@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,193 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {
|
|
3
|
+
__experimentalHStack as HStack,
|
|
4
|
+
__experimentalVStack as VStack,
|
|
5
|
+
__unstableMotion as motion
|
|
6
|
+
} from "@wordpress/components";
|
|
7
|
+
import { useStyle } from "./hooks";
|
|
8
|
+
import { useStylesPreviewColors } from "./preview-hooks";
|
|
9
|
+
import TypographyExample from "./typography-example";
|
|
10
|
+
import HighlightedColors from "./highlighted-colors";
|
|
11
|
+
import PreviewWrapper from "./preview-wrapper";
|
|
12
|
+
const firstFrameVariants = {
|
|
13
|
+
start: {
|
|
14
|
+
scale: 1,
|
|
15
|
+
opacity: 1
|
|
16
|
+
},
|
|
17
|
+
hover: {
|
|
18
|
+
scale: 0,
|
|
19
|
+
opacity: 0
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const midFrameVariants = {
|
|
23
|
+
hover: {
|
|
24
|
+
opacity: 1
|
|
25
|
+
},
|
|
26
|
+
start: {
|
|
27
|
+
opacity: 0.5
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const secondFrameVariants = {
|
|
31
|
+
hover: {
|
|
32
|
+
scale: 1,
|
|
33
|
+
opacity: 1
|
|
34
|
+
},
|
|
35
|
+
start: {
|
|
36
|
+
scale: 0,
|
|
37
|
+
opacity: 0
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
function PreviewStyles({
|
|
41
|
+
label,
|
|
42
|
+
isFocused,
|
|
43
|
+
withHoverView,
|
|
44
|
+
variation
|
|
45
|
+
}) {
|
|
46
|
+
const [fontWeight] = useStyle("typography.fontWeight");
|
|
47
|
+
const [fontFamily = "serif"] = useStyle(
|
|
48
|
+
"typography.fontFamily"
|
|
49
|
+
);
|
|
50
|
+
const [headingFontFamily = fontFamily] = useStyle(
|
|
51
|
+
"elements.h1.typography.fontFamily"
|
|
52
|
+
);
|
|
53
|
+
const [headingFontWeight = fontWeight] = useStyle(
|
|
54
|
+
"elements.h1.typography.fontWeight"
|
|
55
|
+
);
|
|
56
|
+
const [textColor = "black"] = useStyle("color.text");
|
|
57
|
+
const [headingColor = textColor] = useStyle(
|
|
58
|
+
"elements.h1.color.text"
|
|
59
|
+
);
|
|
60
|
+
const { paletteColors } = useStylesPreviewColors();
|
|
61
|
+
return /* @__PURE__ */ jsxs(
|
|
62
|
+
PreviewWrapper,
|
|
63
|
+
{
|
|
64
|
+
label,
|
|
65
|
+
isFocused,
|
|
66
|
+
withHoverView,
|
|
67
|
+
children: [
|
|
68
|
+
({ ratio, key }) => /* @__PURE__ */ jsx(
|
|
69
|
+
motion.div,
|
|
70
|
+
{
|
|
71
|
+
variants: firstFrameVariants,
|
|
72
|
+
style: {
|
|
73
|
+
height: "100%",
|
|
74
|
+
overflow: "hidden"
|
|
75
|
+
},
|
|
76
|
+
children: /* @__PURE__ */ jsxs(
|
|
77
|
+
HStack,
|
|
78
|
+
{
|
|
79
|
+
spacing: 10 * ratio,
|
|
80
|
+
justify: "center",
|
|
81
|
+
style: {
|
|
82
|
+
height: "100%",
|
|
83
|
+
overflow: "hidden"
|
|
84
|
+
},
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsx(
|
|
87
|
+
TypographyExample,
|
|
88
|
+
{
|
|
89
|
+
fontSize: 65 * ratio,
|
|
90
|
+
variation
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ jsx(VStack, { spacing: 4 * ratio, children: /* @__PURE__ */ jsx(
|
|
94
|
+
HighlightedColors,
|
|
95
|
+
{
|
|
96
|
+
normalizedColorSwatchSize: 32,
|
|
97
|
+
ratio
|
|
98
|
+
}
|
|
99
|
+
) })
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
},
|
|
104
|
+
key
|
|
105
|
+
),
|
|
106
|
+
({ key }) => /* @__PURE__ */ jsx(
|
|
107
|
+
motion.div,
|
|
108
|
+
{
|
|
109
|
+
variants: withHoverView ? midFrameVariants : void 0,
|
|
110
|
+
style: {
|
|
111
|
+
height: "100%",
|
|
112
|
+
width: "100%",
|
|
113
|
+
position: "absolute",
|
|
114
|
+
top: 0,
|
|
115
|
+
overflow: "hidden",
|
|
116
|
+
filter: "blur(60px)",
|
|
117
|
+
opacity: 0.1
|
|
118
|
+
},
|
|
119
|
+
children: /* @__PURE__ */ jsx(
|
|
120
|
+
HStack,
|
|
121
|
+
{
|
|
122
|
+
spacing: 0,
|
|
123
|
+
justify: "flex-start",
|
|
124
|
+
style: {
|
|
125
|
+
height: "100%",
|
|
126
|
+
overflow: "hidden"
|
|
127
|
+
},
|
|
128
|
+
children: paletteColors.slice(0, 4).map(({ color }, index) => /* @__PURE__ */ jsx(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
style: {
|
|
132
|
+
height: "100%",
|
|
133
|
+
background: color,
|
|
134
|
+
flexGrow: 1
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
index
|
|
138
|
+
))
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
},
|
|
142
|
+
key
|
|
143
|
+
),
|
|
144
|
+
({ ratio, key }) => /* @__PURE__ */ jsx(
|
|
145
|
+
motion.div,
|
|
146
|
+
{
|
|
147
|
+
variants: secondFrameVariants,
|
|
148
|
+
style: {
|
|
149
|
+
height: "100%",
|
|
150
|
+
width: "100%",
|
|
151
|
+
overflow: "hidden",
|
|
152
|
+
position: "absolute",
|
|
153
|
+
top: 0
|
|
154
|
+
},
|
|
155
|
+
children: /* @__PURE__ */ jsx(
|
|
156
|
+
VStack,
|
|
157
|
+
{
|
|
158
|
+
spacing: 3 * ratio,
|
|
159
|
+
justify: "center",
|
|
160
|
+
style: {
|
|
161
|
+
height: "100%",
|
|
162
|
+
overflow: "hidden",
|
|
163
|
+
padding: 10 * ratio,
|
|
164
|
+
boxSizing: "border-box"
|
|
165
|
+
},
|
|
166
|
+
children: label && /* @__PURE__ */ jsx(
|
|
167
|
+
"div",
|
|
168
|
+
{
|
|
169
|
+
style: {
|
|
170
|
+
fontSize: 40 * ratio,
|
|
171
|
+
fontFamily: headingFontFamily,
|
|
172
|
+
color: headingColor,
|
|
173
|
+
fontWeight: headingFontWeight,
|
|
174
|
+
lineHeight: "1em",
|
|
175
|
+
textAlign: "center"
|
|
176
|
+
},
|
|
177
|
+
children: label
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
},
|
|
183
|
+
key
|
|
184
|
+
)
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
var preview_styles_default = PreviewStyles;
|
|
190
|
+
export {
|
|
191
|
+
preview_styles_default as default
|
|
192
|
+
};
|
|
193
|
+
//# sourceMappingURL=preview-styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/preview-styles.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useStyle } from './hooks';\nimport { useStylesPreviewColors } from './preview-hooks';\nimport TypographyExample from './typography-example';\nimport HighlightedColors from './highlighted-colors';\nimport PreviewWrapper from './preview-wrapper';\n\nconst firstFrameVariants = {\n\tstart: {\n\t\tscale: 1,\n\t\topacity: 1,\n\t},\n\thover: {\n\t\tscale: 0,\n\t\topacity: 0,\n\t},\n};\n\nconst midFrameVariants = {\n\thover: {\n\t\topacity: 1,\n\t},\n\tstart: {\n\t\topacity: 0.5,\n\t},\n};\n\nconst secondFrameVariants = {\n\thover: {\n\t\tscale: 1,\n\t\topacity: 1,\n\t},\n\tstart: {\n\t\tscale: 0,\n\t\topacity: 0,\n\t},\n};\n\ninterface PreviewStylesProps {\n\tlabel?: string;\n\tisFocused?: boolean;\n\twithHoverView?: boolean;\n\tvariation?: any;\n}\n\nfunction PreviewStyles( {\n\tlabel,\n\tisFocused,\n\twithHoverView,\n\tvariation,\n}: PreviewStylesProps ) {\n\tconst [ fontWeight ] = useStyle< string >( 'typography.fontWeight' );\n\tconst [ fontFamily = 'serif' ] = useStyle< string >(\n\t\t'typography.fontFamily'\n\t);\n\tconst [ headingFontFamily = fontFamily ] = useStyle< string >(\n\t\t'elements.h1.typography.fontFamily'\n\t);\n\tconst [ headingFontWeight = fontWeight ] = useStyle< string >(\n\t\t'elements.h1.typography.fontWeight'\n\t);\n\tconst [ textColor = 'black' ] = useStyle< string >( 'color.text' );\n\tconst [ headingColor = textColor ] = useStyle< string >(\n\t\t'elements.h1.color.text'\n\t);\n\n\tconst { paletteColors } = useStylesPreviewColors();\n\n\treturn (\n\t\t<PreviewWrapper\n\t\t\tlabel={ label }\n\t\t\tisFocused={ isFocused }\n\t\t\twithHoverView={ withHoverView }\n\t\t>\n\t\t\t{ ( { ratio, key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ firstFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tspacing={ 10 * ratio }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TypographyExample\n\t\t\t\t\t\t\tfontSize={ 65 * ratio }\n\t\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<VStack spacing={ 4 * ratio }>\n\t\t\t\t\t\t\t<HighlightedColors\n\t\t\t\t\t\t\t\tnormalizedColorSwatchSize={ 32 }\n\t\t\t\t\t\t\t\tratio={ ratio }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t\t{ ( { key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ withHoverView ? midFrameVariants : undefined }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\tfilter: 'blur(60px)',\n\t\t\t\t\t\topacity: 0.1,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ paletteColors\n\t\t\t\t\t\t\t.slice( 0, 4 )\n\t\t\t\t\t\t\t.map( ( { color }, index ) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\t\tbackground: color,\n\t\t\t\t\t\t\t\t\t\tflexGrow: 1,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t</HStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t\t{ ( { ratio, key } ) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tvariants={ secondFrameVariants }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing={ 3 * ratio }\n\t\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\t\tpadding: 10 * ratio,\n\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tfontSize: 40 * ratio,\n\t\t\t\t\t\t\t\t\tfontFamily: headingFontFamily,\n\t\t\t\t\t\t\t\t\tcolor: headingColor,\n\t\t\t\t\t\t\t\t\tfontWeight: headingFontWeight,\n\t\t\t\t\t\t\t\t\tlineHeight: '1em',\n\t\t\t\t\t\t\t\t\ttextAlign: 'center',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</motion.div>\n\t\t\t) }\n\t\t</PreviewWrapper>\n\t);\n}\n\nexport default PreviewStyles;\n"],
|
|
5
|
+
"mappings": "AA8FK,SAQC,KARD;AA3FL;AAAA,EACC,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,oBAAoB;AAAA,OACd;AAKP,SAAS,gBAAgB;AACzB,SAAS,8BAA8B;AACvC,OAAO,uBAAuB;AAC9B,OAAO,uBAAuB;AAC9B,OAAO,oBAAoB;AAE3B,MAAM,qBAAqB;AAAA,EAC1B,OAAO;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,EACV;AAAA,EACA,OAAO;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,EACV;AACD;AAEA,MAAM,mBAAmB;AAAA,EACxB,OAAO;AAAA,IACN,SAAS;AAAA,EACV;AAAA,EACA,OAAO;AAAA,IACN,SAAS;AAAA,EACV;AACD;AAEA,MAAM,sBAAsB;AAAA,EAC3B,OAAO;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,EACV;AAAA,EACA,OAAO;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,EACV;AACD;AASA,SAAS,cAAe;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAwB;AACvB,QAAM,CAAE,UAAW,IAAI,SAAoB,uBAAwB;AACnE,QAAM,CAAE,aAAa,OAAQ,IAAI;AAAA,IAChC;AAAA,EACD;AACA,QAAM,CAAE,oBAAoB,UAAW,IAAI;AAAA,IAC1C;AAAA,EACD;AACA,QAAM,CAAE,oBAAoB,UAAW,IAAI;AAAA,IAC1C;AAAA,EACD;AACA,QAAM,CAAE,YAAY,OAAQ,IAAI,SAAoB,YAAa;AACjE,QAAM,CAAE,eAAe,SAAU,IAAI;AAAA,IACpC;AAAA,EACD;AAEA,QAAM,EAAE,cAAc,IAAI,uBAAuB;AAEjD,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEE;AAAA,SAAE,EAAE,OAAO,IAAI,MAChB;AAAA,UAAC,OAAO;AAAA,UAAP;AAAA,YAEA,UAAW;AAAA,YACX,OAAQ;AAAA,cACP,QAAQ;AAAA,cACR,UAAU;AAAA,YACX;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACA,SAAU,KAAK;AAAA,gBACf,SAAQ;AAAA,gBACR,OAAQ;AAAA,kBACP,QAAQ;AAAA,kBACR,UAAU;AAAA,gBACX;AAAA,gBAEA;AAAA;AAAA,oBAAC;AAAA;AAAA,sBACA,UAAW,KAAK;AAAA,sBAChB;AAAA;AAAA,kBACD;AAAA,kBACA,oBAAC,UAAO,SAAU,IAAI,OACrB;AAAA,oBAAC;AAAA;AAAA,sBACA,2BAA4B;AAAA,sBAC5B;AAAA;AAAA,kBACD,GACD;AAAA;AAAA;AAAA,YACD;AAAA;AAAA,UAzBM;AAAA,QA0BP;AAAA,QAEC,CAAE,EAAE,IAAI,MACT;AAAA,UAAC,OAAO;AAAA,UAAP;AAAA,YAEA,UAAW,gBAAgB,mBAAmB;AAAA,YAC9C,OAAQ;AAAA,cACP,QAAQ;AAAA,cACR,OAAO;AAAA,cACP,UAAU;AAAA,cACV,KAAK;AAAA,cACL,UAAU;AAAA,cACV,QAAQ;AAAA,cACR,SAAS;AAAA,YACV;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACA,SAAU;AAAA,gBACV,SAAQ;AAAA,gBACR,OAAQ;AAAA,kBACP,QAAQ;AAAA,kBACR,UAAU;AAAA,gBACX;AAAA,gBAEE,wBACA,MAAO,GAAG,CAAE,EACZ,IAAK,CAAE,EAAE,MAAM,GAAG,UAClB;AAAA,kBAAC;AAAA;AAAA,oBAEA,OAAQ;AAAA,sBACP,QAAQ;AAAA,sBACR,YAAY;AAAA,sBACZ,UAAU;AAAA,oBACX;AAAA;AAAA,kBALM;AAAA,gBAMP,CACC;AAAA;AAAA,YACJ;AAAA;AAAA,UAhCM;AAAA,QAiCP;AAAA,QAEC,CAAE,EAAE,OAAO,IAAI,MAChB;AAAA,UAAC,OAAO;AAAA,UAAP;AAAA,YAEA,UAAW;AAAA,YACX,OAAQ;AAAA,cACP,QAAQ;AAAA,cACR,OAAO;AAAA,cACP,UAAU;AAAA,cACV,UAAU;AAAA,cACV,KAAK;AAAA,YACN;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACA,SAAU,IAAI;AAAA,gBACd,SAAQ;AAAA,gBACR,OAAQ;AAAA,kBACP,QAAQ;AAAA,kBACR,UAAU;AAAA,kBACV,SAAS,KAAK;AAAA,kBACd,WAAW;AAAA,gBACZ;AAAA,gBAEE,mBACD;AAAA,kBAAC;AAAA;AAAA,oBACA,OAAQ;AAAA,sBACP,UAAU,KAAK;AAAA,sBACf,YAAY;AAAA,sBACZ,OAAO;AAAA,sBACP,YAAY;AAAA,sBACZ,YAAY;AAAA,sBACZ,WAAW;AAAA,oBACZ;AAAA,oBAEE;AAAA;AAAA,gBACH;AAAA;AAAA,YAEF;AAAA;AAAA,UAlCM;AAAA,QAmCP;AAAA;AAAA;AAAA,EAEF;AAEF;AAEA,IAAO,yBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { __experimentalHStack as HStack } from "@wordpress/components";
|
|
3
|
+
import TypographyExample from "./typography-example";
|
|
4
|
+
import PreviewWrapper from "./preview-wrapper";
|
|
5
|
+
const StylesPreviewTypography = ({
|
|
6
|
+
variation,
|
|
7
|
+
isFocused,
|
|
8
|
+
withHoverView
|
|
9
|
+
}) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
PreviewWrapper,
|
|
12
|
+
{
|
|
13
|
+
label: variation.title,
|
|
14
|
+
isFocused,
|
|
15
|
+
withHoverView,
|
|
16
|
+
children: ({ ratio, key }) => /* @__PURE__ */ jsx(
|
|
17
|
+
HStack,
|
|
18
|
+
{
|
|
19
|
+
spacing: 10 * ratio,
|
|
20
|
+
justify: "center",
|
|
21
|
+
style: {
|
|
22
|
+
height: "100%",
|
|
23
|
+
overflow: "hidden"
|
|
24
|
+
},
|
|
25
|
+
children: /* @__PURE__ */ jsx(
|
|
26
|
+
TypographyExample,
|
|
27
|
+
{
|
|
28
|
+
variation,
|
|
29
|
+
fontSize: 85 * ratio
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
},
|
|
33
|
+
key
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
var preview_typography_default = StylesPreviewTypography;
|
|
39
|
+
export {
|
|
40
|
+
preview_typography_default as default
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=preview-typography.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/preview-typography.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalHStack as HStack } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport TypographyExample from './typography-example';\nimport PreviewWrapper from './preview-wrapper';\n\ninterface StylesPreviewTypographyProps {\n\tvariation: any;\n\tisFocused?: boolean;\n\twithHoverView?: boolean;\n}\n\nconst StylesPreviewTypography = ( {\n\tvariation,\n\tisFocused,\n\twithHoverView,\n}: StylesPreviewTypographyProps ) => {\n\treturn (\n\t\t<PreviewWrapper\n\t\t\tlabel={ variation.title }\n\t\t\tisFocused={ isFocused }\n\t\t\twithHoverView={ withHoverView }\n\t\t>\n\t\t\t{ ( { ratio, key } ) => (\n\t\t\t\t<HStack\n\t\t\t\t\tkey={ key }\n\t\t\t\t\tspacing={ 10 * ratio }\n\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<TypographyExample\n\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\tfontSize={ 85 * ratio }\n\t\t\t\t\t/>\n\t\t\t\t</HStack>\n\t\t\t) }\n\t\t</PreviewWrapper>\n\t);\n};\n\nexport default StylesPreviewTypography;\n"],
|
|
5
|
+
"mappings": "AAsCK;AAnCL,SAAS,wBAAwB,cAAc;AAK/C,OAAO,uBAAuB;AAC9B,OAAO,oBAAoB;AAQ3B,MAAM,0BAA0B,CAAE;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACD,MAAqC;AACpC,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ,UAAU;AAAA,MAClB;AAAA,MACA;AAAA,MAEE,WAAE,EAAE,OAAO,IAAI,MAChB;AAAA,QAAC;AAAA;AAAA,UAEA,SAAU,KAAK;AAAA,UACf,SAAQ;AAAA,UACR,OAAQ;AAAA,YACP,QAAQ;AAAA,YACR,UAAU;AAAA,UACX;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACA;AAAA,cACA,UAAW,KAAK;AAAA;AAAA,UACjB;AAAA;AAAA,QAXM;AAAA,MAYP;AAAA;AAAA,EAEF;AAEF;AAEA,IAAO,6BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { __unstableMotion as motion } from "@wordpress/components";
|
|
3
|
+
import {
|
|
4
|
+
useThrottle,
|
|
5
|
+
useReducedMotion,
|
|
6
|
+
useResizeObserver
|
|
7
|
+
} from "@wordpress/compose";
|
|
8
|
+
import { useLayoutEffect, useState } from "@wordpress/element";
|
|
9
|
+
import { useStyle } from "./hooks";
|
|
10
|
+
const normalizedWidth = 248;
|
|
11
|
+
const normalizedHeight = 152;
|
|
12
|
+
const THROTTLE_OPTIONS = {
|
|
13
|
+
leading: true,
|
|
14
|
+
trailing: true
|
|
15
|
+
};
|
|
16
|
+
function PreviewWrapper({
|
|
17
|
+
children,
|
|
18
|
+
label,
|
|
19
|
+
isFocused,
|
|
20
|
+
withHoverView
|
|
21
|
+
}) {
|
|
22
|
+
const [backgroundColor = "white"] = useStyle("color.background");
|
|
23
|
+
const [gradientValue] = useStyle("color.gradient");
|
|
24
|
+
const disableMotion = useReducedMotion();
|
|
25
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
26
|
+
const [containerResizeListener, { width }] = useResizeObserver();
|
|
27
|
+
const [throttledWidth, setThrottledWidthState] = useState(width);
|
|
28
|
+
const [ratioState, setRatioState] = useState();
|
|
29
|
+
const setThrottledWidth = useThrottle(
|
|
30
|
+
setThrottledWidthState,
|
|
31
|
+
250,
|
|
32
|
+
THROTTLE_OPTIONS
|
|
33
|
+
);
|
|
34
|
+
useLayoutEffect(() => {
|
|
35
|
+
if (width) {
|
|
36
|
+
setThrottledWidth(width);
|
|
37
|
+
}
|
|
38
|
+
}, [width, setThrottledWidth]);
|
|
39
|
+
useLayoutEffect(() => {
|
|
40
|
+
const newRatio = throttledWidth ? throttledWidth / normalizedWidth : 1;
|
|
41
|
+
const ratioDiff = newRatio - (ratioState || 0);
|
|
42
|
+
const isRatioDiffBigEnough = Math.abs(ratioDiff) > 0.1;
|
|
43
|
+
if (isRatioDiffBigEnough || !ratioState) {
|
|
44
|
+
setRatioState(newRatio);
|
|
45
|
+
}
|
|
46
|
+
}, [throttledWidth, ratioState]);
|
|
47
|
+
const fallbackRatio = width ? width / normalizedWidth : 1;
|
|
48
|
+
const ratio = ratioState ? ratioState : fallbackRatio;
|
|
49
|
+
const isReady = !!width;
|
|
50
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
51
|
+
/* @__PURE__ */ jsx("div", { style: { position: "relative" }, children: containerResizeListener }),
|
|
52
|
+
isReady && /* @__PURE__ */ jsx(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: "global-styles-ui-preview__wrapper",
|
|
56
|
+
style: {
|
|
57
|
+
height: normalizedHeight * ratio
|
|
58
|
+
},
|
|
59
|
+
onMouseEnter: () => setIsHovered(true),
|
|
60
|
+
onMouseLeave: () => setIsHovered(false),
|
|
61
|
+
tabIndex: -1,
|
|
62
|
+
children: /* @__PURE__ */ jsx(
|
|
63
|
+
motion.div,
|
|
64
|
+
{
|
|
65
|
+
style: {
|
|
66
|
+
height: normalizedHeight * ratio,
|
|
67
|
+
width: "100%",
|
|
68
|
+
background: gradientValue ?? backgroundColor,
|
|
69
|
+
cursor: withHoverView ? "pointer" : void 0
|
|
70
|
+
},
|
|
71
|
+
initial: "start",
|
|
72
|
+
animate: (isHovered || isFocused) && !disableMotion && label ? "hover" : "start",
|
|
73
|
+
children: [].concat(children).map(
|
|
74
|
+
(child, key) => child({ ratio, key })
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
var preview_wrapper_default = PreviewWrapper;
|
|
83
|
+
export {
|
|
84
|
+
preview_wrapper_default as default
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=preview-wrapper.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/preview-wrapper.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport {\n\tuseThrottle,\n\tuseReducedMotion,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { useLayoutEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useStyle } from './hooks';\n\nconst normalizedWidth = 248;\nconst normalizedHeight = 152;\n\n// Throttle options for useThrottle. Must be defined outside of the component,\n// so that the object reference is the same on each render.\nconst THROTTLE_OPTIONS = {\n\tleading: true,\n\ttrailing: true,\n};\n\ninterface PreviewWrapperProps {\n\tchildren:\n\t\t| ( ( args: { ratio: number; key: number } ) => React.ReactNode )\n\t\t| ( ( args: { ratio: number; key: number } ) => React.ReactNode )[];\n\tlabel?: string;\n\tisFocused?: boolean;\n\twithHoverView?: boolean;\n}\n\nfunction PreviewWrapper( {\n\tchildren,\n\tlabel,\n\tisFocused,\n\twithHoverView,\n}: PreviewWrapperProps ) {\n\tconst [ backgroundColor = 'white' ] =\n\t\tuseStyle< string >( 'color.background' );\n\tconst [ gradientValue ] = useStyle< string >( 'color.gradient' );\n\tconst disableMotion = useReducedMotion();\n\tconst [ isHovered, setIsHovered ] = useState( false );\n\tconst [ containerResizeListener, { width } ] = useResizeObserver();\n\tconst [ throttledWidth, setThrottledWidthState ] = useState( width );\n\tconst [ ratioState, setRatioState ] = useState< number | undefined >();\n\n\tconst setThrottledWidth = useThrottle(\n\t\tsetThrottledWidthState,\n\t\t250,\n\t\tTHROTTLE_OPTIONS\n\t);\n\n\t// Must use useLayoutEffect to avoid a flash of the container at the wrong\n\t// size before the width is set.\n\tuseLayoutEffect( () => {\n\t\tif ( width ) {\n\t\t\tsetThrottledWidth( width );\n\t\t}\n\t}, [ width, setThrottledWidth ] );\n\n\t// Must use useLayoutEffect to avoid a flash of the container at the wrong\n\t// size before the width is set.\n\tuseLayoutEffect( () => {\n\t\tconst newRatio = throttledWidth ? throttledWidth / normalizedWidth : 1;\n\t\tconst ratioDiff = newRatio - ( ratioState || 0 );\n\n\t\t// Only update the ratio state if the difference is big enough\n\t\t// or if the ratio state is not yet set. This is to avoid an\n\t\t// endless loop of updates at particular viewport heights when the\n\t\t// presence of a scrollbar causes the width to change slightly.\n\t\tconst isRatioDiffBigEnough = Math.abs( ratioDiff ) > 0.1;\n\n\t\tif ( isRatioDiffBigEnough || ! ratioState ) {\n\t\t\tsetRatioState( newRatio );\n\t\t}\n\t}, [ throttledWidth, ratioState ] );\n\n\t// Set a fallbackRatio to use before the throttled ratio has been set.\n\tconst fallbackRatio = width ? width / normalizedWidth : 1;\n\t/*\n\t * Use the throttled ratio if it has been calculated, otherwise\n\t * use the fallback ratio. The throttled ratio is used to avoid\n\t * an endless loop of updates at particular viewport heights.\n\t * See: https://github.com/WordPress/gutenberg/issues/55112\n\t */\n\tconst ratio = ratioState ? ratioState : fallbackRatio;\n\n\tconst isReady = !! width;\n\n\treturn (\n\t\t<>\n\t\t\t<div style={ { position: 'relative' } }>\n\t\t\t\t{ containerResizeListener }\n\t\t\t</div>\n\t\t\t{ isReady && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"global-styles-ui-preview__wrapper\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\theight: normalizedHeight * ratio,\n\t\t\t\t\t} }\n\t\t\t\t\tonMouseEnter={ () => setIsHovered( true ) }\n\t\t\t\t\tonMouseLeave={ () => setIsHovered( false ) }\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\theight: normalizedHeight * ratio,\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\t\t\t\tcursor: withHoverView ? 'pointer' : undefined,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tinitial=\"start\"\n\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\t( isHovered || isFocused ) &&\n\t\t\t\t\t\t\t! disableMotion &&\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t? 'hover'\n\t\t\t\t\t\t\t\t: 'start'\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ []\n\t\t\t\t\t\t\t.concat( children as any ) // This makes sure children is always an array.\n\t\t\t\t\t\t\t.map( ( child: any, key: number ) =>\n\t\t\t\t\t\t\t\tchild( { ratio, key } )\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</motion.div>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default PreviewWrapper;\n"],
|
|
5
|
+
"mappings": "AA8FE,mBACC,KADD;AA3FF,SAAS,oBAAoB,cAAc;AAC3C;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,iBAAiB,gBAAgB;AAK1C,SAAS,gBAAgB;AAEzB,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;AAIzB,MAAM,mBAAmB;AAAA,EACxB,SAAS;AAAA,EACT,UAAU;AACX;AAWA,SAAS,eAAgB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAyB;AACxB,QAAM,CAAE,kBAAkB,OAAQ,IACjC,SAAoB,kBAAmB;AACxC,QAAM,CAAE,aAAc,IAAI,SAAoB,gBAAiB;AAC/D,QAAM,gBAAgB,iBAAiB;AACvC,QAAM,CAAE,WAAW,YAAa,IAAI,SAAU,KAAM;AACpD,QAAM,CAAE,yBAAyB,EAAE,MAAM,CAAE,IAAI,kBAAkB;AACjE,QAAM,CAAE,gBAAgB,sBAAuB,IAAI,SAAU,KAAM;AACnE,QAAM,CAAE,YAAY,aAAc,IAAI,SAA+B;AAErE,QAAM,oBAAoB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAIA,kBAAiB,MAAM;AACtB,QAAK,OAAQ;AACZ,wBAAmB,KAAM;AAAA,IAC1B;AAAA,EACD,GAAG,CAAE,OAAO,iBAAkB,CAAE;AAIhC,kBAAiB,MAAM;AACtB,UAAM,WAAW,iBAAiB,iBAAiB,kBAAkB;AACrE,UAAM,YAAY,YAAa,cAAc;AAM7C,UAAM,uBAAuB,KAAK,IAAK,SAAU,IAAI;AAErD,QAAK,wBAAwB,CAAE,YAAa;AAC3C,oBAAe,QAAS;AAAA,IACzB;AAAA,EACD,GAAG,CAAE,gBAAgB,UAAW,CAAE;AAGlC,QAAM,gBAAgB,QAAQ,QAAQ,kBAAkB;AAOxD,QAAM,QAAQ,aAAa,aAAa;AAExC,QAAM,UAAU,CAAC,CAAE;AAEnB,SACC,iCACC;AAAA,wBAAC,SAAI,OAAQ,EAAE,UAAU,WAAW,GACjC,mCACH;AAAA,IACE,WACD;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,OAAQ;AAAA,UACP,QAAQ,mBAAmB;AAAA,QAC5B;AAAA,QACA,cAAe,MAAM,aAAc,IAAK;AAAA,QACxC,cAAe,MAAM,aAAc,KAAM;AAAA,QACzC,UAAW;AAAA,QAEX;AAAA,UAAC,OAAO;AAAA,UAAP;AAAA,YACA,OAAQ;AAAA,cACP,QAAQ,mBAAmB;AAAA,cAC3B,OAAO;AAAA,cACP,YAAY,iBAAiB;AAAA,cAC7B,QAAQ,gBAAgB,YAAY;AAAA,YACrC;AAAA,YACA,SAAQ;AAAA,YACR,UACG,aAAa,cACf,CAAE,iBACF,QACG,UACA;AAAA,YAGF,WAAC,EACD,OAAQ,QAAgB,EACxB;AAAA,cAAK,CAAE,OAAY,QACnB,MAAO,EAAE,OAAO,IAAI,CAAE;AAAA,YACvB;AAAA;AAAA,QACF;AAAA;AAAA,IACD;AAAA,KAEF;AAEF;AAEA,IAAO,0BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "@wordpress/element";
|
|
3
|
+
import { mergeGlobalStyles } from "@wordpress/global-styles-engine";
|
|
4
|
+
import { GlobalStylesContext } from "./context";
|
|
5
|
+
function GlobalStylesProvider({
|
|
6
|
+
children,
|
|
7
|
+
value,
|
|
8
|
+
baseValue,
|
|
9
|
+
onChange,
|
|
10
|
+
fontLibraryEnabled
|
|
11
|
+
}) {
|
|
12
|
+
const merged = useMemo(() => {
|
|
13
|
+
return mergeGlobalStyles(baseValue, value);
|
|
14
|
+
}, [baseValue, value]);
|
|
15
|
+
const contextValue = useMemo(
|
|
16
|
+
() => ({
|
|
17
|
+
user: value,
|
|
18
|
+
base: baseValue,
|
|
19
|
+
merged,
|
|
20
|
+
onChange,
|
|
21
|
+
fontLibraryEnabled
|
|
22
|
+
}),
|
|
23
|
+
[value, baseValue, merged, onChange, fontLibraryEnabled]
|
|
24
|
+
);
|
|
25
|
+
return /* @__PURE__ */ jsx(GlobalStylesContext.Provider, { value: contextValue, children });
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
GlobalStylesProvider
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/provider.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport type { GlobalStylesConfig } from '@wordpress/global-styles-engine';\nimport { mergeGlobalStyles } from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport { GlobalStylesContext } from './context';\n\ninterface GlobalStylesProviderProps {\n\tchildren: ReactNode;\n\tvalue: GlobalStylesConfig;\n\tbaseValue: GlobalStylesConfig;\n\tonChange: ( newValue: GlobalStylesConfig ) => void;\n\tfontLibraryEnabled?: boolean;\n}\n\nexport function GlobalStylesProvider( {\n\tchildren,\n\tvalue,\n\tbaseValue,\n\tonChange,\n\tfontLibraryEnabled,\n}: GlobalStylesProviderProps ) {\n\t// Compute merged with memoization since merging can be expensive\n\tconst merged = useMemo( () => {\n\t\treturn mergeGlobalStyles( baseValue, value );\n\t}, [ baseValue, value ] );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tuser: value,\n\t\t\tbase: baseValue,\n\t\t\tmerged,\n\t\t\tonChange,\n\t\t\tfontLibraryEnabled,\n\t\t} ),\n\t\t[ value, baseValue, merged, onChange, fontLibraryEnabled ]\n\t);\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n"],
|
|
5
|
+
"mappings": "AAiDE;AAzCF,SAAS,eAAe;AAExB,SAAS,yBAAyB;AAKlC,SAAS,2BAA2B;AAU7B,SAAS,qBAAsB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAA+B;AAE9B,QAAM,SAAS,QAAS,MAAM;AAC7B,WAAO,kBAAmB,WAAW,KAAM;AAAA,EAC5C,GAAG,CAAE,WAAW,KAAM,CAAE;AAExB,QAAM,eAAe;AAAA,IACpB,OAAQ;AAAA,MACP,MAAM;AAAA,MACN,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,CAAE,OAAO,WAAW,QAAQ,UAAU,kBAAmB;AAAA,EAC1D;AAEA,SACC,oBAAC,oBAAoB,UAApB,EAA6B,OAAQ,cACnC,UACH;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { __experimentalItemGroup as ItemGroup } from "@wordpress/components";
|
|
3
|
+
import {
|
|
4
|
+
background,
|
|
5
|
+
typography,
|
|
6
|
+
color,
|
|
7
|
+
layout,
|
|
8
|
+
shadow as shadowIcon
|
|
9
|
+
} from "@wordpress/icons";
|
|
10
|
+
import { __ } from "@wordpress/i18n";
|
|
11
|
+
import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
|
|
12
|
+
import { NavigationButtonAsItem } from "./navigation-button";
|
|
13
|
+
import { useSetting } from "./hooks";
|
|
14
|
+
import { unlock } from "./lock-unlock";
|
|
15
|
+
const {
|
|
16
|
+
useHasDimensionsPanel,
|
|
17
|
+
useHasTypographyPanel,
|
|
18
|
+
useHasColorPanel,
|
|
19
|
+
useSettingsForBlockElement,
|
|
20
|
+
useHasBackgroundPanel
|
|
21
|
+
} = unlock(blockEditorPrivateApis);
|
|
22
|
+
function RootMenu() {
|
|
23
|
+
const [rawSettings] = useSetting("");
|
|
24
|
+
const settings = useSettingsForBlockElement(rawSettings);
|
|
25
|
+
const hasBackgroundPanel = useHasBackgroundPanel(rawSettings);
|
|
26
|
+
const hasTypographyPanel = useHasTypographyPanel(settings);
|
|
27
|
+
const hasColorPanel = useHasColorPanel(settings);
|
|
28
|
+
const hasShadowPanel = true;
|
|
29
|
+
const hasDimensionsPanel = useHasDimensionsPanel(settings);
|
|
30
|
+
const hasLayoutPanel = hasDimensionsPanel;
|
|
31
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(ItemGroup, { children: [
|
|
32
|
+
hasTypographyPanel && /* @__PURE__ */ jsx(
|
|
33
|
+
NavigationButtonAsItem,
|
|
34
|
+
{
|
|
35
|
+
icon: typography,
|
|
36
|
+
path: "/typography",
|
|
37
|
+
children: __("Typography")
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
hasColorPanel && /* @__PURE__ */ jsx(NavigationButtonAsItem, { icon: color, path: "/colors", children: __("Colors") }),
|
|
41
|
+
hasBackgroundPanel && /* @__PURE__ */ jsx(
|
|
42
|
+
NavigationButtonAsItem,
|
|
43
|
+
{
|
|
44
|
+
icon: background,
|
|
45
|
+
path: "/background",
|
|
46
|
+
"aria-label": __("Background styles"),
|
|
47
|
+
children: __("Background")
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
hasShadowPanel && /* @__PURE__ */ jsx(NavigationButtonAsItem, { icon: shadowIcon, path: "/shadows", children: __("Shadows") }),
|
|
51
|
+
hasLayoutPanel && /* @__PURE__ */ jsx(NavigationButtonAsItem, { icon: layout, path: "/layout", children: __("Layout") })
|
|
52
|
+
] }) });
|
|
53
|
+
}
|
|
54
|
+
var root_menu_default = RootMenu;
|
|
55
|
+
export {
|
|
56
|
+
root_menu_default as default
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=root-menu.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/root-menu.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport {\n\tbackground,\n\ttypography,\n\tcolor,\n\tlayout,\n\tshadow as shadowIcon,\n} from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n// @ts-expect-error: Not typed yet.\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport type { GlobalStylesSettings } from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { useSetting } from './hooks';\nimport { unlock } from './lock-unlock';\n\nconst {\n\tuseHasDimensionsPanel,\n\tuseHasTypographyPanel,\n\tuseHasColorPanel,\n\tuseSettingsForBlockElement,\n\tuseHasBackgroundPanel,\n} = unlock( blockEditorPrivateApis );\n\nfunction RootMenu() {\n\t// Get the raw settings from our custom hook\n\tconst [ rawSettings ] = useSetting< GlobalStylesSettings >( '' );\n\n\t// Process settings the same way as Gutenberg\n\tconst settings = useSettingsForBlockElement( rawSettings );\n\n\t// Use the same panel detection logic as Gutenberg\n\tconst hasBackgroundPanel = useHasBackgroundPanel( rawSettings );\n\tconst hasTypographyPanel = useHasTypographyPanel( settings );\n\tconst hasColorPanel = useHasColorPanel( settings );\n\tconst hasShadowPanel = true; // Same as Gutenberg\n\tconst hasDimensionsPanel = useHasDimensionsPanel( settings );\n\tconst hasLayoutPanel = hasDimensionsPanel;\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ hasTypographyPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ typography }\n\t\t\t\t\t\tpath=\"/typography\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Typography' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasColorPanel && (\n\t\t\t\t\t<NavigationButtonAsItem icon={ color } path=\"/colors\">\n\t\t\t\t\t\t{ __( 'Colors' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasBackgroundPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ background }\n\t\t\t\t\t\tpath=\"/background\"\n\t\t\t\t\t\taria-label={ __( 'Background styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Background' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasShadowPanel && (\n\t\t\t\t\t<NavigationButtonAsItem icon={ shadowIcon } path=\"/shadows\">\n\t\t\t\t\t\t{ __( 'Shadows' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasLayoutPanel && (\n\t\t\t\t\t<NavigationButtonAsItem icon={ layout } path=\"/layout\">\n\t\t\t\t\t\t{ __( 'Layout' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n\nexport default RootMenu;\n"],
|
|
5
|
+
"mappings": "AA+CE,mBAGG,KAFF,YADD;AA5CF,SAAS,2BAA2B,iBAAiB;AACrD;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,OACJ;AACP,SAAS,UAAU;AAEnB,SAAS,eAAe,8BAA8B;AAMtD,SAAS,8BAA8B;AACvC,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AAEvB,MAAM;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,IAAI,OAAQ,sBAAuB;AAEnC,SAAS,WAAW;AAEnB,QAAM,CAAE,WAAY,IAAI,WAAoC,EAAG;AAG/D,QAAM,WAAW,2BAA4B,WAAY;AAGzD,QAAM,qBAAqB,sBAAuB,WAAY;AAC9D,QAAM,qBAAqB,sBAAuB,QAAS;AAC3D,QAAM,gBAAgB,iBAAkB,QAAS;AACjD,QAAM,iBAAiB;AACvB,QAAM,qBAAqB,sBAAuB,QAAS;AAC3D,QAAM,iBAAiB;AAEvB,SACC,gCACC,+BAAC,aACE;AAAA,0BACD;AAAA,MAAC;AAAA;AAAA,QACA,MAAO;AAAA,QACP,MAAK;AAAA,QAEH,aAAI,YAAa;AAAA;AAAA,IACpB;AAAA,IAEC,iBACD,oBAAC,0BAAuB,MAAO,OAAQ,MAAK,WACzC,aAAI,QAAS,GAChB;AAAA,IAEC,sBACD;AAAA,MAAC;AAAA;AAAA,QACA,MAAO;AAAA,QACP,MAAK;AAAA,QACL,cAAa,GAAI,mBAAoB;AAAA,QAEnC,aAAI,YAAa;AAAA;AAAA,IACpB;AAAA,IAEC,kBACD,oBAAC,0BAAuB,MAAO,YAAa,MAAK,YAC9C,aAAI,SAAU,GACjB;AAAA,IAEC,kBACD,oBAAC,0BAAuB,MAAO,QAAS,MAAK,WAC1C,aAAI,QAAS,GAChB;AAAA,KAEF,GACD;AAEF;AAEA,IAAO,oBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { __ } from "@wordpress/i18n";
|
|
3
|
+
import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
|
|
4
|
+
import { __experimentalText as Text } from "@wordpress/components";
|
|
5
|
+
import BackgroundPanel from "./background-panel";
|
|
6
|
+
import { ScreenHeader } from "./screen-header";
|
|
7
|
+
import { useSetting } from "./hooks";
|
|
8
|
+
import { unlock } from "./lock-unlock";
|
|
9
|
+
const { useHasBackgroundPanel } = unlock(blockEditorPrivateApis);
|
|
10
|
+
function ScreenBackground() {
|
|
11
|
+
const [settings] = useSetting("");
|
|
12
|
+
const hasBackgroundPanel = useHasBackgroundPanel(settings);
|
|
13
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14
|
+
/* @__PURE__ */ jsx(
|
|
15
|
+
ScreenHeader,
|
|
16
|
+
{
|
|
17
|
+
title: __("Background"),
|
|
18
|
+
description: /* @__PURE__ */ jsx(Text, { children: __("Set styles for the site's background.") })
|
|
19
|
+
}
|
|
20
|
+
),
|
|
21
|
+
hasBackgroundPanel && /* @__PURE__ */ jsx(BackgroundPanel, {})
|
|
22
|
+
] });
|
|
23
|
+
}
|
|
24
|
+
var screen_background_default = ScreenBackground;
|
|
25
|
+
export {
|
|
26
|
+
screen_background_default as default
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=screen-background.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/screen-background.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n// @ts-expect-error: Not typed yet.\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { __experimentalText as Text } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BackgroundPanel from './background-panel';\nimport { ScreenHeader } from './screen-header';\nimport { useSetting } from './hooks';\nimport { unlock } from './lock-unlock';\n\nconst { useHasBackgroundPanel } = unlock( blockEditorPrivateApis );\n\nfunction ScreenBackground() {\n\tconst [ settings ] = useSetting( '' );\n\tconst hasBackgroundPanel = useHasBackgroundPanel( settings );\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Background' ) }\n\t\t\t\tdescription={\n\t\t\t\t\t<Text>\n\t\t\t\t\t\t{ __( \"Set styles for the site's background.\" ) }\n\t\t\t\t\t</Text>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ hasBackgroundPanel && <BackgroundPanel /> }\n\t\t</>\n\t);\n}\n\nexport default ScreenBackground;\n"],
|
|
5
|
+
"mappings": "AAsBE,mBAIG,KAJH;AAnBF,SAAS,UAAU;AAEnB,SAAS,eAAe,8BAA8B;AACtD,SAAS,sBAAsB,YAAY;AAK3C,OAAO,qBAAqB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AAEvB,MAAM,EAAE,sBAAsB,IAAI,OAAQ,sBAAuB;AAEjE,SAAS,mBAAmB;AAC3B,QAAM,CAAE,QAAS,IAAI,WAAY,EAAG;AACpC,QAAM,qBAAqB,sBAAuB,QAAS;AAC3D,SACC,iCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,GAAI,YAAa;AAAA,QACzB,aACC,oBAAC,QACE,aAAI,uCAAwC,GAC/C;AAAA;AAAA,IAEF;AAAA,IACE,sBAAsB,oBAAC,mBAAgB;AAAA,KAC1C;AAEF;AAEA,IAAO,4BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|