getChildrenDim skips children whose DOM element does not match the itemSel
(e.g. comment nodes rendered as nodeType=8). findPosition returns an index
into the filtered dims array, which was used directly as the model-space
insert index — off by however many children were skipped earlier in the list.
Fix: stamp each Dimension with its unfiltered position (indexEl) in
getChildrenDim, then translate in getDropPosition via
`(dimension.indexEl ?? dimensionIndex)`.
Also guards getDropPosition against the crash that occurred when all
children were filtered (childrenDimensions.length === 0) but the parent
still had model children.
Fixes drops being off-by-N when MSO conditional comment siblings exist
(e.g. content produced by grapesjs-mjml).
- Add support for YouTube's "mute" parameter in video component query parsing
- Maintain backward compatibility with Vimeo's "muted" parameter
- Update condition to check for either qr.mute or qr.muted before setting muted state
- Add clarifying comment explaining parameter difference between platforms
Co-authored-by: Nimit Bhagat <nimit.bhagat@radixweb.com>
* 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>
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.
Removing a component (directly or via replaceWith) left it in the
editor's Selected collection, since only the core:component-delete
command deselected explicitly. The stale entry breaks anything
iterating the selection and, with UndoManager's trackSelection,
lets undo restore a selection pointing at removed components.
Deselect in Components.removeChildren so every non-temporary removal
path is covered. Temporary and undo-driven removals are unaffected.
The stale-target cache in DropLocationDeterminer#getValidParent compared
the current drop-bounds check (container-relative coords) against one
computed from the last mouse event's clientX/clientY (viewport coords),
making the comparison meaningless. On slow drags, where the hovered node
and index stay the same between move samples, the cached target was
returned even after the pointer entered an edge band that should
escalate the target to the parent.
Store the drop-bounds result of each move in lastMoveData and compare
against it, keeping the whole check in a single coordinate space.
Introduced in #6542 (0.22.10).
* Add skipFromStorage support to page and frames
* Add custom wrapper support to frames and refComponent
* Fix Component TS
* Ensure frame reference in components
* Add SelectComponentCommandOptions
* Update runDefault/stopDefault
* Fix component add event with page cloning
* Up TS
fix(parser): don't drop @container/@layer at-rules on CSS parse
The browser CSS parser only recognised nestable at-rules (@container,
@layer, ...) when the CSSOM reported a falsy rule `type`. That happened
to work in Chrome, where the legacy `CSSRule.type` is `0` for newer
at-rules, but engines that expose a real numeric type (jsdom reports
`17` for `CSSContainerRule`) fell through every branch and the whole
rule — selectors, styles and condition — was silently discarded.
Detect nestable at-rules via `getNestableAtRule` regardless of the
numeric `type`. `getNestableAtRule` already matches only when the rule's
`cssText` starts with the exact `@<name>`, so normal style/keyframe
rules are unaffected. The parsed condition keeps the container name and
its query separated by a space, so the exported CSS is valid again
(e.g. `@container somename (min-width: 300px){...}`).
Fixes#5969
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Browsers don't apply the input `accept` attribute to dropped files, so
videos dropped on an image upload zone were uploaded and selectable.
Filter dropped files against `accept` in FileUploader.uploadFile().
Closes#6032
* Initial setup for custom code parser
* Update ParserHtml
* Move methods
* Up
* Move utils
* Fix tests
* Up sanitize
* Up domToParsedNode
* Up fragment node
* Remove node cloning
* Convert ParserHtml to class
* Convert ParserCss to a class
* Update Custom CSS/HTML docs
* Always use isParsedNode if available
* Update API
* Update docs for isParserNode
* Add support for nested CSS rules
* Update undo test
* Cleanup resolutions and TS config
* Update jest
* Normalize tests for the latest jsdom version
* Parse nested CSS rules
* Add hidden test for @page at-rule
* Fix VuePress build
* Up CI nodejs
* Cache list counter
* Skip model resolver when possible
* Clean up Component.getView
* Cleanup SelectComponent
* Update Component getView
* Check in CommandAbstract
* Start data source import policy implementation
* Fix TS
* Update applyImportPolicy
* Up TS naming
* Up test file
* Improve applyImportPolicy
* Add more use cases to data binding import policy tests
* Add support per-call dataBindingImportPolicy
* Up JSDoc
* Fix tests
* Format
* Allow skipping nodes during HTML parsing
* Type canvas events
* Type commands event callbacks
* Type device event callbacks
* Add callback events to i18n
* Add callbacks types to keymaps
* Add callback types to modal
* Add callback types to layers
* Add callback types for pages
* Add callback types to parser
* Add callback type to RTE
* Add callback types to selectors
* Add callback types for storage
* Add callback types to StyleManager
* Add callback types to traits
* Add callback events to Components
* Add callbacks types to editor
* Up types
* Fix API docs generation
* Format