@pantheon-systems/puck-css 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (484) hide show
  1. package/README.md +87 -0
  2. package/dist/agent/useAgentEdit.d.ts.map +1 -1
  3. package/dist/agent/useAgentEdit.js.map +1 -1
  4. package/dist/agent/useAgentTrigger.d.ts.map +1 -1
  5. package/dist/agent/useAgentTrigger.js.map +1 -1
  6. package/dist/auth/AuthGate.d.ts +1 -1
  7. package/dist/auth/AuthGate.d.ts.map +1 -1
  8. package/dist/auth/P1AuthProvider.d.ts.map +1 -1
  9. package/dist/auth/P1AuthProvider.js +52 -1
  10. package/dist/auth/P1AuthProvider.js.map +1 -1
  11. package/dist/collaboration/components/CollaboratorAvatars.d.ts.map +1 -1
  12. package/dist/collaboration/components/CollaboratorAvatars.js +1 -1
  13. package/dist/collaboration/components/CollaboratorAvatars.js.map +1 -1
  14. package/dist/collaboration/utils/avatarColor.d.ts +2 -8
  15. package/dist/collaboration/utils/avatarColor.d.ts.map +1 -1
  16. package/dist/collaboration/utils/avatarColor.js +4 -31
  17. package/dist/collaboration/utils/avatarColor.js.map +1 -1
  18. package/dist/collaboration/utils/focusHighlightConfig.d.ts.map +1 -1
  19. package/dist/collaboration/utils/focusHighlightConfig.js.map +1 -1
  20. package/dist/collaboration/utils/initials.d.ts +2 -0
  21. package/dist/collaboration/utils/initials.d.ts.map +1 -0
  22. package/dist/collaboration/utils/initials.js +27 -0
  23. package/dist/collaboration/utils/initials.js.map +1 -0
  24. package/dist/collaboration/utils/presenceIdentity.d.ts +29 -0
  25. package/dist/collaboration/utils/presenceIdentity.d.ts.map +1 -0
  26. package/dist/collaboration/utils/presenceIdentity.js +42 -0
  27. package/dist/collaboration/utils/presenceIdentity.js.map +1 -0
  28. package/dist/core/PuckConfigContext.d.ts +7 -0
  29. package/dist/core/PuckConfigContext.d.ts.map +1 -0
  30. package/dist/core/PuckConfigContext.js +11 -0
  31. package/dist/core/PuckConfigContext.js.map +1 -0
  32. package/dist/core/config.d.ts +1 -1
  33. package/dist/core/config.d.ts.map +1 -1
  34. package/dist/core/config.js.map +1 -1
  35. package/dist/core/index.d.ts +1 -0
  36. package/dist/core/index.d.ts.map +1 -1
  37. package/dist/core/index.js +1 -0
  38. package/dist/core/index.js.map +1 -1
  39. package/dist/core/types.d.ts +36 -3
  40. package/dist/core/types.d.ts.map +1 -1
  41. package/dist/data/collection-operators.d.ts +19 -0
  42. package/dist/data/collection-operators.d.ts.map +1 -0
  43. package/dist/data/collection-operators.js +97 -0
  44. package/dist/data/collection-operators.js.map +1 -0
  45. package/dist/data/css-queries/css-query-registry.d.ts +11 -0
  46. package/dist/data/css-queries/css-query-registry.d.ts.map +1 -0
  47. package/dist/data/css-queries/css-query-registry.js +30 -0
  48. package/dist/data/css-queries/css-query-registry.js.map +1 -0
  49. package/dist/data/dal/index.d.ts +1 -1
  50. package/dist/data/dal/index.d.ts.map +1 -1
  51. package/dist/data/dal/init.d.ts +5 -0
  52. package/dist/data/dal/init.d.ts.map +1 -1
  53. package/dist/data/dal/init.js +31 -4
  54. package/dist/data/dal/init.js.map +1 -1
  55. package/dist/data/dal/p1-store.d.ts +23 -0
  56. package/dist/data/dal/p1-store.d.ts.map +1 -1
  57. package/dist/data/dal/p1-store.js.map +1 -1
  58. package/dist/data/data-list-block/DataListFieldsGrouper.d.ts +7 -0
  59. package/dist/data/data-list-block/DataListFieldsGrouper.d.ts.map +1 -0
  60. package/dist/data/data-list-block/DataListFieldsGrouper.js +72 -0
  61. package/dist/data/data-list-block/DataListFieldsGrouper.js.map +1 -0
  62. package/dist/data/data-list-block/builtin-components/cards.d.ts +8 -0
  63. package/dist/data/data-list-block/builtin-components/cards.d.ts.map +1 -0
  64. package/dist/data/data-list-block/builtin-components/cards.js +35 -0
  65. package/dist/data/data-list-block/builtin-components/cards.js.map +1 -0
  66. package/dist/data/data-list-block/builtin-components/listing.d.ts +8 -0
  67. package/dist/data/data-list-block/builtin-components/listing.d.ts.map +1 -0
  68. package/dist/data/data-list-block/builtin-components/listing.js +11 -0
  69. package/dist/data/data-list-block/builtin-components/listing.js.map +1 -0
  70. package/dist/data/data-list-block/builtin-components/rows.d.ts +8 -0
  71. package/dist/data/data-list-block/builtin-components/rows.d.ts.map +1 -0
  72. package/dist/data/data-list-block/builtin-components/rows.js +9 -0
  73. package/dist/data/data-list-block/builtin-components/rows.js.map +1 -0
  74. package/dist/data/data-list-block/builtin-modes.d.ts +3 -0
  75. package/dist/data/data-list-block/builtin-modes.d.ts.map +1 -0
  76. package/dist/data/data-list-block/builtin-modes.js +53 -0
  77. package/dist/data/data-list-block/builtin-modes.js.map +1 -0
  78. package/dist/data/data-list-block/create-data-list-block.d.ts +3 -0
  79. package/dist/data/data-list-block/create-data-list-block.d.ts.map +1 -0
  80. package/dist/data/data-list-block/create-data-list-block.js +305 -0
  81. package/dist/data/data-list-block/create-data-list-block.js.map +1 -0
  82. package/dist/data/data-list-block/field-groups.d.ts +4 -0
  83. package/dist/data/data-list-block/field-groups.d.ts.map +1 -0
  84. package/dist/data/data-list-block/field-groups.js +28 -0
  85. package/dist/data/data-list-block/field-groups.js.map +1 -0
  86. package/dist/data/data-list-block/index.d.ts +8 -0
  87. package/dist/data/data-list-block/index.d.ts.map +1 -0
  88. package/dist/data/data-list-block/index.js +7 -0
  89. package/dist/data/data-list-block/index.js.map +1 -0
  90. package/dist/data/data-list-block/types.d.ts +53 -0
  91. package/dist/data/data-list-block/types.d.ts.map +1 -0
  92. package/dist/data/data-list-block/types.js +2 -0
  93. package/dist/data/data-list-block/types.js.map +1 -0
  94. package/dist/data/data-list-block/utils.d.ts +14 -0
  95. package/dist/data/data-list-block/utils.d.ts.map +1 -0
  96. package/dist/data/data-list-block/utils.js +65 -0
  97. package/dist/data/data-list-block/utils.js.map +1 -0
  98. package/dist/data/fields/datasource-select-field.d.ts +29 -0
  99. package/dist/data/fields/datasource-select-field.d.ts.map +1 -0
  100. package/dist/data/fields/datasource-select-field.js +40 -0
  101. package/dist/data/fields/datasource-select-field.js.map +1 -0
  102. package/dist/data/fields/field-section.d.ts +11 -0
  103. package/dist/data/fields/field-section.d.ts.map +1 -0
  104. package/dist/data/fields/field-section.js +6 -0
  105. package/dist/data/fields/field-section.js.map +1 -0
  106. package/dist/data/fields/image-position-field.d.ts +28 -0
  107. package/dist/data/fields/image-position-field.d.ts.map +1 -0
  108. package/dist/data/fields/image-position-field.js +69 -0
  109. package/dist/data/fields/image-position-field.js.map +1 -0
  110. package/dist/data/fields/pds-field-helpers.d.ts +34 -0
  111. package/dist/data/fields/pds-field-helpers.d.ts.map +1 -0
  112. package/dist/data/fields/pds-field-helpers.js +55 -0
  113. package/dist/data/fields/pds-field-helpers.js.map +1 -0
  114. package/dist/data/fields/schema-select-field.d.ts +32 -0
  115. package/dist/data/fields/schema-select-field.d.ts.map +1 -0
  116. package/dist/data/fields/schema-select-field.js +134 -0
  117. package/dist/data/fields/schema-select-field.js.map +1 -0
  118. package/dist/data/fields/template-select-field.d.ts +16 -0
  119. package/dist/data/fields/template-select-field.d.ts.map +1 -0
  120. package/dist/data/fields/template-select-field.js +31 -0
  121. package/dist/data/fields/template-select-field.js.map +1 -0
  122. package/dist/data/fields/view-mode-field.d.ts +21 -0
  123. package/dist/data/fields/view-mode-field.d.ts.map +1 -0
  124. package/dist/data/fields/view-mode-field.js +14 -0
  125. package/dist/data/fields/view-mode-field.js.map +1 -0
  126. package/dist/data/fields.d.ts +12 -0
  127. package/dist/data/fields.d.ts.map +1 -1
  128. package/dist/data/fields.js +10 -0
  129. package/dist/data/fields.js.map +1 -1
  130. package/dist/data/page-editor-meta.d.ts.map +1 -1
  131. package/dist/data/page-editor-meta.js +0 -1
  132. package/dist/data/page-editor-meta.js.map +1 -1
  133. package/dist/data/query-provider.d.ts +1 -1
  134. package/dist/data/query-provider.d.ts.map +1 -1
  135. package/dist/data/remote-datasources/fetch-http-json.d.ts.map +1 -1
  136. package/dist/data/remote-datasources/fetch-http-json.js.map +1 -1
  137. package/dist/data/remote-datasources/loader.d.ts.map +1 -1
  138. package/dist/data/remote-datasources/loader.js +3 -1
  139. package/dist/data/remote-datasources/loader.js.map +1 -1
  140. package/dist/data/resolve-data-templates.d.ts.map +1 -1
  141. package/dist/data/resolve-data-templates.js +31 -4
  142. package/dist/data/resolve-data-templates.js.map +1 -1
  143. package/dist/data/schema-heuristics.d.ts +5 -0
  144. package/dist/data/schema-heuristics.d.ts.map +1 -0
  145. package/dist/data/schema-heuristics.js +46 -0
  146. package/dist/data/schema-heuristics.js.map +1 -0
  147. package/dist/editor/P1App.d.ts.map +1 -1
  148. package/dist/editor/P1App.js +1 -1
  149. package/dist/editor/P1App.js.map +1 -1
  150. package/dist/editor/P1PuckProvider.d.ts.map +1 -1
  151. package/dist/editor/P1PuckProvider.js +170 -41
  152. package/dist/editor/P1PuckProvider.js.map +1 -1
  153. package/dist/editor/aiPanelStore.d.ts +15 -0
  154. package/dist/editor/aiPanelStore.d.ts.map +1 -0
  155. package/dist/editor/aiPanelStore.js +43 -0
  156. package/dist/editor/aiPanelStore.js.map +1 -0
  157. package/dist/editor/components/CollapsibleFieldSection.d.ts +10 -0
  158. package/dist/editor/components/CollapsibleFieldSection.d.ts.map +1 -0
  159. package/dist/editor/components/CollapsibleFieldSection.js +9 -0
  160. package/dist/editor/components/CollapsibleFieldSection.js.map +1 -0
  161. package/dist/editor/components/CollapsibleSection.module.css +70 -0
  162. package/dist/editor/components/CollapsibleSectionHeader.d.ts +20 -0
  163. package/dist/editor/components/CollapsibleSectionHeader.d.ts.map +1 -0
  164. package/dist/editor/components/CollapsibleSectionHeader.js +10 -0
  165. package/dist/editor/components/CollapsibleSectionHeader.js.map +1 -0
  166. package/dist/editor/components/DraggableRow.d.ts +13 -0
  167. package/dist/editor/components/DraggableRow.d.ts.map +1 -0
  168. package/dist/editor/components/DraggableRow.js +20 -0
  169. package/dist/editor/components/DraggableRow.js.map +1 -0
  170. package/dist/editor/components/FieldHelpText.d.ts +6 -0
  171. package/dist/editor/components/FieldHelpText.d.ts.map +1 -0
  172. package/dist/editor/components/FieldHelpText.js +6 -0
  173. package/dist/editor/components/FieldHelpText.js.map +1 -0
  174. package/dist/editor/components/FieldHelpText.module.css +13 -0
  175. package/dist/editor/components/InspectorTabHeader.js +1 -1
  176. package/dist/editor/components/InspectorTabHeader.js.map +1 -1
  177. package/dist/editor/components/OutlinePanel.d.ts +10 -0
  178. package/dist/editor/components/OutlinePanel.d.ts.map +1 -0
  179. package/dist/editor/components/OutlinePanel.js +64 -0
  180. package/dist/editor/components/OutlinePanel.js.map +1 -0
  181. package/dist/editor/components/OutlinePanel.module.css +111 -0
  182. package/dist/editor/components/P1InspectorFields.d.ts.map +1 -1
  183. package/dist/editor/components/P1InspectorFields.js +24 -5
  184. package/dist/editor/components/P1InspectorFields.js.map +1 -1
  185. package/dist/editor/components/PanelHeader.d.ts +25 -0
  186. package/dist/editor/components/PanelHeader.d.ts.map +1 -0
  187. package/dist/editor/components/PanelHeader.js +12 -0
  188. package/dist/editor/components/PanelHeader.js.map +1 -0
  189. package/dist/editor/components/PanelHeader.module.css +34 -0
  190. package/dist/editor/components/PanelShell.d.ts +10 -0
  191. package/dist/editor/components/PanelShell.d.ts.map +1 -0
  192. package/dist/editor/components/PanelShell.js +7 -0
  193. package/dist/editor/components/PanelShell.js.map +1 -0
  194. package/dist/editor/components/PanelShell.module.css +15 -0
  195. package/dist/editor/components/PreviewPanelOverlay.d.ts +12 -0
  196. package/dist/editor/components/PreviewPanelOverlay.d.ts.map +1 -0
  197. package/dist/editor/components/PreviewPanelOverlay.js +7 -0
  198. package/dist/editor/components/PreviewPanelOverlay.js.map +1 -0
  199. package/dist/editor/components/PublishedStatusBadge.d.ts +1 -1
  200. package/dist/editor/components/PublishedStatusBadge.d.ts.map +1 -1
  201. package/dist/editor/components/VersionBannerOverride.d.ts +5 -1
  202. package/dist/editor/components/VersionBannerOverride.d.ts.map +1 -1
  203. package/dist/editor/components/VersionBannerOverride.js +54 -5
  204. package/dist/editor/components/VersionBannerOverride.js.map +1 -1
  205. package/dist/editor/components/VersionTimeline.d.ts +20 -0
  206. package/dist/editor/components/VersionTimeline.d.ts.map +1 -0
  207. package/dist/editor/components/VersionTimeline.js +42 -0
  208. package/dist/editor/components/VersionTimeline.js.map +1 -0
  209. package/dist/editor/components/collapsibleSectionContext.d.ts +17 -0
  210. package/dist/editor/components/collapsibleSectionContext.d.ts.map +1 -0
  211. package/dist/editor/components/collapsibleSectionContext.js +13 -0
  212. package/dist/editor/components/collapsibleSectionContext.js.map +1 -0
  213. package/dist/editor/components/componentIconName.d.ts +15 -0
  214. package/dist/editor/components/componentIconName.d.ts.map +1 -0
  215. package/dist/editor/components/componentIconName.js +68 -0
  216. package/dist/editor/components/componentIconName.js.map +1 -0
  217. package/dist/editor/components/connectable.d.ts +1 -1
  218. package/dist/editor/components/connectable.d.ts.map +1 -1
  219. package/dist/editor/components/merge-preview/MergePreviewPanel.d.ts.map +1 -1
  220. package/dist/editor/components/merge-preview/MergePreviewPanel.js.map +1 -1
  221. package/dist/editor/components/merge-preview/MergePreviewRenderer.js +3 -15
  222. package/dist/editor/components/merge-preview/MergePreviewRenderer.js.map +1 -1
  223. package/dist/editor/components/outlineTree.d.ts +68 -0
  224. package/dist/editor/components/outlineTree.d.ts.map +1 -0
  225. package/dist/editor/components/outlineTree.js +72 -0
  226. package/dist/editor/components/outlineTree.js.map +1 -0
  227. package/dist/editor/components/useDragReorder.d.ts +16 -0
  228. package/dist/editor/components/useDragReorder.d.ts.map +1 -0
  229. package/dist/editor/components/useDragReorder.js +35 -0
  230. package/dist/editor/components/useDragReorder.js.map +1 -0
  231. package/dist/editor/index.d.ts +13 -0
  232. package/dist/editor/index.d.ts.map +1 -1
  233. package/dist/editor/index.js +8 -0
  234. package/dist/editor/index.js.map +1 -1
  235. package/dist/editor/plugin/P1Plugin.d.ts +19 -3
  236. package/dist/editor/plugin/P1Plugin.d.ts.map +1 -1
  237. package/dist/editor/plugin/P1Plugin.js +121 -98
  238. package/dist/editor/plugin/P1Plugin.js.map +1 -1
  239. package/dist/editor/plugin/context-sync-key.d.ts.map +1 -1
  240. package/dist/editor/plugin/context-sync-key.js +5 -5
  241. package/dist/editor/plugin/context-sync-key.js.map +1 -1
  242. package/dist/editor/plugin/createP1Overrides.d.ts +31 -43
  243. package/dist/editor/plugin/createP1Overrides.d.ts.map +1 -1
  244. package/dist/editor/plugin/createP1Overrides.js +47 -43
  245. package/dist/editor/plugin/createP1Overrides.js.map +1 -1
  246. package/dist/editor/plugin/document-sync-plugin.d.ts +23 -5
  247. package/dist/editor/plugin/document-sync-plugin.d.ts.map +1 -1
  248. package/dist/editor/plugin/document-sync-plugin.js +13 -6
  249. package/dist/editor/plugin/document-sync-plugin.js.map +1 -1
  250. package/dist/editor/plugin/fieldGuidance.d.ts +45 -0
  251. package/dist/editor/plugin/fieldGuidance.d.ts.map +1 -0
  252. package/dist/editor/plugin/fieldGuidance.js +24 -0
  253. package/dist/editor/plugin/fieldGuidance.js.map +1 -0
  254. package/dist/editor/plugin/mergePreviewPlugin.d.ts.map +1 -1
  255. package/dist/editor/plugin/mergePreviewPlugin.js.map +1 -1
  256. package/dist/editor/plugin/selectHeaderCollaborators.d.ts +12 -0
  257. package/dist/editor/plugin/selectHeaderCollaborators.d.ts.map +1 -0
  258. package/dist/editor/plugin/selectHeaderCollaborators.js +15 -0
  259. package/dist/editor/plugin/selectHeaderCollaborators.js.map +1 -0
  260. package/dist/editor/thumbnails/LiveThumbnail.d.ts +47 -0
  261. package/dist/editor/thumbnails/LiveThumbnail.d.ts.map +1 -0
  262. package/dist/editor/thumbnails/LiveThumbnail.js +120 -0
  263. package/dist/editor/thumbnails/LiveThumbnail.js.map +1 -0
  264. package/dist/editor/thumbnails/ThumbnailCard.d.ts +37 -0
  265. package/dist/editor/thumbnails/ThumbnailCard.d.ts.map +1 -0
  266. package/dist/editor/thumbnails/ThumbnailCard.js +91 -0
  267. package/dist/editor/thumbnails/ThumbnailCard.js.map +1 -0
  268. package/dist/editor/thumbnails/buildLiveThumbnailDrawer.d.ts +33 -0
  269. package/dist/editor/thumbnails/buildLiveThumbnailDrawer.d.ts.map +1 -0
  270. package/dist/editor/thumbnails/buildLiveThumbnailDrawer.js +79 -0
  271. package/dist/editor/thumbnails/buildLiveThumbnailDrawer.js.map +1 -0
  272. package/dist/editor/thumbnails/humanizeComponentName.d.ts +18 -0
  273. package/dist/editor/thumbnails/humanizeComponentName.d.ts.map +1 -0
  274. package/dist/editor/thumbnails/humanizeComponentName.js +32 -0
  275. package/dist/editor/thumbnails/humanizeComponentName.js.map +1 -0
  276. package/dist/editor/thumbnails/resolveLiveThumbnailDrawer.d.ts +15 -0
  277. package/dist/editor/thumbnails/resolveLiveThumbnailDrawer.d.ts.map +1 -0
  278. package/dist/editor/thumbnails/resolveLiveThumbnailDrawer.js +19 -0
  279. package/dist/editor/thumbnails/resolveLiveThumbnailDrawer.js.map +1 -0
  280. package/dist/editor/thumbnails/thumbnailCache.d.ts +39 -0
  281. package/dist/editor/thumbnails/thumbnailCache.d.ts.map +1 -0
  282. package/dist/editor/thumbnails/thumbnailCache.js +97 -0
  283. package/dist/editor/thumbnails/thumbnailCache.js.map +1 -0
  284. package/dist/editor/useP1Editor.d.ts +14 -4
  285. package/dist/editor/useP1Editor.d.ts.map +1 -1
  286. package/dist/editor/useP1Editor.js +81 -37
  287. package/dist/editor/useP1Editor.js.map +1 -1
  288. package/dist/editor/useP1Overrides.d.ts +1 -1
  289. package/dist/editor/useP1Overrides.d.ts.map +1 -1
  290. package/dist/editor/useP1Overrides.js.map +1 -1
  291. package/dist/editor/useP1Plugin.d.ts +15 -3
  292. package/dist/editor/useP1Plugin.d.ts.map +1 -1
  293. package/dist/editor/useP1Plugin.js +4 -0
  294. package/dist/editor/useP1Plugin.js.map +1 -1
  295. package/dist/editor/useRealtime.d.ts +2 -2
  296. package/dist/editor/useRealtime.d.ts.map +1 -1
  297. package/dist/editor/useRealtime.js.map +1 -1
  298. package/dist/editor/useResponsivePanels.d.ts +29 -0
  299. package/dist/editor/useResponsivePanels.d.ts.map +1 -0
  300. package/dist/editor/useResponsivePanels.js +175 -0
  301. package/dist/editor/useResponsivePanels.js.map +1 -0
  302. package/dist/editor/useSidebarScrollPreservation.d.ts +10 -0
  303. package/dist/editor/useSidebarScrollPreservation.d.ts.map +1 -0
  304. package/dist/editor/useSidebarScrollPreservation.js +39 -0
  305. package/dist/editor/useSidebarScrollPreservation.js.map +1 -0
  306. package/dist/editor/utils/componentRegistry.d.ts +4 -4
  307. package/dist/editor/utils/componentRegistry.d.ts.map +1 -1
  308. package/dist/editor/utils/componentRegistry.js +0 -1
  309. package/dist/editor/utils/componentRegistry.js.map +1 -1
  310. package/dist/editor/utils/restoreDocumentVersion.d.ts +18 -0
  311. package/dist/editor/utils/restoreDocumentVersion.d.ts.map +1 -0
  312. package/dist/editor/utils/restoreDocumentVersion.js +49 -0
  313. package/dist/editor/utils/restoreDocumentVersion.js.map +1 -0
  314. package/dist/editor/utils/sanitizeRichtextDefaults.d.ts +22 -0
  315. package/dist/editor/utils/sanitizeRichtextDefaults.d.ts.map +1 -0
  316. package/dist/editor/utils/sanitizeRichtextDefaults.js +98 -0
  317. package/dist/editor/utils/sanitizeRichtextDefaults.js.map +1 -0
  318. package/dist/features/content-type-templates/permissions/createPuckPermissions.d.ts +1 -3
  319. package/dist/features/content-type-templates/permissions/createPuckPermissions.d.ts.map +1 -1
  320. package/dist/features/content-type-templates/permissions/createPuckPermissions.js.map +1 -1
  321. package/dist/features/content-type-templates/stores/template-store-api.d.ts.map +1 -1
  322. package/dist/features/content-type-templates/ui/ActionBarPinButton.d.ts.map +1 -1
  323. package/dist/features/content-type-templates/ui/ActionBarPinButton.js +1 -1
  324. package/dist/features/content-type-templates/ui/ActionBarPinButton.js.map +1 -1
  325. package/dist/index.d.ts +14 -1
  326. package/dist/index.d.ts.map +1 -1
  327. package/dist/index.js +13 -1
  328. package/dist/index.js.map +1 -1
  329. package/dist/merge/components/merge-resolution/CherryPickVisualPanel.js +1 -3
  330. package/dist/merge/components/merge-resolution/CherryPickVisualPanel.js.map +1 -1
  331. package/dist/merge/components/merge-resolution/DocumentResolutionDetail.js +2 -2
  332. package/dist/merge/components/merge-resolution/DocumentResolutionDetail.js.map +1 -1
  333. package/dist/p1/editor/client.d.ts +1 -5
  334. package/dist/p1/editor/client.d.ts.map +1 -1
  335. package/dist/p1/editor/client.js +11 -12
  336. package/dist/p1/editor/client.js.map +1 -1
  337. package/dist/p1/editor/connect/connect-field-modal.d.ts +1 -1
  338. package/dist/p1/editor/connect/connect-field-modal.d.ts.map +1 -1
  339. package/dist/p1/editor/connect/connect-field-modal.js +1 -1
  340. package/dist/p1/editor/connect/connect-field-modal.js.map +1 -1
  341. package/dist/p1/editor/connect/connect-preview-config.d.ts +1 -1
  342. package/dist/p1/editor/connect/connect-preview-config.d.ts.map +1 -1
  343. package/dist/p1/editor/connect/field-connect-plugin.js +1 -1
  344. package/dist/p1/editor/connect/field-connect-plugin.js.map +1 -1
  345. package/dist/p1/editor/editor-preview-resolve.d.ts +15 -4
  346. package/dist/p1/editor/editor-preview-resolve.d.ts.map +1 -1
  347. package/dist/p1/editor/editor-preview-resolve.js +30 -8
  348. package/dist/p1/editor/editor-preview-resolve.js.map +1 -1
  349. package/dist/p1/editor/hooks/api-hooks.d.ts +4 -4
  350. package/dist/p1/editor/hooks/api-hooks.d.ts.map +1 -1
  351. package/dist/p1/editor/hooks/api-hooks.js +57 -30
  352. package/dist/p1/editor/hooks/api-hooks.js.map +1 -1
  353. package/dist/p1/editor/hooks/index.d.ts +1 -0
  354. package/dist/p1/editor/hooks/index.d.ts.map +1 -1
  355. package/dist/p1/editor/hooks/index.js +1 -0
  356. package/dist/p1/editor/hooks/index.js.map +1 -1
  357. package/dist/p1/editor/hooks/useEditorContext.d.ts +1 -1
  358. package/dist/p1/editor/hooks/useEditorContext.d.ts.map +1 -1
  359. package/dist/p1/editor/hooks/useEditorContext.js +12 -3
  360. package/dist/p1/editor/hooks/useEditorContext.js.map +1 -1
  361. package/dist/p1/editor/hooks/useLiveRemoteDatasources.d.ts +31 -0
  362. package/dist/p1/editor/hooks/useLiveRemoteDatasources.d.ts.map +1 -0
  363. package/dist/p1/editor/hooks/useLiveRemoteDatasources.js +45 -0
  364. package/dist/p1/editor/hooks/useLiveRemoteDatasources.js.map +1 -0
  365. package/dist/p1/editor/hooks/useP1Plugins.d.ts.map +1 -1
  366. package/dist/p1/editor/hooks/useP1Plugins.js +6 -12
  367. package/dist/p1/editor/hooks/useP1Plugins.js.map +1 -1
  368. package/dist/p1/editor/icons/button-block-icon.d.ts +1 -1
  369. package/dist/p1/editor/icons/button-block-icon.d.ts.map +1 -1
  370. package/dist/p1/editor/icons/data-list-block-icon.d.ts +2 -0
  371. package/dist/p1/editor/icons/data-list-block-icon.d.ts.map +1 -0
  372. package/dist/p1/editor/icons/data-list-block-icon.js +5 -0
  373. package/dist/p1/editor/icons/data-list-block-icon.js.map +1 -0
  374. package/dist/p1/editor/icons/default-block-icon.d.ts +1 -1
  375. package/dist/p1/editor/icons/default-block-icon.d.ts.map +1 -1
  376. package/dist/p1/editor/icons/divider-block-icon.d.ts +1 -1
  377. package/dist/p1/editor/icons/divider-block-icon.d.ts.map +1 -1
  378. package/dist/p1/editor/icons/grid-block-icon.d.ts +1 -1
  379. package/dist/p1/editor/icons/grid-block-icon.d.ts.map +1 -1
  380. package/dist/p1/editor/icons/heading-block-icon.d.ts +1 -1
  381. package/dist/p1/editor/icons/heading-block-icon.d.ts.map +1 -1
  382. package/dist/p1/editor/icons/image-block-icon.d.ts +1 -1
  383. package/dist/p1/editor/icons/image-block-icon.d.ts.map +1 -1
  384. package/dist/p1/editor/icons/list-block-icon.d.ts +1 -1
  385. package/dist/p1/editor/icons/list-block-icon.d.ts.map +1 -1
  386. package/dist/p1/editor/icons/paragraph-block-icon.d.ts +1 -1
  387. package/dist/p1/editor/icons/paragraph-block-icon.d.ts.map +1 -1
  388. package/dist/p1/editor/icons/quote-block-icon.d.ts +1 -1
  389. package/dist/p1/editor/icons/quote-block-icon.d.ts.map +1 -1
  390. package/dist/p1/editor/icons/spacer-block-icon.d.ts +1 -1
  391. package/dist/p1/editor/icons/spacer-block-icon.d.ts.map +1 -1
  392. package/dist/p1/editor/index.d.ts +1 -1
  393. package/dist/p1/editor/index.d.ts.map +1 -1
  394. package/dist/p1/editor/index.js +1 -1
  395. package/dist/p1/editor/index.js.map +1 -1
  396. package/dist/p1/editor/remote-datasources/remote-datasource-explorer-plugin.d.ts +6 -7
  397. package/dist/p1/editor/remote-datasources/remote-datasource-explorer-plugin.d.ts.map +1 -1
  398. package/dist/p1/editor/remote-datasources/remote-datasource-explorer-plugin.js +77 -73
  399. package/dist/p1/editor/remote-datasources/remote-datasource-explorer-plugin.js.map +1 -1
  400. package/dist/p1/editor/remote-datasources/remote-datasource-form-helpers.d.ts +4 -4
  401. package/dist/p1/editor/remote-datasources/remote-datasource-form-helpers.d.ts.map +1 -1
  402. package/dist/p1/editor/remote-datasources/remote-datasource-form-helpers.js.map +1 -1
  403. package/dist/p1/editor/remote-datasources/remote-datasource-manager.d.ts +1 -1
  404. package/dist/p1/editor/remote-datasources/remote-datasource-manager.d.ts.map +1 -1
  405. package/dist/p1/editor/remote-datasources/remote-datasource-manager.js +1 -1
  406. package/dist/p1/editor/remote-datasources/remote-datasource-manager.js.map +1 -1
  407. package/dist/p1/editor/remote-datasources/template-preview-params-toolbar.d.ts +1 -1
  408. package/dist/p1/editor/remote-datasources/template-preview-params-toolbar.d.ts.map +1 -1
  409. package/dist/p1/editor/remote-datasources/template-preview-params-toolbar.js +1 -1
  410. package/dist/p1/editor/remote-datasources/template-preview-params-toolbar.js.map +1 -1
  411. package/dist/p1/editor/template-autocomplete-layer.d.ts +2 -2
  412. package/dist/p1/editor/template-autocomplete-layer.d.ts.map +1 -1
  413. package/dist/p1/editor/template-autocomplete-layer.js +23 -3
  414. package/dist/p1/editor/template-autocomplete-layer.js.map +1 -1
  415. package/dist/p1/pages/render-client.d.ts +1 -1
  416. package/dist/p1/pages/render-client.d.ts.map +1 -1
  417. package/dist/p1/pages/render-client.js +2 -1
  418. package/dist/p1/pages/render-client.js.map +1 -1
  419. package/dist/pds/components/AgentChip.d.ts.map +1 -1
  420. package/dist/pds/components/AgentChip.js +1 -2
  421. package/dist/pds/components/AgentChip.js.map +1 -1
  422. package/dist/pds/components/CreatePageModal.d.ts +10 -1
  423. package/dist/pds/components/CreatePageModal.d.ts.map +1 -1
  424. package/dist/pds/components/CreatePageModal.js +29 -9
  425. package/dist/pds/components/CreatePageModal.js.map +1 -1
  426. package/dist/pds/components/CreatePageModal.module.css +34 -0
  427. package/dist/pds/components/DocStateBadge.d.ts +1 -1
  428. package/dist/pds/components/DocStateBadge.d.ts.map +1 -1
  429. package/dist/pds/components/DocStateBadge.js +1 -1
  430. package/dist/pds/components/DocStateBadge.js.map +1 -1
  431. package/dist/pds/components/NavIcon.js +1 -1
  432. package/dist/pds/components/NavIcon.js.map +1 -1
  433. package/dist/pds/components/P1EditorHeader.d.ts +10 -2
  434. package/dist/pds/components/P1EditorHeader.d.ts.map +1 -1
  435. package/dist/pds/components/P1EditorHeader.js +16 -7
  436. package/dist/pds/components/P1EditorHeader.js.map +1 -1
  437. package/dist/pds/components/P1EditorHeader.module.css +113 -35
  438. package/dist/pds/components/P1EditorSubheader.d.ts +1 -4
  439. package/dist/pds/components/P1EditorSubheader.d.ts.map +1 -1
  440. package/dist/pds/components/P1EditorSubheader.js +10 -21
  441. package/dist/pds/components/P1EditorSubheader.js.map +1 -1
  442. package/dist/pds/components/P1EditorSubheader.module.css +7 -5
  443. package/dist/pds/components/PageNavigator.d.ts.map +1 -1
  444. package/dist/pds/components/PageNavigator.js.map +1 -1
  445. package/dist/pds/components/PresenceStack.d.ts +6 -5
  446. package/dist/pds/components/PresenceStack.d.ts.map +1 -1
  447. package/dist/pds/components/PresenceStack.js +43 -4
  448. package/dist/pds/components/PresenceStack.js.map +1 -1
  449. package/dist/pds/components/PresenceStack.module.css +52 -7
  450. package/dist/pds/components/PublishControl.js +2 -2
  451. package/dist/pds/components/PublishControl.js.map +1 -1
  452. package/dist/pds/components/WorkstreamSwitcher.d.ts +7 -2
  453. package/dist/pds/components/WorkstreamSwitcher.d.ts.map +1 -1
  454. package/dist/pds/components/WorkstreamSwitcher.js +5 -3
  455. package/dist/pds/components/WorkstreamSwitcher.js.map +1 -1
  456. package/dist/server.d.ts +3 -1
  457. package/dist/server.d.ts.map +1 -1
  458. package/dist/server.js +4 -1
  459. package/dist/server.js.map +1 -1
  460. package/dist/versioning/components/HistoricalVersionBanner.d.ts +19 -21
  461. package/dist/versioning/components/HistoricalVersionBanner.d.ts.map +1 -1
  462. package/dist/versioning/components/HistoricalVersionBanner.js +9 -21
  463. package/dist/versioning/components/HistoricalVersionBanner.js.map +1 -1
  464. package/dist/versioning/components/HistoricalVersionBanner.module.css +174 -0
  465. package/dist/versioning/components/VersionBannerActions.d.ts +15 -0
  466. package/dist/versioning/components/VersionBannerActions.d.ts.map +1 -0
  467. package/dist/versioning/components/VersionBannerActions.js +38 -0
  468. package/dist/versioning/components/VersionBannerActions.js.map +1 -0
  469. package/dist/versioning/components/VersionPublishedBadge.d.ts +1 -1
  470. package/dist/versioning/components/VersionPublishedBadge.d.ts.map +1 -1
  471. package/dist/versioning/components/version-compare/VisualVersionCompare.d.ts +2 -2
  472. package/dist/versioning/components/version-compare/VisualVersionCompare.d.ts.map +1 -1
  473. package/dist/versioning/utils/formatVersionDate.d.ts +15 -0
  474. package/dist/versioning/utils/formatVersionDate.d.ts.map +1 -0
  475. package/dist/versioning/utils/formatVersionDate.js +41 -0
  476. package/dist/versioning/utils/formatVersionDate.js.map +1 -0
  477. package/dist/versioning/utils/versionKind.d.ts +19 -0
  478. package/dist/versioning/utils/versionKind.d.ts.map +1 -0
  479. package/dist/versioning/utils/versionKind.js +30 -0
  480. package/dist/versioning/utils/versionKind.js.map +1 -0
  481. package/package.json +11 -7
  482. package/src/pds/theme/PuckEditorTheme.css +81 -0
  483. package/src/pds/theme/PuckEditorTheme.test.ts +50 -1
  484. package/src/styles.css +609 -84
@@ -1 +1 @@
1
- {"version":3,"file":"P1App.d.ts","sourceRoot":"","sources":["../../src/editor/P1App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAQ1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,aAAa,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IACnC,cAAc,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACxD;AA6JD,wBAAgB,KAAK,CAAC,EACpB,MAAM,EACN,QAAQ,EACR,eAAe,EACf,aAAa,EACb,cAAc,GACf,EAAE,UAAU,GAAG,KAAK,CAAC,YAAY,CAqDjC"}
1
+ {"version":3,"file":"P1App.d.ts","sourceRoot":"","sources":["../../src/editor/P1App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAO1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAIlD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,aAAa,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IACnC,cAAc,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACxD;AA6JD,wBAAgB,KAAK,CAAC,EACpB,MAAM,EACN,QAAQ,EACR,eAAe,EACf,aAAa,EACb,cAAc,GACf,EAAE,UAAU,GAAG,KAAK,CAAC,YAAY,CAqDjC"}
@@ -2,11 +2,11 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useRef } from 'react';
3
3
  import { P1Client } from '@pantheon-systems/css-client';
4
4
  import { P1AuthProvider, useP1Auth, P1LoginPage } from '../auth/index.js';
5
- import { P1PuckProvider } from './P1PuckProvider.js';
6
5
  import { useP1Puck } from '../core/P1PuckContext.js';
7
6
  import { useOptionalPresenceContext } from '../core/PresenceContext.js';
8
7
  import { createFocusRegionMap } from '../collaboration/utils/focusRegionMap.js';
9
8
  import { pdsCoreCSS } from '../pds/theme/pds-core-content.js';
9
+ import { P1PuckProvider } from './P1PuckProvider.js';
10
10
  function AuthGate({ config, children, loadingFallback, loginFallback, loginPageProps, }) {
11
11
  const { isAuthenticated, isLoading, user, token } = useP1Auth();
12
12
  if (isLoading) {
@@ -1 +1 @@
1
- {"version":3,"file":"P1App.js","sourceRoot":"","sources":["../../src/editor/P1App.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAGhF,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAU9D,SAAS,QAAQ,CAAC,EAChB,MAAM,EACN,QAAQ,EACR,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AAe,EAAE,CAAC;IACnC;;;;OAIG;IACH,aAAa,CAAC,EAAE,eAAe,CAAC;CACjC;AAyBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,KAAK,CAAC,YAAY,CAM7E"}
@@ -5,20 +5,38 @@ import { jsx as _jsx } from "react/jsx-runtime";
5
5
  * React context provider for P1 Puck integration.
6
6
  */
7
7
  import { useState, useCallback, useMemo, useEffect, useRef } from 'react';
8
+ import isEqual from 'lodash.isequal';
8
9
  import { P1PuckContext } from '../core/P1PuckContext.js';
9
10
  import { NotificationProvider, useNotifications } from '../core/NotificationContext.js';
10
11
  import { PresenceContext } from '../core/PresenceContext.js';
11
- import isEqual from 'lodash.isequal';
12
12
  import { debounce } from '../core/utils/debounce.js';
13
13
  import { withRetry } from '../core/utils/retry.js';
14
- import { useRealtime } from './useRealtime.js';
15
- import { useDocuments } from './useDocuments.js';
16
- import { snapshotToPuckData } from './utils/snapshotToPuckData.js';
17
14
  import { resolveFeatureConfig } from '../core/featureConfig.js';
18
- import { resolveActivePlugins, composeProviders } from './composePlugins.js';
19
- import { DEFAULT_CSS_FEATURE_PLUGINS } from './defaultPlugins.js';
20
15
  import { createPuckPermissions } from '../features/content-type-templates/permissions/createPuckPermissions.js';
21
16
  import { useTemplateList } from '../features/content-type-templates/hooks/useTemplateList.js';
17
+ import { presenceIdentityKey } from '../collaboration/utils/presenceIdentity.js';
18
+ import { DEFAULT_CSS_FEATURE_PLUGINS } from './defaultPlugins.js';
19
+ import { resolveActivePlugins, composeProviders } from './composePlugins.js';
20
+ import { snapshotToPuckData } from './utils/snapshotToPuckData.js';
21
+ import { useDocuments } from './useDocuments.js';
22
+ import { useRealtime } from './useRealtime.js';
23
+ /**
24
+ * Identity to record alongside a loaded payload.
25
+ *
26
+ * `branch` must be the branch the load was requested for, not the branch on the
27
+ * returned version: for an inherited document the backend serves main's
28
+ * published version, and recording main would make every consumer treat the
29
+ * payload as belonging to another workstream.
30
+ *
31
+ * Returns a fresh object per call so consumers re-run even when two documents
32
+ * share payload identity — snapshotToPuckData yields one shared constant for
33
+ * every blank snapshot.
34
+ */
35
+ function originFor(doc, branch, versionId, historical) {
36
+ return doc
37
+ ? { branchId: branch, documentId: doc.id, documentPath: doc.path, versionId, historical }
38
+ : null;
39
+ }
22
40
  /**
23
41
  * Provider component for P1 Puck integration.
24
42
  *
@@ -56,6 +74,46 @@ import { useTemplateList } from '../features/content-type-templates/hooks/useTem
56
74
  export function P1PuckProvider(props) {
57
75
  return (_jsx(NotificationProvider, { children: _jsx(P1PuckProviderInner, { ...props }) }));
58
76
  }
77
+ /** Query param naming the workstream to open, set by the dashboard's "Open in visual editor". */
78
+ const BRANCH_QUERY_PARAM = 'branch';
79
+ /**
80
+ * Rejected here rather than downstream: the value reaches API paths and the
81
+ * realtime URL unescaped, so anything that could change a URL's shape ("/",
82
+ * ".", "?", "#") must never get that far. refreshBranches still decides whether
83
+ * a well-formed id actually exists.
84
+ */
85
+ const BRANCH_ID_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
86
+ /** Kept pure — the param is consumed in an effect, not while rendering. */
87
+ function readDeepLinkBranchId() {
88
+ if (typeof window === 'undefined')
89
+ return '';
90
+ try {
91
+ const raw = new URL(window.location.href).searchParams
92
+ .get(BRANCH_QUERY_PARAM)?.trim() ?? '';
93
+ return BRANCH_ID_PATTERN.test(raw) ? raw : '';
94
+ }
95
+ catch {
96
+ return '';
97
+ }
98
+ }
99
+ /**
100
+ * Left in place the param would re-apply on the next remount (this provider
101
+ * remounts on route-param changes), silently undoing a manual workstream switch.
102
+ */
103
+ function stripDeepLinkBranchParam() {
104
+ if (typeof window === 'undefined')
105
+ return;
106
+ try {
107
+ const url = new URL(window.location.href);
108
+ if (!url.searchParams.has(BRANCH_QUERY_PARAM))
109
+ return;
110
+ url.searchParams.delete(BRANCH_QUERY_PARAM);
111
+ window.history.replaceState(window.history.state, '', `${url.pathname}${url.search}${url.hash}`);
112
+ }
113
+ catch {
114
+ // history/URL unavailable — the param is harmless if it stays
115
+ }
116
+ }
59
117
  /**
60
118
  * Inner provider component that has access to notification context.
61
119
  */
@@ -101,8 +159,15 @@ userRole = 'editor', children, }) {
101
159
  ?.then((site) => setSiteName(site.name))
102
160
  .catch(() => { });
103
161
  }, [client, siteId]);
104
- // Branch state - start with initialBranchId, persisted branch, or empty (will be set to main)
162
+ // Outranks the prop (a build-time default) and sessionStorage (a previous
163
+ // visit): this names the workstream the user just asked for. refreshBranches
164
+ // validates it, so a stale or foreign id still falls back to main.
165
+ const [deepLinkBranchId] = useState(readDeepLinkBranchId);
166
+ // Branch state - start with the deep link, initialBranchId, persisted branch,
167
+ // or empty (will be set to main)
105
168
  const [branchId, setBranchId] = useState(() => {
169
+ if (deepLinkBranchId)
170
+ return deepLinkBranchId;
106
171
  if (initialBranchId)
107
172
  return initialBranchId;
108
173
  try {
@@ -115,7 +180,7 @@ userRole = 'editor', children, }) {
115
180
  const [branches, setBranches] = useState([]);
116
181
  const [currentBranch, setCurrentBranch] = useState(null);
117
182
  const [branchesLoading, setBranchesLoading] = useState(() => {
118
- if (initialBranchId)
183
+ if (deepLinkBranchId || initialBranchId)
119
184
  return false;
120
185
  try {
121
186
  return !(typeof window !== 'undefined' && sessionStorage.getItem(branchStorageKey));
@@ -124,9 +189,19 @@ userRole = 'editor', children, }) {
124
189
  return true;
125
190
  }
126
191
  });
192
+ // Persist before stripping: once the param is gone, a remount landing before
193
+ // the branch list resolves would otherwise fall back to a stale persisted
194
+ // branch. refreshBranches replaces this with a validated value.
195
+ useEffect(() => {
196
+ if (!deepLinkBranchId)
197
+ return;
198
+ persistBranchId(deepLinkBranchId);
199
+ stripDeepLinkBranchParam();
200
+ }, [deepLinkBranchId, persistBranchId]);
127
201
  // Document state
128
202
  const [currentDocument, setCurrentDocument] = useState(null);
129
203
  const [currentData, setCurrentData] = useState(null);
204
+ const [currentDataOrigin, setCurrentDataOrigin] = useState(null);
130
205
  // True while loadDocument is in flight. Consumers use it to distinguish
131
206
  // "no document while switching" (keep showing the old canvas) from
132
207
  // "genuinely no document" (show the empty state).
@@ -151,6 +226,19 @@ userRole = 'editor', children, }) {
151
226
  // Checked before every write (realtime or REST) to prevent cross-document
152
227
  // corruption during rapid document switching.
153
228
  const currentDataDocumentPathRef = useRef(null);
229
+ const currentDataOriginRef = useRef(null);
230
+ // Commit data and the identity it was loaded under in a single render pass.
231
+ //
232
+ // Path alone cannot distinguish two branches' copies of the same page, which
233
+ // is what let one workstream's data be published under another's sync key.
234
+ // Because both land in one commit, a consumer reading them together can never
235
+ // see a new identity beside old data.
236
+ const commitCurrentData = useCallback((data, origin) => {
237
+ currentDataDocumentPathRef.current = origin?.documentPath ?? null;
238
+ currentDataOriginRef.current = origin;
239
+ setCurrentDataOrigin(origin);
240
+ setCurrentData(data);
241
+ }, []);
154
242
  // Snapshot of the data loadDocument just loaded. The first onChange after a
155
243
  // load echoes this back; saveData drops that echo by structural compare
156
244
  // (not a one-shot flag, which would swallow a lone genuine first edit like a
@@ -287,9 +375,10 @@ userRole = 'editor', children, }) {
287
375
  // The content-based guards in puckDataToYMap and RealtimeClient
288
376
  // prevent actual echo loops at the Y.Doc/WebSocket layer.
289
377
  pendingRemoteUpdatesRef.current += 1;
290
- // Update current data when remote changes arrive
291
- currentDataDocumentPathRef.current = currentDocumentRef.current?.path ?? null;
292
- setCurrentData(dataToSync);
378
+ // Update current data when remote changes arrive. Same document and
379
+ // branch as whatever is loaded, but no longer a stored version — this
380
+ // syncs through remoteSyncKey below, not the document-sync plugin.
381
+ commitCurrentData(dataToSync, originFor(currentDocumentRef.current, currentDataOriginRef.current?.branchId ?? null, null, currentDataOriginRef.current?.historical ?? false));
293
382
  // Update sync key to trigger Puck re-sync
294
383
  setRemoteSyncKey(`remote-${Date.now()}`);
295
384
  pendingRemoteDataRef.current = null;
@@ -745,6 +834,34 @@ userRole = 'editor', children, }) {
745
834
  }
746
835
  await performSave();
747
836
  }, [debouncedSave, performSave, enableRealtime]);
837
+ // Persist current in-memory edits as a REST version before a destructive operation.
838
+ // Realtime: confirms WebSocket delivery then snapshots latestLocalDataRef as a version.
839
+ // Non-realtime: delegates to performSave which creates a version from pendingDataRef.
840
+ const persistCurrentEdits = useCallback(async () => {
841
+ if (!enableRealtime || !realtimeConnectedRef.current) {
842
+ await performSave();
843
+ return;
844
+ }
845
+ await realtime.waitForDelivery();
846
+ const latestData = latestLocalDataRef.current;
847
+ const doc = currentDocumentRef.current;
848
+ if (latestData && doc && currentDataDocumentPathRef.current === doc.path) {
849
+ setSaveStatus('saving');
850
+ try {
851
+ await userClient.versions.create(siteId, {
852
+ documentId: doc.id,
853
+ branchId,
854
+ snapshot: latestData,
855
+ });
856
+ setSaveStatus('saved');
857
+ setLastSaved(new Date());
858
+ }
859
+ catch (err) {
860
+ setSaveStatus('error');
861
+ throw err;
862
+ }
863
+ }
864
+ }, [enableRealtime, realtime, performSave, userClient, siteId, branchId]);
748
865
  // Load document by path
749
866
  const loadDocument = useCallback(async (path) => {
750
867
  // Flush any pending debounced save while the outgoing document's
@@ -761,6 +878,8 @@ userRole = 'editor', children, }) {
761
878
  }
762
879
  debouncedSave.cancel();
763
880
  pendingDataRef.current = null;
881
+ // Invalidate cached local edit so returnToLatest() doesn't treat it as unsaved.
882
+ latestLocalDataRef.current = null;
764
883
  // Cancel any pending remote sync to prevent race conditions
765
884
  // where a stale remote update overrides the document we're loading
766
885
  cancelPendingRemoteSync();
@@ -774,27 +893,22 @@ userRole = 'editor', children, }) {
774
893
  // Pre-clear the current document so nothing can save against the old
775
894
  // one while the fetch is in flight. The canvas keeps showing the
776
895
  // previous document — documentLoading suppresses the empty state.
777
- currentDataDocumentPathRef.current = null;
778
- setCurrentData(null);
779
- setCurrentDocument(null);
896
+ commitCurrentData(null, null);
780
897
  try {
781
- // Normalize path: strip leading slash if present
782
- const normalizedPath = path.startsWith('/') ? path.slice(1) : path;
783
- // Get document by path
784
- const doc = await userClient.documents.getByPath(siteId, normalizedPath);
898
+ const doc = await userClient.documents.getByPath(siteId, path.startsWith('/') ? path.slice(1) : path);
785
899
  // Staleness check: a newer loadDocument call has started
786
900
  if (thisRequestId !== loadRequestIdRef.current) {
787
901
  console.debug('[P1PuckProvider] Stale loadDocument — skipping (after getByPath)');
788
902
  return;
789
903
  }
790
- // Clear stale data BEFORE updating the document identity so that
791
- // useRealtime's new useEffect sees initialData=null when it creates
792
- // the fresh Y.Doc. Without this, currentData still holds the previous
793
- // document's content when setCurrentDocument triggers the re-render,
794
- // causing the new Y.Doc to be seeded with the wrong document's Yjs
795
- // state — which the DO then commits as the first realtime version.
796
- currentDataDocumentPathRef.current = null;
797
- setCurrentData(null);
904
+ // Use ID not path paths may differ by normalization, causing a false disconnect.
905
+ // Same-doc keeps Yjs alive; cross-doc nulls out so useRealtime seeds a fresh Y.Doc.
906
+ const isSameDocument = doc.id === currentDocumentRef.current?.id;
907
+ // Null data before identity update so useRealtime sees initialData=null.
908
+ commitCurrentData(null, null);
909
+ if (!isSameDocument) {
910
+ setCurrentDocument(null);
911
+ }
798
912
  setCurrentDocument(doc);
799
913
  // Fetch template if document is bound to one (PROPOSAL-010)
800
914
  if (doc.templateId) {
@@ -851,9 +965,13 @@ userRole = 'editor', children, }) {
851
965
  captureTimerRef.current = null;
852
966
  }
853
967
  realtimeDataCaptureRef.current = null;
854
- currentDataDocumentPathRef.current = doc.path;
855
968
  suppressNextSaveRef.current = puckData;
856
- setCurrentData(puckData);
969
+ // branchId is the branch this load requested, deliberately not
970
+ // version.branchId: for an inherited document the backend serves main's
971
+ // published version, so the version names main while the payload is what
972
+ // the requested branch should display. Recording main here would make
973
+ // every consumer reject the payload as foreign.
974
+ commitCurrentData(puckData, originFor(doc, branchId, version.id, false));
857
975
  latestVersionDataRef.current = puckData;
858
976
  setViewingVersion(null);
859
977
  // Clear remoteSyncKey so document sync takes priority
@@ -868,8 +986,7 @@ userRole = 'editor', children, }) {
868
986
  console.warn('[P1PuckProvider] loadDocument failed:', error);
869
987
  // Unload the current document so VersionBannerOverride shows the empty
870
988
  // state instead of the previous document's content.
871
- currentDataDocumentPathRef.current = null;
872
- setCurrentData(null);
989
+ commitCurrentData(null, null);
873
990
  setCurrentDocument(null);
874
991
  throw error;
875
992
  }
@@ -880,7 +997,7 @@ userRole = 'editor', children, }) {
880
997
  setDocumentLoading(false);
881
998
  }
882
999
  }
883
- }, [userClient, siteId, branchId, cancelPendingRemoteSync, enableRealtime, debouncedSave, performSave]);
1000
+ }, [userClient, siteId, branchId, cancelPendingRemoteSync, enableRealtime, debouncedSave, performSave, commitCurrentData]);
884
1001
  // Load a specific version into the editor
885
1002
  const loadVersion = useCallback(async (version) => {
886
1003
  // Cancel any pending remote sync to prevent race conditions
@@ -909,8 +1026,9 @@ userRole = 'editor', children, }) {
909
1026
  // The effect that syncs viewingVersionRef runs AFTER render, which is too late
910
1027
  // Remote updates check this ref, so we need it set synchronously
911
1028
  viewingVersionRef.current = versionToUse;
912
- currentDataDocumentPathRef.current = currentDocumentRef.current?.path ?? null;
913
- setCurrentData(puckData);
1029
+ // Historical: the document-sync plugin must not push this into the
1030
+ // canvas that owns the live undo stack — the version bridge handles it.
1031
+ commitCurrentData(puckData, originFor(doc, branchId, versionToUse.id, true));
914
1032
  setViewingVersion(versionToUse);
915
1033
  // Clear remoteSyncKey so version sync takes priority
916
1034
  setRemoteSyncKey(null);
@@ -924,7 +1042,7 @@ userRole = 'editor', children, }) {
924
1042
  console.error('Failed to load version:', error);
925
1043
  throw error;
926
1044
  }
927
- }, [userClient, siteId, branchId, debouncedSave, cancelPendingRemoteSync]);
1045
+ }, [userClient, siteId, branchId, debouncedSave, cancelPendingRemoteSync, commitCurrentData]);
928
1046
  // Return to the latest version
929
1047
  const returnToLatest = useCallback(async () => {
930
1048
  // Cancel any pending remote sync to prevent race conditions
@@ -987,8 +1105,7 @@ userRole = 'editor', children, }) {
987
1105
  pendingRemoteUpdatesRef.current = 0;
988
1106
  }, 100);
989
1107
  }
990
- currentDataDocumentPathRef.current = currentDocumentRef.current?.path ?? null;
991
- setCurrentData(dataToRestore);
1108
+ commitCurrentData(dataToRestore, originFor(currentDocumentRef.current, branchId, null, false));
992
1109
  latestVersionDataRef.current = dataToRestore;
993
1110
  setViewingVersion(null);
994
1111
  // Clear remoteSyncKey so latest version sync takes priority
@@ -1005,7 +1122,7 @@ userRole = 'editor', children, }) {
1005
1122
  }
1006
1123
  setSaveStatus('idle');
1007
1124
  }
1008
- }, [debouncedSave, cancelPendingRemoteSync, enableRealtime, realtime, userClient, siteId, branchId, showErrorNotifications, notificationContext]);
1125
+ }, [debouncedSave, cancelPendingRemoteSync, enableRealtime, realtime, userClient, siteId, branchId, showErrorNotifications, notificationContext, commitCurrentData]);
1009
1126
  // Computed property for whether viewing historical version
1010
1127
  const isViewingHistoricalVersion = viewingVersion !== null;
1011
1128
  // =========================================================================
@@ -1167,6 +1284,8 @@ userRole = 'editor', children, }) {
1167
1284
  // but shouldn't cause PuckDataSynchronizer or plugin re-renders.
1168
1285
  const presenceStateRef = useRef(presenceState);
1169
1286
  presenceStateRef.current = presenceState;
1287
+ const humanPresenceKey = presenceIdentityKey(presenceState?.humans);
1288
+ const agentPresenceKey = presenceIdentityKey(presenceState?.agents);
1170
1289
  // =========================================================================
1171
1290
  // Phase 9: Agent Edit Capabilities (when this client IS an agent)
1172
1291
  // =========================================================================
@@ -1464,8 +1583,7 @@ userRole = 'editor', children, }) {
1464
1583
  // IMPORTANT: Update the ref BEFORE state updates
1465
1584
  viewingVersionRef.current = null;
1466
1585
  setCurrentDocument(null);
1467
- currentDataDocumentPathRef.current = null;
1468
- setCurrentData(null);
1586
+ commitCurrentData(null, null);
1469
1587
  setViewingVersion(null);
1470
1588
  // Clear remoteSyncKey so new branch document sync takes priority
1471
1589
  setRemoteSyncKey(null);
@@ -1482,7 +1600,7 @@ userRole = 'editor', children, }) {
1482
1600
  switchBranchInFlightRef.current = null;
1483
1601
  }
1484
1602
  }
1485
- }, [branches, debouncedSave, performSave, cancelPendingRemoteSync, persistBranchId]);
1603
+ }, [branches, debouncedSave, performSave, cancelPendingRemoteSync, persistBranchId, commitCurrentData]);
1486
1604
  // Presence context value (for hooks like useFocusRegionReporting)
1487
1605
  const presenceContextValue = useMemo(() => {
1488
1606
  if (!presenceEnabled)
@@ -1534,6 +1652,9 @@ userRole = 'editor', children, }) {
1534
1652
  const saveNowRef = useRef(saveNow);
1535
1653
  saveNowRef.current = saveNow;
1536
1654
  const stableSaveNow = useCallback(() => saveNowRef.current(), []);
1655
+ const persistCurrentEditsRef = useRef(persistCurrentEdits);
1656
+ persistCurrentEditsRef.current = persistCurrentEdits;
1657
+ const stablePersistCurrentEdits = useCallback(() => persistCurrentEditsRef.current(), []);
1537
1658
  const createCheckpointRef = useRef(createCheckpoint);
1538
1659
  createCheckpointRef.current = createCheckpoint;
1539
1660
  const stableCreateCheckpoint = useCallback((name) => createCheckpointRef.current(name), []);
@@ -1644,6 +1765,7 @@ userRole = 'editor', children, }) {
1644
1765
  userId,
1645
1766
  currentDocument,
1646
1767
  currentData,
1768
+ currentDataOrigin,
1647
1769
  documentLoading,
1648
1770
  saveStatus,
1649
1771
  lastSaved,
@@ -1651,6 +1773,7 @@ userRole = 'editor', children, }) {
1651
1773
  loadDocument: stableLoadDocument,
1652
1774
  saveData: stableSaveData,
1653
1775
  saveNow: stableSaveNow,
1776
+ persistCurrentEdits: stablePersistCurrentEdits,
1654
1777
  createCheckpoint: stableCreateCheckpoint,
1655
1778
  publishDocument: stablePublishDocument,
1656
1779
  switchBranch: stableSwitchBranch,
@@ -1731,6 +1854,7 @@ userRole = 'editor', children, }) {
1731
1854
  userId,
1732
1855
  currentDocument,
1733
1856
  currentData,
1857
+ currentDataOrigin,
1734
1858
  documentLoading,
1735
1859
  saveStatus,
1736
1860
  lastSaved,
@@ -1738,6 +1862,7 @@ userRole = 'editor', children, }) {
1738
1862
  stableLoadDocument,
1739
1863
  stableSaveData,
1740
1864
  stableSaveNow,
1865
+ stablePersistCurrentEdits,
1741
1866
  stableCreateCheckpoint,
1742
1867
  stablePublishDocument,
1743
1868
  stableSwitchBranch,
@@ -1775,7 +1900,11 @@ userRole = 'editor', children, }) {
1775
1900
  handleRealtimeDataCapture,
1776
1901
  // Phase 9 dependencies (full presenceState excluded — accessed via getter/ref,
1777
1902
  // but humanPresenceCount/hasActiveHumans/hasActiveAgents are direct values so every
1778
- // join/leave triggers re-renders regardless of how many actors are present)
1903
+ // join/leave triggers re-renders regardless of how many actors are present).
1904
+ // The roster keys cover the changes a count cannot see: a same-frame join/leave of
1905
+ // two humans would keep the count the same but change the roster.
1906
+ humanPresenceKey,
1907
+ agentPresenceKey,
1779
1908
  presenceState?.humans.length,
1780
1909
  presenceState?.hasActiveHumans,
1781
1910
  presenceState?.hasActiveAgents,