@wordpress/edit-site 6.48.1 → 6.49.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/CHANGELOG.md +2 -0
- package/build/components/add-new-post/index.cjs +0 -1
- package/build/components/add-new-post/index.cjs.map +2 -2
- package/build/components/add-new-template/add-custom-generic-template-modal-content.cjs +0 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.cjs.map +2 -2
- package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs +0 -1
- package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs.map +2 -2
- package/build/components/editor/use-editor-title.cjs +1 -1
- package/build/components/editor/use-editor-title.cjs.map +2 -2
- package/build/components/layout/index.cjs +30 -11
- package/build/components/layout/index.cjs.map +3 -3
- package/build/components/page-patterns/fields.cjs +2 -51
- package/build/components/page-patterns/fields.cjs.map +3 -3
- package/build/components/page-patterns/index.cjs +12 -23
- package/build/components/page-patterns/index.cjs.map +2 -2
- package/build/components/page-templates/index-legacy.cjs +8 -27
- package/build/components/page-templates/index-legacy.cjs.map +2 -2
- package/build/components/resizable-frame/index.cjs.map +2 -2
- package/build/components/routes/use-title.cjs +1 -1
- package/build/components/routes/use-title.cjs.map +2 -2
- package/build/components/save-button/index.cjs +2 -2
- package/build/components/save-button/index.cjs.map +1 -1
- package/build/components/save-hub/index.cjs +3 -3
- package/build/components/save-hub/index.cjs.map +3 -3
- package/build/components/sidebar-dataviews/index.cjs +3 -1
- package/build/components/sidebar-dataviews/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-item/index.cjs +17 -3
- package/build/components/sidebar-navigation-item/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen-global-styles/index.cjs +2 -18
- package/build/components/sidebar-navigation-screen-global-styles/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen-identity/index.cjs +0 -19
- package/build/components/sidebar-navigation-screen-identity/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen-main/index.cjs +49 -56
- package/build/components/sidebar-navigation-screen-main/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.cjs +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-patterns/index.cjs +6 -3
- package/build/components/sidebar-navigation-screen-patterns/index.cjs.map +2 -2
- package/build/components/welcome-guide/editor.cjs +1 -1
- package/build/components/welcome-guide/editor.cjs.map +1 -1
- package/build/components/welcome-guide/page.cjs +1 -1
- package/build/components/welcome-guide/page.cjs.map +1 -1
- package/build/components/welcome-guide/template.cjs +1 -1
- package/build/components/welcome-guide/template.cjs.map +1 -1
- package/build-module/components/add-new-post/index.mjs +0 -1
- package/build-module/components/add-new-post/index.mjs.map +2 -2
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.mjs +0 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.mjs.map +2 -2
- package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs +0 -1
- package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs.map +2 -2
- package/build-module/components/editor/use-editor-title.mjs +1 -1
- package/build-module/components/editor/use-editor-title.mjs.map +2 -2
- package/build-module/components/layout/index.mjs +26 -7
- package/build-module/components/layout/index.mjs.map +2 -2
- package/build-module/components/page-patterns/fields.mjs +2 -40
- package/build-module/components/page-patterns/fields.mjs.map +2 -2
- package/build-module/components/page-patterns/index.mjs +14 -29
- package/build-module/components/page-patterns/index.mjs.map +2 -2
- package/build-module/components/page-templates/index-legacy.mjs +9 -28
- package/build-module/components/page-templates/index-legacy.mjs.map +2 -2
- package/build-module/components/resizable-frame/index.mjs.map +2 -2
- package/build-module/components/routes/use-title.mjs +1 -1
- package/build-module/components/routes/use-title.mjs.map +2 -2
- package/build-module/components/save-button/index.mjs +2 -2
- package/build-module/components/save-button/index.mjs.map +1 -1
- package/build-module/components/save-hub/index.mjs +3 -3
- package/build-module/components/save-hub/index.mjs.map +2 -2
- package/build-module/components/sidebar-dataviews/index.mjs +3 -1
- package/build-module/components/sidebar-dataviews/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-item/index.mjs +18 -8
- package/build-module/components/sidebar-navigation-item/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.mjs +2 -14
- package/build-module/components/sidebar-navigation-screen-global-styles/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-identity/index.mjs +0 -15
- package/build-module/components/sidebar-navigation-screen-identity/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-main/index.mjs +50 -57
- package/build-module/components/sidebar-navigation-screen-main/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.mjs +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs +6 -3
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs.map +2 -2
- package/build-module/components/welcome-guide/editor.mjs +1 -1
- package/build-module/components/welcome-guide/editor.mjs.map +1 -1
- package/build-module/components/welcome-guide/page.mjs +1 -1
- package/build-module/components/welcome-guide/page.mjs.map +1 -1
- package/build-module/components/welcome-guide/template.mjs +1 -1
- package/build-module/components/welcome-guide/template.mjs.map +1 -1
- package/build-style/{experimental-admin-bar-in-editor-rtl.css → experimental-omnibar-rtl.css} +46 -1
- package/build-style/{experimental-admin-bar-in-editor.css → experimental-omnibar.css} +46 -1
- package/build-style/style-rtl.css +250 -273
- package/build-style/style.css +250 -273
- package/package.json +48 -48
- package/src/components/add-new-post/index.js +0 -1
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +0 -1
- package/src/components/add-new-template-legacy/add-custom-generic-template-modal-content.js +0 -1
- package/src/components/layout/index.js +21 -11
- package/src/components/layout/style.scss +19 -12
- package/src/components/page-patterns/fields.js +1 -48
- package/src/components/page-patterns/index.js +17 -29
- package/src/components/page-patterns/style.scss +1 -1
- package/src/components/page-templates/index-legacy.js +9 -28
- package/src/components/page-templates/style.scss +0 -5
- package/src/components/resizable-frame/index.js +0 -1
- package/src/components/save-hub/index.js +4 -4
- package/src/components/save-hub/style.scss +3 -3
- package/src/components/sidebar-button/style.scss +2 -2
- package/src/components/sidebar-dataviews/index.js +3 -0
- package/src/components/sidebar-global-styles/style.scss +1 -1
- package/src/components/sidebar-navigation-item/index.js +22 -9
- package/src/components/sidebar-navigation-item/style.scss +6 -6
- package/src/components/sidebar-navigation-screen/style.scss +8 -8
- package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -15
- package/src/components/sidebar-navigation-screen-identity/index.js +0 -15
- package/src/components/sidebar-navigation-screen-main/index.js +49 -54
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +0 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +2 -2
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +8 -8
- package/src/components/sidebar-navigation-screen-patterns/index.js +4 -0
- package/src/components/sidebar-navigation-screen-patterns/style.scss +1 -1
- package/src/components/site-hub/style.scss +5 -5
- package/src/components/welcome-guide/page.js +1 -1
- package/src/{experimental-admin-bar-in-editor.scss → experimental-omnibar.scss} +3 -1
- package/src/style.scss +2 -2
|
@@ -41,71 +41,53 @@ var import_data = require("@wordpress/data");
|
|
|
41
41
|
var import_core_data = require("@wordpress/core-data");
|
|
42
42
|
var import_sidebar_navigation_screen = __toESM(require("../sidebar-navigation-screen/index.cjs"));
|
|
43
43
|
var import_sidebar_navigation_item = __toESM(require("../sidebar-navigation-item/index.cjs"));
|
|
44
|
-
var import_sidebar_navigation_screen_global_styles = require("../sidebar-navigation-screen-global-styles/index.cjs");
|
|
45
|
-
var import_sidebar_navigation_screen_identity = require("../sidebar-navigation-screen-identity/index.cjs");
|
|
46
44
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
47
45
|
function MainSidebarNavigationContent({ isBlockBasedTheme = true }) {
|
|
48
46
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-main", children: [
|
|
49
|
-
|
|
50
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
-
import_sidebar_navigation_screen_global_styles.SidebarNavigationItemGlobalStyles,
|
|
52
|
-
{
|
|
53
|
-
to: "/styles",
|
|
54
|
-
uid: "global-styles-navigation-item",
|
|
55
|
-
icon: import_icons.styles,
|
|
56
|
-
children: (0, import_i18n.__)("Styles")
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
-
import_sidebar_navigation_item.default,
|
|
61
|
-
{
|
|
62
|
-
uid: "navigation-navigation-item",
|
|
63
|
-
to: "/navigation",
|
|
64
|
-
withChevron: true,
|
|
65
|
-
icon: import_icons.navigation,
|
|
66
|
-
children: (0, import_i18n.__)("Navigation")
|
|
67
|
-
}
|
|
68
|
-
),
|
|
69
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
|
-
import_sidebar_navigation_screen_identity.SidebarNavigationItemIdentity,
|
|
71
|
-
{
|
|
72
|
-
to: "/identity",
|
|
73
|
-
uid: "identity-navigation-item",
|
|
74
|
-
icon: import_icons.siteLogo,
|
|
75
|
-
children: (0, import_i18n._x)("Identity", "site identity")
|
|
76
|
-
}
|
|
77
|
-
),
|
|
78
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
79
|
-
import_sidebar_navigation_item.default,
|
|
80
|
-
{
|
|
81
|
-
uid: "page-navigation-item",
|
|
82
|
-
to: "/page",
|
|
83
|
-
withChevron: true,
|
|
84
|
-
icon: import_icons.page,
|
|
85
|
-
children: (0, import_i18n.__)("Pages")
|
|
86
|
-
}
|
|
87
|
-
),
|
|
88
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
89
|
-
import_sidebar_navigation_item.default,
|
|
90
|
-
{
|
|
91
|
-
uid: "template-navigation-item",
|
|
92
|
-
to: "/template",
|
|
93
|
-
withChevron: true,
|
|
94
|
-
icon: import_icons.layout,
|
|
95
|
-
children: (0, import_i18n.__)("Templates")
|
|
96
|
-
}
|
|
97
|
-
)
|
|
98
|
-
] }),
|
|
99
|
-
!isBlockBasedTheme && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
47
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
100
48
|
import_sidebar_navigation_item.default,
|
|
101
49
|
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
50
|
+
to: "/identity",
|
|
51
|
+
uid: "identity-navigation-item",
|
|
52
|
+
icon: import_icons.siteLogo,
|
|
53
|
+
activeOnRouteName: "identity",
|
|
54
|
+
isHidden: !isBlockBasedTheme,
|
|
55
|
+
children: (0, import_i18n._x)("Identity", "site identity")
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
import_sidebar_navigation_item.default,
|
|
60
|
+
{
|
|
61
|
+
to: isBlockBasedTheme ? "/styles" : "/stylebook",
|
|
62
|
+
uid: isBlockBasedTheme ? "global-styles-navigation-item" : "stylebook-navigation-item",
|
|
105
63
|
icon: import_icons.styles,
|
|
64
|
+
activeOnRouteName: isBlockBasedTheme ? "styles" : void 0,
|
|
65
|
+
withChevron: !isBlockBasedTheme,
|
|
106
66
|
children: (0, import_i18n.__)("Styles")
|
|
107
67
|
}
|
|
108
68
|
),
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
|
+
import_sidebar_navigation_item.default,
|
|
71
|
+
{
|
|
72
|
+
uid: "page-navigation-item",
|
|
73
|
+
to: "/page",
|
|
74
|
+
withChevron: true,
|
|
75
|
+
icon: import_icons.page,
|
|
76
|
+
isHidden: !isBlockBasedTheme,
|
|
77
|
+
children: (0, import_i18n.__)("Pages")
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
+
import_sidebar_navigation_item.default,
|
|
82
|
+
{
|
|
83
|
+
uid: "navigation-navigation-item",
|
|
84
|
+
to: "/navigation",
|
|
85
|
+
withChevron: true,
|
|
86
|
+
icon: import_icons.navigation,
|
|
87
|
+
isHidden: !isBlockBasedTheme,
|
|
88
|
+
children: (0, import_i18n.__)("Navigation")
|
|
89
|
+
}
|
|
90
|
+
),
|
|
109
91
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
92
|
import_sidebar_navigation_item.default,
|
|
111
93
|
{
|
|
@@ -115,6 +97,17 @@ function MainSidebarNavigationContent({ isBlockBasedTheme = true }) {
|
|
|
115
97
|
icon: import_icons.symbol,
|
|
116
98
|
children: (0, import_i18n.__)("Patterns")
|
|
117
99
|
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
102
|
+
import_sidebar_navigation_item.default,
|
|
103
|
+
{
|
|
104
|
+
uid: "template-navigation-item",
|
|
105
|
+
to: "/template",
|
|
106
|
+
withChevron: true,
|
|
107
|
+
icon: import_icons.layout,
|
|
108
|
+
isHidden: !isBlockBasedTheme,
|
|
109
|
+
children: (0, import_i18n.__)("Templates")
|
|
110
|
+
}
|
|
118
111
|
)
|
|
119
112
|
] });
|
|
120
113
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar-navigation-screen-main/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tlayout,\n\tsymbol,\n\tnavigation,\n\tstyles,\n\tpage,\n\tsiteLogo,\n} from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAqD;AACrD,kBAAuB;AACvB,mBAOO;AACP,kBAA0B;AAC1B,uBAAmC;AAKnC,uCAAoC;AACpC,qCAAkC;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tlayout,\n\tsymbol,\n\tnavigation,\n\tstyles,\n\tpage,\n\tsiteLogo,\n} from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\n\nexport function MainSidebarNavigationContent( { isBlockBasedTheme = true } ) {\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-main\">\n\t\t\t<SidebarNavigationItem\n\t\t\t\tto=\"/identity\"\n\t\t\t\tuid=\"identity-navigation-item\"\n\t\t\t\ticon={ siteLogo }\n\t\t\t\tactiveOnRouteName=\"identity\"\n\t\t\t\tisHidden={ ! isBlockBasedTheme }\n\t\t\t>\n\t\t\t\t{ _x( 'Identity', 'site identity' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tto={ isBlockBasedTheme ? '/styles' : '/stylebook' }\n\t\t\t\tuid={\n\t\t\t\t\tisBlockBasedTheme\n\t\t\t\t\t\t? 'global-styles-navigation-item'\n\t\t\t\t\t\t: 'stylebook-navigation-item'\n\t\t\t\t}\n\t\t\t\ticon={ styles }\n\t\t\t\tactiveOnRouteName={ isBlockBasedTheme ? 'styles' : undefined }\n\t\t\t\twithChevron={ ! isBlockBasedTheme }\n\t\t\t>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"page-navigation-item\"\n\t\t\t\tto=\"/page\"\n\t\t\t\twithChevron\n\t\t\t\ticon={ page }\n\t\t\t\tisHidden={ ! isBlockBasedTheme }\n\t\t\t>\n\t\t\t\t{ __( 'Pages' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"navigation-navigation-item\"\n\t\t\t\tto=\"/navigation\"\n\t\t\t\twithChevron\n\t\t\t\ticon={ navigation }\n\t\t\t\tisHidden={ ! isBlockBasedTheme }\n\t\t\t>\n\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"patterns-navigation-item\"\n\t\t\t\tto=\"/pattern\"\n\t\t\t\twithChevron\n\t\t\t\ticon={ symbol }\n\t\t\t>\n\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"template-navigation-item\"\n\t\t\t\tto=\"/template\"\n\t\t\t\twithChevron\n\t\t\t\ticon={ layout }\n\t\t\t\tisHidden={ ! isBlockBasedTheme }\n\t\t\t>\n\t\t\t\t{ __( 'Templates' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenMain( { customDescription } ) {\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\n\tlet description;\n\tif ( customDescription ) {\n\t\tdescription = customDescription;\n\t} else if ( isBlockBasedTheme ) {\n\t\tdescription = __(\n\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t);\n\t} else {\n\t\tdescription = __(\n\t\t\t'Explore block styles and patterns to refine your site.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ description }\n\t\t\tcontent={\n\t\t\t\t<MainSidebarNavigationContent\n\t\t\t\t\tisBlockBasedTheme={ isBlockBasedTheme }\n\t\t\t\t/>\n\t\t\t}\n\t\t/>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAqD;AACrD,kBAAuB;AACvB,mBAOO;AACP,kBAA0B;AAC1B,uBAAmC;AAKnC,uCAAoC;AACpC,qCAAkC;AAIhC;AAFK,SAAS,6BAA8B,EAAE,oBAAoB,KAAK,GAAI;AAC5E,SACC,6CAAC,kBAAAA,yBAAA,EAAU,WAAU,4CACpB;AAAA;AAAA,MAAC,+BAAAC;AAAA,MAAA;AAAA,QACA,IAAG;AAAA,QACH,KAAI;AAAA,QACJ,MAAO;AAAA,QACP,mBAAkB;AAAA,QAClB,UAAW,CAAE;AAAA,QAEX,8BAAI,YAAY,eAAgB;AAAA;AAAA,IACnC;AAAA,IACA;AAAA,MAAC,+BAAAA;AAAA,MAAA;AAAA,QACA,IAAK,oBAAoB,YAAY;AAAA,QACrC,KACC,oBACG,kCACA;AAAA,QAEJ,MAAO;AAAA,QACP,mBAAoB,oBAAoB,WAAW;AAAA,QACnD,aAAc,CAAE;AAAA,QAEd,8BAAI,QAAS;AAAA;AAAA,IAChB;AAAA,IACA;AAAA,MAAC,+BAAAA;AAAA,MAAA;AAAA,QACA,KAAI;AAAA,QACJ,IAAG;AAAA,QACH,aAAW;AAAA,QACX,MAAO;AAAA,QACP,UAAW,CAAE;AAAA,QAEX,8BAAI,OAAQ;AAAA;AAAA,IACf;AAAA,IACA;AAAA,MAAC,+BAAAA;AAAA,MAAA;AAAA,QACA,KAAI;AAAA,QACJ,IAAG;AAAA,QACH,aAAW;AAAA,QACX,MAAO;AAAA,QACP,UAAW,CAAE;AAAA,QAEX,8BAAI,YAAa;AAAA;AAAA,IACpB;AAAA,IACA;AAAA,MAAC,+BAAAA;AAAA,MAAA;AAAA,QACA,KAAI;AAAA,QACJ,IAAG;AAAA,QACH,aAAW;AAAA,QACX,MAAO;AAAA,QAEL,8BAAI,UAAW;AAAA;AAAA,IAClB;AAAA,IACA;AAAA,MAAC,+BAAAA;AAAA,MAAA;AAAA,QACA,KAAI;AAAA,QACJ,IAAG;AAAA,QACH,aAAW;AAAA,QACX,MAAO;AAAA,QACP,UAAW,CAAE;AAAA,QAEX,8BAAI,WAAY;AAAA;AAAA,IACnB;AAAA,KACD;AAEF;AAEe,SAAR,4BAA8C,EAAE,kBAAkB,GAAI;AAC5E,QAAM,wBAAoB;AAAA,IACzB,CAAE,WAAY,OAAQ,iBAAAC,KAAU,EAAE,gBAAgB,GAAG;AAAA,IACrD,CAAC;AAAA,EACF;AAEA,MAAI;AACJ,MAAK,mBAAoB;AACxB,kBAAc;AAAA,EACf,WAAY,mBAAoB;AAC/B,sBAAc;AAAA,MACb;AAAA,IACD;AAAA,EACD,OAAO;AACN,sBAAc;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAEA,SACC;AAAA,IAAC,iCAAAC;AAAA,IAAA;AAAA,MACA,QAAM;AAAA,MACN,WAAQ,gBAAI,QAAS;AAAA,MACrB;AAAA,MACA,SACC;AAAA,QAAC;AAAA;AAAA,UACA;AAAA;AAAA,MACD;AAAA;AAAA,EAEF;AAEF;",
|
|
6
6
|
"names": ["ItemGroup", "SidebarNavigationItem", "coreStore", "SidebarNavigationScreen"]
|
|
7
7
|
}
|
|
@@ -43,7 +43,6 @@ function RenameModal({ menuTitle, onClose, onSave }) {
|
|
|
43
43
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
44
|
import_components.TextControl,
|
|
45
45
|
{
|
|
46
|
-
__next40pxDefaultSize: true,
|
|
47
46
|
value: editedMenuTitle,
|
|
48
47
|
placeholder: (0, import_i18n.__)("Navigation title"),
|
|
49
48
|
onChange: setEditedMenuTitle,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\nconst notEmptyString = ( testString ) => testString?.trim()?.length > 0;\n\nexport default function RenameModal( { menuTitle, onClose, onSave } ) {\n\tconst [ editedMenuTitle, setEditedMenuTitle ] = useState( menuTitle );\n\n\tconst titleHasChanged = editedMenuTitle !== menuTitle;\n\n\tconst isEditedMenuTitleValid =\n\t\ttitleHasChanged && notEmptyString( editedMenuTitle );\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Rename' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form className=\"sidebar-navigation__rename-modal-form\">\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAMO;AACP,kBAAmB;AACnB,qBAAyB;AAqBpB;AAnBL,IAAM,iBAAiB,CAAE,eAAgB,YAAY,KAAK,GAAG,SAAS;AAEvD,SAAR,YAA8B,EAAE,WAAW,SAAS,OAAO,GAAI;AACrE,QAAM,CAAE,iBAAiB,kBAAmB,QAAI,yBAAU,SAAU;AAEpE,QAAM,kBAAkB,oBAAoB;AAE5C,QAAM,yBACL,mBAAmB,eAAgB,eAAgB;AAEpD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAQ,gBAAI,QAAS;AAAA,MACrB,gBAAiB;AAAA,MACjB,cAAa;AAAA,MACb,MAAK;AAAA,MAEL,sDAAC,UAAK,WAAU,yCACf,uDAAC,kBAAAA,sBAAA,EAAO,SAAQ,KACf;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\nconst notEmptyString = ( testString ) => testString?.trim()?.length > 0;\n\nexport default function RenameModal( { menuTitle, onClose, onSave } ) {\n\tconst [ editedMenuTitle, setEditedMenuTitle ] = useState( menuTitle );\n\n\tconst titleHasChanged = editedMenuTitle !== menuTitle;\n\n\tconst isEditedMenuTitleValid =\n\t\ttitleHasChanged && notEmptyString( editedMenuTitle );\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Rename' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form className=\"sidebar-navigation__rename-modal-form\">\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ editedMenuTitle }\n\t\t\t\t\t\tplaceholder={ __( 'Navigation title' ) }\n\t\t\t\t\t\tonChange={ setEditedMenuTitle }\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tdisabled={ ! isEditedMenuTitleValid }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t\t\tif ( ! isEditedMenuTitleValid ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonSave( { title: editedMenuTitle } );\n\n\t\t\t\t\t\t\t\t// Immediate close avoids ability to hit save multiple times.\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAMO;AACP,kBAAmB;AACnB,qBAAyB;AAqBpB;AAnBL,IAAM,iBAAiB,CAAE,eAAgB,YAAY,KAAK,GAAG,SAAS;AAEvD,SAAR,YAA8B,EAAE,WAAW,SAAS,OAAO,GAAI;AACrE,QAAM,CAAE,iBAAiB,kBAAmB,QAAI,yBAAU,SAAU;AAEpE,QAAM,kBAAkB,oBAAoB;AAE5C,QAAM,yBACL,mBAAmB,eAAgB,eAAgB;AAEpD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAQ,gBAAI,QAAS;AAAA,MACrB,gBAAiB;AAAA,MACjB,cAAa;AAAA,MACb,MAAK;AAAA,MAEL,sDAAC,UAAK,WAAU,yCACf,uDAAC,kBAAAA,sBAAA,EAAO,SAAQ,KACf;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ;AAAA,YACR,iBAAc,gBAAI,kBAAmB;AAAA,YACrC,UAAW;AAAA,YACX,WAAQ,gBAAI,MAAO;AAAA;AAAA,QACpB;AAAA,QACA,6CAAC,kBAAAC,sBAAA,EAAO,SAAQ,SACf;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,SAAQ;AAAA,cACR,SAAU;AAAA,cAER,8BAAI,QAAS;AAAA;AAAA,UAChB;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,wBAAsB;AAAA,cACtB,UAAW,CAAE;AAAA,cACb,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,SAAU,CAAE,MAAO;AAClB,kBAAE,eAAe;AAEjB,oBAAK,CAAE,wBAAyB;AAC/B;AAAA,gBACD;AACA,uBAAQ,EAAE,OAAO,gBAAgB,CAAE;AAGnC,wBAAQ;AAAA,cACT;AAAA,cAEE,8BAAI,MAAO;AAAA;AAAA,UACd;AAAA,WACD;AAAA,SACD,GACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": ["VStack", "HStack"]
|
|
7
7
|
}
|
|
@@ -47,6 +47,7 @@ var import_use_pattern_categories = __toESM(require("./use-pattern-categories.cj
|
|
|
47
47
|
var import_use_template_part_areas = __toESM(require("./use-template-part-areas.cjs"));
|
|
48
48
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
49
49
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
|
+
var VIEW_CONFIG_FIELDS = ["view_list"];
|
|
50
51
|
var { useLocation } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
51
52
|
function CategoriesGroup({
|
|
52
53
|
templatePartViews,
|
|
@@ -93,11 +94,13 @@ function SidebarNavigationScreenPatterns({ backPath }) {
|
|
|
93
94
|
const currentCategory = categoryId || (postType === import_constants.PATTERN_TYPES.user ? import_constants.PATTERN_DEFAULT_CATEGORY : import_constants.TEMPLATE_PART_ALL_AREAS_CATEGORY);
|
|
94
95
|
const { view_list: templatePartViews } = (0, import_views.useViewConfig)({
|
|
95
96
|
kind: "postType",
|
|
96
|
-
name: import_constants.TEMPLATE_PART_POST_TYPE
|
|
97
|
+
name: import_constants.TEMPLATE_PART_POST_TYPE,
|
|
98
|
+
fields: VIEW_CONFIG_FIELDS
|
|
97
99
|
});
|
|
98
100
|
const { view_list: patternViews } = (0, import_views.useViewConfig)({
|
|
99
101
|
kind: "postType",
|
|
100
|
-
name: import_constants.PATTERN_TYPES.user
|
|
102
|
+
name: import_constants.PATTERN_TYPES.user,
|
|
103
|
+
fields: VIEW_CONFIG_FIELDS
|
|
101
104
|
});
|
|
102
105
|
const { templatePartAreas, isLoading, hasTemplateParts } = (0, import_use_template_part_areas.default)();
|
|
103
106
|
const templatePartCounts = (0, import_element.useMemo)(() => {
|
|
@@ -130,7 +133,7 @@ function SidebarNavigationScreenPatterns({ backPath }) {
|
|
|
130
133
|
isRoot: !backPath,
|
|
131
134
|
backPath,
|
|
132
135
|
content: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
133
|
-
isLoading && (0, import_i18n.__)("Loading items
|
|
136
|
+
isLoading && (0, import_i18n.__)("Loading items…"),
|
|
134
137
|
!isLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
135
138
|
!hasTemplateParts && !hasPatterns && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-patterns__group", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalItem, { children: (0, import_i18n.__)("No items found") }) }),
|
|
136
139
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar-navigation-screen-patterns/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { getTemplatePartIcon } from '@wordpress/editor';\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { file } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useViewConfig } from '@wordpress/views';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport CategoryItem from './category-item';\nimport {\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_ALL_AREAS_CATEGORY,\n} from '../../utils/constants';\nimport usePatternCategories from './use-pattern-categories';\nimport useTemplatePartAreas from './use-template-part-areas';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction CategoriesGroup( {\n\ttemplatePartViews,\n\tpatternViews,\n\ttemplatePartCounts,\n\tpatternCounts,\n\tcurrentCategory,\n\tcurrentType,\n} ) {\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t{ templatePartViews?.map( ( view ) => (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ view.slug }\n\t\t\t\t\tcount={ templatePartCounts[ view.slug ] }\n\t\t\t\t\ticon={ getTemplatePartIcon(\n\t\t\t\t\t\tview.slug === TEMPLATE_PART_ALL_AREAS_CATEGORY\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: view.slug\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ view.title }\n\t\t\t\t\tid={ view.slug }\n\t\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === view.slug &&\n\t\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-patterns__divider\" />\n\t\t\t{ patternViews?.map( ( view ) => (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ view.slug }\n\t\t\t\t\tcount={ patternCounts[ view.slug ] }\n\t\t\t\t\tlabel={ view.title }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ view.slug }\n\t\t\t\t\ttype={ PATTERN_TYPES.user }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ view.slug }` &&\n\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenPatterns( { backPath } ) {\n\tconst {\n\t\tquery: { postType = 'wp_block', categoryId },\n\t} = useLocation();\n\tconst currentCategory =\n\t\tcategoryId ||\n\t\t( postType === PATTERN_TYPES.user\n\t\t\t? PATTERN_DEFAULT_CATEGORY\n\t\t\t: TEMPLATE_PART_ALL_AREAS_CATEGORY );\n\n\tconst { view_list: templatePartViews } = useViewConfig( {\n\t\tkind: 'postType',\n\t\tname: TEMPLATE_PART_POST_TYPE,\n\t} );\n\tconst { view_list: patternViews } = useViewConfig( {\n\t\tkind: 'postType',\n\t\tname: PATTERN_TYPES.user,\n\t} );\n\n\tconst { templatePartAreas, isLoading, hasTemplateParts } =\n\t\tuseTemplatePartAreas();\n\tconst templatePartCounts = useMemo( () => {\n\t\tconst counts = { [ TEMPLATE_PART_ALL_AREAS_CATEGORY ]: 0 };\n\t\tObject.entries( templatePartAreas ).forEach(\n\t\t\t( [ area, { templateParts } ] ) => {\n\t\t\t\tconst count = templateParts?.length || 0;\n\t\t\t\tcounts[ area ] = count;\n\t\t\t\tcounts[ TEMPLATE_PART_ALL_AREAS_CATEGORY ] += count;\n\t\t\t}\n\t\t);\n\t\treturn counts;\n\t}, [ templatePartAreas ] );\n\tconst { patternCategories } = usePatternCategories();\n\tconst patternCounts = useMemo( () => {\n\t\tconst counts = {};\n\t\tpatternCategories.forEach( ( cat ) => {\n\t\t\tcounts[ cat.name ] = cat.count;\n\t\t} );\n\t\treturn counts;\n\t}, [ patternCategories ] );\n\n\tconst hasPatterns = patternCounts[ PATTERN_DEFAULT_CATEGORY ] > 0;\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ __( 'Patterns' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Manage what patterns are available when editing the site.'\n\t\t\t) }\n\t\t\tisRoot={ ! backPath }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ isLoading && __( 'Loading items
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAGO;AACP,oBAAoC;AACpC,qBAAwB;AACxB,kBAAmB;AACnB,mBAAqB;AACrB,oBAAiD;AACjD,mBAA8B;AAK9B,uCAAoC;AACpC,2BAAyB;AACzB,uBAKO;AACP,oCAAiC;AACjC,qCAAiC;AACjC,yBAAuB;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { getTemplatePartIcon } from '@wordpress/editor';\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { file } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useViewConfig } from '@wordpress/views';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport CategoryItem from './category-item';\nimport {\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_ALL_AREAS_CATEGORY,\n} from '../../utils/constants';\nimport usePatternCategories from './use-pattern-categories';\nimport useTemplatePartAreas from './use-template-part-areas';\nimport { unlock } from '../../lock-unlock';\n\nconst VIEW_CONFIG_FIELDS = [ 'view_list' ];\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction CategoriesGroup( {\n\ttemplatePartViews,\n\tpatternViews,\n\ttemplatePartCounts,\n\tpatternCounts,\n\tcurrentCategory,\n\tcurrentType,\n} ) {\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t{ templatePartViews?.map( ( view ) => (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ view.slug }\n\t\t\t\t\tcount={ templatePartCounts[ view.slug ] }\n\t\t\t\t\ticon={ getTemplatePartIcon(\n\t\t\t\t\t\tview.slug === TEMPLATE_PART_ALL_AREAS_CATEGORY\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: view.slug\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ view.title }\n\t\t\t\t\tid={ view.slug }\n\t\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === view.slug &&\n\t\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-patterns__divider\" />\n\t\t\t{ patternViews?.map( ( view ) => (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ view.slug }\n\t\t\t\t\tcount={ patternCounts[ view.slug ] }\n\t\t\t\t\tlabel={ view.title }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ view.slug }\n\t\t\t\t\ttype={ PATTERN_TYPES.user }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ view.slug }` &&\n\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenPatterns( { backPath } ) {\n\tconst {\n\t\tquery: { postType = 'wp_block', categoryId },\n\t} = useLocation();\n\tconst currentCategory =\n\t\tcategoryId ||\n\t\t( postType === PATTERN_TYPES.user\n\t\t\t? PATTERN_DEFAULT_CATEGORY\n\t\t\t: TEMPLATE_PART_ALL_AREAS_CATEGORY );\n\n\tconst { view_list: templatePartViews } = useViewConfig( {\n\t\tkind: 'postType',\n\t\tname: TEMPLATE_PART_POST_TYPE,\n\t\tfields: VIEW_CONFIG_FIELDS,\n\t} );\n\tconst { view_list: patternViews } = useViewConfig( {\n\t\tkind: 'postType',\n\t\tname: PATTERN_TYPES.user,\n\t\tfields: VIEW_CONFIG_FIELDS,\n\t} );\n\n\tconst { templatePartAreas, isLoading, hasTemplateParts } =\n\t\tuseTemplatePartAreas();\n\tconst templatePartCounts = useMemo( () => {\n\t\tconst counts = { [ TEMPLATE_PART_ALL_AREAS_CATEGORY ]: 0 };\n\t\tObject.entries( templatePartAreas ).forEach(\n\t\t\t( [ area, { templateParts } ] ) => {\n\t\t\t\tconst count = templateParts?.length || 0;\n\t\t\t\tcounts[ area ] = count;\n\t\t\t\tcounts[ TEMPLATE_PART_ALL_AREAS_CATEGORY ] += count;\n\t\t\t}\n\t\t);\n\t\treturn counts;\n\t}, [ templatePartAreas ] );\n\tconst { patternCategories } = usePatternCategories();\n\tconst patternCounts = useMemo( () => {\n\t\tconst counts = {};\n\t\tpatternCategories.forEach( ( cat ) => {\n\t\t\tcounts[ cat.name ] = cat.count;\n\t\t} );\n\t\treturn counts;\n\t}, [ patternCategories ] );\n\n\tconst hasPatterns = patternCounts[ PATTERN_DEFAULT_CATEGORY ] > 0;\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ __( 'Patterns' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Manage what patterns are available when editing the site.'\n\t\t\t) }\n\t\t\tisRoot={ ! backPath }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ isLoading && __( 'Loading items…' ) }\n\t\t\t\t\t{ ! isLoading && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! hasTemplateParts && ! hasPatterns && (\n\t\t\t\t\t\t\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t\t\t\t\t\t\t<Item>{ __( 'No items found' ) }</Item>\n\t\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<CategoriesGroup\n\t\t\t\t\t\t\t\ttemplatePartViews={ templatePartViews }\n\t\t\t\t\t\t\t\tpatternViews={ patternViews }\n\t\t\t\t\t\t\t\ttemplatePartCounts={ templatePartCounts }\n\t\t\t\t\t\t\t\tpatternCounts={ patternCounts }\n\t\t\t\t\t\t\t\tcurrentCategory={ currentCategory }\n\t\t\t\t\t\t\t\tcurrentType={ postType }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAGO;AACP,oBAAoC;AACpC,qBAAwB;AACxB,kBAAmB;AACnB,mBAAqB;AACrB,oBAAiD;AACjD,mBAA8B;AAK9B,uCAAoC;AACpC,2BAAyB;AACzB,uBAKO;AACP,oCAAiC;AACjC,qCAAiC;AACjC,yBAAuB;AAerB;AAbF,IAAM,qBAAqB,CAAE,WAAY;AAEzC,IAAM,EAAE,YAAY,QAAI,2BAAQ,cAAAA,WAAkB;AAElD,SAAS,gBAAiB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,SACC,6CAAC,kBAAAC,yBAAA,EAAU,WAAU,uDAClB;AAAA,uBAAmB,IAAK,CAAE,SAC3B;AAAA,MAAC,qBAAAC;AAAA,MAAA;AAAA,QAEA,OAAQ,mBAAoB,KAAK,IAAK;AAAA,QACtC,UAAO;AAAA,UACN,KAAK,SAAS,oDACX,SACA,KAAK;AAAA,QACT;AAAA,QACA,OAAQ,KAAK;AAAA,QACb,IAAK,KAAK;AAAA,QACV,MAAO;AAAA,QACP,UACC,oBAAoB,KAAK,QACzB,gBAAgB;AAAA;AAAA,MAZX,KAAK;AAAA,IAcZ,CACC;AAAA,IACF,4CAAC,SAAI,WAAU,yDAAwD;AAAA,IACrE,cAAc,IAAK,CAAE,SACtB;AAAA,MAAC,qBAAAA;AAAA,MAAA;AAAA,QAEA,OAAQ,cAAe,KAAK,IAAK;AAAA,QACjC,OAAQ,KAAK;AAAA,QACb,MAAO;AAAA,QACP,IAAK,KAAK;AAAA,QACV,MAAO,+BAAc;AAAA,QACrB,UACC,oBAAoB,GAAI,KAAK,IAAK,MAClC,gBAAgB,+BAAc;AAAA;AAAA,MARzB,KAAK;AAAA,IAUZ,CACC;AAAA,KACH;AAEF;AAEe,SAAR,gCAAkD,EAAE,SAAS,GAAI;AACvE,QAAM;AAAA,IACL,OAAO,EAAE,WAAW,YAAY,WAAW;AAAA,EAC5C,IAAI,YAAY;AAChB,QAAM,kBACL,eACE,aAAa,+BAAc,OAC1B,4CACA;AAEJ,QAAM,EAAE,WAAW,kBAAkB,QAAI,4BAAe;AAAA,IACvD,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,EACT,CAAE;AACF,QAAM,EAAE,WAAW,aAAa,QAAI,4BAAe;AAAA,IAClD,MAAM;AAAA,IACN,MAAM,+BAAc;AAAA,IACpB,QAAQ;AAAA,EACT,CAAE;AAEF,QAAM,EAAE,mBAAmB,WAAW,iBAAiB,QACtD,+BAAAC,SAAqB;AACtB,QAAM,yBAAqB,wBAAS,MAAM;AACzC,UAAM,SAAS,EAAE,CAAE,iDAAiC,GAAG,EAAE;AACzD,WAAO,QAAS,iBAAkB,EAAE;AAAA,MACnC,CAAE,CAAE,MAAM,EAAE,cAAc,CAAE,MAAO;AAClC,cAAM,QAAQ,eAAe,UAAU;AACvC,eAAQ,IAAK,IAAI;AACjB,eAAQ,iDAAiC,KAAK;AAAA,MAC/C;AAAA,IACD;AACA,WAAO;AAAA,EACR,GAAG,CAAE,iBAAkB,CAAE;AACzB,QAAM,EAAE,kBAAkB,QAAI,8BAAAC,SAAqB;AACnD,QAAM,oBAAgB,wBAAS,MAAM;AACpC,UAAM,SAAS,CAAC;AAChB,sBAAkB,QAAS,CAAE,QAAS;AACrC,aAAQ,IAAI,IAAK,IAAI,IAAI;AAAA,IAC1B,CAAE;AACF,WAAO;AAAA,EACR,GAAG,CAAE,iBAAkB,CAAE;AAEzB,QAAM,cAAc,cAAe,yCAAyB,IAAI;AAEhE,SACC;AAAA,IAAC,iCAAAC;AAAA,IAAA;AAAA,MACA,WAAQ,gBAAI,UAAW;AAAA,MACvB,iBAAc;AAAA,QACb;AAAA,MACD;AAAA,MACA,QAAS,CAAE;AAAA,MACX;AAAA,MACA,SACC,4EACG;AAAA,yBAAa,gBAAI,gBAAiB;AAAA,QAClC,CAAE,aACH,4EACG;AAAA,WAAE,oBAAoB,CAAE,eACzB,4CAAC,kBAAAJ,yBAAA,EAAU,WAAU,uDACpB,sDAAC,kBAAAK,oBAAA,EAAO,8BAAI,gBAAiB,GAAG,GACjC;AAAA,UAED;AAAA,YAAC;AAAA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA,aAAc;AAAA;AAAA,UACf;AAAA,WACD;AAAA,SAEF;AAAA;AAAA,EAEF;AAEF;",
|
|
6
6
|
"names": ["routerPrivateApis", "ItemGroup", "CategoryItem", "useTemplatePartAreas", "usePatternCategories", "SidebarNavigationScreen", "Item"]
|
|
7
7
|
}
|
|
@@ -74,7 +74,7 @@ function WelcomeGuideEditor() {
|
|
|
74
74
|
content: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
75
75
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "edit-site-welcome-guide__heading", children: (0, import_i18n.__)("Edit your site") }),
|
|
76
76
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0, import_i18n.__)(
|
|
77
|
-
"Design everything on your site
|
|
77
|
+
"Design everything on your site — from the header right down to the footer — using blocks."
|
|
78
78
|
) }),
|
|
79
79
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0, import_element.createInterpolateElement)(
|
|
80
80
|
(0, import_i18n.__)(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/welcome-guide/editor.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\n\nexport default function WelcomeGuideEditor() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst { isActive, isBlockBasedTheme } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tisActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t\tisBlockBasedTheme:\n\t\t\t\tselect( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t};\n\t}, [] );\n\n\tif ( ! isActive || ! isBlockBasedTheme ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-editor\"\n\t\t\tcontentLabel={ __( 'Welcome to the site editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/edit-your-site.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/edit-your-site.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Edit your site' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Design everything on your site
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\n\nexport default function WelcomeGuideEditor() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst { isActive, isBlockBasedTheme } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tisActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t\tisBlockBasedTheme:\n\t\t\t\tselect( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t};\n\t}, [] );\n\n\tif ( ! isActive || ! isBlockBasedTheme ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-editor\"\n\t\t\tcontentLabel={ __( 'Welcome to the site editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/edit-your-site.svg?1\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/edit-your-site.gif?1\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Edit your site' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Design everything on your site — from the header right down to the footer — using blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tStylesIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'styles' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuC;AACvC,wBAAsB;AACtB,kBAAmB;AACnB,qBAAyC;AACzC,yBAA0C;AAC1C,uBAAmC;AAKnC,mBAA8B;AA6BxB;AA3BS,SAAR,qBAAsC;AAC5C,QAAM,EAAE,OAAO,QAAI,yBAAa,mBAAAA,KAAiB;AAEjD,QAAM,EAAE,UAAU,kBAAkB,QAAI,uBAAW,CAAE,WAAY;AAChE,WAAO;AAAA,MACN,UAAU,CAAC,CAAE,OAAQ,mBAAAA,KAAiB,EAAE;AAAA,QACvC;AAAA,QACA;AAAA,MACD;AAAA,MACA,mBACC,OAAQ,iBAAAC,KAAU,EAAE,gBAAgB,GAAG;AAAA,IACzC;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,YAAY,CAAE,mBAAoB;AACxC,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,kBAAe,gBAAI,4BAA6B;AAAA,MAChD,sBAAmB,gBAAI,aAAc;AAAA,MACrC,UAAW,MAAM,OAAQ,kBAAkB,cAAe;AAAA,MAC1D,OAAQ;AAAA,QACP;AAAA,UACC,OACC;AAAA,YAAC,aAAAC;AAAA,YAAA;AAAA,cACA,gBAAe;AAAA,cACf,aAAY;AAAA;AAAA,UACb;AAAA,UAED,SACC,4EACC;AAAA,wDAAC,QAAG,WAAU,oCACX,8BAAI,gBAAiB,GACxB;AAAA,YACA,4CAAC,OAAE,WAAU,iCACV;AAAA,cACD;AAAA,YACD,GACD;AAAA,YACA,4CAAC,OAAE,WAAU,iCACV;AAAA,kBACD;AAAA,gBACC;AAAA,cACD;AAAA,cACA;AAAA,gBACC,iBACC;AAAA,kBAAC;AAAA;AAAA,oBACA,SAAM,gBAAI,QAAS;AAAA,oBACnB,KAAI;AAAA;AAAA,gBACL;AAAA,cAEF;AAAA,YACD,GACD;AAAA,aACD;AAAA,QAEF;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": ["preferencesStore", "coreStore", "WelcomeGuideImage"]
|
|
7
7
|
}
|
|
@@ -76,7 +76,7 @@ function WelcomeGuidePage() {
|
|
|
76
76
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "edit-site-welcome-guide__heading", children: heading }),
|
|
77
77
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0, import_i18n.__)(
|
|
78
78
|
// eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts
|
|
79
|
-
"It
|
|
79
|
+
"It’s now possible to edit page content in the site editor. To customize other parts of the page like the header and footer switch to editing the template using the settings sidebar."
|
|
80
80
|
) })
|
|
81
81
|
] })
|
|
82
82
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/welcome-guide/page.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\nexport default function WelcomeGuidePage() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst isPageActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuidePage'\n\t\t);\n\t\tconst isEditorActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuide'\n\t\t);\n\t\treturn isPageActive && ! isEditorActive;\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a page' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-page\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuidePage' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-page.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts\n\t\t\t\t\t\t\t\t\t'It
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\nexport default function WelcomeGuidePage() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst isPageActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuidePage'\n\t\t);\n\t\tconst isEditorActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuide'\n\t\t);\n\t\treturn isPageActive && ! isEditorActive;\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a page' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-page\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuidePage' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-page.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts\n\t\t\t\t\t\t\t\t\t'It’s now possible to edit page content in the site editor. To customize other parts of the page like the header and footer switch to editing the template using the settings sidebar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuC;AACvC,wBAAsB;AACtB,kBAAmB;AACnB,yBAA0C;AAwCnC;AAtCQ,SAAR,mBAAoC;AAC1C,QAAM,EAAE,OAAO,QAAI,yBAAa,mBAAAA,KAAiB;AAEjD,QAAM,gBAAY,uBAAW,CAAE,WAAY;AAC1C,UAAM,eAAe,CAAC,CAAE,OAAQ,mBAAAA,KAAiB,EAAE;AAAA,MAClD;AAAA,MACA;AAAA,IACD;AACA,UAAM,iBAAiB,CAAC,CAAE,OAAQ,mBAAAA,KAAiB,EAAE;AAAA,MACpD;AAAA,MACA;AAAA,IACD;AACA,WAAO,gBAAgB,CAAE;AAAA,EAC1B,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AAEA,QAAM,cAAU,gBAAI,gBAAiB;AAErC,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,cAAe;AAAA,MACf,sBAAmB,gBAAI,UAAW;AAAA,MAClC,UAAW,MAAM,OAAQ,kBAAkB,kBAAmB;AAAA,MAC9D,OAAQ;AAAA,QACP;AAAA,UACC,OACC;AAAA,YAAC;AAAA;AAAA,cACA,WAAU;AAAA,cACV,UAAQ;AAAA,cACR,MAAI;AAAA,cACJ,OAAK;AAAA,cACL,OAAM;AAAA,cACN,QAAO;AAAA,cAEP;AAAA,gBAAC;AAAA;AAAA,kBACA,KAAI;AAAA,kBACJ,MAAK;AAAA;AAAA,cACN;AAAA;AAAA,UACD;AAAA,UAED,SACC,4EACC;AAAA,wDAAC,QAAG,WAAU,oCACX,mBACH;AAAA,YACA,4CAAC,OAAE,WAAU,iCACV;AAAA;AAAA,cAED;AAAA,YACD,GACD;AAAA,aACD;AAAA,QAEF;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": ["preferencesStore"]
|
|
7
7
|
}
|
|
@@ -74,7 +74,7 @@ function WelcomeGuideTemplate() {
|
|
|
74
74
|
content: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
75
75
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "edit-site-welcome-guide__heading", children: heading }),
|
|
76
76
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0, import_i18n.__)(
|
|
77
|
-
"Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the
|
|
77
|
+
"Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the ‘Back’ button in the toolbar."
|
|
78
78
|
) })
|
|
79
79
|
] })
|
|
80
80
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/welcome-guide/template.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideTemplate() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst { isActive, hasPreviousEntity } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\tisActive: get( 'core/edit-site', 'welcomeGuideTemplate' ),\n\t\t\thasPreviousEntity:\n\t\t\t\t!! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\tconst isVisible = isActive && hasPreviousEntity;\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a template' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-template\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () =>\n\t\t\t\ttoggle( 'core/edit-site', 'welcomeGuideTemplate' )\n\t\t\t}\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-template.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideTemplate() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst { isActive, hasPreviousEntity } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\tisActive: get( 'core/edit-site', 'welcomeGuideTemplate' ),\n\t\t\thasPreviousEntity:\n\t\t\t\t!! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\tconst isVisible = isActive && hasPreviousEntity;\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a template' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-template\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () =>\n\t\t\t\ttoggle( 'core/edit-site', 'welcomeGuideTemplate' )\n\t\t\t}\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-template.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the ‘Back’ button in the toolbar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuC;AACvC,wBAAsB;AACtB,kBAAmB;AACnB,yBAA0C;AAC1C,oBAAqC;AAyC9B;AAvCQ,SAAR,uBAAwC;AAC9C,QAAM,EAAE,OAAO,QAAI,yBAAa,mBAAAA,KAAiB;AAEjD,QAAM,EAAE,UAAU,kBAAkB,QAAI,uBAAW,CAAE,WAAY;AAChE,UAAM,EAAE,kBAAkB,IAAI,OAAQ,cAAAC,KAAY;AAClD,UAAM,EAAE,IAAI,IAAI,OAAQ,mBAAAD,KAAiB;AACzC,WAAO;AAAA,MACN,UAAU,IAAK,kBAAkB,sBAAuB;AAAA,MACxD,mBACC,CAAC,CAAE,kBAAkB,EAAE;AAAA,IACzB;AAAA,EACD,GAAG,CAAC,CAAE;AACN,QAAM,YAAY,YAAY;AAE9B,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AAEA,QAAM,cAAU,gBAAI,oBAAqB;AAEzC,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,cAAe;AAAA,MACf,sBAAmB,gBAAI,UAAW;AAAA,MAClC,UAAW,MACV,OAAQ,kBAAkB,sBAAuB;AAAA,MAElD,OAAQ;AAAA,QACP;AAAA,UACC,OACC;AAAA,YAAC;AAAA;AAAA,cACA,WAAU;AAAA,cACV,UAAQ;AAAA,cACR,MAAI;AAAA,cACJ,OAAK;AAAA,cACL,OAAM;AAAA,cACN,QAAO;AAAA,cAEP;AAAA,gBAAC;AAAA;AAAA,kBACA,KAAI;AAAA,kBACJ,MAAK;AAAA;AAAA,cACN;AAAA;AAAA,UACD;AAAA,UAED,SACC,4EACC;AAAA,wDAAC,QAAG,WAAU,oCACX,mBACH;AAAA,YACA,4CAAC,OAAE,WAAU,iCACV;AAAA,cACD;AAAA,YACD,GACD;AAAA,aACD;AAAA,QAEF;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": ["preferencesStore", "editorStore"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/add-new-post/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tTextControl,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch, useRegistry, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { serialize, synchronizeBlocksWithTemplate } from '@wordpress/blocks';\n\nexport default function AddNewPostModal( { postType, onSave, onClose } ) {\n\tconst labels = useSelect(\n\t\t( select ) => select( coreStore ).getPostType( postType )?.labels,\n\t\t[ postType ]\n\t);\n\tconst [ isCreatingPost, setIsCreatingPost ] = useState( false );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { resolveSelect } = useRegistry();\n\n\tasync function createPost( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( isCreatingPost ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsCreatingPost( true );\n\t\ttry {\n\t\t\tconst postTypeObject =\n\t\t\t\tawait resolveSelect( coreStore ).getPostType( postType );\n\t\t\tconst newPage = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\tstatus: 'draft',\n\t\t\t\t\ttitle,\n\t\t\t\t\tslug: title ?? undefined,\n\t\t\t\t\tcontent:\n\t\t\t\t\t\t!! postTypeObject.template &&\n\t\t\t\t\t\tpostTypeObject.template.length\n\t\t\t\t\t\t\t? serialize(\n\t\t\t\t\t\t\t\t\tsynchronizeBlocksWithTemplate(\n\t\t\t\t\t\t\t\t\t\t[],\n\t\t\t\t\t\t\t\t\t\tpostTypeObject.template\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\tonSave( newPage );\n\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\tdecodeEntities( newPage.title?.rendered || title ) ||\n\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar' }\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while creating the item.' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} finally {\n\t\t\tsetIsCreatingPost( false );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\t// translators: %s: post type singular_name label e.g: \"Page\".\n\t\t\t\tsprintf( __( 'Draft new: %s' ), labels?.singular_name )\n\t\t\t}\n\t\t\tonRequestClose={ onClose }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form onSubmit={ createPost }>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\
|
|
5
|
-
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB;AAAA,OACM;AACP,SAAS,IAAI,eAAe;AAC5B,SAAS,aAAa,aAAa,iBAAiB;AACpD,SAAS,gBAAgB;AACzB,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,oBAAoB;AACtC,SAAS,sBAAsB;AAC/B,SAAS,WAAW,qCAAqC;AAmFpD,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tTextControl,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch, useRegistry, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { serialize, synchronizeBlocksWithTemplate } from '@wordpress/blocks';\n\nexport default function AddNewPostModal( { postType, onSave, onClose } ) {\n\tconst labels = useSelect(\n\t\t( select ) => select( coreStore ).getPostType( postType )?.labels,\n\t\t[ postType ]\n\t);\n\tconst [ isCreatingPost, setIsCreatingPost ] = useState( false );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { resolveSelect } = useRegistry();\n\n\tasync function createPost( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( isCreatingPost ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsCreatingPost( true );\n\t\ttry {\n\t\t\tconst postTypeObject =\n\t\t\t\tawait resolveSelect( coreStore ).getPostType( postType );\n\t\t\tconst newPage = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\tstatus: 'draft',\n\t\t\t\t\ttitle,\n\t\t\t\t\tslug: title ?? undefined,\n\t\t\t\t\tcontent:\n\t\t\t\t\t\t!! postTypeObject.template &&\n\t\t\t\t\t\tpostTypeObject.template.length\n\t\t\t\t\t\t\t? serialize(\n\t\t\t\t\t\t\t\t\tsynchronizeBlocksWithTemplate(\n\t\t\t\t\t\t\t\t\t\t[],\n\t\t\t\t\t\t\t\t\t\tpostTypeObject.template\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\tonSave( newPage );\n\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\tdecodeEntities( newPage.title?.rendered || title ) ||\n\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar' }\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while creating the item.' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} finally {\n\t\t\tsetIsCreatingPost( false );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\t// translators: %s: post type singular_name label e.g: \"Page\".\n\t\t\t\tsprintf( __( 'Draft new: %s' ), labels?.singular_name )\n\t\t\t}\n\t\t\tonRequestClose={ onClose }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form onSubmit={ createPost }>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tlabel={ __( 'Title' ) }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\tplaceholder={ __( 'No title' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack spacing={ 2 } justify=\"end\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tisBusy={ isCreatingPost }\n\t\t\t\t\t\t\taria-disabled={ isCreatingPost }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create draft' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB;AAAA,OACM;AACP,SAAS,IAAI,eAAe;AAC5B,SAAS,aAAa,aAAa,iBAAiB;AACpD,SAAS,gBAAgB;AACzB,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,oBAAoB;AACtC,SAAS,sBAAsB;AAC/B,SAAS,WAAW,qCAAqC;AAmFpD,cAMA,YANA;AAjFU,SAAR,gBAAkC,EAAE,UAAU,QAAQ,QAAQ,GAAI;AACxE,QAAM,SAAS;AAAA,IACd,CAAE,WAAY,OAAQ,SAAU,EAAE,YAAa,QAAS,GAAG;AAAA,IAC3D,CAAE,QAAS;AAAA,EACZ;AACA,QAAM,CAAE,gBAAgB,iBAAkB,IAAI,SAAU,KAAM;AAC9D,QAAM,CAAE,OAAO,QAAS,IAAI,SAAU,EAAG;AAEzC,QAAM,EAAE,iBAAiB,IAAI,YAAa,SAAU;AACpD,QAAM,EAAE,mBAAmB,oBAAoB,IAC9C,YAAa,YAAa;AAC3B,QAAM,EAAE,cAAc,IAAI,YAAY;AAEtC,iBAAe,WAAY,OAAQ;AAClC,UAAM,eAAe;AAErB,QAAK,gBAAiB;AACrB;AAAA,IACD;AACA,sBAAmB,IAAK;AACxB,QAAI;AACH,YAAM,iBACL,MAAM,cAAe,SAAU,EAAE,YAAa,QAAS;AACxD,YAAM,UAAU,MAAM;AAAA,QACrB;AAAA,QACA;AAAA,QACA;AAAA,UACC,QAAQ;AAAA,UACR;AAAA,UACA,MAAM,SAAS;AAAA,UACf,SACC,CAAC,CAAE,eAAe,YAClB,eAAe,SAAS,SACrB;AAAA,YACA;AAAA,cACC,CAAC;AAAA,cACD,eAAe;AAAA,YAChB;AAAA,UACA,IACA;AAAA,QACL;AAAA,QACA,EAAE,cAAc,KAAK;AAAA,MACtB;AAEA,aAAQ,OAAQ;AAEhB;AAAA,QACC;AAAA;AAAA,UAEC,GAAI,4BAA6B;AAAA,UACjC,eAAgB,QAAQ,OAAO,YAAY,KAAM,KAChD,GAAI,YAAa;AAAA,QACnB;AAAA,QACA,EAAE,MAAM,WAAW;AAAA,MACpB;AAAA,IACD,SAAU,OAAQ;AACjB,YAAM,eACL,MAAM,WAAW,MAAM,SAAS,kBAC7B,MAAM,UACN,GAAI,4CAA6C;AAErD,wBAAmB,cAAc;AAAA,QAChC,MAAM;AAAA,MACP,CAAE;AAAA,IACH,UAAE;AACD,wBAAmB,KAAM;AAAA,IAC1B;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA;AAAA,QAEC,QAAS,GAAI,eAAgB,GAAG,QAAQ,aAAc;AAAA;AAAA,MAEvD,gBAAiB;AAAA,MACjB,cAAa;AAAA,MACb,MAAK;AAAA,MAEL,8BAAC,UAAK,UAAW,YAChB,+BAAC,UAAO,SAAU,GACjB;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ,GAAI,OAAQ;AAAA,YACpB,UAAW;AAAA,YACX,aAAc,GAAI,UAAW;AAAA,YAC7B,OAAQ;AAAA;AAAA,QACT;AAAA,QACA,qBAAC,UAAO,SAAU,GAAI,SAAQ,OAC7B;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,SAAQ;AAAA,cACR,SAAU;AAAA,cAER,aAAI,QAAS;AAAA;AAAA,UAChB;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,QAAS;AAAA,cACT,iBAAgB;AAAA,cAEd,aAAI,cAAe;AAAA;AAAA,UACtB;AAAA,WACD;AAAA,SACD,GACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build-module/components/add-new-template/add-custom-generic-template-modal-content.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/add-new-template/add-custom-generic-template-modal-content.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport { paramCase as kebabCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\nfunction AddCustomGenericTemplateModalContent( { createTemplate, onBack } ) {\n\tconst [ title, setTitle ] = useState( '' );\n\tconst defaultTitle = __( 'Custom Template' );\n\tconst [ isBusy, setIsBusy ] = useState( false );\n\tconst inputRef = useRef();\n\n\t// Set focus to the name input when the component mounts\n\tuseEffect( () => {\n\t\tif ( inputRef.current ) {\n\t\t\tinputRef.current.focus();\n\t\t}\n\t}, [] );\n\n\tasync function onCreateTemplate( event ) {\n\t\tevent.preventDefault();\n\t\tif ( isBusy ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsBusy( true );\n\t\ttry {\n\t\t\tawait createTemplate(\n\t\t\t\t{\n\t\t\t\t\tslug:\n\t\t\t\t\t\tkebabCase( title || defaultTitle ) ||\n\t\t\t\t\t\t'wp-custom-template',\n\t\t\t\t\ttitle: title || defaultTitle,\n\t\t\t\t},\n\t\t\t\tfalse\n\t\t\t);\n\t\t} finally {\n\t\t\tsetIsBusy( false );\n\t\t}\n\t}\n\treturn (\n\t\t<form onSubmit={ onCreateTemplate }>\n\t\t\t<VStack spacing={ 6 }>\n\t\t\t\t<TextControl\n\t\t\t\t\
|
|
5
|
-
"mappings": ";AAGA,SAAS,aAAa,iBAAiB;AAKvC,SAAS,UAAU,WAAW,cAAc;AAC5C,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,OAClB;AAsCH,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { paramCase as kebabCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\nfunction AddCustomGenericTemplateModalContent( { createTemplate, onBack } ) {\n\tconst [ title, setTitle ] = useState( '' );\n\tconst defaultTitle = __( 'Custom Template' );\n\tconst [ isBusy, setIsBusy ] = useState( false );\n\tconst inputRef = useRef();\n\n\t// Set focus to the name input when the component mounts\n\tuseEffect( () => {\n\t\tif ( inputRef.current ) {\n\t\t\tinputRef.current.focus();\n\t\t}\n\t}, [] );\n\n\tasync function onCreateTemplate( event ) {\n\t\tevent.preventDefault();\n\t\tif ( isBusy ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsBusy( true );\n\t\ttry {\n\t\t\tawait createTemplate(\n\t\t\t\t{\n\t\t\t\t\tslug:\n\t\t\t\t\t\tkebabCase( title || defaultTitle ) ||\n\t\t\t\t\t\t'wp-custom-template',\n\t\t\t\t\ttitle: title || defaultTitle,\n\t\t\t\t},\n\t\t\t\tfalse\n\t\t\t);\n\t\t} finally {\n\t\t\tsetIsBusy( false );\n\t\t}\n\t}\n\treturn (\n\t\t<form onSubmit={ onCreateTemplate }>\n\t\t\t<VStack spacing={ 6 }>\n\t\t\t\t<TextControl\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\tplaceholder={ defaultTitle }\n\t\t\t\t\tdisabled={ isBusy }\n\t\t\t\t\tref={ inputRef }\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t// eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts\n\t\t\t\t\t\t'Describe the template, e.g. \"Post with sidebar\". A custom template can be manually applied to any post or page.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HStack\n\t\t\t\t\tclassName=\"edit-site-custom-generic-template__modal-actions\"\n\t\t\t\t\tjustify=\"right\"\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ onBack }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\tisBusy={ isBusy }\n\t\t\t\t\t\taria-disabled={ isBusy }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n\nexport default AddCustomGenericTemplateModalContent;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,aAAa,iBAAiB;AAKvC,SAAS,UAAU,WAAW,cAAc;AAC5C,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,OAClB;AAsCH,cAYA,YAZA;AApCJ,SAAS,qCAAsC,EAAE,gBAAgB,OAAO,GAAI;AAC3E,QAAM,CAAE,OAAO,QAAS,IAAI,SAAU,EAAG;AACzC,QAAM,eAAe,GAAI,iBAAkB;AAC3C,QAAM,CAAE,QAAQ,SAAU,IAAI,SAAU,KAAM;AAC9C,QAAM,WAAW,OAAO;AAGxB,YAAW,MAAM;AAChB,QAAK,SAAS,SAAU;AACvB,eAAS,QAAQ,MAAM;AAAA,IACxB;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,iBAAe,iBAAkB,OAAQ;AACxC,UAAM,eAAe;AACrB,QAAK,QAAS;AACb;AAAA,IACD;AACA,cAAW,IAAK;AAChB,QAAI;AACH,YAAM;AAAA,QACL;AAAA,UACC,MACC,UAAW,SAAS,YAAa,KACjC;AAAA,UACD,OAAO,SAAS;AAAA,QACjB;AAAA,QACA;AAAA,MACD;AAAA,IACD,UAAE;AACD,gBAAW,KAAM;AAAA,IAClB;AAAA,EACD;AACA,SACC,oBAAC,UAAK,UAAW,kBAChB,+BAAC,UAAO,SAAU,GACjB;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,GAAI,MAAO;AAAA,QACnB,OAAQ;AAAA,QACR,UAAW;AAAA,QACX,aAAc;AAAA,QACd,UAAW;AAAA,QACX,KAAM;AAAA,QACN,MAAO;AAAA;AAAA,UAEN;AAAA,QACD;AAAA;AAAA,IACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,SAAQ;AAAA,QAER;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,SAAQ;AAAA,cACR,SAAU;AAAA,cAER,aAAI,MAAO;AAAA;AAAA,UACd;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,SAAQ;AAAA,cACR,MAAK;AAAA,cACL;AAAA,cACA,iBAAgB;AAAA,cAEd,aAAI,QAAS;AAAA;AAAA,UAChB;AAAA;AAAA;AAAA,IACD;AAAA,KACD,GACD;AAEF;AAEA,IAAO,oDAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/add-new-template-legacy/add-custom-generic-template-modal-content.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport { paramCase as kebabCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\nfunction AddCustomGenericTemplateModalContent( { createTemplate, onBack } ) {\n\tconst [ title, setTitle ] = useState( '' );\n\tconst defaultTitle = __( 'Custom Template' );\n\tconst [ isBusy, setIsBusy ] = useState( false );\n\tconst inputRef = useRef();\n\n\t// Set focus to the name input when the component mounts\n\tuseEffect( () => {\n\t\tif ( inputRef.current ) {\n\t\t\tinputRef.current.focus();\n\t\t}\n\t}, [] );\n\n\tasync function onCreateTemplate( event ) {\n\t\tevent.preventDefault();\n\t\tif ( isBusy ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsBusy( true );\n\t\ttry {\n\t\t\tawait createTemplate(\n\t\t\t\t{\n\t\t\t\t\tslug:\n\t\t\t\t\t\tkebabCase( title || defaultTitle ) ||\n\t\t\t\t\t\t'wp-custom-template',\n\t\t\t\t\ttitle: title || defaultTitle,\n\t\t\t\t},\n\t\t\t\tfalse\n\t\t\t);\n\t\t} finally {\n\t\t\tsetIsBusy( false );\n\t\t}\n\t}\n\treturn (\n\t\t<form onSubmit={ onCreateTemplate }>\n\t\t\t<VStack spacing={ 6 }>\n\t\t\t\t<TextControl\n\t\t\t\t\
|
|
5
|
-
"mappings": ";AAGA,SAAS,aAAa,iBAAiB;AAKvC,SAAS,UAAU,WAAW,cAAc;AAC5C,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,OAClB;AAsCH,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { paramCase as kebabCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\nfunction AddCustomGenericTemplateModalContent( { createTemplate, onBack } ) {\n\tconst [ title, setTitle ] = useState( '' );\n\tconst defaultTitle = __( 'Custom Template' );\n\tconst [ isBusy, setIsBusy ] = useState( false );\n\tconst inputRef = useRef();\n\n\t// Set focus to the name input when the component mounts\n\tuseEffect( () => {\n\t\tif ( inputRef.current ) {\n\t\t\tinputRef.current.focus();\n\t\t}\n\t}, [] );\n\n\tasync function onCreateTemplate( event ) {\n\t\tevent.preventDefault();\n\t\tif ( isBusy ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsBusy( true );\n\t\ttry {\n\t\t\tawait createTemplate(\n\t\t\t\t{\n\t\t\t\t\tslug:\n\t\t\t\t\t\tkebabCase( title || defaultTitle ) ||\n\t\t\t\t\t\t'wp-custom-template',\n\t\t\t\t\ttitle: title || defaultTitle,\n\t\t\t\t},\n\t\t\t\tfalse\n\t\t\t);\n\t\t} finally {\n\t\t\tsetIsBusy( false );\n\t\t}\n\t}\n\treturn (\n\t\t<form onSubmit={ onCreateTemplate }>\n\t\t\t<VStack spacing={ 6 }>\n\t\t\t\t<TextControl\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\tplaceholder={ defaultTitle }\n\t\t\t\t\tdisabled={ isBusy }\n\t\t\t\t\tref={ inputRef }\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t// eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts\n\t\t\t\t\t\t'Describe the template, e.g. \"Post with sidebar\". A custom template can be manually applied to any post or page.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HStack\n\t\t\t\t\tclassName=\"edit-site-custom-generic-template__modal-actions\"\n\t\t\t\t\tjustify=\"right\"\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ onBack }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\tisBusy={ isBusy }\n\t\t\t\t\t\taria-disabled={ isBusy }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n\nexport default AddCustomGenericTemplateModalContent;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,aAAa,iBAAiB;AAKvC,SAAS,UAAU,WAAW,cAAc;AAC5C,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,OAClB;AAsCH,cAYA,YAZA;AApCJ,SAAS,qCAAsC,EAAE,gBAAgB,OAAO,GAAI;AAC3E,QAAM,CAAE,OAAO,QAAS,IAAI,SAAU,EAAG;AACzC,QAAM,eAAe,GAAI,iBAAkB;AAC3C,QAAM,CAAE,QAAQ,SAAU,IAAI,SAAU,KAAM;AAC9C,QAAM,WAAW,OAAO;AAGxB,YAAW,MAAM;AAChB,QAAK,SAAS,SAAU;AACvB,eAAS,QAAQ,MAAM;AAAA,IACxB;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,iBAAe,iBAAkB,OAAQ;AACxC,UAAM,eAAe;AACrB,QAAK,QAAS;AACb;AAAA,IACD;AACA,cAAW,IAAK;AAChB,QAAI;AACH,YAAM;AAAA,QACL;AAAA,UACC,MACC,UAAW,SAAS,YAAa,KACjC;AAAA,UACD,OAAO,SAAS;AAAA,QACjB;AAAA,QACA;AAAA,MACD;AAAA,IACD,UAAE;AACD,gBAAW,KAAM;AAAA,IAClB;AAAA,EACD;AACA,SACC,oBAAC,UAAK,UAAW,kBAChB,+BAAC,UAAO,SAAU,GACjB;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,GAAI,MAAO;AAAA,QACnB,OAAQ;AAAA,QACR,UAAW;AAAA,QACX,aAAc;AAAA,QACd,UAAW;AAAA,QACX,KAAM;AAAA,QACN,MAAO;AAAA;AAAA,UAEN;AAAA,QACD;AAAA;AAAA,IACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,SAAQ;AAAA,QAER;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,SAAQ;AAAA,cACR,SAAU;AAAA,cAER,aAAI,MAAO;AAAA;AAAA,UACd;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,SAAQ;AAAA,cACR,MAAK;AAAA,cACL;AAAA,cACA,iBAAgB;AAAA,cAEd,aAAI,QAAS;AAAA;AAAA,UAChB;AAAA;AAAA;AAAA,IACD;AAAA,KACD,GACD;AAEF;AAEA,IAAO,oDAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -45,7 +45,7 @@ function useEditorTitle(postType, postId) {
|
|
|
45
45
|
if (isLoaded) {
|
|
46
46
|
editorTitle = sprintf(
|
|
47
47
|
// translators: A breadcrumb trail for the Admin document title. 1: title of template being edited, 2: type of template (Template or Template Part).
|
|
48
|
-
_x("%1$s
|
|
48
|
+
_x("%1$s ‹ %2$s", "breadcrumb trail"),
|
|
49
49
|
decodeEntities(title),
|
|
50
50
|
POST_TYPE_LABELS[postType] ?? POST_TYPE_LABELS[TEMPLATE_POST_TYPE]
|
|
51
51
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/editor/use-editor-title.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport useTitle from '../routes/use-title';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { getTemplateInfo } = unlock( editorPrivateApis );\n\nfunction useEditorTitle( postType, postId ) {\n\tconst { title, isLoaded } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\tgetCurrentTheme,\n\t\t\t\thasFinishedResolution,\n\t\t\t} = select( coreStore );\n\n\t\t\tif ( ! postId ) {\n\t\t\t\treturn { isLoaded: false };\n\t\t\t}\n\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\n\t\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\t\tgetCurrentTheme() ?? {};\n\n\t\t\tconst templateInfo = getTemplateInfo( {\n\t\t\t\ttemplate: _record,\n\t\t\t\ttemplateTypes,\n\t\t\t} );\n\n\t\t\tconst _isLoaded = hasFinishedResolution( 'getEditedEntityRecord', [\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t] );\n\n\t\t\treturn {\n\t\t\t\ttitle: templateInfo.title,\n\t\t\t\tisLoaded: _isLoaded,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tlet editorTitle;\n\tif ( isLoaded ) {\n\t\teditorTitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. 1: title of template being edited, 2: type of template (Template or Template Part).\n\t\t\t_x( '%1$s
|
|
5
|
-
"mappings": ";AAGA,SAAS,IAAI,eAAe;AAC5B,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AACnC,SAAS,sBAAsB;AAC/B,SAAS,eAAe,yBAAyB;AAKjD,OAAO,cAAc;AACrB,SAAS,kBAAkB,0BAA0B;AACrD,SAAS,cAAc;AAEvB,IAAM,EAAE,gBAAgB,IAAI,OAAQ,iBAAkB;AAEtD,SAAS,eAAgB,UAAU,QAAS;AAC3C,QAAM,EAAE,OAAO,SAAS,IAAI;AAAA,IAC3B,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,SAAU;AAEtB,UAAK,CAAE,QAAS;AACf,eAAO,EAAE,UAAU,MAAM;AAAA,MAC1B;AAEA,YAAM,UAAU;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAEA,YAAM,EAAE,wBAAwB,gBAAgB,CAAC,EAAE,IAClD,gBAAgB,KAAK,CAAC;AAEvB,YAAM,eAAe,gBAAiB;AAAA,QACrC,UAAU;AAAA,QACV;AAAA,MACD,CAAE;AAEF,YAAM,YAAY,sBAAuB,yBAAyB;AAAA,QACjE;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAE;AAEF,aAAO;AAAA,QACN,OAAO,aAAa;AAAA,QACpB,UAAU;AAAA,MACX;AAAA,IACD;AAAA,IACA,CAAE,UAAU,MAAO;AAAA,EACpB;AAEA,MAAI;AACJ,MAAK,UAAW;AACf,kBAAc;AAAA;AAAA,MAEb,GAAI,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport useTitle from '../routes/use-title';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { getTemplateInfo } = unlock( editorPrivateApis );\n\nfunction useEditorTitle( postType, postId ) {\n\tconst { title, isLoaded } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\tgetCurrentTheme,\n\t\t\t\thasFinishedResolution,\n\t\t\t} = select( coreStore );\n\n\t\t\tif ( ! postId ) {\n\t\t\t\treturn { isLoaded: false };\n\t\t\t}\n\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\n\t\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\t\tgetCurrentTheme() ?? {};\n\n\t\t\tconst templateInfo = getTemplateInfo( {\n\t\t\t\ttemplate: _record,\n\t\t\t\ttemplateTypes,\n\t\t\t} );\n\n\t\t\tconst _isLoaded = hasFinishedResolution( 'getEditedEntityRecord', [\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t] );\n\n\t\t\treturn {\n\t\t\t\ttitle: templateInfo.title,\n\t\t\t\tisLoaded: _isLoaded,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tlet editorTitle;\n\tif ( isLoaded ) {\n\t\teditorTitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. 1: title of template being edited, 2: type of template (Template or Template Part).\n\t\t\t_x( '%1$s ‹ %2$s', 'breadcrumb trail' ),\n\t\t\tdecodeEntities( title ),\n\t\t\tPOST_TYPE_LABELS[ postType ] ??\n\t\t\t\tPOST_TYPE_LABELS[ TEMPLATE_POST_TYPE ]\n\t\t);\n\t}\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URLQueryController> from double-announcing.\n\tuseTitle( isLoaded && editorTitle );\n}\n\nexport default useEditorTitle;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,IAAI,eAAe;AAC5B,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AACnC,SAAS,sBAAsB;AAC/B,SAAS,eAAe,yBAAyB;AAKjD,OAAO,cAAc;AACrB,SAAS,kBAAkB,0BAA0B;AACrD,SAAS,cAAc;AAEvB,IAAM,EAAE,gBAAgB,IAAI,OAAQ,iBAAkB;AAEtD,SAAS,eAAgB,UAAU,QAAS;AAC3C,QAAM,EAAE,OAAO,SAAS,IAAI;AAAA,IAC3B,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,SAAU;AAEtB,UAAK,CAAE,QAAS;AACf,eAAO,EAAE,UAAU,MAAM;AAAA,MAC1B;AAEA,YAAM,UAAU;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAEA,YAAM,EAAE,wBAAwB,gBAAgB,CAAC,EAAE,IAClD,gBAAgB,KAAK,CAAC;AAEvB,YAAM,eAAe,gBAAiB;AAAA,QACrC,UAAU;AAAA,QACV;AAAA,MACD,CAAE;AAEF,YAAM,YAAY,sBAAuB,yBAAyB;AAAA,QACjE;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAE;AAEF,aAAO;AAAA,QACN,OAAO,aAAa;AAAA,QACpB,UAAU;AAAA,MACX;AAAA,IACD;AAAA,IACA,CAAE,UAAU,MAAO;AAAA,EACpB;AAEA,MAAI;AACJ,MAAK,UAAW;AACf,kBAAc;AAAA;AAAA,MAEb,GAAI,eAAe,kBAAmB;AAAA,MACtC,eAAgB,KAAM;AAAA,MACtB,iBAAkB,QAAS,KAC1B,iBAAkB,kBAAmB;AAAA,IACvC;AAAA,EACD;AAIA,WAAU,YAAY,WAAY;AACnC;AAEA,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
privateApis as editorPrivateApis
|
|
22
22
|
} from "@wordpress/editor";
|
|
23
23
|
import { privateApis as routerPrivateApis } from "@wordpress/router";
|
|
24
|
-
import {
|
|
24
|
+
import { ThemeProvider } from "@wordpress/theme";
|
|
25
25
|
import { PluginArea } from "@wordpress/plugins";
|
|
26
26
|
import { SnackbarNotices, store as noticesStore } from "@wordpress/notices";
|
|
27
27
|
import { useDispatch, useSelect } from "@wordpress/data";
|
|
@@ -39,7 +39,6 @@ import SavePanel from "../save-panel/index.mjs";
|
|
|
39
39
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
40
40
|
var { useLocation } = unlock(routerPrivateApis);
|
|
41
41
|
var { useStyle, UploadProgressSnackbar } = unlock(editorPrivateApis);
|
|
42
|
-
var { ThemeProvider } = unlock(themePrivateApis);
|
|
43
42
|
var ANIMATION_DURATION = 0.3;
|
|
44
43
|
var CONTENT_COLOR = { background: "#ffffff" };
|
|
45
44
|
function Layout() {
|
|
@@ -145,13 +144,33 @@ function Layout() {
|
|
|
145
144
|
isTransparent: isResizableFrameOversized
|
|
146
145
|
}
|
|
147
146
|
),
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
areas.mobileContent ? (
|
|
148
|
+
/*
|
|
149
|
+
* ThemeProvider wraps SidebarContent (rather than
|
|
150
|
+
* just the content) so the scroll wrapper it renders
|
|
151
|
+
* inherits the content background tokens. See
|
|
152
|
+
* `.edit-site-sidebar__screen-wrapper` in style.scss.
|
|
153
|
+
*/
|
|
154
|
+
/* @__PURE__ */ jsx(
|
|
155
|
+
ThemeProvider,
|
|
156
|
+
{
|
|
157
|
+
color: CONTENT_COLOR,
|
|
158
|
+
children: /* @__PURE__ */ jsx(
|
|
159
|
+
SidebarContent,
|
|
160
|
+
{
|
|
161
|
+
routeKey,
|
|
162
|
+
children: /* @__PURE__ */ jsx("div", { className: "edit-site-layout__mobile-content", children: /* @__PURE__ */ jsx(ErrorBoundary, { children: areas.mobileContent }) })
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
) : /* @__PURE__ */ jsx(
|
|
168
|
+
SidebarContent,
|
|
150
169
|
{
|
|
151
|
-
|
|
152
|
-
children: /* @__PURE__ */ jsx(
|
|
170
|
+
routeKey,
|
|
171
|
+
children: /* @__PURE__ */ jsx(ErrorBoundary, { children: areas.mobileSidebar })
|
|
153
172
|
}
|
|
154
|
-
)
|
|
173
|
+
),
|
|
155
174
|
/* @__PURE__ */ jsx(SaveHub, {}),
|
|
156
175
|
/* @__PURE__ */ jsx(SavePanel, {})
|
|
157
176
|
] }) : /* @__PURE__ */ jsx(ThemeProvider, { color: CONTENT_COLOR, children: /* @__PURE__ */ jsx(ErrorBoundary, { children: areas.preview }) }) }) }),
|