@abraca/nuxt 2.4.0 → 2.5.1

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 (97) hide show
  1. package/README.md +25 -6
  2. package/dist/module.d.mts +4 -2
  3. package/dist/module.json +1 -1
  4. package/dist/runtime/components/ACodeEditor.d.vue.ts +1 -1
  5. package/dist/runtime/components/ACodeEditor.vue.d.ts +1 -1
  6. package/dist/runtime/components/AConnectServerModal.d.vue.ts +2 -2
  7. package/dist/runtime/components/AConnectServerModal.vue +1 -1
  8. package/dist/runtime/components/AConnectServerModal.vue.d.ts +2 -2
  9. package/dist/runtime/components/ADocumentTree.d.vue.ts +8 -1
  10. package/dist/runtime/components/ADocumentTree.vue +6 -3
  11. package/dist/runtime/components/ADocumentTree.vue.d.ts +8 -1
  12. package/dist/runtime/components/AEditor.d.vue.ts +7 -7
  13. package/dist/runtime/components/AEditor.vue.d.ts +7 -7
  14. package/dist/runtime/components/AEmailVerifyConfirmModal.d.vue.ts +2 -2
  15. package/dist/runtime/components/AEmailVerifyConfirmModal.vue.d.ts +2 -2
  16. package/dist/runtime/components/AIdentityModal.d.vue.ts +2 -2
  17. package/dist/runtime/components/AIdentityModal.vue.d.ts +2 -2
  18. package/dist/runtime/components/AInviteRedeemModal.vue +15 -11
  19. package/dist/runtime/components/AMnemonicLoginModal.d.vue.ts +2 -2
  20. package/dist/runtime/components/AMnemonicLoginModal.vue.d.ts +2 -2
  21. package/dist/runtime/components/APasswordChangeModal.d.vue.ts +3 -3
  22. package/dist/runtime/components/APasswordChangeModal.vue.d.ts +3 -3
  23. package/dist/runtime/components/APasswordLoginModal.d.vue.ts +4 -4
  24. package/dist/runtime/components/APasswordLoginModal.vue.d.ts +4 -4
  25. package/dist/runtime/components/APasswordRegisterModal.d.vue.ts +3 -3
  26. package/dist/runtime/components/APasswordRegisterModal.vue.d.ts +3 -3
  27. package/dist/runtime/components/APasswordResetConfirmModal.d.vue.ts +3 -3
  28. package/dist/runtime/components/APasswordResetConfirmModal.vue.d.ts +3 -3
  29. package/dist/runtime/components/APasswordResetRequestModal.d.vue.ts +2 -2
  30. package/dist/runtime/components/APasswordResetRequestModal.vue.d.ts +2 -2
  31. package/dist/runtime/components/ASetPasswordCard.d.vue.ts +1 -1
  32. package/dist/runtime/components/ASetPasswordCard.vue.d.ts +1 -1
  33. package/dist/runtime/components/aware/AArea.d.vue.ts +1 -1
  34. package/dist/runtime/components/aware/AArea.vue.d.ts +1 -1
  35. package/dist/runtime/components/aware/ACalendar.d.vue.ts +1 -1
  36. package/dist/runtime/components/aware/ACalendar.vue.d.ts +1 -1
  37. package/dist/runtime/components/aware/AFileUpload.d.vue.ts +1 -1
  38. package/dist/runtime/components/aware/AFileUpload.vue.d.ts +1 -1
  39. package/dist/runtime/components/aware/AInput.d.vue.ts +1 -1
  40. package/dist/runtime/components/aware/AInput.vue.d.ts +1 -1
  41. package/dist/runtime/components/aware/AMedia.d.vue.ts +1 -1
  42. package/dist/runtime/components/aware/AMedia.vue.d.ts +1 -1
  43. package/dist/runtime/components/aware/AScroll.d.vue.ts +1 -1
  44. package/dist/runtime/components/aware/AScroll.vue.d.ts +1 -1
  45. package/dist/runtime/components/aware/ASlider.d.vue.ts +1 -1
  46. package/dist/runtime/components/aware/ASlider.vue.d.ts +1 -1
  47. package/dist/runtime/components/aware/ATable.d.vue.ts +1 -1
  48. package/dist/runtime/components/aware/ATable.vue.d.ts +1 -1
  49. package/dist/runtime/components/aware/ATabs.d.vue.ts +1 -1
  50. package/dist/runtime/components/aware/ATabs.vue.d.ts +1 -1
  51. package/dist/runtime/components/aware/ATextarea.d.vue.ts +1 -1
  52. package/dist/runtime/components/aware/ATextarea.vue.d.ts +1 -1
  53. package/dist/runtime/components/aware/ATree.d.vue.ts +1 -1
  54. package/dist/runtime/components/aware/ATree.vue.d.ts +1 -1
  55. package/dist/runtime/components/docs/ADocsNavigation.d.vue.ts +1 -1
  56. package/dist/runtime/components/docs/ADocsNavigation.vue.d.ts +1 -1
  57. package/dist/runtime/components/docs/ADocsSearch.d.vue.ts +4 -4
  58. package/dist/runtime/components/docs/ADocsSearch.vue.d.ts +4 -4
  59. package/dist/runtime/components/docs/ADocsSearchButton.d.vue.ts +2 -2
  60. package/dist/runtime/components/docs/ADocsSearchButton.vue.d.ts +2 -2
  61. package/dist/runtime/components/docs/ADocsToc.d.vue.ts +1 -1
  62. package/dist/runtime/components/docs/ADocsToc.vue.d.ts +1 -1
  63. package/dist/runtime/components/editor/AColorPalettePopover.d.vue.ts +2 -2
  64. package/dist/runtime/components/editor/AColorPalettePopover.vue.d.ts +2 -2
  65. package/dist/runtime/components/editor/AIconPickerPopover.d.vue.ts +2 -2
  66. package/dist/runtime/components/editor/AIconPickerPopover.vue.d.ts +2 -2
  67. package/dist/runtime/components/editor/ALocationPickerPopover.d.vue.ts +2 -2
  68. package/dist/runtime/components/editor/ALocationPickerPopover.vue.d.ts +2 -2
  69. package/dist/runtime/components/registry/APluginCapabilityDialog.d.vue.ts +4 -4
  70. package/dist/runtime/components/registry/APluginCapabilityDialog.vue +1 -1
  71. package/dist/runtime/components/registry/APluginCapabilityDialog.vue.d.ts +4 -4
  72. package/dist/runtime/components/renderers/AProseRenderer.d.vue.ts +4 -4
  73. package/dist/runtime/components/renderers/AProseRenderer.vue.d.ts +4 -4
  74. package/dist/runtime/components/renderers/sheets/ASheetsCell.d.vue.ts +4 -4
  75. package/dist/runtime/components/renderers/sheets/ASheetsCell.vue.d.ts +4 -4
  76. package/dist/runtime/components/renderers/sheets/ASheetsGrid.d.vue.ts +2 -2
  77. package/dist/runtime/components/renderers/sheets/ASheetsGrid.vue.d.ts +2 -2
  78. package/dist/runtime/components/renderers/sheets/ASheetsMobileActionBar.d.vue.ts +6 -6
  79. package/dist/runtime/components/renderers/sheets/ASheetsMobileActionBar.vue.d.ts +6 -6
  80. package/dist/runtime/components/renderers/sheets/ASheetsToolbar.d.vue.ts +4 -4
  81. package/dist/runtime/components/renderers/sheets/ASheetsToolbar.vue.d.ts +4 -4
  82. package/dist/runtime/components/shell/ADocPanelSettings.d.vue.ts +1 -1
  83. package/dist/runtime/components/shell/ADocPanelSettings.vue.d.ts +1 -1
  84. package/dist/runtime/components/shell/AUserProfilePopover.d.vue.ts +1 -1
  85. package/dist/runtime/components/shell/AUserProfilePopover.vue.d.ts +1 -1
  86. package/dist/runtime/components/shell/AWelcomeScreen.d.vue.ts +4 -4
  87. package/dist/runtime/components/shell/AWelcomeScreen.vue +77 -58
  88. package/dist/runtime/components/shell/AWelcomeScreen.vue.d.ts +4 -4
  89. package/dist/runtime/composables/useAbraAdmin.d.ts +131 -4
  90. package/dist/runtime/composables/useAbraAdmin.js +136 -36
  91. package/dist/runtime/composables/useInvites.d.ts +7 -0
  92. package/dist/runtime/plugin-abracadabra.client.js +44 -3
  93. package/dist/runtime/server/api/_abracadabra/spaces.get.d.ts +1 -1
  94. package/dist/runtime/server/plugins/abracadabra-service.js +1 -0
  95. package/dist/runtime/types.d.ts +2 -0
  96. package/dist/types.d.mts +6 -2
  97. package/package.json +20 -20
@@ -14,6 +14,9 @@ export interface Invite {
14
14
  max_uses: number | null;
15
15
  expires_at: number | null;
16
16
  created_at: number;
17
+ created_by: string | null;
18
+ /** True once the code has been revoked — it can no longer be redeemed. */
19
+ revoked: boolean;
17
20
  }
18
21
  declare function refresh(): Promise<void>;
19
22
  declare function create(opts?: {
@@ -32,6 +35,8 @@ export declare function useInvites(): {
32
35
  max_uses: number | null;
33
36
  expires_at: number | null;
34
37
  created_at: number;
38
+ created_by: string | null;
39
+ revoked: boolean;
35
40
  }[], Invite[] | {
36
41
  code: string;
37
42
  role: string;
@@ -39,6 +44,8 @@ export declare function useInvites(): {
39
44
  max_uses: number | null;
40
45
  expires_at: number | null;
41
46
  created_at: number;
47
+ created_by: string | null;
48
+ revoked: boolean;
42
49
  }[]>;
43
50
  /** Whether invite list is loading. */
44
51
  loading: import("vue").Ref<boolean, boolean>;
@@ -768,13 +768,25 @@ export default defineNuxtPlugin({
768
768
  }
769
769
  }
770
770
  }
771
+ function _normalizeInvite(r) {
772
+ return {
773
+ code: r.code,
774
+ role: r.role,
775
+ max_uses: r.maxUses ?? 0,
776
+ uses: r.useCount ?? 0,
777
+ created_at: r.createdAt ?? 0,
778
+ expires_at: r.expiresAt ?? null,
779
+ created_by: r.createdBy ?? null,
780
+ revoked: !!r.revoked
781
+ };
782
+ }
771
783
  async function createInvite(opts) {
772
784
  if (!client.value) throw new Error("Not connected");
773
- return client.value.createInvite(opts);
785
+ return _normalizeInvite(await client.value.createInvite(opts));
774
786
  }
775
787
  async function listInvites() {
776
788
  if (!client.value) throw new Error("Not connected");
777
- return client.value.listInvites();
789
+ return (await client.value.listInvites()).map(_normalizeInvite);
778
790
  }
779
791
  async function revokeInvite(code) {
780
792
  if (!client.value) throw new Error("Not connected");
@@ -1062,6 +1074,12 @@ export default defineNuxtPlugin({
1062
1074
  document: _doc,
1063
1075
  websocketProvider: wsp,
1064
1076
  client: _client,
1077
+ // The provider lives for the whole app lifetime on one socket
1078
+ // that rarely drops, so it never re-issues sync-step-1 on its
1079
+ // own — doc-tree entries written by an MCP / sibling client
1080
+ // stay invisible until a full page reload. Periodically re-diff
1081
+ // against the server to surface them.
1082
+ forceSyncInterval: 3e4,
1065
1083
  // Route every WS auth handshake (initial + reconnects) through
1066
1084
  // the TokenManager so an expired JWT is silently refreshed via
1067
1085
  // the device session before being sent. Without this, a tab
@@ -1352,6 +1370,13 @@ export default defineNuxtPlugin({
1352
1370
  _wsp.connect();
1353
1371
  } catch {
1354
1372
  }
1373
+ return;
1374
+ }
1375
+ if (status.value === "connected") {
1376
+ try {
1377
+ provider.value?.forceSync();
1378
+ } catch {
1379
+ }
1355
1380
  }
1356
1381
  }
1357
1382
  window.addEventListener("focus", _kickConnection);
@@ -1360,10 +1385,26 @@ export default defineNuxtPlugin({
1360
1385
  if (document.visibilityState === "visible") _kickConnection();
1361
1386
  });
1362
1387
  loadServers();
1388
+ let deepLinkServer = "";
1389
+ try {
1390
+ const qp = new URLSearchParams(window.location.search);
1391
+ const hp = new URLSearchParams(window.location.hash.replace(/^#/, ""));
1392
+ const raw = (qp.get("server") || hp.get("server") || "").trim();
1393
+ if (raw) {
1394
+ let u = raw;
1395
+ if (!u.startsWith("http://") && !u.startsWith("https://")) u = "https://" + u;
1396
+ deepLinkServer = u.replace(/\/$/, "");
1397
+ }
1398
+ } catch {
1399
+ }
1363
1400
  const storedServer = localStorage.getItem(CURRENT_SERVER_KEY);
1364
- const initialUrl = storedServer && savedServers.value.some((s) => s.url === storedServer) ? storedServer : currentServerUrl.value || savedServers.value[0]?.url || defaultUrl;
1401
+ const initialUrl = deepLinkServer || (storedServer && savedServers.value.some((s) => s.url === storedServer) ? storedServer : currentServerUrl.value || savedServers.value[0]?.url || defaultUrl);
1365
1402
  if (initialUrl !== currentServerUrl.value) currentServerUrl.value = initialUrl;
1366
1403
  _initPromise = init(initialUrl);
1404
+ if (deepLinkServer && !savedServers.value.some((s) => s.url === deepLinkServer)) {
1405
+ void addServer(deepLinkServer).catch(() => {
1406
+ });
1407
+ }
1367
1408
  _initPromise.then(async () => {
1368
1409
  if (!provider.value) return;
1369
1410
  const ctx = { abracadabra: abra };
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<Omit<import("h3").EventHandlerRequest, "body">, Promise<unknown[] | never[]>>;
1
+ declare const _default: import("h3").EventHandler<Omit<import("h3").EventHandlerRequest, "body">, Promise<never[] | unknown[]>>;
2
2
  export default _default;
@@ -83,6 +83,7 @@ async function loadOrCreateAutoIdentity(opts) {
83
83
  return identity;
84
84
  }
85
85
  export default defineNitroPlugin(async (nitroApp) => {
86
+ if (import.meta.prerender) return;
86
87
  const config = useRuntimeConfig();
87
88
  const abraConfig = config.abracadabra;
88
89
  const storage = useStorage();
@@ -341,6 +341,8 @@ export interface InviteInfo {
341
341
  created_at: number;
342
342
  expires_at: number | null;
343
343
  created_by: string | null;
344
+ /** True once the code has been revoked — it can no longer be redeemed. */
345
+ revoked: boolean;
344
346
  }
345
347
  export interface SavedServer {
346
348
  url: string;
package/dist/types.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { type AbracadabraPlugin, type AbracadabraState, type CachedTreeNode, type DocCacheAPI, type DocPageMeta, type RunnerCleanup, type ServerRunnerContext, type ServerRunnerDefinition, type TreeEntry, type UserMetaField } from '../dist/runtime/types.js'
1
+ export { type AbracadabraPlugin, type AbracadabraState, type CachedTreeNode, type DocCacheAPI, type DocPageMeta, type InviteInfo, type RunnerCleanup, type ServerRunnerContext, type ServerRunnerDefinition, type SpaceMeta, type TreeEntry, type UserMetaField } from '../dist/runtime/types.js'
2
2
 
3
3
  export { type AbracadabraLocale } from '../dist/runtime/locale.js'
4
4
 
@@ -12,10 +12,14 @@ export { type ParsedMessage, type TextSegment, type parseMessageContent, type pr
12
12
 
13
13
  export { type DupEntry, type duplicateDocContent, type duplicateDocTree } from '../dist/runtime/utils/duplicateDocContent.js'
14
14
 
15
- export { type AuditLogEntry, type AuditQueryOpts, type AuditVerifyResult, type DocSearchHit, type ReadyzStatus } from '@abraca/dabra'
15
+ export { type AdminConfigField, type AuditLogEntry, type AuditQueryOpts, type AuditVerifyResult, type DocSearchHit, type EnvSnapshotResponse, type ReadyzStatus } from '@abraca/dabra'
16
16
 
17
17
  export { type ServerTrashEntry } from '../dist/runtime/composables/useServerTrash.js'
18
18
 
19
+ export { type Invite } from '../dist/runtime/composables/useInvites.js'
20
+
21
+ export { type AdminStorageStats, type AdminUploadList, type AdminUploadRow, type AdminUserDocRow, type AdminUserRow } from '../dist/runtime/composables/useAbraAdmin.js'
22
+
19
23
  export { type SlugMap, type SlugMapEntry, type buildSlugMap, type isUUID, type slugify } from '../dist/runtime/utils/slugify.js'
20
24
 
21
25
  export { type avatarBorderStyle, type avatarGradient, type avatarStyleFromName } from '../dist/runtime/utils/avatarStyle.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abraca/nuxt",
3
- "version": "2.4.0",
3
+ "version": "2.5.1",
4
4
  "description": "First-class Nuxt module for the Abracadabra CRDT collaboration platform",
5
5
  "repository": "abracadabra/abracadabra-nuxt",
6
6
  "license": "MIT",
@@ -26,16 +26,16 @@
26
26
  "access": "public"
27
27
  },
28
28
  "dependencies": {
29
- "@nuxt/kit": "^4.4.4",
29
+ "@nuxt/kit": "^4.4.6",
30
30
  "@vueuse/core": "^14.3.0",
31
31
  "defu": "^6.1.7",
32
32
  "nanoevents": "^9.1.0"
33
33
  },
34
34
  "peerDependencies": {
35
- "@abraca/dabra": "^2.3.0",
36
- "@abraca/convert": "^2.3.0",
37
- "@abraca/plugin": "^2.3.0",
38
- "@abraca/schema": "^2.3.0",
35
+ "@abraca/convert": "^2.5.0",
36
+ "@abraca/dabra": "^2.5.0",
37
+ "@abraca/plugin": "^2.5.0",
38
+ "@abraca/schema": "^2.5.0",
39
39
  "@codemirror/autocomplete": "^6.18.0",
40
40
  "@codemirror/commands": "^6.7.0",
41
41
  "@codemirror/lang-css": "^6.3.1",
@@ -46,7 +46,6 @@
46
46
  "@codemirror/search": "^6.5.0",
47
47
  "@codemirror/state": "^6.6.0",
48
48
  "@codemirror/view": "^6.42.0",
49
- "y-codemirror.next": "^0.3.5",
50
49
  "@noble/ed25519": "^3.1.0",
51
50
  "@noble/hashes": "^2.2.0",
52
51
  "@nuxt/ui": "^3.0.0",
@@ -78,6 +77,7 @@
78
77
  "nuxt": "^4.0.0",
79
78
  "three": "^0.184.0",
80
79
  "vue": "^3.4.0",
80
+ "y-codemirror.next": "^0.3.5",
81
81
  "yjs": "^13.0.0"
82
82
  },
83
83
  "peerDependenciesMeta": {
@@ -137,9 +137,9 @@
137
137
  }
138
138
  },
139
139
  "devDependencies": {
140
- "@abraca/dabra": "^2.3.0",
141
- "@abraca/convert": "^2.3.0",
142
- "@abraca/plugin": "^2.3.0",
140
+ "@abraca/convert": "^2.5.0",
141
+ "@abraca/dabra": "^2.5.0",
142
+ "@abraca/plugin": "^2.5.0",
143
143
  "@codemirror/autocomplete": "^6.18.0",
144
144
  "@codemirror/commands": "^6.7.0",
145
145
  "@codemirror/lang-css": "^6.3.1",
@@ -150,35 +150,35 @@
150
150
  "@codemirror/search": "^6.5.0",
151
151
  "@codemirror/state": "^6.6.0",
152
152
  "@codemirror/view": "^6.42.0",
153
- "y-codemirror.next": "^0.3.5",
154
- "@iconify-json/lucide": "^1.2.105",
153
+ "@iconify-json/lucide": "^1.2.108",
155
154
  "@noble/ed25519": "^3.1.0",
156
155
  "@noble/hashes": "^2.2.0",
157
156
  "@nuxt/eslint-config": "^1.15.2",
158
157
  "@nuxt/module-builder": "^1.0.2",
159
- "@nuxt/schema": "^4.4.4",
158
+ "@nuxt/schema": "^4.4.6",
160
159
  "@nuxt/test-utils": "^4.0.3",
161
160
  "@nuxt/ui": "^4.7.1",
162
161
  "@playwright/test": "^1.59.1",
163
- "@tiptap/core": "^3.22.5",
164
- "@tiptap/extension-collaboration": "^3.22.5",
165
- "@tiptap/extension-collaboration-caret": "^3.22.5",
166
- "@tiptap/vue-3": "^3.22.5",
162
+ "@tiptap/core": "^3.23.5",
163
+ "@tiptap/extension-collaboration": "^3.23.5",
164
+ "@tiptap/extension-collaboration-caret": "^3.23.5",
165
+ "@tiptap/vue-3": "^3.23.5",
167
166
  "@types/d3-force": "^3.0.10",
168
167
  "@types/node": "latest",
169
168
  "@types/ws": "^8.18.1",
170
169
  "@vue/test-utils": "^2.4.10",
171
170
  "changelogen": "^0.6.2",
172
171
  "d3-force": "^3.0.0",
173
- "eslint": "^10.3.0",
172
+ "eslint": "^10.4.0",
174
173
  "happy-dom": "^20.9.0",
175
- "nuxt": "^4.4.4",
174
+ "nuxt": "^4.4.6",
176
175
  "tslib": "^2.8.1",
177
176
  "typescript": "~6.0.3",
178
177
  "vitest": "^4.1.5",
179
178
  "vue": "^3.5.34",
180
- "vue-tsc": "^3.2.8",
179
+ "vue-tsc": "^3.3.1",
181
180
  "ws": "^8.20.0",
181
+ "y-codemirror.next": "^0.3.5",
182
182
  "yjs": "^13.6.30"
183
183
  },
184
184
  "scripts": {