@wordpress/block-library 9.31.0 → 9.31.1-next.233ccab9b.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/build/accordion/edit.js +6 -5
- package/build/accordion/edit.js.map +1 -1
- package/build/accordion/index.js +39 -4
- package/build/accordion/index.js.map +1 -1
- package/build/accordion/save.js +2 -19
- package/build/accordion/save.js.map +1 -1
- package/build/accordion/view.js +50 -16
- package/build/accordion/view.js.map +1 -1
- package/build/accordion-content/index.js +17 -3
- package/build/accordion-content/index.js.map +1 -1
- package/build/accordion-content/save.js +5 -7
- package/build/accordion-content/save.js.map +1 -1
- package/build/accordion-header/edit.js +13 -47
- package/build/accordion-header/edit.js.map +1 -1
- package/build/accordion-header/index.js +6 -11
- package/build/accordion-header/index.js.map +1 -1
- package/build/accordion-header/save.js +11 -44
- package/build/accordion-header/save.js.map +1 -1
- package/build/accordion-panel/edit.js +2 -1
- package/build/accordion-panel/edit.js.map +1 -1
- package/build/accordion-panel/index.js +3 -3
- package/build/accordion-panel/index.js.map +1 -1
- package/build/accordion-panel/save.js +3 -1
- package/build/accordion-panel/save.js.map +1 -1
- package/build/avatar/hooks.js +7 -17
- package/build/avatar/hooks.js.map +1 -1
- package/build/group/variations.js +3 -4
- package/build/group/variations.js.map +1 -1
- package/build/navigation/edit/leaf-more-menu.js +6 -1
- package/build/navigation/edit/leaf-more-menu.js.map +1 -1
- package/build/navigation/index.js +2 -1
- package/build/navigation/index.js.map +1 -1
- package/build/navigation-link/index.js +2 -1
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-submenu/edit.js +2 -4
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/index.js +2 -1
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/page-list/index.js +2 -1
- package/build/page-list/index.js.map +1 -1
- package/build/post-author/edit.js +7 -6
- package/build/post-author/edit.js.map +1 -1
- package/build/post-date/edit.js +16 -3
- package/build/post-date/edit.js.map +1 -1
- package/build/post-time-to-read/edit.js +111 -11
- package/build/post-time-to-read/edit.js.map +1 -1
- package/build/post-time-to-read/index.js +17 -1
- package/build/post-time-to-read/index.js.map +1 -1
- package/build/table-of-contents/index.js +1 -0
- package/build/table-of-contents/index.js.map +1 -1
- package/build/term-description/edit.js +18 -2
- package/build/term-description/edit.js.map +1 -1
- package/build/term-description/index.js +1 -0
- package/build/term-description/index.js.map +1 -1
- package/build/term-description/use-term-description.js +85 -0
- package/build/term-description/use-term-description.js.map +1 -0
- package/build/term-template/edit.js +11 -7
- package/build/term-template/edit.js.map +1 -1
- package/build/term-template/index.js +1 -1
- package/build/terms-query/index.js +8 -2
- package/build/terms-query/index.js.map +1 -1
- package/build/terms-query/inspector-controls/advanced-controls.js +51 -0
- package/build/terms-query/inspector-controls/advanced-controls.js.map +1 -0
- package/build/terms-query/inspector-controls/display-options.js +87 -0
- package/build/terms-query/inspector-controls/display-options.js.map +1 -0
- package/build/terms-query/inspector-controls/empty-terms-control.js +38 -0
- package/build/terms-query/inspector-controls/empty-terms-control.js.map +1 -0
- package/build/terms-query/inspector-controls/hierarchy-control.js +40 -0
- package/build/terms-query/inspector-controls/hierarchy-control.js.map +1 -0
- package/build/terms-query/inspector-controls/index.js +127 -0
- package/build/terms-query/inspector-controls/index.js.map +1 -0
- package/build/terms-query/inspector-controls/max-terms-control.js +50 -0
- package/build/terms-query/inspector-controls/max-terms-control.js.map +1 -0
- package/build/terms-query/inspector-controls/ordering-controls.js +57 -0
- package/build/terms-query/inspector-controls/ordering-controls.js.map +1 -0
- package/build/terms-query/inspector-controls/taxonomy-control.js +52 -0
- package/build/terms-query/inspector-controls/taxonomy-control.js.map +1 -0
- package/build/utils/hooks.js +15 -0
- package/build/utils/hooks.js.map +1 -1
- package/build-module/accordion/edit.js +6 -5
- package/build-module/accordion/edit.js.map +1 -1
- package/build-module/accordion/index.js +40 -4
- package/build-module/accordion/index.js.map +1 -1
- package/build-module/accordion/save.js +2 -17
- package/build-module/accordion/save.js.map +1 -1
- package/build-module/accordion/view.js +51 -17
- package/build-module/accordion/view.js.map +1 -1
- package/build-module/accordion-content/index.js +17 -3
- package/build-module/accordion-content/index.js.map +1 -1
- package/build-module/accordion-content/save.js +5 -7
- package/build-module/accordion-content/save.js.map +1 -1
- package/build-module/accordion-header/edit.js +14 -45
- package/build-module/accordion-header/edit.js.map +1 -1
- package/build-module/accordion-header/index.js +6 -11
- package/build-module/accordion-header/index.js.map +1 -1
- package/build-module/accordion-header/save.js +12 -42
- package/build-module/accordion-header/save.js.map +1 -1
- package/build-module/accordion-panel/edit.js +2 -1
- package/build-module/accordion-panel/edit.js.map +1 -1
- package/build-module/accordion-panel/index.js +3 -3
- package/build-module/accordion-panel/index.js.map +1 -1
- package/build-module/accordion-panel/save.js +3 -1
- package/build-module/accordion-panel/save.js.map +1 -1
- package/build-module/avatar/hooks.js +5 -15
- package/build-module/avatar/hooks.js.map +1 -1
- package/build-module/group/variations.js +3 -4
- package/build-module/group/variations.js.map +1 -1
- package/build-module/navigation/edit/leaf-more-menu.js +6 -1
- package/build-module/navigation/edit/leaf-more-menu.js.map +1 -1
- package/build-module/navigation/index.js +2 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation-link/index.js +2 -1
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -3
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/navigation-submenu/index.js +2 -1
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/page-list/index.js +2 -1
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/post-author/edit.js +8 -7
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-date/edit.js +17 -4
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-time-to-read/edit.js +112 -14
- package/build-module/post-time-to-read/edit.js.map +1 -1
- package/build-module/post-time-to-read/index.js +17 -1
- package/build-module/post-time-to-read/index.js.map +1 -1
- package/build-module/table-of-contents/index.js +1 -0
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/term-description/edit.js +18 -2
- package/build-module/term-description/edit.js.map +1 -1
- package/build-module/term-description/index.js +1 -0
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/term-description/use-term-description.js +79 -0
- package/build-module/term-description/use-term-description.js.map +1 -0
- package/build-module/term-template/edit.js +11 -7
- package/build-module/term-template/edit.js.map +1 -1
- package/build-module/term-template/index.js +1 -1
- package/build-module/terms-query/index.js +8 -2
- package/build-module/terms-query/index.js.map +1 -1
- package/build-module/terms-query/inspector-controls/advanced-controls.js +44 -0
- package/build-module/terms-query/inspector-controls/advanced-controls.js.map +1 -0
- package/build-module/terms-query/inspector-controls/display-options.js +80 -0
- package/build-module/terms-query/inspector-controls/display-options.js.map +1 -0
- package/build-module/terms-query/inspector-controls/empty-terms-control.js +31 -0
- package/build-module/terms-query/inspector-controls/empty-terms-control.js.map +1 -0
- package/build-module/terms-query/inspector-controls/hierarchy-control.js +33 -0
- package/build-module/terms-query/inspector-controls/hierarchy-control.js.map +1 -0
- package/build-module/terms-query/inspector-controls/index.js +119 -0
- package/build-module/terms-query/inspector-controls/index.js.map +1 -0
- package/build-module/terms-query/inspector-controls/max-terms-control.js +43 -0
- package/build-module/terms-query/inspector-controls/max-terms-control.js.map +1 -0
- package/build-module/terms-query/inspector-controls/ordering-controls.js +50 -0
- package/build-module/terms-query/inspector-controls/ordering-controls.js.map +1 -0
- package/build-module/terms-query/inspector-controls/taxonomy-control.js +45 -0
- package/build-module/terms-query/inspector-controls/taxonomy-control.js.map +1 -0
- package/build-module/utils/hooks.js +14 -0
- package/build-module/utils/hooks.js.map +1 -1
- package/build-style/accordion-content/style-rtl.css +155 -0
- package/build-style/accordion-content/style.css +155 -0
- package/build-style/{accordion → accordion-header}/style-rtl.css +12 -51
- package/build-style/{accordion → accordion-header}/style.css +12 -51
- package/build-style/accordion-panel/style-rtl.css +140 -0
- package/build-style/accordion-panel/style.css +140 -0
- package/build-style/style-rtl.css +25 -38
- package/build-style/style.css +25 -38
- package/package.json +35 -35
- package/src/accordion/block.json +16 -3
- package/src/accordion/edit.js +39 -34
- package/src/accordion/index.js +35 -1
- package/src/accordion/index.php +3 -19
- package/src/accordion/save.js +2 -16
- package/src/accordion/view.js +64 -15
- package/src/accordion-content/block.json +17 -3
- package/src/accordion-content/index.php +3 -2
- package/src/accordion-content/save.js +4 -10
- package/src/accordion-content/style.scss +21 -0
- package/src/accordion-header/block.json +6 -11
- package/src/accordion-header/edit.js +17 -61
- package/src/accordion-header/save.js +24 -54
- package/src/accordion-header/style.scss +39 -0
- package/src/accordion-panel/block.json +3 -3
- package/src/accordion-panel/edit.js +1 -0
- package/src/accordion-panel/save.js +3 -1
- package/src/accordion-panel/style.scss +8 -0
- package/src/avatar/hooks.js +5 -10
- package/src/comments/index.php +2 -2
- package/src/group/variations.js +3 -14
- package/src/navigation/block.json +2 -1
- package/src/navigation/edit/leaf-more-menu.js +9 -1
- package/src/navigation/index.php +2 -2
- package/src/navigation-link/block.json +2 -1
- package/src/navigation-submenu/block.json +2 -1
- package/src/navigation-submenu/edit.js +1 -4
- package/src/page-list/block.json +2 -1
- package/src/post-author/edit.js +16 -7
- package/src/post-date/edit.js +16 -16
- package/src/post-time-to-read/block.json +17 -1
- package/src/post-time-to-read/edit.js +167 -20
- package/src/post-time-to-read/index.php +47 -15
- package/src/social-link/index.php +2 -2
- package/src/style.scss +3 -1
- package/src/table-of-contents/block.json +1 -0
- package/src/table-of-contents/index.php +44 -0
- package/src/term-description/block.json +1 -0
- package/src/term-description/edit.js +18 -3
- package/src/term-description/use-term-description.js +109 -0
- package/src/term-template/block.json +1 -1
- package/src/term-template/edit.js +11 -6
- package/src/term-template/index.php +13 -7
- package/src/terms-query/block.json +8 -2
- package/src/terms-query/inspector-controls/advanced-controls.js +37 -0
- package/src/terms-query/inspector-controls/display-options.js +87 -0
- package/src/terms-query/inspector-controls/empty-terms-control.js +30 -0
- package/src/terms-query/inspector-controls/hierarchy-control.js +30 -0
- package/src/terms-query/inspector-controls/index.js +137 -0
- package/src/terms-query/inspector-controls/max-terms-control.js +44 -0
- package/src/terms-query/inspector-controls/ordering-controls.js +55 -0
- package/src/terms-query/inspector-controls/taxonomy-control.js +41 -0
- package/src/utils/hooks.js +9 -0
- package/build/accordion-content/icons.js +0 -30
- package/build/accordion-content/icons.js.map +0 -1
- package/build/terms-query/inspector-controls.js +0 -231
- package/build/terms-query/inspector-controls.js.map +0 -1
- package/build-module/accordion-content/icons.js +0 -22
- package/build-module/accordion-content/icons.js.map +0 -1
- package/build-module/terms-query/inspector-controls.js +0 -224
- package/build-module/terms-query/inspector-controls.js.map +0 -1
- package/src/accordion/style.scss +0 -82
- package/src/accordion-content/icons.js +0 -23
- package/src/terms-query/inspector-controls.js +0 -239
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { __experimentalToolsPanelItem as ToolsPanelItem, SelectControl } from '@wordpress/components';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export default function TaxonomyControl({
|
|
8
|
+
attributes,
|
|
9
|
+
setQuery,
|
|
10
|
+
setAttributes,
|
|
11
|
+
taxonomyOptions
|
|
12
|
+
}) {
|
|
13
|
+
const {
|
|
14
|
+
termQuery
|
|
15
|
+
} = attributes;
|
|
16
|
+
return /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
17
|
+
hasValue: () => termQuery.taxonomy !== 'category',
|
|
18
|
+
label: __('Taxonomy'),
|
|
19
|
+
onDeselect: () => {
|
|
20
|
+
setQuery({
|
|
21
|
+
taxonomy: 'category'
|
|
22
|
+
});
|
|
23
|
+
setAttributes({
|
|
24
|
+
termsToShow: 'all'
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
isShownByDefault: true,
|
|
28
|
+
children: /*#__PURE__*/_jsx(SelectControl, {
|
|
29
|
+
__nextHasNoMarginBottom: true,
|
|
30
|
+
__next40pxDefaultSize: true,
|
|
31
|
+
label: __('Taxonomy'),
|
|
32
|
+
options: taxonomyOptions,
|
|
33
|
+
value: termQuery.taxonomy,
|
|
34
|
+
onChange: selectedTaxonomy => {
|
|
35
|
+
setQuery({
|
|
36
|
+
taxonomy: selectedTaxonomy
|
|
37
|
+
});
|
|
38
|
+
setAttributes({
|
|
39
|
+
termsToShow: 'all'
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=taxonomy-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","__experimentalToolsPanelItem","ToolsPanelItem","SelectControl","jsx","_jsx","TaxonomyControl","attributes","setQuery","setAttributes","taxonomyOptions","termQuery","hasValue","taxonomy","label","onDeselect","termsToShow","isShownByDefault","children","__nextHasNoMarginBottom","__next40pxDefaultSize","options","value","onChange","selectedTaxonomy"],"sources":["@wordpress/block-library/src/terms-query/inspector-controls/taxonomy-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tSelectControl,\n} from '@wordpress/components';\n\nexport default function TaxonomyControl( {\n\tattributes,\n\tsetQuery,\n\tsetAttributes,\n\ttaxonomyOptions,\n} ) {\n\tconst { termQuery } = attributes;\n\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\thasValue={ () => termQuery.taxonomy !== 'category' }\n\t\t\tlabel={ __( 'Taxonomy' ) }\n\t\t\tonDeselect={ () => {\n\t\t\t\tsetQuery( { taxonomy: 'category' } );\n\t\t\t\tsetAttributes( { termsToShow: 'all' } );\n\t\t\t} }\n\t\t\tisShownByDefault\n\t\t>\n\t\t\t<SelectControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'Taxonomy' ) }\n\t\t\t\toptions={ taxonomyOptions }\n\t\t\t\tvalue={ termQuery.taxonomy }\n\t\t\t\tonChange={ ( selectedTaxonomy ) => {\n\t\t\t\t\tsetQuery( { taxonomy: selectedTaxonomy } );\n\t\t\t\t\tsetAttributes( { termsToShow: 'all' } );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</ToolsPanelItem>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,4BAA4B,IAAIC,cAAc,EAC9CC,aAAa,QACP,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/B,eAAe,SAASC,eAAeA,CAAE;EACxCC,UAAU;EACVC,QAAQ;EACRC,aAAa;EACbC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAU,CAAC,GAAGJ,UAAU;EAEhC,oBACCF,IAAA,CAACH,cAAc;IACdU,QAAQ,EAAGA,CAAA,KAAMD,SAAS,CAACE,QAAQ,KAAK,UAAY;IACpDC,KAAK,EAAGd,EAAE,CAAE,UAAW,CAAG;IAC1Be,UAAU,EAAGA,CAAA,KAAM;MAClBP,QAAQ,CAAE;QAAEK,QAAQ,EAAE;MAAW,CAAE,CAAC;MACpCJ,aAAa,CAAE;QAAEO,WAAW,EAAE;MAAM,CAAE,CAAC;IACxC,CAAG;IACHC,gBAAgB;IAAAC,QAAA,eAEhBb,IAAA,CAACF,aAAa;MACbgB,uBAAuB;MACvBC,qBAAqB;MACrBN,KAAK,EAAGd,EAAE,CAAE,UAAW,CAAG;MAC1BqB,OAAO,EAAGX,eAAiB;MAC3BY,KAAK,EAAGX,SAAS,CAACE,QAAU;MAC5BU,QAAQ,EAAKC,gBAAgB,IAAM;QAClChB,QAAQ,CAAE;UAAEK,QAAQ,EAAEW;QAAiB,CAAE,CAAC;QAC1Cf,aAAa,CAAE;UAAEO,WAAW,EAAE;QAAM,CAAE,CAAC;MACxC;IAAG,CACH;EAAC,CACa,CAAC;AAEnB","ignoreList":[]}
|
|
@@ -86,6 +86,20 @@ export function useUploadMediaFromBlobURL(args = {}) {
|
|
|
86
86
|
});
|
|
87
87
|
}, [getSettings]);
|
|
88
88
|
}
|
|
89
|
+
export function useDefaultAvatar() {
|
|
90
|
+
const {
|
|
91
|
+
avatarURL: defaultAvatarUrl
|
|
92
|
+
} = useSelect(select => {
|
|
93
|
+
const {
|
|
94
|
+
getSettings
|
|
95
|
+
} = select(blockEditorStore);
|
|
96
|
+
const {
|
|
97
|
+
__experimentalDiscussionSettings
|
|
98
|
+
} = getSettings();
|
|
99
|
+
return __experimentalDiscussionSettings;
|
|
100
|
+
});
|
|
101
|
+
return defaultAvatarUrl;
|
|
102
|
+
}
|
|
89
103
|
export function useToolsPanelDropdownMenuProps() {
|
|
90
104
|
const isMobile = useViewportMatch('medium', '<');
|
|
91
105
|
return !isMobile ? {
|
|
@@ -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\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,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;IAErC,IAAK,CAAEO,WAAW,EAAG;MACpB;IACD;IAEAR,mBAAmB,CAACE,OAAO,GAAG,IAAI;IAElCM,WAAW,CAAE;MACZC,SAAS,EAAE,CAAEL,IAAI,CAAE;MACnBC,YAAY;MACZK,YAAY,EAAEA,CAAE,CAAEC,KAAK,CAAE,KAAM;QAC9B,IAAK3B,SAAS,CAAE2B,KAAK,EAAER,GAAI,CAAC,EAAG;UAC9B;QACD;QAEAlB,aAAa,CAAEkB,GAAI,CAAC;QACpBG,QAAQ,CAAEK,KAAM,CAAC;QACjBX,mBAAmB,CAACE,OAAO,GAAG,KAAK;MACpC,CAAC;MACDK,OAAO,EAAIK,OAAO,IAAM;QACvB3B,aAAa,CAAEkB,GAAI,CAAC;QACpBI,OAAO,CAAEK,OAAQ,CAAC;QAClBZ,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,
|
|
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","useDefaultAvatar","avatarURL","defaultAvatarUrl","__experimentalDiscussionSettings","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 useDefaultAvatar() {\n\tconst { avatarURL: defaultAvatarUrl } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { __experimentalDiscussionSettings } = getSettings();\n\t\treturn __experimentalDiscussionSettings;\n\t} );\n\treturn defaultAvatarUrl;\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":"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","ignoreList":[]}
|
|
@@ -0,0 +1,155 @@
|
|
|
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-accordion-content {
|
|
138
|
+
display: grid;
|
|
139
|
+
grid-template-rows: max-content 0fr;
|
|
140
|
+
/* Add transitions only for users who do not prefer reduced motion */
|
|
141
|
+
}
|
|
142
|
+
.wp-block-accordion-content.is-open {
|
|
143
|
+
grid-template-rows: max-content 1fr;
|
|
144
|
+
}
|
|
145
|
+
.wp-block-accordion-content.is-open > .wp-block-accordion-header .wp-block-accordion-header__toggle-icon {
|
|
146
|
+
transform: rotate(-45deg);
|
|
147
|
+
}
|
|
148
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
149
|
+
.wp-block-accordion-content {
|
|
150
|
+
transition: grid-template-rows 0.3s ease-out;
|
|
151
|
+
}
|
|
152
|
+
.wp-block-accordion-content > .wp-block-accordion-header .wp-block-accordion-header__toggle-icon {
|
|
153
|
+
transition: transform 0.2s ease-in-out;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
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-accordion-content {
|
|
138
|
+
display: grid;
|
|
139
|
+
grid-template-rows: max-content 0fr;
|
|
140
|
+
/* Add transitions only for users who do not prefer reduced motion */
|
|
141
|
+
}
|
|
142
|
+
.wp-block-accordion-content.is-open {
|
|
143
|
+
grid-template-rows: max-content 1fr;
|
|
144
|
+
}
|
|
145
|
+
.wp-block-accordion-content.is-open > .wp-block-accordion-header .wp-block-accordion-header__toggle-icon {
|
|
146
|
+
transform: rotate(45deg);
|
|
147
|
+
}
|
|
148
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
149
|
+
.wp-block-accordion-content {
|
|
150
|
+
transition: grid-template-rows 0.3s ease-out;
|
|
151
|
+
}
|
|
152
|
+
.wp-block-accordion-content > .wp-block-accordion-header .wp-block-accordion-header__toggle-icon {
|
|
153
|
+
transition: transform 0.2s ease-in-out;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -134,19 +134,7 @@
|
|
|
134
134
|
/**
|
|
135
135
|
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
136
136
|
*/
|
|
137
|
-
.wp-block-accordion-
|
|
138
|
-
display: grid;
|
|
139
|
-
grid-template-rows: max-content 0fr;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.wp-block-accordion-content.is-open {
|
|
143
|
-
grid-template-rows: max-content 1fr;
|
|
144
|
-
}
|
|
145
|
-
.wp-block-accordion-content.is-open > .wp-block-accordion-header .accordion-content__toggle-icon.has-icon-plus {
|
|
146
|
-
transform: rotate(-45deg);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.accordion-content__toggle {
|
|
137
|
+
.wp-block-accordion-header__toggle {
|
|
150
138
|
font-family: inherit;
|
|
151
139
|
font-size: inherit;
|
|
152
140
|
font-weight: inherit;
|
|
@@ -168,46 +156,19 @@
|
|
|
168
156
|
position: relative;
|
|
169
157
|
width: 100%;
|
|
170
158
|
}
|
|
171
|
-
|
|
172
|
-
.accordion-content__toggle > span {
|
|
173
|
-
width: 100%;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.is-layout-flow > .wp-block-accordion-panel,
|
|
177
|
-
.wp-block-accordion-panel {
|
|
178
|
-
overflow: hidden;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.wp-block-accordion-panel[inert],
|
|
182
|
-
.wp-block-accordion-panel[aria-hidden=true] {
|
|
183
|
-
margin-block-start: 0;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.accordion-panel__wrapper {
|
|
187
|
-
padding-bottom: var(--wp--preset--spacing--20, 1em);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/* No icon block style */
|
|
191
|
-
.is-style-no-icon .accordion-content__toggle-icon {
|
|
192
|
-
background-color: unset;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.wp-block-accordion-header.icon-position-left .accordion-content__toggle {
|
|
196
|
-
/* stylelint-disable-next-line declaration-property-value-allowed-list -- This should be refactored to not use the row-reverse value. */
|
|
197
|
-
flex-direction: row-reverse;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.accordion-content__toggle:focus-visible {
|
|
159
|
+
.wp-block-accordion-header__toggle:focus-visible {
|
|
201
160
|
outline: 2px solid -webkit-focus-ring-color;
|
|
202
161
|
outline-offset: 2px;
|
|
203
162
|
}
|
|
204
163
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
.
|
|
211
|
-
|
|
212
|
-
|
|
164
|
+
.wp-block-accordion-header__toggle-title {
|
|
165
|
+
flex: 1;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.wp-block-accordion-header__toggle-icon {
|
|
169
|
+
width: 1.2em;
|
|
170
|
+
height: 1.2em;
|
|
171
|
+
display: flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
justify-content: center;
|
|
213
174
|
}
|
|
@@ -134,19 +134,7 @@
|
|
|
134
134
|
/**
|
|
135
135
|
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
136
136
|
*/
|
|
137
|
-
.wp-block-accordion-
|
|
138
|
-
display: grid;
|
|
139
|
-
grid-template-rows: max-content 0fr;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.wp-block-accordion-content.is-open {
|
|
143
|
-
grid-template-rows: max-content 1fr;
|
|
144
|
-
}
|
|
145
|
-
.wp-block-accordion-content.is-open > .wp-block-accordion-header .accordion-content__toggle-icon.has-icon-plus {
|
|
146
|
-
transform: rotate(45deg);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.accordion-content__toggle {
|
|
137
|
+
.wp-block-accordion-header__toggle {
|
|
150
138
|
font-family: inherit;
|
|
151
139
|
font-size: inherit;
|
|
152
140
|
font-weight: inherit;
|
|
@@ -168,46 +156,19 @@
|
|
|
168
156
|
position: relative;
|
|
169
157
|
width: 100%;
|
|
170
158
|
}
|
|
171
|
-
|
|
172
|
-
.accordion-content__toggle > span {
|
|
173
|
-
width: 100%;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.is-layout-flow > .wp-block-accordion-panel,
|
|
177
|
-
.wp-block-accordion-panel {
|
|
178
|
-
overflow: hidden;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.wp-block-accordion-panel[inert],
|
|
182
|
-
.wp-block-accordion-panel[aria-hidden=true] {
|
|
183
|
-
margin-block-start: 0;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.accordion-panel__wrapper {
|
|
187
|
-
padding-bottom: var(--wp--preset--spacing--20, 1em);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/* No icon block style */
|
|
191
|
-
.is-style-no-icon .accordion-content__toggle-icon {
|
|
192
|
-
background-color: unset;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.wp-block-accordion-header.icon-position-left .accordion-content__toggle {
|
|
196
|
-
/* stylelint-disable-next-line declaration-property-value-allowed-list -- This should be refactored to not use the row-reverse value. */
|
|
197
|
-
flex-direction: row-reverse;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.accordion-content__toggle:focus-visible {
|
|
159
|
+
.wp-block-accordion-header__toggle:focus-visible {
|
|
201
160
|
outline: 2px solid -webkit-focus-ring-color;
|
|
202
161
|
outline-offset: 2px;
|
|
203
162
|
}
|
|
204
163
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
.
|
|
211
|
-
|
|
212
|
-
|
|
164
|
+
.wp-block-accordion-header__toggle-title {
|
|
165
|
+
flex: 1;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.wp-block-accordion-header__toggle-icon {
|
|
169
|
+
width: 1.2em;
|
|
170
|
+
height: 1.2em;
|
|
171
|
+
display: flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
justify-content: center;
|
|
213
174
|
}
|