@conloca/cms-spa 0.2.6 → 0.3.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 (483) hide show
  1. package/dist/spa/main.css +262 -21
  2. package/dist/ts/.build-inputs.json +99 -57
  3. package/dist/ts/CmsSpaApp.d.ts +4 -6
  4. package/dist/ts/CmsSpaApp.d.ts.map +1 -1
  5. package/dist/ts/CmsSpaApp.js +19 -8
  6. package/dist/ts/CmsSpaApp.js.map +1 -1
  7. package/dist/ts/components/conflicts/EditorNoticeStrip.d.ts +44 -0
  8. package/dist/ts/components/conflicts/EditorNoticeStrip.d.ts.map +1 -0
  9. package/dist/ts/components/conflicts/EditorNoticeStrip.js +55 -0
  10. package/dist/ts/components/conflicts/EditorNoticeStrip.js.map +1 -0
  11. package/dist/ts/components/conflicts/FieldConflictList.d.ts +20 -0
  12. package/dist/ts/components/conflicts/FieldConflictList.d.ts.map +1 -0
  13. package/dist/ts/components/conflicts/FieldConflictList.js +14 -0
  14. package/dist/ts/components/conflicts/FieldConflictList.js.map +1 -0
  15. package/dist/ts/components/conflicts/FieldConflictPicker.d.ts +28 -0
  16. package/dist/ts/components/conflicts/FieldConflictPicker.d.ts.map +1 -0
  17. package/dist/ts/components/conflicts/FieldConflictPicker.js +52 -0
  18. package/dist/ts/components/conflicts/FieldConflictPicker.js.map +1 -0
  19. package/dist/ts/components/conflicts/OverwriteNotice.d.ts +11 -0
  20. package/dist/ts/components/conflicts/OverwriteNotice.d.ts.map +1 -0
  21. package/dist/ts/components/conflicts/OverwriteNotice.js +8 -0
  22. package/dist/ts/components/conflicts/OverwriteNotice.js.map +1 -0
  23. package/dist/ts/components/conflicts/PageDraftMenu.d.ts +11 -0
  24. package/dist/ts/components/conflicts/PageDraftMenu.d.ts.map +1 -0
  25. package/dist/ts/components/conflicts/PageDraftMenu.js +20 -0
  26. package/dist/ts/components/conflicts/PageDraftMenu.js.map +1 -0
  27. package/dist/ts/components/conflicts/PeerAvatars.d.ts +9 -0
  28. package/dist/ts/components/conflicts/PeerAvatars.d.ts.map +1 -0
  29. package/dist/ts/components/conflicts/PeerAvatars.js +29 -0
  30. package/dist/ts/components/conflicts/PeerAvatars.js.map +1 -0
  31. package/dist/ts/components/conflicts/PuckConflicts.d.ts +13 -0
  32. package/dist/ts/components/conflicts/PuckConflicts.d.ts.map +1 -0
  33. package/dist/ts/components/conflicts/PuckConflicts.js +59 -0
  34. package/dist/ts/components/conflicts/PuckConflicts.js.map +1 -0
  35. package/dist/ts/components/conflicts/RecentVersionsDialog.d.ts +15 -0
  36. package/dist/ts/components/conflicts/RecentVersionsDialog.d.ts.map +1 -0
  37. package/dist/ts/components/conflicts/RecentVersionsDialog.js +94 -0
  38. package/dist/ts/components/conflicts/RecentVersionsDialog.js.map +1 -0
  39. package/dist/ts/components/conflicts/conflict-label.d.ts +12 -0
  40. package/dist/ts/components/conflicts/conflict-label.d.ts.map +1 -0
  41. package/dist/ts/components/conflicts/conflict-label.js +120 -0
  42. package/dist/ts/components/conflicts/conflict-label.js.map +1 -0
  43. package/dist/ts/components/conflicts/use-page-conflicts.d.ts +26 -0
  44. package/dist/ts/components/conflicts/use-page-conflicts.d.ts.map +1 -0
  45. package/dist/ts/components/conflicts/use-page-conflicts.js +93 -0
  46. package/dist/ts/components/conflicts/use-page-conflicts.js.map +1 -0
  47. package/dist/ts/components/conflicts/version-copy.d.ts +7 -0
  48. package/dist/ts/components/conflicts/version-copy.d.ts.map +1 -0
  49. package/dist/ts/components/conflicts/version-copy.js +31 -0
  50. package/dist/ts/components/conflicts/version-copy.js.map +1 -0
  51. package/dist/ts/components/dashboard/RecentActivity.d.ts.map +1 -1
  52. package/dist/ts/components/dashboard/RecentActivity.js +2 -1
  53. package/dist/ts/components/dashboard/RecentActivity.js.map +1 -1
  54. package/dist/ts/components/dialogs/CreatePageDialog.js +1 -1
  55. package/dist/ts/components/dialogs/CreatePageDialog.js.map +1 -1
  56. package/dist/ts/components/dialogs/DataPropertiesDialog.d.ts +2 -1
  57. package/dist/ts/components/dialogs/DataPropertiesDialog.d.ts.map +1 -1
  58. package/dist/ts/components/dialogs/DataPropertiesDialog.js +15 -3
  59. package/dist/ts/components/dialogs/DataPropertiesDialog.js.map +1 -1
  60. package/dist/ts/components/dialogs/FragmentPropertiesDialog.d.ts +2 -1
  61. package/dist/ts/components/dialogs/FragmentPropertiesDialog.d.ts.map +1 -1
  62. package/dist/ts/components/dialogs/FragmentPropertiesDialog.js +16 -3
  63. package/dist/ts/components/dialogs/FragmentPropertiesDialog.js.map +1 -1
  64. package/dist/ts/components/dialogs/PageMetadataDialog.d.ts +9 -2
  65. package/dist/ts/components/dialogs/PageMetadataDialog.d.ts.map +1 -1
  66. package/dist/ts/components/dialogs/PageMetadataDialog.js +63 -16
  67. package/dist/ts/components/dialogs/PageMetadataDialog.js.map +1 -1
  68. package/dist/ts/components/dialogs/UnsavedChangesDialog.d.ts +16 -1
  69. package/dist/ts/components/dialogs/UnsavedChangesDialog.d.ts.map +1 -1
  70. package/dist/ts/components/dialogs/UnsavedChangesDialog.js +90 -2
  71. package/dist/ts/components/dialogs/UnsavedChangesDialog.js.map +1 -1
  72. package/dist/ts/components/dialogs/unsaved-guard.d.ts +9 -0
  73. package/dist/ts/components/dialogs/unsaved-guard.d.ts.map +1 -0
  74. package/dist/ts/components/dialogs/unsaved-guard.js +14 -0
  75. package/dist/ts/components/dialogs/unsaved-guard.js.map +1 -0
  76. package/dist/ts/components/editor/CMSMDXEditor.d.ts +6 -1
  77. package/dist/ts/components/editor/CMSMDXEditor.d.ts.map +1 -1
  78. package/dist/ts/components/editor/CMSMDXEditor.js +32 -15
  79. package/dist/ts/components/editor/CMSMDXEditor.js.map +1 -1
  80. package/dist/ts/components/editor/EditorFrame.d.ts +22 -0
  81. package/dist/ts/components/editor/EditorFrame.d.ts.map +1 -0
  82. package/dist/ts/components/editor/EditorFrame.js +72 -0
  83. package/dist/ts/components/editor/EditorFrame.js.map +1 -0
  84. package/dist/ts/components/editor/FragmentBlockTypeSelect.d.ts +10 -0
  85. package/dist/ts/components/editor/FragmentBlockTypeSelect.d.ts.map +1 -0
  86. package/dist/ts/components/editor/FragmentBlockTypeSelect.js +187 -0
  87. package/dist/ts/components/editor/FragmentBlockTypeSelect.js.map +1 -0
  88. package/dist/ts/components/editor/FragmentComponentBlock.d.ts +7 -0
  89. package/dist/ts/components/editor/FragmentComponentBlock.d.ts.map +1 -0
  90. package/dist/ts/components/editor/FragmentComponentBlock.js +180 -0
  91. package/dist/ts/components/editor/FragmentComponentBlock.js.map +1 -0
  92. package/dist/ts/components/editor/FragmentEditor.d.ts +3 -1
  93. package/dist/ts/components/editor/FragmentEditor.d.ts.map +1 -1
  94. package/dist/ts/components/editor/FragmentEditor.js +545 -130
  95. package/dist/ts/components/editor/FragmentEditor.js.map +1 -1
  96. package/dist/ts/components/editor/FragmentEditorHeaderActions.d.ts +20 -0
  97. package/dist/ts/components/editor/FragmentEditorHeaderActions.d.ts.map +1 -0
  98. package/dist/ts/components/editor/FragmentEditorHeaderActions.js +49 -0
  99. package/dist/ts/components/editor/FragmentEditorHeaderActions.js.map +1 -0
  100. package/dist/ts/components/editor/GenericBlock.d.ts.map +1 -1
  101. package/dist/ts/components/editor/GenericBlock.js +109 -12
  102. package/dist/ts/components/editor/GenericBlock.js.map +1 -1
  103. package/dist/ts/components/editor/InlinePreviewFrame.d.ts +19 -0
  104. package/dist/ts/components/editor/InlinePreviewFrame.d.ts.map +1 -0
  105. package/dist/ts/components/editor/InlinePreviewFrame.js +65 -0
  106. package/dist/ts/components/editor/InlinePreviewFrame.js.map +1 -0
  107. package/dist/ts/components/editor/JsxPropsPanel.d.ts.map +1 -1
  108. package/dist/ts/components/editor/JsxPropsPanel.js +62 -2
  109. package/dist/ts/components/editor/JsxPropsPanel.js.map +1 -1
  110. package/dist/ts/components/editor/LocaleSelector.d.ts +2 -1
  111. package/dist/ts/components/editor/LocaleSelector.d.ts.map +1 -1
  112. package/dist/ts/components/editor/LocaleSelector.js +2 -2
  113. package/dist/ts/components/editor/LocaleSelector.js.map +1 -1
  114. package/dist/ts/components/editor/MDXLivePreview.d.ts +2 -0
  115. package/dist/ts/components/editor/MDXLivePreview.d.ts.map +1 -1
  116. package/dist/ts/components/editor/MDXLivePreview.js +30 -38
  117. package/dist/ts/components/editor/MDXLivePreview.js.map +1 -1
  118. package/dist/ts/components/editor/MdxPageEditor.d.ts +7 -2
  119. package/dist/ts/components/editor/MdxPageEditor.d.ts.map +1 -1
  120. package/dist/ts/components/editor/MdxPageEditor.js +136 -10
  121. package/dist/ts/components/editor/MdxPageEditor.js.map +1 -1
  122. package/dist/ts/components/editor/PageEditor.d.ts +4 -1
  123. package/dist/ts/components/editor/PageEditor.d.ts.map +1 -1
  124. package/dist/ts/components/editor/PageEditor.js +78 -100
  125. package/dist/ts/components/editor/PageEditor.js.map +1 -1
  126. package/dist/ts/components/editor/PageEditorHeaderActions.d.ts +15 -4
  127. package/dist/ts/components/editor/PageEditorHeaderActions.d.ts.map +1 -1
  128. package/dist/ts/components/editor/PageEditorHeaderActions.js +13 -7
  129. package/dist/ts/components/editor/PageEditorHeaderActions.js.map +1 -1
  130. package/dist/ts/components/editor/PageEditorWrapper.d.ts +8 -2
  131. package/dist/ts/components/editor/PageEditorWrapper.d.ts.map +1 -1
  132. package/dist/ts/components/editor/PageEditorWrapper.js +99 -41
  133. package/dist/ts/components/editor/PageEditorWrapper.js.map +1 -1
  134. package/dist/ts/components/editor/body-sync-plugin.d.ts +2 -0
  135. package/dist/ts/components/editor/body-sync-plugin.d.ts.map +1 -0
  136. package/dist/ts/components/editor/body-sync-plugin.js +32 -0
  137. package/dist/ts/components/editor/body-sync-plugin.js.map +1 -0
  138. package/dist/ts/components/editor/draft-media-config.d.ts +6 -0
  139. package/dist/ts/components/editor/draft-media-config.d.ts.map +1 -1
  140. package/dist/ts/components/editor/draft-media-config.js +21 -0
  141. package/dist/ts/components/editor/draft-media-config.js.map +1 -1
  142. package/dist/ts/components/editor/fragment-save-check.d.ts +7 -0
  143. package/dist/ts/components/editor/fragment-save-check.d.ts.map +1 -0
  144. package/dist/ts/components/editor/fragment-save-check.js +13 -0
  145. package/dist/ts/components/editor/fragment-save-check.js.map +1 -0
  146. package/dist/ts/components/editor/fragment-save-lifetime.d.ts +18 -0
  147. package/dist/ts/components/editor/fragment-save-lifetime.d.ts.map +1 -0
  148. package/dist/ts/components/editor/fragment-save-lifetime.js +115 -0
  149. package/dist/ts/components/editor/fragment-save-lifetime.js.map +1 -0
  150. package/dist/ts/components/editor/host-wrapper-plugin.d.ts.map +1 -1
  151. package/dist/ts/components/editor/host-wrapper-plugin.js +20 -7
  152. package/dist/ts/components/editor/host-wrapper-plugin.js.map +1 -1
  153. package/dist/ts/components/editor/index.d.ts +0 -1
  154. package/dist/ts/components/editor/index.d.ts.map +1 -1
  155. package/dist/ts/components/editor/index.js +0 -1
  156. package/dist/ts/components/editor/index.js.map +1 -1
  157. package/dist/ts/components/editor/insert-menu/InsertMdxComponentButton.d.ts.map +1 -1
  158. package/dist/ts/components/editor/insert-menu/InsertMdxComponentButton.js +6 -11
  159. package/dist/ts/components/editor/insert-menu/InsertMdxComponentButton.js.map +1 -1
  160. package/dist/ts/components/editor/insert-menu/SlashMenuPlugin.d.ts.map +1 -1
  161. package/dist/ts/components/editor/insert-menu/SlashMenuPlugin.js +66 -12
  162. package/dist/ts/components/editor/insert-menu/SlashMenuPlugin.js.map +1 -1
  163. package/dist/ts/components/editor/insert-menu/insert-payload.d.ts +16 -21
  164. package/dist/ts/components/editor/insert-menu/insert-payload.d.ts.map +1 -1
  165. package/dist/ts/components/editor/insert-menu/insert-payload.js +75 -22
  166. package/dist/ts/components/editor/insert-menu/insert-payload.js.map +1 -1
  167. package/dist/ts/components/editor/insert-menu/mdx-components-plugin.d.ts +3 -1
  168. package/dist/ts/components/editor/insert-menu/mdx-components-plugin.d.ts.map +1 -1
  169. package/dist/ts/components/editor/insert-menu/mdx-components-plugin.js +5 -3
  170. package/dist/ts/components/editor/insert-menu/mdx-components-plugin.js.map +1 -1
  171. package/dist/ts/components/editor/jsx-layout-plugin.d.ts +25 -0
  172. package/dist/ts/components/editor/jsx-layout-plugin.d.ts.map +1 -0
  173. package/dist/ts/components/editor/jsx-layout-plugin.js +77 -0
  174. package/dist/ts/components/editor/jsx-layout-plugin.js.map +1 -0
  175. package/dist/ts/components/editor/offered-mdx-components.d.ts +11 -0
  176. package/dist/ts/components/editor/offered-mdx-components.d.ts.map +1 -0
  177. package/dist/ts/components/editor/offered-mdx-components.js +27 -0
  178. package/dist/ts/components/editor/offered-mdx-components.js.map +1 -0
  179. package/dist/ts/components/editor/page-setting-targets.d.ts.map +1 -1
  180. package/dist/ts/components/editor/page-setting-targets.js +2 -1
  181. package/dist/ts/components/editor/page-setting-targets.js.map +1 -1
  182. package/dist/ts/components/editor/preview-availability.d.ts +16 -1
  183. package/dist/ts/components/editor/preview-availability.d.ts.map +1 -1
  184. package/dist/ts/components/editor/preview-availability.js +16 -1
  185. package/dist/ts/components/editor/preview-availability.js.map +1 -1
  186. package/dist/ts/components/editor/prop-field-hint.d.ts +13 -0
  187. package/dist/ts/components/editor/prop-field-hint.d.ts.map +1 -0
  188. package/dist/ts/components/editor/prop-field-hint.js +70 -0
  189. package/dist/ts/components/editor/prop-field-hint.js.map +1 -0
  190. package/dist/ts/components/editor/soft-break-plugin.d.ts +21 -0
  191. package/dist/ts/components/editor/soft-break-plugin.d.ts.map +1 -0
  192. package/dist/ts/components/editor/soft-break-plugin.js +52 -0
  193. package/dist/ts/components/editor/soft-break-plugin.js.map +1 -0
  194. package/dist/ts/components/editor/use-live-page-settings.d.ts +13 -0
  195. package/dist/ts/components/editor/use-live-page-settings.d.ts.map +1 -0
  196. package/dist/ts/components/editor/use-live-page-settings.js +76 -0
  197. package/dist/ts/components/editor/use-live-page-settings.js.map +1 -0
  198. package/dist/ts/components/editor/usePagePreview.d.ts +32 -0
  199. package/dist/ts/components/editor/usePagePreview.d.ts.map +1 -0
  200. package/dist/ts/components/editor/usePagePreview.js +252 -0
  201. package/dist/ts/components/editor/usePagePreview.js.map +1 -0
  202. package/dist/ts/components/editors/DataEditor.d.ts +6 -3
  203. package/dist/ts/components/editors/DataEditor.d.ts.map +1 -1
  204. package/dist/ts/components/editors/DataEditor.js +153 -19
  205. package/dist/ts/components/editors/DataEditor.js.map +1 -1
  206. package/dist/ts/components/fields/MDXEditField.d.ts +1 -1
  207. package/dist/ts/components/fields/MDXEditField.js +2 -2
  208. package/dist/ts/components/fields/MDXEditField.js.map +1 -1
  209. package/dist/ts/components/forms/SchemaForm.d.ts.map +1 -1
  210. package/dist/ts/components/forms/SchemaForm.js +1 -9
  211. package/dist/ts/components/forms/SchemaForm.js.map +1 -1
  212. package/dist/ts/components/media/AssetDetailSidebar.d.ts.map +1 -1
  213. package/dist/ts/components/media/AssetDetailSidebar.js +43 -5
  214. package/dist/ts/components/media/AssetDetailSidebar.js.map +1 -1
  215. package/dist/ts/components/pages/DataList.d.ts.map +1 -1
  216. package/dist/ts/components/pages/DataList.js +16 -4
  217. package/dist/ts/components/pages/DataList.js.map +1 -1
  218. package/dist/ts/components/pages/FragmentList.d.ts.map +1 -1
  219. package/dist/ts/components/pages/FragmentList.js +10 -0
  220. package/dist/ts/components/pages/FragmentList.js.map +1 -1
  221. package/dist/ts/components/pages/PageList.d.ts.map +1 -1
  222. package/dist/ts/components/pages/PageList.js +54 -118
  223. package/dist/ts/components/pages/PageList.js.map +1 -1
  224. package/dist/ts/components/pages/PageRow.d.ts +21 -0
  225. package/dist/ts/components/pages/PageRow.d.ts.map +1 -0
  226. package/dist/ts/components/pages/PageRow.js +70 -0
  227. package/dist/ts/components/pages/PageRow.js.map +1 -0
  228. package/dist/ts/components/pages/PageTable.d.ts +21 -0
  229. package/dist/ts/components/pages/PageTable.d.ts.map +1 -0
  230. package/dist/ts/components/pages/PageTable.js +12 -0
  231. package/dist/ts/components/pages/PageTable.js.map +1 -0
  232. package/dist/ts/components/pages/page-list-model.d.ts +20 -0
  233. package/dist/ts/components/pages/page-list-model.d.ts.map +1 -0
  234. package/dist/ts/components/pages/page-list-model.js +78 -0
  235. package/dist/ts/components/pages/page-list-model.js.map +1 -0
  236. package/dist/ts/components/puck/MDXContent.d.ts +3 -3
  237. package/dist/ts/components/puck/MDXContent.d.ts.map +1 -1
  238. package/dist/ts/components/puck/MDXContent.js +24 -72
  239. package/dist/ts/components/puck/MDXContent.js.map +1 -1
  240. package/dist/ts/components/puck/csp-frame-harness.d.ts +14 -0
  241. package/dist/ts/components/puck/csp-frame-harness.d.ts.map +1 -0
  242. package/dist/ts/components/puck/csp-frame-harness.js +85 -0
  243. package/dist/ts/components/puck/csp-frame-harness.js.map +1 -0
  244. package/dist/ts/components/puck/use-fragment-render.d.ts +9 -0
  245. package/dist/ts/components/puck/use-fragment-render.d.ts.map +1 -0
  246. package/dist/ts/components/puck/use-fragment-render.js +70 -0
  247. package/dist/ts/components/puck/use-fragment-render.js.map +1 -0
  248. package/dist/ts/components/sandbox/ContentSandbox.d.ts +3 -5
  249. package/dist/ts/components/sandbox/ContentSandbox.d.ts.map +1 -1
  250. package/dist/ts/components/sandbox/ContentSandbox.js +6 -8
  251. package/dist/ts/components/sandbox/ContentSandbox.js.map +1 -1
  252. package/dist/ts/components/sandbox/frame-runtime.d.ts +1 -1
  253. package/dist/ts/components/sandbox/frame-runtime.d.ts.map +1 -1
  254. package/dist/ts/components/sandbox/frame-runtime.js +1 -1
  255. package/dist/ts/components/sandbox/frame-runtime.js.map +1 -1
  256. package/dist/ts/components/toast.d.ts +8 -4
  257. package/dist/ts/components/toast.d.ts.map +1 -1
  258. package/dist/ts/components/toast.js +6 -1
  259. package/dist/ts/components/toast.js.map +1 -1
  260. package/dist/ts/components/ui/Card.d.ts +3 -5
  261. package/dist/ts/components/ui/Card.d.ts.map +1 -1
  262. package/dist/ts/components/ui/Card.js +3 -5
  263. package/dist/ts/components/ui/Card.js.map +1 -1
  264. package/dist/ts/components/ui/Select.d.ts.map +1 -1
  265. package/dist/ts/components/ui/Select.js +12 -3
  266. package/dist/ts/components/ui/Select.js.map +1 -1
  267. package/dist/ts/draft-tools.d.ts +76 -0
  268. package/dist/ts/draft-tools.d.ts.map +1 -0
  269. package/dist/ts/draft-tools.js +2 -0
  270. package/dist/ts/draft-tools.js.map +1 -0
  271. package/dist/ts/frame/channel.d.ts +1 -1
  272. package/dist/ts/frame/channel.d.ts.map +1 -1
  273. package/dist/ts/frame/channel.js +3 -0
  274. package/dist/ts/frame/channel.js.map +1 -1
  275. package/dist/ts/frame/editor-frame.d.ts.map +1 -1
  276. package/dist/ts/frame/editor-frame.js +188 -30
  277. package/dist/ts/frame/editor-frame.js.map +1 -1
  278. package/dist/ts/frame/protocol.d.ts +73 -4
  279. package/dist/ts/frame/protocol.d.ts.map +1 -1
  280. package/dist/ts/frame/protocol.js +54 -16
  281. package/dist/ts/frame/protocol.js.map +1 -1
  282. package/dist/ts/hooks/useUnsavedChangesGuard.d.ts +5 -3
  283. package/dist/ts/hooks/useUnsavedChangesGuard.d.ts.map +1 -1
  284. package/dist/ts/hooks/useUnsavedChangesGuard.js +17 -7
  285. package/dist/ts/hooks/useUnsavedChangesGuard.js.map +1 -1
  286. package/dist/ts/host-style-probe.d.ts.map +1 -1
  287. package/dist/ts/host-style-probe.js +160 -40
  288. package/dist/ts/host-style-probe.js.map +1 -1
  289. package/dist/ts/index.d.ts +13 -0
  290. package/dist/ts/index.d.ts.map +1 -1
  291. package/dist/ts/index.js +14 -0
  292. package/dist/ts/index.js.map +1 -1
  293. package/dist/ts/live/data-binding.d.ts +67 -0
  294. package/dist/ts/live/data-binding.d.ts.map +1 -0
  295. package/dist/ts/live/data-binding.js +215 -0
  296. package/dist/ts/live/data-binding.js.map +1 -0
  297. package/dist/ts/live/doc-channel.d.ts +74 -0
  298. package/dist/ts/live/doc-channel.d.ts.map +1 -0
  299. package/dist/ts/live/doc-channel.js +293 -0
  300. package/dist/ts/live/doc-channel.js.map +1 -0
  301. package/dist/ts/live/held-fragment-edits.d.ts +15 -0
  302. package/dist/ts/live/held-fragment-edits.d.ts.map +1 -0
  303. package/dist/ts/live/held-fragment-edits.js +47 -0
  304. package/dist/ts/live/held-fragment-edits.js.map +1 -0
  305. package/dist/ts/live/markdown-binding.d.ts +54 -0
  306. package/dist/ts/live/markdown-binding.d.ts.map +1 -0
  307. package/dist/ts/live/markdown-binding.js +618 -0
  308. package/dist/ts/live/markdown-binding.js.map +1 -0
  309. package/dist/ts/live/markdown-live-plugin.d.ts +42 -0
  310. package/dist/ts/live/markdown-live-plugin.d.ts.map +1 -0
  311. package/dist/ts/live/markdown-live-plugin.js +918 -0
  312. package/dist/ts/live/markdown-live-plugin.js.map +1 -0
  313. package/dist/ts/live/messages.d.ts +142 -0
  314. package/dist/ts/live/messages.d.ts.map +1 -0
  315. package/dist/ts/live/messages.js +266 -0
  316. package/dist/ts/live/messages.js.map +1 -0
  317. package/dist/ts/live/puck-binding.d.ts +88 -0
  318. package/dist/ts/live/puck-binding.d.ts.map +1 -0
  319. package/dist/ts/live/puck-binding.js +467 -0
  320. package/dist/ts/live/puck-binding.js.map +1 -0
  321. package/dist/ts/live/undo.d.ts +29 -0
  322. package/dist/ts/live/undo.d.ts.map +1 -0
  323. package/dist/ts/live/undo.js +104 -0
  324. package/dist/ts/live/undo.js.map +1 -0
  325. package/dist/ts/live/use-live.d.ts +77 -0
  326. package/dist/ts/live/use-live.d.ts.map +1 -0
  327. package/dist/ts/live/use-live.js +207 -0
  328. package/dist/ts/live/use-live.js.map +1 -0
  329. package/dist/ts/mdx-components-define.d.ts +52 -15
  330. package/dist/ts/mdx-components-define.d.ts.map +1 -1
  331. package/dist/ts/mdx-components-define.js +136 -0
  332. package/dist/ts/mdx-components-define.js.map +1 -1
  333. package/dist/ts/mdx-components.d.ts +11 -19
  334. package/dist/ts/mdx-components.d.ts.map +1 -1
  335. package/dist/ts/mdx-components.js +23 -32
  336. package/dist/ts/mdx-components.js.map +1 -1
  337. package/dist/ts/media/AssetScopePill.d.ts.map +1 -1
  338. package/dist/ts/media/AssetScopePill.js +2 -1
  339. package/dist/ts/media/AssetScopePill.js.map +1 -1
  340. package/dist/ts/merge-default-props.d.ts.map +1 -1
  341. package/dist/ts/merge-default-props.js +3 -0
  342. package/dist/ts/merge-default-props.js.map +1 -1
  343. package/dist/ts/selected-block.d.ts +27 -2
  344. package/dist/ts/selected-block.d.ts.map +1 -1
  345. package/dist/ts/selected-block.js +43 -1
  346. package/dist/ts/selected-block.js.map +1 -1
  347. package/dist/ts/site-render.d.ts +60 -0
  348. package/dist/ts/site-render.d.ts.map +1 -0
  349. package/dist/ts/site-render.js +87 -0
  350. package/dist/ts/site-render.js.map +1 -0
  351. package/dist/ts/types.d.ts +3 -0
  352. package/dist/ts/types.d.ts.map +1 -1
  353. package/dist/ts/ui-config.d.ts +29 -13
  354. package/dist/ts/ui-config.d.ts.map +1 -1
  355. package/dist/ts/ui-config.js +14 -3
  356. package/dist/ts/ui-config.js.map +1 -1
  357. package/dist/ts/utils/apply-clash.d.ts +44 -0
  358. package/dist/ts/utils/apply-clash.d.ts.map +1 -0
  359. package/dist/ts/utils/apply-clash.js +102 -0
  360. package/dist/ts/utils/apply-clash.js.map +1 -0
  361. package/dist/ts/utils/mdast-tree.d.ts +5 -7
  362. package/dist/ts/utils/mdast-tree.d.ts.map +1 -1
  363. package/dist/ts/utils/mdast-tree.js +8 -13
  364. package/dist/ts/utils/mdast-tree.js.map +1 -1
  365. package/dist/ts/utils/pageMetadata.d.ts +6 -2
  366. package/dist/ts/utils/pageMetadata.d.ts.map +1 -1
  367. package/dist/ts/utils/pageMetadata.js +25 -7
  368. package/dist/ts/utils/pageMetadata.js.map +1 -1
  369. package/dist/ts/utils/schema-fields.d.ts +2 -0
  370. package/dist/ts/utils/schema-fields.d.ts.map +1 -1
  371. package/dist/ts/utils/schema-fields.js +8 -0
  372. package/dist/ts/utils/schema-fields.js.map +1 -1
  373. package/dist/ts/write-access.d.ts +2 -0
  374. package/dist/ts/write-access.d.ts.map +1 -1
  375. package/dist/ts/write-access.js +9 -4
  376. package/dist/ts/write-access.js.map +1 -1
  377. package/package.json +18 -7
  378. package/src/CmsSpaApp.tsx +20 -11
  379. package/src/components/conflicts/EditorNoticeStrip.tsx +135 -0
  380. package/src/components/conflicts/FieldConflictList.tsx +59 -0
  381. package/src/components/conflicts/FieldConflictPicker.tsx +158 -0
  382. package/src/components/conflicts/OverwriteNotice.tsx +30 -0
  383. package/src/components/conflicts/PageDraftMenu.tsx +51 -0
  384. package/src/components/conflicts/PeerAvatars.tsx +51 -0
  385. package/src/components/conflicts/PuckConflicts.tsx +92 -0
  386. package/src/components/conflicts/RecentVersionsDialog.tsx +154 -0
  387. package/src/components/conflicts/conflict-label.ts +124 -0
  388. package/src/components/conflicts/use-page-conflicts.ts +112 -0
  389. package/src/components/conflicts/version-copy.ts +33 -0
  390. package/src/components/dashboard/RecentActivity.tsx +3 -2
  391. package/src/components/dialogs/CreatePageDialog.tsx +1 -1
  392. package/src/components/dialogs/DataPropertiesDialog.tsx +22 -4
  393. package/src/components/dialogs/FragmentPropertiesDialog.tsx +23 -4
  394. package/src/components/dialogs/PageMetadataDialog.tsx +157 -65
  395. package/src/components/dialogs/UnsavedChangesDialog.tsx +171 -21
  396. package/src/components/dialogs/unsaved-guard.ts +15 -0
  397. package/src/components/editor/CMSMDXEditor.tsx +238 -198
  398. package/src/components/editor/EditorFrame.tsx +116 -0
  399. package/src/components/editor/FragmentBlockTypeSelect.tsx +245 -0
  400. package/src/components/editor/FragmentComponentBlock.tsx +257 -0
  401. package/src/components/editor/FragmentEditor.tsx +899 -213
  402. package/src/components/editor/FragmentEditorHeaderActions.tsx +77 -0
  403. package/src/components/editor/GenericBlock.tsx +127 -16
  404. package/src/components/editor/InlinePreviewFrame.tsx +78 -0
  405. package/src/components/editor/JsxPropsPanel.tsx +90 -6
  406. package/src/components/editor/LocaleSelector.tsx +4 -2
  407. package/src/components/editor/MDXLivePreview.tsx +44 -46
  408. package/src/components/editor/MdxPageEditor.tsx +247 -7
  409. package/src/components/editor/PageEditor.tsx +154 -121
  410. package/src/components/editor/PageEditorHeaderActions.tsx +65 -27
  411. package/src/components/editor/PageEditorWrapper.tsx +122 -45
  412. package/src/components/editor/body-sync-plugin.ts +44 -0
  413. package/src/components/editor/draft-media-config.ts +22 -0
  414. package/src/components/editor/fragment-save-check.ts +26 -0
  415. package/src/components/editor/fragment-save-lifetime.ts +142 -0
  416. package/src/components/editor/host-wrapper-plugin.ts +28 -7
  417. package/src/components/editor/index.ts +0 -1
  418. package/src/components/editor/insert-menu/InsertMdxComponentButton.tsx +7 -11
  419. package/src/components/editor/insert-menu/SlashMenuPlugin.tsx +95 -18
  420. package/src/components/editor/insert-menu/insert-payload.ts +79 -30
  421. package/src/components/editor/insert-menu/mdx-components-plugin.ts +5 -3
  422. package/src/components/editor/jsx-layout-plugin.ts +103 -0
  423. package/src/components/editor/offered-mdx-components.ts +35 -0
  424. package/src/components/editor/page-setting-targets.tsx +2 -0
  425. package/src/components/editor/preview-availability.ts +21 -1
  426. package/src/components/editor/prop-field-hint.ts +75 -0
  427. package/src/components/editor/soft-break-plugin.ts +55 -0
  428. package/src/components/editor/use-live-page-settings.ts +80 -0
  429. package/src/components/editor/usePagePreview.ts +291 -0
  430. package/src/components/editors/DataEditor.tsx +257 -22
  431. package/src/components/fields/MDXEditField.tsx +2 -2
  432. package/src/components/forms/SchemaForm.tsx +1 -10
  433. package/src/components/media/AssetDetailSidebar.tsx +47 -6
  434. package/src/components/pages/DataList.tsx +14 -4
  435. package/src/components/pages/FragmentList.tsx +8 -0
  436. package/src/components/pages/PageList.tsx +90 -337
  437. package/src/components/pages/PageRow.tsx +290 -0
  438. package/src/components/pages/PageTable.tsx +71 -0
  439. package/src/components/pages/page-list-model.ts +98 -0
  440. package/src/components/puck/MDXContent.tsx +37 -113
  441. package/src/components/puck/csp-frame-harness.tsx +99 -0
  442. package/src/components/puck/use-fragment-render.ts +82 -0
  443. package/src/components/sandbox/ContentSandbox.tsx +6 -11
  444. package/src/components/sandbox/frame-runtime.ts +0 -2
  445. package/src/components/toast.tsx +23 -5
  446. package/src/components/ui/Card.tsx +3 -5
  447. package/src/components/ui/Select.tsx +14 -6
  448. package/src/draft-tools.ts +77 -0
  449. package/src/frame/channel.ts +3 -1
  450. package/src/frame/editor-frame.ts +210 -30
  451. package/src/frame/protocol.ts +98 -15
  452. package/src/hooks/useUnsavedChangesGuard.ts +17 -6
  453. package/src/host-style-probe.ts +157 -37
  454. package/src/index.ts +90 -0
  455. package/src/live/data-binding.ts +252 -0
  456. package/src/live/doc-channel.ts +343 -0
  457. package/src/live/held-fragment-edits.ts +47 -0
  458. package/src/live/markdown-binding.ts +630 -0
  459. package/src/live/markdown-live-plugin.tsx +1037 -0
  460. package/src/live/messages.ts +370 -0
  461. package/src/live/puck-binding.tsx +579 -0
  462. package/src/live/undo.ts +112 -0
  463. package/src/live/use-live.ts +264 -0
  464. package/src/main.css +184 -4
  465. package/src/mdx-components-define.ts +170 -24
  466. package/src/mdx-components.ts +29 -30
  467. package/src/media/AssetScopePill.tsx +2 -1
  468. package/src/merge-default-props.ts +4 -0
  469. package/src/selected-block.ts +55 -3
  470. package/src/site-render.ts +146 -0
  471. package/src/types.ts +3 -0
  472. package/src/ui-config.ts +51 -15
  473. package/src/utils/apply-clash.ts +113 -0
  474. package/src/utils/mdast-tree.ts +8 -12
  475. package/src/utils/pageMetadata.ts +25 -7
  476. package/src/utils/schema-fields.ts +9 -0
  477. package/src/write-access.ts +10 -4
  478. package/styles/tailwind-theme.css +11 -0
  479. package/dist/ts/components/editor/ContentDiff.d.ts +0 -10
  480. package/dist/ts/components/editor/ContentDiff.d.ts.map +0 -1
  481. package/dist/ts/components/editor/ContentDiff.js +0 -52
  482. package/dist/ts/components/editor/ContentDiff.js.map +0 -1
  483. package/src/components/editor/ContentDiff.tsx +0 -251
@@ -0,0 +1,618 @@
1
+ import { tokenizeBody } from '@conloca/content-api/merge';
2
+ import { parseMdx, splitEsm } from '@conloca/mdx';
3
+ import { diffArrays } from 'diff';
4
+ import * as Y from 'yjs';
5
+ const LEADING_BREAKS = /^(?:[ \t]*\r?\n)+/;
6
+ const TRAILING_BREAKS = /(?:\r?\n[ \t]*)+$/;
7
+ /** Everything but letters and digits: what the editor's normalization rewrites (markers, escapes, spacing). */
8
+ const WORDLESS = /[^\p{L}\p{N}]/gu;
9
+ /**
10
+ * Top-level blocks of a markdown body (no frontmatter), cut by the content merge's block scanner: runs of lines split by
11
+ * blank lines, where a fenced code block, a JSX element or a list stays one block. Each range excludes the separating
12
+ * line breaks, `\r\n` included.
13
+ */
14
+ export function markdownBlockRanges(md) {
15
+ const ranges = [];
16
+ let start = 0;
17
+ for (const { raw } of tokenizeBody(md)) {
18
+ const from = start + (LEADING_BREAKS.exec(raw)?.[0].length ?? 0);
19
+ const to = start + raw.replace(TRAILING_BREAKS, '').length;
20
+ if (from < to)
21
+ ranges.push([from, to]);
22
+ start += raw.length;
23
+ }
24
+ return ranges;
25
+ }
26
+ function blockTexts(md, ranges = markdownBlockRanges(md)) {
27
+ return ranges.map(([start, end]) => md.slice(start, end));
28
+ }
29
+ /**
30
+ * Where a caret in `before` lands in `after`: blocks inserted or removed above it shift its block index; inside a
31
+ * changed run it keeps its place in the run, clamped to the blocks `after` has.
32
+ */
33
+ export function caretAfterRemoteEdit(before, after, caret) {
34
+ const afterCount = markdownBlockRanges(after).length;
35
+ let b = 0;
36
+ let a = 0;
37
+ for (const part of diffArrays(blockTexts(before), blockTexts(after))) {
38
+ if (part.added) {
39
+ a += part.count;
40
+ continue;
41
+ }
42
+ if (caret.block < b + part.count) {
43
+ const block = Math.max(0, Math.min(a + caret.block - b, afterCount - 1));
44
+ return { block, offset: caret.offset };
45
+ }
46
+ b += part.count;
47
+ if (!part.removed)
48
+ a += part.count;
49
+ }
50
+ return { block: Math.max(0, afterCount - 1), offset: caret.offset };
51
+ }
52
+ const SPACE = /\s/;
53
+ const ENTITY = /&(?:#\d+|#x[\da-f]+|\w+);/iy;
54
+ /** Pairs each character of `value`, a node's parsed text, with its source in `markdown[start, end)`, skipping syntax. */
55
+ function pairSource(markdown, start, end, value, into) {
56
+ let at = start;
57
+ for (const char of value) {
58
+ let width = 0;
59
+ while (at < end && width === 0) {
60
+ ENTITY.lastIndex = at;
61
+ if (markdown.startsWith(char, at))
62
+ width = char.length;
63
+ else if (markdown[at] === '\\' && markdown.startsWith(char, at + 1))
64
+ width = 1 + char.length;
65
+ else if (markdown[at] === '&' && ENTITY.test(markdown))
66
+ width = ENTITY.lastIndex - at;
67
+ else
68
+ at++;
69
+ }
70
+ if (width === 0)
71
+ return;
72
+ at += width;
73
+ into.push({ char, end: at });
74
+ }
75
+ }
76
+ /** Every character of `markdown` taken as shown: for markdown that does not parse, or is not one block. */
77
+ function literalChars(markdown) {
78
+ const chars = [];
79
+ let end = 0;
80
+ for (const char of markdown) {
81
+ end += char.length;
82
+ chars.push({ char, end });
83
+ }
84
+ return chars;
85
+ }
86
+ /**
87
+ * The characters the editor shows from `markdown`, one block, in order, read from the same MDX parse the editor uses:
88
+ * text, code spans and code blocks, whatever escapes, entities, tags or expressions sit between.
89
+ */
90
+ function shownChars(markdown) {
91
+ const tree = parseMdx(markdown);
92
+ if (!tree)
93
+ return literalChars(markdown);
94
+ const chars = [];
95
+ const visit = (node) => {
96
+ const start = node.position?.start.offset;
97
+ const end = node.position?.end.offset;
98
+ if (node.type !== 'text' && node.type !== 'inlineCode' && node.type !== 'code') {
99
+ if ('children' in node)
100
+ for (const child of node.children)
101
+ visit(child);
102
+ }
103
+ else if (start !== undefined && end !== undefined) {
104
+ // A code block's fence line and a code span's backticks are skipped: they could hold the value's first characters.
105
+ const from = node.type === 'code' && /[`~]/.test(markdown[start]) ? markdown.indexOf('\n', start) + 1 || end : start;
106
+ const ticks = node.type === 'inlineCode' ? (/^`+/.exec(markdown.slice(from, end))?.[0].length ?? 0) : 0;
107
+ pairSource(markdown, from + ticks, end, node.value, chars);
108
+ }
109
+ };
110
+ visit(tree);
111
+ return chars;
112
+ }
113
+ /**
114
+ * Where text the editor shows ends in `markdown`, whose shown characters are `chars`: its non-space characters matched
115
+ * in order, then as many of its trailing spaces as the markdown has there.
116
+ */
117
+ function markdownIndexOf(markdown, chars, shown) {
118
+ let next = 0;
119
+ let index = 0;
120
+ for (const char of shown) {
121
+ if (SPACE.test(char))
122
+ continue;
123
+ while (next < chars.length && chars[next].char !== char)
124
+ next++;
125
+ if (next === chars.length)
126
+ return markdown.length;
127
+ index = chars[next].end;
128
+ next++;
129
+ }
130
+ let trailing = shown.length - shown.trimEnd().length;
131
+ while (trailing > 0 && SPACE.test(markdown[index] ?? '')) {
132
+ index++;
133
+ trailing--;
134
+ }
135
+ return index;
136
+ }
137
+ /** How much of `shown`, the editor's text, the markdown up to `index` covers: the inverse of `markdownIndexOf`. */
138
+ function shownLengthOf(shown, chars, index) {
139
+ let length = 0;
140
+ for (const { char, end } of chars) {
141
+ if (end > index)
142
+ break;
143
+ if (SPACE.test(char)) {
144
+ if (SPACE.test(shown[length] ?? ''))
145
+ length++;
146
+ continue;
147
+ }
148
+ while (SPACE.test(shown[length] ?? ''))
149
+ length++;
150
+ if (shown.startsWith(char, length))
151
+ length += char.length;
152
+ }
153
+ return length;
154
+ }
155
+ /** The body's offset in the doc text, or null when ESM below the top was hoisted out of it and offsets do not carry. */
156
+ function bodyOf(raw) {
157
+ const { body } = splitEsm(raw);
158
+ return raw.endsWith(body) ? { body, start: raw.length - body.length } : null;
159
+ }
160
+ /**
161
+ * A caret as a position in the doc text that moves with every insert and delete before it: taken before a remote apply,
162
+ * read back with `caretAtAnchor` after it. `blocks` is each top-level block's text as the editor shows it. Only the
163
+ * caret's block is parsed; where the doc's blocks do not align with the editor's, the caret is placed by its offset in
164
+ * the whole text, unparsed.
165
+ */
166
+ export function anchorCaret(text, caret, blocks) {
167
+ const split = bodyOf(text.toJSON());
168
+ if (!split)
169
+ return null;
170
+ const ranges = markdownBlockRanges(split.body);
171
+ const range = ranges.length === blocks.length ? ranges[caret.block] : undefined;
172
+ const shownBefore = (blocks[caret.block] ?? '').slice(0, caret.offset);
173
+ if (range) {
174
+ const block = split.body.slice(...range);
175
+ return Y.createRelativePositionFromTypeIndex(text, split.start + range[0] + markdownIndexOf(block, shownChars(block), shownBefore));
176
+ }
177
+ const whole = [...blocks.slice(0, caret.block), shownBefore].join('\n\n');
178
+ const index = markdownIndexOf(split.body, literalChars(split.body), whole);
179
+ return Y.createRelativePositionFromTypeIndex(text, split.start + index);
180
+ }
181
+ /** Where a caret anchored by `anchorCaret` is now, in the editor's `blocks`; null when the anchor no longer resolves. */
182
+ export function caretAtAnchor(text, anchor, blocks) {
183
+ if (!text.doc)
184
+ throw new Error('caretAtAnchor needs a Y.Text inside a Y.Doc');
185
+ const resolved = Y.createAbsolutePositionFromRelativePosition(anchor, text.doc);
186
+ const split = bodyOf(text.toJSON());
187
+ if (!resolved || resolved.type !== text || !split || blocks.length === 0)
188
+ return null;
189
+ const index = Math.max(0, resolved.index - split.start);
190
+ const ranges = markdownBlockRanges(split.body);
191
+ if (ranges.length === blocks.length) {
192
+ const found = ranges.findIndex(([, end]) => index <= end);
193
+ const block = found === -1 ? ranges.length - 1 : found;
194
+ const [start, end] = ranges[block];
195
+ return { block, offset: shownLengthOf(blocks[block], shownChars(split.body.slice(start, end)), index - start) };
196
+ }
197
+ let rest = shownLengthOf(blocks.join('\n\n'), literalChars(split.body), index);
198
+ for (const [block, shown] of blocks.entries()) {
199
+ if (rest <= shown.length)
200
+ return { block, offset: rest };
201
+ rest = Math.max(0, rest - shown.length - 2);
202
+ }
203
+ return { block: blocks.length - 1, offset: blocks[blocks.length - 1].length };
204
+ }
205
+ /**
206
+ * Writes the editor's new markdown into the shared text as the smallest edit. `shadow` is the editor's previous
207
+ * markdown and the text is what it was made from, so the two differ only by the editor's normalization. Blocks are
208
+ * paired through a three-way alignment (shadow ↔ text, shadow ↔ next): only the stretches between blocks the user left
209
+ * alone are written, so every untouched block keeps its stored bytes even where the editor split or merged blocks.
210
+ * A stretch is written line by line and cell by cell (see `replacePieces`), so a key that also rewrites distant lines
211
+ * (table padding, list numbers) never overlaps a teammate's edit there. All writes happen in one transaction tagged
212
+ * with `origin`, the symbol the binding uses to tell its own writes from remote ones.
213
+ */
214
+ export function applyMarkdownEdit(text, shadow, next, origin) {
215
+ if (shadow === next)
216
+ return;
217
+ const doc = text.doc;
218
+ if (!doc)
219
+ throw new Error('applyMarkdownEdit needs a Y.Text inside a Y.Doc');
220
+ // `toJSON` is Y.Text's typed string form (its `toString` exists but is not declared).
221
+ const raw = text.toJSON();
222
+ const rawRanges = markdownBlockRanges(raw);
223
+ const shadowRanges = markdownBlockRanges(shadow);
224
+ const nextRanges = markdownBlockRanges(next);
225
+ const edits = rawRanges.length > 0 && shadowRanges.length > 0 && nextRanges.length > 0
226
+ ? alignedBlockEdits(raw, rawRanges, shadow, shadowRanges, next, nextRanges)
227
+ : [[0, raw.length, next + finalLineEnding(raw, next)]];
228
+ doc.transact(() => {
229
+ // Back to front, so the offsets of earlier edits stay valid.
230
+ for (let i = edits.length - 1; i >= 0; i--) {
231
+ const [from, to, insert] = edits[i];
232
+ // The line break before the span goes along unchanged, so its first line owns one too: every line is written
233
+ // with the break before it (see LINE_START).
234
+ const start = from > 0 && raw[from - 1] === '\n' ? from - 1 : from;
235
+ replacePieces(text, raw.slice(start, to), start, raw.slice(start, from) + insert);
236
+ }
237
+ }, origin);
238
+ }
239
+ /** The editor trims its output, so a whole-text replace puts back raw's final line endings, trailing blank lines too. */
240
+ function finalLineEnding(raw, next) {
241
+ return /\r?\n$/.test(next) ? '' : (/(?:\r?\n)+$/.exec(raw)?.[0] ?? '');
242
+ }
243
+ /** A new doc with the shared doc's full state and its own client id. */
244
+ export function createEditorReplica(text) {
245
+ const doc = text.doc;
246
+ if (!doc)
247
+ throw new Error('createEditorReplica needs a Y.Text inside a Y.Doc');
248
+ const types = doc.share;
249
+ const key = [...types].find(([, type]) => type === text)?.[0];
250
+ if (key === undefined)
251
+ throw new Error('createEditorReplica needs a root Y.Text');
252
+ const replica = new Y.Doc();
253
+ Y.applyUpdate(replica, Y.encodeStateAsUpdate(doc));
254
+ return { doc: replica, text: replica.getText(key) };
255
+ }
256
+ /** Brings the replica up to the shared doc; call it right before the editor is given the shared text. */
257
+ export function syncEditorReplica(replica, text) {
258
+ if (!text.doc)
259
+ throw new Error('syncEditorReplica needs a Y.Text inside a Y.Doc');
260
+ Y.applyUpdate(replica.doc, Y.encodeStateAsUpdate(text.doc, Y.encodeStateVector(replica.doc)));
261
+ }
262
+ /** Applies the editor's edit to the replica and sends exactly that change to the shared doc, tagged with `origin`. */
263
+ export function writeEditorEdit(replica, text, shadow, next, origin) {
264
+ if (!text.doc)
265
+ throw new Error('writeEditorEdit needs a Y.Text inside a Y.Doc');
266
+ const before = Y.encodeStateVector(replica.doc);
267
+ applyMarkdownEdit(replica.text, shadow, next, origin);
268
+ Y.applyUpdate(text.doc, Y.encodeStateAsUpdate(replica.doc, before), origin);
269
+ }
270
+ /**
271
+ * Block boundaries `[in a, in other]` where `a` and `other` can be cut apart: around and between equal blocks, at the
272
+ * ends of a changed run, and, for `reformatted` (the editor's normalization of `other`), around blocks with the same
273
+ * non-empty letters and digits (`*a*` → `_a_`) and between the blocks of a changed run of the same length on both
274
+ * sides. A pure insertion gives two cuts at the same boundary of `a`.
275
+ */
276
+ function blockCuts(a, other, reformatted) {
277
+ const cuts = [[0, 0]];
278
+ const parts = reformatted ? diffArrays(a, other, { comparator: sameWords }) : diffArrays(a, other);
279
+ let i = 0;
280
+ let j = 0;
281
+ for (let p = 0; p < parts.length;) {
282
+ const [i0, j0] = [i, j];
283
+ const same = !parts[p].added && !parts[p].removed;
284
+ if (same) {
285
+ i += parts[p].count;
286
+ j += parts[p].count;
287
+ p++;
288
+ }
289
+ else {
290
+ for (; p < parts.length && (parts[p].added || parts[p].removed); p++) {
291
+ if (parts[p].removed)
292
+ i += parts[p].count;
293
+ else
294
+ j += parts[p].count;
295
+ }
296
+ }
297
+ if (same || (reformatted && i - i0 === j - j0))
298
+ for (let k = 1; k <= i - i0; k++)
299
+ cuts.push([i0 + k, j0 + k]);
300
+ else
301
+ cuts.push([i, j]);
302
+ }
303
+ return cuts;
304
+ }
305
+ /**
306
+ * Blocks the editor's normalization can have produced from each other: the same non-empty letters and digits. A block
307
+ * with none (`---`, `***`, `<br />`, an entity) never pairs by comparison, not even with an identical block: an empty
308
+ * key would pair any two of them, and an identical `---` elsewhere can win a tie. Such blocks still pair one to one
309
+ * inside a changed run of the same length on both sides.
310
+ */
311
+ function sameWords(x, y) {
312
+ const key = x.replace(WORDLESS, '');
313
+ return key !== '' && key === y.replace(WORDLESS, '');
314
+ }
315
+ /**
316
+ * Edits that turn raw into next, from a three-way block alignment with the shadow as the common ancestor: the shadow
317
+ * is cut where both raw (normalization) and next (the user's edit) can be cut, and only the pieces the user changed are
318
+ * rewritten from next. Untouched pieces keep raw's bytes, including blocks the editor reformatted, split or merged.
319
+ */
320
+ function alignedBlockEdits(raw, rawRanges, shadow, shadowRanges, next, nextRanges) {
321
+ const shadowBlocks = blockTexts(shadow, shadowRanges);
322
+ const nextBlocks = blockTexts(next, nextRanges);
323
+ const toRaw = blockCuts(shadowBlocks, blockTexts(raw, rawRanges), true);
324
+ const toNext = blockCuts(shadowBlocks, nextBlocks, false);
325
+ const cuts = [];
326
+ for (let i = 0, j = 0; i < toRaw.length && j < toNext.length;) {
327
+ const [s, r] = toRaw[i];
328
+ const [t, n] = toNext[j];
329
+ if (s !== t) {
330
+ if (s < t)
331
+ i++;
332
+ else
333
+ j++;
334
+ continue;
335
+ }
336
+ cuts.push([s, r, n]);
337
+ const moreRaw = toRaw[i + 1]?.[0] === s;
338
+ const moreNext = toNext[j + 1]?.[0] === s;
339
+ // Both sides inserted here: take raw's insertion first, so its blocks stay and the user's land after them.
340
+ if (moreRaw)
341
+ i++;
342
+ else if (moreNext)
343
+ j++;
344
+ else {
345
+ i++;
346
+ j++;
347
+ }
348
+ }
349
+ const edits = [];
350
+ for (let c = 1; c < cuts.length; c++) {
351
+ const [s0, r0, n0] = cuts[c - 1];
352
+ const [s1, r1, n1] = cuts[c];
353
+ const before = shadowBlocks.slice(s0, s1);
354
+ const after = nextBlocks.slice(n0, n1);
355
+ if (before.length === after.length && before.every((block, k) => block === after[k]))
356
+ continue;
357
+ if (r0 === r1 && n0 === n1)
358
+ continue;
359
+ const rewrite = r0 < r1 && n0 < n1;
360
+ const [rawFrom, rawTo] = hunkSpan(rawRanges, r0, r1, rewrite);
361
+ const [nextFrom, nextTo] = hunkSpan(nextRanges, n0, n1, rewrite);
362
+ edits.push([rawFrom, rawTo, next.slice(nextFrom, nextTo)]);
363
+ }
364
+ return edits;
365
+ }
366
+ /**
367
+ * The text a hunk over blocks `[from, to)` replaces. A rewrite covers block content only, so separators keep their
368
+ * bytes; an insert or delete also takes the separator before or after it (the outer blocks bound the ends).
369
+ */
370
+ function hunkSpan(ranges, from, to, rewrite) {
371
+ if (rewrite)
372
+ return [ranges[from][0], ranges[to - 1][1]];
373
+ return [
374
+ from === 0 ? ranges[0][0] : ranges[from - 1][1],
375
+ to === ranges.length ? ranges[ranges.length - 1][1] : ranges[to][0],
376
+ ];
377
+ }
378
+ /**
379
+ * Where `replacePieces` cuts text into lines: before each line break, so a line owns the break before it. Keys a
380
+ * teammate typed meanwhile into a deleted line, which Yjs keeps, then end up after the line above. The first line of a
381
+ * table body or a list is the exception (see LINE_LEAD).
382
+ */
383
+ const LINE_START = /(?=\n)/;
384
+ /**
385
+ * A table row's line break, indent and `|`, or a list item's with its marker. The line above the first row of a table
386
+ * body is the separator row, and above a list's first item a blank line: keys typed after either end the table or
387
+ * join the paragraph above. So a deleted first line that another one follows is written from after its own start to
388
+ * after the next line's: keys typed into it meanwhile join the next line's text.
389
+ */
390
+ const LINE_LEAD = /^\n[ \t]*(?:\||(?:\d+[.)]|[-*+])[ \t]+)/;
391
+ /** A table's separator row. */
392
+ const SEPARATOR_ROW = /^\n?[ \t]*\|?[ \t]*:?-+:?[ \t]*(\|[ \t]*:?-+:?[ \t]*)*\|?[ \t]*$/;
393
+ /**
394
+ * Where it cuts a line into pieces written on their own: after an ordered-list number, so renumbering never rewrites
395
+ * the item's text, and after each `|`, which ends a table cell. An escaped `\|` only cuts a cell finer, which any
396
+ * pairing still writes correctly.
397
+ */
398
+ const CELL_END = /(?<=^\n?[ \t]*\d+(?=[.)])|\|)/;
399
+ /**
400
+ * Changed lines between two unchanged ones further apart than this are written as one span: the line diff stays a few
401
+ * ms per key on any block, and the editor never makes that many line inserts or deletes in one key.
402
+ */
403
+ const MAX_LINE_EDITS = 64;
404
+ /**
405
+ * Replaces `old` at `from` by `insert` line by line, and a line by table cell when both have as many cells, each pair
406
+ * trimmed to the characters that changed. One key in the editor can rewrite lines far from the caret: padding a table
407
+ * column rewrites every row, and a new ordered-list item renumbers every item after it. One span from the first change
408
+ * to the last would overlap a teammate's edit there, and Yjs keeps both inserts, which duplicates rows and items.
409
+ * Writing each line on its own keeps every write where its change is. The stored text is `insert` whatever the pairing.
410
+ */
411
+ function replacePieces(text, old, from, insert) {
412
+ const oldLines = old.split(LINE_START);
413
+ const newLines = insert.split(LINE_START);
414
+ const oldAt = pieceStarts(oldLines);
415
+ const newAt = pieceStarts(newLines);
416
+ const cuts = lineCuts(oldLines, newLines);
417
+ // How far each cut moves into its lines on each side (see LINE_LEAD).
418
+ const oldShift = cuts.map(() => 0);
419
+ const newShift = cuts.map(() => 0);
420
+ for (let c = 1; c < cuts.length; c++) {
421
+ const [o0, n0] = cuts[c - 1];
422
+ const [o1, n1] = cuts[c];
423
+ if (n0 !== n1 || o1 >= oldLines.length || n1 >= newLines.length)
424
+ continue;
425
+ const above = oldLines[o0 - 1];
426
+ if (above !== undefined && above.trim() !== '' && !SEPARATOR_ROW.test(above))
427
+ continue;
428
+ const own = LINE_LEAD.exec(oldLines[o0])?.[0];
429
+ const nextOld = LINE_LEAD.exec(oldLines[o1])?.[0];
430
+ const nextNew = LINE_LEAD.exec(newLines[n1])?.[0];
431
+ if (!own || !nextOld || own !== nextNew)
432
+ continue;
433
+ oldShift[c - 1] = own.length;
434
+ newShift[c - 1] = own.length;
435
+ oldShift[c] = nextOld.length;
436
+ newShift[c] = nextNew.length;
437
+ }
438
+ // Back to front, so the offsets of earlier pieces stay valid.
439
+ for (let c = cuts.length - 1; c > 0; c--) {
440
+ const [o0, n0] = cuts[c - 1];
441
+ const [o1, n1] = cuts[c];
442
+ const start = oldAt[o0] + oldShift[c - 1];
443
+ const before = old.slice(start, oldAt[o1] + oldShift[c]);
444
+ const after = insert.slice(newAt[n0] + newShift[c - 1], newAt[n1] + newShift[c]);
445
+ if (o1 - o0 === 1 && n1 - n0 === 1)
446
+ replaceCells(text, before, from + start, after);
447
+ else
448
+ replaceTrimmed(text, before, from + start, after);
449
+ }
450
+ }
451
+ /**
452
+ * Replaces line `old` at `from` by `insert` piece by piece, in order. Cells added at the end (a new column) go in right
453
+ * before the row's closing `|`: after it they would tie with a row a teammate inserts below, and after the last cell's
454
+ * text with a key typed there. Old pieces past the new ones (stray text after the last `|`) are deleted on their own.
455
+ * A changed list number is rewritten whole: two people renumbering `12` to `13` and `11` would otherwise each keep a
456
+ * digit the other deletes.
457
+ */
458
+ function replaceCells(text, old, from, insert) {
459
+ const oldCells = old.split(CELL_END);
460
+ const newCells = insert.split(CELL_END);
461
+ const last = Math.min(oldCells.length, newCells.length) - 1;
462
+ const oldAt = pieceStarts(oldCells);
463
+ const added = newCells.slice(last + 1).join('');
464
+ if (old.endsWith('|') && added.endsWith('|'))
465
+ text.insert(from + old.length - 1, `|${added.slice(0, -1)}`);
466
+ else if (added)
467
+ text.insert(from + old.length, added);
468
+ if (oldCells.length > last + 1)
469
+ text.delete(from + oldAt[last + 1], old.length - oldAt[last + 1]);
470
+ for (let c = last; c > 0; c--)
471
+ replacePadded(text, oldCells[c], from + oldAt[c], newCells[c]);
472
+ if (oldCells[0] === newCells[0])
473
+ return;
474
+ const oldNumber = LIST_NUMBER.exec(oldCells[0]);
475
+ const newNumber = LIST_NUMBER.exec(newCells[0]);
476
+ if (!oldNumber || !newNumber || oldNumber[1] !== newNumber[1]) {
477
+ replaceTrimmed(text, oldCells[0], from, newCells[0]);
478
+ return;
479
+ }
480
+ // The line break and indent stay; only the digits are rewritten.
481
+ text.delete(from + oldNumber[1].length, oldNumber[2].length);
482
+ text.insert(from + oldNumber[1].length, newNumber[2]);
483
+ }
484
+ /** A line's first piece when it is an ordered-list number: the line break and indent, then the digits. */
485
+ const LIST_NUMBER = /^(\n?[ \t]*)(\d+)$/;
486
+ /**
487
+ * Replaces piece `old` at `from` by `insert`, its text and the padding after it (up to a closing `|`) apart. A key
488
+ * typed before a cell's text moves it right into its padding: trimmed as one, that rewrites the text, and a teammate
489
+ * deleting the row meanwhile would leave the rewritten copy behind.
490
+ */
491
+ function replacePadded(text, old, from, insert) {
492
+ const oldText = old.length - (TRAILING_PAD.exec(old)?.[0].length ?? 0);
493
+ const newText = insert.length - (TRAILING_PAD.exec(insert)?.[0].length ?? 0);
494
+ replaceTrimmed(text, old.slice(oldText), from + oldText, insert.slice(newText));
495
+ replaceTrimmed(text, old.slice(0, oldText), from, insert.slice(0, newText));
496
+ }
497
+ /** The spaces that end a piece, with the `|` closing its cell. */
498
+ const TRAILING_PAD = / *\|?$/;
499
+ /**
500
+ * Line boundaries `[in old, in next]` to write between. As many lines on both sides: line by line, which is linear and
501
+ * never pairs a line with a neighbour of the same text. Otherwise lines pair by their text without spaces, runs of `-`
502
+ * and an ordered-list number, which the editor's padding and renumbering change leave alone, so a key's rewrite of
503
+ * distant lines never moves a write. Between two paired lines, a changed run of the same length on both sides pairs
504
+ * line by line, and others pair their similar lines (typed in) so that only whole lines are inserted or deleted: a span
505
+ * trimmed across lines would start a row delete inside a teammate's row.
506
+ */
507
+ function lineCuts(oldLines, newLines) {
508
+ if (oldLines.length === newLines.length)
509
+ return [...oldLines.keys(), oldLines.length].map((k) => [k, k]);
510
+ const oldKeys = oldLines.map(lineKey);
511
+ const newKeys = newLines.map(lineKey);
512
+ let head = 0;
513
+ while (head < oldKeys.length && head < newKeys.length && oldKeys[head] === newKeys[head])
514
+ head++;
515
+ let tail = 0;
516
+ const most = Math.min(oldKeys.length, newKeys.length) - head;
517
+ while (tail < most && oldKeys[oldKeys.length - 1 - tail] === newKeys[newKeys.length - 1 - tail])
518
+ tail++;
519
+ const oldEnd = oldKeys.length - tail;
520
+ const newEnd = newKeys.length - tail;
521
+ const cuts = [...Array(head + 1).keys()].map((k) => [k, k]);
522
+ const parts = diffArrays(oldKeys.slice(head, oldEnd), newKeys.slice(head, newEnd), { maxEditLength: MAX_LINE_EDITS });
523
+ if (parts) {
524
+ pushRunCuts(parts, head, head, cuts, (i0, j0, i, j) => {
525
+ const similar = diffArrays(oldKeys.slice(i0, i), newKeys.slice(j0, j), { comparator: similarKeys });
526
+ pushRunCuts(similar, i0, j0, cuts, (_i0, _j0, iEnd, jEnd) => cuts.push([iEnd, jEnd]));
527
+ });
528
+ }
529
+ else if (oldEnd > head || newEnd > head)
530
+ cuts.push([oldEnd, newEnd]);
531
+ for (let k = 1; k <= tail; k++)
532
+ cuts.push([oldEnd + k, newEnd + k]);
533
+ return cuts;
534
+ }
535
+ /**
536
+ * Appends the cuts of diff `parts` that starts at lines `oldStart` and `newStart`: one per line of an unchanged run or
537
+ * of a changed run as long on both sides; `unequal` cuts a changed run of different lengths, `[i0, i)` and `[j0, j)`.
538
+ */
539
+ function pushRunCuts(parts, oldStart, newStart, cuts, unequal) {
540
+ let i = oldStart;
541
+ let j = newStart;
542
+ for (let p = 0; p < parts.length;) {
543
+ const [i0, j0] = [i, j];
544
+ const same = !parts[p].added && !parts[p].removed;
545
+ if (same) {
546
+ i += parts[p].count;
547
+ j += parts[p].count;
548
+ p++;
549
+ }
550
+ else {
551
+ for (; p < parts.length && (parts[p].added || parts[p].removed); p++) {
552
+ if (parts[p].removed)
553
+ i += parts[p].count;
554
+ else
555
+ j += parts[p].count;
556
+ }
557
+ }
558
+ if (same || i - i0 === j - j0)
559
+ for (let k = 1; k <= i - i0; k++)
560
+ cuts.push([i0 + k, j0 + k]);
561
+ else if (i0 === i || j0 === j)
562
+ cuts.push([i, j]);
563
+ else
564
+ unequal(i0, j0, i, j);
565
+ }
566
+ }
567
+ /** Line keys one edit can have made from each other: their common start and end cover half the shorter one or more. */
568
+ function similarKeys(x, y) {
569
+ const max = Math.min(x.length, y.length);
570
+ let same = 0;
571
+ while (same < max && x[same] === y[same])
572
+ same++;
573
+ let end = 0;
574
+ while (end < max - same && x[x.length - 1 - end] === y[y.length - 1 - end])
575
+ end++;
576
+ return 2 * (same + end) >= max;
577
+ }
578
+ /** A line without what the editor's padding and renumbering change: spaces, the length of `-` runs, a list number. */
579
+ function lineKey(line) {
580
+ return line
581
+ .replace(/^\s*\d+(?=[.)])/, '')
582
+ .replace(/\s+/g, '')
583
+ .replace(/-+/g, '-');
584
+ }
585
+ /** The offset each piece starts at, then the total length. */
586
+ function pieceStarts(pieces) {
587
+ const starts = [0];
588
+ for (const piece of pieces)
589
+ starts.push(starts[starts.length - 1] + piece.length);
590
+ return starts;
591
+ }
592
+ /** Replaces `old` at `from` by `insert`, touching only the characters between their common prefix and suffix. */
593
+ function replaceTrimmed(text, old, from, insert) {
594
+ const max = Math.min(old.length, insert.length);
595
+ let prefix = 0;
596
+ while (prefix < max && old[prefix] === insert[prefix])
597
+ prefix++;
598
+ // Never split a surrogate pair: back off a prefix ending on a high half, a suffix starting on a low half.
599
+ if (prefix > 0 && (old.charCodeAt(prefix - 1) & 0xfc00) === 0xd800)
600
+ prefix--;
601
+ let suffix = 0;
602
+ while (suffix < max - prefix && old[old.length - 1 - suffix] === insert[insert.length - 1 - suffix])
603
+ suffix++;
604
+ if (suffix > 0 && (old.charCodeAt(old.length - suffix) & 0xfc00) === 0xdc00)
605
+ suffix--;
606
+ const deleted = old.length - prefix - suffix;
607
+ const inserted = insert.slice(prefix, insert.length - suffix);
608
+ // A wrap (bold, a link) keeps the old run inside the new text. Inserted after the deleted run, it would sit among the
609
+ // tombstones with a teammate's text typed right after the run, ordered by client id; inserted first, it stays before.
610
+ const wrap = deleted > 0 && inserted.includes(old.slice(prefix, old.length - suffix));
611
+ if (wrap)
612
+ text.insert(from + prefix, inserted);
613
+ if (deleted > 0)
614
+ text.delete(from + prefix + (wrap ? inserted.length : 0), deleted);
615
+ if (!wrap && inserted.length > 0)
616
+ text.insert(from + prefix, inserted);
617
+ }
618
+ //# sourceMappingURL=markdown-binding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-binding.js","sourceRoot":"","sources":["../../../src/live/markdown-binding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAoB,UAAU,EAAE,MAAM,MAAM,CAAC;AAEpD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAIzB,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAC3C,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAC5C,+GAA+G;AAC/G,MAAM,QAAQ,GAAG,iBAAiB,CAAC;AAEnC;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAU;IAC5C,MAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,EAAE,GAAG,EAAE,IAAI,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,GAAG,KAAK,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;QACjE,MAAM,EAAE,GAAG,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC;QAC3D,IAAI,IAAI,GAAG,EAAE;YAAE,MAAM,CAAC,IA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