@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,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/font-library-modal/utils/set-immutably.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Immutably sets a value inside an object. Like `lodash#set`, but returning a\n * new object. Treats nullish initial values as empty objects. Clones any\n * nested objects. Supports arrays, too.\n * Duplicated from `packages/global-styles-engine/src/utils/object.ts`\n *\n * @param object Object to set a value in.\n * @param path Path in the object to modify.\n * @param value New value to set.\n * @return Cloned object with the new value set.\n */\nexport function setImmutably(\n\tobject: Object,\n\tpath: string | number | ( string | number )[],\n\tvalue: any\n) {\n\t// Normalize path\n\tpath = Array.isArray( path ) ? [ ...path ] : [ path ];\n\n\t// Shallowly clone the base of the object\n\tobject = Array.isArray( object ) ? [ ...object ] : { ...object };\n\n\tconst leaf = path.pop();\n\n\t// Traverse object from root to leaf, shallowly cloning at each level\n\tlet prev = object;\n\tfor ( const key of path ) {\n\t\t// @ts-expect-error\n\t\tconst lvl = prev[ key ];\n\t\t// @ts-expect-error\n\t\tprev = prev[ key ] = Array.isArray( lvl ) ? [ ...lvl ] : { ...lvl };\n\t}\n\t// @ts-expect-error\n\tprev[ leaf ] = value;\n\n\treturn object;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWO,SAAS,aACf,QACA,MACA,OACC;AAED,SAAO,MAAM,QAAS,IAAK,IAAI,CAAE,GAAG,IAAK,IAAI,CAAE,IAAK;AAGpD,WAAS,MAAM,QAAS,MAAO,IAAI,CAAE,GAAG,MAAO,IAAI,EAAE,GAAG,OAAO;AAE/D,QAAM,OAAO,KAAK,IAAI;AAGtB,MAAI,OAAO;AACX,aAAY,OAAO,MAAO;AAEzB,UAAM,MAAM,KAAM,GAAI;AAEtB,WAAO,KAAM,GAAI,IAAI,MAAM,QAAS,GAAI,IAAI,CAAE,GAAG,GAAI,IAAI,EAAE,GAAG,IAAI;AAAA,EACnE;AAEA,OAAM,IAAK,IAAI;AAEf,SAAO;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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 sort_font_faces_exports = {};
|
|
20
|
+
__export(sort_font_faces_exports, {
|
|
21
|
+
sortFontFaces: () => sortFontFaces
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(sort_font_faces_exports);
|
|
24
|
+
function getNumericFontWeight(value) {
|
|
25
|
+
switch (value) {
|
|
26
|
+
case "normal":
|
|
27
|
+
return 400;
|
|
28
|
+
case "bold":
|
|
29
|
+
return 700;
|
|
30
|
+
case "bolder":
|
|
31
|
+
return 500;
|
|
32
|
+
case "lighter":
|
|
33
|
+
return 300;
|
|
34
|
+
default:
|
|
35
|
+
return parseInt(value, 10);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function sortFontFaces(faces) {
|
|
39
|
+
return faces.sort((a, b) => {
|
|
40
|
+
if (a.fontStyle === "normal" && b.fontStyle !== "normal") {
|
|
41
|
+
return -1;
|
|
42
|
+
}
|
|
43
|
+
if (b.fontStyle === "normal" && a.fontStyle !== "normal") {
|
|
44
|
+
return 1;
|
|
45
|
+
}
|
|
46
|
+
if (a.fontStyle === b.fontStyle) {
|
|
47
|
+
return getNumericFontWeight(a.fontWeight?.toString() ?? "normal") - getNumericFontWeight(b.fontWeight?.toString() ?? "normal");
|
|
48
|
+
}
|
|
49
|
+
if (!a.fontStyle || !b.fontStyle) {
|
|
50
|
+
return !a.fontStyle ? 1 : -1;
|
|
51
|
+
}
|
|
52
|
+
return a.fontStyle.localeCompare(b.fontStyle);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
sortFontFaces
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=sort-font-faces.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/font-library-modal/utils/sort-font-faces.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { FontFace } from '../types';\n\nfunction getNumericFontWeight( value: string ): number {\n\tswitch ( value ) {\n\t\tcase 'normal':\n\t\t\treturn 400;\n\t\tcase 'bold':\n\t\t\treturn 700;\n\t\tcase 'bolder':\n\t\t\treturn 500;\n\t\tcase 'lighter':\n\t\t\treturn 300;\n\t\tdefault:\n\t\t\treturn parseInt( value, 10 );\n\t}\n}\n\nexport function sortFontFaces( faces: FontFace[] ): FontFace[] {\n\treturn faces.sort( ( a, b ) => {\n\t\t// Ensure 'normal' fontStyle is always first\n\t\tif ( a.fontStyle === 'normal' && b.fontStyle !== 'normal' ) {\n\t\t\treturn -1;\n\t\t}\n\t\tif ( b.fontStyle === 'normal' && a.fontStyle !== 'normal' ) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t// If both fontStyles are the same, sort by fontWeight\n\t\tif ( a.fontStyle === b.fontStyle ) {\n\t\t\treturn (\n\t\t\t\tgetNumericFontWeight( a.fontWeight?.toString() ?? 'normal' ) -\n\t\t\t\tgetNumericFontWeight( b.fontWeight?.toString() ?? 'normal' )\n\t\t\t);\n\t\t}\n\n\t\t// Sort other fontStyles alphabetically\n\t\tif ( ! a.fontStyle || ! b.fontStyle ) {\n\t\t\treturn ! a.fontStyle ? 1 : -1;\n\t\t}\n\n\t\treturn a.fontStyle.localeCompare( b.fontStyle );\n\t} );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,SAAS,qBAAsB,OAAwB;AACtD,UAAS,OAAQ;AAAA,IAChB,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR,KAAK;AACJ,aAAO;AAAA,IACR;AACC,aAAO,SAAU,OAAO,EAAG;AAAA,EAC7B;AACD;AAEO,SAAS,cAAe,OAAgC;AAC9D,SAAO,MAAM,KAAM,CAAE,GAAG,MAAO;AAE9B,QAAK,EAAE,cAAc,YAAY,EAAE,cAAc,UAAW;AAC3D,aAAO;AAAA,IACR;AACA,QAAK,EAAE,cAAc,YAAY,EAAE,cAAc,UAAW;AAC3D,aAAO;AAAA,IACR;AAGA,QAAK,EAAE,cAAc,EAAE,WAAY;AAClC,aACC,qBAAsB,EAAE,YAAY,SAAS,KAAK,QAAS,IAC3D,qBAAsB,EAAE,YAAY,SAAS,KAAK,QAAS;AAAA,IAE7D;AAGA,QAAK,CAAE,EAAE,aAAa,CAAE,EAAE,WAAY;AACrC,aAAO,CAAE,EAAE,YAAY,IAAI;AAAA,IAC5B;AAEA,WAAO,EAAE,UAAU,cAAe,EAAE,SAAU;AAAA,EAC/C,CAAE;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 toggleFont_exports = {};
|
|
20
|
+
__export(toggleFont_exports, {
|
|
21
|
+
toggleFont: () => toggleFont
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(toggleFont_exports);
|
|
24
|
+
function toggleFont(font, face, initialfonts = []) {
|
|
25
|
+
const isFontActivated = (f) => f.slug === font.slug;
|
|
26
|
+
const getActivatedFont = (fonts) => fonts.find(isFontActivated);
|
|
27
|
+
const toggleEntireFontFamily = (activatedFont2) => {
|
|
28
|
+
if (!activatedFont2) {
|
|
29
|
+
return [...initialfonts, font];
|
|
30
|
+
}
|
|
31
|
+
return initialfonts.filter(
|
|
32
|
+
(f) => !isFontActivated(f)
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
const toggleFontVariant = (activatedFont2) => {
|
|
36
|
+
const isFaceActivated = (f) => f.fontWeight === face.fontWeight && f.fontStyle === face.fontStyle;
|
|
37
|
+
if (!activatedFont2) {
|
|
38
|
+
return [...initialfonts, { ...font, fontFace: [face] }];
|
|
39
|
+
}
|
|
40
|
+
let newFontFaces = activatedFont2.fontFace || [];
|
|
41
|
+
if (newFontFaces.find(isFaceActivated)) {
|
|
42
|
+
newFontFaces = newFontFaces.filter(
|
|
43
|
+
(f) => !isFaceActivated(f)
|
|
44
|
+
);
|
|
45
|
+
} else {
|
|
46
|
+
newFontFaces = [...newFontFaces, face];
|
|
47
|
+
}
|
|
48
|
+
if (newFontFaces.length === 0) {
|
|
49
|
+
return initialfonts.filter(
|
|
50
|
+
(f) => !isFontActivated(f)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
return initialfonts.map(
|
|
54
|
+
(f) => isFontActivated(f) ? { ...f, fontFace: newFontFaces } : f
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
const activatedFont = getActivatedFont(initialfonts);
|
|
58
|
+
if (!face) {
|
|
59
|
+
return toggleEntireFontFamily(activatedFont);
|
|
60
|
+
}
|
|
61
|
+
return toggleFontVariant(activatedFont);
|
|
62
|
+
}
|
|
63
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
+
0 && (module.exports = {
|
|
65
|
+
toggleFont
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=toggleFont.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/font-library-modal/utils/toggleFont.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Toggles the activation of a given font or font variant within a list of custom fonts.\n *\n * - If only the font is provided (without face), the entire font family's activation is toggled.\n * - If both font and face are provided, the activation of the specific font variant is toggled.\n *\n * @param {Object} font - The font to be toggled.\n * @param {string} font.slug - The unique identifier for the font.\n * @param {Array} [font.fontFace] - The list of font variants (faces) associated with the font.\n *\n * @param {Object} [face] - The specific font variant to be toggled.\n * @param {string} face.fontWeight - The weight of the font variant.\n * @param {string} face.fontStyle - The style of the font variant.\n *\n * @param {Array} initialfonts - The initial list of custom fonts.\n *\n * @return {Array} - The updated list of custom fonts with the font/font variant toggled.\n *\n * @example\n * const customFonts = [\n * { slug: 'roboto', fontFace: [{ fontWeight: '400', fontStyle: 'normal' }] }\n * ];\n *\n * toggleFont({ slug: 'roboto' }, null, customFonts);\n * // This will remove 'roboto' from customFonts\n *\n * toggleFont({ slug: 'roboto' }, { fontWeight: '400', fontStyle: 'normal' }, customFonts);\n * // This will remove the specified face from 'roboto' in customFonts\n *\n * toggleFont({ slug: 'roboto' }, { fontWeight: '500', fontStyle: 'normal' }, customFonts);\n * // This will add the specified face to 'roboto' in customFonts\n */\n/**\n * Internal dependencies\n */\nimport type { FontFamily, FontFace } from '../types';\n\nexport function toggleFont(\n\tfont: FontFamily,\n\tface?: FontFace,\n\tinitialfonts: FontFamily[] = []\n): FontFamily[] {\n\t// Helper to check if a font is activated based on its slug\n\tconst isFontActivated = ( f: FontFamily ): boolean => f.slug === font.slug;\n\n\t// Helper to get the activated font from a list of fonts\n\tconst getActivatedFont = ( fonts: FontFamily[] ): FontFamily | undefined =>\n\t\tfonts.find( isFontActivated );\n\n\t// Toggle the activation status of an entire font family\n\tconst toggleEntireFontFamily = (\n\t\tactivatedFont: FontFamily | undefined\n\t): FontFamily[] => {\n\t\tif ( ! activatedFont ) {\n\t\t\t// If the font is not active, activate the entire font family\n\t\t\treturn [ ...initialfonts, font ];\n\t\t}\n\t\t// If the font is already active, deactivate the entire font family\n\t\treturn initialfonts.filter(\n\t\t\t( f: FontFamily ) => ! isFontActivated( f )\n\t\t);\n\t};\n\n\t// Toggle the activation status of a specific font variant\n\tconst toggleFontVariant = (\n\t\tactivatedFont: FontFamily | undefined\n\t): FontFamily[] => {\n\t\tconst isFaceActivated = ( f: FontFace ): boolean =>\n\t\t\tf.fontWeight === face!.fontWeight &&\n\t\t\tf.fontStyle === face!.fontStyle;\n\n\t\tif ( ! activatedFont ) {\n\t\t\t// If the font family is not active, activate the font family with the font variant\n\t\t\treturn [ ...initialfonts, { ...font, fontFace: [ face! ] } ];\n\t\t}\n\n\t\tlet newFontFaces = activatedFont.fontFace || [];\n\n\t\tif ( newFontFaces.find( isFaceActivated ) ) {\n\t\t\t// If the font variant is active, deactivate it\n\t\t\tnewFontFaces = newFontFaces.filter(\n\t\t\t\t( f: FontFace ) => ! isFaceActivated( f )\n\t\t\t);\n\t\t} else {\n\t\t\t// If the font variant is not active, activate it\n\t\t\tnewFontFaces = [ ...newFontFaces, face! ];\n\t\t}\n\n\t\t// If there are no more font faces, deactivate the font family\n\t\tif ( newFontFaces.length === 0 ) {\n\t\t\treturn initialfonts.filter(\n\t\t\t\t( f: FontFamily ) => ! isFontActivated( f )\n\t\t\t);\n\t\t}\n\n\t\t// Return updated fonts list with toggled font variant\n\t\treturn initialfonts.map( ( f: FontFamily ) =>\n\t\t\tisFontActivated( f ) ? { ...f, fontFace: newFontFaces } : f\n\t\t);\n\t};\n\n\tconst activatedFont = getActivatedFont( initialfonts );\n\n\tif ( ! face ) {\n\t\treturn toggleEntireFontFamily( activatedFont );\n\t}\n\n\treturn toggleFontVariant( activatedFont );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCO,SAAS,WACf,MACA,MACA,eAA6B,CAAC,GACf;AAEf,QAAM,kBAAkB,CAAE,MAA4B,EAAE,SAAS,KAAK;AAGtE,QAAM,mBAAmB,CAAE,UAC1B,MAAM,KAAM,eAAgB;AAG7B,QAAM,yBAAyB,CAC9BA,mBACkB;AAClB,QAAK,CAAEA,gBAAgB;AAEtB,aAAO,CAAE,GAAG,cAAc,IAAK;AAAA,IAChC;AAEA,WAAO,aAAa;AAAA,MACnB,CAAE,MAAmB,CAAE,gBAAiB,CAAE;AAAA,IAC3C;AAAA,EACD;AAGA,QAAM,oBAAoB,CACzBA,mBACkB;AAClB,UAAM,kBAAkB,CAAE,MACzB,EAAE,eAAe,KAAM,cACvB,EAAE,cAAc,KAAM;AAEvB,QAAK,CAAEA,gBAAgB;AAEtB,aAAO,CAAE,GAAG,cAAc,EAAE,GAAG,MAAM,UAAU,CAAE,IAAM,EAAE,CAAE;AAAA,IAC5D;AAEA,QAAI,eAAeA,eAAc,YAAY,CAAC;AAE9C,QAAK,aAAa,KAAM,eAAgB,GAAI;AAE3C,qBAAe,aAAa;AAAA,QAC3B,CAAE,MAAiB,CAAE,gBAAiB,CAAE;AAAA,MACzC;AAAA,IACD,OAAO;AAEN,qBAAe,CAAE,GAAG,cAAc,IAAM;AAAA,IACzC;AAGA,QAAK,aAAa,WAAW,GAAI;AAChC,aAAO,aAAa;AAAA,QACnB,CAAE,MAAmB,CAAE,gBAAiB,CAAE;AAAA,MAC3C;AAAA,IACD;AAGA,WAAO,aAAa;AAAA,MAAK,CAAE,MAC1B,gBAAiB,CAAE,IAAI,EAAE,GAAG,GAAG,UAAU,aAAa,IAAI;AAAA,IAC3D;AAAA,EACD;AAEA,QAAM,gBAAgB,iBAAkB,YAAa;AAErD,MAAK,CAAE,MAAO;AACb,WAAO,uBAAwB,aAAc;AAAA,EAC9C;AAEA,SAAO,kBAAmB,aAAc;AACzC;",
|
|
6
|
+
"names": ["activatedFont"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 confirm_delete_font_size_dialog_exports = {};
|
|
20
|
+
__export(confirm_delete_font_size_dialog_exports, {
|
|
21
|
+
default: () => confirm_delete_font_size_dialog_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(confirm_delete_font_size_dialog_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
|
+
function ConfirmDeleteFontSizeDialog({
|
|
28
|
+
fontSize,
|
|
29
|
+
isOpen,
|
|
30
|
+
toggleOpen,
|
|
31
|
+
handleRemoveFontSize
|
|
32
|
+
}) {
|
|
33
|
+
const handleConfirm = async () => {
|
|
34
|
+
toggleOpen();
|
|
35
|
+
handleRemoveFontSize(fontSize);
|
|
36
|
+
};
|
|
37
|
+
const handleCancel = () => {
|
|
38
|
+
toggleOpen();
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
import_components.__experimentalConfirmDialog,
|
|
42
|
+
{
|
|
43
|
+
isOpen,
|
|
44
|
+
cancelButtonText: (0, import_i18n.__)("Cancel"),
|
|
45
|
+
confirmButtonText: (0, import_i18n.__)("Delete"),
|
|
46
|
+
onCancel: handleCancel,
|
|
47
|
+
onConfirm: handleConfirm,
|
|
48
|
+
size: "medium",
|
|
49
|
+
children: fontSize && (0, import_i18n.sprintf)(
|
|
50
|
+
/* translators: %s: Name of the font size preset. */
|
|
51
|
+
(0, import_i18n.__)(
|
|
52
|
+
'Are you sure you want to delete "%s" font size preset?'
|
|
53
|
+
),
|
|
54
|
+
fontSize.name
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
var confirm_delete_font_size_dialog_default = ConfirmDeleteFontSizeDialog;
|
|
60
|
+
//# sourceMappingURL=confirm-delete-font-size-dialog.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/font-sizes/confirm-delete-font-size-dialog.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport type { FontSize } from '@wordpress/global-styles-engine';\n\ninterface ConfirmDeleteFontSizeDialogProps {\n\tfontSize: FontSize;\n\tisOpen: boolean;\n\ttoggleOpen: () => void;\n\thandleRemoveFontSize: ( fontSize: FontSize ) => void;\n}\n\nfunction ConfirmDeleteFontSizeDialog( {\n\tfontSize,\n\tisOpen,\n\ttoggleOpen,\n\thandleRemoveFontSize,\n}: ConfirmDeleteFontSizeDialogProps ) {\n\tconst handleConfirm = async () => {\n\t\ttoggleOpen();\n\t\thandleRemoveFontSize( fontSize );\n\t};\n\n\tconst handleCancel = () => {\n\t\ttoggleOpen();\n\t};\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isOpen }\n\t\t\tcancelButtonText={ __( 'Cancel' ) }\n\t\t\tconfirmButtonText={ __( 'Delete' ) }\n\t\t\tonCancel={ handleCancel }\n\t\t\tonConfirm={ handleConfirm }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t{ fontSize &&\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: Name of the font size preset. */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Are you sure you want to delete \"%s\" font size preset?'\n\t\t\t\t\t),\n\t\t\t\t\tfontSize.name\n\t\t\t\t) }\n\t\t</ConfirmDialog>\n\t);\n}\n\nexport default ConfirmDeleteFontSizeDialog;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BE;AA3BF,wBAA6D;AAC7D,kBAA4B;AAU5B,SAAS,4BAA6B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAsC;AACrC,QAAM,gBAAgB,YAAY;AACjC,eAAW;AACX,yBAAsB,QAAS;AAAA,EAChC;AAEA,QAAM,eAAe,MAAM;AAC1B,eAAW;AAAA,EACZ;AAEA,SACC;AAAA,IAAC,kBAAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,sBAAmB,gBAAI,QAAS;AAAA,MAChC,uBAAoB,gBAAI,QAAS;AAAA,MACjC,UAAW;AAAA,MACX,WAAY;AAAA,MACZ,MAAK;AAAA,MAEH,0BACD;AAAA;AAAA,YAEC;AAAA,UACC;AAAA,QACD;AAAA,QACA,SAAS;AAAA,MACV;AAAA;AAAA,EACF;AAEF;AAEA,IAAO,0CAAQ;",
|
|
6
|
+
"names": ["ConfirmDialog"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 confirm_reset_font_sizes_dialog_exports = {};
|
|
20
|
+
__export(confirm_reset_font_sizes_dialog_exports, {
|
|
21
|
+
default: () => confirm_reset_font_sizes_dialog_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(confirm_reset_font_sizes_dialog_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
|
+
function ConfirmResetFontSizesDialog({
|
|
28
|
+
text,
|
|
29
|
+
confirmButtonText,
|
|
30
|
+
isOpen,
|
|
31
|
+
toggleOpen,
|
|
32
|
+
onConfirm
|
|
33
|
+
}) {
|
|
34
|
+
const handleConfirm = async () => {
|
|
35
|
+
toggleOpen();
|
|
36
|
+
onConfirm();
|
|
37
|
+
};
|
|
38
|
+
const handleCancel = () => {
|
|
39
|
+
toggleOpen();
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
42
|
+
import_components.__experimentalConfirmDialog,
|
|
43
|
+
{
|
|
44
|
+
isOpen,
|
|
45
|
+
cancelButtonText: (0, import_i18n.__)("Cancel"),
|
|
46
|
+
confirmButtonText,
|
|
47
|
+
onCancel: handleCancel,
|
|
48
|
+
onConfirm: handleConfirm,
|
|
49
|
+
size: "medium",
|
|
50
|
+
children: text
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
var confirm_reset_font_sizes_dialog_default = ConfirmResetFontSizesDialog;
|
|
55
|
+
//# sourceMappingURL=confirm-reset-font-sizes-dialog.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/font-sizes/confirm-reset-font-sizes-dialog.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\ninterface ConfirmResetFontSizesDialogProps {\n\ttext: string;\n\tconfirmButtonText: string;\n\tisOpen: boolean;\n\ttoggleOpen: () => void;\n\tonConfirm: () => void;\n}\n\nfunction ConfirmResetFontSizesDialog( {\n\ttext,\n\tconfirmButtonText,\n\tisOpen,\n\ttoggleOpen,\n\tonConfirm,\n}: ConfirmResetFontSizesDialogProps ) {\n\tconst handleConfirm = async () => {\n\t\ttoggleOpen();\n\t\tonConfirm();\n\t};\n\n\tconst handleCancel = () => {\n\t\ttoggleOpen();\n\t};\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isOpen }\n\t\t\tcancelButtonText={ __( 'Cancel' ) }\n\t\t\tconfirmButtonText={ confirmButtonText }\n\t\t\tonCancel={ handleCancel }\n\t\t\tonConfirm={ handleConfirm }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t{ text }\n\t\t</ConfirmDialog>\n\t);\n}\n\nexport default ConfirmResetFontSizesDialog;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BE;AA5BF,wBAA6D;AAC7D,kBAAmB;AAUnB,SAAS,4BAA6B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAsC;AACrC,QAAM,gBAAgB,YAAY;AACjC,eAAW;AACX,cAAU;AAAA,EACX;AAEA,QAAM,eAAe,MAAM;AAC1B,eAAW;AAAA,EACZ;AAEA,SACC;AAAA,IAAC,kBAAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,sBAAmB,gBAAI,QAAS;AAAA,MAChC;AAAA,MACA,UAAW;AAAA,MACX,WAAY;AAAA,MACZ,MAAK;AAAA,MAEH;AAAA;AAAA,EACH;AAEF;AAEA,IAAO,0CAAQ;",
|
|
6
|
+
"names": ["ConfirmDialog"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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 font_size_preview_exports = {};
|
|
20
|
+
__export(font_size_preview_exports, {
|
|
21
|
+
default: () => font_size_preview_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(font_size_preview_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_block_editor = require("@wordpress/block-editor");
|
|
26
|
+
var import_i18n = require("@wordpress/i18n");
|
|
27
|
+
var import_hooks = require("../hooks");
|
|
28
|
+
function FontSizePreview({ fontSize }) {
|
|
29
|
+
const [font] = (0, import_hooks.useStyle)("typography");
|
|
30
|
+
const input = typeof fontSize?.fluid === "object" && fontSize?.fluid?.min && fontSize?.fluid?.max ? {
|
|
31
|
+
minimumFontSize: fontSize.fluid.min,
|
|
32
|
+
maximumFontSize: fontSize.fluid.max
|
|
33
|
+
} : {
|
|
34
|
+
fontSize: fontSize.size
|
|
35
|
+
};
|
|
36
|
+
const computedFontSize = (0, import_block_editor.getComputedFluidTypographyValue)(input);
|
|
37
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: "global-styles-ui-typography-preview",
|
|
41
|
+
style: {
|
|
42
|
+
fontSize: computedFontSize,
|
|
43
|
+
fontFamily: font?.fontFamily ?? "serif"
|
|
44
|
+
},
|
|
45
|
+
children: (0, import_i18n.__)("Aa")
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
var font_size_preview_default = FontSizePreview;
|
|
50
|
+
//# sourceMappingURL=font-size-preview.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/font-sizes/font-size-preview.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\n// @ts-expect-error: Not typed yet.\nimport { getComputedFluidTypographyValue } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport type { FontSize } from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport { useStyle } from '../hooks';\n\ninterface FontSizePreviewProps {\n\tfontSize: FontSize;\n}\n\nfunction FontSizePreview( { fontSize }: FontSizePreviewProps ) {\n\tconst [ font ] = useStyle< { fontFamily?: string } >( 'typography' );\n\n\tconst input =\n\t\ttypeof fontSize?.fluid === 'object' &&\n\t\tfontSize?.fluid?.min &&\n\t\tfontSize?.fluid?.max\n\t\t\t? {\n\t\t\t\t\tminimumFontSize: fontSize.fluid.min,\n\t\t\t\t\tmaximumFontSize: fontSize.fluid.max,\n\t\t\t }\n\t\t\t: {\n\t\t\t\t\tfontSize: fontSize.size,\n\t\t\t };\n\n\tconst computedFontSize = getComputedFluidTypographyValue( input );\n\treturn (\n\t\t<div\n\t\t\tclassName=\"global-styles-ui-typography-preview\"\n\t\t\tstyle={ {\n\t\t\t\tfontSize: computedFontSize,\n\t\t\t\tfontFamily: font?.fontFamily ?? 'serif',\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Aa' ) }\n\t\t</div>\n\t);\n}\n\nexport default FontSizePreview;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkCE;AA9BF,0BAAgD;AAChD,kBAAmB;AAMnB,mBAAyB;AAMzB,SAAS,gBAAiB,EAAE,SAAS,GAA0B;AAC9D,QAAM,CAAE,IAAK,QAAI,uBAAqC,YAAa;AAEnE,QAAM,QACL,OAAO,UAAU,UAAU,YAC3B,UAAU,OAAO,OACjB,UAAU,OAAO,MACd;AAAA,IACA,iBAAiB,SAAS,MAAM;AAAA,IAChC,iBAAiB,SAAS,MAAM;AAAA,EAChC,IACA;AAAA,IACA,UAAU,SAAS;AAAA,EACnB;AAEJ,QAAM,uBAAmB,qDAAiC,KAAM;AAChE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,OAAQ;AAAA,QACP,UAAU;AAAA,QACV,YAAY,MAAM,cAAc;AAAA,MACjC;AAAA,MAEE,8BAAI,IAAK;AAAA;AAAA,EACZ;AAEF;AAEA,IAAO,4BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,261 @@
|
|
|
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 font_size_exports = {};
|
|
30
|
+
__export(font_size_exports, {
|
|
31
|
+
default: () => font_size_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(font_size_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_icons = require("@wordpress/icons");
|
|
38
|
+
var import_element = require("@wordpress/element");
|
|
39
|
+
var import_screen_header = require("../screen-header");
|
|
40
|
+
var import_font_size_preview = __toESM(require("./font-size-preview"));
|
|
41
|
+
var import_confirm_delete_font_size_dialog = __toESM(require("./confirm-delete-font-size-dialog"));
|
|
42
|
+
var import_rename_font_size_dialog = __toESM(require("./rename-font-size-dialog"));
|
|
43
|
+
var import_size_control = require("../size-control");
|
|
44
|
+
var import_hooks = require("../hooks");
|
|
45
|
+
var import_lock_unlock = require("../lock-unlock");
|
|
46
|
+
const { Menu } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
47
|
+
function FontSize() {
|
|
48
|
+
const [isDeleteConfirmOpen, setIsDeleteConfirmOpen] = (0, import_element.useState)(false);
|
|
49
|
+
const [isRenameDialogOpen, setIsRenameDialogOpen] = (0, import_element.useState)(false);
|
|
50
|
+
const {
|
|
51
|
+
params: { origin, slug },
|
|
52
|
+
goBack
|
|
53
|
+
} = (0, import_components.useNavigator)();
|
|
54
|
+
const [fontSizes, setFontSizes] = (0, import_hooks.useSetting)("typography.fontSizes");
|
|
55
|
+
const [globalFluid] = (0, import_hooks.useSetting)("typography.fluid");
|
|
56
|
+
const sizes = fontSizes?.[origin] ?? [];
|
|
57
|
+
const fontSize = sizes.find(
|
|
58
|
+
(size) => size.slug === slug
|
|
59
|
+
);
|
|
60
|
+
(0, import_element.useEffect)(() => {
|
|
61
|
+
if (!!slug && !fontSize) {
|
|
62
|
+
goBack();
|
|
63
|
+
}
|
|
64
|
+
}, [slug, fontSize, goBack]);
|
|
65
|
+
if (!origin || !slug || !fontSize) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
const isFluid = fontSize?.fluid !== void 0 ? !!fontSize.fluid : !!globalFluid;
|
|
69
|
+
const isCustomFluid = typeof fontSize?.fluid === "object";
|
|
70
|
+
const handleNameChange = (value) => {
|
|
71
|
+
updateFontSize("name", value);
|
|
72
|
+
};
|
|
73
|
+
const handleFontSizeChange = (value) => {
|
|
74
|
+
updateFontSize("size", value);
|
|
75
|
+
};
|
|
76
|
+
const handleFluidChange = (value) => {
|
|
77
|
+
updateFontSize("fluid", value);
|
|
78
|
+
};
|
|
79
|
+
const handleCustomFluidValues = (value) => {
|
|
80
|
+
if (value) {
|
|
81
|
+
updateFontSize("fluid", {
|
|
82
|
+
min: fontSize.size,
|
|
83
|
+
max: fontSize.size
|
|
84
|
+
});
|
|
85
|
+
} else {
|
|
86
|
+
updateFontSize("fluid", true);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const handleMinChange = (value) => {
|
|
90
|
+
const fluid = typeof fontSize.fluid === "object" ? fontSize.fluid : {};
|
|
91
|
+
updateFontSize("fluid", { ...fluid, min: value });
|
|
92
|
+
};
|
|
93
|
+
const handleMaxChange = (value) => {
|
|
94
|
+
const fluid = typeof fontSize.fluid === "object" ? fontSize.fluid : {};
|
|
95
|
+
updateFontSize("fluid", { ...fluid, max: value });
|
|
96
|
+
};
|
|
97
|
+
const updateFontSize = (key, value) => {
|
|
98
|
+
const newFontSizes = sizes.map((size) => {
|
|
99
|
+
if (size.slug === slug) {
|
|
100
|
+
return { ...size, [key]: value };
|
|
101
|
+
}
|
|
102
|
+
return size;
|
|
103
|
+
});
|
|
104
|
+
setFontSizes({
|
|
105
|
+
...fontSizes,
|
|
106
|
+
[origin]: newFontSizes
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
const handleRemoveFontSize = () => {
|
|
110
|
+
const newFontSizes = sizes.filter((size) => size.slug !== slug);
|
|
111
|
+
setFontSizes({
|
|
112
|
+
...fontSizes,
|
|
113
|
+
[origin]: newFontSizes
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
const toggleDeleteConfirm = () => {
|
|
117
|
+
setIsDeleteConfirmOpen(!isDeleteConfirmOpen);
|
|
118
|
+
};
|
|
119
|
+
const toggleRenameDialog = () => {
|
|
120
|
+
setIsRenameDialogOpen(!isRenameDialogOpen);
|
|
121
|
+
};
|
|
122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
123
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
124
|
+
import_confirm_delete_font_size_dialog.default,
|
|
125
|
+
{
|
|
126
|
+
fontSize,
|
|
127
|
+
isOpen: isDeleteConfirmOpen,
|
|
128
|
+
toggleOpen: toggleDeleteConfirm,
|
|
129
|
+
handleRemoveFontSize
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
isRenameDialogOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
133
|
+
import_rename_font_size_dialog.default,
|
|
134
|
+
{
|
|
135
|
+
fontSize,
|
|
136
|
+
toggleOpen: toggleRenameDialog,
|
|
137
|
+
handleRename: handleNameChange
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 4, children: [
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "space-between", alignment: "flex-start", children: [
|
|
142
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
143
|
+
import_screen_header.ScreenHeader,
|
|
144
|
+
{
|
|
145
|
+
title: fontSize.name,
|
|
146
|
+
description: (0, import_i18n.sprintf)(
|
|
147
|
+
/* translators: %s: font size preset name. */
|
|
148
|
+
(0, import_i18n.__)("Manage the font size %s."),
|
|
149
|
+
fontSize.name
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
origin === "custom" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
154
|
+
import_components.__experimentalSpacer,
|
|
155
|
+
{
|
|
156
|
+
marginTop: 3,
|
|
157
|
+
marginBottom: 0,
|
|
158
|
+
paddingX: 4,
|
|
159
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Menu, { children: [
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
+
Menu.TriggerButton,
|
|
162
|
+
{
|
|
163
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
164
|
+
import_components.Button,
|
|
165
|
+
{
|
|
166
|
+
size: "small",
|
|
167
|
+
icon: import_icons.moreVertical,
|
|
168
|
+
label: (0, import_i18n.__)(
|
|
169
|
+
"Font size options"
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
),
|
|
175
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Menu.Popover, { children: [
|
|
176
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
177
|
+
Menu.Item,
|
|
178
|
+
{
|
|
179
|
+
onClick: toggleRenameDialog,
|
|
180
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Menu.ItemLabel, { children: (0, import_i18n.__)("Rename") })
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
184
|
+
Menu.Item,
|
|
185
|
+
{
|
|
186
|
+
onClick: toggleDeleteConfirm,
|
|
187
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Menu.ItemLabel, { children: (0, import_i18n.__)("Delete") })
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
] })
|
|
191
|
+
] })
|
|
192
|
+
}
|
|
193
|
+
) })
|
|
194
|
+
] }),
|
|
195
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalView, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
196
|
+
import_components.__experimentalSpacer,
|
|
197
|
+
{
|
|
198
|
+
paddingX: 4,
|
|
199
|
+
marginBottom: 0,
|
|
200
|
+
paddingBottom: 6,
|
|
201
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 4, children: [
|
|
202
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_font_size_preview.default, { fontSize }) }),
|
|
203
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
204
|
+
import_size_control.SizeControl,
|
|
205
|
+
{
|
|
206
|
+
label: (0, import_i18n.__)("Size"),
|
|
207
|
+
value: !isCustomFluid && fontSize.size ? String(fontSize.size) : "",
|
|
208
|
+
onChange: handleFontSizeChange,
|
|
209
|
+
disabled: isCustomFluid
|
|
210
|
+
}
|
|
211
|
+
),
|
|
212
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
213
|
+
import_components.ToggleControl,
|
|
214
|
+
{
|
|
215
|
+
label: (0, import_i18n.__)("Fluid typography"),
|
|
216
|
+
help: (0, import_i18n.__)(
|
|
217
|
+
"Scale the font size dynamically to fit the screen or viewport."
|
|
218
|
+
),
|
|
219
|
+
checked: isFluid,
|
|
220
|
+
onChange: handleFluidChange,
|
|
221
|
+
__nextHasNoMarginBottom: true
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
isFluid && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
225
|
+
import_components.ToggleControl,
|
|
226
|
+
{
|
|
227
|
+
label: (0, import_i18n.__)("Custom fluid values"),
|
|
228
|
+
help: (0, import_i18n.__)(
|
|
229
|
+
"Set custom min and max values for the fluid font size."
|
|
230
|
+
),
|
|
231
|
+
checked: isCustomFluid,
|
|
232
|
+
onChange: handleCustomFluidValues,
|
|
233
|
+
__nextHasNoMarginBottom: true
|
|
234
|
+
}
|
|
235
|
+
),
|
|
236
|
+
isCustomFluid && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
238
|
+
import_size_control.SizeControl,
|
|
239
|
+
{
|
|
240
|
+
label: (0, import_i18n.__)("Minimum"),
|
|
241
|
+
value: typeof fontSize?.fluid === "object" ? fontSize.fluid?.min : void 0,
|
|
242
|
+
onChange: handleMinChange
|
|
243
|
+
}
|
|
244
|
+
),
|
|
245
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
246
|
+
import_size_control.SizeControl,
|
|
247
|
+
{
|
|
248
|
+
label: (0, import_i18n.__)("Maximum"),
|
|
249
|
+
value: typeof fontSize?.fluid === "object" ? fontSize.fluid?.max : void 0,
|
|
250
|
+
onChange: handleMaxChange
|
|
251
|
+
}
|
|
252
|
+
)
|
|
253
|
+
] })
|
|
254
|
+
] })
|
|
255
|
+
}
|
|
256
|
+
) })
|
|
257
|
+
] })
|
|
258
|
+
] });
|
|
259
|
+
}
|
|
260
|
+
var font_size_default = FontSize;
|
|
261
|
+
//# sourceMappingURL=font-size.js.map
|