@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,278 @@
|
|
|
1
|
+
import { Node, mergeAttributes } from "@tiptap/core";
|
|
2
|
+
import { VueNodeViewRenderer } from "@tiptap/vue-3";
|
|
3
|
+
import SwitchWidgetComponent from "./SwitchWidget.vue";
|
|
4
|
+
import CheckboxWidgetComponent from "./CheckboxWidget.vue";
|
|
5
|
+
import ButtonWidgetComponent from "./ButtonWidget.vue";
|
|
6
|
+
import SliderWidgetComponent from "./SliderWidget.vue";
|
|
7
|
+
import ColorPickerWidgetComponent from "./ColorPickerWidget.vue";
|
|
8
|
+
import CalendarWidgetComponent from "./CalendarWidget.vue";
|
|
9
|
+
import InputDateWidgetComponent from "./InputDateWidget.vue";
|
|
10
|
+
import ScrollAreaWidgetComponent from "./ScrollAreaWidget.vue";
|
|
11
|
+
import TabsWidgetComponent from "./TabsWidget.vue";
|
|
12
|
+
import TabPanelWidgetComponent from "./TabPanelWidget.vue";
|
|
13
|
+
import IconWidgetComponent from "./IconWidget.vue";
|
|
14
|
+
export const SwitchWidget = Node.create({
|
|
15
|
+
name: "switchWidget",
|
|
16
|
+
group: "inline",
|
|
17
|
+
inline: true,
|
|
18
|
+
atom: true,
|
|
19
|
+
draggable: true,
|
|
20
|
+
addAttributes() {
|
|
21
|
+
return {
|
|
22
|
+
checked: { default: false },
|
|
23
|
+
label: { default: "" }
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
parseHTML() {
|
|
27
|
+
return [{ tag: 'span[data-type="switch-widget"]' }];
|
|
28
|
+
},
|
|
29
|
+
renderHTML({ HTMLAttributes }) {
|
|
30
|
+
return ["span", mergeAttributes(HTMLAttributes, { "data-type": "switch-widget" })];
|
|
31
|
+
},
|
|
32
|
+
addNodeView() {
|
|
33
|
+
return VueNodeViewRenderer(SwitchWidgetComponent);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export const CheckboxWidget = Node.create({
|
|
37
|
+
name: "checkboxWidget",
|
|
38
|
+
group: "inline",
|
|
39
|
+
inline: true,
|
|
40
|
+
atom: true,
|
|
41
|
+
draggable: true,
|
|
42
|
+
addAttributes() {
|
|
43
|
+
return {
|
|
44
|
+
checked: { default: false },
|
|
45
|
+
label: { default: "" }
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
parseHTML() {
|
|
49
|
+
return [{ tag: 'span[data-type="checkbox-widget"]' }];
|
|
50
|
+
},
|
|
51
|
+
renderHTML({ HTMLAttributes }) {
|
|
52
|
+
return ["span", mergeAttributes(HTMLAttributes, { "data-type": "checkbox-widget" })];
|
|
53
|
+
},
|
|
54
|
+
addNodeView() {
|
|
55
|
+
return VueNodeViewRenderer(CheckboxWidgetComponent);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
export const ButtonWidget = Node.create({
|
|
59
|
+
name: "buttonWidget",
|
|
60
|
+
group: "inline",
|
|
61
|
+
inline: true,
|
|
62
|
+
atom: true,
|
|
63
|
+
draggable: true,
|
|
64
|
+
addAttributes() {
|
|
65
|
+
return {
|
|
66
|
+
label: { default: "Button" },
|
|
67
|
+
variant: { default: "solid" },
|
|
68
|
+
color: { default: "primary" },
|
|
69
|
+
icon: { default: null }
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
parseHTML() {
|
|
73
|
+
return [{ tag: 'span[data-type="button-widget"]' }];
|
|
74
|
+
},
|
|
75
|
+
renderHTML({ HTMLAttributes }) {
|
|
76
|
+
return ["span", mergeAttributes(HTMLAttributes, { "data-type": "button-widget" })];
|
|
77
|
+
},
|
|
78
|
+
addNodeView() {
|
|
79
|
+
return VueNodeViewRenderer(ButtonWidgetComponent);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
export const SliderWidget = Node.create({
|
|
83
|
+
name: "sliderWidget",
|
|
84
|
+
group: "block",
|
|
85
|
+
atom: true,
|
|
86
|
+
draggable: true,
|
|
87
|
+
addAttributes() {
|
|
88
|
+
return {
|
|
89
|
+
value: { default: 50 },
|
|
90
|
+
min: { default: 0 },
|
|
91
|
+
max: { default: 100 },
|
|
92
|
+
step: { default: 1 },
|
|
93
|
+
label: { default: "" }
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
parseHTML() {
|
|
97
|
+
return [{ tag: 'div[data-type="slider-widget"]' }];
|
|
98
|
+
},
|
|
99
|
+
renderHTML({ HTMLAttributes }) {
|
|
100
|
+
return ["div", mergeAttributes(HTMLAttributes, { "data-type": "slider-widget" })];
|
|
101
|
+
},
|
|
102
|
+
addNodeView() {
|
|
103
|
+
return VueNodeViewRenderer(SliderWidgetComponent);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
export const ColorPickerWidget = Node.create({
|
|
107
|
+
name: "colorPickerWidget",
|
|
108
|
+
group: "inline",
|
|
109
|
+
inline: true,
|
|
110
|
+
atom: true,
|
|
111
|
+
draggable: true,
|
|
112
|
+
addAttributes() {
|
|
113
|
+
return {
|
|
114
|
+
color: { default: "#00C16A" },
|
|
115
|
+
label: { default: "" }
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
parseHTML() {
|
|
119
|
+
return [{ tag: 'span[data-type="color-picker-widget"]' }];
|
|
120
|
+
},
|
|
121
|
+
renderHTML({ HTMLAttributes }) {
|
|
122
|
+
return ["span", mergeAttributes(HTMLAttributes, { "data-type": "color-picker-widget" })];
|
|
123
|
+
},
|
|
124
|
+
addNodeView() {
|
|
125
|
+
return VueNodeViewRenderer(ColorPickerWidgetComponent);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
export const CalendarWidget = Node.create({
|
|
129
|
+
name: "calendarWidget",
|
|
130
|
+
group: "block",
|
|
131
|
+
atom: true,
|
|
132
|
+
draggable: true,
|
|
133
|
+
addAttributes() {
|
|
134
|
+
return {
|
|
135
|
+
date: { default: null }
|
|
136
|
+
};
|
|
137
|
+
},
|
|
138
|
+
parseHTML() {
|
|
139
|
+
return [{ tag: 'div[data-type="calendar-widget"]' }];
|
|
140
|
+
},
|
|
141
|
+
renderHTML({ HTMLAttributes }) {
|
|
142
|
+
return ["div", mergeAttributes(HTMLAttributes, { "data-type": "calendar-widget" })];
|
|
143
|
+
},
|
|
144
|
+
addNodeView() {
|
|
145
|
+
return VueNodeViewRenderer(CalendarWidgetComponent);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
export const InputDateWidget = Node.create({
|
|
149
|
+
name: "inputDateWidget",
|
|
150
|
+
group: "inline",
|
|
151
|
+
inline: true,
|
|
152
|
+
atom: true,
|
|
153
|
+
draggable: true,
|
|
154
|
+
addAttributes() {
|
|
155
|
+
return {
|
|
156
|
+
date: { default: null },
|
|
157
|
+
label: { default: "" }
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
parseHTML() {
|
|
161
|
+
return [{ tag: 'span[data-type="input-date-widget"]' }];
|
|
162
|
+
},
|
|
163
|
+
renderHTML({ HTMLAttributes }) {
|
|
164
|
+
return ["span", mergeAttributes(HTMLAttributes, { "data-type": "input-date-widget" })];
|
|
165
|
+
},
|
|
166
|
+
addNodeView() {
|
|
167
|
+
return VueNodeViewRenderer(InputDateWidgetComponent);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
export const ScrollAreaWidget = Node.create({
|
|
171
|
+
name: "scrollAreaWidget",
|
|
172
|
+
group: "block",
|
|
173
|
+
content: "block+",
|
|
174
|
+
defining: true,
|
|
175
|
+
draggable: true,
|
|
176
|
+
addAttributes() {
|
|
177
|
+
return {
|
|
178
|
+
orientation: { default: "vertical" },
|
|
179
|
+
height: { default: 384 }
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
parseHTML() {
|
|
183
|
+
return [{ tag: 'div[data-type="scroll-area-widget"]' }];
|
|
184
|
+
},
|
|
185
|
+
renderHTML({ HTMLAttributes }) {
|
|
186
|
+
return ["div", mergeAttributes(HTMLAttributes, { "data-type": "scroll-area-widget" }), 0];
|
|
187
|
+
},
|
|
188
|
+
addNodeView() {
|
|
189
|
+
return VueNodeViewRenderer(ScrollAreaWidgetComponent);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
export const TabPanel = Node.create({
|
|
193
|
+
name: "tabPanel",
|
|
194
|
+
group: "tabPanel",
|
|
195
|
+
content: "block+",
|
|
196
|
+
defining: true,
|
|
197
|
+
isolating: true,
|
|
198
|
+
addAttributes() {
|
|
199
|
+
return {
|
|
200
|
+
label: { default: "Tab" },
|
|
201
|
+
icon: { default: null }
|
|
202
|
+
};
|
|
203
|
+
},
|
|
204
|
+
parseHTML() {
|
|
205
|
+
return [{ tag: 'div[data-type="tab-panel"]' }];
|
|
206
|
+
},
|
|
207
|
+
renderHTML({ HTMLAttributes }) {
|
|
208
|
+
return ["div", mergeAttributes(HTMLAttributes, { "data-type": "tab-panel" }), 0];
|
|
209
|
+
},
|
|
210
|
+
addNodeView() {
|
|
211
|
+
return VueNodeViewRenderer(TabPanelWidgetComponent);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
export const TabsWidget = Node.create({
|
|
215
|
+
name: "tabsWidget",
|
|
216
|
+
group: "block",
|
|
217
|
+
content: "tabPanel+",
|
|
218
|
+
defining: true,
|
|
219
|
+
draggable: true,
|
|
220
|
+
addAttributes() {
|
|
221
|
+
return {};
|
|
222
|
+
},
|
|
223
|
+
parseHTML() {
|
|
224
|
+
return [{ tag: 'div[data-type="tabs-widget"]' }];
|
|
225
|
+
},
|
|
226
|
+
renderHTML({ HTMLAttributes }) {
|
|
227
|
+
return ["div", mergeAttributes(HTMLAttributes, { "data-type": "tabs-widget" }), 0];
|
|
228
|
+
},
|
|
229
|
+
addNodeView() {
|
|
230
|
+
return VueNodeViewRenderer(TabsWidgetComponent);
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
export const IconWidget = Node.create({
|
|
234
|
+
name: "iconWidget",
|
|
235
|
+
group: "inline",
|
|
236
|
+
inline: true,
|
|
237
|
+
atom: true,
|
|
238
|
+
draggable: true,
|
|
239
|
+
addAttributes() {
|
|
240
|
+
return {
|
|
241
|
+
name: { default: "" }
|
|
242
|
+
};
|
|
243
|
+
},
|
|
244
|
+
parseHTML() {
|
|
245
|
+
return [{ tag: 'span[data-type="icon-widget"]' }];
|
|
246
|
+
},
|
|
247
|
+
renderHTML({ HTMLAttributes }) {
|
|
248
|
+
return ["span", mergeAttributes(HTMLAttributes, { "data-type": "icon-widget" })];
|
|
249
|
+
},
|
|
250
|
+
addNodeView() {
|
|
251
|
+
return VueNodeViewRenderer(IconWidgetComponent);
|
|
252
|
+
},
|
|
253
|
+
addInputRules() {
|
|
254
|
+
return [
|
|
255
|
+
{
|
|
256
|
+
find: /:(i-lucide-[\w-]+):$/,
|
|
257
|
+
handler: ({ state, range, match }) => {
|
|
258
|
+
const attrs = { name: match[1] };
|
|
259
|
+
const { tr } = state;
|
|
260
|
+
tr.replaceWith(range.from, range.to, this.type.create(attrs));
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
];
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
export const AllWidgets = [
|
|
267
|
+
SwitchWidget,
|
|
268
|
+
CheckboxWidget,
|
|
269
|
+
ButtonWidget,
|
|
270
|
+
SliderWidget,
|
|
271
|
+
ColorPickerWidget,
|
|
272
|
+
CalendarWidget,
|
|
273
|
+
InputDateWidget,
|
|
274
|
+
ScrollAreaWidget,
|
|
275
|
+
TabPanel,
|
|
276
|
+
TabsWidget,
|
|
277
|
+
IconWidget
|
|
278
|
+
];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { useCollabStatus } from "./useCollabStatus.js";
|
|
2
|
+
export { useEditorCollaboration } from "./useEditorCollaboration.js";
|
|
3
|
+
export type { CollaborationUser, CollaborationOptions } from "./useEditorCollaboration.js";
|
|
4
|
+
export { COLORS, getRandomColor, getRandomName } from "./useEditorCollaboration.js";
|
|
5
|
+
export { useEditorCompletion } from "./useEditorCompletion.js";
|
|
6
|
+
export { useEditorDragHandle } from "./useEditorDragHandle.js";
|
|
7
|
+
export { useEditorEmojis } from "./useEditorEmojis.js";
|
|
8
|
+
export { useEditorMentions } from "./useEditorMentions.js";
|
|
9
|
+
export { useEditorSuggestions } from "./useEditorSuggestions.js";
|
|
10
|
+
export { useEditorToolbar } from "./useEditorToolbar.js";
|
|
11
|
+
export { useLucideIcons } from "./useLucideIcons.js";
|
|
12
|
+
export { useDocumentPermissions } from "./useDocumentPermissions.js";
|
|
13
|
+
export { useSpaces } from "./useSpaces.js";
|
|
14
|
+
export { useOnlineStatus } from "./useOnlineStatus.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { useCollabStatus } from "./useCollabStatus.js";
|
|
2
|
+
export { useEditorCollaboration } from "./useEditorCollaboration.js";
|
|
3
|
+
export { COLORS, getRandomColor, getRandomName } from "./useEditorCollaboration.js";
|
|
4
|
+
export { useEditorCompletion } from "./useEditorCompletion.js";
|
|
5
|
+
export { useEditorDragHandle } from "./useEditorDragHandle.js";
|
|
6
|
+
export { useEditorEmojis } from "./useEditorEmojis.js";
|
|
7
|
+
export { useEditorMentions } from "./useEditorMentions.js";
|
|
8
|
+
export { useEditorSuggestions } from "./useEditorSuggestions.js";
|
|
9
|
+
export { useEditorToolbar } from "./useEditorToolbar.js";
|
|
10
|
+
export { useLucideIcons } from "./useLucideIcons.js";
|
|
11
|
+
export { useDocumentPermissions } from "./useDocumentPermissions.js";
|
|
12
|
+
export { useSpaces } from "./useSpaces.js";
|
|
13
|
+
export { useOnlineStatus } from "./useOnlineStatus.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Ref } from "vue";
|
|
2
|
+
/**
|
|
3
|
+
* Derives a human-readable status label and color from connection state.
|
|
4
|
+
* Useful for displaying connection indicators in Nuxt UI components.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useCollabStatus(status: Ref<"disconnected" | "connecting" | "connected">, synced: Ref<boolean>): {
|
|
7
|
+
label: import("vue").ComputedRef<"Saved" | "Syncing" | "Connecting" | "Offline">;
|
|
8
|
+
color: import("vue").ComputedRef<"success" | "info" | "warning" | "error">;
|
|
9
|
+
icon: import("vue").ComputedRef<"i-lucide-cloud-check" | "i-lucide-cloud-upload" | "i-lucide-cloud" | "i-lucide-cloud-off">;
|
|
10
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
export function useCollabStatus(status, synced) {
|
|
3
|
+
const label = computed(() => {
|
|
4
|
+
if (status.value === "connected" && synced.value) return "Saved";
|
|
5
|
+
if (status.value === "connected") return "Syncing";
|
|
6
|
+
if (status.value === "connecting") return "Connecting";
|
|
7
|
+
return "Offline";
|
|
8
|
+
});
|
|
9
|
+
const color = computed(() => {
|
|
10
|
+
if (status.value === "connected" && synced.value) return "success";
|
|
11
|
+
if (status.value === "connected") return "info";
|
|
12
|
+
if (status.value === "connecting") return "warning";
|
|
13
|
+
return "error";
|
|
14
|
+
});
|
|
15
|
+
const icon = computed(() => {
|
|
16
|
+
if (status.value === "connected" && synced.value)
|
|
17
|
+
return "i-lucide-cloud-check";
|
|
18
|
+
if (status.value === "connected") return "i-lucide-cloud-upload";
|
|
19
|
+
if (status.value === "connecting") return "i-lucide-cloud";
|
|
20
|
+
return "i-lucide-cloud-off";
|
|
21
|
+
});
|
|
22
|
+
return { label, color, icon };
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type MaybeRef } from "vue";
|
|
2
|
+
export declare function useDocumentPermissions(role: MaybeRef<string | undefined | null>): {
|
|
3
|
+
role: import("vue").ComputedRef<string>;
|
|
4
|
+
canRead: import("vue").ComputedRef<boolean>;
|
|
5
|
+
canWrite: import("vue").ComputedRef<boolean>;
|
|
6
|
+
canCreate: import("vue").ComputedRef<boolean>;
|
|
7
|
+
canDelete: import("vue").ComputedRef<boolean>;
|
|
8
|
+
canUpload: import("vue").ComputedRef<boolean>;
|
|
9
|
+
canManage: import("vue").ComputedRef<boolean>;
|
|
10
|
+
meetsRole: (required: string | string[]) => boolean;
|
|
11
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { computed, toValue } from "vue";
|
|
2
|
+
const ROLE_HIERARCHY = {
|
|
3
|
+
owner: 5,
|
|
4
|
+
admin: 4,
|
|
5
|
+
member: 3,
|
|
6
|
+
editor: 2,
|
|
7
|
+
viewer: 1
|
|
8
|
+
};
|
|
9
|
+
const PERMISSION_MATRIX = {
|
|
10
|
+
owner: { document: ["create", "read", "update", "delete"], file: ["upload", "read", "delete"] },
|
|
11
|
+
admin: { document: ["create", "read", "update", "delete"], file: ["upload", "read", "delete"] },
|
|
12
|
+
member: { document: ["create", "read", "update"], file: ["upload", "read"] },
|
|
13
|
+
editor: { document: ["read", "update"], file: ["upload", "read"] },
|
|
14
|
+
viewer: { document: ["read"], file: ["read"] }
|
|
15
|
+
};
|
|
16
|
+
export function useDocumentPermissions(role) {
|
|
17
|
+
const currentRole = computed(() => toValue(role) || "viewer");
|
|
18
|
+
const canRead = computed(() => hasPermission(currentRole.value, "document", "read"));
|
|
19
|
+
const canWrite = computed(() => hasPermission(currentRole.value, "document", "update"));
|
|
20
|
+
const canCreate = computed(() => hasPermission(currentRole.value, "document", "create"));
|
|
21
|
+
const canDelete = computed(() => hasPermission(currentRole.value, "document", "delete"));
|
|
22
|
+
const canUpload = computed(() => hasPermission(currentRole.value, "file", "upload"));
|
|
23
|
+
const canManage = computed(() => (ROLE_HIERARCHY[currentRole.value] ?? 0) >= (ROLE_HIERARCHY["admin"] ?? Infinity));
|
|
24
|
+
function hasPermission(roleName, resource, action) {
|
|
25
|
+
const perms = PERMISSION_MATRIX[roleName];
|
|
26
|
+
if (!perms) return false;
|
|
27
|
+
return perms[resource].includes(action);
|
|
28
|
+
}
|
|
29
|
+
function meetsRole(required) {
|
|
30
|
+
const roles = Array.isArray(required) ? required : [required];
|
|
31
|
+
const userLevel = ROLE_HIERARCHY[currentRole.value] ?? 0;
|
|
32
|
+
return roles.some((r) => userLevel >= (ROLE_HIERARCHY[r] ?? Infinity));
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
role: currentRole,
|
|
36
|
+
canRead,
|
|
37
|
+
canWrite,
|
|
38
|
+
canCreate,
|
|
39
|
+
canDelete,
|
|
40
|
+
canUpload,
|
|
41
|
+
canManage,
|
|
42
|
+
meetsRole
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface CollaborationUser {
|
|
2
|
+
name: string;
|
|
3
|
+
color: string;
|
|
4
|
+
avatar?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CollaborationOptions {
|
|
7
|
+
spaceId: string;
|
|
8
|
+
documentId: string;
|
|
9
|
+
user: CollaborationUser;
|
|
10
|
+
}
|
|
11
|
+
export declare const COLORS: Record<string, string>;
|
|
12
|
+
export declare const getRandomColor: () => string;
|
|
13
|
+
export declare const getRandomName: () => string;
|
|
14
|
+
export declare function useEditorCollaboration(options: CollaborationOptions): {
|
|
15
|
+
enabled: true;
|
|
16
|
+
ready: any;
|
|
17
|
+
status: any;
|
|
18
|
+
isConnected: any;
|
|
19
|
+
connectedUsers: any;
|
|
20
|
+
extensions: any;
|
|
21
|
+
updateUser: (updates: Partial<CollaborationUser>) => void;
|
|
22
|
+
doc: any;
|
|
23
|
+
provider: any;
|
|
24
|
+
synced: any;
|
|
25
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Collaboration, CollaborationCursor } from "@rgby/collab-core";
|
|
2
|
+
export const COLORS = {
|
|
3
|
+
red: "#f87171",
|
|
4
|
+
orange: "#fb923c",
|
|
5
|
+
amber: "#fbbf24",
|
|
6
|
+
yellow: "#facc15",
|
|
7
|
+
lime: "#a3e635",
|
|
8
|
+
green: "#4ade80",
|
|
9
|
+
emerald: "#34d399",
|
|
10
|
+
teal: "#2dd4bf",
|
|
11
|
+
cyan: "#22d3ee",
|
|
12
|
+
sky: "#38bdf8",
|
|
13
|
+
blue: "#60a5fa",
|
|
14
|
+
indigo: "#818cf8",
|
|
15
|
+
violet: "#a78bfa",
|
|
16
|
+
purple: "#c084fc",
|
|
17
|
+
fuchsia: "#e879f9",
|
|
18
|
+
pink: "#f472b6",
|
|
19
|
+
rose: "#fb7185"
|
|
20
|
+
};
|
|
21
|
+
const ADJECTIVES = [
|
|
22
|
+
"Swift",
|
|
23
|
+
"Clever",
|
|
24
|
+
"Bright",
|
|
25
|
+
"Quick",
|
|
26
|
+
"Sharp",
|
|
27
|
+
"Bold",
|
|
28
|
+
"Calm",
|
|
29
|
+
"Kind",
|
|
30
|
+
"Brave",
|
|
31
|
+
"Wise",
|
|
32
|
+
"Noble",
|
|
33
|
+
"Mighty",
|
|
34
|
+
"Gentle",
|
|
35
|
+
"Fierce",
|
|
36
|
+
"Silent",
|
|
37
|
+
"Wild",
|
|
38
|
+
"Golden",
|
|
39
|
+
"Silver",
|
|
40
|
+
"Cosmic",
|
|
41
|
+
"Lucky",
|
|
42
|
+
"Mystic",
|
|
43
|
+
"Stellar",
|
|
44
|
+
"Radiant",
|
|
45
|
+
"Daring"
|
|
46
|
+
];
|
|
47
|
+
const ANIMALS = [
|
|
48
|
+
"Fox",
|
|
49
|
+
"Owl",
|
|
50
|
+
"Bear",
|
|
51
|
+
"Wolf",
|
|
52
|
+
"Eagle",
|
|
53
|
+
"Hawk",
|
|
54
|
+
"Lion",
|
|
55
|
+
"Tiger",
|
|
56
|
+
"Falcon",
|
|
57
|
+
"Panther",
|
|
58
|
+
"Dolphin",
|
|
59
|
+
"Phoenix",
|
|
60
|
+
"Dragon",
|
|
61
|
+
"Raven",
|
|
62
|
+
"Lynx",
|
|
63
|
+
"Otter",
|
|
64
|
+
"Stag",
|
|
65
|
+
"Cobra",
|
|
66
|
+
"Jaguar",
|
|
67
|
+
"Crane",
|
|
68
|
+
"Badger",
|
|
69
|
+
"Viper",
|
|
70
|
+
"Condor",
|
|
71
|
+
"Gazelle"
|
|
72
|
+
];
|
|
73
|
+
export const getRandomColor = () => {
|
|
74
|
+
const keys = Object.keys(COLORS);
|
|
75
|
+
return keys[Math.floor(Math.random() * keys.length)];
|
|
76
|
+
};
|
|
77
|
+
export const getRandomName = () => `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)]} ${ANIMALS[Math.floor(Math.random() * ANIMALS.length)]}`;
|
|
78
|
+
export function useEditorCollaboration(options) {
|
|
79
|
+
const { spaceId, documentId, user } = options;
|
|
80
|
+
const {
|
|
81
|
+
doc,
|
|
82
|
+
provider,
|
|
83
|
+
status,
|
|
84
|
+
synced,
|
|
85
|
+
users: rawUsers,
|
|
86
|
+
updatePresence,
|
|
87
|
+
me
|
|
88
|
+
} = useCollaborativeDocument(spaceId, documentId);
|
|
89
|
+
const isConnected = computed(() => status.value === "connected");
|
|
90
|
+
const ready = computed(() => !!doc.value && !!provider.value);
|
|
91
|
+
watch(() => isConnected.value, (connected) => {
|
|
92
|
+
if (connected) {
|
|
93
|
+
updatePresence({
|
|
94
|
+
user: {
|
|
95
|
+
name: user.name,
|
|
96
|
+
color: user.color,
|
|
97
|
+
avatar: user.avatar
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}, { immediate: true });
|
|
102
|
+
const connectedUsers = computed(() => {
|
|
103
|
+
return rawUsers.value.filter((u) => u.user).map((u) => ({
|
|
104
|
+
...u.user,
|
|
105
|
+
// Ensure name and color exist, fallback if needed
|
|
106
|
+
name: u.user.name || "Anonymous",
|
|
107
|
+
color: u.user.color || "#ccc"
|
|
108
|
+
}));
|
|
109
|
+
});
|
|
110
|
+
const extensions = computed(() => {
|
|
111
|
+
if (!doc.value || !provider.value) return [];
|
|
112
|
+
return [
|
|
113
|
+
Collaboration.configure({
|
|
114
|
+
document: doc.value
|
|
115
|
+
}),
|
|
116
|
+
CollaborationCursor.configure({
|
|
117
|
+
provider: provider.value,
|
|
118
|
+
user: {
|
|
119
|
+
name: user.name,
|
|
120
|
+
color: user.color
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
];
|
|
124
|
+
});
|
|
125
|
+
return {
|
|
126
|
+
enabled: true,
|
|
127
|
+
ready,
|
|
128
|
+
status,
|
|
129
|
+
isConnected,
|
|
130
|
+
connectedUsers,
|
|
131
|
+
extensions,
|
|
132
|
+
// Helper to update local user if needed
|
|
133
|
+
updateUser: (updates) => {
|
|
134
|
+
updatePresence({ user: { ...user, ...updates } });
|
|
135
|
+
},
|
|
136
|
+
// Expose raw values if needed by other components
|
|
137
|
+
doc,
|
|
138
|
+
provider,
|
|
139
|
+
synced
|
|
140
|
+
};
|
|
141
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/vue-3';
|
|
2
|
+
interface UseEditorCompletionOptions {
|
|
3
|
+
api?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function useEditorCompletion(_editorRef: Ref<{
|
|
6
|
+
editor: Editor | undefined;
|
|
7
|
+
} | null | undefined>, _options?: UseEditorCompletionOptions): {
|
|
8
|
+
extension: import("@tiptap/core").Extension<import("../components/editor/CompletionExtension.js").CompletionOptions, import("../components/editor/CompletionExtension.js").CompletionStorage>;
|
|
9
|
+
handlers: {
|
|
10
|
+
aiContinue: {
|
|
11
|
+
canExecute: () => boolean;
|
|
12
|
+
execute: () => undefined;
|
|
13
|
+
isActive: () => boolean;
|
|
14
|
+
isDisabled: () => boolean;
|
|
15
|
+
};
|
|
16
|
+
aiFix: {
|
|
17
|
+
canExecute: () => boolean;
|
|
18
|
+
execute: () => undefined;
|
|
19
|
+
isActive: () => boolean;
|
|
20
|
+
isDisabled: () => boolean;
|
|
21
|
+
};
|
|
22
|
+
aiExtend: {
|
|
23
|
+
canExecute: () => boolean;
|
|
24
|
+
execute: () => undefined;
|
|
25
|
+
isActive: () => boolean;
|
|
26
|
+
isDisabled: () => boolean;
|
|
27
|
+
};
|
|
28
|
+
aiReduce: {
|
|
29
|
+
canExecute: () => boolean;
|
|
30
|
+
execute: () => undefined;
|
|
31
|
+
isActive: () => boolean;
|
|
32
|
+
isDisabled: () => boolean;
|
|
33
|
+
};
|
|
34
|
+
aiSimplify: {
|
|
35
|
+
canExecute: () => boolean;
|
|
36
|
+
execute: () => undefined;
|
|
37
|
+
isActive: () => boolean;
|
|
38
|
+
isDisabled: () => boolean;
|
|
39
|
+
};
|
|
40
|
+
aiSummarize: {
|
|
41
|
+
canExecute: () => boolean;
|
|
42
|
+
execute: () => undefined;
|
|
43
|
+
isActive: () => boolean;
|
|
44
|
+
isDisabled: () => boolean;
|
|
45
|
+
};
|
|
46
|
+
aiTranslate: {
|
|
47
|
+
canExecute: () => boolean;
|
|
48
|
+
execute: () => undefined;
|
|
49
|
+
isActive: () => boolean;
|
|
50
|
+
isDisabled: () => boolean;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
isLoading: any;
|
|
54
|
+
mode: any;
|
|
55
|
+
completion: any;
|
|
56
|
+
complete: () => void;
|
|
57
|
+
stop: () => void;
|
|
58
|
+
setCompletion: () => void;
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Completion } from "../components/editor/CompletionExtension.js";
|
|
2
|
+
export function useEditorCompletion(_editorRef, _options = {}) {
|
|
3
|
+
const isLoading = ref(false);
|
|
4
|
+
const mode = ref("continue");
|
|
5
|
+
const completion = ref("");
|
|
6
|
+
const extension = Completion.configure({
|
|
7
|
+
onTrigger: () => {
|
|
8
|
+
},
|
|
9
|
+
onAccept: () => {
|
|
10
|
+
},
|
|
11
|
+
onDismiss: () => {
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const handlers = {
|
|
15
|
+
aiContinue: {
|
|
16
|
+
canExecute: () => false,
|
|
17
|
+
execute: () => void 0,
|
|
18
|
+
isActive: () => false,
|
|
19
|
+
isDisabled: () => true
|
|
20
|
+
},
|
|
21
|
+
aiFix: { canExecute: () => false, execute: () => void 0, isActive: () => false, isDisabled: () => true },
|
|
22
|
+
aiExtend: { canExecute: () => false, execute: () => void 0, isActive: () => false, isDisabled: () => true },
|
|
23
|
+
aiReduce: { canExecute: () => false, execute: () => void 0, isActive: () => false, isDisabled: () => true },
|
|
24
|
+
aiSimplify: { canExecute: () => false, execute: () => void 0, isActive: () => false, isDisabled: () => true },
|
|
25
|
+
aiSummarize: { canExecute: () => false, execute: () => void 0, isActive: () => false, isDisabled: () => true },
|
|
26
|
+
aiTranslate: { canExecute: () => false, execute: () => void 0, isActive: () => false, isDisabled: () => true }
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
extension,
|
|
30
|
+
handlers,
|
|
31
|
+
isLoading,
|
|
32
|
+
mode,
|
|
33
|
+
completion,
|
|
34
|
+
// Add missing exports that might be expected by the component
|
|
35
|
+
complete: () => {
|
|
36
|
+
},
|
|
37
|
+
stop: () => {
|
|
38
|
+
},
|
|
39
|
+
setCompletion: () => {
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DropdownMenuItem, EditorCustomHandlers } from '@nuxt/ui';
|
|
2
|
+
import type { Editor, JSONContent } from '@tiptap/vue-3';
|
|
3
|
+
export declare function useEditorDragHandle<T extends EditorCustomHandlers>(customHandlers?: T): {
|
|
4
|
+
selectedNode: any;
|
|
5
|
+
getItems: (editor: Editor) => DropdownMenuItem[][];
|
|
6
|
+
onNodeChange: (event: {
|
|
7
|
+
node: JSONContent | null;
|
|
8
|
+
pos: number;
|
|
9
|
+
}) => void;
|
|
10
|
+
};
|