@abraca/nuxt 2.51.0 → 2.53.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.vue +9 -1
- package/dist/runtime/components/ADocSubPageList.vue +1 -0
- package/dist/runtime/components/ADocViewToggle.vue +10 -2
- package/dist/runtime/components/ADocumentTree.vue +93 -78
- package/dist/runtime/components/AEditor.d.vue.ts +10 -10
- package/dist/runtime/components/AEditor.vue +249 -232
- package/dist/runtime/components/AEditor.vue.d.ts +10 -10
- package/dist/runtime/components/ANodePanel.d.vue.ts +10 -0
- package/dist/runtime/components/ANodePanel.vue +40 -12
- package/dist/runtime/components/ANodePanel.vue.d.ts +10 -0
- package/dist/runtime/components/ANodeSettingsPanel.d.vue.ts +8 -0
- package/dist/runtime/components/ANodeSettingsPanel.vue +22 -8
- package/dist/runtime/components/ANodeSettingsPanel.vue.d.ts +8 -0
- package/dist/runtime/components/renderers/ACalendarRenderer.vue +1 -0
- package/dist/runtime/components/renderers/AChartRenderer.client.vue +1 -0
- package/dist/runtime/components/renderers/AChecklistRenderer.vue +1 -0
- package/dist/runtime/components/renderers/ADashboardRenderer.vue +1 -0
- package/dist/runtime/components/renderers/AGalleryRenderer.vue +1 -0
- package/dist/runtime/components/renderers/AGraphRenderer.vue +1 -0
- package/dist/runtime/components/renderers/AKanbanRenderer.vue +1 -0
- package/dist/runtime/components/renderers/AMapRenderer.vue +1 -0
- package/dist/runtime/components/renderers/AMediaRenderer.vue +3 -0
- package/dist/runtime/components/renderers/AOutlineRenderer.vue +1 -0
- package/dist/runtime/components/renderers/AOverviewRenderer.vue +1 -0
- package/dist/runtime/components/renderers/ASheetsRenderer.client.vue +1 -0
- package/dist/runtime/components/renderers/ASlidesRenderer.vue +1 -0
- package/dist/runtime/components/renderers/ATableRenderer.vue +1 -0
- package/dist/runtime/components/renderers/ATimelineRenderer.vue +1 -0
- package/dist/runtime/components/renderers/table/ATableColumnHeader.d.vue.ts +6 -0
- package/dist/runtime/components/renderers/table/ATableColumnHeader.vue +24 -19
- package/dist/runtime/components/renderers/table/ATableColumnHeader.vue.d.ts +6 -0
- package/dist/runtime/components/renderers/table/ATableFlatMode.vue +2 -0
- package/dist/runtime/components/renderers/table/ATableHierarchyMode.vue +2 -0
- package/dist/runtime/components/renderers/table/ATableToolbar.vue +18 -2
- package/dist/runtime/components/shell/ADocPanelSettings.d.vue.ts +8 -0
- package/dist/runtime/components/shell/ADocPanelSettings.vue +5 -2
- package/dist/runtime/components/shell/ADocPanelSettings.vue.d.ts +8 -0
- package/dist/runtime/composables/useDocSeo.js +11 -5
- package/dist/runtime/composables/useNodeContextMenu.d.ts +11 -0
- package/dist/runtime/composables/useNodeContextMenu.js +13 -3
- package/dist/runtime/composables/useNodePanel.d.ts +11 -4
- package/dist/runtime/composables/useNodePanel.js +2 -17
- package/dist/runtime/composables/useProviderRole.d.ts +17 -0
- package/dist/runtime/composables/useProviderRole.js +22 -0
- package/dist/runtime/extensions/views/DocLinkView.d.vue.ts +12 -0
- package/dist/runtime/extensions/views/DocLinkView.vue +140 -20
- package/dist/runtime/extensions/views/DocLinkView.vue.d.ts +12 -0
- package/dist/runtime/extensions/views/DocumentMetaView.vue +50 -0
- package/package.json +1 -1
|
@@ -19,6 +19,8 @@ import { useDocLinkPick } from "../composables/useDocLinkPick";
|
|
|
19
19
|
import { makeDocSearch } from "../composables/useDocSuggest";
|
|
20
20
|
import { DocSuggest } from "../extensions/doc-suggest";
|
|
21
21
|
import { useNodeContextMenu } from "../composables/useNodeContextMenu";
|
|
22
|
+
import { useDocumentPermissions } from "../composables/useDocumentPermissions";
|
|
23
|
+
import { useProviderRole } from "../composables/useProviderRole";
|
|
22
24
|
import { DOC_DRAG_MIME, isDocDrag, parseDocDragPayload, isDescendantInMap } from "../utils/docDragDrop";
|
|
23
25
|
import { useEditorToolbar } from "../composables/useEditorToolbar";
|
|
24
26
|
import { useEditorSuggestions } from "../composables/useEditorSuggestions";
|
|
@@ -51,7 +53,7 @@ const props = defineProps({
|
|
|
51
53
|
const viewMode = ref("rich");
|
|
52
54
|
const emit = defineEmits(["ready", "update", "rename", "updateMeta"]);
|
|
53
55
|
const model = defineModel({ type: null });
|
|
54
|
-
const { doc, provider, registry } = useNuxtApp().$abracadabra;
|
|
56
|
+
const { doc, provider, registry, effectiveRole } = useNuxtApp().$abracadabra;
|
|
55
57
|
const { connections, getProviderForDoc, getDocForDoc } = useSpaceConnections();
|
|
56
58
|
const ownerProvider = computed(() => getProviderForDoc(props.docId) ?? provider.value);
|
|
57
59
|
const ownerDoc = shallowRef(getDocForDoc(props.docId) ?? doc.value);
|
|
@@ -72,13 +74,20 @@ watch(ownerProvider, async (prov) => {
|
|
|
72
74
|
onBeforeUnmount(() => {
|
|
73
75
|
ownerProvider.value?.unpinChild?.(props.docId);
|
|
74
76
|
});
|
|
77
|
+
const childProviderRole = useProviderRole(childProvider);
|
|
78
|
+
const roleForDoc = computed(() => childProviderRole.value ?? effectiveRole.value);
|
|
79
|
+
const { canWrite: roleCanWrite } = useDocumentPermissions(roleForDoc);
|
|
80
|
+
const effectiveEditable = computed(
|
|
81
|
+
() => props.editable !== false && (!roleForDoc.value || roleCanWrite.value)
|
|
82
|
+
);
|
|
83
|
+
const bcCanWrite = effectiveEditable;
|
|
75
84
|
const docSuggestEnabled = (useRuntimeConfig().public?.abracadabra?.docPicker ?? "inline") === "inline";
|
|
76
85
|
const _suggestTree = useChildTree(ownerDoc, props.docId);
|
|
77
86
|
const docSuggestExt = DocSuggest.configure({
|
|
78
87
|
search: makeDocSearch(_suggestTree, props.docId),
|
|
79
88
|
onCommit: (item, mode, range, query) => {
|
|
80
89
|
const ed = editorRef.value?.editor;
|
|
81
|
-
if (!ed || !
|
|
90
|
+
if (!ed || !effectiveEditable.value) return;
|
|
82
91
|
let docId = item.id;
|
|
83
92
|
if (item.isCreate) docId = _suggestTree.createChild(props.docId, query.trim() || "Untitled", "doc");
|
|
84
93
|
if (!docId) return;
|
|
@@ -463,7 +472,7 @@ const docDragBus = useDocDragBus();
|
|
|
463
472
|
const breadcrumbDragId = ref(null);
|
|
464
473
|
const breadcrumbDropTargetId = ref(null);
|
|
465
474
|
function onBcDragStart(e, a) {
|
|
466
|
-
if (!
|
|
475
|
+
if (!effectiveEditable.value) return;
|
|
467
476
|
breadcrumbDragId.value = a.id;
|
|
468
477
|
if (e.dataTransfer) {
|
|
469
478
|
e.dataTransfer.effectAllowed = "move";
|
|
@@ -500,7 +509,7 @@ function onBcDrop(e, ancestorId) {
|
|
|
500
509
|
e.preventDefault();
|
|
501
510
|
e.stopPropagation();
|
|
502
511
|
breadcrumbDropTargetId.value = null;
|
|
503
|
-
if (!
|
|
512
|
+
if (!effectiveEditable.value) return;
|
|
504
513
|
const payload = parseDocDragPayload(e);
|
|
505
514
|
if (!payload) return;
|
|
506
515
|
if (payload.id === ancestorId) return;
|
|
@@ -538,6 +547,7 @@ function bcMenuItems(a) {
|
|
|
538
547
|
type: a.type,
|
|
539
548
|
tree: bcTree,
|
|
540
549
|
registry,
|
|
550
|
+
canWrite: bcCanWrite.value,
|
|
541
551
|
favorites: { isFavorite, toggleFavorite },
|
|
542
552
|
onOpen: (id) => navigateTo(getDocUrl(id)),
|
|
543
553
|
onOpenInWindow: floatWindowsAvailable.value ? () => bcOpenAsWindow(a.id, a.label) : void 0,
|
|
@@ -558,269 +568,276 @@ function onPlusClick(e, onClick) {
|
|
|
558
568
|
</script>
|
|
559
569
|
|
|
560
570
|
<template>
|
|
561
|
-
<ClientOnly>
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
>
|
|
568
|
-
|
|
569
|
-
<div
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
571
|
+
<!-- Real root element: <ClientOnly> as template root silently DROPS attr
|
|
572
|
+
fallthrough, so mount classes like ANodePanel's `flex-1 overflow-y-auto`
|
|
573
|
+
never reached the canvas — read-only slideovers couldn't scroll at all
|
|
574
|
+
(editable ones masked it via caret scrolling). A plain block root
|
|
575
|
+
restores Vue's automatic inheritance and is the scroll container. -->
|
|
576
|
+
<div class="aeditor-root">
|
|
577
|
+
<ClientOnly>
|
|
578
|
+
<!-- Loading skeleton while extensions and child provider are loading -->
|
|
579
|
+
<div
|
|
580
|
+
v-if="!extensions.length"
|
|
581
|
+
class="p-6 space-y-3"
|
|
582
|
+
:class="{ 'prose-variant': variant === 'prose' }"
|
|
583
|
+
>
|
|
584
|
+
<div class="h-8 w-64 animate-pulse rounded bg-elevated" />
|
|
585
|
+
<div class="h-4 w-full animate-pulse rounded bg-elevated" />
|
|
586
|
+
<div class="h-4 w-3/4 animate-pulse rounded bg-elevated" />
|
|
587
|
+
<div class="h-4 w-5/6 animate-pulse rounded bg-elevated" />
|
|
588
|
+
</div>
|
|
573
589
|
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
590
|
+
<!-- Source view: read-only CodeMirror over getXmlFragment('default').toString() -->
|
|
591
|
+
<div
|
|
592
|
+
v-else-if="viewMode === 'source'"
|
|
593
|
+
class="aeditor-source-wrap"
|
|
594
|
+
>
|
|
595
|
+
<div class="aeditor-source-toolbar">
|
|
596
|
+
<span class="aeditor-source-toolbar__label">
|
|
597
|
+
<UIcon
|
|
598
|
+
name="i-lucide-code-xml"
|
|
599
|
+
class="size-3.5"
|
|
600
|
+
/>
|
|
601
|
+
XML source — read-only mirror of <code>getXmlFragment('default')</code>
|
|
602
|
+
</span>
|
|
603
|
+
<UButton
|
|
604
|
+
icon="i-lucide-file-text"
|
|
605
|
+
size="xs"
|
|
606
|
+
variant="ghost"
|
|
607
|
+
color="neutral"
|
|
608
|
+
label="Rich text"
|
|
609
|
+
@click="viewMode = 'rich'"
|
|
584
610
|
/>
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
label="Rich text"
|
|
593
|
-
@click="viewMode = 'rich'"
|
|
611
|
+
</div>
|
|
612
|
+
<ACodeEditor
|
|
613
|
+
:provider="childProvider"
|
|
614
|
+
field-name="default"
|
|
615
|
+
language="plain"
|
|
616
|
+
:read-only="true"
|
|
617
|
+
:as-xml-fragment="true"
|
|
594
618
|
/>
|
|
595
619
|
</div>
|
|
596
|
-
<ACodeEditor
|
|
597
|
-
:provider="childProvider"
|
|
598
|
-
field-name="default"
|
|
599
|
-
language="plain"
|
|
600
|
-
:read-only="true"
|
|
601
|
-
:as-xml-fragment="true"
|
|
602
|
-
/>
|
|
603
|
-
</div>
|
|
604
620
|
|
|
605
|
-
|
|
621
|
+
<!-- Editor canvas: ancestor breadcrumb (cou-sh parity) + the TipTap editor,
|
|
606
622
|
stacked in one scroll container (the parent's overflow class falls
|
|
607
623
|
through to this wrapper). -->
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
>
|
|
612
|
-
<nav
|
|
613
|
-
v-if="showBreadcrumb && ancestorChain.length"
|
|
614
|
-
aria-label="Breadcrumb"
|
|
615
|
-
class="aeditor-breadcrumb"
|
|
624
|
+
<div
|
|
625
|
+
v-else
|
|
626
|
+
class="aeditor-canvas"
|
|
616
627
|
>
|
|
617
|
-
<
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
628
|
+
<nav
|
|
629
|
+
v-if="showBreadcrumb && ancestorChain.length"
|
|
630
|
+
aria-label="Breadcrumb"
|
|
631
|
+
class="aeditor-breadcrumb"
|
|
632
|
+
>
|
|
633
|
+
<ol class="flex items-center gap-0.5 min-w-0">
|
|
634
|
+
<template
|
|
635
|
+
v-for="(ancestor, idx) in ancestorChain"
|
|
636
|
+
:key="ancestor.id"
|
|
625
637
|
>
|
|
626
|
-
<
|
|
627
|
-
|
|
628
|
-
class="
|
|
629
|
-
/>
|
|
630
|
-
</li>
|
|
631
|
-
<li class="flex min-w-0">
|
|
632
|
-
<ANodeContextMenu
|
|
633
|
-
:items="bcMenuItems(ancestor)"
|
|
634
|
-
:disabled="!breadcrumbMenu"
|
|
638
|
+
<li
|
|
639
|
+
v-if="idx > 0"
|
|
640
|
+
class="flex shrink-0"
|
|
635
641
|
>
|
|
636
|
-
<
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
642
|
+
<UIcon
|
|
643
|
+
name="i-lucide-chevron-right"
|
|
644
|
+
class="size-4 text-(--ui-text-dimmed)"
|
|
645
|
+
/>
|
|
646
|
+
</li>
|
|
647
|
+
<li class="flex min-w-0">
|
|
648
|
+
<ANodeContextMenu
|
|
649
|
+
:items="bcMenuItems(ancestor)"
|
|
650
|
+
:disabled="!breadcrumbMenu"
|
|
651
|
+
>
|
|
652
|
+
<button
|
|
653
|
+
type="button"
|
|
654
|
+
draggable="true"
|
|
655
|
+
class="flex items-center gap-1.5 px-1.5 py-0.5 rounded-md text-sm font-medium transition-colors min-w-0 select-none cursor-pointer"
|
|
656
|
+
:class="[
|
|
641
657
|
breadcrumbDragId === ancestor.id ? 'opacity-30' : '',
|
|
642
658
|
breadcrumbDropTargetId === ancestor.id ? 'bg-(--ui-primary)/10 ring-2 ring-(--ui-primary)/50 text-(--ui-text)' : 'text-(--ui-text-muted) hover:bg-(--ui-bg-elevated)/60 hover:text-(--ui-text)'
|
|
643
659
|
]"
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
660
|
+
@click="navigateTo(ancestor.to)"
|
|
661
|
+
@dragstart="onBcDragStart($event, ancestor)"
|
|
662
|
+
@dragend="onBcDragEnd"
|
|
663
|
+
@dragover="onBcDragOver($event, ancestor.id)"
|
|
664
|
+
@dragleave="onBcDragLeave"
|
|
665
|
+
@drop="onBcDrop($event, ancestor.id)"
|
|
666
|
+
>
|
|
667
|
+
<UIcon
|
|
668
|
+
:name="ancestor.icon"
|
|
669
|
+
class="size-4 shrink-0"
|
|
670
|
+
/>
|
|
671
|
+
<span class="truncate">{{ ancestor.label }}</span>
|
|
672
|
+
</button>
|
|
673
|
+
</ANodeContextMenu>
|
|
674
|
+
</li>
|
|
675
|
+
</template>
|
|
676
|
+
</ol>
|
|
677
|
+
</nav>
|
|
662
678
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
>
|
|
676
|
-
<!-- Floating source-view toggle (opt-in via :show-source-toggle="true") -->
|
|
677
|
-
<UButton
|
|
678
|
-
v-if="showSourceToggle"
|
|
679
|
-
class="aeditor-source-toggle"
|
|
680
|
-
icon="i-lucide-code-xml"
|
|
681
|
-
size="xs"
|
|
682
|
-
variant="ghost"
|
|
683
|
-
color="neutral"
|
|
684
|
-
:title="'View XML source'"
|
|
685
|
-
@click="viewMode = 'source'"
|
|
686
|
-
/>
|
|
687
|
-
<!-- Default slot: app can override entire editor content -->
|
|
688
|
-
<slot
|
|
689
|
-
:editor="editor"
|
|
690
|
-
:connected-users="connectedUsers"
|
|
691
|
-
:ready="ready"
|
|
679
|
+
<UEditor
|
|
680
|
+
ref="editorRef"
|
|
681
|
+
v-slot="{ editor }"
|
|
682
|
+
v-model="model"
|
|
683
|
+
:class="{ 'prose-variant': variant === 'prose' }"
|
|
684
|
+
:content-type="contentType"
|
|
685
|
+
:editable="effectiveEditable"
|
|
686
|
+
:extensions="extensions"
|
|
687
|
+
:starter-kit="{ undoRedo: false, codeBlock: false, document: false }"
|
|
688
|
+
:handlers="editorHandlers"
|
|
689
|
+
:placeholder="placeholder"
|
|
690
|
+
@update:model-value="emit('update', $event)"
|
|
692
691
|
>
|
|
693
|
-
<!--
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
692
|
+
<!-- Floating source-view toggle (opt-in via :show-source-toggle="true") -->
|
|
693
|
+
<UButton
|
|
694
|
+
v-if="showSourceToggle"
|
|
695
|
+
class="aeditor-source-toggle"
|
|
696
|
+
icon="i-lucide-code-xml"
|
|
697
|
+
size="xs"
|
|
698
|
+
variant="ghost"
|
|
699
|
+
color="neutral"
|
|
700
|
+
:title="'View XML source'"
|
|
701
|
+
@click="viewMode = 'source'"
|
|
702
|
+
/>
|
|
703
|
+
<!-- Default slot: app can override entire editor content -->
|
|
704
|
+
<slot
|
|
699
705
|
:editor="editor"
|
|
700
|
-
:
|
|
701
|
-
|
|
702
|
-
:should-show="({ view, state }) => view.hasFocus() && !state.selection.empty"
|
|
706
|
+
:connected-users="connectedUsers"
|
|
707
|
+
:ready="ready"
|
|
703
708
|
>
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
709
|
+
<!-- ── Bubble toolbar (appears when text is selected) ─────────────── -->
|
|
710
|
+
<!-- 4 named slots are forwarded to consumers:
|
|
711
|
+
#link / #doc-link — defaulted to ALinkPopover / ADocLinkPopover
|
|
712
|
+
#create-child-doc / #send-to-chat — empty by default; app-defined -->
|
|
713
|
+
<UEditorToolbar
|
|
714
|
+
v-if="showToolbar"
|
|
715
|
+
:editor="editor"
|
|
716
|
+
:items="toolbarItems"
|
|
717
|
+
layout="bubble"
|
|
718
|
+
:should-show="({ view, state }) => view.hasFocus() && !state.selection.empty"
|
|
719
|
+
>
|
|
720
|
+
<template #link>
|
|
721
|
+
<slot
|
|
722
|
+
name="link"
|
|
723
|
+
:editor="editor"
|
|
724
|
+
>
|
|
725
|
+
<ALinkPopover :editor="editor" />
|
|
726
|
+
</slot>
|
|
727
|
+
</template>
|
|
728
|
+
<template #doc-link>
|
|
729
|
+
<slot
|
|
730
|
+
name="doc-link"
|
|
731
|
+
:editor="editor"
|
|
732
|
+
>
|
|
733
|
+
<ADocLinkPopover :editor="editor" />
|
|
734
|
+
</slot>
|
|
735
|
+
</template>
|
|
736
|
+
<template #create-child-doc>
|
|
737
|
+
<slot
|
|
738
|
+
name="create-child-doc"
|
|
739
|
+
:editor="editor"
|
|
740
|
+
/>
|
|
741
|
+
</template>
|
|
742
|
+
<template #send-to-chat>
|
|
743
|
+
<slot
|
|
744
|
+
name="send-to-chat"
|
|
745
|
+
:editor="editor"
|
|
746
|
+
/>
|
|
747
|
+
</template>
|
|
748
|
+
</UEditorToolbar>
|
|
740
749
|
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
750
|
+
<!-- ── Slash command menu ──────────────────────────────────────────── -->
|
|
751
|
+
<UEditorSuggestionMenu
|
|
752
|
+
v-if="showSuggestionMenu"
|
|
753
|
+
:editor="editor"
|
|
754
|
+
:items="suggestionItems"
|
|
755
|
+
/>
|
|
746
756
|
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
757
|
+
<!-- ── Emoji menu (`:` trigger) ───────────────────────────────────── -->
|
|
758
|
+
<UEditorEmojiMenu
|
|
759
|
+
:editor="editor"
|
|
760
|
+
:items="emojiItems"
|
|
761
|
+
/>
|
|
752
762
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
:editor="editor"
|
|
758
|
-
@node-change="dragHandle.onNodeChange"
|
|
759
|
-
>
|
|
760
|
-
<!-- Plus: insert block via slash menu -->
|
|
761
|
-
<UButton
|
|
762
|
-
icon="i-lucide-plus"
|
|
763
|
-
color="neutral"
|
|
764
|
-
variant="ghost"
|
|
765
|
-
size="sm"
|
|
766
|
-
:class="ui.handle()"
|
|
767
|
-
@click="(e) => onPlusClick(e, onClick)"
|
|
763
|
+
<!-- ── Mention menu (`@` trigger) — users + docs + plugin providers ── -->
|
|
764
|
+
<UEditorMentionMenu
|
|
765
|
+
:editor="editor"
|
|
766
|
+
:items="mentionItems"
|
|
768
767
|
/>
|
|
769
768
|
|
|
770
|
-
<!--
|
|
771
|
-
<
|
|
772
|
-
v-
|
|
773
|
-
|
|
774
|
-
:
|
|
775
|
-
|
|
776
|
-
:ui="{ content: 'w-48', label: 'text-xs' }"
|
|
777
|
-
@update:open="(v) => editor.chain().setMeta('lockDragHandle', v).run()"
|
|
769
|
+
<!-- ── Drag handle — plus button + grip dropdown ───────────────────── -->
|
|
770
|
+
<UEditorDragHandle
|
|
771
|
+
v-if="showDragHandle"
|
|
772
|
+
v-slot="{ ui, onClick }"
|
|
773
|
+
:editor="editor"
|
|
774
|
+
@node-change="dragHandle.onNodeChange"
|
|
778
775
|
>
|
|
776
|
+
<!-- Plus: insert block via slash menu -->
|
|
779
777
|
<UButton
|
|
778
|
+
icon="i-lucide-plus"
|
|
780
779
|
color="neutral"
|
|
781
780
|
variant="ghost"
|
|
782
|
-
:active-variant="'soft'"
|
|
783
781
|
size="sm"
|
|
784
|
-
icon="i-lucide-grip-vertical"
|
|
785
|
-
:active="open"
|
|
786
782
|
:class="ui.handle()"
|
|
783
|
+
@click="(e) => onPlusClick(e, onClick)"
|
|
787
784
|
/>
|
|
788
|
-
</UDropdownMenu>
|
|
789
|
-
</UEditorDragHandle>
|
|
790
785
|
|
|
791
|
-
|
|
786
|
+
<!-- Grip: block context menu -->
|
|
787
|
+
<UDropdownMenu
|
|
788
|
+
v-slot="{ open }"
|
|
789
|
+
:modal="false"
|
|
790
|
+
:items="dragHandle.getItems(editor)"
|
|
791
|
+
:content="{ side: 'left' }"
|
|
792
|
+
:ui="{ content: 'w-48', label: 'text-xs' }"
|
|
793
|
+
@update:open="(v) => editor.chain().setMeta('lockDragHandle', v).run()"
|
|
794
|
+
>
|
|
795
|
+
<UButton
|
|
796
|
+
color="neutral"
|
|
797
|
+
variant="ghost"
|
|
798
|
+
:active-variant="'soft'"
|
|
799
|
+
size="sm"
|
|
800
|
+
icon="i-lucide-grip-vertical"
|
|
801
|
+
:active="open"
|
|
802
|
+
:class="ui.handle()"
|
|
803
|
+
/>
|
|
804
|
+
</UDropdownMenu>
|
|
805
|
+
</UEditorDragHandle>
|
|
806
|
+
|
|
807
|
+
<!-- Inline `[[` doc-link / `![[` doc-embed mention-style popup
|
|
792
808
|
(only mounted when docPicker === 'inline'). -->
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
809
|
+
<ADocSuggestMenu
|
|
810
|
+
v-if="docSuggestEnabled && editor?.storage?.docSuggest"
|
|
811
|
+
:state="editor.storage.docSuggest.popup"
|
|
812
|
+
/>
|
|
813
|
+
</slot>
|
|
814
|
+
</UEditor>
|
|
799
815
|
|
|
800
|
-
|
|
816
|
+
<!-- Comprehensive child-document browser, mirroring cou-sh's DocRenderer
|
|
801
817
|
which renders <DocSubPageList> below the editor body. -->
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
</div>
|
|
810
|
-
|
|
811
|
-
<template #fallback>
|
|
812
|
-
<div
|
|
813
|
-
class="p-6 space-y-3"
|
|
814
|
-
:class="{ 'prose-variant': variant === 'prose' }"
|
|
815
|
-
>
|
|
816
|
-
<div class="h-8 w-64 animate-pulse rounded bg-elevated" />
|
|
817
|
-
<div class="h-4 w-full animate-pulse rounded bg-elevated" />
|
|
818
|
-
<div class="h-4 w-3/4 animate-pulse rounded bg-elevated" />
|
|
818
|
+
<ADocSubPageList
|
|
819
|
+
v-if="showSubPages && docId"
|
|
820
|
+
:doc-id="docId"
|
|
821
|
+
:editable="effectiveEditable"
|
|
822
|
+
:expanded="variant !== 'prose'"
|
|
823
|
+
class="mt-2"
|
|
824
|
+
/>
|
|
819
825
|
</div>
|
|
820
|
-
|
|
821
|
-
|
|
826
|
+
|
|
827
|
+
<template #fallback>
|
|
828
|
+
<div
|
|
829
|
+
class="p-6 space-y-3"
|
|
830
|
+
:class="{ 'prose-variant': variant === 'prose' }"
|
|
831
|
+
>
|
|
832
|
+
<div class="h-8 w-64 animate-pulse rounded bg-elevated" />
|
|
833
|
+
<div class="h-4 w-full animate-pulse rounded bg-elevated" />
|
|
834
|
+
<div class="h-4 w-3/4 animate-pulse rounded bg-elevated" />
|
|
835
|
+
</div>
|
|
836
|
+
</template>
|
|
837
|
+
</ClientOnly>
|
|
838
|
+
</div>
|
|
822
839
|
</template>
|
|
823
840
|
|
|
824
841
|
<style scoped>
|
|
825
|
-
.aeditor-canvas{display:flex;flex-direction:column;min-height:0}.aeditor-breadcrumb{flex-shrink:0;padding:1rem 0 0}@media (min-width:640px){.aeditor-breadcrumb{padding-left:2rem;padding-right:2rem}}.prose-variant :deep(.tiptap){color:var(--ui-text);font-family:ui-serif,Georgia,Cambria,Times New Roman,Times,serif;font-size:1.0625rem;line-height:1.75}.prose-variant :deep(.tiptap p){margin-bottom:1em;margin-top:0}.prose-variant :deep(.tiptap h1),.prose-variant :deep(.tiptap h2),.prose-variant :deep(.tiptap h3),.prose-variant :deep(.tiptap h4){font-family:ui-serif,Georgia,Cambria,Times New Roman,Times,serif;letter-spacing:-.01em;line-height:1.25;margin-bottom:.5em;margin-top:1.75em}.prose-variant :deep(.tiptap h1){font-size:2rem;font-weight:700}.prose-variant :deep(.tiptap h2){font-size:1.5rem;font-weight:700}.prose-variant :deep(.tiptap h3){font-size:1.25rem;font-weight:600}.prose-variant :deep(.tiptap blockquote){border-left:3px solid var(--ui-border);color:var(--ui-text-muted);font-style:italic;margin-left:0;padding-left:1em}.prose-variant :deep(.tiptap ol),.prose-variant :deep(.tiptap ul){margin-bottom:1em;padding-left:1.5em}.prose-variant :deep(.tiptap .document-header){font-family:ui-serif,Georgia,Cambria,Times New Roman,Times,serif;font-size:2.75rem;font-weight:700;letter-spacing:-.02em;line-height:1.15;margin-bottom:1.5rem}.aeditor-source-wrap{display:flex;flex:1 1 0;flex-direction:column;min-height:0}.aeditor-source-toolbar{align-items:center;background:var(--ui-bg);border-bottom:1px solid var(--ui-border);display:flex;flex-shrink:0;justify-content:space-between;padding:.375rem .75rem}.aeditor-source-toolbar__label{align-items:center;color:var(--ui-text-muted);display:inline-flex;font-size:.75rem;gap:.375rem}.aeditor-source-toolbar__label code{background:var(--ui-bg-elevated);border:1px solid var(--ui-border);border-radius:var(--ui-radius);font-family:ui-monospace,SF Mono,Menlo,Monaco,Consolas,monospace;font-size:.7rem;padding:.05rem .3rem}.aeditor-source-toggle{opacity:.6;position:absolute;right:.375rem;top:.375rem;transition:opacity .12s ease;z-index:5}.aeditor-source-toggle:hover{opacity:1}
|
|
842
|
+
.aeditor-root{min-height:0;min-width:0}.aeditor-canvas{display:flex;flex-direction:column;min-height:0}.aeditor-breadcrumb{flex-shrink:0;padding:1rem 0 0}@media (min-width:640px){.aeditor-breadcrumb{padding-left:2rem;padding-right:2rem}}.prose-variant :deep(.tiptap){color:var(--ui-text);font-family:ui-serif,Georgia,Cambria,Times New Roman,Times,serif;font-size:1.0625rem;line-height:1.75}.prose-variant :deep(.tiptap p){margin-bottom:1em;margin-top:0}.prose-variant :deep(.tiptap h1),.prose-variant :deep(.tiptap h2),.prose-variant :deep(.tiptap h3),.prose-variant :deep(.tiptap h4){font-family:ui-serif,Georgia,Cambria,Times New Roman,Times,serif;letter-spacing:-.01em;line-height:1.25;margin-bottom:.5em;margin-top:1.75em}.prose-variant :deep(.tiptap h1){font-size:2rem;font-weight:700}.prose-variant :deep(.tiptap h2){font-size:1.5rem;font-weight:700}.prose-variant :deep(.tiptap h3){font-size:1.25rem;font-weight:600}.prose-variant :deep(.tiptap blockquote){border-left:3px solid var(--ui-border);color:var(--ui-text-muted);font-style:italic;margin-left:0;padding-left:1em}.prose-variant :deep(.tiptap ol),.prose-variant :deep(.tiptap ul){margin-bottom:1em;padding-left:1.5em}.prose-variant :deep(.tiptap .document-header){font-family:ui-serif,Georgia,Cambria,Times New Roman,Times,serif;font-size:2.75rem;font-weight:700;letter-spacing:-.02em;line-height:1.15;margin-bottom:1.5rem}.aeditor-source-wrap{display:flex;flex:1 1 0;flex-direction:column;min-height:0}.aeditor-source-toolbar{align-items:center;background:var(--ui-bg);border-bottom:1px solid var(--ui-border);display:flex;flex-shrink:0;justify-content:space-between;padding:.375rem .75rem}.aeditor-source-toolbar__label{align-items:center;color:var(--ui-text-muted);display:inline-flex;font-size:.75rem;gap:.375rem}.aeditor-source-toolbar__label code{background:var(--ui-bg-elevated);border:1px solid var(--ui-border);border-radius:var(--ui-radius);font-family:ui-monospace,SF Mono,Menlo,Monaco,Consolas,monospace;font-size:.7rem;padding:.05rem .3rem}.aeditor-source-toggle{opacity:.6;position:absolute;right:.375rem;top:.375rem;transition:opacity .12s ease;z-index:5}.aeditor-source-toggle:hover{opacity:1}
|
|
826
843
|
</style>
|
|
@@ -61,7 +61,7 @@ type __VLS_ModelProps = {
|
|
|
61
61
|
modelValue?: any;
|
|
62
62
|
};
|
|
63
63
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
64
|
-
declare var
|
|
64
|
+
declare var __VLS_57: {
|
|
65
65
|
editor: any;
|
|
66
66
|
connectedUsers: {
|
|
67
67
|
name: string;
|
|
@@ -70,25 +70,25 @@ declare var __VLS_58: {
|
|
|
70
70
|
docId?: string | undefined;
|
|
71
71
|
}[];
|
|
72
72
|
ready: boolean;
|
|
73
|
-
},
|
|
73
|
+
}, __VLS_66: {
|
|
74
74
|
editor: any;
|
|
75
|
-
},
|
|
75
|
+
}, __VLS_74: {
|
|
76
76
|
editor: any;
|
|
77
|
-
},
|
|
77
|
+
}, __VLS_82: {
|
|
78
78
|
editor: any;
|
|
79
|
-
},
|
|
79
|
+
}, __VLS_85: {
|
|
80
80
|
editor: any;
|
|
81
81
|
};
|
|
82
82
|
type __VLS_Slots = {} & {
|
|
83
|
-
default?: (props: typeof
|
|
83
|
+
default?: (props: typeof __VLS_57) => any;
|
|
84
84
|
} & {
|
|
85
|
-
link?: (props: typeof
|
|
85
|
+
link?: (props: typeof __VLS_66) => any;
|
|
86
86
|
} & {
|
|
87
|
-
'doc-link'?: (props: typeof
|
|
87
|
+
'doc-link'?: (props: typeof __VLS_74) => any;
|
|
88
88
|
} & {
|
|
89
|
-
'create-child-doc'?: (props: typeof
|
|
89
|
+
'create-child-doc'?: (props: typeof __VLS_82) => any;
|
|
90
90
|
} & {
|
|
91
|
-
'send-to-chat'?: (props: typeof
|
|
91
|
+
'send-to-chat'?: (props: typeof __VLS_85) => any;
|
|
92
92
|
};
|
|
93
93
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
94
94
|
editor: import("vue").ComputedRef<any>;
|
|
@@ -26,6 +26,15 @@ type __VLS_Props = {
|
|
|
26
26
|
* one and falls back to the raw id. Override to target a custom route shape.
|
|
27
27
|
*/
|
|
28
28
|
docHref?: (id: string) => string;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the panel may mutate the doc. Pass the host surface's `editable`
|
|
31
|
+
* so a read-only view never spawns an editable slideover. Even when left
|
|
32
|
+
* true (default, back-compat) the panel additionally gates on the child
|
|
33
|
+
* provider's PER-DOC role, so a viewer/observer-scoped doc always opens
|
|
34
|
+
* read-only: editor, page-type renderer, view-toggle type changes, and
|
|
35
|
+
* meta/type patches all follow `panelEditable`.
|
|
36
|
+
*/
|
|
37
|
+
editable?: boolean;
|
|
29
38
|
};
|
|
30
39
|
declare var __VLS_11: {
|
|
31
40
|
nodeId: string | null;
|
|
@@ -44,6 +53,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
44
53
|
onClose?: (() => any) | undefined;
|
|
45
54
|
}>, {
|
|
46
55
|
initialTab: "editor" | "properties" | "chat" | "settings" | "serverSettings" | string;
|
|
56
|
+
editable: boolean;
|
|
47
57
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
48
58
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
49
59
|
declare const _default: typeof __VLS_export;
|