@abraca/nuxt 2.18.0 → 2.20.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.
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=4.0.0"
6
6
  },
7
- "version": "2.18.0",
7
+ "version": "2.20.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
12
12
  awareness: boolean;
13
13
  tag: "video" | "audio";
14
14
  live: boolean;
15
- total: boolean;
16
15
  controls: boolean;
16
+ total: boolean;
17
17
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
18
  declare const _default: typeof __VLS_export;
19
19
  export default _default;
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
12
12
  awareness: boolean;
13
13
  tag: "video" | "audio";
14
14
  live: boolean;
15
- total: boolean;
16
15
  controls: boolean;
16
+ total: boolean;
17
17
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
18
  declare const _default: typeof __VLS_export;
19
19
  export default _default;
@@ -239,8 +239,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import
239
239
  autofocus: boolean;
240
240
  loading: boolean;
241
241
  dismissible: boolean;
242
- colorMode: boolean;
243
242
  overlay: boolean;
243
+ colorMode: boolean;
244
244
  fullscreen: boolean;
245
245
  modal: boolean;
246
246
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, __VLS_Slots>;
@@ -239,8 +239,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import
239
239
  autofocus: boolean;
240
240
  loading: boolean;
241
241
  dismissible: boolean;
242
- colorMode: boolean;
243
242
  overlay: boolean;
243
+ colorMode: boolean;
244
244
  fullscreen: boolean;
245
245
  modal: boolean;
246
246
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, __VLS_Slots>;
@@ -157,6 +157,7 @@ async function handleDelete(id) {
157
157
 
158
158
  <div
159
159
  v-if="spaces.length === 0 && !loading"
160
+ key="spaces-empty"
160
161
  class="text-sm text-(--ui-text-muted) text-center py-8"
161
162
  >
162
163
  No spaces found.
@@ -164,6 +165,7 @@ async function handleDelete(id) {
164
165
 
165
166
  <div
166
167
  v-if="loading"
168
+ key="spaces-loading"
167
169
  class="space-y-2"
168
170
  >
169
171
  <USkeleton
@@ -36,13 +36,17 @@ export function useCommandPalette() {
36
36
  const treeMap = doc.value.getMap("doc-tree");
37
37
  const entries = [];
38
38
  treeMap.forEach((entry, id) => {
39
- if (!entry.label) return;
40
- if (q && !entry.label.toLowerCase().includes(q)) return;
39
+ const isYMap = entry && typeof entry.get === "function";
40
+ const label = isYMap ? entry.get("label") : entry?.label;
41
+ const type = isYMap ? entry.get("type") : entry?.type;
42
+ const trashed = isYMap ? entry.get("trashed") : entry?.trashed;
43
+ if (!label || trashed) return;
44
+ if (q && !label.toLowerCase().includes(q)) return;
41
45
  entries.push({
42
46
  id: `doc:${id}`,
43
- label: entry.label,
47
+ label,
44
48
  icon: "i-lucide-file-text",
45
- suffix: entry.type,
49
+ suffix: type,
46
50
  onClick: () => {
47
51
  trackRecentDoc(id);
48
52
  navigateTo(getDocUrl(id));
@@ -9,7 +9,7 @@ export function useSpaces() {
9
9
  const entry = abra.savedServers?.value?.find?.((s) => s.url === abra.currentServerUrl?.value);
10
10
  const entryDocId = entry?.entryDocId;
11
11
  if (!entryDocId) return spaces.value[0] ?? null;
12
- return spaces.value.find((s) => s.doc_id === entryDocId) ?? spaces.value[0] ?? null;
12
+ return spaces.value.find((s) => s.id === entryDocId) ?? spaces.value[0] ?? null;
13
13
  });
14
14
  async function refresh() {
15
15
  loading.value = true;
@@ -592,9 +592,22 @@ export default defineNuxtPlugin({
592
592
  _initPromise = init(url);
593
593
  await _initPromise;
594
594
  }
595
- async function switchSpace(serverUrl, spaceDocId2) {
595
+ async function switchSpace(serverUrl, spaceRootId) {
596
596
  if (serverUrl !== currentServerUrl.value) await switchServer(serverUrl);
597
- await navigateTo(`${abraConfig.docBasePath ?? "/doc"}/${spaceDocId2}`);
597
+ const idx = savedServers.value.findIndex((s) => s.url === serverUrl);
598
+ const alreadyActive = idx >= 0 && savedServers.value[idx].entryDocId === spaceRootId;
599
+ if (idx >= 0 && !alreadyActive) {
600
+ savedServers.value[idx] = { ...savedServers.value[idx], entryDocId: spaceRootId };
601
+ persistServers();
602
+ }
603
+ if (!alreadyActive) {
604
+ addLog(`Switching space \u2192 ${spaceRootId}`, "connection");
605
+ _teardown();
606
+ _initPromise = null;
607
+ _initPromise = init(serverUrl);
608
+ await _initPromise;
609
+ }
610
+ await navigateTo(abraConfig.docBasePath ?? "/doc");
598
611
  }
599
612
  async function claimAccount() {
600
613
  if (!client.value || !keystore.value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abraca/nuxt",
3
- "version": "2.18.0",
3
+ "version": "2.20.0",
4
4
  "description": "First-class Nuxt module for the Abracadabra CRDT collaboration platform",
5
5
  "repository": "abracadabra/abracadabra-nuxt",
6
6
  "license": "MIT",