@abraca/nuxt 2.62.0 → 2.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=4.0.0"
6
6
  },
7
- "version": "2.62.0",
7
+ "version": "2.63.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -285,8 +285,22 @@ function deduplicateMetaFields(ed) {
285
285
  deletions.push({ from, to: from + child.nodeSize });
286
286
  return;
287
287
  }
288
- const identity = a.metaKey || `${a.startKey ?? ""}:${a.endKey ?? ""}:${a.latKey ?? ""}:${a.lngKey ?? ""}`;
289
- if (!identity || identity === ":::") return;
288
+ let identity = a.metaKey || `${a.startKey ?? ""}:${a.endKey ?? ""}:${a.latKey ?? ""}:${a.lngKey ?? ""}`;
289
+ if (!identity || identity === ":::") {
290
+ identity = "struct:" + JSON.stringify([
291
+ a.fieldType,
292
+ a.fieldLabel,
293
+ a.metaKey,
294
+ a.startKey,
295
+ a.endKey,
296
+ a.latKey,
297
+ a.lngKey,
298
+ a.allDayKey,
299
+ a.unit,
300
+ a.options,
301
+ a.presets
302
+ ]);
303
+ }
290
304
  if (seen.has(identity)) {
291
305
  const from = metaPos + 1 + childOffset;
292
306
  deletions.push({ from, to: from + child.nodeSize });
@@ -465,10 +479,8 @@ watchEffect((onCleanup) => {
465
479
  };
466
480
  function onUpdate({ transaction }) {
467
481
  const isRemote = !!transaction?.getMeta?.("y-sync$")?.isChangeOrigin;
468
- if (isRemote) {
469
- deduplicateMetaFields(ed);
470
- }
471
482
  initDocumentMeta(ed);
483
+ deduplicateMetaFields(ed);
472
484
  if (isRemote || !initialSyncDone) {
473
485
  if (headerTimer) {
474
486
  clearTimeout(headerTimer);
@@ -727,6 +739,92 @@ const editorHandlers = {
727
739
  }
728
740
  ]),
729
741
  isActive: (editor) => editor.isActive("timeline")
742
+ },
743
+ // ── Structural component blocks ──────────────────────────────────────────────
744
+ // The slash menu's "Components" group and the `table` insert item advertise
745
+ // these kinds, but UEditorSuggestionMenu.onSelect silently no-ops when no
746
+ // handler exists for the kind — so selecting Callout/Collapsible/Accordion/…
747
+ // did nothing. Each seeds a schema-valid subtree (content specs: callout/
748
+ // collapsible/card/steps = block+, accordion = accordionItem+, tabs =
749
+ // tabsItem+, codeGroup = codeBlock+, fieldGroup = field+, codeTree = atom).
750
+ callout: {
751
+ canExecute: () => true,
752
+ execute: (editor) => insertNode(editor, "callout", { type: "note" }, [{ type: "paragraph" }]),
753
+ isActive: (editor) => editor.isActive("callout")
754
+ },
755
+ collapsible: {
756
+ canExecute: () => true,
757
+ execute: (editor) => insertNode(editor, "collapsible", { label: "Details" }, [{ type: "paragraph" }]),
758
+ isActive: (editor) => editor.isActive("collapsible")
759
+ },
760
+ accordion: {
761
+ canExecute: () => true,
762
+ execute: (editor) => insertNode(editor, "accordion", {}, [
763
+ { type: "accordionItem", attrs: { label: "Section 1", icon: "" }, content: [{ type: "paragraph" }] },
764
+ { type: "accordionItem", attrs: { label: "Section 2", icon: "" }, content: [{ type: "paragraph" }] }
765
+ ]),
766
+ isActive: (editor) => editor.isActive("accordion")
767
+ },
768
+ tabs: {
769
+ canExecute: () => true,
770
+ execute: (editor) => insertNode(editor, "tabs", {}, [
771
+ { type: "tabsItem", attrs: { label: "Tab 1", icon: "" }, content: [{ type: "paragraph" }] },
772
+ { type: "tabsItem", attrs: { label: "Tab 2", icon: "" }, content: [{ type: "paragraph" }] }
773
+ ]),
774
+ isActive: (editor) => editor.isActive("tabs")
775
+ },
776
+ card: {
777
+ canExecute: () => true,
778
+ execute: (editor) => insertNode(editor, "card", { title: "" }, [{ type: "paragraph" }]),
779
+ isActive: (editor) => editor.isActive("card")
780
+ },
781
+ steps: {
782
+ canExecute: () => true,
783
+ execute: (editor) => insertNode(editor, "steps", {}, [
784
+ { type: "heading", attrs: { level: 3 }, content: [{ type: "text", text: "First step" }] },
785
+ { type: "paragraph" },
786
+ { type: "heading", attrs: { level: 3 }, content: [{ type: "text", text: "Second step" }] },
787
+ { type: "paragraph" }
788
+ ]),
789
+ isActive: (editor) => editor.isActive("steps")
790
+ },
791
+ codeGroup: {
792
+ canExecute: () => true,
793
+ execute: (editor) => insertNode(editor, "codeGroup", {}, [
794
+ { type: "codeBlock", attrs: { language: "ts" }, content: [{ type: "text", text: 'const hello = "world"' }] },
795
+ { type: "codeBlock", attrs: { language: "js" }, content: [{ type: "text", text: 'const hello = "world"' }] }
796
+ ]),
797
+ isActive: (editor) => editor.isActive("codeGroup")
798
+ },
799
+ codePreview: {
800
+ canExecute: () => true,
801
+ execute: (editor) => insertNode(editor, "codePreview", {}, [
802
+ { type: "codeBlock", attrs: { language: "html" }, content: [{ type: "text", text: "<button>Click me</button>" }] }
803
+ ]),
804
+ isActive: (editor) => editor.isActive("codePreview")
805
+ },
806
+ codeTree: {
807
+ canExecute: () => true,
808
+ execute: (editor) => insertNode(editor, "codeTree", {
809
+ files: JSON.stringify([
810
+ { name: "src", children: [{ name: "index.ts", content: 'export const hello = "world"\n' }] },
811
+ { name: "README.md", content: "# Project\n" }
812
+ ])
813
+ }),
814
+ isActive: (editor) => editor.isActive("codeTree")
815
+ },
816
+ fieldGroup: {
817
+ canExecute: () => true,
818
+ execute: (editor) => insertNode(editor, "fieldGroup", {}, [
819
+ { type: "field", attrs: { name: "name", type: "string", required: false }, content: [{ type: "paragraph" }] },
820
+ { type: "field", attrs: { name: "description", type: "string", required: false }, content: [{ type: "paragraph" }] }
821
+ ]),
822
+ isActive: (editor) => editor.isActive("fieldGroup")
823
+ },
824
+ table: {
825
+ canExecute: (editor) => editor.can?.().insertTable?.({ rows: 3, cols: 3, withHeaderRow: true }) ?? true,
826
+ execute: (editor) => editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: true }),
827
+ isActive: (editor) => editor.isActive("table")
730
828
  }
731
829
  };
732
830
  const _mentionItems = computed(
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
12
12
  awareness: boolean;
13
13
  tag: "video" | "audio";
14
14
  live: boolean;
15
- controls: boolean;
16
15
  total: boolean;
16
+ controls: boolean;
17
17
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
18
  declare const _default: typeof __VLS_export;
19
19
  export default _default;
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
12
12
  awareness: boolean;
13
13
  tag: "video" | "audio";
14
14
  live: boolean;
15
- controls: boolean;
16
15
  total: boolean;
16
+ controls: boolean;
17
17
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
18
  declare const _default: typeof __VLS_export;
19
19
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abraca/nuxt",
3
- "version": "2.62.0",
3
+ "version": "2.63.0",
4
4
  "description": "First-class Nuxt module for the Abracadabra CRDT collaboration platform",
5
5
  "repository": "abracadabra/abracadabra-nuxt",
6
6
  "license": "MIT",