@wordpress/edit-site 6.11.0 → 6.12.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/app/index.js +0 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +6 -8
- package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build/components/editor/index.js +9 -4
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-editor-title.js +29 -12
- package/build/components/editor/use-editor-title.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +24 -22
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +2 -3
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +42 -2
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +6 -8
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/layout/hooks.js +1 -10
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +1 -0
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/fields.js +3 -7
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-templates/fields.js +1 -2
- package/build/components/page-templates/fields.js.map +1 -1
- package/build/components/post-edit/index.js +14 -8
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-fields/index.js +3 -197
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-list/index.js +11 -1
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/sidebar/index.js +11 -3
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-global-styles-wrapper/index.js +129 -0
- package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-global-styles/index.js +14 -72
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +43 -42
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/site-editor-routes/styles-edit.js +6 -1
- package/build/components/site-editor-routes/styles-edit.js.map +1 -1
- package/build/components/site-editor-routes/styles-view.js +8 -2
- package/build/components/site-editor-routes/styles-view.js.map +1 -1
- package/build/components/site-hub/index.js +19 -6
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/constants.js +10 -3
- package/build/components/style-book/constants.js.map +1 -1
- package/build/components/style-book/examples.js +71 -1
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +70 -11
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +32 -32
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/welcome-guide/index.js +4 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +1 -9
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/template.js +1 -12
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +15 -15
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/posts.js +1 -0
- package/build/posts.js.map +1 -1
- package/build-module/components/app/index.js +0 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +6 -8
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build-module/components/editor/index.js +9 -4
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-editor-title.js +29 -12
- package/build-module/components/editor/use-editor-title.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +25 -23
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +2 -3
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +43 -3
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +6 -8
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/layout/hooks.js +1 -9
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +1 -0
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +4 -8
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-templates/fields.js +1 -2
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/post-edit/index.js +14 -8
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +7 -202
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-list/index.js +11 -1
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +11 -3
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-global-styles-wrapper/index.js +121 -0
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +15 -73
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +43 -43
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/site-editor-routes/styles-edit.js +6 -1
- package/build-module/components/site-editor-routes/styles-edit.js.map +1 -1
- package/build-module/components/site-editor-routes/styles-view.js +8 -2
- package/build-module/components/site-editor-routes/styles-view.js.map +1 -1
- package/build-module/components/site-hub/index.js +19 -6
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/constants.js +10 -3
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-module/components/style-book/examples.js +71 -1
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +71 -12
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +32 -32
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +4 -2
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +1 -9
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +1 -11
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +15 -15
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +1 -0
- package/build-module/posts.js.map +1 -1
- package/build-style/posts-rtl.css +54 -5
- package/build-style/posts.css +54 -5
- package/build-style/style-rtl.css +109 -28
- package/build-style/style.css +109 -28
- package/package.json +3 -4
- package/src/components/app/index.js +0 -2
- package/src/components/block-editor/use-editor-iframe-props.js +2 -3
- package/src/components/editor/index.js +16 -4
- package/src/components/editor/use-editor-title.js +37 -13
- package/src/components/editor-canvas-container/style.scss +0 -1
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +28 -31
- package/src/components/global-styles/screen-revisions/style.scss +11 -17
- package/src/components/global-styles/shadows-edit-panel.js +4 -2
- package/src/components/global-styles/ui.js +42 -2
- package/src/components/global-styles-renderer/index.js +4 -10
- package/src/components/layout/hooks.js +1 -7
- package/src/components/layout/index.js +6 -1
- package/src/components/page-patterns/fields.js +6 -12
- package/src/components/page-patterns/style.scss +0 -5
- package/src/components/page-templates/fields.js +2 -3
- package/src/components/post-edit/index.js +38 -30
- package/src/components/post-edit/style.scss +7 -0
- package/src/components/post-fields/index.js +19 -273
- package/src/components/post-list/index.js +9 -3
- package/src/components/post-list/style.scss +29 -3
- package/src/components/sidebar/index.js +23 -7
- package/src/components/sidebar-global-styles-wrapper/index.js +150 -0
- package/src/components/sidebar-global-styles-wrapper/style.scss +35 -0
- package/src/components/sidebar-navigation-item/style.scss +2 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +13 -88
- package/src/components/sidebar-navigation-screen-main/index.js +46 -45
- package/src/components/site-editor-routes/styles-edit.js +10 -1
- package/src/components/site-editor-routes/styles-view.js +11 -1
- package/src/components/site-hub/index.js +33 -16
- package/src/components/site-icon/style.scss +16 -0
- package/src/components/style-book/constants.ts +11 -3
- package/src/components/style-book/examples.tsx +105 -1
- package/src/components/style-book/index.js +86 -8
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +54 -64
- package/src/components/welcome-guide/index.js +3 -3
- package/src/components/welcome-guide/page.js +1 -7
- package/src/components/welcome-guide/template.js +1 -8
- package/src/hooks/commands/use-common-commands.js +253 -246
- package/src/index.js +1 -0
- package/src/posts.js +1 -0
- package/src/style.scss +2 -3
- package/build/components/async/index.js +0 -51
- package/build/components/async/index.js.map +0 -1
- package/build/components/use-edited-entity-record/index.js +0 -60
- package/build/components/use-edited-entity-record/index.js.map +0 -1
- package/build/hooks/commands/use-edit-mode-commands.js +0 -179
- package/build/hooks/commands/use-edit-mode-commands.js.map +0 -1
- package/build-module/components/async/index.js +0 -44
- package/build-module/components/async/index.js.map +0 -1
- package/build-module/components/use-edited-entity-record/index.js +0 -53
- package/build-module/components/use-edited-entity-record/index.js.map +0 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +0 -171
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +0 -1
- package/src/components/async/index.js +0 -43
- package/src/components/use-edited-entity-record/index.js +0 -58
- package/src/hooks/commands/use-edit-mode-commands.js +0 -168
|
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
exports.MainSidebarNavigationContent = MainSidebarNavigationContent;
|
|
7
8
|
exports.default = SidebarNavigationScreenMain;
|
|
8
9
|
var _components = require("@wordpress/components");
|
|
9
10
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -25,6 +26,47 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
25
26
|
* Internal dependencies
|
|
26
27
|
*/
|
|
27
28
|
|
|
29
|
+
function MainSidebarNavigationContent() {
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalItemGroup, {
|
|
31
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
32
|
+
uid: "navigation-navigation-item",
|
|
33
|
+
params: {
|
|
34
|
+
postType: _constants.NAVIGATION_POST_TYPE
|
|
35
|
+
},
|
|
36
|
+
withChevron: true,
|
|
37
|
+
icon: _icons.navigation,
|
|
38
|
+
children: (0, _i18n.__)('Navigation')
|
|
39
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenGlobalStyles.SidebarNavigationItemGlobalStyles, {
|
|
40
|
+
uid: "styles-navigation-item",
|
|
41
|
+
icon: _icons.styles,
|
|
42
|
+
children: (0, _i18n.__)('Styles')
|
|
43
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
44
|
+
uid: "page-navigation-item",
|
|
45
|
+
params: {
|
|
46
|
+
postType: 'page'
|
|
47
|
+
},
|
|
48
|
+
withChevron: true,
|
|
49
|
+
icon: _icons.page,
|
|
50
|
+
children: (0, _i18n.__)('Pages')
|
|
51
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
52
|
+
uid: "template-navigation-item",
|
|
53
|
+
params: {
|
|
54
|
+
postType: _constants.TEMPLATE_POST_TYPE
|
|
55
|
+
},
|
|
56
|
+
withChevron: true,
|
|
57
|
+
icon: _icons.layout,
|
|
58
|
+
children: (0, _i18n.__)('Templates')
|
|
59
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
60
|
+
uid: "patterns-navigation-item",
|
|
61
|
+
params: {
|
|
62
|
+
postType: _constants.PATTERN_TYPES.user
|
|
63
|
+
},
|
|
64
|
+
withChevron: true,
|
|
65
|
+
icon: _icons.symbol,
|
|
66
|
+
children: (0, _i18n.__)('Patterns')
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
28
70
|
function SidebarNavigationScreenMain() {
|
|
29
71
|
const {
|
|
30
72
|
setEditorCanvasContainerView
|
|
@@ -38,48 +80,7 @@ function SidebarNavigationScreenMain() {
|
|
|
38
80
|
isRoot: true,
|
|
39
81
|
title: (0, _i18n.__)('Design'),
|
|
40
82
|
description: (0, _i18n.__)('Customize the appearance of your website using the block editor.'),
|
|
41
|
-
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
42
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalItemGroup, {
|
|
43
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
44
|
-
uid: "navigation-navigation-item",
|
|
45
|
-
params: {
|
|
46
|
-
postType: _constants.NAVIGATION_POST_TYPE
|
|
47
|
-
},
|
|
48
|
-
withChevron: true,
|
|
49
|
-
icon: _icons.navigation,
|
|
50
|
-
children: (0, _i18n.__)('Navigation')
|
|
51
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenGlobalStyles.SidebarNavigationItemGlobalStyles, {
|
|
52
|
-
uid: "styles-navigation-item",
|
|
53
|
-
withChevron: true,
|
|
54
|
-
icon: _icons.styles,
|
|
55
|
-
children: (0, _i18n.__)('Styles')
|
|
56
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
57
|
-
uid: "page-navigation-item",
|
|
58
|
-
params: {
|
|
59
|
-
postType: 'page'
|
|
60
|
-
},
|
|
61
|
-
withChevron: true,
|
|
62
|
-
icon: _icons.page,
|
|
63
|
-
children: (0, _i18n.__)('Pages')
|
|
64
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
65
|
-
uid: "template-navigation-item",
|
|
66
|
-
params: {
|
|
67
|
-
postType: _constants.TEMPLATE_POST_TYPE
|
|
68
|
-
},
|
|
69
|
-
withChevron: true,
|
|
70
|
-
icon: _icons.layout,
|
|
71
|
-
children: (0, _i18n.__)('Templates')
|
|
72
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
73
|
-
uid: "patterns-navigation-item",
|
|
74
|
-
params: {
|
|
75
|
-
postType: _constants.PATTERN_TYPES.user
|
|
76
|
-
},
|
|
77
|
-
withChevron: true,
|
|
78
|
-
icon: _icons.symbol,
|
|
79
|
-
children: (0, _i18n.__)('Patterns')
|
|
80
|
-
})]
|
|
81
|
-
})
|
|
82
|
-
})
|
|
83
|
+
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(MainSidebarNavigationContent, {})
|
|
83
84
|
});
|
|
84
85
|
}
|
|
85
86
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_sidebarNavigationScreenGlobalStyles","_lockUnlock","_store","_constants","_jsxRuntime","
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_sidebarNavigationScreenGlobalStyles","_lockUnlock","_store","_constants","_jsxRuntime","MainSidebarNavigationContent","jsxs","__experimentalItemGroup","children","jsx","default","uid","params","postType","NAVIGATION_POST_TYPE","withChevron","icon","navigation","__","SidebarNavigationItemGlobalStyles","styles","page","TEMPLATE_POST_TYPE","layout","PATTERN_TYPES","user","symbol","SidebarNavigationScreenMain","setEditorCanvasContainerView","unlock","useDispatch","editSiteStore","useEffect","undefined","isRoot","title","description","content"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nexport function MainSidebarNavigationContent() {\n\treturn (\n\t\t<ItemGroup>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"navigation-navigation-item\"\n\t\t\t\tparams={ { postType: NAVIGATION_POST_TYPE } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ navigation }\n\t\t\t>\n\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItemGlobalStyles\n\t\t\t\tuid=\"styles-navigation-item\"\n\t\t\t\ticon={ styles }\n\t\t\t>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</SidebarNavigationItemGlobalStyles>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"page-navigation-item\"\n\t\t\t\tparams={ { postType: 'page' } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ page }\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=\"template-navigation-item\"\n\t\t\t\tparams={ { postType: TEMPLATE_POST_TYPE } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ layout }\n\t\t\t>\n\t\t\t\t{ __( 'Templates' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"patterns-navigation-item\"\n\t\t\t\tparams={ { postType: PATTERN_TYPES.user } }\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</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\t// Clear the editor canvas container view when accessing the main navigation screen.\n\tuseEffect( () => {\n\t\tsetEditorCanvasContainerView( undefined );\n\t}, [ setEditorCanvasContainerView ] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={ <MainSidebarNavigationContent /> }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,wBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,oCAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AAI+B,IAAAY,WAAA,GAAAZ,OAAA;AArB/B;AACA;AACA;;AAOA;AACA;AACA;;AAYO,SAASa,4BAA4BA,CAAA,EAAG;EAC9C,oBACC,IAAAD,WAAA,CAAAE,IAAA,EAACf,WAAA,CAAAgB,uBAAS;IAAAC,QAAA,gBACT,IAAAJ,WAAA,CAAAK,GAAA,EAACV,sBAAA,CAA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M,EAC9C,IAAAC,iBAAW,EAAEC,YAAc,CAC5B,CAAC;;EAED;EACA,IAAAC,kBAAS,EAAE,MAAM;IAChBJ,4BAA4B,CAAEK,SAAU,CAAC;EAC1C,CAAC,EAAE,CAAEL,4BAA4B,CAAG,CAAC;EAErC,oBACC,IAAAxB,WAAA,CAAAK,GAAA,EAACZ,wBAAA,CAAAa,OAAuB;IACvBwB,MAAM;IACNC,KAAK,EAAG,IAAAjB,QAAE,EAAE,QAAS,CAAG;IACxBkB,WAAW,EAAG,IAAAlB,QAAE,EACf,kEACD,CAAG;IACHmB,OAAO,eAAG,IAAAjC,WAAA,CAAAK,GAAA,EAACJ,4BAA4B,IAAE;EAAG,CAC5C,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.stylesEditRoute = void 0;
|
|
8
8
|
var _editor = _interopRequireDefault(require("../editor"));
|
|
9
9
|
var _sidebarNavigationScreenGlobalStyles = _interopRequireDefault(require("../sidebar-navigation-screen-global-styles"));
|
|
10
|
+
var _sidebarGlobalStylesWrapper = _interopRequireDefault(require("../sidebar-global-styles-wrapper"));
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
/**
|
|
12
13
|
* Internal dependencies
|
|
@@ -15,14 +16,18 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
15
16
|
const stylesEditRoute = exports.stylesEditRoute = {
|
|
16
17
|
name: 'styles-edit',
|
|
17
18
|
match: params => {
|
|
18
|
-
return params.path
|
|
19
|
+
return params.path && params.path.startsWith('/wp_global_styles') && params.canvas !== 'edit';
|
|
19
20
|
},
|
|
20
21
|
areas: {
|
|
22
|
+
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarGlobalStylesWrapper.default, {}),
|
|
21
23
|
sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenGlobalStyles.default, {
|
|
22
24
|
backPath: {}
|
|
23
25
|
}),
|
|
24
26
|
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
|
|
25
27
|
mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
|
|
28
|
+
},
|
|
29
|
+
widths: {
|
|
30
|
+
content: 380
|
|
26
31
|
}
|
|
27
32
|
};
|
|
28
33
|
//# sourceMappingURL=styles-edit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_editor","_interopRequireDefault","require","_sidebarNavigationScreenGlobalStyles","_jsxRuntime","stylesEditRoute","exports","name","match","params","path","canvas","areas","
|
|
1
|
+
{"version":3,"names":["_editor","_interopRequireDefault","require","_sidebarNavigationScreenGlobalStyles","_sidebarGlobalStylesWrapper","_jsxRuntime","stylesEditRoute","exports","name","match","params","path","startsWith","canvas","areas","content","jsx","default","sidebar","backPath","preview","mobile","widths"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/styles-edit.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport GlobalStylesUIWrapper from '../sidebar-global-styles-wrapper';\n\nexport const stylesEditRoute = {\n\tname: 'styles-edit',\n\tmatch: ( params ) => {\n\t\treturn (\n\t\t\tparams.path &&\n\t\t\tparams.path.startsWith( '/wp_global_styles' ) &&\n\t\t\tparams.canvas !== 'edit'\n\t\t);\n\t},\n\tareas: {\n\t\tcontent: <GlobalStylesUIWrapper />,\n\t\tsidebar: <SidebarNavigationScreenGlobalStyles backPath={ {} } />,\n\t\tpreview: <Editor />,\n\t\tmobile: <Editor />,\n\t},\n\twidths: {\n\t\tcontent: 380,\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,oCAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,2BAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAqE,IAAAG,WAAA,GAAAH,OAAA;AALrE;AACA;AACA;;AAKO,MAAMI,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG;EAC9BE,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAIC,MAAM,IAAM;IACpB,OACCA,MAAM,CAACC,IAAI,IACXD,MAAM,CAACC,IAAI,CAACC,UAAU,CAAE,mBAAoB,CAAC,IAC7CF,MAAM,CAACG,MAAM,KAAK,MAAM;EAE1B,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eAAE,IAAAV,WAAA,CAAAW,GAAA,EAACZ,2BAAA,CAAAa,OAAqB,IAAE,CAAC;IAClCC,OAAO,eAAE,IAAAb,WAAA,CAAAW,GAAA,EAACb,oCAAA,CAAAc,OAAmC;MAACE,QAAQ,EAAG,CAAC;IAAG,CAAE,CAAC;IAChEC,OAAO,eAAE,IAAAf,WAAA,CAAAW,GAAA,EAAChB,OAAA,CAAAiB,OAAM,IAAE,CAAC;IACnBI,MAAM,eAAE,IAAAhB,WAAA,CAAAW,GAAA,EAAChB,OAAA,CAAAiB,OAAM,IAAE;EAClB,CAAC;EACDK,MAAM,EAAE;IACPP,OAAO,EAAE;EACV;AACD,CAAC","ignoreList":[]}
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.stylesViewRoute = void 0;
|
|
8
8
|
var _editor = _interopRequireDefault(require("../editor"));
|
|
9
9
|
var _sidebarNavigationScreenGlobalStyles = _interopRequireDefault(require("../sidebar-navigation-screen-global-styles"));
|
|
10
|
+
var _sidebarGlobalStylesWrapper = _interopRequireDefault(require("../sidebar-global-styles-wrapper"));
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
/**
|
|
12
13
|
* Internal dependencies
|
|
@@ -15,13 +16,18 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
15
16
|
const stylesViewRoute = exports.stylesViewRoute = {
|
|
16
17
|
name: 'styles-view',
|
|
17
18
|
match: params => {
|
|
18
|
-
return params.path
|
|
19
|
+
return params.path && params.path.startsWith('/wp_global_styles') && params.canvas !== 'edit';
|
|
19
20
|
},
|
|
20
21
|
areas: {
|
|
22
|
+
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarGlobalStylesWrapper.default, {}),
|
|
21
23
|
sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenGlobalStyles.default, {
|
|
22
24
|
backPath: {}
|
|
23
25
|
}),
|
|
24
|
-
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {})
|
|
26
|
+
preview: /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {}),
|
|
27
|
+
mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarGlobalStylesWrapper.default, {})
|
|
28
|
+
},
|
|
29
|
+
widths: {
|
|
30
|
+
content: 380
|
|
25
31
|
}
|
|
26
32
|
};
|
|
27
33
|
//# sourceMappingURL=styles-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_editor","_interopRequireDefault","require","_sidebarNavigationScreenGlobalStyles","_jsxRuntime","stylesViewRoute","exports","name","match","params","path","canvas","areas","
|
|
1
|
+
{"version":3,"names":["_editor","_interopRequireDefault","require","_sidebarNavigationScreenGlobalStyles","_sidebarGlobalStylesWrapper","_jsxRuntime","stylesViewRoute","exports","name","match","params","path","startsWith","canvas","areas","content","jsx","default","sidebar","backPath","preview","mobile","widths"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/styles-view.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport GlobalStylesUIWrapper from '../sidebar-global-styles-wrapper';\n\nexport const stylesViewRoute = {\n\tname: 'styles-view',\n\tmatch: ( params ) => {\n\t\treturn (\n\t\t\tparams.path &&\n\t\t\tparams.path.startsWith( '/wp_global_styles' ) &&\n\t\t\tparams.canvas !== 'edit'\n\t\t);\n\t},\n\tareas: {\n\t\tcontent: <GlobalStylesUIWrapper />,\n\t\tsidebar: <SidebarNavigationScreenGlobalStyles backPath={ {} } />,\n\t\tpreview: <Editor />,\n\t\tmobile: <GlobalStylesUIWrapper />,\n\t},\n\twidths: {\n\t\tcontent: 380,\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,oCAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,2BAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAqE,IAAAG,WAAA,GAAAH,OAAA;AALrE;AACA;AACA;;AAKO,MAAMI,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG;EAC9BE,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAIC,MAAM,IAAM;IACpB,OACCA,MAAM,CAACC,IAAI,IACXD,MAAM,CAACC,IAAI,CAACC,UAAU,CAAE,mBAAoB,CAAC,IAC7CF,MAAM,CAACG,MAAM,KAAK,MAAM;EAE1B,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eAAE,IAAAV,WAAA,CAAAW,GAAA,EAACZ,2BAAA,CAAAa,OAAqB,IAAE,CAAC;IAClCC,OAAO,eAAE,IAAAb,WAAA,CAAAW,GAAA,EAACb,oCAAA,CAAAc,OAAmC;MAACE,QAAQ,EAAG,CAAC;IAAG,CAAE,CAAC;IAChEC,OAAO,eAAE,IAAAf,WAAA,CAAAW,GAAA,EAAChB,OAAA,CAAAiB,OAAM,IAAE,CAAC;IACnBI,MAAM,eAAE,IAAAhB,WAAA,CAAAW,GAAA,EAACZ,2BAAA,CAAAa,OAAqB,IAAE;EACjC,CAAC;EACDK,MAAM,EAAE;IACPP,OAAO,EAAE;EACV;AACD,CAAC","ignoreList":[]}
|
|
@@ -125,14 +125,22 @@ const SiteHubMobile = exports.SiteHubMobile = (0, _element.memo)((0, _element.fo
|
|
|
125
125
|
navigate
|
|
126
126
|
} = (0, _element.useContext)(_sidebar.SidebarNavigationContext);
|
|
127
127
|
const {
|
|
128
|
+
dashboardLink,
|
|
129
|
+
isBlockTheme,
|
|
128
130
|
homeUrl,
|
|
129
131
|
siteTitle
|
|
130
132
|
} = (0, _data.useSelect)(select => {
|
|
131
133
|
const {
|
|
132
|
-
|
|
134
|
+
getSettings
|
|
135
|
+
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
136
|
+
const {
|
|
137
|
+
getEntityRecord,
|
|
138
|
+
getCurrentTheme
|
|
133
139
|
} = select(_coreData.store);
|
|
134
140
|
const _site = getEntityRecord('root', 'site');
|
|
135
141
|
return {
|
|
142
|
+
dashboardLink: getSettings().__experimentalDashboardLink || 'index.php',
|
|
143
|
+
isBlockTheme: getCurrentTheme()?.is_block_theme,
|
|
136
144
|
homeUrl: getEntityRecord('root', '__unstableBase')?.home,
|
|
137
145
|
siteTitle: !_site?.title && !!_site?.url ? (0, _url.filterURLForDisplay)(_site?.url) : _site?.title
|
|
138
146
|
};
|
|
@@ -152,16 +160,21 @@ const SiteHubMobile = exports.SiteHubMobile = (0, _element.memo)((0, _element.fo
|
|
|
152
160
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
153
161
|
__next40pxDefaultSize: true,
|
|
154
162
|
ref: ref,
|
|
155
|
-
label: (0, _i18n.__)('Go to Site Editor'),
|
|
156
163
|
className: "edit-site-layout__view-mode-toggle",
|
|
157
164
|
style: {
|
|
158
165
|
transform: 'scale(0.5)',
|
|
159
166
|
borderRadius: 4
|
|
160
167
|
},
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
168
|
+
...(!isBlockTheme ? {
|
|
169
|
+
href: dashboardLink,
|
|
170
|
+
label: (0, _i18n.__)('Go to the Dashboard')
|
|
171
|
+
} : {
|
|
172
|
+
onClick: () => {
|
|
173
|
+
history.push({});
|
|
174
|
+
navigate('back');
|
|
175
|
+
},
|
|
176
|
+
label: (0, _i18n.__)('Go to Site Editor')
|
|
177
|
+
}),
|
|
165
178
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_siteIcon.default, {
|
|
166
179
|
className: "edit-site-layout__view-mode-toggle-icon"
|
|
167
180
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_i18n","_coreData","_htmlEntities","_element","_icons","_commands","_keycodes","_url","_router","_store","_siteIcon","_lockUnlock","_sidebar","_jsxRuntime","useHistory","unlock","routerPrivateApis","SiteHub","memo","forwardRef","isTransparent","ref","dashboardLink","homeUrl","siteTitle","useSelect","select","getSettings","editSiteStore","getEntityRecord","coreStore","_site","__experimentalDashboardLink","home","title","url","filterURLForDisplay","open","openCommandCenter","useDispatch","commandsStore","jsx","className","children","jsxs","__experimentalHStack","justify","spacing","clsx","Button","__next40pxDefaultSize","href","label","__","style","transform","borderRadius","default","variant","target","decodeEntities","VisuallyHidden","as","expanded","size","icon","search","onClick","shortcut","displayShortcut","primary","_default","exports","SiteHubMobile","history","navigate","useContext","SidebarNavigationContext","push"],"sources":["@wordpress/edit-site/src/components/site-hub/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { memo, forwardRef, useContext } from '@wordpress/element';\nimport { search } from '@wordpress/icons';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { filterURLForDisplay } from '@wordpress/url';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport SiteIcon from '../site-icon';\nimport { unlock } from '../../lock-unlock';\nconst { useHistory } = unlock( routerPrivateApis );\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst SiteHub = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst { dashboardLink, homeUrl, siteTitle } = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst _site = getEntityRecord( 'root', 'site' );\n\t\t\treturn {\n\t\t\t\tdashboardLink:\n\t\t\t\t\tgetSettings().__experimentalDashboardLink || 'index.php',\n\t\t\t\thomeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,\n\t\t\t\tsiteTitle:\n\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t: _site?.title,\n\t\t\t};\n\t\t}, [] );\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\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\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\thref={ dashboardLink }\n\t\t\t\t\t\t\tlabel={ __( 'Go to the Dashboard' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5333) translateX(-4px)', // Offset to position the icon 12px from viewport edge\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n\nexport default SiteHub;\n\nexport const SiteHubMobile = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst history = useHistory();\n\t\tconst { navigate } = useContext( SidebarNavigationContext );\n\n\t\tconst { homeUrl, siteTitle } = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst _site = getEntityRecord( 'root', 'site' );\n\t\t\treturn {\n\t\t\t\thomeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,\n\t\t\t\tsiteTitle:\n\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t: _site?.title,\n\t\t\t};\n\t\t}, [] );\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\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\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tlabel={ __( 'Go to Site Editor' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5)',\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.push( {} );\n\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\tlabel={ __( 'View site (opens in a new tab)' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,SAA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,CAAC,eAEN,IAAA7B,WAAA,CAAA+B,IAAA,EAAC7C,WAAA,CAAA8C,oBAAM;QAAAF,QAAA,gBACN,IAAA9B,WAAA,CAAA4B,GAAA;UAAKC,SAAS,EAAC,2BAA2B;UAAAC,QAAA,eACzC,IAAA9B,WAAA,CAAA4B,GAAA,EAAC1C,WAAA,CAAAkD,MAAM;YACNC,qBAAqB;YACrBQ,OAAO,EAAC,MAAM;YACdP,IAAI,EAAG5B,OAAS;YAChBoC,MAAM,EAAC,QAAQ;YACfP,KAAK,EAAG,IAAAC,QAAE,EAAE,gCAAiC,CAAG;YAAAV,QAAA,EAE9C,IAAAiB,4BAAc,EAAEpC,SAAU;UAAC,CACtB;QAAC,CACL,CAAC,eACN,IAAAX,WAAA,CAAA4B,GAAA,EAAC1C,WAAA,CAAA8C,oBAAM;UACNE,OAAO,EAAG,CAAG;UACbgB,QAAQ,EAAG,KAAO;UAClBrB,SAAS,EAAC,6BAA6B;UAAAC,QAAA,eAEvC,IAAA9B,WAAA,CAAA4B,GAAA,EAAC1C,WAAA,CAAAkD,MAAM;YACNC,qBAAqB;YACrBR,SAAS,EAAC,0CAA0C;YACpDuB,IAAI,EAAGC,aAAQ;YACfC,OAAO,EAAGA,CAAA,KAAM7B,iBAAiB,CAAC,CAAG;YACrCc,KAAK,EAAG,IAAAC,QAAE,EAAE,sBAAuB,CAAG;YACtCe,QAAQ,EAAGC,yBAAe,CAACC,OAAO,CAAE,GAAI;UAAG,CAC3C;QAAC,CACK,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACL,CAAC;AAER,CAAE,CACH,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_i18n","_coreData","_htmlEntities","_element","_icons","_commands","_keycodes","_url","_router","_store","_siteIcon","_lockUnlock","_sidebar","_jsxRuntime","useHistory","unlock","routerPrivateApis","SiteHub","memo","forwardRef","isTransparent","ref","dashboardLink","homeUrl","siteTitle","useSelect","select","getSettings","editSiteStore","getEntityRecord","coreStore","_site","__experimentalDashboardLink","home","title","url","filterURLForDisplay","open","openCommandCenter","useDispatch","commandsStore","jsx","className","children","jsxs","__experimentalHStack","justify","spacing","clsx","Button","__next40pxDefaultSize","href","label","__","style","transform","borderRadius","default","variant","target","decodeEntities","VisuallyHidden","as","expanded","size","icon","search","onClick","shortcut","displayShortcut","primary","_default","exports","SiteHubMobile","history","navigate","useContext","SidebarNavigationContext","isBlockTheme","getCurrentTheme","is_block_theme","push"],"sources":["@wordpress/edit-site/src/components/site-hub/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { memo, forwardRef, useContext } from '@wordpress/element';\nimport { search } from '@wordpress/icons';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { filterURLForDisplay } from '@wordpress/url';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport SiteIcon from '../site-icon';\nimport { unlock } from '../../lock-unlock';\nconst { useHistory } = unlock( routerPrivateApis );\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst SiteHub = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst { dashboardLink, homeUrl, siteTitle } = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst _site = getEntityRecord( 'root', 'site' );\n\t\t\treturn {\n\t\t\t\tdashboardLink:\n\t\t\t\t\tgetSettings().__experimentalDashboardLink || 'index.php',\n\t\t\t\thomeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,\n\t\t\t\tsiteTitle:\n\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t: _site?.title,\n\t\t\t};\n\t\t}, [] );\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\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\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\thref={ dashboardLink }\n\t\t\t\t\t\t\tlabel={ __( 'Go to the Dashboard' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5333) translateX(-4px)', // Offset to position the icon 12px from viewport edge\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n\nexport default SiteHub;\n\nexport const SiteHubMobile = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst history = useHistory();\n\t\tconst { navigate } = useContext( SidebarNavigationContext );\n\n\t\tconst { dashboardLink, isBlockTheme, homeUrl, siteTitle } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\t\t\tconst { getEntityRecord, getCurrentTheme } =\n\t\t\t\t\tselect( coreStore );\n\t\t\t\tconst _site = getEntityRecord( 'root', 'site' );\n\t\t\t\treturn {\n\t\t\t\t\tdashboardLink:\n\t\t\t\t\t\tgetSettings().__experimentalDashboardLink ||\n\t\t\t\t\t\t'index.php',\n\t\t\t\t\tisBlockTheme: getCurrentTheme()?.is_block_theme,\n\t\t\t\t\thomeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,\n\t\t\t\t\tsiteTitle:\n\t\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t\t: _site?.title,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\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\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5)',\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t{ ...( ! isBlockTheme\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\thref: dashboardLink,\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Go to the Dashboard' ),\n\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\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.push( {} );\n\t\t\t\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Go to Site Editor' ),\n\t\t\t\t\t\t\t\t } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\tlabel={ __( 'View site (opens in a new tab)' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GA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AS,EAAC,0CAA0C;YACpDuB,IAAI,EAAGC,aAAQ;YACfC,OAAO,EAAGA,CAAA,KAAM7B,iBAAiB,CAAC,CAAG;YACrCc,KAAK,EAAG,IAAAC,QAAE,EAAE,sBAAuB,CAAG;YACtCe,QAAQ,EAAGC,yBAAe,CAACC,OAAO,CAAE,GAAI;UAAG,CAC3C;QAAC,CACK,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACL,CAAC;AAER,CAAE,CACH,CAAC","ignoreList":[]}
|
|
@@ -69,6 +69,10 @@ const STYLE_BOOK_THEME_SUBCATEGORIES = exports.STYLE_BOOK_THEME_SUBCATEGORIES =
|
|
|
69
69
|
blocks: ['core/comments-title', 'core/comments-pagination', 'core/comments-pagination-numbers', 'core/comments', 'core/comments-author-name', 'core/comment-content', 'core/comment-date', 'core/comment-edit-link', 'core/comment-reply-link', 'core/comment-template', 'core/post-comments-count', 'core/post-comments-link']
|
|
70
70
|
}];
|
|
71
71
|
const STYLE_BOOK_CATEGORIES = exports.STYLE_BOOK_CATEGORIES = [{
|
|
72
|
+
slug: 'overview',
|
|
73
|
+
title: (0, _i18n.__)('Overview'),
|
|
74
|
+
blocks: []
|
|
75
|
+
}, {
|
|
72
76
|
slug: 'text',
|
|
73
77
|
title: (0, _i18n.__)('Text'),
|
|
74
78
|
blocks: ['core/post-content', 'core/home-link', 'core/navigation-link']
|
|
@@ -200,16 +204,19 @@ const STYLE_BOOK_IFRAME_STYLES = exports.STYLE_BOOK_IFRAME_STYLES = `
|
|
|
200
204
|
.edit-site-style-book__example-preview {
|
|
201
205
|
width: 100%;
|
|
202
206
|
}
|
|
207
|
+
|
|
208
|
+
.is-wide .edit-site-style-book__example-preview {
|
|
209
|
+
width: calc(100% - 120px);
|
|
210
|
+
}
|
|
203
211
|
|
|
204
212
|
.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,
|
|
205
213
|
.edit-site-style-book__example-preview .block-list-appender {
|
|
206
214
|
display: none;
|
|
207
215
|
}
|
|
208
|
-
|
|
209
|
-
.edit-site-style-book__example-preview .is-root-container > .wp-block:first-child {
|
|
216
|
+
:where(.is-root-container > .wp-block:first-child) {
|
|
210
217
|
margin-top: 0;
|
|
211
218
|
}
|
|
212
|
-
.
|
|
219
|
+
:where(.is-root-container > .wp-block:last-child) {
|
|
213
220
|
margin-bottom: 0;
|
|
214
221
|
}
|
|
215
222
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","STYLE_BOOK_COLOR_GROUPS","exports","slug","title","__","origin","type","STYLE_BOOK_THEME_SUBCATEGORIES","blocks","exclude","STYLE_BOOK_CATEGORIES","subcategories","include","ROOT_CONTAINER","STYLE_BOOK_IFRAME_STYLES"],"sources":["@wordpress/edit-site/src/components/style-book/constants.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { StyleBookCategory, StyleBookColorGroup } from './types';\n\nexport const STYLE_BOOK_COLOR_GROUPS: StyleBookColorGroup[] = [\n\t{\n\t\tslug: 'theme-colors',\n\t\ttitle: __( 'Theme Colors' ),\n\t\torigin: 'theme',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'theme-gradients',\n\t\ttitle: __( 'Theme Gradients' ),\n\t\torigin: 'theme',\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'custom-colors',\n\t\ttitle: __( 'Custom Colors' ),\n\t\torigin: 'custom',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'custom-gradients',\n\t\ttitle: __( 'Custom Gradients' ),\n\t\torigin: 'custom', // User.\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'duotones',\n\t\ttitle: __( 'Duotones' ),\n\t\torigin: 'theme',\n\t\ttype: 'duotones',\n\t},\n\t{\n\t\tslug: 'default-colors',\n\t\ttitle: __( 'Default Colors' ),\n\t\torigin: 'default',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'default-gradients',\n\t\ttitle: __( 'Default Gradients' ),\n\t\torigin: 'default',\n\t\ttype: 'gradients',\n\t},\n];\n\nexport const STYLE_BOOK_THEME_SUBCATEGORIES: Omit<\n\tStyleBookCategory,\n\t'subcategories'\n>[] = [\n\t{\n\t\tslug: 'site-identity',\n\t\ttitle: __( 'Site Identity' ),\n\t\tblocks: [ 'core/site-logo', 'core/site-title', 'core/site-tagline' ],\n\t},\n\t{\n\t\tslug: 'design',\n\t\ttitle: __( 'Design' ),\n\t\tblocks: [ 'core/navigation', 'core/avatar', 'core/post-time-to-read' ],\n\t\texclude: [ 'core/home-link', 'core/navigation-link' ],\n\t},\n\t{\n\t\tslug: 'posts',\n\t\ttitle: __( 'Posts' ),\n\t\tblocks: [\n\t\t\t'core/post-title',\n\t\t\t'core/post-excerpt',\n\t\t\t'core/post-author',\n\t\t\t'core/post-author-name',\n\t\t\t'core/post-author-biography',\n\t\t\t'core/post-date',\n\t\t\t'core/post-terms',\n\t\t\t'core/term-description',\n\t\t\t'core/query-title',\n\t\t\t'core/query-no-results',\n\t\t\t'core/query-pagination',\n\t\t\t'core/query-numbers',\n\t\t],\n\t},\n\t{\n\t\tslug: 'comments',\n\t\ttitle: __( 'Comments' ),\n\t\tblocks: [\n\t\t\t'core/comments-title',\n\t\t\t'core/comments-pagination',\n\t\t\t'core/comments-pagination-numbers',\n\t\t\t'core/comments',\n\t\t\t'core/comments-author-name',\n\t\t\t'core/comment-content',\n\t\t\t'core/comment-date',\n\t\t\t'core/comment-edit-link',\n\t\t\t'core/comment-reply-link',\n\t\t\t'core/comment-template',\n\t\t\t'core/post-comments-count',\n\t\t\t'core/post-comments-link',\n\t\t],\n\t},\n];\n\nexport const STYLE_BOOK_CATEGORIES: StyleBookCategory[] = [\n\t{\n\t\tslug: 'text',\n\t\ttitle: __( 'Text' ),\n\t\tblocks: [\n\t\t\t'core/post-content',\n\t\t\t'core/home-link',\n\t\t\t'core/navigation-link',\n\t\t],\n\t},\n\t{\n\t\tslug: 'colors',\n\t\ttitle: __( 'Colors' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'theme',\n\t\ttitle: __( 'Theme' ),\n\t\tsubcategories: STYLE_BOOK_THEME_SUBCATEGORIES,\n\t},\n\t{\n\t\tslug: 'media',\n\t\ttitle: __( 'Media' ),\n\t\tblocks: [ 'core/post-featured-image' ],\n\t},\n\t{\n\t\tslug: 'widgets',\n\t\ttitle: __( 'Widgets' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'embed',\n\t\ttitle: __( 'Embeds' ),\n\t\tinclude: [],\n\t},\n];\n\n// Forming a \"block formatting context\" to prevent margin collapsing.\n// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\nconst ROOT_CONTAINER = `\n\t.is-root-container {\n\t\tdisplay: flow-root;\n\t}\n`;\n// The content area of the Style Book is rendered within an iframe so that global styles\n// are applied to elements within the entire content area. To support elements that are\n// not part of the block previews, such as headings and layout for the block previews,\n// additional CSS rules need to be passed into the iframe. These are hard-coded below.\n// Note that button styles are unset, and then focus rules from the `Button` component are\n// applied to the `button` element, targeted via `.edit-site-style-book__example`.\n// This is to ensure that browser default styles for buttons are not applied to the previews.\nexport const STYLE_BOOK_IFRAME_STYLES = `\n\tbody {\n\t\tposition: relative;\n\t\tpadding: 32px !important;\n\t}\n\n\t${ ROOT_CONTAINER }\n\n\t.edit-site-style-book__examples {\n\t\tmax-width: 1200px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t max-width: 900px;\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t\tscroll-margin-top: 32px;\n\t\tscroll-margin-bottom: 32px;\n\t\tmargin: 0 auto 40px auto;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example.is-disabled-example {\n\t\tpointer-events: none;\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__duotone-example > div:first-child {\n\t\tdisplay: flex;\n\t\taspect-ratio: 16 / 9;\n\t\tgrid-row: span 1;\n\t\tgrid-column: span 2;\n\t}\n\t.edit-site-style-book__duotone-example img {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tobject-fit: cover;\n\t}\n\t.edit-site-style-book__duotone-example > div:not(:first-child) {\n\t\theight: 20px;\n\t\tborder: 1px solid #ddd;\n\t}\n\n\t.edit-site-style-book__color-example {\n\t\theight: 52px;\n\t\tborder: 1px solid #ddd;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example {\n\t\tflex-direction: row;\n\t}\n\n\t.edit-site-style-book__subcategory-title,\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\tfont-size: 11px;\n\t\tfont-weight: 500;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\ttext-transform: uppercase;\n\t}\n\n\t.edit-site-style-book__subcategory-title {\n\t\tfont-size: 16px;\n\t\tmargin-bottom: 40px;\n \tborder-bottom: 1px solid #ddd;\n \tpadding-bottom: 8px;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example-title {\n\t\ttext-align: right;\n\t\twidth: 120px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:first-child {\n\t\tmargin-top: 0;\n\t}\n\t.edit-site-style-book__example-preview .is-root-container > .wp-block:last-child {\n\t\tmargin-bottom: 0;\n\t}\n`;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAGO,MAAMC,uBAA8C,GAAAC,OAAA,CAAAD,uBAAA,GAAG,CAC7D;EACCE,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAE,IAAAC,QAAE,EAAE,cAAe,CAAC;EAC3BC,MAAM,EAAE,OAAO;EACfC,IAAI,EAAE;AACP,CAAC,EACD;EACCJ,IAAI,EAAE,iBAAiB;EACvBC,KAAK,EAAE,IAAAC,QAAE,EAAE,iBAAkB,CAAC;EAC9BC,MAAM,EAAE,OAAO;EACfC,IAAI,EAAE;AACP,CAAC,EACD;EACCJ,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAE,IAAAC,QAAE,EAAE,eAAgB,CAAC;EAC5BC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE;AACP,CAAC,EACD;EACCJ,IAAI,EAAE,kBAAkB;EACxBC,KAAK,EAAE,IAAAC,QAAE,EAAE,kBAAmB,CAAC;EAC/BC,MAAM,EAAE,QAAQ;EAAE;EAClBC,IAAI,EAAE;AACP,CAAC,EACD;EACCJ,IAAI,EAAE,UAAU;EAChBC,KAAK,EAAE,IAAAC,QAAE,EAAE,UAAW,CAAC;EACvBC,MAAM,EAAE,OAAO;EACfC,IAAI,EAAE;AACP,CAAC,EACD;EACCJ,IAAI,EAAE,gBAAgB;EACtBC,KAAK,EAAE,IAAAC,QAAE,EAAE,gBAAiB,CAAC;EAC7BC,MAAM,EAAE,SAAS;EACjBC,IAAI,EAAE;AACP,CAAC,EACD;EACCJ,IAAI,EAAE,mBAAmB;EACzBC,KAAK,EAAE,IAAAC,QAAE,EAAE,mBAAoB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AAgB,EAChB,sBAAsB;AAExB,CAAC,EACD;EACCN,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;EACrBI,MAAM,EAAE;AACT,CAAC,EACD;EACCN,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBO,aAAa,EAAEJ;AAChB,CAAC,EACD;EACCL,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBI,MAAM,EAAE,CAAE,0BAA0B;AACrC,CAAC,EACD;EACCN,IAAI,EAAE,SAAS;EACfC,KAAK,EAAE,IAAAC,QAAE,EAAE,SAAU,CAAC;EACtBI,MAAM,EAAE;AACT,CAAC,EACD;EACCN,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;EACrBQ,OAAO,EAAE;AACV,CAAC,CACD;;AAED;AACA;AACA,MAAMC,cAAc,GAAG;AACvB;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,wBAAwB,GAAAb,OAAA,CAAAa,wBAAA,GAAG;AACxC;AACA;AACA;AACA;AACA;AACA,GAAID,cAAc;AAClB;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;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,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","STYLE_BOOK_COLOR_GROUPS","exports","slug","title","__","origin","type","STYLE_BOOK_THEME_SUBCATEGORIES","blocks","exclude","STYLE_BOOK_CATEGORIES","subcategories","include","ROOT_CONTAINER","STYLE_BOOK_IFRAME_STYLES"],"sources":["@wordpress/edit-site/src/components/style-book/constants.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { StyleBookCategory, StyleBookColorGroup } from './types';\n\nexport const STYLE_BOOK_COLOR_GROUPS: StyleBookColorGroup[] = [\n\t{\n\t\tslug: 'theme-colors',\n\t\ttitle: __( 'Theme Colors' ),\n\t\torigin: 'theme',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'theme-gradients',\n\t\ttitle: __( 'Theme Gradients' ),\n\t\torigin: 'theme',\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'custom-colors',\n\t\ttitle: __( 'Custom Colors' ),\n\t\torigin: 'custom',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'custom-gradients',\n\t\ttitle: __( 'Custom Gradients' ),\n\t\torigin: 'custom', // User.\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'duotones',\n\t\ttitle: __( 'Duotones' ),\n\t\torigin: 'theme',\n\t\ttype: 'duotones',\n\t},\n\t{\n\t\tslug: 'default-colors',\n\t\ttitle: __( 'Default Colors' ),\n\t\torigin: 'default',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'default-gradients',\n\t\ttitle: __( 'Default Gradients' ),\n\t\torigin: 'default',\n\t\ttype: 'gradients',\n\t},\n];\n\nexport const STYLE_BOOK_THEME_SUBCATEGORIES: Omit<\n\tStyleBookCategory,\n\t'subcategories'\n>[] = [\n\t{\n\t\tslug: 'site-identity',\n\t\ttitle: __( 'Site Identity' ),\n\t\tblocks: [ 'core/site-logo', 'core/site-title', 'core/site-tagline' ],\n\t},\n\t{\n\t\tslug: 'design',\n\t\ttitle: __( 'Design' ),\n\t\tblocks: [ 'core/navigation', 'core/avatar', 'core/post-time-to-read' ],\n\t\texclude: [ 'core/home-link', 'core/navigation-link' ],\n\t},\n\t{\n\t\tslug: 'posts',\n\t\ttitle: __( 'Posts' ),\n\t\tblocks: [\n\t\t\t'core/post-title',\n\t\t\t'core/post-excerpt',\n\t\t\t'core/post-author',\n\t\t\t'core/post-author-name',\n\t\t\t'core/post-author-biography',\n\t\t\t'core/post-date',\n\t\t\t'core/post-terms',\n\t\t\t'core/term-description',\n\t\t\t'core/query-title',\n\t\t\t'core/query-no-results',\n\t\t\t'core/query-pagination',\n\t\t\t'core/query-numbers',\n\t\t],\n\t},\n\t{\n\t\tslug: 'comments',\n\t\ttitle: __( 'Comments' ),\n\t\tblocks: [\n\t\t\t'core/comments-title',\n\t\t\t'core/comments-pagination',\n\t\t\t'core/comments-pagination-numbers',\n\t\t\t'core/comments',\n\t\t\t'core/comments-author-name',\n\t\t\t'core/comment-content',\n\t\t\t'core/comment-date',\n\t\t\t'core/comment-edit-link',\n\t\t\t'core/comment-reply-link',\n\t\t\t'core/comment-template',\n\t\t\t'core/post-comments-count',\n\t\t\t'core/post-comments-link',\n\t\t],\n\t},\n];\n\nexport const STYLE_BOOK_CATEGORIES: StyleBookCategory[] = [\n\t{\n\t\tslug: 'overview',\n\t\ttitle: __( 'Overview' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'text',\n\t\ttitle: __( 'Text' ),\n\t\tblocks: [\n\t\t\t'core/post-content',\n\t\t\t'core/home-link',\n\t\t\t'core/navigation-link',\n\t\t],\n\t},\n\t{\n\t\tslug: 'colors',\n\t\ttitle: __( 'Colors' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'theme',\n\t\ttitle: __( 'Theme' ),\n\t\tsubcategories: STYLE_BOOK_THEME_SUBCATEGORIES,\n\t},\n\t{\n\t\tslug: 'media',\n\t\ttitle: __( 'Media' ),\n\t\tblocks: [ 'core/post-featured-image' ],\n\t},\n\t{\n\t\tslug: 'widgets',\n\t\ttitle: __( 'Widgets' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'embed',\n\t\ttitle: __( 'Embeds' ),\n\t\tinclude: [],\n\t},\n];\n\n// Forming a \"block formatting context\" to prevent margin collapsing.\n// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\nconst ROOT_CONTAINER = `\n\t.is-root-container {\n\t\tdisplay: flow-root;\n\t}\n`;\n// The content area of the Style Book is rendered within an iframe so that global styles\n// are applied to elements within the entire content area. To support elements that are\n// not part of the block previews, such as headings and layout for the block previews,\n// additional CSS rules need to be passed into the iframe. These are hard-coded below.\n// Note that button styles are unset, and then focus rules from the `Button` component are\n// applied to the `button` element, targeted via `.edit-site-style-book__example`.\n// This is to ensure that browser default styles for buttons are not applied to the previews.\nexport const STYLE_BOOK_IFRAME_STYLES = `\n\tbody {\n\t\tposition: relative;\n\t\tpadding: 32px !important;\n\t}\n\n\t${ ROOT_CONTAINER }\n\n\t.edit-site-style-book__examples {\n\t\tmax-width: 1200px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t max-width: 900px;\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t\tscroll-margin-top: 32px;\n\t\tscroll-margin-bottom: 32px;\n\t\tmargin: 0 auto 40px auto;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example.is-disabled-example {\n\t\tpointer-events: none;\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__duotone-example > div:first-child {\n\t\tdisplay: flex;\n\t\taspect-ratio: 16 / 9;\n\t\tgrid-row: span 1;\n\t\tgrid-column: span 2;\n\t}\n\t.edit-site-style-book__duotone-example img {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tobject-fit: cover;\n\t}\n\t.edit-site-style-book__duotone-example > div:not(:first-child) {\n\t\theight: 20px;\n\t\tborder: 1px solid #ddd;\n\t}\n\n\t.edit-site-style-book__color-example {\n\t\theight: 52px;\n\t\tborder: 1px solid #ddd;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example {\n\t\tflex-direction: row;\n\t}\n\n\t.edit-site-style-book__subcategory-title,\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\tfont-size: 11px;\n\t\tfont-weight: 500;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\ttext-transform: uppercase;\n\t}\n\n\t.edit-site-style-book__subcategory-title {\n\t\tfont-size: 16px;\n\t\tmargin-bottom: 40px;\n \tborder-bottom: 1px solid #ddd;\n \tpadding-bottom: 8px;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example-title {\n\t\ttext-align: right;\n\t\twidth: 120px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\t\n\t.is-wide .edit-site-style-book__example-preview {\n\t\twidth: calc(100% - 120px);\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\t:where(.is-root-container > .wp-block:first-child) {\n\t\tmargin-top: 0;\n\t}\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AgB,EAChB,sBAAsB;AAExB,CAAC,EACD;EACCN,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;EACrBI,MAAM,EAAE;AACT,CAAC,EACD;EACCN,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBO,aAAa,EAAEJ;AAChB,CAAC,EACD;EACCL,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBI,MAAM,EAAE,CAAE,0BAA0B;AACrC,CAAC,EACD;EACCN,IAAI,EAAE,SAAS;EACfC,KAAK,EAAE,IAAAC,QAAE,EAAE,SAAU,CAAC;EACtBI,MAAM,EAAE;AACT,CAAC,EACD;EACCN,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;EACrBQ,OAAO,EAAE;AACV,CAAC,CACD;;AAED;AACA;AACA,MAAMC,cAAc,GAAG;AACvB;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,wBAAwB,GAAAb,OAAA,CAAAa,wBAAA,GAAG;AACxC;AACA;AACA;AACA;AACA;AACA,GAAID,cAAc;AAClB;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;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,CAAC","ignoreList":[]}
|
|
@@ -55,6 +55,75 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
55
55
|
return examples;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Returns examples for the overview page.
|
|
60
|
+
*
|
|
61
|
+
* @param {MultiOriginPalettes} colors Global Styles color palettes per origin.
|
|
62
|
+
* @return {BlockExample[]} An array of block examples.
|
|
63
|
+
*/
|
|
64
|
+
function getOverviewBlockExamples(colors) {
|
|
65
|
+
const examples = [];
|
|
66
|
+
|
|
67
|
+
// Get theme palette from colors.
|
|
68
|
+
const themePalette = colors.colors.find(origin => origin.slug === 'theme');
|
|
69
|
+
if (themePalette) {
|
|
70
|
+
const themeColorexample = {
|
|
71
|
+
name: 'theme-colors',
|
|
72
|
+
title: (0, _i18n.__)('Colors'),
|
|
73
|
+
category: 'overview',
|
|
74
|
+
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_colorExamples.default, {
|
|
75
|
+
colors: themePalette.colors,
|
|
76
|
+
type: colors
|
|
77
|
+
})
|
|
78
|
+
};
|
|
79
|
+
examples.push(themeColorexample);
|
|
80
|
+
}
|
|
81
|
+
const headingBlock = (0, _blocks.createBlock)('core/heading', {
|
|
82
|
+
content: (0, _i18n.__)(`AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™`),
|
|
83
|
+
level: 1
|
|
84
|
+
});
|
|
85
|
+
const firstParagraphBlock = (0, _blocks.createBlock)('core/paragraph', {
|
|
86
|
+
content: (0, _i18n.__)(`A paragraph in a website refers to a distinct block of text that is used to present and organize information. It is a fundamental unit of content in web design and is typically composed of a group of related sentences or thoughts focused on a particular topic or idea. Paragraphs play a crucial role in improving the readability and user experience of a website. They break down the text into smaller, manageable chunks, allowing readers to scan the content more easily.`)
|
|
87
|
+
});
|
|
88
|
+
const secondParagraphBlock = (0, _blocks.createBlock)('core/paragraph', {
|
|
89
|
+
content: (0, _i18n.__)(`Additionally, paragraphs help structure the flow of information and provide logical breaks between different concepts or pieces of information. In terms of formatting, paragraphs in websites are commonly denoted by a vertical gap or indentation between each block of text. This visual separation helps visually distinguish one paragraph from another, creating a clear and organized layout that guides the reader through the content smoothly.`)
|
|
90
|
+
});
|
|
91
|
+
const textExample = {
|
|
92
|
+
name: 'typography',
|
|
93
|
+
title: (0, _i18n.__)('Typography'),
|
|
94
|
+
category: 'overview',
|
|
95
|
+
blocks: [headingBlock, (0, _blocks.createBlock)('core/group', {
|
|
96
|
+
layout: {
|
|
97
|
+
type: 'grid',
|
|
98
|
+
columnCount: 2,
|
|
99
|
+
minimumColumnWidth: '12rem'
|
|
100
|
+
},
|
|
101
|
+
style: {
|
|
102
|
+
spacing: {
|
|
103
|
+
blockGap: '1.5rem'
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}, [firstParagraphBlock, secondParagraphBlock])]
|
|
107
|
+
};
|
|
108
|
+
examples.push(textExample);
|
|
109
|
+
const otherBlockExamples = ['core/image', 'core/separator', 'core/buttons', 'core/pullquote', 'core/search'];
|
|
110
|
+
|
|
111
|
+
// Get examples for other blocks and put them in order of above array.
|
|
112
|
+
otherBlockExamples.forEach(blockName => {
|
|
113
|
+
const blockType = (0, _blocks.getBlockType)(blockName);
|
|
114
|
+
if (blockType && blockType.example) {
|
|
115
|
+
const blockExample = {
|
|
116
|
+
name: blockName,
|
|
117
|
+
title: blockType.title,
|
|
118
|
+
category: 'overview',
|
|
119
|
+
blocks: (0, _blocks.getBlockFromExample)(blockName, blockType.example)
|
|
120
|
+
};
|
|
121
|
+
examples.push(blockExample);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
return examples;
|
|
125
|
+
}
|
|
126
|
+
|
|
58
127
|
/**
|
|
59
128
|
* Returns a list of examples for registered block types.
|
|
60
129
|
*
|
|
@@ -96,6 +165,7 @@ function getExamples(colors) {
|
|
|
96
165
|
})
|
|
97
166
|
};
|
|
98
167
|
const colorExamples = getColorExamples(colors);
|
|
99
|
-
|
|
168
|
+
const overviewBlockExamples = getOverviewBlockExamples(colors);
|
|
169
|
+
return [headingsExample, ...colorExamples, ...nonHeadingBlockExamples, ...overviewBlockExamples];
|
|
100
170
|
}
|
|
101
171
|
//# sourceMappingURL=examples.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_blocks","_colorExamples","_interopRequireDefault","_duotoneExamples","_constants","_jsxRuntime","getColorExamples","colors","examples","STYLE_BOOK_COLOR_GROUPS","forEach","group","palette","type","find","origin","slug","example","name","title","category","content","jsx","default","duotones","push","getExamples","nonHeadingBlockExamples","getBlockTypes","filter","blockType","supports","inserter","map","blocks","getBlockFromExample","isHeadingBlockRegistered","getBlockType","headingsExample","__","level","createBlock","sprintf","colorExamples"],"sources":["@wordpress/edit-site/src/components/style-book/examples.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetBlockTypes,\n\tgetBlockFromExample,\n\tcreateBlock,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport type { BlockExample, ColorOrigin, MultiOriginPalettes } from './types';\nimport ColorExamples from './color-examples';\nimport DuotoneExamples from './duotone-examples';\nimport { STYLE_BOOK_COLOR_GROUPS } from './constants';\n\n/**\n * Returns examples color examples for each origin\n * e.g. Core (Default), Theme, and User.\n *\n * @param {MultiOriginPalettes} colors Global Styles color palettes per origin.\n * @return {BlockExample[]} An array of color block examples.\n */\nfunction getColorExamples( colors: MultiOriginPalettes ): BlockExample[] {\n\tif ( ! colors ) {\n\t\treturn [];\n\t}\n\n\tconst examples: BlockExample[] = [];\n\n\tSTYLE_BOOK_COLOR_GROUPS.forEach( ( group ) => {\n\t\tconst palette = colors[ group.type ].find(\n\t\t\t( origin: ColorOrigin ) => origin.slug === group.origin\n\t\t);\n\n\t\tif ( palette?.[ group.type ] ) {\n\t\t\tconst example: BlockExample = {\n\t\t\t\tname: group.slug,\n\t\t\t\ttitle: group.title,\n\t\t\t\tcategory: 'colors',\n\t\t\t};\n\t\t\tif ( group.type === 'duotones' ) {\n\t\t\t\texample.content = (\n\t\t\t\t\t<DuotoneExamples duotones={ palette[ group.type ] } />\n\t\t\t\t);\n\t\t\t\texamples.push( example );\n\t\t\t} else {\n\t\t\t\texample.content = (\n\t\t\t\t\t<ColorExamples\n\t\t\t\t\t\tcolors={ palette[ group.type ] }\n\t\t\t\t\t\ttype={ group.type }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t\texamples.push( example );\n\t\t\t}\n\t\t}\n\t} );\n\n\treturn examples;\n}\n\n/**\n * Returns a list of examples for registered block types.\n *\n * @param {MultiOriginPalettes} colors Global styles colors grouped by origin e.g. Core, Theme, and User.\n * @return {BlockExample[]} An array of block examples.\n */\nexport function getExamples( colors: MultiOriginPalettes ): BlockExample[] {\n\tconst nonHeadingBlockExamples = getBlockTypes()\n\t\t.filter( ( blockType ) => {\n\t\t\tconst { name, example, supports } = blockType;\n\t\t\treturn (\n\t\t\t\tname !== 'core/heading' &&\n\t\t\t\t!! example &&\n\t\t\t\tsupports?.inserter !== false\n\t\t\t);\n\t\t} )\n\t\t.map( ( blockType ) => ( {\n\t\t\tname: blockType.name,\n\t\t\ttitle: blockType.title,\n\t\t\tcategory: blockType.category,\n\t\t\tblocks: getBlockFromExample( blockType.name, blockType.example ),\n\t\t} ) );\n\tconst isHeadingBlockRegistered = !! getBlockType( 'core/heading' );\n\n\tif ( ! isHeadingBlockRegistered ) {\n\t\treturn nonHeadingBlockExamples;\n\t}\n\n\t// Use our own example for the Heading block so that we can show multiple\n\t// heading levels.\n\tconst headingsExample = {\n\t\tname: 'core/heading',\n\t\ttitle: __( 'Headings' ),\n\t\tcategory: 'text',\n\t\tblocks: [ 1, 2, 3, 4, 5, 6 ].map( ( level ) => {\n\t\t\treturn createBlock( 'core/heading', {\n\t\t\t\tcontent: sprintf(\n\t\t\t\t\t// translators: %d: heading level e.g: \"1\", \"2\", \"3\"\n\t\t\t\t\t__( 'Heading %d' ),\n\t\t\t\t\tlevel\n\t\t\t\t),\n\t\t\t\tlevel,\n\t\t\t} );\n\t\t} ),\n\t};\n\tconst colorExamples = getColorExamples( colors );\n\n\treturn [ headingsExample, ...colorExamples, ...nonHeadingBlockExamples ];\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAWA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAAsD,IAAAM,WAAA,GAAAN,OAAA;AAjBtD;AACA;AACA;;AASA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,SAASO,gBAAgBA,CAAEC,MAA2B,EAAmB;EACxE,IAAK,CAAEA,MAAM,EAAG;IACf,OAAO,EAAE;EACV;EAEA,MAAMC,QAAwB,GAAG,EAAE;EAEnCC,kCAAuB,CAACC,OAAO,CAAIC,KAAK,IAAM;IAC7C,MAAMC,OAAO,GAAGL,MAAM,CAAEI,KAAK,CAACE,IAAI,CAAE,CAACC,IAAI,CACtCC,MAAmB,IAAMA,MAAM,CAACC,IAAI,KAAKL,KAAK,CAACI,MAClD,CAAC;IAED,IAAKH,OAAO,GAAID,KAAK,CAACE,IAAI,CAAE,EAAG;MAC9B,MAAMI,OAAqB,GAAG;QAC7BC,IAAI,EAAEP,KAAK,CAACK,IAAI;QAChBG,KAAK,EAAER,KAAK,CAACQ,KAAK;QAClBC,QAAQ,EAAE;MACX,CAAC;MACD,IAAKT,KAAK,CAACE,IAAI,KAAK,UAAU,EAAG;QAChCI,OAAO,CAACI,OAAO,gBACd,IAAAhB,WAAA,CAAAiB,GAAA,EAACnB,gBAAA,CAAAoB,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,EAAE,cAAc;IACpBC,KAAK,EAAE,IAAAoB,QAAE,EAAE,UAAW,CAAC;IACvBnB,QAAQ,EAAE,MAAM;IAChBc,MAAM,EAAE,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACD,GAAG,CAAIO,KAAK,IAAM;MAC9C,OAAO,IAAAC,mBAAW,EAAE,cAAc,EAAE;QACnCpB,OAAO,EAAE,IAAAqB,aAAO;QACf;QACA,IAAAH,QAAE,EAAE,YAAa,CAAC,EAClBC,KACD,CAAC;QACDA;MACD,CAAE,CAAC;IACJ,CAAE;EACH,CAAC;EACD,MAAMG,aAAa,GAAGrC,gBAAgB,CAAEC,MAAO,CAAC;EAEhD,OAAO,CAAE+B,eAAe,EAAE,GAAGK,aAAa,EAAE,GAAGhB,uBAAuB,CAAE;AACzE","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_blocks","_colorExamples","_interopRequireDefault","_duotoneExamples","_constants","_jsxRuntime","getColorExamples","colors","examples","STYLE_BOOK_COLOR_GROUPS","forEach","group","palette","type","find","origin","slug","example","name","title","category","content","jsx","default","duotones","push","getOverviewBlockExamples","themePalette","themeColorexample","__","headingBlock","createBlock","level","firstParagraphBlock","secondParagraphBlock","textExample","blocks","layout","columnCount","minimumColumnWidth","style","spacing","blockGap","otherBlockExamples","blockName","blockType","getBlockType","blockExample","getBlockFromExample","getExamples","nonHeadingBlockExamples","getBlockTypes","filter","supports","inserter","map","isHeadingBlockRegistered","headingsExample","sprintf","colorExamples","overviewBlockExamples"],"sources":["@wordpress/edit-site/src/components/style-book/examples.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetBlockTypes,\n\tgetBlockFromExample,\n\tcreateBlock,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport type { BlockExample, ColorOrigin, MultiOriginPalettes } from './types';\nimport ColorExamples from './color-examples';\nimport DuotoneExamples from './duotone-examples';\nimport { STYLE_BOOK_COLOR_GROUPS } from './constants';\n\n/**\n * Returns examples color examples for each origin\n * e.g. Core (Default), Theme, and User.\n *\n * @param {MultiOriginPalettes} colors Global Styles color palettes per origin.\n * @return {BlockExample[]} An array of color block examples.\n */\nfunction getColorExamples( colors: MultiOriginPalettes ): BlockExample[] {\n\tif ( ! colors ) {\n\t\treturn [];\n\t}\n\n\tconst examples: BlockExample[] = [];\n\n\tSTYLE_BOOK_COLOR_GROUPS.forEach( ( group ) => {\n\t\tconst palette = colors[ group.type ].find(\n\t\t\t( origin: ColorOrigin ) => origin.slug === group.origin\n\t\t);\n\n\t\tif ( palette?.[ group.type ] ) {\n\t\t\tconst example: BlockExample = {\n\t\t\t\tname: group.slug,\n\t\t\t\ttitle: group.title,\n\t\t\t\tcategory: 'colors',\n\t\t\t};\n\t\t\tif ( group.type === 'duotones' ) {\n\t\t\t\texample.content = (\n\t\t\t\t\t<DuotoneExamples duotones={ palette[ group.type ] } />\n\t\t\t\t);\n\t\t\t\texamples.push( example );\n\t\t\t} else {\n\t\t\t\texample.content = (\n\t\t\t\t\t<ColorExamples\n\t\t\t\t\t\tcolors={ palette[ group.type ] }\n\t\t\t\t\t\ttype={ group.type }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t\texamples.push( example );\n\t\t\t}\n\t\t}\n\t} );\n\n\treturn examples;\n}\n\n/**\n * Returns examples for the overview page.\n *\n * @param {MultiOriginPalettes} colors Global Styles color palettes per origin.\n * @return {BlockExample[]} An array of block examples.\n */\nfunction getOverviewBlockExamples(\n\tcolors: MultiOriginPalettes\n): BlockExample[] {\n\tconst examples: BlockExample[] = [];\n\n\t// Get theme palette from colors.\n\tconst themePalette = colors.colors.find(\n\t\t( origin: ColorOrigin ) => origin.slug === 'theme'\n\t);\n\n\tif ( themePalette ) {\n\t\tconst themeColorexample: BlockExample = {\n\t\t\tname: 'theme-colors',\n\t\t\ttitle: __( 'Colors' ),\n\t\t\tcategory: 'overview',\n\t\t\tcontent: (\n\t\t\t\t<ColorExamples colors={ themePalette.colors } type={ colors } />\n\t\t\t),\n\t\t};\n\n\t\texamples.push( themeColorexample );\n\t}\n\n\tconst headingBlock = createBlock( 'core/heading', {\n\t\tcontent: __(\n\t\t\t`AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™`\n\t\t),\n\t\tlevel: 1,\n\t} );\n\tconst firstParagraphBlock = createBlock( 'core/paragraph', {\n\t\tcontent: __(\n\t\t\t`A paragraph in a website refers to a distinct block of text that is used to present and organize information. It is a fundamental unit of content in web design and is typically composed of a group of related sentences or thoughts focused on a particular topic or idea. Paragraphs play a crucial role in improving the readability and user experience of a website. They break down the text into smaller, manageable chunks, allowing readers to scan the content more easily.`\n\t\t),\n\t} );\n\tconst secondParagraphBlock = createBlock( 'core/paragraph', {\n\t\tcontent: __(\n\t\t\t`Additionally, paragraphs help structure the flow of information and provide logical breaks between different concepts or pieces of information. In terms of formatting, paragraphs in websites are commonly denoted by a vertical gap or indentation between each block of text. This visual separation helps visually distinguish one paragraph from another, creating a clear and organized layout that guides the reader through the content smoothly.`\n\t\t),\n\t} );\n\n\tconst textExample = {\n\t\tname: 'typography',\n\t\ttitle: __( 'Typography' ),\n\t\tcategory: 'overview',\n\t\tblocks: [\n\t\t\theadingBlock,\n\t\t\tcreateBlock(\n\t\t\t\t'core/group',\n\t\t\t\t{\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\ttype: 'grid',\n\t\t\t\t\t\tcolumnCount: 2,\n\t\t\t\t\t\tminimumColumnWidth: '12rem',\n\t\t\t\t\t},\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tspacing: {\n\t\t\t\t\t\t\tblockGap: '1.5rem',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t[ firstParagraphBlock, secondParagraphBlock ]\n\t\t\t),\n\t\t],\n\t};\n\texamples.push( textExample );\n\n\tconst otherBlockExamples = [\n\t\t'core/image',\n\t\t'core/separator',\n\t\t'core/buttons',\n\t\t'core/pullquote',\n\t\t'core/search',\n\t];\n\n\t// Get examples for other blocks and put them in order of above array.\n\totherBlockExamples.forEach( ( blockName ) => {\n\t\tconst blockType = getBlockType( blockName );\n\t\tif ( blockType && blockType.example ) {\n\t\t\tconst blockExample: BlockExample = {\n\t\t\t\tname: blockName,\n\t\t\t\ttitle: blockType.title,\n\t\t\t\tcategory: 'overview',\n\t\t\t\tblocks: getBlockFromExample( blockName, blockType.example ),\n\t\t\t};\n\t\t\texamples.push( blockExample );\n\t\t}\n\t} );\n\n\treturn examples;\n}\n\n/**\n * Returns a list of examples for registered block types.\n *\n * @param {MultiOriginPalettes} colors Global styles colors grouped by origin e.g. Core, Theme, and User.\n * @return {BlockExample[]} An array of block examples.\n */\nexport function getExamples( colors: MultiOriginPalettes ): BlockExample[] {\n\tconst nonHeadingBlockExamples = getBlockTypes()\n\t\t.filter( ( blockType ) => {\n\t\t\tconst { name, example, supports } = blockType;\n\t\t\treturn (\n\t\t\t\tname !== 'core/heading' &&\n\t\t\t\t!! example &&\n\t\t\t\tsupports?.inserter !== false\n\t\t\t);\n\t\t} )\n\t\t.map( ( blockType ) => ( {\n\t\t\tname: blockType.name,\n\t\t\ttitle: blockType.title,\n\t\t\tcategory: blockType.category,\n\t\t\tblocks: getBlockFromExample( blockType.name, blockType.example ),\n\t\t} ) );\n\tconst isHeadingBlockRegistered = !! getBlockType( 'core/heading' );\n\n\tif ( ! isHeadingBlockRegistered ) {\n\t\treturn nonHeadingBlockExamples;\n\t}\n\n\t// Use our own example for the Heading block so that we can show multiple\n\t// heading levels.\n\tconst headingsExample = {\n\t\tname: 'core/heading',\n\t\ttitle: __( 'Headings' ),\n\t\tcategory: 'text',\n\t\tblocks: [ 1, 2, 3, 4, 5, 6 ].map( ( level ) => {\n\t\t\treturn createBlock( 'core/heading', {\n\t\t\t\tcontent: sprintf(\n\t\t\t\t\t// translators: %d: heading level e.g: \"1\", \"2\", \"3\"\n\t\t\t\t\t__( 'Heading %d' ),\n\t\t\t\t\tlevel\n\t\t\t\t),\n\t\t\t\tlevel,\n\t\t\t} );\n\t\t} ),\n\t};\n\tconst colorExamples = getColorExamples( colors );\n\n\tconst overviewBlockExamples = getOverviewBlockExamples( colors );\n\n\treturn [\n\t\theadingsExample,\n\t\t...colorExamples,\n\t\t...nonHeadingBlockExamples,\n\t\t...overviewBlockExamples,\n\t];\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAWA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAAsD,IAAAM,WAAA,GAAAN,OAAA;AAjBtD;AACA;AACA;;AASA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,SAASO,gBAAgBA,CAAEC,MAA2B,EAAmB;EACxE,IAAK,CAAEA,MAAM,EAAG;IACf,OAAO,EAAE;EACV;EAEA,MAAMC,QAAwB,GAAG,EAAE;EAEnCC,kCAAuB,CAACC,OAAO,CAAIC,KAAK,IAAM;IAC7C,MAAMC,OAAO,GAAGL,MAAM,CAAEI,KAAK,CAACE,IAAI,CAAE,CAACC,IAAI,CACtCC,MAAmB,IAAMA,MAAM,CAACC,IAAI,KAAKL,KAAK,CAACI,MAClD,CAAC;IAED,IAAKH,OAAO,GAAID,KAAK,CAACE,IAAI,CAAE,EAAG;MAC9B,MAAMI,OAAqB,GAAG;QAC7BC,IAAI,EAAEP,KAAK,CAACK,IAAI;QAChBG,KAAK,EAAER,KAAK,CAACQ,KAAK;QAClBC,QAAQ,EAAE;MACX,CAAC;MACD,IAAKT,KAAK,CAACE,IAAI,KAAK,UAAU,EAAG;QAChCI,OAAO,CAACI,OAA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