@wordpress/block-library 8.9.0 → 8.10.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.
Files changed (284) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/comment-author-name/edit.js +1 -1
  3. package/build/comment-author-name/edit.js.map +1 -1
  4. package/build/comment-edit-link/edit.js +1 -1
  5. package/build/comment-edit-link/edit.js.map +1 -1
  6. package/build/cover/edit/inspector-controls.js +1 -1
  7. package/build/cover/edit/inspector-controls.js.map +1 -1
  8. package/build/cover/index.js +1 -1
  9. package/build/cover/variations.js +1 -1
  10. package/build/cover/variations.js.map +1 -1
  11. package/build/details/edit.js +19 -5
  12. package/build/details/edit.js.map +1 -1
  13. package/build/details/index.js +14 -10
  14. package/build/details/index.js.map +1 -1
  15. package/build/details/save.js +4 -1
  16. package/build/details/save.js.map +1 -1
  17. package/build/embed/variations.js +2 -2
  18. package/build/embed/variations.js.map +1 -1
  19. package/build/file/view.js +1 -1
  20. package/build/file/view.js.map +1 -1
  21. package/build/gallery/edit.js +2 -8
  22. package/build/gallery/edit.js.map +1 -1
  23. package/build/index.js +0 -6
  24. package/build/index.js.map +1 -1
  25. package/build/index.native.js +1 -1
  26. package/build/index.native.js.map +1 -1
  27. package/build/list-item/utils.js +5 -1
  28. package/build/list-item/utils.js.map +1 -1
  29. package/build/loginout/index.js +11 -1
  30. package/build/loginout/index.js.map +1 -1
  31. package/build/navigation/constants.js +13 -0
  32. package/build/navigation/constants.js.map +1 -0
  33. package/build/navigation/edit/index.js +16 -26
  34. package/build/navigation/edit/index.js.map +1 -1
  35. package/build/navigation/edit/inner-blocks.js +4 -7
  36. package/build/navigation/edit/inner-blocks.js.map +1 -1
  37. package/build/navigation/edit/unsaved-inner-blocks.js +4 -6
  38. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  39. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  40. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  41. package/build/navigation/interactivity.js +139 -0
  42. package/build/navigation/interactivity.js.map +1 -0
  43. package/build/navigation-link/edit.js +1 -1
  44. package/build/navigation-link/edit.js.map +1 -1
  45. package/build/navigation-submenu/edit.js +1 -1
  46. package/build/navigation-submenu/edit.js.map +1 -1
  47. package/build/paragraph/index.js +5 -1
  48. package/build/paragraph/index.js.map +1 -1
  49. package/build/paragraph/transforms.js +5 -1
  50. package/build/paragraph/transforms.js.map +1 -1
  51. package/build/post-author-name/edit.js +1 -1
  52. package/build/post-author-name/edit.js.map +1 -1
  53. package/build/post-featured-image/edit.js +1 -2
  54. package/build/post-featured-image/edit.js.map +1 -1
  55. package/build/post-featured-image/overlay.js +5 -0
  56. package/build/post-featured-image/overlay.js.map +1 -1
  57. package/build/post-title/edit.js +14 -4
  58. package/build/post-title/edit.js.map +1 -1
  59. package/build/preformatted/edit.native.js +3 -2
  60. package/build/preformatted/edit.native.js.map +1 -1
  61. package/build/quote/transforms.js +16 -27
  62. package/build/quote/transforms.js.map +1 -1
  63. package/build/read-more/edit.js +1 -1
  64. package/build/read-more/edit.js.map +1 -1
  65. package/build/search/edit.js +9 -1
  66. package/build/search/edit.js.map +1 -1
  67. package/build/site-title/edit/index.js +1 -1
  68. package/build/site-title/edit/index.js.map +1 -1
  69. package/build/social-links/edit.js +2 -2
  70. package/build/social-links/edit.js.map +1 -1
  71. package/build/utils/interactivity/constants.js +9 -0
  72. package/build/utils/interactivity/constants.js.map +1 -0
  73. package/build/utils/interactivity/directives.js +208 -0
  74. package/build/utils/interactivity/directives.js.map +1 -0
  75. package/build/utils/interactivity/hooks.js +112 -0
  76. package/build/utils/interactivity/hooks.js.map +1 -0
  77. package/build/utils/interactivity/hydration.js +34 -0
  78. package/build/utils/interactivity/hydration.js.map +1 -0
  79. package/build/utils/interactivity/index.js +34 -0
  80. package/build/utils/interactivity/index.js.map +1 -0
  81. package/build/utils/interactivity/store.js +67 -0
  82. package/build/utils/interactivity/store.js.map +1 -0
  83. package/build/utils/interactivity/utils.js +87 -0
  84. package/build/utils/interactivity/utils.js.map +1 -0
  85. package/build/utils/interactivity/vdom.js +109 -0
  86. package/build/utils/interactivity/vdom.js.map +1 -0
  87. package/build-module/comment-author-name/edit.js +1 -1
  88. package/build-module/comment-author-name/edit.js.map +1 -1
  89. package/build-module/comment-edit-link/edit.js +1 -1
  90. package/build-module/comment-edit-link/edit.js.map +1 -1
  91. package/build-module/cover/edit/inspector-controls.js +1 -1
  92. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  93. package/build-module/cover/index.js +1 -1
  94. package/build-module/cover/variations.js +1 -1
  95. package/build-module/cover/variations.js.map +1 -1
  96. package/build-module/details/edit.js +20 -6
  97. package/build-module/details/edit.js.map +1 -1
  98. package/build-module/details/index.js +14 -10
  99. package/build-module/details/index.js.map +1 -1
  100. package/build-module/details/save.js +5 -2
  101. package/build-module/details/save.js.map +1 -1
  102. package/build-module/embed/variations.js +2 -2
  103. package/build-module/embed/variations.js.map +1 -1
  104. package/build-module/file/view.js +1 -1
  105. package/build-module/file/view.js.map +1 -1
  106. package/build-module/gallery/edit.js +2 -8
  107. package/build-module/gallery/edit.js.map +1 -1
  108. package/build-module/index.js +0 -4
  109. package/build-module/index.js.map +1 -1
  110. package/build-module/index.native.js +1 -1
  111. package/build-module/index.native.js.map +1 -1
  112. package/build-module/list-item/utils.js +5 -1
  113. package/build-module/list-item/utils.js.map +1 -1
  114. package/build-module/loginout/index.js +11 -1
  115. package/build-module/loginout/index.js.map +1 -1
  116. package/build-module/navigation/constants.js +5 -0
  117. package/build-module/navigation/constants.js.map +1 -0
  118. package/build-module/navigation/edit/index.js +18 -27
  119. package/build-module/navigation/edit/index.js.map +1 -1
  120. package/build-module/navigation/edit/inner-blocks.js +1 -4
  121. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  122. package/build-module/navigation/edit/unsaved-inner-blocks.js +1 -4
  123. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  124. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  125. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  126. package/build-module/navigation/interactivity.js +136 -0
  127. package/build-module/navigation/interactivity.js.map +1 -0
  128. package/build-module/navigation-link/edit.js +1 -1
  129. package/build-module/navigation-link/edit.js.map +1 -1
  130. package/build-module/navigation-submenu/edit.js +1 -1
  131. package/build-module/navigation-submenu/edit.js.map +1 -1
  132. package/build-module/paragraph/index.js +5 -1
  133. package/build-module/paragraph/index.js.map +1 -1
  134. package/build-module/paragraph/transforms.js +5 -1
  135. package/build-module/paragraph/transforms.js.map +1 -1
  136. package/build-module/post-author-name/edit.js +1 -1
  137. package/build-module/post-author-name/edit.js.map +1 -1
  138. package/build-module/post-featured-image/edit.js +1 -2
  139. package/build-module/post-featured-image/edit.js.map +1 -1
  140. package/build-module/post-featured-image/overlay.js +5 -0
  141. package/build-module/post-featured-image/overlay.js.map +1 -1
  142. package/build-module/post-title/edit.js +13 -4
  143. package/build-module/post-title/edit.js.map +1 -1
  144. package/build-module/preformatted/edit.native.js +3 -2
  145. package/build-module/preformatted/edit.native.js.map +1 -1
  146. package/build-module/quote/transforms.js +16 -27
  147. package/build-module/quote/transforms.js.map +1 -1
  148. package/build-module/read-more/edit.js +1 -1
  149. package/build-module/read-more/edit.js.map +1 -1
  150. package/build-module/search/edit.js +9 -1
  151. package/build-module/search/edit.js.map +1 -1
  152. package/build-module/site-title/edit/index.js +1 -1
  153. package/build-module/site-title/edit/index.js.map +1 -1
  154. package/build-module/social-links/edit.js +2 -2
  155. package/build-module/social-links/edit.js.map +1 -1
  156. package/build-module/utils/interactivity/constants.js +2 -0
  157. package/build-module/utils/interactivity/constants.js.map +1 -0
  158. package/build-module/utils/interactivity/directives.js +193 -0
  159. package/build-module/utils/interactivity/directives.js.map +1 -0
  160. package/build-module/utils/interactivity/hooks.js +98 -0
  161. package/build-module/utils/interactivity/hooks.js.map +1 -0
  162. package/build-module/utils/interactivity/hydration.js +21 -0
  163. package/build-module/utils/interactivity/hydration.js.map +1 -0
  164. package/build-module/utils/interactivity/index.js +17 -0
  165. package/build-module/utils/interactivity/index.js.map +1 -0
  166. package/build-module/utils/interactivity/store.js +56 -0
  167. package/build-module/utils/interactivity/store.js.map +1 -0
  168. package/build-module/utils/interactivity/utils.js +75 -0
  169. package/build-module/utils/interactivity/utils.js.map +1 -0
  170. package/build-module/utils/interactivity/vdom.js +97 -0
  171. package/build-module/utils/interactivity/vdom.js.map +1 -0
  172. package/build-style/cover/style-rtl.css +2 -0
  173. package/build-style/cover/style.css +2 -0
  174. package/build-style/{details-summary → details}/editor-rtl.css +1 -1
  175. package/build-style/{details-summary → details}/editor.css +1 -1
  176. package/build-style/details/style-rtl.css +14 -0
  177. package/build-style/details/style.css +14 -0
  178. package/build-style/editor-rtl.css +3 -5
  179. package/build-style/editor.css +3 -5
  180. package/build-style/gallery/editor-rtl.css +0 -4
  181. package/build-style/gallery/editor.css +0 -4
  182. package/build-style/search/editor-rtl.css +1 -0
  183. package/build-style/search/editor.css +1 -0
  184. package/build-style/site-logo/editor-rtl.css +1 -0
  185. package/build-style/site-logo/editor.css +1 -0
  186. package/build-style/style-rtl.css +13 -1
  187. package/build-style/style.css +13 -1
  188. package/package.json +36 -32
  189. package/src/comment-author-name/edit.js +1 -1
  190. package/src/comment-edit-link/edit.js +1 -1
  191. package/src/comment-template/index.php +8 -7
  192. package/src/cover/block.json +1 -1
  193. package/src/cover/edit/inspector-controls.js +56 -54
  194. package/src/cover/style.scss +5 -0
  195. package/src/cover/test/edit.js +56 -2
  196. package/src/cover/variations.js +1 -3
  197. package/src/details/block.json +8 -6
  198. package/src/details/edit.js +27 -5
  199. package/src/details/editor.scss +3 -0
  200. package/src/details/index.js +10 -5
  201. package/src/details/save.js +5 -1
  202. package/src/details/style.scss +16 -0
  203. package/src/editor.scss +1 -1
  204. package/src/embed/variations.js +2 -2
  205. package/src/file/view.js +4 -1
  206. package/src/gallery/edit.js +5 -8
  207. package/src/gallery/editor.scss +0 -6
  208. package/src/gallery/test/index.native.js +48 -3
  209. package/src/image/test/edit.native.js +38 -16
  210. package/src/index.js +0 -4
  211. package/src/index.native.js +1 -0
  212. package/src/loginout/block.json +11 -1
  213. package/src/navigation/constants.js +16 -0
  214. package/src/navigation/edit/index.js +71 -83
  215. package/src/navigation/edit/inner-blocks.js +1 -16
  216. package/src/navigation/edit/unsaved-inner-blocks.js +1 -16
  217. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  218. package/src/navigation/index.php +209 -203
  219. package/src/navigation/interactivity.js +144 -0
  220. package/src/navigation-link/edit.js +1 -1
  221. package/src/navigation-submenu/edit.js +1 -1
  222. package/src/paragraph/block.json +5 -1
  223. package/src/post-author-name/edit.js +1 -1
  224. package/src/post-featured-image/edit.js +1 -1
  225. package/src/post-featured-image/index.php +1 -1
  226. package/src/post-featured-image/overlay.js +4 -0
  227. package/src/post-terms/index.php +2 -2
  228. package/src/post-title/edit.js +8 -1
  229. package/src/preformatted/edit.native.js +1 -3
  230. package/src/quote/transforms.js +0 -6
  231. package/src/read-more/edit.js +1 -1
  232. package/src/search/edit.js +9 -4
  233. package/src/search/editor.scss +1 -0
  234. package/src/site-logo/editor.scss +2 -1
  235. package/src/site-title/edit/index.js +1 -1
  236. package/src/social-links/edit.js +33 -31
  237. package/src/style.scss +0 -1
  238. package/src/template-part/index.php +20 -5
  239. package/src/utils/interactivity/constants.js +1 -0
  240. package/src/utils/interactivity/directives.js +179 -0
  241. package/src/utils/interactivity/hooks.js +76 -0
  242. package/src/utils/interactivity/hydration.js +22 -0
  243. package/src/utils/interactivity/index.js +17 -0
  244. package/src/utils/interactivity/store.js +45 -0
  245. package/src/utils/interactivity/utils.js +66 -0
  246. package/src/utils/interactivity/vdom.js +94 -0
  247. package/tsconfig.json +1 -0
  248. package/tsconfig.tsbuildinfo +1 -1
  249. package/build/details-content/edit.js +0 -34
  250. package/build/details-content/edit.js.map +0 -1
  251. package/build/details-content/index.js +0 -94
  252. package/build/details-content/index.js.map +0 -1
  253. package/build/details-content/save.js +0 -20
  254. package/build/details-content/save.js.map +0 -1
  255. package/build/details-summary/edit.js +0 -42
  256. package/build/details-summary/edit.js.map +0 -1
  257. package/build/details-summary/index.js +0 -97
  258. package/build/details-summary/index.js.map +0 -1
  259. package/build/details-summary/save.js +0 -24
  260. package/build/details-summary/save.js.map +0 -1
  261. package/build-module/details-content/edit.js +0 -23
  262. package/build-module/details-content/edit.js.map +0 -1
  263. package/build-module/details-content/index.js +0 -76
  264. package/build-module/details-content/index.js.map +0 -1
  265. package/build-module/details-content/save.js +0 -11
  266. package/build-module/details-content/save.js.map +0 -1
  267. package/build-module/details-summary/edit.js +0 -30
  268. package/build-module/details-summary/edit.js.map +0 -1
  269. package/build-module/details-summary/index.js +0 -79
  270. package/build-module/details-summary/index.js.map +0 -1
  271. package/build-module/details-summary/save.js +0 -16
  272. package/build-module/details-summary/save.js.map +0 -1
  273. package/build-style/details-summary/style-rtl.css +0 -91
  274. package/build-style/details-summary/style.css +0 -91
  275. package/src/details-content/block.json +0 -50
  276. package/src/details-content/edit.js +0 -29
  277. package/src/details-content/index.js +0 -23
  278. package/src/details-content/save.js +0 -12
  279. package/src/details-summary/block.json +0 -53
  280. package/src/details-summary/edit.js +0 -27
  281. package/src/details-summary/editor.scss +0 -3
  282. package/src/details-summary/index.js +0 -23
  283. package/src/details-summary/save.js +0 -13
  284. package/src/details-summary/style.scss +0 -3
@@ -1,76 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { postContent as icon } from '@wordpress/icons';
5
- /**
6
- * Internal dependencies
7
- */
8
-
9
- import initBlock from '../utils/init-block';
10
- const metadata = {
11
- $schema: "https://schemas.wp.org/trunk/block.json",
12
- apiVersion: 2,
13
- __experimental: true,
14
- name: "core/details-content",
15
- title: "Details Content",
16
- category: "text",
17
- parent: ["core/details"],
18
- description: "Add content that may be shown or hidden via a Details block.",
19
- textdomain: "default",
20
- supports: {
21
- align: false,
22
- color: {
23
- gradients: true,
24
- link: true,
25
- __experimentalDefaultControls: {
26
- background: true,
27
- text: true,
28
- link: true
29
- }
30
- },
31
- __experimentalBorder: {
32
- radius: true,
33
- color: true,
34
- width: true,
35
- style: true
36
- },
37
- html: false,
38
- lock: false,
39
- multiple: false,
40
- reusable: false,
41
- spacing: {
42
- margin: true,
43
- padding: true
44
- },
45
- typography: {
46
- fontSize: true,
47
- lineHeight: true,
48
- __experimentalFontFamily: true,
49
- __experimentalFontWeight: true,
50
- __experimentalFontStyle: true,
51
- __experimentalTextTransform: true,
52
- __experimentalTextDecoration: true,
53
- __experimentalLetterSpacing: true,
54
- __experimentalDefaultControls: {
55
- fontSize: true
56
- }
57
- }
58
- }
59
- };
60
- import edit from './edit';
61
- import save from './save';
62
- const {
63
- name
64
- } = metadata;
65
- export { metadata, name };
66
- export const settings = {
67
- icon,
68
- save,
69
- edit
70
- };
71
- export const init = () => initBlock({
72
- name,
73
- metadata,
74
- settings
75
- });
76
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/details-content/index.js"],"names":["postContent","icon","initBlock","edit","save","name","metadata","settings","init"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,IAAxB,QAAoC,kBAApC;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AACA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBN,EAAAA,IADuB;AAEvBG,EAAAA,IAFuB;AAGvBD,EAAAA;AAHuB,CAAjB;AAMP,OAAO,MAAMK,IAAI,GAAG,MAAMN,SAAS,CAAE;AAAEG,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAF,CAA5B","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"]}
@@ -1,11 +0,0 @@
1
- import { createElement } from "@wordpress/element";
2
-
3
- /**
4
- * WordPress dependencies
5
- */
6
- import { useBlockProps, InnerBlocks } from '@wordpress/block-editor';
7
- export default function save() {
8
- const blockProps = useBlockProps.save();
9
- return createElement("div", blockProps, createElement(InnerBlocks.Content, null));
10
- }
11
- //# sourceMappingURL=save.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/details-content/save.js"],"names":["useBlockProps","InnerBlocks","save","blockProps"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,aAAT,EAAwBC,WAAxB,QAA2C,yBAA3C;AACA,eAAe,SAASC,IAAT,GAAgB;AAC9B,QAAMC,UAAU,GAAGH,aAAa,CAACE,IAAd,EAAnB;AACA,SACC,qBAAUC,UAAV,EACC,cAAC,WAAD,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"]}
@@ -1,30 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { createElement } from "@wordpress/element";
3
-
4
- /**
5
- * WordPress dependencies
6
- */
7
- import { RichText, useBlockProps } from '@wordpress/block-editor';
8
- import { __ } from '@wordpress/i18n';
9
-
10
- function DetailsSummaryEdit(_ref) {
11
- let {
12
- attributes,
13
- setAttributes
14
- } = _ref;
15
- const summary = attributes.summary ? attributes.summary : __('Details');
16
- return createElement("summary", _extends({}, useBlockProps(), {
17
- onClick: event => event.preventDefault()
18
- }), createElement(RichText, {
19
- "aria-label": __('Add summary'),
20
- allowedFormats: [],
21
- withoutInteractiveFormatting: true,
22
- value: summary,
23
- onChange: newSummary => setAttributes({
24
- summary: newSummary
25
- })
26
- }));
27
- }
28
-
29
- export default DetailsSummaryEdit;
30
- //# sourceMappingURL=edit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/details-summary/edit.js"],"names":["RichText","useBlockProps","__","DetailsSummaryEdit","attributes","setAttributes","summary","event","preventDefault","newSummary"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,aAAnB,QAAwC,yBAAxC;AACA,SAASC,EAAT,QAAmB,iBAAnB;;AAEA,SAASC,kBAAT,OAA6D;AAAA,MAAhC;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,GAAgC;AAC5D,QAAMC,OAAO,GAAGF,UAAU,CAACE,OAAX,GAAqBF,UAAU,CAACE,OAAhC,GAA0CJ,EAAE,CAAE,SAAF,CAA5D;AACA,SACC,sCACMD,aAAa,EADnB;AAEC,IAAA,OAAO,EAAKM,KAAF,IAAaA,KAAK,CAACC,cAAN;AAFxB,MAIC,cAAC,QAAD;AACC,kBAAaN,EAAE,CAAE,aAAF,CADhB;AAEC,IAAA,cAAc,EAAG,EAFlB;AAGC,IAAA,4BAA4B,MAH7B;AAIC,IAAA,KAAK,EAAGI,OAJT;AAKC,IAAA,QAAQ,EAAKG,UAAF,IACVJ,aAAa,CAAE;AAAEC,MAAAA,OAAO,EAAEG;AAAX,KAAF;AANf,IAJD,CADD;AAgBA;;AAED,eAAeN,kBAAf","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"]}
@@ -1,79 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { heading as icon } from '@wordpress/icons';
5
- /**
6
- * Internal dependencies
7
- */
8
-
9
- import initBlock from '../utils/init-block';
10
- const metadata = {
11
- $schema: "https://schemas.wp.org/trunk/block.json",
12
- apiVersion: 2,
13
- __experimental: true,
14
- name: "core/details-summary",
15
- title: "Details Summary",
16
- category: "text",
17
- parent: ["core/details"],
18
- description: "Provide summary text used to toggle the display of content inside a Details block.",
19
- textdomain: "default",
20
- attributes: {
21
- summary: {
22
- type: "string"
23
- }
24
- },
25
- supports: {
26
- align: false,
27
- color: {
28
- gradients: true,
29
- __experimentalDefaultControls: {
30
- background: true,
31
- text: true
32
- }
33
- },
34
- __experimentalBorder: {
35
- radius: true,
36
- color: true,
37
- width: true,
38
- style: true
39
- },
40
- html: false,
41
- lock: false,
42
- multiple: false,
43
- reusable: false,
44
- spacing: {
45
- margin: true,
46
- padding: true
47
- },
48
- typography: {
49
- fontSize: true,
50
- lineHeight: true,
51
- __experimentalFontFamily: true,
52
- __experimentalFontWeight: true,
53
- __experimentalFontStyle: true,
54
- __experimentalTextTransform: true,
55
- __experimentalTextDecoration: true,
56
- __experimentalLetterSpacing: true,
57
- __experimentalDefaultControls: {
58
- fontSize: true
59
- }
60
- }
61
- }
62
- };
63
- import edit from './edit';
64
- import save from './save';
65
- const {
66
- name
67
- } = metadata;
68
- export { metadata, name };
69
- export const settings = {
70
- icon,
71
- save,
72
- edit
73
- };
74
- export const init = () => initBlock({
75
- name,
76
- metadata,
77
- settings
78
- });
79
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/details-summary/index.js"],"names":["heading","icon","initBlock","edit","save","name","metadata","settings","init"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,IAAIC,IAApB,QAAgC,kBAAhC;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AACA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBN,EAAAA,IADuB;AAEvBG,EAAAA,IAFuB;AAGvBD,EAAAA;AAHuB,CAAjB;AAMP,OAAO,MAAMK,IAAI,GAAG,MAAMN,SAAS,CAAE;AAAEG,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAF,CAA5B","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"]}
@@ -1,16 +0,0 @@
1
- import { createElement } from "@wordpress/element";
2
-
3
- /**
4
- * WordPress dependencies
5
- */
6
- import { RichText, useBlockProps } from '@wordpress/block-editor';
7
- export default function save(_ref) {
8
- let {
9
- attributes
10
- } = _ref;
11
- const summary = attributes.summary ? attributes.summary : 'Details';
12
- return createElement("summary", useBlockProps.save(), createElement(RichText.Content, {
13
- value: summary
14
- }));
15
- }
16
- //# sourceMappingURL=save.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/details-summary/save.js"],"names":["RichText","useBlockProps","save","attributes","summary"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,aAAnB,QAAwC,yBAAxC;AAEA,eAAe,SAASC,IAAT,OAAgC;AAAA,MAAjB;AAAEC,IAAAA;AAAF,GAAiB;AAC9C,QAAMC,OAAO,GAAGD,UAAU,CAACC,OAAX,GAAqBD,UAAU,CAACC,OAAhC,GAA0C,SAA1D;AACA,SACC,yBAAcH,aAAa,CAACC,IAAd,EAAd,EACC,cAAC,QAAD,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,91 +0,0 @@
1
- /**
2
- * Converts a hex value into the rgb equivalent.
3
- *
4
- * @param {string} hex - the hexadecimal value to convert
5
- * @return {string} comma separated rgb values
6
- */
7
- /**
8
- * Colors
9
- */
10
- /**
11
- * Breakpoints & Media Queries
12
- */
13
- /**
14
- * SCSS Variables.
15
- *
16
- * Please use variables from this sheet to ensure consistency across the UI.
17
- * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
18
- * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
19
- */
20
- /**
21
- * Converts a hex value into the rgb equivalent.
22
- *
23
- * @param {string} hex - the hexadecimal value to convert
24
- * @return {string} comma separated rgb values
25
- */
26
- /**
27
- * Colors
28
- */
29
- /**
30
- * Fonts & basic variables.
31
- */
32
- /**
33
- * Grid System.
34
- * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
35
- */
36
- /**
37
- * Dimensions.
38
- */
39
- /**
40
- * Shadows.
41
- */
42
- /**
43
- * Editor widths.
44
- */
45
- /**
46
- * Block & Editor UI.
47
- */
48
- /**
49
- * Block paddings.
50
- */
51
- /**
52
- * React Native specific.
53
- * These variables do not appear to be used anywhere else.
54
- */
55
- /**
56
- * Converts a hex value into the rgb equivalent.
57
- *
58
- * @param {string} hex - the hexadecimal value to convert
59
- * @return {string} comma separated rgb values
60
- */
61
- /**
62
- * Long content fade mixin
63
- *
64
- * Creates a fading overlay to signify that the content is longer
65
- * than the space allows.
66
- */
67
- /**
68
- * Breakpoint mixins
69
- */
70
- /**
71
- * Focus styles.
72
- */
73
- /**
74
- * Applies editor left position to the selector passed as argument
75
- */
76
- /**
77
- * Styles that are reused verbatim in a few places
78
- */
79
- /**
80
- * Allows users to opt-out of animations via OS-level preferences.
81
- */
82
- /**
83
- * Reset default styles for JavaScript UI based pages.
84
- * This is a WP-admin agnostic reset
85
- */
86
- /**
87
- * Reset the WP Admin page styles for Gutenberg-like pages.
88
- */
89
- .wp-block-details-summary {
90
- cursor: pointer;
91
- }
@@ -1,91 +0,0 @@
1
- /**
2
- * Converts a hex value into the rgb equivalent.
3
- *
4
- * @param {string} hex - the hexadecimal value to convert
5
- * @return {string} comma separated rgb values
6
- */
7
- /**
8
- * Colors
9
- */
10
- /**
11
- * Breakpoints & Media Queries
12
- */
13
- /**
14
- * SCSS Variables.
15
- *
16
- * Please use variables from this sheet to ensure consistency across the UI.
17
- * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
18
- * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
19
- */
20
- /**
21
- * Converts a hex value into the rgb equivalent.
22
- *
23
- * @param {string} hex - the hexadecimal value to convert
24
- * @return {string} comma separated rgb values
25
- */
26
- /**
27
- * Colors
28
- */
29
- /**
30
- * Fonts & basic variables.
31
- */
32
- /**
33
- * Grid System.
34
- * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
35
- */
36
- /**
37
- * Dimensions.
38
- */
39
- /**
40
- * Shadows.
41
- */
42
- /**
43
- * Editor widths.
44
- */
45
- /**
46
- * Block & Editor UI.
47
- */
48
- /**
49
- * Block paddings.
50
- */
51
- /**
52
- * React Native specific.
53
- * These variables do not appear to be used anywhere else.
54
- */
55
- /**
56
- * Converts a hex value into the rgb equivalent.
57
- *
58
- * @param {string} hex - the hexadecimal value to convert
59
- * @return {string} comma separated rgb values
60
- */
61
- /**
62
- * Long content fade mixin
63
- *
64
- * Creates a fading overlay to signify that the content is longer
65
- * than the space allows.
66
- */
67
- /**
68
- * Breakpoint mixins
69
- */
70
- /**
71
- * Focus styles.
72
- */
73
- /**
74
- * Applies editor left position to the selector passed as argument
75
- */
76
- /**
77
- * Styles that are reused verbatim in a few places
78
- */
79
- /**
80
- * Allows users to opt-out of animations via OS-level preferences.
81
- */
82
- /**
83
- * Reset default styles for JavaScript UI based pages.
84
- * This is a WP-admin agnostic reset
85
- */
86
- /**
87
- * Reset the WP Admin page styles for Gutenberg-like pages.
88
- */
89
- .wp-block-details-summary {
90
- cursor: pointer;
91
- }
@@ -1,50 +0,0 @@
1
- {
2
- "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
4
- "__experimental": true,
5
- "name": "core/details-content",
6
- "title": "Details Content",
7
- "category": "text",
8
- "parent": [ "core/details" ],
9
- "description": "Add content that may be shown or hidden via a Details block.",
10
- "textdomain": "default",
11
- "supports": {
12
- "align": false,
13
- "color": {
14
- "gradients": true,
15
- "link": true,
16
- "__experimentalDefaultControls": {
17
- "background": true,
18
- "text": true,
19
- "link": true
20
- }
21
- },
22
- "__experimentalBorder": {
23
- "radius": true,
24
- "color": true,
25
- "width": true,
26
- "style": true
27
- },
28
- "html": false,
29
- "lock": false,
30
- "multiple": false,
31
- "reusable": false,
32
- "spacing": {
33
- "margin": true,
34
- "padding": true
35
- },
36
- "typography": {
37
- "fontSize": true,
38
- "lineHeight": true,
39
- "__experimentalFontFamily": true,
40
- "__experimentalFontWeight": true,
41
- "__experimentalFontStyle": true,
42
- "__experimentalTextTransform": true,
43
- "__experimentalTextDecoration": true,
44
- "__experimentalLetterSpacing": true,
45
- "__experimentalDefaultControls": {
46
- "fontSize": true
47
- }
48
- }
49
- }
50
- }
@@ -1,29 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';
5
- import { __ } from '@wordpress/i18n';
6
- import { View } from '@wordpress/primitives';
7
-
8
- const TEMPLATE = [
9
- [
10
- 'core/paragraph',
11
- {
12
- placeholder: __(
13
- 'Add text or blocks that will display when the details block is opened.'
14
- ),
15
- },
16
- ],
17
- ];
18
-
19
- function DetailsContentEdit() {
20
- const blockProps = useBlockProps();
21
- const innerBlocksProps = useInnerBlocksProps( blockProps, {
22
- template: TEMPLATE,
23
- templateLock: false,
24
- } );
25
-
26
- return <View { ...innerBlocksProps }></View>;
27
- }
28
-
29
- export default DetailsContentEdit;
@@ -1,23 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { postContent as icon } from '@wordpress/icons';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import initBlock from '../utils/init-block';
10
- import metadata from './block.json';
11
- import edit from './edit';
12
- import save from './save';
13
-
14
- const { name } = metadata;
15
- export { metadata, name };
16
-
17
- export const settings = {
18
- icon,
19
- save,
20
- edit,
21
- };
22
-
23
- export const init = () => initBlock( { name, metadata, settings } );
@@ -1,12 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useBlockProps, InnerBlocks } from '@wordpress/block-editor';
5
- export default function save() {
6
- const blockProps = useBlockProps.save();
7
- return (
8
- <div { ...blockProps }>
9
- <InnerBlocks.Content />
10
- </div>
11
- );
12
- }
@@ -1,53 +0,0 @@
1
- {
2
- "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
4
- "__experimental": true,
5
- "name": "core/details-summary",
6
- "title": "Details Summary",
7
- "category": "text",
8
- "parent": [ "core/details" ],
9
- "description": "Provide summary text used to toggle the display of content inside a Details block.",
10
- "textdomain": "default",
11
- "attributes": {
12
- "summary": {
13
- "type": "string"
14
- }
15
- },
16
- "supports": {
17
- "align": false,
18
- "color": {
19
- "gradients": true,
20
- "__experimentalDefaultControls": {
21
- "background": true,
22
- "text": true
23
- }
24
- },
25
- "__experimentalBorder": {
26
- "radius": true,
27
- "color": true,
28
- "width": true,
29
- "style": true
30
- },
31
- "html": false,
32
- "lock": false,
33
- "multiple": false,
34
- "reusable": false,
35
- "spacing": {
36
- "margin": true,
37
- "padding": true
38
- },
39
- "typography": {
40
- "fontSize": true,
41
- "lineHeight": true,
42
- "__experimentalFontFamily": true,
43
- "__experimentalFontWeight": true,
44
- "__experimentalFontStyle": true,
45
- "__experimentalTextTransform": true,
46
- "__experimentalTextDecoration": true,
47
- "__experimentalLetterSpacing": true,
48
- "__experimentalDefaultControls": {
49
- "fontSize": true
50
- }
51
- }
52
- }
53
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { RichText, useBlockProps } from '@wordpress/block-editor';
5
- import { __ } from '@wordpress/i18n';
6
-
7
- function DetailsSummaryEdit( { attributes, setAttributes } ) {
8
- const summary = attributes.summary ? attributes.summary : __( 'Details' );
9
- return (
10
- <summary
11
- { ...useBlockProps() }
12
- onClick={ ( event ) => event.preventDefault() }
13
- >
14
- <RichText
15
- aria-label={ __( 'Add summary' ) }
16
- allowedFormats={ [] }
17
- withoutInteractiveFormatting
18
- value={ summary }
19
- onChange={ ( newSummary ) =>
20
- setAttributes( { summary: newSummary } )
21
- }
22
- />
23
- </summary>
24
- );
25
- }
26
-
27
- export default DetailsSummaryEdit;
@@ -1,3 +0,0 @@
1
- .wp-block-details-summary div {
2
- display: inline;
3
- }
@@ -1,23 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { heading as icon } from '@wordpress/icons';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import initBlock from '../utils/init-block';
10
- import metadata from './block.json';
11
- import edit from './edit';
12
- import save from './save';
13
-
14
- const { name } = metadata;
15
- export { metadata, name };
16
-
17
- export const settings = {
18
- icon,
19
- save,
20
- edit,
21
- };
22
-
23
- export const init = () => initBlock( { name, metadata, settings } );
@@ -1,13 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { RichText, useBlockProps } from '@wordpress/block-editor';
5
-
6
- export default function save( { attributes } ) {
7
- const summary = attributes.summary ? attributes.summary : 'Details';
8
- return (
9
- <summary { ...useBlockProps.save() }>
10
- <RichText.Content value={ summary } />
11
- </summary>
12
- );
13
- }
@@ -1,3 +0,0 @@
1
- .wp-block-details-summary {
2
- cursor: pointer;
3
- }