@abraca/nuxt 2.39.0 → 2.41.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 +1 -1
- package/dist/runtime/components/ADocRenderer.d.vue.ts +7 -0
- package/dist/runtime/components/ADocRenderer.vue +2 -0
- package/dist/runtime/components/ADocRenderer.vue.d.ts +7 -0
- package/dist/runtime/components/ADocSubPageList.vue +8 -6
- package/dist/runtime/components/AEditor.d.vue.ts +8 -0
- package/dist/runtime/components/AEditor.vue +5 -1
- package/dist/runtime/components/AEditor.vue.d.ts +8 -0
- package/dist/runtime/components/renderers/ACalendarRenderer.vue +3 -1
- package/dist/runtime/components/renderers/AMapRenderer.vue +3 -1
- package/dist/runtime/components/renderers/AOverviewRenderer.vue +7 -5
- package/dist/runtime/components/renderers/ATimelineRenderer.vue +3 -1
- package/dist/runtime/components/shell/ANodeContextMenu.d.vue.ts +10 -2
- package/dist/runtime/components/shell/ANodeContextMenu.vue +4 -1
- package/dist/runtime/components/shell/ANodeContextMenu.vue.d.ts +10 -2
- package/dist/runtime/composables/useDocSnapshots.js +3 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -3,6 +3,12 @@ type __VLS_Props = {
|
|
|
3
3
|
docId: string;
|
|
4
4
|
/** Whether the document is editable. Default: true */
|
|
5
5
|
editable?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Attach the right-click node context menu to editor breadcrumb ancestors.
|
|
8
|
+
* Default: true. Set false for read-only viewers (e.g. marketing /docs) that
|
|
9
|
+
* don't want the node mutation menu. Only affects editor-type documents.
|
|
10
|
+
*/
|
|
11
|
+
breadcrumbMenu?: boolean;
|
|
6
12
|
/** CSS class applied to editor-type documents (doc, or hasEditor: true) */
|
|
7
13
|
editorClass?: string;
|
|
8
14
|
/** CSS class applied to structured renderers (kanban, table, etc.) */
|
|
@@ -18,6 +24,7 @@ type __VLS_Slots = {} & {
|
|
|
18
24
|
};
|
|
19
25
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
20
26
|
editable: boolean;
|
|
27
|
+
breadcrumbMenu: boolean;
|
|
21
28
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
29
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
30
|
declare const _default: typeof __VLS_export;
|
|
@@ -8,6 +8,7 @@ import { resolveDocType } from "../utils/docTypes";
|
|
|
8
8
|
const props = defineProps({
|
|
9
9
|
docId: { type: String, required: true },
|
|
10
10
|
editable: { type: Boolean, required: false, default: true },
|
|
11
|
+
breadcrumbMenu: { type: Boolean, required: false, default: true },
|
|
11
12
|
editorClass: { type: String, required: false },
|
|
12
13
|
rendererClass: { type: String, required: false }
|
|
13
14
|
});
|
|
@@ -100,6 +101,7 @@ const resolvedClass = computed(
|
|
|
100
101
|
:doc-meta="docMeta"
|
|
101
102
|
:child-provider="childProvider"
|
|
102
103
|
:editable="editable"
|
|
104
|
+
:breadcrumb-menu="breadcrumbMenu"
|
|
103
105
|
:class="resolvedClass"
|
|
104
106
|
/>
|
|
105
107
|
</template>
|
|
@@ -3,6 +3,12 @@ type __VLS_Props = {
|
|
|
3
3
|
docId: string;
|
|
4
4
|
/** Whether the document is editable. Default: true */
|
|
5
5
|
editable?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Attach the right-click node context menu to editor breadcrumb ancestors.
|
|
8
|
+
* Default: true. Set false for read-only viewers (e.g. marketing /docs) that
|
|
9
|
+
* don't want the node mutation menu. Only affects editor-type documents.
|
|
10
|
+
*/
|
|
11
|
+
breadcrumbMenu?: boolean;
|
|
6
12
|
/** CSS class applied to editor-type documents (doc, or hasEditor: true) */
|
|
7
13
|
editorClass?: string;
|
|
8
14
|
/** CSS class applied to structured renderers (kanban, table, etc.) */
|
|
@@ -18,6 +24,7 @@ type __VLS_Slots = {} & {
|
|
|
18
24
|
};
|
|
19
25
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
20
26
|
editable: boolean;
|
|
27
|
+
breadcrumbMenu: boolean;
|
|
21
28
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
29
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
30
|
declare const _default: typeof __VLS_export;
|
|
@@ -4,6 +4,7 @@ import { useRouter, useRoute, useRuntimeConfig, useToast } from "#imports";
|
|
|
4
4
|
import * as Y from "yjs";
|
|
5
5
|
import { useAbracadabra } from "../composables/useAbracadabra";
|
|
6
6
|
import { useChildTree } from "../composables/useChildTree";
|
|
7
|
+
import { useDocSlugs } from "../composables/useDocSlugs";
|
|
7
8
|
import { useNodePanel } from "../composables/useNodePanel";
|
|
8
9
|
import { useWindowManager } from "../composables/useWindowManager";
|
|
9
10
|
import { useItemPresence, useViewingBroadcast } from "../composables/useItemPresence";
|
|
@@ -71,6 +72,7 @@ const { treeMap } = docTree;
|
|
|
71
72
|
const canWrite = computed(() => props.editable !== false);
|
|
72
73
|
const router = useRouter();
|
|
73
74
|
const route = useRoute();
|
|
75
|
+
const { getDocUrl } = useDocSlugs();
|
|
74
76
|
const toast = useToast();
|
|
75
77
|
const { enqueue: enqueueUpload } = useOfflineUploadQueue();
|
|
76
78
|
const { isFavorite, toggleFavorite } = useFavorites(rootDoc);
|
|
@@ -114,7 +116,7 @@ function pageViewers(pageId) {
|
|
|
114
116
|
}
|
|
115
117
|
function openFull(id, label) {
|
|
116
118
|
emit("open", id, label);
|
|
117
|
-
router.push(
|
|
119
|
+
router.push(getDocUrl(id));
|
|
118
120
|
}
|
|
119
121
|
function onItemActivate(e, id, label) {
|
|
120
122
|
if (e.metaKey || e.ctrlKey) {
|
|
@@ -144,7 +146,7 @@ watch(tiptapDragState, (state, oldState) => {
|
|
|
144
146
|
dropIndicator.value = null;
|
|
145
147
|
const currentDocId = route.params.id;
|
|
146
148
|
if (currentDocId && currentDocId !== dragOriginDocId) {
|
|
147
|
-
router.push(
|
|
149
|
+
router.push(getDocUrl(dragOriginDocId));
|
|
148
150
|
}
|
|
149
151
|
dragOriginDocId = null;
|
|
150
152
|
}
|
|
@@ -261,7 +263,7 @@ async function onTiptapDrop(targetId) {
|
|
|
261
263
|
const fragment = childProv.document.getXmlFragment("default");
|
|
262
264
|
populateYDocFromHtml(fragment, state.html, label);
|
|
263
265
|
state.deleteFromSource();
|
|
264
|
-
router.push(
|
|
266
|
+
router.push(getDocUrl(newId));
|
|
265
267
|
} else {
|
|
266
268
|
if (targetId === state.sourceDocId) return;
|
|
267
269
|
const childProv = await provider.value.loadChild(targetId);
|
|
@@ -504,9 +506,9 @@ async function onExternalFileDrop(e, parentId = null) {
|
|
|
504
506
|
if (firstId === null && id !== null) firstId = id;
|
|
505
507
|
}
|
|
506
508
|
if (parentId) {
|
|
507
|
-
router.push(
|
|
509
|
+
router.push(getDocUrl(parentId));
|
|
508
510
|
} else if (firstId) {
|
|
509
|
-
router.push(
|
|
511
|
+
router.push(getDocUrl(firstId));
|
|
510
512
|
}
|
|
511
513
|
}
|
|
512
514
|
const TEXT_EXTENSIONS = ["md", "mdx", "txt", "html", "htm"];
|
|
@@ -649,7 +651,7 @@ function createChildPage(parentId) {
|
|
|
649
651
|
treeMap.set(id, { label: "", parentId, order: Date.now(), type: "doc" });
|
|
650
652
|
void client.value?.createChild?.(parentId, { child_id: id, kind: "page" })?.catch?.(() => {
|
|
651
653
|
});
|
|
652
|
-
router.push(
|
|
654
|
+
router.push(getDocUrl(id));
|
|
653
655
|
}
|
|
654
656
|
async function duplicateDoc(id) {
|
|
655
657
|
if (!provider.value) return;
|
|
@@ -41,6 +41,13 @@ type __VLS_Props = {
|
|
|
41
41
|
* so root/space docs show nothing. Set false for embeds/previews.
|
|
42
42
|
*/
|
|
43
43
|
showBreadcrumb?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Attach the right-click node context menu (open / window / change type /
|
|
46
|
+
* favorite / trash, …) to each breadcrumb ancestor. On by default for cou-sh
|
|
47
|
+
* parity. Set false for read-only viewers (e.g. the marketing /docs site)
|
|
48
|
+
* where the mutation menu is noise.
|
|
49
|
+
*/
|
|
50
|
+
breadcrumbMenu?: boolean;
|
|
44
51
|
/**
|
|
45
52
|
* Show the comprehensive sub-page list (<ADocSubPageList>) below the editor
|
|
46
53
|
* body — the child-document browser cou-sh's DocRenderer renders under every
|
|
@@ -106,6 +113,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
106
113
|
variant: "doc" | "prose";
|
|
107
114
|
showSourceToggle: boolean;
|
|
108
115
|
showBreadcrumb: boolean;
|
|
116
|
+
breadcrumbMenu: boolean;
|
|
109
117
|
showSubPages: boolean;
|
|
110
118
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
111
119
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -44,6 +44,7 @@ const props = defineProps({
|
|
|
44
44
|
variant: { type: String, required: false, default: "doc" },
|
|
45
45
|
showSourceToggle: { type: Boolean, required: false, default: false },
|
|
46
46
|
showBreadcrumb: { type: Boolean, required: false, default: true },
|
|
47
|
+
breadcrumbMenu: { type: Boolean, required: false, default: true },
|
|
47
48
|
showSubPages: { type: Boolean, required: false, default: true }
|
|
48
49
|
});
|
|
49
50
|
const viewMode = ref("rich");
|
|
@@ -611,7 +612,10 @@ function onPlusClick(e, onClick) {
|
|
|
611
612
|
/>
|
|
612
613
|
</li>
|
|
613
614
|
<li class="flex min-w-0">
|
|
614
|
-
<ANodeContextMenu
|
|
615
|
+
<ANodeContextMenu
|
|
616
|
+
:items="bcMenuItems(ancestor)"
|
|
617
|
+
:disabled="!breadcrumbMenu"
|
|
618
|
+
>
|
|
615
619
|
<button
|
|
616
620
|
type="button"
|
|
617
621
|
draggable="true"
|
|
@@ -41,6 +41,13 @@ type __VLS_Props = {
|
|
|
41
41
|
* so root/space docs show nothing. Set false for embeds/previews.
|
|
42
42
|
*/
|
|
43
43
|
showBreadcrumb?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Attach the right-click node context menu (open / window / change type /
|
|
46
|
+
* favorite / trash, …) to each breadcrumb ancestor. On by default for cou-sh
|
|
47
|
+
* parity. Set false for read-only viewers (e.g. the marketing /docs site)
|
|
48
|
+
* where the mutation menu is noise.
|
|
49
|
+
*/
|
|
50
|
+
breadcrumbMenu?: boolean;
|
|
44
51
|
/**
|
|
45
52
|
* Show the comprehensive sub-page list (<ADocSubPageList>) below the editor
|
|
46
53
|
* body — the child-document browser cou-sh's DocRenderer renders under every
|
|
@@ -106,6 +113,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
106
113
|
variant: "doc" | "prose";
|
|
107
114
|
showSourceToggle: boolean;
|
|
108
115
|
showBreadcrumb: boolean;
|
|
116
|
+
breadcrumbMenu: boolean;
|
|
109
117
|
showSubPages: boolean;
|
|
110
118
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
111
119
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -3,6 +3,7 @@ import { ref, computed, watch, onBeforeUnmount } from "vue";
|
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
4
|
import { useRuntimeConfig, defineShortcuts } from "#imports";
|
|
5
5
|
import { useRendererBase } from "../../composables/useRendererBase";
|
|
6
|
+
import { useDocSlugs } from "../../composables/useDocSlugs";
|
|
6
7
|
import { useTouchDrag } from "../../composables/useTouchDrag";
|
|
7
8
|
import { useNodePanel } from "../../composables/useNodePanel";
|
|
8
9
|
import { useNodePanelFollow } from "../../composables/useNodePanelFollow";
|
|
@@ -30,6 +31,7 @@ const props = defineProps({
|
|
|
30
31
|
});
|
|
31
32
|
const config = useRuntimeConfig();
|
|
32
33
|
const router = useRouter();
|
|
34
|
+
const { getDocUrl } = useDocSlugs();
|
|
33
35
|
const locale = computed(() => ({
|
|
34
36
|
...DEFAULT_LOCALE.renderers.calendar,
|
|
35
37
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -229,7 +231,7 @@ async function openAsWindow(id, label) {
|
|
|
229
231
|
function eventMenuItems(eventId, label) {
|
|
230
232
|
const items = [
|
|
231
233
|
[
|
|
232
|
-
{ label: "Open", icon: "i-lucide-external-link", onSelect: () => router.push(
|
|
234
|
+
{ label: "Open", icon: "i-lucide-external-link", onSelect: () => router.push(getDocUrl(eventId)) },
|
|
233
235
|
{ label: "Open as slideover", icon: "i-lucide-panel-right", onSelect: () => openNode(eventId, label) },
|
|
234
236
|
...wm.floatWindowsAvailable.value ? [{ label: "Open as window", icon: "i-lucide-picture-in-picture-2", onSelect: () => openAsWindow(eventId, label) }] : [],
|
|
235
237
|
...props.editable ? [
|
|
@@ -4,6 +4,7 @@ import { useRuntimeConfig, useColorMode, useAppConfig, useToast } from "#imports
|
|
|
4
4
|
import { useRouter } from "vue-router";
|
|
5
5
|
import { avatarBorderStyle } from "../../utils/avatarStyle";
|
|
6
6
|
import { useAbracadabra } from "../../composables/useAbracadabra";
|
|
7
|
+
import { useDocSlugs } from "../../composables/useDocSlugs";
|
|
7
8
|
import { useRendererBase } from "../../composables/useRendererBase";
|
|
8
9
|
import { useNodePanel } from "../../composables/useNodePanel";
|
|
9
10
|
import { useNodePanelFollow } from "../../composables/useNodePanelFollow";
|
|
@@ -25,6 +26,7 @@ const props = defineProps({
|
|
|
25
26
|
const emit = defineEmits(["follow"]);
|
|
26
27
|
const config = useRuntimeConfig();
|
|
27
28
|
const router = useRouter();
|
|
29
|
+
const { getDocUrl } = useDocSlugs();
|
|
28
30
|
const toast = useToast();
|
|
29
31
|
const locale = computed(() => ({
|
|
30
32
|
...DEFAULT_LOCALE.renderers.map,
|
|
@@ -259,7 +261,7 @@ const contextMenuItems = computed(() => {
|
|
|
259
261
|
const w = props.editable;
|
|
260
262
|
const openItems = (id, entry) => [
|
|
261
263
|
{ label: "Open", icon: "i-lucide-external-link", onSelect: () => {
|
|
262
|
-
if (id) router.push(
|
|
264
|
+
if (id) router.push(getDocUrl(id));
|
|
263
265
|
} },
|
|
264
266
|
{ label: locale.value.openInPanel ?? "Open as slideover", icon: "i-lucide-panel-right", onSelect: () => {
|
|
265
267
|
if (id && entry) openNode(id, entry.label);
|
|
@@ -4,6 +4,7 @@ import { useRouter, useRuntimeConfig, useAppConfig } from "#imports";
|
|
|
4
4
|
import { useVirtualizer } from "@tanstack/vue-virtual";
|
|
5
5
|
import { DEFAULT_LOCALE } from "../../locale";
|
|
6
6
|
import { useAbracadabra } from "../../composables/useAbracadabra";
|
|
7
|
+
import { useDocSlugs } from "../../composables/useDocSlugs";
|
|
7
8
|
import { useRendererBase } from "../../composables/useRendererBase";
|
|
8
9
|
import { useNodePanel } from "../../composables/useNodePanel";
|
|
9
10
|
import { useNodePanelFollow } from "../../composables/useNodePanelFollow";
|
|
@@ -67,6 +68,7 @@ const { getViewers: getDocViewers } = useItemPresence();
|
|
|
67
68
|
const { favorites, isFavorite, toggleFavorite, moveFavorite } = useFavorites(rootDoc);
|
|
68
69
|
const { voiceRoomId, voiceStatus, peerCount: voicePeerCount, joinRoom: _joinRoom } = useVoice();
|
|
69
70
|
const router = useRouter();
|
|
71
|
+
const { getDocUrl } = useDocSlugs();
|
|
70
72
|
const { isOpen: searchOpen, searchTerm } = useCommandPalette();
|
|
71
73
|
const appConfig = useAppConfig();
|
|
72
74
|
const neutral = computed(() => appConfig.ui?.colors?.neutral ?? "zinc");
|
|
@@ -190,10 +192,10 @@ const virtualPageRows = computed(() => {
|
|
|
190
192
|
return rows.map((vRow) => ({ vRow, item: flat[vRow.index] }));
|
|
191
193
|
});
|
|
192
194
|
function handleNavigate(entry) {
|
|
193
|
-
router.push(
|
|
195
|
+
router.push(getDocUrl(entry.id));
|
|
194
196
|
}
|
|
195
197
|
function handleJoinCall(docId) {
|
|
196
|
-
router.push(
|
|
198
|
+
router.push(getDocUrl(docId));
|
|
197
199
|
}
|
|
198
200
|
function createTypedPage(type) {
|
|
199
201
|
const label = locale.value.untitled;
|
|
@@ -201,7 +203,7 @@ function createTypedPage(type) {
|
|
|
201
203
|
if (id) {
|
|
202
204
|
const entry = tree.treeMap.get(id);
|
|
203
205
|
if (entry) tree.treeMap.set(id, { ...entry, type });
|
|
204
|
-
router.push(
|
|
206
|
+
router.push(getDocUrl(id));
|
|
205
207
|
}
|
|
206
208
|
}
|
|
207
209
|
async function duplicateDoc(id) {
|
|
@@ -272,7 +274,7 @@ function pageMenuItems(page) {
|
|
|
272
274
|
const l = locale.value;
|
|
273
275
|
return [
|
|
274
276
|
[
|
|
275
|
-
{ label: l.open, icon: "i-lucide-external-link", onSelect: () => router.push(
|
|
277
|
+
{ label: l.open, icon: "i-lucide-external-link", onSelect: () => router.push(getDocUrl(page.id)) },
|
|
276
278
|
{ label: l.openAsSlideover, icon: "i-lucide-panel-right", onSelect: () => openNode(page.id, page.label) },
|
|
277
279
|
...floatWindowsAvailable.value ? [{ label: l.openAsWindow, icon: "i-lucide-picture-in-picture-2", onSelect: () => openAsWindow(page.id, page.label) }] : [],
|
|
278
280
|
{ label: l.rename, icon: "i-lucide-pencil", onSelect: () => startRename(page.id) },
|
|
@@ -313,7 +315,7 @@ function readOnlyMenuItems(page) {
|
|
|
313
315
|
const l = locale.value;
|
|
314
316
|
return [
|
|
315
317
|
[
|
|
316
|
-
{ label: l.open, icon: "i-lucide-external-link", onSelect: () => router.push(
|
|
318
|
+
{ label: l.open, icon: "i-lucide-external-link", onSelect: () => router.push(getDocUrl(page.id)) },
|
|
317
319
|
{ label: l.openAsSlideover, icon: "i-lucide-panel-right", onSelect: () => openNode(page.id, page.label) },
|
|
318
320
|
{ label: l.openAsWindow, icon: "i-lucide-picture-in-picture-2", onSelect: () => openAsWindow(page.id, page.label) },
|
|
319
321
|
{
|
|
@@ -3,6 +3,7 @@ import { ref, computed, watch, onBeforeUnmount } from "vue";
|
|
|
3
3
|
import { useRuntimeConfig } from "#imports";
|
|
4
4
|
import { useRouter } from "vue-router";
|
|
5
5
|
import { useRendererBase } from "../../composables/useRendererBase";
|
|
6
|
+
import { useDocSlugs } from "../../composables/useDocSlugs";
|
|
6
7
|
import { useTouchDrag } from "../../composables/useTouchDrag";
|
|
7
8
|
import { useNodePanel } from "../../composables/useNodePanel";
|
|
8
9
|
import { useNodePanelFollow } from "../../composables/useNodePanelFollow";
|
|
@@ -26,6 +27,7 @@ const props = defineProps({
|
|
|
26
27
|
});
|
|
27
28
|
const config = useRuntimeConfig();
|
|
28
29
|
const router = useRouter();
|
|
30
|
+
const { getDocUrl } = useDocSlugs();
|
|
29
31
|
const locale = computed(() => ({
|
|
30
32
|
...DEFAULT_LOCALE.renderers.timeline,
|
|
31
33
|
...config.public?.abracadabra?.locale?.renderers?.timeline ?? {},
|
|
@@ -392,7 +394,7 @@ const ctxItems = computed(() => {
|
|
|
392
394
|
const isEpic = !entry.parentId;
|
|
393
395
|
const items = [
|
|
394
396
|
[
|
|
395
|
-
{ label: locale.value.open, icon: "i-lucide-external-link", onSelect: () => router.push(
|
|
397
|
+
{ label: locale.value.open, icon: "i-lucide-external-link", onSelect: () => router.push(getDocUrl(ctxEntry.value.id)) },
|
|
396
398
|
{ label: "Open as slideover", icon: "i-lucide-panel-right", onSelect: () => openNode(ctxEntry.value.id, ctxEntry.value.label) },
|
|
397
399
|
...wm.floatWindowsAvailable.value ? [{ label: "Open as window", icon: "i-lucide-picture-in-picture-2", onSelect: () => openAsWindow(ctxEntry.value.id, ctxEntry.value.label) }] : [],
|
|
398
400
|
...props.editable ? [
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import type { DropdownMenuItem } from '@nuxt/ui';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
items: DropdownMenuItem[][];
|
|
4
|
+
/**
|
|
5
|
+
* When true, render the trigger content only — no right-click context menu
|
|
6
|
+
* is attached. Used by read-only surfaces (e.g. the marketing docs viewer)
|
|
7
|
+
* that want the element without the node mutation menu.
|
|
8
|
+
*/
|
|
9
|
+
disabled?: boolean;
|
|
4
10
|
};
|
|
5
|
-
declare var
|
|
11
|
+
declare var __VLS_1: {}, __VLS_12: {};
|
|
6
12
|
type __VLS_Slots = {} & {
|
|
7
|
-
default?: (props: typeof
|
|
13
|
+
default?: (props: typeof __VLS_1) => any;
|
|
14
|
+
} & {
|
|
15
|
+
default?: (props: typeof __VLS_12) => any;
|
|
8
16
|
};
|
|
9
17
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
18
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
defineProps({
|
|
3
|
-
items: { type: Array, required: true }
|
|
3
|
+
items: { type: Array, required: true },
|
|
4
|
+
disabled: { type: Boolean, required: false }
|
|
4
5
|
});
|
|
5
6
|
</script>
|
|
6
7
|
|
|
7
8
|
<template>
|
|
9
|
+
<slot v-if="disabled" />
|
|
8
10
|
<UContextMenu
|
|
11
|
+
v-else
|
|
9
12
|
:items="items"
|
|
10
13
|
@contextmenu.stop
|
|
11
14
|
>
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import type { DropdownMenuItem } from '@nuxt/ui';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
items: DropdownMenuItem[][];
|
|
4
|
+
/**
|
|
5
|
+
* When true, render the trigger content only — no right-click context menu
|
|
6
|
+
* is attached. Used by read-only surfaces (e.g. the marketing docs viewer)
|
|
7
|
+
* that want the element without the node mutation menu.
|
|
8
|
+
*/
|
|
9
|
+
disabled?: boolean;
|
|
4
10
|
};
|
|
5
|
-
declare var
|
|
11
|
+
declare var __VLS_1: {}, __VLS_12: {};
|
|
6
12
|
type __VLS_Slots = {} & {
|
|
7
|
-
default?: (props: typeof
|
|
13
|
+
default?: (props: typeof __VLS_1) => any;
|
|
14
|
+
} & {
|
|
15
|
+
default?: (props: typeof __VLS_12) => any;
|
|
8
16
|
};
|
|
9
17
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
18
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { computed, ref } from "vue";
|
|
2
2
|
import { useToast, useRouter } from "#imports";
|
|
3
3
|
import { useAbracadabra } from "./useAbracadabra.js";
|
|
4
|
+
import { useDocSlugs } from "./useDocSlugs.js";
|
|
4
5
|
import { useAbraLocale } from "./useAbraLocale.js";
|
|
5
6
|
export const DOC_SNAPSHOTS_KEY = Symbol("doc-snapshots");
|
|
6
7
|
export function triggerBadgeColor(trigger) {
|
|
@@ -41,6 +42,7 @@ export function useDocSnapshots(docId, overrides) {
|
|
|
41
42
|
const locale = useAbraLocale("snapshots", overrides);
|
|
42
43
|
const toast = useToast();
|
|
43
44
|
const router = useRouter();
|
|
45
|
+
const { getDocUrl } = useDocSlugs();
|
|
44
46
|
const snapshots = ref([]);
|
|
45
47
|
const loading = ref(false);
|
|
46
48
|
const error = ref(null);
|
|
@@ -204,7 +206,7 @@ export function useDocSnapshots(docId, overrides) {
|
|
|
204
206
|
variant: "outline",
|
|
205
207
|
onClick: (e) => {
|
|
206
208
|
e?.stopPropagation();
|
|
207
|
-
router.push(
|
|
209
|
+
router.push(getDocUrl(res.doc_id));
|
|
208
210
|
}
|
|
209
211
|
}]
|
|
210
212
|
});
|