@wordpress/block-editor 13.1.0 → 13.3.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 +21 -17
- package/README.md +1 -2
- package/build/components/block-breadcrumb/index.js +12 -1
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-lock/modal.js +67 -67
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-lock/toolbar.js +0 -1
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-mover/button.js +1 -1
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.js +12 -6
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +2 -2
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-patterns-paging/index.js +5 -7
- package/build/components/block-patterns-paging/index.js.map +1 -1
- package/build/components/block-quick-navigation/index.js +20 -17
- package/build/components/block-quick-navigation/index.js.map +1 -1
- package/build/components/block-rename/modal.js +4 -12
- package/build/components/block-rename/modal.js.map +1 -1
- package/build/components/block-toolbar/shuffle.js +4 -1
- package/build/components/block-toolbar/shuffle.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +7 -58
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/block-toolbar-breadcrumb.js +9 -2
- package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
- package/build/components/block-tools/index.js +14 -1
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +4 -2
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +5 -4
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-tools/zoom-out-popover.js +57 -0
- package/build/components/block-tools/zoom-out-popover.js.map +1 -0
- package/build/components/block-tools/zoom-out-toolbar.js +138 -0
- package/build/components/block-tools/zoom-out-toolbar.js.map +1 -0
- package/build/components/button-block-appender/index.js +3 -1
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/child-layout-control/index.js +193 -127
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +10 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/dimensions-tool/index.js +6 -4
- package/build/components/dimensions-tool/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +26 -61
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +178 -116
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/border-panel.js +2 -1
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +2 -1
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +2 -1
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +2 -1
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +8 -0
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +2 -1
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +50 -12
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +50 -0
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +25 -9
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +17 -7
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/grid/grid-item-movers.js +94 -0
- package/build/components/grid/grid-item-movers.js.map +1 -0
- package/build/components/{grid-visualizer → grid}/grid-item-resizer.js +18 -56
- package/build/components/grid/grid-item-resizer.js.map +1 -0
- package/build/components/grid/grid-visualizer.js +305 -0
- package/build/components/grid/grid-visualizer.js.map +1 -0
- package/build/components/{grid-visualizer → grid}/index.js +14 -0
- package/build/components/grid/index.js.map +1 -0
- package/build/components/grid/use-get-number-of-blocks-before-cell.js +40 -0
- package/build/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
- package/build/components/grid/use-grid-layout-sync.js +169 -0
- package/build/components/grid/use-grid-layout-sync.js.map +1 -0
- package/build/components/grid/utils.js +145 -0
- package/build/components/grid/utils.js.map +1 -0
- package/build/components/image-editor/aspect-ratio-dropdown.js +0 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/inner-blocks/index.js +1 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -19
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
- package/build/components/inserter/menu.js +26 -4
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +2 -1
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +2 -1
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/link-control/link-preview.js +1 -1
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/media-placeholder/index.js +19 -23
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +3 -1
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/rich-text/event-listeners/input-rules.js +1 -0
- package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build/components/rich-text/index.native.js +10 -4
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +14 -0
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +5 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/tabbed-sidebar/index.js +66 -0
- package/build/components/tabbed-sidebar/index.js.map +1 -0
- package/build/components/url-popover/index.js +3 -0
- package/build/components/url-popover/index.js.map +1 -1
- package/build/hooks/background.js +26 -4
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +11 -17
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-style-variation.js +195 -11
- package/build/hooks/block-style-variation.js.map +1 -1
- package/build/hooks/duotone.js +16 -11
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/grid-visualizer.js +65 -0
- package/build/hooks/grid-visualizer.js.map +1 -0
- package/build/hooks/index.js +15 -2
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout-child.js +65 -40
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/position.js +2 -9
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +16 -6
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/hooks/utils.js +5 -2
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +44 -2
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/grid.js +92 -76
- package/build/layouts/grid.js.map +1 -1
- package/build/lock-unlock.js +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +6 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +17 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +0 -2
- package/build/store/defaults.js.map +1 -1
- package/build/store/defaults.native.js +0 -3
- package/build/store/defaults.native.js.map +1 -1
- package/build/store/private-keys.js +2 -1
- package/build/store/private-keys.js.map +1 -1
- package/build/utils/format-font-style.js +45 -0
- package/build/utils/format-font-style.js.map +1 -0
- package/build/utils/format-font-weight.js +68 -0
- package/build/utils/format-font-weight.js.map +1 -0
- package/build/utils/get-editor-region.js +34 -0
- package/build/utils/get-editor-region.js.map +1 -0
- package/build/utils/get-font-styles-and-weights.js +167 -0
- package/build/utils/get-font-styles-and-weights.js.map +1 -0
- package/build/utils/pasting.js +5 -13
- package/build/utils/pasting.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +12 -1
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-lock/modal.js +67 -67
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +0 -1
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-mover/button.js +1 -1
- package/build-module/components/block-mover/button.js.map +1 -1
- package/build-module/components/block-mover/index.js +12 -6
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +2 -2
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-patterns-paging/index.js +5 -7
- package/build-module/components/block-patterns-paging/index.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +20 -17
- package/build-module/components/block-quick-navigation/index.js.map +1 -1
- package/build-module/components/block-rename/modal.js +5 -13
- package/build-module/components/block-rename/modal.js.map +1 -1
- package/build-module/components/block-toolbar/shuffle.js +4 -1
- package/build-module/components/block-toolbar/shuffle.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +10 -61
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js +9 -2
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
- package/build-module/components/block-tools/index.js +14 -1
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +4 -2
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +5 -4
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-popover.js +48 -0
- package/build-module/components/block-tools/zoom-out-popover.js.map +1 -0
- package/build-module/components/block-tools/zoom-out-toolbar.js +131 -0
- package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -0
- package/build-module/components/button-block-appender/index.js +3 -1
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +194 -128
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +11 -3
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/dimensions-tool/index.js +6 -4
- package/build-module/components/dimensions-tool/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +28 -63
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +181 -119
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +3 -2
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +3 -2
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +3 -2
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +3 -2
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +8 -0
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +3 -2
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +52 -14
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +48 -0
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +25 -9
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +15 -6
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/grid/grid-item-movers.js +87 -0
- package/build-module/components/grid/grid-item-movers.js.map +1 -0
- package/build-module/components/{grid-visualizer → grid}/grid-item-resizer.js +13 -51
- package/build-module/components/grid/grid-item-resizer.js.map +1 -0
- package/build-module/components/grid/grid-visualizer.js +297 -0
- package/build-module/components/grid/grid-visualizer.js.map +1 -0
- package/build-module/components/grid/index.js +5 -0
- package/build-module/components/grid/index.js.map +1 -0
- package/build-module/components/grid/use-get-number-of-blocks-before-cell.js +33 -0
- package/build-module/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
- package/build-module/components/grid/use-grid-layout-sync.js +162 -0
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -0
- package/build-module/components/grid/utils.js +131 -0
- package/build-module/components/grid/utils.js.map +1 -0
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +0 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +1 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -19
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
- package/build-module/components/inserter/menu.js +26 -4
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +2 -1
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -2
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +1 -1
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +19 -23
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +3 -1
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +11 -5
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +14 -0
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +5 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/tabbed-sidebar/index.js +60 -0
- package/build-module/components/tabbed-sidebar/index.js.map +1 -0
- package/build-module/components/url-popover/index.js +3 -0
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/hooks/background.js +26 -4
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-hooks.js +11 -17
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +193 -11
- package/build-module/hooks/block-style-variation.js.map +1 -1
- package/build-module/hooks/duotone.js +16 -11
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/grid-visualizer.js +64 -0
- package/build-module/hooks/grid-visualizer.js.map +1 -0
- package/build-module/hooks/index.js +3 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout-child.js +63 -38
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/position.js +2 -9
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +16 -6
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/hooks/utils.js +5 -2
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +44 -2
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/grid.js +92 -76
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/lock-unlock.js +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +8 -3
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +17 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +0 -2
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/defaults.native.js +0 -3
- package/build-module/store/defaults.native.js.map +1 -1
- package/build-module/store/private-keys.js +1 -0
- package/build-module/store/private-keys.js.map +1 -1
- package/build-module/utils/format-font-style.js +39 -0
- package/build-module/utils/format-font-style.js.map +1 -0
- package/build-module/utils/format-font-weight.js +62 -0
- package/build-module/utils/format-font-weight.js.map +1 -0
- package/build-module/utils/get-editor-region.js +28 -0
- package/build-module/utils/get-editor-region.js.map +1 -0
- package/build-module/utils/get-font-styles-and-weights.js +160 -0
- package/build-module/utils/get-font-styles-and-weights.js.map +1 -0
- package/build-module/utils/pasting.js +5 -13
- package/build-module/utils/pasting.js.map +1 -1
- package/build-style/content-rtl.css +1 -0
- package/build-style/content.css +1 -0
- package/build-style/style-rtl.css +238 -106
- package/build-style/style.css +238 -106
- package/package.json +32 -32
- package/src/components/block-breadcrumb/index.js +16 -1
- package/src/components/block-lock/modal.js +95 -82
- package/src/components/block-lock/style.scss +11 -1
- package/src/components/block-lock/toolbar.js +0 -1
- package/src/components/block-mover/button.js +1 -1
- package/src/components/block-mover/index.js +37 -24
- package/src/components/block-pattern-setup/setup-toolbar.js +2 -2
- package/src/components/block-patterns-paging/index.js +8 -11
- package/src/components/block-patterns-paging/style.scss +18 -0
- package/src/components/block-quick-navigation/index.js +21 -28
- package/src/components/block-rename/modal.js +2 -8
- package/src/components/block-switcher/test/index.js +6 -6
- package/src/components/block-toolbar/shuffle.js +4 -1
- package/src/components/block-toolbar/style.scss +1 -11
- package/src/components/block-tools/block-selection-button.js +11 -83
- package/src/components/block-tools/block-toolbar-breadcrumb.js +9 -4
- package/src/components/block-tools/index.js +21 -1
- package/src/components/block-tools/style.scss +15 -0
- package/src/components/block-tools/use-show-block-tools.js +14 -6
- package/src/components/block-tools/zoom-out-mode-inserters.js +5 -4
- package/src/components/block-tools/zoom-out-popover.js +49 -0
- package/src/components/block-tools/zoom-out-toolbar.js +140 -0
- package/src/components/button-block-appender/index.js +2 -1
- package/src/components/child-layout-control/index.js +243 -160
- package/src/components/date-format-picker/index.js +10 -1
- package/src/components/date-format-picker/style.scss +0 -9
- package/src/components/dimensions-tool/index.js +97 -89
- package/src/components/font-appearance-control/index.js +29 -83
- package/src/components/font-appearance-control/style.scss +3 -5
- package/src/components/global-styles/background-panel.js +249 -170
- package/src/components/global-styles/border-panel.js +3 -2
- package/src/components/global-styles/color-panel.js +3 -2
- package/src/components/global-styles/dimensions-panel.js +3 -2
- package/src/components/global-styles/filters-panel.js +3 -2
- package/src/components/global-styles/hooks.js +9 -0
- package/src/components/global-styles/image-settings-panel.js +3 -2
- package/src/components/global-styles/style.scss +105 -20
- package/src/components/global-styles/test/typography-utils.js +269 -0
- package/src/components/global-styles/test/use-global-styles-output.js +38 -3
- package/src/components/global-styles/typography-panel.js +49 -12
- package/src/components/global-styles/typography-utils.js +63 -0
- package/src/components/global-styles/use-global-styles-output.js +25 -9
- package/src/components/global-styles/utils.js +17 -6
- package/src/components/grid/grid-item-movers.js +112 -0
- package/src/components/{grid-visualizer → grid}/grid-item-resizer.js +15 -52
- package/src/components/grid/grid-visualizer.js +384 -0
- package/src/components/grid/index.js +4 -0
- package/src/components/grid/style.scss +98 -0
- package/src/components/grid/use-get-number-of-blocks-before-cell.js +30 -0
- package/src/components/grid/use-grid-layout-sync.js +170 -0
- package/src/components/grid/utils.js +178 -0
- package/src/components/iframe/content.scss +1 -0
- package/src/components/image-editor/aspect-ratio-dropdown.js +0 -1
- package/src/components/inner-blocks/index.js +4 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -16
- package/src/components/inserter/menu.js +47 -13
- package/src/components/inserter/quick-inserter.js +6 -1
- package/src/components/inserter/style.scss +1 -49
- package/src/components/inspector-controls/block-support-tools-panel.js +3 -3
- package/src/components/link-control/link-preview.js +1 -1
- package/src/components/media-placeholder/index.js +22 -32
- package/src/components/navigable-toolbar/index.js +3 -1
- package/src/components/rich-text/event-listeners/input-rules.js +1 -1
- package/src/components/rich-text/index.native.js +10 -8
- package/src/components/rich-text/native/index.native.js +17 -0
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +6 -1
- package/src/components/tabbed-sidebar/README.md +76 -0
- package/src/components/tabbed-sidebar/index.js +70 -0
- package/src/components/tabbed-sidebar/style.scss +53 -0
- package/src/components/url-popover/index.js +3 -0
- package/src/hooks/background.js +25 -10
- package/src/hooks/block-hooks.js +9 -16
- package/src/hooks/block-style-variation.js +226 -9
- package/src/hooks/duotone.js +16 -12
- package/src/hooks/grid-visualizer.js +64 -0
- package/src/hooks/index.js +3 -0
- package/src/hooks/layout-child.js +75 -39
- package/src/hooks/position.js +3 -10
- package/src/hooks/test/get-variation-styles-with-ref-values.js +91 -0
- package/src/hooks/use-bindings-attributes.js +18 -4
- package/src/hooks/utils.js +5 -1
- package/src/layouts/constrained.js +43 -2
- package/src/layouts/grid.js +175 -88
- package/src/lock-unlock.js +1 -1
- package/src/private-apis.js +12 -1
- package/src/store/actions.js +21 -1
- package/src/store/defaults.js +0 -2
- package/src/store/defaults.native.js +0 -3
- package/src/store/private-keys.js +1 -0
- package/src/style.scss +2 -2
- package/src/utils/format-font-style.js +40 -0
- package/src/utils/format-font-weight.js +63 -0
- package/src/utils/get-editor-region.js +31 -0
- package/src/utils/get-font-styles-and-weights.js +191 -0
- package/src/utils/pasting.js +5 -12
- package/src/utils/test/format-font-style.js +34 -0
- package/src/utils/test/format-font-weight.js +66 -0
- package/src/utils/test/get-font-styles-and-weights.js +513 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/grid-visualizer/grid-item-resizer.js.map +0 -1
- package/build/components/grid-visualizer/grid-visualizer.js +0 -92
- package/build/components/grid-visualizer/grid-visualizer.js.map +0 -1
- package/build/components/grid-visualizer/index.js.map +0 -1
- package/build/components/grid-visualizer/utils.js +0 -10
- package/build/components/grid-visualizer/utils.js.map +0 -1
- package/build-module/components/grid-visualizer/grid-item-resizer.js.map +0 -1
- package/build-module/components/grid-visualizer/grid-visualizer.js +0 -84
- package/build-module/components/grid-visualizer/grid-visualizer.js.map +0 -1
- package/build-module/components/grid-visualizer/index.js +0 -3
- package/build-module/components/grid-visualizer/index.js.map +0 -1
- package/build-module/components/grid-visualizer/utils.js +0 -4
- package/build-module/components/grid-visualizer/utils.js.map +0 -1
- package/src/components/grid-visualizer/grid-visualizer.js +0 -101
- package/src/components/grid-visualizer/index.js +0 -2
- package/src/components/grid-visualizer/style.scss +0 -34
- package/src/components/grid-visualizer/utils.js +0 -5
- package/src/hooks/position.scss +0 -18
- /package/src/components/font-sizes/{README.MD → README.md} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","_x","PREFERENCES_DEFAULTS","insertUsage","SETTINGS_DEFAULTS","alignWide","supportsLayout","colors","name","slug","color","fontSizes","size","imageDefaultSize","imageSizes","imageEditing","maxWidth","allowedBlockTypes","maxUploadFileSize","allowedMimeTypes","canLockBlocks","enableOpenverseMediaCategory","clearBlockSelection","__experimentalCanUserUseUnfilteredHTML","__experimentalBlockDirectory","__mobileEnablePageTemplates","__experimentalBlockPatterns","__experimentalBlockPatternCategories","__unstableGalleryWithImageBlocks","__unstableIsPreviewMode","blockInspectorAnimation","animationParent","enterDirection","generateAnchors","gradients","gradient","__unstableResolvedAssets","styles","scripts"],"sources":["@wordpress/block-editor/src/store/defaults.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\n\nexport const PREFERENCES_DEFAULTS = {\n\tinsertUsage: {},\n};\n\n/**\n * The default editor settings\n *\n * @typedef {Object} SETTINGS_DEFAULT\n * @property {boolean} alignWide Enable/Disable Wide/Full Alignments\n * @property {boolean} supportsLayout Enable/disable layouts support in container blocks.\n * @property {boolean} imageEditing Image Editing settings set to false to disable.\n * @property {Array} imageSizes Available image sizes\n * @property {number} maxWidth Max width to constraint resizing\n * @property {boolean|Array} allowedBlockTypes Allowed block types\n * @property {boolean} hasFixedToolbar Whether or not the editor toolbar is fixed\n * @property {boolean} distractionFree Whether or not the editor UI is distraction free\n * @property {boolean} focusMode Whether the focus mode is enabled or not\n * @property {Array} styles Editor Styles\n * @property {boolean} keepCaretInsideBlock Whether caret should move between blocks in edit mode\n * @property {string} bodyPlaceholder Empty post placeholder\n * @property {string} titlePlaceholder Empty title placeholder\n * @property {boolean} canLockBlocks Whether the user can manage Block Lock state\n * @property {boolean} codeEditingEnabled Whether or not the user can switch to the code editor\n * @property {boolean} generateAnchors Enable/Disable auto anchor generation for Heading blocks\n * @property {boolean} enableOpenverseMediaCategory Enable/Disable the Openverse media category in the inserter.\n * @property {boolean} clearBlockSelection Whether the block editor should clear selection on mousedown when a block is not clicked.\n * @property {boolean} __experimentalCanUserUseUnfilteredHTML Whether the user should be able to use unfiltered HTML or the HTML should be filtered e.g., to remove elements considered insecure like iframes.\n * @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory\n * @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns\n * @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories\n * @property {boolean} __unstableGalleryWithImageBlocks Whether the user has enabled the refactored gallery block which uses InnerBlocks\n */\nexport const SETTINGS_DEFAULTS = {\n\talignWide: false,\n\tsupportsLayout: true,\n\n\t// colors setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.\n\t// The setting is only kept for backward compatibility purposes.\n\tcolors: [\n\t\t{\n\t\t\tname: __( 'Black' ),\n\t\t\tslug: 'black',\n\t\t\tcolor: '#000000',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Cyan bluish gray' ),\n\t\t\tslug: 'cyan-bluish-gray',\n\t\t\tcolor: '#abb8c3',\n\t\t},\n\t\t{\n\t\t\tname: __( 'White' ),\n\t\t\tslug: 'white',\n\t\t\tcolor: '#ffffff',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Pale pink' ),\n\t\t\tslug: 'pale-pink',\n\t\t\tcolor: '#f78da7',\n\t\t},\n\t\t{ name: __( 'Vivid red' ), slug: 'vivid-red', color: '#cf2e2e' },\n\t\t{\n\t\t\tname: __( 'Luminous vivid orange' ),\n\t\t\tslug: 'luminous-vivid-orange',\n\t\t\tcolor: '#ff6900',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Luminous vivid amber' ),\n\t\t\tslug: 'luminous-vivid-amber',\n\t\t\tcolor: '#fcb900',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Light green cyan' ),\n\t\t\tslug: 'light-green-cyan',\n\t\t\tcolor: '#7bdcb5',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Vivid green cyan' ),\n\t\t\tslug: 'vivid-green-cyan',\n\t\t\tcolor: '#00d084',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Pale cyan blue' ),\n\t\t\tslug: 'pale-cyan-blue',\n\t\t\tcolor: '#8ed1fc',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Vivid cyan blue' ),\n\t\t\tslug: 'vivid-cyan-blue',\n\t\t\tcolor: '#0693e3',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Vivid purple' ),\n\t\t\tslug: 'vivid-purple',\n\t\t\tcolor: '#9b51e0',\n\t\t},\n\t],\n\t// fontSizes setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.\n\t// The setting is only kept for backward compatibility purposes.\n\tfontSizes: [\n\t\t{\n\t\t\tname: _x( 'Small', 'font size name' ),\n\t\t\tsize: 13,\n\t\t\tslug: 'small',\n\t\t},\n\t\t{\n\t\t\tname: _x( 'Normal', 'font size name' ),\n\t\t\tsize: 16,\n\t\t\tslug: 'normal',\n\t\t},\n\t\t{\n\t\t\tname: _x( 'Medium', 'font size name' ),\n\t\t\tsize: 20,\n\t\t\tslug: 'medium',\n\t\t},\n\t\t{\n\t\t\tname: _x( 'Large', 'font size name' ),\n\t\t\tsize: 36,\n\t\t\tslug: 'large',\n\t\t},\n\t\t{\n\t\t\tname: _x( 'Huge', 'font size name' ),\n\t\t\tsize: 42,\n\t\t\tslug: 'huge',\n\t\t},\n\t],\n\n\t// Image default size slug.\n\timageDefaultSize: 'large',\n\n\timageSizes: [\n\t\t{ slug: 'thumbnail', name: __( 'Thumbnail' ) },\n\t\t{ slug: 'medium', name: __( 'Medium' ) },\n\t\t{ slug: 'large', name: __( 'Large' ) },\n\t\t{ slug: 'full', name: __( 'Full Size' ) },\n\t],\n\n\t// Allow plugin to disable Image Editor if need be.\n\timageEditing: true,\n\n\t// This is current max width of the block inner area\n\t// It's used to constraint image resizing and this value could be overridden later by themes\n\tmaxWidth: 580,\n\n\t// Allowed block types for the editor, defaulting to true (all supported).\n\tallowedBlockTypes: true,\n\n\t// Maximum upload size in bytes allowed for the site.\n\tmaxUploadFileSize: 0,\n\n\t// List of allowed mime types and file extensions.\n\tallowedMimeTypes: null,\n\n\t// Allows to disable block locking interface.\n\tcanLockBlocks: true,\n\n\t// Allows to disable Openverse media category in the inserter.\n\tenableOpenverseMediaCategory: true,\n\n\tclearBlockSelection: true,\n\n\t__experimentalCanUserUseUnfilteredHTML: false,\n\t__experimentalBlockDirectory: false,\n\t__mobileEnablePageTemplates: false,\n\t__experimentalBlockPatterns: [],\n\t__experimentalBlockPatternCategories: [],\n\t__unstableGalleryWithImageBlocks: false,\n\t__unstableIsPreviewMode: false,\n\n\t// These settings will be completely revamped in the future.\n\t// The goal is to evolve this into an API which will instruct\n\t// the block inspector to animate transitions between what it\n\t// displays based on the relationship between the selected block\n\t// and its parent, and only enable it if the parent is controlling\n\t// its children blocks.\n\tblockInspectorAnimation: {\n\t\tanimationParent: 'core/navigation',\n\t\t'core/navigation': { enterDirection: 'leftToRight' },\n\t\t'core/navigation-submenu': { enterDirection: 'rightToLeft' },\n\t\t'core/navigation-link': { enterDirection: 'rightToLeft' },\n\t\t'core/search': { enterDirection: 'rightToLeft' },\n\t\t'core/social-links': { enterDirection: 'rightToLeft' },\n\t\t'core/page-list': { enterDirection: 'rightToLeft' },\n\t\t'core/spacer': { enterDirection: 'rightToLeft' },\n\t\t'core/home-link': { enterDirection: 'rightToLeft' },\n\t\t'core/site-title': { enterDirection: 'rightToLeft' },\n\t\t'core/site-logo': { enterDirection: 'rightToLeft' },\n\t},\n\n\tgenerateAnchors: false,\n\t// gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.\n\t// The setting is only kept for backward compatibility purposes.\n\tgradients: [\n\t\t{\n\t\t\tname: __( 'Vivid cyan blue to vivid purple' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)',\n\t\t\tslug: 'vivid-cyan-blue-to-vivid-purple',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Light green cyan to vivid green cyan' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)',\n\t\t\tslug: 'light-green-cyan-to-vivid-green-cyan',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Luminous vivid amber to luminous vivid orange' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)',\n\t\t\tslug: 'luminous-vivid-amber-to-luminous-vivid-orange',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Luminous vivid orange to vivid red' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)',\n\t\t\tslug: 'luminous-vivid-orange-to-vivid-red',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Very light gray to cyan bluish gray' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)',\n\t\t\tslug: 'very-light-gray-to-cyan-bluish-gray',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Cool to warm spectrum' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)',\n\t\t\tslug: 'cool-to-warm-spectrum',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Blush light purple' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)',\n\t\t\tslug: 'blush-light-purple',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Blush bordeaux' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)',\n\t\t\tslug: 'blush-bordeaux',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Luminous dusk' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)',\n\t\t\tslug: 'luminous-dusk',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Pale ocean' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)',\n\t\t\tslug: 'pale-ocean',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Electric grass' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)',\n\t\t\tslug: 'electric-grass',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Midnight' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)',\n\t\t\tslug: 'midnight',\n\t\t},\n\t],\n\n\t__unstableResolvedAssets: { styles: [], scripts: [] },\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AAExC,OAAO,MAAMC,oBAAoB,GAAG;EACnCC,WAAW,EAAE,CAAC;AACf,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAG;EAChCC,SAAS,EAAE,KAAK;EAChBC,cAAc,EAAE,IAAI;EAEpB;EACA;EACAC,MAAM,EAAE,CACP;IACCC,IAAI,EAAER,EAAE,CAAE,OAAQ,CAAC;IACnBS,IAAI,EAAE,OAAO;IACbC,KAAK,EAAE;EACR,CAAC,EACD;IACCF,IAAI,EAAER,EAAE,C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D,IAAI,EAAER,EAAE,CAAE,qCAAsC,CAAC;IACjDmC,QAAQ,EACP,mEAAmE;IACpE1B,IAAI,EAAE;EACP,CAAC,EACD;IACCD,IAAI,EAAER,EAAE,CAAE,uBAAwB,CAAC;IACnCmC,QAAQ,EACP,kJAAkJ;IACnJ1B,IAAI,EAAE;EACP,CAAC,EACD;IACCD,IAAI,EAAER,EAAE,CAAE,oBAAqB,CAAC;IAChCmC,QAAQ,EACP,mEAAmE;IACpE1B,IAAI,EAAE;EACP,CAAC,EACD;IACCD,IAAI,EAAER,EAAE,CAAE,gBAAiB,CAAC;IAC5BmC,QAAQ,EACP,mFAAmF;IACpF1B,IAAI,EAAE;EACP,CAAC,EACD;IACCD,IAAI,EAAER,EAAE,CAAE,eAAgB,CAAC;IAC3BmC,QAAQ,EACP,qFAAqF;IACtF1B,IAAI,EAAE;EACP,CAAC,EACD;IACCD,IAAI,EAAER,EAAE,CAAE,YAAa,CAAC;IACxBmC,QAAQ,EACP,uFAAuF;IACxF1B,IAAI,EAAE;EACP,CAAC,EACD;IACCD,IAAI,EAAER,EAAE,CAAE,gBAAiB,CAAC;IAC5BmC,QAAQ,EACP,mEAAmE;IACpE1B,IAAI,EAAE;EACP,CAAC,EACD;IACCD,IAAI,EAAER,EAAE,CAAE,UAAW,CAAC;IACtBmC,QAAQ,EACP,8DAA8D;IAC/D1B,IAAI,EAAE;EACP,CAAC,CACD;EAED2B,wBAAwB,EAAE;IAAEC,MAAM,EAAE,EAAE;IAAEC,OAAO,EAAE;EAAG;AACrD,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","_x","PREFERENCES_DEFAULTS","insertUsage","SETTINGS_DEFAULTS","alignWide","supportsLayout","colors","name","slug","color","fontSizes","size","imageDefaultSize","imageSizes","imageEditing","maxWidth","allowedBlockTypes","maxUploadFileSize","allowedMimeTypes","canLockBlocks","enableOpenverseMediaCategory","clearBlockSelection","__experimentalCanUserUseUnfilteredHTML","__experimentalBlockDirectory","__mobileEnablePageTemplates","__experimentalBlockPatterns","__experimentalBlockPatternCategories","__unstableIsPreviewMode","blockInspectorAnimation","animationParent","enterDirection","generateAnchors","gradients","gradient","__unstableResolvedAssets","styles","scripts"],"sources":["@wordpress/block-editor/src/store/defaults.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\n\nexport const PREFERENCES_DEFAULTS = {\n\tinsertUsage: {},\n};\n\n/**\n * The default editor settings\n *\n * @typedef {Object} SETTINGS_DEFAULT\n * @property {boolean} alignWide Enable/Disable Wide/Full Alignments\n * @property {boolean} supportsLayout Enable/disable layouts support in container blocks.\n * @property {boolean} imageEditing Image Editing settings set to false to disable.\n * @property {Array} imageSizes Available image sizes\n * @property {number} maxWidth Max width to constraint resizing\n * @property {boolean|Array} allowedBlockTypes Allowed block types\n * @property {boolean} hasFixedToolbar Whether or not the editor toolbar is fixed\n * @property {boolean} distractionFree Whether or not the editor UI is distraction free\n * @property {boolean} focusMode Whether the focus mode is enabled or not\n * @property {Array} styles Editor Styles\n * @property {boolean} keepCaretInsideBlock Whether caret should move between blocks in edit mode\n * @property {string} bodyPlaceholder Empty post placeholder\n * @property {string} titlePlaceholder Empty title placeholder\n * @property {boolean} canLockBlocks Whether the user can manage Block Lock state\n * @property {boolean} codeEditingEnabled Whether or not the user can switch to the code editor\n * @property {boolean} generateAnchors Enable/Disable auto anchor generation for Heading blocks\n * @property {boolean} enableOpenverseMediaCategory Enable/Disable the Openverse media category in the inserter.\n * @property {boolean} clearBlockSelection Whether the block editor should clear selection on mousedown when a block is not clicked.\n * @property {boolean} __experimentalCanUserUseUnfilteredHTML Whether the user should be able to use unfiltered HTML or the HTML should be filtered e.g., to remove elements considered insecure like iframes.\n * @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory\n * @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns\n * @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories\n */\nexport const SETTINGS_DEFAULTS = {\n\talignWide: false,\n\tsupportsLayout: true,\n\n\t// colors setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.\n\t// The setting is only kept for backward compatibility purposes.\n\tcolors: [\n\t\t{\n\t\t\tname: __( 'Black' ),\n\t\t\tslug: 'black',\n\t\t\tcolor: '#000000',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Cyan bluish gray' ),\n\t\t\tslug: 'cyan-bluish-gray',\n\t\t\tcolor: '#abb8c3',\n\t\t},\n\t\t{\n\t\t\tname: __( 'White' ),\n\t\t\tslug: 'white',\n\t\t\tcolor: '#ffffff',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Pale pink' ),\n\t\t\tslug: 'pale-pink',\n\t\t\tcolor: '#f78da7',\n\t\t},\n\t\t{ name: __( 'Vivid red' ), slug: 'vivid-red', color: '#cf2e2e' },\n\t\t{\n\t\t\tname: __( 'Luminous vivid orange' ),\n\t\t\tslug: 'luminous-vivid-orange',\n\t\t\tcolor: '#ff6900',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Luminous vivid amber' ),\n\t\t\tslug: 'luminous-vivid-amber',\n\t\t\tcolor: '#fcb900',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Light green cyan' ),\n\t\t\tslug: 'light-green-cyan',\n\t\t\tcolor: '#7bdcb5',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Vivid green cyan' ),\n\t\t\tslug: 'vivid-green-cyan',\n\t\t\tcolor: '#00d084',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Pale cyan blue' ),\n\t\t\tslug: 'pale-cyan-blue',\n\t\t\tcolor: '#8ed1fc',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Vivid cyan blue' ),\n\t\t\tslug: 'vivid-cyan-blue',\n\t\t\tcolor: '#0693e3',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Vivid purple' ),\n\t\t\tslug: 'vivid-purple',\n\t\t\tcolor: '#9b51e0',\n\t\t},\n\t],\n\t// fontSizes setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.\n\t// The setting is only kept for backward compatibility purposes.\n\tfontSizes: [\n\t\t{\n\t\t\tname: _x( 'Small', 'font size name' ),\n\t\t\tsize: 13,\n\t\t\tslug: 'small',\n\t\t},\n\t\t{\n\t\t\tname: _x( 'Normal', 'font size name' ),\n\t\t\tsize: 16,\n\t\t\tslug: 'normal',\n\t\t},\n\t\t{\n\t\t\tname: _x( 'Medium', 'font size name' ),\n\t\t\tsize: 20,\n\t\t\tslug: 'medium',\n\t\t},\n\t\t{\n\t\t\tname: _x( 'Large', 'font size name' ),\n\t\t\tsize: 36,\n\t\t\tslug: 'large',\n\t\t},\n\t\t{\n\t\t\tname: _x( 'Huge', 'font size name' ),\n\t\t\tsize: 42,\n\t\t\tslug: 'huge',\n\t\t},\n\t],\n\n\t// Image default size slug.\n\timageDefaultSize: 'large',\n\n\timageSizes: [\n\t\t{ slug: 'thumbnail', name: __( 'Thumbnail' ) },\n\t\t{ slug: 'medium', name: __( 'Medium' ) },\n\t\t{ slug: 'large', name: __( 'Large' ) },\n\t\t{ slug: 'full', name: __( 'Full Size' ) },\n\t],\n\n\t// Allow plugin to disable Image Editor if need be.\n\timageEditing: true,\n\n\t// This is current max width of the block inner area\n\t// It's used to constraint image resizing and this value could be overridden later by themes\n\tmaxWidth: 580,\n\n\t// Allowed block types for the editor, defaulting to true (all supported).\n\tallowedBlockTypes: true,\n\n\t// Maximum upload size in bytes allowed for the site.\n\tmaxUploadFileSize: 0,\n\n\t// List of allowed mime types and file extensions.\n\tallowedMimeTypes: null,\n\n\t// Allows to disable block locking interface.\n\tcanLockBlocks: true,\n\n\t// Allows to disable Openverse media category in the inserter.\n\tenableOpenverseMediaCategory: true,\n\n\tclearBlockSelection: true,\n\n\t__experimentalCanUserUseUnfilteredHTML: false,\n\t__experimentalBlockDirectory: false,\n\t__mobileEnablePageTemplates: false,\n\t__experimentalBlockPatterns: [],\n\t__experimentalBlockPatternCategories: [],\n\t__unstableIsPreviewMode: false,\n\n\t// These settings will be completely revamped in the future.\n\t// The goal is to evolve this into an API which will instruct\n\t// the block inspector to animate transitions between what it\n\t// displays based on the relationship between the selected block\n\t// and its parent, and only enable it if the parent is controlling\n\t// its children blocks.\n\tblockInspectorAnimation: {\n\t\tanimationParent: 'core/navigation',\n\t\t'core/navigation': { enterDirection: 'leftToRight' },\n\t\t'core/navigation-submenu': { enterDirection: 'rightToLeft' },\n\t\t'core/navigation-link': { enterDirection: 'rightToLeft' },\n\t\t'core/search': { enterDirection: 'rightToLeft' },\n\t\t'core/social-links': { enterDirection: 'rightToLeft' },\n\t\t'core/page-list': { enterDirection: 'rightToLeft' },\n\t\t'core/spacer': { enterDirection: 'rightToLeft' },\n\t\t'core/home-link': { enterDirection: 'rightToLeft' },\n\t\t'core/site-title': { enterDirection: 'rightToLeft' },\n\t\t'core/site-logo': { enterDirection: 'rightToLeft' },\n\t},\n\n\tgenerateAnchors: false,\n\t// gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.\n\t// The setting is only kept for backward compatibility purposes.\n\tgradients: [\n\t\t{\n\t\t\tname: __( 'Vivid cyan blue to vivid purple' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)',\n\t\t\tslug: 'vivid-cyan-blue-to-vivid-purple',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Light green cyan to vivid green cyan' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)',\n\t\t\tslug: 'light-green-cyan-to-vivid-green-cyan',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Luminous vivid amber to luminous vivid orange' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)',\n\t\t\tslug: 'luminous-vivid-amber-to-luminous-vivid-orange',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Luminous vivid orange to vivid red' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)',\n\t\t\tslug: 'luminous-vivid-orange-to-vivid-red',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Very light gray to cyan bluish gray' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)',\n\t\t\tslug: 'very-light-gray-to-cyan-bluish-gray',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Cool to warm spectrum' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)',\n\t\t\tslug: 'cool-to-warm-spectrum',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Blush light purple' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)',\n\t\t\tslug: 'blush-light-purple',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Blush bordeaux' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)',\n\t\t\tslug: 'blush-bordeaux',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Luminous dusk' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)',\n\t\t\tslug: 'luminous-dusk',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Pale ocean' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)',\n\t\t\tslug: 'pale-ocean',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Electric grass' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)',\n\t\t\tslug: 'electric-grass',\n\t\t},\n\t\t{\n\t\t\tname: __( 'Midnight' ),\n\t\t\tgradient:\n\t\t\t\t'linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)',\n\t\t\tslug: 'midnight',\n\t\t},\n\t],\n\n\t__unstableResolvedAssets: { styles: [], scripts: [] },\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AAExC,OAAO,MAAMC,oBAAoB,GAAG;EACnCC,WAAW,EAAE,CAAC;AACf,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAG;EAChCC,SAAS,EAAE,KAAK;EAChBC,cAAc,EAAE,IAAI;EAEpB;EACA;EACAC,MAAM,EAAE,CACP;IACCC,IAAI,EAAER,EAAE,CAAE,OAAQ,CAAC;IACnBS,IAAI,EAAE,OAAO;IACbC,KAAK,EAAE;EACR,CAAC,EACD;IACCF,IAAI,EAAER,EAAE,CAAE,kBAAmB,CAAC;IAC9BS,IAAI,EAAE,kBAAkB;IACxBC,KAAK,EAAE;EACR,CAAC,EACD;IACCF,IAAI,EAAER,EAAE,CAAE,OAAQ,CAAC;IACnBS,IAAI,EAAE,OAAO;IACbC,KAAK,EAAE;EACR,CAAC,EACD;IACCF,IAAI,EAAER,EAAE,CAAE,WAAY,CAAC;IACvBS,IAAI,EAAE,WAAW;IACjBC,KAAK,EAAE;EACR,CAAC,EACD;IAAEF,IAAI,EAAER,EAAE,CAAE,WAAY,CAAC;IAAES,IAAI,EAAE,WAAW;IAAEC,KAAK,EAAE;EAAU,CAAC,EAChE;IACCF,IAAI,EAAER,EAAE,CAAE,uBAAwB,CAAC;IACnCS,IAAI,EAAE,uBAAuB;IAC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,EACP,qFAAqF;IACtFzB,IAAI,EAAE;EACP,CAAC,EACD;IACCD,IAAI,EAAER,EAAE,CAAE,YAAa,CAAC;IACxBkC,QAAQ,EACP,uFAAuF;IACxFzB,IAAI,EAAE;EACP,CAAC,EACD;IACCD,IAAI,EAAER,EAAE,CAAE,gBAAiB,CAAC;IAC5BkC,QAAQ,EACP,mEAAmE;IACpEzB,IAAI,EAAE;EACP,CAAC,EACD;IACCD,IAAI,EAAER,EAAE,CAAE,UAAW,CAAC;IACtBkC,QAAQ,EACP,8DAA8D;IAC/DzB,IAAI,EAAE;EACP,CAAC,CACD;EAED0B,wBAAwB,EAAE;IAAEC,MAAM,EAAE,EAAE;IAAEC,OAAO,EAAE;EAAG;AACrD,CAAC","ignoreList":[]}
|
|
@@ -6,9 +6,6 @@ const SETTINGS_DEFAULTS = {
|
|
|
6
6
|
...SETTINGS,
|
|
7
7
|
// Don't add the default font sizes for standard themes
|
|
8
8
|
fontSizes: undefined,
|
|
9
|
-
// FOR TESTING ONLY - Later, this will come from a REST API
|
|
10
|
-
// eslint-disable-next-line no-undef
|
|
11
|
-
__unstableGalleryWithImageBlocks: __DEV__,
|
|
12
9
|
alignWide: true,
|
|
13
10
|
supportsLayout: false,
|
|
14
11
|
__experimentalFeatures: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PREFERENCES_DEFAULTS","SETTINGS_DEFAULTS","SETTINGS","fontSizes","undefined","
|
|
1
|
+
{"version":3,"names":["PREFERENCES_DEFAULTS","SETTINGS_DEFAULTS","SETTINGS","fontSizes","undefined","alignWide","supportsLayout","__experimentalFeatures","color","text","background"],"sources":["@wordpress/block-editor/src/store/defaults.native.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tPREFERENCES_DEFAULTS,\n\tSETTINGS_DEFAULTS as SETTINGS,\n} from './defaults.js';\n\nconst SETTINGS_DEFAULTS = {\n\t...SETTINGS,\n\t// Don't add the default font sizes for standard themes\n\tfontSizes: undefined,\n\talignWide: true,\n\tsupportsLayout: false,\n\t__experimentalFeatures: {\n\t\tcolor: {\n\t\t\ttext: true,\n\t\t\tbackground: true,\n\t\t},\n\t},\n};\n\nexport { PREFERENCES_DEFAULTS, SETTINGS_DEFAULTS };\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,oBAAoB,EACpBC,iBAAiB,IAAIC,QAAQ,QACvB,eAAe;AAEtB,MAAMD,iBAAiB,GAAG;EACzB,GAAGC,QAAQ;EACX;EACAC,SAAS,EAAEC,SAAS;EACpBC,SAAS,EAAE,IAAI;EACfC,cAAc,EAAE,KAAK;EACrBC,sBAAsB,EAAE;IACvBC,KAAK,EAAE;MACNC,IAAI,EAAE,IAAI;MACVC,UAAU,EAAE;IACb;EACD;AACD,CAAC;AAED,SAASV,oBAAoB,EAAEC,iBAAiB","ignoreList":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const globalStylesDataKey = Symbol('globalStylesDataKey');
|
|
2
|
+
export const globalStylesLinksDataKey = Symbol('globalStylesLinks');
|
|
2
3
|
export const selectBlockPatternsKey = Symbol('selectBlockPatternsKey');
|
|
3
4
|
export const reusableBlocksSelectKey = Symbol('reusableBlocksSelect');
|
|
4
5
|
//# sourceMappingURL=private-keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["globalStylesDataKey","Symbol","selectBlockPatternsKey","reusableBlocksSelectKey"],"sources":["@wordpress/block-editor/src/store/private-keys.js"],"sourcesContent":["export const globalStylesDataKey = Symbol( 'globalStylesDataKey' );\nexport const selectBlockPatternsKey = Symbol( 'selectBlockPatternsKey' );\nexport const reusableBlocksSelectKey = Symbol( 'reusableBlocksSelect' );\n"],"mappings":"AAAA,OAAO,MAAMA,mBAAmB,GAAGC,MAAM,CAAE,qBAAsB,CAAC;AAClE,OAAO,MAAMC,
|
|
1
|
+
{"version":3,"names":["globalStylesDataKey","Symbol","globalStylesLinksDataKey","selectBlockPatternsKey","reusableBlocksSelectKey"],"sources":["@wordpress/block-editor/src/store/private-keys.js"],"sourcesContent":["export const globalStylesDataKey = Symbol( 'globalStylesDataKey' );\nexport const globalStylesLinksDataKey = Symbol( 'globalStylesLinks' );\nexport const selectBlockPatternsKey = Symbol( 'selectBlockPatternsKey' );\nexport const reusableBlocksSelectKey = Symbol( 'reusableBlocksSelect' );\n"],"mappings":"AAAA,OAAO,MAAMA,mBAAmB,GAAGC,MAAM,CAAE,qBAAsB,CAAC;AAClE,OAAO,MAAMC,wBAAwB,GAAGD,MAAM,CAAE,mBAAoB,CAAC;AACrE,OAAO,MAAME,sBAAsB,GAAGF,MAAM,CAAE,wBAAyB,CAAC;AACxE,OAAO,MAAMG,uBAAuB,GAAGH,MAAM,CAAE,sBAAuB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { _x } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Formats font styles to human readable names.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} fontStyle font style string
|
|
10
|
+
* @return {Object} new object with formatted font style
|
|
11
|
+
*/
|
|
12
|
+
export function formatFontStyle(fontStyle) {
|
|
13
|
+
if (!fontStyle) {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
if (typeof fontStyle === 'object') {
|
|
17
|
+
return fontStyle;
|
|
18
|
+
}
|
|
19
|
+
let name;
|
|
20
|
+
switch (fontStyle) {
|
|
21
|
+
case 'normal':
|
|
22
|
+
name = _x('Regular', 'font style');
|
|
23
|
+
break;
|
|
24
|
+
case 'italic':
|
|
25
|
+
name = _x('Italic', 'font style');
|
|
26
|
+
break;
|
|
27
|
+
case 'oblique':
|
|
28
|
+
name = _x('Oblique', 'font style');
|
|
29
|
+
break;
|
|
30
|
+
default:
|
|
31
|
+
name = fontStyle;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
name,
|
|
36
|
+
value: fontStyle
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=format-font-style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_x","formatFontStyle","fontStyle","name","value"],"sources":["@wordpress/block-editor/src/utils/format-font-style.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Formats font styles to human readable names.\n *\n * @param {string} fontStyle font style string\n * @return {Object} new object with formatted font style\n */\nexport function formatFontStyle( fontStyle ) {\n\tif ( ! fontStyle ) {\n\t\treturn {};\n\t}\n\n\tif ( typeof fontStyle === 'object' ) {\n\t\treturn fontStyle;\n\t}\n\n\tlet name;\n\n\tswitch ( fontStyle ) {\n\t\tcase 'normal':\n\t\t\tname = _x( 'Regular', 'font style' );\n\t\t\tbreak;\n\t\tcase 'italic':\n\t\t\tname = _x( 'Italic', 'font style' );\n\t\t\tbreak;\n\t\tcase 'oblique':\n\t\t\tname = _x( 'Oblique', 'font style' );\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tname = fontStyle;\n\t\t\tbreak;\n\t}\n\n\treturn { name, value: fontStyle };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAEC,SAAS,EAAG;EAC5C,IAAK,CAAEA,SAAS,EAAG;IAClB,OAAO,CAAC,CAAC;EACV;EAEA,IAAK,OAAOA,SAAS,KAAK,QAAQ,EAAG;IACpC,OAAOA,SAAS;EACjB;EAEA,IAAIC,IAAI;EAER,QAASD,SAAS;IACjB,KAAK,QAAQ;MACZC,IAAI,GAAGH,EAAE,CAAE,SAAS,EAAE,YAAa,CAAC;MACpC;IACD,KAAK,QAAQ;MACZG,IAAI,GAAGH,EAAE,CAAE,QAAQ,EAAE,YAAa,CAAC;MACnC;IACD,KAAK,SAAS;MACbG,IAAI,GAAGH,EAAE,CAAE,SAAS,EAAE,YAAa,CAAC;MACpC;IAED;MACCG,IAAI,GAAGD,SAAS;MAChB;EACF;EAEA,OAAO;IAAEC,IAAI;IAAEC,KAAK,EAAEF;EAAU,CAAC;AAClC","ignoreList":[]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { _x } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Formats font weights to human readable names.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} fontWeight font weight string
|
|
10
|
+
* @return {Object} new object with formatted font weight
|
|
11
|
+
*/
|
|
12
|
+
export function formatFontWeight(fontWeight) {
|
|
13
|
+
if (!fontWeight) {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
if (typeof fontWeight === 'object') {
|
|
17
|
+
return fontWeight;
|
|
18
|
+
}
|
|
19
|
+
let name;
|
|
20
|
+
switch (fontWeight) {
|
|
21
|
+
case 'normal':
|
|
22
|
+
case '400':
|
|
23
|
+
name = _x('Regular', 'font weight');
|
|
24
|
+
break;
|
|
25
|
+
case 'bold':
|
|
26
|
+
case '700':
|
|
27
|
+
name = _x('Bold', 'font weight');
|
|
28
|
+
break;
|
|
29
|
+
case '100':
|
|
30
|
+
name = _x('Thin', 'font weight');
|
|
31
|
+
break;
|
|
32
|
+
case '200':
|
|
33
|
+
name = _x('Extra Light', 'font weight');
|
|
34
|
+
break;
|
|
35
|
+
case '300':
|
|
36
|
+
name = _x('Light', 'font weight');
|
|
37
|
+
break;
|
|
38
|
+
case '500':
|
|
39
|
+
name = _x('Medium', 'font weight');
|
|
40
|
+
break;
|
|
41
|
+
case '600':
|
|
42
|
+
name = _x('Semi Bold', 'font weight');
|
|
43
|
+
break;
|
|
44
|
+
case '800':
|
|
45
|
+
name = _x('Extra Bold', 'font weight');
|
|
46
|
+
break;
|
|
47
|
+
case '900':
|
|
48
|
+
name = _x('Black', 'font weight');
|
|
49
|
+
break;
|
|
50
|
+
case '1000':
|
|
51
|
+
name = _x('Extra Black', 'font weight');
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
name = fontWeight;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
name,
|
|
59
|
+
value: fontWeight
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=format-font-weight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_x","formatFontWeight","fontWeight","name","value"],"sources":["@wordpress/block-editor/src/utils/format-font-weight.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Formats font weights to human readable names.\n *\n * @param {string} fontWeight font weight string\n * @return {Object} new object with formatted font weight\n */\nexport function formatFontWeight( fontWeight ) {\n\tif ( ! fontWeight ) {\n\t\treturn {};\n\t}\n\n\tif ( typeof fontWeight === 'object' ) {\n\t\treturn fontWeight;\n\t}\n\n\tlet name;\n\n\tswitch ( fontWeight ) {\n\t\tcase 'normal':\n\t\tcase '400':\n\t\t\tname = _x( 'Regular', 'font weight' );\n\t\t\tbreak;\n\t\tcase 'bold':\n\t\tcase '700':\n\t\t\tname = _x( 'Bold', 'font weight' );\n\t\t\tbreak;\n\t\tcase '100':\n\t\t\tname = _x( 'Thin', 'font weight' );\n\t\t\tbreak;\n\t\tcase '200':\n\t\t\tname = _x( 'Extra Light', 'font weight' );\n\t\t\tbreak;\n\t\tcase '300':\n\t\t\tname = _x( 'Light', 'font weight' );\n\t\t\tbreak;\n\t\tcase '500':\n\t\t\tname = _x( 'Medium', 'font weight' );\n\t\t\tbreak;\n\t\tcase '600':\n\t\t\tname = _x( 'Semi Bold', 'font weight' );\n\t\t\tbreak;\n\t\tcase '800':\n\t\t\tname = _x( 'Extra Bold', 'font weight' );\n\t\t\tbreak;\n\t\tcase '900':\n\t\t\tname = _x( 'Black', 'font weight' );\n\t\t\tbreak;\n\t\tcase '1000':\n\t\t\tname = _x( 'Extra Black', 'font weight' );\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tname = fontWeight;\n\t\t\tbreak;\n\t}\n\n\treturn { name, value: fontWeight };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,UAAU,EAAG;EAC9C,IAAK,CAAEA,UAAU,EAAG;IACnB,OAAO,CAAC,CAAC;EACV;EAEA,IAAK,OAAOA,UAAU,KAAK,QAAQ,EAAG;IACrC,OAAOA,UAAU;EAClB;EAEA,IAAIC,IAAI;EAER,QAASD,UAAU;IAClB,KAAK,QAAQ;IACb,KAAK,KAAK;MACTC,IAAI,GAAGH,EAAE,CAAE,SAAS,EAAE,aAAc,CAAC;MACrC;IACD,KAAK,MAAM;IACX,KAAK,KAAK;MACTG,IAAI,GAAGH,EAAE,CAAE,MAAM,EAAE,aAAc,CAAC;MAClC;IACD,KAAK,KAAK;MACTG,IAAI,GAAGH,EAAE,CAAE,MAAM,EAAE,aAAc,CAAC;MAClC;IACD,KAAK,KAAK;MACTG,IAAI,GAAGH,EAAE,CAAE,aAAa,EAAE,aAAc,CAAC;MACzC;IACD,KAAK,KAAK;MACTG,IAAI,GAAGH,EAAE,CAAE,OAAO,EAAE,aAAc,CAAC;MACnC;IACD,KAAK,KAAK;MACTG,IAAI,GAAGH,EAAE,CAAE,QAAQ,EAAE,aAAc,CAAC;MACpC;IACD,KAAK,KAAK;MACTG,IAAI,GAAGH,EAAE,CAAE,WAAW,EAAE,aAAc,CAAC;MACvC;IACD,KAAK,KAAK;MACTG,IAAI,GAAGH,EAAE,CAAE,YAAY,EAAE,aAAc,CAAC;MACxC;IACD,KAAK,KAAK;MACTG,IAAI,GAAGH,EAAE,CAAE,OAAO,EAAE,aAAc,CAAC;MACnC;IACD,KAAK,MAAM;MACVG,IAAI,GAAGH,EAAE,CAAE,aAAa,EAAE,aAAc,CAAC;MACzC;IAED;MACCG,IAAI,GAAGD,UAAU;MACjB;EACF;EAEA,OAAO;IAAEC,IAAI;IAAEC,KAAK,EAAEF;EAAW,CAAC;AACnC","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets the editor region for a given editor canvas element or
|
|
3
|
+
* returns the passed element if no region is found
|
|
4
|
+
*
|
|
5
|
+
* @param { Object } editor The editor canvas element.
|
|
6
|
+
* @return { Object } The editor region or given editor element
|
|
7
|
+
*/
|
|
8
|
+
export default function getEditorRegion(editor) {
|
|
9
|
+
var _Array$from$find, _editorCanvas$closest;
|
|
10
|
+
if (!editor) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// If there are multiple editors, we need to find the iframe that contains our contentRef to make sure
|
|
15
|
+
// we're focusing the region that contains this editor.
|
|
16
|
+
const editorCanvas = (_Array$from$find = Array.from(document.querySelectorAll('iframe[name="editor-canvas"]').values()).find(iframe => {
|
|
17
|
+
// Find the iframe that contains our contentRef
|
|
18
|
+
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
|
|
19
|
+
return iframeDocument === editor.ownerDocument;
|
|
20
|
+
})) !== null && _Array$from$find !== void 0 ? _Array$from$find : editor;
|
|
21
|
+
|
|
22
|
+
// The region is provivided by the editor, not the block-editor.
|
|
23
|
+
// We should send focus to the region if one is available to reuse the
|
|
24
|
+
// same interface for navigating landmarks. If no region is available,
|
|
25
|
+
// use the canvas instead.
|
|
26
|
+
return (_editorCanvas$closest = editorCanvas?.closest('[role="region"]')) !== null && _editorCanvas$closest !== void 0 ? _editorCanvas$closest : editorCanvas;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=get-editor-region.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getEditorRegion","editor","_Array$from$find","_editorCanvas$closest","editorCanvas","Array","from","document","querySelectorAll","values","find","iframe","iframeDocument","contentDocument","contentWindow","ownerDocument","closest"],"sources":["@wordpress/block-editor/src/utils/get-editor-region.js"],"sourcesContent":["/**\n * Gets the editor region for a given editor canvas element or\n * returns the passed element if no region is found\n *\n * @param { Object } editor The editor canvas element.\n * @return { Object } The editor region or given editor element\n */\nexport default function getEditorRegion( editor ) {\n\tif ( ! editor ) {\n\t\treturn null;\n\t}\n\n\t// If there are multiple editors, we need to find the iframe that contains our contentRef to make sure\n\t// we're focusing the region that contains this editor.\n\tconst editorCanvas =\n\t\tArray.from(\n\t\t\tdocument.querySelectorAll( 'iframe[name=\"editor-canvas\"]' ).values()\n\t\t).find( ( iframe ) => {\n\t\t\t// Find the iframe that contains our contentRef\n\t\t\tconst iframeDocument =\n\t\t\t\tiframe.contentDocument || iframe.contentWindow.document;\n\n\t\t\treturn iframeDocument === editor.ownerDocument;\n\t\t} ) ?? editor;\n\n\t// The region is provivided by the editor, not the block-editor.\n\t// We should send focus to the region if one is available to reuse the\n\t// same interface for navigating landmarks. If no region is available,\n\t// use the canvas instead.\n\treturn editorCanvas?.closest( '[role=\"region\"]' ) ?? editorCanvas;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,eAAeA,CAAEC,MAAM,EAAG;EAAA,IAAAC,gBAAA,EAAAC,qBAAA;EACjD,IAAK,CAAEF,MAAM,EAAG;IACf,OAAO,IAAI;EACZ;;EAEA;EACA;EACA,MAAMG,YAAY,IAAAF,gBAAA,GACjBG,KAAK,CAACC,IAAI,CACTC,QAAQ,CAACC,gBAAgB,CAAE,8BAA+B,CAAC,CAACC,MAAM,CAAC,CACpE,CAAC,CAACC,IAAI,CAAIC,MAAM,IAAM;IACrB;IACA,MAAMC,cAAc,GACnBD,MAAM,CAACE,eAAe,IAAIF,MAAM,CAACG,aAAa,CAACP,QAAQ;IAExD,OAAOK,cAAc,KAAKX,MAAM,CAACc,aAAa;EAC/C,CAAE,CAAC,cAAAb,gBAAA,cAAAA,gBAAA,GAAID,MAAM;;EAEd;EACA;EACA;EACA;EACA,QAAAE,qBAAA,GAAOC,YAAY,EAAEY,OAAO,CAAE,iBAAkB,CAAC,cAAAb,qBAAA,cAAAA,qBAAA,GAAIC,YAAY;AAClE","ignoreList":[]}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { _x, __, sprintf } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { formatFontStyle } from './format-font-style';
|
|
10
|
+
import { formatFontWeight } from './format-font-weight';
|
|
11
|
+
const FONT_STYLES = [{
|
|
12
|
+
name: _x('Regular', 'font style'),
|
|
13
|
+
value: 'normal'
|
|
14
|
+
}, {
|
|
15
|
+
name: _x('Italic', 'font style'),
|
|
16
|
+
value: 'italic'
|
|
17
|
+
}];
|
|
18
|
+
const FONT_WEIGHTS = [{
|
|
19
|
+
name: _x('Thin', 'font weight'),
|
|
20
|
+
value: '100'
|
|
21
|
+
}, {
|
|
22
|
+
name: _x('Extra Light', 'font weight'),
|
|
23
|
+
value: '200'
|
|
24
|
+
}, {
|
|
25
|
+
name: _x('Light', 'font weight'),
|
|
26
|
+
value: '300'
|
|
27
|
+
}, {
|
|
28
|
+
name: _x('Regular', 'font weight'),
|
|
29
|
+
value: '400'
|
|
30
|
+
}, {
|
|
31
|
+
name: _x('Medium', 'font weight'),
|
|
32
|
+
value: '500'
|
|
33
|
+
}, {
|
|
34
|
+
name: _x('Semi Bold', 'font weight'),
|
|
35
|
+
value: '600'
|
|
36
|
+
}, {
|
|
37
|
+
name: _x('Bold', 'font weight'),
|
|
38
|
+
value: '700'
|
|
39
|
+
}, {
|
|
40
|
+
name: _x('Extra Bold', 'font weight'),
|
|
41
|
+
value: '800'
|
|
42
|
+
}, {
|
|
43
|
+
name: _x('Black', 'font weight'),
|
|
44
|
+
value: '900'
|
|
45
|
+
}, {
|
|
46
|
+
name: _x('Extra Black', 'font weight'),
|
|
47
|
+
value: '1000'
|
|
48
|
+
}];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Builds a list of font style and weight options based on font family faces.
|
|
52
|
+
* Defaults to the standard font styles and weights if no font family faces are provided.
|
|
53
|
+
*
|
|
54
|
+
* @param {Array} fontFamilyFaces font family faces array
|
|
55
|
+
* @return {Object} new object with combined and separated font style and weight properties
|
|
56
|
+
*/
|
|
57
|
+
export function getFontStylesAndWeights(fontFamilyFaces) {
|
|
58
|
+
let fontStyles = [];
|
|
59
|
+
let fontWeights = [];
|
|
60
|
+
const combinedStyleAndWeightOptions = [];
|
|
61
|
+
const isSystemFont = !fontFamilyFaces || fontFamilyFaces?.length === 0;
|
|
62
|
+
let isVariableFont = false;
|
|
63
|
+
fontFamilyFaces?.forEach(face => {
|
|
64
|
+
// Check for variable font by looking for a space in the font weight value. e.g. "100 900"
|
|
65
|
+
if (/\s/.test(face.fontWeight.trim())) {
|
|
66
|
+
isVariableFont = true;
|
|
67
|
+
|
|
68
|
+
// Find font weight start and end values.
|
|
69
|
+
let [startValue, endValue] = face.fontWeight.split(' ');
|
|
70
|
+
startValue = parseInt(startValue.slice(0, 1));
|
|
71
|
+
if (endValue === '1000') {
|
|
72
|
+
endValue = 10;
|
|
73
|
+
} else {
|
|
74
|
+
endValue = parseInt(endValue.slice(0, 1));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Create font weight options for available variable weights.
|
|
78
|
+
for (let i = startValue; i <= endValue; i++) {
|
|
79
|
+
const fontWeightValue = `${i.toString()}00`;
|
|
80
|
+
if (!fontWeights.some(weight => weight.value === fontWeightValue)) {
|
|
81
|
+
fontWeights.push(formatFontWeight(fontWeightValue));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Format font style and weight values.
|
|
87
|
+
const fontWeight = formatFontWeight(face.fontWeight);
|
|
88
|
+
const fontStyle = formatFontStyle(face.fontStyle);
|
|
89
|
+
|
|
90
|
+
// Create font style and font weight lists without duplicates.
|
|
91
|
+
if (fontStyle) {
|
|
92
|
+
if (!fontStyles.some(style => style.value === fontStyle.value)) {
|
|
93
|
+
fontStyles.push(fontStyle);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (fontWeight) {
|
|
97
|
+
if (!fontWeights.some(weight => weight.value === fontWeight.value)) {
|
|
98
|
+
if (!isVariableFont) {
|
|
99
|
+
fontWeights.push(fontWeight);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// If there is no font weight of 600 or above, then include faux bold as an option.
|
|
106
|
+
if (!fontWeights.some(weight => weight.value >= '600')) {
|
|
107
|
+
fontWeights.push({
|
|
108
|
+
name: _x('Bold', 'font weight'),
|
|
109
|
+
value: '700'
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// If there is no italic font style, then include faux italic as an option.
|
|
114
|
+
if (!fontStyles.some(style => style.value === 'italic')) {
|
|
115
|
+
fontStyles.push({
|
|
116
|
+
name: _x('Italic', 'font style'),
|
|
117
|
+
value: 'italic'
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Use default font styles and weights for system fonts.
|
|
122
|
+
if (isSystemFont) {
|
|
123
|
+
fontStyles = FONT_STYLES;
|
|
124
|
+
fontWeights = FONT_WEIGHTS;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Use default styles and weights if there are no available styles or weights from the provided font faces.
|
|
128
|
+
fontStyles = fontStyles.length === 0 ? FONT_STYLES : fontStyles;
|
|
129
|
+
fontWeights = fontWeights.length === 0 ? FONT_WEIGHTS : fontWeights;
|
|
130
|
+
|
|
131
|
+
// Generate combined font style and weight options for available fonts.
|
|
132
|
+
fontStyles.forEach(({
|
|
133
|
+
name: styleName,
|
|
134
|
+
value: styleValue
|
|
135
|
+
}) => {
|
|
136
|
+
fontWeights.forEach(({
|
|
137
|
+
name: weightName,
|
|
138
|
+
value: weightValue
|
|
139
|
+
}) => {
|
|
140
|
+
const optionName = styleValue === 'normal' ? weightName : sprintf( /* translators: 1: Font weight name. 2: Font style name. */
|
|
141
|
+
__('%1$s %2$s'), weightName, styleName);
|
|
142
|
+
combinedStyleAndWeightOptions.push({
|
|
143
|
+
key: `${styleValue}-${weightValue}`,
|
|
144
|
+
name: optionName,
|
|
145
|
+
style: {
|
|
146
|
+
fontStyle: styleValue,
|
|
147
|
+
fontWeight: weightValue
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
return {
|
|
153
|
+
fontStyles,
|
|
154
|
+
fontWeights,
|
|
155
|
+
combinedStyleAndWeightOptions,
|
|
156
|
+
isSystemFont,
|
|
157
|
+
isVariableFont
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=get-font-styles-and-weights.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_x","__","sprintf","formatFontStyle","formatFontWeight","FONT_STYLES","name","value","FONT_WEIGHTS","getFontStylesAndWeights","fontFamilyFaces","fontStyles","fontWeights","combinedStyleAndWeightOptions","isSystemFont","length","isVariableFont","forEach","face","test","fontWeight","trim","startValue","endValue","split","parseInt","slice","i","fontWeightValue","toString","some","weight","push","fontStyle","style","styleName","styleValue","weightName","weightValue","optionName","key"],"sources":["@wordpress/block-editor/src/utils/get-font-styles-and-weights.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x, __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { formatFontStyle } from './format-font-style';\nimport { formatFontWeight } from './format-font-weight';\n\nconst FONT_STYLES = [\n\t{\n\t\tname: _x( 'Regular', 'font style' ),\n\t\tvalue: 'normal',\n\t},\n\t{\n\t\tname: _x( 'Italic', 'font style' ),\n\t\tvalue: 'italic',\n\t},\n];\n\nconst FONT_WEIGHTS = [\n\t{\n\t\tname: _x( 'Thin', 'font weight' ),\n\t\tvalue: '100',\n\t},\n\t{\n\t\tname: _x( 'Extra Light', 'font weight' ),\n\t\tvalue: '200',\n\t},\n\t{\n\t\tname: _x( 'Light', 'font weight' ),\n\t\tvalue: '300',\n\t},\n\t{\n\t\tname: _x( 'Regular', 'font weight' ),\n\t\tvalue: '400',\n\t},\n\t{\n\t\tname: _x( 'Medium', 'font weight' ),\n\t\tvalue: '500',\n\t},\n\t{\n\t\tname: _x( 'Semi Bold', 'font weight' ),\n\t\tvalue: '600',\n\t},\n\t{\n\t\tname: _x( 'Bold', 'font weight' ),\n\t\tvalue: '700',\n\t},\n\t{\n\t\tname: _x( 'Extra Bold', 'font weight' ),\n\t\tvalue: '800',\n\t},\n\t{\n\t\tname: _x( 'Black', 'font weight' ),\n\t\tvalue: '900',\n\t},\n\t{\n\t\tname: _x( 'Extra Black', 'font weight' ),\n\t\tvalue: '1000',\n\t},\n];\n\n/**\n * Builds a list of font style and weight options based on font family faces.\n * Defaults to the standard font styles and weights if no font family faces are provided.\n *\n * @param {Array} fontFamilyFaces font family faces array\n * @return {Object} new object with combined and separated font style and weight properties\n */\nexport function getFontStylesAndWeights( fontFamilyFaces ) {\n\tlet fontStyles = [];\n\tlet fontWeights = [];\n\tconst combinedStyleAndWeightOptions = [];\n\tconst isSystemFont = ! fontFamilyFaces || fontFamilyFaces?.length === 0;\n\tlet isVariableFont = false;\n\n\tfontFamilyFaces?.forEach( ( face ) => {\n\t\t// Check for variable font by looking for a space in the font weight value. e.g. \"100 900\"\n\t\tif ( /\\s/.test( face.fontWeight.trim() ) ) {\n\t\t\tisVariableFont = true;\n\n\t\t\t// Find font weight start and end values.\n\t\t\tlet [ startValue, endValue ] = face.fontWeight.split( ' ' );\n\t\t\tstartValue = parseInt( startValue.slice( 0, 1 ) );\n\t\t\tif ( endValue === '1000' ) {\n\t\t\t\tendValue = 10;\n\t\t\t} else {\n\t\t\t\tendValue = parseInt( endValue.slice( 0, 1 ) );\n\t\t\t}\n\n\t\t\t// Create font weight options for available variable weights.\n\t\t\tfor ( let i = startValue; i <= endValue; i++ ) {\n\t\t\t\tconst fontWeightValue = `${ i.toString() }00`;\n\t\t\t\tif (\n\t\t\t\t\t! fontWeights.some(\n\t\t\t\t\t\t( weight ) => weight.value === fontWeightValue\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tfontWeights.push( formatFontWeight( fontWeightValue ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Format font style and weight values.\n\t\tconst fontWeight = formatFontWeight( face.fontWeight );\n\t\tconst fontStyle = formatFontStyle( face.fontStyle );\n\n\t\t// Create font style and font weight lists without duplicates.\n\t\tif ( fontStyle ) {\n\t\t\tif (\n\t\t\t\t! fontStyles.some(\n\t\t\t\t\t( style ) => style.value === fontStyle.value\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tfontStyles.push( fontStyle );\n\t\t\t}\n\t\t}\n\t\tif ( fontWeight ) {\n\t\t\tif (\n\t\t\t\t! fontWeights.some(\n\t\t\t\t\t( weight ) => weight.value === fontWeight.value\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif ( ! isVariableFont ) {\n\t\t\t\t\tfontWeights.push( fontWeight );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} );\n\n\t// If there is no font weight of 600 or above, then include faux bold as an option.\n\tif ( ! fontWeights.some( ( weight ) => weight.value >= '600' ) ) {\n\t\tfontWeights.push( {\n\t\t\tname: _x( 'Bold', 'font weight' ),\n\t\t\tvalue: '700',\n\t\t} );\n\t}\n\n\t// If there is no italic font style, then include faux italic as an option.\n\tif ( ! fontStyles.some( ( style ) => style.value === 'italic' ) ) {\n\t\tfontStyles.push( {\n\t\t\tname: _x( 'Italic', 'font style' ),\n\t\t\tvalue: 'italic',\n\t\t} );\n\t}\n\n\t// Use default font styles and weights for system fonts.\n\tif ( isSystemFont ) {\n\t\tfontStyles = FONT_STYLES;\n\t\tfontWeights = FONT_WEIGHTS;\n\t}\n\n\t// Use default styles and weights if there are no available styles or weights from the provided font faces.\n\tfontStyles = fontStyles.length === 0 ? FONT_STYLES : fontStyles;\n\tfontWeights = fontWeights.length === 0 ? FONT_WEIGHTS : fontWeights;\n\n\t// Generate combined font style and weight options for available fonts.\n\tfontStyles.forEach( ( { name: styleName, value: styleValue } ) => {\n\t\tfontWeights.forEach( ( { name: weightName, value: weightValue } ) => {\n\t\t\tconst optionName =\n\t\t\t\tstyleValue === 'normal'\n\t\t\t\t\t? weightName\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t/* translators: 1: Font weight name. 2: Font style name. */\n\t\t\t\t\t\t\t__( '%1$s %2$s' ),\n\t\t\t\t\t\t\tweightName,\n\t\t\t\t\t\t\tstyleName\n\t\t\t\t\t );\n\n\t\t\tcombinedStyleAndWeightOptions.push( {\n\t\t\t\tkey: `${ styleValue }-${ weightValue }`,\n\t\t\t\tname: optionName,\n\t\t\t\tstyle: {\n\t\t\t\t\tfontStyle: styleValue,\n\t\t\t\t\tfontWeight: weightValue,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t} );\n\n\treturn {\n\t\tfontStyles,\n\t\tfontWeights,\n\t\tcombinedStyleAndWeightOptions,\n\t\tisSystemFont,\n\t\tisVariableFont,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,gBAAgB,QAAQ,sBAAsB;AAEvD,MAAMC,WAAW,GAAG,CACnB;EACCC,IAAI,EAAEN,EAAE,CAAE,SAAS,EAAE,YAAa,CAAC;EACnCO,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEN,EAAE,CAAE,QAAQ,EAAE,YAAa,CAAC;EAClCO,KAAK,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ACpE,MAAMC,UAAU,GACfH,UAAU,KAAK,QAAQ,GACpBC,UAAU,GACVnC,OAAO,EACP;MACAD,EAAE,CAAE,WAAY,CAAC,EACjBoC,UAAU,EACVF,SACA,CAAC;MAELtB,6BAA6B,CAACmB,IAAI,CAAE;QACnCQ,GAAG,EAAG,GAAGJ,UAAY,IAAIE,WAAa,EAAC;QACvChC,IAAI,EAAEiC,UAAU;QAChBL,KAAK,EAAE;UACND,SAAS,EAAEG,UAAU;UACrBhB,UAAU,EAAEkB;QACb;MACD,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAE,CAAC;EAEH,OAAO;IACN3B,UAAU;IACVC,WAAW;IACXC,6BAA6B;IAC7BC,YAAY;IACZE;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -48,22 +48,14 @@ export function getPasteEventData({
|
|
|
48
48
|
}) {
|
|
49
49
|
let plainText = '';
|
|
50
50
|
let html = '';
|
|
51
|
-
|
|
52
|
-
// IE11 only supports `Text` as an argument for `getData` and will
|
|
53
|
-
// otherwise throw an invalid argument error, so we try the standard
|
|
54
|
-
// arguments first, then fallback to `Text` if they fail.
|
|
55
51
|
try {
|
|
56
52
|
plainText = clipboardData.getData('text/plain');
|
|
57
53
|
html = clipboardData.getData('text/html');
|
|
58
|
-
} catch (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// don't support clipboardData at all, so allow default
|
|
64
|
-
// behaviour.
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
54
|
+
} catch (error) {
|
|
55
|
+
// Some browsers like UC Browser paste plain text by default and
|
|
56
|
+
// don't support clipboardData at all, so allow default
|
|
57
|
+
// behaviour.
|
|
58
|
+
return;
|
|
67
59
|
}
|
|
68
60
|
|
|
69
61
|
// Remove Windows-specific metadata appended within copied HTML text.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getFilesFromDataTransfer","removeWindowsFragments","html","startStr","startIdx","indexOf","substring","length","endStr","endIdx","removeCharsetMetaTag","metaTag","startsWith","slice","getPasteEventData","clipboardData","plainText","getData","
|
|
1
|
+
{"version":3,"names":["getFilesFromDataTransfer","removeWindowsFragments","html","startStr","startIdx","indexOf","substring","length","endStr","endIdx","removeCharsetMetaTag","metaTag","startsWith","slice","getPasteEventData","clipboardData","plainText","getData","error","files","shouldDismissPastedFiles","type","IMAGE_TAG","match","IMG_WITH_LOCAL_SRC"],"sources":["@wordpress/block-editor/src/utils/pasting.js"],"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 {string} html the html to be normalized\n * @return {string} the normalized html\n */\nfunction removeWindowsFragments( html ) {\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 {string} html the html to be stripped of the meta tag.\n * @return {string} the cleaned html\n */\nfunction removeCharsetMetaTag( html ) {\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( { clipboardData } ) {\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 ( error ) {\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 {File[]} files File objects obtained from a paste event\n * @param {string} html HTML content obtained from a paste event\n * @return {boolean} True if the files should be dismissed\n */\nexport function shouldDismissPastedFiles( files, html /*, plainText */ ) {\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_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