@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,66 +0,0 @@
|
|
|
1
|
-
function getVariationClassName(variation) {
|
|
2
|
-
if (!variation) {
|
|
3
|
-
return "";
|
|
4
|
-
}
|
|
5
|
-
return `is-style-${variation}`;
|
|
6
|
-
}
|
|
7
|
-
function getNewIndexFromPresets(presets, slugPrefix) {
|
|
8
|
-
const nameRegex = new RegExp(`^${slugPrefix}([\\d]+)$`);
|
|
9
|
-
const highestPresetValue = presets.reduce((currentHighest, preset) => {
|
|
10
|
-
if (typeof preset?.slug === "string") {
|
|
11
|
-
const matches = preset?.slug.match(nameRegex);
|
|
12
|
-
if (matches) {
|
|
13
|
-
const id = parseInt(matches[1], 10);
|
|
14
|
-
if (id > currentHighest) {
|
|
15
|
-
return id;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return currentHighest;
|
|
20
|
-
}, 0);
|
|
21
|
-
return highestPresetValue + 1;
|
|
22
|
-
}
|
|
23
|
-
function getFontFamilyFromSetting(fontFamilies, setting) {
|
|
24
|
-
if (!Array.isArray(fontFamilies) || !setting) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
const fontFamilyVariable = setting.replace("var(", "").replace(")", "");
|
|
28
|
-
const fontFamilySlug = fontFamilyVariable?.split("--").slice(-1)[0];
|
|
29
|
-
return fontFamilies.find(
|
|
30
|
-
(fontFamily) => fontFamily.slug === fontFamilySlug
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
function getFontFamilies(themeJson) {
|
|
34
|
-
const themeFontFamilies = themeJson?.settings?.typography?.fontFamilies?.theme;
|
|
35
|
-
const customFontFamilies = themeJson?.settings?.typography?.fontFamilies?.custom;
|
|
36
|
-
let fontFamilies = [];
|
|
37
|
-
if (themeFontFamilies && customFontFamilies) {
|
|
38
|
-
fontFamilies = [...themeFontFamilies, ...customFontFamilies];
|
|
39
|
-
} else if (themeFontFamilies) {
|
|
40
|
-
fontFamilies = themeFontFamilies;
|
|
41
|
-
} else if (customFontFamilies) {
|
|
42
|
-
fontFamilies = customFontFamilies;
|
|
43
|
-
}
|
|
44
|
-
const bodyFontFamilySetting = themeJson?.styles?.typography?.fontFamily;
|
|
45
|
-
const bodyFontFamily = getFontFamilyFromSetting(
|
|
46
|
-
fontFamilies,
|
|
47
|
-
bodyFontFamilySetting
|
|
48
|
-
);
|
|
49
|
-
const headingFontFamilySetting = themeJson?.styles?.elements?.heading?.typography?.fontFamily;
|
|
50
|
-
let headingFontFamily;
|
|
51
|
-
if (!headingFontFamilySetting) {
|
|
52
|
-
headingFontFamily = bodyFontFamily;
|
|
53
|
-
} else {
|
|
54
|
-
headingFontFamily = getFontFamilyFromSetting(
|
|
55
|
-
fontFamilies,
|
|
56
|
-
themeJson?.styles?.elements?.heading?.typography?.fontFamily
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
return [bodyFontFamily, headingFontFamily];
|
|
60
|
-
}
|
|
61
|
-
export {
|
|
62
|
-
getFontFamilies,
|
|
63
|
-
getNewIndexFromPresets,
|
|
64
|
-
getVariationClassName
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/global-styles/utils.js"],
|
|
4
|
-
"sourcesContent": ["/**\n *\n * @param {string} variation The variation name.\n *\n * @return {string} The variation class name.\n */\nexport function getVariationClassName( variation ) {\n\tif ( ! variation ) {\n\t\treturn '';\n\t}\n\treturn `is-style-${ variation }`;\n}\n\n/**\n * Iterates through the presets array and searches for slugs that start with the specified\n * slugPrefix followed by a numerical suffix. It identifies the highest numerical suffix found\n * and returns one greater than the highest found suffix, ensuring that the new index is unique.\n *\n * @param {Array} presets The array of preset objects, each potentially containing a slug property.\n * @param {string} slugPrefix The prefix to look for in the preset slugs.\n *\n * @return {number} The next available index for a preset with the specified slug prefix, or 1 if no matching slugs are found.\n */\nexport function getNewIndexFromPresets( presets, slugPrefix ) {\n\tconst nameRegex = new RegExp( `^${ slugPrefix }([\\\\d]+)$` );\n\tconst highestPresetValue = presets.reduce( ( currentHighest, preset ) => {\n\t\tif ( typeof preset?.slug === 'string' ) {\n\t\t\tconst matches = preset?.slug.match( nameRegex );\n\t\t\tif ( matches ) {\n\t\t\t\tconst id = parseInt( matches[ 1 ], 10 );\n\t\t\t\tif ( id > currentHighest ) {\n\t\t\t\t\treturn id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn currentHighest;\n\t}, 0 );\n\treturn highestPresetValue + 1;\n}\n\nfunction getFontFamilyFromSetting( fontFamilies, setting ) {\n\tif ( ! Array.isArray( fontFamilies ) || ! setting ) {\n\t\treturn null;\n\t}\n\n\tconst fontFamilyVariable = setting.replace( 'var(', '' ).replace( ')', '' );\n\tconst fontFamilySlug = fontFamilyVariable?.split( '--' ).slice( -1 )[ 0 ];\n\n\treturn fontFamilies.find(\n\t\t( fontFamily ) => fontFamily.slug === fontFamilySlug\n\t);\n}\n\nexport function getFontFamilies( themeJson ) {\n\tconst themeFontFamilies =\n\t\tthemeJson?.settings?.typography?.fontFamilies?.theme;\n\tconst customFontFamilies =\n\t\tthemeJson?.settings?.typography?.fontFamilies?.custom;\n\n\tlet fontFamilies = [];\n\tif ( themeFontFamilies && customFontFamilies ) {\n\t\tfontFamilies = [ ...themeFontFamilies, ...customFontFamilies ];\n\t} else if ( themeFontFamilies ) {\n\t\tfontFamilies = themeFontFamilies;\n\t} else if ( customFontFamilies ) {\n\t\tfontFamilies = customFontFamilies;\n\t}\n\tconst bodyFontFamilySetting = themeJson?.styles?.typography?.fontFamily;\n\tconst bodyFontFamily = getFontFamilyFromSetting(\n\t\tfontFamilies,\n\t\tbodyFontFamilySetting\n\t);\n\n\tconst headingFontFamilySetting =\n\t\tthemeJson?.styles?.elements?.heading?.typography?.fontFamily;\n\n\tlet headingFontFamily;\n\tif ( ! headingFontFamilySetting ) {\n\t\theadingFontFamily = bodyFontFamily;\n\t} else {\n\t\theadingFontFamily = getFontFamilyFromSetting(\n\t\t\tfontFamilies,\n\t\t\tthemeJson?.styles?.elements?.heading?.typography?.fontFamily\n\t\t);\n\t}\n\n\treturn [ bodyFontFamily, headingFontFamily ];\n}\n"],
|
|
5
|
-
"mappings": "AAMO,SAAS,sBAAuB,WAAY;AAClD,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AACA,SAAO,YAAa,SAAU;AAC/B;AAYO,SAAS,uBAAwB,SAAS,YAAa;AAC7D,QAAM,YAAY,IAAI,OAAQ,IAAK,UAAW,WAAY;AAC1D,QAAM,qBAAqB,QAAQ,OAAQ,CAAE,gBAAgB,WAAY;AACxE,QAAK,OAAO,QAAQ,SAAS,UAAW;AACvC,YAAM,UAAU,QAAQ,KAAK,MAAO,SAAU;AAC9C,UAAK,SAAU;AACd,cAAM,KAAK,SAAU,QAAS,CAAE,GAAG,EAAG;AACtC,YAAK,KAAK,gBAAiB;AAC1B,iBAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD;AACA,WAAO;AAAA,EACR,GAAG,CAAE;AACL,SAAO,qBAAqB;AAC7B;AAEA,SAAS,yBAA0B,cAAc,SAAU;AAC1D,MAAK,CAAE,MAAM,QAAS,YAAa,KAAK,CAAE,SAAU;AACnD,WAAO;AAAA,EACR;AAEA,QAAM,qBAAqB,QAAQ,QAAS,QAAQ,EAAG,EAAE,QAAS,KAAK,EAAG;AAC1E,QAAM,iBAAiB,oBAAoB,MAAO,IAAK,EAAE,MAAO,EAAG,EAAG,CAAE;AAExE,SAAO,aAAa;AAAA,IACnB,CAAE,eAAgB,WAAW,SAAS;AAAA,EACvC;AACD;AAEO,SAAS,gBAAiB,WAAY;AAC5C,QAAM,oBACL,WAAW,UAAU,YAAY,cAAc;AAChD,QAAM,qBACL,WAAW,UAAU,YAAY,cAAc;AAEhD,MAAI,eAAe,CAAC;AACpB,MAAK,qBAAqB,oBAAqB;AAC9C,mBAAe,CAAE,GAAG,mBAAmB,GAAG,kBAAmB;AAAA,EAC9D,WAAY,mBAAoB;AAC/B,mBAAe;AAAA,EAChB,WAAY,oBAAqB;AAChC,mBAAe;AAAA,EAChB;AACA,QAAM,wBAAwB,WAAW,QAAQ,YAAY;AAC7D,QAAM,iBAAiB;AAAA,IACtB;AAAA,IACA;AAAA,EACD;AAEA,QAAM,2BACL,WAAW,QAAQ,UAAU,SAAS,YAAY;AAEnD,MAAI;AACJ,MAAK,CAAE,0BAA2B;AACjC,wBAAoB;AAAA,EACrB,OAAO;AACN,wBAAoB;AAAA,MACnB;AAAA,MACA,WAAW,QAAQ,UAAU,SAAS,YAAY;AAAA,IACnD;AAAA,EACD;AAEA,SAAO,CAAE,gBAAgB,iBAAkB;AAC5C;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
import { Tooltip } from "@wordpress/components";
|
|
4
|
-
import { useMemo, useContext, useState } from "@wordpress/element";
|
|
5
|
-
import { ENTER } from "@wordpress/keycodes";
|
|
6
|
-
import { _x, sprintf } from "@wordpress/i18n";
|
|
7
|
-
import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
|
|
8
|
-
import { privateApis as editorPrivateApis } from "@wordpress/editor";
|
|
9
|
-
import { filterObjectByProperties } from "../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property";
|
|
10
|
-
import { unlock } from "../../../lock-unlock";
|
|
11
|
-
const { mergeBaseAndUserConfigs } = unlock(editorPrivateApis);
|
|
12
|
-
const { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(
|
|
13
|
-
blockEditorPrivateApis
|
|
14
|
-
);
|
|
15
|
-
function Variation({
|
|
16
|
-
variation,
|
|
17
|
-
children,
|
|
18
|
-
isPill,
|
|
19
|
-
properties,
|
|
20
|
-
showTooltip
|
|
21
|
-
}) {
|
|
22
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
23
|
-
const { base, user, setUserConfig } = useContext(GlobalStylesContext);
|
|
24
|
-
const context = useMemo(() => {
|
|
25
|
-
let merged = mergeBaseAndUserConfigs(base, variation);
|
|
26
|
-
if (properties) {
|
|
27
|
-
merged = filterObjectByProperties(merged, properties);
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
user: variation,
|
|
31
|
-
base,
|
|
32
|
-
merged,
|
|
33
|
-
setUserConfig: () => {
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}, [variation, base, properties]);
|
|
37
|
-
const selectVariation = () => setUserConfig(variation);
|
|
38
|
-
const selectOnEnter = (event) => {
|
|
39
|
-
if (event.keyCode === ENTER) {
|
|
40
|
-
event.preventDefault();
|
|
41
|
-
selectVariation();
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
const isActive = useMemo(
|
|
45
|
-
() => areGlobalStyleConfigsEqual(user, variation),
|
|
46
|
-
[user, variation]
|
|
47
|
-
);
|
|
48
|
-
let label = variation?.title;
|
|
49
|
-
if (variation?.description) {
|
|
50
|
-
label = sprintf(
|
|
51
|
-
/* translators: 1: variation title. 2: variation description. */
|
|
52
|
-
_x("%1$s (%2$s)", "variation label"),
|
|
53
|
-
variation?.title,
|
|
54
|
-
variation?.description
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
const content = /* @__PURE__ */ jsx(
|
|
58
|
-
"div",
|
|
59
|
-
{
|
|
60
|
-
className: clsx("edit-site-global-styles-variations_item", {
|
|
61
|
-
"is-active": isActive
|
|
62
|
-
}),
|
|
63
|
-
role: "button",
|
|
64
|
-
onClick: selectVariation,
|
|
65
|
-
onKeyDown: selectOnEnter,
|
|
66
|
-
tabIndex: "0",
|
|
67
|
-
"aria-label": label,
|
|
68
|
-
"aria-current": isActive,
|
|
69
|
-
onFocus: () => setIsFocused(true),
|
|
70
|
-
onBlur: () => setIsFocused(false),
|
|
71
|
-
children: /* @__PURE__ */ jsx(
|
|
72
|
-
"div",
|
|
73
|
-
{
|
|
74
|
-
className: clsx(
|
|
75
|
-
"edit-site-global-styles-variations_item-preview",
|
|
76
|
-
{ "is-pill": isPill }
|
|
77
|
-
),
|
|
78
|
-
children: children(isFocused)
|
|
79
|
-
}
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
return /* @__PURE__ */ jsx(GlobalStylesContext.Provider, { value: context, children: showTooltip ? /* @__PURE__ */ jsx(Tooltip, { text: variation?.title, children: content }) : content });
|
|
84
|
-
}
|
|
85
|
-
export {
|
|
86
|
-
Variation as default
|
|
87
|
-
};
|
|
88
|
-
//# sourceMappingURL=variation.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/components/global-styles/variations/variation.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Tooltip } from '@wordpress/components';\nimport { useMemo, useContext, useState } from '@wordpress/element';\nimport { ENTER } from '@wordpress/keycodes';\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { filterObjectByProperties } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\nimport { unlock } from '../../../lock-unlock';\n\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport default function Variation( {\n\tvariation,\n\tchildren,\n\tisPill,\n\tproperties,\n\tshowTooltip,\n} ) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst { base, user, setUserConfig } = useContext( GlobalStylesContext );\n\n\tconst context = useMemo( () => {\n\t\tlet merged = mergeBaseAndUserConfigs( base, variation );\n\t\tif ( properties ) {\n\t\t\tmerged = filterObjectByProperties( merged, properties );\n\t\t}\n\t\treturn {\n\t\t\tuser: variation,\n\t\t\tbase,\n\t\t\tmerged,\n\t\t\tsetUserConfig: () => {},\n\t\t};\n\t}, [ variation, base, properties ] );\n\n\tconst selectVariation = () => setUserConfig( variation );\n\n\tconst selectOnEnter = ( event ) => {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tselectVariation();\n\t\t}\n\t};\n\n\tconst isActive = useMemo(\n\t\t() => areGlobalStyleConfigsEqual( user, variation ),\n\t\t[ user, variation ]\n\t);\n\n\tlet label = variation?.title;\n\tif ( variation?.description ) {\n\t\tlabel = sprintf(\n\t\t\t/* translators: 1: variation title. 2: variation description. */\n\t\t\t_x( '%1$s (%2$s)', 'variation label' ),\n\t\t\tvariation?.title,\n\t\t\tvariation?.description\n\t\t);\n\t}\n\n\tconst content = (\n\t\t<div\n\t\t\tclassName={ clsx( 'edit-site-global-styles-variations_item', {\n\t\t\t\t'is-active': isActive,\n\t\t\t} ) }\n\t\t\trole=\"button\"\n\t\t\tonClick={ selectVariation }\n\t\t\tonKeyDown={ selectOnEnter }\n\t\t\ttabIndex=\"0\"\n\t\t\taria-label={ label }\n\t\t\taria-current={ isActive }\n\t\t\tonFocus={ () => setIsFocused( true ) }\n\t\t\tonBlur={ () => setIsFocused( false ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'edit-site-global-styles-variations_item-preview',\n\t\t\t\t\t{ 'is-pill': isPill }\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ children( isFocused ) }\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t{ showTooltip ? (\n\t\t\t\t<Tooltip text={ variation?.title }>{ content }</Tooltip>\n\t\t\t) : (\n\t\t\t\tcontent\n\t\t\t) }\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "AAuFG;AApFH,OAAO,UAAU;AAKjB,SAAS,eAAe;AACxB,SAAS,SAAS,YAAY,gBAAgB;AAC9C,SAAS,aAAa;AACtB,SAAS,IAAI,eAAe;AAC5B,SAAS,eAAe,8BAA8B;AACtD,SAAS,eAAe,yBAAyB;AAKjD,SAAS,gCAAgC;AACzC,SAAS,cAAc;AAEvB,MAAM,EAAE,wBAAwB,IAAI,OAAQ,iBAAkB;AAC9D,MAAM,EAAE,qBAAqB,2BAA2B,IAAI;AAAA,EAC3D;AACD;AAEe,SAAR,UAA4B;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,CAAE,WAAW,YAAa,IAAI,SAAU,KAAM;AACpD,QAAM,EAAE,MAAM,MAAM,cAAc,IAAI,WAAY,mBAAoB;AAEtE,QAAM,UAAU,QAAS,MAAM;AAC9B,QAAI,SAAS,wBAAyB,MAAM,SAAU;AACtD,QAAK,YAAa;AACjB,eAAS,yBAA0B,QAAQ,UAAW;AAAA,IACvD;AACA,WAAO;AAAA,MACN,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA,eAAe,MAAM;AAAA,MAAC;AAAA,IACvB;AAAA,EACD,GAAG,CAAE,WAAW,MAAM,UAAW,CAAE;AAEnC,QAAM,kBAAkB,MAAM,cAAe,SAAU;AAEvD,QAAM,gBAAgB,CAAE,UAAW;AAClC,QAAK,MAAM,YAAY,OAAQ;AAC9B,YAAM,eAAe;AACrB,sBAAgB;AAAA,IACjB;AAAA,EACD;AAEA,QAAM,WAAW;AAAA,IAChB,MAAM,2BAA4B,MAAM,SAAU;AAAA,IAClD,CAAE,MAAM,SAAU;AAAA,EACnB;AAEA,MAAI,QAAQ,WAAW;AACvB,MAAK,WAAW,aAAc;AAC7B,YAAQ;AAAA;AAAA,MAEP,GAAI,eAAe,iBAAkB;AAAA,MACrC,WAAW;AAAA,MACX,WAAW;AAAA,IACZ;AAAA,EACD;AAEA,QAAM,UACL;AAAA,IAAC;AAAA;AAAA,MACA,WAAY,KAAM,2CAA2C;AAAA,QAC5D,aAAa;AAAA,MACd,CAAE;AAAA,MACF,MAAK;AAAA,MACL,SAAU;AAAA,MACV,WAAY;AAAA,MACZ,UAAS;AAAA,MACT,cAAa;AAAA,MACb,gBAAe;AAAA,MACf,SAAU,MAAM,aAAc,IAAK;AAAA,MACnC,QAAS,MAAM,aAAc,KAAM;AAAA,MAEnC;AAAA,QAAC;AAAA;AAAA,UACA,WAAY;AAAA,YACX;AAAA,YACA,EAAE,WAAW,OAAO;AAAA,UACrB;AAAA,UAEE,mBAAU,SAAU;AAAA;AAAA,MACvB;AAAA;AAAA,EACD;AAGD,SACC,oBAAC,oBAAoB,UAApB,EAA6B,OAAQ,SACnC,wBACD,oBAAC,WAAQ,MAAO,WAAW,OAAU,mBAAS,IAE9C,SAEF;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
__experimentalGrid as Grid,
|
|
4
|
-
__experimentalVStack as VStack
|
|
5
|
-
} from "@wordpress/components";
|
|
6
|
-
import StylesPreviewColors from "../preview-colors";
|
|
7
|
-
import { useCurrentMergeThemeStyleVariationsWithUserConfig } from "../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property";
|
|
8
|
-
import Subtitle from "../subtitle";
|
|
9
|
-
import Variation from "./variation";
|
|
10
|
-
function ColorVariations({ title, gap = 2 }) {
|
|
11
|
-
const propertiesToFilter = ["color"];
|
|
12
|
-
const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig(propertiesToFilter);
|
|
13
|
-
if (colorVariations?.length <= 1) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
return /* @__PURE__ */ jsxs(VStack, { spacing: 3, children: [
|
|
17
|
-
title && /* @__PURE__ */ jsx(Subtitle, { level: 3, children: title }),
|
|
18
|
-
/* @__PURE__ */ jsx(Grid, { spacing: gap, children: colorVariations.map((variation, index) => /* @__PURE__ */ jsx(
|
|
19
|
-
Variation,
|
|
20
|
-
{
|
|
21
|
-
variation,
|
|
22
|
-
isPill: true,
|
|
23
|
-
properties: propertiesToFilter,
|
|
24
|
-
showTooltip: true,
|
|
25
|
-
children: () => /* @__PURE__ */ jsx(StylesPreviewColors, {})
|
|
26
|
-
},
|
|
27
|
-
index
|
|
28
|
-
)) })
|
|
29
|
-
] });
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
ColorVariations as default
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=variations-color.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/components/global-styles/variations/variations-color.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalGrid as Grid,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport StylesPreviewColors from '../preview-colors';\nimport { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\nimport Subtitle from '../subtitle';\nimport Variation from './variation';\n\nexport default function ColorVariations( { title, gap = 2 } ) {\n\tconst propertiesToFilter = [ 'color' ];\n\tconst colorVariations =\n\t\tuseCurrentMergeThemeStyleVariationsWithUserConfig( propertiesToFilter );\n\n\t// Return null if there is only one variation (the default).\n\tif ( colorVariations?.length <= 1 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t{ title && <Subtitle level={ 3 }>{ title }</Subtitle> }\n\t\t\t<Grid spacing={ gap }>\n\t\t\t\t{ colorVariations.map( ( variation, index ) => (\n\t\t\t\t\t<Variation\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\tisPill\n\t\t\t\t\t\tproperties={ propertiesToFilter }\n\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t>\n\t\t\t\t\t\t{ () => <StylesPreviewColors /> }\n\t\t\t\t\t</Variation>\n\t\t\t\t) ) }\n\t\t\t</Grid>\n\t\t</VStack>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "AA2BE,SACY,KADZ;AAxBF;AAAA,EACC,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,OAClB;AAKP,OAAO,yBAAyB;AAChC,SAAS,yDAAyD;AAClE,OAAO,cAAc;AACrB,OAAO,eAAe;AAEP,SAAR,gBAAkC,EAAE,OAAO,MAAM,EAAE,GAAI;AAC7D,QAAM,qBAAqB,CAAE,OAAQ;AACrC,QAAM,kBACL,kDAAmD,kBAAmB;AAGvE,MAAK,iBAAiB,UAAU,GAAI;AACnC,WAAO;AAAA,EACR;AAEA,SACC,qBAAC,UAAO,SAAU,GACf;AAAA,aAAS,oBAAC,YAAS,OAAQ,GAAM,iBAAO;AAAA,IAC1C,oBAAC,QAAK,SAAU,KACb,0BAAgB,IAAK,CAAE,WAAW,UACnC;AAAA,MAAC;AAAA;AAAA,QAEA;AAAA,QACA,QAAM;AAAA,QACN,YAAa;AAAA,QACb,aAAW;AAAA,QAET,gBAAM,oBAAC,uBAAoB;AAAA;AAAA,MANvB;AAAA,IAOP,CACC,GACH;AAAA,KACD;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { store as blocksStore } from "@wordpress/blocks";
|
|
3
|
-
import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
|
|
4
|
-
import { useSelect } from "@wordpress/data";
|
|
5
|
-
import { __experimentalItemGroup as ItemGroup } from "@wordpress/components";
|
|
6
|
-
import { NavigationButtonAsItem } from "../navigation-button";
|
|
7
|
-
import { unlock } from "../../../lock-unlock";
|
|
8
|
-
const { useGlobalStyle } = unlock(blockEditorPrivateApis);
|
|
9
|
-
function getFilteredBlockStyles(blockStyles, variations) {
|
|
10
|
-
return blockStyles?.filter(
|
|
11
|
-
(style) => style.source === "block" || variations.includes(style.name)
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
function useBlockVariations(name) {
|
|
15
|
-
const blockStyles = useSelect(
|
|
16
|
-
(select) => {
|
|
17
|
-
const { getBlockStyles } = select(blocksStore);
|
|
18
|
-
return getBlockStyles(name);
|
|
19
|
-
},
|
|
20
|
-
[name]
|
|
21
|
-
);
|
|
22
|
-
const [variations] = useGlobalStyle("variations", name);
|
|
23
|
-
const variationNames = Object.keys(variations ?? {});
|
|
24
|
-
return getFilteredBlockStyles(blockStyles, variationNames);
|
|
25
|
-
}
|
|
26
|
-
function VariationsPanel({ name }) {
|
|
27
|
-
const coreBlockStyles = useBlockVariations(name);
|
|
28
|
-
return /* @__PURE__ */ jsx(ItemGroup, { isBordered: true, isSeparated: true, children: coreBlockStyles.map((style, index) => {
|
|
29
|
-
if (style?.isDefault) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
return /* @__PURE__ */ jsx(
|
|
33
|
-
NavigationButtonAsItem,
|
|
34
|
-
{
|
|
35
|
-
path: "/blocks/" + encodeURIComponent(name) + "/variations/" + encodeURIComponent(style.name),
|
|
36
|
-
children: style.label
|
|
37
|
-
},
|
|
38
|
-
index
|
|
39
|
-
);
|
|
40
|
-
}) });
|
|
41
|
-
}
|
|
42
|
-
export {
|
|
43
|
-
VariationsPanel,
|
|
44
|
-
useBlockVariations
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=variations-panel.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/components/global-styles/variations/variations-panel.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButtonAsItem } from '../navigation-button';\nimport { unlock } from '../../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\n// Only core block styles (source === block) or block styles with a matching\n// theme.json style variation will be configurable via Global Styles.\nfunction getFilteredBlockStyles( blockStyles, variations ) {\n\treturn blockStyles?.filter(\n\t\t( style ) =>\n\t\t\tstyle.source === 'block' || variations.includes( style.name )\n\t);\n}\n\nexport function useBlockVariations( name ) {\n\tconst blockStyles = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\tconst [ variations ] = useGlobalStyle( 'variations', name );\n\tconst variationNames = Object.keys( variations ?? {} );\n\n\treturn getFilteredBlockStyles( blockStyles, variationNames );\n}\n\nexport function VariationsPanel( { name } ) {\n\tconst coreBlockStyles = useBlockVariations( name );\n\n\treturn (\n\t\t<ItemGroup isBordered isSeparated>\n\t\t\t{ coreBlockStyles.map( ( style, index ) => {\n\t\t\t\tif ( style?.isDefault ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tpath={\n\t\t\t\t\t\t\t'/blocks/' +\n\t\t\t\t\t\t\tencodeURIComponent( name ) +\n\t\t\t\t\t\t\t'/variations/' +\n\t\t\t\t\t\t\tencodeURIComponent( style.name )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ style.label }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ItemGroup>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "AAiDK;AA9CL,SAAS,SAAS,mBAAmB;AACrC,SAAS,eAAe,8BAA8B;AACtD,SAAS,iBAAiB;AAC1B,SAAS,2BAA2B,iBAAiB;AAKrD,SAAS,8BAA8B;AACvC,SAAS,cAAc;AAEvB,MAAM,EAAE,eAAe,IAAI,OAAQ,sBAAuB;AAI1D,SAAS,uBAAwB,aAAa,YAAa;AAC1D,SAAO,aAAa;AAAA,IACnB,CAAE,UACD,MAAM,WAAW,WAAW,WAAW,SAAU,MAAM,IAAK;AAAA,EAC9D;AACD;AAEO,SAAS,mBAAoB,MAAO;AAC1C,QAAM,cAAc;AAAA,IACnB,CAAE,WAAY;AACb,YAAM,EAAE,eAAe,IAAI,OAAQ,WAAY;AAC/C,aAAO,eAAgB,IAAK;AAAA,IAC7B;AAAA,IACA,CAAE,IAAK;AAAA,EACR;AACA,QAAM,CAAE,UAAW,IAAI,eAAgB,cAAc,IAAK;AAC1D,QAAM,iBAAiB,OAAO,KAAM,cAAc,CAAC,CAAE;AAErD,SAAO,uBAAwB,aAAa,cAAe;AAC5D;AAEO,SAAS,gBAAiB,EAAE,KAAK,GAAI;AAC3C,QAAM,kBAAkB,mBAAoB,IAAK;AAEjD,SACC,oBAAC,aAAU,YAAU,MAAC,aAAW,MAC9B,0BAAgB,IAAK,CAAE,OAAO,UAAW;AAC1C,QAAK,OAAO,WAAY;AACvB,aAAO;AAAA,IACR;AACA,WACC;AAAA,MAAC;AAAA;AAAA,QAEA,MACC,aACA,mBAAoB,IAAK,IACzB,iBACA,mBAAoB,MAAM,IAAK;AAAA,QAG9B,gBAAM;AAAA;AAAA,MARF;AAAA,IASP;AAAA,EAEF,CAAE,GACH;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
__experimentalGrid as Grid,
|
|
4
|
-
__experimentalVStack as VStack
|
|
5
|
-
} from "@wordpress/components";
|
|
6
|
-
import StylesPreviewTypography from "../preview-typography";
|
|
7
|
-
import { useCurrentMergeThemeStyleVariationsWithUserConfig } from "../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property";
|
|
8
|
-
import Subtitle from "../subtitle";
|
|
9
|
-
import Variation from "./variation";
|
|
10
|
-
function TypographyVariations({ title, gap = 2 }) {
|
|
11
|
-
const propertiesToFilter = ["typography"];
|
|
12
|
-
const typographyVariations = useCurrentMergeThemeStyleVariationsWithUserConfig(propertiesToFilter);
|
|
13
|
-
if (typographyVariations?.length <= 1) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
return /* @__PURE__ */ jsxs(VStack, { spacing: 3, children: [
|
|
17
|
-
title && /* @__PURE__ */ jsx(Subtitle, { level: 3, children: title }),
|
|
18
|
-
/* @__PURE__ */ jsx(
|
|
19
|
-
Grid,
|
|
20
|
-
{
|
|
21
|
-
columns: 3,
|
|
22
|
-
gap,
|
|
23
|
-
className: "edit-site-global-styles-style-variations-container",
|
|
24
|
-
children: typographyVariations.map((variation, index) => {
|
|
25
|
-
return /* @__PURE__ */ jsx(
|
|
26
|
-
Variation,
|
|
27
|
-
{
|
|
28
|
-
variation,
|
|
29
|
-
properties: propertiesToFilter,
|
|
30
|
-
showTooltip: true,
|
|
31
|
-
children: () => /* @__PURE__ */ jsx(
|
|
32
|
-
StylesPreviewTypography,
|
|
33
|
-
{
|
|
34
|
-
variation
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
},
|
|
38
|
-
index
|
|
39
|
-
);
|
|
40
|
-
})
|
|
41
|
-
}
|
|
42
|
-
)
|
|
43
|
-
] });
|
|
44
|
-
}
|
|
45
|
-
export {
|
|
46
|
-
TypographyVariations as default
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=variations-typography.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/components/global-styles/variations/variations-typography.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalGrid as Grid,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport StylesPreviewTypography from '../preview-typography';\nimport { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\nimport Subtitle from '../subtitle';\nimport Variation from './variation';\n\nexport default function TypographyVariations( { title, gap = 2 } ) {\n\tconst propertiesToFilter = [ 'typography' ];\n\tconst typographyVariations =\n\t\tuseCurrentMergeThemeStyleVariationsWithUserConfig( propertiesToFilter );\n\n\t// Return null if there is only one variation (the default).\n\tif ( typographyVariations?.length <= 1 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t{ title && <Subtitle level={ 3 }>{ title }</Subtitle> }\n\t\t\t<Grid\n\t\t\t\tcolumns={ 3 }\n\t\t\t\tgap={ gap }\n\t\t\t\tclassName=\"edit-site-global-styles-style-variations-container\"\n\t\t\t>\n\t\t\t\t{ typographyVariations.map( ( variation, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Variation\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\t\tproperties={ propertiesToFilter }\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ () => (\n\t\t\t\t\t\t\t\t<StylesPreviewTypography\n\t\t\t\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Variation>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</Grid>\n\t\t</VStack>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "AA2BE,SACY,KADZ;AAxBF;AAAA,EACC,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,OAClB;AAKP,OAAO,6BAA6B;AACpC,SAAS,yDAAyD;AAClE,OAAO,cAAc;AACrB,OAAO,eAAe;AAEP,SAAR,qBAAuC,EAAE,OAAO,MAAM,EAAE,GAAI;AAClE,QAAM,qBAAqB,CAAE,YAAa;AAC1C,QAAM,uBACL,kDAAmD,kBAAmB;AAGvE,MAAK,sBAAsB,UAAU,GAAI;AACxC,WAAO;AAAA,EACR;AAEA,SACC,qBAAC,UAAO,SAAU,GACf;AAAA,aAAS,oBAAC,YAAS,OAAQ,GAAM,iBAAO;AAAA,IAC1C;AAAA,MAAC;AAAA;AAAA,QACA,SAAU;AAAA,QACV;AAAA,QACA,WAAU;AAAA,QAER,+BAAqB,IAAK,CAAE,WAAW,UAAW;AACnD,iBACC;AAAA,YAAC;AAAA;AAAA,cAEA;AAAA,cACA,YAAa;AAAA,cACb,aAAW;AAAA,cAET,gBACD;AAAA,gBAAC;AAAA;AAAA,kBACA;AAAA;AAAA,cACD;AAAA;AAAA,YARK;AAAA,UAUP;AAAA,QAEF,CAAE;AAAA;AAAA,IACH;AAAA,KACD;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "@wordpress/element";
|
|
2
|
-
import { useSelect, useDispatch } from "@wordpress/data";
|
|
3
|
-
import { store as editSiteStore } from "../../store";
|
|
4
|
-
import { useGlobalStylesOutput } from "../../hooks/use-global-styles-output";
|
|
5
|
-
function useGlobalStylesRenderer(disableRootPadding) {
|
|
6
|
-
const [styles, settings] = useGlobalStylesOutput(disableRootPadding);
|
|
7
|
-
const { getSettings } = useSelect(editSiteStore);
|
|
8
|
-
const { updateSettings } = useDispatch(editSiteStore);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
if (!styles || !settings) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
const currentStoreSettings = getSettings();
|
|
14
|
-
const nonGlobalStyles = Object.values(
|
|
15
|
-
currentStoreSettings.styles ?? []
|
|
16
|
-
).filter((style) => !style.isGlobalStyles);
|
|
17
|
-
updateSettings({
|
|
18
|
-
...currentStoreSettings,
|
|
19
|
-
styles: [...nonGlobalStyles, ...styles],
|
|
20
|
-
__experimentalFeatures: settings
|
|
21
|
-
});
|
|
22
|
-
}, [styles, settings, updateSettings, getSettings]);
|
|
23
|
-
}
|
|
24
|
-
function GlobalStylesRenderer({ disableRootPadding }) {
|
|
25
|
-
useGlobalStylesRenderer(disableRootPadding);
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
GlobalStylesRenderer
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/global-styles-renderer/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { useGlobalStylesOutput } from '../../hooks/use-global-styles-output';\n\nfunction useGlobalStylesRenderer( disableRootPadding ) {\n\tconst [ styles, settings ] = useGlobalStylesOutput( disableRootPadding );\n\tconst { getSettings } = useSelect( editSiteStore );\n\tconst { updateSettings } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( ! styles || ! settings ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentStoreSettings = getSettings();\n\t\tconst nonGlobalStyles = Object.values(\n\t\t\tcurrentStoreSettings.styles ?? []\n\t\t).filter( ( style ) => ! style.isGlobalStyles );\n\t\tupdateSettings( {\n\t\t\t...currentStoreSettings,\n\t\t\tstyles: [ ...nonGlobalStyles, ...styles ],\n\t\t\t__experimentalFeatures: settings,\n\t\t} );\n\t}, [ styles, settings, updateSettings, getSettings ] );\n}\n\nexport function GlobalStylesRenderer( { disableRootPadding } ) {\n\tuseGlobalStylesRenderer( disableRootPadding );\n\n\treturn null;\n}\n"],
|
|
5
|
-
"mappings": "AAGA,SAAS,iBAAiB;AAC1B,SAAS,WAAW,mBAAmB;AAKvC,SAAS,SAAS,qBAAqB;AACvC,SAAS,6BAA6B;AAEtC,SAAS,wBAAyB,oBAAqB;AACtD,QAAM,CAAE,QAAQ,QAAS,IAAI,sBAAuB,kBAAmB;AACvE,QAAM,EAAE,YAAY,IAAI,UAAW,aAAc;AACjD,QAAM,EAAE,eAAe,IAAI,YAAa,aAAc;AAEtD,YAAW,MAAM;AAChB,QAAK,CAAE,UAAU,CAAE,UAAW;AAC7B;AAAA,IACD;AAEA,UAAM,uBAAuB,YAAY;AACzC,UAAM,kBAAkB,OAAO;AAAA,MAC9B,qBAAqB,UAAU,CAAC;AAAA,IACjC,EAAE,OAAQ,CAAE,UAAW,CAAE,MAAM,cAAe;AAC9C,mBAAgB;AAAA,MACf,GAAG;AAAA,MACH,QAAQ,CAAE,GAAG,iBAAiB,GAAG,MAAO;AAAA,MACxC,wBAAwB;AAAA,IACzB,CAAE;AAAA,EACH,GAAG,CAAE,QAAQ,UAAU,gBAAgB,WAAY,CAAE;AACtD;AAEO,SAAS,qBAAsB,EAAE,mBAAmB,GAAI;AAC9D,0BAAyB,kBAAmB;AAE5C,SAAO;AACR;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { privateApis as editorPrivateApis } from "@wordpress/editor";
|
|
3
|
-
import { unlock } from "../../lock-unlock";
|
|
4
|
-
const { ComplementaryArea, ComplementaryAreaMoreMenuItem } = unlock(editorPrivateApis);
|
|
5
|
-
function DefaultSidebar({
|
|
6
|
-
className,
|
|
7
|
-
identifier,
|
|
8
|
-
title,
|
|
9
|
-
icon,
|
|
10
|
-
children,
|
|
11
|
-
closeLabel,
|
|
12
|
-
header,
|
|
13
|
-
headerClassName,
|
|
14
|
-
panelClassName,
|
|
15
|
-
isActiveByDefault
|
|
16
|
-
}) {
|
|
17
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18
|
-
/* @__PURE__ */ jsx(
|
|
19
|
-
ComplementaryArea,
|
|
20
|
-
{
|
|
21
|
-
className,
|
|
22
|
-
scope: "core",
|
|
23
|
-
identifier,
|
|
24
|
-
title,
|
|
25
|
-
icon,
|
|
26
|
-
closeLabel,
|
|
27
|
-
header,
|
|
28
|
-
headerClassName,
|
|
29
|
-
panelClassName,
|
|
30
|
-
isActiveByDefault,
|
|
31
|
-
children
|
|
32
|
-
}
|
|
33
|
-
),
|
|
34
|
-
/* @__PURE__ */ jsx(
|
|
35
|
-
ComplementaryAreaMoreMenuItem,
|
|
36
|
-
{
|
|
37
|
-
scope: "core",
|
|
38
|
-
identifier,
|
|
39
|
-
icon,
|
|
40
|
-
children: title
|
|
41
|
-
}
|
|
42
|
-
)
|
|
43
|
-
] });
|
|
44
|
-
}
|
|
45
|
-
export {
|
|
46
|
-
DefaultSidebar as default
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=default-sidebar.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/global-styles-sidebar/default-sidebar.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { ComplementaryArea, ComplementaryAreaMoreMenuItem } =\n\tunlock( editorPrivateApis );\n\nexport default function DefaultSidebar( {\n\tclassName,\n\tidentifier,\n\ttitle,\n\ticon,\n\tchildren,\n\tcloseLabel,\n\theader,\n\theaderClassName,\n\tpanelClassName,\n\tisActiveByDefault,\n} ) {\n\treturn (\n\t\t<>\n\t\t\t<ComplementaryArea\n\t\t\t\tclassName={ className }\n\t\t\t\tscope=\"core\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ttitle={ title }\n\t\t\t\ticon={ icon }\n\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\theader={ header }\n\t\t\t\theaderClassName={ headerClassName }\n\t\t\t\tpanelClassName={ panelClassName }\n\t\t\t\tisActiveByDefault={ isActiveByDefault }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</ComplementaryArea>\n\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ticon={ icon }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
-
"mappings": "AA0BE,mBACC,KADD;AAvBF,SAAS,eAAe,yBAAyB;AAKjD,SAAS,cAAc;AAEvB,MAAM,EAAE,mBAAmB,8BAA8B,IACxD,OAAQ,iBAAkB;AAEZ,SAAR,eAAiC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,SACC,iCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA,OAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QAEE;AAAA;AAAA,IACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,OAAM;AAAA,QACN;AAAA,QACA;AAAA,QAEE;AAAA;AAAA,IACH;AAAA,KACD;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { FlexItem, Flex, Button } from "@wordpress/components";
|
|
3
|
-
import { __ } from "@wordpress/i18n";
|
|
4
|
-
import { styles, seen, backup } from "@wordpress/icons";
|
|
5
|
-
import { useSelect, useDispatch } from "@wordpress/data";
|
|
6
|
-
import { useEffect, useRef } from "@wordpress/element";
|
|
7
|
-
import { store as preferencesStore } from "@wordpress/preferences";
|
|
8
|
-
import {
|
|
9
|
-
store as editorStore,
|
|
10
|
-
privateApis as editorPrivateApis
|
|
11
|
-
} from "@wordpress/editor";
|
|
12
|
-
import { useViewportMatch } from "@wordpress/compose";
|
|
13
|
-
import { privateApis as routerPrivateApis } from "@wordpress/router";
|
|
14
|
-
import { GlobalStylesUI } from "../global-styles";
|
|
15
|
-
import { store as editSiteStore } from "../../store";
|
|
16
|
-
import { GlobalStylesMenuSlot } from "../global-styles/ui";
|
|
17
|
-
import { unlock } from "../../lock-unlock";
|
|
18
|
-
import { store as coreStore } from "@wordpress/core-data";
|
|
19
|
-
import DefaultSidebar from "./default-sidebar";
|
|
20
|
-
const { interfaceStore } = unlock(editorPrivateApis);
|
|
21
|
-
const { useLocation } = unlock(routerPrivateApis);
|
|
22
|
-
function GlobalStylesSidebar() {
|
|
23
|
-
const { query } = useLocation();
|
|
24
|
-
const { canvas = "view", name } = query;
|
|
25
|
-
const {
|
|
26
|
-
shouldClearCanvasContainerView,
|
|
27
|
-
isStyleBookOpened,
|
|
28
|
-
showListViewByDefault,
|
|
29
|
-
hasRevisions,
|
|
30
|
-
isRevisionsOpened,
|
|
31
|
-
isRevisionsStyleBookOpened
|
|
32
|
-
} = useSelect(
|
|
33
|
-
(select) => {
|
|
34
|
-
const { getActiveComplementaryArea: getActiveComplementaryArea2 } = select(interfaceStore);
|
|
35
|
-
const { getEditorCanvasContainerView } = unlock(
|
|
36
|
-
select(editSiteStore)
|
|
37
|
-
);
|
|
38
|
-
const canvasContainerView = getEditorCanvasContainerView();
|
|
39
|
-
const _isVisualEditorMode = "visual" === select(editorStore).getEditorMode();
|
|
40
|
-
const _isEditCanvasMode = "edit" === canvas;
|
|
41
|
-
const _showListViewByDefault = select(preferencesStore).get(
|
|
42
|
-
"core",
|
|
43
|
-
"showListViewByDefault"
|
|
44
|
-
);
|
|
45
|
-
const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } = select(coreStore);
|
|
46
|
-
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
47
|
-
const globalStyles = globalStylesId ? getEntityRecord("root", "globalStyles", globalStylesId) : void 0;
|
|
48
|
-
return {
|
|
49
|
-
isStyleBookOpened: "style-book" === canvasContainerView,
|
|
50
|
-
shouldClearCanvasContainerView: "edit-site/global-styles" !== getActiveComplementaryArea2("core") || !_isVisualEditorMode || !_isEditCanvasMode,
|
|
51
|
-
showListViewByDefault: _showListViewByDefault,
|
|
52
|
-
hasRevisions: !!globalStyles?._links?.["version-history"]?.[0]?.count,
|
|
53
|
-
isRevisionsStyleBookOpened: "global-styles-revisions:style-book" === canvasContainerView,
|
|
54
|
-
isRevisionsOpened: "global-styles-revisions" === canvasContainerView
|
|
55
|
-
};
|
|
56
|
-
},
|
|
57
|
-
[canvas]
|
|
58
|
-
);
|
|
59
|
-
const { setEditorCanvasContainerView } = unlock(
|
|
60
|
-
useDispatch(editSiteStore)
|
|
61
|
-
);
|
|
62
|
-
const isMobileViewport = useViewportMatch("medium", "<");
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
if (shouldClearCanvasContainerView) {
|
|
65
|
-
setEditorCanvasContainerView(void 0);
|
|
66
|
-
}
|
|
67
|
-
}, [shouldClearCanvasContainerView, setEditorCanvasContainerView]);
|
|
68
|
-
const { setIsListViewOpened } = useDispatch(editorStore);
|
|
69
|
-
const toggleRevisions = () => {
|
|
70
|
-
setIsListViewOpened(false);
|
|
71
|
-
if (isRevisionsStyleBookOpened) {
|
|
72
|
-
setEditorCanvasContainerView("style-book");
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (isRevisionsOpened) {
|
|
76
|
-
setEditorCanvasContainerView(void 0);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (isStyleBookOpened) {
|
|
80
|
-
setEditorCanvasContainerView(
|
|
81
|
-
"global-styles-revisions:style-book"
|
|
82
|
-
);
|
|
83
|
-
} else {
|
|
84
|
-
setEditorCanvasContainerView("global-styles-revisions");
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
const toggleStyleBook = () => {
|
|
88
|
-
if (isRevisionsOpened) {
|
|
89
|
-
setEditorCanvasContainerView(
|
|
90
|
-
"global-styles-revisions:style-book"
|
|
91
|
-
);
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
if (isRevisionsStyleBookOpened) {
|
|
95
|
-
setEditorCanvasContainerView("global-styles-revisions");
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
setIsListViewOpened(isStyleBookOpened && showListViewByDefault);
|
|
99
|
-
setEditorCanvasContainerView(
|
|
100
|
-
isStyleBookOpened ? void 0 : "style-book"
|
|
101
|
-
);
|
|
102
|
-
};
|
|
103
|
-
const { getActiveComplementaryArea } = useSelect(interfaceStore);
|
|
104
|
-
const { enableComplementaryArea } = useDispatch(interfaceStore);
|
|
105
|
-
const previousActiveAreaRef = useRef(null);
|
|
106
|
-
useEffect(() => {
|
|
107
|
-
if (name === "styles" && canvas === "edit") {
|
|
108
|
-
previousActiveAreaRef.current = getActiveComplementaryArea("core");
|
|
109
|
-
enableComplementaryArea("core", "edit-site/global-styles");
|
|
110
|
-
} else if (previousActiveAreaRef.current) {
|
|
111
|
-
enableComplementaryArea("core", previousActiveAreaRef.current);
|
|
112
|
-
}
|
|
113
|
-
}, [name, enableComplementaryArea, canvas, getActiveComplementaryArea]);
|
|
114
|
-
return /* @__PURE__ */ jsx(
|
|
115
|
-
DefaultSidebar,
|
|
116
|
-
{
|
|
117
|
-
className: "edit-site-global-styles-sidebar",
|
|
118
|
-
identifier: "edit-site/global-styles",
|
|
119
|
-
title: __("Styles"),
|
|
120
|
-
icon: styles,
|
|
121
|
-
closeLabel: __("Close Styles"),
|
|
122
|
-
panelClassName: "edit-site-global-styles-sidebar__panel",
|
|
123
|
-
header: /* @__PURE__ */ jsxs(
|
|
124
|
-
Flex,
|
|
125
|
-
{
|
|
126
|
-
className: "edit-site-global-styles-sidebar__header",
|
|
127
|
-
gap: 1,
|
|
128
|
-
children: [
|
|
129
|
-
/* @__PURE__ */ jsx(FlexItem, { children: /* @__PURE__ */ jsx("h2", { className: "edit-site-global-styles-sidebar__header-title", children: __("Styles") }) }),
|
|
130
|
-
/* @__PURE__ */ jsxs(
|
|
131
|
-
Flex,
|
|
132
|
-
{
|
|
133
|
-
justify: "flex-end",
|
|
134
|
-
gap: 1,
|
|
135
|
-
className: "edit-site-global-styles-sidebar__header-actions",
|
|
136
|
-
children: [
|
|
137
|
-
!isMobileViewport && /* @__PURE__ */ jsx(FlexItem, { children: /* @__PURE__ */ jsx(
|
|
138
|
-
Button,
|
|
139
|
-
{
|
|
140
|
-
icon: seen,
|
|
141
|
-
label: __("Style Book"),
|
|
142
|
-
isPressed: isStyleBookOpened || isRevisionsStyleBookOpened,
|
|
143
|
-
accessibleWhenDisabled: true,
|
|
144
|
-
disabled: shouldClearCanvasContainerView,
|
|
145
|
-
onClick: toggleStyleBook,
|
|
146
|
-
size: "compact"
|
|
147
|
-
}
|
|
148
|
-
) }),
|
|
149
|
-
/* @__PURE__ */ jsx(FlexItem, { children: /* @__PURE__ */ jsx(
|
|
150
|
-
Button,
|
|
151
|
-
{
|
|
152
|
-
label: __("Revisions"),
|
|
153
|
-
icon: backup,
|
|
154
|
-
onClick: toggleRevisions,
|
|
155
|
-
accessibleWhenDisabled: true,
|
|
156
|
-
disabled: !hasRevisions,
|
|
157
|
-
isPressed: isRevisionsOpened || isRevisionsStyleBookOpened,
|
|
158
|
-
size: "compact"
|
|
159
|
-
}
|
|
160
|
-
) }),
|
|
161
|
-
/* @__PURE__ */ jsx(GlobalStylesMenuSlot, {})
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
)
|
|
165
|
-
]
|
|
166
|
-
}
|
|
167
|
-
),
|
|
168
|
-
children: /* @__PURE__ */ jsx(GlobalStylesUI, {})
|
|
169
|
-
}
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
export {
|
|
173
|
-
GlobalStylesSidebar as default
|
|
174
|
-
};
|
|
175
|
-
//# sourceMappingURL=index.js.map
|