@wordpress/block-library 8.8.0 → 8.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (437) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/comment-author-name/edit.js +1 -1
  3. package/build/comment-author-name/edit.js.map +1 -1
  4. package/build/comment-edit-link/edit.js +1 -1
  5. package/build/comment-edit-link/edit.js.map +1 -1
  6. package/build/cover/edit/inspector-controls.js +1 -1
  7. package/build/cover/edit/inspector-controls.js.map +1 -1
  8. package/build/cover/index.js +1 -1
  9. package/build/cover/transforms.js +10 -7
  10. package/build/cover/transforms.js.map +1 -1
  11. package/build/cover/variations.js +1 -1
  12. package/build/cover/variations.js.map +1 -1
  13. package/build/details/edit.js +19 -5
  14. package/build/details/edit.js.map +1 -1
  15. package/build/details/index.js +14 -10
  16. package/build/details/index.js.map +1 -1
  17. package/build/details/save.js +4 -1
  18. package/build/details/save.js.map +1 -1
  19. package/build/embed/variations.js +2 -2
  20. package/build/embed/variations.js.map +1 -1
  21. package/build/file/view.js +1 -1
  22. package/build/file/view.js.map +1 -1
  23. package/build/gallery/edit.js +2 -8
  24. package/build/gallery/edit.js.map +1 -1
  25. package/build/group/edit.js +3 -1
  26. package/build/group/edit.js.map +1 -1
  27. package/build/group/index.js +3 -0
  28. package/build/group/index.js.map +1 -1
  29. package/build/image/edit.js +16 -13
  30. package/build/image/edit.js.map +1 -1
  31. package/build/image/index.js +1 -1
  32. package/build/index.js +0 -6
  33. package/build/index.js.map +1 -1
  34. package/build/index.native.js +10 -6
  35. package/build/index.native.js.map +1 -1
  36. package/build/list-item/utils.js +5 -1
  37. package/build/list-item/utils.js.map +1 -1
  38. package/build/loginout/index.js +11 -1
  39. package/build/loginout/index.js.map +1 -1
  40. package/build/media-text/edit.js +4 -2
  41. package/build/media-text/edit.js.map +1 -1
  42. package/build/media-text/index.js +3 -0
  43. package/build/media-text/index.js.map +1 -1
  44. package/build/navigation/constants.js +13 -0
  45. package/build/navigation/constants.js.map +1 -0
  46. package/build/navigation/edit/index.js +26 -68
  47. package/build/navigation/edit/index.js.map +1 -1
  48. package/build/navigation/edit/inner-blocks.js +4 -7
  49. package/build/navigation/edit/inner-blocks.js.map +1 -1
  50. package/build/navigation/edit/unsaved-inner-blocks.js +4 -6
  51. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  52. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  53. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  54. package/build/navigation/interactivity.js +139 -0
  55. package/build/navigation/interactivity.js.map +1 -0
  56. package/build/navigation-link/edit.js +1 -1
  57. package/build/navigation-link/edit.js.map +1 -1
  58. package/build/navigation-submenu/edit.js +1 -1
  59. package/build/navigation-submenu/edit.js.map +1 -1
  60. package/build/paragraph/index.js +5 -1
  61. package/build/paragraph/index.js.map +1 -1
  62. package/build/paragraph/transforms.js +5 -1
  63. package/build/paragraph/transforms.js.map +1 -1
  64. package/build/post-author-name/edit.js +1 -1
  65. package/build/post-author-name/edit.js.map +1 -1
  66. package/build/post-date/edit.js +4 -2
  67. package/build/post-date/edit.js.map +1 -1
  68. package/build/post-excerpt/edit.js +2 -2
  69. package/build/post-excerpt/edit.js.map +1 -1
  70. package/build/post-featured-image/edit.js +6 -4
  71. package/build/post-featured-image/edit.js.map +1 -1
  72. package/build/post-featured-image/overlay.js +5 -0
  73. package/build/post-featured-image/overlay.js.map +1 -1
  74. package/build/post-title/edit.js +14 -4
  75. package/build/post-title/edit.js.map +1 -1
  76. package/build/preformatted/edit.native.js +3 -2
  77. package/build/preformatted/edit.native.js.map +1 -1
  78. package/build/query/deprecated.js +8 -6
  79. package/build/query/deprecated.js.map +1 -1
  80. package/build/query/edit/inspector-controls/create-new-post-link.js +41 -0
  81. package/build/query/edit/inspector-controls/create-new-post-link.js.map +1 -0
  82. package/build/query/edit/inspector-controls/index.js +14 -6
  83. package/build/query/edit/inspector-controls/index.js.map +1 -1
  84. package/build/query/edit/pattern-selection-modal.js +2 -1
  85. package/build/query/edit/pattern-selection-modal.js.map +1 -1
  86. package/build/query/index.js +5 -12
  87. package/build/query/index.js.map +1 -1
  88. package/build/quote/transforms.js +16 -27
  89. package/build/quote/transforms.js.map +1 -1
  90. package/build/read-more/edit.js +1 -1
  91. package/build/read-more/edit.js.map +1 -1
  92. package/build/search/edit.js +9 -1
  93. package/build/search/edit.js.map +1 -1
  94. package/build/site-logo/edit.js +114 -16
  95. package/build/site-logo/edit.js.map +1 -1
  96. package/build/site-logo/index.js +1 -1
  97. package/build/site-title/edit/index.js +1 -1
  98. package/build/site-title/edit/index.js.map +1 -1
  99. package/build/social-link/icons/chain.js +1 -1
  100. package/build/social-link/icons/chain.js.map +1 -1
  101. package/build/social-link/icons/mail.js +1 -1
  102. package/build/social-link/icons/mail.js.map +1 -1
  103. package/build/social-links/edit.js +2 -2
  104. package/build/social-links/edit.js.map +1 -1
  105. package/build/spacer/edit.js +117 -11
  106. package/build/spacer/edit.js.map +1 -1
  107. package/build/template-part/edit/index.js +2 -1
  108. package/build/template-part/edit/index.js.map +1 -1
  109. package/build/template-part/edit/utils/hooks.js +2 -2
  110. package/build/template-part/edit/utils/hooks.js.map +1 -1
  111. package/build/utils/interactivity/constants.js +9 -0
  112. package/build/utils/interactivity/constants.js.map +1 -0
  113. package/build/utils/interactivity/directives.js +208 -0
  114. package/build/utils/interactivity/directives.js.map +1 -0
  115. package/build/utils/interactivity/hooks.js +112 -0
  116. package/build/utils/interactivity/hooks.js.map +1 -0
  117. package/build/utils/interactivity/hydration.js +34 -0
  118. package/build/utils/interactivity/hydration.js.map +1 -0
  119. package/build/utils/interactivity/index.js +34 -0
  120. package/build/utils/interactivity/index.js.map +1 -0
  121. package/build/utils/interactivity/store.js +67 -0
  122. package/build/utils/interactivity/store.js.map +1 -0
  123. package/build/utils/interactivity/utils.js +87 -0
  124. package/build/utils/interactivity/utils.js.map +1 -0
  125. package/build/utils/interactivity/vdom.js +109 -0
  126. package/build/utils/interactivity/vdom.js.map +1 -0
  127. package/build/utils/migrate-font-family.js +12 -5
  128. package/build/utils/migrate-font-family.js.map +1 -1
  129. package/build/video/edit.native.js +4 -3
  130. package/build/video/edit.native.js.map +1 -1
  131. package/build-module/comment-author-name/edit.js +1 -1
  132. package/build-module/comment-author-name/edit.js.map +1 -1
  133. package/build-module/comment-edit-link/edit.js +1 -1
  134. package/build-module/comment-edit-link/edit.js.map +1 -1
  135. package/build-module/cover/edit/inspector-controls.js +1 -1
  136. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  137. package/build-module/cover/index.js +1 -1
  138. package/build-module/cover/transforms.js +5 -1
  139. package/build-module/cover/transforms.js.map +1 -1
  140. package/build-module/cover/variations.js +1 -1
  141. package/build-module/cover/variations.js.map +1 -1
  142. package/build-module/details/edit.js +20 -6
  143. package/build-module/details/edit.js.map +1 -1
  144. package/build-module/details/index.js +14 -10
  145. package/build-module/details/index.js.map +1 -1
  146. package/build-module/details/save.js +5 -2
  147. package/build-module/details/save.js.map +1 -1
  148. package/build-module/embed/variations.js +2 -2
  149. package/build-module/embed/variations.js.map +1 -1
  150. package/build-module/file/view.js +1 -1
  151. package/build-module/file/view.js.map +1 -1
  152. package/build-module/gallery/edit.js +2 -8
  153. package/build-module/gallery/edit.js.map +1 -1
  154. package/build-module/group/edit.js +3 -1
  155. package/build-module/group/edit.js.map +1 -1
  156. package/build-module/group/index.js +3 -0
  157. package/build-module/group/index.js.map +1 -1
  158. package/build-module/image/edit.js +16 -13
  159. package/build-module/image/edit.js.map +1 -1
  160. package/build-module/image/index.js +1 -1
  161. package/build-module/index.js +0 -4
  162. package/build-module/index.js.map +1 -1
  163. package/build-module/index.native.js +10 -6
  164. package/build-module/index.native.js.map +1 -1
  165. package/build-module/list-item/utils.js +5 -1
  166. package/build-module/list-item/utils.js.map +1 -1
  167. package/build-module/loginout/index.js +11 -1
  168. package/build-module/loginout/index.js.map +1 -1
  169. package/build-module/media-text/edit.js +4 -2
  170. package/build-module/media-text/edit.js.map +1 -1
  171. package/build-module/media-text/index.js +3 -0
  172. package/build-module/media-text/index.js.map +1 -1
  173. package/build-module/navigation/constants.js +5 -0
  174. package/build-module/navigation/constants.js.map +1 -0
  175. package/build-module/navigation/edit/index.js +28 -69
  176. package/build-module/navigation/edit/index.js.map +1 -1
  177. package/build-module/navigation/edit/inner-blocks.js +1 -4
  178. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  179. package/build-module/navigation/edit/unsaved-inner-blocks.js +1 -4
  180. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  181. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  182. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  183. package/build-module/navigation/interactivity.js +136 -0
  184. package/build-module/navigation/interactivity.js.map +1 -0
  185. package/build-module/navigation-link/edit.js +1 -1
  186. package/build-module/navigation-link/edit.js.map +1 -1
  187. package/build-module/navigation-submenu/edit.js +1 -1
  188. package/build-module/navigation-submenu/edit.js.map +1 -1
  189. package/build-module/paragraph/index.js +5 -1
  190. package/build-module/paragraph/index.js.map +1 -1
  191. package/build-module/paragraph/transforms.js +5 -1
  192. package/build-module/paragraph/transforms.js.map +1 -1
  193. package/build-module/post-author-name/edit.js +1 -1
  194. package/build-module/post-author-name/edit.js.map +1 -1
  195. package/build-module/post-date/edit.js +4 -2
  196. package/build-module/post-date/edit.js.map +1 -1
  197. package/build-module/post-excerpt/edit.js +2 -2
  198. package/build-module/post-excerpt/edit.js.map +1 -1
  199. package/build-module/post-featured-image/edit.js +6 -4
  200. package/build-module/post-featured-image/edit.js.map +1 -1
  201. package/build-module/post-featured-image/overlay.js +5 -0
  202. package/build-module/post-featured-image/overlay.js.map +1 -1
  203. package/build-module/post-title/edit.js +13 -4
  204. package/build-module/post-title/edit.js.map +1 -1
  205. package/build-module/preformatted/edit.native.js +3 -2
  206. package/build-module/preformatted/edit.native.js.map +1 -1
  207. package/build-module/query/deprecated.js +5 -2
  208. package/build-module/query/deprecated.js.map +1 -1
  209. package/build-module/query/edit/inspector-controls/create-new-post-link.js +33 -0
  210. package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +1 -0
  211. package/build-module/query/edit/inspector-controls/index.js +12 -7
  212. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  213. package/build-module/query/edit/pattern-selection-modal.js +2 -1
  214. package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
  215. package/build-module/query/index.js +5 -10
  216. package/build-module/query/index.js.map +1 -1
  217. package/build-module/quote/transforms.js +16 -27
  218. package/build-module/quote/transforms.js.map +1 -1
  219. package/build-module/read-more/edit.js +1 -1
  220. package/build-module/read-more/edit.js.map +1 -1
  221. package/build-module/search/edit.js +9 -1
  222. package/build-module/search/edit.js.map +1 -1
  223. package/build-module/site-logo/edit.js +115 -18
  224. package/build-module/site-logo/edit.js.map +1 -1
  225. package/build-module/site-logo/index.js +1 -1
  226. package/build-module/site-title/edit/index.js +1 -1
  227. package/build-module/site-title/edit/index.js.map +1 -1
  228. package/build-module/social-link/icons/chain.js +1 -1
  229. package/build-module/social-link/icons/chain.js.map +1 -1
  230. package/build-module/social-link/icons/mail.js +1 -1
  231. package/build-module/social-link/icons/mail.js.map +1 -1
  232. package/build-module/social-links/edit.js +2 -2
  233. package/build-module/social-links/edit.js.map +1 -1
  234. package/build-module/spacer/edit.js +118 -12
  235. package/build-module/spacer/edit.js.map +1 -1
  236. package/build-module/template-part/edit/index.js +2 -1
  237. package/build-module/template-part/edit/index.js.map +1 -1
  238. package/build-module/template-part/edit/utils/hooks.js +2 -2
  239. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  240. package/build-module/utils/interactivity/constants.js +2 -0
  241. package/build-module/utils/interactivity/constants.js.map +1 -0
  242. package/build-module/utils/interactivity/directives.js +193 -0
  243. package/build-module/utils/interactivity/directives.js.map +1 -0
  244. package/build-module/utils/interactivity/hooks.js +98 -0
  245. package/build-module/utils/interactivity/hooks.js.map +1 -0
  246. package/build-module/utils/interactivity/hydration.js +21 -0
  247. package/build-module/utils/interactivity/hydration.js.map +1 -0
  248. package/build-module/utils/interactivity/index.js +17 -0
  249. package/build-module/utils/interactivity/index.js.map +1 -0
  250. package/build-module/utils/interactivity/store.js +56 -0
  251. package/build-module/utils/interactivity/store.js.map +1 -0
  252. package/build-module/utils/interactivity/utils.js +75 -0
  253. package/build-module/utils/interactivity/utils.js.map +1 -0
  254. package/build-module/utils/interactivity/vdom.js +97 -0
  255. package/build-module/utils/interactivity/vdom.js.map +1 -0
  256. package/build-module/utils/migrate-font-family.js +9 -1
  257. package/build-module/utils/migrate-font-family.js.map +1 -1
  258. package/build-module/video/edit.native.js +4 -3
  259. package/build-module/video/edit.native.js.map +1 -1
  260. package/build-style/cover/editor-rtl.css +3 -3
  261. package/build-style/cover/editor.css +3 -3
  262. package/build-style/cover/style-rtl.css +2 -1
  263. package/build-style/cover/style.css +2 -1
  264. package/build-style/{details-summary → details}/editor-rtl.css +1 -1
  265. package/build-style/{details-summary → details}/editor.css +1 -1
  266. package/build-style/details/style-rtl.css +14 -0
  267. package/build-style/details/style.css +14 -0
  268. package/build-style/editor-rtl.css +74 -39
  269. package/build-style/editor.css +74 -39
  270. package/build-style/gallery/editor-rtl.css +0 -4
  271. package/build-style/gallery/editor.css +0 -4
  272. package/build-style/html/editor-rtl.css +2 -2
  273. package/build-style/html/editor.css +2 -2
  274. package/build-style/image/editor-rtl.css +1 -1
  275. package/build-style/image/editor.css +1 -1
  276. package/build-style/query/editor-rtl.css +8 -12
  277. package/build-style/query/editor.css +8 -12
  278. package/build-style/search/editor-rtl.css +1 -0
  279. package/build-style/search/editor.css +1 -0
  280. package/build-style/search/style-rtl.css +2 -0
  281. package/build-style/search/style.css +2 -0
  282. package/build-style/shortcode/editor-rtl.css +3 -4
  283. package/build-style/shortcode/editor.css +3 -4
  284. package/build-style/site-logo/editor-rtl.css +47 -0
  285. package/build-style/site-logo/editor.css +47 -0
  286. package/build-style/style-rtl.css +15 -2
  287. package/build-style/style.css +15 -2
  288. package/build-style/template-part/editor-rtl.css +8 -12
  289. package/build-style/template-part/editor.css +8 -12
  290. package/package.json +36 -32
  291. package/src/buttons/test/__snapshots__/edit.native.js.snap +18 -0
  292. package/src/buttons/test/edit.native.js +123 -2
  293. package/src/comment-author-name/edit.js +1 -1
  294. package/src/comment-edit-link/edit.js +1 -1
  295. package/src/comment-template/index.php +8 -7
  296. package/src/cover/block.json +1 -1
  297. package/src/cover/edit/inspector-controls.js +56 -54
  298. package/src/cover/editor.scss +1 -1
  299. package/src/cover/style.scss +4 -0
  300. package/src/cover/test/edit.js +56 -2
  301. package/src/cover/transforms.js +4 -1
  302. package/src/cover/variations.js +1 -3
  303. package/src/details/block.json +8 -6
  304. package/src/details/edit.js +27 -5
  305. package/src/details/editor.scss +3 -0
  306. package/src/details/index.js +10 -5
  307. package/src/details/save.js +5 -1
  308. package/src/details/style.scss +16 -0
  309. package/src/editor.scss +1 -1
  310. package/src/embed/variations.js +2 -2
  311. package/src/file/view.js +4 -1
  312. package/src/gallery/edit.js +5 -8
  313. package/src/gallery/editor.scss +0 -6
  314. package/src/gallery/test/index.native.js +52 -7
  315. package/src/group/block.json +3 -0
  316. package/src/group/edit.js +8 -2
  317. package/src/heading/test/__snapshots__/index.native.js.snap +12 -0
  318. package/src/heading/test/index.native.js +71 -0
  319. package/src/html/editor.scss +2 -21
  320. package/src/image/block.json +1 -1
  321. package/src/image/edit.js +21 -17
  322. package/src/image/editor.scss +1 -1
  323. package/src/image/test/edit.native.js +38 -16
  324. package/src/index.js +0 -4
  325. package/src/index.native.js +10 -5
  326. package/src/list/test/edit.native.js +7 -7
  327. package/src/loginout/block.json +11 -1
  328. package/src/media-text/block.json +3 -0
  329. package/src/media-text/edit.js +2 -1
  330. package/src/navigation/constants.js +16 -0
  331. package/src/navigation/edit/index.js +77 -163
  332. package/src/navigation/edit/inner-blocks.js +1 -16
  333. package/src/navigation/edit/unsaved-inner-blocks.js +1 -16
  334. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  335. package/src/navigation/index.php +210 -197
  336. package/src/navigation/interactivity.js +144 -0
  337. package/src/navigation-link/edit.js +1 -1
  338. package/src/navigation-submenu/edit.js +1 -1
  339. package/src/paragraph/block.json +5 -1
  340. package/src/paragraph/test/edit.native.js +288 -28
  341. package/src/post-author-name/edit.js +1 -1
  342. package/src/post-date/edit.js +4 -0
  343. package/src/post-date/index.php +17 -8
  344. package/src/post-excerpt/edit.js +1 -1
  345. package/src/post-featured-image/edit.js +5 -4
  346. package/src/post-featured-image/overlay.js +4 -0
  347. package/src/post-terms/index.php +2 -2
  348. package/src/post-title/edit.js +8 -1
  349. package/src/preformatted/edit.native.js +1 -3
  350. package/src/preformatted/test/edit.native.js +6 -9
  351. package/src/pullquote/test/edit.native.js +7 -12
  352. package/src/query/deprecated.js +4 -1
  353. package/src/query/edit/inspector-controls/create-new-post-link.js +26 -0
  354. package/src/query/edit/inspector-controls/index.js +13 -6
  355. package/src/query/edit/pattern-selection-modal.js +1 -0
  356. package/src/query/editor.scss +8 -11
  357. package/src/query/index.js +1 -7
  358. package/src/quote/test/edit.native.js +6 -10
  359. package/src/quote/transforms.js +0 -6
  360. package/src/read-more/edit.js +1 -1
  361. package/src/search/edit.js +9 -4
  362. package/src/search/editor.scss +1 -0
  363. package/src/search/style.scss +3 -0
  364. package/src/shortcode/editor.scss +1 -21
  365. package/src/site-logo/block.json +1 -1
  366. package/src/site-logo/edit.js +123 -9
  367. package/src/site-logo/editor.scss +58 -0
  368. package/src/site-title/edit/index.js +1 -1
  369. package/src/social-link/icons/chain.js +1 -1
  370. package/src/social-link/icons/mail.js +1 -1
  371. package/src/social-link/index.php +2 -2
  372. package/src/social-links/edit.js +33 -31
  373. package/src/spacer/edit.js +157 -18
  374. package/src/style.scss +0 -1
  375. package/src/template-part/edit/index.js +1 -0
  376. package/src/template-part/edit/utils/hooks.js +2 -2
  377. package/src/template-part/editor.scss +9 -11
  378. package/src/template-part/index.php +20 -5
  379. package/src/utils/interactivity/constants.js +1 -0
  380. package/src/utils/interactivity/directives.js +179 -0
  381. package/src/utils/interactivity/hooks.js +76 -0
  382. package/src/utils/interactivity/hydration.js +22 -0
  383. package/src/utils/interactivity/index.js +17 -0
  384. package/src/utils/interactivity/store.js +45 -0
  385. package/src/utils/interactivity/utils.js +66 -0
  386. package/src/utils/interactivity/vdom.js +94 -0
  387. package/src/utils/migrate-font-family.js +8 -1
  388. package/src/verse/test/edit.native.js +4 -9
  389. package/src/video/edit.native.js +2 -2
  390. package/tsconfig.json +2 -0
  391. package/tsconfig.tsbuildinfo +1 -1
  392. package/build/details-content/edit.js +0 -34
  393. package/build/details-content/edit.js.map +0 -1
  394. package/build/details-content/index.js +0 -94
  395. package/build/details-content/index.js.map +0 -1
  396. package/build/details-content/save.js +0 -20
  397. package/build/details-content/save.js.map +0 -1
  398. package/build/details-summary/edit.js +0 -42
  399. package/build/details-summary/edit.js.map +0 -1
  400. package/build/details-summary/index.js +0 -97
  401. package/build/details-summary/index.js.map +0 -1
  402. package/build/details-summary/save.js +0 -24
  403. package/build/details-summary/save.js.map +0 -1
  404. package/build/query/hooks.js +0 -72
  405. package/build/query/hooks.js.map +0 -1
  406. package/build/utils/clean-empty-object.js +0 -37
  407. package/build/utils/clean-empty-object.js.map +0 -1
  408. package/build-module/details-content/edit.js +0 -23
  409. package/build-module/details-content/edit.js.map +0 -1
  410. package/build-module/details-content/index.js +0 -76
  411. package/build-module/details-content/index.js.map +0 -1
  412. package/build-module/details-content/save.js +0 -11
  413. package/build-module/details-content/save.js.map +0 -1
  414. package/build-module/details-summary/edit.js +0 -30
  415. package/build-module/details-summary/edit.js.map +0 -1
  416. package/build-module/details-summary/index.js +0 -79
  417. package/build-module/details-summary/index.js.map +0 -1
  418. package/build-module/details-summary/save.js +0 -16
  419. package/build-module/details-summary/save.js.map +0 -1
  420. package/build-module/query/hooks.js +0 -59
  421. package/build-module/query/hooks.js.map +0 -1
  422. package/build-module/utils/clean-empty-object.js +0 -28
  423. package/build-module/utils/clean-empty-object.js.map +0 -1
  424. package/build-style/details-summary/style-rtl.css +0 -91
  425. package/build-style/details-summary/style.css +0 -91
  426. package/src/details-content/block.json +0 -50
  427. package/src/details-content/edit.js +0 -29
  428. package/src/details-content/index.js +0 -23
  429. package/src/details-content/save.js +0 -12
  430. package/src/details-summary/block.json +0 -53
  431. package/src/details-summary/edit.js +0 -27
  432. package/src/details-summary/editor.scss +0 -3
  433. package/src/details-summary/index.js +0 -23
  434. package/src/details-summary/save.js +0 -13
  435. package/src/details-summary/style.scss +0 -3
  436. package/src/query/hooks.js +0 -53
  437. package/src/utils/clean-empty-object.js +0 -28
@@ -195,7 +195,7 @@ export function SocialLinksEdit( props ) {
195
195
  </ToolbarDropdownMenu>
196
196
  </BlockControls>
197
197
  <InspectorControls>
198
- <PanelBody title={ __( 'Link settings' ) }>
198
+ <PanelBody title={ __( 'Settings' ) }>
199
199
  <ToggleControl
200
200
  __nextHasNoMarginBottom
201
201
  label={ __( 'Open links in new tab' ) }
@@ -214,37 +214,39 @@ export function SocialLinksEdit( props ) {
214
214
  />
215
215
  </PanelBody>
216
216
  </InspectorControls>
217
- <InspectorControls group="color">
218
- { colorSettings.map(
219
- ( { onChange, label, value, resetAllFilter } ) => (
220
- <ColorGradientSettingsDropdown
221
- key={ `social-links-color-${ label }` }
222
- __experimentalIsRenderedInSidebar
223
- settings={ [
224
- {
225
- colorValue: value,
226
- label,
227
- onColorChange: onChange,
228
- isShownByDefault: true,
229
- resetAllFilter,
230
- enableAlpha: true,
231
- },
232
- ] }
233
- panelId={ clientId }
234
- { ...colorGradientSettings }
217
+ { colorGradientSettings.hasColorsOrGradients && (
218
+ <InspectorControls group="color">
219
+ { colorSettings.map(
220
+ ( { onChange, label, value, resetAllFilter } ) => (
221
+ <ColorGradientSettingsDropdown
222
+ key={ `social-links-color-${ label }` }
223
+ __experimentalIsRenderedInSidebar
224
+ settings={ [
225
+ {
226
+ colorValue: value,
227
+ label,
228
+ onColorChange: onChange,
229
+ isShownByDefault: true,
230
+ resetAllFilter,
231
+ enableAlpha: true,
232
+ },
233
+ ] }
234
+ panelId={ clientId }
235
+ { ...colorGradientSettings }
236
+ />
237
+ )
238
+ ) }
239
+ { ! logosOnly && (
240
+ <ContrastChecker
241
+ { ...{
242
+ textColor: iconColorValue,
243
+ backgroundColor: iconBackgroundColorValue,
244
+ } }
245
+ isLargeText={ false }
235
246
  />
236
- )
237
- ) }
238
- { ! logosOnly && (
239
- <ContrastChecker
240
- { ...{
241
- textColor: iconColorValue,
242
- backgroundColor: iconBackgroundColorValue,
243
- } }
244
- isLargeText={ false }
245
- />
246
- ) }
247
- </InspectorControls>
247
+ ) }
248
+ </InspectorControls>
249
+ ) }
248
250
  <ul { ...innerBlocksProps } />
249
251
  </>
250
252
  );
@@ -8,6 +8,8 @@ import classnames from 'classnames';
8
8
  */
9
9
  import {
10
10
  useBlockProps,
11
+ useSetting,
12
+ getCustomValueFromPreset,
11
13
  getSpacingPresetCssVar,
12
14
  store as blockEditorStore,
13
15
  } from '@wordpress/block-editor';
@@ -92,13 +94,20 @@ const SpacerEdit = ( {
92
94
  } );
93
95
  const { orientation } = context;
94
96
  const { orientation: parentOrientation, type } = parentLayout || {};
97
+ // Check if the spacer is inside a flex container.
98
+ const isFlexLayout = type === 'flex';
95
99
  // If the spacer is inside a flex container, it should either inherit the orientation
96
100
  // of the parent or use the flex default orientation.
97
101
  const inheritedOrientation =
98
- ! parentOrientation && type === 'flex'
102
+ ! parentOrientation && isFlexLayout
99
103
  ? 'horizontal'
100
104
  : parentOrientation || orientation;
101
- const { height, width } = attributes;
105
+ const { height, width, style: blockStyle = {} } = attributes;
106
+
107
+ const { layout = {} } = blockStyle;
108
+ const { selfStretch, flexSize } = layout;
109
+
110
+ const spacingSizes = useSetting( 'spacing.spacingSizes' );
102
111
 
103
112
  const [ isResizing, setIsResizing ] = useState( false );
104
113
  const [ temporaryHeight, setTemporaryHeight ] = useState( null );
@@ -110,32 +119,80 @@ const SpacerEdit = ( {
110
119
  const handleOnVerticalResizeStop = ( newHeight ) => {
111
120
  onResizeStop();
112
121
 
122
+ if ( isFlexLayout ) {
123
+ setAttributes( {
124
+ style: {
125
+ ...blockStyle,
126
+ layout: {
127
+ ...layout,
128
+ flexSize: newHeight,
129
+ selfStretch: 'fixed',
130
+ },
131
+ },
132
+ } );
133
+ }
134
+
113
135
  setAttributes( { height: newHeight } );
114
136
  setTemporaryHeight( null );
115
137
  };
116
138
 
117
139
  const handleOnHorizontalResizeStop = ( newWidth ) => {
118
140
  onResizeStop();
141
+
142
+ if ( isFlexLayout ) {
143
+ setAttributes( {
144
+ style: {
145
+ ...blockStyle,
146
+ layout: {
147
+ ...layout,
148
+ flexSize: newWidth,
149
+ selfStretch: 'fixed',
150
+ },
151
+ },
152
+ } );
153
+ }
154
+
119
155
  setAttributes( { width: newWidth } );
120
156
  setTemporaryWidth( null );
121
157
  };
122
158
 
159
+ const getHeightForVerticalBlocks = () => {
160
+ if ( isFlexLayout ) {
161
+ return undefined;
162
+ }
163
+ return temporaryHeight || getSpacingPresetCssVar( height ) || undefined;
164
+ };
165
+
166
+ const getWidthForHorizontalBlocks = () => {
167
+ if ( isFlexLayout ) {
168
+ return undefined;
169
+ }
170
+ return temporaryWidth || getSpacingPresetCssVar( width ) || undefined;
171
+ };
172
+
173
+ const sizeConditionalOnOrientation =
174
+ inheritedOrientation === 'horizontal'
175
+ ? temporaryWidth || flexSize
176
+ : temporaryHeight || flexSize;
177
+
123
178
  const style = {
124
179
  height:
125
180
  inheritedOrientation === 'horizontal'
126
181
  ? 24
127
- : temporaryHeight ||
128
- getSpacingPresetCssVar( height ) ||
129
- undefined,
182
+ : getHeightForVerticalBlocks(),
130
183
  width:
131
184
  inheritedOrientation === 'horizontal'
132
- ? temporaryWidth || getSpacingPresetCssVar( width ) || undefined
185
+ ? getWidthForHorizontalBlocks()
133
186
  : undefined,
134
187
  // In vertical flex containers, the spacer shrinks to nothing without a minimum width.
135
188
  minWidth:
136
- inheritedOrientation === 'vertical' && type === 'flex'
189
+ inheritedOrientation === 'vertical' && isFlexLayout
137
190
  ? 48
138
191
  : undefined,
192
+ // Add flex-basis so temporary sizes are respected.
193
+ flexBasis: isFlexLayout ? sizeConditionalOnOrientation : undefined,
194
+ // Remove flex-grow when resizing.
195
+ flexGrow: isFlexLayout && isResizing ? 0 : undefined,
139
196
  };
140
197
 
141
198
  const resizableBoxWithOrientation = ( blockOrientation ) => {
@@ -191,13 +248,93 @@ const SpacerEdit = ( {
191
248
  };
192
249
 
193
250
  useEffect( () => {
194
- if ( inheritedOrientation === 'horizontal' && ! width ) {
251
+ if (
252
+ isFlexLayout &&
253
+ selfStretch !== 'fill' &&
254
+ selfStretch !== 'fit' &&
255
+ ! flexSize
256
+ ) {
257
+ if ( inheritedOrientation === 'horizontal' ) {
258
+ // If spacer is moving from a vertical container to a horizontal container,
259
+ // it might not have width but have height instead.
260
+ const newSize =
261
+ getCustomValueFromPreset( width, spacingSizes ) ||
262
+ getCustomValueFromPreset( height, spacingSizes ) ||
263
+ '100px';
264
+ setAttributes( {
265
+ width: '0px',
266
+ style: {
267
+ ...blockStyle,
268
+ layout: {
269
+ ...layout,
270
+ flexSize: newSize,
271
+ selfStretch: 'fixed',
272
+ },
273
+ },
274
+ } );
275
+ } else {
276
+ const newSize =
277
+ getCustomValueFromPreset( height, spacingSizes ) ||
278
+ getCustomValueFromPreset( width, spacingSizes ) ||
279
+ '100px';
280
+ setAttributes( {
281
+ height: '0px',
282
+ style: {
283
+ ...blockStyle,
284
+ layout: {
285
+ ...layout,
286
+ flexSize: newSize,
287
+ selfStretch: 'fixed',
288
+ },
289
+ },
290
+ } );
291
+ }
292
+ } else if (
293
+ isFlexLayout &&
294
+ ( selfStretch === 'fill' || selfStretch === 'fit' )
295
+ ) {
296
+ if ( inheritedOrientation === 'horizontal' ) {
297
+ setAttributes( {
298
+ width: undefined,
299
+ } );
300
+ } else {
301
+ setAttributes( {
302
+ height: undefined,
303
+ } );
304
+ }
305
+ } else if ( ! isFlexLayout && ( selfStretch || flexSize ) ) {
306
+ if ( inheritedOrientation === 'horizontal' ) {
307
+ setAttributes( {
308
+ width: flexSize,
309
+ } );
310
+ } else {
311
+ setAttributes( {
312
+ height: flexSize,
313
+ } );
314
+ }
195
315
  setAttributes( {
196
- height: '0px',
197
- width: '72px',
316
+ style: {
317
+ ...blockStyle,
318
+ layout: {
319
+ ...layout,
320
+ flexSize: undefined,
321
+ selfStretch: undefined,
322
+ },
323
+ },
198
324
  } );
199
325
  }
200
- }, [] );
326
+ }, [
327
+ blockStyle,
328
+ flexSize,
329
+ height,
330
+ inheritedOrientation,
331
+ isFlexLayout,
332
+ layout,
333
+ selfStretch,
334
+ setAttributes,
335
+ spacingSizes,
336
+ width,
337
+ ] );
201
338
 
202
339
  return (
203
340
  <>
@@ -211,13 +348,15 @@ const SpacerEdit = ( {
211
348
  >
212
349
  { resizableBoxWithOrientation( inheritedOrientation ) }
213
350
  </View>
214
- <SpacerControls
215
- setAttributes={ setAttributes }
216
- height={ temporaryHeight || height }
217
- width={ temporaryWidth || width }
218
- orientation={ inheritedOrientation }
219
- isResizing={ isResizing }
220
- />
351
+ { ! isFlexLayout && (
352
+ <SpacerControls
353
+ setAttributes={ setAttributes }
354
+ height={ temporaryHeight || height }
355
+ width={ temporaryWidth || width }
356
+ orientation={ inheritedOrientation }
357
+ isResizing={ isResizing }
358
+ />
359
+ ) }
221
360
  </>
222
361
  );
223
362
  };
package/src/style.scss CHANGED
@@ -12,7 +12,6 @@
12
12
  @import "./comment-template/style.scss";
13
13
  @import "./cover/style.scss";
14
14
  @import "./details/style.scss";
15
- @import "./details-summary/style.scss";
16
15
  @import "./embed/style.scss";
17
16
  @import "./file/style.scss";
18
17
  @import "./gallery/style.scss";
@@ -205,6 +205,7 @@ export default function TemplatePartEdit( {
205
205
  onRequestClose={ () =>
206
206
  setIsTemplatePartSelectionOpen( false )
207
207
  }
208
+ isFullScreen={ true }
208
209
  >
209
210
  <TemplatePartSelectionModal
210
211
  templatePartId={ templatePartId }
@@ -37,7 +37,7 @@ export function useAlternativeTemplateParts( area, excludedId ) {
37
37
  'wp_template_part',
38
38
  query
39
39
  ),
40
- isLoading: _isResolving( 'getEntityRecords', [
40
+ isResolving: _isResolving( 'getEntityRecords', [
41
41
  'postType',
42
42
  'wp_template_part',
43
43
  query,
@@ -61,7 +61,7 @@ export function useAlternativeTemplateParts( area, excludedId ) {
61
61
  templatePart.area === area )
62
62
  ) || []
63
63
  );
64
- }, [ templateParts, area ] );
64
+ }, [ templateParts, area, excludedId ] );
65
65
 
66
66
  return {
67
67
  templateParts: filteredTemplateParts,
@@ -1,18 +1,16 @@
1
1
  .block-editor-template-part__selection-modal {
2
2
  z-index: z-index(".block-editor-template-part__selection-modal");
3
3
 
4
- // To keep modal dimensions consistent as subsections are navigated, width
5
- // and height are used instead of max-(width/height).
6
- .components-modal__frame {
7
- @include break-small() {
8
- width: calc(100% - #{$grid-unit-20 * 2});
9
- height: calc(100% - #{$header-height * 2});
10
- }
11
- @include break-medium() {
12
- width: $break-medium - $grid-unit-20 * 2;
4
+ .block-editor-block-patterns-list {
5
+ column-count: 2;
6
+ column-gap: $grid-unit-30;
7
+
8
+ @include break-wide() {
9
+ column-count: 3;
13
10
  }
14
- @include break-large() {
15
- height: 70%;
11
+
12
+ .block-editor-block-patterns-list__list-item {
13
+ break-inside: avoid-column;
16
14
  }
17
15
  }
18
16
  }
@@ -173,21 +173,34 @@ function render_block_core_template_part( $attributes ) {
173
173
  /**
174
174
  * Returns an array of area variation objects for the template part block.
175
175
  *
176
+ * @param array $instance_variations The variations for instances.
177
+ *
176
178
  * @return array Array containing the block variation objects.
177
179
  */
178
- function build_template_part_block_area_variations() {
180
+ function build_template_part_block_area_variations( $instance_variations ) {
179
181
  $variations = array();
180
182
  $defined_areas = get_allowed_block_template_part_areas();
183
+
181
184
  foreach ( $defined_areas as $area ) {
182
185
  if ( 'uncategorized' !== $area['area'] ) {
186
+ $has_instance_for_area = false;
187
+ foreach ( $instance_variations as $variation ) {
188
+ if ( $variation['attributes']['area'] === $area['area'] ) {
189
+ $has_instance_for_area = true;
190
+ break;
191
+ }
192
+ }
193
+
194
+ $scope = $has_instance_for_area ? array() : array( 'inserter' );
195
+
183
196
  $variations[] = array(
184
- 'name' => $area['area'],
197
+ 'name' => 'area_' . $area['area'],
185
198
  'title' => $area['label'],
186
199
  'description' => $area['description'],
187
200
  'attributes' => array(
188
201
  'area' => $area['area'],
189
202
  ),
190
- 'scope' => array( 'inserter' ),
203
+ 'scope' => $scope,
191
204
  'icon' => $area['icon'],
192
205
  );
193
206
  }
@@ -223,7 +236,7 @@ function build_template_part_block_instance_variations() {
223
236
 
224
237
  foreach ( $template_parts as $template_part ) {
225
238
  $variations[] = array(
226
- 'name' => sanitize_title( $template_part->slug ),
239
+ 'name' => 'instance_' . sanitize_title( $template_part->slug ),
227
240
  'title' => $template_part->title,
228
241
  // If there's no description for the template part don't show the
229
242
  // block description. This is a bit hacky, but prevent the fallback
@@ -255,7 +268,9 @@ function build_template_part_block_instance_variations() {
255
268
  * @return array Array containing the block variation objects.
256
269
  */
257
270
  function build_template_part_block_variations() {
258
- return array_merge( build_template_part_block_area_variations(), build_template_part_block_instance_variations() );
271
+ $instance_variations = build_template_part_block_instance_variations();
272
+ $area_variations = build_template_part_block_area_variations( $instance_variations );
273
+ return array_merge( $area_variations, $instance_variations );
259
274
  }
260
275
 
261
276
  /**
@@ -0,0 +1 @@
1
+ export const directivePrefix = 'data-wp-';
@@ -0,0 +1,179 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { useContext, useMemo, useEffect } from 'preact/hooks';
5
+ import { deepSignal, peek } from 'deepsignal';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { useSignalEffect } from './utils';
11
+ import { directive } from './hooks';
12
+
13
+ const isObject = ( item ) =>
14
+ item && typeof item === 'object' && ! Array.isArray( item );
15
+
16
+ const mergeDeepSignals = ( target, source ) => {
17
+ for ( const k in source ) {
18
+ if ( typeof peek( target, k ) === 'undefined' ) {
19
+ target[ `$${ k }` ] = source[ `$${ k }` ];
20
+ } else if (
21
+ isObject( peek( target, k ) ) &&
22
+ isObject( peek( source, k ) )
23
+ ) {
24
+ mergeDeepSignals(
25
+ target[ `$${ k }` ].peek(),
26
+ source[ `$${ k }` ].peek()
27
+ );
28
+ }
29
+ }
30
+ };
31
+
32
+ export default () => {
33
+ // data-wp-context
34
+ directive(
35
+ 'context',
36
+ ( {
37
+ directives: {
38
+ context: { default: context },
39
+ },
40
+ props: { children },
41
+ context: inherited,
42
+ } ) => {
43
+ const { Provider } = inherited;
44
+ const inheritedValue = useContext( inherited );
45
+ const value = useMemo( () => {
46
+ const localValue = deepSignal( context );
47
+ mergeDeepSignals( localValue, inheritedValue );
48
+ return localValue;
49
+ }, [ context, inheritedValue ] );
50
+
51
+ return <Provider value={ value }>{ children }</Provider>;
52
+ }
53
+ );
54
+
55
+ // data-wp-effect.[name]
56
+ directive( 'effect', ( { directives: { effect }, context, evaluate } ) => {
57
+ const contextValue = useContext( context );
58
+ Object.values( effect ).forEach( ( path ) => {
59
+ useSignalEffect( () => {
60
+ return evaluate( path, { context: contextValue } );
61
+ } );
62
+ } );
63
+ } );
64
+
65
+ // data-wp-init.[name]
66
+ directive( 'init', ( { directives: { init }, context, evaluate } ) => {
67
+ const contextValue = useContext( context );
68
+ Object.values( init ).forEach( ( path ) => {
69
+ useEffect( () => {
70
+ return evaluate( path, { context: contextValue } );
71
+ }, [] );
72
+ } );
73
+ } );
74
+
75
+ // data-wp-on.[event]
76
+ directive( 'on', ( { directives: { on }, element, evaluate, context } ) => {
77
+ const contextValue = useContext( context );
78
+ Object.entries( on ).forEach( ( [ name, path ] ) => {
79
+ element.props[ `on${ name }` ] = ( event ) => {
80
+ evaluate( path, { event, context: contextValue } );
81
+ };
82
+ } );
83
+ } );
84
+
85
+ // data-wp-class.[classname]
86
+ directive(
87
+ 'class',
88
+ ( {
89
+ directives: { class: className },
90
+ element,
91
+ evaluate,
92
+ context,
93
+ } ) => {
94
+ const contextValue = useContext( context );
95
+ Object.keys( className )
96
+ .filter( ( n ) => n !== 'default' )
97
+ .forEach( ( name ) => {
98
+ const result = evaluate( className[ name ], {
99
+ className: name,
100
+ context: contextValue,
101
+ } );
102
+ const currentClass = element.props.class || '';
103
+ const classFinder = new RegExp(
104
+ `(^|\\s)${ name }(\\s|$)`,
105
+ 'g'
106
+ );
107
+ if ( ! result )
108
+ element.props.class = currentClass
109
+ .replace( classFinder, ' ' )
110
+ .trim();
111
+ else if ( ! classFinder.test( currentClass ) )
112
+ element.props.class = currentClass
113
+ ? `${ currentClass } ${ name }`
114
+ : name;
115
+
116
+ useEffect( () => {
117
+ // This seems necessary because Preact doesn't change the class
118
+ // names on the hydration, so we have to do it manually. It doesn't
119
+ // need deps because it only needs to do it the first time.
120
+ if ( ! result ) {
121
+ element.ref.current.classList.remove( name );
122
+ } else {
123
+ element.ref.current.classList.add( name );
124
+ }
125
+ }, [] );
126
+ } );
127
+ }
128
+ );
129
+
130
+ // data-wp-bind.[attribute]
131
+ directive(
132
+ 'bind',
133
+ ( { directives: { bind }, element, context, evaluate } ) => {
134
+ const contextValue = useContext( context );
135
+ Object.entries( bind )
136
+ .filter( ( n ) => n !== 'default' )
137
+ .forEach( ( [ attribute, path ] ) => {
138
+ const result = evaluate( path, {
139
+ context: contextValue,
140
+ } );
141
+ element.props[ attribute ] = result;
142
+
143
+ useEffect( () => {
144
+ // This seems necessary because Preact doesn't change the attributes
145
+ // on the hydration, so we have to do it manually. It doesn't need
146
+ // deps because it only needs to do it the first time.
147
+ if ( result === false ) {
148
+ element.ref.current.removeAttribute( attribute );
149
+ } else {
150
+ element.ref.current.setAttribute(
151
+ attribute,
152
+ result === true ? '' : result
153
+ );
154
+ }
155
+ }, [] );
156
+ } );
157
+ }
158
+ );
159
+
160
+ // data-wp-ignore
161
+ directive(
162
+ 'ignore',
163
+ ( {
164
+ element: {
165
+ type: Type,
166
+ props: { innerHTML, ...rest },
167
+ },
168
+ } ) => {
169
+ // Preserve the initial inner HTML.
170
+ const cached = useMemo( () => innerHTML, [] );
171
+ return (
172
+ <Type
173
+ dangerouslySetInnerHTML={ { __html: cached } }
174
+ { ...rest }
175
+ />
176
+ );
177
+ }
178
+ );
179
+ };
@@ -0,0 +1,76 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { h, options, createContext } from 'preact';
5
+ import { useRef, useMemo } from 'preact/hooks';
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { rawStore as store } from './store';
10
+
11
+ // Main context.
12
+ const context = createContext( {} );
13
+
14
+ // WordPress Directives.
15
+ const directiveMap = {};
16
+ export const directive = ( name, cb ) => {
17
+ directiveMap[ name ] = cb;
18
+ };
19
+
20
+ // Resolve the path to some property of the store object.
21
+ const resolve = ( path, ctx ) => {
22
+ // If path starts with !, remove it and save a flag.
23
+ const hasNegationOperator =
24
+ path[ 0 ] === '!' && !! ( path = path.slice( 1 ) );
25
+ let current = { ...store, context: ctx };
26
+ path.split( '.' ).forEach( ( p ) => ( current = current[ p ] ) );
27
+ return hasNegationOperator ? ! current : current;
28
+ };
29
+
30
+ // Generate the evaluate function.
31
+ const getEvaluate =
32
+ ( { ref } = {} ) =>
33
+ ( path, extraArgs = {} ) => {
34
+ const value = resolve( path, extraArgs.context );
35
+ return typeof value === 'function'
36
+ ? value( {
37
+ ref: ref.current,
38
+ ...store,
39
+ ...extraArgs,
40
+ } )
41
+ : value;
42
+ };
43
+
44
+ // Directive wrapper.
45
+ const Directive = ( { type, directives, props: originalProps } ) => {
46
+ const ref = useRef( null );
47
+ const element = h( type, { ...originalProps, ref } );
48
+ const props = { ...originalProps, children: element };
49
+ const evaluate = useMemo( () => getEvaluate( { ref } ), [] );
50
+ const directiveArgs = { directives, props, element, context, evaluate };
51
+
52
+ for ( const d in directives ) {
53
+ const wrapper = directiveMap[ d ]?.( directiveArgs );
54
+ if ( wrapper !== undefined ) props.children = wrapper;
55
+ }
56
+
57
+ return props.children;
58
+ };
59
+
60
+ // Preact Options Hook called each time a vnode is created.
61
+ const old = options.vnode;
62
+ options.vnode = ( vnode ) => {
63
+ if ( vnode.props.__directives ) {
64
+ const props = vnode.props;
65
+ const directives = props.__directives;
66
+ delete props.__directives;
67
+ vnode.props = {
68
+ type: vnode.type,
69
+ directives,
70
+ props,
71
+ };
72
+ vnode.type = Directive;
73
+ }
74
+
75
+ if ( old ) old( vnode );
76
+ };