@wordpress/block-library 8.20.1 → 8.21.1-next.f8d8eceb.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 (412) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +12 -0
  3. package/build/avatar/index.js +5 -1
  4. package/build/avatar/index.js.map +1 -1
  5. package/build/block/edit-title.native.js +11 -3
  6. package/build/block/edit-title.native.js.map +1 -1
  7. package/build/block/index.js +2 -1
  8. package/build/block/index.js.map +1 -1
  9. package/build/code/edit.native.js +8 -2
  10. package/build/code/edit.native.js.map +1 -1
  11. package/build/column/edit.js +2 -1
  12. package/build/column/edit.js.map +1 -1
  13. package/build/column/edit.native.js +2 -1
  14. package/build/column/edit.native.js.map +1 -1
  15. package/build/columns/edit.native.js +2 -1
  16. package/build/columns/edit.native.js.map +1 -1
  17. package/build/cover/controls.native.js +2 -1
  18. package/build/cover/controls.native.js.map +1 -1
  19. package/build/cover/deprecated.js +110 -1
  20. package/build/cover/deprecated.js.map +1 -1
  21. package/build/cover/edit/index.js +11 -4
  22. package/build/cover/edit/index.js.map +1 -1
  23. package/build/cover/edit/inspector-controls.js +3 -3
  24. package/build/cover/edit/inspector-controls.js.map +1 -1
  25. package/build/cover/index.js +0 -3
  26. package/build/cover/index.js.map +1 -1
  27. package/build/cover/save.js +2 -1
  28. package/build/cover/save.js.map +1 -1
  29. package/build/cover/shared.js +1 -1
  30. package/build/cover/shared.js.map +1 -1
  31. package/build/file/view.js +1 -1
  32. package/build/file/view.js.map +1 -1
  33. package/build/footnotes/index.js +1 -0
  34. package/build/footnotes/index.js.map +1 -1
  35. package/build/form/edit.js +138 -0
  36. package/build/form/edit.js.map +1 -0
  37. package/build/form/index.js +92 -0
  38. package/build/form/index.js.map +1 -0
  39. package/build/form/init.js +13 -0
  40. package/build/form/init.js.map +1 -0
  41. package/build/form/save.js +28 -0
  42. package/build/form/save.js.map +1 -0
  43. package/build/form/utils.js +24 -0
  44. package/build/form/utils.js.map +1 -0
  45. package/build/form/variations.js +95 -0
  46. package/build/form/variations.js.map +1 -0
  47. package/build/form/view.js +42 -0
  48. package/build/form/view.js.map +1 -0
  49. package/build/form-input/edit.js +124 -0
  50. package/build/form-input/edit.js.map +1 -0
  51. package/build/form-input/index.js +105 -0
  52. package/build/form-input/index.js.map +1 -0
  53. package/build/form-input/init.js +13 -0
  54. package/build/form-input/init.js.map +1 -0
  55. package/build/form-input/save.js +87 -0
  56. package/build/form-input/save.js.map +1 -0
  57. package/build/form-input/variations.js +93 -0
  58. package/build/form-input/variations.js.map +1 -0
  59. package/build/form-submission-notification/edit.js +59 -0
  60. package/build/form-submission-notification/edit.js.map +1 -0
  61. package/build/form-submission-notification/index.js +56 -0
  62. package/build/form-submission-notification/index.js.map +1 -0
  63. package/build/form-submission-notification/init.js +13 -0
  64. package/build/form-submission-notification/init.js.map +1 -0
  65. package/build/form-submission-notification/save.js +33 -0
  66. package/build/form-submission-notification/save.js.map +1 -0
  67. package/build/form-submission-notification/variations.js +63 -0
  68. package/build/form-submission-notification/variations.js.map +1 -0
  69. package/build/form-submit-button/edit.js +32 -0
  70. package/build/form-submit-button/edit.js.map +1 -0
  71. package/build/form-submit-button/index.js +44 -0
  72. package/build/form-submit-button/index.js.map +1 -0
  73. package/build/form-submit-button/init.js +13 -0
  74. package/build/form-submit-button/init.js.map +1 -0
  75. package/build/form-submit-button/save.js +22 -0
  76. package/build/form-submit-button/save.js.map +1 -0
  77. package/build/group/edit.js +2 -11
  78. package/build/group/edit.js.map +1 -1
  79. package/build/group/index.js +0 -1
  80. package/build/group/index.js.map +1 -1
  81. package/build/heading/index.js +3 -2
  82. package/build/heading/index.js.map +1 -1
  83. package/build/html/preview.js +2 -4
  84. package/build/html/preview.js.map +1 -1
  85. package/build/image/image.js +15 -6
  86. package/build/image/image.js.map +1 -1
  87. package/build/image/view.js +71 -39
  88. package/build/image/view.js.map +1 -1
  89. package/build/index.js +10 -0
  90. package/build/index.js.map +1 -1
  91. package/build/latest-posts/edit.js +6 -2
  92. package/build/latest-posts/edit.js.map +1 -1
  93. package/build/list-item/hooks/use-merge.js +15 -15
  94. package/build/list-item/hooks/use-merge.js.map +1 -1
  95. package/build/lock-unlock.js +1 -1
  96. package/build/lock-unlock.js.map +1 -1
  97. package/build/missing/edit.native.js +54 -64
  98. package/build/missing/edit.native.js.map +1 -1
  99. package/build/navigation/edit/index.js +0 -1
  100. package/build/navigation/edit/index.js.map +1 -1
  101. package/build/navigation/index.js +2 -1
  102. package/build/navigation/index.js.map +1 -1
  103. package/build/navigation/view.js +27 -5
  104. package/build/navigation/view.js.map +1 -1
  105. package/build/page-list-item/edit.js +3 -1
  106. package/build/page-list-item/edit.js.map +1 -1
  107. package/build/paragraph/edit.js +1 -1
  108. package/build/paragraph/edit.js.map +1 -1
  109. package/build/paragraph/index.js +7 -0
  110. package/build/paragraph/index.js.map +1 -1
  111. package/build/pattern/index.js +2 -1
  112. package/build/pattern/index.js.map +1 -1
  113. package/build/post-featured-image/dimension-controls.js +2 -2
  114. package/build/post-featured-image/dimension-controls.js.map +1 -1
  115. package/build/query/edit/enhanced-pagination-modal.js +27 -13
  116. package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
  117. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +15 -12
  118. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  119. package/build/query/utils.js +29 -8
  120. package/build/query/utils.js.map +1 -1
  121. package/build/query/view.js +4 -2
  122. package/build/query/view.js.map +1 -1
  123. package/build/search/edit.js +1 -2
  124. package/build/search/edit.js.map +1 -1
  125. package/build/social-link/edit.native.js +7 -19
  126. package/build/social-link/edit.native.js.map +1 -1
  127. package/build/spacer/controls.js +3 -3
  128. package/build/spacer/controls.js.map +1 -1
  129. package/build/spacer/controls.native.js +2 -1
  130. package/build/spacer/controls.native.js.map +1 -1
  131. package/build/spacer/edit.js +1 -1
  132. package/build/spacer/edit.js.map +1 -1
  133. package/build/spacer/edit.native.js +5 -1
  134. package/build/spacer/edit.native.js.map +1 -1
  135. package/build/tag-cloud/edit.js +2 -1
  136. package/build/tag-cloud/edit.js.map +1 -1
  137. package/build/template-part/edit/inner-blocks.js +2 -2
  138. package/build/template-part/edit/inner-blocks.js.map +1 -1
  139. package/build/template-part/index.js +2 -1
  140. package/build/template-part/index.js.map +1 -1
  141. package/build/term-description/index.js +0 -1
  142. package/build/term-description/index.js.map +1 -1
  143. package/build-module/avatar/index.js +5 -1
  144. package/build-module/avatar/index.js.map +1 -1
  145. package/build-module/block/edit-title.native.js +12 -4
  146. package/build-module/block/edit-title.native.js.map +1 -1
  147. package/build-module/block/index.js +2 -1
  148. package/build-module/block/index.js.map +1 -1
  149. package/build-module/code/edit.native.js +8 -2
  150. package/build-module/code/edit.native.js.map +1 -1
  151. package/build-module/column/edit.js +3 -2
  152. package/build-module/column/edit.js.map +1 -1
  153. package/build-module/column/edit.native.js +3 -2
  154. package/build-module/column/edit.native.js.map +1 -1
  155. package/build-module/columns/edit.native.js +3 -2
  156. package/build-module/columns/edit.native.js.map +1 -1
  157. package/build-module/cover/controls.native.js +3 -2
  158. package/build-module/cover/controls.native.js.map +1 -1
  159. package/build-module/cover/deprecated.js +110 -1
  160. package/build-module/cover/deprecated.js.map +1 -1
  161. package/build-module/cover/edit/index.js +12 -5
  162. package/build-module/cover/edit/index.js.map +1 -1
  163. package/build-module/cover/edit/inspector-controls.js +4 -4
  164. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  165. package/build-module/cover/index.js +0 -3
  166. package/build-module/cover/index.js.map +1 -1
  167. package/build-module/cover/save.js +2 -1
  168. package/build-module/cover/save.js.map +1 -1
  169. package/build-module/cover/shared.js +1 -1
  170. package/build-module/cover/shared.js.map +1 -1
  171. package/build-module/file/view.js +2 -2
  172. package/build-module/file/view.js.map +1 -1
  173. package/build-module/footnotes/index.js +1 -0
  174. package/build-module/footnotes/index.js.map +1 -1
  175. package/build-module/form/edit.js +130 -0
  176. package/build-module/form/edit.js.map +1 -0
  177. package/build-module/form/index.js +82 -0
  178. package/build-module/form/index.js.map +1 -0
  179. package/build-module/form/init.js +6 -0
  180. package/build-module/form/init.js.map +1 -0
  181. package/build-module/form/save.js +20 -0
  182. package/build-module/form/save.js.map +1 -0
  183. package/build-module/form/utils.js +15 -0
  184. package/build-module/form/utils.js.map +1 -0
  185. package/build-module/form/variations.js +86 -0
  186. package/build-module/form/variations.js.map +1 -0
  187. package/build-module/form/view.js +40 -0
  188. package/build-module/form/view.js.map +1 -0
  189. package/build-module/form-input/edit.js +115 -0
  190. package/build-module/form-input/edit.js.map +1 -0
  191. package/build-module/form-input/index.js +95 -0
  192. package/build-module/form-input/index.js.map +1 -0
  193. package/build-module/form-input/init.js +6 -0
  194. package/build-module/form-input/init.js.map +1 -0
  195. package/build-module/form-input/save.js +80 -0
  196. package/build-module/form-input/save.js.map +1 -0
  197. package/build-module/form-input/variations.js +85 -0
  198. package/build-module/form-input/variations.js.map +1 -0
  199. package/build-module/form-submission-notification/edit.js +50 -0
  200. package/build-module/form-submission-notification/edit.js.map +1 -0
  201. package/build-module/form-submission-notification/index.js +47 -0
  202. package/build-module/form-submission-notification/index.js.map +1 -0
  203. package/build-module/form-submission-notification/init.js +6 -0
  204. package/build-module/form-submission-notification/init.js.map +1 -0
  205. package/build-module/form-submission-notification/save.js +25 -0
  206. package/build-module/form-submission-notification/save.js.map +1 -0
  207. package/build-module/form-submission-notification/variations.js +55 -0
  208. package/build-module/form-submission-notification/variations.js.map +1 -0
  209. package/build-module/form-submit-button/edit.js +24 -0
  210. package/build-module/form-submit-button/edit.js.map +1 -0
  211. package/build-module/form-submit-button/index.js +34 -0
  212. package/build-module/form-submit-button/index.js.map +1 -0
  213. package/build-module/form-submit-button/init.js +6 -0
  214. package/build-module/form-submit-button/init.js.map +1 -0
  215. package/build-module/form-submit-button/save.js +14 -0
  216. package/build-module/form-submit-button/save.js.map +1 -0
  217. package/build-module/group/edit.js +3 -12
  218. package/build-module/group/edit.js.map +1 -1
  219. package/build-module/group/index.js +0 -1
  220. package/build-module/group/index.js.map +1 -1
  221. package/build-module/heading/index.js +3 -2
  222. package/build-module/heading/index.js.map +1 -1
  223. package/build-module/html/preview.js +2 -4
  224. package/build-module/html/preview.js.map +1 -1
  225. package/build-module/image/image.js +16 -7
  226. package/build-module/image/image.js.map +1 -1
  227. package/build-module/image/view.js +71 -39
  228. package/build-module/image/view.js.map +1 -1
  229. package/build-module/index.js +10 -0
  230. package/build-module/index.js.map +1 -1
  231. package/build-module/latest-posts/edit.js +6 -2
  232. package/build-module/latest-posts/edit.js.map +1 -1
  233. package/build-module/list-item/hooks/use-merge.js +15 -15
  234. package/build-module/list-item/hooks/use-merge.js.map +1 -1
  235. package/build-module/lock-unlock.js +1 -1
  236. package/build-module/lock-unlock.js.map +1 -1
  237. package/build-module/missing/edit.native.js +58 -68
  238. package/build-module/missing/edit.native.js.map +1 -1
  239. package/build-module/navigation/edit/index.js +0 -1
  240. package/build-module/navigation/edit/index.js.map +1 -1
  241. package/build-module/navigation/index.js +2 -1
  242. package/build-module/navigation/index.js.map +1 -1
  243. package/build-module/navigation/view.js +27 -5
  244. package/build-module/navigation/view.js.map +1 -1
  245. package/build-module/page-list-item/edit.js +3 -1
  246. package/build-module/page-list-item/edit.js.map +1 -1
  247. package/build-module/paragraph/edit.js +2 -2
  248. package/build-module/paragraph/edit.js.map +1 -1
  249. package/build-module/paragraph/index.js +7 -0
  250. package/build-module/paragraph/index.js.map +1 -1
  251. package/build-module/pattern/index.js +2 -1
  252. package/build-module/pattern/index.js.map +1 -1
  253. package/build-module/post-featured-image/dimension-controls.js +3 -3
  254. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  255. package/build-module/query/edit/enhanced-pagination-modal.js +28 -14
  256. package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
  257. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +17 -14
  258. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  259. package/build-module/query/utils.js +27 -5
  260. package/build-module/query/utils.js.map +1 -1
  261. package/build-module/query/view.js +4 -2
  262. package/build-module/query/view.js.map +1 -1
  263. package/build-module/search/edit.js +2 -3
  264. package/build-module/search/edit.js.map +1 -1
  265. package/build-module/social-link/edit.native.js +8 -20
  266. package/build-module/social-link/edit.native.js.map +1 -1
  267. package/build-module/spacer/controls.js +4 -4
  268. package/build-module/spacer/controls.js.map +1 -1
  269. package/build-module/spacer/controls.native.js +3 -2
  270. package/build-module/spacer/controls.native.js.map +1 -1
  271. package/build-module/spacer/edit.js +2 -2
  272. package/build-module/spacer/edit.js.map +1 -1
  273. package/build-module/spacer/edit.native.js +6 -2
  274. package/build-module/spacer/edit.native.js.map +1 -1
  275. package/build-module/tag-cloud/edit.js +3 -2
  276. package/build-module/tag-cloud/edit.js.map +1 -1
  277. package/build-module/template-part/edit/inner-blocks.js +3 -3
  278. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  279. package/build-module/template-part/index.js +2 -1
  280. package/build-module/template-part/index.js.map +1 -1
  281. package/build-module/term-description/index.js +0 -1
  282. package/build-module/term-description/index.js.map +1 -1
  283. package/build-style/editor-rtl.css +50 -0
  284. package/build-style/editor.css +50 -0
  285. package/build-style/file/style-rtl.css +0 -5
  286. package/build-style/file/style.css +0 -5
  287. package/build-style/form-input/editor-rtl.css +106 -0
  288. package/build-style/form-input/editor.css +106 -0
  289. package/build-style/form-input/style-rtl.css +135 -0
  290. package/build-style/form-input/style.css +135 -0
  291. package/build-style/form-submission-notification/editor-rtl.css +118 -0
  292. package/build-style/form-submission-notification/editor.css +118 -0
  293. package/build-style/form-submit-button/style-rtl.css +91 -0
  294. package/build-style/form-submit-button/style.css +91 -0
  295. package/build-style/image/style-rtl.css +39 -5
  296. package/build-style/image/style.css +39 -5
  297. package/build-style/navigation/style-rtl.css +5 -0
  298. package/build-style/navigation/style.css +5 -0
  299. package/build-style/query/style-rtl.css +0 -10
  300. package/build-style/query/style.css +0 -10
  301. package/build-style/style-rtl.css +92 -10
  302. package/build-style/style.css +92 -10
  303. package/package.json +32 -32
  304. package/src/avatar/block.json +5 -1
  305. package/src/block/block.json +2 -1
  306. package/src/block/edit-title.native.js +16 -13
  307. package/src/calendar/index.php +2 -6
  308. package/src/code/edit.native.js +15 -1
  309. package/src/column/edit.js +3 -8
  310. package/src/column/edit.native.js +3 -8
  311. package/src/columns/edit.native.js +3 -8
  312. package/src/comment-author-avatar/index.php +1 -1
  313. package/src/cover/block.json +0 -3
  314. package/src/cover/controls.native.js +3 -8
  315. package/src/cover/deprecated.js +151 -1
  316. package/src/cover/edit/index.js +15 -5
  317. package/src/cover/edit/inspector-controls.js +22 -33
  318. package/src/cover/save.js +2 -1
  319. package/src/cover/shared.js +1 -1
  320. package/src/editor.scss +2 -0
  321. package/src/file/index.php +2 -1
  322. package/src/file/style.scss +0 -6
  323. package/src/file/view.js +2 -2
  324. package/src/footnotes/block.json +1 -0
  325. package/src/form/block.json +60 -0
  326. package/src/form/edit.js +179 -0
  327. package/src/form/index.js +20 -0
  328. package/src/form/index.php +214 -0
  329. package/src/form/init.js +6 -0
  330. package/src/form/save.js +20 -0
  331. package/src/form/utils.js +39 -0
  332. package/src/form/variations.js +139 -0
  333. package/src/form/view.js +41 -0
  334. package/src/form-input/block.json +73 -0
  335. package/src/form-input/edit.js +151 -0
  336. package/src/form-input/editor.scss +24 -0
  337. package/src/form-input/index.js +20 -0
  338. package/src/form-input/index.php +45 -0
  339. package/src/form-input/init.js +6 -0
  340. package/src/form-input/save.js +83 -0
  341. package/src/form-input/style.scss +61 -0
  342. package/src/form-input/variations.js +82 -0
  343. package/src/form-submission-notification/block.json +19 -0
  344. package/src/form-submission-notification/edit.js +63 -0
  345. package/src/form-submission-notification/editor.scss +45 -0
  346. package/src/form-submission-notification/index.js +26 -0
  347. package/src/form-submission-notification/index.php +48 -0
  348. package/src/form-submission-notification/init.js +6 -0
  349. package/src/form-submission-notification/save.js +28 -0
  350. package/src/form-submission-notification/variations.js +59 -0
  351. package/src/form-submit-button/block.json +14 -0
  352. package/src/form-submit-button/edit.js +33 -0
  353. package/src/form-submit-button/index.js +18 -0
  354. package/src/form-submit-button/init.js +6 -0
  355. package/src/form-submit-button/save.js +14 -0
  356. package/src/form-submit-button/style.scss +3 -0
  357. package/src/freeform/test/__snapshots__/index.native.js.snap +7 -0
  358. package/src/freeform/test/index.native.js +57 -0
  359. package/src/group/block.json +0 -1
  360. package/src/group/edit.js +2 -7
  361. package/src/heading/index.js +4 -2
  362. package/src/html/preview.js +9 -4
  363. package/src/image/image.js +27 -6
  364. package/src/image/index.php +128 -83
  365. package/src/image/style.scss +49 -5
  366. package/src/image/view.js +93 -51
  367. package/src/index.js +10 -0
  368. package/src/latest-posts/edit.js +11 -2
  369. package/src/latest-posts/index.php +17 -8
  370. package/src/list-item/hooks/use-merge.js +20 -23
  371. package/src/lock-unlock.js +1 -1
  372. package/src/missing/edit.native.js +56 -117
  373. package/src/missing/style.native.scss +0 -67
  374. package/src/missing/test/edit-integration.native.js +135 -49
  375. package/src/missing/test/edit.native.js +0 -41
  376. package/src/navigation/block.json +2 -1
  377. package/src/navigation/edit/index.js +0 -1
  378. package/src/navigation/index.php +28 -8
  379. package/src/navigation/style.scss +6 -1
  380. package/src/navigation/view.js +25 -6
  381. package/src/page-list-item/edit.js +2 -0
  382. package/src/paragraph/edit.js +2 -2
  383. package/src/paragraph/index.js +10 -0
  384. package/src/pattern/block.json +2 -1
  385. package/src/pattern/index.php +0 -3
  386. package/src/post-featured-image/dimension-controls.js +3 -3
  387. package/src/post-navigation-link/index.php +2 -1
  388. package/src/preformatted/test/edit.native.js +38 -0
  389. package/src/query/edit/enhanced-pagination-modal.js +37 -21
  390. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +18 -22
  391. package/src/query/index.php +100 -10
  392. package/src/query/style.scss +0 -11
  393. package/src/query/utils.js +29 -8
  394. package/src/query/view.js +11 -2
  395. package/src/query-pagination-next/index.php +1 -1
  396. package/src/query-pagination-previous/index.php +1 -1
  397. package/src/search/edit.js +5 -3
  398. package/src/search/index.php +0 -4
  399. package/src/social-link/edit.native.js +12 -26
  400. package/src/social-link/editor.native.scss +0 -9
  401. package/src/social-link/index.php +2 -2
  402. package/src/spacer/controls.js +9 -12
  403. package/src/spacer/controls.native.js +3 -8
  404. package/src/spacer/edit.js +2 -2
  405. package/src/spacer/edit.native.js +6 -5
  406. package/src/style.scss +1 -0
  407. package/src/tag-cloud/edit.js +3 -7
  408. package/src/template-part/block.json +2 -1
  409. package/src/template-part/edit/inner-blocks.js +3 -3
  410. package/src/template-part/index.php +4 -7
  411. package/src/term-description/block.json +0 -1
  412. package/src/verse/test/edit.native.js +37 -0
@@ -5,7 +5,7 @@ import { createElement, Fragment } from "react";
5
5
  import { Flex, FlexItem, PanelBody, ToggleControl, SelectControl, RangeControl, __experimentalUnitControl as UnitControl, __experimentalUseCustomUnits as useCustomUnits, __experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue, Disabled } from '@wordpress/components';
6
6
  import { withSelect } from '@wordpress/data';
7
7
  import { __ } from '@wordpress/i18n';
8
- import { InspectorControls, useBlockProps, useSetting } from '@wordpress/block-editor';
8
+ import { InspectorControls, useBlockProps, useSettings } from '@wordpress/block-editor';
9
9
  import ServerSideRender from '@wordpress/server-side-render';
10
10
  import { store as coreStore } from '@wordpress/core-data';
11
11
 
@@ -36,8 +36,9 @@ function TagCloudEdit({
36
36
  smallestFontSize,
37
37
  largestFontSize
38
38
  } = attributes;
39
+ const [availableUnits] = useSettings('spacing.units');
39
40
  const units = useCustomUnits({
40
- availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem']
41
+ availableUnits: availableUnits || ['%', 'px', 'em', 'rem']
41
42
  });
42
43
  const getTaxonomyOptions = () => {
43
44
  const selectOption = {
@@ -1 +1 @@
1
- {"version":3,"names":["Flex","FlexItem","PanelBody","ToggleControl","SelectControl","RangeControl","__experimentalUnitControl","UnitControl","__experimentalUseCustomUnits","useCustomUnits","__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","Disabled","withSelect","__","InspectorControls","useBlockProps","useSetting","ServerSideRender","store","coreStore","MIN_TAGS","MAX_TAGS","MIN_FONT_SIZE","MAX_FONT_SIZE","TagCloudEdit","attributes","setAttributes","taxonomies","taxonomy","showTagCounts","numberOfTags","smallestFontSize","largestFontSize","units","availableUnits","getTaxonomyOptions","selectOption","label","value","disabled","taxonomyOptions","filter","tax","show_cloud","map","item","slug","name","onFontSizeChange","fontSizeLabel","newValue","quantity","newUnit","Number","isFinite","updateObj","Object","entries","forEach","attribute","currentValue","currentQuantity","currentUnit","inspectorControls","createElement","title","__nextHasNoMarginBottom","options","onChange","selectedTaxonomy","checked","__next40pxDefaultSize","min","max","required","isBlock","Fragment","skipBlockSupportAttributes","block","select","getTaxonomies","per_page"],"sources":["@wordpress/block-library/src/tag-cloud/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tFlex,\n\tFlexItem,\n\tPanelBody,\n\tToggleControl,\n\tSelectControl,\n\tRangeControl,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\tDisabled,\n} from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseSetting,\n} from '@wordpress/block-editor';\nimport ServerSideRender from '@wordpress/server-side-render';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Minimum number of tags a user can show using this block.\n *\n * @type {number}\n */\nconst MIN_TAGS = 1;\n\n/**\n * Maximum number of tags a user can show using this block.\n *\n * @type {number}\n */\nconst MAX_TAGS = 100;\n\nconst MIN_FONT_SIZE = 0.1;\nconst MAX_FONT_SIZE = 100;\n\nfunction TagCloudEdit( { attributes, setAttributes, taxonomies } ) {\n\tconst {\n\t\ttaxonomy,\n\t\tshowTagCounts,\n\t\tnumberOfTags,\n\t\tsmallestFontSize,\n\t\tlargestFontSize,\n\t} = attributes;\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: useSetting( 'spacing.units' ) || [\n\t\t\t'%',\n\t\t\t'px',\n\t\t\t'em',\n\t\t\t'rem',\n\t\t],\n\t} );\n\n\tconst getTaxonomyOptions = () => {\n\t\tconst selectOption = {\n\t\t\tlabel: __( '- Select -' ),\n\t\t\tvalue: '',\n\t\t\tdisabled: true,\n\t\t};\n\t\tconst taxonomyOptions = ( taxonomies ?? [] )\n\t\t\t.filter( ( tax ) => !! tax.show_cloud )\n\t\t\t.map( ( item ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: item.slug,\n\t\t\t\t\tlabel: item.name,\n\t\t\t\t};\n\t\t\t} );\n\n\t\treturn [ selectOption, ...taxonomyOptions ];\n\t};\n\n\tconst onFontSizeChange = ( fontSizeLabel, newValue ) => {\n\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\tconst [ quantity, newUnit ] =\n\t\t\tparseQuantityAndUnitFromRawValue( newValue );\n\t\tif ( ! Number.isFinite( quantity ) ) {\n\t\t\treturn;\n\t\t}\n\t\tconst updateObj = { [ fontSizeLabel ]: newValue };\n\t\t// We need to keep in sync the `unit` changes to both `smallestFontSize`\n\t\t// and `largestFontSize` attributes.\n\t\tObject.entries( {\n\t\t\tsmallestFontSize,\n\t\t\tlargestFontSize,\n\t\t} ).forEach( ( [ attribute, currentValue ] ) => {\n\t\t\tconst [ currentQuantity, currentUnit ] =\n\t\t\t\tparseQuantityAndUnitFromRawValue( currentValue );\n\t\t\t// Only add an update if the other font size attribute has a different unit.\n\t\t\tif ( attribute !== fontSizeLabel && currentUnit !== newUnit ) {\n\t\t\t\tupdateObj[ attribute ] = `${ currentQuantity }${ newUnit }`;\n\t\t\t}\n\t\t} );\n\t\tsetAttributes( updateObj );\n\t};\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Taxonomy' ) }\n\t\t\t\t\toptions={ getTaxonomyOptions() }\n\t\t\t\t\tvalue={ taxonomy }\n\t\t\t\t\tonChange={ ( selectedTaxonomy ) =>\n\t\t\t\t\t\tsetAttributes( { taxonomy: selectedTaxonomy } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Show post counts' ) }\n\t\t\t\t\tchecked={ showTagCounts }\n\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\tsetAttributes( { showTagCounts: ! showTagCounts } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<RangeControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Number of tags' ) }\n\t\t\t\t\tvalue={ numberOfTags }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { numberOfTags: value } )\n\t\t\t\t\t}\n\t\t\t\t\tmin={ MIN_TAGS }\n\t\t\t\t\tmax={ MAX_TAGS }\n\t\t\t\t\trequired\n\t\t\t\t/>\n\t\t\t\t<Flex>\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Smallest size' ) }\n\t\t\t\t\t\t\tvalue={ smallestFontSize }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tonFontSizeChange( 'smallestFontSize', value );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tmin={ MIN_FONT_SIZE }\n\t\t\t\t\t\t\tmax={ MAX_FONT_SIZE }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Largest size' ) }\n\t\t\t\t\t\t\tvalue={ largestFontSize }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tonFontSizeChange( 'largestFontSize', value );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tmin={ MIN_FONT_SIZE }\n\t\t\t\t\t\t\tmax={ MAX_FONT_SIZE }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ inspectorControls }\n\t\t\t<div { ...useBlockProps() }>\n\t\t\t\t<Disabled>\n\t\t\t\t\t<ServerSideRender\n\t\t\t\t\t\tskipBlockSupportAttributes\n\t\t\t\t\t\tblock=\"core/tag-cloud\"\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t/>\n\t\t\t\t</Disabled>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\treturn {\n\t\ttaxonomies: select( coreStore ).getTaxonomies( { per_page: -1 } ),\n\t};\n} )( TagCloudEdit );\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,IAAI,EACJC,QAAQ,EACRC,SAAS,EACTC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,yBAAyB,IAAIC,WAAW,EACxCC,4BAA4B,IAAIC,cAAc,EAC9CC,8CAA8C,IAAIC,gCAAgC,EAClFC,QAAQ,QACF,uBAAuB;AAC9B,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,iBAAiB,EACjBC,aAAa,EACbC,UAAU,QACJ,yBAAyB;AAChC,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AA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AEL;AAEA,eAAeb,UAAU,CAAImE,MAAM,IAAM;EACxC,OAAO;IACNpD,UAAU,EAAEoD,MAAM,CAAE5D,SAAU,CAAC,CAAC6D,aAAa,CAAE;MAAEC,QAAQ,EAAE,CAAC;IAAE,CAAE;EACjE,CAAC;AACF,CAAE,CAAC,CAAEzD,YAAa,CAAC"}
1
+ {"version":3,"names":["Flex","FlexItem","PanelBody","ToggleControl","SelectControl","RangeControl","__experimentalUnitControl","UnitControl","__experimentalUseCustomUnits","useCustomUnits","__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","Disabled","withSelect","__","InspectorControls","useBlockProps","useSettings","ServerSideRender","store","coreStore","MIN_TAGS","MAX_TAGS","MIN_FONT_SIZE","MAX_FONT_SIZE","TagCloudEdit","attributes","setAttributes","taxonomies","taxonomy","showTagCounts","numberOfTags","smallestFontSize","largestFontSize","availableUnits","units","getTaxonomyOptions","selectOption","label","value","disabled","taxonomyOptions","filter","tax","show_cloud","map","item","slug","name","onFontSizeChange","fontSizeLabel","newValue","quantity","newUnit","Number","isFinite","updateObj","Object","entries","forEach","attribute","currentValue","currentQuantity","currentUnit","inspectorControls","createElement","title","__nextHasNoMarginBottom","options","onChange","selectedTaxonomy","checked","__next40pxDefaultSize","min","max","required","isBlock","Fragment","skipBlockSupportAttributes","block","select","getTaxonomies","per_page"],"sources":["@wordpress/block-library/src/tag-cloud/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tFlex,\n\tFlexItem,\n\tPanelBody,\n\tToggleControl,\n\tSelectControl,\n\tRangeControl,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\tDisabled,\n} from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport ServerSideRender from '@wordpress/server-side-render';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Minimum number of tags a user can show using this block.\n *\n * @type {number}\n */\nconst MIN_TAGS = 1;\n\n/**\n * Maximum number of tags a user can show using this block.\n *\n * @type {number}\n */\nconst MAX_TAGS = 100;\n\nconst MIN_FONT_SIZE = 0.1;\nconst MAX_FONT_SIZE = 100;\n\nfunction TagCloudEdit( { attributes, setAttributes, taxonomies } ) {\n\tconst {\n\t\ttaxonomy,\n\t\tshowTagCounts,\n\t\tnumberOfTags,\n\t\tsmallestFontSize,\n\t\tlargestFontSize,\n\t} = attributes;\n\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [ '%', 'px', 'em', 'rem' ],\n\t} );\n\n\tconst getTaxonomyOptions = () => {\n\t\tconst selectOption = {\n\t\t\tlabel: __( '- Select -' ),\n\t\t\tvalue: '',\n\t\t\tdisabled: true,\n\t\t};\n\t\tconst taxonomyOptions = ( taxonomies ?? [] )\n\t\t\t.filter( ( tax ) => !! tax.show_cloud )\n\t\t\t.map( ( item ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: item.slug,\n\t\t\t\t\tlabel: item.name,\n\t\t\t\t};\n\t\t\t} );\n\n\t\treturn [ selectOption, ...taxonomyOptions ];\n\t};\n\n\tconst onFontSizeChange = ( fontSizeLabel, newValue ) => {\n\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\tconst [ quantity, newUnit ] =\n\t\t\tparseQuantityAndUnitFromRawValue( newValue );\n\t\tif ( ! Number.isFinite( quantity ) ) {\n\t\t\treturn;\n\t\t}\n\t\tconst updateObj = { [ fontSizeLabel ]: newValue };\n\t\t// We need to keep in sync the `unit` changes to both `smallestFontSize`\n\t\t// and `largestFontSize` attributes.\n\t\tObject.entries( {\n\t\t\tsmallestFontSize,\n\t\t\tlargestFontSize,\n\t\t} ).forEach( ( [ attribute, currentValue ] ) => {\n\t\t\tconst [ currentQuantity, currentUnit ] =\n\t\t\t\tparseQuantityAndUnitFromRawValue( currentValue );\n\t\t\t// Only add an update if the other font size attribute has a different unit.\n\t\t\tif ( attribute !== fontSizeLabel && currentUnit !== newUnit ) {\n\t\t\t\tupdateObj[ attribute ] = `${ currentQuantity }${ newUnit }`;\n\t\t\t}\n\t\t} );\n\t\tsetAttributes( updateObj );\n\t};\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Taxonomy' ) }\n\t\t\t\t\toptions={ getTaxonomyOptions() }\n\t\t\t\t\tvalue={ taxonomy }\n\t\t\t\t\tonChange={ ( selectedTaxonomy ) =>\n\t\t\t\t\t\tsetAttributes( { taxonomy: selectedTaxonomy } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Show post counts' ) }\n\t\t\t\t\tchecked={ showTagCounts }\n\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\tsetAttributes( { showTagCounts: ! showTagCounts } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<RangeControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Number of tags' ) }\n\t\t\t\t\tvalue={ numberOfTags }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { numberOfTags: value } )\n\t\t\t\t\t}\n\t\t\t\t\tmin={ MIN_TAGS }\n\t\t\t\t\tmax={ MAX_TAGS }\n\t\t\t\t\trequired\n\t\t\t\t/>\n\t\t\t\t<Flex>\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Smallest size' ) }\n\t\t\t\t\t\t\tvalue={ smallestFontSize }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tonFontSizeChange( 'smallestFontSize', value );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tmin={ MIN_FONT_SIZE }\n\t\t\t\t\t\t\tmax={ MAX_FONT_SIZE }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Largest size' ) }\n\t\t\t\t\t\t\tvalue={ largestFontSize }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tonFontSizeChange( 'largestFontSize', value );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tmin={ MIN_FONT_SIZE }\n\t\t\t\t\t\t\tmax={ MAX_FONT_SIZE }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ inspectorControls }\n\t\t\t<div { ...useBlockProps() }>\n\t\t\t\t<Disabled>\n\t\t\t\t\t<ServerSideRender\n\t\t\t\t\t\tskipBlockSupportAttributes\n\t\t\t\t\t\tblock=\"core/tag-cloud\"\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t/>\n\t\t\t\t</Disabled>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\treturn {\n\t\ttaxonomies: select( coreStore ).getTaxonomies( { per_page: -1 } ),\n\t};\n} )( TagCloudEdit );\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,IAAI,EACJC,QAAQ,EACRC,SAAS,EACTC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,yBAAyB,IAAIC,WAAW,EAC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GA,KAAO;IACfsC,GAAG,EAAGlD,aAAe;IACrBmD,GAAG,EAAGlD;EAAe,CACrB,CACQ,CACL,CACI,CACO,CACnB;EAED,OACCyC,aAAA,CAAAY,QAAA,QACGb,iBAAiB,EACnBC,aAAA;IAAA,GAAUjD,aAAa,CAAC;EAAC,GACxBiD,aAAA,CAACrD,QAAQ,QACRqD,aAAA,CAAC/C,gBAAgB;IAChB4D,0BAA0B;IAC1BC,KAAK,EAAC,gBAAgB;IACtBrD,UAAU,EAAGA;EAAY,CACzB,CACQ,CACN,CACJ,CAAC;AAEL;AAEA,eAAeb,UAAU,CAAImE,MAAM,IAAM;EACxC,OAAO;IACNpD,UAAU,EAAEoD,MAAM,CAAE5D,SAAU,CAAC,CAAC6D,aAAa,CAAE;MAAEC,QAAQ,EAAE,CAAC;IAAE,CAAE;EACjE,CAAC;AACF,CAAE,CAAC,CAAEzD,YAAa,CAAC"}
@@ -3,7 +3,7 @@ import { createElement } from "react";
3
3
  * WordPress dependencies
4
4
  */
5
5
  import { useEntityBlockEditor } from '@wordpress/core-data';
6
- import { InnerBlocks, useInnerBlocksProps, useSetting, store as blockEditorStore } from '@wordpress/block-editor';
6
+ import { InnerBlocks, useInnerBlocksProps, useSettings, store as blockEditorStore } from '@wordpress/block-editor';
7
7
  import { useSelect } from '@wordpress/data';
8
8
  export default function TemplatePartInnerBlocks({
9
9
  postId: id,
@@ -18,8 +18,8 @@ export default function TemplatePartInnerBlocks({
18
18
  } = select(blockEditorStore);
19
19
  return getSettings()?.supportsLayout;
20
20
  }, []);
21
- const defaultLayout = useSetting('layout') || {};
22
- const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
21
+ const [defaultLayout] = useSettings('layout');
22
+ const usedLayout = layout?.inherit ? defaultLayout || {} : layout;
23
23
  const [blocks, onInput, onChange] = useEntityBlockEditor('postType', 'wp_template_part', {
24
24
  id
25
25
  });
@@ -1 +1 @@
1
- {"version":3,"names":["useEntityBlockEditor","InnerBlocks","useInnerBlocksProps","useSetting","store","blockEditorStore","useSelect","TemplatePartInnerBlocks","postId","id","hasInnerBlocks","layout","tagName","TagName","blockProps","themeSupportsLayout","select","getSettings","supportsLayout","defaultLayout","usedLayout","inherit","blocks","onInput","onChange","innerBlocksProps","value","renderAppender","undefined","ButtonBlockAppender","createElement"],"sources":["@wordpress/block-library/src/template-part/edit/inner-blocks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tInnerBlocks,\n\tuseInnerBlocksProps,\n\tuseSetting,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\nexport default function TemplatePartInnerBlocks( {\n\tpostId: id,\n\thasInnerBlocks,\n\tlayout,\n\ttagName: TagName,\n\tblockProps,\n} ) {\n\tconst themeSupportsLayout = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings()?.supportsLayout;\n\t}, [] );\n\tconst defaultLayout = useSetting( 'layout' ) || {};\n\tconst usedLayout = !! layout && layout.inherit ? defaultLayout : layout;\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\t'wp_template_part',\n\t\t{ id }\n\t);\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tvalue: blocks,\n\t\tonInput,\n\t\tonChange,\n\t\trenderAppender: hasInnerBlocks\n\t\t\t? undefined\n\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t\tlayout: themeSupportsLayout ? usedLayout : undefined,\n\t} );\n\n\treturn <TagName { ...innerBlocksProps } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,oBAAoB,QAAQ,sBAAsB;AAC3D,SACCC,WAAW,EACXC,mBAAmB,EACnBC,UAAU,EACVC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,eAAe,SAASC,uBAAuBA,CAAE;EAChDC,MAAM,EAAEC,EAAE;EACVC,cAAc;EACdC,MAAM;EACNC,OAAO,EAAEC,OAAO;EAChBC;AACD,CAAC,EAAG;EACH,MAAMC,mBAAmB,GAAGT,SAAS,CAAIU,MAAM,IAAM;IACpD,MAAM;MAAEC;IAAY,CAAC,GAAGD,MAAM,CAAEX,gBAAiB,CAAC;IAClD,OAAOY,WAAW,CAAC,CAAC,EAAEC,cAAc;EACrC,CAAC,EAAE,EAAG,CAAC;EACP,MAAMC,aAAa,GAAGhB,UAAU,CAAE,QAAS,CAAC,IAAI,CAAC,CAAC;EAClD,MAAMiB,UAAU,GAAG,CAAC,CAAET,MAAM,IAAIA,MAAM,CAACU,OAAO,GAAGF,aAAa,GAAGR,MAAM;EAEvE,MAAM,CAAEW,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAE,GAAGxB,oBAAoB,CACzD,UAAU,EACV,kBAAkB,EAClB;IAAES;EAAG,CACN,CAAC;EAED,MAAMgB,gBAAgB,GAAGvB,mBAAmB,CAAEY,UAAU,EAAE;IACzDY,KAAK,EAAEJ,MAAM;IACbC,OAAO;IACPC,QAAQ;IACRG,cAAc,EAAEjB,cAAc,GAC3BkB,SAAS,GACT3B,WAAW,CAAC4B,mBAAmB;IAClClB,MAAM,EAAEI,mBAAmB,GAAGK,UAAU,GAAGQ;EAC5C,CAAE,CAAC;EAEH,OAAOE,aAAA,CAACjB,OAAO;IAAA,GAAMY;EAAgB,CAAI,CAAC;AAC3C"}
1
+ {"version":3,"names":["useEntityBlockEditor","InnerBlocks","useInnerBlocksProps","useSettings","store","blockEditorStore","useSelect","TemplatePartInnerBlocks","postId","id","hasInnerBlocks","layout","tagName","TagName","blockProps","themeSupportsLayout","select","getSettings","supportsLayout","defaultLayout","usedLayout","inherit","blocks","onInput","onChange","innerBlocksProps","value","renderAppender","undefined","ButtonBlockAppender","createElement"],"sources":["@wordpress/block-library/src/template-part/edit/inner-blocks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tInnerBlocks,\n\tuseInnerBlocksProps,\n\tuseSettings,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\nexport default function TemplatePartInnerBlocks( {\n\tpostId: id,\n\thasInnerBlocks,\n\tlayout,\n\ttagName: TagName,\n\tblockProps,\n} ) {\n\tconst themeSupportsLayout = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings()?.supportsLayout;\n\t}, [] );\n\tconst [ defaultLayout ] = useSettings( 'layout' );\n\tconst usedLayout = layout?.inherit ? defaultLayout || {} : layout;\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\t'wp_template_part',\n\t\t{ id }\n\t);\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tvalue: blocks,\n\t\tonInput,\n\t\tonChange,\n\t\trenderAppender: hasInnerBlocks\n\t\t\t? undefined\n\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t\tlayout: themeSupportsLayout ? usedLayout : undefined,\n\t} );\n\n\treturn <TagName { ...innerBlocksProps } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,oBAAoB,QAAQ,sBAAsB;AAC3D,SACCC,WAAW,EACXC,mBAAmB,EACnBC,WAAW,EACXC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,SAAS,QAAQ,iBAAiB;AAE3C,eAAe,SAASC,uBAAuBA,CAAE;EAChDC,MAAM,EAAEC,EAAE;EACVC,cAAc;EACdC,MAAM;EACNC,OAAO,EAAEC,OAAO;EAChBC;AACD,CAAC,EAAG;EACH,MAAMC,mBAAmB,GAAGT,SAAS,CAAIU,MAAM,IAAM;IACpD,MAAM;MAAEC;IAAY,CAAC,GAAGD,MAAM,CAAEX,gBAAiB,CAAC;IAClD,OAAOY,WAAW,CAAC,CAAC,EAAEC,cAAc;EACrC,CAAC,EAAE,EAAG,CAAC;EACP,MAAM,CAAEC,aAAa,CAAE,GAAGhB,WAAW,CAAE,QAAS,CAAC;EACjD,MAAMiB,UAAU,GAAGT,MAAM,EAAEU,OAAO,GAAGF,aAAa,IAAI,CAAC,CAAC,GAAGR,MAAM;EAEjE,MAAM,CAAEW,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAE,GAAGxB,oBAAoB,CACzD,UAAU,EACV,kBAAkB,EAClB;IAAES;EAAG,CACN,CAAC;EAED,MAAMgB,gBAAgB,GAAGvB,mBAAmB,CAAEY,UAAU,EAAE;IACzDY,KAAK,EAAEJ,MAAM;IACbC,OAAO;IACPC,QAAQ;IACRG,cAAc,EAAEjB,cAAc,GAC3BkB,SAAS,GACT3B,WAAW,CAAC4B,mBAAmB;IAClClB,MAAM,EAAEI,mBAAmB,GAAGK,UAAU,GAAGQ;EAC5C,CAAE,CAAC;EAEH,OAAOE,aAAA,CAACjB,OAAO;IAAA,GAAMY;EAAgB,CAAI,CAAC;AAC3C"}
@@ -41,7 +41,8 @@ const metadata = {
41
41
  supports: {
42
42
  align: true,
43
43
  html: false,
44
- reusable: false
44
+ reusable: false,
45
+ renaming: false
45
46
  },
46
47
  editorStyle: "wp-block-template-part-editor"
47
48
  };
@@ -1 +1 @@
1
- {"version":3,"names":["capitalCase","store","coreDataStore","select","symbolFilled","addFilter","decodeEntities","initBlock","metadata","$schema","apiVersion","name","title","category","description","textdomain","attributes","slug","type","theme","tagName","area","supports","align","html","reusable","editorStyle","edit","enhanceTemplatePartVariations","settings","icon","__experimentalLabel","entity","getEntityRecord","rendered","init","DISALLOWED_PARENTS","canInsert","blockType","rootClientId","getBlock","getBlockParentsByBlockName","disallowedParentType","hasDisallowedParent","length"],"sources":["@wordpress/block-library/src/template-part/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { capitalCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { select } from '@wordpress/data';\nimport { symbolFilled } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport { enhanceTemplatePartVariations } from './variations';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon: symbolFilled,\n\t__experimentalLabel: ( { slug, theme } ) => {\n\t\t// Attempt to find entity title if block is a template part.\n\t\t// Require slug to request, otherwise entity is uncreated and will throw 404.\n\t\tif ( ! slug ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst entity = select( coreDataStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\ttheme + '//' + slug\n\t\t);\n\t\tif ( ! entity ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn (\n\t\t\tdecodeEntities( entity.title?.rendered ) ||\n\t\t\tcapitalCase( entity.slug )\n\t\t);\n\t},\n\tedit,\n};\n\nexport const init = () => {\n\taddFilter(\n\t\t'blocks.registerBlockType',\n\t\t'core/template-part',\n\t\tenhanceTemplatePartVariations\n\t);\n\n\t// Prevent adding template parts inside post templates.\n\tconst DISALLOWED_PARENTS = [ 'core/post-template', 'core/post-content' ];\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromPostTemplates',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlock, getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif ( blockType.name !== 'core/template-part' ) {\n\t\t\t\treturn canInsert;\n\t\t\t}\n\n\t\t\tfor ( const disallowedParentType of DISALLOWED_PARENTS ) {\n\t\t\t\tconst hasDisallowedParent =\n\t\t\t\t\tgetBlock( rootClientId )?.name === disallowedParentType ||\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\tdisallowedParentType\n\t\t\t\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,IAAI,GAAGF,IAChB,CAAC;IACD,IAAK,CAAEe,MAAM,EAAG;MACf;IACD;IAEA,OACC1B,cAAc,CAAE0B,MAAM,CAACpB,KAAK,EAAEsB,QAAS,CAAC,IACxClC,WAAW,CAAEgC,MAAM,CAACf,IAAK,CAAC;EAE5B,CAAC;EACDU;AACD,CAAC;AAED,OAAO,MAAMQ,IAAI,GAAGA,CAAA,KAAM;EACzB9B,SAAS,CACR,0BAA0B,EAC1B,oBAAoB,EACpBuB,6BACD,CAAC;;EAED;EACA,MAAMQ,kBAAkB,GAAG,CAAE,oBAAoB,EAAE,mBAAmB,CAAE;EACxE/B,SAAS,CACR,0CAA0C,EAC1C,sCAAsC,EACtC,CACCgC,SAAS,EACTC,SAAS,EACTC,YAAY,EACZ;IAAEC,QAAQ;IAAEC;EAA2B,CAAC,KACpC;IACJ,IAAKH,SAAS,CAAC3B,IAAI,KAAK,oBAAoB,EAAG;MAC9C,OAAO0B,SAAS;IACjB;IAEA,KAAM,MAAMK,oBAAoB,IAAIN,kBAAkB,EAAG;MACxD,MAAMO,mBAAmB,GACxBH,QAAQ,CAAED,YAAa,CAAC,EAAE5B,IAAI,KAAK+B,oBAAoB,IACvDD,0BAA0B,CACzBF,YAAY,EACZG,oBACD,CAAC,CAACE,MAAM;MACT,IAAKD,mBAAmB,EAAG;QAC1B,OAAO,KAAK;MACb;IACD;IACA,OAAO,IAAI;EACZ,CACD,CAAC;EAED,OAAOpC,SAAS,CAAE;IAAEI,IAAI;IAAEH,QAAQ;IAAEqB;EAAS,CAAE,CAAC;AACjD,CAAC"}
1
+ {"version":3,"names":["capitalCase","store","coreDataStore","select","symbolFilled","addFilter","decodeEntities","initBlock","metadata","$schema","apiVersion","name","title","category","description","textdomain","attributes","slug","type","theme","tagName","area","supports","align","html","reusable","renaming","editorStyle","edit","enhanceTemplatePartVariations","settings","icon","__experimentalLabel","entity","getEntityRecord","rendered","init","DISALLOWED_PARENTS","canInsert","blockType","rootClientId","getBlock","getBlockParentsByBlockName","disallowedParentType","hasDisallowedParent","length"],"sources":["@wordpress/block-library/src/template-part/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { capitalCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { select } from '@wordpress/data';\nimport { symbolFilled } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport { enhanceTemplatePartVariations } from './variations';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon: symbolFilled,\n\t__experimentalLabel: ( { slug, theme } ) => {\n\t\t// Attempt to find entity title if block is a template part.\n\t\t// Require slug to request, otherwise entity is uncreated and will throw 404.\n\t\tif ( ! slug ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst entity = select( coreDataStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\ttheme + '//' + slug\n\t\t);\n\t\tif ( ! entity ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn (\n\t\t\tdecodeEntities( entity.title?.rendered ) ||\n\t\t\tcapitalCase( entity.slug )\n\t\t);\n\t},\n\tedit,\n};\n\nexport const init = () => {\n\taddFilter(\n\t\t'blocks.registerBlockType',\n\t\t'core/template-part',\n\t\tenhanceTemplatePartVariations\n\t);\n\n\t// Prevent adding template parts inside post templates.\n\tconst DISALLOWED_PARENTS = [ 'core/post-template', 'core/post-content' ];\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromPostTemplates',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlock, getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif ( blockType.name !== 'core/template-part' ) {\n\t\t\t\treturn canInsert;\n\t\t\t}\n\n\t\t\tfor ( const disallowedParentType of DISALLOWED_PARENTS ) {\n\t\t\t\tconst hasDisallowedParent =\n\t\t\t\t\tgetBlock( rootClientId )?.name === disallowedParentType ||\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\tdisallowedParentType\n\t\t\t\t\t).length;\n\t\t\t\tif ( hasDisallowedParent ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t);\n\n\treturn initBlock( { name, metadata, settings } );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,aAAa;;AAEzC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,sBAAsB;AAC7D,SAASC,MAAM,QAAQ,iBAAiB;AACxC,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,IAAA;MAAAC,IAAA;IAAA;IAAAC,KAAA;MAAAD,IAAA;IAAA;IAAAE,OAAA;MAAAF,IAAA;IAAA;IAAAG,IAAA;MAAAH,IAAA;IAAA;EAAA;EAAAI,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,QAAA;IAAAC,QAAA;EAAA;EAAAC,WAAA;AAAA;AAE5C,OAAOC,IAAI,MAAM,QAAQ;AACzB,SAASC,6BAA6B,QAAQ,cAAc;AAE5D,MAAM;EAAElB;AAAK,CAAC,GAAGH,QAAQ;AACzB,SAASA,QAAQ,EAAEG,IAAI;AAEvB,OAAO,MAAMmB,QAAQ,GAAG;EACvBC,IAAI,EAAE3B,YAAY;EAClB4B,mBAAmB,EAA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10
  const metadata = {
11
11
  $schema: "https://schemas.wp.org/trunk/block.json",
12
12
  apiVersion: 3,
13
- __experimental: "fse",
14
13
  name: "core/term-description",
15
14
  title: "Term Description",
16
15
  category: "theme",
@@ -1 +1 @@
1
- {"version":3,"names":["termDescription","icon","initBlock","metadata","$schema","apiVersion","__experimental","name","title","category","description","textdomain","attributes","textAlign","type","supports","align","html","color","link","__experimentalDefaultControls","background","text","spacing","padding","margin","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","edit","settings","init"],"sources":["@wordpress/block-library/src/term-description/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { termDescription 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';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,IAAIC,IAAI,QAAQ,kBAAkB;;AAE1D;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,cAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;EAAA;EAAAC,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,KAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,OAAA;MAAAC,OAAA;MAAAC,MAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAd,6BAAA;QAAAO,QAAA;MAAA;IAAA;EAAA;AAAA;AAE5C,OAAOQ,IAAI,MAAM,QAAQ;AAEzB,MAAM;EAAE5B;AAAK,CAAC,GAAGJ,QAAQ;AACzB,SAASA,QAAQ,EAAEI,IAAI;AAEvB,OAAO,MAAM6B,QAAQ,GAAG;EACvBnC,IAAI;EACJkC;AACD,CAAC;AAED,OAAO,MAAME,IAAI,GAAGA,CAAA,KAAMnC,SAAS,CAAE;EAAEK,IAAI;EAAEJ,QAAQ;EAAEiC;AAAS,CAAE,CAAC"}
1
+ {"version":3,"names":["termDescription","icon","initBlock","metadata","$schema","apiVersion","name","title","category","description","textdomain","attributes","textAlign","type","supports","align","html","color","link","__experimentalDefaultControls","background","text","spacing","padding","margin","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","edit","settings","init"],"sources":["@wordpress/block-library/src/term-description/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { termDescription 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';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,IAAIC,IAAI,QAAQ,kBAAkB;;AAE1D;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;EAAA;EAAAC,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,KAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,OAAA;MAAAC,OAAA;MAAAC,MAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAd,6BAAA;QAAAO,QAAA;MAAA;IAAA;EAAA;AAAA;AAE5C,OAAOQ,IAAI,MAAM,QAAQ;AAEzB,MAAM;EAAE5B;AAAK,CAAC,GAAGH,QAAQ;AACzB,SAASA,QAAQ,EAAEG,IAAI;AAEvB,OAAO,MAAM6B,QAAQ,GAAG;EACvBlC,IAAI;EACJiC;AACD,CAAC;AAED,OAAO,MAAME,IAAI,GAAGA,CAAA,KAAMlC,SAAS,CAAE;EAAEI,IAAI;EAAEH,QAAQ;EAAEgC;AAAS,CAAE,CAAC"}
@@ -652,6 +652,56 @@ html :where(.wp-block-column) {
652
652
  margin-right: 0.75em;
653
653
  }
654
654
 
655
+ .wp-block-form-input .is-input-hidden {
656
+ font-size: 0.85em;
657
+ opacity: 0.3;
658
+ border: 1px dashed;
659
+ padding: 0.5em;
660
+ box-sizing: border-box;
661
+ background: repeating-linear-gradient(-45deg, transparent, transparent 5px, currentColor 5px, currentColor 6px);
662
+ }
663
+ .wp-block-form-input .is-input-hidden input[type=text] {
664
+ background: transparent;
665
+ }
666
+ .wp-block-form-input.is-selected .is-input-hidden {
667
+ opacity: 1;
668
+ background: none;
669
+ }
670
+ .wp-block-form-input.is-selected .is-input-hidden input[type=text] {
671
+ background: unset;
672
+ }
673
+
674
+ .wp-block-form-submission-notification > * {
675
+ opacity: 0.25;
676
+ border: 1px dashed;
677
+ box-sizing: border-box;
678
+ background: repeating-linear-gradient(-45deg, transparent, transparent 5px, currentColor 5px, currentColor 6px);
679
+ }
680
+ .wp-block-form-submission-notification.is-selected > *, .wp-block-form-submission-notification:has(.is-selected) > * {
681
+ opacity: 1;
682
+ background: none;
683
+ }
684
+ .wp-block-form-submission-notification.is-selected::after, .wp-block-form-submission-notification:has(.is-selected)::after {
685
+ display: none !important;
686
+ }
687
+ .wp-block-form-submission-notification::after {
688
+ display: flex;
689
+ position: absolute;
690
+ width: 100%;
691
+ height: 100%;
692
+ top: 0;
693
+ right: 0;
694
+ justify-content: center;
695
+ align-items: center;
696
+ font-size: 1.1em;
697
+ }
698
+ .wp-block-form-submission-notification.form-notification-type-success::after {
699
+ content: attr(data-message-success);
700
+ }
701
+ .wp-block-form-submission-notification.form-notification-type-error::after {
702
+ content: attr(data-message-error);
703
+ }
704
+
655
705
  .wp-block-freeform.block-library-rich-text__tinymce {
656
706
  height: auto;
657
707
  /* Allow height of embed iframes to be calculated properly */
@@ -656,6 +656,56 @@ html :where(.wp-block-column) {
656
656
  margin-left: 0.75em;
657
657
  }
658
658
 
659
+ .wp-block-form-input .is-input-hidden {
660
+ font-size: 0.85em;
661
+ opacity: 0.3;
662
+ border: 1px dashed;
663
+ padding: 0.5em;
664
+ box-sizing: border-box;
665
+ background: repeating-linear-gradient(45deg, transparent, transparent 5px, currentColor 5px, currentColor 6px);
666
+ }
667
+ .wp-block-form-input .is-input-hidden input[type=text] {
668
+ background: transparent;
669
+ }
670
+ .wp-block-form-input.is-selected .is-input-hidden {
671
+ opacity: 1;
672
+ background: none;
673
+ }
674
+ .wp-block-form-input.is-selected .is-input-hidden input[type=text] {
675
+ background: unset;
676
+ }
677
+
678
+ .wp-block-form-submission-notification > * {
679
+ opacity: 0.25;
680
+ border: 1px dashed;
681
+ box-sizing: border-box;
682
+ background: repeating-linear-gradient(45deg, transparent, transparent 5px, currentColor 5px, currentColor 6px);
683
+ }
684
+ .wp-block-form-submission-notification.is-selected > *, .wp-block-form-submission-notification:has(.is-selected) > * {
685
+ opacity: 1;
686
+ background: none;
687
+ }
688
+ .wp-block-form-submission-notification.is-selected::after, .wp-block-form-submission-notification:has(.is-selected)::after {
689
+ display: none !important;
690
+ }
691
+ .wp-block-form-submission-notification::after {
692
+ display: flex;
693
+ position: absolute;
694
+ width: 100%;
695
+ height: 100%;
696
+ top: 0;
697
+ left: 0;
698
+ justify-content: center;
699
+ align-items: center;
700
+ font-size: 1.1em;
701
+ }
702
+ .wp-block-form-submission-notification.form-notification-type-success::after {
703
+ content: attr(data-message-success);
704
+ }
705
+ .wp-block-form-submission-notification.form-notification-type-error::after {
706
+ content: attr(data-message-error);
707
+ }
708
+
659
709
  .wp-block-freeform.block-library-rich-text__tinymce {
660
710
  height: auto;
661
711
  /* Allow height of embed iframes to be calculated properly */
@@ -110,11 +110,6 @@
110
110
  margin-bottom: 1em;
111
111
  }
112
112
 
113
- @media (max-width: 768px) {
114
- .wp-block-file__embed {
115
- display: none;
116
- }
117
- }
118
113
  :where(.wp-block-file__button) {
119
114
  border-radius: 2em;
120
115
  padding: 0.5em 1em;
@@ -111,11 +111,6 @@
111
111
  margin-bottom: 1em;
112
112
  }
113
113
 
114
- @media (max-width: 768px) {
115
- .wp-block-file__embed {
116
- display: none;
117
- }
118
- }
119
114
  :where(.wp-block-file__button) {
120
115
  border-radius: 2em;
121
116
  padding: 0.5em 1em;
@@ -0,0 +1,106 @@
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-form-input .is-input-hidden {
90
+ font-size: 0.85em;
91
+ opacity: 0.3;
92
+ border: 1px dashed;
93
+ padding: 0.5em;
94
+ box-sizing: border-box;
95
+ background: repeating-linear-gradient(-45deg, transparent, transparent 5px, currentColor 5px, currentColor 6px);
96
+ }
97
+ .wp-block-form-input .is-input-hidden input[type=text] {
98
+ background: transparent;
99
+ }
100
+ .wp-block-form-input.is-selected .is-input-hidden {
101
+ opacity: 1;
102
+ background: none;
103
+ }
104
+ .wp-block-form-input.is-selected .is-input-hidden input[type=text] {
105
+ background: unset;
106
+ }
@@ -0,0 +1,106 @@
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-form-input .is-input-hidden {
90
+ font-size: 0.85em;
91
+ opacity: 0.3;
92
+ border: 1px dashed;
93
+ padding: 0.5em;
94
+ box-sizing: border-box;
95
+ background: repeating-linear-gradient(45deg, transparent, transparent 5px, currentColor 5px, currentColor 6px);
96
+ }
97
+ .wp-block-form-input .is-input-hidden input[type=text] {
98
+ background: transparent;
99
+ }
100
+ .wp-block-form-input.is-selected .is-input-hidden {
101
+ opacity: 1;
102
+ background: none;
103
+ }
104
+ .wp-block-form-input.is-selected .is-input-hidden input[type=text] {
105
+ background: unset;
106
+ }
@@ -0,0 +1,135 @@
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-form-input__label {
90
+ width: 100%;
91
+ display: flex;
92
+ flex-direction: column;
93
+ gap: 0.25em;
94
+ margin-bottom: 0.5em;
95
+ /*
96
+ Small tweak to left-align the checkbox.
97
+ Even though `:has` is not currently supported in Firefox, this is a small tweak
98
+ and does not affect the functionality of the block or the user's experience.
99
+ There will be a minor inconsistency between browsers. However, it's more important to provide
100
+ a better experience for 80+% of users, until Firefox catches up and supports `:has`.
101
+ */
102
+ }
103
+ .wp-block-form-input__label.is-label-inline {
104
+ flex-direction: row;
105
+ gap: 0.5em;
106
+ align-items: center;
107
+ }
108
+ .wp-block-form-input__label.is-label-inline .wp-block-form-input__label-content {
109
+ margin-bottom: 0.5em;
110
+ }
111
+ .wp-block-form-input__label:has(input[type=checkbox]) {
112
+ width: -moz-fit-content;
113
+ width: fit-content;
114
+ flex-direction: row-reverse;
115
+ }
116
+
117
+ .wp-block-form-input__label-content {
118
+ width: -moz-fit-content;
119
+ width: fit-content;
120
+ }
121
+
122
+ .wp-block-form-input__input {
123
+ padding: 0 0.5em;
124
+ font-size: 1em;
125
+ margin-bottom: 0.5em;
126
+ }
127
+ .wp-block-form-input__input[type=text], .wp-block-form-input__input[type=password], .wp-block-form-input__input[type=date], .wp-block-form-input__input[type=datetime], .wp-block-form-input__input[type=datetime-local], .wp-block-form-input__input[type=email], .wp-block-form-input__input[type=month], .wp-block-form-input__input[type=number], .wp-block-form-input__input[type=search], .wp-block-form-input__input[type=tel], .wp-block-form-input__input[type=time], .wp-block-form-input__input[type=url], .wp-block-form-input__input[type=week] {
128
+ min-height: 2em;
129
+ line-height: 2;
130
+ border: 1px solid;
131
+ }
132
+
133
+ textarea.wp-block-form-input__input {
134
+ min-height: 10em;
135
+ }