@wordpress/edit-site 6.32.0 → 6.32.1-next.b8c8708f3.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/build/components/add-new-pattern/index.js +153 -141
- package/build/components/add-new-pattern/index.js.map +7 -1
- package/build/components/add-new-post/index.js +114 -89
- package/build/components/add-new-post/index.js.map +7 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +80 -60
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +7 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +284 -207
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +7 -1
- package/build/components/add-new-template/index.js +309 -248
- package/build/components/add-new-template/index.js.map +7 -1
- package/build/components/add-new-template/utils.js +459 -446
- package/build/components/add-new-template/utils.js.map +7 -1
- package/build/components/app/index.js +72 -63
- package/build/components/app/index.js.map +7 -1
- package/build/components/block-editor/use-editor-iframe-props.js +63 -66
- package/build/components/block-editor/use-editor-iframe-props.js.map +7 -1
- package/build/components/block-editor/use-navigate-to-entity-record.js +34 -22
- package/build/components/block-editor/use-navigate-to-entity-record.js.map +7 -1
- package/build/components/block-editor/use-site-editor-settings.js +64 -51
- package/build/components/block-editor/use-site-editor-settings.js.map +7 -1
- package/build/components/canvas-loader/index.js +41 -56
- package/build/components/canvas-loader/index.js.map +7 -1
- package/build/components/dataviews-actions/index.js +96 -83
- package/build/components/dataviews-actions/index.js.map +7 -1
- package/build/components/editor/index.js +288 -235
- package/build/components/editor/index.js.map +7 -1
- package/build/components/editor/site-preview.js +55 -42
- package/build/components/editor/site-preview.js.map +7 -1
- package/build/components/editor/use-adapt-editor-to-canvas.js +49 -31
- package/build/components/editor/use-adapt-editor-to-canvas.js.map +7 -1
- package/build/components/editor/use-editor-title.js +79 -61
- package/build/components/editor/use-editor-title.js.map +7 -1
- package/build/components/editor/use-resolve-edited-entity.js +112 -140
- package/build/components/editor/use-resolve-edited-entity.js.map +7 -1
- package/build/components/editor-canvas-container/index.js +101 -91
- package/build/components/editor-canvas-container/index.js.map +7 -1
- package/build/components/global-styles/background-panel.js +46 -39
- package/build/components/global-styles/background-panel.js.map +7 -1
- package/build/components/global-styles/block-preview-panel.js +58 -52
- package/build/components/global-styles/block-preview-panel.js.map +7 -1
- package/build/components/global-styles/color-indicator-wrapper.js +47 -26
- package/build/components/global-styles/color-indicator-wrapper.js.map +7 -1
- package/build/components/global-styles/color-palette-panel.js +130 -81
- package/build/components/global-styles/color-palette-panel.js.map +7 -1
- package/build/components/global-styles/confirm-reset-shadow-dialog.js +38 -22
- package/build/components/global-styles/confirm-reset-shadow-dialog.js.map +7 -1
- package/build/components/global-styles/dimensions-panel.js +46 -41
- package/build/components/global-styles/dimensions-panel.js.map +7 -1
- package/build/components/global-styles/font-families.js +106 -102
- package/build/components/global-styles/font-families.js.map +7 -1
- package/build/components/global-styles/font-family-item.js +41 -43
- package/build/components/global-styles/font-family-item.js.map +7 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +55 -39
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +7 -1
- package/build/components/global-styles/font-library-modal/context.js +228 -243
- package/build/components/global-styles/font-library-modal/context.js.map +7 -1
- package/build/components/global-styles/font-library-modal/font-card.js +70 -59
- package/build/components/global-styles/font-library-modal/font-card.js.map +7 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +407 -321
- package/build/components/global-styles/font-library-modal/font-collection.js.map +7 -1
- package/build/components/global-styles/font-library-modal/font-demo.js +54 -50
- package/build/components/global-styles/font-library-modal/font-demo.js.map +7 -1
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +52 -44
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +7 -1
- package/build/components/global-styles/font-library-modal/index.js +90 -87
- package/build/components/global-styles/font-library-modal/index.js.map +7 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +369 -255
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +7 -1
- package/build/components/global-styles/font-library-modal/library-font-details.js +60 -42
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +7 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +64 -49
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +7 -1
- package/build/components/global-styles/font-library-modal/resolvers.js +64 -31
- package/build/components/global-styles/font-library-modal/resolvers.js.map +7 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +133 -145
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/constants.js +45 -24
- package/build/components/global-styles/font-library-modal/utils/constants.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +30 -27
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +41 -13
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +127 -161
- package/build/components/global-styles/font-library-modal/utils/index.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +25 -18
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js +55 -74
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +32 -16
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js +43 -72
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +7 -1
- package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +44 -23
- package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +7 -1
- package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +38 -22
- package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +7 -1
- package/build/components/global-styles/font-sizes/font-size-preview.js +42 -35
- package/build/components/global-styles/font-sizes/font-size-preview.js.map +7 -1
- package/build/components/global-styles/font-sizes/font-size.js +207 -170
- package/build/components/global-styles/font-sizes/font-size.js.map +7 -1
- package/build/components/global-styles/font-sizes/font-sizes-count.js +46 -45
- package/build/components/global-styles/font-sizes/font-sizes-count.js.map +7 -1
- package/build/components/global-styles/font-sizes/font-sizes.js +199 -136
- package/build/components/global-styles/font-sizes/font-sizes.js.map +7 -1
- package/build/components/global-styles/font-sizes/rename-font-size-dialog.js +81 -58
- package/build/components/global-styles/font-sizes/rename-font-size-dialog.js.map +7 -1
- package/build/components/global-styles/gradients-palette-panel.js +140 -85
- package/build/components/global-styles/gradients-palette-panel.js.map +7 -1
- package/build/components/global-styles/header.js +51 -48
- package/build/components/global-styles/header.js.map +7 -1
- package/build/components/global-styles/highlighted-colors.js +48 -40
- package/build/components/global-styles/highlighted-colors.js.map +7 -1
- package/build/components/global-styles/hooks.js +89 -68
- package/build/components/global-styles/hooks.js.map +7 -1
- package/build/components/global-styles/icon-with-current-color.js +50 -25
- package/build/components/global-styles/icon-with-current-color.js.map +7 -1
- package/build/components/global-styles/index.js +36 -11
- package/build/components/global-styles/index.js.map +7 -1
- package/build/components/global-styles/navigation-button.js +41 -42
- package/build/components/global-styles/navigation-button.js.map +7 -1
- package/build/components/global-styles/palette.js +82 -73
- package/build/components/global-styles/palette.js.map +7 -1
- package/build/components/global-styles/preset-colors.js +36 -24
- package/build/components/global-styles/preset-colors.js.map +7 -1
- package/build/components/global-styles/preview-colors.js +68 -46
- package/build/components/global-styles/preview-colors.js.map +7 -1
- package/build/components/global-styles/preview-styles.js +182 -136
- package/build/components/global-styles/preview-styles.js.map +7 -1
- package/build/components/global-styles/preview-typography.js +65 -44
- package/build/components/global-styles/preview-typography.js.map +7 -1
- package/build/components/global-styles/preview-wrapper.js +70 -85
- package/build/components/global-styles/preview-wrapper.js.map +7 -1
- package/build/components/global-styles/root-menu.js +53 -52
- package/build/components/global-styles/root-menu.js.map +7 -1
- package/build/components/global-styles/screen-background.js +54 -35
- package/build/components/global-styles/screen-background.js.map +7 -1
- package/build/components/global-styles/screen-block-list.js +129 -118
- package/build/components/global-styles/screen-block-list.js.map +7 -1
- package/build/components/global-styles/screen-block.js +185 -182
- package/build/components/global-styles/screen-block.js.map +7 -1
- package/build/components/global-styles/screen-color-palette.js +61 -56
- package/build/components/global-styles/screen-color-palette.js.map +7 -1
- package/build/components/global-styles/screen-colors.js +64 -40
- package/build/components/global-styles/screen-colors.js.map +7 -1
- package/build/components/global-styles/screen-css.js +80 -50
- package/build/components/global-styles/screen-css.js.map +7 -1
- package/build/components/global-styles/screen-layout.js +45 -32
- package/build/components/global-styles/screen-layout.js.map +7 -1
- package/build/components/global-styles/screen-revisions/index.js +144 -116
- package/build/components/global-styles/screen-revisions/index.js.map +7 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +165 -166
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +7 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +93 -81
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +7 -1
- package/build/components/global-styles/screen-root.js +93 -84
- package/build/components/global-styles/screen-root.js.map +7 -1
- package/build/components/global-styles/screen-shadows.js +43 -16
- package/build/components/global-styles/screen-shadows.js.map +7 -1
- package/build/components/global-styles/screen-style-variations.js +64 -44
- package/build/components/global-styles/screen-style-variations.js.map +7 -1
- package/build/components/global-styles/screen-typography-element.js +146 -93
- package/build/components/global-styles/screen-typography-element.js.map +7 -1
- package/build/components/global-styles/screen-typography.js +64 -40
- package/build/components/global-styles/screen-typography.js.map +7 -1
- package/build/components/global-styles/shadow-utils.js +75 -180
- package/build/components/global-styles/shadow-utils.js.map +7 -1
- package/build/components/global-styles/shadows-edit-panel.js +433 -358
- package/build/components/global-styles/shadows-edit-panel.js.map +7 -1
- package/build/components/global-styles/shadows-panel.js +178 -131
- package/build/components/global-styles/shadows-panel.js.map +7 -1
- package/build/components/global-styles/size-control/index.js +66 -76
- package/build/components/global-styles/size-control/index.js.map +7 -1
- package/build/components/global-styles/style-variations-container.js +114 -102
- package/build/components/global-styles/style-variations-container.js.map +7 -1
- package/build/components/global-styles/subtitle.js +34 -21
- package/build/components/global-styles/subtitle.js.map +7 -1
- package/build/components/global-styles/typeset.js +73 -75
- package/build/components/global-styles/typeset.js.map +7 -1
- package/build/components/global-styles/typography-elements.js +109 -86
- package/build/components/global-styles/typography-elements.js.map +7 -1
- package/build/components/global-styles/typography-example.js +66 -65
- package/build/components/global-styles/typography-example.js.map +7 -1
- package/build/components/global-styles/typography-panel.js +57 -39
- package/build/components/global-styles/typography-panel.js.map +7 -1
- package/build/components/global-styles/typography-preview.js +73 -53
- package/build/components/global-styles/typography-preview.js.map +7 -1
- package/build/components/global-styles/ui.js +282 -314
- package/build/components/global-styles/ui.js.map +7 -1
- package/build/components/global-styles/utils.js +45 -31
- package/build/components/global-styles/utils.js.map +7 -1
- package/build/components/global-styles/variations/variation.js +90 -74
- package/build/components/global-styles/variations/variation.js.map +7 -1
- package/build/components/global-styles/variations/variations-color.js +52 -41
- package/build/components/global-styles/variations/variations-color.js.map +7 -1
- package/build/components/global-styles/variations/variations-panel.js +61 -51
- package/build/components/global-styles/variations/variations-panel.js.map +7 -1
- package/build/components/global-styles/variations/variations-typography.js +69 -49
- package/build/components/global-styles/variations/variations-typography.js.map +7 -1
- package/build/components/global-styles-renderer/index.js +39 -33
- package/build/components/global-styles-renderer/index.js.map +7 -1
- package/build/components/global-styles-sidebar/default-sidebar.js +53 -40
- package/build/components/global-styles-sidebar/default-sidebar.js.map +7 -1
- package/build/components/global-styles-sidebar/index.js +164 -141
- package/build/components/global-styles-sidebar/index.js.map +7 -1
- package/build/components/layout/animation.js +53 -78
- package/build/components/layout/animation.js.map +7 -1
- package/build/components/layout/hooks.js +40 -35
- package/build/components/layout/hooks.js.map +7 -1
- package/build/components/layout/index.js +220 -199
- package/build/components/layout/index.js.map +7 -1
- package/build/components/media/index.js +31 -26
- package/build/components/media/index.js.map +7 -1
- package/build/components/more-menu/index.js +45 -28
- package/build/components/more-menu/index.js.map +7 -1
- package/build/components/more-menu/site-export.js +69 -44
- package/build/components/more-menu/site-export.js.map +7 -1
- package/build/components/more-menu/welcome-guide-menu-item.js +29 -21
- package/build/components/more-menu/welcome-guide-menu-item.js.map +7 -1
- package/build/components/page-patterns/actions.js +82 -0
- package/build/components/page-patterns/actions.js.map +7 -0
- package/build/components/page-patterns/delete-category-menu-item.js +94 -82
- package/build/components/page-patterns/delete-category-menu-item.js.map +7 -1
- package/build/components/page-patterns/fields.js +135 -123
- package/build/components/page-patterns/fields.js.map +7 -1
- package/build/components/page-patterns/index.js +182 -148
- package/build/components/page-patterns/index.js.map +7 -1
- package/build/components/page-patterns/rename-category-menu-item.js +67 -62
- package/build/components/page-patterns/rename-category-menu-item.js.map +7 -1
- package/build/components/page-patterns/search-items.js +65 -89
- package/build/components/page-patterns/search-items.js.map +7 -1
- package/build/components/page-patterns/use-pattern-settings.js +45 -35
- package/build/components/page-patterns/use-pattern-settings.js.map +7 -1
- package/build/components/page-patterns/use-patterns.js +266 -200
- package/build/components/page-patterns/use-patterns.js.map +7 -1
- package/build/components/page-patterns/utils.js +27 -7
- package/build/components/page-patterns/utils.js.map +7 -1
- package/build/components/page-templates/fields.js +165 -159
- package/build/components/page-templates/fields.js.map +7 -1
- package/build/components/page-templates/hooks.js +66 -64
- package/build/components/page-templates/hooks.js.map +7 -1
- package/build/components/page-templates/index.js +211 -207
- package/build/components/page-templates/index.js.map +7 -1
- package/build/components/page-templates/view-utils.js +67 -0
- package/build/components/page-templates/view-utils.js.map +7 -0
- package/build/components/pagination/index.js +119 -82
- package/build/components/pagination/index.js.map +7 -1
- package/build/components/plugin-template-setting-panel/index.js +49 -56
- package/build/components/plugin-template-setting-panel/index.js.map +7 -1
- package/build/components/post-edit/index.js +171 -149
- package/build/components/post-edit/index.js.map +7 -1
- package/build/components/post-list/index.js +230 -301
- package/build/components/post-list/index.js.map +7 -1
- package/build/components/post-list/view-utils.js +167 -0
- package/build/components/post-list/view-utils.js.map +7 -0
- package/build/components/posts-app/index.js +44 -32
- package/build/components/posts-app/index.js.map +7 -1
- package/build/components/posts-app-routes/index.js +36 -25
- package/build/components/posts-app-routes/index.js.map +7 -1
- package/build/components/posts-app-routes/post-item.js +54 -35
- package/build/components/posts-app-routes/post-item.js.map +7 -1
- package/build/components/posts-app-routes/posts.js +91 -76
- package/build/components/posts-app-routes/posts.js.map +7 -1
- package/build/components/resizable-frame/index.js +200 -224
- package/build/components/resizable-frame/index.js.map +7 -1
- package/build/components/revisions/index.js +102 -71
- package/build/components/revisions/index.js.map +7 -1
- package/build/components/routes/use-title.js +45 -35
- package/build/components/routes/use-title.js.map +7 -1
- package/build/components/save-button/index.js +113 -111
- package/build/components/save-button/index.js.map +7 -1
- package/build/components/save-hub/index.js +52 -40
- package/build/components/save-hub/index.js.map +7 -1
- package/build/components/save-keyboard-shortcut/index.js +46 -52
- package/build/components/save-keyboard-shortcut/index.js.map +7 -1
- package/build/components/save-panel/index.js +155 -136
- package/build/components/save-panel/index.js.map +7 -1
- package/build/components/sidebar/index.js +81 -79
- package/build/components/sidebar/index.js.map +7 -1
- package/build/components/sidebar-button/index.js +43 -22
- package/build/components/sidebar-button/index.js.map +7 -1
- package/build/components/sidebar-dataviews/dataview-item.js +68 -55
- package/build/components/sidebar-dataviews/dataview-item.js.map +7 -1
- package/build/components/sidebar-dataviews/index.js +68 -54
- package/build/components/sidebar-dataviews/index.js.map +7 -1
- package/build/components/sidebar-global-styles-wrapper/index.js +125 -111
- package/build/components/sidebar-global-styles-wrapper/index.js.map +7 -1
- package/build/components/sidebar-navigation-item/index.js +79 -62
- package/build/components/sidebar-navigation-item/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen/index.js +129 -104
- package/build/components/sidebar-navigation-screen/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +63 -53
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-global-styles/content.js +50 -33
- package/build/components/sidebar-navigation-screen-global-styles/content.js.map +7 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +94 -81
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-main/index.js +141 -90
- package/build/components/sidebar-navigation-screen-main/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +40 -29
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +124 -91
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +116 -83
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +57 -48
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +80 -66
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +64 -38
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +125 -96
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +33 -19
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +30 -16
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +119 -105
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +130 -121
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +106 -88
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +7 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +44 -21
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +7 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +129 -106
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +36 -25
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +7 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +81 -70
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +7 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +42 -32
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +7 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +41 -28
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +7 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +95 -76
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +7 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +48 -27
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-unsupported/index.js +28 -20
- package/build/components/sidebar-navigation-screen-unsupported/index.js.map +7 -1
- package/build/components/site-editor-routes/home.js +50 -32
- package/build/components/site-editor-routes/home.js.map +7 -1
- package/build/components/site-editor-routes/index.js +62 -36
- package/build/components/site-editor-routes/index.js.map +7 -1
- package/build/components/site-editor-routes/navigation-item.js +55 -49
- package/build/components/site-editor-routes/navigation-item.js.map +7 -1
- package/build/components/site-editor-routes/navigation.js +55 -49
- package/build/components/site-editor-routes/navigation.js.map +7 -1
- package/build/components/site-editor-routes/notfound.js +54 -34
- package/build/components/site-editor-routes/notfound.js.map +7 -1
- package/build/components/site-editor-routes/page-item.js +58 -41
- package/build/components/site-editor-routes/page-item.js.map +7 -1
- package/build/components/site-editor-routes/pages.js +96 -86
- package/build/components/site-editor-routes/pages.js.map +7 -1
- package/build/components/site-editor-routes/pattern-item.js +48 -26
- package/build/components/site-editor-routes/pattern-item.js.map +7 -1
- package/build/components/site-editor-routes/patterns.js +51 -36
- package/build/components/site-editor-routes/patterns.js.map +7 -1
- package/build/components/site-editor-routes/stylebook.js +60 -43
- package/build/components/site-editor-routes/stylebook.js.map +7 -1
- package/build/components/site-editor-routes/styles.js +58 -46
- package/build/components/site-editor-routes/styles.js.map +7 -1
- package/build/components/site-editor-routes/template-item.js +54 -34
- package/build/components/site-editor-routes/template-item.js.map +7 -1
- package/build/components/site-editor-routes/template-part-item.js +45 -21
- package/build/components/site-editor-routes/template-part-item.js.map +7 -1
- package/build/components/site-editor-routes/templates.js +69 -44
- package/build/components/site-editor-routes/templates.js.map +7 -1
- package/build/components/site-editor-routes/utils.js +27 -13
- package/build/components/site-editor-routes/utils.js.map +7 -1
- package/build/components/site-hub/index.js +233 -222
- package/build/components/site-hub/index.js.map +7 -1
- package/build/components/site-icon/index.js +61 -49
- package/build/components/site-icon/index.js.map +7 -1
- package/build/components/style-book/categories.js +61 -52
- package/build/components/style-book/categories.js.map +7 -1
- package/build/components/style-book/color-examples.js +54 -40
- package/build/components/style-book/color-examples.js.map +7 -1
- package/build/components/style-book/constants.js +218 -144
- package/build/components/style-book/constants.js.map +7 -1
- package/build/components/style-book/duotone-examples.js +54 -40
- package/build/components/style-book/duotone-examples.js.map +7 -1
- package/build/components/style-book/examples.js +145 -120
- package/build/components/style-book/examples.js.map +7 -1
- package/build/components/style-book/index.js +454 -409
- package/build/components/style-book/index.js.map +7 -1
- package/build/components/style-book/types.js +16 -5
- package/build/components/style-book/types.js.map +7 -1
- package/build/components/welcome-guide/editor.js +87 -60
- package/build/components/welcome-guide/editor.js.map +7 -1
- package/build/components/welcome-guide/image.js +34 -22
- package/build/components/welcome-guide/image.js.map +7 -1
- package/build/components/welcome-guide/index.js +44 -21
- package/build/components/welcome-guide/index.js.map +7 -1
- package/build/components/welcome-guide/page.js +76 -52
- package/build/components/welcome-guide/page.js.map +7 -1
- package/build/components/welcome-guide/styles.js +135 -102
- package/build/components/welcome-guide/styles.js.map +7 -1
- package/build/components/welcome-guide/template.js +71 -59
- package/build/components/welcome-guide/template.js.map +7 -1
- package/build/deprecated.js +56 -46
- package/build/deprecated.js.map +7 -1
- package/build/hooks/commands/use-common-commands.js +117 -119
- package/build/hooks/commands/use-common-commands.js.map +7 -1
- package/build/hooks/commands/use-set-command-context.js +40 -50
- package/build/hooks/commands/use-set-command-context.js.map +7 -1
- package/build/hooks/index.js +2 -3
- package/build/hooks/index.js.map +7 -1
- package/build/hooks/push-changes-to-global-styles/index.js +236 -251
- package/build/hooks/push-changes-to-global-styles/index.js.map +7 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +78 -111
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +7 -1
- package/build/index.js +87 -112
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -14
- package/build/lock-unlock.js.map +7 -1
- package/build/posts.js +67 -63
- package/build/posts.js.map +7 -1
- package/build/store/actions.js +199 -365
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +27 -11
- package/build/store/constants.js.map +7 -1
- package/build/store/index.js +52 -30
- package/build/store/index.js.map +7 -1
- package/build/store/private-actions.js +34 -19
- package/build/store/private-actions.js.map +7 -1
- package/build/store/private-selectors.js +28 -13
- package/build/store/private-selectors.js.map +7 -1
- package/build/store/reducer.js +42 -57
- package/build/store/reducer.js.map +7 -1
- package/build/store/selectors.js +205 -301
- package/build/store/selectors.js.map +7 -1
- package/build/utils/constants.js +94 -53
- package/build/utils/constants.js.map +7 -1
- package/build/utils/get-filtered-template-parts.js +36 -42
- package/build/utils/get-filtered-template-parts.js.map +7 -1
- package/build/utils/is-previewing-theme.js +31 -13
- package/build/utils/is-previewing-theme.js.map +7 -1
- package/build/utils/is-template-removable.js +24 -17
- package/build/utils/is-template-removable.js.map +7 -1
- package/build/utils/is-template-revertable.js +24 -19
- package/build/utils/is-template-revertable.js.map +7 -1
- package/build/utils/set-nested-value.js +24 -25
- package/build/utils/set-nested-value.js.map +7 -1
- package/build/utils/template-part-create.js +1 -1
- package/build/utils/template-part-create.js.map +7 -1
- package/build/utils/use-activate-theme.js +40 -45
- package/build/utils/use-activate-theme.js.map +7 -1
- package/build/utils/use-actual-current-theme.js +47 -25
- package/build/utils/use-actual-current-theme.js.map +7 -1
- package/build-module/components/add-new-pattern/index.js +133 -127
- package/build-module/components/add-new-pattern/index.js.map +7 -1
- package/build-module/components/add-new-post/index.js +100 -82
- package/build-module/components/add-new-post/index.js.map +7 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +63 -51
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +7 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +269 -196
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +7 -1
- package/build-module/components/add-new-template/index.js +289 -219
- package/build-module/components/add-new-template/index.js.map +7 -1
- package/build-module/components/add-new-template/utils.js +430 -432
- package/build-module/components/add-new-template/utils.js.map +7 -1
- package/build-module/components/app/index.js +41 -51
- package/build-module/components/app/index.js.map +7 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +33 -58
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +7 -1
- package/build-module/components/block-editor/use-navigate-to-entity-record.js +17 -18
- package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +7 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +28 -41
- package/build-module/components/block-editor/use-site-editor-settings.js.map +7 -1
- package/build-module/components/canvas-loader/index.js +25 -50
- package/build-module/components/canvas-loader/index.js.map +7 -1
- package/build-module/components/dataviews-actions/index.js +75 -78
- package/build-module/components/dataviews-actions/index.js.map +7 -1
- package/build-module/components/editor/index.js +261 -220
- package/build-module/components/editor/index.js.map +7 -1
- package/build-module/components/editor/site-preview.js +38 -38
- package/build-module/components/editor/site-preview.js.map +7 -1
- package/build-module/components/editor/use-adapt-editor-to-canvas.js +25 -24
- package/build-module/components/editor/use-adapt-editor-to-canvas.js.map +7 -1
- package/build-module/components/editor/use-editor-title.js +49 -53
- package/build-module/components/editor/use-editor-title.js.map +7 -1
- package/build-module/components/editor/use-resolve-edited-entity.js +89 -129
- package/build-module/components/editor/use-resolve-edited-entity.js.map +7 -1
- package/build-module/components/editor-canvas-container/index.js +79 -80
- package/build-module/components/editor-canvas-container/index.js.map +7 -1
- package/build-module/components/global-styles/background-panel.js +25 -35
- package/build-module/components/global-styles/background-panel.js.map +7 -1
- package/build-module/components/global-styles/block-preview-panel.js +36 -43
- package/build-module/components/global-styles/block-preview-panel.js.map +7 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +19 -20
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +7 -1
- package/build-module/components/global-styles/color-palette-panel.js +105 -74
- package/build-module/components/global-styles/color-palette-panel.js.map +7 -1
- package/build-module/components/global-styles/confirm-reset-shadow-dialog.js +20 -17
- package/build-module/components/global-styles/confirm-reset-shadow-dialog.js.map +7 -1
- package/build-module/components/global-styles/dimensions-panel.js +26 -34
- package/build-module/components/global-styles/dimensions-panel.js.map +7 -1
- package/build-module/components/global-styles/font-families.js +86 -93
- package/build-module/components/global-styles/font-families.js.map +7 -1
- package/build-module/components/global-styles/font-family-item.js +26 -37
- package/build-module/components/global-styles/font-family-item.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +26 -32
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/context.js +203 -224
- package/build-module/components/global-styles/font-library-modal/context.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/font-card.js +48 -52
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +397 -302
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/font-demo.js +32 -38
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +41 -39
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/index.js +65 -81
- package/build-module/components/global-styles/font-library-modal/index.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +354 -243
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/library-font-details.js +35 -36
- package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +35 -42
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js +27 -20
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +111 -135
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/constants.js +21 -19
- package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +13 -24
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +20 -10
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +102 -154
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +8 -14
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +34 -71
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +11 -13
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +22 -69
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +7 -1
- package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +26 -18
- package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +7 -1
- package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +20 -17
- package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +7 -1
- package/build-module/components/global-styles/font-sizes/font-size-preview.js +26 -29
- package/build-module/components/global-styles/font-sizes/font-size-preview.js.map +7 -1
- package/build-module/components/global-styles/font-sizes/font-size.js +185 -160
- package/build-module/components/global-styles/font-sizes/font-size.js.map +7 -1
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js +23 -39
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +7 -1
- package/build-module/components/global-styles/font-sizes/font-sizes.js +184 -128
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +7 -1
- package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +68 -52
- package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +7 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +117 -79
- package/build-module/components/global-styles/gradients-palette-panel.js.map +7 -1
- package/build-module/components/global-styles/header.js +40 -43
- package/build-module/components/global-styles/header.js.map +7 -1
- package/build-module/components/global-styles/highlighted-colors.js +31 -36
- package/build-module/components/global-styles/highlighted-colors.js.map +7 -1
- package/build-module/components/global-styles/hooks.js +56 -61
- package/build-module/components/global-styles/hooks.js.map +7 -1
- package/build-module/components/global-styles/icon-with-current-color.js +18 -19
- package/build-module/components/global-styles/icon-with-current-color.js.map +7 -1
- package/build-module/components/global-styles/index.js +5 -2
- package/build-module/components/global-styles/index.js.map +7 -1
- package/build-module/components/global-styles/navigation-button.js +23 -37
- package/build-module/components/global-styles/navigation-button.js.map +7 -1
- package/build-module/components/global-styles/palette.js +61 -67
- package/build-module/components/global-styles/palette.js.map +7 -1
- package/build-module/components/global-styles/preset-colors.js +19 -20
- package/build-module/components/global-styles/preset-colors.js.map +7 -1
- package/build-module/components/global-styles/preview-colors.js +43 -40
- package/build-module/components/global-styles/preview-colors.js.map +7 -1
- package/build-module/components/global-styles/preview-styles.js +158 -130
- package/build-module/components/global-styles/preview-styles.js.map +7 -1
- package/build-module/components/global-styles/preview-typography.js +37 -38
- package/build-module/components/global-styles/preview-typography.js.map +7 -1
- package/build-module/components/global-styles/preview-wrapper.js +51 -75
- package/build-module/components/global-styles/preview-wrapper.js.map +7 -1
- package/build-module/components/global-styles/root-menu.js +38 -44
- package/build-module/components/global-styles/root-menu.js.map +7 -1
- package/build-module/components/global-styles/screen-background.js +26 -29
- package/build-module/components/global-styles/screen-background.js.map +7 -1
- package/build-module/components/global-styles/screen-block-list.js +105 -105
- package/build-module/components/global-styles/screen-block-list.js.map +7 -1
- package/build-module/components/global-styles/screen-block.js +156 -169
- package/build-module/components/global-styles/screen-block.js.map +7 -1
- package/build-module/components/global-styles/screen-color-palette.js +33 -50
- package/build-module/components/global-styles/screen-color-palette.js.map +7 -1
- package/build-module/components/global-styles/screen-colors.js +35 -33
- package/build-module/components/global-styles/screen-colors.js.map +7 -1
- package/build-module/components/global-styles/screen-css.js +52 -44
- package/build-module/components/global-styles/screen-css.js.map +7 -1
- package/build-module/components/global-styles/screen-layout.js +17 -26
- package/build-module/components/global-styles/screen-layout.js.map +7 -1
- package/build-module/components/global-styles/screen-revisions/index.js +117 -105
- package/build-module/components/global-styles/screen-revisions/index.js.map +7 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +145 -158
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +7 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +74 -75
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +7 -1
- package/build-module/components/global-styles/screen-root.js +74 -77
- package/build-module/components/global-styles/screen-root.js.map +7 -1
- package/build-module/components/global-styles/screen-shadows.js +12 -11
- package/build-module/components/global-styles/screen-shadows.js.map +7 -1
- package/build-module/components/global-styles/screen-style-variations.js +38 -37
- package/build-module/components/global-styles/screen-style-variations.js.map +7 -1
- package/build-module/components/global-styles/screen-typography-element.js +122 -87
- package/build-module/components/global-styles/screen-typography-element.js.map +7 -1
- package/build-module/components/global-styles/screen-typography.js +36 -34
- package/build-module/components/global-styles/screen-typography.js.map +7 -1
- package/build-module/components/global-styles/shadow-utils.js +53 -176
- package/build-module/components/global-styles/shadow-utils.js.map +7 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +426 -344
- package/build-module/components/global-styles/shadows-edit-panel.js.map +7 -1
- package/build-module/components/global-styles/shadows-panel.js +159 -124
- package/build-module/components/global-styles/shadows-panel.js.map +7 -1
- package/build-module/components/global-styles/size-control/index.js +57 -70
- package/build-module/components/global-styles/size-control/index.js.map +7 -1
- package/build-module/components/global-styles/style-variations-container.js +85 -95
- package/build-module/components/global-styles/style-variations-container.js.map +7 -1
- package/build-module/components/global-styles/subtitle.js +16 -16
- package/build-module/components/global-styles/subtitle.js.map +7 -1
- package/build-module/components/global-styles/typeset.js +50 -65
- package/build-module/components/global-styles/typeset.js.map +7 -1
- package/build-module/components/global-styles/typography-elements.js +86 -80
- package/build-module/components/global-styles/typography-elements.js.map +7 -1
- package/build-module/components/global-styles/typography-example.js +45 -57
- package/build-module/components/global-styles/typography-example.js.map +7 -1
- package/build-module/components/global-styles/typography-panel.js +38 -33
- package/build-module/components/global-styles/typography-panel.js.map +7 -1
- package/build-module/components/global-styles/typography-preview.js +55 -48
- package/build-module/components/global-styles/typography-preview.js.map +7 -1
- package/build-module/components/global-styles/ui.js +252 -295
- package/build-module/components/global-styles/ui.js.map +7 -1
- package/build-module/components/global-styles/utils.js +24 -28
- package/build-module/components/global-styles/utils.js.map +7 -1
- package/build-module/components/global-styles/variations/variation.js +59 -65
- package/build-module/components/global-styles/variations/variation.js.map +7 -1
- package/build-module/components/global-styles/variations/variations-color.js +26 -34
- package/build-module/components/global-styles/variations/variations-color.js.map +7 -1
- package/build-module/components/global-styles/variations/variations-panel.js +39 -46
- package/build-module/components/global-styles/variations/variations-panel.js.map +7 -1
- package/build-module/components/global-styles/variations/variations-typography.js +43 -42
- package/build-module/components/global-styles/variations/variations-typography.js.map +7 -1
- package/build-module/components/global-styles-renderer/index.js +16 -27
- package/build-module/components/global-styles-renderer/index.js.map +7 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js +36 -36
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +7 -1
- package/build-module/components/global-styles-sidebar/index.js +137 -133
- package/build-module/components/global-styles-sidebar/index.js.map +7 -1
- package/build-module/components/layout/animation.js +31 -69
- package/build-module/components/layout/animation.js.map +7 -1
- package/build-module/components/layout/hooks.js +16 -28
- package/build-module/components/layout/hooks.js.map +7 -1
- package/build-module/components/layout/index.js +199 -183
- package/build-module/components/layout/index.js.map +7 -1
- package/build-module/components/media/index.js +13 -21
- package/build-module/components/media/index.js.map +7 -1
- package/build-module/components/more-menu/index.js +18 -23
- package/build-module/components/more-menu/index.js.map +7 -1
- package/build-module/components/more-menu/site-export.js +41 -38
- package/build-module/components/more-menu/site-export.js.map +7 -1
- package/build-module/components/more-menu/welcome-guide-menu-item.js +12 -17
- package/build-module/components/more-menu/welcome-guide-menu-item.js.map +7 -1
- package/build-module/components/page-patterns/actions.js +52 -0
- package/build-module/components/page-patterns/actions.js.map +7 -0
- package/build-module/components/page-patterns/delete-category-menu-item.js +78 -76
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +7 -1
- package/build-module/components/page-patterns/fields.js +103 -112
- package/build-module/components/page-patterns/fields.js.map +7 -1
- package/build-module/components/page-patterns/index.js +144 -120
- package/build-module/components/page-patterns/index.js.map +7 -1
- package/build-module/components/page-patterns/rename-category-menu-item.js +37 -53
- package/build-module/components/page-patterns/rename-category-menu-item.js.map +7 -1
- package/build-module/components/page-patterns/search-items.js +43 -77
- package/build-module/components/page-patterns/search-items.js.map +7 -1
- package/build-module/components/page-patterns/use-pattern-settings.js +27 -30
- package/build-module/components/page-patterns/use-pattern-settings.js.map +7 -1
- package/build-module/components/page-patterns/use-patterns.js +249 -192
- package/build-module/components/page-patterns/use-patterns.js.map +7 -1
- package/build-module/components/page-patterns/utils.js +5 -2
- package/build-module/components/page-patterns/utils.js.map +7 -1
- package/build-module/components/page-templates/fields.js +132 -147
- package/build-module/components/page-templates/fields.js.map +7 -1
- package/build-module/components/page-templates/hooks.js +44 -55
- package/build-module/components/page-templates/hooks.js.map +7 -1
- package/build-module/components/page-templates/index.js +189 -194
- package/build-module/components/page-templates/index.js.map +7 -1
- package/build-module/components/page-templates/view-utils.js +42 -0
- package/build-module/components/page-templates/view-utils.js.map +7 -0
- package/build-module/components/pagination/index.js +96 -77
- package/build-module/components/pagination/index.js.map +7 -1
- package/build-module/components/plugin-template-setting-panel/index.js +21 -50
- package/build-module/components/plugin-template-setting-panel/index.js.map +7 -1
- package/build-module/components/post-edit/index.js +136 -140
- package/build-module/components/post-edit/index.js.map +7 -1
- package/build-module/components/post-list/index.js +205 -291
- package/build-module/components/post-list/index.js.map +7 -1
- package/build-module/components/post-list/view-utils.js +149 -0
- package/build-module/components/post-list/view-utils.js.map +7 -0
- package/build-module/components/posts-app/index.js +15 -25
- package/build-module/components/posts-app/index.js.map +7 -1
- package/build-module/components/posts-app-routes/index.js +12 -18
- package/build-module/components/posts-app-routes/index.js.map +7 -1
- package/build-module/components/posts-app-routes/post-item.js +22 -29
- package/build-module/components/posts-app-routes/post-item.js.map +7 -1
- package/build-module/components/posts-app-routes/posts.js +59 -70
- package/build-module/components/posts-app-routes/posts.js.map +7 -1
- package/build-module/components/resizable-frame/index.js +169 -211
- package/build-module/components/resizable-frame/index.js.map +7 -1
- package/build-module/components/revisions/index.js +78 -64
- package/build-module/components/revisions/index.js.map +7 -1
- package/build-module/components/routes/use-title.js +25 -28
- package/build-module/components/routes/use-title.js.map +7 -1
- package/build-module/components/save-button/index.js +99 -104
- package/build-module/components/save-button/index.js.map +7 -1
- package/build-module/components/save-hub/index.js +23 -33
- package/build-module/components/save-hub/index.js.map +7 -1
- package/build-module/components/save-keyboard-shortcut/index.js +31 -47
- package/build-module/components/save-keyboard-shortcut/index.js.map +7 -1
- package/build-module/components/save-panel/index.js +125 -124
- package/build-module/components/save-panel/index.js.map +7 -1
- package/build-module/components/sidebar/index.js +47 -65
- package/build-module/components/sidebar/index.js.map +7 -1
- package/build-module/components/sidebar-button/index.js +16 -17
- package/build-module/components/sidebar-button/index.js.map +7 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +41 -50
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +7 -1
- package/build-module/components/sidebar-dataviews/index.js +40 -48
- package/build-module/components/sidebar-dataviews/index.js.map +7 -1
- package/build-module/components/sidebar-global-styles-wrapper/index.js +100 -104
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-item/index.js +56 -57
- package/build-module/components/sidebar-navigation-item/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen/index.js +108 -98
- package/build-module/components/sidebar-navigation-screen/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +36 -48
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js +23 -28
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +61 -73
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +108 -82
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +22 -24
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +92 -84
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +87 -76
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +28 -41
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +67 -60
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +37 -32
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +107 -91
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +14 -14
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +8 -12
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +89 -98
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +113 -117
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +82 -82
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +17 -16
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +108 -99
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +19 -21
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +53 -59
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +27 -27
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +24 -24
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +67 -70
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +20 -21
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-unsupported/index.js +11 -16
- package/build-module/components/sidebar-navigation-screen-unsupported/index.js.map +7 -1
- package/build-module/components/site-editor-routes/home.js +18 -26
- package/build-module/components/site-editor-routes/home.js.map +7 -1
- package/build-module/components/site-editor-routes/index.js +39 -30
- package/build-module/components/site-editor-routes/index.js.map +7 -1
- package/build-module/components/site-editor-routes/navigation-item.js +23 -43
- package/build-module/components/site-editor-routes/navigation-item.js.map +7 -1
- package/build-module/components/site-editor-routes/navigation.js +23 -43
- package/build-module/components/site-editor-routes/navigation.js.map +7 -1
- package/build-module/components/site-editor-routes/notfound.js +22 -28
- package/build-module/components/site-editor-routes/notfound.js.map +7 -1
- package/build-module/components/site-editor-routes/page-item.js +26 -35
- package/build-module/components/site-editor-routes/page-item.js.map +7 -1
- package/build-module/components/site-editor-routes/pages.js +64 -80
- package/build-module/components/site-editor-routes/pages.js.map +7 -1
- package/build-module/components/site-editor-routes/pattern-item.js +16 -20
- package/build-module/components/site-editor-routes/pattern-item.js.map +7 -1
- package/build-module/components/site-editor-routes/patterns.js +19 -30
- package/build-module/components/site-editor-routes/patterns.js.map +7 -1
- package/build-module/components/site-editor-routes/stylebook.js +28 -37
- package/build-module/components/site-editor-routes/stylebook.js.map +7 -1
- package/build-module/components/site-editor-routes/styles.js +26 -40
- package/build-module/components/site-editor-routes/styles.js.map +7 -1
- package/build-module/components/site-editor-routes/template-item.js +21 -28
- package/build-module/components/site-editor-routes/template-item.js.map +7 -1
- package/build-module/components/site-editor-routes/template-part-item.js +13 -15
- package/build-module/components/site-editor-routes/template-part-item.js.map +7 -1
- package/build-module/components/site-editor-routes/templates.js +37 -38
- package/build-module/components/site-editor-routes/templates.js.map +7 -1
- package/build-module/components/site-editor-routes/utils.js +6 -10
- package/build-module/components/site-editor-routes/utils.js.map +7 -1
- package/build-module/components/site-hub/index.js +204 -215
- package/build-module/components/site-hub/index.js.map +7 -1
- package/build-module/components/site-icon/index.js +33 -43
- package/build-module/components/site-icon/index.js.map +7 -1
- package/build-module/components/style-book/categories.js +41 -48
- package/build-module/components/style-book/categories.js.map +7 -1
- package/build-module/components/style-book/color-examples.js +29 -37
- package/build-module/components/style-book/color-examples.js.map +7 -1
- package/build-module/components/style-book/constants.js +191 -140
- package/build-module/components/style-book/constants.js.map +7 -1
- package/build-module/components/style-book/duotone-examples.js +36 -35
- package/build-module/components/style-book/duotone-examples.js.map +7 -1
- package/build-module/components/style-book/examples.js +114 -116
- package/build-module/components/style-book/examples.js.map +7 -1
- package/build-module/components/style-book/index.js +431 -384
- package/build-module/components/style-book/index.js.map +7 -1
- package/build-module/components/style-book/types.js +1 -2
- package/build-module/components/style-book/types.js.map +7 -1
- package/build-module/components/welcome-guide/editor.js +59 -54
- package/build-module/components/welcome-guide/editor.js.map +7 -1
- package/build-module/components/welcome-guide/image.js +16 -18
- package/build-module/components/welcome-guide/image.js.map +7 -1
- package/build-module/components/welcome-guide/index.js +16 -15
- package/build-module/components/welcome-guide/index.js.map +7 -1
- package/build-module/components/welcome-guide/page.js +59 -48
- package/build-module/components/welcome-guide/page.js.map +7 -1
- package/build-module/components/welcome-guide/styles.js +108 -97
- package/build-module/components/welcome-guide/styles.js.map +7 -1
- package/build-module/components/welcome-guide/template.js +54 -55
- package/build-module/components/welcome-guide/template.js.map +7 -1
- package/build-module/deprecated.js +28 -40
- package/build-module/deprecated.js.map +7 -1
- package/build-module/hooks/commands/use-common-commands.js +89 -108
- package/build-module/hooks/commands/use-common-commands.js.map +7 -1
- package/build-module/hooks/commands/use-set-command-context.js +21 -44
- package/build-module/hooks/commands/use-set-command-context.js.map +7 -1
- package/build-module/hooks/index.js +2 -5
- package/build-module/hooks/index.js.map +7 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +218 -243
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +7 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +56 -105
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +7 -1
- package/build-module/index.js +55 -69
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/posts.js +38 -54
- package/build-module/posts.js.map +7 -1
- package/build-module/store/actions.js +140 -320
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +5 -7
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/index.js +15 -18
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/private-actions.js +12 -14
- package/build-module/store/private-actions.js.map +7 -1
- package/build-module/store/private-selectors.js +7 -10
- package/build-module/store/private-selectors.js.map +7 -1
- package/build-module/store/reducer.js +21 -53
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/selectors.js +151 -278
- package/build-module/store/selectors.js.map +7 -1
- package/build-module/utils/constants.js +53 -44
- package/build-module/utils/constants.js.map +7 -1
- package/build-module/utils/get-filtered-template-parts.js +18 -37
- package/build-module/utils/get-filtered-template-parts.js.map +7 -1
- package/build-module/utils/is-previewing-theme.js +10 -9
- package/build-module/utils/is-previewing-theme.js.map +7 -1
- package/build-module/utils/is-template-removable.js +6 -13
- package/build-module/utils/is-template-removable.js.map +7 -1
- package/build-module/utils/is-template-revertable.js +6 -15
- package/build-module/utils/is-template-revertable.js.map +7 -1
- package/build-module/utils/set-nested-value.js +7 -22
- package/build-module/utils/set-nested-value.js.map +7 -1
- package/build-module/utils/template-part-create.js +1 -2
- package/build-module/utils/template-part-create.js.map +7 -1
- package/build-module/utils/use-activate-theme.js +21 -40
- package/build-module/utils/use-activate-theme.js.map +7 -1
- package/build-module/utils/use-actual-current-theme.js +13 -17
- package/build-module/utils/use-actual-current-theme.js.map +7 -1
- package/build-style/posts-rtl.css +484 -214
- package/build-style/posts.css +484 -214
- package/build-style/style-rtl.css +629 -271
- package/build-style/style.css +629 -271
- package/package.json +52 -42
- package/src/components/add-new-template/index.js +5 -3
- package/src/components/add-new-template/style.scss +4 -0
- package/src/components/dataviews-actions/index.js +16 -9
- package/src/components/editor/style.scss +3 -0
- package/src/components/editor/use-resolve-edited-entity.js +4 -18
- package/src/components/editor-canvas-container/style.scss +4 -1
- package/src/components/global-styles/font-library-modal/style.scss +4 -0
- package/src/components/global-styles/screen-revisions/style.scss +4 -0
- package/src/components/global-styles/style.scss +3 -0
- package/src/components/global-styles/variations/style.scss +3 -0
- package/src/components/global-styles-sidebar/style.scss +3 -0
- package/src/components/layout/index.js +2 -1
- package/src/components/layout/style.scss +5 -0
- package/src/components/page-patterns/actions.js +54 -0
- package/src/components/page-patterns/index.js +79 -32
- package/src/components/page-patterns/style.scss +4 -0
- package/src/components/page-templates/fields.js +22 -1
- package/src/components/page-templates/index.js +71 -104
- package/src/components/page-templates/style.scss +4 -0
- package/src/components/page-templates/view-utils.js +41 -0
- package/src/components/pagination/style.scss +2 -0
- package/src/components/post-edit/index.js +4 -3
- package/src/components/post-edit/style.scss +3 -6
- package/src/components/post-list/index.js +76 -188
- package/src/components/post-list/style.scss +3 -0
- package/src/components/post-list/view-utils.js +155 -0
- package/src/components/posts-app-routes/posts.js +29 -16
- package/src/components/resizable-frame/style.scss +3 -0
- package/src/components/save-hub/style.scss +3 -0
- package/src/components/save-panel/index.js +2 -2
- package/src/components/save-panel/style.scss +2 -0
- package/src/components/sidebar/style.scss +4 -0
- package/src/components/sidebar-button/style.scss +2 -0
- package/src/components/sidebar-dataviews/dataview-item.js +5 -11
- package/src/components/sidebar-dataviews/index.js +17 -17
- package/src/components/sidebar-dataviews/style.scss +2 -16
- package/src/components/sidebar-global-styles-wrapper/index.js +16 -21
- package/src/components/sidebar-global-styles-wrapper/style.scss +4 -30
- package/src/components/sidebar-navigation-item/style.scss +3 -0
- package/src/components/sidebar-navigation-screen/style.scss +5 -0
- package/src/components/sidebar-navigation-screen-main/style.scss +2 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +2 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +3 -0
- package/src/components/sidebar-navigation-screen-patterns/style.scss +3 -0
- package/src/components/sidebar-navigation-screen-templates-browse/style.scss +2 -0
- package/src/components/site-editor-routes/pages.js +29 -16
- package/src/components/site-editor-routes/templates.js +21 -4
- package/src/components/site-hub/style.scss +3 -0
- package/src/components/site-icon/style.scss +3 -0
- package/src/components/style-book/style.scss +3 -0
- package/src/components/welcome-guide/style.scss +2 -0
- package/src/posts.scss +14 -11
- package/src/style.scss +42 -39
- package/tsconfig.json +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/page/header.js +0 -45
- package/build/components/page/header.js.map +0 -1
- package/build/components/page/index.js +0 -50
- package/build/components/page/index.js.map +0 -1
- package/build/components/page-patterns/header.js +0 -96
- package/build/components/page-patterns/header.js.map +0 -1
- package/build/components/sidebar-dataviews/add-new-view.js +0 -137
- package/build/components/sidebar-dataviews/add-new-view.js.map +0 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +0 -211
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +0 -1
- package/build/components/sidebar-dataviews/default-views.js +0 -141
- package/build/components/sidebar-dataviews/default-views.js.map +0 -1
- package/build-module/components/page/header.js +0 -40
- package/build-module/components/page/header.js.map +0 -1
- package/build-module/components/page/index.js +0 -42
- package/build-module/components/page/index.js.map +0 -1
- package/build-module/components/page-patterns/header.js +0 -88
- package/build-module/components/page-patterns/header.js.map +0 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +0 -129
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +0 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +0 -202
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +0 -1
- package/build-module/components/sidebar-dataviews/default-views.js +0 -133
- package/build-module/components/sidebar-dataviews/default-views.js.map +0 -1
- package/src/components/page/header.js +0 -44
- package/src/components/page/index.js +0 -43
- package/src/components/page/style.scss +0 -56
- package/src/components/page-patterns/header.js +0 -120
- package/src/components/sidebar-dataviews/add-new-view.js +0 -143
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +0 -233
- package/src/components/sidebar-dataviews/default-views.js +0 -168
|
@@ -1,26 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { FONT_WEIGHTS, FONT_STYLES } from './constants';
|
|
10
|
-
import { unlock } from '../../../../lock-unlock';
|
|
11
|
-
import { fetchInstallFontFace } from '../resolvers';
|
|
12
|
-
import { formatFontFaceName } from './preview-styles';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Browser dependencies
|
|
16
|
-
*/
|
|
17
|
-
const {
|
|
18
|
-
File
|
|
19
|
-
} = window;
|
|
20
|
-
const {
|
|
21
|
-
kebabCase
|
|
22
|
-
} = unlock(componentsPrivateApis);
|
|
23
|
-
export function setUIValuesNeeded(font, extraValues = {}) {
|
|
1
|
+
import { privateApis as componentsPrivateApis } from "@wordpress/components";
|
|
2
|
+
import { FONT_WEIGHTS, FONT_STYLES } from "./constants";
|
|
3
|
+
import { unlock } from "../../../../lock-unlock";
|
|
4
|
+
import { fetchInstallFontFace } from "../resolvers";
|
|
5
|
+
import { formatFontFaceName } from "./preview-styles";
|
|
6
|
+
const { File } = window;
|
|
7
|
+
const { kebabCase } = unlock(componentsPrivateApis);
|
|
8
|
+
function setUIValuesNeeded(font, extraValues = {}) {
|
|
24
9
|
if (!font.name && (font.fontFamily || font.slug)) {
|
|
25
10
|
font.name = font.fontFamily || font.slug;
|
|
26
11
|
}
|
|
@@ -29,121 +14,97 @@ export function setUIValuesNeeded(font, extraValues = {}) {
|
|
|
29
14
|
...extraValues
|
|
30
15
|
};
|
|
31
16
|
}
|
|
32
|
-
|
|
33
|
-
if (typeof url !==
|
|
17
|
+
function isUrlEncoded(url) {
|
|
18
|
+
if (typeof url !== "string") {
|
|
34
19
|
return false;
|
|
35
20
|
}
|
|
36
21
|
return url !== decodeURIComponent(url);
|
|
37
22
|
}
|
|
38
|
-
|
|
23
|
+
function getFontFaceVariantName(face) {
|
|
39
24
|
const weightName = FONT_WEIGHTS[face.fontWeight] || face.fontWeight;
|
|
40
|
-
const styleName = face.fontStyle ===
|
|
25
|
+
const styleName = face.fontStyle === "normal" ? "" : FONT_STYLES[face.fontStyle] || face.fontStyle;
|
|
41
26
|
return `${weightName} ${styleName}`;
|
|
42
27
|
}
|
|
43
|
-
|
|
44
|
-
const map = new Map();
|
|
28
|
+
function mergeFontFaces(existing = [], incoming = []) {
|
|
29
|
+
const map = /* @__PURE__ */ new Map();
|
|
45
30
|
for (const face of existing) {
|
|
46
31
|
map.set(`${face.fontWeight}${face.fontStyle}`, face);
|
|
47
32
|
}
|
|
48
33
|
for (const face of incoming) {
|
|
49
|
-
// This will overwrite if the src already exists, keeping it unique.
|
|
50
34
|
map.set(`${face.fontWeight}${face.fontStyle}`, face);
|
|
51
35
|
}
|
|
52
36
|
return Array.from(map.values());
|
|
53
37
|
}
|
|
54
|
-
|
|
55
|
-
const map = new Map();
|
|
56
|
-
// Add the existing array to the map.
|
|
38
|
+
function mergeFontFamilies(existing = [], incoming = []) {
|
|
39
|
+
const map = /* @__PURE__ */ new Map();
|
|
57
40
|
for (const font of existing) {
|
|
58
|
-
map.set(font.slug, {
|
|
59
|
-
...font
|
|
60
|
-
});
|
|
41
|
+
map.set(font.slug, { ...font });
|
|
61
42
|
}
|
|
62
|
-
// Add the incoming array to the map, overwriting existing values excepting fontFace that need to be merged.
|
|
63
43
|
for (const font of incoming) {
|
|
64
44
|
if (map.has(font.slug)) {
|
|
65
|
-
const {
|
|
66
|
-
fontFace: incomingFontFaces,
|
|
67
|
-
...restIncoming
|
|
68
|
-
} = font;
|
|
45
|
+
const { fontFace: incomingFontFaces, ...restIncoming } = font;
|
|
69
46
|
const existingFont = map.get(font.slug);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
47
|
+
const mergedFontFaces = mergeFontFaces(
|
|
48
|
+
existingFont.fontFace,
|
|
49
|
+
incomingFontFaces
|
|
50
|
+
);
|
|
73
51
|
map.set(font.slug, {
|
|
74
52
|
...restIncoming,
|
|
75
53
|
fontFace: mergedFontFaces
|
|
76
54
|
});
|
|
77
55
|
} else {
|
|
78
|
-
map.set(font.slug, {
|
|
79
|
-
...font
|
|
80
|
-
});
|
|
56
|
+
map.set(font.slug, { ...font });
|
|
81
57
|
}
|
|
82
58
|
}
|
|
83
59
|
return Array.from(map.values());
|
|
84
60
|
}
|
|
85
|
-
|
|
86
|
-
/*
|
|
87
|
-
* Loads the font face from a URL and adds it to the browser.
|
|
88
|
-
* It also adds it to the iframe document.
|
|
89
|
-
*/
|
|
90
|
-
export async function loadFontFaceInBrowser(fontFace, source, addTo = 'all') {
|
|
61
|
+
async function loadFontFaceInBrowser(fontFace, source, addTo = "all") {
|
|
91
62
|
let dataSource;
|
|
92
|
-
if (typeof source ===
|
|
63
|
+
if (typeof source === "string") {
|
|
93
64
|
dataSource = `url(${source})`;
|
|
94
|
-
// eslint-disable-next-line no-undef
|
|
95
65
|
} else if (source instanceof File) {
|
|
96
66
|
dataSource = await source.arrayBuffer();
|
|
97
67
|
} else {
|
|
98
68
|
return;
|
|
99
69
|
}
|
|
100
|
-
const newFont = new window.FontFace(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
70
|
+
const newFont = new window.FontFace(
|
|
71
|
+
formatFontFaceName(fontFace.fontFamily),
|
|
72
|
+
dataSource,
|
|
73
|
+
{
|
|
74
|
+
style: fontFace.fontStyle,
|
|
75
|
+
weight: fontFace.fontWeight
|
|
76
|
+
}
|
|
77
|
+
);
|
|
104
78
|
const loadedFace = await newFont.load();
|
|
105
|
-
if (addTo ===
|
|
79
|
+
if (addTo === "document" || addTo === "all") {
|
|
106
80
|
document.fonts.add(loadedFace);
|
|
107
81
|
}
|
|
108
|
-
if (addTo ===
|
|
109
|
-
const iframeDocument = document.querySelector(
|
|
82
|
+
if (addTo === "iframe" || addTo === "all") {
|
|
83
|
+
const iframeDocument = document.querySelector(
|
|
84
|
+
'iframe[name="editor-canvas"]'
|
|
85
|
+
).contentDocument;
|
|
110
86
|
iframeDocument.fonts.add(loadedFace);
|
|
111
87
|
}
|
|
112
88
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
* It also removes it from the iframe document.
|
|
117
|
-
*
|
|
118
|
-
* Note that Font faces that were added to the set using the CSS @font-face rule
|
|
119
|
-
* remain connected to the corresponding CSS, and cannot be deleted.
|
|
120
|
-
*
|
|
121
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet/delete.
|
|
122
|
-
*/
|
|
123
|
-
export function unloadFontFaceInBrowser(fontFace, removeFrom = 'all') {
|
|
124
|
-
const unloadFontFace = fonts => {
|
|
125
|
-
fonts.forEach(f => {
|
|
89
|
+
function unloadFontFaceInBrowser(fontFace, removeFrom = "all") {
|
|
90
|
+
const unloadFontFace = (fonts) => {
|
|
91
|
+
fonts.forEach((f) => {
|
|
126
92
|
if (f.family === formatFontFaceName(fontFace?.fontFamily) && f.weight === fontFace?.fontWeight && f.style === fontFace?.fontStyle) {
|
|
127
93
|
fonts.delete(f);
|
|
128
94
|
}
|
|
129
95
|
});
|
|
130
96
|
};
|
|
131
|
-
if (removeFrom ===
|
|
97
|
+
if (removeFrom === "document" || removeFrom === "all") {
|
|
132
98
|
unloadFontFace(document.fonts);
|
|
133
99
|
}
|
|
134
|
-
if (removeFrom ===
|
|
135
|
-
const iframeDocument = document.querySelector(
|
|
100
|
+
if (removeFrom === "iframe" || removeFrom === "all") {
|
|
101
|
+
const iframeDocument = document.querySelector(
|
|
102
|
+
'iframe[name="editor-canvas"]'
|
|
103
|
+
).contentDocument;
|
|
136
104
|
unloadFontFace(iframeDocument.fonts);
|
|
137
105
|
}
|
|
138
106
|
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Retrieves the display source from a font face src.
|
|
142
|
-
*
|
|
143
|
-
* @param {string|string[]} input - The font face src.
|
|
144
|
-
* @return {string|undefined} The display source or undefined if the input is invalid.
|
|
145
|
-
*/
|
|
146
|
-
export function getDisplaySrcFromFontFace(input) {
|
|
107
|
+
function getDisplaySrcFromFontFace(input) {
|
|
147
108
|
if (!input) {
|
|
148
109
|
return;
|
|
149
110
|
}
|
|
@@ -153,8 +114,7 @@ export function getDisplaySrcFromFontFace(input) {
|
|
|
153
114
|
} else {
|
|
154
115
|
src = input;
|
|
155
116
|
}
|
|
156
|
-
|
|
157
|
-
if (src.startsWith('file:.')) {
|
|
117
|
+
if (src.startsWith("file:.")) {
|
|
158
118
|
return;
|
|
159
119
|
}
|
|
160
120
|
if (!isUrlEncoded(src)) {
|
|
@@ -162,68 +122,54 @@ export function getDisplaySrcFromFontFace(input) {
|
|
|
162
122
|
}
|
|
163
123
|
return src;
|
|
164
124
|
}
|
|
165
|
-
|
|
125
|
+
function makeFontFamilyFormData(fontFamily) {
|
|
166
126
|
const formData = new FormData();
|
|
167
|
-
const {
|
|
168
|
-
fontFace,
|
|
169
|
-
category,
|
|
170
|
-
...familyWithValidParameters
|
|
171
|
-
} = fontFamily;
|
|
127
|
+
const { fontFace, category, ...familyWithValidParameters } = fontFamily;
|
|
172
128
|
const fontFamilySettings = {
|
|
173
129
|
...familyWithValidParameters,
|
|
174
130
|
slug: kebabCase(fontFamily.slug)
|
|
175
131
|
};
|
|
176
|
-
formData.append(
|
|
132
|
+
formData.append(
|
|
133
|
+
"font_family_settings",
|
|
134
|
+
JSON.stringify(fontFamilySettings)
|
|
135
|
+
);
|
|
177
136
|
return formData;
|
|
178
137
|
}
|
|
179
|
-
|
|
138
|
+
function makeFontFacesFormData(font) {
|
|
180
139
|
if (font?.fontFace) {
|
|
181
140
|
const fontFacesFormData = font.fontFace.map((item, faceIndex) => {
|
|
182
|
-
const face = {
|
|
183
|
-
...item
|
|
184
|
-
};
|
|
141
|
+
const face = { ...item };
|
|
185
142
|
const formData = new FormData();
|
|
186
143
|
if (face.file) {
|
|
187
|
-
// Normalize to an array, since face.file may be a single file or an array of files.
|
|
188
144
|
const files = Array.isArray(face.file) ? face.file : [face.file];
|
|
189
145
|
const src = [];
|
|
190
146
|
files.forEach((file, key) => {
|
|
191
|
-
// Slugified file name because the it might contain spaces or characters treated differently on the server.
|
|
192
147
|
const fileId = `file-${faceIndex}-${key}`;
|
|
193
|
-
// Add the files to the formData
|
|
194
148
|
formData.append(fileId, file, file.name);
|
|
195
149
|
src.push(fileId);
|
|
196
150
|
});
|
|
197
151
|
face.src = src.length === 1 ? src[0] : src;
|
|
198
152
|
delete face.file;
|
|
199
|
-
formData.append(
|
|
153
|
+
formData.append("font_face_settings", JSON.stringify(face));
|
|
200
154
|
} else {
|
|
201
|
-
formData.append(
|
|
155
|
+
formData.append("font_face_settings", JSON.stringify(face));
|
|
202
156
|
}
|
|
203
157
|
return formData;
|
|
204
158
|
});
|
|
205
159
|
return fontFacesFormData;
|
|
206
160
|
}
|
|
207
161
|
}
|
|
208
|
-
|
|
162
|
+
async function batchInstallFontFaces(fontFamilyId, fontFacesData) {
|
|
209
163
|
const responses = [];
|
|
210
|
-
|
|
211
|
-
/*
|
|
212
|
-
* Uses the same response format as Promise.allSettled, but executes requests in sequence to work
|
|
213
|
-
* around a race condition that can cause an error when the fonts directory doesn't exist yet.
|
|
214
|
-
*/
|
|
215
164
|
for (const faceData of fontFacesData) {
|
|
216
165
|
try {
|
|
217
|
-
const response = await fetchInstallFontFace(
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
});
|
|
166
|
+
const response = await fetchInstallFontFace(
|
|
167
|
+
fontFamilyId,
|
|
168
|
+
faceData
|
|
169
|
+
);
|
|
170
|
+
responses.push({ status: "fulfilled", value: response });
|
|
222
171
|
} catch (error) {
|
|
223
|
-
responses.push({
|
|
224
|
-
status: 'rejected',
|
|
225
|
-
reason: error
|
|
226
|
-
});
|
|
172
|
+
responses.push({ status: "rejected", reason: error });
|
|
227
173
|
}
|
|
228
174
|
}
|
|
229
175
|
const results = {
|
|
@@ -231,7 +177,7 @@ export async function batchInstallFontFaces(fontFamilyId, fontFacesData) {
|
|
|
231
177
|
successes: []
|
|
232
178
|
};
|
|
233
179
|
responses.forEach((result, index) => {
|
|
234
|
-
if (result.status ===
|
|
180
|
+
if (result.status === "fulfilled") {
|
|
235
181
|
const response = result.value;
|
|
236
182
|
if (response.id) {
|
|
237
183
|
results.successes.push(response);
|
|
@@ -242,7 +188,6 @@ export async function batchInstallFontFaces(fontFamilyId, fontFacesData) {
|
|
|
242
188
|
});
|
|
243
189
|
}
|
|
244
190
|
} else {
|
|
245
|
-
// Handle network errors or other fetch-related errors
|
|
246
191
|
results.errors.push({
|
|
247
192
|
data: fontFacesData[index],
|
|
248
193
|
message: result.reason.message
|
|
@@ -251,43 +196,46 @@ export async function batchInstallFontFaces(fontFamilyId, fontFacesData) {
|
|
|
251
196
|
});
|
|
252
197
|
return results;
|
|
253
198
|
}
|
|
254
|
-
|
|
255
|
-
/*
|
|
256
|
-
* Downloads a font face asset from a URL to the client and returns a File object.
|
|
257
|
-
*/
|
|
258
|
-
export async function downloadFontFaceAssets(src) {
|
|
259
|
-
// Normalize to an array, since `src` could be a string or array.
|
|
199
|
+
async function downloadFontFaceAssets(src) {
|
|
260
200
|
src = Array.isArray(src) ? src : [src];
|
|
261
|
-
const files = await Promise.all(
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
201
|
+
const files = await Promise.all(
|
|
202
|
+
src.map(async (url) => {
|
|
203
|
+
return fetch(new Request(url)).then((response) => {
|
|
204
|
+
if (!response.ok) {
|
|
205
|
+
throw new Error(
|
|
206
|
+
`Error downloading font face asset from ${url}. Server responded with status: ${response.status}`
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
return response.blob();
|
|
210
|
+
}).then((blob) => {
|
|
211
|
+
const filename = url.split("/").pop();
|
|
212
|
+
const file = new File([blob], filename, {
|
|
213
|
+
type: blob.type
|
|
214
|
+
});
|
|
215
|
+
return file;
|
|
271
216
|
});
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}));
|
|
275
|
-
|
|
276
|
-
// If we only have one file return it (not the array). Otherwise return all of them in the array.
|
|
217
|
+
})
|
|
218
|
+
);
|
|
277
219
|
return files.length === 1 ? files[0] : files;
|
|
278
220
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
* Determine if a given Font Face is present in a given collection.
|
|
282
|
-
* We determine that a font face has been installed by comparing the fontWeight and fontStyle
|
|
283
|
-
*
|
|
284
|
-
* @param {Object} fontFace The Font Face to seek
|
|
285
|
-
* @param {Array} collection The Collection to seek in
|
|
286
|
-
* @returns True if the font face is found in the collection. Otherwise False.
|
|
287
|
-
*/
|
|
288
|
-
export function checkFontFaceInstalled(fontFace, collection) {
|
|
289
|
-
return -1 !== collection.findIndex(collectionFontFace => {
|
|
221
|
+
function checkFontFaceInstalled(fontFace, collection) {
|
|
222
|
+
return -1 !== collection.findIndex((collectionFontFace) => {
|
|
290
223
|
return collectionFontFace.fontWeight === fontFace.fontWeight && collectionFontFace.fontStyle === fontFace.fontStyle;
|
|
291
224
|
});
|
|
292
225
|
}
|
|
293
|
-
|
|
226
|
+
export {
|
|
227
|
+
batchInstallFontFaces,
|
|
228
|
+
checkFontFaceInstalled,
|
|
229
|
+
downloadFontFaceAssets,
|
|
230
|
+
getDisplaySrcFromFontFace,
|
|
231
|
+
getFontFaceVariantName,
|
|
232
|
+
isUrlEncoded,
|
|
233
|
+
loadFontFaceInBrowser,
|
|
234
|
+
makeFontFacesFormData,
|
|
235
|
+
makeFontFamilyFormData,
|
|
236
|
+
mergeFontFaces,
|
|
237
|
+
mergeFontFamilies,
|
|
238
|
+
setUIValuesNeeded,
|
|
239
|
+
unloadFontFaceInBrowser
|
|
240
|
+
};
|
|
241
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{"version":3,"names":["privateApis","componentsPrivateApis","FONT_WEIGHTS","FONT_STYLES","unlock","fetchInstallFontFace","formatFontFaceName","File","window","kebabCase","setUIValuesNeeded","font","extraValues","name","fontFamily","slug","isUrlEncoded","url","decodeURIComponent","getFontFaceVariantName","face","weightName","fontWeight","styleName","fontStyle","mergeFontFaces","existing","incoming","map","Map","set","Array","from","values","mergeFontFamilies","has","fontFace","incomingFontFaces","restIncoming","existingFont","get","mergedFontFaces","loadFontFaceInBrowser","source","addTo","dataSource","arrayBuffer","newFont","FontFace","style","weight","loadedFace","load","document","fonts","add","iframeDocument","querySelector","contentDocument","unloadFontFaceInBrowser","removeFrom","unloadFontFace","forEach","f","family","delete","getDisplaySrcFromFontFace","input","src","isArray","startsWith","encodeURI","makeFontFamilyFormData","formData","FormData","category","familyWithValidParameters","fontFamilySettings","append","JSON","stringify","makeFontFacesFormData","fontFacesFormData","item","faceIndex","file","files","key","fileId","push","length","batchInstallFontFaces","fontFamilyId","fontFacesData","responses","faceData","response","status","value","error","reason","results","errors","successes","result","index","id","data","message","downloadFontFaceAssets","Promise","all","fetch","Request","then","ok","Error","blob","filename","split","pop","type","checkFontFaceInstalled","collection","findIndex","collectionFontFace"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/utils/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { FONT_WEIGHTS, FONT_STYLES } from './constants';\nimport { unlock } from '../../../../lock-unlock';\nimport { fetchInstallFontFace } from '../resolvers';\nimport { formatFontFaceName } from './preview-styles';\n\n/**\n * Browser dependencies\n */\nconst { File } = window;\nconst { kebabCase } = unlock( componentsPrivateApis );\n\nexport function setUIValuesNeeded( font, extraValues = {} ) {\n\tif ( ! font.name && ( font.fontFamily || font.slug ) ) {\n\t\tfont.name = font.fontFamily || font.slug;\n\t}\n\treturn {\n\t\t...font,\n\t\t...extraValues,\n\t};\n}\n\nexport function isUrlEncoded( url ) {\n\tif ( typeof url !== 'string' ) {\n\t\treturn false;\n\t}\n\treturn url !== decodeURIComponent( url );\n}\n\nexport function getFontFaceVariantName( face ) {\n\tconst weightName = FONT_WEIGHTS[ face.fontWeight ] || face.fontWeight;\n\tconst styleName =\n\t\tface.fontStyle === 'normal'\n\t\t\t? ''\n\t\t\t: FONT_STYLES[ face.fontStyle ] || face.fontStyle;\n\treturn `${ weightName } ${ styleName }`;\n}\n\nexport function mergeFontFaces( existing = [], incoming = [] ) {\n\tconst map = new Map();\n\tfor ( const face of existing ) {\n\t\tmap.set( `${ face.fontWeight }${ face.fontStyle }`, face );\n\t}\n\tfor ( const face of incoming ) {\n\t\t// This will overwrite if the src already exists, keeping it unique.\n\t\tmap.set( `${ face.fontWeight }${ face.fontStyle }`, face );\n\t}\n\treturn Array.from( map.values() );\n}\n\nexport function mergeFontFamilies( existing = [], incoming = [] ) {\n\tconst map = new Map();\n\t// Add the existing array to the map.\n\tfor ( const font of existing ) {\n\t\tmap.set( font.slug, { ...font } );\n\t}\n\t// Add the incoming array to the map, overwriting existing values excepting fontFace that need to be merged.\n\tfor ( const font of incoming ) {\n\t\tif ( map.has( font.slug ) ) {\n\t\t\tconst { fontFace: incomingFontFaces, ...restIncoming } = font;\n\t\t\tconst existingFont = map.get( font.slug );\n\t\t\t// Merge the fontFaces existing with the incoming fontFaces.\n\t\t\tconst mergedFontFaces = mergeFontFaces(\n\t\t\t\texistingFont.fontFace,\n\t\t\t\tincomingFontFaces\n\t\t\t);\n\t\t\t// Except for the fontFace key all the other keys are overwritten with the incoming values.\n\t\t\tmap.set( font.slug, {\n\t\t\t\t...restIncoming,\n\t\t\t\tfontFace: mergedFontFaces,\n\t\t\t} );\n\t\t} else {\n\t\t\tmap.set( font.slug, { ...font } );\n\t\t}\n\t}\n\treturn Array.from( map.values() );\n}\n\n/*\n * Loads the font face from a URL and adds it to the browser.\n * It also adds it to the iframe document.\n */\nexport async function loadFontFaceInBrowser( fontFace, source, addTo = 'all' ) {\n\tlet dataSource;\n\n\tif ( typeof source === 'string' ) {\n\t\tdataSource = `url(${ source })`;\n\t\t// eslint-disable-next-line no-undef\n\t} else if ( source instanceof File ) {\n\t\tdataSource = await source.arrayBuffer();\n\t} else {\n\t\treturn;\n\t}\n\n\tconst newFont = new window.FontFace(\n\t\tformatFontFaceName( fontFace.fontFamily ),\n\t\tdataSource,\n\t\t{\n\t\t\tstyle: fontFace.fontStyle,\n\t\t\tweight: fontFace.fontWeight,\n\t\t}\n\t);\n\n\tconst loadedFace = await newFont.load();\n\n\tif ( addTo === 'document' || addTo === 'all' ) {\n\t\tdocument.fonts.add( loadedFace );\n\t}\n\n\tif ( addTo === 'iframe' || addTo === 'all' ) {\n\t\tconst iframeDocument = document.querySelector(\n\t\t\t'iframe[name=\"editor-canvas\"]'\n\t\t).contentDocument;\n\t\tiframeDocument.fonts.add( loadedFace );\n\t}\n}\n\n/*\n * Unloads the font face and remove it from the browser.\n * It also removes it from the iframe document.\n *\n * Note that Font faces that were added to the set using the CSS @font-face rule\n * remain connected to the corresponding CSS, and cannot be deleted.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet/delete.\n */\nexport function unloadFontFaceInBrowser( fontFace, removeFrom = 'all' ) {\n\tconst unloadFontFace = ( fonts ) => {\n\t\tfonts.forEach( ( f ) => {\n\t\t\tif (\n\t\t\t\tf.family === formatFontFaceName( fontFace?.fontFamily ) &&\n\t\t\t\tf.weight === fontFace?.fontWeight &&\n\t\t\t\tf.style === fontFace?.fontStyle\n\t\t\t) {\n\t\t\t\tfonts.delete( f );\n\t\t\t}\n\t\t} );\n\t};\n\n\tif ( removeFrom === 'document' || removeFrom === 'all' ) {\n\t\tunloadFontFace( document.fonts );\n\t}\n\n\tif ( removeFrom === 'iframe' || removeFrom === 'all' ) {\n\t\tconst iframeDocument = document.querySelector(\n\t\t\t'iframe[name=\"editor-canvas\"]'\n\t\t).contentDocument;\n\t\tunloadFontFace( iframeDocument.fonts );\n\t}\n}\n\n/**\n * Retrieves the display source from a font face src.\n *\n * @param {string|string[]} input - The font face src.\n * @return {string|undefined} The display source or undefined if the input is invalid.\n */\nexport function getDisplaySrcFromFontFace( input ) {\n\tif ( ! input ) {\n\t\treturn;\n\t}\n\n\tlet src;\n\tif ( Array.isArray( input ) ) {\n\t\tsrc = input[ 0 ];\n\t} else {\n\t\tsrc = input;\n\t}\n\t// It's expected theme fonts will already be loaded in the browser.\n\tif ( src.startsWith( 'file:.' ) ) {\n\t\treturn;\n\t}\n\tif ( ! isUrlEncoded( src ) ) {\n\t\tsrc = encodeURI( src );\n\t}\n\treturn src;\n}\n\nexport function makeFontFamilyFormData( fontFamily ) {\n\tconst formData = new FormData();\n\n\tconst { fontFace, category, ...familyWithValidParameters } = fontFamily;\n\tconst fontFamilySettings = {\n\t\t...familyWithValidParameters,\n\t\tslug: kebabCase( fontFamily.slug ),\n\t};\n\n\tformData.append(\n\t\t'font_family_settings',\n\t\tJSON.stringify( fontFamilySettings )\n\t);\n\treturn formData;\n}\n\nexport function makeFontFacesFormData( font ) {\n\tif ( font?.fontFace ) {\n\t\tconst fontFacesFormData = font.fontFace.map( ( item, faceIndex ) => {\n\t\t\tconst face = { ...item };\n\t\t\tconst formData = new FormData();\n\t\t\tif ( face.file ) {\n\t\t\t\t// Normalize to an array, since face.file may be a single file or an array of files.\n\t\t\t\tconst files = Array.isArray( face.file )\n\t\t\t\t\t? face.file\n\t\t\t\t\t: [ face.file ];\n\t\t\t\tconst src = [];\n\n\t\t\t\tfiles.forEach( ( file, key ) => {\n\t\t\t\t\t// Slugified file name because the it might contain spaces or characters treated differently on the server.\n\t\t\t\t\tconst fileId = `file-${ faceIndex }-${ key }`;\n\t\t\t\t\t// Add the files to the formData\n\t\t\t\t\tformData.append( fileId, file, file.name );\n\t\t\t\t\tsrc.push( fileId );\n\t\t\t\t} );\n\n\t\t\t\tface.src = src.length === 1 ? src[ 0 ] : src;\n\t\t\t\tdelete face.file;\n\n\t\t\t\tformData.append( 'font_face_settings', JSON.stringify( face ) );\n\t\t\t} else {\n\t\t\t\tformData.append( 'font_face_settings', JSON.stringify( face ) );\n\t\t\t}\n\t\t\treturn formData;\n\t\t} );\n\n\t\treturn fontFacesFormData;\n\t}\n}\n\nexport async function batchInstallFontFaces( fontFamilyId, fontFacesData ) {\n\tconst responses = [];\n\n\t/*\n\t * Uses the same response format as Promise.allSettled, but executes requests in sequence to work\n\t * around a race condition that can cause an error when the fonts directory doesn't exist yet.\n\t */\n\tfor ( const faceData of fontFacesData ) {\n\t\ttry {\n\t\t\tconst response = await fetchInstallFontFace(\n\t\t\t\tfontFamilyId,\n\t\t\t\tfaceData\n\t\t\t);\n\t\t\tresponses.push( { status: 'fulfilled', value: response } );\n\t\t} catch ( error ) {\n\t\t\tresponses.push( { status: 'rejected', reason: error } );\n\t\t}\n\t}\n\n\tconst results = {\n\t\terrors: [],\n\t\tsuccesses: [],\n\t};\n\n\tresponses.forEach( ( result, index ) => {\n\t\tif ( result.status === 'fulfilled' ) {\n\t\t\tconst response = result.value;\n\t\t\tif ( response.id ) {\n\t\t\t\tresults.successes.push( response );\n\t\t\t} else {\n\t\t\t\tresults.errors.push( {\n\t\t\t\t\tdata: fontFacesData[ index ],\n\t\t\t\t\tmessage: `Error: ${ response.message }`,\n\t\t\t\t} );\n\t\t\t}\n\t\t} else {\n\t\t\t// Handle network errors or other fetch-related errors\n\t\t\tresults.errors.push( {\n\t\t\t\tdata: fontFacesData[ index ],\n\t\t\t\tmessage: result.reason.message,\n\t\t\t} );\n\t\t}\n\t} );\n\n\treturn results;\n}\n\n/*\n * Downloads a font face asset from a URL to the client and returns a File object.\n */\nexport async function downloadFontFaceAssets( src ) {\n\t// Normalize to an array, since `src` could be a string or array.\n\tsrc = Array.isArray( src ) ? src : [ src ];\n\n\tconst files = await Promise.all(\n\t\tsrc.map( async ( url ) => {\n\t\t\treturn fetch( new Request( url ) )\n\t\t\t\t.then( ( response ) => {\n\t\t\t\t\tif ( ! response.ok ) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`Error downloading font face asset from ${ url }. Server responded with status: ${ response.status }`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn response.blob();\n\t\t\t\t} )\n\t\t\t\t.then( ( blob ) => {\n\t\t\t\t\tconst filename = url.split( '/' ).pop();\n\t\t\t\t\tconst file = new File( [ blob ], filename, {\n\t\t\t\t\t\ttype: blob.type,\n\t\t\t\t\t} );\n\t\t\t\t\treturn file;\n\t\t\t\t} );\n\t\t} )\n\t);\n\n\t// If we only have one file return it (not the array). Otherwise return all of them in the array.\n\treturn files.length === 1 ? files[ 0 ] : files;\n}\n\n/*\n * Determine if a given Font Face is present in a given collection.\n * We determine that a font face has been installed by comparing the fontWeight and fontStyle\n *\n * @param {Object} fontFace The Font Face to seek\n * @param {Array} collection The Collection to seek in\n * @returns True if the font face is found in the collection. Otherwise False.\n */\nexport function checkFontFaceInstalled( fontFace, collection ) {\n\treturn (\n\t\t-1 !==\n\t\tcollection.findIndex( ( collectionFontFace ) => {\n\t\t\treturn (\n\t\t\t\tcollectionFontFace.fontWeight === fontFace.fontWeight &&\n\t\t\t\tcollectionFontFace.fontStyle === fontFace.fontStyle\n\t\t\t);\n\t\t} )\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;;AAE5E;AACA;AACA;AACA,SAASC,YAAY,EAAEC,WAAW,QAAQ,aAAa;AACvD,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,oBAAoB,QAAQ,cAAc;AACnD,SAASC,kBAAkB,QAAQ,kBAAkB;;AAErD;AACA;AACA;AACA,MAAM;EAAEC;AAAK,CAAC,GAAGC,MAAM;AACvB,MAAM;EAAEC;AAAU,CAAC,GAAGL,MAAM,CAAEH,qBAAsB,CAAC;AAErD,OAAO,SAASS,iBAAiBA,CAAEC,IAAI,EAAEC,WAAW,GAAG,CAAC,CAAC,EAAG;EAC3D,IAAK,CAAED,IAAI,CAACE,IAAI,KAAMF,IAAI,CAACG,UAAU,IAAIH,IAAI,CAACI,IAAI,CAAE,EAAG;IACtDJ,IAAI,CAACE,IAAI,GAAGF,IAAI,CAACG,UAAU,IAAIH,IAAI,CAACI,IAAI;EACzC;EACA,OAAO;IACN,GAAGJ,IAAI;IACP,GAAGC;EACJ,CAAC;AACF;AAEA,OAAO,SAASI,YAAYA,CAAEC,GAAG,EAAG;EACnC,IAAK,OAAOA,GAAG,KAAK,QAAQ,EAAG;IAC9B,OAAO,KAAK;EACb;EACA,OAAOA,GAAG,KAAK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,CAAIlB,QAAQ,IAAM;MACtB,IAAK,CAAEA,QAAQ,CAACmB,EAAE,EAAG;QACpB,MAAM,IAAIC,KAAK,CACd,0CAA2CnG,GAAG,mCAAqC+E,QAAQ,CAACC,MAAM,EACnG,CAAC;MACF;MACA,OAAOD,QAAQ,CAACqB,IAAI,CAAC,CAAC;IACvB,CAAE,CAAC,CACFH,IAAI,CAAIG,IAAI,IAAM;MAClB,MAAMC,QAAQ,GAAGrG,GAAG,CAACsG,KAAK,CAAE,GAAI,CAAC,CAACC,GAAG,CAAC,CAAC;MACvC,MAAMnC,IAAI,GAAG,IAAI9E,IAAI,CAAE,CAAE8G,IAAI,CAAE,EAAEC,QAAQ,EAAE;QAC1CG,IAAI,EAAEJ,IAAI,CAACI;MACZ,CAAE,CAAC;MACH,OAAOpC,IAAI;IACZ,CAAE,CAAC;EACL,CAAE,CACH,CAAC;;EAED;EACA,OAAOC,KAAK,CAACI,MAAM,KAAK,CAAC,GAAGJ,KAAK,CAAE,CAAC,CAAE,GAAGA,KAAK;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASoC,sBAAsBA,CAAEtF,QAAQ,EAAEuF,UAAU,EAAG;EAC9D,OACC,CAAC,CAAC,KACFA,UAAU,CAACC,SAAS,CAAIC,kBAAkB,IAAM;IAC/C,OACCA,kBAAkB,CAACvG,UAAU,KAAKc,QAAQ,CAACd,UAAU,IACrDuG,kBAAkB,CAACrG,SAAS,KAAKY,QAAQ,CAACZ,SAAS;EAErD,CAAE,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/global-styles/font-library-modal/utils/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { FONT_WEIGHTS, FONT_STYLES } from './constants';\nimport { unlock } from '../../../../lock-unlock';\nimport { fetchInstallFontFace } from '../resolvers';\nimport { formatFontFaceName } from './preview-styles';\n\n/**\n * Browser dependencies\n */\nconst { File } = window;\nconst { kebabCase } = unlock( componentsPrivateApis );\n\nexport function setUIValuesNeeded( font, extraValues = {} ) {\n\tif ( ! font.name && ( font.fontFamily || font.slug ) ) {\n\t\tfont.name = font.fontFamily || font.slug;\n\t}\n\treturn {\n\t\t...font,\n\t\t...extraValues,\n\t};\n}\n\nexport function isUrlEncoded( url ) {\n\tif ( typeof url !== 'string' ) {\n\t\treturn false;\n\t}\n\treturn url !== decodeURIComponent( url );\n}\n\nexport function getFontFaceVariantName( face ) {\n\tconst weightName = FONT_WEIGHTS[ face.fontWeight ] || face.fontWeight;\n\tconst styleName =\n\t\tface.fontStyle === 'normal'\n\t\t\t? ''\n\t\t\t: FONT_STYLES[ face.fontStyle ] || face.fontStyle;\n\treturn `${ weightName } ${ styleName }`;\n}\n\nexport function mergeFontFaces( existing = [], incoming = [] ) {\n\tconst map = new Map();\n\tfor ( const face of existing ) {\n\t\tmap.set( `${ face.fontWeight }${ face.fontStyle }`, face );\n\t}\n\tfor ( const face of incoming ) {\n\t\t// This will overwrite if the src already exists, keeping it unique.\n\t\tmap.set( `${ face.fontWeight }${ face.fontStyle }`, face );\n\t}\n\treturn Array.from( map.values() );\n}\n\nexport function mergeFontFamilies( existing = [], incoming = [] ) {\n\tconst map = new Map();\n\t// Add the existing array to the map.\n\tfor ( const font of existing ) {\n\t\tmap.set( font.slug, { ...font } );\n\t}\n\t// Add the incoming array to the map, overwriting existing values excepting fontFace that need to be merged.\n\tfor ( const font of incoming ) {\n\t\tif ( map.has( font.slug ) ) {\n\t\t\tconst { fontFace: incomingFontFaces, ...restIncoming } = font;\n\t\t\tconst existingFont = map.get( font.slug );\n\t\t\t// Merge the fontFaces existing with the incoming fontFaces.\n\t\t\tconst mergedFontFaces = mergeFontFaces(\n\t\t\t\texistingFont.fontFace,\n\t\t\t\tincomingFontFaces\n\t\t\t);\n\t\t\t// Except for the fontFace key all the other keys are overwritten with the incoming values.\n\t\t\tmap.set( font.slug, {\n\t\t\t\t...restIncoming,\n\t\t\t\tfontFace: mergedFontFaces,\n\t\t\t} );\n\t\t} else {\n\t\t\tmap.set( font.slug, { ...font } );\n\t\t}\n\t}\n\treturn Array.from( map.values() );\n}\n\n/*\n * Loads the font face from a URL and adds it to the browser.\n * It also adds it to the iframe document.\n */\nexport async function loadFontFaceInBrowser( fontFace, source, addTo = 'all' ) {\n\tlet dataSource;\n\n\tif ( typeof source === 'string' ) {\n\t\tdataSource = `url(${ source })`;\n\t\t// eslint-disable-next-line no-undef\n\t} else if ( source instanceof File ) {\n\t\tdataSource = await source.arrayBuffer();\n\t} else {\n\t\treturn;\n\t}\n\n\tconst newFont = new window.FontFace(\n\t\tformatFontFaceName( fontFace.fontFamily ),\n\t\tdataSource,\n\t\t{\n\t\t\tstyle: fontFace.fontStyle,\n\t\t\tweight: fontFace.fontWeight,\n\t\t}\n\t);\n\n\tconst loadedFace = await newFont.load();\n\n\tif ( addTo === 'document' || addTo === 'all' ) {\n\t\tdocument.fonts.add( loadedFace );\n\t}\n\n\tif ( addTo === 'iframe' || addTo === 'all' ) {\n\t\tconst iframeDocument = document.querySelector(\n\t\t\t'iframe[name=\"editor-canvas\"]'\n\t\t).contentDocument;\n\t\tiframeDocument.fonts.add( loadedFace );\n\t}\n}\n\n/*\n * Unloads the font face and remove it from the browser.\n * It also removes it from the iframe document.\n *\n * Note that Font faces that were added to the set using the CSS @font-face rule\n * remain connected to the corresponding CSS, and cannot be deleted.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet/delete.\n */\nexport function unloadFontFaceInBrowser( fontFace, removeFrom = 'all' ) {\n\tconst unloadFontFace = ( fonts ) => {\n\t\tfonts.forEach( ( f ) => {\n\t\t\tif (\n\t\t\t\tf.family === formatFontFaceName( fontFace?.fontFamily ) &&\n\t\t\t\tf.weight === fontFace?.fontWeight &&\n\t\t\t\tf.style === fontFace?.fontStyle\n\t\t\t) {\n\t\t\t\tfonts.delete( f );\n\t\t\t}\n\t\t} );\n\t};\n\n\tif ( removeFrom === 'document' || removeFrom === 'all' ) {\n\t\tunloadFontFace( document.fonts );\n\t}\n\n\tif ( removeFrom === 'iframe' || removeFrom === 'all' ) {\n\t\tconst iframeDocument = document.querySelector(\n\t\t\t'iframe[name=\"editor-canvas\"]'\n\t\t).contentDocument;\n\t\tunloadFontFace( iframeDocument.fonts );\n\t}\n}\n\n/**\n * Retrieves the display source from a font face src.\n *\n * @param {string|string[]} input - The font face src.\n * @return {string|undefined} The display source or undefined if the input is invalid.\n */\nexport function getDisplaySrcFromFontFace( input ) {\n\tif ( ! input ) {\n\t\treturn;\n\t}\n\n\tlet src;\n\tif ( Array.isArray( input ) ) {\n\t\tsrc = input[ 0 ];\n\t} else {\n\t\tsrc = input;\n\t}\n\t// It's expected theme fonts will already be loaded in the browser.\n\tif ( src.startsWith( 'file:.' ) ) {\n\t\treturn;\n\t}\n\tif ( ! isUrlEncoded( src ) ) {\n\t\tsrc = encodeURI( src );\n\t}\n\treturn src;\n}\n\nexport function makeFontFamilyFormData( fontFamily ) {\n\tconst formData = new FormData();\n\n\tconst { fontFace, category, ...familyWithValidParameters } = fontFamily;\n\tconst fontFamilySettings = {\n\t\t...familyWithValidParameters,\n\t\tslug: kebabCase( fontFamily.slug ),\n\t};\n\n\tformData.append(\n\t\t'font_family_settings',\n\t\tJSON.stringify( fontFamilySettings )\n\t);\n\treturn formData;\n}\n\nexport function makeFontFacesFormData( font ) {\n\tif ( font?.fontFace ) {\n\t\tconst fontFacesFormData = font.fontFace.map( ( item, faceIndex ) => {\n\t\t\tconst face = { ...item };\n\t\t\tconst formData = new FormData();\n\t\t\tif ( face.file ) {\n\t\t\t\t// Normalize to an array, since face.file may be a single file or an array of files.\n\t\t\t\tconst files = Array.isArray( face.file )\n\t\t\t\t\t? face.file\n\t\t\t\t\t: [ face.file ];\n\t\t\t\tconst src = [];\n\n\t\t\t\tfiles.forEach( ( file, key ) => {\n\t\t\t\t\t// Slugified file name because the it might contain spaces or characters treated differently on the server.\n\t\t\t\t\tconst fileId = `file-${ faceIndex }-${ key }`;\n\t\t\t\t\t// Add the files to the formData\n\t\t\t\t\tformData.append( fileId, file, file.name );\n\t\t\t\t\tsrc.push( fileId );\n\t\t\t\t} );\n\n\t\t\t\tface.src = src.length === 1 ? src[ 0 ] : src;\n\t\t\t\tdelete face.file;\n\n\t\t\t\tformData.append( 'font_face_settings', JSON.stringify( face ) );\n\t\t\t} else {\n\t\t\t\tformData.append( 'font_face_settings', JSON.stringify( face ) );\n\t\t\t}\n\t\t\treturn formData;\n\t\t} );\n\n\t\treturn fontFacesFormData;\n\t}\n}\n\nexport async function batchInstallFontFaces( fontFamilyId, fontFacesData ) {\n\tconst responses = [];\n\n\t/*\n\t * Uses the same response format as Promise.allSettled, but executes requests in sequence to work\n\t * around a race condition that can cause an error when the fonts directory doesn't exist yet.\n\t */\n\tfor ( const faceData of fontFacesData ) {\n\t\ttry {\n\t\t\tconst response = await fetchInstallFontFace(\n\t\t\t\tfontFamilyId,\n\t\t\t\tfaceData\n\t\t\t);\n\t\t\tresponses.push( { status: 'fulfilled', value: response } );\n\t\t} catch ( error ) {\n\t\t\tresponses.push( { status: 'rejected', reason: error } );\n\t\t}\n\t}\n\n\tconst results = {\n\t\terrors: [],\n\t\tsuccesses: [],\n\t};\n\n\tresponses.forEach( ( result, index ) => {\n\t\tif ( result.status === 'fulfilled' ) {\n\t\t\tconst response = result.value;\n\t\t\tif ( response.id ) {\n\t\t\t\tresults.successes.push( response );\n\t\t\t} else {\n\t\t\t\tresults.errors.push( {\n\t\t\t\t\tdata: fontFacesData[ index ],\n\t\t\t\t\tmessage: `Error: ${ response.message }`,\n\t\t\t\t} );\n\t\t\t}\n\t\t} else {\n\t\t\t// Handle network errors or other fetch-related errors\n\t\t\tresults.errors.push( {\n\t\t\t\tdata: fontFacesData[ index ],\n\t\t\t\tmessage: result.reason.message,\n\t\t\t} );\n\t\t}\n\t} );\n\n\treturn results;\n}\n\n/*\n * Downloads a font face asset from a URL to the client and returns a File object.\n */\nexport async function downloadFontFaceAssets( src ) {\n\t// Normalize to an array, since `src` could be a string or array.\n\tsrc = Array.isArray( src ) ? src : [ src ];\n\n\tconst files = await Promise.all(\n\t\tsrc.map( async ( url ) => {\n\t\t\treturn fetch( new Request( url ) )\n\t\t\t\t.then( ( response ) => {\n\t\t\t\t\tif ( ! response.ok ) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`Error downloading font face asset from ${ url }. Server responded with status: ${ response.status }`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn response.blob();\n\t\t\t\t} )\n\t\t\t\t.then( ( blob ) => {\n\t\t\t\t\tconst filename = url.split( '/' ).pop();\n\t\t\t\t\tconst file = new File( [ blob ], filename, {\n\t\t\t\t\t\ttype: blob.type,\n\t\t\t\t\t} );\n\t\t\t\t\treturn file;\n\t\t\t\t} );\n\t\t} )\n\t);\n\n\t// If we only have one file return it (not the array). Otherwise return all of them in the array.\n\treturn files.length === 1 ? files[ 0 ] : files;\n}\n\n/*\n * Determine if a given Font Face is present in a given collection.\n * We determine that a font face has been installed by comparing the fontWeight and fontStyle\n *\n * @param {Object} fontFace The Font Face to seek\n * @param {Array} collection The Collection to seek in\n * @returns True if the font face is found in the collection. Otherwise False.\n */\nexport function checkFontFaceInstalled( fontFace, collection ) {\n\treturn (\n\t\t-1 !==\n\t\tcollection.findIndex( ( collectionFontFace ) => {\n\t\t\treturn (\n\t\t\t\tcollectionFontFace.fontWeight === fontFace.fontWeight &&\n\t\t\t\tcollectionFontFace.fontStyle === fontFace.fontStyle\n\t\t\t);\n\t\t} )\n\t);\n}\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,eAAe,6BAA6B;AAKrD,SAAS,cAAc,mBAAmB;AAC1C,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC,SAAS,0BAA0B;AAKnC,MAAM,EAAE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I;AAEzC,QAAM,QAAQ,MAAM,QAAQ;AAAA,IAC3B,IAAI,IAAK,OAAQ,QAAS;AACzB,aAAO,MAAO,IAAI,QAAS,GAAI,CAAE,EAC/B,KAAM,CAAE,aAAc;AACtB,YAAK,CAAE,SAAS,IAAK;AACpB,gBAAM,IAAI;AAAA,YACT,0CAA2C,GAAI,mCAAoC,SAAS,MAAO;AAAA,UACpG;AAAA,QACD;AACA,eAAO,SAAS,KAAK;AAAA,MACtB,CAAE,EACD,KAAM,CAAE,SAAU;AAClB,cAAM,WAAW,IAAI,MAAO,GAAI,EAAE,IAAI;AACtC,cAAM,OAAO,IAAI,KAAM,CAAE,IAAK,GAAG,UAAU;AAAA,UAC1C,MAAM,KAAK;AAAA,QACZ,CAAE;AACF,eAAO;AAAA,MACR,CAAE;AAAA,IACJ,CAAE;AAAA,EACH;AAGA,SAAO,MAAM,WAAW,IAAI,MAAO,CAAE,IAAI;AAC1C;AAUO,SAAS,uBAAwB,UAAU,YAAa;AAC9D,SACC,OACA,WAAW,UAAW,CAAE,uBAAwB;AAC/C,WACC,mBAAmB,eAAe,SAAS,cAC3C,mBAAmB,cAAc,SAAS;AAAA,EAE5C,CAAE;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { unlock } from '../../../../lock-unlock';
|
|
10
|
-
const {
|
|
11
|
-
kebabCase
|
|
12
|
-
} = unlock(componentsPrivateApis);
|
|
13
|
-
export default function makeFamiliesFromFaces(fontFaces) {
|
|
1
|
+
import { privateApis as componentsPrivateApis } from "@wordpress/components";
|
|
2
|
+
import { unlock } from "../../../../lock-unlock";
|
|
3
|
+
const { kebabCase } = unlock(componentsPrivateApis);
|
|
4
|
+
function makeFamiliesFromFaces(fontFaces) {
|
|
14
5
|
const fontFamiliesObject = fontFaces.reduce((acc, item) => {
|
|
15
6
|
if (!acc[item.fontFamily]) {
|
|
16
7
|
acc[item.fontFamily] = {
|
|
@@ -25,4 +16,7 @@ export default function makeFamiliesFromFaces(fontFaces) {
|
|
|
25
16
|
}, {});
|
|
26
17
|
return Object.values(fontFamiliesObject);
|
|
27
18
|
}
|
|
28
|
-
|
|
19
|
+
export {
|
|
20
|
+
makeFamiliesFromFaces as default
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=make-families-from-faces.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/global-styles/font-library-modal/utils/make-families-from-faces.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../../lock-unlock';\n\nconst { kebabCase } = unlock( componentsPrivateApis );\n\nexport default function makeFamiliesFromFaces( fontFaces ) {\n\tconst fontFamiliesObject = fontFaces.reduce( ( acc, item ) => {\n\t\tif ( ! acc[ item.fontFamily ] ) {\n\t\t\tacc[ item.fontFamily ] = {\n\t\t\t\tname: item.fontFamily,\n\t\t\t\tfontFamily: item.fontFamily,\n\t\t\t\tslug: kebabCase( item.fontFamily.toLowerCase() ),\n\t\t\t\tfontFace: [],\n\t\t\t};\n\t\t}\n\t\tacc[ item.fontFamily ].fontFace.push( item );\n\t\treturn acc;\n\t}, {} );\n\treturn Object.values( fontFamiliesObject );\n}\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,eAAe,6BAA6B;AAKrD,SAAS,cAAc;AAEvB,MAAM,EAAE,UAAU,IAAI,OAAQ,qBAAsB;AAErC,SAAR,sBAAwC,WAAY;AAC1D,QAAM,qBAAqB,UAAU,OAAQ,CAAE,KAAK,SAAU;AAC7D,QAAK,CAAE,IAAK,KAAK,UAAW,GAAI;AAC/B,UAAK,KAAK,UAAW,IAAI;AAAA,QACxB,MAAM,KAAK;AAAA,QACX,YAAY,KAAK;AAAA,QACjB,MAAM,UAAW,KAAK,WAAW,YAAY,CAAE;AAAA,QAC/C,UAAU,CAAC;AAAA,MACZ;AAAA,IACD;AACA,QAAK,KAAK,UAAW,EAAE,SAAS,KAAM,IAAK;AAC3C,WAAO;AAAA,EACR,GAAG,CAAC,CAAE;AACN,SAAO,OAAO,OAAQ,kBAAmB;AAC1C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|