soinproduction-gutenberg 0.1.16 → 0.3.41

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 (697) hide show
  1. package/README.md +86 -11
  2. package/adapters/next/runtime.php +2 -2
  3. package/adapters/wordpress/README.md +1 -1
  4. package/adapters/wordpress/blueprint.ts +12 -1
  5. package/adapters/wordpress/renderer.php +27 -8
  6. package/adapters/wordpress/runtime.tsx +14 -8
  7. package/admin-ui/controls.js +15 -15
  8. package/admin-ui/editor.css +21 -4
  9. package/admin-ui/viewport.tsx +20 -2
  10. package/components/archive/editor.tsx +279 -0
  11. package/components/archive/index.tsx +622 -0
  12. package/components/archive/manifest.json +12 -0
  13. package/components/archive/model.ts +433 -0
  14. package/components/archive/styles.css +79 -0
  15. package/components/button/index.tsx +3 -2
  16. package/components/buttons/implementation/content.tsx +2 -7
  17. package/components/buttons/shared/index.tsx +1 -1
  18. package/components/drag/editor.tsx +51 -41
  19. package/components/drag/index.tsx +21 -13
  20. package/components/drag/layout.ts +5 -0
  21. package/components/drag/sync-model.ts +35 -0
  22. package/components/drag/sync.tsx +64 -0
  23. package/components/forms/manifest.json +3 -0
  24. package/components/forms/styles.css +2 -0
  25. package/components/heading/editor.tsx +6 -2
  26. package/components/heading/index.tsx +5 -3
  27. package/components/heading/manifest.json +5 -0
  28. package/components/icon/editor.tsx +1 -0
  29. package/components/icon/index.tsx +8 -10
  30. package/components/icon/manifest.json +8 -1
  31. package/components/list/index.tsx +25 -0
  32. package/components/records/index.tsx +9 -5
  33. package/components/section/index.tsx +7 -3
  34. package/components/text/editor.tsx +1 -0
  35. package/components/text/index.tsx +16 -10
  36. package/components/text/manifest.json +8 -1
  37. package/core/README.md +1 -1
  38. package/core/content/html.tsx +3 -0
  39. package/core/content/rich-text.tsx +15 -1
  40. package/core/editor/appearance.tsx +49 -0
  41. package/core/editor/button-width.tsx +29 -0
  42. package/core/editor/icons.tsx +3 -3
  43. package/core/editor/inline-icon.tsx +144 -0
  44. package/core/editor/inline-link.tsx +1 -1
  45. package/core/editor/paragraphs.tsx +1 -1
  46. package/core/editor/reset.tsx +9 -0
  47. package/core/editor/styles.css +110 -81
  48. package/core/fields/appearance.ts +29 -0
  49. package/core/fields/editor.tsx +35 -14
  50. package/core/fields/render.tsx +16 -14
  51. package/core/icons/icon.tsx +2 -2
  52. package/core/icons/inline.tsx +11 -0
  53. package/core/icons/library.ts +4 -0
  54. package/core/media/universal/editor-value.ts +84 -0
  55. package/core/media/universal/editor.css +51 -53
  56. package/core/media/universal/editor.tsx +197 -117
  57. package/core/ui/button-appearance.ts +1 -1
  58. package/core/ui/button-width.ts +16 -0
  59. package/core/ui/collection-motion.tsx +59 -0
  60. package/core/ui/section-motion.ts +122 -0
  61. package/core/ui/sheet.tsx +1 -1
  62. package/core/ui/slider.tsx +14 -8
  63. package/dist/adapters/next/runtime.php +2 -2
  64. package/dist/adapters/wordpress/README.md +1 -1
  65. package/dist/adapters/wordpress/blueprint.d.ts +18 -4
  66. package/dist/adapters/wordpress/blueprint.js +18 -4
  67. package/dist/adapters/wordpress/blueprint.js.map +2 -2
  68. package/dist/adapters/wordpress/renderer.php +27 -8
  69. package/dist/adapters/wordpress/runtime.js +15 -7
  70. package/dist/adapters/wordpress/runtime.js.map +2 -2
  71. package/dist/admin-ui/controls.js +15 -15
  72. package/dist/admin-ui/editor.css +21 -4
  73. package/dist/admin-ui/viewport.d.ts +3 -0
  74. package/dist/admin-ui/viewport.js +23 -3
  75. package/dist/admin-ui/viewport.js.map +2 -2
  76. package/dist/components/archive/editor.d.ts +2 -0
  77. package/dist/components/archive/editor.js +267 -0
  78. package/dist/components/archive/editor.js.map +7 -0
  79. package/dist/components/archive/index.d.ts +110 -0
  80. package/dist/components/archive/index.js +517 -0
  81. package/dist/components/archive/index.js.map +7 -0
  82. package/dist/components/archive/manifest.json +12 -0
  83. package/dist/components/archive/model.d.ts +102 -0
  84. package/dist/components/archive/model.js +248 -0
  85. package/dist/components/archive/model.js.map +7 -0
  86. package/dist/components/archive/styles.css +79 -0
  87. package/dist/components/button/index.js +3 -2
  88. package/dist/components/button/index.js.map +2 -2
  89. package/dist/components/buttons/implementation/content.js +2 -4
  90. package/dist/components/buttons/implementation/content.js.map +2 -2
  91. package/dist/components/buttons/shared/index.js +1 -1
  92. package/dist/components/buttons/shared/index.js.map +2 -2
  93. package/dist/components/drag/editor.d.ts +1 -1
  94. package/dist/components/drag/editor.js +51 -45
  95. package/dist/components/drag/editor.js.map +2 -2
  96. package/dist/components/drag/index.d.ts +5 -3
  97. package/dist/components/drag/index.js +19 -10
  98. package/dist/components/drag/index.js.map +3 -3
  99. package/dist/components/drag/layout.d.ts +2 -0
  100. package/dist/components/drag/layout.js +4 -0
  101. package/dist/components/drag/layout.js.map +2 -2
  102. package/dist/components/drag/sync-model.d.ts +7 -0
  103. package/dist/components/drag/sync-model.js +35 -0
  104. package/dist/components/drag/sync-model.js.map +7 -0
  105. package/dist/components/drag/sync.d.ts +32 -0
  106. package/dist/components/drag/sync.js +106 -0
  107. package/dist/components/drag/sync.js.map +7 -0
  108. package/dist/components/forms/manifest.json +3 -0
  109. package/dist/components/forms/styles.css +2 -0
  110. package/dist/components/heading/editor.d.ts +1 -0
  111. package/dist/components/heading/editor.js +33 -35
  112. package/dist/components/heading/editor.js.map +2 -2
  113. package/dist/components/heading/index.js +5 -3
  114. package/dist/components/heading/index.js.map +2 -2
  115. package/dist/components/heading/manifest.json +5 -0
  116. package/dist/components/icon/editor.d.ts +1 -0
  117. package/dist/components/icon/editor.js +5 -0
  118. package/dist/components/icon/editor.js.map +7 -0
  119. package/dist/components/icon/index.d.ts +1 -1
  120. package/dist/components/icon/index.js +10 -7
  121. package/dist/components/icon/index.js.map +2 -2
  122. package/dist/components/icon/manifest.json +8 -1
  123. package/dist/components/list/index.js +38 -0
  124. package/dist/components/list/index.js.map +2 -2
  125. package/dist/components/records/index.d.ts +6 -4
  126. package/dist/components/records/index.js +6 -2
  127. package/dist/components/records/index.js.map +2 -2
  128. package/dist/components/section/index.d.ts +2 -1
  129. package/dist/components/section/index.js +7 -3
  130. package/dist/components/section/index.js.map +2 -2
  131. package/dist/components/text/editor.d.ts +1 -0
  132. package/dist/components/text/editor.js +5 -0
  133. package/dist/components/text/editor.js.map +7 -0
  134. package/dist/components/text/index.d.ts +9 -17
  135. package/dist/components/text/index.js +17 -7
  136. package/dist/components/text/index.js.map +2 -2
  137. package/dist/components/text/manifest.json +8 -1
  138. package/dist/core/README.md +1 -1
  139. package/dist/core/content/html.js +4 -0
  140. package/dist/core/content/html.js.map +2 -2
  141. package/dist/core/content/rich-text.js +15 -1
  142. package/dist/core/content/rich-text.js.map +2 -2
  143. package/dist/core/editor/appearance.d.ts +5 -0
  144. package/dist/core/editor/appearance.js +67 -0
  145. package/dist/core/editor/appearance.js.map +7 -0
  146. package/dist/core/editor/button-width.d.ts +5 -0
  147. package/dist/core/editor/button-width.js +46 -0
  148. package/dist/core/editor/button-width.js.map +7 -0
  149. package/dist/core/editor/icons.js +2 -2
  150. package/dist/core/editor/icons.js.map +2 -2
  151. package/dist/core/editor/inline-icon.d.ts +20 -0
  152. package/dist/core/editor/inline-icon.js +207 -0
  153. package/dist/core/editor/inline-icon.js.map +7 -0
  154. package/dist/core/editor/inline-link.js +1 -1
  155. package/dist/core/editor/inline-link.js.map +2 -2
  156. package/dist/core/editor/paragraphs.js +1 -1
  157. package/dist/core/editor/paragraphs.js.map +2 -2
  158. package/dist/core/editor/reset.d.ts +13 -0
  159. package/dist/core/editor/reset.js +15 -0
  160. package/dist/core/editor/reset.js.map +7 -0
  161. package/dist/core/editor/styles.css +110 -81
  162. package/dist/core/fields/appearance.d.ts +10 -0
  163. package/dist/core/fields/appearance.js +40 -0
  164. package/dist/core/fields/appearance.js.map +7 -0
  165. package/dist/core/fields/editor.js +71 -31
  166. package/dist/core/fields/editor.js.map +2 -2
  167. package/dist/core/fields/render.d.ts +5 -2
  168. package/dist/core/fields/render.js +12 -13
  169. package/dist/core/fields/render.js.map +2 -2
  170. package/dist/core/icons/icon.js +2 -2
  171. package/dist/core/icons/icon.js.map +2 -2
  172. package/dist/core/icons/inline.d.ts +5 -0
  173. package/dist/core/icons/inline.js +23 -0
  174. package/dist/core/icons/inline.js.map +7 -0
  175. package/dist/core/icons/library.d.ts +1 -0
  176. package/dist/core/icons/library.js +4 -0
  177. package/dist/core/icons/library.js.map +2 -2
  178. package/dist/core/media/universal/editor-value.d.ts +16 -0
  179. package/dist/core/media/universal/editor-value.js +49 -0
  180. package/dist/core/media/universal/editor-value.js.map +7 -0
  181. package/dist/core/media/universal/editor.css +51 -53
  182. package/dist/core/media/universal/editor.d.ts +4 -2
  183. package/dist/core/media/universal/editor.js +132 -70
  184. package/dist/core/media/universal/editor.js.map +3 -3
  185. package/dist/core/ui/button-appearance.d.ts +1 -0
  186. package/dist/core/ui/button-appearance.js.map +1 -1
  187. package/dist/core/ui/button-width.d.ts +4 -0
  188. package/dist/core/ui/button-width.js +17 -0
  189. package/dist/core/ui/button-width.js.map +7 -0
  190. package/dist/core/ui/collection-motion.d.ts +7 -0
  191. package/dist/core/ui/collection-motion.js +63 -0
  192. package/dist/core/ui/collection-motion.js.map +7 -0
  193. package/dist/core/ui/section-motion.d.ts +6 -0
  194. package/dist/core/ui/section-motion.js +127 -0
  195. package/dist/core/ui/section-motion.js.map +7 -0
  196. package/dist/core/ui/sheet.js +1 -1
  197. package/dist/core/ui/sheet.js.map +2 -2
  198. package/dist/core/ui/slider.js +24 -7
  199. package/dist/core/ui/slider.js.map +2 -2
  200. package/dist/editor/list-icons.js +3 -12
  201. package/dist/editor/list-icons.js.map +2 -2
  202. package/dist/editor/seo.js +7 -3
  203. package/dist/editor/seo.js.map +2 -2
  204. package/dist/generated/adapters.d.ts +1 -0
  205. package/dist/generated/adapters.js +5 -0
  206. package/dist/generated/adapters.js.map +7 -0
  207. package/dist/generated/editor-config.json +3 -0
  208. package/dist/generated/editor-registry.d.ts +6 -0
  209. package/dist/generated/editor-registry.js +7 -0
  210. package/dist/generated/editor-registry.js.map +7 -0
  211. package/dist/generated/editor.d.ts +2 -0
  212. package/dist/generated/editor.js +5 -0
  213. package/dist/generated/editor.js.map +7 -0
  214. package/dist/generated/public-assets.json +3 -0
  215. package/dist/generated/registry.d.ts +2 -0
  216. package/dist/generated/registry.js +7 -0
  217. package/dist/generated/registry.js.map +7 -0
  218. package/dist/generated/section-styles.json +4 -0
  219. package/dist/generated/sections.d.ts +1 -0
  220. package/dist/generated/sections.js +5 -0
  221. package/dist/generated/sections.js.map +7 -0
  222. package/dist/generated/theme.json +4 -0
  223. package/dist/hooks/use-motion.d.ts +5 -2
  224. package/dist/hooks/use-motion.js +4 -34
  225. package/dist/hooks/use-motion.js.map +2 -2
  226. package/dist/host/checks/boilerplate.test.mjs +49 -0
  227. package/dist/host/checks/breakpoints.test.mjs +51 -0
  228. package/dist/host/checks/cms-contract.test.mjs +60 -0
  229. package/dist/host/checks/cms.integration.mjs +19 -0
  230. package/dist/host/checks/rem-scale.test.mjs +13 -0
  231. package/dist/host/checks/routes.integration.mjs +239 -0
  232. package/dist/host/checks/routing.test.mjs +209 -0
  233. package/dist/host/checks/seo.test.mjs +32 -0
  234. package/dist/host/checks/shell-loading.test.mjs +66 -0
  235. package/dist/host/cms/contract.d.ts +75 -0
  236. package/dist/host/cms/contract.js +114 -0
  237. package/dist/host/cms/contract.js.map +7 -0
  238. package/dist/host/cms/policy.d.ts +11 -0
  239. package/dist/host/cms/policy.js +10 -0
  240. package/dist/host/cms/policy.js.map +7 -0
  241. package/dist/host/cms/server.d.ts +13 -0
  242. package/dist/host/cms/server.js +44 -0
  243. package/dist/host/cms/server.js.map +7 -0
  244. package/dist/host/docs/ARCHITECTURE.md +13 -0
  245. package/dist/host/docs/AUTHORING.md +133 -0
  246. package/dist/host/docs/BOILERPLATE.md +31 -0
  247. package/dist/host/docs/HOSTING.md +15 -0
  248. package/dist/host/editor/element-catalog.d.ts +15 -0
  249. package/dist/host/editor/element-catalog.js +20 -0
  250. package/dist/host/editor/element-catalog.js.map +7 -0
  251. package/dist/host/editor/environment.d.ts +1 -0
  252. package/dist/host/editor/environment.js +17 -0
  253. package/dist/host/editor/environment.js.map +7 -0
  254. package/dist/host/editor/field-controls.d.ts +2 -0
  255. package/dist/host/editor/field-controls.js +10 -0
  256. package/dist/host/editor/field-controls.js.map +7 -0
  257. package/dist/host/editor/index.d.ts +1 -0
  258. package/dist/host/editor/index.js +240 -0
  259. package/dist/host/editor/index.js.map +7 -0
  260. package/dist/host/editor/module-editor.d.ts +3 -0
  261. package/dist/host/editor/module-editor.js +10 -0
  262. package/dist/host/editor/module-editor.js.map +7 -0
  263. package/dist/host/editor/page-canvas.d.ts +2 -0
  264. package/dist/host/editor/page-canvas.js +93 -0
  265. package/dist/host/editor/page-canvas.js.map +7 -0
  266. package/dist/host/editor/record.d.ts +13 -0
  267. package/dist/host/editor/record.js +21 -0
  268. package/dist/host/editor/record.js.map +7 -0
  269. package/dist/host/editor/register.d.ts +1 -0
  270. package/dist/host/editor/register.js +186 -0
  271. package/dist/host/editor/register.js.map +7 -0
  272. package/dist/host/editor/styles.css +3 -0
  273. package/dist/host/media/resolve.d.ts +1 -0
  274. package/dist/host/media/resolve.js +5 -0
  275. package/dist/host/media/resolve.js.map +7 -0
  276. package/dist/host/modals/content.d.ts +4 -0
  277. package/dist/host/modals/content.js +51 -0
  278. package/dist/host/modals/content.js.map +7 -0
  279. package/dist/host/modals/dialog.d.ts +10 -0
  280. package/dist/host/modals/dialog.js +16 -0
  281. package/dist/host/modals/dialog.js.map +7 -0
  282. package/dist/host/modals/modal-shell.d.ts +7 -0
  283. package/dist/host/modals/modal-shell.js +119 -0
  284. package/dist/host/modals/modal-shell.js.map +7 -0
  285. package/dist/host/modals/shell.d.ts +10 -0
  286. package/dist/host/modals/shell.js +17 -0
  287. package/dist/host/modals/shell.js.map +7 -0
  288. package/dist/host/next/config.d.ts +2 -0
  289. package/dist/host/next/config.js +34 -0
  290. package/dist/host/next/config.js.map +7 -0
  291. package/dist/host/next/error.d.ts +3 -0
  292. package/dist/host/next/error.js +13 -0
  293. package/dist/host/next/error.js.map +7 -0
  294. package/dist/host/next/head.d.ts +1 -0
  295. package/dist/host/next/head.js +9 -0
  296. package/dist/host/next/head.js.map +7 -0
  297. package/dist/host/next/missing.d.ts +1 -0
  298. package/dist/host/next/missing.js +6 -0
  299. package/dist/host/next/missing.js.map +7 -0
  300. package/dist/host/next/not-found.d.ts +8 -0
  301. package/dist/host/next/not-found.js +11 -0
  302. package/dist/host/next/not-found.js.map +7 -0
  303. package/dist/host/next/page.d.ts +10 -0
  304. package/dist/host/next/page.js +45 -0
  305. package/dist/host/next/page.js.map +7 -0
  306. package/dist/host/next/preview.d.ts +12 -0
  307. package/dist/host/next/preview.js +32 -0
  308. package/dist/host/next/preview.js.map +7 -0
  309. package/dist/host/next/proxy.d.ts +1 -0
  310. package/dist/host/next/proxy.js +7 -0
  311. package/dist/host/next/proxy.js.map +7 -0
  312. package/dist/host/next/routes/api/[...path].d.ts +10 -0
  313. package/dist/host/next/routes/api/[...path].js +25 -0
  314. package/dist/host/next/routes/api/[...path].js.map +7 -0
  315. package/dist/host/next/routes/api/forms/[id].d.ts +7 -0
  316. package/dist/host/next/routes/api/forms/[id].js +17 -0
  317. package/dist/host/next/routes/api/forms/[id].js.map +7 -0
  318. package/dist/host/next/routes/api/modals/[id].d.ts +5 -0
  319. package/dist/host/next/routes/api/modals/[id].js +11 -0
  320. package/dist/host/next/routes/api/modals/[id].js.map +7 -0
  321. package/dist/host/next/routes/api/preview.d.ts +2 -0
  322. package/dist/host/next/routes/api/preview.js +16 -0
  323. package/dist/host/next/routes/api/preview.js.map +7 -0
  324. package/dist/host/next/routes/api/seo/sitemap.d.ts +2 -0
  325. package/dist/host/next/routes/api/seo/sitemap.js +11 -0
  326. package/dist/host/next/routes/api/seo/sitemap.js.map +7 -0
  327. package/dist/host/next/routes/robots.txt.d.ts +2 -0
  328. package/dist/host/next/routes/robots.txt.js +10 -0
  329. package/dist/host/next/routes/robots.txt.js.map +7 -0
  330. package/dist/host/next/routes/sitemap.xml.d.ts +2 -0
  331. package/dist/host/next/routes/sitemap.xml.js +10 -0
  332. package/dist/host/next/routes/sitemap.xml.js.map +7 -0
  333. package/dist/host/next/routes/sitemap_index.xml.d.ts +2 -0
  334. package/dist/host/next/routes/sitemap_index.xml.js +10 -0
  335. package/dist/host/next/routes/sitemap_index.xml.js.map +7 -0
  336. package/dist/host/rendering/block-list.d.ts +7 -0
  337. package/dist/host/rendering/block-list.js +98 -0
  338. package/dist/host/rendering/block-list.js.map +7 -0
  339. package/dist/host/rendering/html.d.ts +2 -0
  340. package/dist/host/rendering/html.js +5 -0
  341. package/dist/host/rendering/html.js.map +7 -0
  342. package/dist/host/rendering/native-content.d.ts +9 -0
  343. package/dist/host/rendering/native-content.js +55 -0
  344. package/dist/host/rendering/native-content.js.map +7 -0
  345. package/dist/host/routing/page-proxy.d.ts +9 -0
  346. package/dist/host/routing/page-proxy.js +70 -0
  347. package/dist/host/routing/page-proxy.js.map +7 -0
  348. package/dist/host/seo/parse.d.ts +13 -0
  349. package/dist/host/seo/parse.js +135 -0
  350. package/dist/host/seo/parse.js.map +7 -0
  351. package/dist/host/seo/schema.d.ts +7 -0
  352. package/dist/host/seo/schema.js +21 -0
  353. package/dist/host/seo/schema.js.map +7 -0
  354. package/dist/host/seo/server.d.ts +11 -0
  355. package/dist/host/seo/server.js +66 -0
  356. package/dist/host/seo/server.js.map +7 -0
  357. package/dist/host/styles.css +23 -0
  358. package/dist/host/system/not-found.d.ts +1 -0
  359. package/dist/host/system/not-found.js +14 -0
  360. package/dist/host/system/not-found.js.map +7 -0
  361. package/dist/host/wordpress.d.ts +1 -0
  362. package/dist/host/wordpress.js +6 -0
  363. package/dist/host/wordpress.js.map +7 -0
  364. package/dist/index.d.ts +2 -2
  365. package/dist/index.js +10 -4
  366. package/dist/index.js.map +2 -2
  367. package/dist/modules/booking/blocks/form/component.d.ts +1 -1
  368. package/dist/modules/booking/blocks/form/component.js +12 -3
  369. package/dist/modules/booking/blocks/form/component.js.map +2 -2
  370. package/dist/modules/booking/bootstrap.php +6 -0
  371. package/dist/modules/booking/frontend/widget.js +1 -1
  372. package/dist/modules/booking/frontend/widget.js.map +2 -2
  373. package/dist/modules/icons/bootstrap.php +6 -0
  374. package/dist/modules/icons/inline.php +24 -0
  375. package/dist/modules/modals/context.d.ts +5 -0
  376. package/dist/modules/modals/context.js +3 -1
  377. package/dist/modules/modals/context.js.map +2 -2
  378. package/dist/schema/index.d.ts +1 -1
  379. package/dist/schema/index.js +8 -2
  380. package/dist/schema/index.js.map +2 -2
  381. package/dist/schema/theme.json +112 -0
  382. package/dist/styles/columns.css +14 -0
  383. package/dist/styles/native-content.css +19 -0
  384. package/dist/tooling/block-paths.mjs +4 -3
  385. package/dist/tooling/breakpoints.cjs +8 -7
  386. package/dist/tooling/build-editor.mjs +8 -6
  387. package/dist/tooling/build-package.mjs +3 -1
  388. package/dist/tooling/build-wordpress.mjs +8 -6
  389. package/dist/tooling/check-project.mjs +14 -0
  390. package/dist/tooling/clean-project.mjs +16 -0
  391. package/dist/tooling/cli.mjs +8 -0
  392. package/dist/tooling/create-module.mjs +2 -2
  393. package/dist/tooling/create-post-type.mjs +10 -8
  394. package/dist/tooling/create-section.mjs +2 -2
  395. package/dist/tooling/dev.mjs +5 -9
  396. package/dist/tooling/export-starter.mjs +50 -0
  397. package/dist/tooling/init-theme.mjs +6 -182
  398. package/dist/tooling/jsx-only.mjs +2 -2
  399. package/dist/tooling/next-runtime.mjs +2 -2
  400. package/dist/tooling/postcss-config.mjs +2 -0
  401. package/dist/tooling/prepare-project.mjs +7 -3
  402. package/dist/tooling/project-build.mjs +6 -0
  403. package/dist/tooling/rem-css.cjs +6 -2
  404. package/dist/tooling/section-styles.mjs +8 -8
  405. package/dist/tooling/smoke-package.mjs +9 -2
  406. package/dist/tooling/sync-blocks.mjs +15 -11
  407. package/dist/tooling/sync-host.mjs +7 -0
  408. package/dist/tooling/sync-kit.mjs +8 -3
  409. package/dist/tooling/sync-public-assets.mjs +24 -0
  410. package/dist/tooling/sync-sections.mjs +5 -4
  411. package/dist/tooling/sync-theme.mjs +91 -0
  412. package/dist/tooling/theme-config.cjs +22 -0
  413. package/dist/tooling/watch-editor.mjs +2 -2
  414. package/dist/ui/README.md +2 -1
  415. package/dist/ui/forms-admin.css +4 -0
  416. package/dist/ui/forms.css +11 -0
  417. package/dist/ui/multi-select.d.ts +23 -0
  418. package/dist/ui/multi-select.js +97 -0
  419. package/dist/ui/multi-select.js.map +7 -0
  420. package/dist/ui/select.js +2 -2
  421. package/dist/ui/select.js.map +2 -2
  422. package/dist/wordpress/admin/locale.php +12 -0
  423. package/dist/wordpress/api/content.php +22 -20
  424. package/dist/wordpress/bootstrap.php +2 -0
  425. package/dist/wordpress/breakpoints.php +3 -2
  426. package/dist/wordpress/documents.php +6 -11
  427. package/dist/wordpress/editor.php +11 -8
  428. package/dist/wordpress/examples/post-type.example.php +11 -11
  429. package/dist/wordpress/host.php +68 -0
  430. package/dist/wordpress/integrations.php +10 -8
  431. package/dist/wordpress/layouts.php +18 -0
  432. package/dist/wordpress/post-types/collections.php +27 -85
  433. package/dist/wordpress/post-types/modals.php +6 -7
  434. package/dist/wordpress/project-autoload.php +16 -0
  435. package/dist/wordpress/record-context.php +42 -0
  436. package/dist/wordpress/rendering/bootstrap.php +4 -6
  437. package/dist/wordpress/rendering/performance.php +1 -12
  438. package/dist/wordpress/seo.php +2 -3
  439. package/dist/wordpress/template.php +24 -0
  440. package/dist/wordpress/theme-config.php +10 -0
  441. package/dist/wordpress/theme.php +7 -0
  442. package/editor/list-icons.tsx +3 -5
  443. package/editor/seo.ts +10 -2
  444. package/generated/adapters.ts +1 -0
  445. package/generated/editor-config.json +3 -0
  446. package/generated/editor-registry.ts +3 -0
  447. package/generated/editor.ts +2 -0
  448. package/generated/public-assets.json +3 -0
  449. package/generated/registry.ts +2 -0
  450. package/generated/section-styles.json +4 -0
  451. package/generated/sections.ts +1 -0
  452. package/generated/theme.json +4 -0
  453. package/hooks/use-motion.ts +8 -44
  454. package/host/checks/boilerplate.test.mjs +49 -0
  455. package/host/checks/breakpoints.test.mjs +51 -0
  456. package/host/checks/cms-contract.test.mjs +60 -0
  457. package/host/checks/cms.integration.mjs +19 -0
  458. package/host/checks/rem-scale.test.mjs +13 -0
  459. package/host/checks/routes.integration.mjs +239 -0
  460. package/host/checks/routing.test.mjs +209 -0
  461. package/host/checks/seo.test.mjs +32 -0
  462. package/host/checks/shell-loading.test.mjs +66 -0
  463. package/host/cms/contract.ts +143 -0
  464. package/host/cms/policy.ts +9 -0
  465. package/host/cms/server.ts +32 -0
  466. package/host/docs/ARCHITECTURE.md +13 -0
  467. package/host/docs/AUTHORING.md +133 -0
  468. package/host/docs/BOILERPLATE.md +31 -0
  469. package/host/docs/HOSTING.md +15 -0
  470. package/host/editor/element-catalog.ts +18 -0
  471. package/host/editor/environment.tsx +10 -0
  472. package/host/editor/field-controls.tsx +7 -0
  473. package/host/editor/globals.d.ts +6 -0
  474. package/host/editor/index.tsx +262 -0
  475. package/host/editor/module-editor.tsx +6 -0
  476. package/host/editor/page-canvas.tsx +96 -0
  477. package/host/editor/record.ts +27 -0
  478. package/host/editor/register.tsx +189 -0
  479. package/host/editor/styles.css +3 -0
  480. package/host/media/resolve.ts +1 -0
  481. package/host/modals/content.tsx +53 -0
  482. package/host/modals/dialog.tsx +24 -0
  483. package/host/modals/modal-shell.tsx +133 -0
  484. package/host/modals/shell.tsx +23 -0
  485. package/host/next/config.ts +31 -0
  486. package/host/next/error.tsx +2 -0
  487. package/host/next/head.tsx +2 -0
  488. package/host/next/missing.tsx +1 -0
  489. package/host/next/not-found.tsx +5 -0
  490. package/host/next/page.tsx +55 -0
  491. package/host/next/preview.tsx +14 -0
  492. package/host/next/proxy.ts +3 -0
  493. package/host/next/routes/api/[...path].ts +16 -0
  494. package/host/next/routes/api/forms/[id].ts +12 -0
  495. package/host/next/routes/api/modals/[id].ts +2 -0
  496. package/host/next/routes/api/preview.ts +13 -0
  497. package/host/next/routes/api/seo/sitemap.ts +7 -0
  498. package/host/next/routes/robots.txt.ts +5 -0
  499. package/host/next/routes/sitemap.xml.ts +5 -0
  500. package/host/next/routes/sitemap_index.xml.ts +5 -0
  501. package/host/rendering/block-list.tsx +121 -0
  502. package/host/rendering/html.tsx +2 -0
  503. package/host/rendering/native-content.tsx +79 -0
  504. package/host/routing/page-proxy.ts +83 -0
  505. package/host/seo/parse.ts +154 -0
  506. package/host/seo/schema.tsx +22 -0
  507. package/host/seo/server.ts +64 -0
  508. package/host/styles.css +23 -0
  509. package/host/system/not-found.tsx +14 -0
  510. package/host/wordpress.tsx +5 -0
  511. package/index.tsx +3 -2
  512. package/modules/booking/blocks/form/component.tsx +10 -3
  513. package/modules/booking/bootstrap.php +6 -0
  514. package/modules/booking/frontend/widget.tsx +1 -1
  515. package/modules/icons/bootstrap.php +6 -0
  516. package/modules/icons/inline.php +24 -0
  517. package/modules/modals/context.ts +2 -0
  518. package/package.json +22 -3
  519. package/schema/index.tsx +7 -2
  520. package/schema/theme.json +112 -0
  521. package/starter/map.json +32 -0
  522. package/starter/package-lock.template.json +3502 -0
  523. package/starter/templates/.htaccess +7 -0
  524. package/starter/templates/.nvmrc +1 -0
  525. package/starter/templates/AGENTS.md +14 -0
  526. package/starter/templates/README.md +13 -0
  527. package/starter/templates/deploy/nginx-private.conf +10 -0
  528. package/starter/templates/frontend/.env.example +13 -0
  529. package/starter/templates/frontend/.htaccess +7 -0
  530. package/starter/templates/frontend/.prettierrc.json +1 -0
  531. package/starter/templates/frontend/AGENTS.md +9 -0
  532. package/starter/templates/frontend/app/404/page.tsx +1 -0
  533. package/starter/templates/frontend/app/[[...path]]/page.tsx +1 -0
  534. package/starter/templates/frontend/app/api/[...path]/route.ts +1 -0
  535. package/starter/templates/frontend/app/api/forms/[id]/route.ts +1 -0
  536. package/starter/templates/frontend/app/api/modals/[id]/route.ts +1 -0
  537. package/starter/templates/frontend/app/api/preview/route.ts +1 -0
  538. package/starter/templates/frontend/app/api/seo/sitemap/route.ts +2 -0
  539. package/starter/templates/frontend/app/error.tsx +2 -0
  540. package/starter/templates/frontend/app/globals.css +5 -0
  541. package/starter/templates/frontend/app/layout.tsx +8 -0
  542. package/starter/templates/frontend/app/not-found.tsx +1 -0
  543. package/starter/templates/frontend/app/preview/[id]/page.tsx +1 -0
  544. package/starter/templates/frontend/app/robots.txt/route.ts +2 -0
  545. package/starter/templates/frontend/app/sitemap.xml/route.ts +2 -0
  546. package/starter/templates/frontend/app/sitemap_index.xml/route.ts +2 -0
  547. package/starter/templates/frontend/gitignore.template +8 -0
  548. package/starter/templates/frontend/next.config.ts +2 -0
  549. package/starter/templates/frontend/package.json +51 -0
  550. package/starter/templates/frontend/postcss.config.mjs +1 -0
  551. package/starter/templates/frontend/proxy.ts +7 -0
  552. package/starter/templates/frontend/public/assets/fonts/Manrope-Variable.woff2 +0 -0
  553. package/starter/templates/frontend/public/assets/fonts/OFL-Manrope.txt +93 -0
  554. package/starter/templates/frontend/public/assets/fonts/OFL-Unbounded.txt +93 -0
  555. package/starter/templates/frontend/public/assets/fonts/SOURCES.txt +26 -0
  556. package/starter/templates/frontend/public/assets/fonts/Unbounded-Variable.woff2 +0 -0
  557. package/starter/templates/frontend/src/README.md +3 -0
  558. package/starter/templates/frontend/src/sections/README.md +3 -0
  559. package/starter/templates/frontend/src/styles/base.css +14 -0
  560. package/starter/templates/frontend/src/styles/buttons.css +200 -0
  561. package/starter/templates/frontend/src/styles/headings.css +42 -0
  562. package/starter/templates/frontend/tsconfig.json +61 -0
  563. package/starter/templates/functions.php +3 -0
  564. package/starter/templates/gitignore.template +27 -0
  565. package/starter/templates/inc/README.md +3 -0
  566. package/starter/templates/index.php +3 -0
  567. package/starter/templates/style.css +7 -0
  568. package/starter/templates/templates/index.html +1 -0
  569. package/starter/templates/theme.json +462 -0
  570. package/styles/columns.css +14 -0
  571. package/styles/native-content.css +19 -0
  572. package/tooling/block-paths.mjs +4 -3
  573. package/tooling/breakpoints.cjs +8 -7
  574. package/tooling/build-editor.mjs +8 -6
  575. package/tooling/build-package.mjs +3 -1
  576. package/tooling/build-wordpress.mjs +8 -6
  577. package/tooling/check-project.mjs +14 -0
  578. package/tooling/clean-project.mjs +16 -0
  579. package/tooling/cli.mjs +8 -0
  580. package/tooling/create-module.mjs +2 -2
  581. package/tooling/create-post-type.mjs +10 -8
  582. package/tooling/create-section.mjs +2 -2
  583. package/tooling/dev.mjs +5 -9
  584. package/tooling/export-starter.mjs +50 -0
  585. package/tooling/init-theme.mjs +6 -182
  586. package/tooling/jsx-only.mjs +2 -2
  587. package/tooling/next-runtime.mjs +2 -2
  588. package/tooling/postcss-config.mjs +2 -0
  589. package/tooling/prepare-project.mjs +7 -3
  590. package/tooling/project-build.mjs +6 -0
  591. package/tooling/rem-css.cjs +6 -2
  592. package/tooling/section-styles.mjs +8 -8
  593. package/tooling/smoke-package.mjs +9 -2
  594. package/tooling/sync-blocks.mjs +15 -11
  595. package/tooling/sync-host.mjs +7 -0
  596. package/tooling/sync-kit.mjs +8 -3
  597. package/tooling/sync-public-assets.mjs +24 -0
  598. package/tooling/sync-sections.mjs +5 -4
  599. package/tooling/sync-theme.mjs +91 -0
  600. package/tooling/theme-config.cjs +22 -0
  601. package/tooling/watch-editor.mjs +2 -2
  602. package/tsconfig.json +4 -1
  603. package/ui/README.md +2 -1
  604. package/ui/forms-admin.css +4 -0
  605. package/ui/forms.css +11 -0
  606. package/ui/multi-select.tsx +60 -0
  607. package/ui/select.tsx +2 -2
  608. package/wordpress/admin/locale.php +12 -0
  609. package/wordpress/api/content.php +22 -20
  610. package/wordpress/bootstrap.php +2 -0
  611. package/wordpress/breakpoints.php +3 -2
  612. package/wordpress/documents.php +6 -11
  613. package/wordpress/editor.php +11 -8
  614. package/wordpress/examples/post-type.example.php +11 -11
  615. package/wordpress/host.php +68 -0
  616. package/wordpress/integrations.php +10 -8
  617. package/wordpress/layouts.php +18 -0
  618. package/wordpress/post-types/collections.php +27 -85
  619. package/wordpress/post-types/modals.php +6 -7
  620. package/wordpress/project-autoload.php +16 -0
  621. package/wordpress/record-context.php +42 -0
  622. package/wordpress/rendering/bootstrap.php +4 -6
  623. package/wordpress/rendering/performance.php +1 -12
  624. package/wordpress/seo.php +2 -3
  625. package/wordpress/template.php +24 -0
  626. package/wordpress/theme-config.php +10 -0
  627. package/wordpress/theme.php +7 -0
  628. package/components/pricing-plans/editor.tsx +0 -2
  629. package/components/pricing-plans/implementation/component.tsx +0 -40
  630. package/components/pricing-plans/implementation/editor.tsx +0 -17
  631. package/components/pricing-plans/implementation/selection.ts +0 -10
  632. package/components/pricing-plans/index.tsx +0 -11
  633. package/components/pricing-plans/manifest.json +0 -17
  634. package/components/pricing-plans/server.php +0 -24
  635. package/components/reviews-carousel/card.tsx +0 -63
  636. package/components/reviews-carousel/editor.tsx +0 -2
  637. package/components/reviews-carousel/implementation/component.tsx +0 -80
  638. package/components/reviews-carousel/implementation/editor.tsx +0 -17
  639. package/components/reviews-carousel/implementation/selection.ts +0 -10
  640. package/components/reviews-carousel/index.tsx +0 -12
  641. package/components/reviews-carousel/manifest.json +0 -14
  642. package/components/reviews-carousel/server.php +0 -18
  643. package/dist/components/pricing-plans/editor.d.ts +0 -1
  644. package/dist/components/pricing-plans/editor.js +0 -9
  645. package/dist/components/pricing-plans/editor.js.map +0 -7
  646. package/dist/components/pricing-plans/implementation/component.d.ts +0 -4
  647. package/dist/components/pricing-plans/implementation/component.js +0 -45
  648. package/dist/components/pricing-plans/implementation/component.js.map +0 -7
  649. package/dist/components/pricing-plans/implementation/editor.d.ts +0 -6
  650. package/dist/components/pricing-plans/implementation/editor.js +0 -21
  651. package/dist/components/pricing-plans/implementation/editor.js.map +0 -7
  652. package/dist/components/pricing-plans/implementation/selection.d.ts +0 -3
  653. package/dist/components/pricing-plans/implementation/selection.js +0 -13
  654. package/dist/components/pricing-plans/implementation/selection.js.map +0 -7
  655. package/dist/components/pricing-plans/index.d.ts +0 -46
  656. package/dist/components/pricing-plans/index.js +0 -13
  657. package/dist/components/pricing-plans/index.js.map +0 -7
  658. package/dist/components/pricing-plans/manifest.json +0 -17
  659. package/dist/components/pricing-plans/server.php +0 -24
  660. package/dist/components/reviews-carousel/card.d.ts +0 -1
  661. package/dist/components/reviews-carousel/card.js +0 -55
  662. package/dist/components/reviews-carousel/card.js.map +0 -7
  663. package/dist/components/reviews-carousel/editor.d.ts +0 -1
  664. package/dist/components/reviews-carousel/editor.js +0 -9
  665. package/dist/components/reviews-carousel/editor.js.map +0 -7
  666. package/dist/components/reviews-carousel/implementation/component.d.ts +0 -12
  667. package/dist/components/reviews-carousel/implementation/component.js +0 -63
  668. package/dist/components/reviews-carousel/implementation/component.js.map +0 -7
  669. package/dist/components/reviews-carousel/implementation/editor.d.ts +0 -6
  670. package/dist/components/reviews-carousel/implementation/editor.js +0 -21
  671. package/dist/components/reviews-carousel/implementation/editor.js.map +0 -7
  672. package/dist/components/reviews-carousel/implementation/selection.d.ts +0 -3
  673. package/dist/components/reviews-carousel/implementation/selection.js +0 -13
  674. package/dist/components/reviews-carousel/implementation/selection.js.map +0 -7
  675. package/dist/components/reviews-carousel/index.d.ts +0 -60
  676. package/dist/components/reviews-carousel/index.js +0 -13
  677. package/dist/components/reviews-carousel/index.js.map +0 -7
  678. package/dist/components/reviews-carousel/manifest.json +0 -14
  679. package/dist/components/reviews-carousel/server.php +0 -18
  680. package/dist/modules/collections/blocks/review/component.d.ts +0 -2
  681. package/dist/modules/collections/blocks/review/component.js +0 -14
  682. package/dist/modules/collections/blocks/review/component.js.map +0 -7
  683. package/dist/modules/collections/blocks/review/editor.d.ts +0 -1
  684. package/dist/modules/collections/blocks/review/editor.js +0 -11
  685. package/dist/modules/collections/blocks/review/editor.js.map +0 -7
  686. package/dist/modules/collections/blocks/review/register.php +0 -2
  687. package/dist/modules/collections/blocks/review/schema.d.ts +0 -7
  688. package/dist/modules/collections/blocks/review/schema.js +0 -14
  689. package/dist/modules/collections/blocks/review/schema.js.map +0 -7
  690. package/dist/modules/collections/manifest.json +0 -5
  691. package/dist/styles/rem-scale.css +0 -76
  692. package/modules/collections/blocks/review/component.tsx +0 -7
  693. package/modules/collections/blocks/review/editor.tsx +0 -8
  694. package/modules/collections/blocks/review/register.php +0 -2
  695. package/modules/collections/blocks/review/schema.ts +0 -20
  696. package/modules/collections/manifest.json +0 -5
  697. package/styles/rem-scale.css +0 -76
package/README.md CHANGED
@@ -17,7 +17,7 @@ The npm package includes compiled ESM, TypeScript declarations, source templates
17
17
 
18
18
  ## WordPress project preparation
19
19
 
20
- The host owns its theme tokens, authored sections/layouts, CMS data, endpoint configuration and secrets. Kit owns reusable component functionality.
20
+ The project owns authored sections/components/styles, theme tokens, language, configuration, content and business PHP. Kit owns CMS/editor/rendering/routing/SEO infrastructure, build tools, generic checks and neutral starter templates.
21
21
 
22
22
  For the existing declarative theme architecture, add this to the frontend's `package.json`:
23
23
 
@@ -31,24 +31,23 @@ An existing hand-maintained `kit/` is never overwritten. Move it aside when migr
31
31
 
32
32
  The host supplies:
33
33
 
34
- - `config/breakpoints.json`: `breakpoints`, `media.columns` and `layoutIgnore`.
35
- - `kit.config.json`: enabled global modules and editor settings.
34
+ - `theme.json → kit.responsive`: `breakpoints`, `media.columns` and `layoutIgnore`.
35
+ - `theme.json → kit`: enabled global modules and editor settings.
36
36
  - `src/sections/section-*/section.tsx` and `section.json`: authored sections.
37
37
  - Existing project content renderer and editor integration points when using legacy blocks.
38
38
 
39
- Example `kit.config.json`:
39
+ Example `theme.json → kit`:
40
40
 
41
41
  ```json
42
42
  {
43
43
  "modules": ["forms", "icons", "video-posters"],
44
- "editor": {"entry":"src/site/editor/index.tsx","stylesheet":"app/globals.css"},
45
- "wordpress": {"entry":"src/wordpress.tsx"}
44
+ "editor": {"stylesheet":"app/globals.css"}
46
45
  }
47
46
  ```
48
47
 
49
48
  Point the host TypeScript aliases `@kit` and `@kit/*` to `kit/index.tsx` and `kit/*`; `@ui/*` to `kit/ui/*`; and `@forms/*` to `kit/modules/forms/frontend/*` where existing host code uses them. The generated source itself uses relative imports. Compile authored portable sections through the root `@kit` import so the WordPress compiler can substitute its markers.
50
49
 
51
- Load `kit/bootstrap.php` once from the WordPress theme and supply module settings through host integration files. Deploy the managed kit's PHP and published assets along with the theme. Node is needed for preparation/building, not PHP request rendering.
50
+ Load `kit/wordpress/theme.php` once from the WordPress theme and supply module settings through host integration files. Deploy the managed kit's PHP and published assets along with the theme. Node is needed for preparation/building, not PHP request rendering.
52
51
 
53
52
  ## Automatic connections
54
53
 
@@ -86,7 +85,7 @@ Use the installed `soinproduction-kit` binary in npm scripts:
86
85
  {"scripts":{"dev":"soinproduction-kit dev","start":"soinproduction-kit start","create:component":"soinproduction-kit create component","create:section":"soinproduction-kit create section","create:layout":"soinproduction-kit create layout","new:section":"soinproduction-kit new section","render:module":"soinproduction-kit render"}}
87
86
  ```
88
87
 
89
- `dev` and `start` select a free port automatically. Explicit `--port`/`-p` or `PORT` take precedence. Development propagates the actual origin to site/forms configuration and writes `build/next-server.json`; the Next PHP adapter loaded by `bootstrap.php` reads it for local frontend URLs. Public deployment URLs stay configured. Override the project-relative runtime path with `runtime.file` in `kit.config.json`.
88
+ `dev` and `start` select a free port automatically. Explicit `--port`/`-p` or `PORT` take precedence. Development propagates the actual origin to site/forms configuration and writes `build/next-server.json`; the Next PHP adapter loaded by `bootstrap.php` reads it for local frontend URLs. Public deployment URLs stay configured. Override the project-relative runtime path with `runtime.file` in `theme.json → kit`.
90
89
 
91
90
  Generators prepare the installed kit automatically, then create the component schema, renderer, editor, PHP registration, styles and preview in the project. `new section` creates a declarative section. Use `--no-build` to generate without an editor build. `render` regenerates module markup from its schema. All commands accept `--project PATH`. The project owns component/section selection and optional `adapters.contentRenderer` / `adapters.editorAdapter` objects (`from`, `export`); portable defaults are provided. Preparation reuses unchanged package sources and refreshes generated connections without disturbing a running Next watcher.
92
91
 
@@ -109,7 +108,7 @@ npx soinproduction-kit create post-type case_study --collection \
109
108
  ```
110
109
 
111
110
  Kit создаёт `inc/post-types/case_study.php`, подключает его в `inc/bootstrap.php`
112
- и добавляет тип в `frontend/kit.config.json`. Для коллекции Kit создаёт блок
111
+ и добавляет тип в `theme.json → kit`. Для коллекции Kit создаёт блок
113
112
  `site/case-study-card` с описанием и изображением и фиксирует его в шаблоне записи.
114
113
  `--block site/study-card` задаёт другое имя. Если такой блок уже существует в теме,
115
114
  Kit использует его. После генерации пересоберите редактор обычной командой проекта
@@ -153,7 +152,7 @@ The portable PHP renderer resolves the same tag, class and defaults as React.
153
152
 
154
153
  ### Isolated section styles
155
154
 
156
- Set `"sectionStyles": "isolated"` in `kit.config.json` to compile each section's `styles.css` into a hashed asset. Preparation emits `src/sections/styles.manifest.generated.json` and `public/kit/sections/`. Keep those public assets available alongside a deployed Next build. The shared stylesheet retains theme declarations; selectors and keyframes load per rendered section. Existing projects retain global imports unless they opt in.
155
+ Set `"sectionStyles": "isolated"` in `theme.json → kit` to compile each section's `styles.css` into a hashed asset. Preparation emits `src/sections/styles.manifest.generated.json` and `public/kit/sections/`. Keep those public assets available alongside a deployed Next build. The shared stylesheet retains theme declarations; selectors and keyframes load per rendered section. Existing projects retain global imports unless they opt in.
157
156
 
158
157
  The existing `Section` root receives `data-site-section="site/slug"`. Compiled selectors are guarded by that owner without increasing specificity; keyframe names are unique to the section. Document state ancestors such as `html[data-motion]` still work. Keep reset rules, fonts and global custom properties in the shared entry. Use unique names for section `@theme` tokens; global directives such as `@font-face`, `@property`, `@utility` and `@apply` are rejected inside isolated section styles.
159
158
 
@@ -161,7 +160,7 @@ In a custom React block renderer, look up the actual block name in the generated
161
160
 
162
161
  ## View-specific native wrappers
163
162
 
164
- Enable `"jsxOnly": true` in `kit.config.json` and run Kit preparation once. It connects the Kit JSX runtime through the project's `jsxImportSource`. Existing consumers stay on their current runtime unless opted in; an unrelated custom runtime is never replaced automatically.
163
+ Enable `"jsxOnly": true` in `theme.json → kit` and run Kit preparation once. It connects the Kit JSX runtime through the project's `jsxImportSource`. Existing consumers stay on their current runtime unless opted in; an unrelated custom runtime is never replaced automatically.
165
164
 
166
165
  ```tsx
167
166
  <div only="admin" className="relative">
@@ -206,3 +205,79 @@ Every public JSX component accepts `order?: number`. Lower values appear first i
206
205
  ```
207
206
 
208
207
  The component reference includes all public JSX props, including inherited props. Its type table is regenerated from TypeScript before each documentation build. Run `node tooling/build-doc-props.mjs --check` to check it without writing files.
208
+
209
+
210
+ ## Explicit project data
211
+
212
+ The site API contains WordPress metadata, shared layout blocks, media references, public page links and archive assignments. It does not create project post types, guess collection block names, read a theme settings function or load project collections. Project PHP registers its own post types and exports data explicitly:
213
+
214
+ ```php
215
+ add_filter('site_public_data', function (array $data): array {
216
+ $data['settings'] = (array) get_option('project_settings', []);
217
+ $data['resources'] = collection_records('resource', 'site/resource-card');
218
+ return $data;
219
+ });
220
+ ```
221
+
222
+ `collection_records($postType, $blockName)` requires both arguments. It returns the saved block fields plus record identity and extra blocks, without injecting domain-specific fields or labels. The CLI generates this explicit integration in the theme. `postTypes` in `theme.json → kit` selects project types for the Kit editor; omitting project configuration creates no project collections. Optional icons, forms and booking modules contribute their data only when connected. Project-specific internal SEO documents use `site_seo_internal_document`.
223
+
224
+ Compose review carousels and pricing sections in the project using `Records`, `Slider`, `List` and their child primitives. KIT no longer ships the old project-specific review/pricing widgets or their automatic API collections. There are no compatibility aliases for these removed integrations.
225
+
226
+
227
+ ## Record and editor API contracts
228
+
229
+ Every document's `record` contains `id`, `type`, `slug`, `url`, `title`, `excerpt` and `taxonomies` (a map of taxonomy names to term ID arrays), plus the project's saved `site_record` fields. Core identity always comes from WordPress, not from editable metadata. Linked cards and collection records use the same context. Projects decide which relationship fields to save; KIT does not guess them.
230
+
231
+ `GET /site/v1/site` contains public data only. Editor-only integrations use the `site_editor_data` filter and authenticated `GET /site/v1/editor/site`, which requires `edit_posts` and returns `Cache-Control: private, no-store`. Do not add editor catalogues or private data to `site_public_data`.
232
+
233
+ ## Thin starter (0.2)
234
+
235
+ Use `soinproduction-kit export /absolute/new-directory` to create a neutral theme from package-owned templates. The current site's sections, settings and secrets are never copied. The export includes the local pinned npm archive, lock and `kit.lock.json` provenance. `starter/map.json` is the ownership map.
236
+
237
+ No project `src/lib`, `src/site`, registry files or scripts are needed. `prepare` writes all connections under `kit/generated`. `app` route files re-export `@kit/host/next/*`; the root layout, stylesheet and language stay project-owned. PHP entry files load `kit/wordpress/theme.php` and `kit/wordpress/template.php`. Common documentation and checks are shipped in `host/docs` and `host/checks`.
238
+
239
+ Commands: `prepare`, `build`, `build:editor`, `build:wordpress`, `dev`, `start`, `check`, `check:routes`, `check:cms`, `clean`, `export`. Projects may add their own `tests/*.test.mjs`; `check` runs them alongside the package's generic checks.
240
+
241
+ Optional custom integration: `editor.extensions` imports a project editor extension after the default entry; `editor.entry` replaces the entry; `editor.styles` adds editor CSS. `adapters.shell`, `adapters.contentRenderer`, and `adapters.editorAdapter` accept explicit `{from, export}` module references. Configure `editor.buttonStyles` as name/label objects. No project styles are registered implicitly.
242
+
243
+ The neutral starter stores Manrope and Unbounded locally with their licenses. Next loads them through next/font/local; WordPress uses theme.json fontFace and published build/assets/fonts. adminUi.locale optionally configures the admin/login/editor language while leaving the public locale unchanged. Shared custom admin controls have English labels.
244
+
245
+
246
+ ### Inline record templates
247
+
248
+ `Records` accepts either ordinary JSX children or a render function with the current record. Use the function for record-dependent classes, attributes, numbers and arrays while keeping the complete card markup inside the collection:
249
+
250
+ ```tsx
251
+ <Records name="items" type="item">
252
+ {record => <article data-record-id={record.id} className={record.highlighted ? 'bg-muted' : 'bg-background'}>
253
+ <RecordTitle />
254
+ <RecordText field="description" />
255
+ </article>}
256
+ </Records>
257
+ ```
258
+
259
+ Record primitives keep the same current-record context in both forms. Selection stores IDs and preserves their order. A render function supplies presentation only; it does not declare editable section fields. An editor add tile renders with an empty record (`title`, `excerpt`, `index`), so guard optional arrays and nested values. Dynamic templates render in Next SSR and Gutenberg; WordPress mode uses the existing browser island because PHP cannot serialize JavaScript callbacks. Ordinary declarative JSX templates retain their existing PHP blueprint behavior.
260
+
261
+
262
+ ### Synchronized Drag areas
263
+
264
+ Give multiple Drag areas in one section the same `sync` value (`true` uses the section's shared group). Each area needs its own name and each Cols palette needs a unique name. Synchronized areas use the same grid/mobileGrid/gap/maxCol and share one native Gutenberg block pool; existing first-area block names stay unchanged.
265
+
266
+ ```tsx
267
+ <Drag name="heading" sync="layout" grid={18} mobileGrid={1} gap={0}>
268
+ <Cols name="main" span={13}><Heading name="title" /></Cols>
269
+ </Drag>
270
+ <Drag name="footer" sync="layout" grid={18} mobileGrid={1} gap={0}>
271
+ <Cols name="action" span={5}><Buttons name="actions" /></Cols>
272
+ </Drag>
273
+ ```
274
+
275
+ A column's English aside `Area` control selects its default area or the area for the chosen screen range. Stored `syncArea` and `responsive[breakpoint].syncArea` route the whole column, including its elements. Each range is independent; removing a range's route restores the default. Normal Gutenberg operations still move child elements between columns in the common pool. Synchronization creates no copies of field data. Stable portal hosts move between areas while keeping mounted React state and focus. Guides and resize frames are shared across the areas of that section.
276
+
277
+ Enabling this on existing content requires a backed-up project migration: put the area's fields into its columns, assign stable `syncId` strings to columns, and set their default `syncArea` names. This is an explicit project data migration, never a library request-time rewrite. Sections using a single ordinary Drag keep their existing behavior. Default placement is available in Next SSR, with responsive portal routing enhanced in the browser. WordPress portable mode uses the existing browser island for synchronized areas; PHP does not execute the portal controller.
278
+
279
+ The editor's **Fit window** mode previews and edits the actual canvas breakpoint, including saved column and area overrides. A named device previews that independent screen range. **Default** in the column layout tabs explicitly edits the base layout on a wide canvas; returning to Fit window restores responsive preview. Column alignment and below-breakpoint full-row placement share the same stylesheet on React, PHP and Gutenberg.
280
+
281
+ ### Shared section reveal
282
+
283
+ `<Section motion>` enables the Kit reveal (32px rise and fade). Mark independent groups with `data-motion`; without markers the section is one reveal target. The editor, reduced-motion preference, missing browser support and initial viewport keep content visible. Added or replaced targets are observed without replaying revealed nodes, including stable portal moves. `data-motion-delay` or `--site-motion-delay` sets an optional delay in milliseconds. Hero entrances and continuous Marquee motion stay project-owned. New section scaffolds include `motion`; omit it or use `motion={false}` to disable. PHP sections and React use the same controller.
@@ -8,9 +8,9 @@ function frontend_origin(?string $configured = null, ?string $runtime_file = nul
8
8
  $local = ['127.0.0.1', 'localhost', '[::1]', '::1'];
9
9
  if (!in_array(parse_url($configured, PHP_URL_HOST), $local, true)) return $configured;
10
10
  $root = dirname(__DIR__, 3);
11
- $config_file = $root . '/kit.config.json';
11
+ $config_file = dirname($root) . '/theme.json';
12
12
  $config = is_readable($config_file) ? json_decode((string)file_get_contents($config_file), true) : [];
13
- $relative = $config['runtime']['file'] ?? 'build/next-server.json';
13
+ $relative = $config['kit']['runtime']['file'] ?? 'build/next-server.json';
14
14
  if ($runtime_file === null && (!is_string($relative) || str_starts_with($relative, '/') || in_array('..', explode('/', str_replace('\\', '/', $relative)), true))) return $configured;
15
15
  $file = $runtime_file ?? $root . '/' . $relative;
16
16
  $runtime = is_readable($file) ? json_decode((string)file_get_contents($file), true) : null;
@@ -6,7 +6,7 @@ Node is required locally for building only. Deploy the theme PHP, its existing e
6
6
 
7
7
  ## Migration
8
8
 
9
- Set `mode` to `next` or `wordpress` in the theme-root `render.config.json`. This is the sole renderer setting shared by PHP and the build scripts; there is no admin control or database option. `npm run dev` watches editor sources and starts Next in next mode, or rebuilds browser/PHP assets in wordpress mode. `npm run build` produces the selected target plus the editor. Restart dev after changing mode. In WordPress mode open the WordPress URL, not the Next port.
9
+ Set `mode` to `next` or `wordpress` in the theme-root `theme.json → kit.render`. This is the sole renderer setting shared by PHP and the build scripts; there is no admin control or database option. `npm run dev` watches editor sources and starts Next in next mode, or rebuilds browser/PHP assets in wordpress mode. `npm run build` produces the selected target plus the editor. Restart dev after changing mode. In WordPress mode open the WordPress URL, not the Next port.
10
10
 
11
11
  Legacy sections and the project header/footer still need migration: the PHP shell renders saved header/footer data through the legacy layout bridge, while new sections use the generated blueprint. Other legacy sections still require migration.
12
12
 
@@ -4,7 +4,7 @@ const marker = (name: string) => Object.assign((_props: any) => null, {kitName:
4
4
  export const Section = marker('Section'), Text = marker('Text'), Heading = marker('Heading'),
5
5
  Paragraphs = marker('Paragraphs'), Image = marker('Image'), Icon = marker('Icon'),
6
6
  Background = marker('Background'), Buttons = marker('Buttons'), SocialLinks = marker('SocialLinks'), Button = marker('Button'), Link = marker('Link'), List = marker('List'),
7
- PricingPlans = marker('PricingPlans'), ReviewsCarousel = marker('ReviewsCarousel'), Form = marker('Form'), Records = marker('Records'), Categories = marker('Categories'), RecordEdit = marker('RecordEdit'), RecordImage = marker('RecordImage'),
7
+ Form = marker('Form'), Records = marker('Records'), Categories = marker('Categories'), RecordEdit = marker('RecordEdit'), RecordImage = marker('RecordImage'),
8
8
  RecordDate = marker('RecordDate'), RecordTitle = marker('RecordTitle'), RecordExcerpt = marker('RecordExcerpt'), RecordLink = marker('RecordLink'),
9
9
  RecordIndex = marker('RecordIndex'), Drag = marker('Drag'), Cols = marker('Cols'), Toggle = marker('Toggle'),
10
10
  Choice = marker('Choice'), Show = marker('Show'), Area = marker('Area'), Gallery = marker('Gallery'),
@@ -23,6 +23,10 @@ function describe(node: ReactNode): any[] {
23
23
  // Stateful project components mount through the existing browser island.
24
24
  // Preserve declarative children as the PHP fallback, without serializing callback props.
25
25
  if (!type) return [{type: 'ClientComponent', props: {}, children: describe((child.props as any).children)}];
26
+ // A record render function needs the live collection and runs in the browser island.
27
+ if (type === 'Drag' && props.sync) return [{type:'ClientComponent',props:{},children:[]}];
28
+ if (type === 'Records' && typeof (sourceProps as any).children === 'function')
29
+ return [{type: 'ClientComponent', props: {}, children: []}];
26
30
  if (type === 'Categories' && props.tab !== undefined) props.tab = describe(props.tab);
27
31
  for (const [key, value] of Object.entries(props)) if (typeof value === 'function') throw new Error(`WordPress compiler: callback ${key} cannot be serialized`);
28
32
  return [{type, props, children: describe((sourceProps as any).children)}];
@@ -36,3 +40,10 @@ export function section(meta: any, View: () => ReactNode) {
36
40
  const isStatic = (nodes:any[]):boolean => nodes.every(node => (staticTypes.has(node.type) || /^[a-z]/.test(node.type)) && isStatic(node.children ?? []));
37
41
  return {name: 'site/' + meta.slug, title: meta.title, template, static: isStatic(template)};
38
42
  }
43
+
44
+ // Archive state is evaluated by the existing WordPress browser island, never during extraction.
45
+ export const Archive = marker('ClientComponent'), ArchiveFilters = marker('ClientComponent'),
46
+ ArchiveSortControl = marker('ClientComponent'), ArchiveSearch = marker('ClientComponent'),
47
+ ArchiveStatus = marker('ClientComponent'), ArchiveResults = marker('ClientComponent'),
48
+ ArchiveReset = marker('ClientComponent'), ArchivePagination = marker('ClientComponent');
49
+ export const useArchive = (): any => { throw new Error('Archive state is only available inside its runtime provider.'); };
@@ -11,6 +11,13 @@ function manifest(): array {
11
11
  }
12
12
  function definition(string $name): ?array {foreach(manifest()['sections'] as $section)if($section['name']===$name)return $section;return null;}
13
13
  function classes(array $props): string {return trim(($props['className']??'').' '.($props['frontClassName']??''));}
14
+ function appearance_color($value): ?string {
15
+ if(!is_string($value))return null;
16
+ if(preg_match('/^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/iD',$value))return $value;
17
+ if(preg_match('/^[a-z][a-z0-9-]*$/D',$value))return 'var(--wp--preset--color--'.$value.')';
18
+ if(preg_match('/^var\(--wp--preset--color--[a-z][a-z0-9-]*\)$/D',$value))return $value;
19
+ return null;
20
+ }
14
21
  function attrs(array $attributes): string {
15
22
  $out='';foreach($attributes as $key=>$value){if($value===null||$value===false||str_starts_with($key,'on'))continue;$out.=' '.esc_attr($key).'="'.esc_attr($value===true?'':(string)$value).'"';}return $out;
16
23
  }
@@ -58,11 +65,17 @@ function background_poster(string $url): string {
58
65
  $id=attachment_url_to_postid($url);
59
66
  return $id?(wp_get_attachment_image_url($id,'large')?:$url):$url;
60
67
  }
68
+ function button_width_style($value): ?string {
69
+ if((!is_string($value)&&!is_int($value)&&!is_float($value))||!is_numeric($value))return null;
70
+ $width=(float)$value;if(!is_finite($width)||$width<=0||$width>100)return null;
71
+ $size='calc('.$width.'% - (1 - '.($width/100).') * var(--site-button-width-gap, 0px))';
72
+ return 'width:'.$size.';flex-basis:'.$size.';flex-grow:0;flex-shrink:0;max-width:100%';
73
+ }
61
74
  function button(array $value,?string $fallback=null,array $site=[],string $extra_class='',bool $unstyled=false): string {
62
75
  if(empty($value['text']))return '';
63
76
  $url=$value['url']??'#';$id=(int)($value['modalId']??0);
64
77
  if($id)foreach($site['modals']??[] as $modal)if($modal['id']===$id)$url='#modal-'.($modal['slug']??$id);
65
- if(!empty($value['linkId']))$url=get_permalink((int)$value['linkId'])?:$url;
78
+ if(!empty($value['linkId'])){$url=\SiteTheme\public_record_url((int)$value['linkId']);if(!$url)return '';}
66
79
  $style=$value['style']??$fallback;
67
80
  $class=$unstyled?'site-link':match($style){'text'=>'site-text-link eyebrow !text-foreground transition-colors hover:!text-flame','accent'=>'btn-primary !bg-flame !text-flame-foreground hover:!opacity-90','outline'=>'btn-ghost','light-outline'=>'btn-ghost !border-background/40 hover:!bg-background hover:!text-foreground',default=>'btn-primary'};
68
81
  $label=wp_kses_post($value['text']);$metadata=$value['metadata']??[];
@@ -70,7 +83,7 @@ function button(array $value,?string $fallback=null,array $site=[],string $extra
70
83
  $mask='url("data:image/svg+xml,'.rawurlencode($icon['svg']).'")';
71
84
  $label=tag('span',['class'=>'site-button-label site-button-icon-'.(($metadata['siteButtonIconPosition']??'')==='before'?'before':'after'),'style'=>'--site-button-icon:'.$mask],$label);break;
72
85
  }
73
- return tag('a',['href'=>esc_url($url),'class'=>trim($class.' '.$extra_class),'data-modal-plan'=>$value['plan']??null,'target'=>$value['linkTarget']??null,'rel'=>$value['rel']??null],$label);
86
+ return tag('a',['href'=>esc_url($url),'style'=>$unstyled?null:button_width_style($value['width']??null),'class'=>trim($class.' '.$extra_class),'data-modal-plan'=>$value['plan']??null,'target'=>$value['linkTarget']??null,'rel'=>$value['rel']??null],$label);
74
87
  }
75
88
  function social_links(array $links, string $class = '', string $style = 'text'): string {
76
89
  $labels = ['instagram'=>'Instagram', 'facebook'=>'Facebook', 'telegram'=>'Telegram', 'youtube'=>'YouTube', 'tiktok'=>'TikTok', 'linkedin'=>'LinkedIn'];
@@ -208,19 +221,25 @@ function node(array $node,array $context): string {
208
221
  if(!array_key_exists('icon',$settings))$icon='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="m6 9 6 6 6-6"></path></svg>';
209
222
  elseif($settings['icon'])$icon=node(['type'=>'Icon','props'=>['name'=>'indicator']],array_replace($context,['data'=>['indicator'=>$settings['icon']]]));
210
223
  return tag('summary',['class'=>$class],nodes($children,$context).($icon?tag('span',['data-disclosure-icon'=>true],$icon):''));
211
- case 'Section':if(!empty($p['when'])&&empty($data[$p['when']]))return '';return tag('section',['id'=>$data['sectionId']??null,'class'=>$class,'data-site-section'=>$p['data-site-section']??null],nodes($children,$context));
212
- case 'Text':return tag('p',['class'=>$class],wp_kses_post((string)($value??'')));
224
+ case 'Section':if(!empty($p['when'])&&empty($data[$p['when']]))return '';return tag('section',['id'=>$data['sectionId']??null,'class'=>$class,'data-site-section'=>$p['data-site-section']??null,'data-section-motion'=>!empty($p['motion'])?'reveal':null],nodes($children,$context));
225
+ case 'Text':
226
+ $settings=$data['__textStyles'][$p['name']??'']??[];$color=appearance_color($settings['color']??null);$style=$color?'color:'.$color:null;
227
+ $decoration=in_array($settings['decoration']??null,['none','line'],true)?$settings['decoration']:($p['decoration']??'none');
228
+ $text=tag('p',['class'=>$decoration==='line'?'min-w-0':$class,'style'=>$style],inline_rich_text((string)($value??''),$site));
229
+ if($decoration!=='line')return $text;
230
+ $line=appearance_color($settings['decorationColor']??null)??appearance_color($p['decorationColor']??null);
231
+ return tag('div',['class'=>trim('site-text-decoration flex items-start gap-4 '.$class),'style'=>$style],tag('span',['aria-hidden'=>'true','class'=>'mt-[.8em] h-px w-12 shrink-0 bg-current','style'=>$line?'background-color:'.$line:null],'').$text);
213
232
  case 'Heading':
214
233
  $valid_tag=static fn($v)=>is_string($v)&&preg_match('/^(?:h[1-6]|p|span)$/D',$v);$valid_style=static fn($v)=>is_string($v)&&preg_match('/^h[1-6]$/D',$v);$settings=$data['__headings'][$p['name']??'']??[];
215
234
  $fallback=$valid_tag($p['tag']??null)?$p['tag']:($valid_style('h'.($p['level']??2))?'h'.($p['level']??2):'h2');
216
235
  $heading_tag=$valid_tag($settings['tag']??null)?$settings['tag']:$fallback;
217
236
  $heading_style=$valid_style($settings['textStyle']??null)?$settings['textStyle']:($valid_style($p['textStyle']??null)?$p['textStyle']:'');
218
- return tag($heading_tag,['class'=>trim($heading_style.' '.$class)],wp_kses_post((string)($value??'')));
237
+ return tag($heading_tag,['class'=>trim($heading_style.' '.$class),'style'=>($color=appearance_color($data['__textStyles'][$p['name']??'']['color']??null))?'color:'.$color:null],inline_rich_text((string)($value??''),$site));
219
238
  case 'Paragraphs':return tag('div',['class'=>'site-paragraph-flow '.$class],implode('',array_map(fn($v,$i)=>tag('div',['class'=>trim('site-description-row '.(is_array($v)&&($v['style']??'')==='accent-line'?'is-style-studio-accent-line ':'').($i?($p['paragraphClassName']??''):''))],tag('p',[],wp_kses_post(is_array($v)?($v['text']??''):$v))),is_array($value)?$value:[],array_keys(is_array($value)?$value:[]))));
220
239
  case 'Image':return image($value,$class);
221
240
  case 'Icon':
222
241
  if(!$value)return '';$name=is_string($value)?$value:($value['type']??'');
223
- foreach($site['icons']??[] as $icon){if(($icon['value']??'')===$name){$mask='url("data:image/svg+xml,'.rawurlencode($icon['svg']).'")';return tag('span',['class'=>trim('inline-flex shrink-0 leading-none text-flame '.$class),'aria-hidden'=>'true'],tag('span',['style'=>'display:inline-block;width:.9em;height:.9em;background-color:currentColor;mask:'.$mask.' center/contain no-repeat;-webkit-mask:'.$mask.' center/contain no-repeat']));}}return '';
242
+ foreach($site['icons']??[] as $icon){if(($icon['value']??'')===$name){$mask='url("data:image/svg+xml,'.rawurlencode($icon['svg']).'")';return tag('span',['class'=>trim('inline-flex shrink-0 leading-none text-flame '.$class),'aria-hidden'=>'true','style'=>($color=appearance_color($data['__iconColors'][$p['name']??'']??null))?'color:'.$color:null],tag('span',['style'=>'display:inline-block;width:.9em;height:.9em;background-color:currentColor;mask:'.$mask.' center/contain no-repeat;-webkit-mask:'.$mask.' center/contain no-repeat']));}}return '';
224
243
  case 'Choice':case 'RecordEdit':return '';
225
244
  case 'Toggle':return ($value??($p['default']??false))?classed_content($class,nodes($children,$context)):'';
226
245
  case 'Show':
@@ -252,10 +271,8 @@ function node(array $node,array $context): string {
252
271
  case 'RecordContent':$blocks=$record[$p['field']??'']??[];return is_array($blocks)&&$blocks?classed_content($class,native_blocks($blocks,$context)):'';
253
272
  case 'RecordText':$text=$record[$p['field']??'']??'';return $text?tag(in_array($p['as']??'p',['p','span','div','blockquote'],true)?($p['as']??'p'):'p',['class'=>$class],wp_kses_post((string)$text)):'';
254
273
  case 'Gallery':$html='';foreach(is_array($value)?$value:[] as $row)$html.=image($row,'w-full h-full object-cover');return tag('div',['class'=>$class],$html);
255
- case 'PricingPlans':return pricing_plans(is_array($value)?$value:null,$site,$class);
256
274
  // The form is interactive and mounts in the browser.
257
275
  case 'Form':return tag('div',['class'=>$class],'');
258
- case 'ReviewsCarousel':return reviews_carousel(is_array($value)?$value:null,$site,$class);
259
276
  case 'Categories':case 'Records':
260
277
  $rows=relationship_rows($value,$p,$site,$data,$context['category']??null,$type==='Categories');
261
278
  if($type==='Categories'&&($p['mode']??'list')==='tabs'){
@@ -306,3 +323,5 @@ function node(array $node,array $context): string {
306
323
  default:throw new \RuntimeException('Unsupported kit node: '.$type);
307
324
  }
308
325
  }
326
+
327
+ function inline_rich_text(string $html,array $site):string { $html=wp_kses_post($html);return function_exists('SpIcons\\inline_icons')?\SpIcons\inline_icons($html,$site['icons']??null):$html; }
@@ -1,3 +1,4 @@
1
+ import {mountSectionMotion} from '../../core/ui/section-motion.js';
1
2
  import {enhanceStaticMedia} from './static-media.js';
2
3
  import {Component, useEffect, useLayoutEffect, useState, type ReactNode} from 'react';
3
4
  import {createRoot} from 'react-dom/client';
@@ -42,7 +43,7 @@ class FallbackBoundary extends Component<{ children: ReactNode }, { failed: bool
42
43
  }
43
44
 
44
45
  /** Keep the already functional PHP header until a visitor interacts with navigation. */
45
- function InteractiveHeader({target,site}:{target:HTMLElement;site:any}) {
46
+ function InteractiveHeader({target,site,record}:{target:HTMLElement;site:any;record:any}) {
46
47
  const [active,setActive]=useState(false);
47
48
  useEffect(()=>{
48
49
  const enable=()=>{
@@ -58,18 +59,23 @@ function InteractiveHeader({target,site}:{target:HTMLElement;site:any}) {
58
59
  target.addEventListener('keyup',click,{once:true});
59
60
  return ()=>{target.removeEventListener('click',click);target.removeEventListener('pointerover',hover);target.removeEventListener('keyup',click);};
60
61
  },[target,site]);
61
- return active?<Island target={target}><BlockList blocks={site.header} site={site}/></Island>:null;
62
+ return active?<Island target={target}><BlockList blocks={site.header} site={site} record={record}/></Island>:null;
62
63
  }
63
64
 
64
65
  /** PHP owns crawlable HTML; browser React provides shared interactions. */
65
66
  const payload = document.getElementById('site-wordpress-data');
66
67
  if (payload) {
67
- const {site, instances} = JSON.parse(payload.textContent ?? '{}');
68
+ const {site, instances, record} = JSON.parse(payload.textContent ?? '{}');
68
69
  site.runtime.retainedHeaderLogo = document.querySelector('#site-header-root header img');
69
70
  const root = document.createElement('div');
70
71
  root.id = 'site-wordpress-runtime';
71
72
  document.body.append(root);
72
73
  enhanceStaticMedia();
74
+ // React islands own their Section effects; enhance only HTML retained from PHP.
75
+ for (const instance of instances) {
76
+ if (!instance.static) continue;
77
+ document.getElementById(instance.id)?.querySelectorAll<HTMLElement>('section[data-section-motion="reveal"]').forEach(section => mountSectionMotion(section));
78
+ }
73
79
  const islands = instances.flatMap((instance: any) => {
74
80
  if (instance.static) return [];
75
81
  const target = document.getElementById(instance.id);
@@ -78,19 +84,19 @@ if (payload) {
78
84
  const View = definition.View;
79
85
  return [<FallbackBoundary key={instance.id}><Island target={target}>
80
86
  <ContentProvider data={mediaValues(instance.block.attrs.data ?? {}, site.media)}
81
- innerBlocks={instance.block.innerBlocks ?? []} site={site}><View
87
+ innerBlocks={instance.block.innerBlocks ?? []} site={site} record={record}><View
82
88
  data={mediaValues(instance.block.attrs.data ?? {}, site.media)}
83
- blocks={instance.block.innerBlocks ?? []} site={site}/></ContentProvider>
89
+ blocks={instance.block.innerBlocks ?? []} site={site} record={record}/></ContentProvider>
84
90
  </Island></FallbackBoundary>];
85
91
  });
86
92
  for (const part of ['header', 'footer'] as const) {
87
93
  const target = document.getElementById(`site-${part}-root`);
88
94
  if (target && site[part]?.length) islands.push(
89
- <FallbackBoundary key={part}>{part==='header'?<InteractiveHeader target={target} site={site}/>:<Island target={target}><BlockList blocks={site[part]}
90
- site={site}/></Island>}</FallbackBoundary>
95
+ <FallbackBoundary key={part}>{part==='header'?<InteractiveHeader target={target} site={site} record={record}/>:<Island target={target}><BlockList blocks={site[part]}
96
+ site={site} record={record}/></Island>}</FallbackBoundary>
91
97
  );
92
98
  }
93
- createRoot(root).render(<SiteShell site={site} chrome={false}>{islands}</SiteShell>);
99
+ createRoot(root).render(<SiteShell site={site} record={record} chrome={false}>{islands}</SiteShell>);
94
100
  }
95
101
 
96
102
  }
@@ -8,7 +8,7 @@ export function enhanceControls(root) {
8
8
  const withMinutes = isTime && Number(source.step) !== 3600;
9
9
  const wrap = document.createElement('div'); wrap.className = 'sp-ui-select';
10
10
  const trigger = document.createElement('button'); trigger.type = 'button'; trigger.className = 'sp-ui-select-trigger';
11
- const label = source.closest('label')?.querySelector('span')?.textContent || source.getAttribute('aria-label') || 'Выбор значения';
11
+ const label = source.closest('label')?.querySelector('span')?.textContent || source.getAttribute('aria-label') || 'Select a value';
12
12
  const list = document.createElement('div'); list.className = 'sp-ui-select-options'; list.setAttribute('popover','auto'); list.setAttribute('role','listbox'); list.setAttribute('aria-label',label);
13
13
  list.id = `site-control-${++enhanceControls.counter}`;
14
14
  trigger.setAttribute('aria-haspopup','listbox'); trigger.setAttribute('aria-expanded','false'); trigger.setAttribute('aria-controls',list.id);
@@ -16,10 +16,10 @@ export function enhanceControls(root) {
16
16
  let editor;
17
17
  if (isTime) {
18
18
  // Preserve typed HH:MM input; minute-enabled fields also expose separate hour/minute columns.
19
- source.type = 'text'; source.inputMode = 'numeric'; source.placeholder = 'ЧЧ:ММ'; source.maxLength = 5;
19
+ source.type = 'text'; source.inputMode = 'numeric'; source.placeholder = 'HH:MM'; source.maxLength = 5;
20
20
  source.pattern = Number(source.step) === 3600 ? '(?:[01][0-9]|2[0-3]):00' : '(?:[01][0-9]|2[0-3]):[0-5][0-9]';
21
21
  wrap.classList.add('sp-ui-time'); editor = source;
22
- trigger.setAttribute('aria-label',`${label}: выбрать время`);
22
+ trigger.setAttribute('aria-label',`${label}: choose time`);
23
23
  } else {
24
24
  source.hidden = true;
25
25
  // The trigger receives the original label association, while the named select submits data.
@@ -29,7 +29,7 @@ export function enhanceControls(root) {
29
29
  const values = () => isTime ? Array.from({length:24},(_,hour)=>({value:`${String(hour).padStart(2,'0')}:00`,label:`${String(hour).padStart(2,'0')}:00`,disabled:false})) : Array.from(source.options,option=>({value:option.value,label:option.text,disabled:option.disabled}));
30
30
  const place = trackPopover(list,wrap,withMinutes?280:null,withMinutes?340:(isTime?300:260));
31
31
  const sync = () => {
32
- if (!isTime) trigger.textContent = source.selectedOptions[0]?.text || 'Выберите';
32
+ if (!isTime) trigger.textContent = source.selectedOptions[0]?.text || 'Select';
33
33
  else trigger.textContent = '◷';
34
34
  trigger.disabled = source.disabled;
35
35
  list.querySelectorAll('[role=option]').forEach(option=>{
@@ -44,7 +44,7 @@ export function enhanceControls(root) {
44
44
  if (withMinutes) {
45
45
  list.classList.add('sp-ui-time-options');list.setAttribute('role','dialog');
46
46
  const columns=document.createElement('div');columns.className='sp-ui-time-columns';
47
- [['hours','Часы',24],['minutes','Минуты',60]].forEach(([part,title,count])=>{
47
+ [['hours','Hours',24],['minutes','Minutes',60]].forEach(([part,title,count])=>{
48
48
  const column=document.createElement('div');column.className='sp-ui-time-column';
49
49
  const heading=document.createElement('span');heading.textContent=title;column.append(heading);
50
50
  const options=document.createElement('div');options.setAttribute('role','listbox');options.setAttribute('aria-label',title);
@@ -54,7 +54,7 @@ export function enhanceControls(root) {
54
54
  }
55
55
  column.append(options);columns.append(column);
56
56
  });
57
- const done=document.createElement('button');done.type='button';done.className='sp-ui-time-done';done.textContent='Готово';done.addEventListener('click',()=>{close();source.focus();});
57
+ const done=document.createElement('button');done.type='button';done.className='sp-ui-time-done';done.textContent='Done';done.addEventListener('click',()=>{close();source.focus();});
58
58
  list.append(columns,done);sync();
59
59
  } else values().forEach(value=>{
60
60
  const option=document.createElement('button'); option.type='button'; option.setAttribute('role','option'); option.tabIndex=-1; option.textContent=value.label; option.dataset.value=value.value; option.disabled=value.disabled;
@@ -65,7 +65,7 @@ export function enhanceControls(root) {
65
65
  if(isTime && !withMinutes) {
66
66
  const options=document.createElement('div');options.className='sp-ui-hour-values';options.setAttribute('role','listbox');options.setAttribute('aria-label',label);
67
67
  options.append(...list.childNodes);list.append(options);list.setAttribute('role','dialog');list.classList.add('sp-ui-hour-options');
68
- const done=document.createElement('button');done.type='button';done.className='sp-ui-time-done';done.textContent='Готово';done.addEventListener('click',()=>{close();source.focus();});list.append(done);sync();
68
+ const done=document.createElement('button');done.type='button';done.className='sp-ui-time-done';done.textContent='Done';done.addEventListener('click',()=>{close();source.focus();});list.append(done);sync();
69
69
  }
70
70
  place();
71
71
  list.showPopover();
@@ -99,7 +99,7 @@ enhanceControls.counter = 0;
99
99
 
100
100
  function enhanceDate(source) {
101
101
  source.dataset.spEnhanced='true';
102
- const label=source.closest('label')?.querySelector('span')?.textContent || 'Дата';
102
+ const label=source.closest('label')?.querySelector('span')?.textContent || 'Date';
103
103
  const required=source.required;
104
104
  const wrap=document.createElement('div');wrap.className='sp-ui-select sp-ui-date';
105
105
  const trigger=document.createElement('button');trigger.type='button';trigger.className='sp-ui-select-trigger';trigger.setAttribute('aria-haspopup','dialog');trigger.setAttribute('aria-expanded','false');trigger.setAttribute('aria-label',label);
@@ -112,7 +112,7 @@ function enhanceDate(source) {
112
112
  const parse=value=>{const [y,m,d]=value.split('-').map(Number);return new Date(Date.UTC(y,m-1,d));};
113
113
  const iso=date=>date.toISOString().slice(0,10);
114
114
  let visible=parse(source.value || todayIso);
115
- const sync=()=>{trigger.textContent=source.value?source.value.split('-').reverse().join('.'):'Выберите дату';trigger.disabled=source.disabled;};
115
+ const sync=()=>{trigger.textContent=source.value?source.value.split('-').reverse().join('.'):'Select date';trigger.disabled=source.disabled;};
116
116
  const place=trackPopover(popup,wrap,304,380);
117
117
  const close=()=>{if(popup.matches(':popover-open'))popup.hidePopover();};
118
118
  const choose=value=>{source.value=value;source.dispatchEvent(new Event('input',{bubbles:true}));source.dispatchEvent(new Event('change',{bubbles:true}));close();trigger.focus();};
@@ -120,15 +120,15 @@ function enhanceDate(source) {
120
120
  const render=(focusDate=null)=>{
121
121
  popup.replaceChildren();
122
122
  const header=document.createElement('div');header.className='sp-ui-date-header';
123
- const title=document.createElement('strong');title.textContent=new Intl.DateTimeFormat('ru',{month:'long',year:'numeric',timeZone:'UTC'}).format(visible);title.setAttribute('aria-live','polite');
123
+ const title=document.createElement('strong');title.textContent=new Intl.DateTimeFormat('en-GB',{month:'long',year:'numeric',timeZone:'UTC'}).format(visible);title.setAttribute('aria-live','polite');
124
124
  const changeMonth=delta=>{visible=new Date(Date.UTC(visible.getUTCFullYear(),visible.getUTCMonth()+delta,1));render(true);};
125
- header.append(button('Предыдущий месяц','‹',()=>changeMonth(-1)),title,button('Следующий месяц','›',()=>changeMonth(1)));popup.append(header);
126
- const weekdays=document.createElement('div');weekdays.className='sp-ui-date-grid sp-ui-date-weekdays';['Пн','Вт','Ср','Чт','Пт','Сб','Вс'].forEach(day=>{const el=document.createElement('span');el.textContent=day;weekdays.append(el);});popup.append(weekdays);
127
- const grid=document.createElement('div');grid.className='sp-ui-date-grid';grid.setAttribute('role','group');grid.setAttribute('aria-label','Дни месяца');
125
+ header.append(button('Previous month','‹',()=>changeMonth(-1)),title,button('Next month','›',()=>changeMonth(1)));popup.append(header);
126
+ const weekdays=document.createElement('div');weekdays.className='sp-ui-date-grid sp-ui-date-weekdays';['Mon','Tue','Wed','Thu','Fri','Sat','Sun'].forEach(day=>{const el=document.createElement('span');el.textContent=day;weekdays.append(el);});popup.append(weekdays);
127
+ const grid=document.createElement('div');grid.className='sp-ui-date-grid';grid.setAttribute('role','group');grid.setAttribute('aria-label','Days of the month');
128
128
  const first=new Date(Date.UTC(visible.getUTCFullYear(),visible.getUTCMonth(),1));const offset=(first.getUTCDay()+6)%7;
129
129
  for(let i=0;i<42;i++) {
130
130
  const date=new Date(first);date.setUTCDate(1-offset+i);const value=iso(date);
131
- const day=button(new Intl.DateTimeFormat('ru',{day:'numeric',month:'long',year:'numeric',timeZone:'UTC'}).format(date),String(date.getUTCDate()),()=>choose(value));day.dataset.date=value;
131
+ const day=button(new Intl.DateTimeFormat('en-GB',{day:'numeric',month:'long',year:'numeric',timeZone:'UTC'}).format(date),String(date.getUTCDate()),()=>choose(value));day.dataset.date=value;
132
132
  if(date.getUTCMonth()!==visible.getUTCMonth())day.classList.add('sp-ui-date-outside');
133
133
  if(value===source.value){day.classList.add('is-selected');day.setAttribute('aria-pressed','true');}
134
134
  if(value===todayIso)day.setAttribute('aria-current','date');
@@ -141,7 +141,7 @@ function enhanceDate(source) {
141
141
  });grid.append(day);
142
142
  }
143
143
  popup.append(grid);
144
- const footer=document.createElement('div');footer.className='sp-ui-date-footer';footer.append(button('Выбрать сегодня','Сегодня',()=>choose(todayIso)));if(!required)footer.append(button('Очистить дату','Очистить',()=>choose('')));popup.append(footer);
144
+ const footer=document.createElement('div');footer.className='sp-ui-date-footer';footer.append(button('Select today','Today',()=>choose(todayIso)));if(!required)footer.append(button('Clear date','Clear',()=>choose('')));popup.append(footer);
145
145
  const focused=focusDate===true?iso(first):(focusDate || source.value || todayIso);
146
146
  const target=Array.from(grid.querySelectorAll('button')).find(el=>el.dataset.date===focused && !el.disabled) || grid.querySelector('button:not(:disabled)');
147
147
  if(target){target.tabIndex=0;if(popup.matches(':popover-open'))target.focus({preventScroll:true});}
@@ -297,10 +297,9 @@
297
297
  /* Small contextual controls keep their own compact scale. */
298
298
  .sp-media-control {
299
299
  --sp-media-border: var(--sp-ui-border);
300
- border-radius: var(--sp-ui-radius);
301
300
  color: var(--sp-ui-ink);
302
- background: var(--sp-ui-surface);
303
- box-shadow: var(--sp-ui-shadow);
301
+ background: transparent;
302
+ box-shadow: none;
304
303
  }
305
304
  .sp-media-control .sp-media-tabs {
306
305
  background: #f0f0f0;
@@ -614,7 +613,8 @@
614
613
  font: 500 11px/1.4 system-ui, sans-serif;
615
614
  color: #1e1e1e;
616
615
  }
617
- .site-field-rich-control > span {
616
+ .site-field-rich-control > span,
617
+ .site-field-control-heading > span {
618
618
  text-transform: uppercase;
619
619
  }
620
620
  .site-field-rich-control > .block-editor-rich-text__editable {
@@ -787,3 +787,20 @@
787
787
  .site-collection-add:only-child{min-height:max(80px,var(--site-collection-add-height,0px));}
788
788
  .site-collection-add>.site-record-add-shape{pointer-events:none;overflow:hidden;}
789
789
  .site-collection-add>.site-record-add-shape>*{max-width:100%;}
790
+
791
+ /* Archive inspector lives outside the canvas: keep its spacing in the editor stylesheet. */
792
+ .site-archive-settings .site-collection-display-title{margin-top:0}
793
+ .site-archive-settings .site-list-display-settings{margin-bottom:20px}
794
+ .site-archive-filter-settings{display:grid;gap:20px;margin-bottom:20px}
795
+ .site-archive-filter-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
796
+ .site-archive-filter-heading .components-base-control{margin-bottom:0}
797
+ .site-archive-filter-options{display:grid;gap:16px;padding-top:16px}
798
+ .site-archive-filter-options>.components-base-control{margin:0}
799
+ .site-archive-record-actions{display:flex;flex-shrink:0;align-items:center}
800
+ .site-archive-record-actions .components-button{padding:6px;height:30px;min-width:30px}
801
+ .site-archive-text-settings{display:grid;gap:20px}
802
+ .site-archive-text-settings>.components-base-control{margin:0}
803
+ .site-archive-settings .site-relationship{margin-top:20px}
804
+
805
+ .site-archive-settings .site-select-control { margin-bottom:20px; }
806
+ .site-archive-filter-options > .site-select-control { margin:0; }
@@ -16,6 +16,7 @@ const breakpoints = (Object.entries(BREAKPOINTS) as [string, number][]).filter((
16
16
  export const editorBreakpoints = breakpoints.map(([name]) => name);
17
17
  let selected: string | null = null;
18
18
  let canvasWidth = 0;
19
+ let defaultLayout = false;
19
20
  const listeners = new Set<() => void>();
20
21
  const emit = () => listeners.forEach(listener => listener());
21
22
  const subscribe = (listener: () => void) => { listeners.add(listener); return () => { listeners.delete(listener); }; };
@@ -25,6 +26,19 @@ export function useViewport() {
25
26
  return useSyncExternalStore(subscribe, () => selected, () => null);
26
27
  }
27
28
 
29
+ /** Explicit base-layout editing is separate from the responsive fit-window preview. */
30
+ export function useDefaultLayout() {
31
+ return useSyncExternalStore(subscribe, () => defaultLayout, () => false);
32
+ }
33
+ export function setDefaultLayout() {
34
+ preserveViewportAnchor();
35
+ selected = null;
36
+ defaultLayout = true;
37
+ if (wp.data.select('core/editor').getDeviceType() !== 'Desktop') wp.data.dispatch('core/editor').setDeviceType('Desktop');
38
+ syncCanvas();
39
+ emit();
40
+ }
41
+
28
42
  /** Width of the editor canvas document, which is what the site's media queries see. */
29
43
  export function useCanvasWidth() {
30
44
  return useSyncExternalStore(subscribe, () => canvasWidth, () => 0);
@@ -70,7 +84,7 @@ function canvasBox() {
70
84
  }
71
85
  function syncCanvas() {
72
86
  let style = document.getElementById('site-viewport-zoom');
73
- const width = selected ? BREAKPOINTS[selected as keyof typeof BREAKPOINTS] : 0;
87
+ const width = defaultLayout ? breakpoints.at(-1)?.[1] ?? 0 : selected ? BREAKPOINTS[selected as keyof typeof BREAKPOINTS] : 0;
74
88
  const container = canvasBox()?.parentElement;
75
89
  if (!width || !container) return style?.remove();
76
90
  const view = getComputedStyle(container);
@@ -146,6 +160,7 @@ export function setViewport(name: string | null) {
146
160
  if (name && !(name in BREAKPOINTS)) return;
147
161
  preserveViewportAnchor();
148
162
  selected = name;
163
+ defaultLayout = false;
149
164
  // Gutenberg's own device preview would size the canvas again.
150
165
  if (name && wp.data.select('core/editor').getDeviceType() !== 'Desktop') wp.data.dispatch('core/editor').setDeviceType('Desktop');
151
166
  syncCanvas();
@@ -154,6 +169,7 @@ export function setViewport(name: string | null) {
154
169
 
155
170
  function ViewportBar() {
156
171
  const current = useViewport();
172
+ const baseLayout = useDefaultLayout();
157
173
  const [host, setHost] = useState<HTMLElement | null>(null);
158
174
  useEffect(() => {
159
175
  const attach = () => {
@@ -194,8 +210,9 @@ function ViewportBar() {
194
210
  if (container) resize.observe(container);
195
211
  // A device picked in Gutenberg's own menu replaces the breakpoint.
196
212
  const unsubscribe = wp.data.subscribe(() => {
197
- if (selected && wp.data.select('core/editor').getDeviceType() !== 'Desktop') {
213
+ if ((selected || defaultLayout) && wp.data.select('core/editor').getDeviceType() !== 'Desktop') {
198
214
  selected = null;
215
+ defaultLayout = false;
199
216
  syncCanvas();
200
217
  emit();
201
218
  }
@@ -206,6 +223,7 @@ function ViewportBar() {
206
223
  const { Button } = wp.components;
207
224
  return createPortal(
208
225
  <div className="site-viewport-bar" role="group" aria-label="Site breakpoints">
226
+ <Button size="compact" icon={<BreakpointIcon value={1360} />} label="Fit window" showTooltip isPressed={!current && !baseLayout} onClick={() => setViewport(null)} />
209
227
  {breakpoints.map(([name, width]) => (
210
228
  <Button key={name} size="compact" icon={<BreakpointIcon value={width} />} label={`${breakpointLabel(name)} · ${breakpointRange(name)}${current === name ? ' · click again to fit the window' : ''}`} showTooltip isPressed={current === name} onClick={() => setViewport(current === name ? null : name)} />
211
229
  ))}