@wordpress/block-editor 12.17.0 → 12.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +32 -0
- package/build/components/block-draggable/index.js +11 -3
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-edit/context.js +3 -1
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/index.js +4 -2
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-editing-mode/index.js +6 -3
- package/build/components/block-editing-mode/index.js.map +1 -1
- package/build/components/block-inspector/index.js +5 -2
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block.js +4 -3
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +9 -5
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +30 -4
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/private-block-context.js +1 -1
- package/build/components/block-list/private-block-context.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +1 -1
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/toolbar.js +8 -2
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-popover/inbetween.js +15 -3
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-preview/auto.js +1 -1
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +3 -2
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +2 -4
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +12 -1
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/index.js +119 -90
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +10 -3
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/dimensions-tool/aspect-ratio-tool.js +2 -1
- package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +7 -1
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/global-styles/border-panel.js +5 -14
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +30 -5
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/effects-panel.js +7 -1
- package/build/components/global-styles/effects-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +11 -8
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +31 -14
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +6 -0
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +99 -0
- package/build/components/iframe/get-compatibility-styles.js.map +1 -0
- package/build/components/iframe/index.js +2 -3
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/index.js +16 -2
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +16 -2
- package/build/components/index.native.js.map +1 -1
- package/build/components/inspector-controls/groups.js +2 -0
- package/build/components/inspector-controls/groups.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +3 -0
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/link-control/link-preview.js +30 -26
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-input.js +1 -9
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/list-view/block-contents.js +3 -1
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block.js +10 -1
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +29 -8
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +100 -32
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/index.js +52 -4
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/leaf.js +2 -2
- package/build/components/list-view/leaf.js.map +1 -1
- package/build/components/list-view/use-list-view-block-indexes.js +30 -0
- package/build/components/list-view/use-list-view-block-indexes.js.map +1 -0
- package/build/components/list-view/use-list-view-drop-zone.js +56 -5
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/list-view/utils.js +92 -0
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/provider/index.js +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/recursion-provider/index.js +21 -0
- package/build/components/recursion-provider/index.js.map +1 -1
- package/build/components/rich-text/index.js +30 -6
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +9 -9
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +30 -7
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +50 -8
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/hooks/block-hooks.js +5 -14
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/content-lock-ui.js +17 -42
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/dimensions.js +71 -1
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/effects.js +66 -0
- package/build/hooks/effects.js.map +1 -0
- package/build/hooks/index.js +17 -4
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +13 -0
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/style.js +9 -2
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +2 -1
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.native.js +2 -2
- package/build/hooks/typography.native.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +115 -0
- package/build/hooks/use-bindings-attributes.js.map +1 -0
- package/build/hooks/use-shadow-props.js +46 -0
- package/build/hooks/use-shadow-props.js.map +1 -0
- package/build/hooks/utils.js +12 -7
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +14 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +10 -6
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +2 -0
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +37 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +60 -9
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +44 -3
- package/build/store/reducer.js.map +1 -1
- package/build/store/resolvers.js +27 -0
- package/build/store/resolvers.js.map +1 -0
- package/build/store/selectors.js +94 -56
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +5 -26
- package/build/store/utils.js.map +1 -1
- package/build/utils/index.js +0 -16
- package/build/utils/index.js.map +1 -1
- package/build/utils/math.js +13 -0
- package/build/utils/math.js.map +1 -1
- package/build/utils/object.js +17 -0
- package/build/utils/object.js.map +1 -1
- package/build/utils/transform-styles/index.js +37 -27
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-draggable/index.js +11 -3
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-edit/context.js +1 -0
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/index.js +5 -3
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-editing-mode/index.js +7 -4
- package/build-module/components/block-editing-mode/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +5 -2
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block.js +6 -5
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +11 -7
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +31 -5
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/private-block-context.js +1 -1
- package/build-module/components/block-list/private-block-context.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +8 -2
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +15 -3
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-preview/auto.js +3 -3
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +3 -2
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -4
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +12 -1
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/index.js +116 -86
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +10 -3
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/dimensions-tool/aspect-ratio-tool.js +2 -1
- package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +7 -1
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +5 -14
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +30 -5
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/effects-panel.js +7 -1
- package/build-module/components/global-styles/effects-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +11 -8
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +32 -15
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +6 -0
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +93 -0
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -0
- package/build-module/components/iframe/index.js +2 -3
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/index.js +1 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inspector-controls/groups.js +2 -0
- package/build-module/components/inspector-controls/groups.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +3 -0
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +32 -28
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-input.js +1 -8
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +3 -1
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block.js +10 -1
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +30 -9
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +99 -32
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/index.js +54 -6
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/leaf.js +2 -2
- package/build-module/components/list-view/leaf.js.map +1 -1
- package/build-module/components/list-view/use-list-view-block-indexes.js +23 -0
- package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -0
- package/build-module/components/list-view/use-list-view-drop-zone.js +58 -7
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/list-view/utils.js +91 -0
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/provider/index.js +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/recursion-provider/index.js +17 -0
- package/build-module/components/recursion-provider/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +30 -6
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +9 -9
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +31 -8
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +51 -9
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/hooks/block-hooks.js +5 -14
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +19 -43
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/dimensions.js +70 -2
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/effects.js +51 -0
- package/build-module/hooks/effects.js.map +1 -0
- package/build-module/hooks/index.js +5 -3
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +1 -0
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/style.js +9 -2
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +2 -1
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.native.js +2 -2
- package/build-module/hooks/typography.native.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +112 -0
- package/build-module/hooks/use-bindings-attributes.js.map +1 -0
- package/build-module/hooks/use-shadow-props.js +39 -0
- package/build-module/hooks/use-shadow-props.js.map +1 -0
- package/build-module/hooks/utils.js +14 -9
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +10 -6
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +2 -0
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +35 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +53 -8
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +43 -3
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/resolvers.js +20 -0
- package/build-module/store/resolvers.js.map +1 -0
- package/build-module/store/selectors.js +89 -52
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +3 -23
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/index.js +0 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/math.js +12 -0
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/object.js +16 -0
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +36 -27
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +33 -16
- package/build-style/content.css +33 -16
- package/build-style/default-editor-styles-rtl.css +1 -1
- package/build-style/default-editor-styles.css +1 -1
- package/build-style/style-rtl.css +169 -114
- package/build-style/style.css +169 -114
- package/package.json +31 -31
- package/src/components/block-canvas/style.scss +8 -1
- package/src/components/block-draggable/index.js +16 -5
- package/src/components/block-edit/context.js +1 -0
- package/src/components/block-edit/index.js +4 -0
- package/src/components/block-editing-mode/index.js +12 -7
- package/src/components/block-inspector/index.js +5 -2
- package/src/components/block-list/block.js +5 -4
- package/src/components/block-list/block.native.js +13 -3
- package/src/components/block-list/content.scss +34 -5
- package/src/components/block-list/index.js +52 -16
- package/src/components/block-list/private-block-context.js +1 -1
- package/src/components/block-list/use-in-between-inserter.js +1 -2
- package/src/components/block-lock/toolbar.js +10 -2
- package/src/components/block-popover/inbetween.js +22 -2
- package/src/components/block-preview/auto.js +3 -3
- package/src/components/block-removal-warning-modal/index.js +3 -2
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -7
- package/src/components/block-switcher/block-transformations-menu.js +18 -1
- package/src/components/block-switcher/index.js +133 -111
- package/src/components/block-switcher/style.scss +6 -4
- package/src/components/block-switcher/test/index.js +113 -230
- package/src/components/block-toolbar/style.scss +22 -18
- package/src/components/block-tools/insertion-point.js +15 -2
- package/src/components/block-tools/style.scss +8 -7
- package/src/components/dimensions-tool/aspect-ratio-tool.js +4 -1
- package/src/components/font-sizes/fluid-utils.js +8 -2
- package/src/components/font-sizes/test/fluid-utils.js +9 -0
- package/src/components/global-styles/border-panel.js +7 -17
- package/src/components/global-styles/dimensions-panel.js +50 -1
- package/src/components/global-styles/effects-panel.js +16 -1
- package/src/components/global-styles/hooks.js +11 -6
- package/src/components/global-styles/typography-panel.js +45 -13
- package/src/components/global-styles/use-global-styles-output.js +6 -0
- package/src/components/iframe/get-compatibility-styles.js +120 -0
- package/src/components/iframe/index.js +2 -3
- package/src/components/index.js +4 -2
- package/src/components/index.native.js +4 -2
- package/src/components/inspector-controls/groups.js +2 -0
- package/src/components/inspector-controls-tabs/styles-tab.js +1 -0
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +2 -0
- package/src/components/link-control/link-preview.js +31 -55
- package/src/components/link-control/search-input.js +1 -9
- package/src/components/link-control/style.scss +31 -85
- package/src/components/link-control/test/index.js +2 -1
- package/src/components/list-view/block-contents.js +5 -1
- package/src/components/list-view/block.js +9 -0
- package/src/components/list-view/branch.js +30 -10
- package/src/components/list-view/drop-indicator.js +139 -46
- package/src/components/list-view/index.js +74 -3
- package/src/components/list-view/leaf.js +2 -2
- package/src/components/list-view/style.scss +102 -13
- package/src/components/list-view/test/use-list-view-drop-zone.js +4 -0
- package/src/components/list-view/test/utils.js +218 -1
- package/src/components/list-view/use-list-view-block-indexes.js +29 -0
- package/src/components/list-view/use-list-view-drop-zone.js +78 -6
- package/src/components/list-view/utils.js +116 -0
- package/src/components/provider/index.js +3 -1
- package/src/components/recursion-provider/README.md +2 -2
- package/src/components/recursion-provider/index.js +17 -0
- package/src/components/rich-text/index.js +48 -10
- package/src/components/rich-text/native/index.native.js +10 -10
- package/src/components/use-block-drop-zone/index.js +60 -19
- package/src/components/use-block-drop-zone/test/index.js +32 -61
- package/src/components/use-on-block-drop/index.js +92 -11
- package/src/hooks/block-hooks.js +5 -17
- package/src/hooks/content-lock-ui.js +15 -55
- package/src/hooks/dimensions.js +74 -3
- package/src/hooks/effects.js +57 -0
- package/src/hooks/index.js +4 -2
- package/src/hooks/index.native.js +1 -0
- package/src/hooks/style.js +12 -0
- package/src/hooks/supports.js +2 -0
- package/src/hooks/test/effects.js +39 -0
- package/src/hooks/typography.native.js +2 -2
- package/src/hooks/use-bindings-attributes.js +148 -0
- package/src/hooks/use-shadow-props.js +37 -0
- package/src/hooks/utils.js +30 -10
- package/src/index.js +2 -0
- package/src/store/actions.js +9 -4
- package/src/store/index.js +2 -0
- package/src/store/private-actions.js +32 -0
- package/src/store/private-selectors.js +78 -21
- package/src/store/reducer.js +49 -2
- package/src/store/resolvers.js +17 -0
- package/src/store/selectors.js +169 -161
- package/src/store/test/registry-selectors.js +431 -0
- package/src/store/test/selectors.js +14 -400
- package/src/store/utils.js +10 -33
- package/src/style.scss +0 -1
- package/src/utils/index.js +0 -1
- package/src/utils/math.js +12 -0
- package/src/utils/object.js +16 -0
- package/src/utils/transform-styles/index.js +52 -37
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/iframe/use-compatibility-styles.js +0 -100
- package/build/components/iframe/use-compatibility-styles.js.map +0 -1
- package/build/hooks/custom-fields.js +0 -106
- package/build/hooks/custom-fields.js.map +0 -1
- package/build/utils/block-variation-transforms.js +0 -42
- package/build/utils/block-variation-transforms.js.map +0 -1
- package/build-module/components/iframe/use-compatibility-styles.js +0 -94
- package/build-module/components/iframe/use-compatibility-styles.js.map +0 -1
- package/build-module/hooks/custom-fields.js +0 -99
- package/build-module/hooks/custom-fields.js.map +0 -1
- package/build-module/utils/block-variation-transforms.js +0 -35
- package/build-module/utils/block-variation-transforms.js.map +0 -1
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +0 -116
- package/src/components/contrast-checker/style.scss +0 -3
- package/src/components/iframe/use-compatibility-styles.js +0 -122
- package/src/hooks/custom-fields.js +0 -115
- package/src/utils/block-variation-transforms.js +0 -38
- package/src/utils/test/block-variation-transforms.js +0 -94
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/scheduler/tracing.d.ts","../../node_modules/@types/react/index.d.ts","../element/build-types/create-interpolate-element.d.ts","../element/build-types/react.d.ts","../../node_modules/@types/react-dom/index.d.ts","../../node_modules/@types/react-dom/client.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/components/block-context/index.js","./src/utils/dom.js"],"fileInfos":[{"version":"f59215c5f1d886b05395ee7aca73e0ac69ddfad2843aa88530e797879d511bad","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","f4e736d6c8d69ae5b3ab0ddfcaa3dc365c3e76909d6660af5b4e979b3934ac20","eeeb3aca31fbadef8b82502484499dfd1757204799a6f5b33116201c810676ec",{"version":"3dda5344576193a4ae48b8d03f105c86f20b2f2aff0a1d1fd7935f5d68649654","affectsGlobalScope":true},{"version":"9d9885c728913c1d16e0d2831b40341d6ad9a0ceecaabc55209b306ad9c736a5","affectsGlobalScope":true},{"version":"17bea081b9c0541f39dd1ae9bc8c78bdd561879a682e60e2f25f688c0ecab248","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"f06948deb2a51aae25184561c9640fb66afeddb34531a9212d011792b1d19e0a","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"61ed9b6d07af959e745fb11f9593ecd743b279418cc8a99448ea3cd5f3b3eb22","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"25de46552b782d43cb7284df22fe2a265de387cf0248b747a7a1b647d81861f6","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"5917af4ff931b050dba49a1dedd9c00f15f7b3dc4345ad8491bfacd2ec68ed32","affectsGlobalScope":true},"0c1c79ce1b4c085adce94f17891812ee1a8b76fc1de63dd0d9d80ea34034f389","470509b95e55f314470599d05bd8600eaf3c7bd10d35c94eea5f1ae3139a2bae","e4dd91dd4789a109aab51d8a0569a282369fcda9ba6f2b2297bc61bacfb1a042","83e27bbd7304ea67f9afa1535f1d4fdb15866089f0d893c784cbb5b1c6fb3386","472c14cdec534a465e866b6e1feee2d4e0d89c15fdc33ba80ff034fa0e80f3c1","4d807d55c784b72f71c092c34c84d09b95c29500c30252538fd5cf9a0a788c0e","df43a3968118d4b16618d7a0ac8ba89337fcce3c39e39984087ac34bf0cf250c","7f2497d56947331a6705c6c8d099b173d6fa7b90f5110c190cbca5cae1f3a09c","582f001c48a6204fd6bb5c6c71b36adc5256078c0ac3686b99db59cbb724ca73","af88a0b0f808a6721401550621bfe67c46c6fd55000305058e7c73600d119a9b",{"version":"0a41b61ddcb640fa2a07cb7a04ecddf540b8199f70d3cf5f2d8903be722529eb","signature":"4b7a879cde76a92dc90518ea30784dc4737a9088b19ce8b3e6e52ca88d79fdd9"},{"version":"4e8c59b6c243b9148b72d7428c71592176a520225ee91b718f4a655a5baf6624","signature":"5120315643470468a3955abbc6f5669c5314f62f237825a2930ede632739ff58"}],"root":[76,77],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[65],[61,62,63,64],[65,75],[66,67,70,71,72,73,74],[68,69]],"referencedMap":[[69,1],[68,1],[65,2],[76,3],[66,1],[75,4],[74,1],[70,5],[67,1],[73,1]],"exportedModulesMap":[[69,1],[68,1],[65,2],[76,1],[66,1],[75,4],[74,1],[70,5],[67,1],[73,1]],"semanticDiagnosticsPerFile":[63,69,68,61,65,64,62,59,60,12,14,13,2,15,16,17,18,19,20,21,22,3,4,26,23,24,25,27,28,29,5,30,31,32,33,6,37,34,35,36,38,7,39,44,45,40,41,42,43,8,49,46,47,48,50,9,51,52,53,56,54,55,57,10,1,11,58,76,77,66,75,72,74,70,67,73,71],"latestChangedDtsFile":"./build-types/utils/dom.d.ts"},"version":"5.1.6"}
|
|
1
|
+
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/scheduler/tracing.d.ts","../../node_modules/@types/react/index.d.ts","../element/build-types/create-interpolate-element.d.ts","../element/build-types/react.d.ts","../../node_modules/@types/react-dom/index.d.ts","../../node_modules/@types/react-dom/client.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/components/block-context/index.js","./src/utils/dom.js"],"fileInfos":[{"version":"f59215c5f1d886b05395ee7aca73e0ac69ddfad2843aa88530e797879d511bad","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","f4e736d6c8d69ae5b3ab0ddfcaa3dc365c3e76909d6660af5b4e979b3934ac20","eeeb3aca31fbadef8b82502484499dfd1757204799a6f5b33116201c810676ec",{"version":"3dda5344576193a4ae48b8d03f105c86f20b2f2aff0a1d1fd7935f5d68649654","affectsGlobalScope":true},{"version":"9d9885c728913c1d16e0d2831b40341d6ad9a0ceecaabc55209b306ad9c736a5","affectsGlobalScope":true},{"version":"17bea081b9c0541f39dd1ae9bc8c78bdd561879a682e60e2f25f688c0ecab248","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"f06948deb2a51aae25184561c9640fb66afeddb34531a9212d011792b1d19e0a","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"61ed9b6d07af959e745fb11f9593ecd743b279418cc8a99448ea3cd5f3b3eb22","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"25de46552b782d43cb7284df22fe2a265de387cf0248b747a7a1b647d81861f6","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"5917af4ff931b050dba49a1dedd9c00f15f7b3dc4345ad8491bfacd2ec68ed32","affectsGlobalScope":true},"0c1c79ce1b4c085adce94f17891812ee1a8b76fc1de63dd0d9d80ea34034f389","85abb794f600fbd798f9bc50e51771a9152b7e5ad611a95fceac020efd0a0bd4","e4dd91dd4789a109aab51d8a0569a282369fcda9ba6f2b2297bc61bacfb1a042","83e27bbd7304ea67f9afa1535f1d4fdb15866089f0d893c784cbb5b1c6fb3386","472c14cdec534a465e866b6e1feee2d4e0d89c15fdc33ba80ff034fa0e80f3c1","4d807d55c784b72f71c092c34c84d09b95c29500c30252538fd5cf9a0a788c0e","df43a3968118d4b16618d7a0ac8ba89337fcce3c39e39984087ac34bf0cf250c","7f2497d56947331a6705c6c8d099b173d6fa7b90f5110c190cbca5cae1f3a09c","582f001c48a6204fd6bb5c6c71b36adc5256078c0ac3686b99db59cbb724ca73","af88a0b0f808a6721401550621bfe67c46c6fd55000305058e7c73600d119a9b",{"version":"0a41b61ddcb640fa2a07cb7a04ecddf540b8199f70d3cf5f2d8903be722529eb","signature":"4b7a879cde76a92dc90518ea30784dc4737a9088b19ce8b3e6e52ca88d79fdd9"},{"version":"4e8c59b6c243b9148b72d7428c71592176a520225ee91b718f4a655a5baf6624","signature":"5120315643470468a3955abbc6f5669c5314f62f237825a2930ede632739ff58"}],"root":[76,77],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[65],[61,62,63,64],[65,75],[66,67,70,71,72,73,74],[68,69]],"referencedMap":[[69,1],[68,1],[65,2],[76,3],[66,1],[75,4],[74,1],[70,5],[67,1],[73,1]],"exportedModulesMap":[[69,1],[68,1],[65,2],[76,1],[66,1],[75,4],[74,1],[70,5],[67,1],[73,1]],"semanticDiagnosticsPerFile":[63,69,68,61,65,64,62,59,60,12,14,13,2,15,16,17,18,19,20,21,22,3,4,26,23,24,25,27,28,29,5,30,31,32,33,6,37,34,35,36,38,7,39,44,45,40,41,42,43,8,49,46,47,48,50,9,51,52,53,56,54,55,57,10,1,11,58,76,77,66,75,72,74,70,67,73,71],"latestChangedDtsFile":"./build-types/utils/dom.d.ts"},"version":"5.1.6"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useCompatibilityStyles = useCompatibilityStyles;
|
|
7
|
-
var _element = require("@wordpress/element");
|
|
8
|
-
/**
|
|
9
|
-
* WordPress dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Returns a list of stylesheets that target the editor canvas. A stylesheet is
|
|
14
|
-
* considered targetting the editor a canvas if it contains the
|
|
15
|
-
* `editor-styles-wrapper`, `wp-block`, or `wp-block-*` class selectors.
|
|
16
|
-
*
|
|
17
|
-
* Ideally, this hook should be removed in the future and styles should be added
|
|
18
|
-
* explicitly as editor styles.
|
|
19
|
-
*/
|
|
20
|
-
function useCompatibilityStyles() {
|
|
21
|
-
// Only memoize the result once on load, since these stylesheets should not
|
|
22
|
-
// change.
|
|
23
|
-
return (0, _element.useMemo)(() => {
|
|
24
|
-
// Search the document for stylesheets targetting the editor canvas.
|
|
25
|
-
return Array.from(document.styleSheets).reduce((accumulator, styleSheet) => {
|
|
26
|
-
try {
|
|
27
|
-
// May fail for external styles.
|
|
28
|
-
// eslint-disable-next-line no-unused-expressions
|
|
29
|
-
styleSheet.cssRules;
|
|
30
|
-
} catch (e) {
|
|
31
|
-
return accumulator;
|
|
32
|
-
}
|
|
33
|
-
const {
|
|
34
|
-
ownerNode,
|
|
35
|
-
cssRules
|
|
36
|
-
} = styleSheet;
|
|
37
|
-
|
|
38
|
-
// Stylesheet is added by another stylesheet. See
|
|
39
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet/ownerNode#notes.
|
|
40
|
-
if (ownerNode === null) {
|
|
41
|
-
return accumulator;
|
|
42
|
-
}
|
|
43
|
-
if (!cssRules) {
|
|
44
|
-
return accumulator;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Don't try to add the reset styles, which were removed as a dependency
|
|
48
|
-
// from `edit-blocks` for the iframe since we don't need to reset admin
|
|
49
|
-
// styles.
|
|
50
|
-
if (ownerNode.id === 'wp-reset-editor-styles-css') {
|
|
51
|
-
return accumulator;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Don't try to add styles without ID. Styles enqueued via the WP dependency system will always have IDs.
|
|
55
|
-
if (!ownerNode.id) {
|
|
56
|
-
return accumulator;
|
|
57
|
-
}
|
|
58
|
-
function matchFromRules(_cssRules) {
|
|
59
|
-
return Array.from(_cssRules).find(({
|
|
60
|
-
selectorText,
|
|
61
|
-
conditionText,
|
|
62
|
-
cssRules: __cssRules
|
|
63
|
-
}) => {
|
|
64
|
-
// If the rule is conditional then it will not have selector text.
|
|
65
|
-
// Recurse into child CSS ruleset to determine selector eligibility.
|
|
66
|
-
if (conditionText) {
|
|
67
|
-
return matchFromRules(__cssRules);
|
|
68
|
-
}
|
|
69
|
-
return selectorText && (selectorText.includes('.editor-styles-wrapper') || selectorText.includes('.wp-block'));
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
if (matchFromRules(cssRules)) {
|
|
73
|
-
const isInline = ownerNode.tagName === 'STYLE';
|
|
74
|
-
if (isInline) {
|
|
75
|
-
// If the current target is inline,
|
|
76
|
-
// it could be a dependency of an existing stylesheet.
|
|
77
|
-
// Look for that dependency and add it BEFORE the current target.
|
|
78
|
-
const mainStylesCssId = ownerNode.id.replace('-inline-css', '-css');
|
|
79
|
-
const mainStylesElement = document.getElementById(mainStylesCssId);
|
|
80
|
-
if (mainStylesElement) {
|
|
81
|
-
accumulator.push(mainStylesElement.cloneNode(true));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
accumulator.push(ownerNode.cloneNode(true));
|
|
85
|
-
if (!isInline) {
|
|
86
|
-
// If the current target is not inline,
|
|
87
|
-
// we still look for inline styles that could be relevant for the current target.
|
|
88
|
-
// If they exist, add them AFTER the current target.
|
|
89
|
-
const inlineStylesCssId = ownerNode.id.replace('-css', '-inline-css');
|
|
90
|
-
const inlineStylesElement = document.getElementById(inlineStylesCssId);
|
|
91
|
-
if (inlineStylesElement) {
|
|
92
|
-
accumulator.push(inlineStylesElement.cloneNode(true));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return accumulator;
|
|
97
|
-
}, []);
|
|
98
|
-
}, []);
|
|
99
|
-
}
|
|
100
|
-
//# sourceMappingURL=use-compatibility-styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","useCompatibilityStyles","useMemo","Array","from","document","styleSheets","reduce","accumulator","styleSheet","cssRules","e","ownerNode","id","matchFromRules","_cssRules","find","selectorText","conditionText","__cssRules","includes","isInline","tagName","mainStylesCssId","replace","mainStylesElement","getElementById","push","cloneNode","inlineStylesCssId","inlineStylesElement"],"sources":["@wordpress/block-editor/src/components/iframe/use-compatibility-styles.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Returns a list of stylesheets that target the editor canvas. A stylesheet is\n * considered targetting the editor a canvas if it contains the\n * `editor-styles-wrapper`, `wp-block`, or `wp-block-*` class selectors.\n *\n * Ideally, this hook should be removed in the future and styles should be added\n * explicitly as editor styles.\n */\nexport function useCompatibilityStyles() {\n\t// Only memoize the result once on load, since these stylesheets should not\n\t// change.\n\treturn useMemo( () => {\n\t\t// Search the document for stylesheets targetting the editor canvas.\n\t\treturn Array.from( document.styleSheets ).reduce(\n\t\t\t( accumulator, styleSheet ) => {\n\t\t\t\ttry {\n\t\t\t\t\t// May fail for external styles.\n\t\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\t\tstyleSheet.cssRules;\n\t\t\t\t} catch ( e ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\tconst { ownerNode, cssRules } = styleSheet;\n\n\t\t\t\t// Stylesheet is added by another stylesheet. See\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet/ownerNode#notes.\n\t\t\t\tif ( ownerNode === null ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\tif ( ! cssRules ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\t// Don't try to add the reset styles, which were removed as a dependency\n\t\t\t\t// from `edit-blocks` for the iframe since we don't need to reset admin\n\t\t\t\t// styles.\n\t\t\t\tif ( ownerNode.id === 'wp-reset-editor-styles-css' ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\t// Don't try to add styles without ID. Styles enqueued via the WP dependency system will always have IDs.\n\t\t\t\tif ( ! ownerNode.id ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\tfunction matchFromRules( _cssRules ) {\n\t\t\t\t\treturn Array.from( _cssRules ).find(\n\t\t\t\t\t\t( {\n\t\t\t\t\t\t\tselectorText,\n\t\t\t\t\t\t\tconditionText,\n\t\t\t\t\t\t\tcssRules: __cssRules,\n\t\t\t\t\t\t} ) => {\n\t\t\t\t\t\t\t// If the rule is conditional then it will not have selector text.\n\t\t\t\t\t\t\t// Recurse into child CSS ruleset to determine selector eligibility.\n\t\t\t\t\t\t\tif ( conditionText ) {\n\t\t\t\t\t\t\t\treturn matchFromRules( __cssRules );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\tselectorText &&\n\t\t\t\t\t\t\t\t( selectorText.includes(\n\t\t\t\t\t\t\t\t\t'.editor-styles-wrapper'\n\t\t\t\t\t\t\t\t) ||\n\t\t\t\t\t\t\t\t\tselectorText.includes( '.wp-block' ) )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( matchFromRules( cssRules ) ) {\n\t\t\t\t\tconst isInline = ownerNode.tagName === 'STYLE';\n\n\t\t\t\t\tif ( isInline ) {\n\t\t\t\t\t\t// If the current target is inline,\n\t\t\t\t\t\t// it could be a dependency of an existing stylesheet.\n\t\t\t\t\t\t// Look for that dependency and add it BEFORE the current target.\n\t\t\t\t\t\tconst mainStylesCssId = ownerNode.id.replace(\n\t\t\t\t\t\t\t'-inline-css',\n\t\t\t\t\t\t\t'-css'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst mainStylesElement =\n\t\t\t\t\t\t\tdocument.getElementById( mainStylesCssId );\n\t\t\t\t\t\tif ( mainStylesElement ) {\n\t\t\t\t\t\t\taccumulator.push(\n\t\t\t\t\t\t\t\tmainStylesElement.cloneNode( true )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\taccumulator.push( ownerNode.cloneNode( true ) );\n\n\t\t\t\t\tif ( ! isInline ) {\n\t\t\t\t\t\t// If the current target is not inline,\n\t\t\t\t\t\t// we still look for inline styles that could be relevant for the current target.\n\t\t\t\t\t\t// If they exist, add them AFTER the current target.\n\t\t\t\t\t\tconst inlineStylesCssId = ownerNode.id.replace(\n\t\t\t\t\t\t\t'-css',\n\t\t\t\t\t\t\t'-inline-css'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst inlineStylesElement =\n\t\t\t\t\t\t\tdocument.getElementById( inlineStylesCssId );\n\t\t\t\t\t\tif ( inlineStylesElement ) {\n\t\t\t\t\t\t\taccumulator.push(\n\t\t\t\t\t\t\t\tinlineStylesElement.cloneNode( true )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn accumulator;\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,sBAAsBA,CAAA,EAAG;EACxC;EACA;EACA,OAAO,IAAAC,gBAAO,EAAE,MAAM;IACrB;IACA,OAAOC,KAAK,CAACC,IAAI,CAAEC,QAAQ,CAACC,WAAY,CAAC,CAACC,MAAM,CAC/C,CAAEC,WAAW,EAAEC,UAAU,KAAM;MAC9B,IAAI;QACH;QACA;QACAA,UAAU,CAACC,QAAQ;MACpB,CAAC,CAAC,OAAQC,CAAC,EAAG;QACb,OAAOH,WAAW;MACnB;MAEA,MAAM;QAAEI,SAAS;QAAEF;MAAS,CAAC,GAAGD,UAAU;;MAE1C;MACA;MACA,IAAKG,SAAS,KAAK,IAAI,EAAG;QACzB,OAAOJ,WAAW;MACnB;MAEA,IAAK,CAAEE,QAAQ,EAAG;QACjB,OAAOF,WAAW;MACnB;;MAEA;MACA;MACA;MACA,IAAKI,SAAS,CAACC,EAAE,KAAK,4BAA4B,EAAG;QACpD,OAAOL,WAAW;MACnB;;MAEA;MACA,IAAK,CAAEI,SAAS,CAACC,EAAE,EAAG;QACrB,OAAOL,WAAW;MACnB;MAEA,SAASM,cAAcA,CAAEC,SAAS,EAAG;QACpC,OAAOZ,KAAK,CAACC,IAAI,CAAEW,SAAU,CAAC,CAACC,IAAI,CAClC,CAAE;UACDC,YAAY;UACZC,aAAa;UACbR,QAAQ,EAAES;QACX,CAAC,KAAM;UACN;UACA;UACA,IAAKD,aAAa,EAAG;YACpB,OAAOJ,cAAc,CAAEK,UAAW,CAAC;UACpC;UAEA,OACCF,YAAY,KACVA,YAAY,CAACG,QAAQ,CACtB,wBACD,CAAC,IACAH,YAAY,CAACG,QAAQ,CAAE,WAAY,CAAC,CAAE;QAEzC,CACD,CAAC;MACF;MAEA,IAAKN,cAAc,CAAEJ,QAAS,CAAC,EAAG;QACjC,MAAMW,QAAQ,GAAGT,SAAS,CAACU,OAAO,KAAK,OAAO;QAE9C,IAAKD,QAAQ,EAAG;UACf;UACA;UACA;UACA,MAAME,eAAe,GAAGX,SAAS,CAACC,EAAE,CAACW,OAAO,CAC3C,aAAa,EACb,MACD,CAAC;UACD,MAAMC,iBAAiB,GACtBpB,QAAQ,CAACqB,cAAc,CAAEH,eAAgB,CAAC;UAC3C,IAAKE,iBAAiB,EAAG;YACxBjB,WAAW,CAACmB,IAAI,CACfF,iBAAiB,CAACG,SAAS,CAAE,IAAK,CACnC,CAAC;UACF;QACD;QAEApB,WAAW,CAACmB,IAAI,CAAEf,SAAS,CAACgB,SAAS,CAAE,IAAK,CAAE,CAAC;QAE/C,IAAK,CAAEP,QAAQ,EAAG;UACjB;UACA;UACA;UACA,MAAMQ,iBAAiB,GAAGjB,SAAS,CAACC,EAAE,CAACW,OAAO,CAC7C,MAAM,EACN,aACD,CAAC;UACD,MAAMM,mBAAmB,GACxBzB,QAAQ,CAACqB,cAAc,CAAEG,iBAAkB,CAAC;UAC7C,IAAKC,mBAAmB,EAAG;YAC1BtB,WAAW,CAACmB,IAAI,CACfG,mBAAmB,CAACF,SAAS,CAAE,IAAK,CACrC,CAAC;UACF;QACD;MACD;MAEA,OAAOpB,WAAW;IACnB,CAAC,EACD,EACD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _hooks = require("@wordpress/hooks");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
var _i18n = require("@wordpress/i18n");
|
|
11
|
-
var _blocks = require("@wordpress/blocks");
|
|
12
|
-
var _components2 = require("../components");
|
|
13
|
-
var _blockEditingMode = require("../components/block-editing-mode");
|
|
14
|
-
/**
|
|
15
|
-
* WordPress dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Filters registered block settings, extending attributes to include `connections`.
|
|
24
|
-
*
|
|
25
|
-
* @param {Object} settings Original block settings.
|
|
26
|
-
*
|
|
27
|
-
* @return {Object} Filtered block settings.
|
|
28
|
-
*/
|
|
29
|
-
function addAttribute(settings) {
|
|
30
|
-
if ((0, _blocks.hasBlockSupport)(settings, '__experimentalConnections', true)) {
|
|
31
|
-
// Gracefully handle if settings.attributes.connections is undefined.
|
|
32
|
-
settings.attributes = {
|
|
33
|
-
...settings.attributes,
|
|
34
|
-
connections: {
|
|
35
|
-
type: 'object'
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
return settings;
|
|
40
|
-
}
|
|
41
|
-
function CustomFieldsControlPure({
|
|
42
|
-
name,
|
|
43
|
-
connections,
|
|
44
|
-
setAttributes
|
|
45
|
-
}) {
|
|
46
|
-
const blockEditingMode = (0, _blockEditingMode.useBlockEditingMode)();
|
|
47
|
-
if (blockEditingMode !== 'default') {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// If the block is a paragraph or image block, we need to know which
|
|
52
|
-
// attribute to use for the connection. Only the `content` attribute
|
|
53
|
-
// of the paragraph block and the `url` attribute of the image block are supported.
|
|
54
|
-
let attributeName;
|
|
55
|
-
if (name === 'core/paragraph') attributeName = 'content';
|
|
56
|
-
if (name === 'core/image') attributeName = 'url';
|
|
57
|
-
return (0, _react.createElement)(_components2.InspectorControls, null, (0, _react.createElement)(_components.PanelBody, {
|
|
58
|
-
title: (0, _i18n.__)('Connections'),
|
|
59
|
-
initialOpen: true
|
|
60
|
-
}, (0, _react.createElement)(_components.TextControl, {
|
|
61
|
-
__nextHasNoMarginBottom: true,
|
|
62
|
-
autoComplete: "off",
|
|
63
|
-
label: (0, _i18n.__)('Custom field meta_key'),
|
|
64
|
-
value: connections?.attributes?.[attributeName]?.value || '',
|
|
65
|
-
onChange: nextValue => {
|
|
66
|
-
if (nextValue === '') {
|
|
67
|
-
setAttributes({
|
|
68
|
-
connections: undefined,
|
|
69
|
-
[attributeName]: undefined,
|
|
70
|
-
placeholder: undefined
|
|
71
|
-
});
|
|
72
|
-
} else {
|
|
73
|
-
setAttributes({
|
|
74
|
-
connections: {
|
|
75
|
-
attributes: {
|
|
76
|
-
// The attributeName will be either `content` or `url`.
|
|
77
|
-
[attributeName]: {
|
|
78
|
-
// Source will be variable, could be post_meta, user_meta, term_meta, etc.
|
|
79
|
-
// Could even be a custom source like a social media attribute.
|
|
80
|
-
source: 'meta_fields',
|
|
81
|
-
value: nextValue
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
[attributeName]: undefined,
|
|
86
|
-
placeholder: (0, _i18n.sprintf)('This content will be replaced on the frontend by the value of "%s" custom field.', nextValue)
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
})));
|
|
91
|
-
}
|
|
92
|
-
var _default = {
|
|
93
|
-
edit: CustomFieldsControlPure,
|
|
94
|
-
attributeKeys: ['connections'],
|
|
95
|
-
hasSupport(name) {
|
|
96
|
-
return (0, _blocks.hasBlockSupport)(name, '__experimentalConnections', false) &&
|
|
97
|
-
// Check if the current block is a paragraph or image block.
|
|
98
|
-
// Currently, only these two blocks are supported.
|
|
99
|
-
['core/paragraph', 'core/image'].includes(name);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
exports.default = _default;
|
|
103
|
-
if (window.__experimentalConnections || window.__experimentalPatternPartialSyncing) {
|
|
104
|
-
(0, _hooks.addFilter)('blocks.registerBlockType', 'core/editor/connections/attribute', addAttribute);
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=custom-fields.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_hooks","require","_components","_i18n","_blocks","_components2","_blockEditingMode","addAttribute","settings","hasBlockSupport","attributes","connections","type","CustomFieldsControlPure","name","setAttributes","blockEditingMode","useBlockEditingMode","attributeName","_react","createElement","InspectorControls","PanelBody","title","__","initialOpen","TextControl","__nextHasNoMarginBottom","autoComplete","label","value","onChange","nextValue","undefined","placeholder","source","sprintf","_default","edit","attributeKeys","hasSupport","includes","exports","default","window","__experimentalConnections","__experimentalPatternPartialSyncing","addFilter"],"sources":["@wordpress/block-editor/src/hooks/custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { PanelBody, TextControl } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { InspectorControls } from '../components';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\n/**\n * Filters registered block settings, extending attributes to include `connections`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( hasBlockSupport( settings, '__experimentalConnections', true ) ) {\n\t\t// Gracefully handle if settings.attributes.connections is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tconnections: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction CustomFieldsControlPure( { name, connections, setAttributes } ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\t// If the block is a paragraph or image block, we need to know which\n\t// attribute to use for the connection. Only the `content` attribute\n\t// of the paragraph block and the `url` attribute of the image block are supported.\n\tlet attributeName;\n\tif ( name === 'core/paragraph' ) attributeName = 'content';\n\tif ( name === 'core/image' ) attributeName = 'url';\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Connections' ) } initialOpen={ true }>\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tlabel={ __( 'Custom field meta_key' ) }\n\t\t\t\t\tvalue={\n\t\t\t\t\t\tconnections?.attributes?.[ attributeName ]?.value || ''\n\t\t\t\t\t}\n\t\t\t\t\tonChange={ ( nextValue ) => {\n\t\t\t\t\t\tif ( nextValue === '' ) {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tconnections: undefined,\n\t\t\t\t\t\t\t\t[ attributeName ]: undefined,\n\t\t\t\t\t\t\t\tplaceholder: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tconnections: {\n\t\t\t\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\t\t\t\t// The attributeName will be either `content` or `url`.\n\t\t\t\t\t\t\t\t\t\t[ attributeName ]: {\n\t\t\t\t\t\t\t\t\t\t\t// Source will be variable, could be post_meta, user_meta, term_meta, etc.\n\t\t\t\t\t\t\t\t\t\t\t// Could even be a custom source like a social media attribute.\n\t\t\t\t\t\t\t\t\t\t\tsource: 'meta_fields',\n\t\t\t\t\t\t\t\t\t\t\tvalue: nextValue,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t[ attributeName ]: undefined,\n\t\t\t\t\t\t\t\tplaceholder: sprintf(\n\t\t\t\t\t\t\t\t\t'This content will be replaced on the frontend by the value of \"%s\" custom field.',\n\t\t\t\t\t\t\t\t\tnextValue\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n}\n\nexport default {\n\tedit: CustomFieldsControlPure,\n\tattributeKeys: [ 'connections' ],\n\thasSupport( name ) {\n\t\treturn (\n\t\t\thasBlockSupport( name, '__experimentalConnections', false ) &&\n\t\t\t// Check if the current block is a paragraph or image block.\n\t\t\t// Currently, only these two blocks are supported.\n\t\t\t[ 'core/paragraph', 'core/image' ].includes( name )\n\t\t);\n\t},\n};\n\nif (\n\twindow.__experimentalConnections ||\n\twindow.__experimentalPatternPartialSyncing\n) {\n\taddFilter(\n\t\t'blocks.registerBlockType',\n\t\t'core/editor/connections/attribute',\n\t\taddAttribute\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASM,YAAYA,CAAEC,QAAQ,EAAG;EACjC,IAAK,IAAAC,uBAAe,EAAED,QAAQ,EAAE,2BAA2B,EAAE,IAAK,CAAC,EAAG;IACrE;IACAA,QAAQ,CAACE,UAAU,GAAG;MACrB,GAAGF,QAAQ,CAACE,UAAU;MACtBC,WAAW,EAAE;QACZC,IAAI,EAAE;MACP;IACD,CAAC;EACF;EAEA,OAAOJ,QAAQ;AAChB;AAEA,SAASK,uBAAuBA,CAAE;EAAEC,IAAI;EAAEH,WAAW;EAAEI;AAAc,CAAC,EAAG;EACxE,MAAMC,gBAAgB,GAAG,IAAAC,qCAAmB,EAAC,CAAC;EAC9C,IAAKD,gBAAgB,KAAK,SAAS,EAAG;IACrC,OAAO,IAAI;EACZ;;EAEA;EACA;EACA;EACA,IAAIE,aAAa;EACjB,IAAKJ,IAAI,KAAK,gBAAgB,EAAGI,aAAa,GAAG,SAAS;EAC1D,IAAKJ,IAAI,KAAK,YAAY,EAAGI,aAAa,GAAG,KAAK;EAElD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACf,YAAA,CAAAgB,iBAAiB,QACjB,IAAAF,MAAA,CAAAC,aAAA,EAAClB,WAAA,CAAAoB,SAAS;IAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,aAAc,CAAG;IAACC,WAAW,EAAG;EAAM,GAC5D,IAAAN,MAAA,CAAAC,aAAA,EAAClB,WAAA,CAAAwB,WAAW;IACXC,uBAAuB;IACvBC,YAAY,EAAC,KAAK;IAClBC,KAAK,EAAG,IAAAL,QAAE,EAAE,uBAAwB,CAAG;IACvCM,KAAK,EACJnB,WAAW,EAAED,UAAU,GAAIQ,aAAa,CAAE,EAAEY,KAAK,IAAI,EACrD;IACDC,QAAQ,EAAKC,SAAS,IAAM;MAC3B,IAAKA,SAAS,KAAK,EAAE,EAAG;QACvBjB,aAAa,CAAE;UACdJ,WAAW,EAAEsB,SAAS;UACtB,CAAEf,aAAa,GAAIe,SAAS;UAC5BC,WAAW,EAAED;QACd,CAAE,CAAC;MACJ,CAAC,MAAM;QACNlB,aAAa,CAAE;UACdJ,WAAW,EAAE;YACZD,UAAU,EAAE;cACX;cACA,CAAEQ,aAAa,GAAI;gBAClB;gBACA;gBACAiB,MAAM,EAAE,aAAa;gBACrBL,KAAK,EAAEE;cACR;YACD;UACD,CAAC;UACD,CAAEd,aAAa,GAAIe,SAAS;UAC5BC,WAAW,EAAE,IAAAE,aAAO,EACnB,kFAAkF,EAClFJ,SACD;QACD,CAAE,CAAC;MACJ;IACD;EAAG,CACH,CACS,CACO,CAAC;AAEtB;AAAC,IAAAK,QAAA,GAEc;EACdC,IAAI,EAAEzB,uBAAuB;EAC7B0B,aAAa,EAAE,CAAE,aAAa,CAAE;EAChCC,UAAUA,CAAE1B,IAAI,EAAG;IAClB,OACC,IAAAL,uBAAe,EAAEK,IAAI,EAAE,2BAA2B,EAAE,KAAM,CAAC;IAC3D;IACA;IACA,CAAE,gBAAgB,EAAE,YAAY,CAAE,CAAC2B,QAAQ,CAAE3B,IAAK,CAAC;EAErD;AACD,CAAC;AAAA4B,OAAA,CAAAC,OAAA,GAAAN,QAAA;AAED,IACCO,MAAM,CAACC,yBAAyB,IAChCD,MAAM,CAACE,mCAAmC,EACzC;EACD,IAAAC,gBAAS,EACR,0BAA0B,EAC1B,mCAAmC,EACnCxC,YACD,CAAC;AACF"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.__experimentalGetMatchingVariation = void 0;
|
|
7
|
-
/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
|
|
8
|
-
|
|
9
|
-
function matchesAttributes(blockAttributes, variation) {
|
|
10
|
-
return Object.entries(variation).every(([key, value]) => {
|
|
11
|
-
if (typeof value === 'object' && typeof blockAttributes[key] === 'object') {
|
|
12
|
-
return matchesAttributes(blockAttributes[key], value);
|
|
13
|
-
}
|
|
14
|
-
return blockAttributes[key] === value;
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Matches the provided block variations with a block's attributes. If no match
|
|
20
|
-
* or more than one matches are found it returns `undefined`. If a single match is
|
|
21
|
-
* found it returns it.
|
|
22
|
-
*
|
|
23
|
-
* This is a simple implementation for now as it takes into account only the attributes
|
|
24
|
-
* of a block variation and not `InnerBlocks`.
|
|
25
|
-
*
|
|
26
|
-
* @param {Object} blockAttributes - The block attributes to try to find a match.
|
|
27
|
-
* @param {WPBlockVariation[]} variations - A list of block variations to test for a match.
|
|
28
|
-
* @return {WPBlockVariation | undefined} - If a match is found returns it. If not or more than one matches are found returns `undefined`.
|
|
29
|
-
*/
|
|
30
|
-
const __experimentalGetMatchingVariation = (blockAttributes, variations) => {
|
|
31
|
-
if (!variations || !blockAttributes) return;
|
|
32
|
-
const matches = variations.filter(({
|
|
33
|
-
attributes
|
|
34
|
-
}) => {
|
|
35
|
-
if (!attributes || !Object.keys(attributes).length) return false;
|
|
36
|
-
return matchesAttributes(blockAttributes, attributes);
|
|
37
|
-
});
|
|
38
|
-
if (matches.length !== 1) return;
|
|
39
|
-
return matches[0];
|
|
40
|
-
};
|
|
41
|
-
exports.__experimentalGetMatchingVariation = __experimentalGetMatchingVariation;
|
|
42
|
-
//# sourceMappingURL=block-variation-transforms.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["matchesAttributes","blockAttributes","variation","Object","entries","every","key","value","__experimentalGetMatchingVariation","variations","matches","filter","attributes","keys","length","exports"],"sources":["@wordpress/block-editor/src/utils/block-variation-transforms.js"],"sourcesContent":["/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n\nfunction matchesAttributes( blockAttributes, variation ) {\n\treturn Object.entries( variation ).every( ( [ key, value ] ) => {\n\t\tif (\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof blockAttributes[ key ] === 'object'\n\t\t) {\n\t\t\treturn matchesAttributes( blockAttributes[ key ], value );\n\t\t}\n\t\treturn blockAttributes[ key ] === value;\n\t} );\n}\n\n/**\n * Matches the provided block variations with a block's attributes. If no match\n * or more than one matches are found it returns `undefined`. If a single match is\n * found it returns it.\n *\n * This is a simple implementation for now as it takes into account only the attributes\n * of a block variation and not `InnerBlocks`.\n *\n * @param {Object} blockAttributes - The block attributes to try to find a match.\n * @param {WPBlockVariation[]} variations - A list of block variations to test for a match.\n * @return {WPBlockVariation | undefined} - If a match is found returns it. If not or more than one matches are found returns `undefined`.\n */\nexport const __experimentalGetMatchingVariation = (\n\tblockAttributes,\n\tvariations\n) => {\n\tif ( ! variations || ! blockAttributes ) return;\n\tconst matches = variations.filter( ( { attributes } ) => {\n\t\tif ( ! attributes || ! Object.keys( attributes ).length ) return false;\n\t\treturn matchesAttributes( blockAttributes, attributes );\n\t} );\n\tif ( matches.length !== 1 ) return;\n\treturn matches[ 0 ];\n};\n"],"mappings":";;;;;;AAAA;;AAEA,SAASA,iBAAiBA,CAAEC,eAAe,EAAEC,SAAS,EAAG;EACxD,OAAOC,MAAM,CAACC,OAAO,CAAEF,SAAU,CAAC,CAACG,KAAK,CAAE,CAAE,CAAEC,GAAG,EAAEC,KAAK,CAAE,KAAM;IAC/D,IACC,OAAOA,KAAK,KAAK,QAAQ,IACzB,OAAON,eAAe,CAAEK,GAAG,CAAE,KAAK,QAAQ,EACzC;MACD,OAAON,iBAAiB,CAAEC,eAAe,CAAEK,GAAG,CAAE,EAAEC,KAAM,CAAC;IAC1D;IACA,OAAON,eAAe,CAAEK,GAAG,CAAE,KAAKC,KAAK;EACxC,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,kCAAkC,GAAGA,CACjDP,eAAe,EACfQ,UAAU,KACN;EACJ,IAAK,CAAEA,UAAU,IAAI,CAAER,eAAe,EAAG;EACzC,MAAMS,OAAO,GAAGD,UAAU,CAACE,MAAM,CAAE,CAAE;IAAEC;EAAW,CAAC,KAAM;IACxD,IAAK,CAAEA,UAAU,IAAI,CAAET,MAAM,CAACU,IAAI,CAAED,UAAW,CAAC,CAACE,MAAM,EAAG,OAAO,KAAK;IACtE,OAAOd,iBAAiB,CAAEC,eAAe,EAAEW,UAAW,CAAC;EACxD,CAAE,CAAC;EACH,IAAKF,OAAO,CAACI,MAAM,KAAK,CAAC,EAAG;EAC5B,OAAOJ,OAAO,CAAE,CAAC,CAAE;AACpB,CAAC;AAACK,OAAA,CAAAP,kCAAA,GAAAA,kCAAA"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useMemo } from '@wordpress/element';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Returns a list of stylesheets that target the editor canvas. A stylesheet is
|
|
8
|
-
* considered targetting the editor a canvas if it contains the
|
|
9
|
-
* `editor-styles-wrapper`, `wp-block`, or `wp-block-*` class selectors.
|
|
10
|
-
*
|
|
11
|
-
* Ideally, this hook should be removed in the future and styles should be added
|
|
12
|
-
* explicitly as editor styles.
|
|
13
|
-
*/
|
|
14
|
-
export function useCompatibilityStyles() {
|
|
15
|
-
// Only memoize the result once on load, since these stylesheets should not
|
|
16
|
-
// change.
|
|
17
|
-
return useMemo(() => {
|
|
18
|
-
// Search the document for stylesheets targetting the editor canvas.
|
|
19
|
-
return Array.from(document.styleSheets).reduce((accumulator, styleSheet) => {
|
|
20
|
-
try {
|
|
21
|
-
// May fail for external styles.
|
|
22
|
-
// eslint-disable-next-line no-unused-expressions
|
|
23
|
-
styleSheet.cssRules;
|
|
24
|
-
} catch (e) {
|
|
25
|
-
return accumulator;
|
|
26
|
-
}
|
|
27
|
-
const {
|
|
28
|
-
ownerNode,
|
|
29
|
-
cssRules
|
|
30
|
-
} = styleSheet;
|
|
31
|
-
|
|
32
|
-
// Stylesheet is added by another stylesheet. See
|
|
33
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet/ownerNode#notes.
|
|
34
|
-
if (ownerNode === null) {
|
|
35
|
-
return accumulator;
|
|
36
|
-
}
|
|
37
|
-
if (!cssRules) {
|
|
38
|
-
return accumulator;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Don't try to add the reset styles, which were removed as a dependency
|
|
42
|
-
// from `edit-blocks` for the iframe since we don't need to reset admin
|
|
43
|
-
// styles.
|
|
44
|
-
if (ownerNode.id === 'wp-reset-editor-styles-css') {
|
|
45
|
-
return accumulator;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Don't try to add styles without ID. Styles enqueued via the WP dependency system will always have IDs.
|
|
49
|
-
if (!ownerNode.id) {
|
|
50
|
-
return accumulator;
|
|
51
|
-
}
|
|
52
|
-
function matchFromRules(_cssRules) {
|
|
53
|
-
return Array.from(_cssRules).find(({
|
|
54
|
-
selectorText,
|
|
55
|
-
conditionText,
|
|
56
|
-
cssRules: __cssRules
|
|
57
|
-
}) => {
|
|
58
|
-
// If the rule is conditional then it will not have selector text.
|
|
59
|
-
// Recurse into child CSS ruleset to determine selector eligibility.
|
|
60
|
-
if (conditionText) {
|
|
61
|
-
return matchFromRules(__cssRules);
|
|
62
|
-
}
|
|
63
|
-
return selectorText && (selectorText.includes('.editor-styles-wrapper') || selectorText.includes('.wp-block'));
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
if (matchFromRules(cssRules)) {
|
|
67
|
-
const isInline = ownerNode.tagName === 'STYLE';
|
|
68
|
-
if (isInline) {
|
|
69
|
-
// If the current target is inline,
|
|
70
|
-
// it could be a dependency of an existing stylesheet.
|
|
71
|
-
// Look for that dependency and add it BEFORE the current target.
|
|
72
|
-
const mainStylesCssId = ownerNode.id.replace('-inline-css', '-css');
|
|
73
|
-
const mainStylesElement = document.getElementById(mainStylesCssId);
|
|
74
|
-
if (mainStylesElement) {
|
|
75
|
-
accumulator.push(mainStylesElement.cloneNode(true));
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
accumulator.push(ownerNode.cloneNode(true));
|
|
79
|
-
if (!isInline) {
|
|
80
|
-
// If the current target is not inline,
|
|
81
|
-
// we still look for inline styles that could be relevant for the current target.
|
|
82
|
-
// If they exist, add them AFTER the current target.
|
|
83
|
-
const inlineStylesCssId = ownerNode.id.replace('-css', '-inline-css');
|
|
84
|
-
const inlineStylesElement = document.getElementById(inlineStylesCssId);
|
|
85
|
-
if (inlineStylesElement) {
|
|
86
|
-
accumulator.push(inlineStylesElement.cloneNode(true));
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return accumulator;
|
|
91
|
-
}, []);
|
|
92
|
-
}, []);
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=use-compatibility-styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","useCompatibilityStyles","Array","from","document","styleSheets","reduce","accumulator","styleSheet","cssRules","e","ownerNode","id","matchFromRules","_cssRules","find","selectorText","conditionText","__cssRules","includes","isInline","tagName","mainStylesCssId","replace","mainStylesElement","getElementById","push","cloneNode","inlineStylesCssId","inlineStylesElement"],"sources":["@wordpress/block-editor/src/components/iframe/use-compatibility-styles.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Returns a list of stylesheets that target the editor canvas. A stylesheet is\n * considered targetting the editor a canvas if it contains the\n * `editor-styles-wrapper`, `wp-block`, or `wp-block-*` class selectors.\n *\n * Ideally, this hook should be removed in the future and styles should be added\n * explicitly as editor styles.\n */\nexport function useCompatibilityStyles() {\n\t// Only memoize the result once on load, since these stylesheets should not\n\t// change.\n\treturn useMemo( () => {\n\t\t// Search the document for stylesheets targetting the editor canvas.\n\t\treturn Array.from( document.styleSheets ).reduce(\n\t\t\t( accumulator, styleSheet ) => {\n\t\t\t\ttry {\n\t\t\t\t\t// May fail for external styles.\n\t\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\t\tstyleSheet.cssRules;\n\t\t\t\t} catch ( e ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\tconst { ownerNode, cssRules } = styleSheet;\n\n\t\t\t\t// Stylesheet is added by another stylesheet. See\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet/ownerNode#notes.\n\t\t\t\tif ( ownerNode === null ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\tif ( ! cssRules ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\t// Don't try to add the reset styles, which were removed as a dependency\n\t\t\t\t// from `edit-blocks` for the iframe since we don't need to reset admin\n\t\t\t\t// styles.\n\t\t\t\tif ( ownerNode.id === 'wp-reset-editor-styles-css' ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\t// Don't try to add styles without ID. Styles enqueued via the WP dependency system will always have IDs.\n\t\t\t\tif ( ! ownerNode.id ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\tfunction matchFromRules( _cssRules ) {\n\t\t\t\t\treturn Array.from( _cssRules ).find(\n\t\t\t\t\t\t( {\n\t\t\t\t\t\t\tselectorText,\n\t\t\t\t\t\t\tconditionText,\n\t\t\t\t\t\t\tcssRules: __cssRules,\n\t\t\t\t\t\t} ) => {\n\t\t\t\t\t\t\t// If the rule is conditional then it will not have selector text.\n\t\t\t\t\t\t\t// Recurse into child CSS ruleset to determine selector eligibility.\n\t\t\t\t\t\t\tif ( conditionText ) {\n\t\t\t\t\t\t\t\treturn matchFromRules( __cssRules );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\tselectorText &&\n\t\t\t\t\t\t\t\t( selectorText.includes(\n\t\t\t\t\t\t\t\t\t'.editor-styles-wrapper'\n\t\t\t\t\t\t\t\t) ||\n\t\t\t\t\t\t\t\t\tselectorText.includes( '.wp-block' ) )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( matchFromRules( cssRules ) ) {\n\t\t\t\t\tconst isInline = ownerNode.tagName === 'STYLE';\n\n\t\t\t\t\tif ( isInline ) {\n\t\t\t\t\t\t// If the current target is inline,\n\t\t\t\t\t\t// it could be a dependency of an existing stylesheet.\n\t\t\t\t\t\t// Look for that dependency and add it BEFORE the current target.\n\t\t\t\t\t\tconst mainStylesCssId = ownerNode.id.replace(\n\t\t\t\t\t\t\t'-inline-css',\n\t\t\t\t\t\t\t'-css'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst mainStylesElement =\n\t\t\t\t\t\t\tdocument.getElementById( mainStylesCssId );\n\t\t\t\t\t\tif ( mainStylesElement ) {\n\t\t\t\t\t\t\taccumulator.push(\n\t\t\t\t\t\t\t\tmainStylesElement.cloneNode( true )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\taccumulator.push( ownerNode.cloneNode( true ) );\n\n\t\t\t\t\tif ( ! isInline ) {\n\t\t\t\t\t\t// If the current target is not inline,\n\t\t\t\t\t\t// we still look for inline styles that could be relevant for the current target.\n\t\t\t\t\t\t// If they exist, add them AFTER the current target.\n\t\t\t\t\t\tconst inlineStylesCssId = ownerNode.id.replace(\n\t\t\t\t\t\t\t'-css',\n\t\t\t\t\t\t\t'-inline-css'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst inlineStylesElement =\n\t\t\t\t\t\t\tdocument.getElementById( inlineStylesCssId );\n\t\t\t\t\t\tif ( inlineStylesElement ) {\n\t\t\t\t\t\t\taccumulator.push(\n\t\t\t\t\t\t\t\tinlineStylesElement.cloneNode( true )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn accumulator;\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t}, [] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAA,EAAG;EACxC;EACA;EACA,OAAOD,OAAO,CAAE,MAAM;IACrB;IACA,OAAOE,KAAK,CAACC,IAAI,CAAEC,QAAQ,CAACC,WAAY,CAAC,CAACC,MAAM,CAC/C,CAAEC,WAAW,EAAEC,UAAU,KAAM;MAC9B,IAAI;QACH;QACA;QACAA,UAAU,CAACC,QAAQ;MACpB,CAAC,CAAC,OAAQC,CAAC,EAAG;QACb,OAAOH,WAAW;MACnB;MAEA,MAAM;QAAEI,SAAS;QAAEF;MAAS,CAAC,GAAGD,UAAU;;MAE1C;MACA;MACA,IAAKG,SAAS,KAAK,IAAI,EAAG;QACzB,OAAOJ,WAAW;MACnB;MAEA,IAAK,CAAEE,QAAQ,EAAG;QACjB,OAAOF,WAAW;MACnB;;MAEA;MACA;MACA;MACA,IAAKI,SAAS,CAACC,EAAE,KAAK,4BAA4B,EAAG;QACpD,OAAOL,WAAW;MACnB;;MAEA;MACA,IAAK,CAAEI,SAAS,CAACC,EAAE,EAAG;QACrB,OAAOL,WAAW;MACnB;MAEA,SAASM,cAAcA,CAAEC,SAAS,EAAG;QACpC,OAAOZ,KAAK,CAACC,IAAI,CAAEW,SAAU,CAAC,CAACC,IAAI,CAClC,CAAE;UACDC,YAAY;UACZC,aAAa;UACbR,QAAQ,EAAES;QACX,CAAC,KAAM;UACN;UACA;UACA,IAAKD,aAAa,EAAG;YACpB,OAAOJ,cAAc,CAAEK,UAAW,CAAC;UACpC;UAEA,OACCF,YAAY,KACVA,YAAY,CAACG,QAAQ,CACtB,wBACD,CAAC,IACAH,YAAY,CAACG,QAAQ,CAAE,WAAY,CAAC,CAAE;QAEzC,CACD,CAAC;MACF;MAEA,IAAKN,cAAc,CAAEJ,QAAS,CAAC,EAAG;QACjC,MAAMW,QAAQ,GAAGT,SAAS,CAACU,OAAO,KAAK,OAAO;QAE9C,IAAKD,QAAQ,EAAG;UACf;UACA;UACA;UACA,MAAME,eAAe,GAAGX,SAAS,CAACC,EAAE,CAACW,OAAO,CAC3C,aAAa,EACb,MACD,CAAC;UACD,MAAMC,iBAAiB,GACtBpB,QAAQ,CAACqB,cAAc,CAAEH,eAAgB,CAAC;UAC3C,IAAKE,iBAAiB,EAAG;YACxBjB,WAAW,CAACmB,IAAI,CACfF,iBAAiB,CAACG,SAAS,CAAE,IAAK,CACnC,CAAC;UACF;QACD;QAEApB,WAAW,CAACmB,IAAI,CAAEf,SAAS,CAACgB,SAAS,CAAE,IAAK,CAAE,CAAC;QAE/C,IAAK,CAAEP,QAAQ,EAAG;UACjB;UACA;UACA;UACA,MAAMQ,iBAAiB,GAAGjB,SAAS,CAACC,EAAE,CAACW,OAAO,CAC7C,MAAM,EACN,aACD,CAAC;UACD,MAAMM,mBAAmB,GACxBzB,QAAQ,CAACqB,cAAc,CAAEG,iBAAkB,CAAC;UAC7C,IAAKC,mBAAmB,EAAG;YAC1BtB,WAAW,CAACmB,IAAI,CACfG,mBAAmB,CAACF,SAAS,CAAE,IAAK,CACrC,CAAC;UACF;QACD;MACD;MAEA,OAAOpB,WAAW;IACnB,CAAC,EACD,EACD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { addFilter } from '@wordpress/hooks';
|
|
6
|
-
import { PanelBody, TextControl } from '@wordpress/components';
|
|
7
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
8
|
-
import { hasBlockSupport } from '@wordpress/blocks';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import { InspectorControls } from '../components';
|
|
14
|
-
import { useBlockEditingMode } from '../components/block-editing-mode';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Filters registered block settings, extending attributes to include `connections`.
|
|
18
|
-
*
|
|
19
|
-
* @param {Object} settings Original block settings.
|
|
20
|
-
*
|
|
21
|
-
* @return {Object} Filtered block settings.
|
|
22
|
-
*/
|
|
23
|
-
function addAttribute(settings) {
|
|
24
|
-
if (hasBlockSupport(settings, '__experimentalConnections', true)) {
|
|
25
|
-
// Gracefully handle if settings.attributes.connections is undefined.
|
|
26
|
-
settings.attributes = {
|
|
27
|
-
...settings.attributes,
|
|
28
|
-
connections: {
|
|
29
|
-
type: 'object'
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
return settings;
|
|
34
|
-
}
|
|
35
|
-
function CustomFieldsControlPure({
|
|
36
|
-
name,
|
|
37
|
-
connections,
|
|
38
|
-
setAttributes
|
|
39
|
-
}) {
|
|
40
|
-
const blockEditingMode = useBlockEditingMode();
|
|
41
|
-
if (blockEditingMode !== 'default') {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// If the block is a paragraph or image block, we need to know which
|
|
46
|
-
// attribute to use for the connection. Only the `content` attribute
|
|
47
|
-
// of the paragraph block and the `url` attribute of the image block are supported.
|
|
48
|
-
let attributeName;
|
|
49
|
-
if (name === 'core/paragraph') attributeName = 'content';
|
|
50
|
-
if (name === 'core/image') attributeName = 'url';
|
|
51
|
-
return createElement(InspectorControls, null, createElement(PanelBody, {
|
|
52
|
-
title: __('Connections'),
|
|
53
|
-
initialOpen: true
|
|
54
|
-
}, createElement(TextControl, {
|
|
55
|
-
__nextHasNoMarginBottom: true,
|
|
56
|
-
autoComplete: "off",
|
|
57
|
-
label: __('Custom field meta_key'),
|
|
58
|
-
value: connections?.attributes?.[attributeName]?.value || '',
|
|
59
|
-
onChange: nextValue => {
|
|
60
|
-
if (nextValue === '') {
|
|
61
|
-
setAttributes({
|
|
62
|
-
connections: undefined,
|
|
63
|
-
[attributeName]: undefined,
|
|
64
|
-
placeholder: undefined
|
|
65
|
-
});
|
|
66
|
-
} else {
|
|
67
|
-
setAttributes({
|
|
68
|
-
connections: {
|
|
69
|
-
attributes: {
|
|
70
|
-
// The attributeName will be either `content` or `url`.
|
|
71
|
-
[attributeName]: {
|
|
72
|
-
// Source will be variable, could be post_meta, user_meta, term_meta, etc.
|
|
73
|
-
// Could even be a custom source like a social media attribute.
|
|
74
|
-
source: 'meta_fields',
|
|
75
|
-
value: nextValue
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
[attributeName]: undefined,
|
|
80
|
-
placeholder: sprintf('This content will be replaced on the frontend by the value of "%s" custom field.', nextValue)
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
})));
|
|
85
|
-
}
|
|
86
|
-
export default {
|
|
87
|
-
edit: CustomFieldsControlPure,
|
|
88
|
-
attributeKeys: ['connections'],
|
|
89
|
-
hasSupport(name) {
|
|
90
|
-
return hasBlockSupport(name, '__experimentalConnections', false) &&
|
|
91
|
-
// Check if the current block is a paragraph or image block.
|
|
92
|
-
// Currently, only these two blocks are supported.
|
|
93
|
-
['core/paragraph', 'core/image'].includes(name);
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
if (window.__experimentalConnections || window.__experimentalPatternPartialSyncing) {
|
|
97
|
-
addFilter('blocks.registerBlockType', 'core/editor/connections/attribute', addAttribute);
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=custom-fields.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["addFilter","PanelBody","TextControl","__","sprintf","hasBlockSupport","InspectorControls","useBlockEditingMode","addAttribute","settings","attributes","connections","type","CustomFieldsControlPure","name","setAttributes","blockEditingMode","attributeName","createElement","title","initialOpen","__nextHasNoMarginBottom","autoComplete","label","value","onChange","nextValue","undefined","placeholder","source","edit","attributeKeys","hasSupport","includes","window","__experimentalConnections","__experimentalPatternPartialSyncing"],"sources":["@wordpress/block-editor/src/hooks/custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { PanelBody, TextControl } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { InspectorControls } from '../components';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\n/**\n * Filters registered block settings, extending attributes to include `connections`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( hasBlockSupport( settings, '__experimentalConnections', true ) ) {\n\t\t// Gracefully handle if settings.attributes.connections is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tconnections: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction CustomFieldsControlPure( { name, connections, setAttributes } ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\t// If the block is a paragraph or image block, we need to know which\n\t// attribute to use for the connection. Only the `content` attribute\n\t// of the paragraph block and the `url` attribute of the image block are supported.\n\tlet attributeName;\n\tif ( name === 'core/paragraph' ) attributeName = 'content';\n\tif ( name === 'core/image' ) attributeName = 'url';\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Connections' ) } initialOpen={ true }>\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tlabel={ __( 'Custom field meta_key' ) }\n\t\t\t\t\tvalue={\n\t\t\t\t\t\tconnections?.attributes?.[ attributeName ]?.value || ''\n\t\t\t\t\t}\n\t\t\t\t\tonChange={ ( nextValue ) => {\n\t\t\t\t\t\tif ( nextValue === '' ) {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tconnections: undefined,\n\t\t\t\t\t\t\t\t[ attributeName ]: undefined,\n\t\t\t\t\t\t\t\tplaceholder: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tconnections: {\n\t\t\t\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\t\t\t\t// The attributeName will be either `content` or `url`.\n\t\t\t\t\t\t\t\t\t\t[ attributeName ]: {\n\t\t\t\t\t\t\t\t\t\t\t// Source will be variable, could be post_meta, user_meta, term_meta, etc.\n\t\t\t\t\t\t\t\t\t\t\t// Could even be a custom source like a social media attribute.\n\t\t\t\t\t\t\t\t\t\t\tsource: 'meta_fields',\n\t\t\t\t\t\t\t\t\t\t\tvalue: nextValue,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t[ attributeName ]: undefined,\n\t\t\t\t\t\t\t\tplaceholder: sprintf(\n\t\t\t\t\t\t\t\t\t'This content will be replaced on the frontend by the value of \"%s\" custom field.',\n\t\t\t\t\t\t\t\t\tnextValue\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n}\n\nexport default {\n\tedit: CustomFieldsControlPure,\n\tattributeKeys: [ 'connections' ],\n\thasSupport( name ) {\n\t\treturn (\n\t\t\thasBlockSupport( name, '__experimentalConnections', false ) &&\n\t\t\t// Check if the current block is a paragraph or image block.\n\t\t\t// Currently, only these two blocks are supported.\n\t\t\t[ 'core/paragraph', 'core/image' ].includes( name )\n\t\t);\n\t},\n};\n\nif (\n\twindow.__experimentalConnections ||\n\twindow.__experimentalPatternPartialSyncing\n) {\n\taddFilter(\n\t\t'blocks.registerBlockType',\n\t\t'core/editor/connections/attribute',\n\t\taddAttribute\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,SAAS,EAAEC,WAAW,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,eAAe,QAAQ,mBAAmB;;AAEnD;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,eAAe;AACjD,SAASC,mBAAmB,QAAQ,kCAAkC;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAAEC,QAAQ,EAAG;EACjC,IAAKJ,eAAe,CAAEI,QAAQ,EAAE,2BAA2B,EAAE,IAAK,CAAC,EAAG;IACrE;IACAA,QAAQ,CAACC,UAAU,GAAG;MACrB,GAAGD,QAAQ,CAACC,UAAU;MACtBC,WAAW,EAAE;QACZC,IAAI,EAAE;MACP;IACD,CAAC;EACF;EAEA,OAAOH,QAAQ;AAChB;AAEA,SAASI,uBAAuBA,CAAE;EAAEC,IAAI;EAAEH,WAAW;EAAEI;AAAc,CAAC,EAAG;EACxE,MAAMC,gBAAgB,GAAGT,mBAAmB,CAAC,CAAC;EAC9C,IAAKS,gBAAgB,KAAK,SAAS,EAAG;IACrC,OAAO,IAAI;EACZ;;EAEA;EACA;EACA;EACA,IAAIC,aAAa;EACjB,IAAKH,IAAI,KAAK,gBAAgB,EAAGG,aAAa,GAAG,SAAS;EAC1D,IAAKH,IAAI,KAAK,YAAY,EAAGG,aAAa,GAAG,KAAK;EAElD,OACCC,aAAA,CAACZ,iBAAiB,QACjBY,aAAA,CAACjB,SAAS;IAACkB,KAAK,EAAGhB,EAAE,CAAE,aAAc,CAAG;IAACiB,WAAW,EAAG;EAAM,GAC5DF,aAAA,CAAChB,WAAW;IACXmB,uBAAuB;IACvBC,YAAY,EAAC,KAAK;IAClBC,KAAK,EAAGpB,EAAE,CAAE,uBAAwB,CAAG;IACvCqB,KAAK,EACJb,WAAW,EAAED,UAAU,GAAIO,aAAa,CAAE,EAAEO,KAAK,IAAI,EACrD;IACDC,QAAQ,EAAKC,SAAS,IAAM;MAC3B,IAAKA,SAAS,KAAK,EAAE,EAAG;QACvBX,aAAa,CAAE;UACdJ,WAAW,EAAEgB,SAAS;UACtB,CAAEV,aAAa,GAAIU,SAAS;UAC5BC,WAAW,EAAED;QACd,CAAE,CAAC;MACJ,CAAC,MAAM;QACNZ,aAAa,CAAE;UACdJ,WAAW,EAAE;YACZD,UAAU,EAAE;cACX;cACA,CAAEO,aAAa,GAAI;gBAClB;gBACA;gBACAY,MAAM,EAAE,aAAa;gBACrBL,KAAK,EAAEE;cACR;YACD;UACD,CAAC;UACD,CAAET,aAAa,GAAIU,SAAS;UAC5BC,WAAW,EAAExB,OAAO,CACnB,kFAAkF,EAClFsB,SACD;QACD,CAAE,CAAC;MACJ;IACD;EAAG,CACH,CACS,CACO,CAAC;AAEtB;AAEA,eAAe;EACdI,IAAI,EAAEjB,uBAAuB;EAC7BkB,aAAa,EAAE,CAAE,aAAa,CAAE;EAChCC,UAAUA,CAAElB,IAAI,EAAG;IAClB,OACCT,eAAe,CAAES,IAAI,EAAE,2BAA2B,EAAE,KAAM,CAAC;IAC3D;IACA;IACA,CAAE,gBAAgB,EAAE,YAAY,CAAE,CAACmB,QAAQ,CAAEnB,IAAK,CAAC;EAErD;AACD,CAAC;AAED,IACCoB,MAAM,CAACC,yBAAyB,IAChCD,MAAM,CAACE,mCAAmC,EACzC;EACDpC,SAAS,CACR,0BAA0B,EAC1B,mCAAmC,EACnCQ,YACD,CAAC;AACF"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
|
|
2
|
-
|
|
3
|
-
function matchesAttributes(blockAttributes, variation) {
|
|
4
|
-
return Object.entries(variation).every(([key, value]) => {
|
|
5
|
-
if (typeof value === 'object' && typeof blockAttributes[key] === 'object') {
|
|
6
|
-
return matchesAttributes(blockAttributes[key], value);
|
|
7
|
-
}
|
|
8
|
-
return blockAttributes[key] === value;
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Matches the provided block variations with a block's attributes. If no match
|
|
14
|
-
* or more than one matches are found it returns `undefined`. If a single match is
|
|
15
|
-
* found it returns it.
|
|
16
|
-
*
|
|
17
|
-
* This is a simple implementation for now as it takes into account only the attributes
|
|
18
|
-
* of a block variation and not `InnerBlocks`.
|
|
19
|
-
*
|
|
20
|
-
* @param {Object} blockAttributes - The block attributes to try to find a match.
|
|
21
|
-
* @param {WPBlockVariation[]} variations - A list of block variations to test for a match.
|
|
22
|
-
* @return {WPBlockVariation | undefined} - If a match is found returns it. If not or more than one matches are found returns `undefined`.
|
|
23
|
-
*/
|
|
24
|
-
export const __experimentalGetMatchingVariation = (blockAttributes, variations) => {
|
|
25
|
-
if (!variations || !blockAttributes) return;
|
|
26
|
-
const matches = variations.filter(({
|
|
27
|
-
attributes
|
|
28
|
-
}) => {
|
|
29
|
-
if (!attributes || !Object.keys(attributes).length) return false;
|
|
30
|
-
return matchesAttributes(blockAttributes, attributes);
|
|
31
|
-
});
|
|
32
|
-
if (matches.length !== 1) return;
|
|
33
|
-
return matches[0];
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=block-variation-transforms.js.map
|