@abraca/nuxt 2.52.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 +6 -3
- package/dist/runtime/components/ADocSubPageList.vue +1 -0
- package/dist/runtime/components/ADocumentTree.vue +1 -0
- package/dist/runtime/components/AEditor.d.vue.ts +10 -10
- package/dist/runtime/components/AEditor.vue +246 -235
- 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 +1 -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/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/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.vue +5 -4
- package/dist/runtime/extensions/views/DocumentMetaView.vue +50 -0
- package/package.json +1 -1
|
@@ -20,6 +20,7 @@ import { makeDocSearch } from "../composables/useDocSuggest";
|
|
|
20
20
|
import { DocSuggest } from "../extensions/doc-suggest";
|
|
21
21
|
import { useNodeContextMenu } from "../composables/useNodeContextMenu";
|
|
22
22
|
import { useDocumentPermissions } from "../composables/useDocumentPermissions";
|
|
23
|
+
import { useProviderRole } from "../composables/useProviderRole";
|
|
23
24
|
import { DOC_DRAG_MIME, isDocDrag, parseDocDragPayload, isDescendantInMap } from "../utils/docDragDrop";
|
|
24
25
|
import { useEditorToolbar } from "../composables/useEditorToolbar";
|
|
25
26
|
import { useEditorSuggestions } from "../composables/useEditorSuggestions";
|
|
@@ -53,10 +54,6 @@ const viewMode = ref("rich");
|
|
|
53
54
|
const emit = defineEmits(["ready", "update", "rename", "updateMeta"]);
|
|
54
55
|
const model = defineModel({ type: null });
|
|
55
56
|
const { doc, provider, registry, effectiveRole } = useNuxtApp().$abracadabra;
|
|
56
|
-
const { canWrite: bcCanWriteRole } = useDocumentPermissions(effectiveRole);
|
|
57
|
-
const bcCanWrite = computed(
|
|
58
|
-
() => props.editable && (!effectiveRole.value || bcCanWriteRole.value)
|
|
59
|
-
);
|
|
60
57
|
const { connections, getProviderForDoc, getDocForDoc } = useSpaceConnections();
|
|
61
58
|
const ownerProvider = computed(() => getProviderForDoc(props.docId) ?? provider.value);
|
|
62
59
|
const ownerDoc = shallowRef(getDocForDoc(props.docId) ?? doc.value);
|
|
@@ -77,13 +74,20 @@ watch(ownerProvider, async (prov) => {
|
|
|
77
74
|
onBeforeUnmount(() => {
|
|
78
75
|
ownerProvider.value?.unpinChild?.(props.docId);
|
|
79
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;
|
|
80
84
|
const docSuggestEnabled = (useRuntimeConfig().public?.abracadabra?.docPicker ?? "inline") === "inline";
|
|
81
85
|
const _suggestTree = useChildTree(ownerDoc, props.docId);
|
|
82
86
|
const docSuggestExt = DocSuggest.configure({
|
|
83
87
|
search: makeDocSearch(_suggestTree, props.docId),
|
|
84
88
|
onCommit: (item, mode, range, query) => {
|
|
85
89
|
const ed = editorRef.value?.editor;
|
|
86
|
-
if (!ed || !
|
|
90
|
+
if (!ed || !effectiveEditable.value) return;
|
|
87
91
|
let docId = item.id;
|
|
88
92
|
if (item.isCreate) docId = _suggestTree.createChild(props.docId, query.trim() || "Untitled", "doc");
|
|
89
93
|
if (!docId) return;
|
|
@@ -468,7 +472,7 @@ const docDragBus = useDocDragBus();
|
|
|
468
472
|
const breadcrumbDragId = ref(null);
|
|
469
473
|
const breadcrumbDropTargetId = ref(null);
|
|
470
474
|
function onBcDragStart(e, a) {
|
|
471
|
-
if (!
|
|
475
|
+
if (!effectiveEditable.value) return;
|
|
472
476
|
breadcrumbDragId.value = a.id;
|
|
473
477
|
if (e.dataTransfer) {
|
|
474
478
|
e.dataTransfer.effectAllowed = "move";
|
|
@@ -505,7 +509,7 @@ function onBcDrop(e, ancestorId) {
|
|
|
505
509
|
e.preventDefault();
|
|
506
510
|
e.stopPropagation();
|
|
507
511
|
breadcrumbDropTargetId.value = null;
|
|
508
|
-
if (!
|
|
512
|
+
if (!effectiveEditable.value) return;
|
|
509
513
|
const payload = parseDocDragPayload(e);
|
|
510
514
|
if (!payload) return;
|
|
511
515
|
if (payload.id === ancestorId) return;
|
|
@@ -564,269 +568,276 @@ function onPlusClick(e, onClick) {
|
|
|
564
568
|
</script>
|
|
565
569
|
|
|
566
570
|
<template>
|
|
567
|
-
<ClientOnly>
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
>
|
|
574
|
-
|
|
575
|
-
<div
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
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>
|
|
579
589
|
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
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'"
|
|
590
610
|
/>
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
label="Rich text"
|
|
599
|
-
@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"
|
|
600
618
|
/>
|
|
601
619
|
</div>
|
|
602
|
-
<ACodeEditor
|
|
603
|
-
:provider="childProvider"
|
|
604
|
-
field-name="default"
|
|
605
|
-
language="plain"
|
|
606
|
-
:read-only="true"
|
|
607
|
-
:as-xml-fragment="true"
|
|
608
|
-
/>
|
|
609
|
-
</div>
|
|
610
620
|
|
|
611
|
-
|
|
621
|
+
<!-- Editor canvas: ancestor breadcrumb (cou-sh parity) + the TipTap editor,
|
|
612
622
|
stacked in one scroll container (the parent's overflow class falls
|
|
613
623
|
through to this wrapper). -->
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
>
|
|
618
|
-
<nav
|
|
619
|
-
v-if="showBreadcrumb && ancestorChain.length"
|
|
620
|
-
aria-label="Breadcrumb"
|
|
621
|
-
class="aeditor-breadcrumb"
|
|
624
|
+
<div
|
|
625
|
+
v-else
|
|
626
|
+
class="aeditor-canvas"
|
|
622
627
|
>
|
|
623
|
-
<
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
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"
|
|
631
637
|
>
|
|
632
|
-
<
|
|
633
|
-
|
|
634
|
-
class="
|
|
635
|
-
/>
|
|
636
|
-
</li>
|
|
637
|
-
<li class="flex min-w-0">
|
|
638
|
-
<ANodeContextMenu
|
|
639
|
-
:items="bcMenuItems(ancestor)"
|
|
640
|
-
:disabled="!breadcrumbMenu"
|
|
638
|
+
<li
|
|
639
|
+
v-if="idx > 0"
|
|
640
|
+
class="flex shrink-0"
|
|
641
641
|
>
|
|
642
|
-
<
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
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="[
|
|
647
657
|
breadcrumbDragId === ancestor.id ? 'opacity-30' : '',
|
|
648
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)'
|
|
649
659
|
]"
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
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>
|
|
668
678
|
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
>
|
|
682
|
-
<!-- Floating source-view toggle (opt-in via :show-source-toggle="true") -->
|
|
683
|
-
<UButton
|
|
684
|
-
v-if="showSourceToggle"
|
|
685
|
-
class="aeditor-source-toggle"
|
|
686
|
-
icon="i-lucide-code-xml"
|
|
687
|
-
size="xs"
|
|
688
|
-
variant="ghost"
|
|
689
|
-
color="neutral"
|
|
690
|
-
:title="'View XML source'"
|
|
691
|
-
@click="viewMode = 'source'"
|
|
692
|
-
/>
|
|
693
|
-
<!-- Default slot: app can override entire editor content -->
|
|
694
|
-
<slot
|
|
695
|
-
:editor="editor"
|
|
696
|
-
:connected-users="connectedUsers"
|
|
697
|
-
: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)"
|
|
698
691
|
>
|
|
699
|
-
<!--
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
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
|
|
705
705
|
:editor="editor"
|
|
706
|
-
:
|
|
707
|
-
|
|
708
|
-
:should-show="({ view, state }) => view.hasFocus() && !state.selection.empty"
|
|
706
|
+
:connected-users="connectedUsers"
|
|
707
|
+
:ready="ready"
|
|
709
708
|
>
|
|
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
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
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>
|
|
746
749
|
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
750
|
+
<!-- ── Slash command menu ──────────────────────────────────────────── -->
|
|
751
|
+
<UEditorSuggestionMenu
|
|
752
|
+
v-if="showSuggestionMenu"
|
|
753
|
+
:editor="editor"
|
|
754
|
+
:items="suggestionItems"
|
|
755
|
+
/>
|
|
752
756
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
757
|
+
<!-- ── Emoji menu (`:` trigger) ───────────────────────────────────── -->
|
|
758
|
+
<UEditorEmojiMenu
|
|
759
|
+
:editor="editor"
|
|
760
|
+
:items="emojiItems"
|
|
761
|
+
/>
|
|
758
762
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
:editor="editor"
|
|
764
|
-
@node-change="dragHandle.onNodeChange"
|
|
765
|
-
>
|
|
766
|
-
<!-- Plus: insert block via slash menu -->
|
|
767
|
-
<UButton
|
|
768
|
-
icon="i-lucide-plus"
|
|
769
|
-
color="neutral"
|
|
770
|
-
variant="ghost"
|
|
771
|
-
size="sm"
|
|
772
|
-
:class="ui.handle()"
|
|
773
|
-
@click="(e) => onPlusClick(e, onClick)"
|
|
763
|
+
<!-- ── Mention menu (`@` trigger) — users + docs + plugin providers ── -->
|
|
764
|
+
<UEditorMentionMenu
|
|
765
|
+
:editor="editor"
|
|
766
|
+
:items="mentionItems"
|
|
774
767
|
/>
|
|
775
768
|
|
|
776
|
-
<!--
|
|
777
|
-
<
|
|
778
|
-
v-
|
|
779
|
-
|
|
780
|
-
:
|
|
781
|
-
|
|
782
|
-
:ui="{ content: 'w-48', label: 'text-xs' }"
|
|
783
|
-
@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"
|
|
784
775
|
>
|
|
776
|
+
<!-- Plus: insert block via slash menu -->
|
|
785
777
|
<UButton
|
|
778
|
+
icon="i-lucide-plus"
|
|
786
779
|
color="neutral"
|
|
787
780
|
variant="ghost"
|
|
788
|
-
:active-variant="'soft'"
|
|
789
781
|
size="sm"
|
|
790
|
-
icon="i-lucide-grip-vertical"
|
|
791
|
-
:active="open"
|
|
792
782
|
:class="ui.handle()"
|
|
783
|
+
@click="(e) => onPlusClick(e, onClick)"
|
|
793
784
|
/>
|
|
794
|
-
</UDropdownMenu>
|
|
795
|
-
</UEditorDragHandle>
|
|
796
785
|
|
|
797
|
-
|
|
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
|
|
798
808
|
(only mounted when docPicker === 'inline'). -->
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
809
|
+
<ADocSuggestMenu
|
|
810
|
+
v-if="docSuggestEnabled && editor?.storage?.docSuggest"
|
|
811
|
+
:state="editor.storage.docSuggest.popup"
|
|
812
|
+
/>
|
|
813
|
+
</slot>
|
|
814
|
+
</UEditor>
|
|
805
815
|
|
|
806
|
-
|
|
816
|
+
<!-- Comprehensive child-document browser, mirroring cou-sh's DocRenderer
|
|
807
817
|
which renders <DocSubPageList> below the editor body. -->
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
</div>
|
|
816
|
-
|
|
817
|
-
<template #fallback>
|
|
818
|
-
<div
|
|
819
|
-
class="p-6 space-y-3"
|
|
820
|
-
:class="{ 'prose-variant': variant === 'prose' }"
|
|
821
|
-
>
|
|
822
|
-
<div class="h-8 w-64 animate-pulse rounded bg-elevated" />
|
|
823
|
-
<div class="h-4 w-full animate-pulse rounded bg-elevated" />
|
|
824
|
-
<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
|
+
/>
|
|
825
825
|
</div>
|
|
826
|
-
|
|
827
|
-
|
|
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>
|
|
828
839
|
</template>
|
|
829
840
|
|
|
830
841
|
<style scoped>
|
|
831
|
-
.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}
|
|
832
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;
|