@wordpress/block-library 7.13.0 → 7.13.1-next.957ca95e4c.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 (242) hide show
  1. package/build/columns/transforms.js +10 -1
  2. package/build/columns/transforms.js.map +1 -1
  3. package/build/cover/edit/block-controls.js +9 -2
  4. package/build/cover/edit/block-controls.js.map +1 -1
  5. package/build/gallery/gap-styles.js +5 -4
  6. package/build/gallery/gap-styles.js.map +1 -1
  7. package/build/home-link/index.js +14 -1
  8. package/build/home-link/index.js.map +1 -1
  9. package/build/image/edit.js +3 -1
  10. package/build/image/edit.js.map +1 -1
  11. package/build/image/use-client-width.js +3 -1
  12. package/build/image/use-client-width.js.map +1 -1
  13. package/build/index.js +1 -1
  14. package/build/index.js.map +1 -1
  15. package/build/index.native.js +3 -15
  16. package/build/index.native.js.map +1 -1
  17. package/build/latest-posts/deprecated.js +14 -1
  18. package/build/latest-posts/deprecated.js.map +1 -1
  19. package/build/latest-posts/index.js +14 -1
  20. package/build/latest-posts/index.js.map +1 -1
  21. package/build/list/deprecated.js +84 -1
  22. package/build/list/deprecated.js.map +1 -1
  23. package/build/list/edit.js +153 -134
  24. package/build/list/edit.js.map +1 -1
  25. package/build/list/index.js +29 -34
  26. package/build/list/index.js.map +1 -1
  27. package/build/list/save.js +1 -5
  28. package/build/list/save.js.map +1 -1
  29. package/build/list/{v2/tag-name.js → tag-name.js} +0 -0
  30. package/build/list/tag-name.js.map +1 -0
  31. package/build/list/{v2/tag-name.native.js → tag-name.native.js} +0 -0
  32. package/build/list/tag-name.native.js.map +1 -0
  33. package/build/list/transforms.js +61 -95
  34. package/build/list/transforms.js.map +1 -1
  35. package/build/list/{v2/migrate.js → utils.js} +3 -2
  36. package/build/list/utils.js.map +1 -0
  37. package/build/list-item/edit.native.js +21 -3
  38. package/build/list-item/edit.native.js.map +1 -1
  39. package/build/list-item/hooks/use-copy.js +2 -0
  40. package/build/list-item/hooks/use-copy.js.map +1 -1
  41. package/build/list-item/hooks/use-merge.js +0 -1
  42. package/build/list-item/hooks/use-merge.js.map +1 -1
  43. package/build/list-item/hooks/use-outdent-list-item.js +0 -1
  44. package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
  45. package/build/list-item/hooks/use-space.js +10 -1
  46. package/build/list-item/hooks/use-space.js.map +1 -1
  47. package/build/list-item/index.js +0 -1
  48. package/build/list-item/index.js.map +1 -1
  49. package/build/list-item/utils.js +0 -1
  50. package/build/list-item/utils.js.map +1 -1
  51. package/build/navigation/edit/index.js +6 -3
  52. package/build/navigation/edit/index.js.map +1 -1
  53. package/build/navigation/edit/responsive-wrapper.js +6 -4
  54. package/build/navigation/edit/responsive-wrapper.js.map +1 -1
  55. package/build/navigation/edit/unsaved-inner-blocks.js +4 -15
  56. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  57. package/build/post-excerpt/index.js +4 -2
  58. package/build/post-excerpt/index.js.map +1 -1
  59. package/build/post-terms/edit.js +0 -1
  60. package/build/post-terms/edit.js.map +1 -1
  61. package/build/post-terms/use-post-terms.js +4 -24
  62. package/build/post-terms/use-post-terms.js.map +1 -1
  63. package/build/query-no-results/index.js +13 -0
  64. package/build/query-no-results/index.js.map +1 -1
  65. package/build/query-pagination-numbers/index.js +4 -2
  66. package/build/query-pagination-numbers/index.js.map +1 -1
  67. package/build/query-title/index.js +1 -0
  68. package/build/query-title/index.js.map +1 -1
  69. package/build/quote/index.js +4 -2
  70. package/build/quote/index.js.map +1 -1
  71. package/build/term-description/index.js +6 -0
  72. package/build/term-description/index.js.map +1 -1
  73. package/build/verse/index.js +1 -0
  74. package/build/verse/index.js.map +1 -1
  75. package/build-module/columns/transforms.js +10 -1
  76. package/build-module/columns/transforms.js.map +1 -1
  77. package/build-module/cover/edit/block-controls.js +10 -3
  78. package/build-module/cover/edit/block-controls.js.map +1 -1
  79. package/build-module/gallery/gap-styles.js +6 -5
  80. package/build-module/gallery/gap-styles.js.map +1 -1
  81. package/build-module/home-link/index.js +14 -1
  82. package/build-module/home-link/index.js.map +1 -1
  83. package/build-module/image/edit.js +4 -2
  84. package/build-module/image/edit.js.map +1 -1
  85. package/build-module/image/use-client-width.js +3 -1
  86. package/build-module/image/use-client-width.js.map +1 -1
  87. package/build-module/index.js +1 -1
  88. package/build-module/index.js.map +1 -1
  89. package/build-module/index.native.js +3 -15
  90. package/build-module/index.native.js.map +1 -1
  91. package/build-module/latest-posts/deprecated.js +14 -1
  92. package/build-module/latest-posts/deprecated.js.map +1 -1
  93. package/build-module/latest-posts/index.js +14 -1
  94. package/build-module/latest-posts/index.js.map +1 -1
  95. package/build-module/list/deprecated.js +83 -1
  96. package/build-module/list/deprecated.js.map +1 -1
  97. package/build-module/list/edit.js +151 -134
  98. package/build-module/list/edit.js.map +1 -1
  99. package/build-module/list/index.js +29 -29
  100. package/build-module/list/index.js.map +1 -1
  101. package/build-module/list/save.js +2 -6
  102. package/build-module/list/save.js.map +1 -1
  103. package/build-module/list/{v2/tag-name.js → tag-name.js} +0 -0
  104. package/build-module/list/tag-name.js.map +1 -0
  105. package/build-module/list/{v2/tag-name.native.js → tag-name.native.js} +0 -0
  106. package/build-module/list/tag-name.native.js.map +1 -0
  107. package/build-module/list/transforms.js +62 -97
  108. package/build-module/list/transforms.js.map +1 -1
  109. package/build-module/list/{v2/migrate.js → utils.js} +3 -2
  110. package/build-module/list/utils.js.map +1 -0
  111. package/build-module/list-item/edit.native.js +19 -3
  112. package/build-module/list-item/edit.native.js.map +1 -1
  113. package/build-module/list-item/hooks/use-copy.js +2 -0
  114. package/build-module/list-item/hooks/use-copy.js.map +1 -1
  115. package/build-module/list-item/hooks/use-merge.js +0 -1
  116. package/build-module/list-item/hooks/use-merge.js.map +1 -1
  117. package/build-module/list-item/hooks/use-outdent-list-item.js +0 -1
  118. package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
  119. package/build-module/list-item/hooks/use-space.js +10 -1
  120. package/build-module/list-item/hooks/use-space.js.map +1 -1
  121. package/build-module/list-item/index.js +0 -1
  122. package/build-module/list-item/index.js.map +1 -1
  123. package/build-module/list-item/utils.js +0 -1
  124. package/build-module/list-item/utils.js.map +1 -1
  125. package/build-module/navigation/edit/index.js +5 -3
  126. package/build-module/navigation/edit/index.js.map +1 -1
  127. package/build-module/navigation/edit/responsive-wrapper.js +6 -4
  128. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
  129. package/build-module/navigation/edit/unsaved-inner-blocks.js +5 -15
  130. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  131. package/build-module/post-excerpt/index.js +4 -2
  132. package/build-module/post-excerpt/index.js.map +1 -1
  133. package/build-module/post-terms/edit.js +0 -1
  134. package/build-module/post-terms/edit.js.map +1 -1
  135. package/build-module/post-terms/use-post-terms.js +5 -25
  136. package/build-module/post-terms/use-post-terms.js.map +1 -1
  137. package/build-module/query-no-results/index.js +13 -0
  138. package/build-module/query-no-results/index.js.map +1 -1
  139. package/build-module/query-pagination-numbers/index.js +4 -2
  140. package/build-module/query-pagination-numbers/index.js.map +1 -1
  141. package/build-module/query-title/index.js +1 -0
  142. package/build-module/query-title/index.js.map +1 -1
  143. package/build-module/quote/index.js +4 -2
  144. package/build-module/quote/index.js.map +1 -1
  145. package/build-module/term-description/index.js +6 -0
  146. package/build-module/term-description/index.js.map +1 -1
  147. package/build-module/verse/index.js +1 -0
  148. package/build-module/verse/index.js.map +1 -1
  149. package/build-style/button/style-rtl.css +1 -4
  150. package/build-style/button/style.css +1 -4
  151. package/build-style/code/editor-rtl.css +79 -0
  152. package/build-style/code/editor.css +79 -0
  153. package/build-style/cover/editor-rtl.css +0 -3
  154. package/build-style/cover/editor.css +0 -3
  155. package/build-style/editor-rtl.css +9 -44
  156. package/build-style/editor.css +9 -44
  157. package/build-style/group/editor-rtl.css +2 -22
  158. package/build-style/group/editor.css +2 -22
  159. package/build-style/navigation/editor-rtl.css +3 -19
  160. package/build-style/navigation/editor.css +3 -19
  161. package/build-style/navigation/style-rtl.css +8 -1
  162. package/build-style/navigation/style.css +8 -1
  163. package/build-style/style-rtl.css +9 -5
  164. package/build-style/style.css +9 -5
  165. package/package.json +28 -28
  166. package/src/button/style.scss +1 -8
  167. package/src/code/editor.scss +3 -0
  168. package/src/columns/transforms.js +17 -3
  169. package/src/cover/edit/block-controls.js +15 -3
  170. package/src/cover/editor.scss +0 -4
  171. package/src/editor.scss +1 -0
  172. package/src/gallery/gap-styles.js +10 -6
  173. package/src/gallery/index.php +23 -2
  174. package/src/group/editor.scss +1 -28
  175. package/src/home-link/block.json +14 -1
  176. package/src/image/edit.js +3 -3
  177. package/src/image/use-client-width.js +1 -1
  178. package/src/index.js +1 -4
  179. package/src/index.native.js +2 -13
  180. package/src/latest-posts/block.json +14 -1
  181. package/src/list/deprecated.js +71 -1
  182. package/src/list/edit.js +146 -133
  183. package/src/list/index.js +25 -24
  184. package/src/list/save.js +3 -4
  185. package/src/list/{v2/tag-name.js → tag-name.js} +0 -0
  186. package/src/list/{v2/tag-name.native.js → tag-name.native.js} +0 -0
  187. package/src/list/test/__snapshots__/edit.native.js.snap +14 -2
  188. package/src/list/test/edit.native.js +0 -154
  189. package/src/list/transforms.js +57 -111
  190. package/src/list/{v2/migrate.js → utils.js} +2 -2
  191. package/src/list-item/block.json +0 -1
  192. package/src/list-item/edit.native.js +32 -2
  193. package/src/list-item/hooks/use-copy.js +2 -0
  194. package/src/list-item/hooks/use-space.js +10 -2
  195. package/src/list-item/style.native.scss +8 -0
  196. package/src/navigation/edit/index.js +14 -4
  197. package/src/navigation/edit/responsive-wrapper.js +8 -3
  198. package/src/navigation/edit/unsaved-inner-blocks.js +14 -24
  199. package/src/navigation/editor.scss +2 -23
  200. package/src/navigation/index.php +13 -8
  201. package/src/navigation/style.scss +11 -2
  202. package/src/post-excerpt/block.json +4 -2
  203. package/src/post-terms/edit.js +0 -1
  204. package/src/post-terms/use-post-terms.js +10 -15
  205. package/src/query-no-results/block.json +13 -0
  206. package/src/query-pagination-numbers/block.json +4 -2
  207. package/src/query-title/block.json +1 -0
  208. package/src/quote/block.json +4 -2
  209. package/src/term-description/block.json +6 -0
  210. package/src/verse/block.json +1 -0
  211. package/build/list/v2/deprecated.js +0 -117
  212. package/build/list/v2/deprecated.js.map +0 -1
  213. package/build/list/v2/edit.js +0 -200
  214. package/build/list/v2/edit.js.map +0 -1
  215. package/build/list/v2/index.js +0 -36
  216. package/build/list/v2/index.js.map +0 -1
  217. package/build/list/v2/migrate.js.map +0 -1
  218. package/build/list/v2/save.js +0 -34
  219. package/build/list/v2/save.js.map +0 -1
  220. package/build/list/v2/tag-name.js.map +0 -1
  221. package/build/list/v2/tag-name.native.js.map +0 -1
  222. package/build/list/v2/transforms.js +0 -137
  223. package/build/list/v2/transforms.js.map +0 -1
  224. package/build-module/list/v2/deprecated.js +0 -104
  225. package/build-module/list/v2/deprecated.js.map +0 -1
  226. package/build-module/list/v2/edit.js +0 -179
  227. package/build-module/list/v2/edit.js.map +0 -1
  228. package/build-module/list/v2/index.js +0 -21
  229. package/build-module/list/v2/index.js.map +0 -1
  230. package/build-module/list/v2/migrate.js.map +0 -1
  231. package/build-module/list/v2/save.js +0 -23
  232. package/build-module/list/v2/save.js.map +0 -1
  233. package/build-module/list/v2/tag-name.js.map +0 -1
  234. package/build-module/list/v2/tag-name.native.js.map +0 -1
  235. package/build-module/list/v2/transforms.js +0 -127
  236. package/build-module/list/v2/transforms.js.map +0 -1
  237. package/src/list/test/migrate.js +0 -158
  238. package/src/list/v2/deprecated.js +0 -89
  239. package/src/list/v2/edit.js +0 -192
  240. package/src/list/v2/index.js +0 -22
  241. package/src/list/v2/save.js +0 -18
  242. package/src/list/v2/transforms.js +0 -120
@@ -1,200 +0,0 @@
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 _lodash = require("lodash");
15
-
16
- var _blockEditor = require("@wordpress/block-editor");
17
-
18
- var _components = require("@wordpress/components");
19
-
20
- var _data = require("@wordpress/data");
21
-
22
- var _i18n = require("@wordpress/i18n");
23
-
24
- var _icons = require("@wordpress/icons");
25
-
26
- var _blocks = require("@wordpress/blocks");
27
-
28
- var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
29
-
30
- var _orderedListSettings = _interopRequireDefault(require("../ordered-list-settings"));
31
-
32
- var _migrate = require("./migrate");
33
-
34
- var _tagName = _interopRequireDefault(require("./tag-name"));
35
-
36
- /**
37
- * External dependencies
38
- */
39
-
40
- /**
41
- * WordPress dependencies
42
- */
43
-
44
- /**
45
- * Internal dependencies
46
- */
47
- const TEMPLATE = [['core/list-item']];
48
- const NATIVE_MARGIN_SPACING = 8;
49
- /**
50
- * At the moment, deprecations don't handle create blocks from attributes
51
- * (like when using CPT templates). For this reason, this hook is necessary
52
- * to avoid breaking templates using the old list block format.
53
- *
54
- * @param {Object} attributes Block attributes.
55
- * @param {string} clientId Block client ID.
56
- */
57
-
58
- function useMigrateOnLoad(attributes, clientId) {
59
- const registry = (0, _data.useRegistry)();
60
- const {
61
- updateBlockAttributes,
62
- replaceInnerBlocks
63
- } = (0, _data.useDispatch)(_blockEditor.store);
64
- (0, _element.useEffect)(() => {
65
- // As soon as the block is loaded, migrate it to the new version.
66
- if (!attributes.values) {
67
- return;
68
- }
69
-
70
- const [newAttributes, newInnerBlocks] = (0, _migrate.migrateToListV2)(attributes);
71
- (0, _deprecated.default)('Value attribute on the list block', {
72
- since: '6.0',
73
- version: '6.5',
74
- alternative: 'inner blocks'
75
- });
76
- registry.batch(() => {
77
- updateBlockAttributes(clientId, newAttributes);
78
- replaceInnerBlocks(clientId, newInnerBlocks);
79
- });
80
- }, [attributes.values]);
81
- }
82
-
83
- function useOutdentList(clientId) {
84
- const {
85
- canOutdent
86
- } = (0, _data.useSelect)(innerSelect => {
87
- const {
88
- getBlockRootClientId,
89
- getBlock
90
- } = innerSelect(_blockEditor.store);
91
- const parentId = getBlockRootClientId(clientId);
92
- return {
93
- canOutdent: !!parentId && getBlock(parentId).name === 'core/list-item'
94
- };
95
- }, [clientId]);
96
- const {
97
- replaceBlocks,
98
- selectionChange
99
- } = (0, _data.useDispatch)(_blockEditor.store);
100
- const {
101
- getBlockRootClientId,
102
- getBlockAttributes,
103
- getBlock
104
- } = (0, _data.useSelect)(_blockEditor.store);
105
- return [canOutdent, (0, _element.useCallback)(() => {
106
- const parentBlockId = getBlockRootClientId(clientId);
107
- const parentBlockAttributes = getBlockAttributes(parentBlockId); // Create a new parent block without the inner blocks.
108
-
109
- const newParentBlock = (0, _blocks.createBlock)('core/list-item', parentBlockAttributes);
110
- const {
111
- innerBlocks
112
- } = getBlock(clientId); // Replace the parent block with a new parent block without inner blocks,
113
- // and make the inner blocks siblings of the parent.
114
-
115
- replaceBlocks([parentBlockId], [newParentBlock, ...innerBlocks]); // Select the last child of the list being outdent.
116
-
117
- selectionChange((0, _lodash.last)(innerBlocks).clientId);
118
- }, [clientId])];
119
- }
120
-
121
- function IndentUI(_ref) {
122
- let {
123
- clientId
124
- } = _ref;
125
- const [canOutdent, outdentList] = useOutdentList(clientId);
126
- return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.ToolbarButton, {
127
- icon: (0, _i18n.isRTL)() ? _icons.formatOutdentRTL : _icons.formatOutdent,
128
- title: (0, _i18n.__)('Outdent'),
129
- describedBy: (0, _i18n.__)('Outdent list item'),
130
- disabled: !canOutdent,
131
- onClick: outdentList
132
- }));
133
- }
134
-
135
- function Edit(_ref2) {
136
- let {
137
- attributes,
138
- setAttributes,
139
- clientId,
140
- style
141
- } = _ref2;
142
- const blockProps = (0, _blockEditor.useBlockProps)({ ...(_element.Platform.isNative && {
143
- style
144
- })
145
- });
146
- const innerBlocksProps = (0, _blockEditor.useInnerBlocksProps)(blockProps, {
147
- allowedBlocks: ['core/list-item'],
148
- template: TEMPLATE,
149
- templateInsertUpdatesSelection: true,
150
- ...(_element.Platform.isNative && {
151
- marginVertical: NATIVE_MARGIN_SPACING,
152
- marginHorizontal: NATIVE_MARGIN_SPACING
153
- })
154
- });
155
- useMigrateOnLoad(attributes, clientId);
156
- const {
157
- ordered,
158
- reversed,
159
- start
160
- } = attributes;
161
- const controls = (0, _element.createElement)(_blockEditor.BlockControls, {
162
- group: "block"
163
- }, (0, _element.createElement)(_components.ToolbarButton, {
164
- icon: (0, _i18n.isRTL)() ? _icons.formatListBulletsRTL : _icons.formatListBullets,
165
- title: (0, _i18n.__)('Unordered'),
166
- describedBy: (0, _i18n.__)('Convert to unordered list'),
167
- isActive: ordered === false,
168
- onClick: () => {
169
- setAttributes({
170
- ordered: false
171
- });
172
- }
173
- }), (0, _element.createElement)(_components.ToolbarButton, {
174
- icon: (0, _i18n.isRTL)() ? _icons.formatListNumberedRTL : _icons.formatListNumbered,
175
- title: (0, _i18n.__)('Ordered'),
176
- describedBy: (0, _i18n.__)('Convert to ordered list'),
177
- isActive: ordered === true,
178
- onClick: () => {
179
- setAttributes({
180
- ordered: true
181
- });
182
- }
183
- }), (0, _element.createElement)(IndentUI, {
184
- clientId: clientId
185
- }));
186
- return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_tagName.default, (0, _extends2.default)({
187
- ordered: ordered,
188
- reversed: reversed,
189
- start: start
190
- }, innerBlocksProps)), controls, ordered && (0, _element.createElement)(_orderedListSettings.default, {
191
- setAttributes: setAttributes,
192
- ordered: ordered,
193
- reversed: reversed,
194
- start: start
195
- }));
196
- }
197
-
198
- var _default = Edit;
199
- exports.default = _default;
200
- //# sourceMappingURL=edit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/list/v2/edit.js"],"names":["TEMPLATE","NATIVE_MARGIN_SPACING","useMigrateOnLoad","attributes","clientId","registry","updateBlockAttributes","replaceInnerBlocks","blockEditorStore","values","newAttributes","newInnerBlocks","since","version","alternative","batch","useOutdentList","canOutdent","innerSelect","getBlockRootClientId","getBlock","parentId","name","replaceBlocks","selectionChange","getBlockAttributes","parentBlockId","parentBlockAttributes","newParentBlock","innerBlocks","IndentUI","outdentList","formatOutdentRTL","formatOutdent","Edit","setAttributes","style","blockProps","Platform","isNative","innerBlocksProps","allowedBlocks","template","templateInsertUpdatesSelection","marginVertical","marginHorizontal","ordered","reversed","start","controls","formatListBulletsRTL","formatListBullets","formatListNumberedRTL","formatListNumbered"],"mappings":";;;;;;;;;AA0BA;;;;AAvBA;;AAKA;;AAMA;;AACA;;AACA;;AACA;;AAQA;;AAEA;;AAKA;;AACA;;AACA;;AAlCA;AACA;AACA;;AAGA;AACA;AACA;;AAsBA;AACA;AACA;AAKA,MAAMA,QAAQ,GAAG,CAAE,CAAE,gBAAF,CAAF,CAAjB;AACA,MAAMC,qBAAqB,GAAG,CAA9B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,gBAAT,CAA2BC,UAA3B,EAAuCC,QAAvC,EAAkD;AACjD,QAAMC,QAAQ,GAAG,wBAAjB;AACA,QAAM;AAAEC,IAAAA,qBAAF;AAAyBC,IAAAA;AAAzB,MACL,uBAAaC,kBAAb,CADD;AAGA,0BAAW,MAAM;AAChB;AAEA,QAAK,CAAEL,UAAU,CAACM,MAAlB,EAA2B;AAC1B;AACA;;AAED,UAAM,CAAEC,aAAF,EAAiBC,cAAjB,IAAoC,8BAAiBR,UAAjB,CAA1C;AAEA,6BAAY,mCAAZ,EAAiD;AAChDS,MAAAA,KAAK,EAAE,KADyC;AAEhDC,MAAAA,OAAO,EAAE,KAFuC;AAGhDC,MAAAA,WAAW,EAAE;AAHmC,KAAjD;AAMAT,IAAAA,QAAQ,CAACU,KAAT,CAAgB,MAAM;AACrBT,MAAAA,qBAAqB,CAAEF,QAAF,EAAYM,aAAZ,CAArB;AACAH,MAAAA,kBAAkB,CAAEH,QAAF,EAAYO,cAAZ,CAAlB;AAC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2BAAV,GAAiCC,wBADzC;AAEC,IAAA,KAAK,EAAG,cAAI,WAAJ,CAFT;AAGC,IAAA,WAAW,EAAG,cAAI,2BAAJ,CAHf;AAIC,IAAA,QAAQ,EAAGL,OAAO,KAAK,KAJxB;AAKC,IAAA,OAAO,EAAG,MAAM;AACfX,MAAAA,aAAa,CAAE;AAAEW,QAAAA,OAAO,EAAE;AAAX,OAAF,CAAb;AACA;AAPF,IADD,EAUC,4BAAC,yBAAD;AACC,IAAA,IAAI,EAAG,qBAAUM,4BAAV,GAAkCC,yBAD1C;AAEC,IAAA,KAAK,EAAG,cAAI,SAAJ,CAFT;AAGC,IAAA,WAAW,EAAG,cAAI,yBAAJ,CAHf;AAIC,IAAA,QAAQ,EAAGP,OAAO,KAAK,IAJxB;AAKC,IAAA,OAAO,EAAG,MAAM;AACfX,MAAAA,aAAa,CAAE;AAAEW,QAAAA,OAAO,EAAE;AAAX,OAAF,CAAb;AACA;AAPF,IAVD,EAmBC,4BAAC,QAAD;AAAU,IAAA,QAAQ,EAAG1C;AAArB,IAnBD,CADD;AAwBA,SACC,qDACC,4BAAC,gBAAD;AACC,IAAA,OAAO,EAAG0C,OADX;AAEC,IAAA,QAAQ,EAAGC,QAFZ;AAGC,IAAA,KAAK,EAAGC;AAHT,KAIMR,gBAJN,EADD,EAOGS,QAPH,EAQGH,OAAO,IACR,4BAAC,4BAAD;AACC,IAAA,aAAa,EAAGX,aADjB;AAEC,IAAA,OAAO,EAAGW,OAFX;AAGC,IAAA,QAAQ,EAAGC,QAHZ;AAIC,IAAA,KAAK,EAAGC;AAJT,IATF,CADD;AAmBA;;eAEcd,I","sourcesContent":["/**\n * External dependencies\n */\nimport { last } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarButton } from '@wordpress/components';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport {\n\tformatListBullets,\n\tformatListBulletsRTL,\n\tformatListNumbered,\n\tformatListNumberedRTL,\n\tformatOutdent,\n\tformatOutdentRTL,\n} from '@wordpress/icons';\nimport { createBlock } from '@wordpress/blocks';\nimport { useCallback, useEffect, Platform } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport OrderedListSettings from '../ordered-list-settings';\nimport { migrateToListV2 } from './migrate';\nimport TagName from './tag-name';\n\nconst TEMPLATE = [ [ 'core/list-item' ] ];\nconst NATIVE_MARGIN_SPACING = 8;\n\n/**\n * At the moment, deprecations don't handle create blocks from attributes\n * (like when using CPT templates). For this reason, this hook is necessary\n * to avoid breaking templates using the old list block format.\n *\n * @param {Object} attributes Block attributes.\n * @param {string} clientId Block client ID.\n */\nfunction useMigrateOnLoad( attributes, clientId ) {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes, replaceInnerBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\t// As soon as the block is loaded, migrate it to the new version.\n\n\t\tif ( ! attributes.values ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ newAttributes, newInnerBlocks ] = migrateToListV2( attributes );\n\n\t\tdeprecated( 'Value attribute on the list block', {\n\t\t\tsince: '6.0',\n\t\t\tversion: '6.5',\n\t\t\talternative: 'inner blocks',\n\t\t} );\n\n\t\tregistry.batch( () => {\n\t\t\tupdateBlockAttributes( clientId, newAttributes );\n\t\t\treplaceInnerBlocks( clientId, newInnerBlocks );\n\t\t} );\n\t}, [ attributes.values ] );\n}\n\nfunction useOutdentList( clientId ) {\n\tconst { canOutdent } = useSelect(\n\t\t( innerSelect ) => {\n\t\t\tconst { getBlockRootClientId, getBlock } =\n\t\t\t\tinnerSelect( blockEditorStore );\n\t\t\tconst parentId = getBlockRootClientId( clientId );\n\t\t\treturn {\n\t\t\t\tcanOutdent:\n\t\t\t\t\t!! parentId &&\n\t\t\t\t\tgetBlock( parentId ).name === 'core/list-item',\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { replaceBlocks, selectionChange } = useDispatch( blockEditorStore );\n\tconst { getBlockRootClientId, getBlockAttributes, getBlock } =\n\t\tuseSelect( blockEditorStore );\n\n\treturn [\n\t\tcanOutdent,\n\t\tuseCallback( () => {\n\t\t\tconst parentBlockId = getBlockRootClientId( clientId );\n\t\t\tconst parentBlockAttributes = getBlockAttributes( parentBlockId );\n\t\t\t// Create a new parent block without the inner blocks.\n\t\t\tconst newParentBlock = createBlock(\n\t\t\t\t'core/list-item',\n\t\t\t\tparentBlockAttributes\n\t\t\t);\n\t\t\tconst { innerBlocks } = getBlock( clientId );\n\t\t\t// Replace the parent block with a new parent block without inner blocks,\n\t\t\t// and make the inner blocks siblings of the parent.\n\t\t\treplaceBlocks(\n\t\t\t\t[ parentBlockId ],\n\t\t\t\t[ newParentBlock, ...innerBlocks ]\n\t\t\t);\n\t\t\t// Select the last child of the list being outdent.\n\t\t\tselectionChange( last( innerBlocks ).clientId );\n\t\t}, [ clientId ] ),\n\t];\n}\n\nfunction IndentUI( { clientId } ) {\n\tconst [ canOutdent, outdentList ] = useOutdentList( clientId );\n\treturn (\n\t\t<>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatOutdentRTL : formatOutdent }\n\t\t\t\ttitle={ __( 'Outdent' ) }\n\t\t\t\tdescribedBy={ __( 'Outdent list item' ) }\n\t\t\t\tdisabled={ ! canOutdent }\n\t\t\t\tonClick={ outdentList }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nfunction Edit( { attributes, setAttributes, clientId, style } ) {\n\tconst blockProps = useBlockProps( {\n\t\t...( Platform.isNative && { style } ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: [ 'core/list-item' ],\n\t\ttemplate: TEMPLATE,\n\t\ttemplateInsertUpdatesSelection: true,\n\t\t...( Platform.isNative && {\n\t\t\tmarginVertical: NATIVE_MARGIN_SPACING,\n\t\t\tmarginHorizontal: NATIVE_MARGIN_SPACING,\n\t\t} ),\n\t} );\n\tuseMigrateOnLoad( attributes, clientId );\n\tconst { ordered, reversed, start } = attributes;\n\n\tconst controls = (\n\t\t<BlockControls group=\"block\">\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatListBulletsRTL : formatListBullets }\n\t\t\t\ttitle={ __( 'Unordered' ) }\n\t\t\t\tdescribedBy={ __( 'Convert to unordered list' ) }\n\t\t\t\tisActive={ ordered === false }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetAttributes( { ordered: false } );\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatListNumberedRTL : formatListNumbered }\n\t\t\t\ttitle={ __( 'Ordered' ) }\n\t\t\t\tdescribedBy={ __( 'Convert to ordered list' ) }\n\t\t\t\tisActive={ ordered === true }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetAttributes( { ordered: true } );\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<IndentUI clientId={ clientId } />\n\t\t</BlockControls>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<TagName\n\t\t\t\tordered={ ordered }\n\t\t\t\treversed={ reversed }\n\t\t\t\tstart={ start }\n\t\t\t\t{ ...innerBlocksProps }\n\t\t\t/>\n\t\t\t{ controls }\n\t\t\t{ ordered && (\n\t\t\t\t<OrderedListSettings\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tordered={ ordered }\n\t\t\t\t\treversed={ reversed }\n\t\t\t\t\tstart={ start }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Edit;\n"]}
@@ -1,36 +0,0 @@
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 _icons = require("@wordpress/icons");
11
-
12
- var _edit = _interopRequireDefault(require("./edit"));
13
-
14
- var _save = _interopRequireDefault(require("./save"));
15
-
16
- var _transforms = _interopRequireDefault(require("./transforms"));
17
-
18
- var _deprecated = _interopRequireDefault(require("./deprecated"));
19
-
20
- /**
21
- * WordPress dependencies
22
- */
23
-
24
- /**
25
- * Internal dependencies
26
- */
27
- const settings = {
28
- icon: _icons.list,
29
- edit: _edit.default,
30
- save: _save.default,
31
- transforms: _transforms.default,
32
- deprecated: _deprecated.default
33
- };
34
- var _default = settings;
35
- exports.default = _default;
36
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/list/v2/index.js"],"names":["settings","icon","edit","save","transforms","deprecated"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMA,MAAMA,QAAQ,GAAG;AAChBC,EAAAA,IAAI,EAAJA,WADgB;AAEhBC,EAAAA,IAAI,EAAJA,aAFgB;AAGhBC,EAAAA,IAAI,EAAJA,aAHgB;AAIhBC,EAAAA,UAAU,EAAVA,mBAJgB;AAKhBC,EAAAA,UAAU,EAAVA;AALgB,CAAjB;eAQeL,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { list as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport save from './save';\nimport transforms from './transforms';\nimport deprecated from './deprecated';\n\nconst settings = {\n\ticon,\n\tedit,\n\tsave,\n\ttransforms,\n\tdeprecated,\n};\n\nexport default settings;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/list/v2/migrate.js"],"names":["createListBlockFromDOMElement","listElement","listAttributes","ordered","tagName","start","getAttribute","parseInt","undefined","reversed","type","innerBlocks","Array","from","children","map","listItem","childNodes","filter","node","nodeType","TEXT_NODE","textContent","trim","length","reverse","nestedList","nodes","hasNestedList","content","innerHTML","htmlNodes","outerHTML","childAttributes","join","childInnerBlocks","migrateToListV2","attributes","values","list","document","createElement","setAttribute","listBlock"],"mappings":";;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGO,SAASA,6BAAT,CAAwCC,WAAxC,EAAsD;AAAA;;AAC5D,QAAMC,cAAc,GAAG;AACtBC,IAAAA,OAAO,EAAE,SAASF,WAAW,CAACG,OADR;AAEtBC,IAAAA,KAAK,EAAEJ,WAAW,CAACK,YAAZ,CAA0B,OAA1B,IACJC,QAAQ,CAAEN,WAAW,CAACK,YAAZ,CAA0B,OAA1B,CAAF,EAAuC,EAAvC,CADJ,GAEJE,SAJmB;AAKtBC,IAAAA,QAAQ,EACPR,WAAW,CAACK,YAAZ,CAA0B,UAA1B,MAA2C,IAA3C,GAAkD,IAAlD,GAAyDE,SANpC;AAOtBE,IAAAA,IAAI,2BAAET,WAAW,CAACK,YAAZ,CAA0B,MAA1B,CAAF,yEAAwCE;AAPtB,GAAvB;AAUA,QAAMG,WAAW,GAAGC,KAAK,CAACC,IAAN,CAAYZ,WAAW,CAACa,QAAxB,EAAmCC,GAAnC,CACjBC,QAAF,IAAgB;AACf,UAAMF,QAAQ,GAAGF,KAAK,CAACC,IAAN,CAAYG,QAAQ,CAACC,UAArB,EAAkCC,MAAlC,CACdC,IAAF,IACCA,IAAI,CAACC,QAAL,KAAkBD,IAAI,CAACE,SAAvB,IACAF,IAAI,CAACG,WAAL,CAAiBC,IAAjB,GAAwBC,MAAxB,KAAmC,CAHpB,CAAjB;AAKAV,IAAAA,QAAQ,CAACW,OAAT;AACA,UAAM,CAAEC,UAAF,EAAc,GAAGC,KAAjB,IAA2Bb,QAAjC;AAEA,UAAMc,aAAa,GAClBF,UAAU,CAACtB,OAAX,KAAuB,IAAvB,IAA+BsB,UAAU,CAACtB,OAAX,KAAuB,IADvD;;AAEA,QAAK,CAAEwB,aAAP,EAAuB;AACtB,aAAO,yBAAa,gBAAb,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B,MAAnB,EAA2BhC,IAA3B;AACA;;AAED,QAAMiC,SAAS,GAAG3C,6BAA6B,CAAEuC,IAAF,CAA/C;AAEA,SAAO,CACN,EACC,GAAG,kBAAMF,UAAN,EAAkB,CAAE,QAAF,CAAlB,CADJ;AAEC,OAAGM,SAAS,CAACN;AAFd,GADM,EAKNM,SAAS,CAAChC,WALJ,CAAP;AAOA","sourcesContent":["/**\n * External dependencies\n */\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\nexport function createListBlockFromDOMElement( listElement ) {\n\tconst listAttributes = {\n\t\tordered: 'OL' === listElement.tagName,\n\t\tstart: listElement.getAttribute( 'start' )\n\t\t\t? parseInt( listElement.getAttribute( 'start' ), 10 )\n\t\t\t: undefined,\n\t\treversed:\n\t\t\tlistElement.getAttribute( 'reversed' ) === true ? true : undefined,\n\t\ttype: listElement.getAttribute( 'type' ) ?? undefined,\n\t};\n\n\tconst innerBlocks = Array.from( listElement.children ).map(\n\t\t( listItem ) => {\n\t\t\tconst children = Array.from( listItem.childNodes ).filter(\n\t\t\t\t( node ) =>\n\t\t\t\t\tnode.nodeType !== node.TEXT_NODE ||\n\t\t\t\t\tnode.textContent.trim().length !== 0\n\t\t\t);\n\t\t\tchildren.reverse();\n\t\t\tconst [ nestedList, ...nodes ] = children;\n\n\t\t\tconst hasNestedList =\n\t\t\t\tnestedList.tagName === 'UL' || nestedList.tagName === 'OL';\n\t\t\tif ( ! hasNestedList ) {\n\t\t\t\treturn createBlock( 'core/list-item', {\n\t\t\t\t\tcontent: listItem.innerHTML,\n\t\t\t\t} );\n\t\t\t}\n\t\t\tconst htmlNodes = nodes.map( ( node ) => {\n\t\t\t\tif ( node.nodeType === node.TEXT_NODE ) {\n\t\t\t\t\treturn node.textContent;\n\t\t\t\t}\n\t\t\t\treturn node.outerHTML;\n\t\t\t} );\n\t\t\thtmlNodes.reverse();\n\t\t\tconst childAttributes = {\n\t\t\t\tcontent: htmlNodes.join( '' ).trim(),\n\t\t\t};\n\t\t\tconst childInnerBlocks = [\n\t\t\t\tcreateListBlockFromDOMElement( nestedList ),\n\t\t\t];\n\t\t\treturn createBlock(\n\t\t\t\t'core/list-item',\n\t\t\t\tchildAttributes,\n\t\t\t\tchildInnerBlocks\n\t\t\t);\n\t\t}\n\t);\n\n\treturn createBlock( 'core/list', listAttributes, innerBlocks );\n}\n\nexport function migrateToListV2( attributes ) {\n\tconst { values, start, reversed, ordered, type } = attributes;\n\n\tconst list = document.createElement( ordered ? 'ol' : 'ul' );\n\tlist.innerHTML = values;\n\tif ( start ) {\n\t\tlist.setAttribute( 'start', start );\n\t}\n\tif ( reversed ) {\n\t\tlist.setAttribute( 'reversed', true );\n\t}\n\tif ( type ) {\n\t\tlist.setAttribute( 'type', type );\n\t}\n\n\tconst listBlock = createListBlockFromDOMElement( list );\n\n\treturn [\n\t\t{\n\t\t\t...omit( attributes, [ 'values' ] ),\n\t\t\t...listBlock.attributes,\n\t\t},\n\t\tlistBlock.innerBlocks,\n\t];\n}\n"]}
@@ -1,34 +0,0 @@
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
- ordered,
25
- reversed,
26
- start
27
- } = attributes;
28
- const TagName = ordered ? 'ol' : 'ul';
29
- return (0, _element.createElement)(TagName, (0, _extends2.default)({
30
- reversed: reversed,
31
- start: start
32
- }, _blockEditor.useBlockProps.save()), (0, _element.createElement)(_blockEditor.InnerBlocks.Content, null));
33
- }
34
- //# sourceMappingURL=save.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/list/v2/save.js"],"names":["save","attributes","ordered","reversed","start","TagName","useBlockProps"],"mappings":";;;;;;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGe,SAASA,IAAT,OAAgC;AAAA,MAAjB;AAAEC,IAAAA;AAAF,GAAiB;AAC9C,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA,QAAX;AAAqBC,IAAAA;AAArB,MAA+BH,UAArC;AACA,QAAMI,OAAO,GAAGH,OAAO,GAAG,IAAH,GAAU,IAAjC;AACA,SACC,4BAAC,OAAD;AACC,IAAA,QAAQ,EAAGC,QADZ;AAEC,IAAA,KAAK,EAAGC;AAFT,KAGME,2BAAcN,IAAd,EAHN,GAKC,4BAAC,wBAAD,CAAa,OAAb,OALD,CADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { InnerBlocks, useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst { ordered, reversed, start } = attributes;\n\tconst TagName = ordered ? 'ol' : 'ul';\n\treturn (\n\t\t<TagName\n\t\t\treversed={ reversed }\n\t\t\tstart={ start }\n\t\t\t{ ...useBlockProps.save() }\n\t\t>\n\t\t\t<InnerBlocks.Content />\n\t\t</TagName>\n\t);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/list/v2/tag-name.js"],"names":["TagName","props","ref","ordered","extraProps","Tag"],"mappings":";;;;;;;;;AAGA;;;;AAHA;AACA;AACA;AAGA,SAASA,OAAT,CAAkBC,KAAlB,EAAyBC,GAAzB,EAA+B;AAC9B,QAAM;AAAEC,IAAAA,OAAF;AAAW,OAAGC;AAAd,MAA6BH,KAAnC;AACA,QAAMI,GAAG,GAAGF,OAAO,GAAG,IAAH,GAAU,IAA7B;AAEA,SAAO,4BAAC,GAAD;AAAK,IAAA,GAAG,EAAGD;AAAX,KAAsBE,UAAtB,EAAP;AACA;;eAEc,yBAAYJ,OAAZ,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\nfunction TagName( props, ref ) {\n\tconst { ordered, ...extraProps } = props;\n\tconst Tag = ordered ? 'ol' : 'ul';\n\n\treturn <Tag ref={ ref } { ...extraProps } />;\n}\n\nexport default forwardRef( TagName );\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/list/v2/tag-name.native.js"],"names":["TagName","props","ref","start","extraProps"],"mappings":";;;;;;;;;AAGA;;;;AACA;;AAJA;AACA;AACA;AAIA,SAASA,OAAT,CAAkBC,KAAlB,EAAyBC,GAAzB,EAA+B;AAC9B,QAAM;AAAEC,IAAAA,KAAF;AAAS,OAAGC;AAAZ,MAA2BH,KAAjC;AACA,SAAO,4BAAC,gBAAD;AAAM,IAAA,GAAG,EAAGC;AAAZ,KAAuBE,UAAvB,EAAP;AACA;;eAEc,yBAAYJ,OAAZ,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { View } from '@wordpress/primitives';\n\nfunction TagName( props, ref ) {\n\tconst { start, ...extraProps } = props;\n\treturn <View ref={ ref } { ...extraProps } />;\n}\n\nexport default forwardRef( TagName );\n"]}
@@ -1,137 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _blocks = require("@wordpress/blocks");
9
-
10
- var _richText = require("@wordpress/rich-text");
11
-
12
- var _migrate = require("./migrate");
13
-
14
- /**
15
- * WordPress dependencies
16
- */
17
-
18
- /**
19
- * Internal dependencies
20
- */
21
- function getListContentSchema(_ref) {
22
- let {
23
- phrasingContentSchema
24
- } = _ref;
25
- const listContentSchema = { ...phrasingContentSchema,
26
- ul: {},
27
- ol: {
28
- attributes: ['type', 'start', 'reversed']
29
- }
30
- }; // Recursion is needed.
31
- // Possible: ul > li > ul.
32
- // Impossible: ul > ul.
33
-
34
- ['ul', 'ol'].forEach(tag => {
35
- listContentSchema[tag].children = {
36
- li: {
37
- children: listContentSchema
38
- }
39
- };
40
- });
41
- return listContentSchema;
42
- }
43
-
44
- function getListContentFlat(blocks) {
45
- return blocks.flatMap(_ref2 => {
46
- let {
47
- name,
48
- attributes,
49
- innerBlocks = []
50
- } = _ref2;
51
-
52
- if (name === 'core/list-item') {
53
- return [attributes.content, ...getListContentFlat(innerBlocks)];
54
- }
55
-
56
- return getListContentFlat(innerBlocks);
57
- });
58
- }
59
-
60
- const transforms = {
61
- from: [{
62
- type: 'block',
63
- isMultiBlock: true,
64
- blocks: ['core/paragraph', 'core/heading'],
65
- transform: blockAttributes => {
66
- let childBlocks = [];
67
-
68
- if (blockAttributes.length > 1) {
69
- childBlocks = blockAttributes.map(_ref3 => {
70
- let {
71
- content
72
- } = _ref3;
73
- return (0, _blocks.createBlock)('core/list-item', {
74
- content
75
- });
76
- });
77
- } else if (blockAttributes.length === 1) {
78
- const value = (0, _richText.create)({
79
- html: blockAttributes[0].content
80
- });
81
- childBlocks = (0, _richText.split)(value, '\n').map(result => {
82
- return (0, _blocks.createBlock)('core/list-item', {
83
- content: (0, _richText.toHTMLString)({
84
- value: result
85
- })
86
- });
87
- });
88
- }
89
-
90
- return (0, _blocks.createBlock)('core/list', {
91
- anchor: blockAttributes.anchor
92
- }, childBlocks);
93
- }
94
- }, ...['*', '-'].map(prefix => ({
95
- type: 'prefix',
96
- prefix,
97
-
98
- transform(content) {
99
- return (0, _blocks.createBlock)('core/list', {}, [(0, _blocks.createBlock)('core/list-item', {
100
- content
101
- })]);
102
- }
103
-
104
- })), ...['1.', '1)'].map(prefix => ({
105
- type: 'prefix',
106
- prefix,
107
-
108
- transform(content) {
109
- return (0, _blocks.createBlock)('core/list', {
110
- ordered: true
111
- }, [(0, _blocks.createBlock)('core/list-item', {
112
- content
113
- })]);
114
- }
115
-
116
- })), {
117
- type: 'raw',
118
- selector: 'ol,ul',
119
- schema: args => ({
120
- ol: getListContentSchema(args).ol,
121
- ul: getListContentSchema(args).ul
122
- }),
123
- transform: _migrate.createListBlockFromDOMElement
124
- }],
125
- to: [...['core/paragraph', 'core/heading'].map(block => ({
126
- type: 'block',
127
- blocks: [block],
128
- transform: (_attributes, childBlocks) => {
129
- return getListContentFlat(childBlocks).map(content => (0, _blocks.createBlock)(block, {
130
- content
131
- }));
132
- }
133
- }))]
134
- };
135
- var _default = transforms;
136
- exports.default = _default;
137
- //# sourceMappingURL=transforms.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/list/v2/transforms.js"],"names":["getListContentSchema","phrasingContentSchema","listContentSchema","ul","ol","attributes","forEach","tag","children","li","getListContentFlat","blocks","flatMap","name","innerBlocks","content","transforms","from","type","isMultiBlock","transform","blockAttributes","childBlocks","length","map","value","html","result","anchor","prefix","ordered","selector","schema","args","createListBlockFromDOMElement","to","block","_attributes"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,SAASA,oBAAT,OAA2D;AAAA,MAA5B;AAAEC,IAAAA;AAAF,GAA4B;AAC1D,QAAMC,iBAAiB,GAAG,EACzB,GAAGD,qBADsB;AAEzBE,IAAAA,EAAE,EAAE,EAFqB;AAGzBC,IAAAA,EAAE,EAAE;AAAEC,MAAAA,UAAU,EAAE,CAAE,MAAF,EAAU,OAAV,EAAmB,UAAnB;AAAd;AAHqB,GAA1B,CAD0D,CAO1D;AACA;AACA;;AACA,GAAE,IAAF,EAAQ,IAAR,EAAeC,OAAf,CAA0BC,GAAF,IAAW;AAClCL,IAAAA,iBAAiB,CAAEK,GAAF,CAAjB,CAAyBC,QAAzB,GAAoC;AACnCC,MAAAA,EAAE,EAAE;AACHD,QAAAA,QAAQ,EAAEN;AADP;AAD+B,KAApC;AAKA,GAND;AAQA,SAAOA,iBAAP;AACA;;AAED,SAASQ,kBAAT,CAA6BC,MAA7B,EAAsC;AACrC,SAAOA,MAAM,CAACC,OAAP,CAAgB,SAA8C;AAAA,QAA5C;AAAEC,M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,CAFmD;AAG3DhB,IAAAA,SAAS,EAAE,CAAEiB,WAAF,EAAef,WAAf,KAAgC;AAC1C,aAAOZ,kBAAkB,CAAEY,WAAF,CAAlB,CAAkCE,GAAlC,CAAyCT,OAAF,IAC7C,yBAAaqB,KAAb,EAAoB;AACnBrB,QAAAA;AADmB,OAApB,CADM,CAAP;AAKA;AAT0D,GAAf,CAA1C,CADA;AA/Dc,CAAnB;eA8EeC,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { create, split, toHTMLString } from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport { createListBlockFromDOMElement } from './migrate';\n\nfunction getListContentSchema( { phrasingContentSchema } ) {\n\tconst listContentSchema = {\n\t\t...phrasingContentSchema,\n\t\tul: {},\n\t\tol: { attributes: [ 'type', 'start', 'reversed' ] },\n\t};\n\n\t// Recursion is needed.\n\t// Possible: ul > li > ul.\n\t// Impossible: ul > ul.\n\t[ 'ul', 'ol' ].forEach( ( tag ) => {\n\t\tlistContentSchema[ tag ].children = {\n\t\t\tli: {\n\t\t\t\tchildren: listContentSchema,\n\t\t\t},\n\t\t};\n\t} );\n\n\treturn listContentSchema;\n}\n\nfunction getListContentFlat( blocks ) {\n\treturn blocks.flatMap( ( { name, attributes, innerBlocks = [] } ) => {\n\t\tif ( name === 'core/list-item' ) {\n\t\t\treturn [ attributes.content, ...getListContentFlat( innerBlocks ) ];\n\t\t}\n\t\treturn getListContentFlat( innerBlocks );\n\t} );\n}\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tisMultiBlock: true,\n\t\t\tblocks: [ 'core/paragraph', 'core/heading' ],\n\t\t\ttransform: ( blockAttributes ) => {\n\t\t\t\tlet childBlocks = [];\n\t\t\t\tif ( blockAttributes.length > 1 ) {\n\t\t\t\t\tchildBlocks = blockAttributes.map( ( { content } ) => {\n\t\t\t\t\t\treturn createBlock( 'core/list-item', { content } );\n\t\t\t\t\t} );\n\t\t\t\t} else if ( blockAttributes.length === 1 ) {\n\t\t\t\t\tconst value = create( {\n\t\t\t\t\t\thtml: blockAttributes[ 0 ].content,\n\t\t\t\t\t} );\n\t\t\t\t\tchildBlocks = split( value, '\\n' ).map( ( result ) => {\n\t\t\t\t\t\treturn createBlock( 'core/list-item', {\n\t\t\t\t\t\t\tcontent: toHTMLString( { value: result } ),\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/list',\n\t\t\t\t\t{\n\t\t\t\t\t\tanchor: blockAttributes.anchor,\n\t\t\t\t\t},\n\t\t\t\t\tchildBlocks\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\t...[ '*', '-' ].map( ( prefix ) => ( {\n\t\t\ttype: 'prefix',\n\t\t\tprefix,\n\t\t\ttransform( content ) {\n\t\t\t\treturn createBlock( 'core/list', {}, [\n\t\t\t\t\tcreateBlock( 'core/list-item', { content } ),\n\t\t\t\t] );\n\t\t\t},\n\t\t} ) ),\n\t\t...[ '1.', '1)' ].map( ( prefix ) => ( {\n\t\t\ttype: 'prefix',\n\t\t\tprefix,\n\t\t\ttransform( content ) {\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/list',\n\t\t\t\t\t{\n\t\t\t\t\t\tordered: true,\n\t\t\t\t\t},\n\t\t\t\t\t[ createBlock( 'core/list-item', { content } ) ]\n\t\t\t\t);\n\t\t\t},\n\t\t} ) ),\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tselector: 'ol,ul',\n\t\t\tschema: ( args ) => ( {\n\t\t\t\tol: getListContentSchema( args ).ol,\n\t\t\t\tul: getListContentSchema( args ).ul,\n\t\t\t} ),\n\t\t\ttransform: createListBlockFromDOMElement,\n\t\t},\n\t],\n\tto: [\n\t\t...[ 'core/paragraph', 'core/heading' ].map( ( block ) => ( {\n\t\t\ttype: 'block',\n\t\t\tblocks: [ block ],\n\t\t\ttransform: ( _attributes, childBlocks ) => {\n\t\t\t\treturn getListContentFlat( childBlocks ).map( ( content ) =>\n\t\t\t\t\tcreateBlock( block, {\n\t\t\t\t\t\tcontent,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t} ) ),\n\t],\n};\n\nexport default transforms;\n"]}
@@ -1,104 +0,0 @@
1
- import { createElement } from "@wordpress/element";
2
-
3
- /**
4
- * WordPress dependencies
5
- */
6
- import { RichText, useBlockProps } from '@wordpress/block-editor';
7
- /**
8
- * Internal dependencies
9
- */
10
-
11
- import initialDeprecations from '../deprecated';
12
- import { migrateToListV2 } from './migrate';
13
- const v1 = {
14
- attributes: {
15
- ordered: {
16
- type: 'boolean',
17
- default: false,
18
- __experimentalRole: 'content'
19
- },
20
- values: {
21
- type: 'string',
22
- source: 'html',
23
- selector: 'ol,ul',
24
- multiline: 'li',
25
- __unstableMultilineWrapperTags: ['ol', 'ul'],
26
- default: '',
27
- __experimentalRole: 'content'
28
- },
29
- type: {
30
- type: 'string'
31
- },
32
- start: {
33
- type: 'number'
34
- },
35
- reversed: {
36
- type: 'boolean'
37
- },
38
- placeholder: {
39
- type: 'string'
40
- }
41
- },
42
- supports: {
43
- anchor: true,
44
- className: false,
45
- typography: {
46
- fontSize: true,
47
- __experimentalFontFamily: true,
48
- lineHeight: true,
49
- __experimentalFontStyle: true,
50
- __experimentalFontWeight: true,
51
- __experimentalLetterSpacing: true,
52
- __experimentalTextTransform: true,
53
- __experimentalDefaultControls: {
54
- fontSize: true
55
- }
56
- },
57
- color: {
58
- gradients: true,
59
- link: true,
60
- __experimentalDefaultControls: {
61
- background: true,
62
- text: true
63
- }
64
- },
65
- __unstablePasteTextInline: true,
66
- __experimentalSelector: 'ol,ul',
67
- __experimentalSlashInserter: true
68
- },
69
-
70
- save(_ref) {
71
- let {
72
- attributes
73
- } = _ref;
74
- const {
75
- ordered,
76
- values,
77
- type,
78
- reversed,
79
- start
80
- } = attributes;
81
- const TagName = ordered ? 'ol' : 'ul';
82
- return createElement(TagName, useBlockProps.save({
83
- type,
84
- reversed,
85
- start
86
- }), createElement(RichText.Content, {
87
- value: values,
88
- multiline: "li"
89
- }));
90
- },
91
-
92
- migrate: migrateToListV2
93
- };
94
- /**
95
- * New deprecations need to be placed first
96
- * for them to have higher priority.
97
- *
98
- * Old deprecations may need to be updated as well.
99
- *
100
- * See block-deprecation.md
101
- */
102
-
103
- export default [v1, ...initialDeprecations];
104
- //# sourceMappingURL=deprecated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/list/v2/deprecated.js"],"names":["RichText","useBlockProps","initialDeprecations","migrateToListV2","v1","attributes","ordered","type","default","__experimentalRole","values","source","selector","multiline","__unstableMultilineWrapperTags","start","reversed","placeholder","supports","anchor","className","typography","fontSize","__experimentalFontFamily","lineHeight","__experimentalFontStyle","__experimentalFontWeight","__experimentalLetterSpacing","__experimentalTextTransform","__experimentalDefaultControls","color","gradients","link","background","text","__unstablePasteTextInline","__experimentalSelector","__experimentalSlashInserter","save","TagName","migrate"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,aAAnB,QAAwC,yBAAxC;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,eAAhC;AACA,SAASC,eAAT,QAAgC,WAAhC;AAEA,MAAMC,EAAE,GAAG;AACVC,EAAAA,UAAU,EAAE;AACXC,IAAAA,OAAO,EAAE;AACRC,MAAAA,IAAI,EAAE,SADE;AAERC,MAAAA,OAAO,EAAE,KAFD;AAGRC,MAAAA,kBAAkB,EAAE;AAHZ,KADE;AAMXC,IAAAA,MAAM,EAAE;AACPH,MAAAA,IAAI,EAAE,QADC;AAEPI,MAAAA,MAAM,EAAE,MAFD;AAGPC,MAAAA,QAAQ,EAAE,OAHH;AAIPC,MAAAA,SAAS,EAAE,IAJJ;AAKPC,MAAAA,8BAA8B,EAAE,CAAE,IAAF,EAAQ,IAAR,CALzB;AAMPN,MAAAA,OAAO,EAAE,EANF;AAOPC,MAAA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AnC,QAA6CV,UAAnD;AACA,UAAMkC,OAAO,GAAGjC,OAAO,GAAG,IAAH,GAAU,IAAjC;AAEA,WACC,cAAC,OAAD,EAAcL,aAAa,CAACqC,IAAd,CAAoB;AAAE/B,MAAAA,IAAF;AAAQS,MAAAA,QAAR;AAAkBD,MAAAA;AAAlB,KAApB,CAAd,EACC,cAAC,QAAD,CAAU,OAAV;AAAkB,MAAA,KAAK,EAAGL,MAA1B;AAAmC,MAAA,SAAS,EAAC;AAA7C,MADD,CADD;AAKA,GAjES;;AAkEV8B,EAAAA,OAAO,EAAErC;AAlEC,CAAX;AAqEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,CAAEC,EAAF,EAAM,GAAGF,mBAAT,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport initialDeprecations from '../deprecated';\nimport { migrateToListV2 } from './migrate';\n\nconst v1 = {\n\tattributes: {\n\t\tordered: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\t__experimentalRole: 'content',\n\t\t},\n\t\tvalues: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'ol,ul',\n\t\t\tmultiline: 'li',\n\t\t\t__unstableMultilineWrapperTags: [ 'ol', 'ul' ],\n\t\t\tdefault: '',\n\t\t\t__experimentalRole: 'content',\n\t\t},\n\t\ttype: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tstart: {\n\t\t\ttype: 'number',\n\t\t},\n\t\treversed: {\n\t\t\ttype: 'boolean',\n\t\t},\n\t\tplaceholder: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tsupports: {\n\t\tanchor: true,\n\t\tclassName: false,\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\t__experimentalFontFamily: true,\n\t\t\tlineHeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tfontSize: true,\n\t\t\t},\n\t\t},\n\t\tcolor: {\n\t\t\tgradients: true,\n\t\t\tlink: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tbackground: true,\n\t\t\t\ttext: true,\n\t\t\t},\n\t\t},\n\t\t__unstablePasteTextInline: true,\n\t\t__experimentalSelector: 'ol,ul',\n\t\t__experimentalSlashInserter: true,\n\t},\n\tsave( { attributes } ) {\n\t\tconst { ordered, values, type, reversed, start } = attributes;\n\t\tconst TagName = ordered ? 'ol' : 'ul';\n\n\t\treturn (\n\t\t\t<TagName { ...useBlockProps.save( { type, reversed, start } ) }>\n\t\t\t\t<RichText.Content value={ values } multiline=\"li\" />\n\t\t\t</TagName>\n\t\t);\n\t},\n\tmigrate: migrateToListV2,\n};\n\n/**\n * New deprecations need to be placed first\n * for them to have higher priority.\n *\n * Old deprecations may need to be updated as well.\n *\n * See block-deprecation.md\n */\nexport default [ v1, ...initialDeprecations ];\n"]}