@wordpress/edit-site 3.0.1-next.253d9b6e21.0 → 3.0.3
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/README.md +1 -1
- package/build/components/block-editor/back-button.js +60 -0
- package/build/components/block-editor/back-button.js.map +1 -0
- package/build/components/block-editor/index.js +20 -5
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/edit-template-part-menu-button/index.js +63 -0
- package/build/components/edit-template-part-menu-button/index.js.map +1 -0
- package/build/components/editor/global-styles-provider.js +15 -2
- package/build/components/editor/global-styles-provider.js.map +1 -1
- package/build/components/editor/global-styles-renderer.js +8 -8
- package/build/components/editor/global-styles-renderer.js.map +1 -1
- package/build/components/editor/index.js +7 -7
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/utils.js +4 -9
- package/build/components/editor/utils.js.map +1 -1
- package/build/components/{sidebar → global-styles}/border-panel.js +2 -2
- package/build/components/global-styles/border-panel.js.map +1 -0
- package/build/components/{sidebar → global-styles}/color-palette-panel.js +4 -2
- package/build/components/global-styles/color-palette-panel.js.map +1 -0
- package/build/components/{sidebar → global-styles}/color-panel.js +24 -21
- package/build/components/global-styles/color-panel.js.map +1 -0
- package/build/components/global-styles/context-menu.js +58 -0
- package/build/components/global-styles/context-menu.js.map +1 -0
- package/build/components/{sidebar → global-styles}/dimensions-panel.js +58 -8
- package/build/components/global-styles/dimensions-panel.js.map +1 -0
- package/build/components/global-styles/header.js +54 -0
- package/build/components/global-styles/header.js.map +1 -0
- package/build/components/global-styles/index.js +89 -0
- package/build/components/global-styles/index.js.map +1 -0
- package/build/components/global-styles/navigation-button.js +43 -0
- package/build/components/global-styles/navigation-button.js.map +1 -0
- package/build/components/global-styles/palette.js +57 -0
- package/build/components/global-styles/palette.js.map +1 -0
- package/build/components/global-styles/preview.js +59 -0
- package/build/components/global-styles/preview.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +76 -0
- package/build/components/global-styles/screen-block-list.js.map +1 -0
- package/build/components/global-styles/screen-block.js +45 -0
- package/build/components/global-styles/screen-block.js.map +1 -0
- package/build/components/global-styles/screen-color-palette.js +48 -0
- package/build/components/global-styles/screen-color-palette.js.map +1 -0
- package/build/components/global-styles/screen-colors.js +51 -0
- package/build/components/global-styles/screen-colors.js.map +1 -0
- package/build/components/global-styles/screen-layout.js +60 -0
- package/build/components/global-styles/screen-layout.js.map +1 -0
- package/build/components/global-styles/screen-root.js +44 -0
- package/build/components/global-styles/screen-root.js.map +1 -0
- package/build/components/global-styles/screen-typography.js +50 -0
- package/build/components/global-styles/screen-typography.js.map +1 -0
- package/build/components/global-styles/subtitle.js +25 -0
- package/build/components/global-styles/subtitle.js.map +1 -0
- package/build/components/{sidebar → global-styles}/typography-panel.js +1 -3
- package/build/components/global-styles/typography-panel.js.map +1 -0
- package/build/components/header/document-actions/index.js +1 -1
- package/build/components/header/document-actions/index.js.map +1 -1
- package/build/components/header/plugin-more-menu-item/index.js +82 -0
- package/build/components/header/plugin-more-menu-item/index.js.map +1 -0
- package/build/components/header/plugin-sidebar-more-menu-item/index.js +75 -0
- package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -0
- package/build/components/header/undo-redo/redo.js +1 -1
- package/build/components/header/undo-redo/redo.js.map +1 -1
- package/build/components/header/undo-redo/undo.js +1 -1
- package/build/components/header/undo-redo/undo.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +2 -10
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/navigation-sidebar/index.js +1 -1
- package/build/components/navigation-sidebar/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/constants.js +10 -10
- package/build/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/content-navigation-item.js +1 -3
- package/build/components/navigation-sidebar/navigation-panel/content-navigation-item.js.map +1 -1
- package/build/components/save-button/index.js +1 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +2 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/sidebar/global-styles-sidebar.js +11 -161
- package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +1 -6
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +95 -0
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -0
- package/build/components/template-details/index.js +12 -6
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +73 -0
- package/build/components/template-details/template-areas.js.map +1 -0
- package/build/components/template-part-converter/convert-to-regular.js +3 -3
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/index.js +1 -1
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/url-query-controller/index.js +1 -1
- package/build/components/url-query-controller/index.js.map +1 -1
- package/build/index.js +24 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +60 -7
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +19 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/reducer.js +16 -7
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +91 -9
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +48 -0
- package/build-module/components/block-editor/back-button.js.map +1 -0
- package/build-module/components/block-editor/index.js +17 -5
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/edit-template-part-menu-button/index.js +49 -0
- package/build-module/components/edit-template-part-menu-button/index.js.map +1 -0
- package/build-module/components/editor/global-styles-provider.js +16 -3
- package/build-module/components/editor/global-styles-provider.js.map +1 -1
- package/build-module/components/editor/global-styles-renderer.js +8 -8
- package/build-module/components/editor/global-styles-renderer.js.map +1 -1
- package/build-module/components/editor/index.js +4 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/utils.js +2 -7
- package/build-module/components/editor/utils.js.map +1 -1
- package/build-module/components/{sidebar → global-styles}/border-panel.js +2 -2
- package/build-module/components/global-styles/border-panel.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/color-palette-panel.js +4 -2
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/color-panel.js +25 -22
- package/build-module/components/global-styles/color-panel.js.map +1 -0
- package/build-module/components/global-styles/context-menu.js +41 -0
- package/build-module/components/global-styles/context-menu.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/dimensions-panel.js +58 -9
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -0
- package/build-module/components/global-styles/header.js +41 -0
- package/build-module/components/global-styles/header.js.map +1 -0
- package/build-module/components/global-styles/index.js +70 -0
- package/build-module/components/global-styles/index.js.map +1 -0
- package/build-module/components/global-styles/navigation-button.js +31 -0
- package/build-module/components/global-styles/navigation-button.js.map +1 -0
- package/build-module/components/global-styles/palette.js +43 -0
- package/build-module/components/global-styles/palette.js.map +1 -0
- package/build-module/components/global-styles/preview.js +50 -0
- package/build-module/components/global-styles/preview.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +58 -0
- package/build-module/components/global-styles/screen-block-list.js.map +1 -0
- package/build-module/components/global-styles/screen-block.js +32 -0
- package/build-module/components/global-styles/screen-block.js.map +1 -0
- package/build-module/components/global-styles/screen-color-palette.js +35 -0
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -0
- package/build-module/components/global-styles/screen-colors.js +38 -0
- package/build-module/components/global-styles/screen-colors.js.map +1 -0
- package/build-module/components/global-styles/screen-layout.js +44 -0
- package/build-module/components/global-styles/screen-layout.js.map +1 -0
- package/build-module/components/global-styles/screen-root.js +29 -0
- package/build-module/components/global-styles/screen-root.js.map +1 -0
- package/build-module/components/global-styles/screen-typography.js +37 -0
- package/build-module/components/global-styles/screen-typography.js.map +1 -0
- package/build-module/components/global-styles/subtitle.js +17 -0
- package/build-module/components/global-styles/subtitle.js.map +1 -0
- package/build-module/components/{sidebar → global-styles}/typography-panel.js +1 -2
- package/build-module/components/global-styles/typography-panel.js.map +1 -0
- package/build-module/components/header/document-actions/index.js +1 -1
- package/build-module/components/header/document-actions/index.js.map +1 -1
- package/build-module/components/header/plugin-more-menu-item/index.js +70 -0
- package/build-module/components/header/plugin-more-menu-item/index.js.map +1 -0
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +64 -0
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -0
- package/build-module/components/header/undo-redo/redo.js +1 -1
- package/build-module/components/header/undo-redo/redo.js.map +1 -1
- package/build-module/components/header/undo-redo/undo.js +1 -1
- package/build-module/components/header/undo-redo/undo.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +3 -11
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/index.js +1 -1
- package/build-module/components/navigation-sidebar/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js +5 -3
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/content-navigation-item.js +1 -3
- package/build-module/components/navigation-sidebar/navigation-panel/content-navigation-item.js.map +1 -1
- package/build-module/components/save-button/index.js +1 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +2 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/sidebar/global-styles-sidebar.js +13 -159
- package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +2 -7
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +84 -0
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -0
- package/build-module/components/template-details/index.js +13 -8
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +60 -0
- package/build-module/components/template-details/template-areas.js.map +1 -0
- package/build-module/components/template-part-converter/convert-to-regular.js +3 -3
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/template-part-converter/index.js +1 -1
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/url-query-controller/index.js +1 -1
- package/build-module/components/url-query-controller/index.js.map +1 -1
- package/build-module/index.js +3 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +51 -7
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +13 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/reducer.js +16 -7
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +85 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +158 -19
- package/build-style/style.css +158 -19
- package/package.json +26 -26
- package/src/components/block-editor/back-button.js +44 -0
- package/src/components/block-editor/index.js +18 -2
- package/src/components/block-editor/style.scss +26 -0
- package/src/components/edit-template-part-menu-button/index.js +57 -0
- package/src/components/editor/global-styles-provider.js +19 -3
- package/src/components/editor/global-styles-renderer.js +8 -5
- package/src/components/editor/index.js +5 -8
- package/src/components/editor/test/global-styles-provider.js +131 -0
- package/src/components/editor/test/global-styles-renderer.js +1 -1
- package/src/components/editor/test/utils.js +146 -0
- package/src/components/editor/utils.js +2 -7
- package/src/components/{sidebar → global-styles}/border-panel.js +2 -2
- package/src/components/{sidebar → global-styles}/color-palette-panel.js +13 -11
- package/src/components/{sidebar → global-styles}/color-panel.js +43 -28
- package/src/components/global-styles/context-menu.js +54 -0
- package/src/components/{sidebar → global-styles}/dimensions-panel.js +60 -9
- package/src/components/global-styles/header.js +50 -0
- package/src/components/global-styles/index.js +81 -0
- package/src/components/global-styles/navigation-button.js +35 -0
- package/src/components/global-styles/palette.js +67 -0
- package/src/components/global-styles/preview.js +41 -0
- package/src/components/global-styles/screen-block-list.js +59 -0
- package/src/components/global-styles/screen-block.js +28 -0
- package/src/components/global-styles/screen-color-palette.js +33 -0
- package/src/components/global-styles/screen-colors.js +36 -0
- package/src/components/global-styles/screen-layout.js +45 -0
- package/src/components/global-styles/screen-root.js +43 -0
- package/src/components/global-styles/screen-typography.js +33 -0
- package/src/components/global-styles/style.scss +35 -0
- package/src/components/global-styles/subtitle.js +10 -0
- package/src/components/{sidebar → global-styles}/typography-panel.js +1 -2
- package/src/components/header/document-actions/index.js +1 -1
- package/src/components/header/plugin-more-menu-item/index.js +71 -0
- package/src/components/header/plugin-sidebar-more-menu-item/index.js +64 -0
- package/src/components/header/undo-redo/redo.js +4 -1
- package/src/components/header/undo-redo/undo.js +4 -1
- package/src/components/keyboard-shortcuts/index.js +25 -40
- package/src/components/navigation-sidebar/index.js +1 -1
- package/src/components/navigation-sidebar/navigation-panel/constants.js +9 -4
- package/src/components/navigation-sidebar/navigation-panel/content-navigation-item.js +1 -1
- package/src/components/navigation-sidebar/navigation-panel/style.scss +1 -0
- package/src/components/navigation-sidebar/navigation-toggle/style.scss +3 -2
- package/src/components/save-button/index.js +1 -1
- package/src/components/secondary-sidebar/inserter-sidebar.js +1 -0
- package/src/components/sidebar/global-styles-sidebar.js +14 -187
- package/src/components/sidebar/index.js +2 -7
- package/src/components/sidebar/plugin-sidebar/index.js +80 -0
- package/src/components/sidebar/style.scss +40 -0
- package/src/components/template-details/index.js +17 -7
- package/src/components/template-details/style.scss +36 -27
- package/src/components/template-details/template-areas.js +66 -0
- package/src/components/template-part-converter/convert-to-regular.js +2 -8
- package/src/components/template-part-converter/index.js +1 -1
- package/src/components/url-query-controller/index.js +1 -1
- package/src/index.js +3 -0
- package/src/store/actions.js +59 -7
- package/src/store/constants.js +15 -0
- package/src/store/reducer.js +26 -12
- package/src/store/selectors.js +96 -9
- package/src/store/test/reducer.js +40 -23
- package/src/store/test/selectors.js +34 -3
- package/src/style.scss +1 -0
- package/build/components/sidebar/border-panel.js.map +0 -1
- package/build/components/sidebar/color-palette-panel.js.map +0 -1
- package/build/components/sidebar/color-panel.js.map +0 -1
- package/build/components/sidebar/dimensions-panel.js.map +0 -1
- package/build/components/sidebar/typography-panel.js.map +0 -1
- package/build-module/components/sidebar/border-panel.js.map +0 -1
- package/build-module/components/sidebar/color-palette-panel.js.map +0 -1
- package/build-module/components/sidebar/color-panel.js.map +0 -1
- package/build-module/components/sidebar/dimensions-panel.js.map +0 -1
- package/build-module/components/sidebar/typography-panel.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/constants.js"],"names":["TEMPLATES_PRIMARY","TEMPLATES_SECONDARY","TEMPLATES_TOP_LEVEL","TEMPLATES_GENERAL","TEMPLATES_POSTS_PREFIXES","TEMPLATES_PAGES_PREFIXES","TEMPLATES_NEW_OPTIONS","TEMPLATE_OVERRIDES","singular","index","home","MENU_ROOT","MENU_CONTENT_CATEGORIES","MENU_CONTENT_PAGES","MENU_CONTENT_POSTS","MENU_TEMPLATE_PARTS","MENU_TEMPLATES","MENU_TEMPLATES_GENERAL","MENU_TEMPLATES_PAGES","MENU_TEMPLATES_POSTS","MENU_TEMPLATES_UNUSED","SEARCH_DEBOUNCE_IN_MS","MENU_TEMPLATE_PARTS_HEADERS","MENU_TEMPLATE_PARTS_FOOTERS","MENU_TEMPLATE_PARTS_SIDEBARS","MENU_TEMPLATE_PARTS_GENERAL","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/constants.js"],"names":["TEMPLATES_PRIMARY","TEMPLATES_SECONDARY","TEMPLATES_TOP_LEVEL","TEMPLATES_GENERAL","TEMPLATES_POSTS_PREFIXES","TEMPLATES_PAGES_PREFIXES","TEMPLATES_NEW_OPTIONS","TEMPLATE_OVERRIDES","singular","index","home","MENU_ROOT","MENU_CONTENT_CATEGORIES","MENU_CONTENT_PAGES","MENU_CONTENT_POSTS","MENU_TEMPLATE_PARTS","MENU_TEMPLATES","MENU_TEMPLATES_GENERAL","MENU_TEMPLATES_PAGES","MENU_TEMPLATES_POSTS","MENU_TEMPLATES_UNUSED","SEARCH_DEBOUNCE_IN_MS","MENU_TEMPLATE_PARTS_HEADERS","MENU_TEMPLATE_PARTS_FOOTERS","MENU_TEMPLATE_PARTS_SIDEBARS","MENU_TEMPLATE_PARTS_GENERAL","TEMPLATE_PARTS_SUB_MENUS","area","TEMPLATE_PART_AREA_HEADER","menu","title","TEMPLATE_PART_AREA_FOOTER","TEMPLATE_PART_AREA_SIDEBAR"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAOO,MAAMA,iBAAiB,GAAG,CAChC,OADgC,EAEhC,UAFgC,EAGhC,SAHgC,EAIhC,QAJgC,EAKhC,MALgC,EAMhC,MANgC,EAOhC,KAPgC,EAQhC,QARgC,CAA1B;;AAWA,MAAMC,mBAAmB,GAAG,CAClC,QADkC,EAElC,UAFkC,EAGlC,UAHkC,EAIlC,MAJkC,EAKlC,KALkC,EAMlC,YANkC,EAOlC,aAPkC,EAQlC,YARkC,CAA5B;;AAWA,MAAMC,mBAAmB,GAAG,CAClC,GAAGF,iBAD+B,EAElC,GAAGC,mBAF+B,CAA5B;;AAKA,MAAME,iBAAiB,GAAG,CAAE,WAAF,CAA1B;;AAEA,MAAMC,wBAAwB,GAAG,CACvC,OADuC,EAEvC,SAFuC,EAGvC,cAHuC,EAIvC,MAJuC,CAAjC;;AAOA,MAAMC,wBAAwB,GAAG,CAAE,OAAF,CAAjC;;AAEA,MAAMC,qBAAqB,GAAG,CACpC,YADoC,EAEpC,aAFoC,EAGpC,MAHoC,EAIpC,SAJoC,EAKpC,QALoC,EAMpC,KANoC,EAOpC,OAPoC,CAA9B;;AAUA,MAAMC,kBAAkB,GAAG;AACjCC,EAAAA,QAAQ,EAAE,CAAE,QAAF,EAAY,MAAZ,CADuB;AAEjCC,EAAAA,KAAK,EAAE,CAAE,SAAF,EAAa,KAAb,EAAoB,QAApB,EAA8B,UAA9B,EAA0C,MAA1C,CAF0B;AAGjCC,EAAAA,IAAI,EAAE,CAAE,YAAF;AAH2B,CAA3B;;AAMA,MAAMC,SAAS,GAAG,MAAlB;;AACA,MAAMC,uBAAuB,GAAG,oBAAhC;;AACA,MAAMC,kBAAkB,GAAG,eAA3B;;AACA,MAAMC,kBAAkB,GAAG,eAA3B;;AACA,MAAMC,mBAAmB,GAAG,gBAA5B;;AACA,MAAMC,cAAc,GAAG,WAAvB;;AACA,MAAMC,sBAAsB,GAAG,mBAA/B;;AACA,MAAMC,oBAAoB,GAAG,iBAA7B;;AACA,MAAMC,oBAAoB,GAAG,iBAA7B;;AACA,MAAMC,qBAAqB,GAAG,kBAA9B;;AAEA,MAAMC,qBAAqB,GAAG,EAA9B;;AAEA,MAAMC,2BAA2B,GAAG,wBAApC;;AACA,MAAMC,2BAA2B,GAAG,wBAApC;;AACA,MAAMC,4BAA4B,GAAG,yBAArC;;AACA,MAAMC,2BAA2B,GAAG,wBAApC;;AAEA,MAAMC,wBAAwB,GAAG,CACvC;AACCC,EAAAA,IAAI,EAAEC,oCADP;AAECC,EAAAA,IAAI,EAAEP,2BAFP;AAGCQ,EAAAA,KAAK,EAAE,cAAI,SAAJ;AAHR,CADuC,EAMvC;AACCH,EAAAA,IAAI,EAAEI,oCADP;AAECF,EAAAA,IAAI,EAAEN,2BAFP;AAGCO,EAAAA,KAAK,EAAE,cAAI,SAAJ;AAHR,CANuC,EAWvC;AACCH,EAAAA,IAAI,EAAEK,qCADP;AAECH,EAAAA,IAAI,EAAEL,4BAFP;AAGCM,EAAAA,KAAK,EAAE,cAAI,UAAJ;AAHR,CAXuC,EAgBvC;AACCH,EAAAA,IAAI,EAAE,eADP;AAECE,EAAAA,IAAI,EAAEJ,2BAFP;AAGCK,EAAAA,KAAK,EAAE,cAAI,SAAJ;AAHR,CAhBuC,CAAjC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_PART_AREA_HEADER,\n\tTEMPLATE_PART_AREA_FOOTER,\n\tTEMPLATE_PART_AREA_SIDEBAR,\n} from '../../../store/constants';\n\nexport const TEMPLATES_PRIMARY = [\n\t'index',\n\t'singular',\n\t'archive',\n\t'single',\n\t'page',\n\t'home',\n\t'404',\n\t'search',\n];\n\nexport const TEMPLATES_SECONDARY = [\n\t'author',\n\t'category',\n\t'taxonomy',\n\t'date',\n\t'tag',\n\t'attachment',\n\t'single-post',\n\t'front-page',\n];\n\nexport const TEMPLATES_TOP_LEVEL = [\n\t...TEMPLATES_PRIMARY,\n\t...TEMPLATES_SECONDARY,\n];\n\nexport const TEMPLATES_GENERAL = [ 'page-home' ];\n\nexport const TEMPLATES_POSTS_PREFIXES = [\n\t'post-',\n\t'author-',\n\t'single-post-',\n\t'tag-',\n];\n\nexport const TEMPLATES_PAGES_PREFIXES = [ 'page-' ];\n\nexport const TEMPLATES_NEW_OPTIONS = [\n\t'front-page',\n\t'single-post',\n\t'page',\n\t'archive',\n\t'search',\n\t'404',\n\t'index',\n];\n\nexport const TEMPLATE_OVERRIDES = {\n\tsingular: [ 'single', 'page' ],\n\tindex: [ 'archive', '404', 'search', 'singular', 'home' ],\n\thome: [ 'front-page' ],\n};\n\nexport const MENU_ROOT = 'root';\nexport const MENU_CONTENT_CATEGORIES = 'content-categories';\nexport const MENU_CONTENT_PAGES = 'content-pages';\nexport const MENU_CONTENT_POSTS = 'content-posts';\nexport const MENU_TEMPLATE_PARTS = 'template-parts';\nexport const MENU_TEMPLATES = 'templates';\nexport const MENU_TEMPLATES_GENERAL = 'templates-general';\nexport const MENU_TEMPLATES_PAGES = 'templates-pages';\nexport const MENU_TEMPLATES_POSTS = 'templates-posts';\nexport const MENU_TEMPLATES_UNUSED = 'templates-unused';\n\nexport const SEARCH_DEBOUNCE_IN_MS = 75;\n\nexport const MENU_TEMPLATE_PARTS_HEADERS = 'template-parts-headers';\nexport const MENU_TEMPLATE_PARTS_FOOTERS = 'template-parts-footers';\nexport const MENU_TEMPLATE_PARTS_SIDEBARS = 'template-parts-sidebars';\nexport const MENU_TEMPLATE_PARTS_GENERAL = 'template-parts-general';\n\nexport const TEMPLATE_PARTS_SUB_MENUS = [\n\t{\n\t\tarea: TEMPLATE_PART_AREA_HEADER,\n\t\tmenu: MENU_TEMPLATE_PARTS_HEADERS,\n\t\ttitle: __( 'Headers' ),\n\t},\n\t{\n\t\tarea: TEMPLATE_PART_AREA_FOOTER,\n\t\tmenu: MENU_TEMPLATE_PARTS_FOOTERS,\n\t\ttitle: __( 'Footers' ),\n\t},\n\t{\n\t\tarea: TEMPLATE_PART_AREA_SIDEBAR,\n\t\tmenu: MENU_TEMPLATE_PARTS_SIDEBARS,\n\t\ttitle: __( 'Sidebars' ),\n\t},\n\t{\n\t\tarea: 'uncategorized',\n\t\tmenu: MENU_TEMPLATE_PARTS_GENERAL,\n\t\ttitle: __( 'General' ),\n\t},\n];\n"]}
|
|
@@ -47,15 +47,13 @@ function ContentNavigationItem({
|
|
|
47
47
|
}) {
|
|
48
48
|
const [isPreviewVisible, setIsPreviewVisible] = (0, _element.useState)(false);
|
|
49
49
|
const previewContent = (0, _data.useSelect)(select => {
|
|
50
|
-
var _template$content;
|
|
51
|
-
|
|
52
50
|
if (!isPreviewVisible) {
|
|
53
51
|
return null;
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
const template = select(_coreData.store).__experimentalGetTemplateForLink(item.link);
|
|
57
55
|
|
|
58
|
-
return template === null || template === void 0 ? void 0 :
|
|
56
|
+
return template === null || template === void 0 ? void 0 : template.content;
|
|
59
57
|
}, [isPreviewVisible]);
|
|
60
58
|
const {
|
|
61
59
|
setPage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/content-navigation-item.js"],"names":["getTitle","entity","title","taxonomy","name","rendered","titleElement","document","createElement","innerHTML","textContent","innerText","ContentNavigationItem","item","isPreviewVisible","setIsPreviewVisible","previewContent","select","template","coreStore","__experimentalGetTemplateForLink","link","content","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/content-navigation-item.js"],"names":["getTitle","entity","title","taxonomy","name","rendered","titleElement","document","createElement","innerHTML","textContent","innerText","ContentNavigationItem","item","isPreviewVisible","setIsPreviewVisible","previewContent","select","template","coreStore","__experimentalGetTemplateForLink","link","content","setPage","setIsNavigationPanelOpened","editSiteStore","onActivateItem","type","slug","id","path","context","postType","postId"],"mappings":";;;;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAfA;AACA;AACA;;AAQA;AACA;AACA;AAKA,MAAMA,QAAQ,GAAKC,MAAF,IAAc;AAAA;;AAC9B,QAAMC,KAAK,GAAGD,MAAM,CAACE,QAAP,GAAkBF,MAAM,CAACG,IAAzB,GAAgCH,MAAhC,aAAgCA,MAAhC,wCAAgCA,MAAM,CAAEC,KAAxC,kDAAgC,cAAeG,QAA7D,CAD8B,CAG9B;;AACA,QAAMC,YAAY,GAAGC,QAAQ,CAACC,aAAT,CAAwB,KAAxB,CAArB;AACAF,EAAAA,YAAY,CAACG,SAAb,GAAyBP,KAAzB;AAEA,SAAOI,YAAY,CAACI,WAAb,IAA4BJ,YAAY,CAACK,SAAzC,IAAsD,EAA7D;AACA,CARD;;AAUe,SAASC,qBAAT,CAAgC;AAAEC,EAAAA;AAAF,CAAhC,EAA2C;AACzD,QAAM,CAAEC,gBAAF,EAAoBC,mBAApB,IAA4C,uBAAU,KAAV,CAAlD;AACA,QAAMC,cAAc,GAAG,qBACpBC,MAAF,IAAc;AACb,QAAK,CAAEH,gBAAP,EAA0B;AACzB,aAAO,IAAP;AACA;;AAED,UAAMI,QAAQ,GAAGD,MAAM,CACtBE,eADsB,CAAN,CAEfC,gCAFe,CAEmBP,IAAI,CAACQ,IAFxB,CAAjB;;AAGA,WAAOH,QAAP,aAAOA,QAAP,uBAAOA,QAAQ,CAAEI,OAAjB;AACA,GAVqB,EAWtB,CAAER,gBAAF,CAXsB,CAAvB;AAaA,QAAM;AAAES,IAAAA,OAAF;AAAWC,IAAAA;AAAX,MAA0C,uBAC/CC,YAD+C,CAAhD;AAIA,QAAMC,cAAc,GAAG,0BAAa,MAAM;AACzC,UAAM;AAAEC,MAAAA,IAAF;AAAQC,MAAAA,IAAR;AAAcP,MAAAA,IAAd;AAAoBQ,MAAAA;AAApB,QAA2BhB,IAAjC;AACAU,IAAAA,OAAO,CAAE;AACRI,MAAAA,IADQ;AAERC,MAAAA,IAFQ;AAGRE,MAAAA,IAAI,EAAE,gCAAuBT,IAAvB,CAHE;AAIRU,MAAAA,OAAO,EAAE;AACRC,QAAAA,QAAQ,EAAEL,IADF;AAERM,QAAAA,MAAM,EAAEJ;AAFA;AAJD,KAAF,CAAP;AASAL,IAAAA,0BAA0B,CAAE,KAAF,CAA1B;AACA,GAZsB,EAYpB,CAAED,OAAF,EAAWV,IAAX,CAZoB,CAAvB;;AAcA,MAAK,CAAEA,IAAP,EAAc;AACb,WAAO,IAAP;AACA;;AAED,SACC,qDACC,4BAAC,wCAAD;AACC,IAAA,SAAS,EAAC,0CADX;AAEC,IAAA,IAAI,EAAI,GAAGA,IAAI,CAACV,QAAL,IAAiBU,IAAI,CAACc,IAAM,IAAId,IAAI,CAACgB,EAAI,EAFrD;AAGC,IAAA,KAAK,EAAG7B,QAAQ,CAAEa,IAAF,CAAR,IAAoB,cAAI,YAAJ,CAH7B;AAIC,IAAA,OAAO,EAAGa,cAJX;AAKC,IAAA,YAAY,EAAG,MAAMX,mBAAmB,CAAE,IAAF,CALzC;AAMC,IAAA,YAAY,EAAG,MAAMA,mBAAmB,CAAE,KAAF;AANzC,IADD,EAUGD,gBAAgB,IAAIE,cAApB,IACD,4BAAC,4BAAD,QACC,4BAAC,wBAAD;AACC,IAAA,UAAU,EAAGA,cADd;AAEC,IAAA,YAAY,EAAG;AACdgB,MAAAA,QAAQ,EAAEnB,IAAI,CAACc,IADD;AAEdM,MAAAA,MAAM,EAAEpB,IAAI,CAACgB;AAFC;AAFhB,IADD,CAXF,CADD;AAwBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalNavigationItem as NavigationItem } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useCallback, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { getPathAndQueryString } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { NavigationPanelPreviewFill } from '..';\nimport TemplatePreview from './template-preview';\nimport { store as editSiteStore } from '../../../store';\n\nconst getTitle = ( entity ) => {\n\tconst title = entity.taxonomy ? entity.name : entity?.title?.rendered;\n\n\t// Make sure encoded characters are displayed as the characters they represent.\n\tconst titleElement = document.createElement( 'div' );\n\ttitleElement.innerHTML = title;\n\n\treturn titleElement.textContent || titleElement.innerText || '';\n};\n\nexport default function ContentNavigationItem( { item } ) {\n\tconst [ isPreviewVisible, setIsPreviewVisible ] = useState( false );\n\tconst previewContent = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isPreviewVisible ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst template = select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetTemplateForLink( item.link );\n\t\t\treturn template?.content;\n\t\t},\n\t\t[ isPreviewVisible ]\n\t);\n\tconst { setPage, setIsNavigationPanelOpened } = useDispatch(\n\t\teditSiteStore\n\t);\n\n\tconst onActivateItem = useCallback( () => {\n\t\tconst { type, slug, link, id } = item;\n\t\tsetPage( {\n\t\t\ttype,\n\t\t\tslug,\n\t\t\tpath: getPathAndQueryString( link ),\n\t\t\tcontext: {\n\t\t\t\tpostType: type,\n\t\t\t\tpostId: id,\n\t\t\t},\n\t\t} );\n\t\tsetIsNavigationPanelOpened( false );\n\t}, [ setPage, item ] );\n\n\tif ( ! item ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<NavigationItem\n\t\t\t\tclassName=\"edit-site-navigation-panel__content-item\"\n\t\t\t\titem={ `${ item.taxonomy || item.type }-${ item.id }` }\n\t\t\t\ttitle={ getTitle( item ) || __( '(no title)' ) }\n\t\t\t\tonClick={ onActivateItem }\n\t\t\t\tonMouseEnter={ () => setIsPreviewVisible( true ) }\n\t\t\t\tonMouseLeave={ () => setIsPreviewVisible( false ) }\n\t\t\t/>\n\n\t\t\t{ isPreviewVisible && previewContent && (\n\t\t\t\t<NavigationPanelPreviewFill>\n\t\t\t\t\t<TemplatePreview\n\t\t\t\t\t\trawContent={ previewContent }\n\t\t\t\t\t\tblockContext={ {\n\t\t\t\t\t\t\tpostType: item.type,\n\t\t\t\t\t\t\tpostId: item.id,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</NavigationPanelPreviewFill>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -43,7 +43,7 @@ function SaveButton({
|
|
|
43
43
|
isDirty: dirtyEntityRecords.length > 0,
|
|
44
44
|
isSaving: (0, _lodash.some)(dirtyEntityRecords, record => isSavingEntityRecord(record.kind, record.name, record.key))
|
|
45
45
|
};
|
|
46
|
-
});
|
|
46
|
+
}, []);
|
|
47
47
|
const disabled = !isDirty || isSaving;
|
|
48
48
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.Button, {
|
|
49
49
|
variant: "primary",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["SaveButton","openEntitiesSavedStates","isEntitiesSavedStatesOpen","isDirty","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","length","record","kind","name","key","disabled","undefined"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMe,SAASA,UAAT,CAAqB;AACnCC,EAAAA,uBADmC;AAEnCC,EAAAA;AAFmC,CAArB,EAGX;AACH,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,MAAwB,qBAAaC,MAAF,IAAc;AACtD,UAAM;AACLC,MAAAA,mCADK;AAELC,MAAAA;AAFK,QAGFF,MAAM,CAAEG,eAAF,CAHV;;AAIA,UAAMC,kBAAkB,GAAGH,mCAAmC,EAA9D;;AACA,WAAO;AACNH,MAAAA,OAAO,EAAEM,kBAAkB,CAACC,MAAnB,GAA4B,CAD/B;AAENN,MAAAA,QAAQ,EAAE,kBAAMK,kBAAN,EAA4BE,MAAF,IACnCJ,oBAAoB,CAAEI,MAAM,CAACC,IAAT,EAAeD,MAAM,CAACE,IAAtB,EAA4BF,MAAM,CAACG,GAAnC,CADX;AAFJ,KAAP;AAMA,GAZ6B,CAA9B;AAcA,QAAMC,QAAQ,GAAG,CAAEZ,OAAF,IAAaC,QAA9B;AAEA,SACC,qDACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,qBAAgBW,QAHjB;AAIC,qBAAgBb,yBAJjB;AAKC,IAAA,QAAQ,EAAGa,QALZ;AAMC,IAAA,MAAM,EAAGX,QANV;AAOC,IAAA,OAAO,EAAGW,QAAQ,GAAGC,SAAH,GAAef;AAPlC,KASG,cAAI,MAAJ,CATH,CADD,CADD;AAeA","sourcesContent":["/**\n * External dependencies\n */\nimport { some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function SaveButton( {\n\topenEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving: some( dirtyEntityRecords, ( record ) =>\n\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t),\n\t\t};\n\t} );\n\n\tconst disabled = ! isDirty || isSaving;\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tclassName=\"edit-site-save-button__button\"\n\t\t\t\taria-disabled={ disabled }\n\t\t\t\taria-expanded={ isEntitiesSavedStatesOpen }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tisBusy={ isSaving }\n\t\t\t\tonClick={ disabled ? undefined : openEntitiesSavedStates }\n\t\t\t>\n\t\t\t\t{ __( 'Save' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["SaveButton","openEntitiesSavedStates","isEntitiesSavedStatesOpen","isDirty","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","length","record","kind","name","key","disabled","undefined"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMe,SAASA,UAAT,CAAqB;AACnCC,EAAAA,uBADmC;AAEnCC,EAAAA;AAFmC,CAArB,EAGX;AACH,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,MAAwB,qBAAaC,MAAF,IAAc;AACtD,UAAM;AACLC,MAAAA,mCADK;AAELC,MAAAA;AAFK,QAGFF,MAAM,CAAEG,eAAF,CAHV;;AAIA,UAAMC,kBAAkB,GAAGH,mCAAmC,EAA9D;;AACA,WAAO;AACNH,MAAAA,OAAO,EAAEM,kBAAkB,CAACC,MAAnB,GAA4B,CAD/B;AAENN,MAAAA,QAAQ,EAAE,kBAAMK,kBAAN,EAA4BE,MAAF,IACnCJ,oBAAoB,CAAEI,MAAM,CAACC,IAAT,EAAeD,MAAM,CAACE,IAAtB,EAA4BF,MAAM,CAACG,GAAnC,CADX;AAFJ,KAAP;AAMA,GAZ6B,EAY3B,EAZ2B,CAA9B;AAcA,QAAMC,QAAQ,GAAG,CAAEZ,OAAF,IAAaC,QAA9B;AAEA,SACC,qDACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,qBAAgBW,QAHjB;AAIC,qBAAgBb,yBAJjB;AAKC,IAAA,QAAQ,EAAGa,QALZ;AAMC,IAAA,MAAM,EAAGX,QANV;AAOC,IAAA,OAAO,EAAGW,QAAQ,GAAGC,SAAH,GAAef;AAPlC,KASG,cAAI,MAAJ,CATH,CADD,CADD;AAeA","sourcesContent":["/**\n * External dependencies\n */\nimport { some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function SaveButton( {\n\topenEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving: some( dirtyEntityRecords, ( record ) =>\n\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst disabled = ! isDirty || isSaving;\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tclassName=\"edit-site-save-button__button\"\n\t\t\t\taria-disabled={ disabled }\n\t\t\t\taria-expanded={ isEntitiesSavedStatesOpen }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tisBusy={ isSaving }\n\t\t\t\tonClick={ disabled ? undefined : openEntitiesSavedStates }\n\t\t\t>\n\t\t\t\t{ __( 'Save' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -54,7 +54,8 @@ function InserterSidebar() {
|
|
|
54
54
|
showInserterHelpPanel: true,
|
|
55
55
|
shouldFocusBlock: isMobile,
|
|
56
56
|
rootClientId: insertionPoint.rootClientId,
|
|
57
|
-
__experimentalInsertionIndex: insertionPoint.insertionIndex
|
|
57
|
+
__experimentalInsertionIndex: insertionPoint.insertionIndex,
|
|
58
|
+
__experimentalFilterValue: insertionPoint.filterValue
|
|
58
59
|
})));
|
|
59
60
|
}
|
|
60
61
|
//# sourceMappingURL=inserter-sidebar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/inserter-sidebar.js"],"names":["InserterSidebar","setIsInserterOpened","editSiteStore","insertionPoint","select","__experimentalGetInsertionPoint","isMobile","inserterDialogRef","inserterDialogProps","onClose","close","rootClientId","insertionIndex"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;AAGe,SAASA,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0B,uBAAaC,YAAb,CAAhC;AACA,QAAMC,cAAc,GAAG,qBACpBC,MAAF,IAAcA,MAAM,CAAEF,YAAF,CAAN,CAAwBG,+BAAxB,EADQ,EAEtB,EAFsB,CAAvB;AAKA,QAAMC,QAAQ,GAAG,+BAAkB,QAAlB,EAA4B,GAA5B,CAAjB;AACA,QAAM,CAAEC,iBAAF,EAAqBC,mBAArB,IAA6C,sCAAW;AAC7DC,IAAAA,OAAO,EAAE,MAAMR,mBAAmB,CAAE,KAAF;AAD2B,GAAX,CAAnD;AAIA,SACC;AACC,IAAA,GAAG,EAAGM;AADP,KAEMC,mBAFN;AAGC,IAAA,SAAS,EAAC;AAHX,MAKC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kBAAD;AACC,IAAA,IAAI,EAAGE,YADR;AAEC,IAAA,OAAO,EAAG,MAAMT,mBAAmB,CAAE,KAAF;AAFpC,IADD,CALD,EAWC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kCAAD;AACC,IAAA,qBAAqB,MADtB;AAEC,IAAA,gBAAgB,EAAGK,QAFpB;AAGC,IAAA,YAAY,EAAGH,cAAc,CAACQ,YAH/B;AAIC,IAAA,4BAA4B,EAC3BR,cAAc,CAACS;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/secondary-sidebar/inserter-sidebar.js"],"names":["InserterSidebar","setIsInserterOpened","editSiteStore","insertionPoint","select","__experimentalGetInsertionPoint","isMobile","inserterDialogRef","inserterDialogProps","onClose","close","rootClientId","insertionIndex","filterValue"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;AAGe,SAASA,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0B,uBAAaC,YAAb,CAAhC;AACA,QAAMC,cAAc,GAAG,qBACpBC,MAAF,IAAcA,MAAM,CAAEF,YAAF,CAAN,CAAwBG,+BAAxB,EADQ,EAEtB,EAFsB,CAAvB;AAKA,QAAMC,QAAQ,GAAG,+BAAkB,QAAlB,EAA4B,GAA5B,CAAjB;AACA,QAAM,CAAEC,iBAAF,EAAqBC,mBAArB,IAA6C,sCAAW;AAC7DC,IAAAA,OAAO,EAAE,MAAMR,mBAAmB,CAAE,KAAF;AAD2B,GAAX,CAAnD;AAIA,SACC;AACC,IAAA,GAAG,EAAGM;AADP,KAEMC,mBAFN;AAGC,IAAA,SAAS,EAAC;AAHX,MAKC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kBAAD;AACC,IAAA,IAAI,EAAGE,YADR;AAEC,IAAA,OAAO,EAAG,MAAMT,mBAAmB,CAAE,KAAF;AAFpC,IADD,CALD,EAWC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kCAAD;AACC,IAAA,qBAAqB,MADtB;AAEC,IAAA,gBAAgB,EAAGK,QAFpB;AAGC,IAAA,YAAY,EAAGH,cAAc,CAACQ,YAH/B;AAIC,IAAA,4BAA4B,EAC3BR,cAAc,CAACS,cALjB;AAOC,IAAA,yBAAyB,EAAGT,cAAc,CAACU;AAP5C,IADD,CAXD,CADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport { close } from '@wordpress/icons';\nimport {\n\tuseViewportMatch,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst { setIsInserterOpened } = useDispatch( editSiteStore );\n\tconst insertionPoint = useSelect(\n\t\t( select ) => select( editSiteStore ).__experimentalGetInsertionPoint(),\n\t\t[]\n\t);\n\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: () => setIsInserterOpened( false ),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-site-editor__inserter-panel\"\n\t\t>\n\t\t\t<div className=\"edit-site-editor__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tonClick={ () => setIsInserterOpened( false ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div className=\"edit-site-editor__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobile }\n\t\t\t\t\trootClientId={ insertionPoint.rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={\n\t\t\t\t\t\tinsertionPoint.insertionIndex\n\t\t\t\t\t}\n\t\t\t\t\t__experimentalFilterValue={ insertionPoint.filterValue }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11,29 +9,17 @@ exports.default = GlobalStylesSidebar;
|
|
|
11
9
|
|
|
12
10
|
var _element = require("@wordpress/element");
|
|
13
11
|
|
|
14
|
-
var _lodash = require("lodash");
|
|
15
|
-
|
|
16
12
|
var _components = require("@wordpress/components");
|
|
17
13
|
|
|
18
14
|
var _i18n = require("@wordpress/i18n");
|
|
19
15
|
|
|
20
|
-
var
|
|
16
|
+
var _icons = require("@wordpress/icons");
|
|
21
17
|
|
|
22
18
|
var _globalStylesProvider = require("../editor/global-styles-provider");
|
|
23
19
|
|
|
24
20
|
var _defaultSidebar = _interopRequireDefault(require("./default-sidebar"));
|
|
25
21
|
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
var _borderPanel = _interopRequireWildcard(require("./border-panel"));
|
|
29
|
-
|
|
30
|
-
var _colorPanel = _interopRequireWildcard(require("./color-panel"));
|
|
31
|
-
|
|
32
|
-
var _dimensionsPanel = _interopRequireWildcard(require("./dimensions-panel"));
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* External dependencies
|
|
36
|
-
*/
|
|
22
|
+
var _globalStyles = _interopRequireDefault(require("../global-styles"));
|
|
37
23
|
|
|
38
24
|
/**
|
|
39
25
|
* WordPress dependencies
|
|
@@ -42,159 +28,23 @@ var _dimensionsPanel = _interopRequireWildcard(require("./dimensions-panel"));
|
|
|
42
28
|
/**
|
|
43
29
|
* Internal dependencies
|
|
44
30
|
*/
|
|
45
|
-
function
|
|
46
|
-
wrapperPanelTitle,
|
|
47
|
-
context,
|
|
48
|
-
getStyle,
|
|
49
|
-
setStyle,
|
|
50
|
-
getSetting,
|
|
51
|
-
setSetting
|
|
52
|
-
}) {
|
|
53
|
-
const hasBorderPanel = (0, _borderPanel.useHasBorderPanel)(context);
|
|
54
|
-
const hasColorPanel = (0, _colorPanel.useHasColorPanel)(context);
|
|
55
|
-
const hasTypographyPanel = (0, _typographyPanel.useHasTypographyPanel)(context);
|
|
56
|
-
const hasDimensionsPanel = (0, _dimensionsPanel.useHasDimensionsPanel)(context);
|
|
57
|
-
|
|
58
|
-
if (!hasColorPanel && !hasTypographyPanel && !hasDimensionsPanel) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const content = (0, _element.createElement)(_element.Fragment, null, hasTypographyPanel && (0, _element.createElement)(_typographyPanel.default, {
|
|
63
|
-
context: context,
|
|
64
|
-
getStyle: getStyle,
|
|
65
|
-
setStyle: setStyle
|
|
66
|
-
}), hasColorPanel && (0, _element.createElement)(_colorPanel.default, {
|
|
67
|
-
context: context,
|
|
68
|
-
getStyle: getStyle,
|
|
69
|
-
setStyle: setStyle,
|
|
70
|
-
getSetting: getSetting,
|
|
71
|
-
setSetting: setSetting
|
|
72
|
-
}), hasDimensionsPanel && (0, _element.createElement)(_dimensionsPanel.default, {
|
|
73
|
-
context: context,
|
|
74
|
-
getStyle: getStyle,
|
|
75
|
-
setStyle: setStyle
|
|
76
|
-
}), hasBorderPanel && (0, _element.createElement)(_borderPanel.default, {
|
|
77
|
-
context: context,
|
|
78
|
-
getStyle: getStyle,
|
|
79
|
-
setStyle: setStyle
|
|
80
|
-
}));
|
|
81
|
-
|
|
82
|
-
if (!wrapperPanelTitle) {
|
|
83
|
-
return content;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return (0, _element.createElement)(_components.PanelBody, {
|
|
87
|
-
title: wrapperPanelTitle,
|
|
88
|
-
initialOpen: false
|
|
89
|
-
}, content);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function getPanelTitle(blockName) {
|
|
93
|
-
const blockType = (0, _blocks.getBlockType)(blockName); // Protect against blocks that aren't registered
|
|
94
|
-
// eg: widget-area
|
|
95
|
-
|
|
96
|
-
if (blockType === undefined) {
|
|
97
|
-
return blockName;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return blockType.title;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function GlobalStylesBlockPanels({
|
|
104
|
-
blocks,
|
|
105
|
-
getStyle,
|
|
106
|
-
setStyle,
|
|
107
|
-
getSetting,
|
|
108
|
-
setSetting
|
|
109
|
-
}) {
|
|
110
|
-
const panels = (0, _element.useMemo)(() => (0, _lodash.sortBy)((0, _lodash.map)(blocks, (block, name) => {
|
|
111
|
-
return {
|
|
112
|
-
block,
|
|
113
|
-
name,
|
|
114
|
-
wrapperPanelTitle: getPanelTitle(name)
|
|
115
|
-
};
|
|
116
|
-
}), ({
|
|
117
|
-
wrapperPanelTitle
|
|
118
|
-
}) => wrapperPanelTitle), [blocks]);
|
|
119
|
-
return (0, _lodash.map)(panels, ({
|
|
120
|
-
block,
|
|
121
|
-
name,
|
|
122
|
-
wrapperPanelTitle
|
|
123
|
-
}) => {
|
|
124
|
-
return (0, _element.createElement)(GlobalStylesPanel, {
|
|
125
|
-
key: 'panel-' + name,
|
|
126
|
-
wrapperPanelTitle: wrapperPanelTitle,
|
|
127
|
-
context: block,
|
|
128
|
-
getStyle: getStyle,
|
|
129
|
-
setStyle: setStyle,
|
|
130
|
-
getSetting: getSetting,
|
|
131
|
-
setSetting: setSetting
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function GlobalStylesSidebar({
|
|
137
|
-
identifier,
|
|
138
|
-
title,
|
|
139
|
-
icon,
|
|
140
|
-
closeLabel
|
|
141
|
-
}) {
|
|
142
|
-
const {
|
|
143
|
-
root,
|
|
144
|
-
blocks,
|
|
145
|
-
getStyle,
|
|
146
|
-
setStyle,
|
|
147
|
-
getSetting,
|
|
148
|
-
setSetting
|
|
149
|
-
} = (0, _globalStylesProvider.useGlobalStylesContext)();
|
|
31
|
+
function GlobalStylesSidebar() {
|
|
150
32
|
const [canRestart, onReset] = (0, _globalStylesProvider.useGlobalStylesReset)();
|
|
151
|
-
|
|
152
|
-
if (typeof blocks !== 'object' || !root) {
|
|
153
|
-
// No sidebar is shown.
|
|
154
|
-
return null;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
33
|
return (0, _element.createElement)(_defaultSidebar.default, {
|
|
158
34
|
className: "edit-site-global-styles-sidebar",
|
|
159
|
-
identifier:
|
|
160
|
-
title:
|
|
161
|
-
icon:
|
|
162
|
-
closeLabel:
|
|
163
|
-
header: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("strong", null,
|
|
35
|
+
identifier: "edit-site/global-styles",
|
|
36
|
+
title: (0, _i18n.__)('Styles'),
|
|
37
|
+
icon: _icons.styles,
|
|
38
|
+
closeLabel: (0, _i18n.__)('Close global styles sidebar'),
|
|
39
|
+
header: (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("strong", null, (0, _i18n.__)('Styles')), (0, _element.createElement)("span", {
|
|
40
|
+
className: "edit-site-global-styles-sidebar__beta"
|
|
41
|
+
}, (0, _i18n.__)('Beta')), (0, _element.createElement)(_components.Button, {
|
|
164
42
|
className: "edit-site-global-styles-sidebar__reset-button",
|
|
165
43
|
isSmall: true,
|
|
166
44
|
variant: "tertiary",
|
|
167
45
|
disabled: !canRestart,
|
|
168
46
|
onClick: onReset
|
|
169
47
|
}, (0, _i18n.__)('Reset to defaults')))
|
|
170
|
-
}, (0, _element.createElement)(
|
|
171
|
-
tabs: [{
|
|
172
|
-
name: 'root',
|
|
173
|
-
title: (0, _i18n.__)('Root')
|
|
174
|
-
}, {
|
|
175
|
-
name: 'block',
|
|
176
|
-
title: (0, _i18n.__)('By Block Type')
|
|
177
|
-
}]
|
|
178
|
-
}, tab => {
|
|
179
|
-
/* Per Block Context */
|
|
180
|
-
if ('block' === tab.name) {
|
|
181
|
-
return (0, _element.createElement)(GlobalStylesBlockPanels, {
|
|
182
|
-
blocks: blocks,
|
|
183
|
-
getStyle: getStyle,
|
|
184
|
-
setStyle: setStyle,
|
|
185
|
-
getSetting: getSetting,
|
|
186
|
-
setSetting: setSetting
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return (0, _element.createElement)(GlobalStylesPanel, {
|
|
191
|
-
hasWrapper: false,
|
|
192
|
-
context: root,
|
|
193
|
-
getStyle: getStyle,
|
|
194
|
-
setStyle: setStyle,
|
|
195
|
-
getSetting: getSetting,
|
|
196
|
-
setSetting: setSetting
|
|
197
|
-
});
|
|
198
|
-
}));
|
|
48
|
+
}, (0, _element.createElement)(_globalStyles.default, null));
|
|
199
49
|
}
|
|
200
50
|
//# sourceMappingURL=global-styles-sidebar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/global-styles-sidebar.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/global-styles-sidebar.js"],"names":["GlobalStylesSidebar","canRestart","onReset","styles"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAZA;AACA;AACA;;AAKA;AACA;AACA;AAKe,SAASA,mBAAT,GAA+B;AAC7C,QAAM,CAAEC,UAAF,EAAcC,OAAd,IAA0B,iDAAhC;AAEA,SACC,4BAAC,uBAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,UAAU,EAAC,yBAFZ;AAGC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAHT;AAIC,IAAA,IAAI,EAAGC,aAJR;AAKC,IAAA,UAAU,EAAG,cAAI,6BAAJ,CALd;AAMC,IAAA,MAAM,EACL,qDACC,4CAAU,cAAI,QAAJ,CAAV,CADD,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACG,cAAI,MAAJ,CADH,CAFD,EAKC,4BAAC,kBAAD;AACC,MAAA,SAAS,EAAC,+CADX;AAEC,MAAA,OAAO,MAFR;AAGC,MAAA,OAAO,EAAC,UAHT;AAIC,MAAA,QAAQ,EAAG,CAAEF,UAJd;AAKC,MAAA,OAAO,EAAGC;AALX,OAOG,cAAI,mBAAJ,CAPH,CALD;AAPF,KAwBC,4BAAC,qBAAD,OAxBD,CADD;AA4BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStylesReset } from '../editor/global-styles-provider';\nimport DefaultSidebar from './default-sidebar';\nimport GlobalStyles from '../global-styles';\n\nexport default function GlobalStylesSidebar() {\n\tconst [ canRestart, onReset ] = useGlobalStylesReset();\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close global styles sidebar' ) }\n\t\t\theader={\n\t\t\t\t<>\n\t\t\t\t\t<strong>{ __( 'Styles' ) }</strong>\n\t\t\t\t\t<span className=\"edit-site-global-styles-sidebar__beta\">\n\t\t\t\t\t\t{ __( 'Beta' ) }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"edit-site-global-styles-sidebar__reset-button\"\n\t\t\t\t\t\tisSmall\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tdisabled={ ! canRestart }\n\t\t\t\t\t\tonClick={ onReset }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset to defaults' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStyles />\n\t\t</DefaultSidebar>\n\t);\n}\n"]}
|
|
@@ -93,11 +93,6 @@ function SidebarComplementaryAreaFills() {
|
|
|
93
93
|
headerClassName: "edit-site-sidebar__panel-tabs"
|
|
94
94
|
}, sidebarName === _constants2.SIDEBAR_TEMPLATE && (0, _element.createElement)(_components.PanelBody, null, (0, _element.createElement)(_templateCard.default, null)), sidebarName === _constants2.SIDEBAR_BLOCK && (0, _element.createElement)(InspectorSlot, {
|
|
95
95
|
bubblesVirtually: true
|
|
96
|
-
})), (0, _element.createElement)(_globalStylesSidebar.default,
|
|
97
|
-
identifier: "edit-site/global-styles",
|
|
98
|
-
title: (0, _i18n.__)('Global Styles'),
|
|
99
|
-
closeLabel: (0, _i18n.__)('Close global styles sidebar'),
|
|
100
|
-
icon: _icons.typography
|
|
101
|
-
}));
|
|
96
|
+
})), (0, _element.createElement)(_globalStylesSidebar.default, null));
|
|
102
97
|
}
|
|
103
98
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","SidebarComplementaryAreaFills","sidebar","isEditorSidebarOpened","hasBlockSelection","select","_sidebar","interfaceStore","getActiveComplementaryArea","STORE_NAME","_isEditorSidebarOpened","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","includes","blockEditorStore","getBlockSelectionStart","enableComplementaryArea","sidebarName","cog"
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","SidebarComplementaryAreaFills","sidebar","isEditorSidebarOpened","hasBlockSelection","select","_sidebar","interfaceStore","getActiveComplementaryArea","STORE_NAME","_isEditorSidebarOpened","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","includes","blockEditorStore","getBlockSelectionStart","enableComplementaryArea","sidebarName","cog"],"mappings":";;;;;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AASA;AACA;AACA;AAQA,MAAM;AAAEA,EAAAA,IAAI,EAAEC,aAAR;AAAuBC,EAAAA,IAAI,EAAEC;AAA7B,IAA+C,gCACpD,0BADoD,CAArD;AAGO,MAAMC,oBAAoB,GAAGD,aAA7B;;;AAEA,SAASE,6BAAT,GAAyC;AAC/C,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA,qBAAX;AAAkCC,IAAAA;AAAlC,MAAwD,qBAC3DC,MAAF,IAAc;AACb,UAAMC,QAAQ,GAAGD,MAAM,CACtBE,gBADsB,CAAN,CAEfC,0BAFe,CAEaC,qBAFb,CAAjB;;AAGA,UAAMC,sBAAsB,GAAG,CAC9BC,yBAD8B,EAE9BC,4BAF8B,EAG7BC,QAH6B,CAGnBP,QAHmB,CAA/B;;AAIA,WAAO;AACNJ,MAAAA,OAAO,EAAEI,QADH;AAENH,MAAAA,qBAAqB,EAAEO,sBAFjB;AAGNN,MAAAA,iBAAiB,EAAE,CAAC,CAAEC,MAAM,CAC3BS,kBAD2B,CAAN,CAEpBC,sBAFoB;AAHhB,KAAP;AAOA,GAhB4D,EAiB7D,EAjB6D,CAA9D;AAmBA,QAAM;AAAEC,IAAAA;AAAF,MAA8B,uBAAaT,gBAAb,CAApC;AACA,0BAAW,MAAM;AAChB,QAAK,CAAEJ,qBAAP,EAA+B;;AAC/B,QAAKC,iBAAL,EAAyB;AACxBY,MAAAA,uBAAuB,CAAEP,qBAAF,EAAcE,yBAAd,CAAvB;AACA,KAFD,MAEO;AACNK,MAAAA,uBAAuB,CAAEP,qBAAF,EAAcG,4BAAd,CAAvB;AACA;AACD,GAPD,EAOG,CAAER,iBAAF,EAAqBD,qBAArB,CAPH;AAQA,MAAIc,WAAW,GAAGf,OAAlB;;AACA,MAAK,CAAEC,qBAAP,EAA+B;AAC9Bc,IAAAA,WAAW,GAAGb,iBAAiB,GAAGO,yBAAH,GAAmBC,4BAAlD;AACA;;AACD,SACC,qDACC,4BAAC,uBAAD;AACC,IAAA,UAAU,EAAGK,WADd;AAEC,IAAA,KAAK,EAAG,cAAI,UAAJ,CAFT;AAGC,IAAA,IAAI,EAAGC,UAHR;AAIC,IAAA,UAAU,EAAG,cAAI,wBAAJ,CAJd;AAKC,IAAA,MAAM,EAAG,4BAAC,uBAAD;AAAgB,MAAA,WAAW,EAAGD;AAA9B,MALV;AAMC,IAAA,eAAe,EAAC;AANjB,KAQGA,WAAW,KAAKL,4BAAhB,IACD,4BAAC,qBAAD,QACC,4BAAC,qBAAD,OADD,CATF,EAaGK,WAAW,KAAKN,yBAAhB,IACD,4BAAC,aAAD;AAAe,IAAA,gBAAgB;AAA/B,IAdF,CADD,EAkBC,4BAAC,4BAAD,OAlBD,CADD;AAsBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { cog } from '@wordpress/icons';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport GlobalStylesSidebar from './global-styles-sidebar';\nimport { STORE_NAME } from '../../store/constants';\nimport SettingsHeader from './settings-header';\nimport TemplateCard from './template-card';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from './constants';\n\nconst { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(\n\t'EditSiteSidebarInspector'\n);\nexport const SidebarInspectorFill = InspectorFill;\n\nexport function SidebarComplementaryAreaFills() {\n\tconst { sidebar, isEditorSidebarOpened, hasBlockSelection } = useSelect(\n\t\t( select ) => {\n\t\t\tconst _sidebar = select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( STORE_NAME );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tSIDEBAR_BLOCK,\n\t\t\t\tSIDEBAR_TEMPLATE,\n\t\t\t].includes( _sidebar );\n\t\t\treturn {\n\t\t\t\tsidebar: _sidebar,\n\t\t\t\tisEditorSidebarOpened: _isEditorSidebarOpened,\n\t\t\t\thasBlockSelection: !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tuseEffect( () => {\n\t\tif ( ! isEditorSidebarOpened ) return;\n\t\tif ( hasBlockSelection ) {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\t\t}\n\t}, [ hasBlockSelection, isEditorSidebarOpened ] );\n\tlet sidebarName = sidebar;\n\tif ( ! isEditorSidebarOpened ) {\n\t\tsidebarName = hasBlockSelection ? SIDEBAR_BLOCK : SIDEBAR_TEMPLATE;\n\t}\n\treturn (\n\t\t<>\n\t\t\t<DefaultSidebar\n\t\t\t\tidentifier={ sidebarName }\n\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\ticon={ cog }\n\t\t\t\tcloseLabel={ __( 'Close settings sidebar' ) }\n\t\t\t\theader={ <SettingsHeader sidebarName={ sidebarName } /> }\n\t\t\t\theaderClassName=\"edit-site-sidebar__panel-tabs\"\n\t\t\t>\n\t\t\t\t{ sidebarName === SIDEBAR_TEMPLATE && (\n\t\t\t\t\t<PanelBody>\n\t\t\t\t\t\t<TemplateCard />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t\t{ sidebarName === SIDEBAR_BLOCK && (\n\t\t\t\t\t<InspectorSlot bubblesVirtually />\n\t\t\t\t) }\n\t\t\t</DefaultSidebar>\n\t\t\t<GlobalStylesSidebar />\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = PluginSidebarEditSite;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _interface = require("@wordpress/interface");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* WordPress dependencies
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.
|
|
22
|
+
* It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.
|
|
23
|
+
* If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:
|
|
24
|
+
*
|
|
25
|
+
* ```js
|
|
26
|
+
* wp.data.dispatch( 'core/edit-site' ).openGeneralSidebar( 'plugin-name/sidebar-name' );
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @see PluginSidebarMoreMenuItem
|
|
30
|
+
*
|
|
31
|
+
* @param {Object} props Element props.
|
|
32
|
+
* @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.
|
|
33
|
+
* @param {string} [props.className] An optional class name added to the sidebar body.
|
|
34
|
+
* @param {string} props.title Title displayed at the top of the sidebar.
|
|
35
|
+
* @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.
|
|
36
|
+
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```js
|
|
40
|
+
* // Using ES5 syntax
|
|
41
|
+
* var __ = wp.i18n.__;
|
|
42
|
+
* var el = wp.element.createElement;
|
|
43
|
+
* var PanelBody = wp.components.PanelBody;
|
|
44
|
+
* var PluginSidebar = wp.editSite.PluginSidebar;
|
|
45
|
+
* var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
|
|
46
|
+
*
|
|
47
|
+
* function MyPluginSidebar() {
|
|
48
|
+
* return el(
|
|
49
|
+
* PluginSidebar,
|
|
50
|
+
* {
|
|
51
|
+
* name: 'my-sidebar',
|
|
52
|
+
* title: 'My sidebar title',
|
|
53
|
+
* icon: moreIcon,
|
|
54
|
+
* },
|
|
55
|
+
* el(
|
|
56
|
+
* PanelBody,
|
|
57
|
+
* {},
|
|
58
|
+
* __( 'My sidebar content' )
|
|
59
|
+
* )
|
|
60
|
+
* );
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```jsx
|
|
66
|
+
* // Using ESNext syntax
|
|
67
|
+
* import { __ } from '@wordpress/i18n';
|
|
68
|
+
* import { PanelBody } from '@wordpress/components';
|
|
69
|
+
* import { PluginSidebar } from '@wordpress/edit-site';
|
|
70
|
+
* import { more } from '@wordpress/icons';
|
|
71
|
+
*
|
|
72
|
+
* const MyPluginSidebar = () => (
|
|
73
|
+
* <PluginSidebar
|
|
74
|
+
* name="my-sidebar"
|
|
75
|
+
* title="My sidebar title"
|
|
76
|
+
* icon={ more }
|
|
77
|
+
* >
|
|
78
|
+
* <PanelBody>
|
|
79
|
+
* { __( 'My sidebar content' ) }
|
|
80
|
+
* </PanelBody>
|
|
81
|
+
* </PluginSidebar>
|
|
82
|
+
* );
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
function PluginSidebarEditSite({
|
|
86
|
+
className,
|
|
87
|
+
...props
|
|
88
|
+
}) {
|
|
89
|
+
return (0, _element.createElement)(_interface.ComplementaryArea, (0, _extends2.default)({
|
|
90
|
+
panelClassName: className,
|
|
91
|
+
className: "edit-site-sidebar",
|
|
92
|
+
scope: "core/edit-site"
|
|
93
|
+
}, props));
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/plugin-sidebar/index.js"],"names":["PluginSidebarEditSite","className","props"],"mappings":";;;;;;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAT,CAAgC;AAAEC,EAAAA,SAAF;AAAa,KAAGC;AAAhB,CAAhC,EAA0D;AACxE,SACC,4BAAC,4BAAD;AACC,IAAA,cAAc,EAAGD,SADlB;AAEC,IAAA,SAAS,EAAC,mBAFX;AAGC,IAAA,KAAK,EAAC;AAHP,KAIMC,KAJN,EADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryArea } from '@wordpress/interface';\n\n/**\n * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.\n * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.\n * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:\n *\n * ```js\n * wp.data.dispatch( 'core/edit-site' ).openGeneralSidebar( 'plugin-name/sidebar-name' );\n * ```\n *\n * @see PluginSidebarMoreMenuItem\n *\n * @param {Object} props Element props.\n * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.\n * @param {string} [props.className] An optional class name added to the sidebar body.\n * @param {string} props.title Title displayed at the top of the sidebar.\n * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var el = wp.element.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editSite.PluginSidebar;\n * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.\n *\n * function MyPluginSidebar() {\n * \treturn el(\n * \t\t\tPluginSidebar,\n * \t\t\t{\n * \t\t\t\tname: 'my-sidebar',\n * \t\t\t\ttitle: 'My sidebar title',\n * \t\t\t\ticon: moreIcon,\n * \t\t\t},\n * \t\t\tel(\n * \t\t\t\tPanelBody,\n * \t\t\t\t{},\n * \t\t\t\t__( 'My sidebar content' )\n * \t\t\t)\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PanelBody } from '@wordpress/components';\n * import { PluginSidebar } from '@wordpress/edit-site';\n * import { more } from '@wordpress/icons';\n *\n * const MyPluginSidebar = () => (\n * \t<PluginSidebar\n * \t\tname=\"my-sidebar\"\n * \t\ttitle=\"My sidebar title\"\n * \t\ticon={ more }\n * \t>\n * \t\t<PanelBody>\n * \t\t\t{ __( 'My sidebar content' ) }\n * \t\t</PanelBody>\n * \t</PluginSidebar>\n * );\n * ```\n */\nexport default function PluginSidebarEditSite( { className, ...props } ) {\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tpanelClassName={ className }\n\t\t\tclassName=\"edit-site-sidebar\"\n\t\t\tscope=\"core/edit-site\"\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -23,6 +23,8 @@ var _constants = require("../navigation-sidebar/navigation-panel/constants");
|
|
|
23
23
|
|
|
24
24
|
var _store = require("../../store");
|
|
25
25
|
|
|
26
|
+
var _templateAreas = _interopRequireDefault(require("./template-areas"));
|
|
27
|
+
|
|
26
28
|
/**
|
|
27
29
|
* WordPress dependencies
|
|
28
30
|
*/
|
|
@@ -57,17 +59,21 @@ function TemplateDetails({
|
|
|
57
59
|
onClose();
|
|
58
60
|
};
|
|
59
61
|
|
|
60
|
-
return (0, _element.createElement)(
|
|
62
|
+
return (0, _element.createElement)("div", {
|
|
61
63
|
className: "edit-site-template-details"
|
|
62
|
-
}, (0, _element.createElement)(
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
}, (0, _element.createElement)("div", {
|
|
65
|
+
className: "edit-site-template-details__group"
|
|
66
|
+
}, (0, _element.createElement)(_components.__experimentalHeading, {
|
|
67
|
+
level: 4,
|
|
68
|
+
weight: 600,
|
|
69
|
+
className: "edit-site-template-details__title"
|
|
65
70
|
}, title), description && (0, _element.createElement)(_components.__experimentalText, {
|
|
66
71
|
size: "body",
|
|
67
72
|
className: "edit-site-template-details__description"
|
|
68
|
-
}, description)), (0, _isTemplateRevertable.default)(template) && (0, _element.createElement)(
|
|
69
|
-
className: "edit-site-template-
|
|
73
|
+
}, description)), (0, _element.createElement)(_templateAreas.default, null), (0, _isTemplateRevertable.default)(template) && (0, _element.createElement)(_components.MenuGroup, {
|
|
74
|
+
className: "edit-site-template-details__group"
|
|
70
75
|
}, (0, _element.createElement)(_components.MenuItem, {
|
|
76
|
+
className: "edit-site-template-details__revert-button",
|
|
71
77
|
info: (0, _i18n.__)('Restore template to theme default'),
|
|
72
78
|
onClick: revert
|
|
73
79
|
}, (0, _i18n.__)('Clear customizations'))), (0, _element.createElement)(_components.Button, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/template-details/index.js"],"names":["TemplateDetails","template","onClose","title","description","select","editorStore","__experimentalGetTemplateInfo","openNavigationPanelToMenu","revertTemplate","editSiteStore","showTemplateInSidebar","MENU_TEMPLATES","revert"],"mappings":";;;;;;;;;;;AAGA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/template-details/index.js"],"names":["TemplateDetails","template","onClose","title","description","select","editorStore","__experimentalGetTemplateInfo","openNavigationPanelToMenu","revertTemplate","editSiteStore","showTemplateInSidebar","MENU_TEMPLATES","revert"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAOA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AAYA;AACA;AACA;AAMe,SAASA,eAAT,CAA0B;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAA1B,EAAkD;AAChE,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAyB,qBAC5BC,MAAF,IACCA,MAAM,CAAEC,aAAF,CAAN,CAAsBC,6BAAtB,CAAqDN,QAArD,CAF6B,EAG9B,EAH8B,CAA/B;AAKA,QAAM;AAAEO,IAAAA,yBAAF;AAA6BC,IAAAA;AAA7B,MAAgD,uBACrDC,YADqD,CAAtD;;AAIA,MAAK,CAAET,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,QAAMU,qBAAqB,GAAG,MAAM;AACnCT,IAAAA,OAAO;AACPM,IAAAA,yBAAyB,CAAEI,yBAAF,CAAzB;AACA,GAHD;;AAKA,QAAMC,MAAM,GAAG,MAAM;AACpBJ,IAAAA,cAAc,CAAER,QAAF,CAAd;AACAC,IAAAA,OAAO;AACP,GAHD;;AAKA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,iCAAD;AACC,IAAA,KAAK,EAAG,CADT;AAEC,IAAA,MAAM,EAAG,GAFV;AAGC,IAAA,SAAS,EAAC;AAHX,KAKGC,KALH,CADD,EASGC,WAAW,IACZ,4BAAC,8BAAD;AACC,IAAA,IAAI,EAAC,MADN;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGA,WAJH,CAVF,CADD,EAoBC,4BAAC,sBAAD,OApBD,EAsBG,mCAAsBH,QAAtB,KACD,4BAAC,qBAAD;AAAW,IAAA,SAAS,EAAC;AAArB,KACC,4BAAC,oBAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAG,cAAI,mCAAJ,CAFR;AAGC,IAAA,OAAO,EAAGY;AAHX,KAKG,cAAI,sBAAJ,CALH,CADD,CAvBF,EAkCC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,6CADX;AAEC,IAAA,OAAO,EAAGF,qBAFX;AAGC,kBAAa,cACZ,sFADY;AAHd,KAOG,cAAI,sBAAJ,CAPH,CAlCD,CADD;AA8CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tMenuGroup,\n\tMenuItem,\n\t__experimentalHeading as Heading,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport { MENU_TEMPLATES } from '../navigation-sidebar/navigation-panel/constants';\nimport { store as editSiteStore } from '../../store';\nimport TemplateAreas from './template-areas';\n\nexport default function TemplateDetails( { template, onClose } ) {\n\tconst { title, description } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetTemplateInfo( template ),\n\t\t[]\n\t);\n\tconst { openNavigationPanelToMenu, revertTemplate } = useDispatch(\n\t\teditSiteStore\n\t);\n\n\tif ( ! template ) {\n\t\treturn null;\n\t}\n\n\tconst showTemplateInSidebar = () => {\n\t\tonClose();\n\t\topenNavigationPanelToMenu( MENU_TEMPLATES );\n\t};\n\n\tconst revert = () => {\n\t\trevertTemplate( template );\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<div className=\"edit-site-template-details\">\n\t\t\t<div className=\"edit-site-template-details__group\">\n\t\t\t\t<Heading\n\t\t\t\t\tlevel={ 4 }\n\t\t\t\t\tweight={ 600 }\n\t\t\t\t\tclassName=\"edit-site-template-details__title\"\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</Heading>\n\n\t\t\t\t{ description && (\n\t\t\t\t\t<Text\n\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\tclassName=\"edit-site-template-details__description\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t</div>\n\n\t\t\t<TemplateAreas />\n\n\t\t\t{ isTemplateRevertable( template ) && (\n\t\t\t\t<MenuGroup className=\"edit-site-template-details__group\">\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tclassName=\"edit-site-template-details__revert-button\"\n\t\t\t\t\t\tinfo={ __( 'Restore template to theme default' ) }\n\t\t\t\t\t\tonClick={ revert }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Clear customizations' ) }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-template-details__show-all-button\"\n\t\t\t\tonClick={ showTemplateInSidebar }\n\t\t\t\taria-label={ __(\n\t\t\t\t\t'Browse all templates. This will open the template menu in the navigation side panel.'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ __( 'Browse all templates' ) }\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n"]}
|