@kywi-software/core 0.14.0 → 0.15.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 (478) hide show
  1. package/AGENT-PATTERNS.md +153 -17
  2. package/README.md +38 -12
  3. package/dist/admin/chrome.d.ts.map +1 -1
  4. package/dist/admin/chrome.js +6 -7
  5. package/dist/admin/chrome.js.map +1 -1
  6. package/dist/admin/field-components.d.ts.map +1 -1
  7. package/dist/admin/field-components.js +27 -1
  8. package/dist/admin/field-components.js.map +1 -1
  9. package/dist/admin/form-helpers.d.ts.map +1 -1
  10. package/dist/admin/form-helpers.js +6 -1
  11. package/dist/admin/form-helpers.js.map +1 -1
  12. package/dist/admin/layout-editor/chrome-env.d.ts +35 -0
  13. package/dist/admin/layout-editor/chrome-env.d.ts.map +1 -0
  14. package/dist/admin/layout-editor/chrome-env.js +13 -0
  15. package/dist/admin/layout-editor/chrome-env.js.map +1 -0
  16. package/dist/admin/layout-editor/component-actions.d.ts +58 -7
  17. package/dist/admin/layout-editor/component-actions.d.ts.map +1 -1
  18. package/dist/admin/layout-editor/component-actions.js +131 -5
  19. package/dist/admin/layout-editor/component-actions.js.map +1 -1
  20. package/dist/admin/layout-editor/component-fork.d.ts +4 -4
  21. package/dist/admin/layout-editor/component-fork.d.ts.map +1 -1
  22. package/dist/admin/layout-editor/component-fork.js +76 -10
  23. package/dist/admin/layout-editor/component-fork.js.map +1 -1
  24. package/dist/admin/layout-editor/component-picker-field.d.ts +17 -3
  25. package/dist/admin/layout-editor/component-picker-field.d.ts.map +1 -1
  26. package/dist/admin/layout-editor/component-picker-field.js +5 -2
  27. package/dist/admin/layout-editor/component-picker-field.js.map +1 -1
  28. package/dist/admin/layout-editor/drag-feedback.d.ts +25 -1
  29. package/dist/admin/layout-editor/drag-feedback.d.ts.map +1 -1
  30. package/dist/admin/layout-editor/drag-feedback.js +9 -0
  31. package/dist/admin/layout-editor/drag-feedback.js.map +1 -1
  32. package/dist/admin/layout-editor/drag-utils.d.ts +103 -5
  33. package/dist/admin/layout-editor/drag-utils.d.ts.map +1 -1
  34. package/dist/admin/layout-editor/drag-utils.js +131 -4
  35. package/dist/admin/layout-editor/drag-utils.js.map +1 -1
  36. package/dist/admin/layout-editor/editor-canvas.d.ts +11 -0
  37. package/dist/admin/layout-editor/editor-canvas.d.ts.map +1 -1
  38. package/dist/admin/layout-editor/editor-canvas.js +134 -20
  39. package/dist/admin/layout-editor/editor-canvas.js.map +1 -1
  40. package/dist/admin/layout-editor/editor-dialog.d.ts +58 -3
  41. package/dist/admin/layout-editor/editor-dialog.d.ts.map +1 -1
  42. package/dist/admin/layout-editor/editor-dialog.js +71 -9
  43. package/dist/admin/layout-editor/editor-dialog.js.map +1 -1
  44. package/dist/admin/layout-editor/editor-state.d.ts +119 -0
  45. package/dist/admin/layout-editor/editor-state.d.ts.map +1 -1
  46. package/dist/admin/layout-editor/editor-state.js +188 -6
  47. package/dist/admin/layout-editor/editor-state.js.map +1 -1
  48. package/dist/admin/layout-editor/editor-toolbar.d.ts +10 -1
  49. package/dist/admin/layout-editor/editor-toolbar.d.ts.map +1 -1
  50. package/dist/admin/layout-editor/editor-toolbar.js +2 -2
  51. package/dist/admin/layout-editor/editor-toolbar.js.map +1 -1
  52. package/dist/admin/layout-editor/editor.css +216 -8
  53. package/dist/admin/layout-editor/inline-text.d.ts +15 -1
  54. package/dist/admin/layout-editor/inline-text.d.ts.map +1 -1
  55. package/dist/admin/layout-editor/inline-text.js +30 -2
  56. package/dist/admin/layout-editor/inline-text.js.map +1 -1
  57. package/dist/admin/layout-editor/layout-editor.d.ts +21 -16
  58. package/dist/admin/layout-editor/layout-editor.d.ts.map +1 -1
  59. package/dist/admin/layout-editor/layout-editor.js +40 -17
  60. package/dist/admin/layout-editor/layout-editor.js.map +1 -1
  61. package/dist/admin/layout-editor/linked-component-notes.d.ts +88 -0
  62. package/dist/admin/layout-editor/linked-component-notes.d.ts.map +1 -0
  63. package/dist/admin/layout-editor/linked-component-notes.js +88 -0
  64. package/dist/admin/layout-editor/linked-component-notes.js.map +1 -0
  65. package/dist/admin/layout-editor/module-overlay.d.ts +23 -4
  66. package/dist/admin/layout-editor/module-overlay.d.ts.map +1 -1
  67. package/dist/admin/layout-editor/module-overlay.js +56 -10
  68. package/dist/admin/layout-editor/module-overlay.js.map +1 -1
  69. package/dist/admin/layout-editor/module-variant-container-config.d.ts.map +1 -1
  70. package/dist/admin/layout-editor/module-variant-container-config.js +9 -2
  71. package/dist/admin/layout-editor/module-variant-container-config.js.map +1 -1
  72. package/dist/admin/layout-editor/module-variant-container-panel.d.ts +75 -0
  73. package/dist/admin/layout-editor/module-variant-container-panel.d.ts.map +1 -0
  74. package/dist/admin/layout-editor/module-variant-container-panel.js +29 -0
  75. package/dist/admin/layout-editor/module-variant-container-panel.js.map +1 -0
  76. package/dist/admin/layout-editor/node-lookup.d.ts.map +1 -1
  77. package/dist/admin/layout-editor/node-lookup.js +33 -3
  78. package/dist/admin/layout-editor/node-lookup.js.map +1 -1
  79. package/dist/admin/layout-editor/overlay-shell.d.ts.map +1 -1
  80. package/dist/admin/layout-editor/overlay-shell.js +19 -4
  81. package/dist/admin/layout-editor/overlay-shell.js.map +1 -1
  82. package/dist/admin/layout-editor/props-panel.d.ts +28 -11
  83. package/dist/admin/layout-editor/props-panel.d.ts.map +1 -1
  84. package/dist/admin/layout-editor/props-panel.js +75 -125
  85. package/dist/admin/layout-editor/props-panel.js.map +1 -1
  86. package/dist/admin/layout-editor/section-variant-container-config.d.ts.map +1 -1
  87. package/dist/admin/layout-editor/section-variant-container-config.js +11 -2
  88. package/dist/admin/layout-editor/section-variant-container-config.js.map +1 -1
  89. package/dist/admin/layout-editor/use-chrome-flip.d.ts +99 -11
  90. package/dist/admin/layout-editor/use-chrome-flip.d.ts.map +1 -1
  91. package/dist/admin/layout-editor/use-chrome-flip.js +268 -97
  92. package/dist/admin/layout-editor/use-chrome-flip.js.map +1 -1
  93. package/dist/admin/layout-editor/use-component-connect.d.ts +13 -0
  94. package/dist/admin/layout-editor/use-component-connect.d.ts.map +1 -1
  95. package/dist/admin/layout-editor/use-component-connect.js +116 -20
  96. package/dist/admin/layout-editor/use-component-connect.js.map +1 -1
  97. package/dist/admin/layout-editor/use-component-fork.d.ts +49 -19
  98. package/dist/admin/layout-editor/use-component-fork.d.ts.map +1 -1
  99. package/dist/admin/layout-editor/use-component-fork.js +28 -19
  100. package/dist/admin/layout-editor/use-component-fork.js.map +1 -1
  101. package/dist/admin/layout-editor/use-component-library.d.ts +4 -4
  102. package/dist/admin/layout-editor/use-component-library.d.ts.map +1 -1
  103. package/dist/admin/layout-editor/use-component-library.js +1 -1
  104. package/dist/admin/layout-editor/use-component-library.js.map +1 -1
  105. package/dist/admin/layout-editor/use-editor-dnd.d.ts +10 -0
  106. package/dist/admin/layout-editor/use-editor-dnd.d.ts.map +1 -1
  107. package/dist/admin/layout-editor/use-editor-dnd.js +234 -14
  108. package/dist/admin/layout-editor/use-editor-dnd.js.map +1 -1
  109. package/dist/admin/layout-editor/variant-container-config.d.ts.map +1 -1
  110. package/dist/admin/layout-editor/variant-container-config.js +1 -1
  111. package/dist/admin/layout-editor/variant-container-config.js.map +1 -1
  112. package/dist/admin/layout-editor/variant-editor.d.ts +16 -15
  113. package/dist/admin/layout-editor/variant-editor.d.ts.map +1 -1
  114. package/dist/admin/layout-editor/variant-editor.js +16 -5
  115. package/dist/admin/layout-editor/variant-editor.js.map +1 -1
  116. package/dist/admin/primitives.d.ts.map +1 -1
  117. package/dist/admin/primitives.js +1 -1
  118. package/dist/admin/primitives.js.map +1 -1
  119. package/dist/admin/registry.d.ts +12 -0
  120. package/dist/admin/registry.d.ts.map +1 -1
  121. package/dist/admin/registry.js +12 -0
  122. package/dist/admin/registry.js.map +1 -1
  123. package/dist/admin/server.d.ts +10 -1
  124. package/dist/admin/server.d.ts.map +1 -1
  125. package/dist/admin/server.js +4 -1
  126. package/dist/admin/server.js.map +1 -1
  127. package/dist/admin/site-switcher.d.ts +16 -3
  128. package/dist/admin/site-switcher.d.ts.map +1 -1
  129. package/dist/admin/site-switcher.js +18 -3
  130. package/dist/admin/site-switcher.js.map +1 -1
  131. package/dist/admin/styles/admin.css +0 -3
  132. package/dist/admin/surface-matcher.d.ts +6 -2
  133. package/dist/admin/surface-matcher.d.ts.map +1 -1
  134. package/dist/admin/surface-matcher.js +42 -5
  135. package/dist/admin/surface-matcher.js.map +1 -1
  136. package/dist/admin/surfaces/components/components-data.d.ts +31 -11
  137. package/dist/admin/surfaces/components/components-data.d.ts.map +1 -1
  138. package/dist/admin/surfaces/components/components-data.js +17 -4
  139. package/dist/admin/surfaces/components/components-data.js.map +1 -1
  140. package/dist/admin/surfaces/components/components-list.d.ts.map +1 -1
  141. package/dist/admin/surfaces/components/components-list.js +20 -7
  142. package/dist/admin/surfaces/components/components-list.js.map +1 -1
  143. package/dist/admin/surfaces/components/definition-canvas.d.ts +11 -3
  144. package/dist/admin/surfaces/components/definition-canvas.d.ts.map +1 -1
  145. package/dist/admin/surfaces/components/definition-canvas.js +138 -17
  146. package/dist/admin/surfaces/components/definition-canvas.js.map +1 -1
  147. package/dist/admin/surfaces/dashboard/dashboard-index.d.ts.map +1 -1
  148. package/dist/admin/surfaces/dashboard/dashboard-index.js +2 -2
  149. package/dist/admin/surfaces/dashboard/dashboard-index.js.map +1 -1
  150. package/dist/admin/surfaces/layouts/layout-editor-client.d.ts.map +1 -1
  151. package/dist/admin/surfaces/layouts/layout-editor-client.js +12 -11
  152. package/dist/admin/surfaces/layouts/layout-editor-client.js.map +1 -1
  153. package/dist/admin/surfaces/menus/menu-editor.d.ts.map +1 -1
  154. package/dist/admin/surfaces/menus/menu-editor.js +17 -4
  155. package/dist/admin/surfaces/menus/menu-editor.js.map +1 -1
  156. package/dist/admin/surfaces/menus/menu-tree.d.ts +18 -4
  157. package/dist/admin/surfaces/menus/menu-tree.d.ts.map +1 -1
  158. package/dist/admin/surfaces/menus/menu-tree.js +18 -3
  159. package/dist/admin/surfaces/menus/menu-tree.js.map +1 -1
  160. package/dist/admin/surfaces/menus/menus-data.d.ts +18 -0
  161. package/dist/admin/surfaces/menus/menus-data.d.ts.map +1 -1
  162. package/dist/admin/surfaces/menus/menus-data.js +4 -0
  163. package/dist/admin/surfaces/menus/menus-data.js.map +1 -1
  164. package/dist/admin/surfaces/menus/menus-list.d.ts.map +1 -1
  165. package/dist/admin/surfaces/menus/menus-list.js +2 -12
  166. package/dist/admin/surfaces/menus/menus-list.js.map +1 -1
  167. package/dist/admin/surfaces/users/users-data.d.ts +14 -0
  168. package/dist/admin/surfaces/users/users-data.d.ts.map +1 -1
  169. package/dist/admin/surfaces/users/users-data.js +19 -0
  170. package/dist/admin/surfaces/users/users-data.js.map +1 -1
  171. package/dist/admin/surfaces/users/users-detail.d.ts.map +1 -1
  172. package/dist/admin/surfaces/users/users-detail.js +40 -4
  173. package/dist/admin/surfaces/users/users-detail.js.map +1 -1
  174. package/dist/admin/surfaces/users/users-new.d.ts.map +1 -1
  175. package/dist/admin/surfaces/users/users-new.js +8 -5
  176. package/dist/admin/surfaces/users/users-new.js.map +1 -1
  177. package/dist/admin/user-form.d.ts +10 -1
  178. package/dist/admin/user-form.d.ts.map +1 -1
  179. package/dist/admin/user-form.js +2 -2
  180. package/dist/admin/user-form.js.map +1 -1
  181. package/dist/api/admin-features-routes.js +2 -2
  182. package/dist/api/admin-features-routes.js.map +1 -1
  183. package/dist/api/audience-preview-routes.d.ts +7 -0
  184. package/dist/api/audience-preview-routes.d.ts.map +1 -1
  185. package/dist/api/audience-preview-routes.js +4 -4
  186. package/dist/api/audience-preview-routes.js.map +1 -1
  187. package/dist/api/audience-routes.d.ts +7 -0
  188. package/dist/api/audience-routes.d.ts.map +1 -1
  189. package/dist/api/audience-routes.js +21 -15
  190. package/dist/api/audience-routes.js.map +1 -1
  191. package/dist/api/audience-runtime-routes.d.ts +6 -0
  192. package/dist/api/audience-runtime-routes.d.ts.map +1 -1
  193. package/dist/api/audience-runtime-routes.js +38 -3
  194. package/dist/api/audience-runtime-routes.js.map +1 -1
  195. package/dist/api/auth-routes.d.ts.map +1 -1
  196. package/dist/api/auth-routes.js +10 -4
  197. package/dist/api/auth-routes.js.map +1 -1
  198. package/dist/api/auth.d.ts +1 -0
  199. package/dist/api/auth.d.ts.map +1 -1
  200. package/dist/api/auth.js +43 -3
  201. package/dist/api/auth.js.map +1 -1
  202. package/dist/api/bulk-routes.d.ts.map +1 -1
  203. package/dist/api/bulk-routes.js +7 -7
  204. package/dist/api/bulk-routes.js.map +1 -1
  205. package/dist/api/category-routes.js +3 -3
  206. package/dist/api/category-routes.js.map +1 -1
  207. package/dist/api/comment-routes.js +8 -8
  208. package/dist/api/comment-routes.js.map +1 -1
  209. package/dist/api/component-routes.d.ts +25 -0
  210. package/dist/api/component-routes.d.ts.map +1 -1
  211. package/dist/api/component-routes.js +41 -16
  212. package/dist/api/component-routes.js.map +1 -1
  213. package/dist/api/content-routes.js +13 -13
  214. package/dist/api/content-routes.js.map +1 -1
  215. package/dist/api/dashboard-routes.js +1 -1
  216. package/dist/api/dashboard-routes.js.map +1 -1
  217. package/dist/api/experiment-routes.d.ts +7 -0
  218. package/dist/api/experiment-routes.d.ts.map +1 -1
  219. package/dist/api/experiment-routes.js +8 -8
  220. package/dist/api/experiment-routes.js.map +1 -1
  221. package/dist/api/experiment-runtime-routes.d.ts +6 -0
  222. package/dist/api/experiment-runtime-routes.d.ts.map +1 -1
  223. package/dist/api/experiment-runtime-routes.js +47 -11
  224. package/dist/api/experiment-runtime-routes.js.map +1 -1
  225. package/dist/api/feed-routes.d.ts +2 -2
  226. package/dist/api/feed-routes.js +3 -3
  227. package/dist/api/feed-routes.js.map +1 -1
  228. package/dist/api/form-routes.js +4 -4
  229. package/dist/api/form-routes.js.map +1 -1
  230. package/dist/api/graphql/resolvers.d.ts +1 -1
  231. package/dist/api/graphql/resolvers.d.ts.map +1 -1
  232. package/dist/api/graphql/resolvers.js +68 -33
  233. package/dist/api/graphql/resolvers.js.map +1 -1
  234. package/dist/api/group-routes.js +6 -6
  235. package/dist/api/group-routes.js.map +1 -1
  236. package/dist/api/index.d.ts +1 -0
  237. package/dist/api/index.d.ts.map +1 -1
  238. package/dist/api/index.js +39 -6
  239. package/dist/api/index.js.map +1 -1
  240. package/dist/api/layout-routes.d.ts.map +1 -1
  241. package/dist/api/layout-routes.js +27 -3
  242. package/dist/api/layout-routes.js.map +1 -1
  243. package/dist/api/media-routes.d.ts.map +1 -1
  244. package/dist/api/media-routes.js +50 -26
  245. package/dist/api/media-routes.js.map +1 -1
  246. package/dist/api/menu-routes.d.ts +9 -1
  247. package/dist/api/menu-routes.d.ts.map +1 -1
  248. package/dist/api/menu-routes.js +44 -10
  249. package/dist/api/menu-routes.js.map +1 -1
  250. package/dist/api/nav-routes.d.ts +6 -0
  251. package/dist/api/nav-routes.d.ts.map +1 -1
  252. package/dist/api/nav-routes.js +24 -3
  253. package/dist/api/nav-routes.js.map +1 -1
  254. package/dist/api/openapi.d.ts.map +1 -1
  255. package/dist/api/openapi.js +68 -33
  256. package/dist/api/openapi.js.map +1 -1
  257. package/dist/api/search-routes.js +2 -2
  258. package/dist/api/search-routes.js.map +1 -1
  259. package/dist/api/section-template-routes.d.ts.map +1 -1
  260. package/dist/api/section-template-routes.js +35 -18
  261. package/dist/api/section-template-routes.js.map +1 -1
  262. package/dist/api/site-admin-routes.d.ts +10 -1
  263. package/dist/api/site-admin-routes.d.ts.map +1 -1
  264. package/dist/api/site-admin-routes.js +21 -1
  265. package/dist/api/site-admin-routes.js.map +1 -1
  266. package/dist/api/site-context.d.ts +35 -5
  267. package/dist/api/site-context.d.ts.map +1 -1
  268. package/dist/api/site-context.js +21 -6
  269. package/dist/api/site-context.js.map +1 -1
  270. package/dist/api/tag-routes.js +3 -3
  271. package/dist/api/tag-routes.js.map +1 -1
  272. package/dist/api/translation-routes.js +5 -5
  273. package/dist/api/translation-routes.js.map +1 -1
  274. package/dist/api/user-routes.d.ts.map +1 -1
  275. package/dist/api/user-routes.js +134 -19
  276. package/dist/api/user-routes.js.map +1 -1
  277. package/dist/api/webhook-routes.js +5 -5
  278. package/dist/api/webhook-routes.js.map +1 -1
  279. package/dist/api/workflow-routes.js +8 -8
  280. package/dist/api/workflow-routes.js.map +1 -1
  281. package/dist/audiences/collectors/identity.d.ts +14 -1
  282. package/dist/audiences/collectors/identity.d.ts.map +1 -1
  283. package/dist/audiences/collectors/identity.js +16 -3
  284. package/dist/audiences/collectors/identity.js.map +1 -1
  285. package/dist/audiences/collectors/index.d.ts +12 -2
  286. package/dist/audiences/collectors/index.d.ts.map +1 -1
  287. package/dist/audiences/collectors/index.js +16 -5
  288. package/dist/audiences/collectors/index.js.map +1 -1
  289. package/dist/audiences/collectors/pinned-audience.d.ts +28 -2
  290. package/dist/audiences/collectors/pinned-audience.d.ts.map +1 -1
  291. package/dist/audiences/collectors/pinned-audience.js +35 -5
  292. package/dist/audiences/collectors/pinned-audience.js.map +1 -1
  293. package/dist/audiences/collectors/utm.d.ts +15 -1
  294. package/dist/audiences/collectors/utm.d.ts.map +1 -1
  295. package/dist/audiences/collectors/utm.js +16 -2
  296. package/dist/audiences/collectors/utm.js.map +1 -1
  297. package/dist/audiences/consent-config.d.ts +21 -0
  298. package/dist/audiences/consent-config.d.ts.map +1 -0
  299. package/dist/audiences/consent-config.js +15 -0
  300. package/dist/audiences/consent-config.js.map +1 -0
  301. package/dist/audiences/consent-startup.d.ts +39 -0
  302. package/dist/audiences/consent-startup.d.ts.map +1 -0
  303. package/dist/audiences/consent-startup.js +105 -0
  304. package/dist/audiences/consent-startup.js.map +1 -0
  305. package/dist/audiences/consent.d.ts +192 -0
  306. package/dist/audiences/consent.d.ts.map +1 -0
  307. package/dist/audiences/consent.js +322 -0
  308. package/dist/audiences/consent.js.map +1 -0
  309. package/dist/audiences/engine.d.ts +7 -0
  310. package/dist/audiences/engine.d.ts.map +1 -1
  311. package/dist/audiences/engine.js +6 -2
  312. package/dist/audiences/engine.js.map +1 -1
  313. package/dist/audiences/index.d.ts +3 -0
  314. package/dist/audiences/index.d.ts.map +1 -1
  315. package/dist/audiences/index.js +6 -0
  316. package/dist/audiences/index.js.map +1 -1
  317. package/dist/audiences/server-eval.d.ts +13 -1
  318. package/dist/audiences/server-eval.d.ts.map +1 -1
  319. package/dist/audiences/server-eval.js +18 -2
  320. package/dist/audiences/server-eval.js.map +1 -1
  321. package/dist/audiences/ssr.d.ts +18 -1
  322. package/dist/audiences/ssr.d.ts.map +1 -1
  323. package/dist/audiences/ssr.js +18 -1
  324. package/dist/audiences/ssr.js.map +1 -1
  325. package/dist/audiences/utm-persistence.d.ts +20 -7
  326. package/dist/audiences/utm-persistence.d.ts.map +1 -1
  327. package/dist/audiences/utm-persistence.js +20 -7
  328. package/dist/audiences/utm-persistence.js.map +1 -1
  329. package/dist/auth/roles.d.ts +11 -0
  330. package/dist/auth/roles.d.ts.map +1 -1
  331. package/dist/auth/roles.js +13 -0
  332. package/dist/auth/roles.js.map +1 -1
  333. package/dist/auth/tokens.d.ts +7 -0
  334. package/dist/auth/tokens.d.ts.map +1 -1
  335. package/dist/auth/tokens.js +24 -2
  336. package/dist/auth/tokens.js.map +1 -1
  337. package/dist/config/types.d.ts +43 -0
  338. package/dist/config/types.d.ts.map +1 -1
  339. package/dist/config/types.js.map +1 -1
  340. package/dist/config/validate.d.ts.map +1 -1
  341. package/dist/config/validate.js +3 -0
  342. package/dist/config/validate.js.map +1 -1
  343. package/dist/db/apply-snapshot.d.ts +18 -0
  344. package/dist/db/apply-snapshot.d.ts.map +1 -1
  345. package/dist/db/apply-snapshot.js +41 -16
  346. package/dist/db/apply-snapshot.js.map +1 -1
  347. package/dist/db/component-instance-queries.d.ts +79 -19
  348. package/dist/db/component-instance-queries.d.ts.map +1 -1
  349. package/dist/db/component-instance-queries.js +266 -83
  350. package/dist/db/component-instance-queries.js.map +1 -1
  351. package/dist/db/component-queries.d.ts +1 -16
  352. package/dist/db/component-queries.d.ts.map +1 -1
  353. package/dist/db/component-queries.js +7 -56
  354. package/dist/db/component-queries.js.map +1 -1
  355. package/dist/db/content-queries.d.ts.map +1 -1
  356. package/dist/db/content-queries.js +1 -2
  357. package/dist/db/content-queries.js.map +1 -1
  358. package/dist/db/extension-queries.d.ts +2 -2
  359. package/dist/db/feed-queries.d.ts +3 -3
  360. package/dist/db/index.d.ts +1 -0
  361. package/dist/db/index.d.ts.map +1 -1
  362. package/dist/db/index.js +1 -0
  363. package/dist/db/index.js.map +1 -1
  364. package/dist/db/layout-queries.d.ts +2 -1
  365. package/dist/db/layout-queries.d.ts.map +1 -1
  366. package/dist/db/layout-queries.js +3 -3
  367. package/dist/db/layout-queries.js.map +1 -1
  368. package/dist/db/menu-queries.d.ts +69 -5
  369. package/dist/db/menu-queries.d.ts.map +1 -1
  370. package/dist/db/menu-queries.js +120 -13
  371. package/dist/db/menu-queries.js.map +1 -1
  372. package/dist/db/section-template-queries.d.ts +62 -0
  373. package/dist/db/section-template-queries.d.ts.map +1 -0
  374. package/dist/db/section-template-queries.js +178 -0
  375. package/dist/db/section-template-queries.js.map +1 -0
  376. package/dist/db/site-plugin-queries.d.ts +2 -2
  377. package/dist/db/tree-queries.d.ts.map +1 -1
  378. package/dist/db/tree-queries.js +5 -0
  379. package/dist/db/tree-queries.js.map +1 -1
  380. package/dist/db/webhook-queries.d.ts +3 -3
  381. package/dist/db/workflow-queries.d.ts.map +1 -1
  382. package/dist/db/workflow-queries.js +5 -20
  383. package/dist/db/workflow-queries.js.map +1 -1
  384. package/dist/experiments/runtime.d.ts +21 -3
  385. package/dist/experiments/runtime.d.ts.map +1 -1
  386. package/dist/experiments/runtime.js +21 -3
  387. package/dist/experiments/runtime.js.map +1 -1
  388. package/dist/layout/component-refs.d.ts +90 -2
  389. package/dist/layout/component-refs.d.ts.map +1 -1
  390. package/dist/layout/component-refs.js +293 -16
  391. package/dist/layout/component-refs.js.map +1 -1
  392. package/dist/layout/index.d.ts +4 -3
  393. package/dist/layout/index.d.ts.map +1 -1
  394. package/dist/layout/index.js +3 -2
  395. package/dist/layout/index.js.map +1 -1
  396. package/dist/layout/legacy-variant-container.d.ts +123 -0
  397. package/dist/layout/legacy-variant-container.d.ts.map +1 -0
  398. package/dist/layout/legacy-variant-container.js +397 -0
  399. package/dist/layout/legacy-variant-container.js.map +1 -0
  400. package/dist/layout/module-permissions.d.ts.map +1 -1
  401. package/dist/layout/module-permissions.js +25 -1
  402. package/dist/layout/module-permissions.js.map +1 -1
  403. package/dist/layout/modules-extended.d.ts +28 -1
  404. package/dist/layout/modules-extended.d.ts.map +1 -1
  405. package/dist/layout/modules-extended.js +73 -1
  406. package/dist/layout/modules-extended.js.map +1 -1
  407. package/dist/layout/modules.d.ts.map +1 -1
  408. package/dist/layout/modules.js +9 -1
  409. package/dist/layout/modules.js.map +1 -1
  410. package/dist/layout/personalization.d.ts +83 -0
  411. package/dist/layout/personalization.d.ts.map +1 -1
  412. package/dist/layout/personalization.js +250 -4
  413. package/dist/layout/personalization.js.map +1 -1
  414. package/dist/layout/registry.d.ts.map +1 -1
  415. package/dist/layout/registry.js +20 -0
  416. package/dist/layout/registry.js.map +1 -1
  417. package/dist/layout/renderer.d.ts +29 -2
  418. package/dist/layout/renderer.d.ts.map +1 -1
  419. package/dist/layout/renderer.js +23 -6
  420. package/dist/layout/renderer.js.map +1 -1
  421. package/dist/layout/types.d.ts +17 -0
  422. package/dist/layout/types.d.ts.map +1 -1
  423. package/dist/layout/types.js +7 -0
  424. package/dist/layout/types.js.map +1 -1
  425. package/dist/media/inline-risk.d.ts +26 -0
  426. package/dist/media/inline-risk.d.ts.map +1 -0
  427. package/dist/media/inline-risk.js +142 -0
  428. package/dist/media/inline-risk.js.map +1 -0
  429. package/dist/nav/builder.d.ts.map +1 -1
  430. package/dist/nav/builder.js +15 -3
  431. package/dist/nav/builder.js.map +1 -1
  432. package/dist/nav/index.d.ts +1 -1
  433. package/dist/nav/index.d.ts.map +1 -1
  434. package/dist/nav/index.js +1 -1
  435. package/dist/nav/index.js.map +1 -1
  436. package/dist/nav/menu-resolver.d.ts +11 -0
  437. package/dist/nav/menu-resolver.d.ts.map +1 -1
  438. package/dist/nav/menu-resolver.js +49 -9
  439. package/dist/nav/menu-resolver.js.map +1 -1
  440. package/dist/nav/paths.d.ts +37 -0
  441. package/dist/nav/paths.d.ts.map +1 -0
  442. package/dist/nav/paths.js +48 -0
  443. package/dist/nav/paths.js.map +1 -0
  444. package/dist/nav/types.d.ts +6 -0
  445. package/dist/nav/types.d.ts.map +1 -1
  446. package/dist/nav/url-resolver.d.ts +1 -5
  447. package/dist/nav/url-resolver.d.ts.map +1 -1
  448. package/dist/nav/url-resolver.js +6 -12
  449. package/dist/nav/url-resolver.js.map +1 -1
  450. package/dist/schema/base.d.ts +24 -4
  451. package/dist/schema/base.d.ts.map +1 -1
  452. package/dist/schema/base.js +17 -4
  453. package/dist/schema/base.js.map +1 -1
  454. package/dist/schema/components.d.ts +90 -9
  455. package/dist/schema/components.d.ts.map +1 -1
  456. package/dist/schema/components.js +113 -22
  457. package/dist/schema/components.js.map +1 -1
  458. package/dist/schema/mysql-tables.d.ts +5758 -48
  459. package/dist/schema/mysql-tables.d.ts.map +1 -1
  460. package/dist/schema/mysql-tables.js +620 -46
  461. package/dist/schema/mysql-tables.js.map +1 -1
  462. package/dist/scope/kywi-form.d.ts +11 -0
  463. package/dist/scope/kywi-form.d.ts.map +1 -1
  464. package/dist/scope/kywi-form.js +11 -1
  465. package/dist/scope/kywi-form.js.map +1 -1
  466. package/dist/scope/kywi-wizard-form.d.ts.map +1 -1
  467. package/dist/scope/kywi-wizard-form.js +76 -2
  468. package/dist/scope/kywi-wizard-form.js.map +1 -1
  469. package/dist/scope/sticky-offset.d.ts +34 -13
  470. package/dist/scope/sticky-offset.d.ts.map +1 -1
  471. package/dist/scope/sticky-offset.js +236 -43
  472. package/dist/scope/sticky-offset.js.map +1 -1
  473. package/dist/site/styles.css +61 -15
  474. package/dist/versioning/scheduler.d.ts +28 -0
  475. package/dist/versioning/scheduler.d.ts.map +1 -1
  476. package/dist/versioning/scheduler.js +50 -3
  477. package/dist/versioning/scheduler.js.map +1 -1
  478. package/package.json +7 -2
@@ -10,7 +10,15 @@ import { readStickyOffsetPx } from '../../scope/sticky-offset.js';
10
10
  * CSS could resolve — so all of those must be changed together.
11
11
  */
12
12
  const BAR_HEIGHT_PX = 46;
13
- /** One chrome row: the height a floating section/container bar occupies. */
13
+ /**
14
+ * One chrome row: the height a floating section/container bar occupies.
15
+ *
16
+ * kywi-cms#133: deliberately above the ~32px actually measured for a rendered
17
+ * chrome bar (the y 60–92 reading a few lines down is exactly that — a 32px
18
+ * band). 40 is a margin over the measured value, not the value itself, so a
19
+ * chrome that grows slightly (a longer label, a bigger hit target) doesn't
20
+ * immediately need this constant chased too.
21
+ */
14
22
  const CHROME_ROW_PX = 40;
15
23
  /**
16
24
  * An owner whose top edge sits above this line has no room for a chrome row
@@ -39,6 +47,41 @@ export const BAR_STRIP_PX = BAR_HEIGHT_PX + CHROME_ROW_PX;
39
47
  * is still running, which a rect read during a palette toggle is not.
40
48
  */
41
49
  export const RAIL_WIDTH_FALLBACK_PX = 232;
50
+ /**
51
+ * The same, for the RIGHT properties rail (`--kywi-overlay-rail-right`, which
52
+ * resolves to `--kywi-editor-panel-width-right`) — see kywi-cms#166.
53
+ *
54
+ * The rail that dodging matters most for, because it is open precisely when
55
+ * someone is working: it opens itself the moment anything is selected and
56
+ * closes on deselect, so "the rail is out" is the ordinary editing state rather
57
+ * than a mode the owner chose.
58
+ */
59
+ export const RIGHT_RAIL_WIDTH_FALLBACK_PX = 288;
60
+ /**
61
+ * The shortest owner worth clamping a bar INSIDE — two chrome rows.
62
+ *
63
+ * The clamp pins a bar inside its owner so it clears the editor's fixed bar
64
+ * (kywi-cms#122). That trade only works while the owner has room to spare: the
65
+ * bar covers one row of it, and what is left has to still be the owner's own
66
+ * clickable surface. Below two rows there is nothing left — the cap just above
67
+ * (`height - CHROME_ROW_PX`) collapses toward 0 and the bar lands flush over
68
+ * the whole owner.
69
+ *
70
+ * Which is not cosmetic. Measured on a module-level variant container
71
+ * (kywi-cms#166 review): a 38px owner put its bar at 635–992 × 78–110 across a
72
+ * module of 124–1156 × 78–116, so a click on the module's own centre hit the
73
+ * bar, and selecting the module — the first half of the "select, then edit"
74
+ * gesture — became impossible. The module chip and action cluster inherited the
75
+ * same hazard the moment they joined the clamp in kywi-cms#128, because a module
76
+ * is exactly the size of owner this describes.
77
+ *
78
+ * An owner this short therefore keeps the behaviour it has always had: its
79
+ * chrome renders above itself, under the editor's bar, and is reached by
80
+ * scrolling. Same family as kywi-cms#128's recorded disclosure that a clamped
81
+ * container bar covers the top strip of the section it wraps — and the same
82
+ * answer, which is not a clamp.
83
+ */
84
+ export const CHROME_MIN_CLAMP_HEIGHT_PX = CHROME_ROW_PX * 2;
42
85
  /**
43
86
  * The narrowest strip of owner worth pushing the bar into. A chrome bar cannot
44
87
  * be pushed so far right that its LEFT edge leaves its owner: it is absolutely
@@ -67,16 +110,22 @@ export const CHROME_MIN_WIDTH_PX = 200;
67
110
  * "var(--kywi-editor-panel-width-left)". Either way a value this cannot parse
68
111
  * falls back rather than producing NaN arithmetic.
69
112
  */
70
- function readRailWidthPx() {
71
- if (typeof window === 'undefined' || typeof document === 'undefined') {
72
- return RAIL_WIDTH_FALLBACK_PX;
73
- }
74
- const raw = window
75
- .getComputedStyle(document.documentElement)
76
- .getPropertyValue('--kywi-overlay-rail-left');
113
+ function readRailWidthPx(token, fallbackPx) {
114
+ if (typeof window === 'undefined' || typeof document === 'undefined')
115
+ return fallbackPx;
116
+ const raw = window.getComputedStyle(document.documentElement).getPropertyValue(token);
77
117
  const parsed = Number.parseFloat(raw);
78
- return Number.isFinite(parsed) && parsed > 0 ? parsed : RAIL_WIDTH_FALLBACK_PX;
118
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : fallbackPx;
79
119
  }
120
+ // kywi-cms#133: "flip" is a name from this hook's first shape — an
121
+ // above/below toggle for the chrome's vertical position — and survived the
122
+ // #122 redesign below into a CLAMP (pin the chrome just under the fixed bar
123
+ // while any of its owner is on screen) plus, since #132, a horizontal
124
+ // rail-avoid offset that has nothing to do with flipping either axis. The
125
+ // name is stale on the hook, this file, and the describe blocks that test it;
126
+ // left alone here rather than renamed mid-fix, since another change is
127
+ // in flight against this same file. Tracked as a deferred rename, not
128
+ // forgotten.
80
129
  /**
81
130
  * In-place chrome floats ABOVE its owner (`transform: translateY(-100%)`, see
82
131
  * `.kywi-ip-section-chrome` / `.kywi-ip-vc-chrome` in editor.css). For an owner
@@ -104,7 +153,16 @@ function readRailWidthPx() {
104
153
  * band's height and the clamp adds it, which is a no-op (0) on a page with no
105
154
  * top-anchored chrome — i.e. every page the #122 geometry was written against.
106
155
  *
107
- * Returns both offsets from ONE rect read, in px:
156
+ * And it runs sideways once more for the RIGHT properties rail (kywi-cms#166).
157
+ * A module-level variant container floats its badge and arm switcher at the
158
+ * container's own `right: 0`, which on a full-width column is exactly where
159
+ * that rail is — and the rail opens itself whenever anything is selected, so
160
+ * the switcher was unreachable for as long as any editing was going on. The
161
+ * e2e suite worked around it by closing the rail, which is the gesture the
162
+ * owner was forced into. Same argument, same fix: the rail's width is a token
163
+ * the editor owns, so push the bar left by the overlap.
164
+ *
165
+ * Returns every offset from ONE rect read, in px:
108
166
  * - `clampPx` — distance to pin the chrome DOWN from its owner's top edge so
109
167
  * it lands just under the fixed bar (and the site's offset nav, if any), or
110
168
  * null when the owner has room above it and the ordinary above-position
@@ -114,6 +172,14 @@ function readRailWidthPx() {
114
172
  * palette rail, or null when the palette is closed or the owner already
115
173
  * starts to the right of it. The caller turns that into
116
174
  * `--kywi-ip-chrome-left` + `.kywi-ip-chrome--rail-avoid`.
175
+ * - `railAvoidRightPx` — the mirror, for a RIGHT-anchored bar against the
176
+ * props rail: `--kywi-ip-chrome-right` +
177
+ * `.kywi-ip-chrome--rail-avoid-right`.
178
+ *
179
+ * Both horizontal offsets are always measured; which one a given bar may take
180
+ * is the caller's answer, because only the caller knows which edge its CSS pins
181
+ * it to — see {@link ChromeAnchor}, and note that taking the wrong one deforms
182
+ * the bar rather than moving it.
117
183
  *
118
184
  * One hook rather than two: both offsets are read off the same
119
185
  * `getBoundingClientRect()`, which is also the rule the drag work landed on
@@ -143,91 +209,155 @@ function readRailWidthPx() {
143
209
  * @param paletteOpen whether the left module-palette rail is currently expanded.
144
210
  * In-place only; the admin Layout tab's palette is an in-flow column that
145
211
  * displaces the canvas rather than floating over it, so nothing there has a
146
- * rail to avoid. Part of the effect's deps, so toggling the palette
212
+ * rail to avoid. Drives the SECOND effect below, so toggling the palette
147
213
  * re-measures immediately rather than waiting for the next scroll.
214
+ * @param propsRailOpen whether the right properties rail is showing a selection
215
+ * (kywi-cms#166). In-place only, for the same reason as `paletteOpen`, and it
216
+ * has to drive a re-measure for a reason of its own: the rail opens on
217
+ * SELECTION, and nothing about the owner's geometry changes when it does, so
218
+ * neither the scroll listener nor the `ResizeObserver` would ever notice.
219
+ *
220
+ * Neither belongs in the LISTENER effect's deps, which is why there are two
221
+ * (kywi-cms#166 review). The props rail opens on every click, and with the
222
+ * two joined that tore down and rebuilt a scroll listener, a resize listener
223
+ * and a `ResizeObserver` for every section, container and module on the page
224
+ * once per selection — on a hook that, since kywi-cms#128, runs per module.
148
225
  */
149
- export function useChromeFlip(ownerRef, enabled = true, paletteOpen = false) {
226
+ export function useChromeFlip(ownerRef, enabled = true, paletteOpen = false, propsRailOpen = false) {
150
227
  const [clampOffsetPx, setClampOffsetPx] = React.useState(null);
151
228
  const [railAvoidOffsetPx, setRailAvoidOffsetPx] = React.useState(null);
229
+ const [railAvoidRightOffsetPx, setRailAvoidRightOffsetPx] = React.useState(null);
230
+ /**
231
+ * The rail widths, read once per rail TOGGLE rather than per scroll frame:
232
+ * these are theme tokens, so they can only change with a stylesheet, and
233
+ * `getComputedStyle` in a scroll handler is exactly the kind of per-frame
234
+ * style read the clamp's own comment is careful to avoid. A toggle is also
235
+ * the only moment a re-read could matter. Refreshed by the second effect
236
+ * below, which runs on mount and on every rail change.
237
+ */
238
+ const railWidthsRef = React.useRef({
239
+ leftPx: RAIL_WIDTH_FALLBACK_PX,
240
+ rightPx: RIGHT_RAIL_WIDTH_FALLBACK_PX,
241
+ });
242
+ /**
243
+ * The current measurement, behind a ref so the listeners below never have to
244
+ * be re-registered to see a new one.
245
+ *
246
+ * That indirection is the whole point of the split (kywi-cms#166 review).
247
+ * With `paletteOpen`/`propsRailOpen` in one effect's deps, EVERY selection
248
+ * tore down and rebuilt a scroll listener, a resize listener and a
249
+ * `ResizeObserver` for every section, container and module on the page — and
250
+ * the props rail opens on selection, so that is once per click, on a hook
251
+ * that now runs per module. Reassigned during render, which is what keeps it
252
+ * reading the latest props without re-running anything.
253
+ */
254
+ const measureRef = React.useRef(() => { });
255
+ measureRef.current = () => {
256
+ if (!enabled || typeof window === 'undefined')
257
+ return;
258
+ const { leftPx: railWidthPx, rightPx: rightRailWidthPx } = railWidthsRef.current;
259
+ const owner = ownerRef.current;
260
+ if (!owner)
261
+ return;
262
+ // ONE rect for both axes — see the kywi-cms#136 note above.
263
+ const { top, height, left, width, right } = owner.getBoundingClientRect();
264
+ // ── Vertical: clear the editor's fixed top bar (kywi-cms#122) and the
265
+ // site's offset sticky band on top of it (kywi-cms#146) ─────────────
266
+ //
267
+ // Read per measurement, unlike the rail width above: that is a theme
268
+ // token which can only change with a stylesheet, whereas this tracks a
269
+ // live element whose height changes when its nav wraps. Cheap enough for
270
+ // a scroll handler because `readStickyOffsetPx` reads back the INLINE
271
+ // custom property the detector wrote — a CSSOM read, not a
272
+ // `getComputedStyle` that could force a style recalculation. 0 (the whole
273
+ // pre-#146 behaviour) whenever the page has no offset top band.
274
+ const stickyPx = readStickyOffsetPx();
275
+ // Where a clamped bar has to land: under the editor's bar AND under the
276
+ // site's nav, which the detector re-pinned directly beneath it.
277
+ const stripBottomPx = BAR_HEIGHT_PX + stickyPx;
278
+ // An owner with room above it needs no clamp; an owner too short to host
279
+ // a bar without covering itself must not take one (see
280
+ // CHROME_MIN_CLAMP_HEIGHT_PX — this is the case that makes a module
281
+ // unclickable rather than merely untidy).
282
+ if (top >= BAR_STRIP_PX + stickyPx || height < CHROME_MIN_CLAMP_HEIGHT_PX) {
283
+ setClampOffsetPx(null);
284
+ }
285
+ else {
286
+ // How far down from the owner's top edge the bar has to sit to clear the
287
+ // fixed bar. Never negative: an owner already below the bar keeps its
288
+ // chrome flush with its own top edge rather than being pulled up into it.
289
+ const wanted = Math.max(0, stripBottomPx - top);
290
+ // …but never past the owner's own bottom edge either. Once the owner has
291
+ // scrolled far enough that the bar would otherwise hang below it, the bar
292
+ // rides out with its owner instead of sticking to the top of the screen
293
+ // over whatever the reader is actually looking at. This also caps the
294
+ // per-scroll churn: for anything well above the fold the offset stops
295
+ // changing, and the style writes stop with it.
296
+ const maxInsideOwner = Math.max(0, height - CHROME_ROW_PX);
297
+ // Rounded so sub-pixel rects (browser zoom, fractional layouts) don't
298
+ // re-render on every frame of a scroll that hasn't moved a whole pixel.
299
+ setClampOffsetPx(Math.round(Math.min(wanted, maxInsideOwner)));
300
+ }
301
+ // ── Horizontal: clear the open palette rail (kywi-cms#132) ────────────
302
+ if (!paletteOpen || left >= railWidthPx) {
303
+ // A closed palette, or an owner (a centred container, an inset band)
304
+ // that already starts to the right of the rail — the ordinary
305
+ // left-edge position is reachable, so leave it alone.
306
+ setRailAvoidOffsetPx(null);
307
+ }
308
+ else {
309
+ // Full-width owners are the case in the issue: left 0, so the chrome
310
+ // needs the rail's whole width. A partly-covered owner needs only the
311
+ // overlap.
312
+ const wanted = railWidthPx - left;
313
+ // Capped so the bar's left edge stays inside the owner it belongs to.
314
+ // A band narrower than the rail plus a usable strip keeps whatever room
315
+ // it has; pushing further would start the bar past the band's own right
316
+ // edge, over the section beside it.
317
+ const maxInsideOwner = Math.max(0, width - CHROME_MIN_WIDTH_PX);
318
+ // Rounded AWAY from each obstacle, not to the nearest pixel. A
319
+ // fractional owner left (zoom, a centred layout on an odd viewport)
320
+ // rounded to nearest can land the bar half a pixel back INSIDE the rail
321
+ // — owner left 124.6 + round(107.4) = 231.6, against a rail that ends at
322
+ // 232 — which is both visibly clipped and a real hit-test failure at the
323
+ // bar's left edge. `ceil` on the push clears the rail; `floor` on the
324
+ // cap keeps the guarantee above (≥200px of owner to the bar's right)
325
+ // rather than overshooting it by the same sub-pixel.
326
+ setRailAvoidOffsetPx(Math.min(Math.ceil(wanted), Math.floor(maxInsideOwner)));
327
+ }
328
+ // ── Horizontal, other edge: clear the open props rail (kywi-cms#166) ──
329
+ //
330
+ // The mirror image, and the one that bites hardest: the props rail opens
331
+ // itself the moment anything is selected and closes on deselect, so "the
332
+ // rail is out" is the ordinary state of editing rather than a mode the
333
+ // owner chose. A right-anchored bar on a full-width owner is therefore
334
+ // unreachable for as long as any work is going on — the e2e suite closed
335
+ // the rail to get at it, which is the gesture the owner was forced into.
336
+ const railInnerEdgeX = window.innerWidth - rightRailWidthPx;
337
+ if (!propsRailOpen || right <= railInnerEdgeX) {
338
+ setRailAvoidRightOffsetPx(null);
339
+ }
340
+ else {
341
+ const wanted = right - railInnerEdgeX;
342
+ // The same guarantee as the left cap, read in a mirror: the bar's RIGHT
343
+ // edge stays inside its owner with at least this much of the owner to
344
+ // its left. Rounded away from the obstacle for the same sub-pixel
345
+ // reason — `ceil` clears the rail, `floor` keeps the cap honest.
346
+ const maxInsideOwner = Math.max(0, width - CHROME_MIN_WIDTH_PX);
347
+ setRailAvoidRightOffsetPx(Math.min(Math.ceil(wanted), Math.floor(maxInsideOwner)));
348
+ }
349
+ };
350
+ // ── Listeners: bound to the OWNER's lifetime, nothing else ────────────────
152
351
  React.useEffect(() => {
153
352
  if (!enabled || typeof window === 'undefined') {
154
353
  setClampOffsetPx(null);
155
354
  setRailAvoidOffsetPx(null);
355
+ setRailAvoidRightOffsetPx(null);
156
356
  return;
157
357
  }
158
- // Read once per effect run, not per scroll: this is a theme token, so it
159
- // can only change with a stylesheet, and `getComputedStyle` in a scroll
160
- // handler is exactly the kind of per-frame style read the clamp's own
161
- // comment is careful to avoid. A palette toggle re-runs the effect (it is
162
- // in the deps), which is also when a re-read could matter.
163
- const railWidthPx = readRailWidthPx();
164
- const measure = () => {
165
- const owner = ownerRef.current;
166
- if (!owner)
167
- return;
168
- // ONE rect for both axes — see the kywi-cms#136 note above.
169
- const { top, height, left, width } = owner.getBoundingClientRect();
170
- // ── Vertical: clear the editor's fixed top bar (kywi-cms#122) and the
171
- // site's offset sticky band on top of it (kywi-cms#146) ─────────────
172
- //
173
- // Read per measurement, unlike the rail width above: that is a theme
174
- // token which can only change with a stylesheet, whereas this tracks a
175
- // live element whose height changes when its nav wraps. Cheap enough for
176
- // a scroll handler because `readStickyOffsetPx` reads back the INLINE
177
- // custom property the detector wrote — a CSSOM read, not a
178
- // `getComputedStyle` that could force a style recalculation. 0 (the whole
179
- // pre-#146 behaviour) whenever the page has no offset top band.
180
- const stickyPx = readStickyOffsetPx();
181
- // Where a clamped bar has to land: under the editor's bar AND under the
182
- // site's nav, which the detector re-pinned directly beneath it.
183
- const stripBottomPx = BAR_HEIGHT_PX + stickyPx;
184
- if (top >= BAR_STRIP_PX + stickyPx) {
185
- setClampOffsetPx(null);
186
- }
187
- else {
188
- // How far down from the owner's top edge the bar has to sit to clear the
189
- // fixed bar. Never negative: an owner already below the bar keeps its
190
- // chrome flush with its own top edge rather than being pulled up into it.
191
- const wanted = Math.max(0, stripBottomPx - top);
192
- // …but never past the owner's own bottom edge either. Once the owner has
193
- // scrolled far enough that the bar would otherwise hang below it, the bar
194
- // rides out with its owner instead of sticking to the top of the screen
195
- // over whatever the reader is actually looking at. This also caps the
196
- // per-scroll churn: for anything well above the fold the offset stops
197
- // changing, and the style writes stop with it.
198
- const maxInsideOwner = Math.max(0, height - CHROME_ROW_PX);
199
- // Rounded so sub-pixel rects (browser zoom, fractional layouts) don't
200
- // re-render on every frame of a scroll that hasn't moved a whole pixel.
201
- setClampOffsetPx(Math.round(Math.min(wanted, maxInsideOwner)));
202
- }
203
- // ── Horizontal: clear the open palette rail (kywi-cms#132) ────────────
204
- if (!paletteOpen || left >= railWidthPx) {
205
- // A closed palette, or an owner (a centred container, an inset band)
206
- // that already starts to the right of the rail — the ordinary
207
- // left-edge position is reachable, so leave it alone.
208
- setRailAvoidOffsetPx(null);
209
- }
210
- else {
211
- // Full-width owners are the case in the issue: left 0, so the chrome
212
- // needs the rail's whole width. A partly-covered owner needs only the
213
- // overlap.
214
- const wanted = railWidthPx - left;
215
- // Capped so the bar's left edge stays inside the owner it belongs to.
216
- // A band narrower than the rail plus a usable strip keeps whatever room
217
- // it has; pushing further would start the bar past the band's own right
218
- // edge, over the section beside it.
219
- const maxInsideOwner = Math.max(0, width - CHROME_MIN_WIDTH_PX);
220
- // Rounded AWAY from each obstacle, not to the nearest pixel. A
221
- // fractional owner left (zoom, a centred layout on an odd viewport)
222
- // rounded to nearest can land the bar half a pixel back INSIDE the rail
223
- // — owner left 124.6 + round(107.4) = 231.6, against a rail that ends at
224
- // 232 — which is both visibly clipped and a real hit-test failure at the
225
- // bar's left edge. `ceil` on the push clears the rail; `floor` on the
226
- // cap keeps the guarantee above (≥200px of owner to the bar's right)
227
- // rather than overshooting it by the same sub-pixel.
228
- setRailAvoidOffsetPx(Math.min(Math.ceil(wanted), Math.floor(maxInsideOwner)));
229
- }
230
- };
358
+ // A stable wrapper, so add and remove are the same function across the
359
+ // whole life of the subscription however often `measureRef` is reassigned.
360
+ const measure = () => measureRef.current();
231
361
  measure();
232
362
  // `capture: true` so a scroll inside any nested scroll container on the
233
363
  // host page counts too — `scroll` does not bubble, but the capture phase
@@ -266,32 +396,73 @@ export function useChromeFlip(ownerRef, enabled = true, paletteOpen = false) {
266
396
  window.removeEventListener('resize', measure, listenerOptions);
267
397
  observer?.disconnect();
268
398
  };
269
- }, [ownerRef, enabled, paletteOpen]);
270
- return React.useMemo(() => ({ clampPx: clampOffsetPx, railAvoidPx: railAvoidOffsetPx }), [clampOffsetPx, railAvoidOffsetPx]);
399
+ }, [ownerRef, enabled]);
400
+ // ── Rails: re-measure when one opens or closes, and only then ─────────────
401
+ //
402
+ // A rail toggle changes nothing about the owner's geometry, so neither the
403
+ // scroll listener nor the `ResizeObserver` above would ever notice it — which
404
+ // is why this needs an effect of its own rather than none at all. It re-reads
405
+ // the rail widths first: a toggle is the one moment a theme override could
406
+ // have changed them, and it is cheap here in a way it would not be per frame.
407
+ //
408
+ // Runs on mount too, harmlessly: the listener effect's own first `measure()`
409
+ // has already run with the fallback widths, and React bails out of a state
410
+ // write that does not change the value, so the second pass costs a rect read
411
+ // and no render.
412
+ React.useEffect(() => {
413
+ if (!enabled || typeof window === 'undefined')
414
+ return;
415
+ railWidthsRef.current = {
416
+ leftPx: readRailWidthPx('--kywi-overlay-rail-left', RAIL_WIDTH_FALLBACK_PX),
417
+ rightPx: readRailWidthPx('--kywi-overlay-rail-right', RIGHT_RAIL_WIDTH_FALLBACK_PX),
418
+ };
419
+ measureRef.current();
420
+ }, [enabled, paletteOpen, propsRailOpen]);
421
+ return React.useMemo(() => ({
422
+ clampPx: clampOffsetPx,
423
+ railAvoidPx: railAvoidOffsetPx,
424
+ railAvoidRightPx: railAvoidRightOffsetPx,
425
+ }), [clampOffsetPx, railAvoidOffsetPx, railAvoidRightOffsetPx]);
426
+ }
427
+ /**
428
+ * The horizontal offset a bar pinned to `anchor` is allowed to take — the other
429
+ * edge's is dropped rather than applied. See {@link ChromeAnchor} for why that
430
+ * is a correctness rule and not tidiness.
431
+ */
432
+ function horizontalOffsetFor(offsets, anchor) {
433
+ return anchor === 'right' ? offsets.railAvoidRightPx : offsets.railAvoidPx;
271
434
  }
272
435
  /**
273
436
  * The modifier classes the measured offsets ask for, in the order the CSS
274
- * expects them. Shared by both consumers (`SectionOverlay` and
275
- * `VariantContainerBlock`) so a third one cannot half-implement the contract.
437
+ * expects them. Shared by every consumer (`SectionOverlay`,
438
+ * `VariantContainerBlock`, `ModuleVariantContainerBlock`, `ModuleOverlay`) so a
439
+ * new one cannot half-implement the contract.
440
+ *
441
+ * @param anchor which edge the bar is pinned to; `left` for everything the
442
+ * original geometry was written for, `right` for the module-level container's
443
+ * bar and the module action cluster (kywi-cms#166).
276
444
  */
277
- export function chromeOffsetClasses(offsets) {
445
+ export function chromeOffsetClasses(offsets, anchor = 'left') {
278
446
  const classes = [];
279
447
  if (offsets.clampPx !== null)
280
448
  classes.push('kywi-ip-chrome--clamped');
281
- if (offsets.railAvoidPx !== null)
282
- classes.push('kywi-ip-chrome--rail-avoid');
449
+ if (horizontalOffsetFor(offsets, anchor) !== null) {
450
+ classes.push(anchor === 'right' ? 'kywi-ip-chrome--rail-avoid-right' : 'kywi-ip-chrome--rail-avoid');
451
+ }
283
452
  return classes;
284
453
  }
285
454
  /**
286
- * The custom properties those classes read, or undefined when neither offset
287
- * applies (so the element keeps no `style` attribute at all in the common case).
455
+ * The custom properties those classes read, or undefined when no offset applies
456
+ * (so the element keeps no `style` attribute at all in the common case).
288
457
  */
289
- export function chromeOffsetStyle(offsets) {
290
- if (offsets.clampPx === null && offsets.railAvoidPx === null)
458
+ export function chromeOffsetStyle(offsets, anchor = 'left') {
459
+ const horizontalPx = horizontalOffsetFor(offsets, anchor);
460
+ if (offsets.clampPx === null && horizontalPx === null)
291
461
  return undefined;
462
+ const horizontalVar = anchor === 'right' ? '--kywi-ip-chrome-right' : '--kywi-ip-chrome-left';
292
463
  return {
293
464
  ...(offsets.clampPx !== null ? { '--kywi-ip-chrome-clamp': `${offsets.clampPx}px` } : {}),
294
- ...(offsets.railAvoidPx !== null ? { '--kywi-ip-chrome-left': `${offsets.railAvoidPx}px` } : {}),
465
+ ...(horizontalPx !== null ? { [horizontalVar]: `${horizontalPx}px` } : {}),
295
466
  };
296
467
  }
297
468
  //# sourceMappingURL=use-chrome-flip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-chrome-flip.js","sourceRoot":"","sources":["../../../src/admin/layout-editor/use-chrome-flip.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,KAAK,M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MAAM,CAAC,CAAA;IACzD,IAAI,OAAO,CAAC,OAAO,KAAK,IAAI,IAAI,YAAY,KAAK,IAAI;QAAE,OAAO,SAAS,CAAA;IACvE,MAAM,aAAa,GAAG,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,uBAAuB,CAAA;IAC7F,OAAO;QACL,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,wBAAwB,EAAE,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzF,GAAG,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,EAAE,GAAG,YAAY,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpD,CAAA;AAC1B,CAAC"}
@@ -31,11 +31,24 @@ export interface ComponentConnect {
31
31
  saveModule: (moduleId: string) => void;
32
32
  saveSection: (sectionId: string) => void;
33
33
  saveVariantContainer: (containerId: string) => void;
34
+ /** Save the selected MODULE-level container as a component (kywi-cms#170). */
35
+ saveModuleVariantContainer: (containerId: string) => void;
34
36
  detachModule: (moduleId: string) => void;
35
37
  detachSection: (sectionId: string) => void;
36
38
  detachVariantContainer: (containerId: string) => void;
39
+ detachModuleVariantContainer: (containerId: string) => void;
37
40
  /** Point an unlinked `component` placeholder node at a saved component. */
38
41
  linkModule: (moduleId: string, componentId: string) => void;
42
+ /**
43
+ * Place a saved `moduleVariantContainer` component where an unlinked
44
+ * `component` placeholder sits (kywi-cms#170, owner decision D2).
45
+ *
46
+ * The placeholder is the "Insert component" gesture a column already has, and
47
+ * a module container is a column node — so placing one is the same gesture with
48
+ * a different answer: the placeholder cannot simply GROW a link (it is a
49
+ * `ModuleNode`, and a container is not one), so it is replaced.
50
+ */
51
+ placeModuleVariantContainer: (placeholderId: string, componentId: string) => void;
39
52
  /**
40
53
  * Does this node live inside ANOTHER node's linked component instance?
41
54
  *
@@ -1 +1 @@
1
- {"version":3,"file":"use-component-connect.d.ts","sourceRoot":"","sources":["../../../src/admin/layout-editor/use-component-connect.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,cAAc,EAA+C,MAAM,uBAAuB,CAAA;AAGxG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAiBrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,4BAA4B,CAAA;AAEnF;;;;;;;;;;GAUG;AAEH,UAAU,oBAAoB;IAC5B,MAAM,EAAE,cAAc,CAAA;IACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAA;IACtC,OAAO,EAAE,gBAAgB,CAAA;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,WAAW,EAAE,oBAAoB,CAAA;IACjC,8EAA8E;IAC9E,MAAM,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IACnD,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,sBAAsB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IACrD,2EAA2E;IAC3E,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3D;;;;;;;;;OASG;IACH,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAA;CACrD;AAQD;;;;;;;;;;GAUG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAY1E;AAqDD,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,QAAQ,EACR,OAAO,GACR,EAAE,oBAAoB,GAAG,gBAAgB,CA+TzC"}
1
+ {"version":3,"file":"use-component-connect.d.ts","sourceRoot":"","sources":["../../../src/admin/layout-editor/use-component-connect.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EACV,cAAc,EAKf,MAAM,uBAAuB,CAAA;AAG9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAoBrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,4BAA4B,CAAA;AAEnF;;;;;;;;;;GAUG;AAEH,UAAU,oBAAoB;IAC5B,MAAM,EAAE,cAAc,CAAA;IACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAA;IACtC,OAAO,EAAE,gBAAgB,CAAA;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,WAAW,EAAE,oBAAoB,CAAA;IACjC,8EAA8E;IAC9E,MAAM,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IACnD,8EAA8E;IAC9E,0BAA0B,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IACzD,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;I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