Browse Source

fix(video): remove deprecated modestbranding option from YouTube videos (#6815)

* fix(video): remove deprecated modestbranding option from YouTube videos

- Remove modestbranding property from default component traits
- Remove modestbranding parameter parsing from YouTube URL query string handling
- Remove modestbranding checkbox trait from component configuration
- Remove modestbranding URL parameter generation from getYoutubeSrc method
- Update ComponentVideoView to stop listening for modestbranding change events
- The modestbranding option was deprecated by YouTube and is no longer functional

* fix(keymaps): apply prevent option without relying on CanvasView (#6804)

The `prevent` option delegated to `CanvasView.preventDefault`, resolved
through `Canvas.getCanvasView()` with optional chaining, so the default
browser action was silently kept whenever the canvas view was not
available (editor not rendered yet, canvas removed). `Commands`,
`Canvas` and the editor instance were also captured when the keymap was
added instead of when it runs.

Move the prevention to a shared `preventDefault` DOM util, which also
handles the original event of the canvas frame (`_parentEvent`), and
resolve the modules inside the handler.

* build(deps-dev): bump postcss from 8.5.18 to 8.5.23 (#6807)

Bumps [postcss](https://github.com/postcss/postcss) from 8.5.18 to 8.5.23.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.5.18...8.5.23)

---
updated-dependencies:
- dependency-name: postcss
  dependency-version: 8.5.23
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fixes frame (#6809)

* Fix isStyleInFlow

* Fix save restore

* Format

* Release GrapesJS core latest: v0.23.5 (#6812)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Garvish Panchal <85312938+Gxrvish@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artur Arseniev <artur.catch@hotmail.it>
pull/6819/head
Nimit Bhagat 3 days ago
committed by GitHub
parent
commit
baee2e3418
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 9
      packages/core/src/dom_components/model/ComponentVideo.ts
  2. 2
      packages/core/src/dom_components/view/ComponentVideoView.ts

9
packages/core/src/dom_components/model/ComponentVideo.ts

@ -35,7 +35,6 @@ export default class ComponentVideo extends ComponentImage {
list: '',
src: '',
rel: 1, // YT related videos
modestbranding: 0, // YT modest branding
sources: [],
attributes: { allowfullscreen: 'allowfullscreen' },
};
@ -132,7 +131,6 @@ export default class ComponentVideo extends ComponentImage {
parseInt(qr.controls) === 0 && this.set('controls', false);
hasParam(qr.color) && this.set('color', qr.color);
qr.rel === '0' && this.set('rel', 0);
qr.modestbranding === '1' && this.set('modestbranding', 1);
qr.muted === '1' && this.set('muted', true);
break;
default:
@ -256,12 +254,6 @@ export default class ComponentVideo extends ComponentImage {
name: 'rel',
changeProp: true,
},
{
type: 'checkbox',
label: 'Modest',
name: 'modestbranding',
changeProp: true,
},
this.getMutedTrait(),
];
}
@ -364,7 +356,6 @@ export default class ComponentVideo extends ComponentImage {
url += !this.get('controls') ? '&controls=0&showinfo=0' : '';
url += this.get('loop') ? `&loop=1&playlist=${id}` : '';
url += this.get('rel') ? '' : '&rel=0';
url += this.get('modestbranding') ? '&modestbranding=1' : '';
return url;
}

2
packages/core/src/dom_components/view/ComponentVideoView.ts

@ -18,7 +18,7 @@ export default class ComponentVideoView extends ComponentImageView<ComponentVide
// @ts-ignore
ComponentView.prototype.initialize.apply(this, arguments);
const { model } = this;
const props = ['loop', 'autoplay', 'controls', 'color', 'rel', 'modestbranding', 'poster', 'muted'];
const props = ['loop', 'autoplay', 'controls', 'color', 'rel', 'poster', 'muted'];
const events = props.map((p) => `change:${p}`).join(' ');
this.listenTo(model, 'change:provider', this.updateProvider);
this.listenTo(model, 'change:src', this.updateSrc);

Loading…
Cancel
Save