@wordpress/block-library 9.30.1-next.836ecdcae.0 → 9.31.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/button/edit.js +6 -1
- package/build/button/edit.js.map +1 -1
- package/build/button/edit.native.js +1 -1
- package/build/button/edit.native.js.map +1 -1
- package/build/buttons/index.js +2 -1
- package/build/buttons/index.js.map +1 -1
- package/build/categories/edit.js +3 -1
- package/build/categories/edit.js.map +1 -1
- package/build/image/edit.native.js +1 -1
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +5 -8
- package/build/image/image.js.map +1 -1
- package/build/image/save.js +6 -2
- package/build/image/save.js.map +1 -1
- package/build/index.js +4 -0
- package/build/index.js.map +1 -1
- package/build/navigation/edit/index.js +0 -1
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation-link/block-inserter.js +69 -0
- package/build/navigation-link/block-inserter.js.map +1 -0
- package/build/navigation-link/dialog-wrapper.js +80 -0
- package/build/navigation-link/dialog-wrapper.js.map +1 -0
- package/build/navigation-link/link-ui.js +34 -82
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-link/page-creator.js +12 -18
- package/build/navigation-link/page-creator.js.map +1 -1
- package/build/post-date/edit.js +2 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +7 -2
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-title/edit.js +8 -2
- package/build/post-title/edit.js.map +1 -1
- package/build/query/edit/pattern-selection.js +9 -1
- package/build/query/edit/pattern-selection.js.map +1 -1
- package/build/query/index.js +2 -1
- package/build/query/index.js.map +1 -1
- package/build/rss/edit.js +6 -1
- package/build/rss/edit.js.map +1 -1
- package/build/site-tagline/index.js +1 -0
- package/build/site-tagline/index.js.map +1 -1
- package/build/social-link/edit.js +6 -1
- package/build/social-link/edit.js.map +1 -1
- package/build/social-links/index.js +2 -1
- package/build/social-links/index.js.map +1 -1
- package/build/spacer/edit.js +2 -1
- package/build/spacer/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +33 -9
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/index.js +4 -0
- package/build/table-of-contents/index.js.map +1 -1
- package/build/table-of-contents/list.js +6 -3
- package/build/table-of-contents/list.js.map +1 -1
- package/build/table-of-contents/save.js +6 -3
- package/build/table-of-contents/save.js.map +1 -1
- package/build/term-template/edit.js +318 -0
- package/build/term-template/edit.js.map +1 -0
- package/build/term-template/index.js +109 -0
- package/build/term-template/index.js.map +1 -0
- package/build/term-template/save.js +16 -0
- package/build/term-template/save.js.map +1 -0
- package/build/term-template/variations.js +83 -0
- package/build/term-template/variations.js.map +1 -0
- package/build/terms-query/edit.js +20 -0
- package/build/terms-query/edit.js.map +1 -0
- package/build/terms-query/index.js +83 -0
- package/build/terms-query/index.js.map +1 -0
- package/build/terms-query/inspector-controls.js +231 -0
- package/build/terms-query/inspector-controls.js.map +1 -0
- package/build/terms-query/save.js +24 -0
- package/build/terms-query/save.js.map +1 -0
- package/build/terms-query/terms-query-content.js +71 -0
- package/build/terms-query/terms-query-content.js.map +1 -0
- package/build/utils/hooks.js +3 -0
- package/build/utils/hooks.js.map +1 -1
- package/build-module/button/edit.js +7 -2
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/edit.native.js +1 -1
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/buttons/index.js +2 -1
- package/build-module/buttons/index.js.map +1 -1
- package/build-module/categories/edit.js +3 -1
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/image/edit.native.js +1 -1
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +5 -8
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/save.js +6 -2
- package/build-module/image/save.js.map +1 -1
- package/build-module/index.js +4 -0
- package/build-module/index.js.map +1 -1
- package/build-module/navigation/edit/index.js +0 -1
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation-link/block-inserter.js +61 -0
- package/build-module/navigation-link/block-inserter.js.map +1 -0
- package/build-module/navigation-link/dialog-wrapper.js +75 -0
- package/build-module/navigation-link/dialog-wrapper.js.map +1 -0
- package/build-module/navigation-link/link-ui.js +37 -85
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-link/page-creator.js +12 -19
- package/build-module/navigation-link/page-creator.js.map +1 -1
- package/build-module/post-date/edit.js +3 -2
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +9 -4
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-title/edit.js +9 -3
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/query/edit/pattern-selection.js +9 -1
- package/build-module/query/edit/pattern-selection.js.map +1 -1
- package/build-module/query/index.js +2 -1
- package/build-module/query/index.js.map +1 -1
- package/build-module/rss/edit.js +8 -3
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/site-tagline/index.js +1 -0
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/social-link/edit.js +8 -3
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-links/index.js +2 -1
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/spacer/edit.js +3 -2
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +35 -11
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/index.js +4 -0
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/table-of-contents/list.js +6 -3
- package/build-module/table-of-contents/list.js.map +1 -1
- package/build-module/table-of-contents/save.js +6 -3
- package/build-module/table-of-contents/save.js.map +1 -1
- package/build-module/term-template/edit.js +310 -0
- package/build-module/term-template/edit.js.map +1 -0
- package/build-module/term-template/index.js +102 -0
- package/build-module/term-template/index.js.map +1 -0
- package/build-module/term-template/save.js +9 -0
- package/build-module/term-template/save.js.map +1 -0
- package/build-module/term-template/variations.js +76 -0
- package/build-module/term-template/variations.js.map +1 -0
- package/build-module/terms-query/edit.js +12 -0
- package/build-module/terms-query/edit.js.map +1 -0
- package/build-module/terms-query/index.js +76 -0
- package/build-module/terms-query/index.js.map +1 -0
- package/build-module/terms-query/inspector-controls.js +224 -0
- package/build-module/terms-query/inspector-controls.js.map +1 -0
- package/build-module/terms-query/save.js +17 -0
- package/build-module/terms-query/save.js.map +1 -0
- package/build-module/terms-query/terms-query-content.js +63 -0
- package/build-module/terms-query/terms-query-content.js.map +1 -0
- package/build-module/utils/hooks.js +3 -0
- package/build-module/utils/hooks.js.map +1 -1
- package/build-style/editor-rtl.css +24 -0
- package/build-style/editor.css +24 -0
- package/build-style/style-rtl.css +16 -0
- package/build-style/style.css +16 -0
- package/build-style/term-template/editor-rtl.css +160 -0
- package/build-style/term-template/editor.css +160 -0
- package/build-style/term-template/style-rtl.css +146 -0
- package/build-style/term-template/style.css +146 -0
- package/build-style/terms-query/style-rtl.css +140 -0
- package/build-style/terms-query/style.css +140 -0
- package/build-types/table-of-contents/list.d.ts +2 -1
- package/build-types/table-of-contents/list.d.ts.map +1 -1
- package/package.json +35 -35
- package/src/button/edit.js +12 -1
- package/src/button/edit.native.js +1 -1
- package/src/buttons/block.json +2 -1
- package/src/categories/edit.js +2 -1
- package/src/editor.scss +1 -0
- package/src/image/edit.native.js +1 -1
- package/src/image/image.js +5 -8
- package/src/image/save.js +7 -1
- package/src/index.js +4 -0
- package/src/navigation/edit/index.js +0 -1
- package/src/navigation-link/block-inserter.js +65 -0
- package/src/navigation-link/dialog-wrapper.js +74 -0
- package/src/navigation-link/link-ui.js +32 -95
- package/src/navigation-link/page-creator.js +13 -20
- package/src/post-date/edit.js +64 -53
- package/src/post-date/index.php +5 -13
- package/src/post-featured-image/edit.js +19 -3
- package/src/post-title/edit.js +14 -2
- package/src/query/block.json +2 -1
- package/src/query/edit/pattern-selection.js +10 -1
- package/src/rss/edit.js +13 -2
- package/src/site-tagline/block.json +1 -0
- package/src/social-link/edit.js +13 -2
- package/src/social-links/block.json +2 -1
- package/src/spacer/edit.js +5 -1
- package/src/style.scss +2 -0
- package/src/table-of-contents/block.json +4 -0
- package/src/table-of-contents/edit.js +58 -21
- package/src/table-of-contents/list.tsx +7 -2
- package/src/table-of-contents/save.js +7 -3
- package/src/term-template/block.json +73 -0
- package/src/term-template/edit.js +391 -0
- package/src/term-template/editor.scss +26 -0
- package/src/term-template/index.js +26 -0
- package/src/term-template/index.php +224 -0
- package/src/term-template/save.js +8 -0
- package/src/term-template/style.scss +12 -0
- package/src/term-template/variations.js +87 -0
- package/src/terms-query/block.json +49 -0
- package/src/terms-query/edit.js +10 -0
- package/src/terms-query/index.js +24 -0
- package/src/terms-query/index.php +44 -0
- package/src/terms-query/inspector-controls.js +239 -0
- package/src/terms-query/save.js +10 -0
- package/src/terms-query/style.scss +6 -0
- package/src/terms-query/terms-query-content.js +74 -0
- package/src/utils/hooks.js +4 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, RangeControl, SelectControl, ToggleControl } from '@wordpress/components';
|
|
6
|
+
import { InspectorControls, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
7
|
+
import { useSelect } from '@wordpress/data';
|
|
8
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
14
|
+
import { unlock } from '../lock-unlock';
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
|
+
const {
|
|
17
|
+
HTMLElementControl
|
|
18
|
+
} = unlock(blockEditorPrivateApis);
|
|
19
|
+
export default function TermsQueryInspectorControls({
|
|
20
|
+
attributes,
|
|
21
|
+
setQuery,
|
|
22
|
+
setAttributes,
|
|
23
|
+
TagName,
|
|
24
|
+
clientId
|
|
25
|
+
}) {
|
|
26
|
+
const {
|
|
27
|
+
termQuery
|
|
28
|
+
} = attributes;
|
|
29
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
30
|
+
const {
|
|
31
|
+
taxonomies
|
|
32
|
+
} = useSelect(select => {
|
|
33
|
+
const {
|
|
34
|
+
getEntityRecords
|
|
35
|
+
} = select(coreStore);
|
|
36
|
+
const allTaxonomies = getEntityRecords('root', 'taxonomy');
|
|
37
|
+
return {
|
|
38
|
+
taxonomies: allTaxonomies?.filter(t => t.visibility.public) || []
|
|
39
|
+
};
|
|
40
|
+
}, []);
|
|
41
|
+
const taxonomyOptions = taxonomies.map(taxonomy => ({
|
|
42
|
+
label: taxonomy.name,
|
|
43
|
+
value: taxonomy.slug
|
|
44
|
+
}));
|
|
45
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
46
|
+
children: [/*#__PURE__*/_jsx(InspectorControls, {
|
|
47
|
+
children: /*#__PURE__*/_jsxs(ToolsPanel, {
|
|
48
|
+
label: __('Terms Query Settings'),
|
|
49
|
+
resetAll: () => {
|
|
50
|
+
setAttributes({
|
|
51
|
+
termQuery: {
|
|
52
|
+
taxonomy: 'category',
|
|
53
|
+
order: 'asc',
|
|
54
|
+
orderBy: 'name',
|
|
55
|
+
hideEmpty: true,
|
|
56
|
+
hierarchical: false,
|
|
57
|
+
parent: 0,
|
|
58
|
+
perPage: 10
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
63
|
+
children: [/*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
64
|
+
hasValue: () => termQuery.taxonomy !== 'category',
|
|
65
|
+
label: __('Taxonomy'),
|
|
66
|
+
onDeselect: () => setQuery({
|
|
67
|
+
taxonomy: 'category'
|
|
68
|
+
}),
|
|
69
|
+
isShownByDefault: true,
|
|
70
|
+
children: /*#__PURE__*/_jsx(SelectControl, {
|
|
71
|
+
__nextHasNoMarginBottom: true,
|
|
72
|
+
__next40pxDefaultSize: true,
|
|
73
|
+
label: __('Taxonomy'),
|
|
74
|
+
options: taxonomyOptions,
|
|
75
|
+
value: termQuery.taxonomy,
|
|
76
|
+
onChange: selectedTaxonomy => setQuery({
|
|
77
|
+
taxonomy: selectedTaxonomy
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
}), /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
81
|
+
hasValue: () => termQuery.orderBy !== 'name' || termQuery.order !== 'asc',
|
|
82
|
+
label: __('Order by'),
|
|
83
|
+
onDeselect: () => setQuery({
|
|
84
|
+
orderBy: 'name',
|
|
85
|
+
order: 'asc'
|
|
86
|
+
}),
|
|
87
|
+
isShownByDefault: true,
|
|
88
|
+
children: /*#__PURE__*/_jsx(SelectControl, {
|
|
89
|
+
__nextHasNoMarginBottom: true,
|
|
90
|
+
__next40pxDefaultSize: true,
|
|
91
|
+
label: __('Order by'),
|
|
92
|
+
options: [{
|
|
93
|
+
label: __('Name: A → Z'),
|
|
94
|
+
value: 'name/asc'
|
|
95
|
+
}, {
|
|
96
|
+
label: __('Name: Z → A'),
|
|
97
|
+
value: 'name/desc'
|
|
98
|
+
}, {
|
|
99
|
+
label: __('Count, high to low'),
|
|
100
|
+
value: 'count/desc'
|
|
101
|
+
}, {
|
|
102
|
+
label: __('Count, low to high'),
|
|
103
|
+
value: 'count/asc'
|
|
104
|
+
}],
|
|
105
|
+
value: termQuery.orderBy + '/' + termQuery.order,
|
|
106
|
+
onChange: orderBy => {
|
|
107
|
+
const [newOrderBy, newOrder] = orderBy.split('/');
|
|
108
|
+
setQuery({
|
|
109
|
+
orderBy: newOrderBy,
|
|
110
|
+
order: newOrder
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
}), /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
115
|
+
hasValue: () => termQuery.parent !== 0,
|
|
116
|
+
label: __('Show only top level terms'),
|
|
117
|
+
onDeselect: () => setQuery({
|
|
118
|
+
parent: 0
|
|
119
|
+
}),
|
|
120
|
+
isShownByDefault: true,
|
|
121
|
+
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
122
|
+
__nextHasNoMarginBottom: true,
|
|
123
|
+
label: __('Show only top level terms'),
|
|
124
|
+
checked: termQuery.parent === 0,
|
|
125
|
+
onChange: showTopLevel => {
|
|
126
|
+
setQuery({
|
|
127
|
+
parent: showTopLevel ? 0 : undefined
|
|
128
|
+
});
|
|
129
|
+
if (showTopLevel && termQuery.hierarchical) {
|
|
130
|
+
setQuery({
|
|
131
|
+
hierarchical: false
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
disabled: !!termQuery.hierarchical
|
|
136
|
+
})
|
|
137
|
+
}), /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
138
|
+
hasValue: () => termQuery.hideEmpty !== true,
|
|
139
|
+
label: __('Show empty terms'),
|
|
140
|
+
onDeselect: () => setQuery({
|
|
141
|
+
hideEmpty: true
|
|
142
|
+
}),
|
|
143
|
+
isShownByDefault: true,
|
|
144
|
+
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
145
|
+
__nextHasNoMarginBottom: true,
|
|
146
|
+
label: __('Show empty terms'),
|
|
147
|
+
checked: !termQuery.hideEmpty,
|
|
148
|
+
onChange: showEmpty => setQuery({
|
|
149
|
+
hideEmpty: !showEmpty
|
|
150
|
+
})
|
|
151
|
+
})
|
|
152
|
+
}), /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
153
|
+
hasValue: () => termQuery.hierarchical !== false,
|
|
154
|
+
label: __('Show hierarchy'),
|
|
155
|
+
onDeselect: () => setQuery({
|
|
156
|
+
hierarchical: false
|
|
157
|
+
}),
|
|
158
|
+
isShownByDefault: true,
|
|
159
|
+
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
160
|
+
__nextHasNoMarginBottom: true,
|
|
161
|
+
label: __('Show hierarchy'),
|
|
162
|
+
checked: termQuery.hierarchical,
|
|
163
|
+
onChange: hierarchical => {
|
|
164
|
+
setQuery({
|
|
165
|
+
hierarchical
|
|
166
|
+
});
|
|
167
|
+
if (hierarchical && termQuery.parent) {
|
|
168
|
+
setQuery({
|
|
169
|
+
parent: 0
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
disabled: termQuery.parent === 0
|
|
174
|
+
})
|
|
175
|
+
}), !termQuery.hierarchical && /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
176
|
+
hasValue: () => termQuery.perPage !== 10,
|
|
177
|
+
label: __('Max terms'),
|
|
178
|
+
onDeselect: () => setQuery({
|
|
179
|
+
perPage: 10
|
|
180
|
+
}),
|
|
181
|
+
isShownByDefault: true,
|
|
182
|
+
children: /*#__PURE__*/_jsx(RangeControl, {
|
|
183
|
+
__nextHasNoMarginBottom: true,
|
|
184
|
+
__next40pxDefaultSize: true,
|
|
185
|
+
label: __('Max terms'),
|
|
186
|
+
value: termQuery.perPage,
|
|
187
|
+
min: 0,
|
|
188
|
+
max: 100,
|
|
189
|
+
onChange: perPage => {
|
|
190
|
+
// Show all terms (-1) when 0 is selected.
|
|
191
|
+
setQuery({
|
|
192
|
+
perPage: perPage === 0 ? -1 : perPage
|
|
193
|
+
});
|
|
194
|
+
},
|
|
195
|
+
help: __('Limit the number of terms you want to show. To show all terms, use 0 (zero).')
|
|
196
|
+
})
|
|
197
|
+
})]
|
|
198
|
+
})
|
|
199
|
+
}), /*#__PURE__*/_jsx(InspectorControls, {
|
|
200
|
+
group: "advanced",
|
|
201
|
+
children: /*#__PURE__*/_jsx(HTMLElementControl, {
|
|
202
|
+
tagName: TagName,
|
|
203
|
+
onChange: value => setAttributes({
|
|
204
|
+
tagName: value
|
|
205
|
+
}),
|
|
206
|
+
clientId: clientId,
|
|
207
|
+
options: [{
|
|
208
|
+
label: __('Default (<div>)'),
|
|
209
|
+
value: 'div'
|
|
210
|
+
}, {
|
|
211
|
+
label: '<main>',
|
|
212
|
+
value: 'main'
|
|
213
|
+
}, {
|
|
214
|
+
label: '<section>',
|
|
215
|
+
value: 'section'
|
|
216
|
+
}, {
|
|
217
|
+
label: '<aside>',
|
|
218
|
+
value: 'aside'
|
|
219
|
+
}]
|
|
220
|
+
})
|
|
221
|
+
})]
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=inspector-controls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","RangeControl","SelectControl","ToggleControl","InspectorControls","privateApis","blockEditorPrivateApis","useSelect","store","coreStore","useToolsPanelDropdownMenuProps","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","HTMLElementControl","TermsQueryInspectorControls","attributes","setQuery","setAttributes","TagName","clientId","termQuery","dropdownMenuProps","taxonomies","select","getEntityRecords","allTaxonomies","filter","t","visibility","public","taxonomyOptions","map","taxonomy","label","name","value","slug","children","resetAll","order","orderBy","hideEmpty","hierarchical","parent","perPage","hasValue","onDeselect","isShownByDefault","__nextHasNoMarginBottom","__next40pxDefaultSize","options","onChange","selectedTaxonomy","newOrderBy","newOrder","split","checked","showTopLevel","undefined","disabled","showEmpty","min","max","help","group","tagName"],"sources":["@wordpress/block-library/src/terms-query/inspector-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tRangeControl,\n\tSelectControl,\n\tToggleControl,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport { unlock } from '../lock-unlock';\n\nconst { HTMLElementControl } = unlock( blockEditorPrivateApis );\n\nexport default function TermsQueryInspectorControls( {\n\tattributes,\n\tsetQuery,\n\tsetAttributes,\n\tTagName,\n\tclientId,\n} ) {\n\tconst { termQuery } = attributes;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst { taxonomies } = useSelect( ( select ) => {\n\t\tconst { getEntityRecords } = select( coreStore );\n\t\tconst allTaxonomies = getEntityRecords( 'root', 'taxonomy' );\n\t\treturn {\n\t\t\ttaxonomies:\n\t\t\t\tallTaxonomies?.filter( ( t ) => t.visibility.public ) || [],\n\t\t};\n\t}, [] );\n\n\tconst taxonomyOptions = taxonomies.map( ( taxonomy ) => ( {\n\t\tlabel: taxonomy.name,\n\t\tvalue: taxonomy.slug,\n\t} ) );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Terms Query Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttermQuery: {\n\t\t\t\t\t\t\t\ttaxonomy: 'category',\n\t\t\t\t\t\t\t\torder: 'asc',\n\t\t\t\t\t\t\t\torderBy: 'name',\n\t\t\t\t\t\t\t\thideEmpty: true,\n\t\t\t\t\t\t\t\thierarchical: false,\n\t\t\t\t\t\t\t\tparent: 0,\n\t\t\t\t\t\t\t\tperPage: 10,\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\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => termQuery.taxonomy !== 'category' }\n\t\t\t\t\t\tlabel={ __( 'Taxonomy' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetQuery( { taxonomy: 'category' } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Taxonomy' ) }\n\t\t\t\t\t\t\toptions={ taxonomyOptions }\n\t\t\t\t\t\t\tvalue={ termQuery.taxonomy }\n\t\t\t\t\t\t\tonChange={ ( selectedTaxonomy ) =>\n\t\t\t\t\t\t\t\tsetQuery( { taxonomy: selectedTaxonomy } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\ttermQuery.orderBy !== 'name' ||\n\t\t\t\t\t\t\ttermQuery.order !== 'asc'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlabel={ __( 'Order by' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetQuery( { orderBy: 'name', order: 'asc' } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Order by' ) }\n\t\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: __( 'Name: A → Z' ),\n\t\t\t\t\t\t\t\t\tvalue: 'name/asc',\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\tlabel: __( 'Name: Z → A' ),\n\t\t\t\t\t\t\t\t\tvalue: 'name/desc',\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\tlabel: __( 'Count, high to low' ),\n\t\t\t\t\t\t\t\t\tvalue: 'count/desc',\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\tlabel: __( 'Count, low to high' ),\n\t\t\t\t\t\t\t\t\tvalue: 'count/asc',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tvalue={ termQuery.orderBy + '/' + termQuery.order }\n\t\t\t\t\t\t\tonChange={ ( orderBy ) => {\n\t\t\t\t\t\t\t\tconst [ newOrderBy, newOrder ] =\n\t\t\t\t\t\t\t\t\torderBy.split( '/' );\n\t\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\t\torderBy: newOrderBy,\n\t\t\t\t\t\t\t\t\torder: newOrder,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => termQuery.parent !== 0 }\n\t\t\t\t\t\tlabel={ __( 'Show only top level terms' ) }\n\t\t\t\t\t\tonDeselect={ () => setQuery( { parent: 0 } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show only top level terms' ) }\n\t\t\t\t\t\t\tchecked={ termQuery.parent === 0 }\n\t\t\t\t\t\t\tonChange={ ( showTopLevel ) => {\n\t\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\t\tparent: showTopLevel ? 0 : undefined,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\tif ( showTopLevel && termQuery.hierarchical ) {\n\t\t\t\t\t\t\t\t\tsetQuery( { hierarchical: false } );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tdisabled={ !! termQuery.hierarchical }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => termQuery.hideEmpty !== true }\n\t\t\t\t\t\tlabel={ __( 'Show empty terms' ) }\n\t\t\t\t\t\tonDeselect={ () => setQuery( { hideEmpty: true } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show empty terms' ) }\n\t\t\t\t\t\t\tchecked={ ! termQuery.hideEmpty }\n\t\t\t\t\t\t\tonChange={ ( showEmpty ) =>\n\t\t\t\t\t\t\t\tsetQuery( { hideEmpty: ! showEmpty } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => termQuery.hierarchical !== false }\n\t\t\t\t\t\tlabel={ __( 'Show hierarchy' ) }\n\t\t\t\t\t\tonDeselect={ () => setQuery( { hierarchical: false } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show hierarchy' ) }\n\t\t\t\t\t\t\tchecked={ termQuery.hierarchical }\n\t\t\t\t\t\t\tonChange={ ( hierarchical ) => {\n\t\t\t\t\t\t\t\tsetQuery( { hierarchical } );\n\t\t\t\t\t\t\t\tif ( hierarchical && termQuery.parent ) {\n\t\t\t\t\t\t\t\t\tsetQuery( { parent: 0 } );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tdisabled={ termQuery.parent === 0 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t{ ! termQuery.hierarchical && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => termQuery.perPage !== 10 }\n\t\t\t\t\t\t\tlabel={ __( 'Max terms' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { perPage: 10 } ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Max terms' ) }\n\t\t\t\t\t\t\t\tvalue={ termQuery.perPage }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\t\tonChange={ ( perPage ) => {\n\t\t\t\t\t\t\t\t\t// Show all terms (-1) when 0 is selected.\n\t\t\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\t\t\tperPage: perPage === 0 ? -1 : perPage,\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\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Limit the number of terms you want to show. To show all terms, use 0 (zero).'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<HTMLElementControl\n\t\t\t\t\ttagName={ TagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 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IAAI,EAAGxE,EAAE,CACR,8EACD;UAAG,CACH;QAAC,CACa,CAChB;MAAA,CACU;IAAC,CACK,CAAC,eACpBiB,IAAA,CAACT,iBAAiB;MAACiE,KAAK,EAAC,UAAU;MAAA3B,QAAA,eAClC7B,IAAA,CAACK,kBAAkB;QAClBoD,OAAO,EAAG/C,OAAS;QACnBiC,QAAQ,EAAKhB,KAAK,IACjBlB,aAAa,CAAE;UAAEgD,OAAO,EAAE9B;QAAM,CAAE,CAClC;QACDhB,QAAQ,EAAGA,QAAU;QACrB+B,OAAO,EAAG,CACT;UAAEjB,KAAK,EAAE1C,EAAE,CAAE,iBAAkB,CAAC;UAAE4C,KAAK,EAAE;QAAM,CAAC,EAChD;UAAEF,KAAK,EAAE,QAAQ;UAAEE,KAAK,EAAE;QAAO,CAAC,EAClC;UAAEF,KAAK,EAAE,WAAW;UAAEE,KAAK,EAAE;QAAU,CAAC,EACxC;UAAEF,KAAK,EAAE,SAAS;UAAEE,KAAK,EAAE;QAAQ,CAAC;MAClC,CACH;IAAC,CACgB,CAAC;EAAA,CACnB,CAAC;AAEL","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useInnerBlocksProps, useBlockProps } from '@wordpress/block-editor';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export default function save({
|
|
7
|
+
attributes: {
|
|
8
|
+
tagName: Tag = 'div'
|
|
9
|
+
}
|
|
10
|
+
}) {
|
|
11
|
+
const blockProps = useBlockProps.save();
|
|
12
|
+
const innerBlocksProps = useInnerBlocksProps.save(blockProps);
|
|
13
|
+
return /*#__PURE__*/_jsx(Tag, {
|
|
14
|
+
...innerBlocksProps
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=save.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useInnerBlocksProps","useBlockProps","jsx","_jsx","save","attributes","tagName","Tag","blockProps","innerBlocksProps"],"sources":["@wordpress/block-library/src/terms-query/save.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInnerBlocksProps, useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes: { tagName: Tag = 'div' } } ) {\n\tconst blockProps = useBlockProps.save();\n\tconst innerBlocksProps = useInnerBlocksProps.save( blockProps );\n\treturn <Tag { ...innerBlocksProps } />;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,mBAAmB,EAAEC,aAAa,QAAQ,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE7E,eAAe,SAASC,IAAIA,CAAE;EAAEC,UAAU,EAAE;IAAEC,OAAO,EAAEC,GAAG,GAAG;EAAM;AAAE,CAAC,EAAG;EACxE,MAAMC,UAAU,GAAGP,aAAa,CAACG,IAAI,CAAC,CAAC;EACvC,MAAMK,gBAAgB,GAAGT,mBAAmB,CAACI,IAAI,CAAEI,UAAW,CAAC;EAC/D,oBAAOL,IAAA,CAACI,GAAG;IAAA,GAAME;EAAgB,CAAI,CAAC;AACvC","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useDispatch } from '@wordpress/data';
|
|
5
|
+
import { useInstanceId } from '@wordpress/compose';
|
|
6
|
+
import { useEffect } from '@wordpress/element';
|
|
7
|
+
import { useBlockProps, store as blockEditorStore, useInnerBlocksProps } from '@wordpress/block-editor';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import TermsQueryInspectorControls from './inspector-controls';
|
|
13
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
const TEMPLATE = [['core/term-template']];
|
|
15
|
+
export default function TermsQueryContent({
|
|
16
|
+
attributes,
|
|
17
|
+
setAttributes,
|
|
18
|
+
clientId,
|
|
19
|
+
name
|
|
20
|
+
}) {
|
|
21
|
+
const {
|
|
22
|
+
termQueryId,
|
|
23
|
+
termQuery = {},
|
|
24
|
+
tagName: TagName = 'div'
|
|
25
|
+
} = attributes;
|
|
26
|
+
const {
|
|
27
|
+
__unstableMarkNextChangeAsNotPersistent
|
|
28
|
+
} = useDispatch(blockEditorStore);
|
|
29
|
+
const instanceId = useInstanceId(TermsQueryContent);
|
|
30
|
+
const blockProps = useBlockProps();
|
|
31
|
+
const innerBlocksProps = useInnerBlocksProps(blockProps, {
|
|
32
|
+
template: TEMPLATE
|
|
33
|
+
});
|
|
34
|
+
const setQuery = newQuery => {
|
|
35
|
+
setAttributes({
|
|
36
|
+
termQuery: {
|
|
37
|
+
...termQuery,
|
|
38
|
+
...newQuery
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (!termQueryId) {
|
|
44
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
45
|
+
setAttributes({
|
|
46
|
+
termQueryId: instanceId
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}, [termQueryId, instanceId, setAttributes, __unstableMarkNextChangeAsNotPersistent]);
|
|
50
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
51
|
+
children: [/*#__PURE__*/_jsx(TermsQueryInspectorControls, {
|
|
52
|
+
name: name,
|
|
53
|
+
attributes: attributes,
|
|
54
|
+
setQuery: setQuery,
|
|
55
|
+
setAttributes: setAttributes,
|
|
56
|
+
clientId: clientId,
|
|
57
|
+
tagName: TagName
|
|
58
|
+
}), /*#__PURE__*/_jsx(TagName, {
|
|
59
|
+
...innerBlocksProps
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=terms-query-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useDispatch","useInstanceId","useEffect","useBlockProps","store","blockEditorStore","useInnerBlocksProps","TermsQueryInspectorControls","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","TEMPLATE","TermsQueryContent","attributes","setAttributes","clientId","name","termQueryId","termQuery","tagName","TagName","__unstableMarkNextChangeAsNotPersistent","instanceId","blockProps","innerBlocksProps","template","setQuery","newQuery","children"],"sources":["@wordpress/block-library/src/terms-query/terms-query-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TermsQueryInspectorControls from './inspector-controls';\n\nconst TEMPLATE = [ [ 'core/term-template' ] ];\n\nexport default function TermsQueryContent( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tname,\n} ) {\n\tconst {\n\t\ttermQueryId,\n\t\ttermQuery = {},\n\t\ttagName: TagName = 'div',\n\t} = attributes;\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst instanceId = useInstanceId( TermsQueryContent );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\n\tconst setQuery = ( newQuery ) => {\n\t\tsetAttributes( {\n\t\t\ttermQuery: {\n\t\t\t\t...termQuery,\n\t\t\t\t...newQuery,\n\t\t\t},\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! termQueryId ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { termQueryId: instanceId } );\n\t\t}\n\t}, [\n\t\ttermQueryId,\n\t\tinstanceId,\n\t\tsetAttributes,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t] );\n\n\treturn (\n\t\t<>\n\t\t\t<TermsQueryInspectorControls\n\t\t\t\tname={ name }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetQuery={ setQuery }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tclientId={ clientId }\n\t\t\t\ttagName={ TagName }\n\t\t\t/>\n\t\t\t<TagName { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SACCC,aAAa,EACbC,KAAK,IAAIC,gBAAgB,EACzBC,mBAAmB,QACb,yBAAyB;;AAEhC;AACA;AACA;AACA,OAAOC,2BAA2B,MAAM,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE/D,MAAMC,QAAQ,GAAG,CAAE,CAAE,oBAAoB,CAAE,CAAE;AAE7C,eAAe,SAASC,iBAAiBA,CAAE;EAC1CC,UAAU;EACVC,aAAa;EACbC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM;IACLC,WAAW;IACXC,SAAS,GAAG,CAAC,CAAC;IACdC,OAAO,EAAEC,OAAO,GAAG;EACpB,CAAC,GAAGP,UAAU;EAEd,MAAM;IAAEQ;EAAwC,CAAC,GAChDxB,WAAW,CAAEK,gBAAiB,CAAC;EAChC,MAAMoB,UAAU,GAAGxB,aAAa,CAAEc,iBAAkB,CAAC;EACrD,MAAMW,UAAU,GAAGvB,aAAa,CAAC,CAAC;EAClC,MAAMwB,gBAAgB,GAAGrB,mBAAmB,CAAEoB,UAAU,EAAE;IACzDE,QAAQ,EAAEd;EACX,CAAE,CAAC;EAEH,MAAMe,QAAQ,GAAKC,QAAQ,IAAM;IAChCb,aAAa,CAAE;MACdI,SAAS,EAAE;QACV,GAAGA,SAAS;QACZ,GAAGS;MACJ;IACD,CAAE,CAAC;EACJ,CAAC;EAED5B,SAAS,CAAE,MAAM;IAChB,IAAK,CAAEkB,WAAW,EAAG;MACpBI,uCAAuC,CAAC,CAAC;MACzCP,aAAa,CAAE;QAAEG,WAAW,EAAEK;MAAW,CAAE,CAAC;IAC7C;EACD,CAAC,EAAE,CACFL,WAAW,EACXK,UAAU,EACVR,aAAa,EACbO,uCAAuC,CACtC,CAAC;EAEH,oBACCX,KAAA,CAAAF,SAAA;IAAAoB,QAAA,gBACCtB,IAAA,CAACF,2BAA2B;MAC3BY,IAAI,EAAGA,IAAM;MACbH,UAAU,EAAGA,UAAY;MACzBa,QAAQ,EAAGA,QAAU;MACrBZ,aAAa,EAAGA,aAAe;MAC/BC,QAAQ,EAAGA,QAAU;MACrBI,OAAO,EAAGC;IAAS,CACnB,CAAC,eACFd,IAAA,CAACc,OAAO;MAAA,GAAMI;IAAgB,CAAI,CAAC;EAAA,CAClC,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useLayoutEffect","useEffect","useRef","getBlobByURL","isBlobURL","revokeBlobURL","store","blockEditorStore","coreStore","useViewportMatch","useCanEditEntity","kind","name","recordId","select","canUser","id","useUploadMediaFromBlobURL","args","latestArgsRef","hasUploadStartedRef","getSettings","current","url","file","allowedTypes","onChange","onError","mediaUpload","filesList","onFileChange","media","message","useToolsPanelDropdownMenuProps","isMobile","popoverProps","placement","offset"],"sources":["@wordpress/block-library/src/utils/hooks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useLayoutEffect, useEffect, useRef } from '@wordpress/element';\nimport { getBlobByURL, isBlobURL, revokeBlobURL } from '@wordpress/blob';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Returns whether the current user can edit the given entity.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {string} recordId Record's id.\n */\nexport function useCanEditEntity( kind, name, recordId ) {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).canUser( 'update', {\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\tid: recordId,\n\t\t\t} ),\n\t\t[ kind, name, recordId ]\n\t);\n}\n\n/**\n * Handles uploading a media file from a blob URL on mount.\n *\n * @param {Object} args Upload media arguments.\n * @param {string} args.url Blob URL.\n * @param {?Array} args.allowedTypes Array of allowed media types.\n * @param {Function} args.onChange Function called when the media is uploaded.\n * @param {Function} args.onError Function called when an error happens.\n */\nexport function useUploadMediaFromBlobURL( args = {} ) {\n\tconst latestArgsRef = useRef( args );\n\tconst hasUploadStartedRef = useRef( false );\n\tconst { getSettings } = useSelect( blockEditorStore );\n\n\tuseLayoutEffect( () => {\n\t\tlatestArgsRef.current = args;\n\t} );\n\n\tuseEffect( () => {\n\t\t// Uploading is a special effect that can't be canceled via the cleanup method.\n\t\t// The extra check avoids duplicate uploads in development mode (React.StrictMode).\n\t\tif ( hasUploadStartedRef.current ) {\n\t\t\treturn;\n\t\t}\n\t\tif (\n\t\t\t! latestArgsRef.current.url ||\n\t\t\t! isBlobURL( latestArgsRef.current.url )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst file = getBlobByURL( latestArgsRef.current.url );\n\t\tif ( ! file ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { url, allowedTypes, onChange, onError } = latestArgsRef.current;\n\t\tconst { mediaUpload } = getSettings();\n\n\t\thasUploadStartedRef.current = true;\n\n\t\tmediaUpload( {\n\t\t\tfilesList: [ file ],\n\t\t\tallowedTypes,\n\t\t\tonFileChange: ( [ media ] ) => {\n\t\t\t\tif ( isBlobURL( media?.url ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trevokeBlobURL( url );\n\t\t\t\tonChange( media );\n\t\t\t\thasUploadStartedRef.current = false;\n\t\t\t},\n\t\t\tonError: ( message ) => {\n\t\t\t\trevokeBlobURL( url );\n\t\t\t\tonError( message );\n\t\t\t\thasUploadStartedRef.current = false;\n\t\t\t},\n\t\t} );\n\t}, [ getSettings ] );\n}\n\nexport function useToolsPanelDropdownMenuProps() {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn ! isMobile\n\t\t? {\n\t\t\t\tpopoverProps: {\n\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)\n\t\t\t\t\toffset: 259,\n\t\t\t\t},\n\t\t }\n\t\t: {};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,eAAe,EAAEC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACvE,SAASC,YAAY,EAAEC,SAAS,EAAEC,aAAa,QAAQ,iBAAiB;AACxE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASC,gBAAgB,QAAQ,oBAAoB;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAG;EACxD,OAAOd,SAAS,CACbe,MAAM,IACPA,MAAM,CAAEN,SAAU,CAAC,CAACO,OAAO,CAAE,QAAQ,EAAE;IACtCJ,IAAI;IACJC,IAAI;IACJI,EAAE,EAAEH;EACL,CAAE,CAAC,EACJ,CAAEF,IAAI,EAAEC,IAAI,EAAEC,QAAQ,CACvB,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,yBAAyBA,CAAEC,IAAI,GAAG,CAAC,CAAC,EAAG;EACtD,MAAMC,aAAa,GAAGjB,MAAM,CAAEgB,IAAK,CAAC;EACpC,MAAME,mBAAmB,GAAGlB,MAAM,CAAE,KAAM,CAAC;EAC3C,MAAM;IAAEmB;EAAY,CAAC,GAAGtB,SAAS,CAAEQ,gBAAiB,CAAC;EAErDP,eAAe,CAAE,MAAM;IACtBmB,aAAa,CAACG,OAAO,GAAGJ,IAAI;EAC7B,CAAE,CAAC;EAEHjB,SAAS,CAAE,MAAM;IAChB;IACA;IACA,IAAKmB,mBAAmB,CAACE,OAAO,EAAG;MAClC;IACD;IACA,IACC,CAAEH,aAAa,CAACG,OAAO,CAACC,GAAG,IAC3B,CAAEnB,SAAS,CAAEe,aAAa,CAACG,OAAO,CAACC,GAAI,CAAC,EACvC;MACD;IACD;IAEA,MAAMC,IAAI,GAAGrB,YAAY,CAAEgB,aAAa,CAACG,OAAO,CAACC,GAAI,CAAC;IACtD,IAAK,CAAEC,IAAI,EAAG;MACb;IACD;IAEA,MAAM;MAAED,GAAG;MAAEE,YAAY;MAAEC,QAAQ;MAAEC;IAAQ,CAAC,GAAGR,aAAa,CAACG,OAAO;IACtE,MAAM;MAAEM;IAAY,CAAC,GAAGP,WAAW,CAAC,CAAC;
|
|
1
|
+
{"version":3,"names":["useSelect","useLayoutEffect","useEffect","useRef","getBlobByURL","isBlobURL","revokeBlobURL","store","blockEditorStore","coreStore","useViewportMatch","useCanEditEntity","kind","name","recordId","select","canUser","id","useUploadMediaFromBlobURL","args","latestArgsRef","hasUploadStartedRef","getSettings","current","url","file","allowedTypes","onChange","onError","mediaUpload","filesList","onFileChange","media","message","useToolsPanelDropdownMenuProps","isMobile","popoverProps","placement","offset"],"sources":["@wordpress/block-library/src/utils/hooks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useLayoutEffect, useEffect, useRef } from '@wordpress/element';\nimport { getBlobByURL, isBlobURL, revokeBlobURL } from '@wordpress/blob';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Returns whether the current user can edit the given entity.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {string} recordId Record's id.\n */\nexport function useCanEditEntity( kind, name, recordId ) {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).canUser( 'update', {\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\tid: recordId,\n\t\t\t} ),\n\t\t[ kind, name, recordId ]\n\t);\n}\n\n/**\n * Handles uploading a media file from a blob URL on mount.\n *\n * @param {Object} args Upload media arguments.\n * @param {string} args.url Blob URL.\n * @param {?Array} args.allowedTypes Array of allowed media types.\n * @param {Function} args.onChange Function called when the media is uploaded.\n * @param {Function} args.onError Function called when an error happens.\n */\nexport function useUploadMediaFromBlobURL( args = {} ) {\n\tconst latestArgsRef = useRef( args );\n\tconst hasUploadStartedRef = useRef( false );\n\tconst { getSettings } = useSelect( blockEditorStore );\n\n\tuseLayoutEffect( () => {\n\t\tlatestArgsRef.current = args;\n\t} );\n\n\tuseEffect( () => {\n\t\t// Uploading is a special effect that can't be canceled via the cleanup method.\n\t\t// The extra check avoids duplicate uploads in development mode (React.StrictMode).\n\t\tif ( hasUploadStartedRef.current ) {\n\t\t\treturn;\n\t\t}\n\t\tif (\n\t\t\t! latestArgsRef.current.url ||\n\t\t\t! isBlobURL( latestArgsRef.current.url )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst file = getBlobByURL( latestArgsRef.current.url );\n\t\tif ( ! file ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { url, allowedTypes, onChange, onError } = latestArgsRef.current;\n\t\tconst { mediaUpload } = getSettings();\n\n\t\tif ( ! mediaUpload ) {\n\t\t\treturn;\n\t\t}\n\n\t\thasUploadStartedRef.current = true;\n\n\t\tmediaUpload( {\n\t\t\tfilesList: [ file ],\n\t\t\tallowedTypes,\n\t\t\tonFileChange: ( [ media ] ) => {\n\t\t\t\tif ( isBlobURL( media?.url ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trevokeBlobURL( url );\n\t\t\t\tonChange( media );\n\t\t\t\thasUploadStartedRef.current = false;\n\t\t\t},\n\t\t\tonError: ( message ) => {\n\t\t\t\trevokeBlobURL( url );\n\t\t\t\tonError( message );\n\t\t\t\thasUploadStartedRef.current = false;\n\t\t\t},\n\t\t} );\n\t}, [ getSettings ] );\n}\n\nexport function useToolsPanelDropdownMenuProps() {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn ! isMobile\n\t\t? {\n\t\t\t\tpopoverProps: {\n\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)\n\t\t\t\t\toffset: 259,\n\t\t\t\t},\n\t\t }\n\t\t: {};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,eAAe,EAAEC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACvE,SAASC,YAAY,EAAEC,SAAS,EAAEC,aAAa,QAAQ,iBAAiB;AACxE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASC,gBAAgB,QAAQ,oBAAoB;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAG;EACxD,OAAOd,SAAS,CACbe,MAAM,IACPA,MAAM,CAAEN,SAAU,CAAC,CAACO,OAAO,CAAE,QAAQ,EAAE;IACtCJ,IAAI;IACJC,IAAI;IACJI,EAAE,EAAEH;EACL,CAAE,CAAC,EACJ,CAAEF,IAAI,EAAEC,IAAI,EAAEC,QAAQ,CACvB,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,yBAAyBA,CAAEC,IAAI,GAAG,CAAC,CAAC,EAAG;EACtD,MAAMC,aAAa,GA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,mBAAmB,CAACE,OAAO,GAAG,KAAK;MACpC;IACD,CAAE,CAAC;EACJ,CAAC,EAAE,CAAED,WAAW,CAAG,CAAC;AACrB;AAEA,OAAO,SAASY,8BAA8BA,CAAA,EAAG;EAChD,MAAMC,QAAQ,GAAGzB,gBAAgB,CAAE,QAAQ,EAAE,GAAI,CAAC;EAClD,OAAO,CAAEyB,QAAQ,GACd;IACAC,YAAY,EAAE;MACbC,SAAS,EAAE,YAAY;MACvB;MACAC,MAAM,EAAE;IACT;EACA,CAAC,GACD,CAAC,CAAC;AACN","ignoreList":[]}
|
|
@@ -2560,6 +2560,30 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2560
2560
|
border: none;
|
|
2561
2561
|
}
|
|
2562
2562
|
|
|
2563
|
+
.wp-block-term-template .term-loading .term-loading-placeholder {
|
|
2564
|
+
width: 100%;
|
|
2565
|
+
height: 1.5em;
|
|
2566
|
+
margin-bottom: 0.25em;
|
|
2567
|
+
background-color: #f0f0f0;
|
|
2568
|
+
border-radius: 2px;
|
|
2569
|
+
}
|
|
2570
|
+
@media not (prefers-reduced-motion) {
|
|
2571
|
+
.wp-block-term-template .term-loading .term-loading-placeholder {
|
|
2572
|
+
animation: loadingpulse 1.5s ease-in-out infinite;
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
@keyframes loadingpulse {
|
|
2577
|
+
0% {
|
|
2578
|
+
opacity: 1;
|
|
2579
|
+
}
|
|
2580
|
+
50% {
|
|
2581
|
+
opacity: 0.5;
|
|
2582
|
+
}
|
|
2583
|
+
100% {
|
|
2584
|
+
opacity: 1;
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2563
2587
|
.wp-block-text-columns .block-editor-rich-text__editable:focus {
|
|
2564
2588
|
outline: 1px solid #ddd;
|
|
2565
2589
|
}
|
package/build-style/editor.css
CHANGED
|
@@ -2567,6 +2567,30 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2567
2567
|
border: none;
|
|
2568
2568
|
}
|
|
2569
2569
|
|
|
2570
|
+
.wp-block-term-template .term-loading .term-loading-placeholder {
|
|
2571
|
+
width: 100%;
|
|
2572
|
+
height: 1.5em;
|
|
2573
|
+
margin-bottom: 0.25em;
|
|
2574
|
+
background-color: #f0f0f0;
|
|
2575
|
+
border-radius: 2px;
|
|
2576
|
+
}
|
|
2577
|
+
@media not (prefers-reduced-motion) {
|
|
2578
|
+
.wp-block-term-template .term-loading .term-loading-placeholder {
|
|
2579
|
+
animation: loadingpulse 1.5s ease-in-out infinite;
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
|
|
2583
|
+
@keyframes loadingpulse {
|
|
2584
|
+
0% {
|
|
2585
|
+
opacity: 1;
|
|
2586
|
+
}
|
|
2587
|
+
50% {
|
|
2588
|
+
opacity: 0.5;
|
|
2589
|
+
}
|
|
2590
|
+
100% {
|
|
2591
|
+
opacity: 1;
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2570
2594
|
.wp-block-text-columns .block-editor-rich-text__editable:focus {
|
|
2571
2595
|
outline: 1px solid #ddd;
|
|
2572
2596
|
}
|
|
@@ -4235,6 +4235,22 @@ ul.wp-block-rss.is-grid li {
|
|
|
4235
4235
|
margin-bottom: 0;
|
|
4236
4236
|
}
|
|
4237
4237
|
|
|
4238
|
+
.wp-block-term-template {
|
|
4239
|
+
margin-top: 0;
|
|
4240
|
+
margin-bottom: 0;
|
|
4241
|
+
max-width: 100%;
|
|
4242
|
+
box-sizing: border-box;
|
|
4243
|
+
}
|
|
4244
|
+
.wp-block-term-template.is-layout-grid, .wp-block-term-template.is-layout-flex {
|
|
4245
|
+
list-style: none;
|
|
4246
|
+
padding: 0;
|
|
4247
|
+
}
|
|
4248
|
+
|
|
4249
|
+
.wp-block-terms-query .wp-block-term {
|
|
4250
|
+
margin-block-start: 0;
|
|
4251
|
+
margin-block-end: 0;
|
|
4252
|
+
}
|
|
4253
|
+
|
|
4238
4254
|
.wp-block-text-columns {
|
|
4239
4255
|
display: flex;
|
|
4240
4256
|
}
|
package/build-style/style.css
CHANGED
|
@@ -4268,6 +4268,22 @@ ul.wp-block-rss.is-grid li {
|
|
|
4268
4268
|
margin-bottom: 0;
|
|
4269
4269
|
}
|
|
4270
4270
|
|
|
4271
|
+
.wp-block-term-template {
|
|
4272
|
+
margin-top: 0;
|
|
4273
|
+
margin-bottom: 0;
|
|
4274
|
+
max-width: 100%;
|
|
4275
|
+
box-sizing: border-box;
|
|
4276
|
+
}
|
|
4277
|
+
.wp-block-term-template.is-layout-grid, .wp-block-term-template.is-layout-flex {
|
|
4278
|
+
list-style: none;
|
|
4279
|
+
padding: 0;
|
|
4280
|
+
}
|
|
4281
|
+
|
|
4282
|
+
.wp-block-terms-query .wp-block-term {
|
|
4283
|
+
margin-block-start: 0;
|
|
4284
|
+
margin-block-end: 0;
|
|
4285
|
+
}
|
|
4286
|
+
|
|
4271
4287
|
.wp-block-text-columns {
|
|
4272
4288
|
display: flex;
|
|
4273
4289
|
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Colors
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Breakpoints & Media Queries
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Colors
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* SCSS Variables.
|
|
12
|
+
*
|
|
13
|
+
* Please use variables from this sheet to ensure consistency across the UI.
|
|
14
|
+
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
15
|
+
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Fonts & basic variables.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Typography
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Grid System.
|
|
25
|
+
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Radius scale.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Elevation scale.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Dimensions.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Mobile specific styles
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Editor styles.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* Block & Editor UI.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* Block paddings.
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
* React Native specific.
|
|
50
|
+
* These variables do not appear to be used anywhere else.
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* Colors
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* SCSS Variables.
|
|
57
|
+
*
|
|
58
|
+
* Please use variables from this sheet to ensure consistency across the UI.
|
|
59
|
+
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
60
|
+
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
61
|
+
*/
|
|
62
|
+
/**
|
|
63
|
+
* Fonts & basic variables.
|
|
64
|
+
*/
|
|
65
|
+
/**
|
|
66
|
+
* Typography
|
|
67
|
+
*/
|
|
68
|
+
/**
|
|
69
|
+
* Grid System.
|
|
70
|
+
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
71
|
+
*/
|
|
72
|
+
/**
|
|
73
|
+
* Radius scale.
|
|
74
|
+
*/
|
|
75
|
+
/**
|
|
76
|
+
* Elevation scale.
|
|
77
|
+
*/
|
|
78
|
+
/**
|
|
79
|
+
* Dimensions.
|
|
80
|
+
*/
|
|
81
|
+
/**
|
|
82
|
+
* Mobile specific styles
|
|
83
|
+
*/
|
|
84
|
+
/**
|
|
85
|
+
* Editor styles.
|
|
86
|
+
*/
|
|
87
|
+
/**
|
|
88
|
+
* Block & Editor UI.
|
|
89
|
+
*/
|
|
90
|
+
/**
|
|
91
|
+
* Block paddings.
|
|
92
|
+
*/
|
|
93
|
+
/**
|
|
94
|
+
* React Native specific.
|
|
95
|
+
* These variables do not appear to be used anywhere else.
|
|
96
|
+
*/
|
|
97
|
+
/**
|
|
98
|
+
* Breakpoints & Media Queries
|
|
99
|
+
*/
|
|
100
|
+
/**
|
|
101
|
+
* Converts a hex value into the rgb equivalent.
|
|
102
|
+
*
|
|
103
|
+
* @param {string} hex - the hexadecimal value to convert
|
|
104
|
+
* @return {string} comma separated rgb values
|
|
105
|
+
*/
|
|
106
|
+
/**
|
|
107
|
+
* Long content fade mixin
|
|
108
|
+
*
|
|
109
|
+
* Creates a fading overlay to signify that the content is longer
|
|
110
|
+
* than the space allows.
|
|
111
|
+
*/
|
|
112
|
+
/**
|
|
113
|
+
* Typography
|
|
114
|
+
*/
|
|
115
|
+
/**
|
|
116
|
+
* Breakpoint mixins
|
|
117
|
+
*/
|
|
118
|
+
/**
|
|
119
|
+
* Focus styles.
|
|
120
|
+
*/
|
|
121
|
+
/**
|
|
122
|
+
* Applies editor left position to the selector passed as argument
|
|
123
|
+
*/
|
|
124
|
+
/**
|
|
125
|
+
* Styles that are reused verbatim in a few places
|
|
126
|
+
*/
|
|
127
|
+
/**
|
|
128
|
+
* Allows users to opt-out of animations via OS-level preferences.
|
|
129
|
+
*/
|
|
130
|
+
/**
|
|
131
|
+
* Reset default styles for JavaScript UI based pages.
|
|
132
|
+
* This is a WP-admin agnostic reset
|
|
133
|
+
*/
|
|
134
|
+
/**
|
|
135
|
+
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
136
|
+
*/
|
|
137
|
+
.wp-block-term-template .term-loading .term-loading-placeholder {
|
|
138
|
+
width: 100%;
|
|
139
|
+
height: 1.5em;
|
|
140
|
+
margin-bottom: 0.25em;
|
|
141
|
+
background-color: #f0f0f0;
|
|
142
|
+
border-radius: 2px;
|
|
143
|
+
}
|
|
144
|
+
@media not (prefers-reduced-motion) {
|
|
145
|
+
.wp-block-term-template .term-loading .term-loading-placeholder {
|
|
146
|
+
animation: loadingpulse 1.5s ease-in-out infinite;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@keyframes loadingpulse {
|
|
151
|
+
0% {
|
|
152
|
+
opacity: 1;
|
|
153
|
+
}
|
|
154
|
+
50% {
|
|
155
|
+
opacity: 0.5;
|
|
156
|
+
}
|
|
157
|
+
100% {
|
|
158
|
+
opacity: 1;
|
|
159
|
+
}
|
|
160
|
+
}
|