@abraca/nuxt 2.0.11 → 2.4.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.
Files changed (135) hide show
  1. package/dist/module.d.mts +68 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +99 -4
  4. package/dist/runtime/components/ACodeEditor.d.vue.ts +26 -0
  5. package/dist/runtime/components/ACodeEditor.vue +268 -0
  6. package/dist/runtime/components/ACodeEditor.vue.d.ts +26 -0
  7. package/dist/runtime/components/ADocumentTree.vue +52 -20
  8. package/dist/runtime/components/AEditor.d.vue.ts +20 -13
  9. package/dist/runtime/components/AEditor.vue +55 -2
  10. package/dist/runtime/components/AEditor.vue.d.ts +20 -13
  11. package/dist/runtime/components/ANodePanel.vue +64 -60
  12. package/dist/runtime/components/ANotificationBell.d.vue.ts +1 -1
  13. package/dist/runtime/components/ANotificationBell.vue.d.ts +1 -1
  14. package/dist/runtime/components/ASpaceFormModal.d.vue.ts +2 -2
  15. package/dist/runtime/components/ASpaceFormModal.vue.d.ts +2 -2
  16. package/dist/runtime/components/aware/AMedia.d.vue.ts +1 -1
  17. package/dist/runtime/components/aware/AMedia.vue.d.ts +1 -1
  18. package/dist/runtime/components/aware/APresenceBlobs.d.vue.ts +29 -1
  19. package/dist/runtime/components/aware/APresenceBlobs.vue +54 -8
  20. package/dist/runtime/components/aware/APresenceBlobs.vue.d.ts +29 -1
  21. package/dist/runtime/components/aware/APresenceCursors.d.vue.ts +11 -0
  22. package/dist/runtime/components/aware/APresenceCursors.vue +74 -9
  23. package/dist/runtime/components/aware/APresenceCursors.vue.d.ts +11 -0
  24. package/dist/runtime/components/aware/AToggleGroup.d.vue.ts +28 -13
  25. package/dist/runtime/components/aware/AToggleGroup.vue +56 -20
  26. package/dist/runtime/components/aware/AToggleGroup.vue.d.ts +28 -13
  27. package/dist/runtime/components/docs/ADocsNavigation.d.vue.ts +1 -1
  28. package/dist/runtime/components/docs/ADocsNavigation.vue.d.ts +1 -1
  29. package/dist/runtime/components/docs/ADocsSearch.d.vue.ts +1 -1
  30. package/dist/runtime/components/docs/ADocsSearch.vue.d.ts +1 -1
  31. package/dist/runtime/components/docs/ADocsSearchButton.d.vue.ts +1 -1
  32. package/dist/runtime/components/docs/ADocsSearchButton.vue.d.ts +1 -1
  33. package/dist/runtime/components/docs/ADocsToc.d.vue.ts +2 -2
  34. package/dist/runtime/components/docs/ADocsToc.vue.d.ts +2 -2
  35. package/dist/runtime/components/editor/AEditorRedoButton.d.vue.ts +1 -1
  36. package/dist/runtime/components/editor/AEditorRedoButton.vue.d.ts +1 -1
  37. package/dist/runtime/components/editor/AEditorUndoButton.d.vue.ts +1 -1
  38. package/dist/runtime/components/editor/AEditorUndoButton.vue.d.ts +1 -1
  39. package/dist/runtime/components/editor/AFileGlbViewer.vue +27 -10
  40. package/dist/runtime/components/editor/ANodeInlineLabel.d.vue.ts +1 -1
  41. package/dist/runtime/components/editor/ANodeInlineLabel.vue.d.ts +1 -1
  42. package/dist/runtime/components/registry/APluginBrowser.d.vue.ts +23 -0
  43. package/dist/runtime/components/registry/APluginBrowser.vue +155 -0
  44. package/dist/runtime/components/registry/APluginBrowser.vue.d.ts +23 -0
  45. package/dist/runtime/components/registry/APluginCapabilityDialog.d.vue.ts +17 -0
  46. package/dist/runtime/components/registry/APluginCapabilityDialog.vue +159 -0
  47. package/dist/runtime/components/registry/APluginCapabilityDialog.vue.d.ts +17 -0
  48. package/dist/runtime/components/registry/APluginCard.d.vue.ts +20 -0
  49. package/dist/runtime/components/registry/APluginCard.vue +91 -0
  50. package/dist/runtime/components/registry/APluginCard.vue.d.ts +20 -0
  51. package/dist/runtime/components/registry/APluginDetail.d.vue.ts +18 -0
  52. package/dist/runtime/components/registry/APluginDetail.vue +252 -0
  53. package/dist/runtime/components/registry/APluginDetail.vue.d.ts +18 -0
  54. package/dist/runtime/components/renderers/ACodeRenderer.d.vue.ts +15 -0
  55. package/dist/runtime/components/renderers/ACodeRenderer.vue +68 -0
  56. package/dist/runtime/components/renderers/ACodeRenderer.vue.d.ts +15 -0
  57. package/dist/runtime/components/renderers/AGraphRenderer.vue +416 -120
  58. package/dist/runtime/components/renderers/AProseRenderer.d.vue.ts +2 -2
  59. package/dist/runtime/components/renderers/AProseRenderer.vue.d.ts +2 -2
  60. package/dist/runtime/components/renderers/sheets/ASheetsToolbar.d.vue.ts +4 -4
  61. package/dist/runtime/components/renderers/sheets/ASheetsToolbar.vue.d.ts +4 -4
  62. package/dist/runtime/components/shell/ABreadcrumbForDoc.d.vue.ts +11 -0
  63. package/dist/runtime/components/shell/ABreadcrumbForDoc.vue +16 -0
  64. package/dist/runtime/components/shell/ABreadcrumbForDoc.vue.d.ts +11 -0
  65. package/dist/runtime/components/shell/ASettingsSection.d.vue.ts +35 -0
  66. package/dist/runtime/components/shell/ASettingsSection.vue +26 -0
  67. package/dist/runtime/components/shell/ASettingsSection.vue.d.ts +35 -0
  68. package/dist/runtime/components/shell/ASidebar.d.vue.ts +1 -1
  69. package/dist/runtime/components/shell/ASidebar.vue.d.ts +1 -1
  70. package/dist/runtime/components/shell/AUserMenu.d.vue.ts +3 -0
  71. package/dist/runtime/components/shell/AUserMenu.vue +4 -0
  72. package/dist/runtime/components/shell/AUserMenu.vue.d.ts +3 -0
  73. package/dist/runtime/composables/useAbracadabraSchema.d.ts +83 -0
  74. package/dist/runtime/composables/useAbracadabraSchema.js +52 -0
  75. package/dist/runtime/composables/useAggregatedPresence.d.ts +1 -6
  76. package/dist/runtime/composables/useCalendarView.d.ts +1 -1
  77. package/dist/runtime/composables/useChat.js +1 -0
  78. package/dist/runtime/composables/useDocBreadcrumb.d.ts +21 -0
  79. package/dist/runtime/composables/useDocBreadcrumb.js +33 -0
  80. package/dist/runtime/composables/useDocEntryTyped.d.ts +60 -0
  81. package/dist/runtime/composables/useDocEntryTyped.js +70 -0
  82. package/dist/runtime/composables/useEditorDragHandle.js +18 -0
  83. package/dist/runtime/composables/useEditorSuggestions.js +2 -1
  84. package/dist/runtime/composables/useInstalledPlugins.d.ts +3 -21
  85. package/dist/runtime/composables/useInstalledPlugins.js +2 -12
  86. package/dist/runtime/composables/useMetaMenuItems.d.ts +21 -0
  87. package/dist/runtime/composables/useMetaMenuItems.js +115 -0
  88. package/dist/runtime/composables/useMetaValidator.d.ts +27 -0
  89. package/dist/runtime/composables/useMetaValidator.js +10 -0
  90. package/dist/runtime/composables/usePluginCatalog.d.ts +161 -0
  91. package/dist/runtime/composables/usePluginCatalog.js +234 -0
  92. package/dist/runtime/composables/useQuery.d.ts +79 -0
  93. package/dist/runtime/composables/useQuery.js +97 -0
  94. package/dist/runtime/composables/useSpaces.js +4 -5
  95. package/dist/runtime/composables/useTableView.d.ts +3 -3
  96. package/dist/runtime/composables/useTypedDoc.d.ts +97 -0
  97. package/dist/runtime/composables/useTypedDoc.js +114 -0
  98. package/dist/runtime/composables/useWebRTC.js +44 -5
  99. package/dist/runtime/extensions/document-meta.js +5 -0
  100. package/dist/runtime/extensions/timeline.d.ts +11 -0
  101. package/dist/runtime/extensions/timeline.js +52 -0
  102. package/dist/runtime/extensions/views/DocumentMetaView.d.vue.ts +4 -0
  103. package/dist/runtime/extensions/views/DocumentMetaView.vue +63 -0
  104. package/dist/runtime/extensions/views/DocumentMetaView.vue.d.ts +4 -0
  105. package/dist/runtime/extensions/views/TimelineItemView.d.vue.ts +4 -0
  106. package/dist/runtime/extensions/views/TimelineItemView.vue +131 -0
  107. package/dist/runtime/extensions/views/TimelineItemView.vue.d.ts +4 -0
  108. package/dist/runtime/extensions/views/TimelineView.d.vue.ts +9 -0
  109. package/dist/runtime/extensions/views/TimelineView.vue +29 -0
  110. package/dist/runtime/extensions/views/TimelineView.vue.d.ts +9 -0
  111. package/dist/runtime/locale.d.ts +2 -0
  112. package/dist/runtime/locale.js +2 -0
  113. package/dist/runtime/plugin-abracadabra.client.js +107 -6
  114. package/dist/runtime/plugin-registry.d.ts +11 -30
  115. package/dist/runtime/plugin-registry.js +2 -82
  116. package/dist/runtime/plugins/core.plugin.js +10 -4
  117. package/dist/runtime/server/api/_abracadabra/spaces.get.d.ts +1 -1
  118. package/dist/runtime/server/plugins/abracadabra-service.js +28 -0
  119. package/dist/runtime/server/utils/docCache.js +24 -3
  120. package/dist/runtime/server/utils/schemaServerSupport.d.ts +52 -0
  121. package/dist/runtime/server/utils/schemaServerSupport.js +51 -0
  122. package/dist/runtime/types.d.ts +63 -46
  123. package/dist/runtime/utils/docTypes.d.ts +15 -0
  124. package/dist/runtime/utils/docTypes.js +20 -0
  125. package/dist/runtime/utils/loadCodeMirror.d.ts +32 -0
  126. package/dist/runtime/utils/loadCodeMirror.js +65 -0
  127. package/dist/runtime/utils/loadThree.d.ts +18 -0
  128. package/dist/runtime/utils/loadThree.js +46 -0
  129. package/dist/runtime/utils/markdownToYjs.d.ts +1 -23
  130. package/dist/runtime/utils/markdownToYjs.js +5 -440
  131. package/dist/runtime/utils/schemaSupport.d.ts +60 -0
  132. package/dist/runtime/utils/schemaSupport.js +40 -0
  133. package/dist/runtime/utils/yjsConvert.d.ts +1 -14
  134. package/dist/runtime/utils/yjsConvert.js +5 -331
  135. package/package.json +86 -21
@@ -1,331 +1,5 @@
1
- import * as Y from "yjs";
2
- function serializeDelta(delta) {
3
- let result = "";
4
- for (const op of delta) {
5
- if (typeof op.insert !== "string") continue;
6
- let text = op.insert;
7
- const attrs = op.attributes ?? {};
8
- if (attrs.code) {
9
- result += `\`${text}\``;
10
- continue;
11
- }
12
- if (attrs.bold) text = `**${text}**`;
13
- if (attrs.italic) text = `*${text}*`;
14
- if (attrs.strike) text = `~~${text}~~`;
15
- if (attrs.link) {
16
- const href = attrs.link.href ?? "";
17
- text = `[${text}](${href})`;
18
- }
19
- result += text;
20
- }
21
- return result;
22
- }
23
- function serializeInline(el) {
24
- const parts = [];
25
- for (const child of el.toArray()) {
26
- if (child instanceof Y.XmlText) {
27
- parts.push(serializeDelta(child.toDelta()));
28
- } else if (child instanceof Y.XmlElement) {
29
- parts.push(serializeInline(child));
30
- }
31
- }
32
- return parts.join("");
33
- }
34
- function serializeBlock(el, indent = "") {
35
- if (el instanceof Y.XmlText) {
36
- return serializeDelta(el.toDelta());
37
- }
38
- const name = el.nodeName;
39
- switch (name) {
40
- case "documentHeader":
41
- case "documentMeta":
42
- return "";
43
- case "heading": {
44
- const level = Number(el.getAttribute("level") ?? 2);
45
- const hashes = "#".repeat(level);
46
- return `${hashes} ${serializeInline(el)}`;
47
- }
48
- case "paragraph":
49
- return serializeInline(el);
50
- case "bulletList":
51
- return serializeListItems(el, "bullet", indent);
52
- case "orderedList":
53
- return serializeListItems(el, "ordered", indent);
54
- case "taskList":
55
- return serializeTaskList(el, indent);
56
- case "codeBlock": {
57
- const lang = el.getAttribute("language") ?? "";
58
- const code = getCodeBlockText(el);
59
- return `\`\`\`${lang}
60
- ${code}
61
- \`\`\``;
62
- }
63
- case "blockquote": {
64
- const lines = [];
65
- for (const child of el.toArray()) {
66
- if (child instanceof Y.XmlElement) {
67
- const text = serializeBlock(child);
68
- for (const line of text.split("\n")) {
69
- lines.push(`> ${line}`);
70
- }
71
- }
72
- }
73
- return lines.join("\n");
74
- }
75
- case "table":
76
- return serializeTable(el);
77
- case "horizontalRule":
78
- return "---";
79
- case "image": {
80
- const src = el.getAttribute("src") ?? "";
81
- const alt = el.getAttribute("alt") ?? "";
82
- return `![${alt}](${src})`;
83
- }
84
- case "fileBlock": {
85
- const uploadId = el.getAttribute("uploadId") ?? "";
86
- const filename = el.getAttribute("filename") ?? "file";
87
- if (uploadId) return `<!--fileblock:${uploadId}:${filename}-->`;
88
- return `<!-- file: ${filename} -->`;
89
- }
90
- default:
91
- return serializeChildren(el);
92
- }
93
- }
94
- function serializeChildren(el) {
95
- const blocks = [];
96
- for (const child of el.toArray()) {
97
- if (child instanceof Y.XmlElement) {
98
- const text = serializeBlock(child);
99
- if (text) blocks.push(text);
100
- } else if (child instanceof Y.XmlText) {
101
- const text = serializeDelta(child.toDelta());
102
- if (text) blocks.push(text);
103
- }
104
- }
105
- return blocks.join("\n\n");
106
- }
107
- function serializeListItems(el, type, indent) {
108
- const lines = [];
109
- let counter = 1;
110
- for (const child of el.toArray()) {
111
- if (!(child instanceof Y.XmlElement) || child.nodeName !== "listItem") continue;
112
- const prefix = type === "bullet" ? "- " : `${counter++}. `;
113
- const subParts = [];
114
- for (const sub of child.toArray()) {
115
- if (!(sub instanceof Y.XmlElement)) continue;
116
- if (sub.nodeName === "bulletList") {
117
- subParts.push(serializeListItems(sub, "bullet", indent + " "));
118
- } else if (sub.nodeName === "orderedList") {
119
- subParts.push(serializeListItems(sub, "ordered", indent + " "));
120
- } else {
121
- subParts.push(serializeInline(sub));
122
- }
123
- }
124
- if (subParts.length <= 1) {
125
- lines.push(`${indent}${prefix}${subParts[0] ?? ""}`);
126
- } else {
127
- lines.push(`${indent}${prefix}${subParts[0] ?? ""}`);
128
- for (let i = 1; i < subParts.length; i++) {
129
- lines.push(subParts[i]);
130
- }
131
- }
132
- }
133
- return lines.join("\n");
134
- }
135
- function serializeTaskList(el, indent) {
136
- const lines = [];
137
- for (const child of el.toArray()) {
138
- if (!(child instanceof Y.XmlElement) || child.nodeName !== "taskItem") continue;
139
- const checked = child.getAttribute("checked");
140
- const marker = checked === true || checked === "true" ? "[x]" : "[ ]";
141
- const text = child.toArray().filter((c) => c instanceof Y.XmlElement).map((c) => serializeInline(c)).join("");
142
- lines.push(`${indent}- ${marker} ${text}`);
143
- }
144
- return lines.join("\n");
145
- }
146
- function getCodeBlockText(el) {
147
- for (const child of el.toArray()) {
148
- if (child instanceof Y.XmlText) {
149
- return child.toString();
150
- }
151
- }
152
- return "";
153
- }
154
- function serializeTable(el) {
155
- const rows = el.toArray().filter((c) => c instanceof Y.XmlElement);
156
- if (!rows.length) return "";
157
- const serializedRows = [];
158
- for (const row of rows) {
159
- const cells = row.toArray().filter((c) => c instanceof Y.XmlElement).map((cell) => {
160
- return cell.toArray().filter((c) => c instanceof Y.XmlElement).map((c) => serializeInline(c)).join(" ");
161
- });
162
- serializedRows.push(cells);
163
- }
164
- if (!serializedRows.length) return "";
165
- const colCount = Math.max(...serializedRows.map((r) => r.length));
166
- const headerRow = serializedRows[0];
167
- const separator = Array(colCount).fill("---");
168
- const dataRows = serializedRows.slice(1);
169
- const formatRow = (cells) => {
170
- const padded = Array(colCount).fill("").map((_, i) => cells[i] ?? "");
171
- return `| ${padded.join(" | ")} |`;
172
- };
173
- const lines = [formatRow(headerRow), formatRow(separator), ...dataRows.map(formatRow)];
174
- return lines.join("\n");
175
- }
176
- function generateFrontmatter(label, meta, type) {
177
- const lines = [];
178
- lines.push(`title: "${escapeYaml(label)}"`);
179
- if (type && type !== "doc") lines.push(`type: ${type}`);
180
- if (!meta) return `---
181
- ${lines.join("\n")}
182
- ---`;
183
- if (meta.tags?.length) lines.push(`tags: [${meta.tags.join(", ")}]`);
184
- if (meta.color) lines.push(`color: ${meta.color}`);
185
- if (meta.icon) lines.push(`icon: ${meta.icon}`);
186
- if (meta.status) lines.push(`status: ${meta.status}`);
187
- if (meta.priority !== void 0 && meta.priority !== 0) {
188
- const map = { 1: "low", 2: "medium", 3: "high", 4: "urgent" };
189
- lines.push(`priority: ${map[meta.priority] ?? meta.priority}`);
190
- }
191
- if (meta.checked !== void 0) lines.push(`checked: ${meta.checked}`);
192
- if (meta.dateStart) lines.push(`date: ${meta.dateStart}`);
193
- if (meta.dateEnd) lines.push(`due: ${meta.dateEnd}`);
194
- if (meta.subtitle) lines.push(`description: "${escapeYaml(meta.subtitle)}"`);
195
- if (meta.url) lines.push(`url: ${meta.url}`);
196
- if (meta.rating !== void 0 && meta.rating !== 0) lines.push(`rating: ${meta.rating}`);
197
- return `---
198
- ${lines.join("\n")}
199
- ---`;
200
- }
201
- function escapeYaml(s) {
202
- return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
203
- }
204
- function escapeHtml(s) {
205
- return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
206
- }
207
- function serializeDeltaToHtml(delta) {
208
- let result = "";
209
- for (const op of delta) {
210
- if (typeof op.insert !== "string") continue;
211
- let text = escapeHtml(op.insert);
212
- const attrs = op.attributes ?? {};
213
- if (attrs.code) text = `<code>${text}</code>`;
214
- if (attrs.bold) text = `<strong>${text}</strong>`;
215
- if (attrs.italic) text = `<em>${text}</em>`;
216
- if (attrs.strike) text = `<s>${text}</s>`;
217
- if (attrs.link) {
218
- const href = escapeHtml(attrs.link.href ?? "");
219
- text = `<a href="${href}">${text}</a>`;
220
- }
221
- result += text;
222
- }
223
- return result;
224
- }
225
- function serializeInlineHtml(el) {
226
- const parts = [];
227
- for (const child of el.toArray()) {
228
- if (child instanceof Y.XmlText) {
229
- parts.push(serializeDeltaToHtml(child.toDelta()));
230
- } else if (child instanceof Y.XmlElement) {
231
- parts.push(serializeInlineHtml(child));
232
- }
233
- }
234
- return parts.join("");
235
- }
236
- function serializeBlockToHtml(el) {
237
- if (el instanceof Y.XmlText) {
238
- return serializeDeltaToHtml(el.toDelta());
239
- }
240
- const name = el.nodeName;
241
- switch (name) {
242
- case "documentHeader":
243
- case "documentMeta":
244
- return "";
245
- case "heading": {
246
- const level = Number(el.getAttribute("level") ?? 2);
247
- return `<h${level}>${serializeInlineHtml(el)}</h${level}>`;
248
- }
249
- case "paragraph":
250
- return `<p>${serializeInlineHtml(el)}</p>`;
251
- case "bulletList":
252
- return `<ul>${el.toArray().filter((c) => c instanceof Y.XmlElement && c.nodeName === "listItem").map((li) => `<li>${li.toArray().filter((c) => c instanceof Y.XmlElement).map((c) => serializeBlockToHtml(c)).join("")}</li>`).join("\n")}</ul>`;
253
- case "orderedList":
254
- return `<ol>${el.toArray().filter((c) => c instanceof Y.XmlElement && c.nodeName === "listItem").map((li) => `<li>${li.toArray().filter((c) => c instanceof Y.XmlElement).map((c) => serializeBlockToHtml(c)).join("")}</li>`).join("\n")}</ol>`;
255
- case "codeBlock": {
256
- const lang = el.getAttribute("language") ?? "";
257
- const code = escapeHtml(getCodeBlockText(el));
258
- return lang ? `<pre><code class="language-${lang}">${code}</code></pre>` : `<pre><code>${code}</code></pre>`;
259
- }
260
- case "blockquote": {
261
- const inner = el.toArray().filter((c) => c instanceof Y.XmlElement).map((c) => serializeBlockToHtml(c)).join("\n");
262
- return `<blockquote>
263
- ${inner}
264
- </blockquote>`;
265
- }
266
- case "table": {
267
- const rows = el.toArray().filter((c) => c instanceof Y.XmlElement);
268
- if (!rows.length) return "";
269
- const htmlRows = rows.map((row, ri) => {
270
- const tag = ri === 0 ? "th" : "td";
271
- const cells = row.toArray().filter((c) => c instanceof Y.XmlElement).map((cell) => {
272
- const inner = cell.toArray().filter((c) => c instanceof Y.XmlElement).map((c) => serializeInlineHtml(c)).join("");
273
- return `<${tag}>${inner}</${tag}>`;
274
- }).join("");
275
- return `<tr>${cells}</tr>`;
276
- });
277
- return `<table>
278
- ${htmlRows.join("\n")}
279
- </table>`;
280
- }
281
- case "horizontalRule":
282
- return "<hr>";
283
- case "image": {
284
- const src = el.getAttribute("src") ?? "";
285
- const alt = el.getAttribute("alt") ?? "";
286
- return `<img src="${escapeHtml(src)}" alt="${escapeHtml(alt)}">`;
287
- }
288
- case "fileBlock": {
289
- const uploadId = el.getAttribute("uploadId") ?? "";
290
- const filename = el.getAttribute("filename") ?? "file";
291
- if (uploadId) return `<!--fileblock:${uploadId}:${filename}-->`;
292
- return `<!-- file: ${filename} -->`;
293
- }
294
- default: {
295
- const inner = el.toArray().filter((c) => c instanceof Y.XmlElement || c instanceof Y.XmlText).map((c) => c instanceof Y.XmlElement ? serializeBlockToHtml(c) : serializeDeltaToHtml(c.toDelta())).join("\n");
296
- return `<div data-type="${name}">
297
- ${inner}
298
- </div>`;
299
- }
300
- }
301
- }
302
- export function yjsToMarkdown(fragment, label, meta, type) {
303
- const frontmatter = generateFrontmatter(label, meta, type);
304
- const body = serializeChildren(fragment);
305
- return `${frontmatter}
306
-
307
- ${body}
308
- `;
309
- }
310
- export function yjsToHtml(fragment, label) {
311
- const title = escapeHtml(label);
312
- const bodyParts = [];
313
- for (const child of fragment.toArray()) {
314
- if (child instanceof Y.XmlElement) {
315
- const html = serializeBlockToHtml(child);
316
- if (html) bodyParts.push(html);
317
- }
318
- }
319
- return `<!DOCTYPE html>
320
- <html>
321
- <head><meta charset="utf-8"><title>${title}</title></head>
322
- <body>
323
- <h1>${title}</h1>
324
- ${bodyParts.join("\n")}
325
- </body>
326
- </html>
327
- `;
328
- }
329
- export function yjsToPlainText(fragment) {
330
- return serializeChildren(fragment);
331
- }
1
+ export {
2
+ yjsToMarkdown,
3
+ yjsToHtml,
4
+ yjsToPlainText
5
+ } from "@abraca/convert";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abraca/nuxt",
3
- "version": "2.0.11",
3
+ "version": "2.4.0",
4
4
  "description": "First-class Nuxt module for the Abracadabra CRDT collaboration platform",
5
5
  "repository": "abracadabra/abracadabra-nuxt",
6
6
  "license": "MIT",
@@ -25,22 +25,6 @@
25
25
  "publishConfig": {
26
26
  "access": "public"
27
27
  },
28
- "scripts": {
29
- "prepack": "nuxt-module-build build",
30
- "dev": "npm run dev:prepare && nuxt dev playground",
31
- "dev:build": "nuxt build playground",
32
- "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
33
- "release": "npm run lint && npm run prepack",
34
- "lint": "eslint .",
35
- "test": "vitest run",
36
- "test:watch": "vitest watch",
37
- "test:integration": "vitest run --config test/integration/vitest.config.ts --reporter=verbose",
38
- "test:unit": "vitest run --config test/unit/vitest.config.ts",
39
- "test:e2e": "playwright test",
40
- "test:e2e:headed": "playwright test --headed",
41
- "test:e2e:ui": "playwright test --ui",
42
- "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
43
- },
44
28
  "dependencies": {
45
29
  "@nuxt/kit": "^4.4.4",
46
30
  "@vueuse/core": "^14.3.0",
@@ -48,7 +32,21 @@
48
32
  "nanoevents": "^9.1.0"
49
33
  },
50
34
  "peerDependencies": {
51
- "@abraca/dabra": "^2.0.9",
35
+ "@abraca/dabra": "^2.3.0",
36
+ "@abraca/convert": "^2.3.0",
37
+ "@abraca/plugin": "^2.3.0",
38
+ "@abraca/schema": "^2.3.0",
39
+ "@codemirror/autocomplete": "^6.18.0",
40
+ "@codemirror/commands": "^6.7.0",
41
+ "@codemirror/lang-css": "^6.3.1",
42
+ "@codemirror/lang-javascript": "^6.2.5",
43
+ "@codemirror/lang-json": "^6.0.0",
44
+ "@codemirror/lang-vue": "^0.1.3",
45
+ "@codemirror/language": "^6.10.0",
46
+ "@codemirror/search": "^6.5.0",
47
+ "@codemirror/state": "^6.6.0",
48
+ "@codemirror/view": "^6.42.0",
49
+ "y-codemirror.next": "^0.3.5",
52
50
  "@noble/ed25519": "^3.1.0",
53
51
  "@noble/hashes": "^2.2.0",
54
52
  "@nuxt/ui": "^3.0.0",
@@ -78,10 +76,50 @@
78
76
  "lowlight": "^3.0.0",
79
77
  "mapbox-gl": "^3.0.0",
80
78
  "nuxt": "^4.0.0",
79
+ "three": "^0.184.0",
81
80
  "vue": "^3.4.0",
82
81
  "yjs": "^13.0.0"
83
82
  },
84
83
  "peerDependenciesMeta": {
84
+ "@abraca/schema": {
85
+ "optional": true
86
+ },
87
+ "three": {
88
+ "optional": true
89
+ },
90
+ "@codemirror/autocomplete": {
91
+ "optional": true
92
+ },
93
+ "@codemirror/commands": {
94
+ "optional": true
95
+ },
96
+ "@codemirror/lang-css": {
97
+ "optional": true
98
+ },
99
+ "@codemirror/lang-javascript": {
100
+ "optional": true
101
+ },
102
+ "@codemirror/lang-json": {
103
+ "optional": true
104
+ },
105
+ "@codemirror/lang-vue": {
106
+ "optional": true
107
+ },
108
+ "@codemirror/language": {
109
+ "optional": true
110
+ },
111
+ "@codemirror/search": {
112
+ "optional": true
113
+ },
114
+ "@codemirror/state": {
115
+ "optional": true
116
+ },
117
+ "@codemirror/view": {
118
+ "optional": true
119
+ },
120
+ "y-codemirror.next": {
121
+ "optional": true
122
+ },
85
123
  "@tanstack/vue-virtual": {
86
124
  "optional": true
87
125
  },
@@ -99,7 +137,20 @@
99
137
  }
100
138
  },
101
139
  "devDependencies": {
102
- "@abraca/dabra": "^2.0.10",
140
+ "@abraca/dabra": "^2.3.0",
141
+ "@abraca/convert": "^2.3.0",
142
+ "@abraca/plugin": "^2.3.0",
143
+ "@codemirror/autocomplete": "^6.18.0",
144
+ "@codemirror/commands": "^6.7.0",
145
+ "@codemirror/lang-css": "^6.3.1",
146
+ "@codemirror/lang-javascript": "^6.2.5",
147
+ "@codemirror/lang-json": "^6.0.0",
148
+ "@codemirror/lang-vue": "^0.1.3",
149
+ "@codemirror/language": "^6.10.0",
150
+ "@codemirror/search": "^6.5.0",
151
+ "@codemirror/state": "^6.6.0",
152
+ "@codemirror/view": "^6.42.0",
153
+ "y-codemirror.next": "^0.3.5",
103
154
  "@iconify-json/lucide": "^1.2.105",
104
155
  "@noble/ed25519": "^3.1.0",
105
156
  "@noble/hashes": "^2.2.0",
@@ -130,5 +181,19 @@
130
181
  "ws": "^8.20.0",
131
182
  "yjs": "^13.6.30"
132
183
  },
133
- "packageManager": "pnpm@10.29.3+sha512.498e1fb4cca5aa06c1dcf2611e6fafc50972ffe7189998c409e90de74566444298ffe43e6cd2acdc775ba1aa7cc5e092a8b7054c811ba8c5770f84693d33d2dc"
134
- }
184
+ "scripts": {
185
+ "dev": "npm run dev:prepare && nuxt dev playground",
186
+ "dev:build": "nuxt build playground",
187
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
188
+ "release": "npm run lint && npm run prepack",
189
+ "lint": "eslint .",
190
+ "test": "vitest run",
191
+ "test:watch": "vitest watch",
192
+ "test:integration": "vitest run --config test/integration/vitest.config.ts --reporter=verbose",
193
+ "test:unit": "vitest run --config test/unit/vitest.config.ts",
194
+ "test:e2e": "playwright test",
195
+ "test:e2e:headed": "playwright test --headed",
196
+ "test:e2e:ui": "playwright test --ui",
197
+ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
198
+ }
199
+ }