@abraca/nuxt 2.42.0 → 2.43.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.42.0",
7
+ "version": "2.43.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -1,3 +1,4 @@
1
+ import type * as Y from 'yjs';
1
2
  type __VLS_Props = {
2
3
  collapsed?: boolean;
3
4
  editable?: boolean;
@@ -8,6 +9,17 @@ type __VLS_Props = {
8
9
  * root as before — so this is a purely additive opt-in filter.
9
10
  */
10
11
  rootId?: string | null;
12
+ /**
13
+ * Render the tree from an explicitly supplied Y.Doc — typically a sibling
14
+ * space's child doc loaded via `provider.loadChild(spaceId)` — instead of
15
+ * the active entry doc. The supplied doc's OWN `doc-tree` map is used; its
16
+ * `parentId == null` entries (plus anything parented to `rootId`) become
17
+ * the roots, and the doc's self-entry (`rootId`) is hidden. This lets an
18
+ * admin browse another space's subtree without re-pointing the whole
19
+ * provider. When null (default) the tree reads the active entry doc as
20
+ * before, so this is purely additive.
21
+ */
22
+ sourceDoc?: Y.Doc | null;
11
23
  };
12
24
  declare var __VLS_39: {};
13
25
  type __VLS_Slots = {} & {
@@ -24,6 +36,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
24
36
  }>, {
25
37
  editable: boolean;
26
38
  rootId: string | null;
39
+ sourceDoc: Y.Doc | null;
27
40
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
41
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
42
  declare const _default: typeof __VLS_export;
@@ -11,7 +11,8 @@ const props = defineProps({
11
11
  collapsed: { type: Boolean, required: false },
12
12
  editable: { type: Boolean, required: false, default: true },
13
13
  selectedId: { type: [String, null], required: false },
14
- rootId: { type: [String, null], required: false, default: null }
14
+ rootId: { type: [String, null], required: false, default: null },
15
+ sourceDoc: { type: null, required: false, default: null }
15
16
  });
16
17
  const emit = defineEmits(["navigate", "create"]);
17
18
  const { doc, spaceDocId, isReady, provider, client, userName } = useAbracadabra();
@@ -30,7 +31,11 @@ function leaveRoom() {
30
31
  const toast = useToast();
31
32
  const appConfig = useAppConfig();
32
33
  const presenceNeutral = computed(() => appConfig.ui?.colors?.neutral ?? "zinc");
33
- const treeMap = useSyncedMap(doc, "doc-tree");
34
+ const treeSourceDoc = shallowRef(props.sourceDoc ?? doc.value);
35
+ watch([() => props.sourceDoc, doc], ([src, d]) => {
36
+ treeSourceDoc.value = src ?? d;
37
+ }, { immediate: true });
38
+ const treeMap = useSyncedMap(treeSourceDoc, "doc-tree");
34
39
  const structureHash = computed(() => {
35
40
  let h = 0;
36
41
  const data = treeMap.data;
@@ -54,7 +59,8 @@ const treeItems = computed(() => {
54
59
  const raw = toRaw(treeMap.data);
55
60
  const ROOT = "@root";
56
61
  const scopeRoot = props.rootId ?? null;
57
- const isTopLevel = (p) => scopeRoot != null ? p === scopeRoot : p == null || p === sid;
62
+ const usingSource = props.sourceDoc != null;
63
+ const isTopLevel = (p) => usingSource ? p == null || p === scopeRoot : scopeRoot != null ? p === scopeRoot : p == null || p === sid;
58
64
  const childrenByParent = /* @__PURE__ */ new Map();
59
65
  for (const id in raw) {
60
66
  if (id === sid || id === scopeRoot) continue;
@@ -1,3 +1,4 @@
1
+ import type * as Y from 'yjs';
1
2
  type __VLS_Props = {
2
3
  collapsed?: boolean;
3
4
  editable?: boolean;
@@ -8,6 +9,17 @@ type __VLS_Props = {
8
9
  * root as before — so this is a purely additive opt-in filter.
9
10
  */
10
11
  rootId?: string | null;
12
+ /**
13
+ * Render the tree from an explicitly supplied Y.Doc — typically a sibling
14
+ * space's child doc loaded via `provider.loadChild(spaceId)` — instead of
15
+ * the active entry doc. The supplied doc's OWN `doc-tree` map is used; its
16
+ * `parentId == null` entries (plus anything parented to `rootId`) become
17
+ * the roots, and the doc's self-entry (`rootId`) is hidden. This lets an
18
+ * admin browse another space's subtree without re-pointing the whole
19
+ * provider. When null (default) the tree reads the active entry doc as
20
+ * before, so this is purely additive.
21
+ */
22
+ sourceDoc?: Y.Doc | null;
11
23
  };
12
24
  declare var __VLS_39: {};
13
25
  type __VLS_Slots = {} & {
@@ -24,6 +36,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
24
36
  }>, {
25
37
  editable: boolean;
26
38
  rootId: string | null;
39
+ sourceDoc: Y.Doc | null;
27
40
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
41
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
42
  declare const _default: typeof __VLS_export;
@@ -94,16 +94,16 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
94
94
  editor: import("vue").ComputedRef<any>;
95
95
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
96
96
  rename: (label: string) => any;
97
- ready: () => any;
98
97
  "update:modelValue": (value: any) => any;
99
98
  updateMeta: (patch: Partial<DocPageMeta>) => any;
100
99
  update: (content: any) => any;
100
+ ready: () => any;
101
101
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
102
102
  onRename?: ((label: string) => any) | undefined;
103
- onReady?: (() => any) | undefined;
104
103
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
105
104
  onUpdateMeta?: ((patch: Partial<DocPageMeta>) => any) | undefined;
106
105
  onUpdate?: ((content: any) => any) | undefined;
106
+ onReady?: (() => any) | undefined;
107
107
  }>, {
108
108
  contentType: "json" | "html" | "markdown";
109
109
  editable: boolean;
@@ -94,16 +94,16 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
94
94
  editor: import("vue").ComputedRef<any>;
95
95
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
96
96
  rename: (label: string) => any;
97
- ready: () => any;
98
97
  "update:modelValue": (value: any) => any;
99
98
  updateMeta: (patch: Partial<DocPageMeta>) => any;
100
99
  update: (content: any) => any;
100
+ ready: () => any;
101
101
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
102
102
  onRename?: ((label: string) => any) | undefined;
103
- onReady?: (() => any) | undefined;
104
103
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
105
104
  onUpdateMeta?: ((patch: Partial<DocPageMeta>) => any) | undefined;
106
105
  onUpdate?: ((content: any) => any) | undefined;
106
+ onReady?: (() => any) | undefined;
107
107
  }>, {
108
108
  contentType: "json" | "html" | "markdown";
109
109
  editable: boolean;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
22
22
  }>, {
23
23
  subtitle: string;
24
24
  title: string;
25
- success: boolean;
26
25
  loading: boolean;
26
+ success: boolean;
27
27
  initialToken: string;
28
28
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
29
  declare const _default: typeof __VLS_export;
@@ -22,8 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
22
22
  }>, {
23
23
  subtitle: string;
24
24
  title: string;
25
- success: boolean;
26
25
  loading: boolean;
26
+ success: boolean;
27
27
  initialToken: string;
28
28
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
29
  declare const _default: typeof __VLS_export;
@@ -18,9 +18,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
18
18
  }>, {
19
19
  subtitle: string;
20
20
  title: string;
21
- success: boolean;
22
21
  minLength: number;
23
22
  loading: boolean;
23
+ success: boolean;
24
24
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
25
  declare const _default: typeof __VLS_export;
26
26
  export default _default;
@@ -18,9 +18,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
18
18
  }>, {
19
19
  subtitle: string;
20
20
  title: string;
21
- success: boolean;
22
21
  minLength: number;
23
22
  loading: boolean;
23
+ success: boolean;
24
24
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
25
  declare const _default: typeof __VLS_export;
26
26
  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
- controls: boolean;
16
15
  total: boolean;
16
+ controls: 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
- controls: boolean;
16
15
  total: boolean;
16
+ controls: boolean;
17
17
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
18
  declare const _default: typeof __VLS_export;
19
19
  export default _default;
@@ -10,14 +10,14 @@ type __VLS_Props = {
10
10
  };
11
11
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, Record<PropertyKey, unknown>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
12
  rename: (label: string) => any;
13
- ready: () => any;
14
13
  updateMeta: (patch: Partial<DocPageMeta>) => any;
15
14
  update: (content: any) => any;
15
+ ready: () => any;
16
16
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
17
  onRename?: ((label: string) => any) | undefined;
18
- onReady?: (() => any) | undefined;
19
18
  onUpdateMeta?: ((patch: Partial<DocPageMeta>) => any) | undefined;
20
19
  onUpdate?: ((content: any) => any) | undefined;
20
+ onReady?: (() => any) | undefined;
21
21
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
22
  declare const _default: typeof __VLS_export;
23
23
  export default _default;
@@ -10,14 +10,14 @@ type __VLS_Props = {
10
10
  };
11
11
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, Record<PropertyKey, unknown>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
12
  rename: (label: string) => any;
13
- ready: () => any;
14
13
  updateMeta: (patch: Partial<DocPageMeta>) => any;
15
14
  update: (content: any) => any;
15
+ ready: () => any;
16
16
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
17
  onRename?: ((label: string) => any) | undefined;
18
- onReady?: (() => any) | undefined;
19
18
  onUpdateMeta?: ((patch: Partial<DocPageMeta>) => any) | undefined;
20
19
  onUpdate?: ((content: any) => any) | undefined;
20
+ onReady?: (() => any) | undefined;
21
21
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
22
  declare const _default: typeof __VLS_export;
23
23
  export default _default;
@@ -15,7 +15,7 @@ type ConnectionStatusValue = 'disconnected' | 'connecting' | 'connected' | 'offl
15
15
  */
16
16
  export declare function useConnectionStatus(status?: MaybeRef<ConnectionStatusValue | string | undefined>, synced?: MaybeRef<boolean | undefined>): {
17
17
  label: import("vue").ComputedRef<string>;
18
- color: import("vue").ComputedRef<"error" | "success" | "warning">;
18
+ color: import("vue").ComputedRef<"error" | "warning" | "success">;
19
19
  icon: import("vue").ComputedRef<"i-lucide-cloud-off" | "i-lucide-cloud-check" | "i-lucide-cloud">;
20
20
  };
21
21
  export {};
@@ -1,2 +1,2 @@
1
- declare const _default: import("#app").RouteMiddleware;
1
+ declare const _default: any;
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
1
+ declare const _default: any;
2
2
  export default _default;
3
3
  declare module '#app' {
4
4
  interface NuxtApp {
@@ -1,2 +1,2 @@
1
- declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
1
+ declare const _default: any;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
1
+ declare const _default: any;
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abraca/nuxt",
3
- "version": "2.42.0",
3
+ "version": "2.43.0",
4
4
  "description": "First-class Nuxt module for the Abracadabra CRDT collaboration platform",
5
5
  "repository": "abracadabra/abracadabra-nuxt",
6
6
  "license": "MIT",