@wordpress/block-editor 15.22.1-next.v.202606191442.0 → 15.23.0
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 +3 -1
- package/README.md +2 -2
- package/build/components/block-editing-mode/index.cjs +13 -7
- package/build/components/block-editing-mode/index.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +50 -51
- package/build/components/block-inspector/index.cjs.map +2 -2
- package/build/components/block-rename/modal.cjs +0 -1
- package/build/components/block-rename/modal.cjs.map +2 -2
- package/build/components/block-toolbar/block-toolbar-icon.cjs +14 -6
- package/build/components/block-toolbar/block-toolbar-icon.cjs.map +2 -2
- package/build/components/colors-gradients/control.cjs +25 -14
- package/build/components/colors-gradients/control.cjs.map +2 -2
- package/build/components/colors-gradients/dropdown.cjs +4 -1
- package/build/components/colors-gradients/dropdown.cjs.map +3 -3
- package/build/components/contrast-checker/index.cjs +22 -4
- package/build/components/contrast-checker/index.cjs.map +2 -2
- package/build/components/date-format-picker/index.cjs +0 -1
- package/build/components/date-format-picker/index.cjs.map +2 -2
- package/build/components/global-styles/background-panel.cjs +153 -25
- package/build/components/global-styles/background-panel.cjs.map +3 -3
- package/build/components/global-styles/color-gradient-dropdown-item.cjs +227 -0
- package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +7 -0
- package/build/components/global-styles/color-panel.cjs +98 -375
- package/build/components/global-styles/color-panel.cjs.map +3 -3
- package/build/components/global-styles/dimensions-panel.cjs +0 -3
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/global-styles/hooks.cjs +34 -0
- package/build/components/global-styles/hooks.cjs.map +2 -2
- package/build/components/global-styles/typography-panel.cjs +82 -10
- package/build/components/global-styles/typography-panel.cjs.map +3 -3
- package/build/components/inspector-controls/groups.cjs +2 -0
- package/build/components/inspector-controls/groups.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/styles-tab.cjs +75 -31
- package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
- package/build/components/link-control/index.cjs +1 -2
- package/build/components/link-control/index.cjs.map +2 -2
- package/build/components/list-view/block-select-button.cjs +1 -10
- package/build/components/list-view/block-select-button.cjs.map +3 -3
- package/build/components/provider/use-block-sync.cjs +3 -1
- package/build/components/provider/use-block-sync.cjs.map +2 -2
- package/build/components/url-popover/image-url-input-ui.cjs +0 -2
- package/build/components/url-popover/image-url-input-ui.cjs.map +2 -2
- package/build/components/use-block-display-information/index.cjs +10 -3
- package/build/components/use-block-display-information/index.cjs.map +2 -2
- package/build/components/use-resize-canvas/index.cjs +16 -53
- package/build/components/use-resize-canvas/index.cjs.map +3 -3
- package/build/hooks/anchor.cjs +0 -1
- package/build/hooks/anchor.cjs.map +2 -2
- package/build/hooks/background.cjs +124 -75
- package/build/hooks/background.cjs.map +3 -3
- package/build/hooks/color.cjs +0 -162
- package/build/hooks/color.cjs.map +3 -3
- package/build/hooks/contrast-checker.cjs +31 -28
- package/build/hooks/contrast-checker.cjs.map +3 -3
- package/build/hooks/custom-class-name.cjs +0 -1
- package/build/hooks/custom-class-name.cjs.map +2 -2
- package/build/hooks/elements.cjs +142 -0
- package/build/hooks/elements.cjs.map +7 -0
- package/build/hooks/grid-visualizer.cjs +21 -11
- package/build/hooks/grid-visualizer.cjs.map +2 -2
- package/build/hooks/layout-child.cjs +38 -8
- package/build/hooks/layout-child.cjs.map +2 -2
- package/build/hooks/layout.cjs +6 -3
- package/build/hooks/layout.cjs.map +2 -2
- package/build/hooks/states.cjs +15 -23
- package/build/hooks/states.cjs.map +2 -2
- package/build/hooks/style.cjs +8 -4
- package/build/hooks/style.cjs.map +2 -2
- package/build/hooks/typography.cjs +62 -10
- package/build/hooks/typography.cjs.map +3 -3
- package/build/layouts/flex.cjs +99 -6
- package/build/layouts/flex.cjs.map +2 -2
- package/build/private-apis.cjs +0 -1
- package/build/private-apis.cjs.map +2 -2
- package/build/store/private-actions.cjs +16 -0
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-keys.cjs +0 -3
- package/build/store/private-keys.cjs.map +2 -2
- package/build/store/private-selectors.cjs +24 -6
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +19 -3
- package/build/store/reducer.cjs.map +2 -2
- package/build/utils/block-bindings.cjs +9 -9
- package/build/utils/block-bindings.cjs.map +3 -3
- package/build/utils/color-values.cjs +10 -1
- package/build/utils/color-values.cjs.map +3 -3
- package/build/utils/dom.cjs +2 -5
- package/build/utils/dom.cjs.map +3 -3
- package/build/utils/fit-text-frontend.cjs +6 -2
- package/build/utils/fit-text-frontend.cjs.map +3 -3
- package/build/utils/fit-text-utils.cjs +1 -1
- package/build/utils/fit-text-utils.cjs.map +3 -3
- package/build/utils/format-font-style.cjs +1 -1
- package/build/utils/format-font-style.cjs.map +3 -3
- package/build/utils/format-font-weight.cjs +1 -1
- package/build/utils/format-font-weight.cjs.map +3 -3
- package/build/utils/get-editor-region.cjs +4 -2
- package/build/utils/get-editor-region.cjs.map +3 -3
- package/build/utils/get-font-styles-and-weights.cjs +8 -12
- package/build/utils/get-font-styles-and-weights.cjs.map +3 -3
- package/build/utils/get-px-from-css-unit.cjs +1 -1
- package/build/utils/get-px-from-css-unit.cjs.map +1 -1
- package/build/utils/index.cjs +1 -1
- package/build/utils/index.cjs.map +1 -1
- package/build/utils/math.cjs +1 -1
- package/build/utils/math.cjs.map +3 -3
- package/build/utils/object.cjs +8 -8
- package/build/utils/object.cjs.map +3 -3
- package/build/utils/order-inserter-block-items.cjs +1 -1
- package/build/utils/order-inserter-block-items.cjs.map +3 -3
- package/build/utils/pasting.cjs +4 -2
- package/build/utils/pasting.cjs.map +3 -3
- package/build/utils/selection.cjs +2 -1
- package/build/utils/selection.cjs.map +3 -3
- package/build/utils/sorting.cjs +9 -3
- package/build/utils/sorting.cjs.map +3 -3
- package/build/utils/transform-styles/index.cjs +3 -2
- package/build/utils/transform-styles/index.cjs.map +3 -3
- package/build/utils/transform-styles/postcss-urlrebase.d.cjs +2 -0
- package/build/utils/transform-styles/postcss-urlrebase.d.cjs.map +7 -0
- package/build/utils/transform-styles/types.cjs +19 -0
- package/build/utils/transform-styles/types.cjs.map +7 -0
- package/build/utils/types.cjs +19 -0
- package/build/utils/types.cjs.map +7 -0
- package/build-module/components/block-editing-mode/index.mjs +14 -8
- package/build-module/components/block-editing-mode/index.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +50 -51
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-rename/modal.mjs +0 -1
- package/build-module/components/block-rename/modal.mjs.map +2 -2
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs +14 -6
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +2 -2
- package/build-module/components/colors-gradients/control.mjs +27 -15
- package/build-module/components/colors-gradients/control.mjs.map +2 -2
- package/build-module/components/colors-gradients/dropdown.mjs +4 -1
- package/build-module/components/colors-gradients/dropdown.mjs.map +2 -2
- package/build-module/components/contrast-checker/index.mjs +18 -4
- package/build-module/components/contrast-checker/index.mjs.map +2 -2
- package/build-module/components/date-format-picker/index.mjs +0 -1
- package/build-module/components/date-format-picker/index.mjs.map +2 -2
- package/build-module/components/global-styles/background-panel.mjs +155 -27
- package/build-module/components/global-styles/background-panel.mjs.map +2 -2
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +207 -0
- package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +7 -0
- package/build-module/components/global-styles/color-panel.mjs +106 -387
- package/build-module/components/global-styles/color-panel.mjs.map +3 -3
- package/build-module/components/global-styles/dimensions-panel.mjs +0 -3
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/hooks.mjs +33 -0
- package/build-module/components/global-styles/hooks.mjs.map +2 -2
- package/build-module/components/global-styles/typography-panel.mjs +84 -10
- package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
- package/build-module/components/inspector-controls/groups.mjs +2 -0
- package/build-module/components/inspector-controls/groups.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs +75 -31
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
- package/build-module/components/link-control/index.mjs +1 -2
- package/build-module/components/link-control/index.mjs.map +2 -2
- package/build-module/components/list-view/block-select-button.mjs +2 -17
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/provider/use-block-sync.mjs +3 -1
- package/build-module/components/provider/use-block-sync.mjs.map +2 -2
- package/build-module/components/url-popover/image-url-input-ui.mjs +0 -2
- package/build-module/components/url-popover/image-url-input-ui.mjs.map +2 -2
- package/build-module/components/use-block-display-information/index.mjs +10 -3
- package/build-module/components/use-block-display-information/index.mjs.map +2 -2
- package/build-module/components/use-resize-canvas/index.mjs +6 -53
- package/build-module/components/use-resize-canvas/index.mjs.map +2 -2
- package/build-module/hooks/anchor.mjs +0 -1
- package/build-module/hooks/anchor.mjs.map +2 -2
- package/build-module/hooks/background.mjs +123 -75
- package/build-module/hooks/background.mjs.map +2 -2
- package/build-module/hooks/color.mjs +2 -175
- package/build-module/hooks/color.mjs.map +2 -2
- package/build-module/hooks/contrast-checker.mjs +32 -19
- package/build-module/hooks/contrast-checker.mjs.map +2 -2
- package/build-module/hooks/custom-class-name.mjs +0 -1
- package/build-module/hooks/custom-class-name.mjs.map +2 -2
- package/build-module/hooks/elements.mjs +115 -0
- package/build-module/hooks/elements.mjs.map +7 -0
- package/build-module/hooks/grid-visualizer.mjs +21 -11
- package/build-module/hooks/grid-visualizer.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +41 -8
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/hooks/layout.mjs +6 -3
- package/build-module/hooks/layout.mjs.map +2 -2
- package/build-module/hooks/states.mjs +15 -23
- package/build-module/hooks/states.mjs.map +2 -2
- package/build-module/hooks/style.mjs +9 -5
- package/build-module/hooks/style.mjs.map +2 -2
- package/build-module/hooks/typography.mjs +62 -10
- package/build-module/hooks/typography.mjs.map +2 -2
- package/build-module/layouts/flex.mjs +105 -7
- package/build-module/layouts/flex.mjs.map +2 -2
- package/build-module/private-apis.mjs +0 -2
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +14 -0
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-keys.mjs +0 -2
- package/build-module/store/private-keys.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +22 -6
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +17 -3
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/utils/block-bindings.mjs +9 -9
- package/build-module/utils/block-bindings.mjs.map +3 -3
- package/build-module/utils/color-values.mjs +9 -1
- package/build-module/utils/color-values.mjs.map +3 -3
- package/build-module/utils/dom.mjs +2 -5
- package/build-module/utils/dom.mjs.map +3 -3
- package/build-module/utils/fit-text-frontend.mjs +6 -2
- package/build-module/utils/fit-text-frontend.mjs.map +3 -3
- package/build-module/utils/fit-text-utils.mjs +1 -1
- package/build-module/utils/fit-text-utils.mjs.map +3 -3
- package/build-module/utils/format-font-style.mjs +1 -1
- package/build-module/utils/format-font-style.mjs.map +3 -3
- package/build-module/utils/format-font-weight.mjs +1 -1
- package/build-module/utils/format-font-weight.mjs.map +3 -3
- package/build-module/utils/get-editor-region.mjs +4 -2
- package/build-module/utils/get-editor-region.mjs.map +3 -3
- package/build-module/utils/get-font-styles-and-weights.mjs +8 -12
- package/build-module/utils/get-font-styles-and-weights.mjs.map +3 -3
- package/build-module/utils/get-px-from-css-unit.mjs +1 -1
- package/build-module/utils/get-px-from-css-unit.mjs.map +1 -1
- package/build-module/utils/index.mjs +1 -1
- package/build-module/utils/index.mjs.map +1 -1
- package/build-module/utils/math.mjs +1 -1
- package/build-module/utils/math.mjs.map +3 -3
- package/build-module/utils/object.mjs +8 -8
- package/build-module/utils/object.mjs.map +3 -3
- package/build-module/utils/order-inserter-block-items.mjs +1 -1
- package/build-module/utils/order-inserter-block-items.mjs.map +3 -3
- package/build-module/utils/pasting.mjs +4 -2
- package/build-module/utils/pasting.mjs.map +3 -3
- package/build-module/utils/selection.mjs +2 -1
- package/build-module/utils/selection.mjs.map +3 -3
- package/build-module/utils/sorting.mjs +9 -3
- package/build-module/utils/sorting.mjs.map +3 -3
- package/build-module/utils/transform-styles/index.mjs +3 -2
- package/build-module/utils/transform-styles/index.mjs.map +3 -3
- package/build-module/utils/transform-styles/postcss-urlrebase.d.mjs +1 -0
- package/build-module/utils/transform-styles/postcss-urlrebase.d.mjs.map +7 -0
- package/build-module/utils/transform-styles/types.mjs +1 -0
- package/build-module/utils/transform-styles/types.mjs.map +7 -0
- package/build-module/utils/types.mjs +1 -0
- package/build-module/utils/types.mjs.map +7 -0
- package/build-style/content-rtl.css +2 -0
- package/build-style/content.css +2 -0
- package/build-style/style-rtl.css +34 -41
- package/build-style/style.css +34 -41
- package/build-types/utils/block-bindings.d.ts +27 -0
- package/build-types/utils/block-bindings.d.ts.map +1 -0
- package/build-types/utils/color-values.d.ts +40 -0
- package/build-types/utils/color-values.d.ts.map +1 -0
- package/build-types/utils/dom.d.ts +19 -19
- package/build-types/utils/dom.d.ts.map +1 -1
- package/build-types/utils/fit-text-frontend.d.ts +7 -0
- package/build-types/utils/fit-text-frontend.d.ts.map +1 -0
- package/build-types/utils/fit-text-utils.d.ts +15 -0
- package/build-types/utils/fit-text-utils.d.ts.map +1 -0
- package/build-types/utils/format-font-style.d.ts +12 -0
- package/build-types/utils/format-font-style.d.ts.map +1 -0
- package/build-types/utils/format-font-weight.d.ts +12 -0
- package/build-types/utils/format-font-weight.d.ts.map +1 -0
- package/build-types/utils/get-editor-region.d.ts +9 -0
- package/build-types/utils/get-editor-region.d.ts.map +1 -0
- package/build-types/utils/get-font-styles-and-weights.d.ts +16 -0
- package/build-types/utils/get-font-styles-and-weights.d.ts.map +1 -0
- package/build-types/utils/get-px-from-css-unit.d.ts +10 -0
- package/build-types/utils/get-px-from-css-unit.d.ts.map +1 -0
- package/build-types/utils/index.d.ts +3 -0
- package/build-types/utils/index.d.ts.map +1 -0
- package/build-types/utils/math.d.ts +61 -0
- package/build-types/utils/math.d.ts.map +1 -0
- package/build-types/utils/object.d.ts +39 -0
- package/build-types/utils/object.d.ts.map +1 -0
- package/build-types/utils/order-inserter-block-items.d.ts +13 -0
- package/build-types/utils/order-inserter-block-items.d.ts.map +1 -0
- package/build-types/utils/pasting.d.ts +28 -0
- package/build-types/utils/pasting.d.ts.map +1 -0
- package/build-types/utils/selection.d.ts +21 -0
- package/build-types/utils/selection.d.ts.map +1 -0
- package/build-types/utils/sorting.d.ts +17 -0
- package/build-types/utils/sorting.d.ts.map +1 -0
- package/build-types/utils/transform-styles/index.d.ts +15 -0
- package/build-types/utils/transform-styles/index.d.ts.map +1 -0
- package/build-types/utils/transform-styles/types.d.ts +13 -0
- package/build-types/utils/transform-styles/types.d.ts.map +1 -0
- package/build-types/utils/types.d.ts +28 -0
- package/build-types/utils/types.d.ts.map +1 -0
- package/package.json +40 -39
- package/src/components/alignment-control/test/__snapshots__/index.js.snap +6 -0
- package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +5 -0
- package/src/components/block-editing-mode/index.js +17 -9
- package/src/components/block-icon/test/__snapshots__/index.js.snap +1 -0
- package/src/components/block-inspector/index.js +43 -53
- package/src/components/block-rename/modal.js +0 -1
- package/src/components/block-toolbar/block-toolbar-icon.js +22 -6
- package/src/components/block-toolbar/test/block-toolbar-icon.js +99 -0
- package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +4 -0
- package/src/components/colors-gradients/control.js +29 -12
- package/src/components/colors-gradients/dropdown.js +4 -1
- package/src/components/colors-gradients/style.scss +39 -2
- package/src/components/contrast-checker/README.md +9 -0
- package/src/components/contrast-checker/index.js +42 -3
- package/src/components/date-format-picker/index.js +0 -1
- package/src/components/default-block-appender/content.scss +3 -0
- package/src/components/global-styles/background-panel.js +201 -34
- package/src/components/global-styles/color-gradient-dropdown-item.js +258 -0
- package/src/components/global-styles/color-panel.js +125 -487
- package/src/components/global-styles/dimensions-panel.js +0 -3
- package/src/components/global-styles/hooks.js +45 -0
- package/src/components/global-styles/test/background-panel.js +56 -0
- package/src/components/global-styles/test/color-panel.js +172 -118
- package/src/components/global-styles/test/typography-panel.js +167 -0
- package/src/components/global-styles/typography-panel.js +100 -11
- package/src/components/inspector-controls/README.md +0 -2
- package/src/components/inspector-controls/groups.js +2 -0
- package/src/components/inspector-controls-tabs/styles-tab.js +74 -28
- package/src/components/link-control/index.js +0 -1
- package/src/components/link-control/test/index.js +2 -3
- package/src/components/list-view/block-select-button.js +2 -17
- package/src/components/provider/use-block-sync.js +3 -1
- package/src/components/rich-text/content.scss +2 -0
- package/src/components/url-popover/image-url-input-ui.js +0 -2
- package/src/components/use-block-display-information/index.js +15 -2
- package/src/components/use-block-display-information/test/index.js +140 -0
- package/src/components/use-resize-canvas/index.js +10 -71
- package/src/hooks/anchor.js +0 -1
- package/src/hooks/background.js +210 -133
- package/src/hooks/background.scss +0 -35
- package/src/hooks/color.js +2 -205
- package/src/hooks/color.scss +3 -9
- package/src/hooks/contrast-checker.js +60 -17
- package/src/hooks/custom-class-name.js +0 -1
- package/src/hooks/elements.js +140 -0
- package/src/hooks/elements.scss +8 -0
- package/src/hooks/grid-visualizer.js +59 -45
- package/src/hooks/layout-child.js +51 -12
- package/src/hooks/layout.js +6 -3
- package/src/hooks/states.js +32 -28
- package/src/hooks/style.js +11 -7
- package/src/hooks/test/background.js +59 -0
- package/src/hooks/test/block-style-state.js +14 -14
- package/src/hooks/test/layout.js +6 -6
- package/src/hooks/test/style.js +8 -8
- package/src/hooks/typography.js +70 -6
- package/src/layouts/flex.js +118 -15
- package/src/private-apis.js +0 -2
- package/src/store/private-actions.js +31 -0
- package/src/store/private-keys.js +0 -1
- package/src/store/private-selectors.js +43 -7
- package/src/store/reducer.js +37 -2
- package/src/store/test/private-selectors.js +39 -14
- package/src/store/test/reducer.js +91 -12
- package/src/style.scss +1 -0
- package/src/utils/block-bindings.ts +51 -0
- package/src/utils/color-values.ts +63 -0
- package/src/utils/{dom.js → dom.ts} +27 -27
- package/src/utils/{fit-text-frontend.js → fit-text-frontend.ts} +12 -4
- package/src/utils/{fit-text-utils.js → fit-text-utils.ts} +15 -7
- package/src/utils/{format-font-style.js → format-font-style.ts} +10 -3
- package/src/utils/{format-font-weight.js → format-font-weight.ts} +10 -3
- package/src/utils/{get-editor-region.js → get-editor-region.ts} +10 -6
- package/src/utils/{get-font-styles-and-weights.js → get-font-styles-and-weights.ts} +21 -17
- package/src/utils/{math.js → math.ts} +37 -30
- package/src/utils/object.ts +89 -0
- package/src/utils/{order-inserter-block-items.js → order-inserter-block-items.ts} +8 -5
- package/src/utils/{pasting.js → pasting.ts} +18 -11
- package/src/utils/{selection.js → selection.ts} +11 -4
- package/src/utils/sorting.ts +81 -0
- package/src/utils/test/color-values.js +44 -1
- package/src/utils/transform-styles/{index.js → index.ts} +25 -25
- package/src/utils/transform-styles/postcss-urlrebase.d.ts +15 -0
- package/src/utils/transform-styles/types.ts +13 -0
- package/src/utils/types.ts +29 -0
- package/src/components/use-resize-canvas/README.md +0 -37
- package/src/utils/block-bindings.js +0 -46
- package/src/utils/color-values.js +0 -28
- package/src/utils/object.js +0 -67
- package/src/utils/sorting.js +0 -54
- /package/src/utils/{get-px-from-css-unit.js → get-px-from-css-unit.ts} +0 -0
- /package/src/utils/{index.js → index.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/order-inserter-block-items.
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";AASO,IAAM,0BAA0B,
|
|
3
|
+
"sources": ["../../src/utils/order-inserter-block-items.ts"],
|
|
4
|
+
"sourcesContent": ["type EditorInserterItem = { id: string };\n\n/**\n * Helper function to order inserter block items according to a provided array of prioritized blocks.\n *\n * @param items The array of editor inserter block items to be sorted.\n * @param priority The array of block names to be prioritized.\n * @return The sorted array of editor inserter block items.\n */\nexport const orderInserterBlockItems = (\n\titems: EditorInserterItem[],\n\tpriority: string[] | undefined\n) => {\n\tif ( ! priority ) {\n\t\treturn items;\n\t}\n\n\titems.sort( ( { id: aName }, { id: bName } ) => {\n\t\t// Sort block items according to `priority`.\n\t\tlet aIndex = priority.indexOf( aName );\n\t\tlet bIndex = priority.indexOf( bName );\n\t\t// All other block items should come after that.\n\t\tif ( aIndex < 0 ) {\n\t\t\taIndex = priority.length;\n\t\t}\n\t\tif ( bIndex < 0 ) {\n\t\t\tbIndex = priority.length;\n\t\t}\n\t\treturn aIndex - bIndex;\n\t} );\n\n\treturn items;\n};\n"],
|
|
5
|
+
"mappings": ";AASO,IAAM,0BAA0B,CACtC,OACA,aACI;AACJ,MAAK,CAAE,UAAW;AACjB,WAAO;AAAA,EACR;AAEA,QAAM,KAAM,CAAE,EAAE,IAAI,MAAM,GAAG,EAAE,IAAI,MAAM,MAAO;AAE/C,QAAI,SAAS,SAAS,QAAS,KAAM;AACrC,QAAI,SAAS,SAAS,QAAS,KAAM;AAErC,QAAK,SAAS,GAAI;AACjB,eAAS,SAAS;AAAA,IACnB;AACA,QAAK,SAAS,GAAI;AACjB,eAAS,SAAS;AAAA,IACnB;AACA,WAAO,SAAS;AAAA,EACjB,CAAE;AAEF,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/block-editor/src/utils/pasting.
|
|
1
|
+
// packages/block-editor/src/utils/pasting.ts
|
|
2
2
|
import { getFilesFromDataTransfer } from "@wordpress/dom";
|
|
3
3
|
function removeWindowsFragments(html) {
|
|
4
4
|
const startStr = "<!--StartFragment-->";
|
|
@@ -22,7 +22,9 @@ function removeCharsetMetaTag(html) {
|
|
|
22
22
|
}
|
|
23
23
|
return html;
|
|
24
24
|
}
|
|
25
|
-
function getPasteEventData({
|
|
25
|
+
function getPasteEventData({
|
|
26
|
+
clipboardData
|
|
27
|
+
}) {
|
|
26
28
|
let plainText = "";
|
|
27
29
|
let html = "";
|
|
28
30
|
try {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/pasting.
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getFilesFromDataTransfer } from '@wordpress/dom';\n\n/**\n * Normalizes a given string of HTML to remove the Windows-specific \"Fragment\"\n * comments and any preceding and trailing content.\n *\n * @param
|
|
5
|
-
"mappings": ";AAGA,SAAS,gCAAgC;AASzC,SAAS,uBAAwB,
|
|
3
|
+
"sources": ["../../src/utils/pasting.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getFilesFromDataTransfer } from '@wordpress/dom';\n\n/**\n * Normalizes a given string of HTML to remove the Windows-specific \"Fragment\"\n * comments and any preceding and trailing content.\n *\n * @param html the html to be normalized\n * @return the normalized html\n */\nfunction removeWindowsFragments( html: string ) {\n\tconst startStr = '<!--StartFragment-->';\n\tconst startIdx = html.indexOf( startStr );\n\tif ( startIdx > -1 ) {\n\t\thtml = html.substring( startIdx + startStr.length );\n\t} else {\n\t\t// No point looking for EndFragment\n\t\treturn html;\n\t}\n\n\tconst endStr = '<!--EndFragment-->';\n\tconst endIdx = html.indexOf( endStr );\n\tif ( endIdx > -1 ) {\n\t\thtml = html.substring( 0, endIdx );\n\t}\n\n\treturn html;\n}\n\n/**\n * Removes the charset meta tag inserted by Chromium.\n * See:\n * - https://github.com/WordPress/gutenberg/issues/33585\n * - https://bugs.chromium.org/p/chromium/issues/detail?id=1264616#c4\n *\n * @param html the html to be stripped of the meta tag.\n * @return the cleaned html\n */\nfunction removeCharsetMetaTag( html: string ) {\n\tconst metaTag = `<meta charset='utf-8'>`;\n\n\tif ( html.startsWith( metaTag ) ) {\n\t\treturn html.slice( metaTag.length );\n\t}\n\n\treturn html;\n}\n\nexport function getPasteEventData( {\n\tclipboardData,\n}: {\n\tclipboardData: DataTransfer;\n} ) {\n\tlet plainText = '';\n\tlet html = '';\n\n\ttry {\n\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\thtml = clipboardData.getData( 'text/html' );\n\t} catch {\n\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t// don't support clipboardData at all, so allow default\n\t\t// behaviour.\n\t\treturn;\n\t}\n\n\t// Remove Windows-specific metadata appended within copied HTML text.\n\thtml = removeWindowsFragments( html );\n\n\t// Strip meta tag.\n\thtml = removeCharsetMetaTag( html );\n\n\tconst files = getFilesFromDataTransfer( clipboardData );\n\n\tif ( files.length && ! shouldDismissPastedFiles( files, html ) ) {\n\t\treturn { files };\n\t}\n\n\treturn { html, plainText, files: [] };\n}\n\n/**\n * Given a collection of DataTransfer files and HTML and plain text strings,\n * determine whether the files are to be dismissed in favor of the HTML.\n *\n * Certain office-type programs, like Microsoft Word or Apple Numbers,\n * will, upon copy, generate a screenshot of the content being copied and\n * attach it to the clipboard alongside the actual rich text that the user\n * sought to copy. In those cases, we should let Gutenberg handle the rich text\n * content and not the screenshot, since this allows Gutenberg to insert\n * meaningful blocks, like paragraphs, lists or even tables.\n *\n * @param files File objects obtained from a paste event\n * @param html HTML content obtained from a paste event\n * @return True if the files should be dismissed\n */\nexport function shouldDismissPastedFiles(\n\tfiles: File[],\n\thtml: string /*, plainText */\n) {\n\t// The question is only relevant when there is actual HTML content and when\n\t// there is exactly one image file.\n\tif (\n\t\thtml &&\n\t\tfiles?.length === 1 &&\n\t\tfiles[ 0 ].type.indexOf( 'image/' ) === 0\n\t) {\n\t\t// A single <img> tag found in the HTML source suggests that the\n\t\t// content being pasted revolves around an image. Sometimes there are\n\t\t// other elements found, like <figure>, but we assume that the user's\n\t\t// intention is to paste the actual image file.\n\t\tconst IMAGE_TAG = /<\\s*img\\b/gi;\n\t\tif ( html.match( IMAGE_TAG )?.length !== 1 ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Even when there is exactly one <img> tag in the HTML payload, we\n\t\t// choose to weed out local images, i.e. those whose source starts with\n\t\t// \"file://\". These payloads occur in specific configurations, such as\n\t\t// when copying an entire document from Microsoft Word, that contains\n\t\t// text and exactly one image, and pasting that content using Google\n\t\t// Chrome.\n\t\tconst IMG_WITH_LOCAL_SRC = /<\\s*img\\b[^>]*\\bsrc=\"file:\\/\\//i;\n\t\tif ( html.match( IMG_WITH_LOCAL_SRC ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,gCAAgC;AASzC,SAAS,uBAAwB,MAAe;AAC/C,QAAM,WAAW;AACjB,QAAM,WAAW,KAAK,QAAS,QAAS;AACxC,MAAK,WAAW,IAAK;AACpB,WAAO,KAAK,UAAW,WAAW,SAAS,MAAO;AAAA,EACnD,OAAO;AAEN,WAAO;AAAA,EACR;AAEA,QAAM,SAAS;AACf,QAAM,SAAS,KAAK,QAAS,MAAO;AACpC,MAAK,SAAS,IAAK;AAClB,WAAO,KAAK,UAAW,GAAG,MAAO;AAAA,EAClC;AAEA,SAAO;AACR;AAWA,SAAS,qBAAsB,MAAe;AAC7C,QAAM,UAAU;AAEhB,MAAK,KAAK,WAAY,OAAQ,GAAI;AACjC,WAAO,KAAK,MAAO,QAAQ,MAAO;AAAA,EACnC;AAEA,SAAO;AACR;AAEO,SAAS,kBAAmB;AAAA,EAClC;AACD,GAEI;AACH,MAAI,YAAY;AAChB,MAAI,OAAO;AAEX,MAAI;AACH,gBAAY,cAAc,QAAS,YAAa;AAChD,WAAO,cAAc,QAAS,WAAY;AAAA,EAC3C,QAAQ;AAIP;AAAA,EACD;AAGA,SAAO,uBAAwB,IAAK;AAGpC,SAAO,qBAAsB,IAAK;AAElC,QAAM,QAAQ,yBAA0B,aAAc;AAEtD,MAAK,MAAM,UAAU,CAAE,yBAA0B,OAAO,IAAK,GAAI;AAChE,WAAO,EAAE,MAAM;AAAA,EAChB;AAEA,SAAO,EAAE,MAAM,WAAW,OAAO,CAAC,EAAE;AACrC;AAiBO,SAAS,yBACf,OACA,MACC;AAGD,MACC,QACA,OAAO,WAAW,KAClB,MAAO,CAAE,EAAE,KAAK,QAAS,QAAS,MAAM,GACvC;AAKD,UAAM,YAAY;AAClB,QAAK,KAAK,MAAO,SAAU,GAAG,WAAW,GAAI;AAC5C,aAAO;AAAA,IACR;AAQA,UAAM,qBAAqB;AAC3B,QAAK,KAAK,MAAO,kBAAmB,GAAI;AACvC,aAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/block-editor/src/utils/selection.
|
|
1
|
+
// packages/block-editor/src/utils/selection.ts
|
|
2
2
|
import { RichTextData } from "@wordpress/rich-text";
|
|
3
3
|
var START_OF_SELECTED_AREA = "";
|
|
4
4
|
function retrieveSelectedAttribute(blockAttributes) {
|
|
@@ -18,6 +18,7 @@ function findRichTextAttributeKey(blockType) {
|
|
|
18
18
|
return key;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
return void 0;
|
|
21
22
|
}
|
|
22
23
|
export {
|
|
23
24
|
START_OF_SELECTED_AREA,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/selection.
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { RichTextData } from '@wordpress/rich-text';\n\n/**\n * A robust way to retain selection position through various\n * transforms is to insert a special character at the position and\n * then recover it.\n */\nexport const START_OF_SELECTED_AREA = '\\u0086';\n\n/**\n * Retrieve the block attribute that contains the selection position.\n *\n * @param
|
|
5
|
-
"mappings": ";AAGA,SAAS,oBAAoB;AAOtB,IAAM,yBAAyB;AAQ/B,SAAS,
|
|
3
|
+
"sources": ["../../src/utils/selection.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { RichTextData } from '@wordpress/rich-text';\n\n/**\n * A robust way to retain selection position through various\n * transforms is to insert a special character at the position and\n * then recover it.\n */\nexport const START_OF_SELECTED_AREA = '\\u0086';\n\n/**\n * Retrieve the block attribute that contains the selection position.\n *\n * @param blockAttributes Block attributes.\n * @return The name of the block attribute that was previously selected.\n */\nexport function retrieveSelectedAttribute(\n\tblockAttributes: Record< string, unknown > | undefined\n) {\n\tif ( ! blockAttributes ) {\n\t\treturn;\n\t}\n\n\treturn Object.keys( blockAttributes ).find( ( name ) => {\n\t\tconst value = blockAttributes[ name ];\n\t\treturn (\n\t\t\t( typeof value === 'string' || value instanceof RichTextData ) &&\n\t\t\t// To do: refactor this to use rich text's selection instead, so we\n\t\t\t// no longer have to use on this hack inserting a special character.\n\t\t\tvalue.toString().indexOf( START_OF_SELECTED_AREA ) !== -1\n\t\t);\n\t} );\n}\n\ntype BlockTypeWithAttributes = {\n\tattributes: Record< string, { source?: string } >;\n};\n\nexport function findRichTextAttributeKey( blockType: BlockTypeWithAttributes ) {\n\tfor ( const [ key, value ] of Object.entries( blockType.attributes ) ) {\n\t\tif ( value.source === 'rich-text' || value.source === 'html' ) {\n\t\t\treturn key;\n\t\t}\n\t}\n\treturn undefined;\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,oBAAoB;AAOtB,IAAM,yBAAyB;AAQ/B,SAAS,0BACf,iBACC;AACD,MAAK,CAAE,iBAAkB;AACxB;AAAA,EACD;AAEA,SAAO,OAAO,KAAM,eAAgB,EAAE,KAAM,CAAE,SAAU;AACvD,UAAM,QAAQ,gBAAiB,IAAK;AACpC,YACG,OAAO,UAAU,YAAY,iBAAiB;AAAA;AAAA,IAGhD,MAAM,SAAS,EAAE,QAAS,sBAAuB,MAAM;AAAA,EAEzD,CAAE;AACH;AAMO,SAAS,yBAA0B,WAAqC;AAC9E,aAAY,CAAE,KAAK,KAAM,KAAK,OAAO,QAAS,UAAU,UAAW,GAAI;AACtE,QAAK,MAAM,WAAW,eAAe,MAAM,WAAW,QAAS;AAC9D,aAAO;AAAA,IACR;AAAA,EACD;AACA,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
// packages/block-editor/src/utils/sorting.
|
|
1
|
+
// packages/block-editor/src/utils/sorting.ts
|
|
2
|
+
function isGreater(a, b) {
|
|
3
|
+
if (typeof a === "string" && typeof b === "string") {
|
|
4
|
+
return a > b;
|
|
5
|
+
}
|
|
6
|
+
return Number(a) > Number(b);
|
|
7
|
+
}
|
|
2
8
|
var comparator = (field, items, order) => {
|
|
3
9
|
return (a, b) => {
|
|
4
10
|
let cmpA, cmpB;
|
|
@@ -9,9 +15,9 @@ var comparator = (field, items, order) => {
|
|
|
9
15
|
cmpA = a[field];
|
|
10
16
|
cmpB = b[field];
|
|
11
17
|
}
|
|
12
|
-
if (cmpA
|
|
18
|
+
if (isGreater(cmpA, cmpB)) {
|
|
13
19
|
return order === "asc" ? 1 : -1;
|
|
14
|
-
} else if (cmpB
|
|
20
|
+
} else if (isGreater(cmpB, cmpA)) {
|
|
15
21
|
return order === "asc" ? -1 : 1;
|
|
16
22
|
}
|
|
17
23
|
const orderA = items.findIndex((item) => item === a);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/sorting.
|
|
4
|
-
"sourcesContent": ["/**\n * Recursive stable sorting comparator function.\n *\n * @param
|
|
5
|
-
"mappings": ";
|
|
3
|
+
"sources": ["../../src/utils/sorting.ts"],
|
|
4
|
+
"sourcesContent": ["type Comparable = string | number | undefined;\ntype SortItem = Record< string, Comparable >;\ntype SortField< T > = string | ( ( item: T ) => Comparable );\n\n/**\n * Mirrors the `>` operator for `Comparable` values: lexicographic when both\n * are strings, numeric otherwise (an `undefined` operand is never greater).\n *\n * @param a Left-hand value.\n * @param b Right-hand value.\n * @return Whether `a` is greater than `b`.\n */\nfunction isGreater( a: Comparable, b: Comparable ): boolean {\n\tif ( typeof a === 'string' && typeof b === 'string' ) {\n\t\treturn a > b;\n\t}\n\treturn Number( a ) > Number( b );\n}\n\n/**\n * Recursive stable sorting comparator function.\n *\n * @param field Field to sort by.\n * @param items Items to sort.\n * @param order Order, 'asc' or 'desc'.\n * @return Comparison function to be used in a `.sort()`.\n */\nconst comparator = < T extends SortItem >(\n\tfield: SortField< T >,\n\titems: T[],\n\torder: string\n) => {\n\treturn ( a: T, b: T ) => {\n\t\tlet cmpA: Comparable, cmpB: Comparable;\n\n\t\tif ( typeof field === 'function' ) {\n\t\t\tcmpA = field( a );\n\t\t\tcmpB = field( b );\n\t\t} else {\n\t\t\tcmpA = a[ field ];\n\t\t\tcmpB = b[ field ];\n\t\t}\n\n\t\tif ( isGreater( cmpA, cmpB ) ) {\n\t\t\treturn order === 'asc' ? 1 : -1;\n\t\t} else if ( isGreater( cmpB, cmpA ) ) {\n\t\t\treturn order === 'asc' ? -1 : 1;\n\t\t}\n\n\t\tconst orderA = items.findIndex( ( item ) => item === a );\n\t\tconst orderB = items.findIndex( ( item ) => item === b );\n\n\t\t// Stable sort: maintaining original array order\n\t\tif ( orderA > orderB ) {\n\t\t\treturn 1;\n\t\t} else if ( orderB > orderA ) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn 0;\n\t};\n};\n\n/**\n * Order items by a certain key.\n * Supports decorator functions that allow complex picking of a comparison field.\n * Sorts in ascending order by default, but supports descending as well.\n * Stable sort - maintains original order of equal items.\n *\n * @param items Items to order.\n * @param field Field to order by.\n * @param order Sorting order, `asc` or `desc`.\n * @return Sorted items.\n */\nexport function orderBy< T extends SortItem >(\n\titems: T[],\n\tfield: SortField< T >,\n\torder = 'asc'\n) {\n\treturn items.concat().sort( comparator( field, items, order ) );\n}\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,UAAW,GAAe,GAAyB;AAC3D,MAAK,OAAO,MAAM,YAAY,OAAO,MAAM,UAAW;AACrD,WAAO,IAAI;AAAA,EACZ;AACA,SAAO,OAAQ,CAAE,IAAI,OAAQ,CAAE;AAChC;AAUA,IAAM,aAAa,CAClB,OACA,OACA,UACI;AACJ,SAAO,CAAE,GAAM,MAAU;AACxB,QAAI,MAAkB;AAEtB,QAAK,OAAO,UAAU,YAAa;AAClC,aAAO,MAAO,CAAE;AAChB,aAAO,MAAO,CAAE;AAAA,IACjB,OAAO;AACN,aAAO,EAAG,KAAM;AAChB,aAAO,EAAG,KAAM;AAAA,IACjB;AAEA,QAAK,UAAW,MAAM,IAAK,GAAI;AAC9B,aAAO,UAAU,QAAQ,IAAI;AAAA,IAC9B,WAAY,UAAW,MAAM,IAAK,GAAI;AACrC,aAAO,UAAU,QAAQ,KAAK;AAAA,IAC/B;AAEA,UAAM,SAAS,MAAM,UAAW,CAAE,SAAU,SAAS,CAAE;AACvD,UAAM,SAAS,MAAM,UAAW,CAAE,SAAU,SAAS,CAAE;AAGvD,QAAK,SAAS,QAAS;AACtB,aAAO;AAAA,IACR,WAAY,SAAS,QAAS;AAC7B,aAAO;AAAA,IACR;AAEA,WAAO;AAAA,EACR;AACD;AAaO,SAAS,QACf,OACA,OACA,QAAQ,OACP;AACD,SAAO,MAAM,OAAO,EAAE,KAAM,WAAY,OAAO,OAAO,KAAM,CAAE;AAC/D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// packages/block-editor/src/utils/transform-styles/index.
|
|
1
|
+
// packages/block-editor/src/utils/transform-styles/index.ts
|
|
2
2
|
import * as parsel from "parsel-js";
|
|
3
3
|
import Processor from "postcss/lib/processor";
|
|
4
4
|
import CssSyntaxError from "postcss/lib/css-syntax-error";
|
|
@@ -34,7 +34,8 @@ function prefixRootSelector(prefix, selector) {
|
|
|
34
34
|
0,
|
|
35
35
|
{
|
|
36
36
|
type: "combinator",
|
|
37
|
-
content: " "
|
|
37
|
+
content: " ",
|
|
38
|
+
pos: [0, 0]
|
|
38
39
|
},
|
|
39
40
|
...tokenizedPrefix
|
|
40
41
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/utils/transform-styles/index.
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport * as parsel from 'parsel-js';\nimport Processor from 'postcss/lib/processor';\nimport CssSyntaxError from 'postcss/lib/css-syntax-error';\nimport prefixSelector from 'postcss-prefix-selector';\nimport rebaseUrl from 'postcss-urlrebase';\n\nconst cacheByWrapperSelector = new Map();\n\nconst ROOT_SELECTOR_TOKENS = [\n\t{ type: 'type', content: 'body' },\n\t{ type: 'type', content: 'html' },\n\t{ type: 'pseudo-class', content: ':root' },\n\t{ type: 'pseudo-class', content: ':where(body)' },\n\t{ type: 'pseudo-class', content: ':where(:root)' },\n\t{ type: 'pseudo-class', content: ':where(html)' },\n];\n\n/**\n * Prefixes root selectors in a way that ensures consistent specificity.\n * This requires special handling, since prefixing a classname before\n * html, body, or :root will generally result in an invalid selector.\n *\n * Some libraries will simply replace the root selector with the prefix\n * instead, but this results in inconsistent specificity.\n *\n * This function instead inserts the prefix after the root tags but before\n * any other part of the selector. This results in consistent specificity:\n * - If a `:where()` selector is used for the prefix, all selectors output\n * by `transformStyles` will have no specificity increase.\n * - If a classname, id, or something else is used as the prefix, all selectors\n * will have the same specificity bump when transformed.\n *\n * @param
|
|
5
|
-
"mappings": ";
|
|
3
|
+
"sources": ["../../../src/utils/transform-styles/index.ts"],
|
|
4
|
+
"sourcesContent": ["/// <reference path=\"./postcss-urlrebase.d.ts\" />\n\n/**\n * External dependencies\n */\nimport * as parsel from 'parsel-js';\nimport Processor from 'postcss/lib/processor';\nimport CssSyntaxError from 'postcss/lib/css-syntax-error';\nimport prefixSelector from 'postcss-prefix-selector';\nimport rebaseUrl from 'postcss-urlrebase';\n\n/**\n * Internal dependencies\n */\nimport type { EditorStyle, TransformOptions } from './types';\n\nconst cacheByWrapperSelector = new Map();\n\nconst ROOT_SELECTOR_TOKENS = [\n\t{ type: 'type', content: 'body' },\n\t{ type: 'type', content: 'html' },\n\t{ type: 'pseudo-class', content: ':root' },\n\t{ type: 'pseudo-class', content: ':where(body)' },\n\t{ type: 'pseudo-class', content: ':where(:root)' },\n\t{ type: 'pseudo-class', content: ':where(html)' },\n];\n\n/**\n * Prefixes root selectors in a way that ensures consistent specificity.\n * This requires special handling, since prefixing a classname before\n * html, body, or :root will generally result in an invalid selector.\n *\n * Some libraries will simply replace the root selector with the prefix\n * instead, but this results in inconsistent specificity.\n *\n * This function instead inserts the prefix after the root tags but before\n * any other part of the selector. This results in consistent specificity:\n * - If a `:where()` selector is used for the prefix, all selectors output\n * by `transformStyles` will have no specificity increase.\n * - If a classname, id, or something else is used as the prefix, all selectors\n * will have the same specificity bump when transformed.\n *\n * @param prefix The prefix.\n * @param selector The selector.\n *\n * @return The prefixed root selector.\n */\nfunction prefixRootSelector( prefix: string, selector: string ) {\n\t// Use a tokenizer, since regular expressions are unreliable.\n\tconst tokenized = parsel.tokenize( selector );\n\n\t// Find the last token that contains a root selector by walking back\n\t// through the tokens.\n\tconst lastRootIndex = tokenized.findLastIndex( ( { content, type } ) => {\n\t\treturn ROOT_SELECTOR_TOKENS.some(\n\t\t\t( rootSelector ) =>\n\t\t\t\tcontent === rootSelector.content && type === rootSelector.type\n\t\t);\n\t} );\n\n\t// Walk forwards to find the combinator after the last root.\n\t// This is where the root ends and the rest of the selector begins,\n\t// and the index to insert before.\n\t// Doing it this way takes into account that a root selector like\n\t// 'body' may have additional id/class/pseudo-class/attribute-selector\n\t// parts chained to it, which is difficult to quantify using a regex.\n\tlet insertionPoint = -1;\n\tfor ( let i = lastRootIndex + 1; i < tokenized.length; i++ ) {\n\t\tif ( tokenized[ i ].type === 'combinator' ) {\n\t\t\tinsertionPoint = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Tokenize and insert the prefix with a ' ' combinator before it.\n\tconst tokenizedPrefix = parsel.tokenize( prefix );\n\ttokenized.splice(\n\t\t// Insert at the insertion point, or the end.\n\t\tinsertionPoint === -1 ? tokenized.length : insertionPoint,\n\t\t0,\n\t\t{\n\t\t\ttype: 'combinator',\n\t\t\tcontent: ' ',\n\t\t\tpos: [ 0, 0 ],\n\t\t} as parsel.Token,\n\t\t...tokenizedPrefix\n\t);\n\n\treturn parsel.stringify( tokenized );\n}\n\nfunction transformStyle(\n\t{ css, ignoredSelectors = [], baseURL }: EditorStyle,\n\twrapperSelector = '',\n\ttransformOptions?: TransformOptions\n) {\n\t// When there is no wrapper selector and no base URL, there is no need\n\t// to transform the CSS. This is most cases because in the default\n\t// iframed editor, no wrapping is needed, and not many styles\n\t// provide a base URL.\n\tif ( ! wrapperSelector && ! baseURL ) {\n\t\treturn css;\n\t}\n\n\ttry {\n\t\tconst excludedSelectors = [\n\t\t\t...ignoredSelectors,\n\t\t\t...( transformOptions?.ignoredSelectors ?? [] ),\n\t\t\twrapperSelector,\n\t\t];\n\n\t\treturn new Processor(\n\t\t\t[\n\t\t\t\twrapperSelector &&\n\t\t\t\t\tprefixSelector( {\n\t\t\t\t\t\tprefix: wrapperSelector,\n\t\t\t\t\t\ttransform( prefix, selector, prefixedSelector ) {\n\t\t\t\t\t\t\t// For backwards compatibility, don't use the `exclude` option\n\t\t\t\t\t\t\t// of postcss-prefix-selector, instead handle it here to match\n\t\t\t\t\t\t\t// the behavior of the old library (postcss-prefix-wrap) that\n\t\t\t\t\t\t\t// `transformStyle` previously used.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\texcludedSelectors.some( ( excludedSelector ) =>\n\t\t\t\t\t\t\t\t\texcludedSelector instanceof RegExp\n\t\t\t\t\t\t\t\t\t\t? selector.match( excludedSelector )\n\t\t\t\t\t\t\t\t\t\t: selector.includes( excludedSelector )\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn selector;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst hasRootSelector = ROOT_SELECTOR_TOKENS.some(\n\t\t\t\t\t\t\t\t( rootSelector ) =>\n\t\t\t\t\t\t\t\t\tselector.startsWith( rootSelector.content )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t// Reorganize root selectors such that the root part comes before the prefix,\n\t\t\t\t\t\t\t// but the prefix still comes before the remaining part of the selector.\n\t\t\t\t\t\t\tif ( hasRootSelector ) {\n\t\t\t\t\t\t\t\treturn prefixRootSelector( prefix, selector );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn prefixedSelector;\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t\tbaseURL && rebaseUrl( { rootUrl: baseURL } ),\n\t\t\t].filter( Boolean ) as import('postcss').AcceptedPlugin[]\n\t\t).process( css, {} ).css; // use sync PostCSS API\n\t} catch ( error ) {\n\t\tif ( error instanceof CssSyntaxError ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\terror.message + '\\n' + error.showSourceCode( false )\n\t\t\t);\n\t\t} else {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\terror\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\n/**\n * Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed.\n *\n * @param styles CSS rules.\n * @param wrapperSelector Wrapper selector.\n * @param transformOptions Additional options for style transformation.\n * @return converted rules.\n */\nconst transformStyles = (\n\tstyles: EditorStyle[],\n\twrapperSelector = '',\n\ttransformOptions?: TransformOptions\n) => {\n\tlet cache = cacheByWrapperSelector.get( wrapperSelector );\n\tif ( ! cache ) {\n\t\tcache = new WeakMap();\n\t\tcacheByWrapperSelector.set( wrapperSelector, cache );\n\t}\n\treturn styles.map( ( style ) => {\n\t\tlet css = cache.get( style );\n\t\tif ( ! css ) {\n\t\t\tcss = transformStyle( style, wrapperSelector, transformOptions );\n\t\t\tcache.set( style, css );\n\t\t}\n\t\treturn css;\n\t} );\n};\n\nexport default transformStyles;\n"],
|
|
5
|
+
"mappings": ";AAKA,YAAY,YAAY;AACxB,OAAO,eAAe;AACtB,OAAO,oBAAoB;AAC3B,OAAO,oBAAoB;AAC3B,OAAO,eAAe;AAOtB,IAAM,yBAAyB,oBAAI,IAAI;AAEvC,IAAM,uBAAuB;AAAA,EAC5B,EAAE,MAAM,QAAQ,SAAS,OAAO;AAAA,EAChC,EAAE,MAAM,QAAQ,SAAS,OAAO;AAAA,EAChC,EAAE,MAAM,gBAAgB,SAAS,QAAQ;AAAA,EACzC,EAAE,MAAM,gBAAgB,SAAS,eAAe;AAAA,EAChD,EAAE,MAAM,gBAAgB,SAAS,gBAAgB;AAAA,EACjD,EAAE,MAAM,gBAAgB,SAAS,eAAe;AACjD;AAsBA,SAAS,mBAAoB,QAAgB,UAAmB;AAE/D,QAAM,YAAmB,gBAAU,QAAS;AAI5C,QAAM,gBAAgB,UAAU,cAAe,CAAE,EAAE,SAAS,KAAK,MAAO;AACvE,WAAO,qBAAqB;AAAA,MAC3B,CAAE,iBACD,YAAY,aAAa,WAAW,SAAS,aAAa;AAAA,IAC5D;AAAA,EACD,CAAE;AAQF,MAAI,iBAAiB;AACrB,WAAU,IAAI,gBAAgB,GAAG,IAAI,UAAU,QAAQ,KAAM;AAC5D,QAAK,UAAW,CAAE,EAAE,SAAS,cAAe;AAC3C,uBAAiB;AACjB;AAAA,IACD;AAAA,EACD;AAGA,QAAM,kBAAyB,gBAAU,MAAO;AAChD,YAAU;AAAA;AAAA,IAET,mBAAmB,KAAK,UAAU,SAAS;AAAA,IAC3C;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,SAAS;AAAA,MACT,KAAK,CAAE,GAAG,CAAE;AAAA,IACb;AAAA,IACA,GAAG;AAAA,EACJ;AAEA,SAAc,iBAAW,SAAU;AACpC;AAEA,SAAS,eACR,EAAE,KAAK,mBAAmB,CAAC,GAAG,QAAQ,GACtC,kBAAkB,IAClB,kBACC;AAKD,MAAK,CAAE,mBAAmB,CAAE,SAAU;AACrC,WAAO;AAAA,EACR;AAEA,MAAI;AACH,UAAM,oBAAoB;AAAA,MACzB,GAAG;AAAA,MACH,GAAK,kBAAkB,oBAAoB,CAAC;AAAA,MAC5C;AAAA,IACD;AAEA,WAAO,IAAI;AAAA,MACV;AAAA,QACC,mBACC,eAAgB;AAAA,UACf,QAAQ;AAAA,UACR,UAAW,QAAQ,UAAU,kBAAmB;AAK/C,gBACC,kBAAkB;AAAA,cAAM,CAAE,qBACzB,4BAA4B,SACzB,SAAS,MAAO,gBAAiB,IACjC,SAAS,SAAU,gBAAiB;AAAA,YACxC,GACC;AACD,qBAAO;AAAA,YACR;AAEA,kBAAM,kBAAkB,qBAAqB;AAAA,cAC5C,CAAE,iBACD,SAAS,WAAY,aAAa,OAAQ;AAAA,YAC5C;AAIA,gBAAK,iBAAkB;AACtB,qBAAO,mBAAoB,QAAQ,QAAS;AAAA,YAC7C;AAEA,mBAAO;AAAA,UACR;AAAA,QACD,CAAE;AAAA,QACH,WAAW,UAAW,EAAE,SAAS,QAAQ,CAAE;AAAA,MAC5C,EAAE,OAAQ,OAAQ;AAAA,IACnB,EAAE,QAAS,KAAK,CAAC,CAAE,EAAE;AAAA,EACtB,SAAU,OAAQ;AACjB,QAAK,iBAAiB,gBAAiB;AAEtC,cAAQ;AAAA,QACP;AAAA,QACA,MAAM,UAAU,OAAO,MAAM,eAAgB,KAAM;AAAA,MACpD;AAAA,IACD,OAAO;AAEN,cAAQ;AAAA,QACP;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AACD;AAUA,IAAM,kBAAkB,CACvB,QACA,kBAAkB,IAClB,qBACI;AACJ,MAAI,QAAQ,uBAAuB,IAAK,eAAgB;AACxD,MAAK,CAAE,OAAQ;AACd,YAAQ,oBAAI,QAAQ;AACpB,2BAAuB,IAAK,iBAAiB,KAAM;AAAA,EACpD;AACA,SAAO,OAAO,IAAK,CAAE,UAAW;AAC/B,QAAI,MAAM,MAAM,IAAK,KAAM;AAC3B,QAAK,CAAE,KAAM;AACZ,YAAM,eAAgB,OAAO,iBAAiB,gBAAiB;AAC/D,YAAM,IAAK,OAAO,GAAI;AAAA,IACvB;AACA,WAAO;AAAA,EACR,CAAE;AACH;AAEA,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=postcss-urlrebase.d.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -686,6 +686,7 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
686
686
|
}
|
|
687
687
|
.block-editor-default-block-appender .block-editor-default-block-appender__content {
|
|
688
688
|
opacity: 0.62;
|
|
689
|
+
text-shadow: none;
|
|
689
690
|
margin-block-start: 0;
|
|
690
691
|
margin-block-end: 0;
|
|
691
692
|
}
|
|
@@ -877,6 +878,7 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
877
878
|
.rich-text [data-rich-text-placeholder]::after {
|
|
878
879
|
content: attr(data-rich-text-placeholder);
|
|
879
880
|
opacity: 0.62;
|
|
881
|
+
text-shadow: none;
|
|
880
882
|
}
|
|
881
883
|
.rich-text:focus {
|
|
882
884
|
outline: none;
|
package/build-style/content.css
CHANGED
|
@@ -687,6 +687,7 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
687
687
|
}
|
|
688
688
|
.block-editor-default-block-appender .block-editor-default-block-appender__content {
|
|
689
689
|
opacity: 0.62;
|
|
690
|
+
text-shadow: none;
|
|
690
691
|
margin-block-start: 0;
|
|
691
692
|
margin-block-end: 0;
|
|
692
693
|
}
|
|
@@ -878,6 +879,7 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
878
879
|
.rich-text [data-rich-text-placeholder]::after {
|
|
879
880
|
content: attr(data-rich-text-placeholder);
|
|
880
881
|
opacity: 0.62;
|
|
882
|
+
text-shadow: none;
|
|
881
883
|
}
|
|
882
884
|
.rich-text:focus {
|
|
883
885
|
outline: none;
|
|
@@ -1519,14 +1519,22 @@ iframe[name=editor-canvas] {
|
|
|
1519
1519
|
background: linear-gradient(45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
|
|
1520
1520
|
}
|
|
1521
1521
|
|
|
1522
|
+
.block-editor-panel-color-gradient-settings__contrast-notice {
|
|
1523
|
+
margin-bottom: 16px;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1522
1526
|
/**
|
|
1523
1527
|
* The following styles replicate the separated border of the
|
|
1524
1528
|
* `ItemGroup` component but allows for hidden items. This is because
|
|
1525
1529
|
* to maintain the order of `ToolsPanel` controls, each `ToolsPanelItem`
|
|
1526
1530
|
* must at least render a placeholder which would otherwise interfere
|
|
1527
1531
|
* with the `:last-child` styles.
|
|
1532
|
+
*
|
|
1533
|
+
* Applied via the shared `block-editor-color-gradient-item` class on
|
|
1534
|
+
* color/gradient dropdown items across the Color, Background, and
|
|
1535
|
+
* Typography panels.
|
|
1528
1536
|
*/
|
|
1529
|
-
.block-editor-
|
|
1537
|
+
.block-editor-color-gradient-item {
|
|
1530
1538
|
padding: 0;
|
|
1531
1539
|
max-width: 100%;
|
|
1532
1540
|
position: relative;
|
|
@@ -1534,18 +1542,17 @@ iframe[name=editor-canvas] {
|
|
|
1534
1542
|
border-left: 1px solid #ddd;
|
|
1535
1543
|
border-bottom: 1px solid #ddd;
|
|
1536
1544
|
}
|
|
1537
|
-
.block-editor-
|
|
1538
|
-
margin-top: 24px;
|
|
1545
|
+
.block-editor-color-gradient-item:nth-child(1 of .block-editor-color-gradient-item) {
|
|
1539
1546
|
border-top-right-radius: 2px;
|
|
1540
1547
|
border-top-left-radius: 2px;
|
|
1541
1548
|
border-top: 1px solid #ddd;
|
|
1542
1549
|
}
|
|
1543
|
-
.block-editor-
|
|
1550
|
+
.block-editor-color-gradient-item:nth-last-child(1 of .block-editor-color-gradient-item) {
|
|
1544
1551
|
border-bottom-right-radius: 2px;
|
|
1545
1552
|
border-bottom-left-radius: 2px;
|
|
1546
1553
|
}
|
|
1547
|
-
.block-editor-
|
|
1548
|
-
.block-editor-
|
|
1554
|
+
.block-editor-color-gradient-item > div,
|
|
1555
|
+
.block-editor-color-gradient-item > div > button {
|
|
1549
1556
|
border-radius: inherit;
|
|
1550
1557
|
}
|
|
1551
1558
|
|
|
@@ -1569,6 +1576,9 @@ iframe[name=editor-canvas] {
|
|
|
1569
1576
|
text-overflow: ellipsis;
|
|
1570
1577
|
max-width: calc(100% - 44px);
|
|
1571
1578
|
}
|
|
1579
|
+
.block-editor-tools-panel-color-gradient-settings__dropdown > button.has-contrast-warning .block-editor-panel-color-gradient-settings__color-name {
|
|
1580
|
+
max-width: calc(100% - 72px);
|
|
1581
|
+
}
|
|
1572
1582
|
|
|
1573
1583
|
.block-editor-panel-color-gradient-settings__dropdown {
|
|
1574
1584
|
width: 100%;
|
|
@@ -1600,6 +1610,19 @@ iframe[name=editor-canvas] {
|
|
|
1600
1610
|
opacity: 1;
|
|
1601
1611
|
}
|
|
1602
1612
|
}
|
|
1613
|
+
.block-editor-panel-color-gradient-settings__dropdown.has-contrast-warning + .block-editor-panel-color-gradient-settings__reset {
|
|
1614
|
+
left: 28px;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
.block-editor-panel-color-gradient-settings__contrast-warning {
|
|
1618
|
+
position: absolute;
|
|
1619
|
+
left: 0;
|
|
1620
|
+
top: 8px;
|
|
1621
|
+
margin: auto 8px auto;
|
|
1622
|
+
}
|
|
1623
|
+
.block-editor-panel-color-gradient-settings__contrast-warning.block-editor-panel-color-gradient-settings__contrast-warning {
|
|
1624
|
+
border-radius: 2px;
|
|
1625
|
+
}
|
|
1603
1626
|
|
|
1604
1627
|
.block-editor-date-format-picker {
|
|
1605
1628
|
margin: 0 0 16px;
|
|
@@ -3410,33 +3433,6 @@ iframe[name=editor-canvas] {
|
|
|
3410
3433
|
font-size: 12px;
|
|
3411
3434
|
}
|
|
3412
3435
|
|
|
3413
|
-
/**
|
|
3414
|
-
* ItemGroup-like border styles for the background panel's ToolsPanelItems.
|
|
3415
|
-
* Replicates the separated border of the `ItemGroup` component while
|
|
3416
|
-
* allowing for hidden placeholder items (same approach as the color panel).
|
|
3417
|
-
*/
|
|
3418
|
-
.block-editor-background-panel__item {
|
|
3419
|
-
padding: 0;
|
|
3420
|
-
max-width: 100%;
|
|
3421
|
-
position: relative;
|
|
3422
|
-
border-right: 1px solid #ddd;
|
|
3423
|
-
border-left: 1px solid #ddd;
|
|
3424
|
-
border-bottom: 1px solid #ddd;
|
|
3425
|
-
}
|
|
3426
|
-
.block-editor-background-panel__item:nth-child(1 of .block-editor-background-panel__item) {
|
|
3427
|
-
border-top-right-radius: 2px;
|
|
3428
|
-
border-top-left-radius: 2px;
|
|
3429
|
-
border-top: 1px solid #ddd;
|
|
3430
|
-
}
|
|
3431
|
-
.block-editor-background-panel__item:nth-last-child(1 of .block-editor-background-panel__item) {
|
|
3432
|
-
border-bottom-right-radius: 2px;
|
|
3433
|
-
border-bottom-left-radius: 2px;
|
|
3434
|
-
}
|
|
3435
|
-
.block-editor-background-panel__item > div,
|
|
3436
|
-
.block-editor-background-panel__item > div > button {
|
|
3437
|
-
border-radius: inherit;
|
|
3438
|
-
}
|
|
3439
|
-
|
|
3440
3436
|
.background-block-support-panel {
|
|
3441
3437
|
/* Increased specificity required to remove the slot wrapper's row gap */
|
|
3442
3438
|
}
|
|
@@ -3651,15 +3647,12 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
3651
3647
|
.color-block-support-panel.color-block-support-panel .color-block-support-panel__inner-wrapper {
|
|
3652
3648
|
row-gap: 0;
|
|
3653
3649
|
}
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
* we need to remove the top margin when wrapping inner content due to
|
|
3658
|
-
* rendering via SlotFills.
|
|
3659
|
-
*/
|
|
3650
|
+
|
|
3651
|
+
.elements-block-support-panel {
|
|
3652
|
+
/* Increased specificity required to remove the slot wrapper's row gap */
|
|
3660
3653
|
}
|
|
3661
|
-
.
|
|
3662
|
-
|
|
3654
|
+
.elements-block-support-panel.elements-block-support-panel .elements-block-support-panel__inner-wrapper {
|
|
3655
|
+
row-gap: 0;
|
|
3663
3656
|
}
|
|
3664
3657
|
|
|
3665
3658
|
.dimensions-block-support-panel .single-column {
|
package/build-style/style.css
CHANGED
|
@@ -1519,14 +1519,22 @@ iframe[name=editor-canvas] {
|
|
|
1519
1519
|
background: linear-gradient(-45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
|
|
1520
1520
|
}
|
|
1521
1521
|
|
|
1522
|
+
.block-editor-panel-color-gradient-settings__contrast-notice {
|
|
1523
|
+
margin-bottom: 16px;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1522
1526
|
/**
|
|
1523
1527
|
* The following styles replicate the separated border of the
|
|
1524
1528
|
* `ItemGroup` component but allows for hidden items. This is because
|
|
1525
1529
|
* to maintain the order of `ToolsPanel` controls, each `ToolsPanelItem`
|
|
1526
1530
|
* must at least render a placeholder which would otherwise interfere
|
|
1527
1531
|
* with the `:last-child` styles.
|
|
1532
|
+
*
|
|
1533
|
+
* Applied via the shared `block-editor-color-gradient-item` class on
|
|
1534
|
+
* color/gradient dropdown items across the Color, Background, and
|
|
1535
|
+
* Typography panels.
|
|
1528
1536
|
*/
|
|
1529
|
-
.block-editor-
|
|
1537
|
+
.block-editor-color-gradient-item {
|
|
1530
1538
|
padding: 0;
|
|
1531
1539
|
max-width: 100%;
|
|
1532
1540
|
position: relative;
|
|
@@ -1534,18 +1542,17 @@ iframe[name=editor-canvas] {
|
|
|
1534
1542
|
border-right: 1px solid #ddd;
|
|
1535
1543
|
border-bottom: 1px solid #ddd;
|
|
1536
1544
|
}
|
|
1537
|
-
.block-editor-
|
|
1538
|
-
margin-top: 24px;
|
|
1545
|
+
.block-editor-color-gradient-item:nth-child(1 of .block-editor-color-gradient-item) {
|
|
1539
1546
|
border-top-left-radius: 2px;
|
|
1540
1547
|
border-top-right-radius: 2px;
|
|
1541
1548
|
border-top: 1px solid #ddd;
|
|
1542
1549
|
}
|
|
1543
|
-
.block-editor-
|
|
1550
|
+
.block-editor-color-gradient-item:nth-last-child(1 of .block-editor-color-gradient-item) {
|
|
1544
1551
|
border-bottom-left-radius: 2px;
|
|
1545
1552
|
border-bottom-right-radius: 2px;
|
|
1546
1553
|
}
|
|
1547
|
-
.block-editor-
|
|
1548
|
-
.block-editor-
|
|
1554
|
+
.block-editor-color-gradient-item > div,
|
|
1555
|
+
.block-editor-color-gradient-item > div > button {
|
|
1549
1556
|
border-radius: inherit;
|
|
1550
1557
|
}
|
|
1551
1558
|
|
|
@@ -1569,6 +1576,9 @@ iframe[name=editor-canvas] {
|
|
|
1569
1576
|
text-overflow: ellipsis;
|
|
1570
1577
|
max-width: calc(100% - 44px);
|
|
1571
1578
|
}
|
|
1579
|
+
.block-editor-tools-panel-color-gradient-settings__dropdown > button.has-contrast-warning .block-editor-panel-color-gradient-settings__color-name {
|
|
1580
|
+
max-width: calc(100% - 72px);
|
|
1581
|
+
}
|
|
1572
1582
|
|
|
1573
1583
|
.block-editor-panel-color-gradient-settings__dropdown {
|
|
1574
1584
|
width: 100%;
|
|
@@ -1600,6 +1610,19 @@ iframe[name=editor-canvas] {
|
|
|
1600
1610
|
opacity: 1;
|
|
1601
1611
|
}
|
|
1602
1612
|
}
|
|
1613
|
+
.block-editor-panel-color-gradient-settings__dropdown.has-contrast-warning + .block-editor-panel-color-gradient-settings__reset {
|
|
1614
|
+
right: 28px;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
.block-editor-panel-color-gradient-settings__contrast-warning {
|
|
1618
|
+
position: absolute;
|
|
1619
|
+
right: 0;
|
|
1620
|
+
top: 8px;
|
|
1621
|
+
margin: auto 8px auto;
|
|
1622
|
+
}
|
|
1623
|
+
.block-editor-panel-color-gradient-settings__contrast-warning.block-editor-panel-color-gradient-settings__contrast-warning {
|
|
1624
|
+
border-radius: 2px;
|
|
1625
|
+
}
|
|
1603
1626
|
|
|
1604
1627
|
.block-editor-date-format-picker {
|
|
1605
1628
|
margin: 0 0 16px;
|
|
@@ -3412,33 +3435,6 @@ iframe[name=editor-canvas] {
|
|
|
3412
3435
|
font-size: 12px;
|
|
3413
3436
|
}
|
|
3414
3437
|
|
|
3415
|
-
/**
|
|
3416
|
-
* ItemGroup-like border styles for the background panel's ToolsPanelItems.
|
|
3417
|
-
* Replicates the separated border of the `ItemGroup` component while
|
|
3418
|
-
* allowing for hidden placeholder items (same approach as the color panel).
|
|
3419
|
-
*/
|
|
3420
|
-
.block-editor-background-panel__item {
|
|
3421
|
-
padding: 0;
|
|
3422
|
-
max-width: 100%;
|
|
3423
|
-
position: relative;
|
|
3424
|
-
border-left: 1px solid #ddd;
|
|
3425
|
-
border-right: 1px solid #ddd;
|
|
3426
|
-
border-bottom: 1px solid #ddd;
|
|
3427
|
-
}
|
|
3428
|
-
.block-editor-background-panel__item:nth-child(1 of .block-editor-background-panel__item) {
|
|
3429
|
-
border-top-left-radius: 2px;
|
|
3430
|
-
border-top-right-radius: 2px;
|
|
3431
|
-
border-top: 1px solid #ddd;
|
|
3432
|
-
}
|
|
3433
|
-
.block-editor-background-panel__item:nth-last-child(1 of .block-editor-background-panel__item) {
|
|
3434
|
-
border-bottom-left-radius: 2px;
|
|
3435
|
-
border-bottom-right-radius: 2px;
|
|
3436
|
-
}
|
|
3437
|
-
.block-editor-background-panel__item > div,
|
|
3438
|
-
.block-editor-background-panel__item > div > button {
|
|
3439
|
-
border-radius: inherit;
|
|
3440
|
-
}
|
|
3441
|
-
|
|
3442
3438
|
.background-block-support-panel {
|
|
3443
3439
|
/* Increased specificity required to remove the slot wrapper's row gap */
|
|
3444
3440
|
}
|
|
@@ -3653,15 +3649,12 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
3653
3649
|
.color-block-support-panel.color-block-support-panel .color-block-support-panel__inner-wrapper {
|
|
3654
3650
|
row-gap: 0;
|
|
3655
3651
|
}
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
* we need to remove the top margin when wrapping inner content due to
|
|
3660
|
-
* rendering via SlotFills.
|
|
3661
|
-
*/
|
|
3652
|
+
|
|
3653
|
+
.elements-block-support-panel {
|
|
3654
|
+
/* Increased specificity required to remove the slot wrapper's row gap */
|
|
3662
3655
|
}
|
|
3663
|
-
.
|
|
3664
|
-
|
|
3656
|
+
.elements-block-support-panel.elements-block-support-panel .elements-block-support-panel__inner-wrapper {
|
|
3657
|
+
row-gap: 0;
|
|
3665
3658
|
}
|
|
3666
3659
|
|
|
3667
3660
|
.dimensions-block-support-panel .single-column {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type Binding = {
|
|
2
|
+
source?: string;
|
|
3
|
+
};
|
|
4
|
+
type Bindings = Record<string, Binding>;
|
|
5
|
+
/**
|
|
6
|
+
* Checks if the block has the `__default` binding for pattern overrides.
|
|
7
|
+
*
|
|
8
|
+
* @param bindings A block's bindings from the metadata attribute.
|
|
9
|
+
*
|
|
10
|
+
* @return Whether the block has the `__default` binding for pattern overrides.
|
|
11
|
+
*/
|
|
12
|
+
export declare function hasPatternOverridesDefaultBinding(bindings: Bindings | undefined | null): bindings is Bindings;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the bindings with the `__default` binding for pattern overrides
|
|
15
|
+
* replaced with the full-set of supported attributes. e.g.:
|
|
16
|
+
*
|
|
17
|
+
* - bindings passed in: `{ __default: { source: 'core/pattern-overrides' } }`
|
|
18
|
+
* - bindings returned: `{ content: { source: 'core/pattern-overrides' } }`
|
|
19
|
+
*
|
|
20
|
+
* @param bindings A block's bindings from the metadata attribute.
|
|
21
|
+
* @param supportedAttributes The block's attributes which are supported by block bindings.
|
|
22
|
+
*
|
|
23
|
+
* @return The bindings with default replaced for pattern overrides.
|
|
24
|
+
*/
|
|
25
|
+
export declare function replacePatternOverridesDefaultBinding(bindings: Bindings | undefined | null, supportedAttributes: string[]): Bindings | null | undefined;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=block-bindings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-bindings.d.ts","sourceRoot":"","sources":["../../src/utils/block-bindings.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACnC,KAAK,QAAQ,GAAG,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,CAAC;AAK1C;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAChD,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,GACnC,QAAQ,IAAI,QAAQ,CAEtB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qCAAqC,CACpD,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,EACrC,mBAAmB,EAAE,MAAM,EAAE,+BAiB7B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts the palette slug from a style value for any preset type, supporting
|
|
3
|
+
* both the user preset format and the theme CSS-variable format:
|
|
4
|
+
*
|
|
5
|
+
* - User format: `var:preset|<type>|slug`
|
|
6
|
+
* - Theme format: `var(--wp--preset--<type>--slug)`
|
|
7
|
+
*
|
|
8
|
+
* Returns `undefined` for plain values, non-strings, or any other
|
|
9
|
+
* unrecognised format.
|
|
10
|
+
*
|
|
11
|
+
* @param rawValue Raw style value stored in the style object.
|
|
12
|
+
* @param type Preset type, e.g. `'color'` or `'gradient'`.
|
|
13
|
+
* @return The palette slug, or undefined.
|
|
14
|
+
*/
|
|
15
|
+
export declare function extractPresetSlug(rawValue: unknown, type: 'color' | 'gradient'): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Encodes a color value for storage in the style object.
|
|
18
|
+
*
|
|
19
|
+
* When a `slug` is provided it is used directly (the slug-based selection
|
|
20
|
+
* path). This is important because two palette entries can share the same
|
|
21
|
+
* hex value (e.g. two custom colors both set to `#e10000`); relying on a
|
|
22
|
+
* hex lookup alone would collapse them onto whichever entry appears first
|
|
23
|
+
* in the palette and silently discard the user's actual choice. Only when
|
|
24
|
+
* no slug is supplied does the function fall back to matching the hex value
|
|
25
|
+
* against the palette; if a match is found the slug is encoded, otherwise
|
|
26
|
+
* the raw value is stored as-is.
|
|
27
|
+
*
|
|
28
|
+
* Callers pass the flattened palette (`allColors`), typically computed once
|
|
29
|
+
* per render from the per-origin `colors` array.
|
|
30
|
+
*
|
|
31
|
+
* @param allColors Flat array of `{ color, slug }` objects.
|
|
32
|
+
* @param colorValue Hex or CSS color string.
|
|
33
|
+
* @param slug Optional palette slug from slug-aware selection.
|
|
34
|
+
* @return Encoded value suitable for the style object.
|
|
35
|
+
*/
|
|
36
|
+
export declare function encodeColorValueWithPalette(allColors: {
|
|
37
|
+
color: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
}[], colorValue?: string, slug?: string): string | undefined;
|
|
40
|
+
//# sourceMappingURL=color-values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-values.d.ts","sourceRoot":"","sources":["../../src/utils/color-values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,OAAO,EACjB,IAAI,EAAE,OAAO,GAAG,UAAU,sBAc1B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,2BAA2B,CAC1C,SAAS,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,EAC5C,UAAU,CAAC,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,MAAM,sBAOb"}
|