@wordpress/edit-site 5.3.7 → 5.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/add-new-template/new-template.js +16 -10
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +2 -1
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -40
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +3 -1
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/index.js +134 -19
- package/build/components/style-book/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +18 -11
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +2 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +2 -39
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +3 -1
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/index.js +135 -22
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-style/style-rtl.css +21 -47
- package/build-style/style.css +21 -47
- package/package.json +10 -10
- package/src/components/add-new-template/new-template.js +57 -32
- package/src/components/add-new-template/style.scss +12 -1
- package/src/components/sidebar-navigation-item/style.scss +1 -3
- package/src/components/sidebar-navigation-screen-main/index.js +4 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +3 -40
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +4 -0
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +1 -1
- package/src/components/site-hub/index.js +5 -1
- package/src/components/site-hub/style.scss +5 -1
- package/src/components/style-book/index.js +209 -54
- package/src/components/style-book/style.scss +1 -45
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* External dependencies
|
|
@@ -8,10 +9,11 @@ import classnames from 'classnames';
|
|
|
8
9
|
* WordPress dependencies
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
|
-
import { Button, TabPanel, createSlotFill, __experimentalUseSlotFills as useSlotFills } from '@wordpress/components';
|
|
12
|
+
import { Button, __unstableComposite as Composite, __unstableUseCompositeState as useCompositeState, __unstableCompositeItem as CompositeItem, Disabled, TabPanel, createSlotFill, __experimentalUseSlotFills as useSlotFills } from '@wordpress/components';
|
|
12
13
|
import { __, sprintf } from '@wordpress/i18n';
|
|
13
14
|
import { getCategories, getBlockTypes, getBlockFromExample, createBlock } from '@wordpress/blocks';
|
|
14
|
-
import {
|
|
15
|
+
import { BlockList, privateApis as blockEditorPrivateApis, store as blockEditorStore, __unstableEditorStyles as EditorStyles, __unstableIframe as Iframe } from '@wordpress/block-editor';
|
|
16
|
+
import { useSelect } from '@wordpress/data';
|
|
15
17
|
import { closeSmall } from '@wordpress/icons';
|
|
16
18
|
import { useResizeObserver, useFocusOnMount, useFocusReturn, useMergeRefs } from '@wordpress/compose';
|
|
17
19
|
import { useMemo, memo } from '@wordpress/element';
|
|
@@ -22,13 +24,83 @@ import { ESCAPE } from '@wordpress/keycodes';
|
|
|
22
24
|
|
|
23
25
|
import { unlock } from '../../private-apis';
|
|
24
26
|
const {
|
|
27
|
+
ExperimentalBlockEditorProvider,
|
|
25
28
|
useGlobalStyle
|
|
26
29
|
} = unlock(blockEditorPrivateApis);
|
|
27
30
|
const SLOT_FILL_NAME = 'EditSiteStyleBook';
|
|
28
31
|
const {
|
|
29
32
|
Slot: StyleBookSlot,
|
|
30
33
|
Fill: StyleBookFill
|
|
31
|
-
} = createSlotFill(SLOT_FILL_NAME);
|
|
34
|
+
} = createSlotFill(SLOT_FILL_NAME); // The content area of the Style Book is rendered within an iframe so that global styles
|
|
35
|
+
// are applied to elements within the entire content area. To support elements that are
|
|
36
|
+
// not part of the block previews, such as headings and layout for the block previews,
|
|
37
|
+
// additional CSS rules need to be passed into the iframe. These are hard-coded below.
|
|
38
|
+
// Note that button styles are unset, and then focus rules from the `Button` component are
|
|
39
|
+
// applied to the `button` element, targeted via `.edit-site-style-book__example`.
|
|
40
|
+
// This is to ensure that browser default styles for buttons are not applied to the previews.
|
|
41
|
+
|
|
42
|
+
const STYLE_BOOK_IFRAME_STYLES = `
|
|
43
|
+
.edit-site-style-book__examples {
|
|
44
|
+
max-width: 900px;
|
|
45
|
+
margin: 0 auto;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.edit-site-style-book__example {
|
|
49
|
+
border-radius: 2px;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
gap: 40px;
|
|
54
|
+
margin-bottom: 40px;
|
|
55
|
+
padding: 16px;
|
|
56
|
+
width: 100%;
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.edit-site-style-book__example.is-selected {
|
|
61
|
+
box-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.edit-site-style-book__example:focus:not(:disabled) {
|
|
65
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
|
66
|
+
outline: 3px solid transparent;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.edit-site-style-book__examples.is-wide .edit-site-style-book__example {
|
|
70
|
+
flex-direction: row;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.edit-site-style-book__example-title {
|
|
74
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
75
|
+
font-size: 11px;
|
|
76
|
+
font-weight: 500;
|
|
77
|
+
line-height: normal;
|
|
78
|
+
margin: 0;
|
|
79
|
+
text-align: left;
|
|
80
|
+
text-transform: uppercase;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.edit-site-style-book__examples.is-wide .edit-site-style-book__example-title {
|
|
84
|
+
text-align: right;
|
|
85
|
+
width: 120px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.edit-site-style-book__example-preview {
|
|
89
|
+
width: 100%;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,
|
|
93
|
+
.edit-site-style-book__example-preview .block-list-appender {
|
|
94
|
+
display: none;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.edit-site-style-book__example-preview .is-root-container > .wp-block:first-child {
|
|
98
|
+
margin-top: 0;
|
|
99
|
+
}
|
|
100
|
+
.edit-site-style-book__example-preview .is-root-container > .wp-block:last-child {
|
|
101
|
+
margin-bottom: 0;
|
|
102
|
+
}
|
|
103
|
+
`;
|
|
32
104
|
|
|
33
105
|
function getExamples() {
|
|
34
106
|
// Use our own example for the Heading block so that we can show multiple
|
|
@@ -87,6 +159,10 @@ function StyleBook(_ref) {
|
|
|
87
159
|
title: category.title,
|
|
88
160
|
icon: category.icon
|
|
89
161
|
})), [examples]);
|
|
162
|
+
const originalSettings = useSelect(select => select(blockEditorStore).getSettings(), []);
|
|
163
|
+
const settings = useMemo(() => ({ ...originalSettings,
|
|
164
|
+
__unstableIsPreviewMode: true
|
|
165
|
+
}), [originalSettings]);
|
|
90
166
|
|
|
91
167
|
function closeOnEscape(event) {
|
|
92
168
|
if (event.keyCode === ESCAPE && !event.defaultPrevented) {
|
|
@@ -115,25 +191,48 @@ function StyleBook(_ref) {
|
|
|
115
191
|
}), createElement(TabPanel, {
|
|
116
192
|
className: "edit-site-style-book__tab-panel",
|
|
117
193
|
tabs: tabs
|
|
118
|
-
}, tab => createElement(
|
|
194
|
+
}, tab => createElement(Iframe, {
|
|
195
|
+
className: "edit-site-style-book__iframe",
|
|
196
|
+
head: createElement(Fragment, null, createElement(EditorStyles, {
|
|
197
|
+
styles: settings.styles
|
|
198
|
+
}), createElement("style", null, // Forming a "block formatting context" to prevent margin collapsing.
|
|
199
|
+
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
|
|
200
|
+
`.is-root-container { display: flow-root; }
|
|
201
|
+
body { position: relative; padding: 32px !important; }` + STYLE_BOOK_IFRAME_STYLES)),
|
|
202
|
+
name: "style-book-canvas",
|
|
203
|
+
tabIndex: 0
|
|
204
|
+
}, settings.svgFilters, createElement(Examples, {
|
|
205
|
+
className: classnames('edit-site-style-book__examples', {
|
|
206
|
+
'is-wide': sizes.width > 600
|
|
207
|
+
}),
|
|
119
208
|
examples: examples,
|
|
120
209
|
category: tab.name,
|
|
210
|
+
label: sprintf( // translators: %s: Category of blocks, e.g. Text.
|
|
211
|
+
__('Examples of blocks in the %s category'), tab.title),
|
|
121
212
|
isSelected: isSelected,
|
|
122
213
|
onSelect: onSelect
|
|
123
|
-
}))));
|
|
214
|
+
})))));
|
|
124
215
|
}
|
|
125
216
|
|
|
126
217
|
const Examples = memo(_ref2 => {
|
|
127
218
|
let {
|
|
219
|
+
className,
|
|
128
220
|
examples,
|
|
129
221
|
category,
|
|
222
|
+
label,
|
|
130
223
|
isSelected,
|
|
131
224
|
onSelect
|
|
132
225
|
} = _ref2;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
226
|
+
const composite = useCompositeState({
|
|
227
|
+
orientation: 'vertical'
|
|
228
|
+
});
|
|
229
|
+
return createElement(Composite, _extends({}, composite, {
|
|
230
|
+
className: className,
|
|
231
|
+
"aria-label": label
|
|
232
|
+
}), examples.filter(example => example.category === category).map(example => createElement(Example, {
|
|
136
233
|
key: example.name,
|
|
234
|
+
id: `example-${example.name}`,
|
|
235
|
+
composite: composite,
|
|
137
236
|
title: example.title,
|
|
138
237
|
blocks: example.blocks,
|
|
139
238
|
isSelected: isSelected(example.name),
|
|
@@ -142,32 +241,46 @@ const Examples = memo(_ref2 => {
|
|
|
142
241
|
}
|
|
143
242
|
})));
|
|
144
243
|
});
|
|
145
|
-
|
|
244
|
+
|
|
245
|
+
const Example = _ref3 => {
|
|
146
246
|
let {
|
|
247
|
+
composite,
|
|
248
|
+
id,
|
|
147
249
|
title,
|
|
148
250
|
blocks,
|
|
149
251
|
isSelected,
|
|
150
252
|
onClick
|
|
151
253
|
} = _ref3;
|
|
152
|
-
|
|
254
|
+
const originalSettings = useSelect(select => select(blockEditorStore).getSettings(), []);
|
|
255
|
+
const settings = useMemo(() => ({ ...originalSettings,
|
|
256
|
+
__unstableIsPreviewMode: true
|
|
257
|
+
}), [originalSettings]); // Cache the list of blocks to avoid additional processing when the component is re-rendered.
|
|
258
|
+
|
|
259
|
+
const renderedBlocks = useMemo(() => Array.isArray(blocks) ? blocks : [blocks], [blocks]);
|
|
260
|
+
return createElement(CompositeItem, _extends({}, composite, {
|
|
153
261
|
className: classnames('edit-site-style-book__example', {
|
|
154
262
|
'is-selected': isSelected
|
|
155
263
|
}),
|
|
264
|
+
id: id,
|
|
156
265
|
"aria-label": sprintf( // translators: %s: Title of a block, e.g. Heading.
|
|
157
266
|
__('Open %s styles in Styles panel'), title),
|
|
158
|
-
onClick: onClick
|
|
159
|
-
|
|
267
|
+
onClick: onClick,
|
|
268
|
+
role: "button",
|
|
269
|
+
as: "div"
|
|
270
|
+
}), createElement("span", {
|
|
160
271
|
className: "edit-site-style-book__example-title"
|
|
161
272
|
}, title), createElement("div", {
|
|
162
|
-
className: "edit-site-style-book__example-preview"
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
273
|
+
className: "edit-site-style-book__example-preview",
|
|
274
|
+
"aria-hidden": true
|
|
275
|
+
}, createElement(Disabled, {
|
|
276
|
+
className: "edit-site-style-book__example-preview__content"
|
|
277
|
+
}, createElement(ExperimentalBlockEditorProvider, {
|
|
278
|
+
value: renderedBlocks,
|
|
279
|
+
settings: settings
|
|
280
|
+
}, createElement(BlockList, {
|
|
281
|
+
renderAppender: false
|
|
282
|
+
})))));
|
|
283
|
+
};
|
|
171
284
|
|
|
172
285
|
function useHasStyleBook() {
|
|
173
286
|
const fills = useSlotFills(SLOT_FILL_NAME);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/style-book/index.js"],"names":["classnames","Button","TabPanel","createSlotFill","__experimentalUseSlotFills","useSlotFills","__","sprintf","getCategories","getBlockTypes","getBlockFromExample","createBlock","BlockPreview","privateApis","blockEditorPrivateApis","closeSmall","useResizeObserver","useFocusOnMount","useFocusReturn","useMergeRefs","useMemo","memo","ESCAPE","unlock","useGlobalStyle","SLOT_FILL_NAME","Slot","StyleBookSlot","Fill","StyleBookFill","getExamples","headingsExample","name","title","category","blocks","content","level","otherExamples","filter","blockType","example","supports","inserter","map","StyleBook","isSelected","onSelect","onClose","resizeObserver","sizes","focusOnMountRef","sectionFocusReturnRef","textColor","backgroundColor","examples","tabs","some","slug","icon","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","width","color","background","tab","Examples","Example","onClick","css","useHasStyleBook","fills","length"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,MADD,EAECC,QAFD,EAGCC,cAHD,EAICC,0BAA0B,IAAIC,YAJ/B,QAKO,uBALP;AAMA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;A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;AADyC,KAAnC,CADvB;AAIC,kBAAavC,OAAO,EACnB;AACAD,IAAAA,EAAE,CAAE,gCAAF,CAFiB,EAGnB2B,KAHmB,CAJrB;AASC,IAAA,OAAO,EAAGsC;AATX,KAWC;AAAM,IAAA,SAAS,EAAC;AAAhB,KAAwDtC,KAAxD,CAXD,EAYC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,YAAD;AACC,IAAA,MAAM,EAAGE,MADV;AAEC,IAAA,aAAa,EAAG,CAFjB;AAGC,IAAA,gBAAgB,EAAG,CAClB;AACCqC,MAAAA,GAAG,EACF,6CACA;AAHF,KADkB;AAHpB,IADD,CAZD,CADqB;AAAA,CAAF,CAApB;;AA6BA,SAASC,eAAT,GAA2B;AAC1B,QAAMC,KAAK,GAAGrE,YAAY,CAAEoB,cAAF,CAA1B;AACA,SAAO,CAAC,EAAEiD,KAAF,aAAEA,KAAF,eAAEA,KAAK,CAAEC,MAAT,CAAR;AACA;;AAED9B,SAAS,CAACnB,IAAV,GAAiBC,aAAjB;AACA,eAAekB,SAAf;AACA,SAAS4B,eAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tTabPanel,\n\tcreateSlotFill,\n\t__experimentalUseSlotFills as useSlotFills,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tgetCategories,\n\tgetBlockTypes,\n\tgetBlockFromExample,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport {\n\tBlockPreview,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { closeSmall } from '@wordpress/icons';\nimport {\n\tuseResizeObserver,\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useMemo, memo } from '@wordpress/element';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst SLOT_FILL_NAME = 'EditSiteStyleBook';\nconst { Slot: StyleBookSlot, Fill: StyleBookFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction getExamples() {\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: [\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 1,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 2,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 3,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 4,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 5,\n\t\t\t} ),\n\t\t],\n\t};\n\n\tconst otherExamples = 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\n\treturn [ headingsExample, ...otherExamples ];\n}\n\nfunction StyleBook( { isSelected, onSelect, onClose } ) {\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst sectionFocusReturnRef = useFocusReturn();\n\n\tconst [ textColor ] = useGlobalStyle( 'color.text' );\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst examples = useMemo( getExamples, [] );\n\tconst tabs = useMemo(\n\t\t() =>\n\t\t\tgetCategories()\n\t\t\t\t.filter( ( category ) =>\n\t\t\t\t\texamples.some(\n\t\t\t\t\t\t( example ) => example.category === category.slug\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t.map( ( category ) => ( {\n\t\t\t\t\tname: category.slug,\n\t\t\t\t\ttitle: category.title,\n\t\t\t\t\ticon: category.icon,\n\t\t\t\t} ) ),\n\t\t[ examples ]\n\t);\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tonClose();\n\t\t}\n\t}\n\n\treturn (\n\t\t<StyleBookFill>\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<section\n\t\t\t\tclassName={ classnames( 'edit-site-style-book', {\n\t\t\t\t\t'is-wide': sizes.width > 600,\n\t\t\t\t} ) }\n\t\t\t\tstyle={ {\n\t\t\t\t\tcolor: textColor,\n\t\t\t\t\tbackground: backgroundColor,\n\t\t\t\t} }\n\t\t\t\taria-label={ __( 'Style Book' ) }\n\t\t\t\tonKeyDown={ closeOnEscape }\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\tsectionFocusReturnRef,\n\t\t\t\t\tfocusOnMountRef,\n\t\t\t\t] ) }\n\t\t\t>\n\t\t\t\t{ resizeObserver }\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"edit-site-style-book__close-button\"\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close Style Book' ) }\n\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t/>\n\t\t\t\t<TabPanel\n\t\t\t\t\tclassName=\"edit-site-style-book__tab-panel\"\n\t\t\t\t\ttabs={ tabs }\n\t\t\t\t>\n\t\t\t\t\t{ ( tab ) => (\n\t\t\t\t\t\t<Examples\n\t\t\t\t\t\t\texamples={ examples }\n\t\t\t\t\t\t\tcategory={ tab.name }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</TabPanel>\n\t\t\t</section>\n\t\t</StyleBookFill>\n\t);\n}\n\nconst Examples = memo( ( { examples, category, isSelected, onSelect } ) => (\n\t<div className=\"edit-site-style-book__examples\">\n\t\t{ examples\n\t\t\t.filter( ( example ) => example.category === category )\n\t\t\t.map( ( example ) => (\n\t\t\t\t<Example\n\t\t\t\t\tkey={ example.name }\n\t\t\t\t\ttitle={ example.title }\n\t\t\t\t\tblocks={ example.blocks }\n\t\t\t\t\tisSelected={ isSelected( example.name ) }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonSelect( example.name );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) ) }\n\t</div>\n) );\n\nconst Example = memo( ( { title, blocks, isSelected, onClick } ) => (\n\t<button\n\t\tclassName={ classnames( 'edit-site-style-book__example', {\n\t\t\t'is-selected': isSelected,\n\t\t} ) }\n\t\taria-label={ sprintf(\n\t\t\t// translators: %s: Title of a block, e.g. Heading.\n\t\t\t__( 'Open %s styles in Styles panel' ),\n\t\t\ttitle\n\t\t) }\n\t\tonClick={ onClick }\n\t>\n\t\t<span className=\"edit-site-style-book__example-title\">{ title }</span>\n\t\t<div className=\"edit-site-style-book__example-preview\">\n\t\t\t<BlockPreview\n\t\t\t\tblocks={ blocks }\n\t\t\t\tviewportWidth={ 0 }\n\t\t\t\tadditionalStyles={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tcss:\n\t\t\t\t\t\t\t'.wp-block:first-child { margin-top: 0; }' +\n\t\t\t\t\t\t\t'.wp-block:last-child { margin-bottom: 0; }',\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t</div>\n\t</button>\n) );\n\nfunction useHasStyleBook() {\n\tconst fills = useSlotFills( SLOT_FILL_NAME );\n\treturn !! fills?.length;\n}\n\nStyleBook.Slot = StyleBookSlot;\nexport default StyleBook;\nexport { useHasStyleBook };\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/style-book/index.js"],"names":["classnames","Button","__unstableComposite","Composite","__unstableUseCompositeState","useCompositeState","__unstableCompositeItem","CompositeItem","Disabled","TabPanel","createSlotFill","__experimentalUseSlotFills","useSlotFills","__","sprintf","getCategories","getBlockTypes","getBlockFromExample","createBlock","BlockList","privateApis","blockEditorPrivateApis","store","blockEditorStore","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","useSelect","closeSmall","useResizeObserver","useFocusOnMount","useFocusReturn","useMergeRefs","useMemo","memo","ESCAPE","unlock","ExperimentalBlockEditorProvider","useGlobalStyle","SLOT_FILL_NAME","Slot","StyleBookSlot","Fill","StyleBookFill","STYLE_BOOK_IFRAME_STYLES","getExamples","headingsExample","name","title","category","blocks","content","level","otherExamples","filter","blockType","example","supports","inserter","map","StyleBook","isSelected","onSelect","onClose","resizeObserver","sizes","focusOnMountRef","sectionFocusReturnRef","textColor","backgroundColor","examples","tabs","some","slug","icon","originalSettings","select","getSettings","settings","__unstableIsPreviewMode","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","width","color","background","tab","styles","svgFilters","Examples","className","label","composite","orientation","Example","id","onClick","renderedBlocks","Array","isArray","useHasStyleBook","fills","length"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,MADD,EAECC,mBAAmB,IAAIC,SAFxB,EAGCC,2BAA2B,IAAIC,iBAHhC,EAICC,uBAAuB,IAAIC,aAJ5B,EAKCC,QALD,EAMCC,QAND,EAOCC,cAPD,EAQCC,0BAA0B,IAAIC,YAR/B,QASO,uBATP;AAUA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,aADD,EAECC,aAFD,EAGCC,mBAHD,EAICC,WAJD,QAKO,mBALP;AAMA,SACCC,SADD,EAECC,WAAW,IAAIC,sBAFhB,EAGCC,KAAK,IAAIC,gBAHV,EAICC,sBAAsB,IAAIC,YAJ3B,EAKCC,gBAAgB,IAAIC,MALrB,QAMO,yBANP;AAOA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,UAAT,QAA2B,kBAA3B;AACA,SACCC,iBADD,EAECC,eAFD,EAGCC,cAHD,EAICC,YAJD,QAKO,oBALP;AAMA,SAASC,OAAT,EAAkBC,IAAlB,QAA8B,oBAA9B;AACA,SAASC,MAAT,QAAuB,qBAAvB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA,+BAAF;AAAmCC,EAAAA;AAAnC,IAAsDF,MAAM,CACjEhB,sBADiE,CAAlE;AAIA,MAAMmB,cAAc,GAAG,mBAAvB;AACA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,aAAR;AAAuBC,EAAAA,IAAI,EAAEC;AAA7B,IACLlC,cAAc,CAAE8B,cAAF,CADf,C,CAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMK,wBAAwB,GAAI;AAClC;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,CA7DA;;AA+DA,SAASC,WAAT,GAAuB;AACtB;AACA;AACA,QAAMC,eAAe,GAAG;AACvBC,IAAAA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AA,SAAS,EAAC;AAAhB,KACGlD,KADH,CAfD,EAkBC;AAAK,IAAA,SAAS,EAAC,uCAAf;AAAuD;AAAvD,KACC,cAAC,QAAD;AAAU,IAAA,SAAS,EAAC;AAApB,KACC,cAAC,+BAAD;AACC,IAAA,KAAK,EAAGmD,cADT;AAEC,IAAA,QAAQ,EAAGrB;AAFZ,KAIC,cAAC,SAAD;AAAW,IAAA,cAAc,EAAG;AAA5B,IAJD,CADD,CADD,CAlBD,CADD;AA+BA,CA/CD;;AAiDA,SAASwB,eAAT,GAA2B;AAC1B,QAAMC,KAAK,GAAG5F,YAAY,CAAE4B,cAAF,CAA1B;AACA,SAAO,CAAC,EAAEgE,KAAF,aAAEA,KAAF,eAAEA,KAAK,CAAEC,MAAT,CAAR;AACA;;AAED5C,SAAS,CAACpB,IAAV,GAAiBC,aAAjB;AACA,eAAemB,SAAf;AACA,SAAS0C,eAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n\t__unstableCompositeItem as CompositeItem,\n\tDisabled,\n\tTabPanel,\n\tcreateSlotFill,\n\t__experimentalUseSlotFills as useSlotFills,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tgetCategories,\n\tgetBlockTypes,\n\tgetBlockFromExample,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { closeSmall } from '@wordpress/icons';\nimport {\n\tuseResizeObserver,\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useMemo, memo } from '@wordpress/element';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\n\nconst { ExperimentalBlockEditorProvider, useGlobalStyle } = unlock(\n\tblockEditorPrivateApis\n);\n\nconst SLOT_FILL_NAME = 'EditSiteStyleBook';\nconst { Slot: StyleBookSlot, Fill: StyleBookFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\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.\nconst STYLE_BOOK_IFRAME_STYLES = `\n\t.edit-site-style-book__examples {\n\t\tmax-width: 900px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tmargin-bottom: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\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: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__examples.is-wide .edit-site-style-book__example {\n\t\tflex-direction: row;\n\t}\n\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__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\nfunction getExamples() {\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: [\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 1,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 2,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 3,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 4,\n\t\t\t} ),\n\t\t\tcreateBlock( 'core/heading', {\n\t\t\t\tcontent: __( 'Code Is Poetry' ),\n\t\t\t\tlevel: 5,\n\t\t\t} ),\n\t\t],\n\t};\n\n\tconst otherExamples = 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\n\treturn [ headingsExample, ...otherExamples ];\n}\n\nfunction StyleBook( { isSelected, onSelect, onClose } ) {\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst sectionFocusReturnRef = useFocusReturn();\n\n\tconst [ textColor ] = useGlobalStyle( 'color.text' );\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst examples = useMemo( getExamples, [] );\n\tconst tabs = useMemo(\n\t\t() =>\n\t\t\tgetCategories()\n\t\t\t\t.filter( ( category ) =>\n\t\t\t\t\texamples.some(\n\t\t\t\t\t\t( example ) => example.category === category.slug\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t.map( ( category ) => ( {\n\t\t\t\t\tname: category.slug,\n\t\t\t\t\ttitle: category.title,\n\t\t\t\t\ticon: category.icon,\n\t\t\t\t} ) ),\n\t\t[ examples ]\n\t);\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\n\t\t[ originalSettings ]\n\t);\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tonClose();\n\t\t}\n\t}\n\n\treturn (\n\t\t<StyleBookFill>\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<section\n\t\t\t\tclassName={ classnames( 'edit-site-style-book', {\n\t\t\t\t\t'is-wide': sizes.width > 600,\n\t\t\t\t} ) }\n\t\t\t\tstyle={ {\n\t\t\t\t\tcolor: textColor,\n\t\t\t\t\tbackground: backgroundColor,\n\t\t\t\t} }\n\t\t\t\taria-label={ __( 'Style Book' ) }\n\t\t\t\tonKeyDown={ closeOnEscape }\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\tsectionFocusReturnRef,\n\t\t\t\t\tfocusOnMountRef,\n\t\t\t\t] ) }\n\t\t\t>\n\t\t\t\t{ resizeObserver }\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"edit-site-style-book__close-button\"\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close Style Book' ) }\n\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t/>\n\t\t\t\t<TabPanel\n\t\t\t\t\tclassName=\"edit-site-style-book__tab-panel\"\n\t\t\t\t\ttabs={ tabs }\n\t\t\t\t>\n\t\t\t\t\t{ ( tab ) => (\n\t\t\t\t\t\t<Iframe\n\t\t\t\t\t\t\tclassName=\"edit-site-style-book__iframe\"\n\t\t\t\t\t\t\thead={\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<EditorStyles styles={ settings.styles } />\n\t\t\t\t\t\t\t\t\t<style>\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t\t\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t\t\t\t\t\t\t`.is-root-container { display: flow-root; }\n\t\t\t\t\t\t\t\t\t\t\tbody { position: relative; padding: 32px !important; }` +\n\t\t\t\t\t\t\t\t\t\t\t\tSTYLE_BOOK_IFRAME_STYLES\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t</style>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tname=\"style-book-canvas\"\n\t\t\t\t\t\t\ttabIndex={ 0 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ /* Filters need to be rendered before children to avoid Safari rendering issues. */ }\n\t\t\t\t\t\t\t{ settings.svgFilters }\n\t\t\t\t\t\t\t<Examples\n\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t'edit-site-style-book__examples',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'is-wide': sizes.width > 600,\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\texamples={ examples }\n\t\t\t\t\t\t\t\tcategory={ tab.name }\n\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t// translators: %s: Category of blocks, e.g. Text.\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'Examples of blocks in the %s category'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\ttab.title\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Iframe>\n\t\t\t\t\t) }\n\t\t\t\t</TabPanel>\n\t\t\t</section>\n\t\t</StyleBookFill>\n\t);\n}\n\nconst Examples = memo(\n\t( { className, examples, category, label, isSelected, onSelect } ) => {\n\t\tconst composite = useCompositeState( { orientation: 'vertical' } );\n\t\treturn (\n\t\t\t<Composite\n\t\t\t\t{ ...composite }\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ label }\n\t\t\t>\n\t\t\t\t{ examples\n\t\t\t\t\t.filter( ( example ) => example.category === category )\n\t\t\t\t\t.map( ( example ) => (\n\t\t\t\t\t\t<Example\n\t\t\t\t\t\t\tkey={ example.name }\n\t\t\t\t\t\t\tid={ `example-${ example.name }` }\n\t\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\t\ttitle={ example.title }\n\t\t\t\t\t\t\tblocks={ example.blocks }\n\t\t\t\t\t\t\tisSelected={ isSelected( example.name ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonSelect( example.name );\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</Composite>\n\t\t);\n\t}\n);\n\nconst Example = ( { composite, id, title, blocks, isSelected, onClick } ) => {\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\n\t\t[ originalSettings ]\n\t);\n\n\t// Cache the list of blocks to avoid additional processing when the component is re-rendered.\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\treturn (\n\t\t<CompositeItem\n\t\t\t{ ...composite }\n\t\t\tclassName={ classnames( 'edit-site-style-book__example', {\n\t\t\t\t'is-selected': isSelected,\n\t\t\t} ) }\n\t\t\tid={ id }\n\t\t\taria-label={ sprintf(\n\t\t\t\t// translators: %s: Title of a block, e.g. Heading.\n\t\t\t\t__( 'Open %s styles in Styles panel' ),\n\t\t\t\ttitle\n\t\t\t) }\n\t\t\tonClick={ onClick }\n\t\t\trole=\"button\"\n\t\t\tas=\"div\"\n\t\t>\n\t\t\t<span className=\"edit-site-style-book__example-title\">\n\t\t\t\t{ title }\n\t\t\t</span>\n\t\t\t<div className=\"edit-site-style-book__example-preview\" aria-hidden>\n\t\t\t\t<Disabled className=\"edit-site-style-book__example-preview__content\">\n\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\tvalue={ renderedBlocks }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t</Disabled>\n\t\t\t</div>\n\t\t</CompositeItem>\n\t);\n};\n\nfunction useHasStyleBook() {\n\tconst fills = useSlotFills( SLOT_FILL_NAME );\n\treturn !! fills?.length;\n}\n\nStyleBook.Slot = StyleBookSlot;\nexport default StyleBook;\nexport { useHasStyleBook };\n"]}
|
|
@@ -568,10 +568,19 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
568
568
|
}
|
|
569
569
|
|
|
570
570
|
@media (min-width: 600px) {
|
|
571
|
-
.edit-site-new-template-dropdown .edit-site-new-template-
|
|
571
|
+
.edit-site-new-template-dropdown .edit-site-new-template-dropdown__menu-groups {
|
|
572
572
|
min-width: 300px;
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
|
+
.edit-site-new-template-dropdown__menu-item-tooltip.components-tooltip .components-popover__content {
|
|
576
|
+
max-width: 320px;
|
|
577
|
+
padding: 8px 12px;
|
|
578
|
+
border-radius: 2px;
|
|
579
|
+
white-space: pre-wrap;
|
|
580
|
+
min-width: 0;
|
|
581
|
+
width: auto;
|
|
582
|
+
text-align: right;
|
|
583
|
+
}
|
|
575
584
|
|
|
576
585
|
.edit-site-custom-template-modal__contents > .components-button {
|
|
577
586
|
padding: 24px;
|
|
@@ -2370,12 +2379,11 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2370
2379
|
|
|
2371
2380
|
.edit-site-sidebar-navigation-item.components-item {
|
|
2372
2381
|
color: #949494;
|
|
2373
|
-
|
|
2382
|
+
margin: 0 4px;
|
|
2374
2383
|
}
|
|
2375
2384
|
.edit-site-sidebar-navigation-item.components-item:hover, .edit-site-sidebar-navigation-item.components-item:focus, .edit-site-sidebar-navigation-item.components-item[aria-current] {
|
|
2376
2385
|
color: #fff;
|
|
2377
2386
|
background: #2f2f2f;
|
|
2378
|
-
border-width: 1.5px;
|
|
2379
2387
|
}
|
|
2380
2388
|
.edit-site-sidebar-navigation-item.components-item[aria-current] {
|
|
2381
2389
|
background: var(--wp-admin-theme-color);
|
|
@@ -2383,7 +2391,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2383
2391
|
|
|
2384
2392
|
.edit-site-sidebar-navigation-screen__content .block-editor-list-view-block-select-button {
|
|
2385
2393
|
cursor: grab;
|
|
2386
|
-
width: calc(100% - 2px);
|
|
2387
2394
|
padding: 8px;
|
|
2388
2395
|
}
|
|
2389
2396
|
|
|
@@ -2449,7 +2456,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2449
2456
|
|
|
2450
2457
|
.edit-site-site-hub__view-mode-toggle-container {
|
|
2451
2458
|
height: 60px;
|
|
2452
|
-
width:
|
|
2459
|
+
width: 60px;
|
|
2453
2460
|
flex-shrink: 0;
|
|
2454
2461
|
background: #1e1e1e;
|
|
2455
2462
|
}
|
|
@@ -2464,6 +2471,10 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2464
2471
|
overflow: hidden;
|
|
2465
2472
|
}
|
|
2466
2473
|
|
|
2474
|
+
.edit-site-site-hub__site-title {
|
|
2475
|
+
margin-right: 4px;
|
|
2476
|
+
}
|
|
2477
|
+
|
|
2467
2478
|
.edit-site-sidebar-navigation-screen__description {
|
|
2468
2479
|
margin: 0 16px 32px 0;
|
|
2469
2480
|
}
|
|
@@ -2516,6 +2527,10 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2516
2527
|
color: #fff;
|
|
2517
2528
|
}
|
|
2518
2529
|
|
|
2530
|
+
.edit-site-sidebar-navigation-screen-navigation-menus__content .popover-slot .wp-block-navigation-submenu {
|
|
2531
|
+
display: none;
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2519
2534
|
.edit-site-site-icon__icon {
|
|
2520
2535
|
fill: currentColor;
|
|
2521
2536
|
}
|
|
@@ -2554,53 +2569,12 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2554
2569
|
bottom: 0;
|
|
2555
2570
|
right: 0;
|
|
2556
2571
|
overflow: auto;
|
|
2557
|
-
padding:
|
|
2572
|
+
padding: 0;
|
|
2558
2573
|
position: absolute;
|
|
2559
2574
|
left: 0;
|
|
2560
2575
|
top: 48px;
|
|
2561
2576
|
}
|
|
2562
2577
|
|
|
2563
|
-
.edit-site-style-book__examples {
|
|
2564
|
-
max-width: 900px;
|
|
2565
|
-
margin: 0 auto;
|
|
2566
|
-
}
|
|
2567
|
-
|
|
2568
|
-
.edit-site-style-book__example {
|
|
2569
|
-
background: none;
|
|
2570
|
-
border-radius: 2px;
|
|
2571
|
-
border: none;
|
|
2572
|
-
color: inherit;
|
|
2573
|
-
cursor: pointer;
|
|
2574
|
-
display: flex;
|
|
2575
|
-
flex-direction: column;
|
|
2576
|
-
gap: 40px;
|
|
2577
|
-
margin-bottom: 40px;
|
|
2578
|
-
padding: 16px;
|
|
2579
|
-
width: 100%;
|
|
2580
|
-
}
|
|
2581
|
-
.edit-site-style-book__example.is-selected {
|
|
2582
|
-
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
|
|
2583
|
-
}
|
|
2584
|
-
.edit-site-style-book.is-wide .edit-site-style-book__example {
|
|
2585
|
-
flex-direction: row;
|
|
2586
|
-
}
|
|
2587
|
-
|
|
2588
|
-
.edit-site-style-book__example-title {
|
|
2589
|
-
font-size: 11px;
|
|
2590
|
-
font-weight: 500;
|
|
2591
|
-
margin: 0;
|
|
2592
|
-
text-align: right;
|
|
2593
|
-
text-transform: uppercase;
|
|
2594
|
-
}
|
|
2595
|
-
.edit-site-style-book.is-wide .edit-site-style-book__example-title {
|
|
2596
|
-
text-align: left;
|
|
2597
|
-
width: 120px;
|
|
2598
|
-
}
|
|
2599
|
-
|
|
2600
|
-
.edit-site-style-book__example-preview {
|
|
2601
|
-
width: 100%;
|
|
2602
|
-
}
|
|
2603
|
-
|
|
2604
2578
|
.edit-site-push-changes-to-global-styles-control .components-button {
|
|
2605
2579
|
justify-content: center;
|
|
2606
2580
|
width: 100%;
|
package/build-style/style.css
CHANGED
|
@@ -568,10 +568,19 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
568
568
|
}
|
|
569
569
|
|
|
570
570
|
@media (min-width: 600px) {
|
|
571
|
-
.edit-site-new-template-dropdown .edit-site-new-template-
|
|
571
|
+
.edit-site-new-template-dropdown .edit-site-new-template-dropdown__menu-groups {
|
|
572
572
|
min-width: 300px;
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
|
+
.edit-site-new-template-dropdown__menu-item-tooltip.components-tooltip .components-popover__content {
|
|
576
|
+
max-width: 320px;
|
|
577
|
+
padding: 8px 12px;
|
|
578
|
+
border-radius: 2px;
|
|
579
|
+
white-space: pre-wrap;
|
|
580
|
+
min-width: 0;
|
|
581
|
+
width: auto;
|
|
582
|
+
text-align: left;
|
|
583
|
+
}
|
|
575
584
|
|
|
576
585
|
.edit-site-custom-template-modal__contents > .components-button {
|
|
577
586
|
padding: 24px;
|
|
@@ -2370,12 +2379,11 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2370
2379
|
|
|
2371
2380
|
.edit-site-sidebar-navigation-item.components-item {
|
|
2372
2381
|
color: #949494;
|
|
2373
|
-
|
|
2382
|
+
margin: 0 4px;
|
|
2374
2383
|
}
|
|
2375
2384
|
.edit-site-sidebar-navigation-item.components-item:hover, .edit-site-sidebar-navigation-item.components-item:focus, .edit-site-sidebar-navigation-item.components-item[aria-current] {
|
|
2376
2385
|
color: #fff;
|
|
2377
2386
|
background: #2f2f2f;
|
|
2378
|
-
border-width: 1.5px;
|
|
2379
2387
|
}
|
|
2380
2388
|
.edit-site-sidebar-navigation-item.components-item[aria-current] {
|
|
2381
2389
|
background: var(--wp-admin-theme-color);
|
|
@@ -2383,7 +2391,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2383
2391
|
|
|
2384
2392
|
.edit-site-sidebar-navigation-screen__content .block-editor-list-view-block-select-button {
|
|
2385
2393
|
cursor: grab;
|
|
2386
|
-
width: calc(100% - 2px);
|
|
2387
2394
|
padding: 8px;
|
|
2388
2395
|
}
|
|
2389
2396
|
|
|
@@ -2449,7 +2456,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2449
2456
|
|
|
2450
2457
|
.edit-site-site-hub__view-mode-toggle-container {
|
|
2451
2458
|
height: 60px;
|
|
2452
|
-
width:
|
|
2459
|
+
width: 60px;
|
|
2453
2460
|
flex-shrink: 0;
|
|
2454
2461
|
background: #1e1e1e;
|
|
2455
2462
|
}
|
|
@@ -2464,6 +2471,10 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2464
2471
|
overflow: hidden;
|
|
2465
2472
|
}
|
|
2466
2473
|
|
|
2474
|
+
.edit-site-site-hub__site-title {
|
|
2475
|
+
margin-left: 4px;
|
|
2476
|
+
}
|
|
2477
|
+
|
|
2467
2478
|
.edit-site-sidebar-navigation-screen__description {
|
|
2468
2479
|
margin: 0 0 32px 16px;
|
|
2469
2480
|
}
|
|
@@ -2516,6 +2527,10 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2516
2527
|
color: #fff;
|
|
2517
2528
|
}
|
|
2518
2529
|
|
|
2530
|
+
.edit-site-sidebar-navigation-screen-navigation-menus__content .popover-slot .wp-block-navigation-submenu {
|
|
2531
|
+
display: none;
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2519
2534
|
.edit-site-site-icon__icon {
|
|
2520
2535
|
fill: currentColor;
|
|
2521
2536
|
}
|
|
@@ -2554,53 +2569,12 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2554
2569
|
bottom: 0;
|
|
2555
2570
|
left: 0;
|
|
2556
2571
|
overflow: auto;
|
|
2557
|
-
padding:
|
|
2572
|
+
padding: 0;
|
|
2558
2573
|
position: absolute;
|
|
2559
2574
|
right: 0;
|
|
2560
2575
|
top: 48px;
|
|
2561
2576
|
}
|
|
2562
2577
|
|
|
2563
|
-
.edit-site-style-book__examples {
|
|
2564
|
-
max-width: 900px;
|
|
2565
|
-
margin: 0 auto;
|
|
2566
|
-
}
|
|
2567
|
-
|
|
2568
|
-
.edit-site-style-book__example {
|
|
2569
|
-
background: none;
|
|
2570
|
-
border-radius: 2px;
|
|
2571
|
-
border: none;
|
|
2572
|
-
color: inherit;
|
|
2573
|
-
cursor: pointer;
|
|
2574
|
-
display: flex;
|
|
2575
|
-
flex-direction: column;
|
|
2576
|
-
gap: 40px;
|
|
2577
|
-
margin-bottom: 40px;
|
|
2578
|
-
padding: 16px;
|
|
2579
|
-
width: 100%;
|
|
2580
|
-
}
|
|
2581
|
-
.edit-site-style-book__example.is-selected {
|
|
2582
|
-
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
|
|
2583
|
-
}
|
|
2584
|
-
.edit-site-style-book.is-wide .edit-site-style-book__example {
|
|
2585
|
-
flex-direction: row;
|
|
2586
|
-
}
|
|
2587
|
-
|
|
2588
|
-
.edit-site-style-book__example-title {
|
|
2589
|
-
font-size: 11px;
|
|
2590
|
-
font-weight: 500;
|
|
2591
|
-
margin: 0;
|
|
2592
|
-
text-align: left;
|
|
2593
|
-
text-transform: uppercase;
|
|
2594
|
-
}
|
|
2595
|
-
.edit-site-style-book.is-wide .edit-site-style-book__example-title {
|
|
2596
|
-
text-align: right;
|
|
2597
|
-
width: 120px;
|
|
2598
|
-
}
|
|
2599
|
-
|
|
2600
|
-
.edit-site-style-book__example-preview {
|
|
2601
|
-
width: 100%;
|
|
2602
|
-
}
|
|
2603
|
-
|
|
2604
2578
|
.edit-site-push-changes-to-global-styles-control .components-button {
|
|
2605
2579
|
justify-content: center;
|
|
2606
2580
|
width: 100%;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.9",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -29,33 +29,33 @@
|
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
30
|
"@wordpress/a11y": "^3.26.1",
|
|
31
31
|
"@wordpress/api-fetch": "^6.23.1",
|
|
32
|
-
"@wordpress/block-editor": "^11.3.
|
|
33
|
-
"@wordpress/block-library": "^8.3.
|
|
32
|
+
"@wordpress/block-editor": "^11.3.9",
|
|
33
|
+
"@wordpress/block-library": "^8.3.9",
|
|
34
34
|
"@wordpress/blocks": "^12.3.3",
|
|
35
|
-
"@wordpress/components": "^23.3.
|
|
35
|
+
"@wordpress/components": "^23.3.6",
|
|
36
36
|
"@wordpress/compose": "^6.3.3",
|
|
37
37
|
"@wordpress/core-data": "^6.3.3",
|
|
38
38
|
"@wordpress/data": "^8.3.3",
|
|
39
39
|
"@wordpress/deprecated": "^3.26.1",
|
|
40
|
-
"@wordpress/editor": "^13.3.
|
|
40
|
+
"@wordpress/editor": "^13.3.9",
|
|
41
41
|
"@wordpress/element": "^5.3.2",
|
|
42
42
|
"@wordpress/hooks": "^3.26.1",
|
|
43
43
|
"@wordpress/html-entities": "^3.26.1",
|
|
44
44
|
"@wordpress/i18n": "^4.26.1",
|
|
45
45
|
"@wordpress/icons": "^9.17.2",
|
|
46
|
-
"@wordpress/interface": "^5.3.
|
|
46
|
+
"@wordpress/interface": "^5.3.7",
|
|
47
47
|
"@wordpress/keyboard-shortcuts": "^4.3.3",
|
|
48
48
|
"@wordpress/keycodes": "^3.26.2",
|
|
49
49
|
"@wordpress/media-utils": "^4.17.2",
|
|
50
50
|
"@wordpress/notices": "^3.26.3",
|
|
51
51
|
"@wordpress/plugins": "^5.3.3",
|
|
52
|
-
"@wordpress/preferences": "^3.3.
|
|
52
|
+
"@wordpress/preferences": "^3.3.6",
|
|
53
53
|
"@wordpress/private-apis": "^0.8.1",
|
|
54
|
-
"@wordpress/reusable-blocks": "^4.3.
|
|
54
|
+
"@wordpress/reusable-blocks": "^4.3.9",
|
|
55
55
|
"@wordpress/style-engine": "^1.9.1",
|
|
56
56
|
"@wordpress/url": "^3.27.1",
|
|
57
57
|
"@wordpress/viewport": "^5.3.3",
|
|
58
|
-
"@wordpress/widgets": "^3.3.
|
|
58
|
+
"@wordpress/widgets": "^3.3.9",
|
|
59
59
|
"classnames": "^2.3.1",
|
|
60
60
|
"colord": "^2.9.2",
|
|
61
61
|
"downloadjs": "^1.4.7",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "f22a3cbf0cd8f48c7ef800a09b69212a893b99b8"
|
|
77
77
|
}
|