@cou.sh/nuxt 1.0.1
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/README.md +84 -0
- package/dist/module.d.mts +49 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +126 -0
- package/dist/runtime/components/ActivityTimeline.d.vue.ts +17 -0
- package/dist/runtime/components/ActivityTimeline.vue +108 -0
- package/dist/runtime/components/ActivityTimeline.vue.d.ts +17 -0
- package/dist/runtime/components/AuthForm.d.vue.ts +20 -0
- package/dist/runtime/components/AuthForm.vue +78 -0
- package/dist/runtime/components/AuthForm.vue.d.ts +20 -0
- package/dist/runtime/components/CommentThread.d.vue.ts +10 -0
- package/dist/runtime/components/CommentThread.vue +149 -0
- package/dist/runtime/components/CommentThread.vue.d.ts +10 -0
- package/dist/runtime/components/ConnectionStatus.d.vue.ts +13 -0
- package/dist/runtime/components/ConnectionStatus.vue +27 -0
- package/dist/runtime/components/ConnectionStatus.vue.d.ts +13 -0
- package/dist/runtime/components/DocumentBreadcrumb.d.vue.ts +13 -0
- package/dist/runtime/components/DocumentBreadcrumb.vue +38 -0
- package/dist/runtime/components/DocumentBreadcrumb.vue.d.ts +13 -0
- package/dist/runtime/components/DocumentCard.d.vue.ts +30 -0
- package/dist/runtime/components/DocumentCard.vue +88 -0
- package/dist/runtime/components/DocumentCard.vue.d.ts +30 -0
- package/dist/runtime/components/DocumentSearchPalette.d.vue.ts +22 -0
- package/dist/runtime/components/DocumentSearchPalette.vue +99 -0
- package/dist/runtime/components/DocumentSearchPalette.vue.d.ts +22 -0
- package/dist/runtime/components/DocumentTree.d.vue.ts +32 -0
- package/dist/runtime/components/DocumentTree.vue +497 -0
- package/dist/runtime/components/DocumentTree.vue.d.ts +32 -0
- package/dist/runtime/components/Editor.d.vue.ts +11 -0
- package/dist/runtime/components/Editor.vue +328 -0
- package/dist/runtime/components/Editor.vue.d.ts +11 -0
- package/dist/runtime/components/ExportMenu.d.vue.ts +9 -0
- package/dist/runtime/components/ExportMenu.vue +55 -0
- package/dist/runtime/components/ExportMenu.vue.d.ts +9 -0
- package/dist/runtime/components/FileUploader.d.vue.ts +22 -0
- package/dist/runtime/components/FileUploader.vue +148 -0
- package/dist/runtime/components/FileUploader.vue.d.ts +22 -0
- package/dist/runtime/components/MemberManager.d.vue.ts +9 -0
- package/dist/runtime/components/MemberManager.vue +153 -0
- package/dist/runtime/components/MemberManager.vue.d.ts +9 -0
- package/dist/runtime/components/OfflineIndicator.d.vue.ts +9 -0
- package/dist/runtime/components/OfflineIndicator.vue +44 -0
- package/dist/runtime/components/OfflineIndicator.vue.d.ts +9 -0
- package/dist/runtime/components/PermissionGuard.d.vue.ts +25 -0
- package/dist/runtime/components/PermissionGuard.vue +16 -0
- package/dist/runtime/components/PermissionGuard.vue.d.ts +25 -0
- package/dist/runtime/components/RoleBadge.d.vue.ts +11 -0
- package/dist/runtime/components/RoleBadge.vue +30 -0
- package/dist/runtime/components/RoleBadge.vue.d.ts +11 -0
- package/dist/runtime/components/ShareDialog.d.vue.ts +15 -0
- package/dist/runtime/components/ShareDialog.vue +119 -0
- package/dist/runtime/components/ShareDialog.vue.d.ts +15 -0
- package/dist/runtime/components/SnapshotTimeline.d.vue.ts +15 -0
- package/dist/runtime/components/SnapshotTimeline.vue +118 -0
- package/dist/runtime/components/SnapshotTimeline.vue.d.ts +15 -0
- package/dist/runtime/components/SpaceSettings.d.vue.ts +7 -0
- package/dist/runtime/components/SpaceSettings.vue +105 -0
- package/dist/runtime/components/SpaceSettings.vue.d.ts +7 -0
- package/dist/runtime/components/SpaceSwitcher.d.vue.ts +18 -0
- package/dist/runtime/components/SpaceSwitcher.vue +104 -0
- package/dist/runtime/components/SpaceSwitcher.vue.d.ts +18 -0
- package/dist/runtime/components/TrashBin.d.vue.ts +7 -0
- package/dist/runtime/components/TrashBin.vue +159 -0
- package/dist/runtime/components/TrashBin.vue.d.ts +7 -0
- package/dist/runtime/components/UserMenu.d.vue.ts +13 -0
- package/dist/runtime/components/UserMenu.vue +50 -0
- package/dist/runtime/components/UserMenu.vue.d.ts +13 -0
- package/dist/runtime/components/UserPresence.d.vue.ts +13 -0
- package/dist/runtime/components/UserPresence.vue +34 -0
- package/dist/runtime/components/UserPresence.vue.d.ts +13 -0
- package/dist/runtime/components/editor/CollaborationUsers.d.vue.ts +7 -0
- package/dist/runtime/components/editor/CollaborationUsers.vue +31 -0
- package/dist/runtime/components/editor/CollaborationUsers.vue.d.ts +7 -0
- package/dist/runtime/components/editor/CompletionExtension.d.ts +43 -0
- package/dist/runtime/components/editor/CompletionExtension.js +133 -0
- package/dist/runtime/components/editor/ImageUploadExtension.d.ts +10 -0
- package/dist/runtime/components/editor/ImageUploadExtension.js +31 -0
- package/dist/runtime/components/editor/ImageUploadNode.d.vue.ts +4 -0
- package/dist/runtime/components/editor/ImageUploadNode.vue +59 -0
- package/dist/runtime/components/editor/ImageUploadNode.vue.d.ts +4 -0
- package/dist/runtime/components/editor/LinkPopover.d.vue.ts +8 -0
- package/dist/runtime/components/editor/LinkPopover.vue +131 -0
- package/dist/runtime/components/editor/LinkPopover.vue.d.ts +8 -0
- package/dist/runtime/components/widgets/ButtonWidget.d.vue.ts +4 -0
- package/dist/runtime/components/widgets/ButtonWidget.vue +32 -0
- package/dist/runtime/components/widgets/ButtonWidget.vue.d.ts +4 -0
- package/dist/runtime/components/widgets/CalendarWidget.d.vue.ts +4 -0
- package/dist/runtime/components/widgets/CalendarWidget.vue +36 -0
- package/dist/runtime/components/widgets/CalendarWidget.vue.d.ts +4 -0
- package/dist/runtime/components/widgets/CheckboxWidget.d.vue.ts +4 -0
- package/dist/runtime/components/widgets/CheckboxWidget.vue +32 -0
- package/dist/runtime/components/widgets/CheckboxWidget.vue.d.ts +4 -0
- package/dist/runtime/components/widgets/ColorPickerWidget.d.vue.ts +4 -0
- package/dist/runtime/components/widgets/ColorPickerWidget.vue +30 -0
- package/dist/runtime/components/widgets/ColorPickerWidget.vue.d.ts +4 -0
- package/dist/runtime/components/widgets/IconWidget.d.vue.ts +4 -0
- package/dist/runtime/components/widgets/IconWidget.vue +102 -0
- package/dist/runtime/components/widgets/IconWidget.vue.d.ts +4 -0
- package/dist/runtime/components/widgets/InputDateWidget.d.vue.ts +4 -0
- package/dist/runtime/components/widgets/InputDateWidget.vue +38 -0
- package/dist/runtime/components/widgets/InputDateWidget.vue.d.ts +4 -0
- package/dist/runtime/components/widgets/ScrollAreaWidget.d.vue.ts +4 -0
- package/dist/runtime/components/widgets/ScrollAreaWidget.vue +41 -0
- package/dist/runtime/components/widgets/ScrollAreaWidget.vue.d.ts +4 -0
- package/dist/runtime/components/widgets/SliderWidget.d.vue.ts +4 -0
- package/dist/runtime/components/widgets/SliderWidget.vue +42 -0
- package/dist/runtime/components/widgets/SliderWidget.vue.d.ts +4 -0
- package/dist/runtime/components/widgets/SwitchWidget.d.vue.ts +4 -0
- package/dist/runtime/components/widgets/SwitchWidget.vue +35 -0
- package/dist/runtime/components/widgets/SwitchWidget.vue.d.ts +4 -0
- package/dist/runtime/components/widgets/TabPanelWidget.d.vue.ts +4 -0
- package/dist/runtime/components/widgets/TabPanelWidget.vue +22 -0
- package/dist/runtime/components/widgets/TabPanelWidget.vue.d.ts +4 -0
- package/dist/runtime/components/widgets/TabsWidget.d.vue.ts +4 -0
- package/dist/runtime/components/widgets/TabsWidget.vue +109 -0
- package/dist/runtime/components/widgets/TabsWidget.vue.d.ts +4 -0
- package/dist/runtime/components/widgets/index.d.ts +13 -0
- package/dist/runtime/components/widgets/index.js +278 -0
- package/dist/runtime/composables/index.d.ts +14 -0
- package/dist/runtime/composables/index.js +13 -0
- package/dist/runtime/composables/useCollabStatus.d.ts +10 -0
- package/dist/runtime/composables/useCollabStatus.js +23 -0
- package/dist/runtime/composables/useDocumentPermissions.d.ts +11 -0
- package/dist/runtime/composables/useDocumentPermissions.js +44 -0
- package/dist/runtime/composables/useEditorCollaboration.d.ts +25 -0
- package/dist/runtime/composables/useEditorCollaboration.js +141 -0
- package/dist/runtime/composables/useEditorCompletion.d.ts +60 -0
- package/dist/runtime/composables/useEditorCompletion.js +42 -0
- package/dist/runtime/composables/useEditorDragHandle.d.ts +10 -0
- package/dist/runtime/composables/useEditorDragHandle.js +130 -0
- package/dist/runtime/composables/useEditorEmojis.d.ts +4 -0
- package/dist/runtime/composables/useEditorEmojis.js +9 -0
- package/dist/runtime/composables/useEditorMentions.d.ts +4 -0
- package/dist/runtime/composables/useEditorMentions.js +27 -0
- package/dist/runtime/composables/useEditorSuggestions.d.ts +149 -0
- package/dist/runtime/composables/useEditorSuggestions.js +114 -0
- package/dist/runtime/composables/useEditorToolbar.d.ts +12 -0
- package/dist/runtime/composables/useEditorToolbar.js +194 -0
- package/dist/runtime/composables/useLucideIcons.d.ts +4 -0
- package/dist/runtime/composables/useLucideIcons.js +16 -0
- package/dist/runtime/composables/useOnlineStatus.d.ts +6 -0
- package/dist/runtime/composables/useOnlineStatus.js +44 -0
- package/dist/runtime/composables/useSpaces.d.ts +36 -0
- package/dist/runtime/composables/useSpaces.js +29 -0
- package/dist/runtime/middleware/collab-auth.d.ts +2 -0
- package/dist/runtime/middleware/collab-auth.js +18 -0
- package/dist/runtime/plugin.d.ts +7 -0
- package/dist/runtime/plugin.js +39 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/types.d.mts +3 -0
- package/package.json +66 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { NodeViewWrapper } from "@tiptap/vue-3";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
decorations: { type: Array, required: true },
|
|
5
|
+
selected: { type: Boolean, required: true },
|
|
6
|
+
updateAttributes: { type: Function, required: true },
|
|
7
|
+
deleteNode: { type: Function, required: true },
|
|
8
|
+
node: { type: null, required: true },
|
|
9
|
+
view: { type: null, required: true },
|
|
10
|
+
getPos: { type: null, required: true },
|
|
11
|
+
innerDecorations: { type: null, required: true },
|
|
12
|
+
editor: { type: Object, required: true },
|
|
13
|
+
extension: { type: Object, required: true },
|
|
14
|
+
HTMLAttributes: { type: Object, required: true }
|
|
15
|
+
});
|
|
16
|
+
const { search } = useLucideIcons();
|
|
17
|
+
const iconName = computed(() => props.node.attrs.name || "");
|
|
18
|
+
const iconSizeClass = computed(() => {
|
|
19
|
+
const resolved = props.editor.state.doc.resolve(props.getPos());
|
|
20
|
+
const parent = resolved.parent;
|
|
21
|
+
if (parent.type.name === "heading") {
|
|
22
|
+
const level = parent.attrs.level;
|
|
23
|
+
switch (level) {
|
|
24
|
+
case 1:
|
|
25
|
+
return "size-8";
|
|
26
|
+
case 2:
|
|
27
|
+
return "size-7";
|
|
28
|
+
case 3:
|
|
29
|
+
return "size-6";
|
|
30
|
+
case 4:
|
|
31
|
+
return "size-5";
|
|
32
|
+
default:
|
|
33
|
+
return "size-5";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return "size-5";
|
|
37
|
+
});
|
|
38
|
+
const open = ref(false);
|
|
39
|
+
const query = ref("");
|
|
40
|
+
const results = computed(() => search(query.value, 80));
|
|
41
|
+
function pickIcon(name) {
|
|
42
|
+
props.updateAttributes({ name });
|
|
43
|
+
open.value = false;
|
|
44
|
+
query.value = "";
|
|
45
|
+
}
|
|
46
|
+
function displayName(name) {
|
|
47
|
+
return name.replace("i-lucide-", "").replace(/-/g, " ");
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<NodeViewWrapper as="span" class="inline-flex items-center align-middle" data-drag-handle draggable="true">
|
|
53
|
+
<UPopover v-model:open="open" :ui="{ content: 'w-72' }">
|
|
54
|
+
<button
|
|
55
|
+
type="button"
|
|
56
|
+
class="inline-flex items-center rounded hover:bg-[var(--ui-bg-elevated)] transition-colors cursor-grab active:cursor-grabbing"
|
|
57
|
+
:class="iconName ? 'px-0.5 py-0.5' : 'px-1.5 py-0.5 border border-dashed border-[var(--ui-border)]'"
|
|
58
|
+
>
|
|
59
|
+
<UIcon
|
|
60
|
+
v-if="iconName"
|
|
61
|
+
:name="iconName"
|
|
62
|
+
:class="iconSizeClass"
|
|
63
|
+
/>
|
|
64
|
+
<span v-else class="text-xs text-[var(--ui-text-muted)]">Pick icon</span>
|
|
65
|
+
</button>
|
|
66
|
+
|
|
67
|
+
<template #content>
|
|
68
|
+
<div class="flex flex-col gap-2 p-2">
|
|
69
|
+
<UInput
|
|
70
|
+
v-model="query"
|
|
71
|
+
placeholder="Search icons..."
|
|
72
|
+
icon="i-lucide-search"
|
|
73
|
+
size="sm"
|
|
74
|
+
autofocus
|
|
75
|
+
/>
|
|
76
|
+
|
|
77
|
+
<div v-if="iconName" class="flex items-center gap-1.5 px-1">
|
|
78
|
+
<span class="text-xs text-[var(--ui-text-muted)] truncate">{{ displayName(iconName) }}</span>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div class="grid grid-cols-8 gap-0.5 max-h-52 overflow-y-auto">
|
|
82
|
+
<button
|
|
83
|
+
v-for="icon in results"
|
|
84
|
+
:key="icon"
|
|
85
|
+
type="button"
|
|
86
|
+
class="flex items-center justify-center rounded p-1.5 cursor-pointer transition-colors"
|
|
87
|
+
:class="icon === iconName ? 'bg-[var(--ui-bg-inverted)] text-[var(--ui-text-inverted)]' : 'hover:bg-[var(--ui-bg-elevated)] text-[var(--ui-text)]'"
|
|
88
|
+
:title="displayName(icon)"
|
|
89
|
+
@click="pickIcon(icon)"
|
|
90
|
+
>
|
|
91
|
+
<UIcon :name="icon" class="size-5" />
|
|
92
|
+
</button>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<p v-if="!results.length" class="text-xs text-[var(--ui-text-muted)] text-center py-4">
|
|
96
|
+
No icons found
|
|
97
|
+
</p>
|
|
98
|
+
</div>
|
|
99
|
+
</template>
|
|
100
|
+
</UPopover>
|
|
101
|
+
</NodeViewWrapper>
|
|
102
|
+
</template>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { NodeViewWrapper } from "@tiptap/vue-3";
|
|
3
|
+
import { CalendarDate } from "@internationalized/date";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
decorations: { type: Array, required: true },
|
|
6
|
+
selected: { type: Boolean, required: true },
|
|
7
|
+
updateAttributes: { type: Function, required: true },
|
|
8
|
+
deleteNode: { type: Function, required: true },
|
|
9
|
+
node: { type: null, required: true },
|
|
10
|
+
view: { type: null, required: true },
|
|
11
|
+
getPos: { type: null, required: true },
|
|
12
|
+
innerDecorations: { type: null, required: true },
|
|
13
|
+
editor: { type: Object, required: true },
|
|
14
|
+
extension: { type: Object, required: true },
|
|
15
|
+
HTMLAttributes: { type: Object, required: true }
|
|
16
|
+
});
|
|
17
|
+
const value = computed({
|
|
18
|
+
get: () => {
|
|
19
|
+
const raw = props.node.attrs.date;
|
|
20
|
+
if (!raw) return void 0;
|
|
21
|
+
const [y, m, d] = raw.split("-").map(Number);
|
|
22
|
+
return new CalendarDate(y, m, d);
|
|
23
|
+
},
|
|
24
|
+
set: (val) => {
|
|
25
|
+
props.updateAttributes({
|
|
26
|
+
date: val ? `${val.year}-${String(val.month).padStart(2, "0")}-${String(val.day).padStart(2, "0")}` : null
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const label = computed(() => props.node.attrs.label || "");
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<NodeViewWrapper as="span" class="inline-flex items-center align-middle mx-0.5 gap-1.5">
|
|
35
|
+
<span v-if="label" class="text-sm text-[var(--ui-text-muted)]">{{ label }}</span>
|
|
36
|
+
<UInputDate v-model="value" size="xs" />
|
|
37
|
+
</NodeViewWrapper>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { NodeViewWrapper, NodeViewContent } from "@tiptap/vue-3";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
decorations: { type: Array, required: true },
|
|
5
|
+
selected: { type: Boolean, required: true },
|
|
6
|
+
updateAttributes: { type: Function, required: true },
|
|
7
|
+
deleteNode: { type: Function, required: true },
|
|
8
|
+
node: { type: null, required: true },
|
|
9
|
+
view: { type: null, required: true },
|
|
10
|
+
getPos: { type: null, required: true },
|
|
11
|
+
innerDecorations: { type: null, required: true },
|
|
12
|
+
editor: { type: Object, required: true },
|
|
13
|
+
extension: { type: Object, required: true },
|
|
14
|
+
HTMLAttributes: { type: Object, required: true }
|
|
15
|
+
});
|
|
16
|
+
const orientation = computed(() => props.node.attrs.orientation || "vertical");
|
|
17
|
+
const height = computed(() => props.node.attrs.height || 384);
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<NodeViewWrapper class="my-2" data-drag-handle>
|
|
22
|
+
<div
|
|
23
|
+
class="rounded-[var(--ui-radius)] border border-[var(--ui-border)] overflow-hidden"
|
|
24
|
+
>
|
|
25
|
+
<div class="flex items-center gap-2 px-3 py-1.5 bg-[var(--ui-bg-elevated)] border-b border-[var(--ui-border)]">
|
|
26
|
+
<UIcon name="i-lucide-scroll" class="size-4 text-[var(--ui-text-muted)]" />
|
|
27
|
+
<span class="text-xs text-[var(--ui-text-muted)] select-none">Scroll Area</span>
|
|
28
|
+
<span class="text-xs text-[var(--ui-text-dimmed)] select-none ml-auto">{{ height }}px</span>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<UScrollArea
|
|
32
|
+
:orientation="orientation"
|
|
33
|
+
class="w-full"
|
|
34
|
+
:style="{ height: `${height}px` }"
|
|
35
|
+
:ui="{ viewport: 'p-4' }"
|
|
36
|
+
>
|
|
37
|
+
<NodeViewContent class="min-h-full" />
|
|
38
|
+
</UScrollArea>
|
|
39
|
+
</div>
|
|
40
|
+
</NodeViewWrapper>
|
|
41
|
+
</template>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { NodeViewWrapper } from "@tiptap/vue-3";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
decorations: { type: Array, required: true },
|
|
5
|
+
selected: { type: Boolean, required: true },
|
|
6
|
+
updateAttributes: { type: Function, required: true },
|
|
7
|
+
deleteNode: { type: Function, required: true },
|
|
8
|
+
node: { type: null, required: true },
|
|
9
|
+
view: { type: null, required: true },
|
|
10
|
+
getPos: { type: null, required: true },
|
|
11
|
+
innerDecorations: { type: null, required: true },
|
|
12
|
+
editor: { type: Object, required: true },
|
|
13
|
+
extension: { type: Object, required: true },
|
|
14
|
+
HTMLAttributes: { type: Object, required: true }
|
|
15
|
+
});
|
|
16
|
+
const value = computed({
|
|
17
|
+
get: () => props.node.attrs.value,
|
|
18
|
+
set: (val) => {
|
|
19
|
+
props.updateAttributes({ value: val });
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const min = computed(() => props.node.attrs.min ?? 0);
|
|
23
|
+
const max = computed(() => props.node.attrs.max ?? 100);
|
|
24
|
+
const step = computed(() => props.node.attrs.step ?? 1);
|
|
25
|
+
const label = computed(() => props.node.attrs.label || "");
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<NodeViewWrapper class="my-2">
|
|
30
|
+
<div class="flex items-center gap-3">
|
|
31
|
+
<span v-if="label" class="text-sm text-[var(--ui-text-muted)] shrink-0">{{ label }}</span>
|
|
32
|
+
<USlider
|
|
33
|
+
v-model="value"
|
|
34
|
+
:min="min"
|
|
35
|
+
:max="max"
|
|
36
|
+
:step="step"
|
|
37
|
+
class="flex-1"
|
|
38
|
+
/>
|
|
39
|
+
<span class="text-sm text-[var(--ui-text-muted)] tabular-nums w-8 text-right shrink-0">{{ value }}</span>
|
|
40
|
+
</div>
|
|
41
|
+
</NodeViewWrapper>
|
|
42
|
+
</template>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { NodeViewWrapper } from "@tiptap/vue-3";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
decorations: { type: Array, required: true },
|
|
5
|
+
selected: { type: Boolean, required: true },
|
|
6
|
+
updateAttributes: { type: Function, required: true },
|
|
7
|
+
deleteNode: { type: Function, required: true },
|
|
8
|
+
node: { type: null, required: true },
|
|
9
|
+
view: { type: null, required: true },
|
|
10
|
+
getPos: { type: null, required: true },
|
|
11
|
+
innerDecorations: { type: null, required: true },
|
|
12
|
+
editor: { type: Object, required: true },
|
|
13
|
+
extension: { type: Object, required: true },
|
|
14
|
+
HTMLAttributes: { type: Object, required: true }
|
|
15
|
+
});
|
|
16
|
+
const checked = computed({
|
|
17
|
+
get: () => props.node.attrs.checked,
|
|
18
|
+
set: (value) => {
|
|
19
|
+
props.updateAttributes({ checked: value });
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const label = computed(() => props.node.attrs.label || "");
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<NodeViewWrapper as="span" class="inline-flex items-center align-middle mx-0.5">
|
|
27
|
+
<USwitch
|
|
28
|
+
v-model="checked"
|
|
29
|
+
:label="label"
|
|
30
|
+
size="xs"
|
|
31
|
+
unchecked-icon="i-lucide-x"
|
|
32
|
+
checked-icon="i-lucide-check"
|
|
33
|
+
/>
|
|
34
|
+
</NodeViewWrapper>
|
|
35
|
+
</template>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { NodeViewWrapper, NodeViewContent } from "@tiptap/vue-3";
|
|
3
|
+
defineProps({
|
|
4
|
+
decorations: { type: Array, required: true },
|
|
5
|
+
selected: { type: Boolean, required: true },
|
|
6
|
+
updateAttributes: { type: Function, required: true },
|
|
7
|
+
deleteNode: { type: Function, required: true },
|
|
8
|
+
node: { type: null, required: true },
|
|
9
|
+
view: { type: null, required: true },
|
|
10
|
+
getPos: { type: null, required: true },
|
|
11
|
+
innerDecorations: { type: null, required: true },
|
|
12
|
+
editor: { type: Object, required: true },
|
|
13
|
+
extension: { type: Object, required: true },
|
|
14
|
+
HTMLAttributes: { type: Object, required: true }
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<NodeViewWrapper class="tab-panel-wrapper" data-tab-panel>
|
|
20
|
+
<NodeViewContent class="min-h-[2rem]" />
|
|
21
|
+
</NodeViewWrapper>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { NodeViewWrapper, NodeViewContent } from "@tiptap/vue-3";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
decorations: { type: Array, required: true },
|
|
5
|
+
selected: { type: Boolean, required: true },
|
|
6
|
+
updateAttributes: { type: Function, required: true },
|
|
7
|
+
deleteNode: { type: Function, required: true },
|
|
8
|
+
node: { type: null, required: true },
|
|
9
|
+
view: { type: null, required: true },
|
|
10
|
+
getPos: { type: null, required: true },
|
|
11
|
+
innerDecorations: { type: null, required: true },
|
|
12
|
+
editor: { type: Object, required: true },
|
|
13
|
+
extension: { type: Object, required: true },
|
|
14
|
+
HTMLAttributes: { type: Object, required: true }
|
|
15
|
+
});
|
|
16
|
+
const activeTab = ref(0);
|
|
17
|
+
const tabs = computed(() => {
|
|
18
|
+
const panels = [];
|
|
19
|
+
props.node.forEach((child) => {
|
|
20
|
+
panels.push({
|
|
21
|
+
label: child.attrs.label || `Tab ${panels.length + 1}`,
|
|
22
|
+
icon: child.attrs.icon || void 0
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
return panels;
|
|
26
|
+
});
|
|
27
|
+
const items = computed(
|
|
28
|
+
() => tabs.value.map((tab, index) => ({
|
|
29
|
+
label: tab.label,
|
|
30
|
+
icon: tab.icon,
|
|
31
|
+
value: String(index)
|
|
32
|
+
}))
|
|
33
|
+
);
|
|
34
|
+
const activeValue = computed({
|
|
35
|
+
get: () => String(activeTab.value),
|
|
36
|
+
set: (val) => {
|
|
37
|
+
activeTab.value = Number(val);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
function addTab() {
|
|
41
|
+
const pos = props.getPos();
|
|
42
|
+
if (typeof pos !== "number") return;
|
|
43
|
+
const endPos = pos + props.node.nodeSize - 1;
|
|
44
|
+
props.editor.chain().focus().insertContentAt(endPos, {
|
|
45
|
+
type: "tabPanel",
|
|
46
|
+
attrs: { label: `Tab ${props.node.childCount + 1}` },
|
|
47
|
+
content: [{ type: "paragraph" }]
|
|
48
|
+
}).run();
|
|
49
|
+
nextTick(() => {
|
|
50
|
+
activeTab.value = props.node.childCount - 1;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function removeTab(index) {
|
|
54
|
+
if (props.node.childCount <= 1) return;
|
|
55
|
+
const pos = props.getPos();
|
|
56
|
+
if (typeof pos !== "number") return;
|
|
57
|
+
let offset = 1;
|
|
58
|
+
for (let i = 0; i < index; i++) {
|
|
59
|
+
offset += props.node.child(i).nodeSize;
|
|
60
|
+
}
|
|
61
|
+
const child = props.node.child(index);
|
|
62
|
+
const from = pos + offset;
|
|
63
|
+
const to = from + child.nodeSize;
|
|
64
|
+
props.editor.chain().focus().deleteRange({ from, to }).run();
|
|
65
|
+
if (activeTab.value >= props.node.childCount - 1) {
|
|
66
|
+
activeTab.value = Math.max(0, props.node.childCount - 2);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<template>
|
|
72
|
+
<NodeViewWrapper class="my-2 tabs-widget" :data-active-tab="activeTab" data-drag-handle>
|
|
73
|
+
<div class="rounded-[var(--ui-radius)] border border-[var(--ui-border)] overflow-hidden">
|
|
74
|
+
<div class="flex items-center bg-[var(--ui-bg-elevated)] border-b border-[var(--ui-border)]">
|
|
75
|
+
<UTabs
|
|
76
|
+
v-model="activeValue"
|
|
77
|
+
:items="items"
|
|
78
|
+
variant="link"
|
|
79
|
+
:content="false"
|
|
80
|
+
:ui="{ trigger: 'grow' }"
|
|
81
|
+
class="flex-1"
|
|
82
|
+
/>
|
|
83
|
+
<div class="flex items-center gap-0.5 px-2">
|
|
84
|
+
<UButton
|
|
85
|
+
icon="i-lucide-plus"
|
|
86
|
+
size="xs"
|
|
87
|
+
variant="ghost"
|
|
88
|
+
color="neutral"
|
|
89
|
+
@click="addTab"
|
|
90
|
+
/>
|
|
91
|
+
<UButton
|
|
92
|
+
v-if="node.childCount > 1"
|
|
93
|
+
icon="i-lucide-x"
|
|
94
|
+
size="xs"
|
|
95
|
+
variant="ghost"
|
|
96
|
+
color="neutral"
|
|
97
|
+
@click="removeTab(activeTab)"
|
|
98
|
+
/>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<NodeViewContent class="tabs-widget-content" />
|
|
103
|
+
</div>
|
|
104
|
+
</NodeViewWrapper>
|
|
105
|
+
</template>
|
|
106
|
+
|
|
107
|
+
<style scoped>
|
|
108
|
+
.tabs-widget-content :deep([data-tab-panel]){display:none}.tabs-widget[data-active-tab="0"] .tabs-widget-content :deep([data-tab-panel]:first-child),.tabs-widget[data-active-tab="1"] .tabs-widget-content :deep([data-tab-panel]:nth-child(2)),.tabs-widget[data-active-tab="2"] .tabs-widget-content :deep([data-tab-panel]:nth-child(3)),.tabs-widget[data-active-tab="3"] .tabs-widget-content :deep([data-tab-panel]:nth-child(4)),.tabs-widget[data-active-tab="4"] .tabs-widget-content :deep([data-tab-panel]:nth-child(5)),.tabs-widget[data-active-tab="5"] .tabs-widget-content :deep([data-tab-panel]:nth-child(6)),.tabs-widget[data-active-tab="6"] .tabs-widget-content :deep([data-tab-panel]:nth-child(7)),.tabs-widget[data-active-tab="7"] .tabs-widget-content :deep([data-tab-panel]:nth-child(8)){display:block;padding:1rem}
|
|
109
|
+
</style>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeViewProps } from '@tiptap/vue-3';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<NodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export declare const SwitchWidget: Node<any, any>;
|
|
3
|
+
export declare const CheckboxWidget: Node<any, any>;
|
|
4
|
+
export declare const ButtonWidget: Node<any, any>;
|
|
5
|
+
export declare const SliderWidget: Node<any, any>;
|
|
6
|
+
export declare const ColorPickerWidget: Node<any, any>;
|
|
7
|
+
export declare const CalendarWidget: Node<any, any>;
|
|
8
|
+
export declare const InputDateWidget: Node<any, any>;
|
|
9
|
+
export declare const ScrollAreaWidget: Node<any, any>;
|
|
10
|
+
export declare const TabPanel: Node<any, any>;
|
|
11
|
+
export declare const TabsWidget: Node<any, any>;
|
|
12
|
+
export declare const IconWidget: Node<any, any>;
|
|
13
|
+
export declare const AllWidgets: Node<any, any>[];
|