@wordpress/block-library 8.7.0 → 8.8.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/column/index.js +2 -1
- package/build/column/index.js.map +1 -1
- package/build/columns/edit.js +24 -6
- package/build/columns/edit.js.map +1 -1
- package/build/columns/index.js +2 -1
- package/build/columns/index.js.map +1 -1
- package/build/columns/utils.js +4 -9
- package/build/columns/utils.js.map +1 -1
- package/build/cover/edit/index.js +46 -50
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/{resizable-cover.js → resizable-cover-popover.js} +32 -6
- package/build/cover/edit/resizable-cover-popover.js.map +1 -0
- package/build/cover/index.js +12 -0
- package/build/cover/index.js.map +1 -1
- package/build/details/edit.js +67 -0
- package/build/details/edit.js.map +1 -0
- package/build/details/index.js +110 -0
- package/build/details/index.js.map +1 -0
- package/build/details/save.js +33 -0
- package/build/details/save.js.map +1 -0
- package/build/details-content/edit.js +34 -0
- package/build/details-content/edit.js.map +1 -0
- package/build/details-content/index.js +94 -0
- package/build/details-content/index.js.map +1 -0
- package/build/details-content/save.js +20 -0
- package/build/details-content/save.js.map +1 -0
- package/build/details-summary/edit.js +42 -0
- package/build/details-summary/edit.js.map +1 -0
- package/build/details-summary/index.js +97 -0
- package/build/details-summary/index.js.map +1 -0
- package/build/details-summary/save.js +24 -0
- package/build/details-summary/save.js.map +1 -0
- package/build/embed/deprecated.js +4 -1
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/embed-link-settings.native.js +1 -1
- package/build/embed/embed-link-settings.native.js.map +1 -1
- package/build/embed/embed-placeholder.js +1 -1
- package/build/embed/embed-placeholder.js.map +1 -1
- package/build/embed/index.js +4 -1
- package/build/embed/index.js.map +1 -1
- package/build/embed/transforms.js +4 -1
- package/build/embed/transforms.js.map +1 -1
- package/build/embed/util.js +4 -1
- package/build/embed/util.js.map +1 -1
- package/build/file/edit.native.js +0 -2
- package/build/file/edit.native.js.map +1 -1
- package/build/gallery/use-get-media.native.js +2 -1
- package/build/gallery/use-get-media.native.js.map +1 -1
- package/build/image/index.js +4 -2
- package/build/image/index.js.map +1 -1
- package/build/index.js +24 -6
- package/build/index.js.map +1 -1
- package/build/media-text/media-container.js +2 -6
- package/build/media-text/media-container.js.map +1 -1
- package/build/media-text/media-container.native.js +3 -3
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/navigation/deprecated.js +8 -11
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +1 -14
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/post-author/index.js +0 -1
- package/build/post-author/index.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +2 -1
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +8 -22
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-time-to-read/edit.js +1 -1
- package/build/post-time-to-read/edit.js.map +1 -1
- package/build/post-time-to-read/index.js +7 -0
- package/build/post-time-to-read/index.js.map +1 -1
- package/build/spacer/controls.js +25 -6
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/edit.js +14 -4
- package/build/spacer/edit.js.map +1 -1
- package/build/spacer/save.js +2 -2
- package/build/spacer/save.js.map +1 -1
- package/build/table/state.js +35 -35
- package/build/table/state.js.map +1 -1
- package/build/term-description/index.js +1 -2
- package/build/term-description/index.js.map +1 -1
- package/build/utils/clean-empty-object.js +5 -2
- package/build/utils/clean-empty-object.js.map +1 -1
- package/build-module/column/index.js +2 -1
- package/build-module/column/index.js.map +1 -1
- package/build-module/columns/edit.js +24 -6
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/index.js +2 -1
- package/build-module/columns/index.js.map +1 -1
- package/build-module/columns/utils.js +4 -8
- package/build-module/columns/utils.js.map +1 -1
- package/build-module/cover/edit/index.js +48 -52
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/{resizable-cover.js → resizable-cover-popover.js} +31 -6
- package/build-module/cover/edit/resizable-cover-popover.js.map +1 -0
- package/build-module/cover/index.js +12 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/details/edit.js +52 -0
- package/build-module/details/edit.js.map +1 -0
- package/build-module/details/index.js +91 -0
- package/build-module/details/index.js.map +1 -0
- package/build-module/details/save.js +20 -0
- package/build-module/details/save.js.map +1 -0
- package/build-module/details-content/edit.js +23 -0
- package/build-module/details-content/edit.js.map +1 -0
- package/build-module/details-content/index.js +76 -0
- package/build-module/details-content/index.js.map +1 -0
- package/build-module/details-content/save.js +11 -0
- package/build-module/details-content/save.js.map +1 -0
- package/build-module/details-summary/edit.js +30 -0
- package/build-module/details-summary/edit.js.map +1 -0
- package/build-module/details-summary/index.js +79 -0
- package/build-module/details-summary/index.js.map +1 -0
- package/build-module/details-summary/save.js +16 -0
- package/build-module/details-summary/save.js.map +1 -0
- package/build-module/embed/deprecated.js +4 -1
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/embed-link-settings.native.js +1 -1
- package/build-module/embed/embed-link-settings.native.js.map +1 -1
- package/build-module/embed/embed-placeholder.js +1 -1
- package/build-module/embed/embed-placeholder.js.map +1 -1
- package/build-module/embed/index.js +4 -1
- package/build-module/embed/index.js.map +1 -1
- package/build-module/embed/transforms.js +4 -1
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/embed/util.js +4 -1
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/edit.native.js +0 -2
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/gallery/use-get-media.native.js +2 -1
- package/build-module/gallery/use-get-media.native.js.map +1 -1
- package/build-module/image/index.js +4 -2
- package/build-module/image/index.js.map +1 -1
- package/build-module/index.js +21 -6
- package/build-module/index.js.map +1 -1
- package/build-module/media-text/media-container.js +1 -5
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/media-text/media-container.native.js +1 -1
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/navigation/deprecated.js +8 -10
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +1 -14
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/post-author/index.js +0 -1
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +2 -1
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +8 -22
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-time-to-read/edit.js +1 -1
- package/build-module/post-time-to-read/edit.js.map +1 -1
- package/build-module/post-time-to-read/index.js +7 -0
- package/build-module/post-time-to-read/index.js.map +1 -1
- package/build-module/spacer/controls.js +27 -9
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/edit.js +14 -5
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/spacer/save.js +3 -3
- package/build-module/spacer/save.js.map +1 -1
- package/build-module/table/state.js +35 -33
- package/build-module/table/state.js.map +1 -1
- package/build-module/term-description/index.js +1 -2
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/utils/clean-empty-object.js +6 -3
- package/build-module/utils/clean-empty-object.js.map +1 -1
- package/build-style/columns/style-rtl.css +4 -1
- package/build-style/columns/style.css +4 -1
- package/build-style/common-rtl.css +1 -1
- package/build-style/common.css +1 -1
- package/build-style/cover/editor-rtl.css +11 -12
- package/build-style/cover/editor.css +11 -12
- package/build-style/cover/style-rtl.css +3 -2
- package/build-style/cover/style.css +3 -2
- package/build-style/details/style-rtl.css +91 -0
- package/build-style/details/style.css +91 -0
- package/build-style/details-summary/editor-rtl.css +91 -0
- package/build-style/details-summary/editor.css +91 -0
- package/build-style/details-summary/style-rtl.css +91 -0
- package/build-style/details-summary/style.css +91 -0
- package/build-style/editor-rtl.css +34 -48
- package/build-style/editor.css +34 -48
- package/build-style/file/style-rtl.css +4 -3
- package/build-style/file/style.css +4 -3
- package/build-style/post-excerpt/style-rtl.css +1 -1
- package/build-style/post-excerpt/style.css +1 -1
- package/build-style/pullquote/style-rtl.css +4 -1
- package/build-style/pullquote/style.css +4 -1
- package/build-style/shortcode/editor-rtl.css +15 -34
- package/build-style/shortcode/editor.css +15 -34
- package/build-style/spacer/editor-rtl.css +4 -2
- package/build-style/spacer/editor.css +4 -2
- package/build-style/style-rtl.css +25 -9
- package/build-style/style.css +25 -9
- package/package.json +31 -31
- package/src/column/block.json +2 -1
- package/src/columns/block.json +2 -1
- package/src/columns/edit.js +33 -9
- package/src/columns/style.scss +5 -1
- package/src/columns/utils.js +8 -9
- package/src/common.scss +1 -1
- package/src/cover/block.json +12 -0
- package/src/cover/edit/index.js +44 -37
- package/src/cover/edit/resizable-cover-popover.js +82 -0
- package/src/cover/editor.scss +20 -13
- package/src/cover/index.php +9 -10
- package/src/cover/style.scss +2 -1
- package/src/cover/test/edit.js +1 -1
- package/src/details/block.json +54 -0
- package/src/details/edit.js +59 -0
- package/src/details/index.js +35 -0
- package/src/details/save.js +15 -0
- package/src/details/style.scss +3 -0
- package/src/details-content/block.json +50 -0
- package/src/details-content/edit.js +29 -0
- package/src/details-content/index.js +23 -0
- package/src/details-content/save.js +12 -0
- package/src/details-summary/block.json +53 -0
- package/src/details-summary/edit.js +27 -0
- package/src/details-summary/editor.scss +3 -0
- package/src/details-summary/index.js +23 -0
- package/src/details-summary/save.js +13 -0
- package/src/details-summary/style.scss +3 -0
- package/src/editor.scss +1 -0
- package/src/embed/block.json +4 -1
- package/src/embed/embed-link-settings.native.js +1 -1
- package/src/embed/embed-placeholder.js +1 -1
- package/src/file/edit.native.js +0 -2
- package/src/file/style.scss +5 -2
- package/src/gallery/test/use-get-media.native.js +24 -0
- package/src/gallery/use-get-media.native.js +1 -1
- package/src/image/block.json +4 -2
- package/src/index.js +13 -3
- package/src/media-text/media-container.js +1 -5
- package/src/media-text/media-container.native.js +1 -1
- package/src/navigation/deprecated.js +15 -19
- package/src/navigation/edit/unsaved-inner-blocks.js +34 -46
- package/src/navigation/index.php +0 -4
- package/src/paragraph/test/edit.native.js +356 -1
- package/src/post-author/block.json +0 -1
- package/src/post-excerpt/index.php +3 -3
- package/src/post-excerpt/style.scss +2 -1
- package/src/post-featured-image/dimension-controls.js +5 -1
- package/src/post-featured-image/edit.js +8 -29
- package/src/post-time-to-read/block.json +7 -0
- package/src/post-time-to-read/edit.js +1 -1
- package/src/post-time-to-read/index.php +3 -3
- package/src/preformatted/test/__snapshots__/edit.native.js.snap +2 -2
- package/src/preformatted/test/edit.native.js +45 -2
- package/src/pullquote/style.scss +5 -1
- package/src/pullquote/test/edit.native.js +70 -0
- package/src/quote/test/edit.native.js +92 -0
- package/src/search/index.php +1 -1
- package/src/shortcode/editor.scss +26 -5
- package/src/spacer/controls.js +42 -17
- package/src/spacer/edit.js +23 -4
- package/src/spacer/editor.scss +2 -1
- package/src/spacer/save.js +3 -3
- package/src/style.scss +2 -0
- package/src/table/state.js +83 -66
- package/src/term-description/block.json +1 -2
- package/src/utils/clean-empty-object.js +4 -4
- package/src/verse/test/edit.native.js +33 -0
- package/build/cover/edit/resizable-cover.js.map +0 -1
- package/build/media-text/media-container-icon.js +0 -27
- package/build/media-text/media-container-icon.js.map +0 -1
- package/build-module/cover/edit/resizable-cover.js.map +0 -1
- package/build-module/media-text/media-container-icon.js +0 -17
- package/build-module/media-text/media-container-icon.js.map +0 -1
- package/src/cover/edit/resizable-cover.js +0 -61
- package/src/media-text/media-container-icon.js +0 -12
package/build/cover/index.js
CHANGED
|
@@ -126,6 +126,18 @@ const metadata = {
|
|
|
126
126
|
blockGap: true
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
|
+
__experimentalBorder: {
|
|
130
|
+
color: true,
|
|
131
|
+
radius: true,
|
|
132
|
+
style: true,
|
|
133
|
+
width: true,
|
|
134
|
+
__experimentalDefaultControls: {
|
|
135
|
+
color: true,
|
|
136
|
+
radius: true,
|
|
137
|
+
style: true,
|
|
138
|
+
width: true
|
|
139
|
+
}
|
|
140
|
+
},
|
|
129
141
|
color: {
|
|
130
142
|
__experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background",
|
|
131
143
|
text: true,
|
package/build/cover/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/cover/index.js"],"names":["name","metadata","settings","icon","example","attributes","customOverlayColor","dimRatio","url","innerBlocks","content","align","style","typography","fontSize","color","text","transforms","save","edit","deprecated","variations","init"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAfA;AACA;AACA;;AAIA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/cover/index.js"],"names":["name","metadata","settings","icon","example","attributes","customOverlayColor","dimRatio","url","innerBlocks","content","align","style","typography","fontSize","color","text","transforms","save","edit","deprecated","variations","init"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAfA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,YADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,kBAAkB,EAAE,SADT;AAEXC,MAAAA,QAAQ,EAAE,EAFC;AAGXC,MAAAA,GAAG,EAAE;AAHM,KADJ;AAMRC,IAAAA,WAAW,EAAE,CACZ;AACCT,MAAAA,IAAI,EAAE,gBADP;AAECK,MAAAA,UAAU,EAAE;AACXK,QAAAA,OAAO,EAAE,cAAI,8BAAJ,CADE;AAEXC,QAAAA,KAAK,EAAE,QAFI;AAGXC,QAAAA,KAAK,EAAE;AACNC,UAAAA,UAAU,EAAE;AACXC,YAAAA,QAAQ,EAAE;AADC,WADN;AAINC,UAAAA,KAAK,EAAE;AACNC,YAAAA,IAAI,EAAE;AADA;AAJD;AAHI;AAFb,KADY;AANL,GAFc;AA0BvBC,EAAAA,UAAU,EAAVA,mBA1BuB;AA2BvBC,EAAAA,IAAI,EAAJA,aA3BuB;AA4BvBC,EAAAA,IAAI,EAAJA,aA5BuB;AA6BvBC,EAAAA,UAAU,EAAVA,mBA7BuB;AA8BvBC,EAAAA,UAAU,EAAVA;AA9BuB,CAAjB;;;AAiCA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEtB,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { cover as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcustomOverlayColor: '#065174',\n\t\t\tdimRatio: 40,\n\t\t\turl: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg',\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __( '<strong>Snow Patrol</strong>' ),\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\ttypography: {\n\t\t\t\t\t\t\tfontSize: 48,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\ttext: 'white',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tsave,\n\tedit,\n\tdeprecated,\n\tvariations,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
15
|
+
|
|
16
|
+
var _data = require("@wordpress/data");
|
|
17
|
+
|
|
18
|
+
var _components = require("@wordpress/components");
|
|
19
|
+
|
|
20
|
+
var _i18n = require("@wordpress/i18n");
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* WordPress dependencies
|
|
24
|
+
*/
|
|
25
|
+
const TEMPLATE = [['core/details-summary'], ['core/details-content']];
|
|
26
|
+
|
|
27
|
+
function DetailsEdit(_ref) {
|
|
28
|
+
let {
|
|
29
|
+
attributes,
|
|
30
|
+
setAttributes,
|
|
31
|
+
clientId
|
|
32
|
+
} = _ref;
|
|
33
|
+
const {
|
|
34
|
+
showContent
|
|
35
|
+
} = attributes;
|
|
36
|
+
const blockProps = (0, _blockEditor.useBlockProps)();
|
|
37
|
+
const innerBlocksProps = (0, _blockEditor.useInnerBlocksProps)(blockProps, {
|
|
38
|
+
allowedBlocks: TEMPLATE,
|
|
39
|
+
template: TEMPLATE,
|
|
40
|
+
templateLock: 'all'
|
|
41
|
+
}); // Check if either the block or the inner blocks are selected.
|
|
42
|
+
|
|
43
|
+
const hasSelection = (0, _data.useSelect)(select => {
|
|
44
|
+
const {
|
|
45
|
+
isBlockSelected,
|
|
46
|
+
hasSelectedInnerBlock
|
|
47
|
+
} = select(_blockEditor.store);
|
|
48
|
+
/* Sets deep to true to also find blocks inside the details content block. */
|
|
49
|
+
|
|
50
|
+
return hasSelectedInnerBlock(clientId, true) || isBlockSelected(clientId);
|
|
51
|
+
}, []);
|
|
52
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.InspectorControls, null, (0, _element.createElement)(_components.PanelBody, {
|
|
53
|
+
title: (0, _i18n.__)('Settings')
|
|
54
|
+
}, (0, _element.createElement)(_components.ToggleControl, {
|
|
55
|
+
label: (0, _i18n.__)('Open by default'),
|
|
56
|
+
checked: showContent,
|
|
57
|
+
onChange: () => setAttributes({
|
|
58
|
+
showContent: !showContent
|
|
59
|
+
})
|
|
60
|
+
}))), (0, _element.createElement)("details", (0, _extends2.default)({}, innerBlocksProps, {
|
|
61
|
+
open: hasSelection || showContent
|
|
62
|
+
})));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
var _default = DetailsEdit;
|
|
66
|
+
exports.default = _default;
|
|
67
|
+
//# sourceMappingURL=edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/details/edit.js"],"names":["TEMPLATE","DetailsEdit","attributes","setAttributes","clientId","showContent","blockProps","innerBlocksProps","allowedBlocks","template","templateLock","hasSelection","select","isBlockSelected","hasSelectedInnerBlock","blockEditorStore"],"mappings":";;;;;;;;;;;;;AAGA;;AAMA;;AACA;;AACA;;AAXA;AACA;AACA;AAWA,MAAMA,QAAQ,GAAG,CAAE,CAAE,sBAAF,CAAF,EAA8B,CAAE,sBAAF,CAA9B,CAAjB;;AAEA,SAASC,WAAT,OAAgE;AAAA,MAA1C;AAAEC,IAAAA,UAAF;AAAcC,IAAAA,aAAd;AAA6BC,IAAAA;AAA7B,GAA0C;AAC/D,QAAM;AAAEC,IAAAA;AAAF,MAAkBH,UAAxB;AACA,QAAMI,UAAU,GAAG,iCAAnB;AACA,QAAMC,gBAAgB,GAAG,sCAAqBD,UAArB,EAAiC;AACzDE,IAAAA,aAAa,EAAER,QAD0C;AAEzDS,IAAAA,QAAQ,EAAET,QAF+C;AAGzDU,IAAAA,YAAY,EAAE;AAH2C,GAAjC,CAAzB,CAH+D,CAS/D;;AACA,QAAMC,YAAY,GAAG,qBAAaC,MAAF,IAAc;AAC7C,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QACLF,MAAM,CAAEG,kBAAF,CADP;AAEA;;AACA,WACCD,qBAAqB,CAAEV,QAAF,EAAY,IAAZ,CAArB,IACAS,eAAe,CAAET,QAAF,CAFhB;AAIA,GARoB,EAQlB,EARkB,CAArB;AAUA,SACC,qDACC,4BAAC,8BAAD,QACC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAG,cAAI,UAAJ;AAAnB,KACC,4BAAC,yBAAD;AACC,IAAA,KAAK,EAAG,cAAI,iBAAJ,CADT;AAEC,IAAA,OAAO,EAAGC,WAFX;AAGC,IAAA,QAAQ,EAAG,MACVF,aAAa,CAAE;AACdE,MAAAA,WAAW,EAAE,CAAEA;AADD,KAAF;AAJf,IADD,CADD,CADD,EAcC,kEACME,gBADN;AAEC,IAAA,IAAI,EAAGI,YAAY,IAAIN;AAFxB,KAdD,CADD;AAqBA;;eAEcJ,W","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n\tInspectorControls,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst TEMPLATE = [ [ 'core/details-summary' ], [ 'core/details-content' ] ];\n\nfunction DetailsEdit( { attributes, setAttributes, clientId } ) {\n\tconst { showContent } = attributes;\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: TEMPLATE,\n\t\ttemplate: TEMPLATE,\n\t\ttemplateLock: 'all',\n\t} );\n\n\t// Check if either the block or the inner blocks are selected.\n\tconst hasSelection = useSelect( ( select ) => {\n\t\tconst { isBlockSelected, hasSelectedInnerBlock } =\n\t\t\tselect( blockEditorStore );\n\t\t/* Sets deep to true to also find blocks inside the details content block. */\n\t\treturn (\n\t\t\thasSelectedInnerBlock( clientId, true ) ||\n\t\t\tisBlockSelected( clientId )\n\t\t);\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Open by default' ) }\n\t\t\t\t\t\tchecked={ showContent }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowContent: ! showContent,\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</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<details\n\t\t\t\t{ ...innerBlocksProps }\n\t\t\t\topen={ hasSelection || showContent }\n\t\t\t></details>\n\t\t</>\n\t);\n}\n\nexport default DetailsEdit;\n"]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.settings = exports.name = exports.metadata = exports.init = void 0;
|
|
9
|
+
|
|
10
|
+
var _icons = require("@wordpress/icons");
|
|
11
|
+
|
|
12
|
+
var _i18n = require("@wordpress/i18n");
|
|
13
|
+
|
|
14
|
+
var _initBlock = _interopRequireDefault(require("../utils/init-block"));
|
|
15
|
+
|
|
16
|
+
var _edit = _interopRequireDefault(require("./edit"));
|
|
17
|
+
|
|
18
|
+
var _save = _interopRequireDefault(require("./save"));
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* WordPress dependencies
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Internal dependencies
|
|
26
|
+
*/
|
|
27
|
+
const metadata = {
|
|
28
|
+
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
29
|
+
apiVersion: 2,
|
|
30
|
+
__experimental: true,
|
|
31
|
+
name: "core/details",
|
|
32
|
+
title: "Details",
|
|
33
|
+
category: "text",
|
|
34
|
+
description: "A block that displays a summary and shows or hides additional content.",
|
|
35
|
+
keywords: ["disclosure", "summary", "hide", "transcript"],
|
|
36
|
+
textdomain: "default",
|
|
37
|
+
attributes: {
|
|
38
|
+
showContent: {
|
|
39
|
+
type: "boolean",
|
|
40
|
+
"default": false
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
supports: {
|
|
44
|
+
align: true,
|
|
45
|
+
color: {
|
|
46
|
+
gradients: true,
|
|
47
|
+
link: true,
|
|
48
|
+
__experimentalDefaultControls: {
|
|
49
|
+
background: true,
|
|
50
|
+
text: true,
|
|
51
|
+
link: true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
__experimentalBorder: {
|
|
55
|
+
radius: true,
|
|
56
|
+
color: true,
|
|
57
|
+
width: true,
|
|
58
|
+
style: true
|
|
59
|
+
},
|
|
60
|
+
html: false,
|
|
61
|
+
spacing: {
|
|
62
|
+
margin: true,
|
|
63
|
+
padding: true
|
|
64
|
+
},
|
|
65
|
+
typography: {
|
|
66
|
+
fontSize: true,
|
|
67
|
+
lineHeight: true,
|
|
68
|
+
__experimentalFontFamily: true,
|
|
69
|
+
__experimentalFontWeight: true,
|
|
70
|
+
__experimentalFontStyle: true,
|
|
71
|
+
__experimentalTextTransform: true,
|
|
72
|
+
__experimentalTextDecoration: true,
|
|
73
|
+
__experimentalLetterSpacing: true,
|
|
74
|
+
__experimentalDefaultControls: {
|
|
75
|
+
fontSize: true
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
style: "wp-block-details"
|
|
80
|
+
};
|
|
81
|
+
exports.metadata = metadata;
|
|
82
|
+
const {
|
|
83
|
+
name
|
|
84
|
+
} = metadata;
|
|
85
|
+
exports.name = name;
|
|
86
|
+
const settings = {
|
|
87
|
+
icon: _icons.details,
|
|
88
|
+
example: {
|
|
89
|
+
innerBlocks: [{
|
|
90
|
+
name: 'core/details-summary',
|
|
91
|
+
attributes: {
|
|
92
|
+
summary: (0, _i18n.__)('Details')
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
name: 'core/details-content'
|
|
96
|
+
}]
|
|
97
|
+
},
|
|
98
|
+
save: _save.default,
|
|
99
|
+
edit: _edit.default
|
|
100
|
+
};
|
|
101
|
+
exports.settings = settings;
|
|
102
|
+
|
|
103
|
+
const init = () => (0, _initBlock.default)({
|
|
104
|
+
name,
|
|
105
|
+
metadata,
|
|
106
|
+
settings
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
exports.init = init;
|
|
110
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/details/index.js"],"names":["name","metadata","settings","icon","example","innerBlocks","attributes","summary","save","edit","init"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AAEA;;AACA;;AAZA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,cADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,WAAW,EAAE,CACZ;AACCL,MAAAA,IAAI,EAAE,sBADP;AAECM,MAAAA,UAAU,EAAE;AAAEC,QAAAA,OAAO,EAAE,cAAI,SAAJ;AAAX;AAFb,KADY,EAKZ;AACCP,MAAAA,IAAI,EAAE;AADP,KALY;AADL,GAFc;AAavBQ,EAAAA,IAAI,EAAJA,aAbuB;AAcvBC,EAAAA,IAAI,EAAJA;AAduB,CAAjB;;;AAiBA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEV,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { details as icon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/details-summary',\n\t\t\t\tattributes: { summary: __( 'Details' ) },\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/details-content',\n\t\t\t},\n\t\t],\n\t},\n\tsave,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = save;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* WordPress dependencies
|
|
18
|
+
*/
|
|
19
|
+
function save(_ref) {
|
|
20
|
+
let {
|
|
21
|
+
attributes
|
|
22
|
+
} = _ref;
|
|
23
|
+
const {
|
|
24
|
+
showContent
|
|
25
|
+
} = attributes;
|
|
26
|
+
|
|
27
|
+
const blockProps = _blockEditor.useBlockProps.save();
|
|
28
|
+
|
|
29
|
+
return (0, _element.createElement)("details", (0, _extends2.default)({}, blockProps, {
|
|
30
|
+
open: showContent
|
|
31
|
+
}), (0, _element.createElement)(_blockEditor.InnerBlocks.Content, null));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=save.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/details/save.js"],"names":["save","attributes","showContent","blockProps","useBlockProps"],"mappings":";;;;;;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGe,SAASA,IAAT,OAAgC;AAAA,MAAjB;AAAEC,IAAAA;AAAF,GAAiB;AAC9C,QAAM;AAAEC,IAAAA;AAAF,MAAkBD,UAAxB;;AACA,QAAME,UAAU,GAAGC,2BAAcJ,IAAd,EAAnB;;AAEA,SACC,kEAAcG,UAAd;AAA2B,IAAA,IAAI,EAAGD;AAAlC,MACC,4BAAC,wBAAD,CAAa,OAAb,OADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useBlockProps, InnerBlocks } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst { showContent } = attributes;\n\tconst blockProps = useBlockProps.save();\n\n\treturn (\n\t\t<details { ...blockProps } open={ showContent }>\n\t\t\t<InnerBlocks.Content />\n\t\t</details>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
11
|
+
|
|
12
|
+
var _i18n = require("@wordpress/i18n");
|
|
13
|
+
|
|
14
|
+
var _primitives = require("@wordpress/primitives");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* WordPress dependencies
|
|
18
|
+
*/
|
|
19
|
+
const TEMPLATE = [['core/paragraph', {
|
|
20
|
+
placeholder: (0, _i18n.__)('Add text or blocks that will display when the details block is opened.')
|
|
21
|
+
}]];
|
|
22
|
+
|
|
23
|
+
function DetailsContentEdit() {
|
|
24
|
+
const blockProps = (0, _blockEditor.useBlockProps)();
|
|
25
|
+
const innerBlocksProps = (0, _blockEditor.useInnerBlocksProps)(blockProps, {
|
|
26
|
+
template: TEMPLATE,
|
|
27
|
+
templateLock: false
|
|
28
|
+
});
|
|
29
|
+
return (0, _element.createElement)(_primitives.View, innerBlocksProps);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var _default = DetailsContentEdit;
|
|
33
|
+
exports.default = _default;
|
|
34
|
+
//# sourceMappingURL=edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/details-content/edit.js"],"names":["TEMPLATE","placeholder","DetailsContentEdit","blockProps","innerBlocksProps","template","templateLock"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKA,MAAMA,QAAQ,GAAG,CAChB,CACC,gBADD,EAEC;AACCC,EAAAA,WAAW,EAAE,cACZ,wEADY;AADd,CAFD,CADgB,CAAjB;;AAWA,SAASC,kBAAT,GAA8B;AAC7B,QAAMC,UAAU,GAAG,iCAAnB;AACA,QAAMC,gBAAgB,GAAG,sCAAqBD,UAArB,EAAiC;AACzDE,IAAAA,QAAQ,EAAEL,QAD+C;AAEzDM,IAAAA,YAAY,EAAE;AAF2C,GAAjC,CAAzB;AAKA,SAAO,4BAAC,gBAAD,EAAWF,gBAAX,CAAP;AACA;;eAEcF,kB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { View } from '@wordpress/primitives';\n\nconst TEMPLATE = [\n\t[\n\t\t'core/paragraph',\n\t\t{\n\t\t\tplaceholder: __(\n\t\t\t\t'Add text or blocks that will display when the details block is opened.'\n\t\t\t),\n\t\t},\n\t],\n];\n\nfunction DetailsContentEdit() {\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\ttemplateLock: false,\n\t} );\n\n\treturn <View { ...innerBlocksProps }></View>;\n}\n\nexport default DetailsContentEdit;\n"]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.settings = exports.name = exports.metadata = exports.init = void 0;
|
|
9
|
+
|
|
10
|
+
var _icons = require("@wordpress/icons");
|
|
11
|
+
|
|
12
|
+
var _initBlock = _interopRequireDefault(require("../utils/init-block"));
|
|
13
|
+
|
|
14
|
+
var _edit = _interopRequireDefault(require("./edit"));
|
|
15
|
+
|
|
16
|
+
var _save = _interopRequireDefault(require("./save"));
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* WordPress dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Internal dependencies
|
|
24
|
+
*/
|
|
25
|
+
const metadata = {
|
|
26
|
+
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
27
|
+
apiVersion: 2,
|
|
28
|
+
__experimental: true,
|
|
29
|
+
name: "core/details-content",
|
|
30
|
+
title: "Details Content",
|
|
31
|
+
category: "text",
|
|
32
|
+
parent: ["core/details"],
|
|
33
|
+
description: "Add content that may be shown or hidden via a Details block.",
|
|
34
|
+
textdomain: "default",
|
|
35
|
+
supports: {
|
|
36
|
+
align: false,
|
|
37
|
+
color: {
|
|
38
|
+
gradients: true,
|
|
39
|
+
link: true,
|
|
40
|
+
__experimentalDefaultControls: {
|
|
41
|
+
background: true,
|
|
42
|
+
text: true,
|
|
43
|
+
link: true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
__experimentalBorder: {
|
|
47
|
+
radius: true,
|
|
48
|
+
color: true,
|
|
49
|
+
width: true,
|
|
50
|
+
style: true
|
|
51
|
+
},
|
|
52
|
+
html: false,
|
|
53
|
+
lock: false,
|
|
54
|
+
multiple: false,
|
|
55
|
+
reusable: false,
|
|
56
|
+
spacing: {
|
|
57
|
+
margin: true,
|
|
58
|
+
padding: true
|
|
59
|
+
},
|
|
60
|
+
typography: {
|
|
61
|
+
fontSize: true,
|
|
62
|
+
lineHeight: true,
|
|
63
|
+
__experimentalFontFamily: true,
|
|
64
|
+
__experimentalFontWeight: true,
|
|
65
|
+
__experimentalFontStyle: true,
|
|
66
|
+
__experimentalTextTransform: true,
|
|
67
|
+
__experimentalTextDecoration: true,
|
|
68
|
+
__experimentalLetterSpacing: true,
|
|
69
|
+
__experimentalDefaultControls: {
|
|
70
|
+
fontSize: true
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
exports.metadata = metadata;
|
|
76
|
+
const {
|
|
77
|
+
name
|
|
78
|
+
} = metadata;
|
|
79
|
+
exports.name = name;
|
|
80
|
+
const settings = {
|
|
81
|
+
icon: _icons.postContent,
|
|
82
|
+
save: _save.default,
|
|
83
|
+
edit: _edit.default
|
|
84
|
+
};
|
|
85
|
+
exports.settings = settings;
|
|
86
|
+
|
|
87
|
+
const init = () => (0, _initBlock.default)({
|
|
88
|
+
name,
|
|
89
|
+
metadata,
|
|
90
|
+
settings
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
exports.init = init;
|
|
94
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/details-content/index.js"],"names":["name","metadata","settings","icon","save","edit","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,kBADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA;AAHuB,CAAjB;;;AAMA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEN,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postContent as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tsave,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = save;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* WordPress dependencies
|
|
14
|
+
*/
|
|
15
|
+
function save() {
|
|
16
|
+
const blockProps = _blockEditor.useBlockProps.save();
|
|
17
|
+
|
|
18
|
+
return (0, _element.createElement)("div", blockProps, (0, _element.createElement)(_blockEditor.InnerBlocks.Content, null));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=save.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/details-content/save.js"],"names":["save","blockProps","useBlockProps"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAEe,SAASA,IAAT,GAAgB;AAC9B,QAAMC,UAAU,GAAGC,2BAAcF,IAAd,EAAnB;;AACA,SACC,mCAAUC,UAAV,EACC,4BAAC,wBAAD,CAAa,OAAb,OADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useBlockProps, InnerBlocks } from '@wordpress/block-editor';\nexport default function save() {\n\tconst blockProps = useBlockProps.save();\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<InnerBlocks.Content />\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
15
|
+
|
|
16
|
+
var _i18n = require("@wordpress/i18n");
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* WordPress dependencies
|
|
20
|
+
*/
|
|
21
|
+
function DetailsSummaryEdit(_ref) {
|
|
22
|
+
let {
|
|
23
|
+
attributes,
|
|
24
|
+
setAttributes
|
|
25
|
+
} = _ref;
|
|
26
|
+
const summary = attributes.summary ? attributes.summary : (0, _i18n.__)('Details');
|
|
27
|
+
return (0, _element.createElement)("summary", (0, _extends2.default)({}, (0, _blockEditor.useBlockProps)(), {
|
|
28
|
+
onClick: event => event.preventDefault()
|
|
29
|
+
}), (0, _element.createElement)(_blockEditor.RichText, {
|
|
30
|
+
"aria-label": (0, _i18n.__)('Add summary'),
|
|
31
|
+
allowedFormats: [],
|
|
32
|
+
withoutInteractiveFormatting: true,
|
|
33
|
+
value: summary,
|
|
34
|
+
onChange: newSummary => setAttributes({
|
|
35
|
+
summary: newSummary
|
|
36
|
+
})
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
var _default = DetailsSummaryEdit;
|
|
41
|
+
exports.default = _default;
|
|
42
|
+
//# sourceMappingURL=edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/details-summary/edit.js"],"names":["DetailsSummaryEdit","attributes","setAttributes","summary","event","preventDefault","newSummary"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,SAASA,kBAAT,OAA6D;AAAA,MAAhC;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,GAAgC;AAC5D,QAAMC,OAAO,GAAGF,UAAU,CAACE,OAAX,GAAqBF,UAAU,CAACE,OAAhC,GAA0C,cAAI,SAAJ,CAA1D;AACA,SACC,kEACM,iCADN;AAEC,IAAA,OAAO,EAAKC,KAAF,IAAaA,KAAK,CAACC,cAAN;AAFxB,MAIC,4BAAC,qBAAD;AACC,kBAAa,cAAI,aAAJ,CADd;AAEC,IAAA,cAAc,EAAG,EAFlB;AAGC,IAAA,4BAA4B,MAH7B;AAIC,IAAA,KAAK,EAAGF,OAJT;AAKC,IAAA,QAAQ,EAAKG,UAAF,IACVJ,aAAa,CAAE;AAAEC,MAAAA,OAAO,EAAEG;AAAX,KAAF;AANf,IAJD,CADD;AAgBA;;eAEcN,kB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\nfunction DetailsSummaryEdit( { attributes, setAttributes } ) {\n\tconst summary = attributes.summary ? attributes.summary : __( 'Details' );\n\treturn (\n\t\t<summary\n\t\t\t{ ...useBlockProps() }\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t>\n\t\t\t<RichText\n\t\t\t\taria-label={ __( 'Add summary' ) }\n\t\t\t\tallowedFormats={ [] }\n\t\t\t\twithoutInteractiveFormatting\n\t\t\t\tvalue={ summary }\n\t\t\t\tonChange={ ( newSummary ) =>\n\t\t\t\t\tsetAttributes( { summary: newSummary } )\n\t\t\t\t}\n\t\t\t/>\n\t\t</summary>\n\t);\n}\n\nexport default DetailsSummaryEdit;\n"]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.settings = exports.name = exports.metadata = exports.init = void 0;
|
|
9
|
+
|
|
10
|
+
var _icons = require("@wordpress/icons");
|
|
11
|
+
|
|
12
|
+
var _initBlock = _interopRequireDefault(require("../utils/init-block"));
|
|
13
|
+
|
|
14
|
+
var _edit = _interopRequireDefault(require("./edit"));
|
|
15
|
+
|
|
16
|
+
var _save = _interopRequireDefault(require("./save"));
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* WordPress dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Internal dependencies
|
|
24
|
+
*/
|
|
25
|
+
const metadata = {
|
|
26
|
+
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
27
|
+
apiVersion: 2,
|
|
28
|
+
__experimental: true,
|
|
29
|
+
name: "core/details-summary",
|
|
30
|
+
title: "Details Summary",
|
|
31
|
+
category: "text",
|
|
32
|
+
parent: ["core/details"],
|
|
33
|
+
description: "Provide summary text used to toggle the display of content inside a Details block.",
|
|
34
|
+
textdomain: "default",
|
|
35
|
+
attributes: {
|
|
36
|
+
summary: {
|
|
37
|
+
type: "string"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
supports: {
|
|
41
|
+
align: false,
|
|
42
|
+
color: {
|
|
43
|
+
gradients: true,
|
|
44
|
+
__experimentalDefaultControls: {
|
|
45
|
+
background: true,
|
|
46
|
+
text: true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
__experimentalBorder: {
|
|
50
|
+
radius: true,
|
|
51
|
+
color: true,
|
|
52
|
+
width: true,
|
|
53
|
+
style: true
|
|
54
|
+
},
|
|
55
|
+
html: false,
|
|
56
|
+
lock: false,
|
|
57
|
+
multiple: false,
|
|
58
|
+
reusable: false,
|
|
59
|
+
spacing: {
|
|
60
|
+
margin: true,
|
|
61
|
+
padding: true
|
|
62
|
+
},
|
|
63
|
+
typography: {
|
|
64
|
+
fontSize: true,
|
|
65
|
+
lineHeight: true,
|
|
66
|
+
__experimentalFontFamily: true,
|
|
67
|
+
__experimentalFontWeight: true,
|
|
68
|
+
__experimentalFontStyle: true,
|
|
69
|
+
__experimentalTextTransform: true,
|
|
70
|
+
__experimentalTextDecoration: true,
|
|
71
|
+
__experimentalLetterSpacing: true,
|
|
72
|
+
__experimentalDefaultControls: {
|
|
73
|
+
fontSize: true
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
exports.metadata = metadata;
|
|
79
|
+
const {
|
|
80
|
+
name
|
|
81
|
+
} = metadata;
|
|
82
|
+
exports.name = name;
|
|
83
|
+
const settings = {
|
|
84
|
+
icon: _icons.heading,
|
|
85
|
+
save: _save.default,
|
|
86
|
+
edit: _edit.default
|
|
87
|
+
};
|
|
88
|
+
exports.settings = settings;
|
|
89
|
+
|
|
90
|
+
const init = () => (0, _initBlock.default)({
|
|
91
|
+
name,
|
|
92
|
+
metadata,
|
|
93
|
+
settings
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
exports.init = init;
|
|
97
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/details-summary/index.js"],"names":["name","metadata","settings","icon","save","edit","init"],"mappings":";;;;;;;;;AAGA;;AAKA;;AAEA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,cADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA;AAHuB,CAAjB;;;AAMA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEN,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { heading as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tsave,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = save;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* WordPress dependencies
|
|
14
|
+
*/
|
|
15
|
+
function save(_ref) {
|
|
16
|
+
let {
|
|
17
|
+
attributes
|
|
18
|
+
} = _ref;
|
|
19
|
+
const summary = attributes.summary ? attributes.summary : 'Details';
|
|
20
|
+
return (0, _element.createElement)("summary", _blockEditor.useBlockProps.save(), (0, _element.createElement)(_blockEditor.RichText.Content, {
|
|
21
|
+
value: summary
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=save.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/details-summary/save.js"],"names":["save","attributes","summary","useBlockProps"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGe,SAASA,IAAT,OAAgC;AAAA,MAAjB;AAAEC,IAAAA;AAAF,GAAiB;AAC9C,QAAMC,OAAO,GAAGD,UAAU,CAACC,OAAX,GAAqBD,UAAU,CAACC,OAAhC,GAA0C,SAA1D;AACA,SACC,uCAAcC,2BAAcH,IAAd,EAAd,EACC,4BAAC,qBAAD,CAAU,OAAV;AAAkB,IAAA,KAAK,EAAGE;AAA1B,IADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst summary = attributes.summary ? attributes.summary : 'Details';\n\treturn (\n\t\t<summary { ...useBlockProps.save() }>\n\t\t\t<RichText.Content value={ summary } />\n\t\t</summary>\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/deprecated.js"],"names":["attributes","blockAttributes","metadata","v2","save","url","caption","type","providerNameSlug","className","useBlockProps","RichText","isEmpty","v1","embedClassName","deprecated"],"mappings":";;;;;;;;;;;AAGA;;AAUA;;AAbA;AACA;AACA;;AAGA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/embed/deprecated.js"],"names":["attributes","blockAttributes","metadata","v2","save","url","caption","type","providerNameSlug","className","useBlockProps","RichText","isEmpty","v1","embedClassName","deprecated"],"mappings":";;;;;;;;;;;AAGA;;AAUA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AACA;AACA;;AAGA,MAAM;AAAEA,EAAAA,UAAU,EAAEC;AAAd,IAAkCC,QAAxC,C,CAEA;AACA;;AACA,MAAMC,EAAE,GAAG;AACVH,EAAAA,UAAU,EAAEC,eADF;;AAEVG,EAAAA,IAAI,OAAmB;AAAA,QAAjB;AAAEJ,MAAAA;AAAF,KAAiB;AACtB,UAAM;AAAEK,MAAAA,GAAF;AAAOC,MAAAA,OAAP;AAAgBC,MAAAA,IAAhB;AAAsBC,MAAAA;AAAtB,QAA2CR,UAAjD;;AAEA,QAAK,CAAEK,GAAP,EAAa;AACZ,aAAO,IAAP;AACA;;AAED,UAAMI,SAAS,GAAG,yBAAY,gBAAZ,EAA8B;AAC/C,OAAG,WAAWF,IAAM,EAApB,GAAyBA,IADsB;AAE/C,OAAG,eAAeC,gBAAkB,EAApC,GAAyCA,gBAFM;AAG/C,OAAG,kBAAkBA,gBAAkB,EAAvC,GAA4CA;AAHG,KAA9B,CAAlB;AAMA,WACC,sCAAaE,2BAAcN,IAAd,CAAoB;AAAEK,MAAAA;AAAF,KAApB,CAAb,EACC;AAAK,MAAA,SAAS,EAAC;AAAf,OACI,KAAKJ,GAAK;AAAI;AADlB,KADD,EAIG,CAAEM,sBAASC,OAAT,CAAkBN,OAAlB,CAAF,IACD,4BAAC,qBAAD,CAAU,OAAV;AAAkB,MAAA,OAAO,EAAC,YAA1B;AAAuC,MAAA,KAAK,EAAGA;AAA/C,MALF,CADD;AAUA;;AAzBS,CAAX;AA4BA,MAAMO,EAAE,GAAG;AACVb,EAAAA,UAAU,EAAEC,eADF;;AAEVG,EAAAA,IAAI,QAA6D;AAAA,QAA3D;AAAEJ,MAAAA,UAAU,EAAE;AAAEK,QAAAA,GAAF;AAAOC,QAAAA,OAAP;AAAgBC,QAAAA,IAAhB;AAAsBC,QAAAA;AAAtB;AAAd,KAA2D;;AAChE,QAAK,CAAEH,GAAP,EAAa;AACZ,aAAO,IAAP;AACA;;AAED,UAAMS,cAAc,GAAG,yBAAY,gBAAZ,EAA8B;AACpD,OAAG,WAAWP,IAAM,EAApB,GAAyBA,IAD2B;AAEpD,OAAG,eAAeC,gBAAkB,EAApC,GAAyCA;AAFW,KAA9B,CAAvB;AAKA,WACC;AAAQ,MAAA,SAAS,EAAGM;AAApB,OACI,KAAKT,GAAK;AAAI;AADlB,MAEG,CAAEM,sBAASC,OAAT,CAAkBN,OAAlB,CAAF,IACD,4BAAC,qBAAD,CAAU,OAAV;AAAkB,MAAA,OAAO,EAAC,YAA1B;AAAuC,MAAA,KAAK,EAAGA;AAA/C,MAHF,CADD;AAQA;;AApBS,CAAX;AAuBA,MAAMS,UAAU,GAAG,CAAEZ,EAAF,EAAMU,EAAN,CAAnB;eAEeE,U","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\n\n/**\n * WordPress dependencies\n */\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\n\nconst { attributes: blockAttributes } = metadata;\n\n// In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname\n// to the embed figcaption element.\nconst v2 = {\n\tattributes: blockAttributes,\n\tsave( { attributes } ) {\n\t\tconst { url, caption, type, providerNameSlug } = attributes;\n\n\t\tif ( ! url ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst className = classnames( 'wp-block-embed', {\n\t\t\t[ `is-type-${ type }` ]: type,\n\t\t\t[ `is-provider-${ providerNameSlug }` ]: providerNameSlug,\n\t\t\t[ `wp-block-embed-${ providerNameSlug }` ]: providerNameSlug,\n\t\t} );\n\n\t\treturn (\n\t\t\t<figure { ...useBlockProps.save( { className } ) }>\n\t\t\t\t<div className=\"wp-block-embed__wrapper\">\n\t\t\t\t\t{ `\\n${ url }\\n` /* URL needs to be on its own line. */ }\n\t\t\t\t</div>\n\t\t\t\t{ ! RichText.isEmpty( caption ) && (\n\t\t\t\t\t<RichText.Content tagName=\"figcaption\" value={ caption } />\n\t\t\t\t) }\n\t\t\t</figure>\n\t\t);\n\t},\n};\n\nconst v1 = {\n\tattributes: blockAttributes,\n\tsave( { attributes: { url, caption, type, providerNameSlug } } ) {\n\t\tif ( ! url ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst embedClassName = classnames( 'wp-block-embed', {\n\t\t\t[ `is-type-${ type }` ]: type,\n\t\t\t[ `is-provider-${ providerNameSlug }` ]: providerNameSlug,\n\t\t} );\n\n\t\treturn (\n\t\t\t<figure className={ embedClassName }>\n\t\t\t\t{ `\\n${ url }\\n` /* URL needs to be on its own line. */ }\n\t\t\t\t{ ! RichText.isEmpty( caption ) && (\n\t\t\t\t\t<RichText.Content tagName=\"figcaption\" value={ caption } />\n\t\t\t\t) }\n\t\t\t</figure>\n\t\t);\n\t},\n};\n\nconst deprecated = [ v2, v1 ];\n\nexport default deprecated;\n"]}
|
|
@@ -45,7 +45,7 @@ const EmbedLinkSettings = _ref => {
|
|
|
45
45
|
},
|
|
46
46
|
footer: {
|
|
47
47
|
label: (0, _element.createElement)(_components.FooterMessageLink, {
|
|
48
|
-
href: (0, _i18n.__)('https://wordpress.org/
|
|
48
|
+
href: (0, _i18n.__)('https://wordpress.org/documentation/article/embeds/'),
|
|
49
49
|
value: (0, _i18n.__)('Learn more about embeds')
|
|
50
50
|
}),
|
|
51
51
|
separatorType: 'topFullWidth'
|