@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
package/dist/module.json
CHANGED
|
@@ -4,6 +4,8 @@ import { useFetch } from "#imports";
|
|
|
4
4
|
import { useAbracadabra } from "../composables/useAbracadabra";
|
|
5
5
|
import { useSpaceConnections } from "../composables/useSpaceConnections";
|
|
6
6
|
import { usePluginRegistry } from "../composables/usePluginRegistry";
|
|
7
|
+
import { useDocumentPermissions } from "../composables/useDocumentPermissions";
|
|
8
|
+
import { useProviderRole } from "../composables/useProviderRole";
|
|
7
9
|
import { resolveDocType } from "../utils/docTypes";
|
|
8
10
|
const props = defineProps({
|
|
9
11
|
docId: { type: String, required: true },
|
|
@@ -23,6 +25,12 @@ const docMeta = computed(() => props.entry?.meta ?? resolvedEntry.value?.meta ??
|
|
|
23
25
|
const registry = usePluginRegistry();
|
|
24
26
|
const docTypeDef = computed(() => resolveDocType(docType.value, registry));
|
|
25
27
|
const childProvider = shallowRef(null);
|
|
28
|
+
const childProviderRole = useProviderRole(() => childProvider.value);
|
|
29
|
+
const roleForDoc = computed(() => childProviderRole.value ?? abra.effectiveRole.value);
|
|
30
|
+
const { canWrite: canWriteRole } = useDocumentPermissions(roleForDoc);
|
|
31
|
+
const effectiveEditable = computed(
|
|
32
|
+
() => props.editable !== false && (!roleForDoc.value || canWriteRole.value)
|
|
33
|
+
);
|
|
26
34
|
async function loadChildProvider(id) {
|
|
27
35
|
childProvider.value = null;
|
|
28
36
|
if (!id) return;
|
|
@@ -112,7 +120,7 @@ const wrapperClass = computed(
|
|
|
112
120
|
:doc-label="docTitle"
|
|
113
121
|
:doc-meta="docMeta"
|
|
114
122
|
:child-provider="childProvider"
|
|
115
|
-
:editable="
|
|
123
|
+
:editable="effectiveEditable"
|
|
116
124
|
:breadcrumb-menu="breadcrumbMenu"
|
|
117
125
|
:class="resolvedClass"
|
|
118
126
|
/>
|
|
@@ -998,6 +998,7 @@ const isDragActive = computed(() => tiptapDragActive.value || externalDragActive
|
|
|
998
998
|
:node-label="openNodeLabel"
|
|
999
999
|
:child-provider="openNodeProvider"
|
|
1000
1000
|
:is-loading="nodePanelLoading"
|
|
1001
|
+
:editable="editable"
|
|
1001
1002
|
@close="closePanel"
|
|
1002
1003
|
/>
|
|
1003
1004
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref, computed, onBeforeUnmount } from "vue";
|
|
2
|
+
import { ref, computed, onBeforeUnmount, shallowRef, watch } from "vue";
|
|
3
3
|
import { useAbracadabra } from "../composables/useAbracadabra";
|
|
4
|
+
import { useSpaceConnections } from "../composables/useSpaceConnections";
|
|
4
5
|
import { useSyncedMap } from "../composables/useYDoc";
|
|
5
6
|
import { useAbraLocale } from "../composables/useAbraLocale";
|
|
6
7
|
import { resolveDocType, getAvailableDocTypes } from "../utils/docTypes";
|
|
@@ -20,7 +21,14 @@ const props = defineProps({
|
|
|
20
21
|
const emit = defineEmits(["update:modelValue", "select"]);
|
|
21
22
|
const locale = computed(() => useAbraLocale("nodePanel"));
|
|
22
23
|
const { doc, registry } = useAbracadabra();
|
|
23
|
-
const
|
|
24
|
+
const { connections, getDocForDoc } = useSpaceConnections();
|
|
25
|
+
const ownerDoc = shallowRef(
|
|
26
|
+
props.docId ? getDocForDoc(props.docId) ?? doc.value : doc.value
|
|
27
|
+
);
|
|
28
|
+
watch(() => [props.docId, doc.value, connections.size], () => {
|
|
29
|
+
ownerDoc.value = props.docId ? getDocForDoc(props.docId) ?? doc.value : doc.value;
|
|
30
|
+
}, { immediate: true });
|
|
31
|
+
const treeMap = useSyncedMap(ownerDoc, "doc-tree");
|
|
24
32
|
const docTypeDef = computed(() => resolveDocType(props.docType, registry));
|
|
25
33
|
const hasPageType = computed(() => !!(props.docType && props.docType !== "doc"));
|
|
26
34
|
const docTypeItems = computed(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref, computed, nextTick, shallowRef, toRaw, watch } from "vue";
|
|
3
3
|
import { useVirtualizer } from "@tanstack/vue-virtual";
|
|
4
|
-
import { useAbracadabra, useTrash, useChat, useVoice, useToast, useAppConfig, useSyncedMap, useDocImport, useDocExport, useWindowManager, useAwareness } from "#imports";
|
|
4
|
+
import { useAbracadabra, useTrash, useChat, useVoice, useToast, useAppConfig, useSyncedMap, useDocImport, useDocExport, useWindowManager, useAwareness, useDocumentPermissions } from "#imports";
|
|
5
5
|
import { resolveDocType, getAvailableDocTypes } from "../utils/docTypes";
|
|
6
6
|
import { avatarBorderStyle } from "../utils/avatarStyle";
|
|
7
7
|
import { DOC_DRAG_MIME, isDocDrag, parseDocDragPayload, isDescendantInMap } from "../utils/docDragDrop";
|
|
@@ -17,7 +17,11 @@ const props = defineProps({
|
|
|
17
17
|
spaceId: { type: [String, null], required: false, default: null }
|
|
18
18
|
});
|
|
19
19
|
const emit = defineEmits(["navigate", "create"]);
|
|
20
|
-
const { doc, spaceDocId, isReady, provider, client, userName } = useAbracadabra();
|
|
20
|
+
const { doc, spaceDocId, isReady, provider, client, userName, effectiveRole } = useAbracadabra();
|
|
21
|
+
const { canWrite: treeCanWriteRole } = useDocumentPermissions(effectiveRole);
|
|
22
|
+
const canWrite = computed(
|
|
23
|
+
() => props.editable && (!effectiveRole.value || treeCanWriteRole.value)
|
|
24
|
+
);
|
|
21
25
|
const { trashMap, trashedCount, moveToTrash, restoreFromTrash, permanentlyDelete, emptyTrash } = useTrash();
|
|
22
26
|
const _chat = import.meta.client ? useChat() : null;
|
|
23
27
|
const chatChannels = computed(() => _chat?.channels.value ?? {});
|
|
@@ -811,13 +815,15 @@ function isInThisCall(item) {
|
|
|
811
815
|
}
|
|
812
816
|
const { floatWindowsAvailable } = useWindowManager();
|
|
813
817
|
function treeNodeMenuItems(item) {
|
|
814
|
-
const
|
|
818
|
+
const writable = canWrite.value;
|
|
819
|
+
const isMulti = multiSelected.value.size > 1 && multiSelected.value.has(item.id);
|
|
820
|
+
const multiDeleteSection = writable && isMulti ? [[{
|
|
815
821
|
label: `Move ${multiSelected.value.size} items to Trash`,
|
|
816
822
|
icon: "i-lucide-trash-2",
|
|
817
823
|
color: "error",
|
|
818
824
|
onSelect: deleteSelected
|
|
819
825
|
}]] : [];
|
|
820
|
-
const multiExportSection =
|
|
826
|
+
const multiExportSection = isMulti ? [[{
|
|
821
827
|
label: `Export ${multiSelected.value.size} items`,
|
|
822
828
|
icon: "i-lucide-download",
|
|
823
829
|
children: [
|
|
@@ -825,50 +831,68 @@ function treeNodeMenuItems(item) {
|
|
|
825
831
|
{ label: "HTML", icon: "i-lucide-file-code", onSelect: () => exportDocs([...multiSelected.value], "html") }
|
|
826
832
|
]
|
|
827
833
|
}]] : [];
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
834
|
+
const openItems = [
|
|
835
|
+
{
|
|
836
|
+
label: "Open",
|
|
837
|
+
icon: "i-lucide-external-link",
|
|
838
|
+
onSelect: () => emit("navigate", item.id)
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
label: "Open as overlay",
|
|
842
|
+
icon: "i-lucide-panel-right",
|
|
843
|
+
onSelect: () => openAsOverlay(item.id)
|
|
844
|
+
},
|
|
845
|
+
...floatWindowsAvailable.value ? [{
|
|
846
|
+
label: "Open as window",
|
|
847
|
+
icon: "i-lucide-picture-in-picture-2",
|
|
848
|
+
onSelect: () => openAsFloatingWindow(item.id)
|
|
849
|
+
}] : []
|
|
850
|
+
];
|
|
851
|
+
const editItems = writable ? [
|
|
852
|
+
{
|
|
853
|
+
label: "Rename",
|
|
854
|
+
icon: "i-lucide-pencil",
|
|
855
|
+
onSelect: () => startRename(item.id)
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
label: "Duplicate",
|
|
859
|
+
icon: "i-lucide-copy",
|
|
860
|
+
onSelect: () => duplicateDoc(item.id)
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
label: "Add child page",
|
|
864
|
+
icon: "i-lucide-file-plus",
|
|
865
|
+
onSelect: () => createDirectly(item.id)
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
label: "Move to\u2026",
|
|
869
|
+
icon: "i-lucide-corner-down-right",
|
|
870
|
+
onSelect: () => openMovePicker(item.id)
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
label: "Edit tags\u2026",
|
|
874
|
+
icon: "i-lucide-tags",
|
|
875
|
+
onSelect: () => openTagsEditor(item.id)
|
|
876
|
+
}
|
|
877
|
+
] : [];
|
|
878
|
+
const exportImportItems = [
|
|
879
|
+
{
|
|
880
|
+
label: "Export",
|
|
881
|
+
icon: "i-lucide-download",
|
|
882
|
+
children: [
|
|
883
|
+
{ label: "Markdown", icon: "i-lucide-file-text", onSelect: () => exportSingleDoc(item.id, "markdown") },
|
|
884
|
+
{ label: "HTML", icon: "i-lucide-file-code", onSelect: () => exportSingleDoc(item.id, "html") }
|
|
885
|
+
]
|
|
886
|
+
},
|
|
887
|
+
...writable ? [{
|
|
888
|
+
label: "Import into...",
|
|
889
|
+
icon: "i-lucide-file-up",
|
|
890
|
+
onSelect: () => importFiles(item.id)
|
|
891
|
+
}] : []
|
|
892
|
+
];
|
|
893
|
+
const groups = [[...openItems, ...editItems]];
|
|
894
|
+
if (writable) {
|
|
895
|
+
groups.push([
|
|
872
896
|
{
|
|
873
897
|
label: "Change type",
|
|
874
898
|
icon: "i-lucide-layers",
|
|
@@ -883,33 +907,21 @@ function treeNodeMenuItems(item) {
|
|
|
883
907
|
}
|
|
884
908
|
}))
|
|
885
909
|
}
|
|
886
|
-
]
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
children: [
|
|
892
|
-
{ label: "Markdown", icon: "i-lucide-file-text", onSelect: () => exportSingleDoc(item.id, "markdown") },
|
|
893
|
-
{ label: "HTML", icon: "i-lucide-file-code", onSelect: () => exportSingleDoc(item.id, "html") }
|
|
894
|
-
]
|
|
895
|
-
},
|
|
896
|
-
{
|
|
897
|
-
label: "Import into...",
|
|
898
|
-
icon: "i-lucide-file-up",
|
|
899
|
-
onSelect: () => importFiles(item.id)
|
|
900
|
-
}
|
|
901
|
-
],
|
|
902
|
-
[
|
|
910
|
+
]);
|
|
911
|
+
}
|
|
912
|
+
groups.push(exportImportItems);
|
|
913
|
+
if (writable) {
|
|
914
|
+
groups.push([
|
|
903
915
|
{
|
|
904
916
|
label: "Move to Trash",
|
|
905
917
|
icon: "i-lucide-trash-2",
|
|
906
918
|
color: "error",
|
|
907
919
|
onSelect: () => deleteDoc(item.id)
|
|
908
920
|
}
|
|
909
|
-
]
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
921
|
+
]);
|
|
922
|
+
}
|
|
923
|
+
groups.push(...multiExportSection, ...multiDeleteSection);
|
|
924
|
+
return groups;
|
|
913
925
|
}
|
|
914
926
|
function onRestoreItem(item) {
|
|
915
927
|
restoreFromTrash(item.id);
|
|
@@ -947,17 +959,19 @@ function trashRootMenuItems() {
|
|
|
947
959
|
];
|
|
948
960
|
}
|
|
949
961
|
function treeAreaMenuItems() {
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
[
|
|
962
|
+
const groups = [];
|
|
963
|
+
if (canWrite.value) {
|
|
964
|
+
groups.push([{ label: "New page", icon: "i-lucide-file-plus", onSelect: () => createDirectly(null) }]);
|
|
965
|
+
groups.push([
|
|
953
966
|
{ label: "Import files...", icon: "i-lucide-file-up", onSelect: () => importFiles(null) },
|
|
954
967
|
{ label: "Import folder...", icon: "i-lucide-folder-up", onSelect: () => importFolder(null) }
|
|
955
|
-
]
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
];
|
|
968
|
+
]);
|
|
969
|
+
}
|
|
970
|
+
groups.push([
|
|
971
|
+
{ label: "Export all as Markdown", icon: "i-lucide-download", onSelect: () => exportAll("md") },
|
|
972
|
+
{ label: "Export all as HTML", icon: "i-lucide-file-code", onSelect: () => exportAll("html") }
|
|
973
|
+
]);
|
|
974
|
+
return groups;
|
|
961
975
|
}
|
|
962
976
|
function nodeToFlatItem(node) {
|
|
963
977
|
return {
|
|
@@ -1618,6 +1632,7 @@ defineExpose({
|
|
|
1618
1632
|
:node-label="overlayLabel"
|
|
1619
1633
|
:child-provider="overlayProvider"
|
|
1620
1634
|
:doc-type="treeMap.get(overlayNodeId ?? '')?.type"
|
|
1635
|
+
:editable="editable"
|
|
1621
1636
|
@close="closeOverlay"
|
|
1622
1637
|
/>
|
|
1623
1638
|
</div>
|
|
@@ -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>;
|