@wordpress/global-styles-ui 1.1.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/LICENSE.md +788 -0
- package/README.md +48 -0
- package/build/background-panel.js +62 -0
- package/build/background-panel.js.map +7 -0
- package/build/block-preview-panel.js +90 -0
- package/build/block-preview-panel.js.map +7 -0
- package/build/color-indicator-wrapper.js +55 -0
- package/build/color-indicator-wrapper.js.map +7 -0
- package/build/color-palette-panel.js +123 -0
- package/build/color-palette-panel.js.map +7 -0
- package/build/color-preview.js +94 -0
- package/build/color-preview.js.map +7 -0
- package/build/color-variations.js +41 -0
- package/build/color-variations.js.map +7 -0
- package/build/confirm-reset-shadow-dialog.js +55 -0
- package/build/confirm-reset-shadow-dialog.js.map +7 -0
- package/build/context.js +37 -0
- package/build/context.js.map +7 -0
- package/build/dimensions-panel.js +89 -0
- package/build/dimensions-panel.js.map +7 -0
- package/build/font-families.js +114 -0
- package/build/font-families.js.map +7 -0
- package/build/font-family-item.js +48 -0
- package/build/font-family-item.js.map +7 -0
- package/build/font-library-modal/collection-font-variant.js +75 -0
- package/build/font-library-modal/collection-font-variant.js.map +7 -0
- package/build/font-library-modal/context.js +386 -0
- package/build/font-library-modal/context.js.map +7 -0
- package/build/font-library-modal/font-card.js +81 -0
- package/build/font-library-modal/font-card.js.map +7 -0
- package/build/font-library-modal/font-collection.js +510 -0
- package/build/font-library-modal/font-collection.js.map +7 -0
- package/build/font-library-modal/font-demo.js +111 -0
- package/build/font-library-modal/font-demo.js.map +7 -0
- package/build/font-library-modal/google-fonts-confirm-dialog.js +58 -0
- package/build/font-library-modal/google-fonts-confirm-dialog.js.map +7 -0
- package/build/font-library-modal/index.js +110 -0
- package/build/font-library-modal/index.js.map +7 -0
- package/build/font-library-modal/installed-fonts.js +453 -0
- package/build/font-library-modal/installed-fonts.js.map +7 -0
- package/build/font-library-modal/lib/inflate.js +2628 -0
- package/build/font-library-modal/lib/inflate.js.map +7 -0
- package/build/font-library-modal/lib/lib-font.browser.d.js +33 -0
- package/build/font-library-modal/lib/lib-font.browser.d.js.map +7 -0
- package/build/font-library-modal/lib/lib-font.browser.js +3788 -0
- package/build/font-library-modal/lib/lib-font.browser.js.map +7 -0
- package/build/font-library-modal/lib/unbrotli.js +3678 -0
- package/build/font-library-modal/lib/unbrotli.js.map +7 -0
- package/build/font-library-modal/library-font-details.js +63 -0
- package/build/font-library-modal/library-font-details.js.map +7 -0
- package/build/font-library-modal/library-font-variant.js +81 -0
- package/build/font-library-modal/library-font-variant.js.map +7 -0
- package/build/font-library-modal/resolvers.js +115 -0
- package/build/font-library-modal/resolvers.js.map +7 -0
- package/build/font-library-modal/types.js +17 -0
- package/build/font-library-modal/types.js.map +7 -0
- package/build/font-library-modal/upload-fonts.js +207 -0
- package/build/font-library-modal/upload-fonts.js.map +7 -0
- package/build/font-library-modal/utils/constants.js +49 -0
- package/build/font-library-modal/utils/constants.js.map +7 -0
- package/build/font-library-modal/utils/filter-fonts.js +39 -0
- package/build/font-library-modal/utils/filter-fonts.js.map +7 -0
- package/build/font-library-modal/utils/fonts-outline.js +51 -0
- package/build/font-library-modal/utils/fonts-outline.js.map +7 -0
- package/build/font-library-modal/utils/index.js +274 -0
- package/build/font-library-modal/utils/index.js.map +7 -0
- package/build/font-library-modal/utils/make-families-from-faces.js +45 -0
- package/build/font-library-modal/utils/make-families-from-faces.js.map +7 -0
- package/build/font-library-modal/utils/preview-styles.js +119 -0
- package/build/font-library-modal/utils/preview-styles.js.map +7 -0
- package/build/font-library-modal/utils/set-immutably.js +40 -0
- package/build/font-library-modal/utils/set-immutably.js.map +7 -0
- package/build/font-library-modal/utils/sort-font-faces.js +59 -0
- package/build/font-library-modal/utils/sort-font-faces.js.map +7 -0
- package/build/font-library-modal/utils/toggleFont.js +67 -0
- package/build/font-library-modal/utils/toggleFont.js.map +7 -0
- package/build/font-sizes/confirm-delete-font-size-dialog.js +60 -0
- package/build/font-sizes/confirm-delete-font-size-dialog.js.map +7 -0
- package/build/font-sizes/confirm-reset-font-sizes-dialog.js +55 -0
- package/build/font-sizes/confirm-reset-font-sizes-dialog.js.map +7 -0
- package/build/font-sizes/font-size-preview.js +50 -0
- package/build/font-sizes/font-size-preview.js.map +7 -0
- package/build/font-sizes/font-size.js +261 -0
- package/build/font-sizes/font-size.js.map +7 -0
- package/build/font-sizes/font-sizes-count.js +40 -0
- package/build/font-sizes/font-sizes-count.js.map +7 -0
- package/build/font-sizes/font-sizes.js +215 -0
- package/build/font-sizes/font-sizes.js.map +7 -0
- package/build/font-sizes/rename-font-size-dialog.js +96 -0
- package/build/font-sizes/rename-font-size-dialog.js.map +7 -0
- package/build/global-styles-ui.js +213 -0
- package/build/global-styles-ui.js.map +7 -0
- package/build/gradients-palette-panel.js +133 -0
- package/build/gradients-palette-panel.js.map +7 -0
- package/build/highlighted-colors.js +57 -0
- package/build/highlighted-colors.js.map +7 -0
- package/build/hooks.js +176 -0
- package/build/hooks.js.map +7 -0
- package/build/icon-with-current-color.js +56 -0
- package/build/icon-with-current-color.js.map +7 -0
- package/build/index.js +51 -0
- package/build/index.js.map +7 -0
- package/build/lock-unlock.js +35 -0
- package/build/lock-unlock.js.map +7 -0
- package/build/navigation-button.js +52 -0
- package/build/navigation-button.js.map +7 -0
- package/build/pagination/index.js +133 -0
- package/build/pagination/index.js.map +7 -0
- package/build/palette.js +93 -0
- package/build/palette.js.map +7 -0
- package/build/preset-colors.js +40 -0
- package/build/preset-colors.js.map +7 -0
- package/build/preview-colors.js +86 -0
- package/build/preview-colors.js.map +7 -0
- package/build/preview-hooks.js +60 -0
- package/build/preview-hooks.js.map +7 -0
- package/build/preview-styles.js +219 -0
- package/build/preview-styles.js.map +7 -0
- package/build/preview-typography.js +72 -0
- package/build/preview-typography.js.map +7 -0
- package/build/preview-wrapper.js +102 -0
- package/build/preview-wrapper.js.map +7 -0
- package/build/provider.js +54 -0
- package/build/provider.js.map +7 -0
- package/build/root-menu.js +72 -0
- package/build/root-menu.js.map +7 -0
- package/build/screen-background.js +58 -0
- package/build/screen-background.js.map +7 -0
- package/build/screen-block-list.js +160 -0
- package/build/screen-block-list.js.map +7 -0
- package/build/screen-block.js +316 -0
- package/build/screen-block.js.map +7 -0
- package/build/screen-color-palette.js +64 -0
- package/build/screen-color-palette.js.map +7 -0
- package/build/screen-colors.js +85 -0
- package/build/screen-colors.js.map +7 -0
- package/build/screen-css.js +68 -0
- package/build/screen-css.js.map +7 -0
- package/build/screen-header.js +61 -0
- package/build/screen-header.js.map +7 -0
- package/build/screen-layout.js +54 -0
- package/build/screen-layout.js.map +7 -0
- package/build/screen-revisions/index.js +147 -0
- package/build/screen-revisions/index.js.map +7 -0
- package/build/screen-revisions/revisions-buttons.js +198 -0
- package/build/screen-revisions/revisions-buttons.js.map +7 -0
- package/build/screen-revisions/types.js +17 -0
- package/build/screen-revisions/types.js.map +7 -0
- package/build/screen-revisions/use-global-styles-revisions.js +163 -0
- package/build/screen-revisions/use-global-styles-revisions.js.map +7 -0
- package/build/screen-root.js +134 -0
- package/build/screen-root.js.map +7 -0
- package/build/screen-shadows.js +49 -0
- package/build/screen-shadows.js.map +7 -0
- package/build/screen-style-variations.js +52 -0
- package/build/screen-style-variations.js.map +7 -0
- package/build/screen-typography-element.js +167 -0
- package/build/screen-typography-element.js.map +7 -0
- package/build/screen-typography.js +65 -0
- package/build/screen-typography.js.map +7 -0
- package/build/shadow-utils.js +125 -0
- package/build/shadow-utils.js.map +7 -0
- package/build/shadows-edit-panel.js +503 -0
- package/build/shadows-edit-panel.js.map +7 -0
- package/build/shadows-panel.js +203 -0
- package/build/shadows-panel.js.map +7 -0
- package/build/size-control/index.js +86 -0
- package/build/size-control/index.js.map +7 -0
- package/build/style-variations-container.js +130 -0
- package/build/style-variations-container.js.map +7 -0
- package/build/style-variations-content.js +52 -0
- package/build/style-variations-content.js.map +7 -0
- package/build/style-variations.js +41 -0
- package/build/style-variations.js.map +7 -0
- package/build/subtitle.js +33 -0
- package/build/subtitle.js.map +7 -0
- package/build/typography-elements.js +117 -0
- package/build/typography-elements.js.map +7 -0
- package/build/typography-example.js +79 -0
- package/build/typography-example.js.map +7 -0
- package/build/typography-panel.js +64 -0
- package/build/typography-panel.js.map +7 -0
- package/build/typography-preview.js +70 -0
- package/build/typography-preview.js.map +7 -0
- package/build/typography-variations.js +41 -0
- package/build/typography-variations.js.map +7 -0
- package/build/utils.js +210 -0
- package/build/utils.js.map +7 -0
- package/build/variations/variation.js +116 -0
- package/build/variations/variation.js.map +7 -0
- package/build/variations/variations-color.js +64 -0
- package/build/variations/variations-color.js.map +7 -0
- package/build/variations/variations-panel.js +69 -0
- package/build/variations/variations-panel.js.map +7 -0
- package/build/variations/variations-typography.js +80 -0
- package/build/variations/variations-typography.js.map +7 -0
- package/build/with-global-styles-provider.js +48 -0
- package/build/with-global-styles-provider.js.map +7 -0
- package/build-module/background-panel.js +38 -0
- package/build-module/background-panel.js.map +7 -0
- package/build-module/block-preview-panel.js +70 -0
- package/build-module/block-preview-panel.js.map +7 -0
- package/build-module/color-indicator-wrapper.js +25 -0
- package/build-module/color-indicator-wrapper.js.map +7 -0
- package/build-module/color-palette-panel.js +97 -0
- package/build-module/color-palette-panel.js.map +7 -0
- package/build-module/color-preview.js +70 -0
- package/build-module/color-preview.js.map +7 -0
- package/build-module/color-variations.js +7 -0
- package/build-module/color-variations.js.map +7 -0
- package/build-module/confirm-reset-shadow-dialog.js +35 -0
- package/build-module/confirm-reset-shadow-dialog.js.map +7 -0
- package/build-module/context.js +13 -0
- package/build-module/context.js.map +7 -0
- package/build-module/dimensions-panel.js +69 -0
- package/build-module/dimensions-panel.js.map +7 -0
- package/build-module/font-families.js +92 -0
- package/build-module/font-families.js.map +7 -0
- package/build-module/font-family-item.js +32 -0
- package/build-module/font-family-item.js.map +7 -0
- package/build-module/font-library-modal/collection-font-variant.js +45 -0
- package/build-module/font-library-modal/collection-font-variant.js.map +7 -0
- package/build-module/font-library-modal/context.js +382 -0
- package/build-module/font-library-modal/context.js.map +7 -0
- package/build-module/font-library-modal/font-card.js +57 -0
- package/build-module/font-library-modal/font-card.js.map +7 -0
- package/build-module/font-library-modal/font-collection.js +510 -0
- package/build-module/font-library-modal/font-collection.js.map +7 -0
- package/build-module/font-library-modal/font-demo.js +94 -0
- package/build-module/font-library-modal/font-demo.js.map +7 -0
- package/build-module/font-library-modal/google-fonts-confirm-dialog.js +45 -0
- package/build-module/font-library-modal/google-fonts-confirm-dialog.js.map +7 -0
- package/build-module/font-library-modal/index.js +83 -0
- package/build-module/font-library-modal/index.js.map +7 -0
- package/build-module/font-library-modal/installed-fonts.js +442 -0
- package/build-module/font-library-modal/installed-fonts.js.map +7 -0
- package/build-module/font-library-modal/lib/inflate.js +2636 -0
- package/build-module/font-library-modal/lib/inflate.js.map +7 -0
- package/build-module/font-library-modal/lib/lib-font.browser.d.js +9 -0
- package/build-module/font-library-modal/lib/lib-font.browser.d.js.map +7 -0
- package/build-module/font-library-modal/lib/lib-font.browser.js +3754 -0
- package/build-module/font-library-modal/lib/lib-font.browser.js.map +7 -0
- package/build-module/font-library-modal/lib/unbrotli.js +3686 -0
- package/build-module/font-library-modal/lib/unbrotli.js.map +7 -0
- package/build-module/font-library-modal/library-font-details.js +36 -0
- package/build-module/font-library-modal/library-font-details.js.map +7 -0
- package/build-module/font-library-modal/library-font-variant.js +51 -0
- package/build-module/font-library-modal/library-font-variant.js.map +7 -0
- package/build-module/font-library-modal/resolvers.js +76 -0
- package/build-module/font-library-modal/resolvers.js.map +7 -0
- package/build-module/font-library-modal/types.js +1 -0
- package/build-module/font-library-modal/types.js.map +7 -0
- package/build-module/font-library-modal/upload-fonts.js +187 -0
- package/build-module/font-library-modal/upload-fonts.js.map +7 -0
- package/build-module/font-library-modal/utils/constants.js +23 -0
- package/build-module/font-library-modal/utils/constants.js.map +7 -0
- package/build-module/font-library-modal/utils/filter-fonts.js +19 -0
- package/build-module/font-library-modal/utils/filter-fonts.js.map +7 -0
- package/build-module/font-library-modal/utils/fonts-outline.js +26 -0
- package/build-module/font-library-modal/utils/fonts-outline.js.map +7 -0
- package/build-module/font-library-modal/utils/index.js +238 -0
- package/build-module/font-library-modal/utils/index.js.map +7 -0
- package/build-module/font-library-modal/utils/make-families-from-faces.js +25 -0
- package/build-module/font-library-modal/utils/make-families-from-faces.js.map +7 -0
- package/build-module/font-library-modal/utils/preview-styles.js +92 -0
- package/build-module/font-library-modal/utils/preview-styles.js.map +7 -0
- package/build-module/font-library-modal/utils/set-immutably.js +16 -0
- package/build-module/font-library-modal/utils/set-immutably.js.map +7 -0
- package/build-module/font-library-modal/utils/sort-font-faces.js +35 -0
- package/build-module/font-library-modal/utils/sort-font-faces.js.map +7 -0
- package/build-module/font-library-modal/utils/toggleFont.js +43 -0
- package/build-module/font-library-modal/utils/toggleFont.js.map +7 -0
- package/build-module/font-sizes/confirm-delete-font-size-dialog.js +40 -0
- package/build-module/font-sizes/confirm-delete-font-size-dialog.js.map +7 -0
- package/build-module/font-sizes/confirm-reset-font-sizes-dialog.js +35 -0
- package/build-module/font-sizes/confirm-reset-font-sizes-dialog.js.map +7 -0
- package/build-module/font-sizes/font-size-preview.js +30 -0
- package/build-module/font-sizes/font-size-preview.js.map +7 -0
- package/build-module/font-sizes/font-size.js +241 -0
- package/build-module/font-sizes/font-size.js.map +7 -0
- package/build-module/font-sizes/font-sizes-count.js +25 -0
- package/build-module/font-sizes/font-sizes-count.js.map +7 -0
- package/build-module/font-sizes/font-sizes.js +200 -0
- package/build-module/font-sizes/font-sizes.js.map +7 -0
- package/build-module/font-sizes/rename-font-size-dialog.js +82 -0
- package/build-module/font-sizes/rename-font-size-dialog.js.map +7 -0
- package/build-module/global-styles-ui.js +182 -0
- package/build-module/global-styles-ui.js.map +7 -0
- package/build-module/gradients-palette-panel.js +118 -0
- package/build-module/gradients-palette-panel.js.map +7 -0
- package/build-module/highlighted-colors.js +37 -0
- package/build-module/highlighted-colors.js.map +7 -0
- package/build-module/hooks.js +144 -0
- package/build-module/hooks.js.map +7 -0
- package/build-module/icon-with-current-color.js +22 -0
- package/build-module/icon-with-current-color.js.map +7 -0
- package/build-module/index.js +13 -0
- package/build-module/index.js.map +7 -0
- package/build-module/lock-unlock.js +10 -0
- package/build-module/lock-unlock.js.map +7 -0
- package/build-module/navigation-button.js +32 -0
- package/build-module/navigation-button.js.map +7 -0
- package/build-module/pagination/index.js +107 -0
- package/build-module/pagination/index.js.map +7 -0
- package/build-module/palette.js +70 -0
- package/build-module/palette.js.map +7 -0
- package/build-module/preset-colors.js +20 -0
- package/build-module/preset-colors.js.map +7 -0
- package/build-module/preview-colors.js +59 -0
- package/build-module/preview-colors.js.map +7 -0
- package/build-module/preview-hooks.js +36 -0
- package/build-module/preview-hooks.js.map +7 -0
- package/build-module/preview-styles.js +193 -0
- package/build-module/preview-styles.js.map +7 -0
- package/build-module/preview-typography.js +42 -0
- package/build-module/preview-typography.js.map +7 -0
- package/build-module/preview-wrapper.js +86 -0
- package/build-module/preview-wrapper.js.map +7 -0
- package/build-module/provider.js +30 -0
- package/build-module/provider.js.map +7 -0
- package/build-module/root-menu.js +58 -0
- package/build-module/root-menu.js.map +7 -0
- package/build-module/screen-background.js +28 -0
- package/build-module/screen-background.js.map +7 -0
- package/build-module/screen-block-list.js +150 -0
- package/build-module/screen-block-list.js.map +7 -0
- package/build-module/screen-block.js +293 -0
- package/build-module/screen-block.js.map +7 -0
- package/build-module/screen-color-palette.js +34 -0
- package/build-module/screen-color-palette.js.map +7 -0
- package/build-module/screen-colors.js +55 -0
- package/build-module/screen-colors.js.map +7 -0
- package/build-module/screen-css.js +48 -0
- package/build-module/screen-css.js.map +7 -0
- package/build-module/screen-header.js +44 -0
- package/build-module/screen-header.js.map +7 -0
- package/build-module/screen-layout.js +24 -0
- package/build-module/screen-layout.js.map +7 -0
- package/build-module/screen-revisions/index.js +121 -0
- package/build-module/screen-revisions/index.js.map +7 -0
- package/build-module/screen-revisions/revisions-buttons.js +178 -0
- package/build-module/screen-revisions/revisions-buttons.js.map +7 -0
- package/build-module/screen-revisions/types.js +1 -0
- package/build-module/screen-revisions/types.js.map +7 -0
- package/build-module/screen-revisions/use-global-styles-revisions.js +145 -0
- package/build-module/screen-revisions/use-global-styles-revisions.js.map +7 -0
- package/build-module/screen-root.js +114 -0
- package/build-module/screen-root.js.map +7 -0
- package/build-module/screen-shadows.js +14 -0
- package/build-module/screen-shadows.js.map +7 -0
- package/build-module/screen-style-variations.js +32 -0
- package/build-module/screen-style-variations.js.map +7 -0
- package/build-module/screen-typography-element.js +141 -0
- package/build-module/screen-typography-element.js.map +7 -0
- package/build-module/screen-typography.js +35 -0
- package/build-module/screen-typography.js.map +7 -0
- package/build-module/shadow-utils.js +98 -0
- package/build-module/shadow-utils.js.map +7 -0
- package/build-module/shadows-edit-panel.js +502 -0
- package/build-module/shadows-edit-panel.js.map +7 -0
- package/build-module/shadows-panel.js +182 -0
- package/build-module/shadows-panel.js.map +7 -0
- package/build-module/size-control/index.js +72 -0
- package/build-module/size-control/index.js.map +7 -0
- package/build-module/style-variations-container.js +100 -0
- package/build-module/style-variations-container.js.map +7 -0
- package/build-module/style-variations-content.js +18 -0
- package/build-module/style-variations-content.js.map +7 -0
- package/build-module/style-variations.js +7 -0
- package/build-module/style-variations.js.map +7 -0
- package/build-module/subtitle.js +9 -0
- package/build-module/subtitle.js.map +7 -0
- package/build-module/typography-elements.js +102 -0
- package/build-module/typography-elements.js.map +7 -0
- package/build-module/typography-example.js +59 -0
- package/build-module/typography-example.js.map +7 -0
- package/build-module/typography-panel.js +44 -0
- package/build-module/typography-panel.js.map +7 -0
- package/build-module/typography-preview.js +50 -0
- package/build-module/typography-preview.js.map +7 -0
- package/build-module/typography-variations.js +7 -0
- package/build-module/typography-variations.js.map +7 -0
- package/build-module/utils.js +179 -0
- package/build-module/utils.js.map +7 -0
- package/build-module/variations/variation.js +86 -0
- package/build-module/variations/variation.js.map +7 -0
- package/build-module/variations/variations-color.js +37 -0
- package/build-module/variations/variations-color.js.map +7 -0
- package/build-module/variations/variations-panel.js +44 -0
- package/build-module/variations/variations-panel.js.map +7 -0
- package/build-module/variations/variations-typography.js +53 -0
- package/build-module/variations/variations-typography.js.map +7 -0
- package/build-module/with-global-styles-provider.js +24 -0
- package/build-module/with-global-styles-provider.js.map +7 -0
- package/build-style/style-rtl.css +717 -0
- package/build-style/style.css +718 -0
- package/build-types/background-panel.d.ts +10 -0
- package/build-types/background-panel.d.ts.map +1 -0
- package/build-types/block-preview-panel.d.ts +7 -0
- package/build-types/block-preview-panel.d.ts.map +1 -0
- package/build-types/color-indicator-wrapper.d.ts +7 -0
- package/build-types/color-indicator-wrapper.d.ts.map +1 -0
- package/build-types/color-palette-panel.d.ts +6 -0
- package/build-types/color-palette-panel.d.ts.map +1 -0
- package/build-types/color-preview.d.ts +2 -0
- package/build-types/color-preview.d.ts.map +1 -0
- package/build-types/color-variations.d.ts +27 -0
- package/build-types/color-variations.d.ts.map +1 -0
- package/build-types/confirm-reset-shadow-dialog.d.ts +10 -0
- package/build-types/confirm-reset-shadow-dialog.d.ts.map +1 -0
- package/build-types/context.d.ts +10 -0
- package/build-types/context.d.ts.map +1 -0
- package/build-types/dimensions-panel.d.ts +2 -0
- package/build-types/dimensions-panel.d.ts.map +1 -0
- package/build-types/font-families.d.ts +4 -0
- package/build-types/font-families.d.ts.map +1 -0
- package/build-types/font-family-item.d.ts +7 -0
- package/build-types/font-family-item.d.ts.map +1 -0
- package/build-types/font-library-modal/collection-font-variant.d.ts +4 -0
- package/build-types/font-library-modal/collection-font-variant.d.ts.map +1 -0
- package/build-types/font-library-modal/context.d.ts +7 -0
- package/build-types/font-library-modal/context.d.ts.map +1 -0
- package/build-types/font-library-modal/font-card.d.ts +9 -0
- package/build-types/font-library-modal/font-card.d.ts.map +1 -0
- package/build-types/font-library-modal/font-collection.d.ts +5 -0
- package/build-types/font-library-modal/font-collection.d.ts.map +1 -0
- package/build-types/font-library-modal/font-demo.d.ts +4 -0
- package/build-types/font-library-modal/font-demo.d.ts.map +1 -0
- package/build-types/font-library-modal/google-fonts-confirm-dialog.d.ts +3 -0
- package/build-types/font-library-modal/google-fonts-confirm-dialog.d.ts.map +1 -0
- package/build-types/font-library-modal/index.d.ts +6 -0
- package/build-types/font-library-modal/index.d.ts.map +1 -0
- package/build-types/font-library-modal/installed-fonts.d.ts +3 -0
- package/build-types/font-library-modal/installed-fonts.d.ts.map +1 -0
- package/build-types/font-library-modal/library-font-details.d.ts +6 -0
- package/build-types/font-library-modal/library-font-details.d.ts.map +1 -0
- package/build-types/font-library-modal/library-font-variant.d.ts +7 -0
- package/build-types/font-library-modal/library-font-variant.d.ts.map +1 -0
- package/build-types/font-library-modal/resolvers.d.ts +43 -0
- package/build-types/font-library-modal/resolvers.d.ts.map +1 -0
- package/build-types/font-library-modal/types.d.ts +133 -0
- package/build-types/font-library-modal/types.d.ts.map +1 -0
- package/build-types/font-library-modal/upload-fonts.d.ts +3 -0
- package/build-types/font-library-modal/upload-fonts.d.ts.map +1 -0
- package/build-types/font-library-modal/utils/constants.d.ts +4 -0
- package/build-types/font-library-modal/utils/constants.d.ts.map +1 -0
- package/build-types/font-library-modal/utils/filter-fonts.d.ts +25 -0
- package/build-types/font-library-modal/utils/filter-fonts.d.ts.map +1 -0
- package/build-types/font-library-modal/utils/fonts-outline.d.ts +7 -0
- package/build-types/font-library-modal/utils/fonts-outline.d.ts.map +1 -0
- package/build-types/font-library-modal/utils/index.d.ts +21 -0
- package/build-types/font-library-modal/utils/index.d.ts.map +1 -0
- package/build-types/font-library-modal/utils/make-families-from-faces.d.ts +6 -0
- package/build-types/font-library-modal/utils/make-families-from-faces.d.ts.map +1 -0
- package/build-types/font-library-modal/utils/preview-styles.d.ts +13 -0
- package/build-types/font-library-modal/utils/preview-styles.d.ts.map +1 -0
- package/build-types/font-library-modal/utils/set-immutably.d.ts +13 -0
- package/build-types/font-library-modal/utils/set-immutably.d.ts.map +1 -0
- package/build-types/font-library-modal/utils/sort-font-faces.d.ts +6 -0
- package/build-types/font-library-modal/utils/sort-font-faces.d.ts.map +1 -0
- package/build-types/font-library-modal/utils/toggleFont.d.ts +38 -0
- package/build-types/font-library-modal/utils/toggleFont.d.ts.map +1 -0
- package/build-types/font-sizes/confirm-delete-font-size-dialog.d.ts +10 -0
- package/build-types/font-sizes/confirm-delete-font-size-dialog.d.ts.map +1 -0
- package/build-types/font-sizes/confirm-reset-font-sizes-dialog.d.ts +10 -0
- package/build-types/font-sizes/confirm-reset-font-sizes-dialog.d.ts.map +1 -0
- package/build-types/font-sizes/font-size-preview.d.ts +7 -0
- package/build-types/font-sizes/font-size-preview.d.ts.map +1 -0
- package/build-types/font-sizes/font-size.d.ts +4 -0
- package/build-types/font-sizes/font-size.d.ts.map +1 -0
- package/build-types/font-sizes/font-sizes-count.d.ts +3 -0
- package/build-types/font-sizes/font-sizes-count.d.ts.map +1 -0
- package/build-types/font-sizes/font-sizes.d.ts +3 -0
- package/build-types/font-sizes/font-sizes.d.ts.map +1 -0
- package/build-types/font-sizes/rename-font-size-dialog.d.ts +9 -0
- package/build-types/font-sizes/rename-font-size-dialog.d.ts.map +1 -0
- package/build-types/global-styles-ui.d.ts +26 -0
- package/build-types/global-styles-ui.d.ts.map +1 -0
- package/build-types/gradients-palette-panel.d.ts +6 -0
- package/build-types/gradients-palette-panel.d.ts.map +1 -0
- package/build-types/highlighted-colors.d.ts +7 -0
- package/build-types/highlighted-colors.d.ts.map +1 -0
- package/build-types/hooks.d.ts +46 -0
- package/build-types/hooks.d.ts.map +1 -0
- package/build-types/icon-with-current-color.d.ts +9 -0
- package/build-types/icon-with-current-color.d.ts.map +1 -0
- package/build-types/index.d.ts +6 -0
- package/build-types/index.d.ts.map +1 -0
- package/build-types/lock-unlock.d.ts +2 -0
- package/build-types/lock-unlock.d.ts.map +1 -0
- package/build-types/navigation-button.d.ts +10 -0
- package/build-types/navigation-button.d.ts.map +1 -0
- package/build-types/pagination/index.d.ts +13 -0
- package/build-types/pagination/index.d.ts.map +1 -0
- package/build-types/palette.d.ts +6 -0
- package/build-types/palette.d.ts.map +1 -0
- package/build-types/preset-colors.d.ts +2 -0
- package/build-types/preset-colors.d.ts.map +1 -0
- package/build-types/preview-colors.d.ts +8 -0
- package/build-types/preview-colors.d.ts.map +1 -0
- package/build-types/preview-hooks.d.ts +9 -0
- package/build-types/preview-hooks.d.ts.map +1 -0
- package/build-types/preview-styles.d.ts +9 -0
- package/build-types/preview-styles.d.ts.map +1 -0
- package/build-types/preview-typography.d.ts +8 -0
- package/build-types/preview-typography.d.ts.map +1 -0
- package/build-types/preview-wrapper.d.ts +15 -0
- package/build-types/preview-wrapper.d.ts.map +1 -0
- package/build-types/provider.d.ts +15 -0
- package/build-types/provider.d.ts.map +1 -0
- package/build-types/root-menu.d.ts +3 -0
- package/build-types/root-menu.d.ts.map +1 -0
- package/build-types/screen-background.d.ts +3 -0
- package/build-types/screen-background.d.ts.map +1 -0
- package/build-types/screen-block-list.d.ts +4 -0
- package/build-types/screen-block-list.d.ts.map +1 -0
- package/build-types/screen-block.d.ts +7 -0
- package/build-types/screen-block.d.ts.map +1 -0
- package/build-types/screen-color-palette.d.ts +5 -0
- package/build-types/screen-color-palette.d.ts.map +1 -0
- package/build-types/screen-colors.d.ts +3 -0
- package/build-types/screen-colors.d.ts.map +1 -0
- package/build-types/screen-css.d.ts +3 -0
- package/build-types/screen-css.d.ts.map +1 -0
- package/build-types/screen-header.d.ts +8 -0
- package/build-types/screen-header.d.ts.map +1 -0
- package/build-types/screen-layout.d.ts +3 -0
- package/build-types/screen-layout.d.ts.map +1 -0
- package/build-types/screen-revisions/index.d.ts +6 -0
- package/build-types/screen-revisions/index.d.ts.map +1 -0
- package/build-types/screen-revisions/revisions-buttons.d.ts +23 -0
- package/build-types/screen-revisions/revisions-buttons.d.ts.map +1 -0
- package/build-types/screen-revisions/types.d.ts +17 -0
- package/build-types/screen-revisions/types.d.ts.map +1 -0
- package/build-types/screen-revisions/use-global-styles-revisions.d.ts +17 -0
- package/build-types/screen-revisions/use-global-styles-revisions.d.ts.map +1 -0
- package/build-types/screen-root.d.ts +3 -0
- package/build-types/screen-root.d.ts.map +1 -0
- package/build-types/screen-shadows.d.ts +3 -0
- package/build-types/screen-shadows.d.ts.map +1 -0
- package/build-types/screen-style-variations.d.ts +3 -0
- package/build-types/screen-style-variations.d.ts.map +1 -0
- package/build-types/screen-typography-element.d.ts +28 -0
- package/build-types/screen-typography-element.d.ts.map +1 -0
- package/build-types/screen-typography.d.ts +3 -0
- package/build-types/screen-typography.d.ts.map +1 -0
- package/build-types/shadow-utils.d.ts +126 -0
- package/build-types/shadow-utils.d.ts.map +1 -0
- package/build-types/shadows-edit-panel.d.ts +2 -0
- package/build-types/shadows-edit-panel.d.ts.map +1 -0
- package/build-types/shadows-panel.d.ts +3 -0
- package/build-types/shadows-panel.d.ts.map +1 -0
- package/build-types/size-control/index.d.ts +11 -0
- package/build-types/size-control/index.d.ts.map +1 -0
- package/build-types/stories/index.story.d.ts +6 -0
- package/build-types/stories/index.story.d.ts.map +1 -0
- package/build-types/style-variations-container.d.ts +6 -0
- package/build-types/style-variations-container.d.ts.map +1 -0
- package/build-types/style-variations-content.d.ts +2 -0
- package/build-types/style-variations-content.d.ts.map +1 -0
- package/build-types/style-variations.d.ts +25 -0
- package/build-types/style-variations.d.ts.map +1 -0
- package/build-types/subtitle.d.ts +7 -0
- package/build-types/subtitle.d.ts.map +1 -0
- package/build-types/test/shadow-utils.spec.d.ts +2 -0
- package/build-types/test/shadow-utils.spec.d.ts.map +1 -0
- package/build-types/test/utils.spec.d.ts +2 -0
- package/build-types/test/utils.spec.d.ts.map +1 -0
- package/build-types/typography-elements.d.ts +3 -0
- package/build-types/typography-elements.d.ts.map +1 -0
- package/build-types/typography-example.d.ts +7 -0
- package/build-types/typography-example.d.ts.map +1 -0
- package/build-types/typography-panel.d.ts +7 -0
- package/build-types/typography-panel.d.ts.map +1 -0
- package/build-types/typography-preview.d.ts +8 -0
- package/build-types/typography-preview.d.ts.map +1 -0
- package/build-types/typography-variations.d.ts +27 -0
- package/build-types/typography-variations.d.ts.map +1 -0
- package/build-types/utils.d.ts +63 -0
- package/build-types/utils.d.ts.map +1 -0
- package/build-types/variations/variation.d.ts +10 -0
- package/build-types/variations/variation.d.ts.map +1 -0
- package/build-types/variations/variations-color.d.ts +7 -0
- package/build-types/variations/variations-color.d.ts.map +1 -0
- package/build-types/variations/variations-panel.d.ts +13 -0
- package/build-types/variations/variations-panel.d.ts.map +1 -0
- package/build-types/variations/variations-typography.d.ts +7 -0
- package/build-types/variations/variations-typography.d.ts.map +1 -0
- package/build-types/with-global-styles-provider.d.ts +20 -0
- package/build-types/with-global-styles-provider.d.ts.map +1 -0
- package/package.json +67 -0
- package/src/README.md +99 -0
- package/src/background-panel.tsx +56 -0
- package/src/block-preview-panel.tsx +91 -0
- package/src/color-indicator-wrapper.tsx +34 -0
- package/src/color-palette-panel.tsx +111 -0
- package/src/color-preview.tsx +78 -0
- package/src/color-variations.tsx +35 -0
- package/src/confirm-reset-shadow-dialog.tsx +45 -0
- package/src/context.ts +21 -0
- package/src/dimensions-panel.tsx +85 -0
- package/src/font-families.tsx +127 -0
- package/src/font-family-item.tsx +52 -0
- package/src/font-library-modal/collection-font-variant.tsx +52 -0
- package/src/font-library-modal/context.tsx +591 -0
- package/src/font-library-modal/font-card.tsx +77 -0
- package/src/font-library-modal/font-collection.tsx +592 -0
- package/src/font-library-modal/font-demo.tsx +123 -0
- package/src/font-library-modal/google-fonts-confirm-dialog.tsx +57 -0
- package/src/font-library-modal/index.tsx +110 -0
- package/src/font-library-modal/installed-fonts.tsx +547 -0
- package/src/font-library-modal/lib/inflate.js +4112 -0
- package/src/font-library-modal/lib/lib-font.browser.d.ts +11 -0
- package/src/font-library-modal/lib/lib-font.browser.js +3861 -0
- package/src/font-library-modal/lib/unbrotli.js +2706 -0
- package/src/font-library-modal/library-font-details.tsx +46 -0
- package/src/font-library-modal/library-font-variant.tsx +67 -0
- package/src/font-library-modal/resolvers.tsx +100 -0
- package/src/font-library-modal/style.scss +222 -0
- package/src/font-library-modal/types.ts +176 -0
- package/src/font-library-modal/upload-fonts.tsx +269 -0
- package/src/font-library-modal/utils/constants.ts +23 -0
- package/src/font-library-modal/utils/filter-fonts.ts +47 -0
- package/src/font-library-modal/utils/fonts-outline.ts +33 -0
- package/src/font-library-modal/utils/index.ts +368 -0
- package/src/font-library-modal/utils/make-families-from-faces.ts +34 -0
- package/src/font-library-modal/utils/preview-styles.ts +167 -0
- package/src/font-library-modal/utils/set-immutably.ts +37 -0
- package/src/font-library-modal/utils/sort-font-faces.ts +46 -0
- package/src/font-library-modal/utils/toggleFont.ts +109 -0
- package/src/font-sizes/confirm-delete-font-size-dialog.tsx +51 -0
- package/src/font-sizes/confirm-reset-font-sizes-dialog.tsx +45 -0
- package/src/font-sizes/font-size-preview.tsx +47 -0
- package/src/font-sizes/font-size.tsx +289 -0
- package/src/font-sizes/font-sizes-count.tsx +37 -0
- package/src/font-sizes/font-sizes.tsx +265 -0
- package/src/font-sizes/rename-font-size-dialog.tsx +83 -0
- package/src/global-styles-ui.tsx +292 -0
- package/src/gradients-palette-panel.tsx +126 -0
- package/src/highlighted-colors.tsx +44 -0
- package/src/hooks.ts +251 -0
- package/src/icon-with-current-color.tsx +31 -0
- package/src/index.ts +7 -0
- package/src/lock-unlock.ts +10 -0
- package/src/navigation-button.tsx +53 -0
- package/src/pagination/index.tsx +107 -0
- package/src/pagination/style.scss +7 -0
- package/src/palette.tsx +101 -0
- package/src/preset-colors.tsx +18 -0
- package/src/preview-colors.tsx +68 -0
- package/src/preview-hooks.tsx +58 -0
- package/src/preview-styles.tsx +196 -0
- package/src/preview-typography.tsx +49 -0
- package/src/preview-wrapper.tsx +137 -0
- package/src/provider.tsx +54 -0
- package/src/root-menu.tsx +87 -0
- package/src/screen-background.tsx +37 -0
- package/src/screen-block-list.tsx +198 -0
- package/src/screen-block.tsx +370 -0
- package/src/screen-color-palette.tsx +47 -0
- package/src/screen-colors.tsx +67 -0
- package/src/screen-css.tsx +56 -0
- package/src/screen-header.tsx +56 -0
- package/src/screen-layout.tsx +34 -0
- package/src/screen-revisions/index.tsx +158 -0
- package/src/screen-revisions/revisions-buttons.tsx +259 -0
- package/src/screen-revisions/style.scss +194 -0
- package/src/screen-revisions/types.ts +18 -0
- package/src/screen-revisions/use-global-styles-revisions.tsx +204 -0
- package/src/screen-root.tsx +146 -0
- package/src/screen-shadows.tsx +13 -0
- package/src/screen-style-variations.tsx +36 -0
- package/src/screen-typography-element.tsx +127 -0
- package/src/screen-typography.tsx +41 -0
- package/src/shadow-utils.ts +167 -0
- package/src/shadows-edit-panel.tsx +559 -0
- package/src/shadows-panel.tsx +207 -0
- package/src/size-control/index.tsx +97 -0
- package/src/size-control/style.scss +7 -0
- package/src/stories/index.story.js +410 -0
- package/src/style-variations-container.tsx +153 -0
- package/src/style-variations-content.tsx +24 -0
- package/src/style-variations.tsx +33 -0
- package/src/style.scss +287 -0
- package/src/subtitle.tsx +17 -0
- package/src/test/shadow-utils.spec.js +251 -0
- package/src/test/utils.spec.js +59 -0
- package/src/typography-elements.tsx +113 -0
- package/src/typography-example.tsx +78 -0
- package/src/typography-panel.tsx +56 -0
- package/src/typography-preview.tsx +61 -0
- package/src/typography-variations.tsx +35 -0
- package/src/utils.ts +301 -0
- package/src/variations/style.scss +43 -0
- package/src/variations/variation.tsx +113 -0
- package/src/variations/variations-color.tsx +54 -0
- package/src/variations/variations-panel.tsx +79 -0
- package/src/variations/variations-typography.tsx +65 -0
- package/src/with-global-styles-provider.tsx +44 -0
- package/tsconfig.json +26 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var use_global_styles_revisions_exports = {};
|
|
20
|
+
__export(use_global_styles_revisions_exports, {
|
|
21
|
+
default: () => useGlobalStylesRevisions
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(use_global_styles_revisions_exports);
|
|
24
|
+
var import_data = require("@wordpress/data");
|
|
25
|
+
var import_core_data = require("@wordpress/core-data");
|
|
26
|
+
var import_element = require("@wordpress/element");
|
|
27
|
+
var import_context = require("../context");
|
|
28
|
+
const SITE_EDITOR_AUTHORS_QUERY = {
|
|
29
|
+
per_page: -1,
|
|
30
|
+
_fields: "id,name,avatar_urls",
|
|
31
|
+
context: "view",
|
|
32
|
+
capabilities: ["edit_theme_options"]
|
|
33
|
+
};
|
|
34
|
+
const DEFAULT_QUERY = { per_page: 100, page: 1 };
|
|
35
|
+
const EMPTY_ARRAY = [];
|
|
36
|
+
function useGlobalStylesRevisions({
|
|
37
|
+
query
|
|
38
|
+
} = {}) {
|
|
39
|
+
const { user: userConfig } = (0, import_element.useContext)(import_context.GlobalStylesContext);
|
|
40
|
+
const _query = (0, import_element.useMemo)(
|
|
41
|
+
() => ({ ...DEFAULT_QUERY, ...query }),
|
|
42
|
+
[query]
|
|
43
|
+
);
|
|
44
|
+
const {
|
|
45
|
+
authors,
|
|
46
|
+
currentUser,
|
|
47
|
+
isDirty,
|
|
48
|
+
revisions,
|
|
49
|
+
isLoadingGlobalStylesRevisions,
|
|
50
|
+
revisionsCount
|
|
51
|
+
} = (0, import_data.useSelect)(
|
|
52
|
+
(select) => {
|
|
53
|
+
const {
|
|
54
|
+
__experimentalGetDirtyEntityRecords,
|
|
55
|
+
getCurrentUser,
|
|
56
|
+
getUsers,
|
|
57
|
+
getRevisions,
|
|
58
|
+
__experimentalGetCurrentGlobalStylesId,
|
|
59
|
+
getEntityRecord,
|
|
60
|
+
// @ts-expect-error
|
|
61
|
+
isResolving
|
|
62
|
+
} = select(import_core_data.store);
|
|
63
|
+
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords() || [];
|
|
64
|
+
const _currentUser = getCurrentUser();
|
|
65
|
+
const _isDirty = dirtyEntityRecords.length > 0;
|
|
66
|
+
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
67
|
+
const globalStyles = globalStylesId ? getEntityRecord(
|
|
68
|
+
"root",
|
|
69
|
+
"globalStyles",
|
|
70
|
+
globalStylesId
|
|
71
|
+
) : void 0;
|
|
72
|
+
const _revisionsCount = (
|
|
73
|
+
// @ts-expect-error - _links is not typed in GlobalStylesRevision
|
|
74
|
+
globalStyles?._links?.["version-history"]?.[0]?.count ?? 0
|
|
75
|
+
);
|
|
76
|
+
const globalStylesRevisions = globalStylesId ? getRevisions(
|
|
77
|
+
"root",
|
|
78
|
+
"globalStyles",
|
|
79
|
+
globalStylesId,
|
|
80
|
+
_query
|
|
81
|
+
) || EMPTY_ARRAY : EMPTY_ARRAY;
|
|
82
|
+
const _authors = getUsers(SITE_EDITOR_AUTHORS_QUERY) || [];
|
|
83
|
+
const _isResolving = globalStylesId ? isResolving("getRevisions", [
|
|
84
|
+
"root",
|
|
85
|
+
"globalStyles",
|
|
86
|
+
globalStylesId,
|
|
87
|
+
_query
|
|
88
|
+
]) : false;
|
|
89
|
+
return {
|
|
90
|
+
authors: _authors,
|
|
91
|
+
currentUser: _currentUser,
|
|
92
|
+
isDirty: _isDirty,
|
|
93
|
+
revisions: globalStylesRevisions,
|
|
94
|
+
isLoadingGlobalStylesRevisions: _isResolving,
|
|
95
|
+
revisionsCount: _revisionsCount
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
[_query]
|
|
99
|
+
);
|
|
100
|
+
return (0, import_element.useMemo)(() => {
|
|
101
|
+
if (!authors.length || isLoadingGlobalStylesRevisions) {
|
|
102
|
+
return {
|
|
103
|
+
revisions: EMPTY_ARRAY,
|
|
104
|
+
hasUnsavedChanges: isDirty,
|
|
105
|
+
isLoading: true,
|
|
106
|
+
revisionsCount
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
const _modifiedRevisions = revisions.map((revision) => {
|
|
110
|
+
return {
|
|
111
|
+
...revision,
|
|
112
|
+
author: authors.find(
|
|
113
|
+
(author) => author.id === revision.author
|
|
114
|
+
)
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
const fetchedRevisionsCount = revisions.length;
|
|
118
|
+
if (fetchedRevisionsCount) {
|
|
119
|
+
if (_modifiedRevisions[0].id !== "unsaved" && _query.page === 1) {
|
|
120
|
+
_modifiedRevisions[0].isLatest = true;
|
|
121
|
+
}
|
|
122
|
+
if (isDirty && userConfig && Object.keys(userConfig).length > 0 && currentUser && _query.page === 1) {
|
|
123
|
+
const unsavedRevision = {
|
|
124
|
+
id: "unsaved",
|
|
125
|
+
styles: userConfig?.styles,
|
|
126
|
+
settings: userConfig?.settings,
|
|
127
|
+
_links: userConfig?._links,
|
|
128
|
+
author: {
|
|
129
|
+
name: currentUser?.name || "",
|
|
130
|
+
// @ts-expect-error - avatar_urls is not typed in User
|
|
131
|
+
avatar_urls: currentUser?.avatar_urls || {}
|
|
132
|
+
},
|
|
133
|
+
modified: /* @__PURE__ */ new Date()
|
|
134
|
+
};
|
|
135
|
+
_modifiedRevisions.unshift(unsavedRevision);
|
|
136
|
+
}
|
|
137
|
+
if (_query.per_page && _query.page === Math.ceil(revisionsCount / _query.per_page)) {
|
|
138
|
+
_modifiedRevisions.push({
|
|
139
|
+
id: "parent",
|
|
140
|
+
styles: {},
|
|
141
|
+
settings: {}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
revisions: _modifiedRevisions,
|
|
147
|
+
hasUnsavedChanges: isDirty,
|
|
148
|
+
isLoading: false,
|
|
149
|
+
revisionsCount
|
|
150
|
+
};
|
|
151
|
+
}, [
|
|
152
|
+
isDirty,
|
|
153
|
+
revisions,
|
|
154
|
+
currentUser,
|
|
155
|
+
authors,
|
|
156
|
+
userConfig,
|
|
157
|
+
isLoadingGlobalStylesRevisions,
|
|
158
|
+
revisionsCount,
|
|
159
|
+
_query.page,
|
|
160
|
+
_query.per_page
|
|
161
|
+
]);
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=use-global-styles-revisions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/screen-revisions/use-global-styles-revisions.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\ttype GlobalStylesRevision,\n} from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { GlobalStylesContext } from '../context';\nimport type { Revision, User } from './types';\n\ninterface RawRevision extends Omit< Revision, 'author' > {\n\tauthor?: number;\n}\n\ninterface Query {\n\tper_page?: number;\n\tpage?: number;\n}\n\ninterface UseGlobalStylesRevisionsParams {\n\tquery?: Query;\n}\n\ninterface UseGlobalStylesRevisionsReturn {\n\trevisions: Revision[];\n\thasUnsavedChanges: boolean;\n\tisLoading: boolean;\n\trevisionsCount: number;\n}\n\nconst SITE_EDITOR_AUTHORS_QUERY = {\n\tper_page: -1,\n\t_fields: 'id,name,avatar_urls',\n\tcontext: 'view',\n\tcapabilities: [ 'edit_theme_options' ],\n};\nconst DEFAULT_QUERY = { per_page: 100, page: 1 };\nconst EMPTY_ARRAY: RawRevision[] = [];\n\nexport default function useGlobalStylesRevisions( {\n\tquery,\n}: UseGlobalStylesRevisionsParams = {} ): UseGlobalStylesRevisionsReturn {\n\tconst { user: userConfig } = useContext( GlobalStylesContext );\n\tconst _query: Query = useMemo(\n\t\t() => ( { ...DEFAULT_QUERY, ...query } ),\n\t\t[ query ]\n\t);\n\tconst {\n\t\tauthors,\n\t\tcurrentUser,\n\t\tisDirty,\n\t\trevisions,\n\t\tisLoadingGlobalStylesRevisions,\n\t\trevisionsCount,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetCurrentUser,\n\t\t\t\tgetUsers,\n\t\t\t\tgetRevisions,\n\t\t\t\t__experimentalGetCurrentGlobalStylesId,\n\t\t\t\tgetEntityRecord,\n\t\t\t\t// @ts-expect-error\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords =\n\t\t\t\t__experimentalGetDirtyEntityRecords() || [];\n\t\t\tconst _currentUser = getCurrentUser();\n\t\t\tconst _isDirty = dirtyEntityRecords.length > 0;\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord< GlobalStylesRevision >(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\tglobalStylesId\n\t\t\t\t )\n\t\t\t\t: undefined;\n\t\t\tconst _revisionsCount: number =\n\t\t\t\t// @ts-expect-error - _links is not typed in GlobalStylesRevision\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;\n\t\t\t// @ts-expect-error - getRevisions is not fully typed\n\t\t\tconst globalStylesRevisions: RawRevision[] = globalStylesId\n\t\t\t\t? getRevisions(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\tglobalStylesId,\n\t\t\t\t\t\t_query\n\t\t\t\t ) || EMPTY_ARRAY\n\t\t\t\t: EMPTY_ARRAY;\n\t\t\t// @ts-expect-error - getUsers is not fully typed\n\t\t\tconst _authors: User[] =\n\t\t\t\tgetUsers( SITE_EDITOR_AUTHORS_QUERY ) || [];\n\t\t\tconst _isResolving = globalStylesId\n\t\t\t\t? isResolving( 'getRevisions', [\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\tglobalStylesId,\n\t\t\t\t\t\t_query,\n\t\t\t\t ] )\n\t\t\t\t: false;\n\t\t\treturn {\n\t\t\t\tauthors: _authors,\n\t\t\t\tcurrentUser: _currentUser,\n\t\t\t\tisDirty: _isDirty,\n\t\t\t\trevisions: globalStylesRevisions,\n\t\t\t\tisLoadingGlobalStylesRevisions: _isResolving,\n\t\t\t\trevisionsCount: _revisionsCount,\n\t\t\t};\n\t\t},\n\t\t[ _query ]\n\t);\n\treturn useMemo( (): UseGlobalStylesRevisionsReturn => {\n\t\tif ( ! authors.length || isLoadingGlobalStylesRevisions ) {\n\t\t\treturn {\n\t\t\t\trevisions: EMPTY_ARRAY as Revision[],\n\t\t\t\thasUnsavedChanges: isDirty,\n\t\t\t\tisLoading: true,\n\t\t\t\trevisionsCount,\n\t\t\t};\n\t\t}\n\n\t\t// Adds author details to each revision.\n\t\tconst _modifiedRevisions: Revision[] = revisions.map( ( revision ) => {\n\t\t\treturn {\n\t\t\t\t...revision,\n\t\t\t\tauthor: authors.find(\n\t\t\t\t\t( author ) => author.id === revision.author\n\t\t\t\t),\n\t\t\t};\n\t\t} );\n\n\t\tconst fetchedRevisionsCount = revisions.length;\n\n\t\tif ( fetchedRevisionsCount ) {\n\t\t\t// Flags the most current saved revision.\n\t\t\tif (\n\t\t\t\t_modifiedRevisions[ 0 ].id !== 'unsaved' &&\n\t\t\t\t_query.page === 1\n\t\t\t) {\n\t\t\t\t_modifiedRevisions[ 0 ].isLatest = true;\n\t\t\t}\n\n\t\t\t// Adds an item for unsaved changes.\n\t\t\tif (\n\t\t\t\tisDirty &&\n\t\t\t\tuserConfig &&\n\t\t\t\tObject.keys( userConfig ).length > 0 &&\n\t\t\t\tcurrentUser &&\n\t\t\t\t_query.page === 1\n\t\t\t) {\n\t\t\t\tconst unsavedRevision: Revision = {\n\t\t\t\t\tid: 'unsaved',\n\t\t\t\t\tstyles: userConfig?.styles,\n\t\t\t\t\tsettings: userConfig?.settings,\n\t\t\t\t\t_links: userConfig?._links,\n\t\t\t\t\tauthor: {\n\t\t\t\t\t\tname: currentUser?.name || '',\n\t\t\t\t\t\t// @ts-expect-error - avatar_urls is not typed in User\n\t\t\t\t\t\tavatar_urls: currentUser?.avatar_urls || {},\n\t\t\t\t\t},\n\t\t\t\t\tmodified: new Date(),\n\t\t\t\t};\n\n\t\t\t\t_modifiedRevisions.unshift( unsavedRevision );\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t_query.per_page &&\n\t\t\t\t_query.page === Math.ceil( revisionsCount / _query.per_page )\n\t\t\t) {\n\t\t\t\t// Adds an item for the default theme styles.\n\t\t\t\t_modifiedRevisions.push( {\n\t\t\t\t\tid: 'parent',\n\t\t\t\t\tstyles: {},\n\t\t\t\t\tsettings: {},\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trevisions: _modifiedRevisions,\n\t\t\thasUnsavedChanges: isDirty,\n\t\t\tisLoading: false,\n\t\t\trevisionsCount,\n\t\t};\n\t}, [\n\t\tisDirty,\n\t\trevisions,\n\t\tcurrentUser,\n\t\tauthors,\n\t\tuserConfig,\n\t\tisLoadingGlobalStylesRevisions,\n\t\trevisionsCount,\n\t\t_query.page,\n\t\t_query.per_page,\n\t] );\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["coreStore"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var screen_root_exports = {};
|
|
30
|
+
__export(screen_root_exports, {
|
|
31
|
+
default: () => screen_root_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(screen_root_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_components = require("@wordpress/components");
|
|
36
|
+
var import_i18n = require("@wordpress/i18n");
|
|
37
|
+
var import_icons = require("@wordpress/icons");
|
|
38
|
+
var import_data = require("@wordpress/data");
|
|
39
|
+
var import_core_data = require("@wordpress/core-data");
|
|
40
|
+
var import_icon_with_current_color = require("./icon-with-current-color");
|
|
41
|
+
var import_navigation_button = require("./navigation-button");
|
|
42
|
+
var import_root_menu = __toESM(require("./root-menu"));
|
|
43
|
+
var import_preview_styles = __toESM(require("./preview-styles"));
|
|
44
|
+
function ScreenRoot() {
|
|
45
|
+
const { hasVariations, canEditCSS } = (0, import_data.useSelect)((select) => {
|
|
46
|
+
const {
|
|
47
|
+
__experimentalGetCurrentThemeGlobalStylesVariations,
|
|
48
|
+
__experimentalGetCurrentGlobalStylesId,
|
|
49
|
+
getEntityRecord
|
|
50
|
+
} = select(import_core_data.store);
|
|
51
|
+
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
52
|
+
const globalStyles = globalStylesId ? getEntityRecord("root", "globalStyles", globalStylesId) : void 0;
|
|
53
|
+
return {
|
|
54
|
+
hasVariations: !!__experimentalGetCurrentThemeGlobalStylesVariations()?.length,
|
|
55
|
+
canEditCSS: !!globalStyles?._links?.["wp:action-edit-css"]
|
|
56
|
+
};
|
|
57
|
+
}, []);
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
59
|
+
import_components.Card,
|
|
60
|
+
{
|
|
61
|
+
size: "small",
|
|
62
|
+
isBorderless: true,
|
|
63
|
+
className: "global-styles-ui-screen-root",
|
|
64
|
+
isRounded: false,
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 4, children: [
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Card, { className: "global-styles-ui-screen-root__active-style-tile", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.CardMedia, { className: "global-styles-ui-screen-root__active-style-tile-preview", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_preview_styles.default, {}) }) }),
|
|
68
|
+
hasVariations && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalItemGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_button.NavigationButtonAsItem, { path: "/variations", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "space-between", children: [
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { children: (0, import_i18n.__)("Browse styles") }),
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
+
import_icon_with_current_color.IconWithCurrentColor,
|
|
72
|
+
{
|
|
73
|
+
icon: (0, import_i18n.isRTL)() ? import_icons.chevronLeft : import_icons.chevronRight
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] }) }) }),
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_root_menu.default, {})
|
|
78
|
+
] }) }),
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.CardDivider, {}),
|
|
80
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.CardBody, { children: [
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
82
|
+
import_components.__experimentalSpacer,
|
|
83
|
+
{
|
|
84
|
+
as: "p",
|
|
85
|
+
paddingTop: 2,
|
|
86
|
+
paddingX: "13px",
|
|
87
|
+
marginBottom: 4,
|
|
88
|
+
children: (0, import_i18n.__)(
|
|
89
|
+
"Customize the appearance of specific blocks for the whole site."
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalItemGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_button.NavigationButtonAsItem, { path: "/blocks", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "space-between", children: [
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { children: (0, import_i18n.__)("Blocks") }),
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
import_icon_with_current_color.IconWithCurrentColor,
|
|
97
|
+
{
|
|
98
|
+
icon: (0, import_i18n.isRTL)() ? import_icons.chevronLeft : import_icons.chevronRight
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
] }) }) })
|
|
102
|
+
] }),
|
|
103
|
+
canEditCSS && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.CardDivider, {}),
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.CardBody, { children: [
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
107
|
+
import_components.__experimentalSpacer,
|
|
108
|
+
{
|
|
109
|
+
as: "p",
|
|
110
|
+
paddingTop: 2,
|
|
111
|
+
paddingX: "13px",
|
|
112
|
+
marginBottom: 4,
|
|
113
|
+
children: (0, import_i18n.__)(
|
|
114
|
+
"Add your own CSS to customize the appearance and layout of your site."
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalItemGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_navigation_button.NavigationButtonAsItem, { path: "/css", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "space-between", children: [
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { children: (0, import_i18n.__)("Additional CSS") }),
|
|
120
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
121
|
+
import_icon_with_current_color.IconWithCurrentColor,
|
|
122
|
+
{
|
|
123
|
+
icon: (0, import_i18n.isRTL)() ? import_icons.chevronLeft : import_icons.chevronRight
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
] }) }) })
|
|
127
|
+
] })
|
|
128
|
+
] })
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
var screen_root_default = ScreenRoot;
|
|
134
|
+
//# sourceMappingURL=screen-root.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/screen-root.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tCardBody,\n\tCard,\n\tCardDivider,\n\tCardMedia,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { GlobalStylesConfig } from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport { IconWithCurrentColor } from './icon-with-current-color';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport RootMenu from './root-menu';\nimport PreviewStyles from './preview-styles';\n\nfunction ScreenRoot() {\n\tconst { hasVariations, canEditCSS } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetCurrentThemeGlobalStylesVariations,\n\t\t\t__experimentalGetCurrentGlobalStylesId,\n\t\t\tgetEntityRecord,\n\t\t} = select( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\thasVariations:\n\t\t\t\t!! __experimentalGetCurrentThemeGlobalStylesVariations()\n\t\t\t\t\t?.length,\n\t\t\tcanEditCSS: !! ( globalStyles as GlobalStylesConfig )?._links?.[\n\t\t\t\t'wp:action-edit-css'\n\t\t\t],\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Card\n\t\t\tsize=\"small\"\n\t\t\tisBorderless\n\t\t\tclassName=\"global-styles-ui-screen-root\"\n\t\t\tisRounded={ false }\n\t\t>\n\t\t\t<CardBody>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<Card className=\"global-styles-ui-screen-root__active-style-tile\">\n\t\t\t\t\t\t<CardMedia className=\"global-styles-ui-screen-root__active-style-tile-preview\">\n\t\t\t\t\t\t\t<PreviewStyles />\n\t\t\t\t\t\t</CardMedia>\n\t\t\t\t\t</Card>\n\t\t\t\t\t{ hasVariations && (\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem path=\"/variations\">\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t<RootMenu />\n\t\t\t\t</VStack>\n\t\t\t</CardBody>\n\n\t\t\t<CardDivider />\n\n\t\t\t<CardBody>\n\t\t\t\t<Spacer\n\t\t\t\t\tas=\"p\"\n\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t) }\n\t\t\t\t</Spacer>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<NavigationButtonAsItem path=\"/blocks\">\n\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Blocks' ) }</FlexItem>\n\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronLeft : chevronRight }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t</ItemGroup>\n\t\t\t</CardBody>\n\n\t\t\t{ canEditCSS && (\n\t\t\t\t<>\n\t\t\t\t\t<CardDivider />\n\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t<Spacer\n\t\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Add your own CSS to customize the appearance and layout of your site.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem path=\"/css\">\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</CardBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Card>\n\t);\n}\n\nexport default ScreenRoot;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8DO;AA3DP,wBAUO;AACP,kBAA0B;AAC1B,mBAA0C;AAC1C,kBAA0B;AAC1B,uBAAmC;AAMnC,qCAAqC;AACrC,+BAAuC;AACvC,uBAAqB;AACrB,4BAA0B;AAE1B,SAAS,aAAa;AACrB,QAAM,EAAE,eAAe,WAAW,QAAI,uBAAW,CAAE,WAAY;AAC9D,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI,OAAQ,iBAAAA,KAAU;AAEtB,UAAM,iBAAiB,uCAAuC;AAC9D,UAAM,eAAe,iBAClB,gBAAiB,QAAQ,gBAAgB,cAAe,IACxD;AAEH,WAAO;AAAA,MACN,eACC,CAAC,CAAE,oDAAoD,GACpD;AAAA,MACJ,YAAY,CAAC,CAAI,cAAsC,SACtD,oBACD;AAAA,IACD;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,cAAY;AAAA,MACZ,WAAU;AAAA,MACV,WAAY;AAAA,MAEZ;AAAA,oDAAC,8BACA,uDAAC,kBAAAC,sBAAA,EAAO,SAAU,GACjB;AAAA,sDAAC,0BAAK,WAAU,mDACf,sDAAC,+BAAU,WAAU,2DACpB,sDAAC,sBAAAC,SAAA,EAAc,GAChB,GACD;AAAA,UACE,iBACD,4CAAC,kBAAAC,yBAAA,EACA,sDAAC,mDAAuB,MAAK,eAC5B,uDAAC,kBAAAC,sBAAA,EAAO,SAAQ,iBACf;AAAA,wDAAC,8BACE,8BAAI,eAAgB,GACvB;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACA,UACC,mBAAM,IAAI,2BAAc;AAAA;AAAA,YAE1B;AAAA,aACD,GACD,GACD;AAAA,UAED,4CAAC,iBAAAC,SAAA,EAAS;AAAA,WACX,GACD;AAAA,QAEA,4CAAC,iCAAY;AAAA,QAEb,6CAAC,8BACA;AAAA;AAAA,YAAC,kBAAAC;AAAA,YAAA;AAAA,cACA,IAAG;AAAA,cACH,YAAa;AAAA,cACb,UAAS;AAAA,cACT,cAAe;AAAA,cAEb;AAAA,gBACD;AAAA,cACD;AAAA;AAAA,UACD;AAAA,UACA,4CAAC,kBAAAH,yBAAA,EACA,sDAAC,mDAAuB,MAAK,WAC5B,uDAAC,kBAAAC,sBAAA,EAAO,SAAQ,iBACf;AAAA,wDAAC,8BAAW,8BAAI,QAAS,GAAG;AAAA,YAC5B;AAAA,cAAC;AAAA;AAAA,gBACA,UAAO,mBAAM,IAAI,2BAAc;AAAA;AAAA,YAChC;AAAA,aACD,GACD,GACD;AAAA,WACD;AAAA,QAEE,cACD,4EACC;AAAA,sDAAC,iCAAY;AAAA,UACb,6CAAC,8BACA;AAAA;AAAA,cAAC,kBAAAE;AAAA,cAAA;AAAA,gBACA,IAAG;AAAA,gBACH,YAAa;AAAA,gBACb,UAAS;AAAA,gBACT,cAAe;AAAA,gBAEb;AAAA,kBACD;AAAA,gBACD;AAAA;AAAA,YACD;AAAA,YACA,4CAAC,kBAAAH,yBAAA,EACA,sDAAC,mDAAuB,MAAK,QAC5B,uDAAC,kBAAAC,sBAAA,EAAO,SAAQ,iBACf;AAAA,0DAAC,8BACE,8BAAI,gBAAiB,GACxB;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACA,UACC,mBAAM,IAAI,2BAAc;AAAA;AAAA,cAE1B;AAAA,eACD,GACD,GACD;AAAA,aACD;AAAA,WACD;AAAA;AAAA;AAAA,EAEF;AAEF;AAEA,IAAO,sBAAQ;",
|
|
6
|
+
"names": ["coreStore", "VStack", "PreviewStyles", "ItemGroup", "HStack", "RootMenu", "Spacer"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var screen_shadows_exports = {};
|
|
30
|
+
__export(screen_shadows_exports, {
|
|
31
|
+
ScreenShadows: () => ScreenShadows,
|
|
32
|
+
ScreenShadowsEdit: () => ScreenShadowsEdit
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(screen_shadows_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_shadows_panel = __toESM(require("./shadows-panel"));
|
|
37
|
+
var import_shadows_edit_panel = __toESM(require("./shadows-edit-panel"));
|
|
38
|
+
function ScreenShadows() {
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_shadows_panel.default, {});
|
|
40
|
+
}
|
|
41
|
+
function ScreenShadowsEdit() {
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_shadows_edit_panel.default, {});
|
|
43
|
+
}
|
|
44
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
+
0 && (module.exports = {
|
|
46
|
+
ScreenShadows,
|
|
47
|
+
ScreenShadowsEdit
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=screen-shadows.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/screen-shadows.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport ShadowsPanel from './shadows-panel';\nimport ShadowsEditPanel from './shadows-edit-panel';\n\nexport function ScreenShadows() {\n\treturn <ShadowsPanel />;\n}\n\nexport function ScreenShadowsEdit() {\n\treturn <ShadowsEditPanel />;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOQ;AAJR,2BAAyB;AACzB,gCAA6B;AAEtB,SAAS,gBAAgB;AAC/B,SAAO,4CAAC,qBAAAA,SAAA,EAAa;AACtB;AAEO,SAAS,oBAAoB;AACnC,SAAO,4CAAC,0BAAAC,SAAA,EAAiB;AAC1B;",
|
|
6
|
+
"names": ["ShadowsPanel", "ShadowsEditPanel"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var screen_style_variations_exports = {};
|
|
20
|
+
__export(screen_style_variations_exports, {
|
|
21
|
+
default: () => screen_style_variations_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(screen_style_variations_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_components = require("@wordpress/components");
|
|
26
|
+
var import_i18n = require("@wordpress/i18n");
|
|
27
|
+
var import_screen_header = require("./screen-header");
|
|
28
|
+
var import_style_variations_content = require("./style-variations-content");
|
|
29
|
+
function ScreenStyleVariations() {
|
|
30
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
31
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
32
|
+
import_screen_header.ScreenHeader,
|
|
33
|
+
{
|
|
34
|
+
title: (0, import_i18n.__)("Browse styles"),
|
|
35
|
+
description: (0, import_i18n.__)(
|
|
36
|
+
"Choose a variation to change the look of the site."
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
import_components.Card,
|
|
42
|
+
{
|
|
43
|
+
size: "small",
|
|
44
|
+
isBorderless: true,
|
|
45
|
+
className: "global-styles-ui-screen-style-variations",
|
|
46
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_style_variations_content.StyleVariationsContent, {}) })
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] });
|
|
50
|
+
}
|
|
51
|
+
var screen_style_variations_default = ScreenStyleVariations;
|
|
52
|
+
//# sourceMappingURL=screen-style-variations.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/screen-style-variations.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Card, CardBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { ScreenHeader } from './screen-header';\nimport { StyleVariationsContent } from './style-variations-content';\n\nfunction ScreenStyleVariations() {\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Browse styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a variation to change the look of the site.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<Card\n\t\t\t\tsize=\"small\"\n\t\t\t\tisBorderless\n\t\t\t\tclassName=\"global-styles-ui-screen-style-variations\"\n\t\t\t>\n\t\t\t\t<CardBody>\n\t\t\t\t\t<StyleVariationsContent />\n\t\t\t\t</CardBody>\n\t\t\t</Card>\n\t\t</>\n\t);\n}\n\nexport default ScreenStyleVariations;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcE;AAXF,wBAA+B;AAC/B,kBAAmB;AAKnB,2BAA6B;AAC7B,sCAAuC;AAEvC,SAAS,wBAAwB;AAChC,SACC,4EACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,WAAQ,gBAAI,eAAgB;AAAA,QAC5B,iBAAc;AAAA,UACb;AAAA,QACD;AAAA;AAAA,IACD;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,WAAU;AAAA,QAEV,sDAAC,8BACA,sDAAC,0DAAuB,GACzB;AAAA;AAAA,IACD;AAAA,KACD;AAEF;AAEA,IAAO,kCAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var screen_typography_element_exports = {};
|
|
30
|
+
__export(screen_typography_element_exports, {
|
|
31
|
+
default: () => screen_typography_element_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(screen_typography_element_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_i18n = require("@wordpress/i18n");
|
|
36
|
+
var import_components = require("@wordpress/components");
|
|
37
|
+
var import_element = require("@wordpress/element");
|
|
38
|
+
var import_typography_panel = __toESM(require("./typography-panel"));
|
|
39
|
+
var import_screen_header = require("./screen-header");
|
|
40
|
+
var import_typography_preview = __toESM(require("./typography-preview"));
|
|
41
|
+
const elements = {
|
|
42
|
+
text: {
|
|
43
|
+
description: (0, import_i18n.__)("Manage the fonts used on the site."),
|
|
44
|
+
title: (0, import_i18n.__)("Text")
|
|
45
|
+
},
|
|
46
|
+
link: {
|
|
47
|
+
description: (0, import_i18n.__)("Manage the fonts and typography used on the links."),
|
|
48
|
+
title: (0, import_i18n.__)("Links")
|
|
49
|
+
},
|
|
50
|
+
heading: {
|
|
51
|
+
description: (0, import_i18n.__)("Manage the fonts and typography used on headings."),
|
|
52
|
+
title: (0, import_i18n.__)("Headings")
|
|
53
|
+
},
|
|
54
|
+
caption: {
|
|
55
|
+
description: (0, import_i18n.__)("Manage the fonts and typography used on captions."),
|
|
56
|
+
title: (0, import_i18n.__)("Captions")
|
|
57
|
+
},
|
|
58
|
+
button: {
|
|
59
|
+
description: (0, import_i18n.__)("Manage the fonts and typography used on buttons."),
|
|
60
|
+
title: (0, import_i18n.__)("Buttons")
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
function ScreenTypographyElement({ element }) {
|
|
64
|
+
const [headingLevel, setHeadingLevel] = (0, import_element.useState)("heading");
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
|
+
import_screen_header.ScreenHeader,
|
|
68
|
+
{
|
|
69
|
+
title: elements[element].title,
|
|
70
|
+
description: elements[element].description
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalSpacer, { marginX: 4, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
import_typography_preview.default,
|
|
75
|
+
{
|
|
76
|
+
element,
|
|
77
|
+
headingLevel
|
|
78
|
+
}
|
|
79
|
+
) }),
|
|
80
|
+
element === "heading" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalSpacer, { marginX: 4, marginBottom: "1em", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
81
|
+
import_components.__experimentalToggleGroupControl,
|
|
82
|
+
{
|
|
83
|
+
label: (0, import_i18n.__)("Select heading level"),
|
|
84
|
+
hideLabelFromVision: true,
|
|
85
|
+
value: headingLevel,
|
|
86
|
+
onChange: (value) => setHeadingLevel(value),
|
|
87
|
+
isBlock: true,
|
|
88
|
+
size: "__unstable-large",
|
|
89
|
+
__nextHasNoMarginBottom: true,
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
|
+
import_components.__experimentalToggleGroupControlOption,
|
|
93
|
+
{
|
|
94
|
+
value: "heading",
|
|
95
|
+
showTooltip: true,
|
|
96
|
+
"aria-label": (0, import_i18n.__)("All headings"),
|
|
97
|
+
label: (0, import_i18n._x)("All", "heading levels")
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
101
|
+
import_components.__experimentalToggleGroupControlOption,
|
|
102
|
+
{
|
|
103
|
+
value: "h1",
|
|
104
|
+
showTooltip: true,
|
|
105
|
+
"aria-label": (0, import_i18n.__)("Heading 1"),
|
|
106
|
+
label: (0, import_i18n.__)("H1")
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
import_components.__experimentalToggleGroupControlOption,
|
|
111
|
+
{
|
|
112
|
+
value: "h2",
|
|
113
|
+
showTooltip: true,
|
|
114
|
+
"aria-label": (0, import_i18n.__)("Heading 2"),
|
|
115
|
+
label: (0, import_i18n.__)("H2")
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
119
|
+
import_components.__experimentalToggleGroupControlOption,
|
|
120
|
+
{
|
|
121
|
+
value: "h3",
|
|
122
|
+
showTooltip: true,
|
|
123
|
+
"aria-label": (0, import_i18n.__)("Heading 3"),
|
|
124
|
+
label: (0, import_i18n.__)("H3")
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
128
|
+
import_components.__experimentalToggleGroupControlOption,
|
|
129
|
+
{
|
|
130
|
+
value: "h4",
|
|
131
|
+
showTooltip: true,
|
|
132
|
+
"aria-label": (0, import_i18n.__)("Heading 4"),
|
|
133
|
+
label: (0, import_i18n.__)("H4")
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
+
import_components.__experimentalToggleGroupControlOption,
|
|
138
|
+
{
|
|
139
|
+
value: "h5",
|
|
140
|
+
showTooltip: true,
|
|
141
|
+
"aria-label": (0, import_i18n.__)("Heading 5"),
|
|
142
|
+
label: (0, import_i18n.__)("H5")
|
|
143
|
+
}
|
|
144
|
+
),
|
|
145
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
146
|
+
import_components.__experimentalToggleGroupControlOption,
|
|
147
|
+
{
|
|
148
|
+
value: "h6",
|
|
149
|
+
showTooltip: true,
|
|
150
|
+
"aria-label": (0, import_i18n.__)("Heading 6"),
|
|
151
|
+
label: (0, import_i18n.__)("H6")
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
) }),
|
|
157
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
158
|
+
import_typography_panel.default,
|
|
159
|
+
{
|
|
160
|
+
element,
|
|
161
|
+
headingLevel
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
] });
|
|
165
|
+
}
|
|
166
|
+
var screen_typography_element_default = ScreenTypographyElement;
|
|
167
|
+
//# sourceMappingURL=screen-typography-element.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/screen-typography-element.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TypographyPanel from './typography-panel';\nimport { ScreenHeader } from './screen-header';\nimport TypographyPreview from './typography-preview';\n\nconst elements = {\n\ttext: {\n\t\tdescription: __( 'Manage the fonts used on the site.' ),\n\t\ttitle: __( 'Text' ),\n\t},\n\tlink: {\n\t\tdescription: __( 'Manage the fonts and typography used on the links.' ),\n\t\ttitle: __( 'Links' ),\n\t},\n\theading: {\n\t\tdescription: __( 'Manage the fonts and typography used on headings.' ),\n\t\ttitle: __( 'Headings' ),\n\t},\n\tcaption: {\n\t\tdescription: __( 'Manage the fonts and typography used on captions.' ),\n\t\ttitle: __( 'Captions' ),\n\t},\n\tbutton: {\n\t\tdescription: __( 'Manage the fonts and typography used on buttons.' ),\n\t\ttitle: __( 'Buttons' ),\n\t},\n};\n\ninterface ScreenTypographyElementProps {\n\telement: keyof typeof elements;\n}\n\nfunction ScreenTypographyElement( { element }: ScreenTypographyElementProps ) {\n\tconst [ headingLevel, setHeadingLevel ] = useState( 'heading' );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ elements[ element ].title }\n\t\t\t\tdescription={ elements[ element ].description }\n\t\t\t/>\n\t\t\t<Spacer marginX={ 4 }>\n\t\t\t\t<TypographyPreview\n\t\t\t\t\telement={ element }\n\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t/>\n\t\t\t</Spacer>\n\t\t\t{ element === 'heading' && (\n\t\t\t\t<Spacer marginX={ 4 } marginBottom=\"1em\">\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Select heading level' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tvalue={ headingLevel }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetHeadingLevel( value as string )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"heading\"\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\taria-label={ __( 'All headings' ) }\n\t\t\t\t\t\t\tlabel={ _x( 'All', 'heading levels' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h1\"\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\taria-label={ __( 'Heading 1' ) }\n\t\t\t\t\t\t\tlabel={ __( 'H1' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h2\"\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\taria-label={ __( 'Heading 2' ) }\n\t\t\t\t\t\t\tlabel={ __( 'H2' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h3\"\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\taria-label={ __( 'Heading 3' ) }\n\t\t\t\t\t\t\tlabel={ __( 'H3' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h4\"\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\taria-label={ __( 'Heading 4' ) }\n\t\t\t\t\t\t\tlabel={ __( 'H4' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h5\"\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\taria-label={ __( 'Heading 5' ) }\n\t\t\t\t\t\t\tlabel={ __( 'H5' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h6\"\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\taria-label={ __( 'Heading 6' ) }\n\t\t\t\t\t\t\tlabel={ __( 'H6' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</Spacer>\n\t\t\t) }\n\t\t\t<TypographyPanel\n\t\t\t\telement={ element }\n\t\t\t\theadingLevel={ headingLevel }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypographyElement;\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Spacer", "TypographyPreview", "ToggleGroupControl", "ToggleGroupControlOption", "TypographyPanel"]
|
|
7
|
+
}
|