@wordpress/edit-site 6.33.3-next.36001005c.0 → 6.34.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 +2 -0
- package/build/components/block-editor/use-site-editor-settings.js +14 -2
- package/build/components/block-editor/use-site-editor-settings.js.map +3 -3
- package/build/components/canvas-loader/index.js +5 -8
- package/build/components/canvas-loader/index.js.map +3 -3
- package/build/components/dataviews-actions/index.js +8 -6
- package/build/components/dataviews-actions/index.js.map +2 -2
- package/build/components/editor/index.js +2 -40
- package/build/components/editor/index.js.map +3 -3
- package/build/components/layout/index.js +5 -7
- package/build/components/layout/index.js.map +3 -3
- package/build/components/page-patterns/fields.js +4 -3
- package/build/components/page-patterns/fields.js.map +3 -3
- package/build/components/page-templates/fields.js +21 -28
- package/build/components/page-templates/fields.js.map +3 -3
- package/build/components/page-templates/index.js +41 -31
- package/build/components/page-templates/index.js.map +2 -2
- package/build/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +22 -46
- package/build/components/sidebar-global-styles/index.js.map +7 -0
- package/build/components/sidebar-navigation-screen-global-styles/content.js +38 -16
- package/build/components/sidebar-navigation-screen-global-styles/content.js.map +3 -3
- package/build/components/sidebar-navigation-screen-global-styles/index.js +6 -7
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +3 -3
- package/build/components/sidebar-navigation-screen-main/index.js +0 -9
- package/build/components/sidebar-navigation-screen-main/index.js.map +3 -3
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +8 -9
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +2 -2
- package/build/components/site-editor-routes/stylebook.js +5 -3
- package/build/components/site-editor-routes/stylebook.js.map +3 -3
- package/build/components/site-editor-routes/styles.js +33 -11
- package/build/components/site-editor-routes/styles.js.map +3 -3
- package/build/components/welcome-guide/index.js +0 -2
- package/build/components/welcome-guide/index.js.map +3 -3
- package/build/hooks/commands/use-common-commands.js +10 -12
- package/build/hooks/commands/use-common-commands.js.map +3 -3
- package/build/hooks/commands/use-set-command-context.js +0 -5
- package/build/hooks/commands/use-set-command-context.js.map +2 -2
- package/build/index.js +0 -1
- package/build/index.js.map +2 -2
- package/build/posts.js +0 -1
- package/build/posts.js.map +2 -2
- package/build/store/private-actions.js +0 -8
- package/build/store/private-actions.js.map +2 -2
- package/build/store/private-selectors.js +0 -5
- package/build/store/private-selectors.js.map +2 -2
- package/build/store/reducer.js +0 -8
- package/build/store/reducer.js.map +2 -2
- package/build-module/components/block-editor/use-site-editor-settings.js +14 -2
- package/build-module/components/block-editor/use-site-editor-settings.js.map +2 -2
- package/build-module/components/canvas-loader/index.js +5 -8
- package/build-module/components/canvas-loader/index.js.map +2 -2
- package/build-module/components/dataviews-actions/index.js +8 -6
- package/build-module/components/dataviews-actions/index.js.map +2 -2
- package/build-module/components/editor/index.js +4 -46
- package/build-module/components/editor/index.js.map +2 -2
- package/build-module/components/layout/index.js +5 -7
- package/build-module/components/layout/index.js.map +2 -2
- package/build-module/components/page-patterns/fields.js +5 -7
- package/build-module/components/page-patterns/fields.js.map +2 -2
- package/build-module/components/page-templates/fields.js +25 -32
- package/build-module/components/page-templates/fields.js.map +2 -2
- package/build-module/components/page-templates/index.js +41 -31
- package/build-module/components/page-templates/index.js.map +2 -2
- package/build-module/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +21 -41
- package/build-module/components/sidebar-global-styles/index.js.map +7 -0
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js +42 -6
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +2 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -6
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +2 -2
- package/build-module/components/sidebar-navigation-screen-main/index.js +1 -10
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +2 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +9 -10
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +2 -2
- package/build-module/components/site-editor-routes/stylebook.js +3 -1
- package/build-module/components/site-editor-routes/stylebook.js.map +2 -2
- package/build-module/components/site-editor-routes/styles.js +31 -9
- package/build-module/components/site-editor-routes/styles.js.map +2 -2
- package/build-module/components/welcome-guide/index.js +0 -2
- package/build-module/components/welcome-guide/index.js.map +2 -2
- package/build-module/hooks/commands/use-common-commands.js +13 -12
- package/build-module/hooks/commands/use-common-commands.js.map +2 -2
- package/build-module/hooks/commands/use-set-command-context.js +0 -5
- package/build-module/hooks/commands/use-set-command-context.js.map +2 -2
- package/build-module/index.js +0 -1
- package/build-module/index.js.map +2 -2
- package/build-module/posts.js +0 -1
- package/build-module/posts.js.map +2 -2
- package/build-module/store/private-actions.js +0 -7
- package/build-module/store/private-actions.js.map +2 -2
- package/build-module/store/private-selectors.js +0 -4
- package/build-module/store/private-selectors.js.map +2 -2
- package/build-module/store/reducer.js +0 -8
- package/build-module/store/reducer.js.map +2 -2
- package/build-style/posts-rtl.css +0 -37
- package/build-style/posts.css +0 -37
- package/build-style/style-rtl.css +702 -706
- package/build-style/style.css +702 -706
- package/package.json +49 -45
- package/src/components/block-editor/use-site-editor-settings.js +21 -2
- package/src/components/canvas-loader/index.js +5 -9
- package/src/components/dataviews-actions/index.js +12 -10
- package/src/components/editor/index.js +2 -50
- package/src/components/layout/index.js +6 -10
- package/src/components/page-patterns/fields.js +5 -7
- package/src/components/page-templates/fields.js +29 -35
- package/src/components/page-templates/index.js +51 -38
- package/src/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +16 -48
- package/src/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/style.scss +3 -3
- package/src/components/sidebar-navigation-screen/style.scss +5 -12
- package/src/components/sidebar-navigation-screen-global-styles/content.js +34 -6
- package/src/components/sidebar-navigation-screen-global-styles/index.js +6 -9
- package/src/components/sidebar-navigation-screen-main/index.js +1 -12
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +9 -10
- package/src/components/site-editor-routes/stylebook.js +4 -1
- package/src/components/site-editor-routes/styles.js +35 -9
- package/src/components/welcome-guide/index.js +0 -2
- package/src/components/welcome-guide/style.scss +1 -2
- package/src/hooks/commands/use-common-commands.js +19 -12
- package/src/hooks/commands/use-set-command-context.js +0 -11
- package/src/index.js +0 -1
- package/src/posts.js +0 -1
- package/src/posts.scss +0 -1
- package/src/store/private-actions.js +0 -14
- package/src/store/private-selectors.js +0 -11
- package/src/store/reducer.js +0 -18
- package/src/style.scss +2 -9
- package/tsconfig.json +2 -11
- package/build/components/editor-canvas-container/index.js +0 -139
- package/build/components/editor-canvas-container/index.js.map +0 -7
- package/build/components/global-styles/background-panel.js +0 -62
- package/build/components/global-styles/background-panel.js.map +0 -7
- package/build/components/global-styles/block-preview-panel.js +0 -87
- package/build/components/global-styles/block-preview-panel.js.map +0 -7
- package/build/components/global-styles/color-indicator-wrapper.js +0 -50
- package/build/components/global-styles/color-indicator-wrapper.js.map +0 -7
- package/build/components/global-styles/color-palette-panel.js +0 -133
- package/build/components/global-styles/color-palette-panel.js.map +0 -7
- package/build/components/global-styles/confirm-reset-shadow-dialog.js +0 -55
- package/build/components/global-styles/confirm-reset-shadow-dialog.js.map +0 -7
- package/build/components/global-styles/dimensions-panel.js +0 -92
- package/build/components/global-styles/dimensions-panel.js.map +0 -7
- package/build/components/global-styles/font-families.js +0 -114
- package/build/components/global-styles/font-families.js.map +0 -7
- package/build/components/global-styles/font-family-item.js +0 -48
- package/build/components/global-styles/font-family-item.js.map +0 -7
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +0 -75
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +0 -7
- package/build/components/global-styles/font-library-modal/context.js +0 -386
- package/build/components/global-styles/font-library-modal/context.js.map +0 -7
- package/build/components/global-styles/font-library-modal/font-card.js +0 -76
- package/build/components/global-styles/font-library-modal/font-card.js.map +0 -7
- package/build/components/global-styles/font-library-modal/font-collection.js +0 -504
- package/build/components/global-styles/font-library-modal/font-collection.js.map +0 -7
- package/build/components/global-styles/font-library-modal/font-demo.js +0 -108
- package/build/components/global-styles/font-library-modal/font-demo.js.map +0 -7
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -58
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +0 -7
- package/build/components/global-styles/font-library-modal/index.js +0 -110
- package/build/components/global-styles/font-library-modal/index.js.map +0 -7
- package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -455
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +0 -7
- package/build/components/global-styles/font-library-modal/library-font-details.js +0 -63
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +0 -7
- package/build/components/global-styles/font-library-modal/library-font-variant.js +0 -78
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +0 -7
- package/build/components/global-styles/font-library-modal/resolvers.js +0 -115
- package/build/components/global-styles/font-library-modal/resolvers.js.map +0 -7
- package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -205
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/constants.js +0 -49
- package/build/components/global-styles/font-library-modal/utils/constants.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -39
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -51
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/index.js +0 -277
- package/build/components/global-styles/font-library-modal/utils/index.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -42
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js +0 -117
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -56
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js +0 -63
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +0 -7
- package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -60
- package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +0 -7
- package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -55
- package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +0 -7
- package/build/components/global-styles/font-sizes/font-size-preview.js +0 -51
- package/build/components/global-styles/font-sizes/font-size-preview.js.map +0 -7
- package/build/components/global-styles/font-sizes/font-size.js +0 -260
- package/build/components/global-styles/font-sizes/font-size.js.map +0 -7
- package/build/components/global-styles/font-sizes/font-sizes-count.js +0 -50
- package/build/components/global-styles/font-sizes/font-sizes-count.js.map +0 -7
- package/build/components/global-styles/font-sizes/font-sizes.js +0 -220
- package/build/components/global-styles/font-sizes/font-sizes.js.map +0 -7
- package/build/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -90
- package/build/components/global-styles/font-sizes/rename-font-size-dialog.js.map +0 -7
- package/build/components/global-styles/gradients-palette-panel.js +0 -144
- package/build/components/global-styles/gradients-palette-panel.js.map +0 -7
- package/build/components/global-styles/header.js +0 -54
- package/build/components/global-styles/header.js.map +0 -7
- package/build/components/global-styles/highlighted-colors.js +0 -57
- package/build/components/global-styles/highlighted-colors.js.map +0 -7
- package/build/components/global-styles/hooks.js +0 -113
- package/build/components/global-styles/hooks.js.map +0 -7
- package/build/components/global-styles/icon-with-current-color.js +0 -53
- package/build/components/global-styles/icon-with-current-color.js.map +0 -7
- package/build/components/global-styles/index.js +0 -39
- package/build/components/global-styles/index.js.map +0 -7
- package/build/components/global-styles/navigation-button.js +0 -48
- package/build/components/global-styles/navigation-button.js.map +0 -7
- package/build/components/global-styles/palette.js +0 -86
- package/build/components/global-styles/palette.js.map +0 -7
- package/build/components/global-styles/preset-colors.js +0 -40
- package/build/components/global-styles/preset-colors.js.map +0 -7
- package/build/components/global-styles/preview-colors.js +0 -82
- package/build/components/global-styles/preview-colors.js.map +0 -7
- package/build/components/global-styles/preview-styles.js +0 -214
- package/build/components/global-styles/preview-styles.js.map +0 -7
- package/build/components/global-styles/preview-typography.js +0 -68
- package/build/components/global-styles/preview-typography.js.map +0 -7
- package/build/components/global-styles/preview-wrapper.js +0 -101
- package/build/components/global-styles/preview-wrapper.js.map +0 -7
- package/build/components/global-styles/root-menu.js +0 -72
- package/build/components/global-styles/root-menu.js.map +0 -7
- package/build/components/global-styles/screen-background.js +0 -59
- package/build/components/global-styles/screen-background.js.map +0 -7
- package/build/components/global-styles/screen-block-list.js +0 -170
- package/build/components/global-styles/screen-block-list.js.map +0 -7
- package/build/components/global-styles/screen-block.js +0 -316
- package/build/components/global-styles/screen-block.js.map +0 -7
- package/build/components/global-styles/screen-color-palette.js +0 -64
- package/build/components/global-styles/screen-color-palette.js.map +0 -7
- package/build/components/global-styles/screen-colors.js +0 -81
- package/build/components/global-styles/screen-colors.js.map +0 -7
- package/build/components/global-styles/screen-css.js +0 -92
- package/build/components/global-styles/screen-css.js.map +0 -7
- package/build/components/global-styles/screen-layout.js +0 -51
- package/build/components/global-styles/screen-layout.js.map +0 -7
- package/build/components/global-styles/screen-revisions/index.js +0 -179
- package/build/components/global-styles/screen-revisions/index.js.map +0 -7
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +0 -192
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +0 -7
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -148
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +0 -7
- package/build/components/global-styles/screen-root.js +0 -99
- package/build/components/global-styles/screen-root.js.map +0 -7
- package/build/components/global-styles/screen-shadows.js +0 -49
- package/build/components/global-styles/screen-shadows.js.map +0 -7
- package/build/components/global-styles/screen-style-variations.js +0 -70
- package/build/components/global-styles/screen-style-variations.js.map +0 -7
- package/build/components/global-styles/screen-typography-element.js +0 -167
- package/build/components/global-styles/screen-typography-element.js.map +0 -7
- package/build/components/global-styles/screen-typography.js +0 -68
- package/build/components/global-styles/screen-typography.js.map +0 -7
- package/build/components/global-styles/shadow-utils.js +0 -125
- package/build/components/global-styles/shadow-utils.js.map +0 -7
- package/build/components/global-styles/shadows-edit-panel.js +0 -501
- package/build/components/global-styles/shadows-edit-panel.js.map +0 -7
- package/build/components/global-styles/shadows-panel.js +0 -206
- package/build/components/global-styles/shadows-panel.js.map +0 -7
- package/build/components/global-styles/size-control/index.js +0 -80
- package/build/components/global-styles/size-control/index.js.map +0 -7
- package/build/components/global-styles/style-variations-container.js +0 -124
- package/build/components/global-styles/style-variations-container.js.map +0 -7
- package/build/components/global-styles/subtitle.js +0 -37
- package/build/components/global-styles/subtitle.js.map +0 -7
- package/build/components/global-styles/typeset.js +0 -78
- package/build/components/global-styles/typeset.js.map +0 -7
- package/build/components/global-styles/typography-elements.js +0 -123
- package/build/components/global-styles/typography-elements.js.map +0 -7
- package/build/components/global-styles/typography-example.js +0 -81
- package/build/components/global-styles/typography-example.js.map +0 -7
- package/build/components/global-styles/typography-panel.js +0 -69
- package/build/components/global-styles/typography-panel.js.map +0 -7
- package/build/components/global-styles/typography-preview.js +0 -80
- package/build/components/global-styles/typography-preview.js.map +0 -7
- package/build/components/global-styles/ui.js +0 -355
- package/build/components/global-styles/ui.js.map +0 -7
- package/build/components/global-styles/utils.js +0 -92
- package/build/components/global-styles/utils.js.map +0 -7
- package/build/components/global-styles/variations/variation.js +0 -118
- package/build/components/global-styles/variations/variation.js.map +0 -7
- package/build/components/global-styles/variations/variations-color.js +0 -61
- package/build/components/global-styles/variations/variations-color.js.map +0 -7
- package/build/components/global-styles/variations/variations-panel.js +0 -71
- package/build/components/global-styles/variations/variations-panel.js.map +0 -7
- package/build/components/global-styles/variations/variations-typography.js +0 -75
- package/build/components/global-styles/variations/variations-typography.js.map +0 -7
- package/build/components/global-styles-renderer/index.js +0 -55
- package/build/components/global-styles-renderer/index.js.map +0 -7
- package/build/components/global-styles-sidebar/default-sidebar.js +0 -68
- package/build/components/global-styles-sidebar/default-sidebar.js.map +0 -7
- package/build/components/global-styles-sidebar/index.js +0 -202
- package/build/components/global-styles-sidebar/index.js.map +0 -7
- package/build/components/revisions/index.js +0 -120
- package/build/components/revisions/index.js.map +0 -7
- package/build/components/sidebar-global-styles-wrapper/index.js.map +0 -7
- package/build/components/style-book/categories.js +0 -86
- package/build/components/style-book/categories.js.map +0 -7
- package/build/components/style-book/color-examples.js +0 -65
- package/build/components/style-book/color-examples.js.map +0 -7
- package/build/components/style-book/constants.js +0 -319
- package/build/components/style-book/constants.js.map +0 -7
- package/build/components/style-book/duotone-examples.js +0 -69
- package/build/components/style-book/duotone-examples.js.map +0 -7
- package/build/components/style-book/examples.js +0 -237
- package/build/components/style-book/examples.js.map +0 -7
- package/build/components/style-book/index.js +0 -640
- package/build/components/style-book/index.js.map +0 -7
- package/build/components/style-book/types.js +0 -17
- package/build/components/style-book/types.js.map +0 -7
- package/build/components/welcome-guide/styles.js +0 -145
- package/build/components/welcome-guide/styles.js.map +0 -7
- package/build/hooks/index.js +0 -3
- package/build/hooks/index.js.map +0 -7
- package/build/hooks/push-changes-to-global-styles/index.js +0 -319
- package/build/hooks/push-changes-to-global-styles/index.js.map +0 -7
- package/build/hooks/use-global-styles-output.js +0 -77
- package/build/hooks/use-global-styles-output.js.map +0 -7
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -126
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +0 -7
- package/build/utils/set-nested-value.js +0 -43
- package/build/utils/set-nested-value.js.map +0 -7
- package/build-module/components/editor-canvas-container/index.js +0 -120
- package/build-module/components/editor-canvas-container/index.js.map +0 -7
- package/build-module/components/global-styles/background-panel.js +0 -38
- package/build-module/components/global-styles/background-panel.js.map +0 -7
- package/build-module/components/global-styles/block-preview-panel.js +0 -67
- package/build-module/components/global-styles/block-preview-panel.js.map +0 -7
- package/build-module/components/global-styles/color-indicator-wrapper.js +0 -20
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +0 -7
- package/build-module/components/global-styles/color-palette-panel.js +0 -107
- package/build-module/components/global-styles/color-palette-panel.js.map +0 -7
- package/build-module/components/global-styles/confirm-reset-shadow-dialog.js +0 -35
- package/build-module/components/global-styles/confirm-reset-shadow-dialog.js.map +0 -7
- package/build-module/components/global-styles/dimensions-panel.js +0 -72
- package/build-module/components/global-styles/dimensions-panel.js.map +0 -7
- package/build-module/components/global-styles/font-families.js +0 -92
- package/build-module/components/global-styles/font-families.js.map +0 -7
- package/build-module/components/global-styles/font-family-item.js +0 -32
- package/build-module/components/global-styles/font-family-item.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +0 -45
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/context.js +0 -372
- package/build-module/components/global-styles/font-library-modal/context.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/font-card.js +0 -53
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/font-collection.js +0 -505
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/font-demo.js +0 -91
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -45
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/index.js +0 -83
- package/build-module/components/global-styles/font-library-modal/index.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -444
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/library-font-details.js +0 -36
- package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +0 -48
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/resolvers.js +0 -76
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -185
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/constants.js +0 -23
- package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -19
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -26
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/index.js +0 -241
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -22
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +0 -90
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -32
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +0 -39
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +0 -7
- package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -40
- package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +0 -7
- package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -35
- package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +0 -7
- package/build-module/components/global-styles/font-sizes/font-size-preview.js +0 -34
- package/build-module/components/global-styles/font-sizes/font-size-preview.js.map +0 -7
- package/build-module/components/global-styles/font-sizes/font-size.js +0 -240
- package/build-module/components/global-styles/font-sizes/font-size.js.map +0 -7
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js +0 -25
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +0 -7
- package/build-module/components/global-styles/font-sizes/font-sizes.js +0 -205
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +0 -7
- package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -76
- package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +0 -7
- package/build-module/components/global-styles/gradients-palette-panel.js +0 -119
- package/build-module/components/global-styles/gradients-palette-panel.js.map +0 -7
- package/build-module/components/global-styles/header.js +0 -41
- package/build-module/components/global-styles/header.js.map +0 -7
- package/build-module/components/global-styles/highlighted-colors.js +0 -37
- package/build-module/components/global-styles/highlighted-colors.js.map +0 -7
- package/build-module/components/global-styles/hooks.js +0 -77
- package/build-module/components/global-styles/hooks.js.map +0 -7
- package/build-module/components/global-styles/icon-with-current-color.js +0 -19
- package/build-module/components/global-styles/icon-with-current-color.js.map +0 -7
- package/build-module/components/global-styles/index.js +0 -5
- package/build-module/components/global-styles/index.js.map +0 -7
- package/build-module/components/global-styles/navigation-button.js +0 -28
- package/build-module/components/global-styles/navigation-button.js.map +0 -7
- package/build-module/components/global-styles/palette.js +0 -63
- package/build-module/components/global-styles/palette.js.map +0 -7
- package/build-module/components/global-styles/preset-colors.js +0 -20
- package/build-module/components/global-styles/preset-colors.js.map +0 -7
- package/build-module/components/global-styles/preview-colors.js +0 -55
- package/build-module/components/global-styles/preview-colors.js.map +0 -7
- package/build-module/components/global-styles/preview-styles.js +0 -188
- package/build-module/components/global-styles/preview-styles.js.map +0 -7
- package/build-module/components/global-styles/preview-typography.js +0 -38
- package/build-module/components/global-styles/preview-typography.js.map +0 -7
- package/build-module/components/global-styles/preview-wrapper.js +0 -85
- package/build-module/components/global-styles/preview-wrapper.js.map +0 -7
- package/build-module/components/global-styles/root-menu.js +0 -58
- package/build-module/components/global-styles/root-menu.js.map +0 -7
- package/build-module/components/global-styles/screen-background.js +0 -29
- package/build-module/components/global-styles/screen-background.js.map +0 -7
- package/build-module/components/global-styles/screen-block-list.js +0 -150
- package/build-module/components/global-styles/screen-block-list.js.map +0 -7
- package/build-module/components/global-styles/screen-block.js +0 -293
- package/build-module/components/global-styles/screen-block.js.map +0 -7
- package/build-module/components/global-styles/screen-color-palette.js +0 -34
- package/build-module/components/global-styles/screen-color-palette.js.map +0 -7
- package/build-module/components/global-styles/screen-colors.js +0 -51
- package/build-module/components/global-styles/screen-colors.js.map +0 -7
- package/build-module/components/global-styles/screen-css.js +0 -62
- package/build-module/components/global-styles/screen-css.js.map +0 -7
- package/build-module/components/global-styles/screen-layout.js +0 -21
- package/build-module/components/global-styles/screen-layout.js.map +0 -7
- package/build-module/components/global-styles/screen-revisions/index.js +0 -155
- package/build-module/components/global-styles/screen-revisions/index.js.map +0 -7
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +0 -172
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +0 -7
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -128
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +0 -7
- package/build-module/components/global-styles/screen-root.js +0 -79
- package/build-module/components/global-styles/screen-root.js.map +0 -7
- package/build-module/components/global-styles/screen-shadows.js +0 -14
- package/build-module/components/global-styles/screen-shadows.js.map +0 -7
- package/build-module/components/global-styles/screen-style-variations.js +0 -43
- package/build-module/components/global-styles/screen-style-variations.js.map +0 -7
- package/build-module/components/global-styles/screen-typography-element.js +0 -141
- package/build-module/components/global-styles/screen-typography-element.js.map +0 -7
- package/build-module/components/global-styles/screen-typography.js +0 -38
- package/build-module/components/global-styles/screen-typography.js.map +0 -7
- package/build-module/components/global-styles/shadow-utils.js +0 -98
- package/build-module/components/global-styles/shadow-utils.js.map +0 -7
- package/build-module/components/global-styles/shadows-edit-panel.js +0 -500
- package/build-module/components/global-styles/shadows-edit-panel.js.map +0 -7
- package/build-module/components/global-styles/shadows-panel.js +0 -185
- package/build-module/components/global-styles/shadows-panel.js.map +0 -7
- package/build-module/components/global-styles/size-control/index.js +0 -70
- package/build-module/components/global-styles/size-control/index.js.map +0 -7
- package/build-module/components/global-styles/style-variations-container.js +0 -94
- package/build-module/components/global-styles/style-variations-container.js.map +0 -7
- package/build-module/components/global-styles/subtitle.js +0 -17
- package/build-module/components/global-styles/subtitle.js.map +0 -7
- package/build-module/components/global-styles/typeset.js +0 -54
- package/build-module/components/global-styles/typeset.js.map +0 -7
- package/build-module/components/global-styles/typography-elements.js +0 -98
- package/build-module/components/global-styles/typography-elements.js.map +0 -7
- package/build-module/components/global-styles/typography-example.js +0 -61
- package/build-module/components/global-styles/typography-example.js.map +0 -7
- package/build-module/components/global-styles/typography-panel.js +0 -49
- package/build-module/components/global-styles/typography-panel.js.map +0 -7
- package/build-module/components/global-styles/typography-preview.js +0 -60
- package/build-module/components/global-styles/typography-preview.js.map +0 -7
- package/build-module/components/global-styles/ui.js +0 -334
- package/build-module/components/global-styles/ui.js.map +0 -7
- package/build-module/components/global-styles/utils.js +0 -66
- package/build-module/components/global-styles/utils.js.map +0 -7
- package/build-module/components/global-styles/variations/variation.js +0 -88
- package/build-module/components/global-styles/variations/variation.js.map +0 -7
- package/build-module/components/global-styles/variations/variations-color.js +0 -34
- package/build-module/components/global-styles/variations/variations-color.js.map +0 -7
- package/build-module/components/global-styles/variations/variations-panel.js +0 -46
- package/build-module/components/global-styles/variations/variations-panel.js.map +0 -7
- package/build-module/components/global-styles/variations/variations-typography.js +0 -48
- package/build-module/components/global-styles/variations/variations-typography.js.map +0 -7
- package/build-module/components/global-styles-renderer/index.js +0 -31
- package/build-module/components/global-styles-renderer/index.js.map +0 -7
- package/build-module/components/global-styles-sidebar/default-sidebar.js +0 -48
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +0 -7
- package/build-module/components/global-styles-sidebar/index.js +0 -175
- package/build-module/components/global-styles-sidebar/index.js.map +0 -7
- package/build-module/components/revisions/index.js +0 -96
- package/build-module/components/revisions/index.js.map +0 -7
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +0 -7
- package/build-module/components/style-book/categories.js +0 -64
- package/build-module/components/style-book/categories.js.map +0 -7
- package/build-module/components/style-book/color-examples.js +0 -38
- package/build-module/components/style-book/color-examples.js.map +0 -7
- package/build-module/components/style-book/constants.js +0 -290
- package/build-module/components/style-book/constants.js.map +0 -7
- package/build-module/components/style-book/duotone-examples.js +0 -49
- package/build-module/components/style-book/duotone-examples.js.map +0 -7
- package/build-module/components/style-book/examples.js +0 -208
- package/build-module/components/style-book/examples.js.map +0 -7
- package/build-module/components/style-book/index.js +0 -631
- package/build-module/components/style-book/index.js.map +0 -7
- package/build-module/components/style-book/types.js +0 -1
- package/build-module/components/style-book/types.js.map +0 -7
- package/build-module/components/welcome-guide/styles.js +0 -115
- package/build-module/components/welcome-guide/styles.js.map +0 -7
- package/build-module/hooks/index.js +0 -2
- package/build-module/hooks/index.js.map +0 -7
- package/build-module/hooks/push-changes-to-global-styles/index.js +0 -305
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +0 -7
- package/build-module/hooks/use-global-styles-output.js +0 -52
- package/build-module/hooks/use-global-styles-output.js.map +0 -7
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -99
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +0 -7
- package/build-module/utils/set-nested-value.js +0 -23
- package/build-module/utils/set-nested-value.js.map +0 -7
- package/build-types/components/style-book/categories.d.ts +0 -18
- package/build-types/components/style-book/categories.d.ts.map +0 -1
- package/build-types/components/style-book/color-examples.d.ts +0 -7
- package/build-types/components/style-book/color-examples.d.ts.map +0 -1
- package/build-types/components/style-book/constants.d.ts +0 -11
- package/build-types/components/style-book/constants.d.ts.map +0 -1
- package/build-types/components/style-book/duotone-examples.d.ts +0 -9
- package/build-types/components/style-book/duotone-examples.d.ts.map +0 -1
- package/build-types/components/style-book/examples.d.ts +0 -12
- package/build-types/components/style-book/examples.d.ts.map +0 -1
- package/build-types/components/style-book/types.d.ts +0 -72
- package/build-types/components/style-book/types.d.ts.map +0 -1
- package/lib/inflate.js +0 -3333
- package/lib/lib-font.browser.js +0 -3861
- package/lib/unbrotli.js +0 -2039
- package/src/components/editor-canvas-container/index.js +0 -149
- package/src/components/editor-canvas-container/style.scss +0 -43
- package/src/components/global-styles/README.md +0 -17
- package/src/components/global-styles/background-panel.js +0 -55
- package/src/components/global-styles/block-preview-panel.js +0 -81
- package/src/components/global-styles/color-indicator-wrapper.js +0 -23
- package/src/components/global-styles/color-palette-panel.js +0 -110
- package/src/components/global-styles/confirm-reset-shadow-dialog.js +0 -37
- package/src/components/global-styles/dimensions-panel.js +0 -86
- package/src/components/global-styles/font-families.js +0 -128
- package/src/components/global-styles/font-family-item.js +0 -47
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +0 -51
- package/src/components/global-styles/font-library-modal/context.js +0 -540
- package/src/components/global-styles/font-library-modal/font-card.js +0 -67
- package/src/components/global-styles/font-library-modal/font-collection.js +0 -575
- package/src/components/global-styles/font-library-modal/font-demo.js +0 -116
- package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -57
- package/src/components/global-styles/font-library-modal/index.js +0 -106
- package/src/components/global-styles/font-library-modal/installed-fonts.js +0 -518
- package/src/components/global-styles/font-library-modal/library-font-details.js +0 -45
- package/src/components/global-styles/font-library-modal/library-font-variant.js +0 -60
- package/src/components/global-styles/font-library-modal/resolvers.js +0 -78
- package/src/components/global-styles/font-library-modal/style.scss +0 -220
- package/src/components/global-styles/font-library-modal/upload-fonts.js +0 -253
- package/src/components/global-styles/font-library-modal/utils/constants.js +0 -23
- package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -35
- package/src/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -22
- package/src/components/global-styles/font-library-modal/utils/index.js +0 -333
- package/src/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -27
- package/src/components/global-styles/font-library-modal/utils/preview-styles.js +0 -152
- package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -37
- package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +0 -99
- package/src/components/global-styles/font-library-modal/utils/test/fonts-outline.spec.js +0 -109
- package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +0 -42
- package/src/components/global-styles/font-library-modal/utils/test/getFontFaceVariantName.spec.js +0 -30
- package/src/components/global-styles/font-library-modal/utils/test/isUrlEncoded.spec.js +0 -31
- package/src/components/global-styles/font-library-modal/utils/test/makeFamiliesFromFaces.spec.js +0 -57
- package/src/components/global-styles/font-library-modal/utils/test/mergeFontFaces.spec.js +0 -56
- package/src/components/global-styles/font-library-modal/utils/test/mergeFontFamilies.spec.js +0 -108
- package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +0 -216
- package/src/components/global-styles/font-library-modal/utils/test/setUIValuesNeeded.spec.js +0 -41
- package/src/components/global-styles/font-library-modal/utils/test/sort-font-faces.js +0 -74
- package/src/components/global-styles/font-library-modal/utils/test/toggleFont.spec.js +0 -141
- package/src/components/global-styles/font-library-modal/utils/toggleFont.js +0 -90
- package/src/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -43
- package/src/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -37
- package/src/components/global-styles/font-sizes/font-size-preview.js +0 -43
- package/src/components/global-styles/font-sizes/font-size.js +0 -265
- package/src/components/global-styles/font-sizes/font-sizes-count.js +0 -37
- package/src/components/global-styles/font-sizes/font-sizes.js +0 -261
- package/src/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -70
- package/src/components/global-styles/gradients-palette-panel.js +0 -123
- package/src/components/global-styles/header.js +0 -48
- package/src/components/global-styles/highlighted-colors.js +0 -39
- package/src/components/global-styles/hooks.js +0 -111
- package/src/components/global-styles/icon-with-current-color.js +0 -21
- package/src/components/global-styles/index.js +0 -1
- package/src/components/global-styles/navigation-button.js +0 -38
- package/src/components/global-styles/palette.js +0 -90
- package/src/components/global-styles/preset-colors.js +0 -18
- package/src/components/global-styles/preview-colors.js +0 -58
- package/src/components/global-styles/preview-styles.js +0 -185
- package/src/components/global-styles/preview-typography.js +0 -39
- package/src/components/global-styles/preview-wrapper.js +0 -126
- package/src/components/global-styles/root-menu.js +0 -84
- package/src/components/global-styles/screen-background.js +0 -37
- package/src/components/global-styles/screen-block-list.js +0 -187
- package/src/components/global-styles/screen-block.js +0 -358
- package/src/components/global-styles/screen-color-palette.js +0 -42
- package/src/components/global-styles/screen-colors.js +0 -55
- package/src/components/global-styles/screen-css.js +0 -67
- package/src/components/global-styles/screen-layout.js +0 -30
- package/src/components/global-styles/screen-revisions/index.js +0 -202
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +0 -238
- package/src/components/global-styles/screen-revisions/style.scss +0 -194
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +0 -228
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -159
- package/src/components/global-styles/screen-root.js +0 -102
- package/src/components/global-styles/screen-shadows.js +0 -13
- package/src/components/global-styles/screen-style-variations.js +0 -52
- package/src/components/global-styles/screen-typography-element.js +0 -121
- package/src/components/global-styles/screen-typography.js +0 -45
- package/src/components/global-styles/shadow-utils.js +0 -158
- package/src/components/global-styles/shadows-edit-panel.js +0 -525
- package/src/components/global-styles/shadows-panel.js +0 -196
- package/src/components/global-styles/size-control/index.js +0 -89
- package/src/components/global-styles/stories/index.story.js +0 -427
- package/src/components/global-styles/style-variations-container.js +0 -132
- package/src/components/global-styles/style.scss +0 -265
- package/src/components/global-styles/subtitle.js +0 -17
- package/src/components/global-styles/test/shadow-utils.spec.js +0 -251
- package/src/components/global-styles/test/utils.spec.js +0 -59
- package/src/components/global-styles/typeset.js +0 -73
- package/src/components/global-styles/typography-elements.js +0 -102
- package/src/components/global-styles/typography-example.js +0 -76
- package/src/components/global-styles/typography-panel.js +0 -54
- package/src/components/global-styles/typography-preview.js +0 -70
- package/src/components/global-styles/ui.js +0 -448
- package/src/components/global-styles/utils.js +0 -88
- package/src/components/global-styles/variations/style.scss +0 -43
- package/src/components/global-styles/variations/variation.js +0 -108
- package/src/components/global-styles/variations/variations-color.js +0 -45
- package/src/components/global-styles/variations/variations-panel.js +0 -65
- package/src/components/global-styles/variations/variations-typography.js +0 -54
- package/src/components/global-styles-renderer/index.js +0 -39
- package/src/components/global-styles-sidebar/default-sidebar.js +0 -51
- package/src/components/global-styles-sidebar/index.js +0 -206
- package/src/components/global-styles-sidebar/style.scss +0 -80
- package/src/components/revisions/index.js +0 -109
- package/src/components/style-book/categories.ts +0 -97
- package/src/components/style-book/color-examples.tsx +0 -57
- package/src/components/style-book/constants.ts +0 -308
- package/src/components/style-book/duotone-examples.tsx +0 -57
- package/src/components/style-book/examples.tsx +0 -273
- package/src/components/style-book/index.js +0 -801
- package/src/components/style-book/style.scss +0 -44
- package/src/components/style-book/test/categories.js +0 -166
- package/src/components/style-book/types.ts +0 -80
- package/src/components/welcome-guide/styles.js +0 -139
- package/src/hooks/index.js +0 -4
- package/src/hooks/push-changes-to-global-styles/index.js +0 -388
- package/src/hooks/push-changes-to-global-styles/style.scss +0 -4
- package/src/hooks/use-global-styles-output.js +0 -80
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +0 -271
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -175
- package/src/utils/set-nested-value.js +0 -39
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/push-changes-to-global-styles/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport {\n\tInspectorAdvancedControls,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useContext, useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useSupportedStyles } from '../../components/global-styles/hooks';\nimport { unlock } from '../../lock-unlock';\nimport setNestedValue from '../../utils/set-nested-value';\n\nconst { cleanEmptyObject, GlobalStylesContext } = unlock(\n\tblockEditorPrivateApis\n);\n\n// Block Gap is a special case and isn't defined within the blocks\n// style properties config. We'll add it here to allow it to be pushed\n// to global styles as well.\nconst STYLE_PROPERTY = {\n\t...__EXPERIMENTAL_STYLE_PROPERTY,\n\tblockGap: { value: [ 'spacing', 'blockGap' ] },\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_CSS_VAR_INFIX = {\n\t'border.color': 'color',\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'elements.link.color.text': 'color',\n\t'elements.link.:hover.color.text': 'color',\n\t'elements.link.typography.fontFamily': 'font-family',\n\t'elements.link.typography.fontSize': 'font-size',\n\t'elements.button.color.text': 'color',\n\t'elements.button.color.background': 'color',\n\t'elements.button.typography.fontFamily': 'font-family',\n\t'elements.button.typography.fontSize': 'font-size',\n\t'elements.caption.color.text': 'color',\n\t'elements.heading.color': 'color',\n\t'elements.heading.color.background': 'color',\n\t'elements.heading.typography.fontFamily': 'font-family',\n\t'elements.heading.gradient': 'gradient',\n\t'elements.heading.color.gradient': 'gradient',\n\t'elements.h1.color': 'color',\n\t'elements.h1.color.background': 'color',\n\t'elements.h1.typography.fontFamily': 'font-family',\n\t'elements.h1.color.gradient': 'gradient',\n\t'elements.h2.color': 'color',\n\t'elements.h2.color.background': 'color',\n\t'elements.h2.typography.fontFamily': 'font-family',\n\t'elements.h2.color.gradient': 'gradient',\n\t'elements.h3.color': 'color',\n\t'elements.h3.color.background': 'color',\n\t'elements.h3.typography.fontFamily': 'font-family',\n\t'elements.h3.color.gradient': 'gradient',\n\t'elements.h4.color': 'color',\n\t'elements.h4.color.background': 'color',\n\t'elements.h4.typography.fontFamily': 'font-family',\n\t'elements.h4.color.gradient': 'gradient',\n\t'elements.h5.color': 'color',\n\t'elements.h5.color.background': 'color',\n\t'elements.h5.typography.fontFamily': 'font-family',\n\t'elements.h5.color.gradient': 'gradient',\n\t'elements.h6.color': 'color',\n\t'elements.h6.color.background': 'color',\n\t'elements.h6.typography.fontFamily': 'font-family',\n\t'elements.h6.color.gradient': 'gradient',\n\t'color.gradient': 'gradient',\n\tblockGap: 'spacing',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {\n\t'border.color': 'borderColor',\n\t'color.background': 'backgroundColor',\n\t'color.text': 'textColor',\n\t'color.gradient': 'gradient',\n\t'typography.fontSize': 'fontSize',\n\t'typography.fontFamily': 'fontFamily',\n};\n\nconst SUPPORTED_STYLES = [ 'border', 'color', 'spacing', 'typography' ];\n\nconst getValueFromObjectPath = ( object, path ) => {\n\tlet value = object;\n\tpath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\nconst flatBorderProperties = [ 'borderColor', 'borderWidth', 'borderStyle' ];\nconst sides = [ 'top', 'right', 'bottom', 'left' ];\n\nfunction getBorderStyleChanges( border, presetColor, userStyle ) {\n\tif ( ! border && ! presetColor ) {\n\t\treturn [];\n\t}\n\n\tconst changes = [\n\t\t...getFallbackBorderStyleChange( 'top', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'right', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'bottom', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'left', border, userStyle ),\n\t];\n\n\t// Handle a flat border i.e. all sides the same, CSS shorthand.\n\tconst { color: customColor, style, width } = border || {};\n\tconst hasColorOrWidth = presetColor || customColor || width;\n\n\tif ( hasColorOrWidth && ! style ) {\n\t\t// Global Styles need individual side configurations to overcome\n\t\t// theme.json configurations which are per side as well.\n\t\tsides.forEach( ( side ) => {\n\t\t\t// Only add fallback border-style if global styles don't already\n\t\t\t// have something set.\n\t\t\tif ( ! userStyle?.[ side ]?.style ) {\n\t\t\t\tchanges.push( {\n\t\t\t\t\tpath: [ 'border', side, 'style' ],\n\t\t\t\t\tvalue: 'solid',\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn changes;\n}\n\nfunction getFallbackBorderStyleChange( side, border, globalBorderStyle ) {\n\tif ( ! border?.[ side ] || globalBorderStyle?.[ side ]?.style ) {\n\t\treturn [];\n\t}\n\n\tconst { color, style, width } = border[ side ];\n\tconst hasColorOrWidth = color || width;\n\n\tif ( ! hasColorOrWidth || style ) {\n\t\treturn [];\n\t}\n\n\treturn [ { path: [ 'border', side, 'style' ], value: 'solid' } ];\n}\n\nfunction useChangesToPush( name, attributes, userConfig ) {\n\tconst supports = useSupportedStyles( name );\n\tconst blockUserConfig = userConfig?.styles?.blocks?.[ name ];\n\n\treturn useMemo( () => {\n\t\tconst changes = supports.flatMap( ( key ) => {\n\t\t\tif ( ! STYLE_PROPERTY[ key ] ) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst { value: path } = STYLE_PROPERTY[ key ];\n\t\t\tconst presetAttributeKey = path.join( '.' );\n\t\t\tconst presetAttributeValue =\n\t\t\t\tattributes[\n\t\t\t\t\tSTYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[ presetAttributeKey ]\n\t\t\t\t];\n\t\t\tconst value = presetAttributeValue\n\t\t\t\t? `var:preset|${ STYLE_PATH_TO_CSS_VAR_INFIX[ presetAttributeKey ] }|${ presetAttributeValue }`\n\t\t\t\t: getValueFromObjectPath( attributes.style, path );\n\n\t\t\t// Links only have a single support entry but have two element\n\t\t\t// style properties, color and hover color. The following check\n\t\t\t// will add the hover color to the changes if required.\n\t\t\tif ( key === 'linkColor' ) {\n\t\t\t\tconst linkChanges = value ? [ { path, value } ] : [];\n\t\t\t\tconst hoverPath = [\n\t\t\t\t\t'elements',\n\t\t\t\t\t'link',\n\t\t\t\t\t':hover',\n\t\t\t\t\t'color',\n\t\t\t\t\t'text',\n\t\t\t\t];\n\t\t\t\tconst hoverValue = getValueFromObjectPath(\n\t\t\t\t\tattributes.style,\n\t\t\t\t\thoverPath\n\t\t\t\t);\n\n\t\t\t\tif ( hoverValue ) {\n\t\t\t\t\tlinkChanges.push( { path: hoverPath, value: hoverValue } );\n\t\t\t\t}\n\n\t\t\t\treturn linkChanges;\n\t\t\t}\n\n\t\t\t// The shorthand border styles can't be mapped directly as global\n\t\t\t// styles requires longhand config.\n\t\t\tif ( flatBorderProperties.includes( key ) && value ) {\n\t\t\t\t// The shorthand config path is included to clear the block attribute.\n\t\t\t\tconst borderChanges = [ { path, value } ];\n\t\t\t\tsides.forEach( ( side ) => {\n\t\t\t\t\tconst currentPath = [ ...path ];\n\t\t\t\t\tcurrentPath.splice( -1, 0, side );\n\t\t\t\t\tborderChanges.push( { path: currentPath, value } );\n\t\t\t\t} );\n\t\t\t\treturn borderChanges;\n\t\t\t}\n\n\t\t\treturn value ? [ { path, value } ] : [];\n\t\t} );\n\n\t\t// To ensure display of a visible border, global styles require a\n\t\t// default border style if a border color or width is present.\n\t\tgetBorderStyleChanges(\n\t\t\tattributes.style?.border,\n\t\t\tattributes.borderColor,\n\t\t\tblockUserConfig?.border\n\t\t).forEach( ( change ) => changes.push( change ) );\n\n\t\treturn changes;\n\t}, [ supports, attributes, blockUserConfig ] );\n}\n\nfunction PushChangesToGlobalStylesControl( {\n\tname,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { user: userConfig, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\n\tconst changes = useChangesToPush( name, attributes, userConfig );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst pushChanges = useCallback( () => {\n\t\tif ( changes.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( changes.length > 0 ) {\n\t\t\tconst { style: blockStyles } = attributes;\n\n\t\t\tconst newBlockStyles = structuredClone( blockStyles );\n\t\t\tconst newUserConfig = structuredClone( userConfig );\n\n\t\t\tfor ( const { path, value } of changes ) {\n\t\t\t\tsetNestedValue( newBlockStyles, path, undefined );\n\t\t\t\tsetNestedValue(\n\t\t\t\t\tnewUserConfig,\n\t\t\t\t\t[ 'styles', 'blocks', name, ...path ],\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst newBlockAttributes = {\n\t\t\t\tborderColor: undefined,\n\t\t\t\tbackgroundColor: undefined,\n\t\t\t\ttextColor: undefined,\n\t\t\t\tgradient: undefined,\n\t\t\t\tfontSize: undefined,\n\t\t\t\tfontFamily: undefined,\n\t\t\t\tstyle: cleanEmptyObject( newBlockStyles ),\n\t\t\t};\n\n\t\t\t// @wordpress/core-data doesn't support editing multiple entity types in\n\t\t\t// a single undo level. So for now, we disable @wordpress/core-data undo\n\t\t\t// tracking and implement our own Undo button in the snackbar\n\t\t\t// notification.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( newBlockAttributes );\n\t\t\tsetUserConfig( newUserConfig, { undoIgnore: true } );\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t\t__( '%s styles applied.' ),\n\t\t\t\t\tgetBlockType( name ).title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tsetAttributes( attributes );\n\t\t\t\t\t\t\t\tsetUserConfig( userConfig, {\n\t\t\t\t\t\t\t\t\tundoIgnore: true,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tattributes,\n\t\tchanges,\n\t\tcreateSuccessNotice,\n\t\tname,\n\t\tsetAttributes,\n\t\tsetUserConfig,\n\t\tuserConfig,\n\t] );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"edit-site-push-changes-to-global-styles-control\"\n\t\t\thelp={ sprintf(\n\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t__(\n\t\t\t\t\t'Apply this block\u2019s typography, spacing, dimensions, and color styles to all %s blocks.'\n\t\t\t\t),\n\t\t\t\tgetBlockType( name ).title\n\t\t\t) }\n\t\t>\n\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tdisabled={ changes.length === 0 }\n\t\t\t\tonClick={ pushChanges }\n\t\t\t>\n\t\t\t\t{ __( 'Apply globally' ) }\n\t\t\t</Button>\n\t\t</BaseControl>\n\t);\n}\n\nfunction PushChangesToGlobalStyles( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\tconst supportsStyles = SUPPORTED_STYLES.some( ( feature ) =>\n\t\thasBlockSupport( props.name, feature )\n\t);\n\tconst isDisplayed =\n\t\tblockEditingMode === 'default' && supportsStyles && isBlockBasedTheme;\n\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorAdvancedControls>\n\t\t\t<PushChangesToGlobalStylesControl { ...props } />\n\t\t</InspectorAdvancedControls>\n\t);\n}\n\nconst withPushChangesToGlobalStyles = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => (\n\t\t<>\n\t\t\t<BlockEdit key=\"edit\" { ...props } />\n\t\t\t{ props.isSelected && <PushChangesToGlobalStyles { ...props } /> }\n\t\t</>\n\t)\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-site/push-changes-to-global-styles',\n\twithPushChangesToGlobalStyles\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAoUE;AAjUF,mBAA0B;AAC1B,qBAA2C;AAC3C,0BAKO;AACP,wBAAoC;AACpC,kBAA4B;AAC5B,oBAIO;AACP,qBAAiD;AACjD,kBAAuC;AACvC,qBAAsC;AACtC,uBAAmC;AAKnC,IAAAA,gBAAmC;AACnC,yBAAuB;AACvB,8BAA2B;AAE3B,MAAM,EAAE,kBAAkB,oBAAoB,QAAI;AAAA,EACjD,oBAAAC;AACD;AAKA,MAAM,iBAAiB;AAAA,EACtB,GAAG;AAAA,EACH,UAAU,EAAE,OAAO,CAAE,WAAW,UAAW,EAAE;AAC9C;AAKA,MAAM,8BAA8B;AAAA,EACnC,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,4BAA4B;AAAA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AAC,6BAA4B,GAAG,OAAQ;AAAA,KAC/D;AAEF;AAAA,IAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
|
-
"names": ["import_hooks", "blockEditorPrivateApis", "blockEditorStore", "noticesStore", "setNestedValue", "coreStore"]
|
|
7
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var use_global_styles_output_exports = {};
|
|
20
|
-
__export(use_global_styles_output_exports, {
|
|
21
|
-
useGlobalStylesOutput: () => useGlobalStylesOutput,
|
|
22
|
-
useGlobalStylesOutputWithConfig: () => useGlobalStylesOutputWithConfig
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(use_global_styles_output_exports);
|
|
25
|
-
var import_blocks = require("@wordpress/blocks");
|
|
26
|
-
var import_data = require("@wordpress/data");
|
|
27
|
-
var import_element = require("@wordpress/element");
|
|
28
|
-
var import_global_styles_engine = require("@wordpress/global-styles-engine");
|
|
29
|
-
var import_block_editor = require("@wordpress/block-editor");
|
|
30
|
-
var import_store = require("../store");
|
|
31
|
-
var import_lock_unlock = require("../lock-unlock");
|
|
32
|
-
const { GlobalStylesContext, useGlobalSetting } = (0, import_lock_unlock.unlock)(
|
|
33
|
-
import_block_editor.privateApis
|
|
34
|
-
);
|
|
35
|
-
function useGlobalStylesOutputWithConfig(mergedConfig = {}, disableRootPadding = false) {
|
|
36
|
-
const [blockGap] = useGlobalSetting("spacing.blockGap");
|
|
37
|
-
const hasBlockGapSupport = blockGap !== null;
|
|
38
|
-
const hasFallbackGapSupport = !hasBlockGapSupport;
|
|
39
|
-
const { disableLayoutStyles, getBlockStyles } = (0, import_data.useSelect)((select) => {
|
|
40
|
-
const { getSettings } = select(import_store.store);
|
|
41
|
-
const { getBlockStyles: getBlockStylesSelector } = select(import_blocks.store);
|
|
42
|
-
return {
|
|
43
|
-
disableLayoutStyles: !!getSettings()?.disableLayoutStyles,
|
|
44
|
-
getBlockStyles: getBlockStylesSelector
|
|
45
|
-
};
|
|
46
|
-
}, []);
|
|
47
|
-
return (0, import_element.useMemo)(() => {
|
|
48
|
-
if (!mergedConfig?.styles || !mergedConfig?.settings) {
|
|
49
|
-
return [[], {}];
|
|
50
|
-
}
|
|
51
|
-
const blockTypes = (0, import_blocks.getBlockTypes)();
|
|
52
|
-
return (0, import_global_styles_engine.generateGlobalStyles)(mergedConfig, blockTypes, {
|
|
53
|
-
hasBlockGapSupport,
|
|
54
|
-
hasFallbackGapSupport,
|
|
55
|
-
disableLayoutStyles,
|
|
56
|
-
disableRootPadding,
|
|
57
|
-
getBlockStyles
|
|
58
|
-
});
|
|
59
|
-
}, [
|
|
60
|
-
hasBlockGapSupport,
|
|
61
|
-
hasFallbackGapSupport,
|
|
62
|
-
mergedConfig,
|
|
63
|
-
disableLayoutStyles,
|
|
64
|
-
disableRootPadding,
|
|
65
|
-
getBlockStyles
|
|
66
|
-
]);
|
|
67
|
-
}
|
|
68
|
-
function useGlobalStylesOutput(disableRootPadding = false) {
|
|
69
|
-
const { merged: mergedConfig } = (0, import_element.useContext)(GlobalStylesContext);
|
|
70
|
-
return useGlobalStylesOutputWithConfig(mergedConfig, disableRootPadding);
|
|
71
|
-
}
|
|
72
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
73
|
-
0 && (module.exports = {
|
|
74
|
-
useGlobalStylesOutput,
|
|
75
|
-
useGlobalStylesOutputWithConfig
|
|
76
|
-
});
|
|
77
|
-
//# sourceMappingURL=use-global-styles-output.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/hooks/use-global-styles-output.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { generateGlobalStyles } from '@wordpress/global-styles-engine';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\nconst { GlobalStylesContext, useGlobalSetting } = unlock(\n\tblockEditorPrivateApis\n);\n\n/**\n * Returns the global styles output based on the provided global styles config.\n *\n * @param {Object} mergedConfig The merged global styles config.\n * @param {boolean} disableRootPadding Disable root padding styles.\n *\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutputWithConfig(\n\tmergedConfig = {},\n\tdisableRootPadding = false\n) {\n\tconst [ blockGap ] = useGlobalSetting( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGap !== null;\n\tconst hasFallbackGapSupport = ! hasBlockGapSupport;\n\n\tconst { disableLayoutStyles, getBlockStyles } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( editSiteStore );\n\t\tconst { getBlockStyles: getBlockStylesSelector } =\n\t\t\tselect( blocksStore );\n\t\treturn {\n\t\t\tdisableLayoutStyles: !! getSettings()?.disableLayoutStyles,\n\t\t\tgetBlockStyles: getBlockStylesSelector,\n\t\t};\n\t}, [] );\n\n\treturn useMemo( () => {\n\t\tif ( ! mergedConfig?.styles || ! mergedConfig?.settings ) {\n\t\t\treturn [ [], {} ];\n\t\t}\n\n\t\tconst blockTypes = getBlockTypes();\n\n\t\treturn generateGlobalStyles( mergedConfig, blockTypes, {\n\t\t\thasBlockGapSupport,\n\t\t\thasFallbackGapSupport,\n\t\t\tdisableLayoutStyles,\n\t\t\tdisableRootPadding,\n\t\t\tgetBlockStyles,\n\t\t} );\n\t}, [\n\t\thasBlockGapSupport,\n\t\thasFallbackGapSupport,\n\t\tmergedConfig,\n\t\tdisableLayoutStyles,\n\t\tdisableRootPadding,\n\t\tgetBlockStyles,\n\t] );\n}\n\n/**\n * Returns the global styles output based on the current state of global styles config loaded in the editor context.\n *\n * @param {boolean} disableRootPadding Disable root padding styles.\n *\n * @return {Array} Array of stylesheets and settings.\n */\nexport function useGlobalStylesOutput( disableRootPadding = false ) {\n\tconst { merged: mergedConfig } = useContext( GlobalStylesContext );\n\treturn useGlobalStylesOutputWithConfig( mergedConfig, disableRootPadding );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAoD;AACpD,kBAA0B;AAC1B,qBAAoC;AACpC,kCAAqC;AACrC,0BAAsD;AAKtD,mBAAuC;AACvC,yBAAuB;AAEvB,MAAM,EAAE,qBAAqB,iBAAiB,QAAI;AAAA,EACjD,oBAAAA;AACD;AAUO,SAAS,gCACf,eAAe,CAAC,GAChB,qBAAqB,OACpB;AACD,QAAM,CAAE,QAAS,IAAI,iBAAkB,kBAAmB;AAC1D,QAAM,qBAAqB,aAAa;AACxC,QAAM,wBAAwB,CAAE;AAEhC,QAAM,EAAE,qBAAqB,eAAe,QAAI,uBAAW,CAAE,WAAY;AACxE,UAAM,EAAE,YAAY,IAAI,OAAQ,aAAAC,KAAc;AAC9C,UAAM,EAAE,gBAAgB,uBAAuB,IAC9C,OAAQ,cAAAC,KAAY;AACrB,WAAO;AAAA,MACN,qBAAqB,CAAC,CAAE,YAAY,GAAG;AAAA,MACvC,gBAAgB;AAAA,IACjB;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,aAAO,wBAAS,MAAM;AACrB,QAAK,CAAE,cAAc,UAAU,CAAE,cAAc,UAAW;AACzD,aAAO,CAAE,CAAC,GAAG,CAAC,CAAE;AAAA,IACjB;AAEA,UAAM,iBAAa,6BAAc;AAEjC,eAAO,kDAAsB,cAAc,YAAY;AAAA,MACtD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,CAAE;AAAA,EACH,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;AASO,SAAS,sBAAuB,qBAAqB,OAAQ;AACnE,QAAM,EAAE,QAAQ,aAAa,QAAI,2BAAY,mBAAoB;AACjE,SAAO,gCAAiC,cAAc,kBAAmB;AAC1E;",
|
|
6
|
-
"names": ["blockEditorPrivateApis", "editSiteStore", "blocksStore"]
|
|
7
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var use_theme_style_variations_by_property_exports = {};
|
|
20
|
-
__export(use_theme_style_variations_by_property_exports, {
|
|
21
|
-
filterObjectByProperties: () => filterObjectByProperties,
|
|
22
|
-
isVariationWithProperties: () => isVariationWithProperties,
|
|
23
|
-
removePropertiesFromObject: () => removePropertiesFromObject,
|
|
24
|
-
useCurrentMergeThemeStyleVariationsWithUserConfig: () => useCurrentMergeThemeStyleVariationsWithUserConfig
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(use_theme_style_variations_by_property_exports);
|
|
27
|
-
var import_data = require("@wordpress/data");
|
|
28
|
-
var import_core_data = require("@wordpress/core-data");
|
|
29
|
-
var import_element = require("@wordpress/element");
|
|
30
|
-
var import_block_editor = require("@wordpress/block-editor");
|
|
31
|
-
var import_editor = require("@wordpress/editor");
|
|
32
|
-
var import_i18n = require("@wordpress/i18n");
|
|
33
|
-
var import_lock_unlock = require("../../lock-unlock");
|
|
34
|
-
const EMPTY_ARRAY = [];
|
|
35
|
-
const { GlobalStylesContext, areGlobalStyleConfigsEqual } = (0, import_lock_unlock.unlock)(
|
|
36
|
-
import_block_editor.privateApis
|
|
37
|
-
);
|
|
38
|
-
const { mergeBaseAndUserConfigs } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
39
|
-
function removePropertiesFromObject(object, properties) {
|
|
40
|
-
if (!properties?.length) {
|
|
41
|
-
return object;
|
|
42
|
-
}
|
|
43
|
-
if (typeof object !== "object" || !object || !Object.keys(object).length) {
|
|
44
|
-
return object;
|
|
45
|
-
}
|
|
46
|
-
for (const key in object) {
|
|
47
|
-
if (properties.includes(key)) {
|
|
48
|
-
delete object[key];
|
|
49
|
-
} else if (typeof object[key] === "object") {
|
|
50
|
-
removePropertiesFromObject(object[key], properties);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return object;
|
|
54
|
-
}
|
|
55
|
-
function hasThemeVariation({ title, settings, styles }) {
|
|
56
|
-
return title === (0, import_i18n.__)("Default") || // Always preserve the default variation.
|
|
57
|
-
Object.keys(settings).length > 0 || Object.keys(styles).length > 0;
|
|
58
|
-
}
|
|
59
|
-
function useCurrentMergeThemeStyleVariationsWithUserConfig(properties = []) {
|
|
60
|
-
const { variationsFromTheme } = (0, import_data.useSelect)((select) => {
|
|
61
|
-
const _variationsFromTheme = select(
|
|
62
|
-
import_core_data.store
|
|
63
|
-
).__experimentalGetCurrentThemeGlobalStylesVariations();
|
|
64
|
-
return {
|
|
65
|
-
variationsFromTheme: _variationsFromTheme || EMPTY_ARRAY
|
|
66
|
-
};
|
|
67
|
-
}, []);
|
|
68
|
-
const { user: userVariation } = (0, import_element.useContext)(GlobalStylesContext);
|
|
69
|
-
const propertiesAsString = properties.toString();
|
|
70
|
-
return (0, import_element.useMemo)(() => {
|
|
71
|
-
const clonedUserVariation = structuredClone(userVariation);
|
|
72
|
-
const userVariationWithoutProperties = removePropertiesFromObject(
|
|
73
|
-
clonedUserVariation,
|
|
74
|
-
properties
|
|
75
|
-
);
|
|
76
|
-
userVariationWithoutProperties.title = (0, import_i18n.__)("Default");
|
|
77
|
-
const variationsWithPropertiesAndBase = variationsFromTheme.filter((variation) => {
|
|
78
|
-
return isVariationWithProperties(variation, properties);
|
|
79
|
-
}).map((variation) => {
|
|
80
|
-
return mergeBaseAndUserConfigs(
|
|
81
|
-
userVariationWithoutProperties,
|
|
82
|
-
variation
|
|
83
|
-
);
|
|
84
|
-
});
|
|
85
|
-
const variationsByProperties = [
|
|
86
|
-
userVariationWithoutProperties,
|
|
87
|
-
...variationsWithPropertiesAndBase
|
|
88
|
-
];
|
|
89
|
-
return variationsByProperties?.length ? variationsByProperties.filter(hasThemeVariation) : [];
|
|
90
|
-
}, [propertiesAsString, userVariation, variationsFromTheme]);
|
|
91
|
-
}
|
|
92
|
-
const filterObjectByProperties = (object, properties) => {
|
|
93
|
-
if (!object || !properties?.length) {
|
|
94
|
-
return {};
|
|
95
|
-
}
|
|
96
|
-
const newObject = {};
|
|
97
|
-
Object.keys(object).forEach((key) => {
|
|
98
|
-
if (properties.includes(key)) {
|
|
99
|
-
newObject[key] = object[key];
|
|
100
|
-
} else if (typeof object[key] === "object") {
|
|
101
|
-
const newFilter = filterObjectByProperties(
|
|
102
|
-
object[key],
|
|
103
|
-
properties
|
|
104
|
-
);
|
|
105
|
-
if (Object.keys(newFilter).length) {
|
|
106
|
-
newObject[key] = newFilter;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
return newObject;
|
|
111
|
-
};
|
|
112
|
-
function isVariationWithProperties(variation, properties) {
|
|
113
|
-
const variationWithProperties = filterObjectByProperties(
|
|
114
|
-
structuredClone(variation),
|
|
115
|
-
properties
|
|
116
|
-
);
|
|
117
|
-
return areGlobalStyleConfigsEqual(variationWithProperties, variation);
|
|
118
|
-
}
|
|
119
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
120
|
-
0 && (module.exports = {
|
|
121
|
-
filterObjectByProperties,
|
|
122
|
-
isVariationWithProperties,
|
|
123
|
-
removePropertiesFromObject,
|
|
124
|
-
useCurrentMergeThemeStyleVariationsWithUserConfig
|
|
125
|
-
});
|
|
126
|
-
//# sourceMappingURL=use-theme-style-variations-by-property.js.map
|
package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst EMPTY_ARRAY = [];\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\n/**\n * Removes all instances of properties from an object.\n *\n * @param {Object} object The object to remove the properties from.\n * @param {string[]} properties The properties to remove.\n * @return {Object} The modified object.\n */\nexport function removePropertiesFromObject( object, properties ) {\n\tif ( ! properties?.length ) {\n\t\treturn object;\n\t}\n\n\tif (\n\t\ttypeof object !== 'object' ||\n\t\t! object ||\n\t\t! Object.keys( object ).length\n\t) {\n\t\treturn object;\n\t}\n\n\tfor ( const key in object ) {\n\t\tif ( properties.includes( key ) ) {\n\t\t\tdelete object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tremovePropertiesFromObject( object[ key ], properties );\n\t\t}\n\t}\n\treturn object;\n}\n\n/**\n * Checks whether a style variation is empty.\n *\n * @param {Object} variation A style variation object.\n * @param {string} variation.title The title of the variation.\n * @param {Object} variation.settings The settings of the variation.\n * @param {Object} variation.styles The styles of the variation.\n * @return {boolean} Whether the variation is empty.\n */\nfunction hasThemeVariation( { title, settings, styles } ) {\n\treturn (\n\t\ttitle === __( 'Default' ) || // Always preserve the default variation.\n\t\tObject.keys( settings ).length > 0 ||\n\t\tObject.keys( styles ).length > 0\n\t);\n}\n\n/**\n * Fetches the current theme style variations that contain only the specified properties\n * and merges them with the user config.\n *\n * @param {string[]} properties The properties to filter by.\n * @return {Object[]|*} The merged object.\n */\nexport function useCurrentMergeThemeStyleVariationsWithUserConfig(\n\tproperties = []\n) {\n\tconst { variationsFromTheme } = useSelect( ( select ) => {\n\t\tconst _variationsFromTheme =\n\t\t\tselect(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\n\t\treturn {\n\t\t\tvariationsFromTheme: _variationsFromTheme || EMPTY_ARRAY,\n\t\t};\n\t}, [] );\n\tconst { user: userVariation } = useContext( GlobalStylesContext );\n\n\tconst propertiesAsString = properties.toString();\n\n\treturn useMemo( () => {\n\t\tconst clonedUserVariation = structuredClone( userVariation );\n\n\t\t// Get user variation and remove the settings for the given property.\n\t\tconst userVariationWithoutProperties = removePropertiesFromObject(\n\t\t\tclonedUserVariation,\n\t\t\tproperties\n\t\t);\n\t\tuserVariationWithoutProperties.title = __( 'Default' );\n\n\t\tconst variationsWithPropertiesAndBase = variationsFromTheme\n\t\t\t.filter( ( variation ) => {\n\t\t\t\treturn isVariationWithProperties( variation, properties );\n\t\t\t} )\n\t\t\t.map( ( variation ) => {\n\t\t\t\treturn mergeBaseAndUserConfigs(\n\t\t\t\t\tuserVariationWithoutProperties,\n\t\t\t\t\tvariation\n\t\t\t\t);\n\t\t\t} );\n\n\t\tconst variationsByProperties = [\n\t\t\tuserVariationWithoutProperties,\n\t\t\t...variationsWithPropertiesAndBase,\n\t\t];\n\n\t\t/*\n\t\t * Filter out variations with no settings or styles.\n\t\t */\n\t\treturn variationsByProperties?.length\n\t\t\t? variationsByProperties.filter( hasThemeVariation )\n\t\t\t: [];\n\t}, [ propertiesAsString, userVariation, variationsFromTheme ] );\n}\n\n/**\n * Returns a new object, with properties specified in `properties` array.,\n * maintain the original object tree structure.\n * The function is recursive, so it will perform a deep search for the given properties.\n * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the properties are `[ 'test' ]`.\n *\n * @param {Object} object The object to filter\n * @param {string[]} properties The properties to filter by\n * @return {Object} The merged object.\n */\nexport const filterObjectByProperties = ( object, properties ) => {\n\tif ( ! object || ! properties?.length ) {\n\t\treturn {};\n\t}\n\n\tconst newObject = {};\n\tObject.keys( object ).forEach( ( key ) => {\n\t\tif ( properties.includes( key ) ) {\n\t\t\tnewObject[ key ] = object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tconst newFilter = filterObjectByProperties(\n\t\t\t\tobject[ key ],\n\t\t\t\tproperties\n\t\t\t);\n\t\t\tif ( Object.keys( newFilter ).length ) {\n\t\t\t\tnewObject[ key ] = newFilter;\n\t\t\t}\n\t\t}\n\t} );\n\treturn newObject;\n};\n\n/**\n * Compares a style variation to the same variation filtered by the specified properties.\n * Returns true if the variation contains only the properties specified.\n *\n * @param {Object} variation The variation to compare.\n * @param {string[]} properties The properties to compare.\n * @return {boolean} Whether the variation contains only the specified properties.\n */\nexport function isVariationWithProperties( variation, properties ) {\n\tconst variationWithProperties = filterObjectByProperties(\n\t\tstructuredClone( variation ),\n\t\tproperties\n\t);\n\n\treturn areGlobalStyleConfigsEqual( variationWithProperties, variation );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,uBAAmC;AACnC,qBAAoC;AACpC,0BAAsD;AACtD,oBAAiD;AACjD,kBAAmB;AAKnB,yBAAuB;AAEvB,MAAM,cAAc,CAAC;AACrB,MAAM,EAAE,qBAAqB,2BAA2B,QAAI;AAAA,EAC3D,oBAAAA;AACD;AACA,MAAM,EAAE,wBAAwB,QAAI,2BAAQ,cAAAC,WAAkB;AASvD,SAAS,2BAA4B,QAAQ,YAAa;AAChE,MAAK,CAAE,YAAY,QAAS;AAC3B,WAAO;AAAA,EACR;AAEA,MACC,OAAO,WAAW,YAClB,CAAE,UACF,CAAE,OAAO,KAAM,MAAO,EAAE,QACvB;AACD,WAAO;AAAA,EACR;AAEA,aAAY,OAAO,QAAS;AAC3B,QAAK,WAAW,SAAU,GAAI,GAAI;AACjC,aAAO,OAAQ,GAAI;AAAA,IACpB,WAAY,OAAO,OAAQ,GAAI,MAAM,UAAW;AAC/C,iCAA4B,OAAQ,GAAI,GAAG,UAAW;AAAA,IACvD;AAAA,EACD;AACA,SAAO;AACR;A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AI,IAAI,OAAQ,GAAI;AAAA,IAChC,WAAY,OAAO,OAAQ,GAAI,MAAM,UAAW;AAC/C,YAAM,YAAY;AAAA,QACjB,OAAQ,GAAI;AAAA,QACZ;AAAA,MACD;AACA,UAAK,OAAO,KAAM,SAAU,EAAE,QAAS;AACtC,kBAAW,GAAI,IAAI;AAAA,MACpB;AAAA,IACD;AAAA,EACD,CAAE;AACF,SAAO;AACR;AAUO,SAAS,0BAA2B,WAAW,YAAa;AAClE,QAAM,0BAA0B;AAAA,IAC/B,gBAAiB,SAAU;AAAA,IAC3B;AAAA,EACD;AAEA,SAAO,2BAA4B,yBAAyB,SAAU;AACvE;",
|
|
6
|
-
"names": ["blockEditorPrivateApis", "editorPrivateApis", "coreStore"]
|
|
7
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var set_nested_value_exports = {};
|
|
20
|
-
__export(set_nested_value_exports, {
|
|
21
|
-
default: () => setNestedValue
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(set_nested_value_exports);
|
|
24
|
-
function setNestedValue(object, path, value) {
|
|
25
|
-
if (!object || typeof object !== "object") {
|
|
26
|
-
return object;
|
|
27
|
-
}
|
|
28
|
-
path.reduce((acc, key, idx) => {
|
|
29
|
-
if (acc[key] === void 0) {
|
|
30
|
-
if (Number.isInteger(path[idx + 1])) {
|
|
31
|
-
acc[key] = [];
|
|
32
|
-
} else {
|
|
33
|
-
acc[key] = {};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
if (idx === path.length - 1) {
|
|
37
|
-
acc[key] = value;
|
|
38
|
-
}
|
|
39
|
-
return acc[key];
|
|
40
|
-
}, object);
|
|
41
|
-
return object;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=set-nested-value.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/set-nested-value.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * Sets the value at path of object.\n * If a portion of path doesn\u2019t exist, it\u2019s created.\n * Arrays are created for missing index properties while objects are created\n * for all other missing properties.\n *\n * This function intentionally mutates the input object.\n *\n * Inspired by _.set().\n *\n * @see https://lodash.com/docs/4.17.15#set\n *\n * @todo Needs to be deduplicated with its copy in `@wordpress/core-data`.\n *\n * @param {Object} object Object to modify\n * @param {Array} path Path of the property to set.\n * @param {*} value Value to set.\n */\nexport default function setNestedValue( object, path, value ) {\n\tif ( ! object || typeof object !== 'object' ) {\n\t\treturn object;\n\t}\n\n\tpath.reduce( ( acc, key, idx ) => {\n\t\tif ( acc[ key ] === undefined ) {\n\t\t\tif ( Number.isInteger( path[ idx + 1 ] ) ) {\n\t\t\t\tacc[ key ] = [];\n\t\t\t} else {\n\t\t\t\tacc[ key ] = {};\n\t\t\t}\n\t\t}\n\t\tif ( idx === path.length - 1 ) {\n\t\t\tacc[ key ] = value;\n\t\t}\n\t\treturn acc[ key ];\n\t}, object );\n\n\treturn object;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBe,SAAR,eAAiC,QAAQ,MAAM,OAAQ;AAC7D,MAAK,CAAE,UAAU,OAAO,WAAW,UAAW;AAC7C,WAAO;AAAA,EACR;AAEA,OAAK,OAAQ,CAAE,KAAK,KAAK,QAAS;AACjC,QAAK,IAAK,GAAI,MAAM,QAAY;AAC/B,UAAK,OAAO,UAAW,KAAM,MAAM,CAAE,CAAE,GAAI;AAC1C,YAAK,GAAI,IAAI,CAAC;AAAA,MACf,OAAO;AACN,YAAK,GAAI,IAAI,CAAC;AAAA,MACf;AAAA,IACD;AACA,QAAK,QAAQ,KAAK,SAAS,GAAI;AAC9B,UAAK,GAAI,IAAI;AAAA,IACd;AACA,WAAO,IAAK,GAAI;AAAA,EACjB,GAAG,MAAO;AAEV,SAAO;AACR;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Children, cloneElement, useState } from "@wordpress/element";
|
|
3
|
-
import {
|
|
4
|
-
Button,
|
|
5
|
-
__experimentalUseSlotFills as useSlotFills
|
|
6
|
-
} from "@wordpress/components";
|
|
7
|
-
import { ESCAPE } from "@wordpress/keycodes";
|
|
8
|
-
import { __ } from "@wordpress/i18n";
|
|
9
|
-
import { useDispatch, useSelect } from "@wordpress/data";
|
|
10
|
-
import { closeSmall } from "@wordpress/icons";
|
|
11
|
-
import { useFocusOnMount, useFocusReturn } from "@wordpress/compose";
|
|
12
|
-
import { store as preferencesStore } from "@wordpress/preferences";
|
|
13
|
-
import {
|
|
14
|
-
store as editorStore,
|
|
15
|
-
privateApis as editorPrivateApis
|
|
16
|
-
} from "@wordpress/editor";
|
|
17
|
-
import { unlock } from "../../lock-unlock";
|
|
18
|
-
import { store as editSiteStore } from "../../store";
|
|
19
|
-
const { EditorContentSlotFill, ResizableEditor } = unlock(editorPrivateApis);
|
|
20
|
-
function getEditorCanvasContainerTitle(view) {
|
|
21
|
-
switch (view) {
|
|
22
|
-
case "style-book":
|
|
23
|
-
return __("Style Book");
|
|
24
|
-
case "global-styles-revisions":
|
|
25
|
-
case "global-styles-revisions:style-book":
|
|
26
|
-
return __("Style Revisions");
|
|
27
|
-
default:
|
|
28
|
-
return "";
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function EditorCanvasContainer({
|
|
32
|
-
children,
|
|
33
|
-
closeButtonLabel,
|
|
34
|
-
onClose,
|
|
35
|
-
enableResizing = false
|
|
36
|
-
}) {
|
|
37
|
-
const { editorCanvasContainerView, showListViewByDefault } = useSelect(
|
|
38
|
-
(select) => {
|
|
39
|
-
const _editorCanvasContainerView = unlock(
|
|
40
|
-
select(editSiteStore)
|
|
41
|
-
).getEditorCanvasContainerView();
|
|
42
|
-
const _showListViewByDefault = select(preferencesStore).get(
|
|
43
|
-
"core",
|
|
44
|
-
"showListViewByDefault"
|
|
45
|
-
);
|
|
46
|
-
return {
|
|
47
|
-
editorCanvasContainerView: _editorCanvasContainerView,
|
|
48
|
-
showListViewByDefault: _showListViewByDefault
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
[]
|
|
52
|
-
);
|
|
53
|
-
const [isClosed, setIsClosed] = useState(false);
|
|
54
|
-
const { setEditorCanvasContainerView } = unlock(
|
|
55
|
-
useDispatch(editSiteStore)
|
|
56
|
-
);
|
|
57
|
-
const { setIsListViewOpened } = useDispatch(editorStore);
|
|
58
|
-
const focusOnMountRef = useFocusOnMount("firstElement");
|
|
59
|
-
const sectionFocusReturnRef = useFocusReturn();
|
|
60
|
-
function onCloseContainer() {
|
|
61
|
-
setIsListViewOpened(showListViewByDefault);
|
|
62
|
-
setEditorCanvasContainerView(void 0);
|
|
63
|
-
setIsClosed(true);
|
|
64
|
-
if (typeof onClose === "function") {
|
|
65
|
-
onClose();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function closeOnEscape(event) {
|
|
69
|
-
if (event.keyCode === ESCAPE && !event.defaultPrevented) {
|
|
70
|
-
event.preventDefault();
|
|
71
|
-
onCloseContainer();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
const childrenWithProps = Array.isArray(children) ? Children.map(
|
|
75
|
-
children,
|
|
76
|
-
(child, index) => index === 0 ? cloneElement(child, {
|
|
77
|
-
ref: sectionFocusReturnRef
|
|
78
|
-
}) : child
|
|
79
|
-
) : cloneElement(children, {
|
|
80
|
-
ref: sectionFocusReturnRef
|
|
81
|
-
});
|
|
82
|
-
if (isClosed) {
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
const title = getEditorCanvasContainerTitle(editorCanvasContainerView);
|
|
86
|
-
const shouldShowCloseButton = onClose || closeButtonLabel;
|
|
87
|
-
return /* @__PURE__ */ jsx(EditorContentSlotFill.Fill, { children: /* @__PURE__ */ jsx("div", { className: "edit-site-editor-canvas-container", children: /* @__PURE__ */ jsx(ResizableEditor, { enableResizing, children: /* @__PURE__ */ jsxs(
|
|
88
|
-
"section",
|
|
89
|
-
{
|
|
90
|
-
className: "edit-site-editor-canvas-container__section",
|
|
91
|
-
ref: shouldShowCloseButton ? focusOnMountRef : null,
|
|
92
|
-
onKeyDown: closeOnEscape,
|
|
93
|
-
"aria-label": title,
|
|
94
|
-
children: [
|
|
95
|
-
shouldShowCloseButton && /* @__PURE__ */ jsx(
|
|
96
|
-
Button,
|
|
97
|
-
{
|
|
98
|
-
size: "compact",
|
|
99
|
-
className: "edit-site-editor-canvas-container__close-button",
|
|
100
|
-
icon: closeSmall,
|
|
101
|
-
label: closeButtonLabel || __("Close"),
|
|
102
|
-
onClick: onCloseContainer
|
|
103
|
-
}
|
|
104
|
-
),
|
|
105
|
-
childrenWithProps
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
) }) }) });
|
|
109
|
-
}
|
|
110
|
-
function useHasEditorCanvasContainer() {
|
|
111
|
-
const fills = useSlotFills(EditorContentSlotFill.name);
|
|
112
|
-
return !!fills?.length;
|
|
113
|
-
}
|
|
114
|
-
var editor_canvas_container_default = EditorCanvasContainer;
|
|
115
|
-
export {
|
|
116
|
-
editor_canvas_container_default as default,
|
|
117
|
-
getEditorCanvasContainerTitle,
|
|
118
|
-
useHasEditorCanvasContainer
|
|
119
|
-
};
|
|
120
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/editor-canvas-container/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Children, cloneElement, useState } from '@wordpress/element';\nimport {\n\tButton,\n\t__experimentalUseSlotFills as useSlotFills,\n} from '@wordpress/components';\nimport { ESCAPE } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { closeSmall } from '@wordpress/icons';\nimport { useFocusOnMount, useFocusReturn } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst { EditorContentSlotFill, ResizableEditor } = unlock( editorPrivateApis );\n\n/**\n * Returns a translated string for the title of the editor canvas container.\n *\n * @param {string} view Editor canvas container view.\n *\n * @return {Object} Translated string for the view title and associated icon, both defaulting to ''.\n */\nfunction getEditorCanvasContainerTitle( view ) {\n\tswitch ( view ) {\n\t\tcase 'style-book':\n\t\t\treturn __( 'Style Book' );\n\t\tcase 'global-styles-revisions':\n\t\tcase 'global-styles-revisions:style-book':\n\t\t\treturn __( 'Style Revisions' );\n\t\tdefault:\n\t\t\treturn '';\n\t}\n}\n\nfunction EditorCanvasContainer( {\n\tchildren,\n\tcloseButtonLabel,\n\tonClose,\n\tenableResizing = false,\n} ) {\n\tconst { editorCanvasContainerView, showListViewByDefault } = useSelect(\n\t\t( select ) => {\n\t\t\tconst _editorCanvasContainerView = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView();\n\n\t\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'showListViewByDefault'\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\teditorCanvasContainerView: _editorCanvasContainerView,\n\t\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst [ isClosed, setIsClosed ] = useState( false );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst sectionFocusReturnRef = useFocusReturn();\n\n\tfunction onCloseContainer() {\n\t\tsetIsListViewOpened( showListViewByDefault );\n\t\tsetEditorCanvasContainerView( undefined );\n\t\tsetIsClosed( true );\n\t\tif ( typeof onClose === 'function' ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tonCloseContainer();\n\t\t}\n\t}\n\n\tconst childrenWithProps = Array.isArray( children )\n\t\t? Children.map( children, ( child, index ) =>\n\t\t\t\tindex === 0\n\t\t\t\t\t? cloneElement( child, {\n\t\t\t\t\t\t\tref: sectionFocusReturnRef,\n\t\t\t\t\t } )\n\t\t\t\t\t: child\n\t\t )\n\t\t: cloneElement( children, {\n\t\t\t\tref: sectionFocusReturnRef,\n\t\t } );\n\n\tif ( isClosed ) {\n\t\treturn null;\n\t}\n\n\tconst title = getEditorCanvasContainerTitle( editorCanvasContainerView );\n\tconst shouldShowCloseButton = onClose || closeButtonLabel;\n\n\treturn (\n\t\t<EditorContentSlotFill.Fill>\n\t\t\t<div className=\"edit-site-editor-canvas-container\">\n\t\t\t\t<ResizableEditor enableResizing={ enableResizing }>\n\t\t\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t\t\t<section\n\t\t\t\t\t\tclassName=\"edit-site-editor-canvas-container__section\"\n\t\t\t\t\t\tref={ shouldShowCloseButton ? focusOnMountRef : null }\n\t\t\t\t\t\tonKeyDown={ closeOnEscape }\n\t\t\t\t\t\taria-label={ title }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ shouldShowCloseButton && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\tclassName=\"edit-site-editor-canvas-container__close-button\"\n\t\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\t\tlabel={ closeButtonLabel || __( 'Close' ) }\n\t\t\t\t\t\t\t\tonClick={ onCloseContainer }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ childrenWithProps }\n\t\t\t\t\t</section>\n\t\t\t\t</ResizableEditor>\n\t\t\t</div>\n\t\t</EditorContentSlotFill.Fill>\n\t);\n}\n\nfunction useHasEditorCanvasContainer() {\n\tconst fills = useSlotFills( EditorContentSlotFill.name );\n\treturn !! fills?.length;\n}\n\nexport default EditorCanvasContainer;\nexport { useHasEditorCanvasContainer, getEditorCanvasContainerTitle };\n"],
|
|
5
|
-
"mappings": "AAuHK,SAOE,KAPF;AApHL,SAAS,UAAU,cAAc,gBAAgB;AACjD;AAAA,EACC;AAAA,EACA,8BAA8B;AAAA,OACxB;AACP,SAAS,cAAc;AACvB,SAAS,UAAU;AACnB,SAAS,aAAa,iBAAiB;AACvC,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB,sBAAsB;AAChD,SAAS,SAAS,wBAAwB;AAC1C;AAAA,EACC,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AAKP,SAAS,cA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,SAAS;AAAA,IAAK;AAAA,IAAU,CAAE,OAAO,UACjC,UAAU,IACP,aAAc,OAAO;AAAA,MACrB,KAAK;AAAA,IACL,CAAE,IACF;AAAA,EACH,IACA,aAAc,UAAU;AAAA,IACxB,KAAK;AAAA,EACL,CAAE;AAEL,MAAK,UAAW;AACf,WAAO;AAAA,EACR;AAEA,QAAM,QAAQ,8BAA+B,yBAA0B;AACvE,QAAM,wBAAwB,WAAW;AAEzC,SACC,oBAAC,sBAAsB,MAAtB,EACA,8BAAC,SAAI,WAAU,qCACd,8BAAC,mBAAgB,gBAEhB;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,KAAM,wBAAwB,kBAAkB;AAAA,MAChD,WAAY;AAAA,MACZ,cAAa;AAAA,MAEX;AAAA,iCACD;AAAA,UAAC;AAAA;AAAA,YACA,MAAK;AAAA,YACL,WAAU;AAAA,YACV,MAAO;AAAA,YACP,OAAQ,oBAAoB,GAAI,OAAQ;AAAA,YACxC,SAAU;AAAA;AAAA,QACX;AAAA,QAEC;AAAA;AAAA;AAAA,EACH,GACD,GACD,GACD;AAEF;AAEA,SAAS,8BAA8B;AACtC,QAAM,QAAQ,aAAc,sBAAsB,IAAK;AACvD,SAAO,CAAC,CAAE,OAAO;AAClB;AAEA,IAAO,kCAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
|
|
3
|
-
import { unlock } from "../../lock-unlock";
|
|
4
|
-
const BACKGROUND_DEFAULT_VALUES = {
|
|
5
|
-
backgroundSize: "auto"
|
|
6
|
-
};
|
|
7
|
-
const {
|
|
8
|
-
useGlobalStyle,
|
|
9
|
-
useGlobalSetting,
|
|
10
|
-
BackgroundPanel: StylesBackgroundPanel
|
|
11
|
-
} = unlock(blockEditorPrivateApis);
|
|
12
|
-
function hasBackgroundImageValue(style) {
|
|
13
|
-
return !!style?.background?.backgroundImage?.id || !!style?.background?.backgroundImage?.url || typeof style?.background?.backgroundImage === "string";
|
|
14
|
-
}
|
|
15
|
-
function BackgroundPanel() {
|
|
16
|
-
const [style] = useGlobalStyle("", void 0, "user", {
|
|
17
|
-
shouldDecodeEncode: false
|
|
18
|
-
});
|
|
19
|
-
const [inheritedStyle, setStyle] = useGlobalStyle("", void 0, "all", {
|
|
20
|
-
shouldDecodeEncode: false
|
|
21
|
-
});
|
|
22
|
-
const [settings] = useGlobalSetting("");
|
|
23
|
-
return /* @__PURE__ */ jsx(
|
|
24
|
-
StylesBackgroundPanel,
|
|
25
|
-
{
|
|
26
|
-
inheritedValue: inheritedStyle,
|
|
27
|
-
value: style,
|
|
28
|
-
onChange: setStyle,
|
|
29
|
-
settings,
|
|
30
|
-
defaultValues: BACKGROUND_DEFAULT_VALUES
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
export {
|
|
35
|
-
BackgroundPanel as default,
|
|
36
|
-
hasBackgroundImageValue
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=background-panel.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/global-styles/background-panel.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\n// Initial control values where no block style is set.\nconst BACKGROUND_DEFAULT_VALUES = {\n\tbackgroundSize: 'auto',\n};\n\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tBackgroundPanel: StylesBackgroundPanel,\n} = unlock( blockEditorPrivateApis );\n\n/**\n * Checks if there is a current value in the background image block support\n * attributes.\n *\n * @param {Object} style Style attribute.\n * @return {boolean} Whether the block has a background image value set.\n */\nexport function hasBackgroundImageValue( style ) {\n\treturn (\n\t\t!! style?.background?.backgroundImage?.id ||\n\t\t!! style?.background?.backgroundImage?.url ||\n\t\ttypeof style?.background?.backgroundImage === 'string'\n\t);\n}\n\nexport default function BackgroundPanel() {\n\tconst [ style ] = useGlobalStyle( '', undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle( '', undefined, 'all', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ settings ] = useGlobalSetting( '' );\n\n\treturn (\n\t\t<StylesBackgroundPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ settings }\n\t\t\tdefaultValues={ BACKGROUND_DEFAULT_VALUES }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "AA8CE;AA3CF,SAAS,eAAe,8BAA8B;AAKtD,SAAS,cAAc;AAGvB,MAAM,4BAA4B;AAAA,EACjC,gBAAgB;AACjB;AAEA,MAAM;AAAA,EACL;AAAA,EACA;AAAA,EACA,iBAAiB;AAClB,IAAI,OAAQ,sBAAuB;AAS5B,SAAS,wBAAyB,OAAQ;AAChD,SACC,CAAC,CAAE,OAAO,YAAY,iBAAiB,MACvC,CAAC,CAAE,OAAO,YAAY,iBAAiB,OACvC,OAAO,OAAO,YAAY,oBAAoB;AAEhD;AAEe,SAAR,kBAAmC;AACzC,QAAM,CAAE,KAAM,IAAI,eAAgB,IAAI,QAAW,QAAQ;AAAA,IACxD,oBAAoB;AAAA,EACrB,CAAE;AACF,QAAM,CAAE,gBAAgB,QAAS,IAAI,eAAgB,IAAI,QAAW,OAAO;AAAA,IAC1E,oBAAoB;AAAA,EACrB,CAAE;AACF,QAAM,CAAE,QAAS,IAAI,iBAAkB,EAAG;AAE1C,SACC;AAAA,IAAC;AAAA;AAAA,MACA,gBAAiB;AAAA,MACjB,OAAQ;AAAA,MACR,UAAW;AAAA,MACX;AAAA,MACA,eAAgB;AAAA;AAAA,EACjB;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { BlockPreview } from "@wordpress/block-editor";
|
|
3
|
-
import { getBlockType, getBlockFromExample } from "@wordpress/blocks";
|
|
4
|
-
import { __experimentalSpacer as Spacer } from "@wordpress/components";
|
|
5
|
-
import { useMemo } from "@wordpress/element";
|
|
6
|
-
import { getVariationClassName } from "./utils";
|
|
7
|
-
const BlockPreviewPanel = ({ name, variation = "" }) => {
|
|
8
|
-
const blockExample = getBlockType(name)?.example;
|
|
9
|
-
const blocks = useMemo(() => {
|
|
10
|
-
if (!blockExample) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
const example = {
|
|
14
|
-
...blockExample,
|
|
15
|
-
attributes: {
|
|
16
|
-
...blockExample.attributes,
|
|
17
|
-
style: void 0,
|
|
18
|
-
className: variation ? getVariationClassName(variation) : blockExample.attributes?.className
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
return getBlockFromExample(name, example);
|
|
22
|
-
}, [name, blockExample, variation]);
|
|
23
|
-
const viewportWidth = blockExample?.viewportWidth ?? 500;
|
|
24
|
-
const previewHeight = 144;
|
|
25
|
-
const sidebarWidth = 235;
|
|
26
|
-
const scale = sidebarWidth / viewportWidth;
|
|
27
|
-
const minHeight = scale !== 0 && scale < 1 && previewHeight ? previewHeight / scale : previewHeight;
|
|
28
|
-
if (!blockExample) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
return /* @__PURE__ */ jsx(Spacer, { marginX: 4, marginBottom: 4, children: /* @__PURE__ */ jsx(
|
|
32
|
-
"div",
|
|
33
|
-
{
|
|
34
|
-
className: "edit-site-global-styles__block-preview-panel",
|
|
35
|
-
style: { maxHeight: previewHeight, boxSizing: "initial" },
|
|
36
|
-
children: /* @__PURE__ */ jsx(
|
|
37
|
-
BlockPreview,
|
|
38
|
-
{
|
|
39
|
-
blocks,
|
|
40
|
-
viewportWidth,
|
|
41
|
-
minHeight: previewHeight,
|
|
42
|
-
additionalStyles: (
|
|
43
|
-
//We want this CSS to be in sync with the one in InserterPreviewPanel.
|
|
44
|
-
[
|
|
45
|
-
{
|
|
46
|
-
css: `
|
|
47
|
-
body{
|
|
48
|
-
padding: 24px;
|
|
49
|
-
min-height:${Math.round(minHeight)}px;
|
|
50
|
-
display:flex;
|
|
51
|
-
align-items:center;
|
|
52
|
-
}
|
|
53
|
-
.is-root-container { width: 100%; }
|
|
54
|
-
`
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
) });
|
|
62
|
-
};
|
|
63
|
-
var block_preview_panel_default = BlockPreviewPanel;
|
|
64
|
-
export {
|
|
65
|
-
block_preview_panel_default as default
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=block-preview-panel.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/global-styles/block-preview-panel.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { BlockPreview } from '@wordpress/block-editor';\nimport { getBlockType, getBlockFromExample } from '@wordpress/blocks';\nimport { __experimentalSpacer as Spacer } from '@wordpress/components';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { getVariationClassName } from './utils';\n\nconst BlockPreviewPanel = ( { name, variation = '' } ) => {\n\tconst blockExample = getBlockType( name )?.example;\n\tconst blocks = useMemo( () => {\n\t\tif ( ! blockExample ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst example = {\n\t\t\t...blockExample,\n\t\t\tattributes: {\n\t\t\t\t...blockExample.attributes,\n\t\t\t\tstyle: undefined,\n\t\t\t\tclassName: variation\n\t\t\t\t\t? getVariationClassName( variation )\n\t\t\t\t\t: blockExample.attributes?.className,\n\t\t\t},\n\t\t};\n\n\t\treturn getBlockFromExample( name, example );\n\t}, [ name, blockExample, variation ] );\n\n\tconst viewportWidth = blockExample?.viewportWidth ?? 500;\n\t// Same as height of InserterPreviewPanel.\n\tconst previewHeight = 144;\n\tconst sidebarWidth = 235;\n\tconst scale = sidebarWidth / viewportWidth;\n\tconst minHeight =\n\t\tscale !== 0 && scale < 1 && previewHeight\n\t\t\t? previewHeight / scale\n\t\t\t: previewHeight;\n\n\tif ( ! blockExample ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Spacer marginX={ 4 } marginBottom={ 4 }>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-site-global-styles__block-preview-panel\"\n\t\t\t\tstyle={ { maxHeight: previewHeight, boxSizing: 'initial' } }\n\t\t\t>\n\t\t\t\t<BlockPreview\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t\tminHeight={ previewHeight }\n\t\t\t\t\tadditionalStyles={\n\t\t\t\t\t\t//We want this CSS to be in sync with the one in InserterPreviewPanel.\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcss: `\n\t\t\t\t\t\t\t\tbody{\n\t\t\t\t\t\t\t\t\tpadding: 24px;\n\t\t\t\t\t\t\t\t\tmin-height:${ Math.round( minHeight ) }px;\n\t\t\t\t\t\t\t\t\tdisplay:flex;\n\t\t\t\t\t\t\t\t\talign-items:center;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t.is-root-container { width: 100%; }\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</Spacer>\n\t);\n};\n\nexport default BlockPreviewPanel;\n"],
|
|
5
|
-
"mappings": "AAsDI;AAnDJ,SAAS,oBAAoB;AAC7B,SAAS,cAAc,2BAA2B;AAClD,SAAS,wBA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-
import clsx from "clsx";
|
|
3
|
-
import { Flex } from "@wordpress/components";
|
|
4
|
-
function ColorIndicatorWrapper({ className, ...props }) {
|
|
5
|
-
return /* @__PURE__ */ jsx(
|
|
6
|
-
Flex,
|
|
7
|
-
{
|
|
8
|
-
className: clsx(
|
|
9
|
-
"edit-site-global-styles__color-indicator-wrapper",
|
|
10
|
-
className
|
|
11
|
-
),
|
|
12
|
-
...props
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
var color_indicator_wrapper_default = ColorIndicatorWrapper;
|
|
17
|
-
export {
|
|
18
|
-
color_indicator_wrapper_default as default
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=color-indicator-wrapper.js.map
|