@abraca/nuxt 1.9.1 → 2.0.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 (434) hide show
  1. package/dist/module.d.mts +4 -3
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +9 -1
  4. package/dist/runtime/components/ADocumentTree.vue +1 -1
  5. package/dist/runtime/components/AEditor.d.vue.ts +26 -1
  6. package/dist/runtime/components/AEditor.vue +153 -4
  7. package/dist/runtime/components/AEditor.vue.d.ts +26 -1
  8. package/dist/runtime/components/AIdentityModal.d.vue.ts +46 -0
  9. package/dist/runtime/components/AIdentityModal.vue +157 -0
  10. package/dist/runtime/components/AIdentityModal.vue.d.ts +46 -0
  11. package/dist/runtime/components/AMnemonicLoginModal.d.vue.ts +35 -0
  12. package/dist/runtime/components/AMnemonicLoginModal.vue +173 -0
  13. package/dist/runtime/components/AMnemonicLoginModal.vue.d.ts +35 -0
  14. package/dist/runtime/components/ANodePanel.d.vue.ts +29 -2
  15. package/dist/runtime/components/ANodePanel.vue +148 -27
  16. package/dist/runtime/components/ANodePanel.vue.d.ts +29 -2
  17. package/dist/runtime/components/ANodePanelHeader.d.vue.ts +64 -0
  18. package/dist/runtime/components/ANodePanelHeader.vue +105 -0
  19. package/dist/runtime/components/ANodePanelHeader.vue.d.ts +64 -0
  20. package/dist/runtime/components/ANodeSettingsPanel.d.vue.ts +49 -0
  21. package/dist/runtime/components/ANodeSettingsPanel.vue +59 -0
  22. package/dist/runtime/components/ANodeSettingsPanel.vue.d.ts +49 -0
  23. package/dist/runtime/components/ANotificationBell.d.vue.ts +26 -0
  24. package/dist/runtime/components/ANotificationBell.vue +55 -0
  25. package/dist/runtime/components/ANotificationBell.vue.d.ts +26 -0
  26. package/dist/runtime/components/AOfflineSync.d.vue.ts +11 -0
  27. package/dist/runtime/components/AOfflineSync.vue +217 -0
  28. package/dist/runtime/components/AOfflineSync.vue.d.ts +11 -0
  29. package/dist/runtime/components/ARecoveryPhraseDisplay.d.vue.ts +26 -0
  30. package/dist/runtime/components/ARecoveryPhraseDisplay.vue +94 -0
  31. package/dist/runtime/components/ARecoveryPhraseDisplay.vue.d.ts +26 -0
  32. package/dist/runtime/components/AServerInfoModal.d.vue.ts +43 -0
  33. package/dist/runtime/components/AServerInfoModal.vue +150 -0
  34. package/dist/runtime/components/AServerInfoModal.vue.d.ts +43 -0
  35. package/dist/runtime/components/ASpaceFormModal.vue +1 -1
  36. package/dist/runtime/components/aware/AAccordion.d.vue.ts +25 -0
  37. package/dist/runtime/components/aware/AAccordion.vue +107 -0
  38. package/dist/runtime/components/aware/AAccordion.vue.d.ts +25 -0
  39. package/dist/runtime/components/aware/AArea.vue +24 -11
  40. package/dist/runtime/components/aware/AAvatar.d.vue.ts +6 -0
  41. package/dist/runtime/components/aware/AAvatar.vue +33 -3
  42. package/dist/runtime/components/aware/AAvatar.vue.d.ts +6 -0
  43. package/dist/runtime/components/aware/AAvatarGroup.d.vue.ts +10 -0
  44. package/dist/runtime/components/aware/AAvatarGroup.vue +30 -0
  45. package/dist/runtime/components/aware/AAvatarGroup.vue.d.ts +10 -0
  46. package/dist/runtime/components/aware/AButton.d.vue.ts +4 -2
  47. package/dist/runtime/components/aware/AButton.vue +46 -14
  48. package/dist/runtime/components/aware/AButton.vue.d.ts +4 -2
  49. package/dist/runtime/components/aware/ACalendar.d.vue.ts +17 -0
  50. package/dist/runtime/components/aware/ACalendar.vue +145 -0
  51. package/dist/runtime/components/aware/ACalendar.vue.d.ts +17 -0
  52. package/dist/runtime/components/aware/ACarousel.d.vue.ts +25 -0
  53. package/dist/runtime/components/aware/ACarousel.vue +39 -0
  54. package/dist/runtime/components/aware/ACarousel.vue.d.ts +25 -0
  55. package/dist/runtime/components/aware/ACheckbox.d.vue.ts +11 -0
  56. package/dist/runtime/components/aware/ACheckbox.vue +74 -0
  57. package/dist/runtime/components/aware/ACheckbox.vue.d.ts +11 -0
  58. package/dist/runtime/components/aware/ACheckboxGroup.d.vue.ts +27 -0
  59. package/dist/runtime/components/aware/ACheckboxGroup.vue +79 -0
  60. package/dist/runtime/components/aware/ACheckboxGroup.vue.d.ts +27 -0
  61. package/dist/runtime/components/aware/ACollapsible.d.vue.ts +25 -0
  62. package/dist/runtime/components/aware/ACollapsible.vue +45 -0
  63. package/dist/runtime/components/aware/ACollapsible.vue.d.ts +25 -0
  64. package/dist/runtime/components/aware/AColorPicker.d.vue.ts +15 -0
  65. package/dist/runtime/components/aware/AColorPicker.vue +48 -0
  66. package/dist/runtime/components/aware/AColorPicker.vue.d.ts +15 -0
  67. package/dist/runtime/components/aware/ACommandPalette.d.vue.ts +33 -0
  68. package/dist/runtime/components/aware/ACommandPalette.vue +123 -0
  69. package/dist/runtime/components/aware/ACommandPalette.vue.d.ts +33 -0
  70. package/dist/runtime/components/aware/AContextMenu.d.vue.ts +25 -0
  71. package/dist/runtime/components/aware/AContextMenu.vue +63 -0
  72. package/dist/runtime/components/aware/AContextMenu.vue.d.ts +25 -0
  73. package/dist/runtime/components/aware/ADrawer.d.vue.ts +25 -0
  74. package/dist/runtime/components/aware/ADrawer.vue +57 -0
  75. package/dist/runtime/components/aware/ADrawer.vue.d.ts +25 -0
  76. package/dist/runtime/components/aware/ADropdownMenu.d.vue.ts +25 -0
  77. package/dist/runtime/components/aware/ADropdownMenu.vue +63 -0
  78. package/dist/runtime/components/aware/ADropdownMenu.vue.d.ts +25 -0
  79. package/dist/runtime/components/aware/AFileUpload.d.vue.ts +27 -0
  80. package/dist/runtime/components/aware/AFileUpload.vue +67 -0
  81. package/dist/runtime/components/aware/AFileUpload.vue.d.ts +27 -0
  82. package/dist/runtime/components/aware/AFollowBar.d.vue.ts +21 -0
  83. package/dist/runtime/components/aware/AFollowBar.vue +62 -0
  84. package/dist/runtime/components/aware/AFollowBar.vue.d.ts +21 -0
  85. package/dist/runtime/components/aware/AFollowScroll.d.vue.ts +7 -0
  86. package/dist/runtime/components/aware/AFollowScroll.vue +17 -0
  87. package/dist/runtime/components/aware/AFollowScroll.vue.d.ts +7 -0
  88. package/dist/runtime/components/aware/AFormSync.d.vue.ts +21 -0
  89. package/dist/runtime/components/aware/AFormSync.vue +52 -0
  90. package/dist/runtime/components/aware/AFormSync.vue.d.ts +21 -0
  91. package/dist/runtime/components/aware/AGlobalFocusLayer.d.vue.ts +3 -0
  92. package/dist/runtime/components/aware/AGlobalFocusLayer.vue +90 -0
  93. package/dist/runtime/components/aware/AGlobalFocusLayer.vue.d.ts +3 -0
  94. package/dist/runtime/components/aware/AHoverItem.d.vue.ts +27 -0
  95. package/dist/runtime/components/aware/AHoverItem.vue +124 -0
  96. package/dist/runtime/components/aware/AHoverItem.vue.d.ts +27 -0
  97. package/dist/runtime/components/aware/AInput.d.vue.ts +12 -2
  98. package/dist/runtime/components/aware/AInput.vue +72 -19
  99. package/dist/runtime/components/aware/AInput.vue.d.ts +12 -2
  100. package/dist/runtime/components/aware/AInputMenu.d.vue.ts +17 -0
  101. package/dist/runtime/components/aware/AInputMenu.vue +138 -0
  102. package/dist/runtime/components/aware/AInputMenu.vue.d.ts +17 -0
  103. package/dist/runtime/components/aware/AInputNumber.d.vue.ts +15 -0
  104. package/dist/runtime/components/aware/AInputNumber.vue +67 -0
  105. package/dist/runtime/components/aware/AInputNumber.vue.d.ts +15 -0
  106. package/dist/runtime/components/aware/AInputTags.d.vue.ts +15 -0
  107. package/dist/runtime/components/aware/AInputTags.vue +67 -0
  108. package/dist/runtime/components/aware/AInputTags.vue.d.ts +15 -0
  109. package/dist/runtime/components/aware/AKeyHint.d.vue.ts +3 -0
  110. package/dist/runtime/components/aware/AKeyHint.vue +23 -0
  111. package/dist/runtime/components/aware/AKeyHint.vue.d.ts +3 -0
  112. package/dist/runtime/components/aware/AMedia.d.vue.ts +19 -0
  113. package/dist/runtime/components/aware/AMedia.vue +85 -0
  114. package/dist/runtime/components/aware/AMedia.vue.d.ts +19 -0
  115. package/dist/runtime/components/aware/AModal.d.vue.ts +33 -0
  116. package/dist/runtime/components/aware/AModal.vue +110 -0
  117. package/dist/runtime/components/aware/AModal.vue.d.ts +33 -0
  118. package/dist/runtime/components/aware/ANavigationMenu.d.vue.ts +25 -0
  119. package/dist/runtime/components/aware/ANavigationMenu.vue +82 -0
  120. package/dist/runtime/components/aware/ANavigationMenu.vue.d.ts +25 -0
  121. package/dist/runtime/components/aware/APagination.d.vue.ts +13 -0
  122. package/dist/runtime/components/aware/APagination.vue +53 -0
  123. package/dist/runtime/components/aware/APagination.vue.d.ts +13 -0
  124. package/dist/runtime/components/aware/APeerCaretLayer.d.vue.ts +10 -0
  125. package/dist/runtime/components/aware/APeerCaretLayer.vue +133 -0
  126. package/dist/runtime/components/aware/APeerCaretLayer.vue.d.ts +10 -0
  127. package/dist/runtime/components/aware/APinInput.d.vue.ts +15 -0
  128. package/dist/runtime/components/aware/APinInput.vue +48 -0
  129. package/dist/runtime/components/aware/APinInput.vue.d.ts +15 -0
  130. package/dist/runtime/components/aware/APopover.d.vue.ts +25 -0
  131. package/dist/runtime/components/aware/APopover.vue +57 -0
  132. package/dist/runtime/components/aware/APopover.vue.d.ts +25 -0
  133. package/dist/runtime/components/aware/APresenceBlobs.d.vue.ts +3 -0
  134. package/dist/runtime/components/aware/APresenceBlobs.vue +69 -0
  135. package/dist/runtime/components/aware/APresenceBlobs.vue.d.ts +3 -0
  136. package/dist/runtime/components/aware/APresenceCursors.d.vue.ts +20 -0
  137. package/dist/runtime/components/aware/APresenceCursors.vue +47 -0
  138. package/dist/runtime/components/aware/APresenceCursors.vue.d.ts +20 -0
  139. package/dist/runtime/components/aware/ARadioGroup.d.vue.ts +27 -0
  140. package/dist/runtime/components/aware/ARadioGroup.vue +86 -0
  141. package/dist/runtime/components/aware/ARadioGroup.vue.d.ts +27 -0
  142. package/dist/runtime/components/aware/AScroll.d.vue.ts +25 -0
  143. package/dist/runtime/components/aware/AScroll.vue +87 -0
  144. package/dist/runtime/components/aware/AScroll.vue.d.ts +25 -0
  145. package/dist/runtime/components/aware/ASelect.d.vue.ts +12 -2
  146. package/dist/runtime/components/aware/ASelect.vue +146 -22
  147. package/dist/runtime/components/aware/ASelect.vue.d.ts +12 -2
  148. package/dist/runtime/components/aware/ASelectMenu.d.vue.ts +17 -0
  149. package/dist/runtime/components/aware/ASelectMenu.vue +139 -0
  150. package/dist/runtime/components/aware/ASelectMenu.vue.d.ts +17 -0
  151. package/dist/runtime/components/aware/ASlideover.d.vue.ts +33 -0
  152. package/dist/runtime/components/aware/ASlideover.vue +110 -0
  153. package/dist/runtime/components/aware/ASlideover.vue.d.ts +33 -0
  154. package/dist/runtime/components/aware/ASlider.d.vue.ts +19 -0
  155. package/dist/runtime/components/aware/ASlider.vue +77 -0
  156. package/dist/runtime/components/aware/ASlider.vue.d.ts +19 -0
  157. package/dist/runtime/components/aware/AStepper.d.vue.ts +25 -0
  158. package/dist/runtime/components/aware/AStepper.vue +82 -0
  159. package/dist/runtime/components/aware/AStepper.vue.d.ts +25 -0
  160. package/dist/runtime/components/aware/ASwitch.d.vue.ts +11 -0
  161. package/dist/runtime/components/aware/ASwitch.vue +75 -0
  162. package/dist/runtime/components/aware/ASwitch.vue.d.ts +11 -0
  163. package/dist/runtime/components/aware/ATable.d.vue.ts +23 -0
  164. package/dist/runtime/components/aware/ATable.vue +97 -0
  165. package/dist/runtime/components/aware/ATable.vue.d.ts +23 -0
  166. package/dist/runtime/components/aware/ATabs.d.vue.ts +27 -0
  167. package/dist/runtime/components/aware/ATabs.vue +128 -0
  168. package/dist/runtime/components/aware/ATabs.vue.d.ts +27 -0
  169. package/dist/runtime/components/aware/ATextarea.d.vue.ts +12 -2
  170. package/dist/runtime/components/aware/ATextarea.vue +72 -19
  171. package/dist/runtime/components/aware/ATextarea.vue.d.ts +12 -2
  172. package/dist/runtime/components/aware/AToggleGroup.d.vue.ts +27 -0
  173. package/dist/runtime/components/aware/AToggleGroup.vue +79 -0
  174. package/dist/runtime/components/aware/AToggleGroup.vue.d.ts +27 -0
  175. package/dist/runtime/components/aware/ATree.d.vue.ts +27 -0
  176. package/dist/runtime/components/aware/ATree.vue +111 -0
  177. package/dist/runtime/components/aware/ATree.vue.d.ts +27 -0
  178. package/dist/runtime/components/chat/AChatPanel.d.vue.ts +6 -6
  179. package/dist/runtime/components/chat/AChatPanel.vue.d.ts +6 -6
  180. package/dist/runtime/components/chat/ANodeChatPanel.d.vue.ts +42 -0
  181. package/dist/runtime/components/chat/ANodeChatPanel.vue +53 -0
  182. package/dist/runtime/components/chat/ANodeChatPanel.vue.d.ts +42 -0
  183. package/dist/runtime/components/docs/ADocsSearch.d.vue.ts +2 -2
  184. package/dist/runtime/components/docs/ADocsSearch.vue.d.ts +2 -2
  185. package/dist/runtime/components/docs/ADocsSearchButton.d.vue.ts +3 -3
  186. package/dist/runtime/components/docs/ADocsSearchButton.vue.d.ts +3 -3
  187. package/dist/runtime/components/editor/AEditorRedoButton.d.vue.ts +26 -0
  188. package/dist/runtime/components/editor/AEditorRedoButton.vue +38 -0
  189. package/dist/runtime/components/editor/AEditorRedoButton.vue.d.ts +26 -0
  190. package/dist/runtime/components/editor/AEditorUndoButton.d.vue.ts +26 -0
  191. package/dist/runtime/components/editor/AEditorUndoButton.vue +38 -0
  192. package/dist/runtime/components/editor/AEditorUndoButton.vue.d.ts +26 -0
  193. package/dist/runtime/components/editor/AIconPickerPopover.d.vue.ts +24 -0
  194. package/dist/runtime/components/editor/AIconPickerPopover.vue +113 -0
  195. package/dist/runtime/components/editor/AIconPickerPopover.vue.d.ts +24 -0
  196. package/dist/runtime/components/editor/ANodeInlineLabel.d.vue.ts +24 -0
  197. package/dist/runtime/components/editor/ANodeInlineLabel.vue +101 -0
  198. package/dist/runtime/components/editor/ANodeInlineLabel.vue.d.ts +24 -0
  199. package/dist/runtime/components/renderers/ADocLoadError.d.vue.ts +3 -0
  200. package/dist/runtime/components/renderers/ADocLoadError.vue +11 -0
  201. package/dist/runtime/components/renderers/ADocLoadError.vue.d.ts +3 -0
  202. package/dist/runtime/components/renderers/ADocLoadingSkeleton.d.vue.ts +3 -0
  203. package/dist/runtime/components/renderers/ADocLoadingSkeleton.vue +5 -0
  204. package/dist/runtime/components/renderers/ADocLoadingSkeleton.vue.d.ts +3 -0
  205. package/dist/runtime/components/renderers/AOverviewRenderer.d.vue.ts +22 -0
  206. package/dist/runtime/components/renderers/AOverviewRenderer.vue +1041 -0
  207. package/dist/runtime/components/renderers/AOverviewRenderer.vue.d.ts +22 -0
  208. package/dist/runtime/components/renderers/AProseRenderer.d.vue.ts +23 -0
  209. package/dist/runtime/components/renderers/AProseRenderer.vue +31 -0
  210. package/dist/runtime/components/renderers/AProseRenderer.vue.d.ts +23 -0
  211. package/dist/runtime/components/renderers/ASheetsRenderer.client.d.vue.ts +19 -0
  212. package/dist/runtime/components/renderers/ASheetsRenderer.client.vue +865 -0
  213. package/dist/runtime/components/renderers/ASheetsRenderer.client.vue.d.ts +19 -0
  214. package/dist/runtime/components/renderers/calendar/ACalendarDayCell.d.vue.ts +14 -0
  215. package/dist/runtime/components/renderers/calendar/ACalendarDayCell.vue +45 -15
  216. package/dist/runtime/components/renderers/calendar/ACalendarDayCell.vue.d.ts +14 -0
  217. package/dist/runtime/components/renderers/calendar/ACalendarDayView.d.vue.ts +15 -0
  218. package/dist/runtime/components/renderers/calendar/ACalendarDayView.vue +93 -20
  219. package/dist/runtime/components/renderers/calendar/ACalendarDayView.vue.d.ts +15 -0
  220. package/dist/runtime/components/renderers/calendar/ACalendarEventChip.d.vue.ts +9 -0
  221. package/dist/runtime/components/renderers/calendar/ACalendarEventChip.vue +31 -2
  222. package/dist/runtime/components/renderers/calendar/ACalendarEventChip.vue.d.ts +9 -0
  223. package/dist/runtime/components/renderers/calendar/ACalendarToolbar.d.vue.ts +4 -4
  224. package/dist/runtime/components/renderers/calendar/ACalendarToolbar.vue.d.ts +4 -4
  225. package/dist/runtime/components/renderers/calendar/ACalendarWeekView.d.vue.ts +15 -0
  226. package/dist/runtime/components/renderers/calendar/ACalendarWeekView.vue +94 -21
  227. package/dist/runtime/components/renderers/calendar/ACalendarWeekView.vue.d.ts +15 -0
  228. package/dist/runtime/components/renderers/media/MediaTransportBar.d.vue.ts +2 -2
  229. package/dist/runtime/components/renderers/media/MediaTransportBar.vue.d.ts +2 -2
  230. package/dist/runtime/components/renderers/sheets/ASheetsCell.d.vue.ts +45 -0
  231. package/dist/runtime/components/renderers/sheets/ASheetsCell.vue +123 -0
  232. package/dist/runtime/components/renderers/sheets/ASheetsCell.vue.d.ts +45 -0
  233. package/dist/runtime/components/renderers/sheets/ASheetsGrid.d.vue.ts +111 -0
  234. package/dist/runtime/components/renderers/sheets/ASheetsGrid.vue +737 -0
  235. package/dist/runtime/components/renderers/sheets/ASheetsGrid.vue.d.ts +111 -0
  236. package/dist/runtime/components/renderers/sheets/ASheetsMobileActionBar.d.vue.ts +26 -0
  237. package/dist/runtime/components/renderers/sheets/ASheetsMobileActionBar.vue +100 -0
  238. package/dist/runtime/components/renderers/sheets/ASheetsMobileActionBar.vue.d.ts +26 -0
  239. package/dist/runtime/components/renderers/sheets/ASheetsToolbar.d.vue.ts +48 -0
  240. package/dist/runtime/components/renderers/sheets/ASheetsToolbar.vue +243 -0
  241. package/dist/runtime/components/renderers/sheets/ASheetsToolbar.vue.d.ts +48 -0
  242. package/dist/runtime/components/renderers/table/cells/ATableCellColor.d.vue.ts +1 -0
  243. package/dist/runtime/components/renderers/table/cells/ATableCellColor.vue +13 -32
  244. package/dist/runtime/components/renderers/table/cells/ATableCellColor.vue.d.ts +1 -0
  245. package/dist/runtime/components/renderers/timeline/ATimelineBar.d.vue.ts +6 -0
  246. package/dist/runtime/components/renderers/timeline/ATimelineBar.vue +34 -4
  247. package/dist/runtime/components/renderers/timeline/ATimelineBar.vue.d.ts +6 -0
  248. package/dist/runtime/components/renderers/timeline/ATimelineBarArea.d.vue.ts +16 -0
  249. package/dist/runtime/components/renderers/timeline/ATimelineBarArea.vue +14 -3
  250. package/dist/runtime/components/renderers/timeline/ATimelineBarArea.vue.d.ts +16 -0
  251. package/dist/runtime/components/renderers/timeline/ATimelineLabelPanel.d.vue.ts +13 -1
  252. package/dist/runtime/components/renderers/timeline/ATimelineLabelPanel.vue +114 -47
  253. package/dist/runtime/components/renderers/timeline/ATimelineLabelPanel.vue.d.ts +13 -1
  254. package/dist/runtime/components/renderers/timeline/ATimelineMilestone.d.vue.ts +4 -0
  255. package/dist/runtime/components/renderers/timeline/ATimelineMilestone.vue +21 -4
  256. package/dist/runtime/components/renderers/timeline/ATimelineMilestone.vue.d.ts +4 -0
  257. package/dist/runtime/components/renderers/timeline/ATimelineToolbar.d.vue.ts +2 -2
  258. package/dist/runtime/components/renderers/timeline/ATimelineToolbar.vue.d.ts +2 -2
  259. package/dist/runtime/components/settings/ASettingsSpacesPanel.vue +7 -25
  260. package/dist/runtime/components/shell/ADocPanelSettings.d.vue.ts +3 -3
  261. package/dist/runtime/components/shell/ADocPanelSettings.vue.d.ts +3 -3
  262. package/dist/runtime/components/shell/ASyncStatus.d.vue.ts +1 -1
  263. package/dist/runtime/components/shell/ASyncStatus.vue.d.ts +1 -1
  264. package/dist/runtime/components/shell/AUserMenu.d.vue.ts +2 -2
  265. package/dist/runtime/components/shell/AUserMenu.vue.d.ts +2 -2
  266. package/dist/runtime/components/shell/AWelcomeScreen.d.vue.ts +1 -1
  267. package/dist/runtime/components/shell/AWelcomeScreen.vue.d.ts +1 -1
  268. package/dist/runtime/composables/useAACaret.d.ts +29 -0
  269. package/dist/runtime/composables/useAACaret.js +64 -0
  270. package/dist/runtime/composables/useAAEphemeral.d.ts +32 -0
  271. package/dist/runtime/composables/useAAEphemeral.js +33 -0
  272. package/dist/runtime/composables/useAAField.d.ts +10 -2
  273. package/dist/runtime/composables/useAAField.js +31 -2
  274. package/dist/runtime/composables/useAAFieldValue.d.ts +26 -0
  275. package/dist/runtime/composables/useAAFieldValue.js +32 -0
  276. package/dist/runtime/composables/useAAFocus.d.ts +68 -0
  277. package/dist/runtime/composables/useAAFocus.js +174 -0
  278. package/dist/runtime/composables/useAAFollowAnchor.d.ts +25 -0
  279. package/dist/runtime/composables/useAAFollowAnchor.js +69 -0
  280. package/dist/runtime/composables/useAAFollowPeer.d.ts +29 -0
  281. package/dist/runtime/composables/useAAFollowPeer.js +75 -0
  282. package/dist/runtime/composables/useAAKey.d.ts +22 -0
  283. package/dist/runtime/composables/useAAKey.js +24 -0
  284. package/dist/runtime/composables/useAAPointer.d.ts +30 -0
  285. package/dist/runtime/composables/useAAPointer.js +53 -0
  286. package/dist/runtime/composables/useAAUIState.d.ts +29 -0
  287. package/dist/runtime/composables/useAAUIState.js +28 -0
  288. package/dist/runtime/composables/useAAViewport.d.ts +22 -0
  289. package/dist/runtime/composables/useAAViewport.js +50 -0
  290. package/dist/runtime/composables/useAbraAdmin.d.ts +54 -0
  291. package/dist/runtime/composables/useAbraAdmin.js +115 -0
  292. package/dist/runtime/composables/useAbracadabraAuth.d.ts +8 -0
  293. package/dist/runtime/composables/useAbracadabraAuth.js +8 -0
  294. package/dist/runtime/composables/useAggregatedPresence.d.ts +23 -0
  295. package/dist/runtime/composables/useAggregatedPresence.js +140 -0
  296. package/dist/runtime/composables/useChat.d.ts +16 -2
  297. package/dist/runtime/composables/useChat.js +257 -66
  298. package/dist/runtime/composables/useChatUsers.d.ts +2 -0
  299. package/dist/runtime/composables/useChatUsers.js +2 -1
  300. package/dist/runtime/composables/useDocLookup.d.ts +4 -0
  301. package/dist/runtime/composables/useDocLookup.js +25 -0
  302. package/dist/runtime/composables/useDocSnapshots.d.ts +79 -0
  303. package/dist/runtime/composables/useDocSnapshots.js +234 -0
  304. package/dist/runtime/composables/useEditorDragHandle.d.ts +7 -0
  305. package/dist/runtime/composables/useEditorDragHandle.js +19 -1
  306. package/dist/runtime/composables/useEditorSuggestions.js +26 -1
  307. package/dist/runtime/composables/useEditorToolbar.js +9 -1
  308. package/dist/runtime/composables/useEmailVerification.d.ts +33 -0
  309. package/dist/runtime/composables/useEmailVerification.js +58 -0
  310. package/dist/runtime/composables/useIdentityDoc.js +0 -3
  311. package/dist/runtime/composables/useItemPresence.d.ts +47 -0
  312. package/dist/runtime/composables/useItemPresence.js +73 -0
  313. package/dist/runtime/composables/useResizableWidth.d.ts +24 -0
  314. package/dist/runtime/composables/useResizableWidth.js +87 -0
  315. package/dist/runtime/composables/useServerInfo.d.ts +17 -2
  316. package/dist/runtime/composables/useServerInfo.js +30 -6
  317. package/dist/runtime/composables/useServerSearch.d.ts +36 -0
  318. package/dist/runtime/composables/useServerSearch.js +91 -0
  319. package/dist/runtime/composables/useServerTrash.d.ts +67 -0
  320. package/dist/runtime/composables/useServerTrash.js +128 -0
  321. package/dist/runtime/composables/useSheetsClipboard.d.ts +42 -0
  322. package/dist/runtime/composables/useSheetsClipboard.js +109 -0
  323. package/dist/runtime/composables/useSheetsFormulas.d.ts +38 -0
  324. package/dist/runtime/composables/useSheetsFormulas.js +725 -0
  325. package/dist/runtime/composables/useSheetsSelection.d.ts +68 -0
  326. package/dist/runtime/composables/useSheetsSelection.js +390 -0
  327. package/dist/runtime/composables/useSheetsView.d.ts +31 -0
  328. package/dist/runtime/composables/useSheetsView.js +77 -0
  329. package/dist/runtime/composables/useSpaceConnections.d.ts +43 -0
  330. package/dist/runtime/composables/useSpaceConnections.js +72 -0
  331. package/dist/runtime/composables/useSpaces.d.ts +1 -3
  332. package/dist/runtime/composables/useSpaces.js +2 -5
  333. package/dist/runtime/composables/useTiptapHistory.d.ts +22 -0
  334. package/dist/runtime/composables/useTiptapHistory.js +12 -0
  335. package/dist/runtime/composables/useTreeExpansion.d.ts +28 -0
  336. package/dist/runtime/composables/useTreeExpansion.js +94 -0
  337. package/dist/runtime/composables/useYDoc.js +12 -1
  338. package/dist/runtime/extensions/button.d.ts +3 -0
  339. package/dist/runtime/extensions/button.js +62 -0
  340. package/dist/runtime/extensions/color-swatch.d.ts +2 -0
  341. package/dist/runtime/extensions/color-swatch.js +34 -0
  342. package/dist/runtime/extensions/diff.d.ts +2 -0
  343. package/dist/runtime/extensions/diff.js +40 -0
  344. package/dist/runtime/extensions/divider.d.ts +2 -0
  345. package/dist/runtime/extensions/divider.js +33 -0
  346. package/dist/runtime/extensions/embed.d.ts +2 -0
  347. package/dist/runtime/extensions/embed.js +40 -0
  348. package/dist/runtime/extensions/figure.d.ts +2 -0
  349. package/dist/runtime/extensions/figure.js +49 -0
  350. package/dist/runtime/extensions/math.d.ts +15 -0
  351. package/dist/runtime/extensions/math.js +66 -0
  352. package/dist/runtime/extensions/progress.d.ts +2 -0
  353. package/dist/runtime/extensions/progress.js +43 -0
  354. package/dist/runtime/extensions/quote.d.ts +2 -0
  355. package/dist/runtime/extensions/quote.js +39 -0
  356. package/dist/runtime/extensions/spoiler.d.ts +2 -0
  357. package/dist/runtime/extensions/spoiler.js +36 -0
  358. package/dist/runtime/extensions/stat.d.ts +3 -0
  359. package/dist/runtime/extensions/stat.js +58 -0
  360. package/dist/runtime/extensions/video.d.ts +2 -0
  361. package/dist/runtime/extensions/video.js +40 -0
  362. package/dist/runtime/extensions/views/ButtonGroupView.d.vue.ts +4 -0
  363. package/dist/runtime/extensions/views/ButtonGroupView.vue +25 -0
  364. package/dist/runtime/extensions/views/ButtonGroupView.vue.d.ts +4 -0
  365. package/dist/runtime/extensions/views/ButtonView.d.vue.ts +4 -0
  366. package/dist/runtime/extensions/views/ButtonView.vue +171 -0
  367. package/dist/runtime/extensions/views/ButtonView.vue.d.ts +4 -0
  368. package/dist/runtime/extensions/views/ColorSwatchView.d.vue.ts +4 -0
  369. package/dist/runtime/extensions/views/ColorSwatchView.vue +134 -0
  370. package/dist/runtime/extensions/views/ColorSwatchView.vue.d.ts +4 -0
  371. package/dist/runtime/extensions/views/DiffView.d.vue.ts +4 -0
  372. package/dist/runtime/extensions/views/DiffView.vue +163 -0
  373. package/dist/runtime/extensions/views/DiffView.vue.d.ts +4 -0
  374. package/dist/runtime/extensions/views/DividerView.d.vue.ts +4 -0
  375. package/dist/runtime/extensions/views/DividerView.vue +40 -0
  376. package/dist/runtime/extensions/views/DividerView.vue.d.ts +4 -0
  377. package/dist/runtime/extensions/views/EmbedView.d.vue.ts +4 -0
  378. package/dist/runtime/extensions/views/EmbedView.vue +166 -0
  379. package/dist/runtime/extensions/views/EmbedView.vue.d.ts +4 -0
  380. package/dist/runtime/extensions/views/FigureView.d.vue.ts +4 -0
  381. package/dist/runtime/extensions/views/FigureView.vue +122 -0
  382. package/dist/runtime/extensions/views/FigureView.vue.d.ts +4 -0
  383. package/dist/runtime/extensions/views/FileNodeView.vue +21 -24
  384. package/dist/runtime/extensions/views/MathBlockView.d.vue.ts +4 -0
  385. package/dist/runtime/extensions/views/MathBlockView.vue +151 -0
  386. package/dist/runtime/extensions/views/MathBlockView.vue.d.ts +4 -0
  387. package/dist/runtime/extensions/views/MathInlineView.d.vue.ts +4 -0
  388. package/dist/runtime/extensions/views/MathInlineView.vue +149 -0
  389. package/dist/runtime/extensions/views/MathInlineView.vue.d.ts +4 -0
  390. package/dist/runtime/extensions/views/MetaFieldView.vue +1129 -550
  391. package/dist/runtime/extensions/views/ProgressView.d.vue.ts +4 -0
  392. package/dist/runtime/extensions/views/ProgressView.vue +156 -0
  393. package/dist/runtime/extensions/views/ProgressView.vue.d.ts +4 -0
  394. package/dist/runtime/extensions/views/QuoteView.d.vue.ts +4 -0
  395. package/dist/runtime/extensions/views/QuoteView.vue +128 -0
  396. package/dist/runtime/extensions/views/QuoteView.vue.d.ts +4 -0
  397. package/dist/runtime/extensions/views/SpoilerView.d.vue.ts +4 -0
  398. package/dist/runtime/extensions/views/SpoilerView.vue +62 -0
  399. package/dist/runtime/extensions/views/SpoilerView.vue.d.ts +4 -0
  400. package/dist/runtime/extensions/views/StatGroupView.d.vue.ts +4 -0
  401. package/dist/runtime/extensions/views/StatGroupView.vue +25 -0
  402. package/dist/runtime/extensions/views/StatGroupView.vue.d.ts +4 -0
  403. package/dist/runtime/extensions/views/StatView.d.vue.ts +4 -0
  404. package/dist/runtime/extensions/views/StatView.vue +89 -0
  405. package/dist/runtime/extensions/views/StatView.vue.d.ts +4 -0
  406. package/dist/runtime/extensions/views/VideoView.d.vue.ts +4 -0
  407. package/dist/runtime/extensions/views/VideoView.vue +190 -0
  408. package/dist/runtime/extensions/views/VideoView.vue.d.ts +4 -0
  409. package/dist/runtime/locale.d.ts +133 -0
  410. package/dist/runtime/locale.js +121 -2
  411. package/dist/runtime/plugin-abracadabra.client.js +233 -36
  412. package/dist/runtime/plugin-abracadabra.server.js +0 -1
  413. package/dist/runtime/plugins/core.plugin.js +73 -4
  414. package/dist/runtime/server/plugins/abracadabra-service.js +1 -1
  415. package/dist/runtime/server/utils/rpcHandler.d.ts +74 -0
  416. package/dist/runtime/server/utils/rpcHandler.js +74 -0
  417. package/dist/runtime/server/utils/spaceManager.js +10 -9
  418. package/dist/runtime/types.d.ts +63 -10
  419. package/dist/runtime/utils/awareRingStyle.d.ts +22 -0
  420. package/dist/runtime/utils/awareRingStyle.js +16 -0
  421. package/dist/runtime/utils/caretCoordinates.d.ts +41 -0
  422. package/dist/runtime/utils/caretCoordinates.js +126 -0
  423. package/dist/runtime/utils/content.d.ts +1 -1
  424. package/dist/runtime/utils/docTypes.js +44 -13
  425. package/dist/runtime/utils/domPath.d.ts +42 -0
  426. package/dist/runtime/utils/domPath.js +89 -0
  427. package/dist/runtime/utils/loadKatex.d.ts +1 -0
  428. package/dist/runtime/utils/loadKatex.js +29 -0
  429. package/dist/runtime/utils/lucideIcons.d.ts +16 -0
  430. package/dist/runtime/utils/lucideIcons.js +451 -0
  431. package/dist/runtime/utils/time.d.ts +15 -0
  432. package/dist/runtime/utils/time.js +5 -0
  433. package/dist/types.d.mts +4 -0
  434. package/package.json +27 -16
@@ -1,8 +1,32 @@
1
- import { ref, computed } from "vue";
1
+ import { ref, computed, watch } from "vue";
2
2
  import { useAbracadabra } from "./useAbracadabra.js";
3
+ import { tsToMs } from "../utils/time.js";
4
+ import {
5
+ ChannelKeyResolver,
6
+ DocKeyManager,
7
+ decryptChatContent,
8
+ foldRecords,
9
+ isEncryptedContent,
10
+ recordFromYAny
11
+ } from "@abraca/dabra";
12
+ const _docKeys = new DocKeyManager();
13
+ const _resolverByClient = /* @__PURE__ */ new WeakMap();
14
+ function _resolveChannelKey(client) {
15
+ if (!client) return null;
16
+ const cached = _resolverByClient.get(client);
17
+ if (cached) return cached;
18
+ const { keystore } = useAbracadabra();
19
+ if (!keystore.value) return null;
20
+ const resolver = new ChannelKeyResolver(client, _docKeys, keystore.value);
21
+ _resolverByClient.set(client, resolver);
22
+ return resolver;
23
+ }
3
24
  export function buildDmChannelId(a, b) {
4
25
  return `dm:${[a, b].sort().join(":")}`;
5
26
  }
27
+ function normalizeChannel(channelId) {
28
+ return channelId.startsWith("group:") ? channelId.slice("group:".length) : channelId;
29
+ }
6
30
  const messagesByChannel = ref({});
7
31
  const channels = ref({});
8
32
  const typingByChannel = ref({});
@@ -26,6 +50,20 @@ export function _destroyChat() {
26
50
  for (const t of typingTimers.values()) clearTimeout(t);
27
51
  typingTimers.clear();
28
52
  }
53
+ function resolveSenderName(senderId, fallback = "User") {
54
+ if (!senderId) return fallback;
55
+ try {
56
+ const { provider } = useAbracadabra();
57
+ const awareness = provider.value?.awareness;
58
+ if (!awareness) return fallback;
59
+ const states = awareness.getStates();
60
+ for (const state of states.values()) {
61
+ if (state?.user?.publicKey === senderId && state.user.name) return state.user.name;
62
+ }
63
+ } catch {
64
+ }
65
+ return fallback;
66
+ }
29
67
  function resolveChannelLabel(channelId, senderName, senderId) {
30
68
  const { doc } = useAbracadabra();
31
69
  if (channelId.startsWith("group:")) {
@@ -60,50 +98,56 @@ function ensureChannel(channelId, label) {
60
98
  function addMessage(msg) {
61
99
  const list = messagesByChannel.value[msg.channel] ?? [];
62
100
  if (list.some((m) => m.id === msg.id)) return;
63
- const sorted = [...list, msg].sort((a, b) => a.createdAt - b.createdAt);
101
+ const isServerEcho = !msg.id.startsWith("local-");
102
+ let filtered = list;
103
+ if (isServerEcho) {
104
+ filtered = list.filter(
105
+ (m) => !(m.id.startsWith("local-") && m.senderId === msg.senderId && m.content === msg.content && Math.abs(m.createdAt - msg.createdAt) < 3e4)
106
+ );
107
+ }
108
+ const sorted = [...filtered, msg].sort((a, b) => a.createdAt - b.createdAt);
64
109
  messagesByChannel.value = { ...messagesByChannel.value, [msg.channel]: sorted };
65
110
  const chan = channels.value[msg.channel];
66
111
  if (chan) {
67
112
  const isActive = activeChannel.value === msg.channel;
113
+ const isOwn = msg.senderId === _publicKeyB64.value;
68
114
  channels.value = {
69
115
  ...channels.value,
70
116
  [msg.channel]: {
71
117
  ...chan,
72
118
  lastMessage: msg,
73
- unreadCount: isActive ? 0 : chan.unreadCount + 1
119
+ unreadCount: isActive || isOwn ? chan.unreadCount : chan.unreadCount + 1
74
120
  }
75
121
  };
76
122
  }
77
123
  }
78
124
  export function _handleStatelessChat(payload) {
79
- if (!payload.includes('"chat:')) return;
125
+ if (!payload.includes('"messages:')) return;
80
126
  try {
81
127
  const data = JSON.parse(payload);
82
- if (!data.type?.startsWith("chat:")) return;
83
- switch (data.type) {
84
- case "chat:history": {
85
- const msgs = (data.messages || []).map((m) => ({
86
- id: m.id,
87
- channel: m.channel,
88
- senderId: m.sender_id ?? "",
89
- senderName: m.sender_name ?? "User",
90
- content: m.content,
91
- createdAt: typeof m.created_at === "number" ? m.created_at : new Date(m.created_at).getTime()
92
- }));
93
- for (const msg of msgs) {
94
- ensureChannel(msg.channel, resolveChannelLabel(msg.channel, msg.senderName, msg.senderId));
95
- addMessage(msg);
96
- }
97
- break;
98
- }
99
- case "chat:message": {
128
+ const t = data.type;
129
+ if (!t || !t.startsWith("messages:")) return;
130
+ switch (t) {
131
+ case "messages:new_message": {
132
+ const rec = data.record;
133
+ if (!rec || rec.record_kind && rec.record_kind !== "message") break;
134
+ const channelDocId = rec.channel_doc_id;
135
+ if (!channelDocId) break;
136
+ const tsMs = tsToMs(rec.ts) ?? Date.now();
137
+ const senderId = rec.sender_id ?? "";
100
138
  const msg = {
101
- id: data.id ?? crypto.randomUUID(),
102
- channel: data.channel,
103
- senderId: data.sender_id ?? "",
104
- senderName: data.sender_name ?? "User",
105
- content: data.content,
106
- createdAt: typeof data.created_at === "number" ? data.created_at : Date.now()
139
+ id: rec.id ?? `${senderId}-${tsMs}`,
140
+ // Use the raw doc id as the channel key; the legacy `group:`
141
+ // prefix scheme is on its way out across the codebase.
142
+ channel: channelDocId,
143
+ senderId,
144
+ // Server records carry only `sender_id` (publicKey). Resolve a
145
+ // human-readable name from awareness so peers don't all show as
146
+ // the placeholder "User" — that visual collapse was being read
147
+ // as "chat is broken / messages aren't syncing".
148
+ senderName: rec.sender_name ?? resolveSenderName(senderId),
149
+ content: rec.content ?? "",
150
+ createdAt: tsMs
107
151
  };
108
152
  ensureChannel(msg.channel, resolveChannelLabel(msg.channel, msg.senderName, msg.senderId));
109
153
  addMessage(msg);
@@ -115,26 +159,61 @@ export function _handleStatelessChat(payload) {
115
159
  }
116
160
  break;
117
161
  }
118
- case "chat:typing": {
119
- const channel = data.channel;
162
+ case "messages:typing": {
163
+ const channelDocId = data.channel_doc_id;
164
+ if (!channelDocId) break;
120
165
  const senderId = data.sender_id ?? "";
121
166
  const name = data.sender_name ?? "User";
122
167
  if (senderId === _publicKeyB64.value) break;
123
- const current = typingByChannel.value[channel] ?? /* @__PURE__ */ new Map();
168
+ const current = typingByChannel.value[channelDocId] ?? /* @__PURE__ */ new Map();
124
169
  const next = new Map(current);
125
170
  next.set(senderId, name);
126
- typingByChannel.value = { ...typingByChannel.value, [channel]: next };
127
- const timerKey = `${channel}:${senderId}`;
171
+ typingByChannel.value = { ...typingByChannel.value, [channelDocId]: next };
172
+ const timerKey = `${channelDocId}:${senderId}`;
128
173
  const existing = typingTimers.get(timerKey);
129
174
  if (existing) clearTimeout(existing);
130
175
  typingTimers.set(timerKey, setTimeout(() => {
131
176
  typingTimers.delete(timerKey);
132
- const cur = typingByChannel.value[channel];
133
- if (!cur) return;
134
- const updated = new Map(cur);
135
- updated.delete(senderId);
136
- typingByChannel.value = { ...typingByChannel.value, [channel]: updated };
137
- }, 4e3));
177
+ const cur = typingByChannel.value[channelDocId];
178
+ if (cur?.has(senderId)) {
179
+ const n2 = new Map(cur);
180
+ n2.delete(senderId);
181
+ typingByChannel.value = { ...typingByChannel.value, [channelDocId]: n2 };
182
+ }
183
+ }, 5e3));
184
+ break;
185
+ }
186
+ case "permissions:rewrap_needed": {
187
+ const docId = data.doc_id;
188
+ const targetUserId = data.target_user_id;
189
+ if (!docId || !targetUserId) break;
190
+ if (targetUserId === _publicKeyB64.value) break;
191
+ (async () => {
192
+ const { client } = useAbracadabra();
193
+ if (!client?.value) return;
194
+ try {
195
+ const resolver = _resolveChannelKey(client.value);
196
+ if (!resolver) return;
197
+ const docKey = await resolver.docKeyFor(docId);
198
+ if (!docKey) return;
199
+ const granteeKeys = await client.value.listUserKeys(targetUserId);
200
+ if (!granteeKeys.length) return;
201
+ const granteeKey = granteeKeys[0];
202
+ if (!granteeKey.x25519Key) return;
203
+ const x25519Pub = Uint8Array.from(
204
+ atob(granteeKey.x25519Key.replace(/-/g, "+").replace(/_/g, "/")),
205
+ (c) => c.charCodeAt(0)
206
+ );
207
+ const wrapped = await _docKeys.wrapKeyForRecipient(docKey, x25519Pub, docId);
208
+ const b64 = btoa(String.fromCharCode(...wrapped));
209
+ await client.value.uploadKeyEnvelopes(docId, {
210
+ key_epoch: 1,
211
+ envelopes: [{ recipient_key_id: granteeKey.id, encrypted_key: b64 }]
212
+ });
213
+ } catch (err) {
214
+ if (import.meta.dev) console.warn("[abracadabra] rewrap_needed handler failed:", err);
215
+ }
216
+ })();
138
217
  break;
139
218
  }
140
219
  }
@@ -142,39 +221,140 @@ export function _handleStatelessChat(payload) {
142
221
  if (import.meta.dev) console.warn("[abracadabra] chat: failed to handle stateless message:", e);
143
222
  }
144
223
  }
145
- function sendMessage(channelId, content) {
146
- const { provider } = useAbracadabra();
224
+ function sendMessage(channelId, content, opts) {
225
+ const { provider, userName } = useAbracadabra();
147
226
  if (!provider.value || !content.trim()) return;
227
+ const channelDocId = normalizeChannel(channelId);
228
+ const trimmed = content.trim();
229
+ ensureChannel(channelDocId);
230
+ addMessage({
231
+ id: `local-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
232
+ channel: channelDocId,
233
+ senderId: _publicKeyB64.value,
234
+ senderName: userName?.value ?? _userName.value,
235
+ content: trimmed,
236
+ createdAt: Date.now()
237
+ });
148
238
  provider.value.sendStateless(JSON.stringify({
149
- type: "chat:send",
150
- channel: channelId,
151
- content: content.trim()
239
+ type: "messages:send",
240
+ channel_doc_id: channelDocId,
241
+ content: trimmed,
242
+ mentions: opts?.mentions ?? [],
243
+ ...opts?.replyTo ? { reply_to: opts.replyTo } : {}
152
244
  }));
153
245
  }
154
- function fetchHistory(channelId, opts) {
246
+ const _channelHandles = /* @__PURE__ */ new Map();
247
+ async function _attachPeriodProvider(channel, rootProv, periodId) {
248
+ const handle = _channelHandles.get(channel);
249
+ if (!handle) return;
250
+ if (handle.periodProv && handle.periodProv.name === periodId) return;
251
+ try {
252
+ const periodChild = await rootProv.loadChild(periodId);
253
+ handle.periodProv = periodChild;
254
+ const arr = periodChild.document.getArray("messages");
255
+ const channelDocIdRaw = channel.startsWith("group:") ? channel.slice("group:".length) : channel;
256
+ const { client } = useAbracadabra();
257
+ const resolver = _resolveChannelKey(client?.value);
258
+ let channelDocKey = null;
259
+ let docKeyError = null;
260
+ if (resolver) {
261
+ try {
262
+ channelDocKey = await resolver.docKeyFor(channelDocIdRaw);
263
+ } catch (e) {
264
+ docKeyError = e;
265
+ }
266
+ }
267
+ const pumpAll = async () => {
268
+ const records = arr.toArray().map((v) => recordFromYAny(v)).filter((r) => r !== null);
269
+ const folded = foldRecords(records);
270
+ for (const f of folded) {
271
+ let content = f.content;
272
+ if (isEncryptedContent(content)) {
273
+ if (channelDocKey) {
274
+ const decrypted = await decryptChatContent(content, channelDocKey);
275
+ content = decrypted ?? "[decryption failed]";
276
+ } else {
277
+ content = docKeyError ? "[encrypted \u2014 no key available for this channel]" : "[encrypted]";
278
+ }
279
+ }
280
+ addMessage({
281
+ id: f.id,
282
+ channel,
283
+ senderId: f.senderId,
284
+ senderName: "",
285
+ content,
286
+ createdAt: f.createdAt
287
+ });
288
+ }
289
+ };
290
+ const onChange = () => {
291
+ void pumpAll();
292
+ };
293
+ arr.observe(onChange);
294
+ handle.disposers.push(() => arr.unobserve(onChange));
295
+ const tryPump = () => {
296
+ if (arr.length > 0) void pumpAll();
297
+ };
298
+ if (periodChild.synced) tryPump();
299
+ else periodChild.on("synced", tryPump);
300
+ } catch (err) {
301
+ if (import.meta.dev) console.warn(`[abracadabra] loadChild(period ${periodId}) for ${channel} failed:`, err);
302
+ }
303
+ }
304
+ function fetchHistory(channelId, _opts) {
305
+ const channelDocId = normalizeChannel(channelId);
306
+ if (_channelHandles.has(channelDocId)) return;
155
307
  const { provider } = useAbracadabra();
156
- if (!provider.value) return;
157
- provider.value.sendStateless(JSON.stringify({
158
- type: "chat:history",
159
- channel: channelId,
160
- before: opts?.before,
161
- limit: opts?.limit ?? 50
162
- }));
308
+ const rootProv = provider.value;
309
+ if (!rootProv) {
310
+ if (import.meta.dev) console.warn(`[abracadabra] fetchHistory(${channelDocId}): no provider attached yet`);
311
+ return;
312
+ }
313
+ const handle = { wrapperProv: null, periodProv: null, disposers: [] };
314
+ _channelHandles.set(channelDocId, handle);
315
+ const rootName = rootProv?.configuration?.name ?? rootProv?.document?.guid;
316
+ const isSelfChannel = rootName === channelDocId;
317
+ const wireUp = (wrapperChild) => {
318
+ handle.wrapperProv = wrapperChild;
319
+ const periods = wrapperChild.document.getArray("periods");
320
+ const pickActive = () => {
321
+ const len = periods.length;
322
+ if (len === 0) return;
323
+ const last = periods.get(len - 1);
324
+ const periodId = last?.id ?? last?.get?.("id");
325
+ if (periodId) void _attachPeriodProvider(channelDocId, rootProv, periodId);
326
+ };
327
+ const onPeriods = () => pickActive();
328
+ periods.observe(onPeriods);
329
+ handle.disposers.push(() => periods.unobserve(onPeriods));
330
+ if (wrapperChild.synced) pickActive();
331
+ else wrapperChild.on("synced", pickActive);
332
+ };
333
+ if (isSelfChannel) {
334
+ wireUp(rootProv);
335
+ return;
336
+ }
337
+ rootProv.loadChild(channelDocId).then(wireUp).catch((err) => {
338
+ if (import.meta.dev) console.warn(`[abracadabra] loadChild(${channelDocId}) failed:`, err);
339
+ _channelHandles.delete(channelDocId);
340
+ });
163
341
  }
164
342
  function sendTyping(channelId) {
165
343
  const { provider } = useAbracadabra();
166
344
  if (!provider.value) return;
345
+ const channelDocId = normalizeChannel(channelId);
167
346
  provider.value.sendStateless(JSON.stringify({
168
- type: "chat:typing",
169
- channel: channelId
347
+ type: "messages:typing",
348
+ channel_doc_id: channelDocId
170
349
  }));
171
350
  }
172
351
  function setActiveChannel(channelId) {
173
- activeChannel.value = channelId;
174
- if (channelId && channels.value[channelId]) {
352
+ const key = channelId ? normalizeChannel(channelId) : null;
353
+ activeChannel.value = key;
354
+ if (key && channels.value[key]) {
175
355
  channels.value = {
176
356
  ...channels.value,
177
- [channelId]: { ...channels.value[channelId], unreadCount: 0 }
357
+ [key]: { ...channels.value[key], unreadCount: 0 }
178
358
  };
179
359
  }
180
360
  }
@@ -196,24 +376,35 @@ export function useChat() {
196
376
  };
197
377
  }
198
378
  export function useChatChannel(channelId) {
199
- const messages = computed(() => messagesByChannel.value[channelId] ?? []);
200
- const channel = computed(() => channels.value[channelId]);
201
- const typingUsers = computed(() => [...typingByChannel.value[channelId]?.values() ?? []]);
202
- const unreadCount = computed(() => channels.value[channelId]?.unreadCount ?? 0);
379
+ const key = normalizeChannel(channelId);
380
+ const messages = computed(() => messagesByChannel.value[key] ?? []);
381
+ const channel = computed(() => channels.value[key]);
382
+ const typingUsers = computed(() => [...typingByChannel.value[key]?.values() ?? []]);
383
+ const unreadCount = computed(() => channels.value[key]?.unreadCount ?? 0);
384
+ ensureChannel(key);
385
+ const { provider } = useAbracadabra();
386
+ if (provider.value) fetchHistory(key);
387
+ else {
388
+ const stop = watch(provider, (p) => {
389
+ if (!p) return;
390
+ fetchHistory(key);
391
+ stop();
392
+ });
393
+ }
203
394
  function send(content) {
204
- sendMessage(channelId, content);
395
+ sendMessage(key, content);
205
396
  }
206
397
  function loadHistory(opts) {
207
- fetchHistory(channelId, opts);
398
+ fetchHistory(key, opts);
208
399
  }
209
400
  function typing() {
210
- sendTyping(channelId);
401
+ sendTyping(key);
211
402
  }
212
403
  function focus() {
213
- setActiveChannel(channelId);
404
+ setActiveChannel(key);
214
405
  }
215
406
  function blur() {
216
- if (activeChannel.value === channelId) setActiveChannel(null);
407
+ if (activeChannel.value === key) setActiveChannel(null);
217
408
  }
218
409
  return { messages, channel, typingUsers, unreadCount, send, loadHistory, typing, focus, blur };
219
410
  }
@@ -14,6 +14,8 @@ export interface ChatUserAppearance {
14
14
  neutralName: string;
15
15
  publicKey: string;
16
16
  isOnline: boolean;
17
+ /** Doc the user is currently viewing (from awareness `docId` field). */
18
+ docId?: string;
17
19
  }
18
20
  export declare function useChatUsers(): {
19
21
  onlineUsers: import("vue").ComputedRef<ChatUserAppearance[]>;
@@ -16,7 +16,8 @@ export function useChatUsers() {
16
16
  color: u.color ?? "#888",
17
17
  neutralName: "zinc",
18
18
  publicKey: u.publicKey,
19
- isOnline: true
19
+ isOnline: true,
20
+ docId: typeof state.docId === "string" ? state.docId : void 0
20
21
  });
21
22
  }
22
23
  }
@@ -0,0 +1,4 @@
1
+ export declare function useDocLookup(): {
2
+ docToSpace: import("vue").ComputedRef<Map<string, string>>;
3
+ resolveDocSpace: (docId: string) => string | undefined;
4
+ };
@@ -0,0 +1,25 @@
1
+ import { computed } from "vue";
2
+ import { useSpaceConnections } from "./useSpaceConnections.js";
3
+ import { useAbracadabra } from "./useAbracadabra.js";
4
+ export function useDocLookup() {
5
+ const { connections } = useSpaceConnections();
6
+ const state = useAbracadabra();
7
+ const docToSpace = computed(() => {
8
+ const map = /* @__PURE__ */ new Map();
9
+ for (const [spaceId, conn] of connections) {
10
+ if (state.spaceDocId.value) map.set(state.spaceDocId.value, spaceId);
11
+ const treeData = conn.treeData.value;
12
+ for (const docId of Object.keys(treeData)) {
13
+ map.set(docId, spaceId);
14
+ }
15
+ }
16
+ return map;
17
+ });
18
+ function resolveDocSpace(docId) {
19
+ return docToSpace.value.get(docId);
20
+ }
21
+ return {
22
+ docToSpace,
23
+ resolveDocSpace
24
+ };
25
+ }
@@ -0,0 +1,79 @@
1
+ /**
2
+ * useDocSnapshots
3
+ *
4
+ * CRUD over a document's snapshot history with paginated fetch and a
5
+ * derived "display items" view that collapses runs of consecutive
6
+ * auto-snapshots from the same author within a 30-min window into one
7
+ * cluster (manual / unload / shutdown / labelled snapshots stay
8
+ * individual). Keeps the side-panel timeline scannable while losing
9
+ * nothing.
10
+ *
11
+ * Mirrors the `cou-sh` implementation 1-to-1 — the cou-sh version is the
12
+ * source of truth (see project memory: nuxt-module-must-match-coush). If
13
+ * this composable drifts from cou-sh's, fix it back rather than
14
+ * "improving" it here.
15
+ *
16
+ * Usage:
17
+ * const docId = computed(() => route.params.id as string)
18
+ * const snaps = useDocSnapshots(docId)
19
+ * onMounted(() => snaps.fetchList())
20
+ */
21
+ import { type ComputedRef, type InjectionKey, type Ref } from 'vue';
22
+ import type { SnapshotMeta } from '@abraca/dabra';
23
+ import type { AbracadabraLocale } from '../locale.js';
24
+ export type DocSnapshotsCtx = ReturnType<typeof useDocSnapshots>;
25
+ export declare const DOC_SNAPSHOTS_KEY: InjectionKey<DocSnapshotsCtx>;
26
+ /** Trigger badge color, matching cou-sh's mapping exactly. */
27
+ export declare function triggerBadgeColor(trigger: string): 'primary' | 'neutral' | 'warning';
28
+ /**
29
+ * Trigger label key — consumers translate via their own i18n if they
30
+ * don't use `useAbraLocale`. Returns the dot-path key cou-sh uses.
31
+ */
32
+ export declare function triggerLabelKey(trigger: string): string;
33
+ /**
34
+ * Per-row item for the side-panel list. Auto runs collapse into a
35
+ * single `cluster` item; everything else stays as its own `snap`.
36
+ */
37
+ export type SnapshotDisplayItem = {
38
+ kind: 'snap';
39
+ snap: SnapshotMeta;
40
+ } | {
41
+ kind: 'cluster';
42
+ items: SnapshotMeta[];
43
+ firstAt: number;
44
+ lastAt: number;
45
+ createdBy: string | null;
46
+ };
47
+ export declare function useDocSnapshots(docId: Ref<string> | ComputedRef<string>, overrides?: Partial<AbracadabraLocale['snapshots']> | null): {
48
+ snapshots: Ref<{
49
+ version: number;
50
+ size_bytes: number;
51
+ trigger: string;
52
+ label?: string | null | undefined;
53
+ created_by?: string | null | undefined;
54
+ created_at: number;
55
+ file_count?: number | undefined;
56
+ delta_bytes?: number | null | undefined;
57
+ }[], SnapshotMeta[] | {
58
+ version: number;
59
+ size_bytes: number;
60
+ trigger: string;
61
+ label?: string | null | undefined;
62
+ created_by?: string | null | undefined;
63
+ created_at: number;
64
+ file_count?: number | undefined;
65
+ delta_bytes?: number | null | undefined;
66
+ }[]>;
67
+ displayItems: ComputedRef<SnapshotDisplayItem[]>;
68
+ loading: Ref<boolean, boolean>;
69
+ error: Ref<string | null, string | null>;
70
+ hasMore: Ref<boolean, boolean>;
71
+ creating: Ref<boolean, boolean>;
72
+ pending: Ref<Record<number, "delete" | "restore" | "fork" | undefined>, Record<number, "delete" | "restore" | "fork" | undefined>>;
73
+ fetchList: () => Promise<void>;
74
+ loadMore: () => Promise<void>;
75
+ create: (label?: string) => Promise<void>;
76
+ remove: (version: number) => Promise<void>;
77
+ restore: (version: number) => Promise<void>;
78
+ fork: (version: number) => Promise<void>;
79
+ };