@prenta/admin 0.92.0 → 0.93.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 (374) hide show
  1. package/CHANGELOG.md +552 -0
  2. package/design-system/tokens.css +173 -71
  3. package/design-system/tokens.json +244 -63
  4. package/design-system/tokens.scss +203 -98
  5. package/design-system/tokens.tailwind.cjs +93 -38
  6. package/dist/AdminRoot.d.ts +27 -6
  7. package/dist/AdminRoot.d.ts.map +1 -1
  8. package/dist/AdminRoot.js.map +1 -1
  9. package/dist/__tests__/components/breakpoint-controls.render.test.d.ts +2 -0
  10. package/dist/__tests__/components/breakpoint-controls.render.test.d.ts.map +1 -0
  11. package/dist/__tests__/components/breakpoint-controls.render.test.js +51 -0
  12. package/dist/__tests__/components/breakpoint-controls.render.test.js.map +1 -0
  13. package/dist/__tests__/components/canvas-edit-tip.render.test.d.ts +2 -0
  14. package/dist/__tests__/components/canvas-edit-tip.render.test.d.ts.map +1 -0
  15. package/dist/__tests__/components/canvas-edit-tip.render.test.js +37 -0
  16. package/dist/__tests__/components/canvas-edit-tip.render.test.js.map +1 -0
  17. package/dist/__tests__/components/editor-rail.render.test.d.ts +2 -0
  18. package/dist/__tests__/components/editor-rail.render.test.d.ts.map +1 -0
  19. package/dist/__tests__/components/editor-rail.render.test.js +138 -0
  20. package/dist/__tests__/components/editor-rail.render.test.js.map +1 -0
  21. package/dist/__tests__/components/media-block.render.test.d.ts +2 -0
  22. package/dist/__tests__/components/media-block.render.test.d.ts.map +1 -0
  23. package/dist/__tests__/components/media-block.render.test.js +108 -0
  24. package/dist/__tests__/components/media-block.render.test.js.map +1 -0
  25. package/dist/__tests__/components/page-audit-panel.render.test.d.ts +2 -0
  26. package/dist/__tests__/components/page-audit-panel.render.test.d.ts.map +1 -0
  27. package/dist/__tests__/components/page-audit-panel.render.test.js +59 -0
  28. package/dist/__tests__/components/page-audit-panel.render.test.js.map +1 -0
  29. package/dist/__tests__/components/reflow-meter.render.test.d.ts +2 -0
  30. package/dist/__tests__/components/reflow-meter.render.test.d.ts.map +1 -0
  31. package/dist/__tests__/components/reflow-meter.render.test.js +94 -0
  32. package/dist/__tests__/components/reflow-meter.render.test.js.map +1 -0
  33. package/dist/__tests__/components/seo-char-count.test.js +24 -6
  34. package/dist/__tests__/components/seo-char-count.test.js.map +1 -1
  35. package/dist/__tests__/components/serp-preview.render.test.d.ts +2 -0
  36. package/dist/__tests__/components/serp-preview.render.test.d.ts.map +1 -0
  37. package/dist/__tests__/components/serp-preview.render.test.js +25 -0
  38. package/dist/__tests__/components/serp-preview.render.test.js.map +1 -0
  39. package/dist/__tests__/lib/breakpoints.test.d.ts +2 -0
  40. package/dist/__tests__/lib/breakpoints.test.d.ts.map +1 -0
  41. package/dist/__tests__/lib/breakpoints.test.js +67 -0
  42. package/dist/__tests__/lib/breakpoints.test.js.map +1 -0
  43. package/dist/__tests__/lib/canvas-edit-chrome.test.d.ts +2 -0
  44. package/dist/__tests__/lib/canvas-edit-chrome.test.d.ts.map +1 -0
  45. package/dist/__tests__/lib/canvas-edit-chrome.test.js +44 -0
  46. package/dist/__tests__/lib/canvas-edit-chrome.test.js.map +1 -0
  47. package/dist/__tests__/lib/media-format.test.d.ts +2 -0
  48. package/dist/__tests__/lib/media-format.test.d.ts.map +1 -0
  49. package/dist/__tests__/lib/media-format.test.js +70 -0
  50. package/dist/__tests__/lib/media-format.test.js.map +1 -0
  51. package/dist/__tests__/lib/page-audit-input.test.d.ts +2 -0
  52. package/dist/__tests__/lib/page-audit-input.test.d.ts.map +1 -0
  53. package/dist/__tests__/lib/page-audit-input.test.js +122 -0
  54. package/dist/__tests__/lib/page-audit-input.test.js.map +1 -0
  55. package/dist/__tests__/lib/page-editor-service.test.js +2 -0
  56. package/dist/__tests__/lib/page-editor-service.test.js.map +1 -1
  57. package/dist/__tests__/lib/page-redirect.test.d.ts +2 -0
  58. package/dist/__tests__/lib/page-redirect.test.d.ts.map +1 -0
  59. package/dist/__tests__/lib/page-redirect.test.js +26 -0
  60. package/dist/__tests__/lib/page-redirect.test.js.map +1 -0
  61. package/dist/__tests__/lib/rail-width.test.d.ts +2 -0
  62. package/dist/__tests__/lib/rail-width.test.d.ts.map +1 -0
  63. package/dist/__tests__/lib/rail-width.test.js +69 -0
  64. package/dist/__tests__/lib/rail-width.test.js.map +1 -0
  65. package/dist/__tests__/lib/reflow-baseline.test.d.ts +2 -0
  66. package/dist/__tests__/lib/reflow-baseline.test.d.ts.map +1 -0
  67. package/dist/__tests__/lib/reflow-baseline.test.js +56 -0
  68. package/dist/__tests__/lib/reflow-baseline.test.js.map +1 -0
  69. package/dist/__tests__/lib/reflow-probe.test.d.ts +2 -0
  70. package/dist/__tests__/lib/reflow-probe.test.d.ts.map +1 -0
  71. package/dist/__tests__/lib/reflow-probe.test.js +73 -0
  72. package/dist/__tests__/lib/reflow-probe.test.js.map +1 -0
  73. package/dist/__tests__/styles/canvas-container-queries.test.d.ts +2 -0
  74. package/dist/__tests__/styles/canvas-container-queries.test.d.ts.map +1 -0
  75. package/dist/__tests__/styles/canvas-container-queries.test.js +87 -0
  76. package/dist/__tests__/styles/canvas-container-queries.test.js.map +1 -0
  77. package/dist/__tests__/styles/packaging.test.d.ts +2 -0
  78. package/dist/__tests__/styles/packaging.test.d.ts.map +1 -0
  79. package/dist/__tests__/styles/packaging.test.js +31 -0
  80. package/dist/__tests__/styles/packaging.test.js.map +1 -0
  81. package/dist/__tests__/styles/tokens-drift.test.d.ts +2 -0
  82. package/dist/__tests__/styles/tokens-drift.test.d.ts.map +1 -0
  83. package/dist/__tests__/styles/tokens-drift.test.js +92 -0
  84. package/dist/__tests__/styles/tokens-drift.test.js.map +1 -0
  85. package/dist/__tests__/views/admin-renderer-compat.test.d.ts +2 -0
  86. package/dist/__tests__/views/admin-renderer-compat.test.d.ts.map +1 -0
  87. package/dist/__tests__/views/admin-renderer-compat.test.js +43 -0
  88. package/dist/__tests__/views/admin-renderer-compat.test.js.map +1 -0
  89. package/dist/__tests__/views/admin-section-renderers.test.js +52 -4
  90. package/dist/__tests__/views/admin-section-renderers.test.js.map +1 -1
  91. package/dist/__tests__/views/editor-top-bar.render.test.js +1 -1
  92. package/dist/__tests__/views/editor-top-bar.render.test.js.map +1 -1
  93. package/dist/__tests__/views/page-tab.render.test.d.ts +2 -0
  94. package/dist/__tests__/views/page-tab.render.test.d.ts.map +1 -0
  95. package/dist/__tests__/views/page-tab.render.test.js +151 -0
  96. package/dist/__tests__/views/page-tab.render.test.js.map +1 -0
  97. package/dist/__tests__/views/section-class-parity.test.d.ts +2 -0
  98. package/dist/__tests__/views/section-class-parity.test.d.ts.map +1 -0
  99. package/dist/__tests__/views/section-class-parity.test.js +81 -0
  100. package/dist/__tests__/views/section-class-parity.test.js.map +1 -0
  101. package/dist/__tests__/views/sections-panel-design-owned.render.test.d.ts +2 -0
  102. package/dist/__tests__/views/sections-panel-design-owned.render.test.d.ts.map +1 -0
  103. package/dist/__tests__/views/sections-panel-design-owned.render.test.js +86 -0
  104. package/dist/__tests__/views/sections-panel-design-owned.render.test.js.map +1 -0
  105. package/dist/components/BreakpointPicker.d.ts +18 -0
  106. package/dist/components/BreakpointPicker.d.ts.map +1 -0
  107. package/dist/components/BreakpointPicker.js +31 -0
  108. package/dist/components/BreakpointPicker.js.map +1 -0
  109. package/dist/components/CanvasEditTip.d.ts +6 -0
  110. package/dist/components/CanvasEditTip.d.ts.map +1 -0
  111. package/dist/components/CanvasEditTip.js +22 -0
  112. package/dist/components/CanvasEditTip.js.map +1 -0
  113. package/dist/components/EditorRail.d.ts +36 -0
  114. package/dist/components/EditorRail.d.ts.map +1 -0
  115. package/dist/components/EditorRail.js +104 -0
  116. package/dist/components/EditorRail.js.map +1 -0
  117. package/dist/components/EditorRailTabs.d.ts +32 -0
  118. package/dist/components/EditorRailTabs.d.ts.map +1 -0
  119. package/dist/components/EditorRailTabs.js +45 -0
  120. package/dist/components/EditorRailTabs.js.map +1 -0
  121. package/dist/components/MediaBlock.d.ts +49 -0
  122. package/dist/components/MediaBlock.d.ts.map +1 -0
  123. package/dist/components/MediaBlock.js +50 -0
  124. package/dist/components/MediaBlock.js.map +1 -0
  125. package/dist/components/ReflowMeter.d.ts +28 -0
  126. package/dist/components/ReflowMeter.d.ts.map +1 -0
  127. package/dist/components/ReflowMeter.js +42 -0
  128. package/dist/components/ReflowMeter.js.map +1 -0
  129. package/dist/components/ZoomChip.d.ts +17 -0
  130. package/dist/components/ZoomChip.d.ts.map +1 -0
  131. package/dist/components/ZoomChip.js +17 -0
  132. package/dist/components/ZoomChip.js.map +1 -0
  133. package/dist/components/breakpoint-icons.d.ts +3 -0
  134. package/dist/components/breakpoint-icons.d.ts.map +1 -0
  135. package/dist/components/breakpoint-icons.js +16 -0
  136. package/dist/components/breakpoint-icons.js.map +1 -0
  137. package/dist/components/page-tab/AuthorPicker.d.ts +31 -0
  138. package/dist/components/page-tab/AuthorPicker.d.ts.map +1 -0
  139. package/dist/components/page-tab/AuthorPicker.js +95 -0
  140. package/dist/components/page-tab/AuthorPicker.js.map +1 -0
  141. package/dist/components/page-tab/DirectiveSwitch.d.ts +38 -0
  142. package/dist/components/page-tab/DirectiveSwitch.d.ts.map +1 -0
  143. package/dist/components/page-tab/DirectiveSwitch.js +29 -0
  144. package/dist/components/page-tab/DirectiveSwitch.js.map +1 -0
  145. package/dist/components/seo/EditorSeoScoreBadge.d.ts +8 -1
  146. package/dist/components/seo/EditorSeoScoreBadge.d.ts.map +1 -1
  147. package/dist/components/seo/EditorSeoScoreBadge.js +2 -2
  148. package/dist/components/seo/EditorSeoScoreBadge.js.map +1 -1
  149. package/dist/components/seo/PageAuditPanel.d.ts +14 -0
  150. package/dist/components/seo/PageAuditPanel.d.ts.map +1 -0
  151. package/dist/components/seo/PageAuditPanel.js +59 -0
  152. package/dist/components/seo/PageAuditPanel.js.map +1 -0
  153. package/dist/components/seo/SeoCharCount.d.ts +19 -7
  154. package/dist/components/seo/SeoCharCount.d.ts.map +1 -1
  155. package/dist/components/seo/SeoCharCount.js +30 -16
  156. package/dist/components/seo/SeoCharCount.js.map +1 -1
  157. package/dist/components/seo/SeoEditorPane.d.ts +15 -1
  158. package/dist/components/seo/SeoEditorPane.d.ts.map +1 -1
  159. package/dist/components/seo/SeoEditorPane.js +118 -21
  160. package/dist/components/seo/SeoEditorPane.js.map +1 -1
  161. package/dist/components/seo/SerpPreview.d.ts +20 -0
  162. package/dist/components/seo/SerpPreview.d.ts.map +1 -0
  163. package/dist/components/seo/SerpPreview.js +6 -0
  164. package/dist/components/seo/SerpPreview.js.map +1 -0
  165. package/dist/hooks/usePageAudit.d.ts +41 -0
  166. package/dist/hooks/usePageAudit.d.ts.map +1 -0
  167. package/dist/hooks/usePageAudit.js +68 -0
  168. package/dist/hooks/usePageAudit.js.map +1 -0
  169. package/dist/hooks/useReflowGuard.d.ts +47 -0
  170. package/dist/hooks/useReflowGuard.d.ts.map +1 -0
  171. package/dist/hooks/useReflowGuard.js +52 -0
  172. package/dist/hooks/useReflowGuard.js.map +1 -0
  173. package/dist/lib/breakpoints.d.ts +51 -0
  174. package/dist/lib/breakpoints.d.ts.map +1 -0
  175. package/dist/lib/breakpoints.js +84 -0
  176. package/dist/lib/breakpoints.js.map +1 -0
  177. package/dist/lib/canvas-edit-chrome.d.ts +22 -0
  178. package/dist/lib/canvas-edit-chrome.d.ts.map +1 -0
  179. package/dist/lib/canvas-edit-chrome.js +81 -0
  180. package/dist/lib/canvas-edit-chrome.js.map +1 -0
  181. package/dist/lib/media-format.d.ts +55 -0
  182. package/dist/lib/media-format.d.ts.map +1 -0
  183. package/dist/lib/media-format.js +93 -0
  184. package/dist/lib/media-format.js.map +1 -0
  185. package/dist/lib/page-audit-input.d.ts +45 -0
  186. package/dist/lib/page-audit-input.d.ts.map +1 -0
  187. package/dist/lib/page-audit-input.js +53 -0
  188. package/dist/lib/page-audit-input.js.map +1 -0
  189. package/dist/lib/page-editor-service.d.ts +12 -0
  190. package/dist/lib/page-editor-service.d.ts.map +1 -1
  191. package/dist/lib/page-editor-service.js +6 -0
  192. package/dist/lib/page-editor-service.js.map +1 -1
  193. package/dist/lib/page-redirect.d.ts +39 -0
  194. package/dist/lib/page-redirect.d.ts.map +1 -0
  195. package/dist/lib/page-redirect.js +38 -0
  196. package/dist/lib/page-redirect.js.map +1 -0
  197. package/dist/lib/rail-width.d.ts +23 -0
  198. package/dist/lib/rail-width.d.ts.map +1 -0
  199. package/dist/lib/rail-width.js +59 -0
  200. package/dist/lib/rail-width.js.map +1 -0
  201. package/dist/lib/reflow-baseline.d.ts +45 -0
  202. package/dist/lib/reflow-baseline.d.ts.map +1 -0
  203. package/dist/lib/reflow-baseline.js +38 -0
  204. package/dist/lib/reflow-baseline.js.map +1 -0
  205. package/dist/lib/reflow-probe.d.ts +159 -0
  206. package/dist/lib/reflow-probe.d.ts.map +1 -0
  207. package/dist/lib/reflow-probe.js +228 -0
  208. package/dist/lib/reflow-probe.js.map +1 -0
  209. package/dist/lib/seo-service.d.ts +10 -0
  210. package/dist/lib/seo-service.d.ts.map +1 -1
  211. package/dist/lib/seo-service.js.map +1 -1
  212. package/dist/prenta-admin.css +1 -1
  213. package/dist/views/page-editor/CanvasMetaLine.d.ts +19 -0
  214. package/dist/views/page-editor/CanvasMetaLine.d.ts.map +1 -0
  215. package/dist/views/page-editor/CanvasMetaLine.js +23 -0
  216. package/dist/views/page-editor/CanvasMetaLine.js.map +1 -0
  217. package/dist/views/page-editor/EditorCanvas.d.ts +34 -8
  218. package/dist/views/page-editor/EditorCanvas.d.ts.map +1 -1
  219. package/dist/views/page-editor/EditorCanvas.js +68 -34
  220. package/dist/views/page-editor/EditorCanvas.js.map +1 -1
  221. package/dist/views/page-editor/EditorTopBar.d.ts +14 -1
  222. package/dist/views/page-editor/EditorTopBar.d.ts.map +1 -1
  223. package/dist/views/page-editor/EditorTopBar.js +8 -17
  224. package/dist/views/page-editor/EditorTopBar.js.map +1 -1
  225. package/dist/views/page-editor/PageSectionEditor.d.ts.map +1 -1
  226. package/dist/views/page-editor/PageSectionEditor.js +275 -53
  227. package/dist/views/page-editor/PageSectionEditor.js.map +1 -1
  228. package/dist/views/page-editor/PageTab.d.ts +36 -0
  229. package/dist/views/page-editor/PageTab.d.ts.map +1 -0
  230. package/dist/views/page-editor/PageTab.js +65 -0
  231. package/dist/views/page-editor/PageTab.js.map +1 -0
  232. package/dist/views/page-editor/SectionInspector.d.ts.map +1 -1
  233. package/dist/views/page-editor/SectionInspector.js +63 -19
  234. package/dist/views/page-editor/SectionInspector.js.map +1 -1
  235. package/dist/views/page-editor/SectionsPanel.d.ts +30 -5
  236. package/dist/views/page-editor/SectionsPanel.d.ts.map +1 -1
  237. package/dist/views/page-editor/SectionsPanel.js +38 -7
  238. package/dist/views/page-editor/SectionsPanel.js.map +1 -1
  239. package/dist/views/page-editor/SitePreviewFrame.d.ts.map +1 -1
  240. package/dist/views/page-editor/SitePreviewFrame.js +3 -0
  241. package/dist/views/page-editor/SitePreviewFrame.js.map +1 -1
  242. package/dist/views/page-editor/reflow-context.d.ts +28 -0
  243. package/dist/views/page-editor/reflow-context.d.ts.map +1 -0
  244. package/dist/views/page-editor/reflow-context.js +14 -0
  245. package/dist/views/page-editor/reflow-context.js.map +1 -0
  246. package/dist/views/page-editor/sections/ByTheNumbersSection.d.ts.map +1 -1
  247. package/dist/views/page-editor/sections/ByTheNumbersSection.js +1 -1
  248. package/dist/views/page-editor/sections/ByTheNumbersSection.js.map +1 -1
  249. package/dist/views/page-editor/sections/CtaBannerSection.d.ts.map +1 -1
  250. package/dist/views/page-editor/sections/CtaBannerSection.js +1 -1
  251. package/dist/views/page-editor/sections/CtaBannerSection.js.map +1 -1
  252. package/dist/views/page-editor/sections/FeatureHighlightSection.d.ts.map +1 -1
  253. package/dist/views/page-editor/sections/FeatureHighlightSection.js +2 -2
  254. package/dist/views/page-editor/sections/FeatureHighlightSection.js.map +1 -1
  255. package/dist/views/page-editor/sections/GallerySection.d.ts.map +1 -1
  256. package/dist/views/page-editor/sections/GallerySection.js +7 -3
  257. package/dist/views/page-editor/sections/GallerySection.js.map +1 -1
  258. package/dist/views/page-editor/sections/HeroBannerSection.js +1 -1
  259. package/dist/views/page-editor/sections/HeroBannerSection.js.map +1 -1
  260. package/dist/views/page-editor/sections/MissionSection.d.ts.map +1 -1
  261. package/dist/views/page-editor/sections/MissionSection.js +1 -1
  262. package/dist/views/page-editor/sections/MissionSection.js.map +1 -1
  263. package/dist/views/page-editor/sections/PullQuoteSection.d.ts.map +1 -1
  264. package/dist/views/page-editor/sections/PullQuoteSection.js +1 -1
  265. package/dist/views/page-editor/sections/PullQuoteSection.js.map +1 -1
  266. package/dist/views/page-editor/sections/RelatedPostsSection.d.ts.map +1 -1
  267. package/dist/views/page-editor/sections/RelatedPostsSection.js +1 -1
  268. package/dist/views/page-editor/sections/RelatedPostsSection.js.map +1 -1
  269. package/dist/views/page-editor/sections/SectionRenderer.d.ts.map +1 -1
  270. package/dist/views/page-editor/sections/SectionRenderer.js +49 -24
  271. package/dist/views/page-editor/sections/SectionRenderer.js.map +1 -1
  272. package/dist/views/page-editor/sections/admin-renderers.d.ts +47 -15
  273. package/dist/views/page-editor/sections/admin-renderers.d.ts.map +1 -1
  274. package/dist/views/page-editor/sections/admin-renderers.js +27 -15
  275. package/dist/views/page-editor/sections/admin-renderers.js.map +1 -1
  276. package/dist/views/page-editor/sections/parts.d.ts +0 -1
  277. package/dist/views/page-editor/sections/parts.d.ts.map +1 -1
  278. package/dist/views/page-editor/sections/parts.js +41 -16
  279. package/dist/views/page-editor/sections/parts.js.map +1 -1
  280. package/dist/views/page-editor/viewports.d.ts +7 -14
  281. package/dist/views/page-editor/viewports.d.ts.map +1 -1
  282. package/dist/views/page-editor/viewports.js +7 -12
  283. package/dist/views/page-editor/viewports.js.map +1 -1
  284. package/dist/views/post-editor/PostEditorCanvas.d.ts +2 -1
  285. package/dist/views/post-editor/PostEditorCanvas.d.ts.map +1 -1
  286. package/dist/views/post-editor/PostEditorCanvas.js +5 -2
  287. package/dist/views/post-editor/PostEditorCanvas.js.map +1 -1
  288. package/dist/views/post-editor/PostSectionEditor.d.ts.map +1 -1
  289. package/dist/views/post-editor/PostSectionEditor.js +2 -20
  290. package/dist/views/post-editor/PostSectionEditor.js.map +1 -1
  291. package/dist/views/post-editor/PostTemplateEditor.d.ts.map +1 -1
  292. package/dist/views/post-editor/PostTemplateEditor.js +4 -1
  293. package/dist/views/post-editor/PostTemplateEditor.js.map +1 -1
  294. package/package.json +5 -3
  295. package/src/AdminRoot.tsx +27 -6
  296. package/src/__tests__/components/breakpoint-controls.render.test.tsx +57 -0
  297. package/src/__tests__/components/canvas-edit-tip.render.test.tsx +41 -0
  298. package/src/__tests__/components/editor-rail.render.test.tsx +192 -0
  299. package/src/__tests__/components/media-block.render.test.tsx +126 -0
  300. package/src/__tests__/components/page-audit-panel.render.test.tsx +64 -0
  301. package/src/__tests__/components/reflow-meter.render.test.tsx +144 -0
  302. package/src/__tests__/components/seo-char-count.test.tsx +26 -6
  303. package/src/__tests__/components/serp-preview.render.test.tsx +32 -0
  304. package/src/__tests__/lib/breakpoints.test.ts +84 -0
  305. package/src/__tests__/lib/canvas-edit-chrome.test.ts +56 -0
  306. package/src/__tests__/lib/media-format.test.ts +89 -0
  307. package/src/__tests__/lib/page-audit-input.test.ts +144 -0
  308. package/src/__tests__/lib/page-editor-service.test.ts +2 -0
  309. package/src/__tests__/lib/page-redirect.test.ts +29 -0
  310. package/src/__tests__/lib/rail-width.test.ts +86 -0
  311. package/src/__tests__/lib/reflow-baseline.test.ts +64 -0
  312. package/src/__tests__/lib/reflow-probe.test.ts +95 -0
  313. package/src/__tests__/styles/canvas-container-queries.test.ts +103 -0
  314. package/src/__tests__/styles/packaging.test.ts +38 -0
  315. package/src/__tests__/styles/tokens-drift.test.ts +110 -0
  316. package/src/__tests__/views/admin-renderer-compat.test.ts +48 -0
  317. package/src/__tests__/views/admin-section-renderers.test.tsx +70 -4
  318. package/src/__tests__/views/editor-top-bar.render.test.tsx +1 -1
  319. package/src/__tests__/views/page-tab.render.test.tsx +226 -0
  320. package/src/__tests__/views/section-class-parity.test.ts +98 -0
  321. package/src/__tests__/views/sections-panel-design-owned.render.test.tsx +104 -0
  322. package/src/components/BreakpointPicker.tsx +114 -0
  323. package/src/components/CanvasEditTip.tsx +46 -0
  324. package/src/components/EditorRail.tsx +219 -0
  325. package/src/components/EditorRailTabs.tsx +117 -0
  326. package/src/components/MediaBlock.tsx +223 -0
  327. package/src/components/ReflowMeter.tsx +125 -0
  328. package/src/components/ZoomChip.tsx +39 -0
  329. package/src/components/breakpoint-icons.ts +17 -0
  330. package/src/components/page-tab/AuthorPicker.tsx +240 -0
  331. package/src/components/page-tab/DirectiveSwitch.tsx +86 -0
  332. package/src/components/seo/EditorSeoScoreBadge.tsx +9 -1
  333. package/src/components/seo/PageAuditPanel.tsx +192 -0
  334. package/src/components/seo/SeoCharCount.tsx +55 -24
  335. package/src/components/seo/SeoEditorPane.tsx +213 -31
  336. package/src/components/seo/SerpPreview.tsx +41 -0
  337. package/src/hooks/usePageAudit.ts +98 -0
  338. package/src/hooks/useReflowGuard.ts +96 -0
  339. package/src/lib/breakpoints.ts +107 -0
  340. package/src/lib/canvas-edit-chrome.ts +82 -0
  341. package/src/lib/media-format.ts +99 -0
  342. package/src/lib/page-audit-input.ts +104 -0
  343. package/src/lib/page-editor-service.ts +18 -0
  344. package/src/lib/page-redirect.ts +60 -0
  345. package/src/lib/rail-width.ts +58 -0
  346. package/src/lib/reflow-baseline.ts +70 -0
  347. package/src/lib/reflow-probe.ts +299 -0
  348. package/src/lib/seo-service.ts +10 -0
  349. package/src/styles/prenta-tokens.css +120 -42
  350. package/src/styles/theme.css +130 -0
  351. package/src/views/page-editor/CanvasMetaLine.tsx +50 -0
  352. package/src/views/page-editor/EditorCanvas.tsx +109 -50
  353. package/src/views/page-editor/EditorTopBar.tsx +35 -43
  354. package/src/views/page-editor/PageSectionEditor.tsx +419 -148
  355. package/src/views/page-editor/PageTab.tsx +433 -0
  356. package/src/views/page-editor/SectionInspector.tsx +82 -41
  357. package/src/views/page-editor/SectionsPanel.tsx +281 -140
  358. package/src/views/page-editor/SitePreviewFrame.tsx +3 -0
  359. package/src/views/page-editor/reflow-context.ts +43 -0
  360. package/src/views/page-editor/sections/ByTheNumbersSection.tsx +3 -2
  361. package/src/views/page-editor/sections/CtaBannerSection.tsx +3 -1
  362. package/src/views/page-editor/sections/FeatureHighlightSection.tsx +3 -2
  363. package/src/views/page-editor/sections/GallerySection.tsx +7 -3
  364. package/src/views/page-editor/sections/HeroBannerSection.tsx +2 -2
  365. package/src/views/page-editor/sections/MissionSection.tsx +4 -2
  366. package/src/views/page-editor/sections/PullQuoteSection.tsx +3 -1
  367. package/src/views/page-editor/sections/RelatedPostsSection.tsx +2 -1
  368. package/src/views/page-editor/sections/SectionRenderer.tsx +69 -29
  369. package/src/views/page-editor/sections/admin-renderers.tsx +54 -15
  370. package/src/views/page-editor/sections/parts.tsx +46 -18
  371. package/src/views/page-editor/viewports.ts +13 -26
  372. package/src/views/post-editor/PostEditorCanvas.tsx +18 -11
  373. package/src/views/post-editor/PostSectionEditor.tsx +1 -56
  374. package/src/views/post-editor/PostTemplateEditor.tsx +3 -0
@@ -1 +1 @@
1
- {"version":3,"file":"page-editor-service.js","sourceRoot":"","sources":["../../src/lib/page-editor-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EACL,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,IAAI,kBAAkB,EACpC,sBAAsB,GAEvB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,EAAE,uBAAuB,EAAE,MAAM,w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M,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;QAChC,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;KACjD,CAAC,CAAA;IACF,IAAI,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,wBAAwB,CAAC,CAAA;IAClF,OAAO,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,eAA8B,IAAI;IAC1D,OAAO;QACL,EAAE,EAAE,IAAI;QACR,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,OAAO;QACf,YAAY;QACZ,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,cAAc,EAAE,EAAE;QAClB,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,IAAI;QACjB,oBAAoB,EAAE,IAAI;QAC1B,YAAY,EAAE,KAAK;KACpB,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"page-editor-service.js","sourceRoot":"","sources":["../../src/lib/page-editor-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EACL,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,IAAI,kBAAkB,EACpC,sBAAsB,GAEvB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD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moves.
3
+ *
4
+ * ── Why this is offered rather than assumed ───────────────────────────────
5
+ *
6
+ * Changing the slug of a page that is already live breaks every inbound link
7
+ * to it — search results, other sites, someone's bookmarks — and the CMS is the
8
+ * only party that knows the old address. Leaving the editor to remember it
9
+ * afterwards means the 404s are discovered by visitors.
10
+ *
11
+ * It is offered rather than created silently because a redirect is a public,
12
+ * durable artifact: it outlives the page, and a wrong one is harder to notice
13
+ * than a missing one. The editor sees `old → new` and decides.
14
+ */
15
+ export interface SlugChange {
16
+ from: string;
17
+ to: string;
18
+ }
19
+ /**
20
+ * The move worth redirecting, or `null`.
21
+ *
22
+ * `null` when the page has never been live (nothing out there points at the old
23
+ * path), when the path is unchanged, or when either side is empty — a redirect
24
+ * from or to nothing is not a redirect, and posting one would put a broken rule
25
+ * in a table that runs on every request.
26
+ */
27
+ export declare function pendingSlugChange(publishedPath: string | null, currentPath: string): SlugChange | null;
28
+ /**
29
+ * Create the 301.
30
+ *
31
+ * Failure is reported, never swallowed. The page has already moved by the time
32
+ * this runs, so a silently-failed redirect leaves exactly the broken links the
33
+ * switch promised to prevent — and the editor would have no reason to suspect
34
+ * it.
35
+ */
36
+ export declare function createPublishRedirect(change: SlugChange): Promise<{
37
+ error?: string;
38
+ }>;
39
+ //# sourceMappingURL=page-redirect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-redirect.d.ts","sourceRoot":"","sources":["../../src/lib/page-redirect.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;CACX;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,WAAW,EAAE,MAAM,GAClB,UAAU,GAAG,IAAI,CAKnB;AAED;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAY3F"}
@@ -0,0 +1,38 @@
1
+ import { cmsApi } from './api.js';
2
+ /**
3
+ * The move worth redirecting, or `null`.
4
+ *
5
+ * `null` when the page has never been live (nothing out there points at the old
6
+ * path), when the path is unchanged, or when either side is empty — a redirect
7
+ * from or to nothing is not a redirect, and posting one would put a broken rule
8
+ * in a table that runs on every request.
9
+ */
10
+ export function pendingSlugChange(publishedPath, currentPath) {
11
+ const from = (publishedPath ?? '').trim();
12
+ const to = currentPath.trim();
13
+ if (!from || !to || from === to)
14
+ return null;
15
+ return { from, to };
16
+ }
17
+ /**
18
+ * Create the 301.
19
+ *
20
+ * Failure is reported, never swallowed. The page has already moved by the time
21
+ * this runs, so a silently-failed redirect leaves exactly the broken links the
22
+ * switch promised to prevent — and the editor would have no reason to suspect
23
+ * it.
24
+ */
25
+ export async function createPublishRedirect(change) {
26
+ const res = await cmsApi('/redirects', {
27
+ method: 'POST',
28
+ body: JSON.stringify({
29
+ source: change.from,
30
+ destination: change.to,
31
+ statusCode: 301,
32
+ source_kind: 'manual',
33
+ notes: 'Created automatically when the page slug changed on publish.',
34
+ }),
35
+ });
36
+ return res.error ? { error: res.error } : {};
37
+ }
38
+ //# sourceMappingURL=page-redirect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-redirect.js","sourceRoot":"","sources":["../../src/lib/page-redirect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAqBjC;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,aAA4B,EAC5B,WAAmB;IAEnB,MAAM,IAAI,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IACzC,MAAM,EAAE,GAAG,WAAW,CAAC,IAAI,EAAE,CAAA;IAC7B,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,IAAI,CAAA;IAC5C,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAA;AACrB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,MAAkB;IAC5D,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,YAAY,EAAE;QACrC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,MAAM,EAAE,MAAM,CAAC,IAAI;YACnB,WAAW,EAAE,MAAM,CAAC,EAAE;YACtB,UAAU,EAAE,GAAG;YACf,WAAW,EAAE,QAAQ;YACrB,KAAK,EAAE,8DAA8D;SACtE,CAAC;KACH,CAAC,CAAA;IACF,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;AAC9C,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Editor rail sizing — pure logic, no DOM, so the clamping and persistence
3
+ * rules are testable without mounting a resizable panel.
4
+ */
5
+ export declare const RAIL_MIN_WIDTH = 300;
6
+ export declare const RAIL_MAX_WIDTH = 620;
7
+ export declare const RAIL_DEFAULT_WIDTH = 360;
8
+ /** Width of the strip that replaces the rail when it is collapsed. */
9
+ export declare const RAIL_COLLAPSED_WIDTH = 38;
10
+ export declare const RAIL_WIDTH_STORAGE_KEY = "pb.panelW";
11
+ /** Constrain a candidate width to the rail's range, rejecting junk. */
12
+ export declare function clampRailWidth(width: number): number;
13
+ /**
14
+ * Read the persisted width. Anything unreadable — no storage, a value written
15
+ * by an older build, a user editing localStorage — falls back to the default
16
+ * rather than throwing or producing a broken layout.
17
+ *
18
+ * Storage access is wrapped: Safari in private mode throws on `getItem`, and a
19
+ * rail that cannot size itself must not take down the editor.
20
+ */
21
+ export declare function readRailWidth(storage?: Pick<Storage, 'getItem'>): number;
22
+ export declare function writeRailWidth(width: number, storage?: Pick<Storage, 'setItem'>): void;
23
+ //# sourceMappingURL=rail-width.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rail-width.d.ts","sourceRoot":"","sources":["../../src/lib/rail-width.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,cAAc,MAAM,CAAA;AACjC,eAAO,MAAM,cAAc,MAAM,CAAA;AACjC,eAAO,MAAM,kBAAkB,MAAM,CAAA;AAErC,sEAAsE;AACtE,eAAO,MAAM,oBAAoB,KAAK,CAAA;AAEtC,eAAO,MAAM,sBAAsB,cAAc,CAAA;AAEjD,uEAAuE;AACvE,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,MAAM,CAWxE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,IAAI,CAQtF"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Editor rail sizing — pure logic, no DOM, so the clamping and persistence
3
+ * rules are testable without mounting a resizable panel.
4
+ */
5
+ export const RAIL_MIN_WIDTH = 300;
6
+ export const RAIL_MAX_WIDTH = 620;
7
+ export const RAIL_DEFAULT_WIDTH = 360;
8
+ /** Width of the strip that replaces the rail when it is collapsed. */
9
+ export const RAIL_COLLAPSED_WIDTH = 38;
10
+ export const RAIL_WIDTH_STORAGE_KEY = 'pb.panelW';
11
+ /** Constrain a candidate width to the rail's range, rejecting junk. */
12
+ export function clampRailWidth(width) {
13
+ if (!Number.isFinite(width))
14
+ return RAIL_DEFAULT_WIDTH;
15
+ return Math.min(RAIL_MAX_WIDTH, Math.max(RAIL_MIN_WIDTH, Math.round(width)));
16
+ }
17
+ /**
18
+ * Read the persisted width. Anything unreadable — no storage, a value written
19
+ * by an older build, a user editing localStorage — falls back to the default
20
+ * rather than throwing or producing a broken layout.
21
+ *
22
+ * Storage access is wrapped: Safari in private mode throws on `getItem`, and a
23
+ * rail that cannot size itself must not take down the editor.
24
+ */
25
+ export function readRailWidth(storage) {
26
+ const store = storage ?? safeStorage();
27
+ if (!store)
28
+ return RAIL_DEFAULT_WIDTH;
29
+ try {
30
+ const raw = store.getItem(RAIL_WIDTH_STORAGE_KEY);
31
+ if (raw === null)
32
+ return RAIL_DEFAULT_WIDTH;
33
+ const parsed = Number.parseInt(raw, 10);
34
+ return Number.isNaN(parsed) ? RAIL_DEFAULT_WIDTH : clampRailWidth(parsed);
35
+ }
36
+ catch {
37
+ return RAIL_DEFAULT_WIDTH;
38
+ }
39
+ }
40
+ export function writeRailWidth(width, storage) {
41
+ const store = storage ?? safeStorage();
42
+ if (!store)
43
+ return;
44
+ try {
45
+ store.setItem(RAIL_WIDTH_STORAGE_KEY, String(clampRailWidth(width)));
46
+ }
47
+ catch {
48
+ // Quota or private-mode failure. The width still applies for this session.
49
+ }
50
+ }
51
+ function safeStorage() {
52
+ try {
53
+ return typeof localStorage === 'undefined' ? null : localStorage;
54
+ }
55
+ catch {
56
+ return null;
57
+ }
58
+ }
59
+ //# sourceMappingURL=rail-width.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rail-width.js","sourceRoot":"","sources":["../../src/lib/rail-width.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;AACjC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;AACjC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAErC,sEAAsE;AACtE,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAEtC,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAA;AAEjD,uEAAuE;AACvE,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,IAAI,CAAC,MAAM,CAAC,QAAQ,CA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CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC"}
@@ -0,0 +1,45 @@
1
+ import type { PageSection } from '@prenta/core/page-sections';
2
+ /**
3
+ * The content a page's sections had when they were last live.
4
+ *
5
+ * ── What "baseline" means here, and why ───────────────────────────────────
6
+ *
7
+ * The guard answers "will this edit change how the live page wraps?" — so the
8
+ * baseline has to be what is actually on the site, not what was last saved.
9
+ *
10
+ * This CMS has no draft/published split: a document carries one `status` and
11
+ * saving a PUBLISHED page updates the live content in place. So for a published
12
+ * page the live content is whatever the editor loaded, refreshed on every save
13
+ * and publish. For a page that has never been published there is no baseline at
14
+ * all, and the guard reports line counts without deltas — correctly, because
15
+ * there is no live layout to break.
16
+ *
17
+ * Deliberately NOT sourced from the versions API. Versions do hold full
18
+ * snapshots, but they record every update, so finding "the published one" means
19
+ * scanning history and guessing which entry was live — an extra request and a
20
+ * heuristic, to reconstruct something the editor already has in hand.
21
+ */
22
+ export interface ReflowBaseline {
23
+ byId: Map<string, Record<string, unknown>>;
24
+ }
25
+ /**
26
+ * Snapshot section content, or `null` when the page is not live.
27
+ *
28
+ * `null` rather than an empty snapshot: an empty baseline would read as "every
29
+ * field was previously blank" and flag every line of existing copy as newly
30
+ * added.
31
+ */
32
+ export declare function snapshotBaseline(sections: readonly PageSection[], status: string): ReflowBaseline | null;
33
+ /**
34
+ * Resolve a `data-cms-field` path against a baseline.
35
+ *
36
+ * Paths are dotted and may index arrays (`stats.0.label`), matching the markers
37
+ * the renderers emit.
38
+ *
39
+ * Returns `undefined` for anything that is not baseline text — no snapshot, a
40
+ * section added since publish, a field that did not exist, or a non-string
41
+ * value. The guard reads `undefined` as "nothing to compare against" and
42
+ * reports no delta, which is the truthful answer in every one of those cases.
43
+ */
44
+ export declare function baselineFieldText(baseline: ReflowBaseline | null, sectionId: string, fieldPath: string): string | undefined;
45
+ //# sourceMappingURL=reflow-baseline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflow-baseline.d.ts","sourceRoot":"","sources":["../../src/lib/reflow-baseline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAC3C;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,SAAS,WAAW,EAAE,EAChC,MAAM,EAAE,MAAM,GACb,cAAc,GAAG,IAAI,CAKvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,cAAc,GAAG,IAAI,EAC/B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,SAAS,CAWpB"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Snapshot section content, or `null` when the page is not live.
3
+ *
4
+ * `null` rather than an empty snapshot: an empty baseline would read as "every
5
+ * field was previously blank" and flag every line of existing copy as newly
6
+ * added.
7
+ */
8
+ export function snapshotBaseline(sections, status) {
9
+ if (status !== 'PUBLISHED')
10
+ return null;
11
+ return {
12
+ byId: new Map(sections.map((s) => [s.id, { ...(s.content ?? {}) }])),
13
+ };
14
+ }
15
+ /**
16
+ * Resolve a `data-cms-field` path against a baseline.
17
+ *
18
+ * Paths are dotted and may index arrays (`stats.0.label`), matching the markers
19
+ * the renderers emit.
20
+ *
21
+ * Returns `undefined` for anything that is not baseline text — no snapshot, a
22
+ * section added since publish, a field that did not exist, or a non-string
23
+ * value. The guard reads `undefined` as "nothing to compare against" and
24
+ * reports no delta, which is the truthful answer in every one of those cases.
25
+ */
26
+ export function baselineFieldText(baseline, sectionId, fieldPath) {
27
+ const content = baseline?.byId.get(sectionId);
28
+ if (!content)
29
+ return undefined;
30
+ let cursor = content;
31
+ for (const key of fieldPath.split('.')) {
32
+ if (cursor === null || typeof cursor !== 'object')
33
+ return undefined;
34
+ cursor = cursor[key];
35
+ }
36
+ return typeof cursor === 'string' ? cursor : undefined;
37
+ }
38
+ //# sourceMappingURL=reflow-baseline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflow-baseline.js","sourceRoot":"","sources":["../../src/lib/reflow-baseline.ts"],"names":[],"mappings":"AA0BA;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAAgC,EAChC,MAAc;IAEd,IAAI,MAAM,KAAK,WAAW;QAAE,OAAO,IAAI,CAAA;IACvC,OAAO;QACL,IAAI,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KACrE,CAAA;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAA+B,EAC/B,SAAiB,EACjB,SAAiB;IAEjB,MAAM,OAAO,GAAG,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IAC7C,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAA;IAE9B,IAAI,MAAM,GAAY,OAAO,CAAA;IAC7B,KAAK,MAAM,GAAG,IAAI,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACvC,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ;YAAE,OAAO,SAAS,CAAA;QACnE,MAAM,GAAI,MAAkC,CAAC,GAAG,CAAC,CAAA;IACnD,CAAC;IAED,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;AACxD,CAAC"}
@@ -0,0 +1,159 @@
1
+ import { type BreakpointId } from './breakpoints.js';
2
+ /**
3
+ * Measures how a field's copy wraps at every breakpoint, by laying it out for
4
+ * real rather than estimating.
5
+ *
6
+ * ── Why not a class chain ─────────────────────────────────────────────────
7
+ *
8
+ * The design handoff specifies rebuilding each probe from a hardcoded list of
9
+ * wrapper classes per guarded field, and warns twice that a width cap outside
10
+ * that list makes the guard lie — at wide breakpoints only, so it looks correct
11
+ * on mobile. By the handoff's own account that list drifted twice.
12
+ *
13
+ * A chain is a second source of truth that has to track the renderers' markup
14
+ * by hand. Worse here: the prototype had semantic classes (`.pv-hero-h`), while
15
+ * these components are styled with Tailwind utility strings that Prettier's
16
+ * plugin reorders on save. And a chain written in the admin cannot describe a
17
+ * consumer's own registered renderer at all.
18
+ *
19
+ * So the probe measures the REAL element: the caller renders the actual section
20
+ * into a hidden host, and this module finds the field by its `data-cms-field`
21
+ * marker — the same attribute the click-to-edit bridge uses. There is nothing
22
+ * to keep in sync, and a renderer refactor cannot silently invalidate it.
23
+ *
24
+ * ── Why one host, resized ─────────────────────────────────────────────────
25
+ *
26
+ * Six widths are measured by resizing a single rendered copy, not by rendering
27
+ * six. Layout is recomputed either way; React reconciliation is not.
28
+ */
29
+ /** A field's wrap count at one breakpoint. */
30
+ export interface FieldLineCount {
31
+ id: BreakpointId;
32
+ lines: number;
33
+ }
34
+ /**
35
+ * Line count from an element's laid-out height.
36
+ *
37
+ * Falls back to `fontSize * 1.25` when `line-height` computes to `normal`,
38
+ * which it does for any element that never set one. Rounding rather than
39
+ * flooring: sub-pixel line heights accumulate, and 2.97 lines is three.
40
+ */
41
+ export declare function linesFromMetrics(height: number, lineHeight: number, fontSize: number): number;
42
+ /**
43
+ * How many lines an element's text actually occupies.
44
+ *
45
+ * Counts LINE BOXES via a Range over the element's contents, deduplicated by
46
+ * their top edge. Dividing the element's height by its line-height — the
47
+ * obvious approach, and what the prototype does — counts padding as text: a
48
+ * button reading "Get Started" measured 2 lines, because its vertical padding
49
+ * came to roughly another line's worth of height. Every padded element was
50
+ * over-reported, which is most CTAs and every boxed heading.
51
+ *
52
+ * Rects are deduplicated by rounded top edge because a range spanning nested
53
+ * inline elements (a `<strong>` mid-sentence, an icon in a button) yields one
54
+ * rect per fragment, not per line.
55
+ *
56
+ * Falls back to the height ratio when the range produces nothing — an element
57
+ * whose content is a single replaced node, or a layout engine that gives no
58
+ * rects for empty text.
59
+ */
60
+ export declare function countLines(el: HTMLElement): number;
61
+ /**
62
+ * The off-screen host.
63
+ *
64
+ * `left: -99999px`, never `display: none` — a hidden element has no layout, so
65
+ * every measurement would be zero. `visibility: hidden` would keep layout but
66
+ * also keep the element in the accessibility tree; moving it off-screen and
67
+ * marking it `aria-hidden` keeps it out of both the viewport and the a11y tree
68
+ * while still being laid out.
69
+ *
70
+ * MOUNT IT INSIDE `.prenta-admin`, never on `document.body`. Type tokens and
71
+ * the font stack are scoped to that root, so a host outside it lays text out in
72
+ * the document's default font and every measurement is taken at the wrong
73
+ * metrics. Caught by `e2e/reflow-probe.spec.ts` on its first run: a button
74
+ * measured 127px on the canvas and 139px in a body-mounted probe.
75
+ *
76
+ * Use `mountProbeHost` rather than appending by hand.
77
+ */
78
+ export declare function createProbeHost(doc?: Document): HTMLElement;
79
+ /**
80
+ * Attach a probe host in the only place it measures correctly.
81
+ *
82
+ * Returns a detach function. Falls back to `document.body` only when no admin
83
+ * root exists (it always does in the app) — and callers should treat a
84
+ * fallback mount as untrustworthy rather than silently measuring.
85
+ */
86
+ export declare function mountProbeHost(host: HTMLElement, doc?: Document): {
87
+ detach: () => void;
88
+ scoped: boolean;
89
+ };
90
+ /**
91
+ * Measure one field across every breakpoint.
92
+ *
93
+ * `container` must carry the same class chain the canvas uses
94
+ * (`prenta-canvas`, which supplies the query container). Its width is set per
95
+ * breakpoint, so it must not be width-constrained by a parent.
96
+ *
97
+ * `scope` narrows to one section and is REQUIRED whenever the container holds
98
+ * more than one, because `data-cms-field` paths are unique only within a
99
+ * section — every section has a `heading` and a `body`. Without it a whole page
100
+ * silently measures the first section's field and reports it for all of them.
101
+ * (That mistake is what `e2e/reflow-probe.spec.ts` caught on its second run.)
102
+ *
103
+ * Returns `null` when the field cannot be found — the canvas is rendering a
104
+ * component without `data-cms-field` markers, so there is nothing to measure.
105
+ * Reporting a line count from the wrong element would be worse than reporting
106
+ * none: an editor reads a number as a fact.
107
+ */
108
+ export declare function measureFieldAcrossBreakpoints(container: HTMLElement, fieldPath: string, scope?: string): FieldLineCount[] | null;
109
+ /** What a probe pass produces for one field. */
110
+ export interface FieldReflow {
111
+ current: FieldLineCount[];
112
+ baseline: FieldLineCount[];
113
+ }
114
+ /**
115
+ * Measure a field's wrapping now and as published, from the live canvas.
116
+ *
117
+ * The whole `.prenta-canvas` is cloned, not just the target section. Cloning
118
+ * the section alone would require rebuilding whatever sits between the canvas
119
+ * root and the section — which is the class-chain problem again, in a smaller
120
+ * disguise. `e2e/reflow-probe.spec.ts` asserts the whole-canvas clone
121
+ * reproduces every field's rendered width exactly; nothing asserts that for a
122
+ * hand-rebuilt wrapper.
123
+ *
124
+ * The baseline is measured by writing the published string into the SAME cloned
125
+ * element and re-measuring, rather than by rendering the published section. The
126
+ * two differ in exactly one field, so everything else — width caps, siblings,
127
+ * grid tracks — is held identical by construction rather than by hoping a second
128
+ * render matches.
129
+ *
130
+ * `baselineText` of `undefined` means the field has no published version (a new
131
+ * section), so there is no change to report and current is echoed as baseline.
132
+ *
133
+ * Returns `null` when the section or field is absent from the canvas — a
134
+ * consumer's renderer may carry no `data-cms-field` markers, and a line count
135
+ * read off the wrong element is worse than none.
136
+ */
137
+ export declare function probeFieldReflow(options: {
138
+ canvas: HTMLElement;
139
+ sectionId: string;
140
+ fieldPath: string;
141
+ baselineText: string | undefined;
142
+ doc?: Document;
143
+ }): FieldReflow | null;
144
+ export type ReflowSeverity = 'same' | 'grew' | 'grew-badly';
145
+ /**
146
+ * Compare a field's current wrapping against its published baseline.
147
+ *
148
+ * Only growth is flagged. Copy that got shorter cannot break a layout that
149
+ * already held the longer version, so reporting it would be noise on exactly
150
+ * the edit an editor was asked to make.
151
+ */
152
+ export declare function reflowSeverity(current: number, baseline: number): ReflowSeverity;
153
+ /**
154
+ * The breakpoint worth proofing on: the biggest jump, and on a tie the
155
+ * narrowest width. A tie means the same damage happens at several sizes, and
156
+ * the narrowest is where it is most likely to look broken.
157
+ */
158
+ export declare function worstBreakpoint(current: FieldLineCount[], baseline: FieldLineCount[]): BreakpointId | null;
159
+ //# sourceMappingURL=reflow-probe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflow-probe.d.ts","sourceRoot":"","sources":["../../src/lib/reflow-probe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,8CAA8C;AAC9C,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,YAAY,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAK7F;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM,CAqBlD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,GAAG,GAAE,QAAmB,GAAG,WAAW,CAarE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,WAAW,EACjB,GAAG,GAAE,QAAmB,GACvB;IAAE,MAAM,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAKzC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,WAAW,EACtB,SAAS,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,GAC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