@abraca/nuxt 2.10.0 → 2.13.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 (127) hide show
  1. package/dist/module.d.mts +14 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +9 -0
  4. package/dist/runtime/assets/editor.css +1 -1
  5. package/dist/runtime/components/AConnectionBadge.d.vue.ts +29 -0
  6. package/dist/runtime/components/AConnectionBadge.vue +79 -0
  7. package/dist/runtime/components/AConnectionBadge.vue.d.ts +29 -0
  8. package/dist/runtime/components/ADocPickerModal.d.vue.ts +31 -0
  9. package/dist/runtime/components/ADocPickerModal.vue +191 -0
  10. package/dist/runtime/components/ADocPickerModal.vue.d.ts +31 -0
  11. package/dist/runtime/components/ADocumentTree.vue +65 -0
  12. package/dist/runtime/components/AEditor.d.vue.ts +19 -12
  13. package/dist/runtime/components/AEditor.vue +243 -165
  14. package/dist/runtime/components/AEditor.vue.d.ts +19 -12
  15. package/dist/runtime/components/AEncryptionModePicker.d.vue.ts +33 -0
  16. package/dist/runtime/components/AEncryptionModePicker.vue +211 -0
  17. package/dist/runtime/components/AEncryptionModePicker.vue.d.ts +33 -0
  18. package/dist/runtime/components/AModalShell.d.vue.ts +48 -0
  19. package/dist/runtime/components/AModalShell.vue +105 -0
  20. package/dist/runtime/components/AModalShell.vue.d.ts +48 -0
  21. package/dist/runtime/components/ANodePanel.d.vue.ts +17 -7
  22. package/dist/runtime/components/ANodePanel.vue +550 -451
  23. package/dist/runtime/components/ANodePanel.vue.d.ts +17 -7
  24. package/dist/runtime/components/ANodePanelHeader.d.vue.ts +20 -10
  25. package/dist/runtime/components/ANodePanelHeader.vue +17 -3
  26. package/dist/runtime/components/ANodePanelHeader.vue.d.ts +20 -10
  27. package/dist/runtime/components/ANodeSettingsPanel.d.vue.ts +2 -0
  28. package/dist/runtime/components/ANodeSettingsPanel.vue +21 -1
  29. package/dist/runtime/components/ANodeSettingsPanel.vue.d.ts +2 -0
  30. package/dist/runtime/components/ASnapshotPreviewModal.d.vue.ts +33 -0
  31. package/dist/runtime/components/ASnapshotPreviewModal.vue +430 -0
  32. package/dist/runtime/components/ASnapshotPreviewModal.vue.d.ts +33 -0
  33. package/dist/runtime/components/ATagsEditor.d.vue.ts +19 -0
  34. package/dist/runtime/components/ATagsEditor.vue +60 -0
  35. package/dist/runtime/components/ATagsEditor.vue.d.ts +19 -0
  36. package/dist/runtime/components/aware/AMedia.d.vue.ts +1 -1
  37. package/dist/runtime/components/aware/AMedia.vue.d.ts +1 -1
  38. package/dist/runtime/components/chat/AChatInput.d.vue.ts +11 -6
  39. package/dist/runtime/components/chat/AChatInput.vue +33 -2
  40. package/dist/runtime/components/chat/AChatInput.vue.d.ts +11 -6
  41. package/dist/runtime/components/chat/AChatList.d.vue.ts +12 -0
  42. package/dist/runtime/components/chat/AChatList.vue +76 -32
  43. package/dist/runtime/components/chat/AChatList.vue.d.ts +12 -0
  44. package/dist/runtime/components/chat/AChatMessages.d.vue.ts +4 -0
  45. package/dist/runtime/components/chat/AChatMessages.vue +57 -4
  46. package/dist/runtime/components/chat/AChatMessages.vue.d.ts +4 -0
  47. package/dist/runtime/components/chat/AChatPanel.d.vue.ts +6 -2
  48. package/dist/runtime/components/chat/AChatPanel.vue +17 -1
  49. package/dist/runtime/components/chat/AChatPanel.vue.d.ts +6 -2
  50. package/dist/runtime/components/chat/ANodeChatPanel.vue +1 -1
  51. package/dist/runtime/components/docs/ADocsSearch.d.vue.ts +1 -1
  52. package/dist/runtime/components/docs/ADocsSearch.vue.d.ts +1 -1
  53. package/dist/runtime/components/editor/ALocationPickerPopover.vue +28 -7
  54. package/dist/runtime/components/registry/APluginDetail.d.vue.ts +2 -2
  55. package/dist/runtime/components/registry/APluginDetail.vue.d.ts +2 -2
  56. package/dist/runtime/components/renderers/AChartRenderer.client.d.vue.ts +17 -0
  57. package/dist/runtime/components/renderers/AChartRenderer.client.vue +622 -0
  58. package/dist/runtime/components/renderers/AChartRenderer.client.vue.d.ts +17 -0
  59. package/dist/runtime/components/renderers/AGraphRenderer.vue +64 -15
  60. package/dist/runtime/components/renderers/AProseRenderer.d.vue.ts +2 -2
  61. package/dist/runtime/components/renderers/AProseRenderer.vue.d.ts +2 -2
  62. package/dist/runtime/components/renderers/calendar/ACalendarToolbar.d.vue.ts +2 -2
  63. package/dist/runtime/components/renderers/calendar/ACalendarToolbar.vue.d.ts +2 -2
  64. package/dist/runtime/components/renderers/media/MediaTransportBar.d.vue.ts +2 -2
  65. package/dist/runtime/components/renderers/media/MediaTransportBar.vue.d.ts +2 -2
  66. package/dist/runtime/components/renderers/sheets/ASheetsGrid.d.vue.ts +2 -2
  67. package/dist/runtime/components/renderers/sheets/ASheetsGrid.vue.d.ts +2 -2
  68. package/dist/runtime/components/settings/ASettingsAppearancePanel.d.vue.ts +3 -0
  69. package/dist/runtime/components/settings/ASettingsAppearancePanel.vue +67 -0
  70. package/dist/runtime/components/settings/ASettingsAppearancePanel.vue.d.ts +3 -0
  71. package/dist/runtime/components/settings/ASettingsGroup.d.vue.ts +24 -0
  72. package/dist/runtime/components/settings/ASettingsGroup.vue +31 -0
  73. package/dist/runtime/components/settings/ASettingsGroup.vue.d.ts +24 -0
  74. package/dist/runtime/components/settings/ASettingsModal.vue +84 -53
  75. package/dist/runtime/components/settings/ASettingsPlaceholder.d.vue.ts +20 -0
  76. package/dist/runtime/components/settings/ASettingsPlaceholder.vue +32 -0
  77. package/dist/runtime/components/settings/ASettingsPlaceholder.vue.d.ts +20 -0
  78. package/dist/runtime/components/settings/ASettingsRow.d.vue.ts +34 -0
  79. package/dist/runtime/components/settings/ASettingsRow.vue +34 -0
  80. package/dist/runtime/components/settings/ASettingsRow.vue.d.ts +34 -0
  81. package/dist/runtime/components/settings/sections.d.ts +37 -0
  82. package/dist/runtime/components/settings/sections.js +45 -0
  83. package/dist/runtime/components/shell/ABreadcrumbForDoc.d.vue.ts +6 -0
  84. package/dist/runtime/components/shell/ABreadcrumbForDoc.vue +75 -3
  85. package/dist/runtime/components/shell/ABreadcrumbForDoc.vue.d.ts +6 -0
  86. package/dist/runtime/components/shell/ADocPanelServerSettings.d.vue.ts +17 -0
  87. package/dist/runtime/components/shell/ADocPanelServerSettings.vue +253 -0
  88. package/dist/runtime/components/shell/ADocPanelServerSettings.vue.d.ts +17 -0
  89. package/dist/runtime/components/shell/ADocPanelSettings.d.vue.ts +2 -0
  90. package/dist/runtime/components/shell/ADocPanelSettings.vue +15 -4
  91. package/dist/runtime/components/shell/ADocPanelSettings.vue.d.ts +2 -0
  92. package/dist/runtime/components/shell/AUserProfilePopover.d.vue.ts +1 -1
  93. package/dist/runtime/components/shell/AUserProfilePopover.vue.d.ts +1 -1
  94. package/dist/runtime/composables/useChat.d.ts +22 -1
  95. package/dist/runtime/composables/useChat.js +79 -8
  96. package/dist/runtime/composables/useDocBreadcrumb.d.ts +17 -2
  97. package/dist/runtime/composables/useDocBreadcrumb.js +17 -3
  98. package/dist/runtime/composables/useDocSnapshots.d.ts +2 -1
  99. package/dist/runtime/composables/useDocSnapshots.js +5 -0
  100. package/dist/runtime/composables/useEditor.d.ts +1 -1
  101. package/dist/runtime/composables/useEditor.js +120 -0
  102. package/dist/runtime/composables/useEditorToolbar.d.ts +12 -4
  103. package/dist/runtime/composables/useEditorToolbar.js +78 -56
  104. package/dist/runtime/composables/useNodeContextMenu.d.ts +14 -0
  105. package/dist/runtime/composables/useNodeContextMenu.js +59 -1
  106. package/dist/runtime/composables/useSettingsModal.d.ts +1 -1
  107. package/dist/runtime/composables/useSwipeGesture.d.ts +48 -0
  108. package/dist/runtime/composables/useSwipeGesture.js +140 -0
  109. package/dist/runtime/extensions/document-header.js +16 -6
  110. package/dist/runtime/extensions/document-meta.js +344 -19
  111. package/dist/runtime/extensions/meta-field.js +42 -0
  112. package/dist/runtime/extensions/views/DocumentMetaView.vue +33 -7
  113. package/dist/runtime/extensions/views/FieldView.vue +51 -19
  114. package/dist/runtime/extensions/views/MetaFieldView.vue +30 -4
  115. package/dist/runtime/locale.d.ts +8 -0
  116. package/dist/runtime/locale.js +9 -1
  117. package/dist/runtime/middleware/abracadabra-auth.d.ts +1 -1
  118. package/dist/runtime/plugin-abracadabra.client.d.ts +1 -1
  119. package/dist/runtime/plugin-abracadabra.client.js +12 -2
  120. package/dist/runtime/plugin-abracadabra.server.d.ts +1 -1
  121. package/dist/runtime/plugin-shared-globals.client.d.ts +1 -1
  122. package/dist/runtime/utils/chatContent.d.ts +20 -2
  123. package/dist/runtime/utils/chatContent.js +20 -1
  124. package/dist/runtime/utils/docTypes.js +43 -0
  125. package/dist/runtime/utils/titleSync.d.ts +130 -0
  126. package/dist/runtime/utils/titleSync.js +53 -0
  127. package/package.json +11 -4
@@ -7,19 +7,29 @@ type __VLS_Props = {
7
7
  docType?: string;
8
8
  labels?: Partial<AbracadabraLocale['nodePanel']>;
9
9
  /** Tab to open initially. Defaults to 'editor'. */
10
- initialTab?: 'editor' | 'properties' | 'chat' | 'settings' | string;
10
+ initialTab?: 'editor' | 'properties' | 'chat' | 'settings' | 'serverSettings' | string;
11
11
  /**
12
- * Built-in tabs to render. Defaults to all-on; pass an array to limit which
13
- * tabs appear (useful when a developer wants only properties + chat).
14
- * Plugin-registered tab slots are unaffected.
12
+ * Built-in tabs to render. Defaults to editor/properties/chat/settings on;
13
+ * pass an array to limit which tabs appear (useful when a developer wants
14
+ * only properties + chat). `serverSettings` is OPT-IN only rendered when
15
+ * explicitly included (it targets a server hub doc). Plugin-registered tab
16
+ * slots are unaffected.
15
17
  */
16
- tabs?: Array<'editor' | 'properties' | 'chat' | 'settings'>;
18
+ tabs?: Array<'editor' | 'properties' | 'chat' | 'settings' | 'serverSettings'>;
19
+ /**
20
+ * Build the URL the "open as full page" (expand) button navigates to.
21
+ * Defaults to a slug-aware path derived from the configured `docBasePath`
22
+ * (`useDocSlugs().getDocUrl`), which resolves to the doc's slug when it has
23
+ * one and falls back to the raw id. Override to target a custom route shape.
24
+ */
25
+ docHref?: (id: string) => string;
17
26
  };
18
27
  declare var __VLS_11: {
19
28
  nodeId: string | null;
20
- nodeLabel: string | undefined;
29
+ nodeLabel: any;
21
30
  editor: any;
22
31
  meta: DocPageMeta;
32
+ activeTab: string;
23
33
  docTypeDef: import("../utils/docTypes.js").DocTypeDefinition;
24
34
  };
25
35
  type __VLS_Slots = {} & {
@@ -30,7 +40,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
30
40
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
31
41
  onClose?: (() => any) | undefined;
32
42
  }>, {
33
- initialTab: "editor" | "properties" | "chat" | "settings" | string;
43
+ initialTab: "editor" | "properties" | "chat" | "settings" | "serverSettings" | string;
34
44
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
45
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
36
46
  declare const _default: typeof __VLS_export;
@@ -10,12 +10,19 @@ type __VLS_Props = {
10
10
  iconColor?: string;
11
11
  /** TipTap editor — when passed, default undo/redo buttons render */
12
12
  editor?: Editor | null;
13
+ /**
14
+ * The doc's child provider. When passed, the default `#status` slot renders
15
+ * an <AConnectionBadge> so an offline / auth-rejected doc shows a status dot.
16
+ */
17
+ provider?: any;
13
18
  /** Show undo/redo buttons in default slot. Default: true when editor passed */
14
19
  showUndoRedo?: boolean;
15
20
  /** Show expand-to-full-page button. Default: true when nodeId passed */
16
21
  showExpand?: boolean;
17
22
  /** Show presence facepile in default presence slot. Default: true when nodeId passed */
18
23
  showPresence?: boolean;
24
+ /** Show the connection badge in default `#status` slot. Default: true when provider passed */
25
+ showConnectionBadge?: boolean;
19
26
  /** Tooltip text for the expand button */
20
27
  expandTooltip?: string;
21
28
  };
@@ -24,34 +31,37 @@ declare var __VLS_1: {
24
31
  color: string | undefined;
25
32
  }, __VLS_8: {
26
33
  label: string | undefined;
27
- }, __VLS_10: {}, __VLS_12: {}, __VLS_19: {
34
+ }, __VLS_10: {}, __VLS_17: {}, __VLS_19: {}, __VLS_26: {
28
35
  editor: Editor | null | undefined;
29
- }, __VLS_31: {}, __VLS_33: {
30
- expand: () => void;
36
+ }, __VLS_38: {}, __VLS_40: {
37
+ expand: (e?: MouseEvent) => void;
31
38
  };
32
39
  type __VLS_Slots = {} & {
33
40
  icon?: (props: typeof __VLS_1) => any;
34
41
  } & {
35
42
  title?: (props: typeof __VLS_8) => any;
36
43
  } & {
37
- 'actions-left'?: (props: typeof __VLS_10) => any;
44
+ status?: (props: typeof __VLS_10) => any;
38
45
  } & {
39
- presence?: (props: typeof __VLS_12) => any;
46
+ 'actions-left'?: (props: typeof __VLS_17) => any;
40
47
  } & {
41
- 'undo-redo'?: (props: typeof __VLS_19) => any;
48
+ presence?: (props: typeof __VLS_19) => any;
42
49
  } & {
43
- 'actions-right'?: (props: typeof __VLS_31) => any;
50
+ 'undo-redo'?: (props: typeof __VLS_26) => any;
44
51
  } & {
45
- expand?: (props: typeof __VLS_33) => any;
52
+ 'actions-right'?: (props: typeof __VLS_38) => any;
53
+ } & {
54
+ expand?: (props: typeof __VLS_40) => any;
46
55
  };
47
56
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
48
- expand: () => any;
57
+ expand: (event?: MouseEvent | undefined) => any;
49
58
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
50
- onExpand?: (() => any) | undefined;
59
+ onExpand?: ((event?: MouseEvent | undefined) => any) | undefined;
51
60
  }>, {
52
61
  showUndoRedo: boolean;
53
62
  showExpand: boolean;
54
63
  showPresence: boolean;
64
+ showConnectionBadge: boolean;
55
65
  expandTooltip: string;
56
66
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
57
67
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
3
  import AFacepile from "./aware/AFacepile.vue";
4
+ import AConnectionBadge from "./AConnectionBadge.vue";
4
5
  import AEditorUndoButton from "./editor/AEditorUndoButton.vue";
5
6
  import AEditorRedoButton from "./editor/AEditorRedoButton.vue";
6
7
  const props = defineProps({
@@ -9,9 +10,11 @@ const props = defineProps({
9
10
  icon: { type: String, required: false },
10
11
  iconColor: { type: String, required: false },
11
12
  editor: { type: [Object, null], required: false },
13
+ provider: { type: null, required: false },
12
14
  showUndoRedo: { type: Boolean, required: false, default: void 0 },
13
15
  showExpand: { type: Boolean, required: false, default: void 0 },
14
16
  showPresence: { type: Boolean, required: false, default: void 0 },
17
+ showConnectionBadge: { type: Boolean, required: false, default: void 0 },
15
18
  expandTooltip: { type: String, required: false, default: "Open as full page" }
16
19
  });
17
20
  const emit = defineEmits(["expand"]);
@@ -29,6 +32,9 @@ const expandEnabled = computed(
29
32
  const presenceEnabled = computed(
30
33
  () => props.showPresence === void 0 ? !!props.nodeId : props.showPresence
31
34
  );
35
+ const connectionBadgeEnabled = computed(
36
+ () => props.showConnectionBadge === void 0 ? !!props.provider : props.showConnectionBadge
37
+ );
32
38
  </script>
33
39
 
34
40
  <template>
@@ -55,6 +61,14 @@ const presenceEnabled = computed(
55
61
  <span class="font-medium truncate flex-1">{{ nodeLabel || "Document" }}</span>
56
62
  </slot>
57
63
 
64
+ <!-- connection status dot (offline / auth-rejected) for this doc's provider -->
65
+ <slot name="status">
66
+ <AConnectionBadge
67
+ v-if="connectionBadgeEnabled"
68
+ :provider="provider"
69
+ />
70
+ </slot>
71
+
58
72
  <!-- left-of-presence actions (badges, status indicators, etc.) -->
59
73
  <slot name="actions-left" />
60
74
 
@@ -82,10 +96,10 @@ const presenceEnabled = computed(
82
96
  <!-- right-of-undo extension actions -->
83
97
  <slot name="actions-right" />
84
98
 
85
- <!-- expand to full page -->
99
+ <!-- expand to full page (modifier-aware: see the `expand` emit docs) -->
86
100
  <slot
87
101
  name="expand"
88
- :expand="() => emit('expand')"
102
+ :expand="(e) => emit('expand', e)"
89
103
  >
90
104
  <UTooltip
91
105
  v-if="expandEnabled"
@@ -97,7 +111,7 @@ const presenceEnabled = computed(
97
111
  size="xs"
98
112
  variant="ghost"
99
113
  color="neutral"
100
- @click="emit('expand')"
114
+ @click="(e) => emit('expand', e)"
101
115
  />
102
116
  </UTooltip>
103
117
  </slot>
@@ -10,12 +10,19 @@ type __VLS_Props = {
10
10
  iconColor?: string;
11
11
  /** TipTap editor — when passed, default undo/redo buttons render */
12
12
  editor?: Editor | null;
13
+ /**
14
+ * The doc's child provider. When passed, the default `#status` slot renders
15
+ * an <AConnectionBadge> so an offline / auth-rejected doc shows a status dot.
16
+ */
17
+ provider?: any;
13
18
  /** Show undo/redo buttons in default slot. Default: true when editor passed */
14
19
  showUndoRedo?: boolean;
15
20
  /** Show expand-to-full-page button. Default: true when nodeId passed */
16
21
  showExpand?: boolean;
17
22
  /** Show presence facepile in default presence slot. Default: true when nodeId passed */
18
23
  showPresence?: boolean;
24
+ /** Show the connection badge in default `#status` slot. Default: true when provider passed */
25
+ showConnectionBadge?: boolean;
19
26
  /** Tooltip text for the expand button */
20
27
  expandTooltip?: string;
21
28
  };
@@ -24,34 +31,37 @@ declare var __VLS_1: {
24
31
  color: string | undefined;
25
32
  }, __VLS_8: {
26
33
  label: string | undefined;
27
- }, __VLS_10: {}, __VLS_12: {}, __VLS_19: {
34
+ }, __VLS_10: {}, __VLS_17: {}, __VLS_19: {}, __VLS_26: {
28
35
  editor: Editor | null | undefined;
29
- }, __VLS_31: {}, __VLS_33: {
30
- expand: () => void;
36
+ }, __VLS_38: {}, __VLS_40: {
37
+ expand: (e?: MouseEvent) => void;
31
38
  };
32
39
  type __VLS_Slots = {} & {
33
40
  icon?: (props: typeof __VLS_1) => any;
34
41
  } & {
35
42
  title?: (props: typeof __VLS_8) => any;
36
43
  } & {
37
- 'actions-left'?: (props: typeof __VLS_10) => any;
44
+ status?: (props: typeof __VLS_10) => any;
38
45
  } & {
39
- presence?: (props: typeof __VLS_12) => any;
46
+ 'actions-left'?: (props: typeof __VLS_17) => any;
40
47
  } & {
41
- 'undo-redo'?: (props: typeof __VLS_19) => any;
48
+ presence?: (props: typeof __VLS_19) => any;
42
49
  } & {
43
- 'actions-right'?: (props: typeof __VLS_31) => any;
50
+ 'undo-redo'?: (props: typeof __VLS_26) => any;
44
51
  } & {
45
- expand?: (props: typeof __VLS_33) => any;
52
+ 'actions-right'?: (props: typeof __VLS_38) => any;
53
+ } & {
54
+ expand?: (props: typeof __VLS_40) => any;
46
55
  };
47
56
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
48
- expand: () => any;
57
+ expand: (event?: MouseEvent | undefined) => any;
49
58
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
50
- onExpand?: (() => any) | undefined;
59
+ onExpand?: ((event?: MouseEvent | undefined) => any) | undefined;
51
60
  }>, {
52
61
  showUndoRedo: boolean;
53
62
  showExpand: boolean;
54
63
  showPresence: boolean;
64
+ showConnectionBadge: boolean;
55
65
  expandTooltip: string;
56
66
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
57
67
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -4,6 +4,8 @@ type __VLS_Props = {
4
4
  docId: string;
5
5
  /** Document type key (drives metaSchema form). */
6
6
  docTypeKey?: string;
7
+ /** Document label — used as the title when serializing a snapshot preview. */
8
+ docLabel?: string;
7
9
  /** Document meta to read/write. */
8
10
  docMeta?: DocPageMeta | null;
9
11
  /** Permission entries — left to the consumer (varies per backend). */
@@ -1,11 +1,13 @@
1
1
  <script setup>
2
- import { computed, toRef } from "vue";
2
+ import { computed, ref, toRef, watch } from "vue";
3
3
  import { useDocSnapshots } from "../composables/useDocSnapshots";
4
4
  import { useAbracadabra } from "../composables/useAbracadabra";
5
5
  import ADocPanelSettings from "./shell/ADocPanelSettings.vue";
6
+ import ASnapshotPreviewModal from "./ASnapshotPreviewModal.vue";
6
7
  const props = defineProps({
7
8
  docId: { type: String, required: true },
8
9
  docTypeKey: { type: String, required: false },
10
+ docLabel: { type: String, required: false },
9
11
  docMeta: { type: [Object, null], required: false },
10
12
  permissions: { type: Array, required: false, default: () => [] },
11
13
  loadingPermissions: { type: Boolean, required: false, default: false },
@@ -16,6 +18,10 @@ const emit = defineEmits(["grant-permission", "change-role", "revoke-permission"
16
18
  const abra = useAbracadabra();
17
19
  const docIdRef = toRef(props, "docId");
18
20
  const snaps = useDocSnapshots(docIdRef);
21
+ watch(docIdRef, (id) => {
22
+ if (id) snaps.fetchList();
23
+ }, { immediate: true });
24
+ const previewVersion = ref(null);
19
25
  const effectiveRole = computed(() => abra.provider.value?.effectiveRole ?? null);
20
26
  const userName = computed(() => abra.userName?.value ?? "");
21
27
  const syncStatusIcon = computed(() => abra.provider.value ? "i-lucide-cloud" : "i-lucide-cloud-off");
@@ -54,6 +60,20 @@ const syncStatusLabel = computed(() => abra.provider.value ? "Connected" : "Disc
54
60
  @delete-snapshot="(v) => snaps.remove(v)"
55
61
  @restore-snapshot="(v) => snaps.restore(v)"
56
62
  @fork-snapshot="(v) => snaps.fork(v)"
63
+ @preview-snapshot="(v) => previewVersion = v"
57
64
  @load-more-snapshots="snaps.loadMore"
58
65
  />
66
+
67
+ <ASnapshotPreviewModal
68
+ v-model:version="previewVersion"
69
+ :snapshots="snaps.snapshots.value"
70
+ :get-snapshot="snaps.getSnapshot"
71
+ :doc-label="docLabel"
72
+ :doc-type="docTypeKey"
73
+ :doc-meta="docMeta"
74
+ :is-owner="isOwner"
75
+ @restore="(v) => snaps.restore(v)"
76
+ @fork="(v) => snaps.fork(v)"
77
+ @delete="(v) => snaps.remove(v)"
78
+ />
59
79
  </template>
@@ -4,6 +4,8 @@ type __VLS_Props = {
4
4
  docId: string;
5
5
  /** Document type key (drives metaSchema form). */
6
6
  docTypeKey?: string;
7
+ /** Document label — used as the title when serializing a snapshot preview. */
8
+ docLabel?: string;
7
9
  /** Document meta to read/write. */
8
10
  docMeta?: DocPageMeta | null;
9
11
  /** Permission entries — left to the consumer (varies per backend). */
@@ -0,0 +1,33 @@
1
+ import type { SnapshotData, SnapshotMeta } from '@abraca/dabra';
2
+ import type { DocPageMeta } from '../types.js';
3
+ type __VLS_Props = {
4
+ /** Selected version — null closes the modal. The parent owns this. */
5
+ version: number | null;
6
+ /** The loaded snapshot metadata list (compare-baseline candidates). */
7
+ snapshots?: SnapshotMeta[];
8
+ /** Fetch a single snapshot's data blob (e.g. `useDocSnapshots().getSnapshot`). */
9
+ getSnapshot: (version: number) => Promise<SnapshotData | null>;
10
+ /** Document label — used as the title when serializing. */
11
+ docLabel?: string;
12
+ /** Document page type — passed to the markdown serializer. */
13
+ docType?: string;
14
+ /** Document meta — passed to the markdown serializer. */
15
+ docMeta?: DocPageMeta | null;
16
+ /** Whether the current user may delete snapshots. */
17
+ isOwner?: boolean;
18
+ };
19
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ delete: (version: number) => any;
21
+ restore: (version: number) => any;
22
+ fork: (version: number) => any;
23
+ "update:version": (value: number | null) => any;
24
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
+ onDelete?: ((version: number) => any) | undefined;
26
+ onRestore?: ((version: number) => any) | undefined;
27
+ onFork?: ((version: number) => any) | undefined;
28
+ "onUpdate:version"?: ((value: number | null) => any) | undefined;
29
+ }>, {
30
+ snapshots: SnapshotMeta[];
31
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
+ declare const _default: typeof __VLS_export;
33
+ export default _default;