Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

fix(open-knowledge): keep marks on inline leaf nodes through Y bridge (#2961)

Nick Gomezd83840b2e0fa
diff --git a/.changeset/preserve-marks-on-inline-leaf-nodes.md b/.changeset/preserve-marks-on-inline-leaf-nodes.md
new file mode 100644
index 000000000..f8f78c9da
--- /dev/null
+++ b/.changeset/preserve-marks-on-inline-leaf-nodes.md
@@ -0,0 +1,24 @@
+---
+'@inkeep/open-knowledge': patch
+---
+
+Fix bold, italic, and other formatting being dropped from wiki links, images, inline math, tags,
+and line breaks.
+
+Formatting applied to an inline element was lost as soon as the document round-tripped through the
+collaboration layer. Writing `**[[Page]]**` in source mode, in the editor, or through the agent API
+produced `[[Page]]` on disk, and the emphasis could not be re-applied because it was discarded
+again on the next sync. A soft line break inside bold text split it into two separate bold runs.
+
+| Before | After |
+| --- | --- |
+| `**[[Page]]**` → `[[Page]]` | `**[[Page]]**` → `**[[Page]]**` |
+| `*![alt](img.png)*` → `![alt](img.png)` | `*![alt](img.png)*` → `*![alt](img.png)*` |
+| `**a<br>b**` → `**a**<br>**b**` | `**a<br>b**` → `**a<br>b**` |
+
+This affects `[[wiki links]]`, images, image references, footnote references, inline math, tags,
+inline JSX, and hard line breaks.
+
+Documents already saved without their formatting are not repaired automatically — the formatting
+has to be applied again. If you run multiple clients against one server, update them together:
+an older client editing a document alongside an updated one will strip the restored formatting.
diff --git a/packages/app/src/editor/extensions/marked-inline-leaf-editing.dom.test.tsx b/packages/app/src/editor/extensions/marked-inline-leaf-editing.dom.test.tsx
new file mode 100644
index 000000000..294169fc2
--- /dev/null
+++ b/packages/app/src/editor/extensions/marked-inline-leaf-editing.dom.test.tsx
@@ -0,0 +1,195 @@
+/**
+ * WYSIWYG edit- and create-path coverage for emphasis marks on inline leaf nodes.
+ *
+ * The Yjs-bridge fix preserves a mark on an inline leaf (wikiLink, image, ...)
+ * through the storage round-trip, but that is a rung below the editor: it never
+ * dispatches a ProseMirror transaction. If the PM schema still forbids the mark
+ * (`allowsMarkType === false`), a real editing transaction can normalize it away
+ * and the bridge then faithfully persists the stripped result — the loss returns
+ * via the edit path — and a user cannot apply the mark at all (`toggleBold`
+ * no-ops on the node). This suite drives a real `Editor` in jsdom and asserts the
+ * mark survives representative edits and can be created, which the storage-round-
+ * trip tests (`conversion-fidelity`, `invariant-i5`, `marked-inline-leaf-bridge`)
+ * structurally cannot see. Undo-survival is deliberately not tested here:
+ * production undo is Yjs/Collaboration-backed, so its fidelity lives in the
+ * two-client `marked-inline-leaf-collab.test.ts`, not a plain history plugin.
+ *
+ * Marks are mdast-canonical here: `strong` (Cmd+B / toggleBold) and `emphasis`.
+ */
+
+// `cleanup` satisfies the Tier-3 filename contract (every `*.dom.test.tsx` must
+// value-import from `@testing-library/react`); the suite builds the Editor
+// directly and tears it down in `afterEach`.
+import { cleanup } from '@testing-library/react';
+import { Editor, type JSONContent } from '@tiptap/core';
+import { NodeSelection } from '@tiptap/pm/state';
+import { afterEach, describe, expect, test } from 'vitest';
+import { sharedExtensions } from './shared';
+
+/** A representative inline leaf seed: node type + minimal attrs to construct it. */
+interface LeafSeed {
+ nodeName: string;
+ attrs: Record<string, unknown>;
+}
+
+// wikiLink is the originally reported case; image proves the fix generalizes past it.
+// The other leaves (tag/mathInline/imageReference/hardBreak) have their legality
+// pinned in core `marked-inline-leaf-schema.test.ts` and their storage round-trip
+// in the fidelity suites — the edit-path behavior is a property of "inline leaf
+// with an empty mark set", identical across them, so it is proven on these two.
+const LEAF_SEEDS: LeafSeed[] = [
+ { nodeName: 'wikiLink', attrs: { target: 'Alpha' } },
+ { nodeName: 'image', attrs: { src: 'pic.png', alt: 'pic' } },
+];
+
+function mount(content: JSONContent): { editor: Editor; container: HTMLDivElement } {
+ const container = document.createElement('div');
+ document.body.appendChild(container);
+ const editor = new Editor({
+ element: container,
+ extensions: sharedExtensions,
+ editable: true,
+ content,
+ });
+ return { editor, container };
+}
+
+/** A paragraph of `lead <leaf> trail`, with the leaf carrying the given marks. */
+function paragraphWithLeaf(seed: LeafSeed, markNames: string[]): JSONContent {
+ return {
+ type: 'doc',
+ content: [
+ {
+ type: 'paragraph',
+ content: [
+ { type: 'text', text: 'lead ' },
+ { type: seed.nodeName, attrs: seed.attrs, marks: markNames.map((m) => ({ type: m })) },
+ { type: 'text', text: ' trail' },
+ ],
+ },
+ ],
+ };
+}
+
+function teardown(editor: Editor, container: HTMLDivElement): void {
+ editor.destroy();
+ container.remove();
+}
+
+/** Document position of the first node of `nodeName`, or -1. */
+function posOf(editor: Editor, nodeName: string): number {
+ let found = -1;
+ editor.state.doc.descendants((node, pos) => {
+ if (found < 0 && node.type.name === nodeName) found = pos;
+ return found < 0;
+ });
+ return found;
+}
+
+/** Mark type-names carried by the first node of `nodeName`, or null if absent. */
+function marksOnLeaf(editor: Editor, nodeName: string): string[] | null {
+ let marks: string[] | null = null;
+ editor.state.doc.descendants((node) => {
+ if (marks === null && node.type.name === nodeName) marks = node.marks.map((m) => m.type.name);
+ return marks === null;
+ });
+ return marks;
+}
+
+describe('emphasis marks on inline leaf nodes survive WYSIWYG editing', () => {
+ afterEach(() => {
+ cleanup();
+ });
+
+ for (const seed of LEAF_SEEDS) {
+ // Baseline: constructing the doc with the mark keeps it (Node.fromJSON does
+ // not validate). If this ever fails, the seed itself is being normalized and
+ // the edit assertions below would be testing nothing.
+ test(`${seed.nodeName}: seeded strong mark is present`, () => {
+ const { editor, container } = mount(paragraphWithLeaf(seed, ['strong']));
+ try {
+ expect(marksOnLeaf(editor, seed.nodeName)).toContain('strong');
+ } finally {
+ teardown(editor, container);
+ }
+ });
+
+ test(`${seed.nodeName}: strong survives typing after the node`, () => {
+ const { editor, container } = mount(paragraphWithLeaf(seed, ['strong']));
+ try {
+ editor.commands.insertContentAt(posOf(editor, seed.nodeName) + 1, 'X');
+ expect(marksOnLeaf(editor, seed.nodeName)).toContain('strong');
+ } finally {
+ teardown(editor, container);
+ }
+ });
+
+ test(`${seed.nodeName}: strong survives typing before the node`, () => {
+ const { editor, container } = mount(paragraphWithLeaf(seed, ['strong']));
+ try {
+ editor.commands.insertContentAt(posOf(editor, seed.nodeName), 'X');
+ expect(marksOnLeaf(editor, seed.nodeName)).toContain('strong');
+ } finally {
+ teardown(editor, container);
+ }
+ });
+
+ test(`${seed.nodeName}: strong survives splitting the paragraph after the node`, () => {
+ const { editor, container } = mount(paragraphWithLeaf(seed, ['strong']));
+ try {
+ editor
+ .chain()
+ .setTextSelection(posOf(editor, seed.nodeName) + 1)
+ .splitBlock()
+ .run();
+ expect(marksOnLeaf(editor, seed.nodeName)).toContain('strong');
+ } finally {
+ teardown(editor, container);
+ }
+ });
+ }
+
+ test('wikiLink: pre-existing emphasis and strong coexist through an edit', () => {
+ const { editor, container } = mount(paragraphWithLeaf(LEAF_SEEDS[0], ['strong', 'emphasis']));
+ try {
+ editor.commands.insertContentAt(posOf(editor, 'wikiLink') + 1, 'X');
+ const marks = marksOnLeaf(editor, 'wikiLink');
+ expect(marks).toContain('strong');
+ expect(marks).toContain('emphasis');
+ } finally {
+ teardown(editor, container);
+ }
+ });
+
+ // Create path: select an unmarked wikilink and hit Cmd+B (toggleBold → strong).
+ // A user can only bold a wikilink if the schema allows the mark on the node.
+ test('wikiLink: toggleBold applies strong to a selected unmarked node (create path)', () => {
+ const { editor, container } = mount(paragraphWithLeaf(LEAF_SEEDS[0], []));
+ try {
+ const pos = posOf(editor, 'wikiLink');
+ const { state } = editor.view;
+ editor.view.dispatch(state.tr.setSelection(NodeSelection.create(state.doc, pos)));
+ editor.commands.toggleBold();
+ expect(marksOnLeaf(editor, 'wikiLink')).toContain('strong');
+ } finally {
+ teardown(editor, container);
+ }
+ });
+
+ // Removal path: the mirror of the create path. Select a strong-marked
+ // wikilink and hit Cmd+B — the mark must toggle back OFF. A schema that made
+ // the mark legal for adding but left it stuck-on would be a worse bug than
+ // the original loss, so the removal direction is pinned independently.
+ test('wikiLink: toggleBold removes strong from a selected marked node (removal path)', () => {
+ const { editor, container } = mount(paragraphWithLeaf(LEAF_SEEDS[0], ['strong']));
+ try {
+ const pos = posOf(editor, 'wikiLink');
+ const { state } = editor.view;
+ editor.view.dispatch(state.tr.setSelection(NodeSelection.create(state.doc, pos)));
+ editor.commands.toggleBold();
+ expect(marksOnLeaf(editor, 'wikiLink')).not.toContain('strong');
+ } finally {
+ teardown(editor, container);
+ }
+ });
+});
diff --git a/packages/app/tests/conversion/conversion-fidelity.test.ts b/packages/app/tests/conversion/conversion-fidelity.test.ts
index 515f5b52d..a2e540ff2 100644
--- a/packages/app/tests/conversion/conversion-fidelity.test.ts
+++ b/packages/app/tests/conversion/conversion-fidelity.test.ts
@@ -213,6 +213,177 @@ describe('tree round-trip: pmJSON → updateYFragment → yXmlFragmentToProsemir
}
});
+// ─── 2b. Marked inline leaf nodes: byte-exact across chains 1 and 2 ───
+
+/**
+ * An inline *leaf* node is an inline node with no inline content, so ProseMirror
+ * computes an empty mark set for it. Parsed markdown can still hand such a node
+ * a mark (`**[[Page]]**` yields a `wikiLink` carrying `strong`), and only the
+ * tree round-trip can lose it: chain 1 never leaves mdast/PM, chain 2 stores the
+ * node as a Y.XmlElement.
+ *
+ * The `stable`/token-containment oracle the blocks above use cannot see this
+ * class at all — mark delimiters are not word tokens, so a dropped `**` matches
+ * every token it is asked about. These cases pin exact bytes on both chains
+ * instead, and pinning chain 1 alongside chain 2 keeps the reference honest: if
+ * both move together the expectation is wrong, not the bridge.
+ *
+ * The negative controls pin the class boundary. `[a](b)` is a link *mark* on
+ * text, `[[]]` never forms a node, and an inline wiki embed materializes as
+ * link-marked text, so none of them route a mark through an element node.
+ */
+const MARKED_INLINE_LEAF: Array<{ name: string; input: string; expected: string }> = [
+ // Marked inline leaf nodes — the mark must survive both chains.
+ { name: 'strong + wikilink', input: '**[[Page]]**\n', expected: '**[[Page]]**\n' },
+ {
+ name: 'strong + wikilink with alias',
+ input: '**[[Page|Alias]]**\n',
+ expected: '**[[Page|Alias]]**\n',
+ },
+ {
+ name: 'strong + wikilink with anchor',
+ input: '**[[Page#Section]]**\n',
+ expected: '**[[Page#Section]]**\n',
+ },
+ { name: 'emphasis + wikilink', input: '*[[Page]]*\n', expected: '*[[Page]]*\n' },
+ { name: 'strikethrough + wikilink', input: '~~[[Page]]~~\n', expected: '~~[[Page]]~~\n' },
+
+ // Multi-mark leaves (count > 1). Each mark serializes to its own
+ // `ymark:<hash>` Y-attribute; the per-key encoding is what keeps a second
+ // mark from clobbering the first under last-write-wins. A single-key design
+ // would round-trip these with only one mark surviving.
+ {
+ name: 'strong + emphasis + wikilink',
+ input: '***[[Page]]***\n',
+ expected: '***[[Page]]***\n',
+ },
+ {
+ name: 'strong + strikethrough + wikilink',
+ input: '**~~[[Page]]~~**\n',
+ expected: '**~~[[Page]]~~**\n',
+ },
+ { name: 'strong + emphasis + tag', input: '***#mytag***\n', expected: '***#mytag***\n' },
+ {
+ name: 'strong + wikilink mid-paragraph',
+ input: 'lead **[[Page]]** trail\n',
+ expected: 'lead **[[Page]]** trail\n',
+ },
+ { name: 'strong + image', input: '**![alt](file.png)**\n', expected: '**![alt](file.png)**\n' },
+ { name: 'strong + inline math', input: '**$x = 1$**\n', expected: '**$x = 1$**\n' },
+ { name: 'strong + tag', input: '**#mytag**\n', expected: '**#mytag**\n' },
+ {
+ name: 'strong + hard break (backslash)',
+ input: '**alpha\\\nbravo**\n',
+ expected: '**alpha\\\nbravo**\n',
+ },
+ {
+ name: 'strong + hard break (two spaces)',
+ input: '**alpha \nbravo**\n',
+ expected: '**alpha \nbravo**\n',
+ },
+ {
+ name: 'strong + image reference',
+ input: '**![alt][ref]**\n\n[ref]: file.png\n',
+ expected: '**![alt][ref]**\n\n[ref]: file.png\n',
+ },
+ {
+ name: 'strong + footnote reference',
+ input: '**[^1]**\n\n[^1]: a note\n',
+ expected: '**[^1]**\n\n[^1]: a note\n',
+ },
+ { name: 'strong + inline JSX', input: '**<Icon />**\n', expected: '**<Icon />**\n' },
+
+ // Negative controls — outside the class, must stay byte-identical.
+ {
+ name: 'control: strong + inline link',
+ input: '**[a](https://example.com)**\n',
+ expected: '**[a](https://example.com)**\n',
+ },
+ { name: 'control: strong + empty wikilink', input: '**[[]]**\n', expected: '**[[]]**\n' },
+ {
+ name: 'control: strong + inline wiki embed',
+ input: '**![[embed.png]]**\n',
+ expected: '**![[embed.png]]**\n',
+ },
+ { name: 'control: bare wikilink', input: '[[Page]]\n', expected: '[[Page]]\n' },
+ { name: 'control: strong on text', input: '**alpha**\n', expected: '**alpha**\n' },
+ { name: 'control: bare image', input: '![alt](file.png)\n', expected: '![alt](file.png)\n' },
+ { name: 'control: bare inline math', input: '$x = 1$\n', expected: '$x = 1$\n' },
+ { name: 'control: bare tag', input: '#mytag is here\n', expected: '#mytag is here\n' },
+ { name: 'control: bare inline JSX', input: '<Icon />\n', expected: '<Icon />\n' },
+ { name: 'control: bare hard break', input: 'alpha\\\nbravo\n', expected: 'alpha\\\nbravo\n' },
+ {
+ name: 'control: bare image reference',
+ input: '![alt][ref]\n\n[ref]: file.png\n',
+ expected: '![alt][ref]\n\n[ref]: file.png\n',
+ },
+ {
+ name: 'control: bare footnote reference',
+ input: '[^1]\n\n[^1]: a note\n',
+ expected: '[^1]\n\n[^1]: a note\n',
+ },
+ // No mark forms, so both chains escape the literal delimiters instead. A
+ // fix must not start synthesizing a mark where the parser saw none.
+ {
+ name: 'control: non-flanking delimiter run',
+ input: '** [[Page]]**\n',
+ expected: '\\*\\* [[Page]]\\*\\*\n',
+ },
+ {
+ name: 'control: mismatched delimiters',
+ input: '**[[Page]]__\n',
+ expected: '\\*\\*[[Page]]\\_\\_\n',
+ },
+];
+
+describe('marked inline leaf nodes: byte-exact through chains 1 and 2', () => {
+ for (const { name, input, expected } of MARKED_INLINE_LEAF) {
+ test.concurrent(name, () => {
+ expect(mdRoundTrip(input)).toBe(expected);
+ expect(treeRoundTrip(input)).toBe(expected);
+ });
+ }
+});
+
+describe('marked inline leaf nodes: in-place fragment update', () => {
+ /**
+ * A fresh fragment only exercises the create path. Reusing one fragment across
+ * successive updates is what drives updateYFragment's attribute reconciliation
+ * and the equality check that decides whether a node is touched at all, which
+ * is the path a live editor session actually takes.
+ *
+ */
+ test('a reused fragment gains, keeps and loses a mark on an inline leaf', () => {
+ const doc = new Y.Doc();
+ const fragment = doc.getXmlFragment('default');
+ const meta = { mapping: new Map(), isOMark: new Map() };
+
+ const applyMd = (md: string): string => {
+ updateYFragment(doc, fragment, schema.nodeFromJSON(mdManager.parse(md)), meta);
+ return mdManager.serialize(yXmlFragmentToProseMirrorRootNode(fragment, schema).toJSON());
+ };
+
+ try {
+ expect(applyMd('[[Page]]\n\nsibling\n')).toBe('[[Page]]\n\nsibling\n');
+ expect(applyMd('**[[Page]]**\n\nsibling\n')).toBe('**[[Page]]**\n\nsibling\n');
+ // Only the sibling changes. The marked paragraph must compare equal and be
+ // left alone rather than swept as a stale attribute.
+ expect(applyMd('**[[Page]]**\n\nsibling edited\n')).toBe('**[[Page]]**\n\nsibling edited\n');
+ // The marked node's own attributes change while the mark stays. The
+ // reconciliation reads a snapshot of the attributes taken before the
+ // stale-attribute sweep, so sweeping the mark here would leave the
+ // snapshot claiming it is still present and the mark would never be
+ // rewritten.
+ expect(applyMd('**[[Other]]**\n\nsibling edited\n')).toBe(
+ '**[[Other]]**\n\nsibling edited\n',
+ );
+ expect(applyMd('[[Other]]\n\nsibling edited\n')).toBe('[[Other]]\n\nsibling edited\n');
+ } finally {
+ doc.destroy();
+ }
+ });
+});
+
// Observer round-trip and full-stack chain blocks removed.
// Layer A (mdManager) === Layer B (Y.Doc observer path) on all 118 constructs.
// These chains tested a proven pass-through.
diff --git a/packages/app/tests/dom/jsdom-preload.dom.test.tsx b/packages/app/tests/dom/jsdom-preload.dom.test.tsx
new file mode 100644
index 000000000..c03712d0c
--- /dev/null
+++ b/packages/app/tests/dom/jsdom-preload.dom.test.tsx
@@ -0,0 +1,84 @@
+/**
+ * The Tier-3 jsdom environment must expose the CSSOM-View geometry surface
+ * ProseMirror measures through, not only the subset jsdom implements.
+ *
+ * jsdom ships `getClientRects` / `getBoundingClientRect` on `Element` (both
+ * returning zero geometry) but leaves both undefined on `Range`. ProseMirror
+ * measures a text position through a `Range`, so every path reaching
+ * `coordsAtPos` throws `TypeError: textRange(...).getClientRects is not a
+ * function`. Tiptap's `focus()` reaches it from a `requestAnimationFrame`
+ * callback guarded only by `editor.isDestroyed`, so whether the throw lands
+ * depends on which wins the race — the frame callback or the test's
+ * `editor.destroy()`. When the frame wins, the throw surfaces after the test
+ * that scheduled it already resolved: an unhandled error that reds the run
+ * while every test still reports as passing.
+ */
+
+// `cleanup` satisfies the Tier-3 filename contract (every `*.dom.test.tsx`
+// must value-import from `@testing-library/react`). This suite constructs the
+// Editor directly rather than rendering through RTL; `cleanup` runs in
+// `afterEach` so any future RTL render is torn down between tests.
+import { cleanup } from '@testing-library/react';
+import { Editor } from '@tiptap/core';
+import { afterEach, describe, expect, test } from 'vitest';
+import { sharedExtensions } from '../../src/editor/extensions/shared';
+
+/**
+ * Measurement walks the live document, so the editor has to be attached rather
+ * than constructed against a detached element.
+ */
+function mountEditor(): { editor: Editor; container: HTMLDivElement } {
+ const container = document.createElement('div');
+ document.body.appendChild(container);
+ const editor = new Editor({
+ element: container,
+ extensions: sharedExtensions,
+ editable: true,
+ content: {
+ type: 'doc',
+ content: [{ type: 'paragraph', content: [{ type: 'text', text: 'alpha' }] }],
+ },
+ });
+ return { editor, container };
+}
+
+describe('jsdom preload backfills the geometry surface ProseMirror measures through', () => {
+ afterEach(() => {
+ cleanup();
+ });
+
+ test('Range answers geometry queries with the zero rects jsdom already gives Element', () => {
+ const range = document.createRange();
+ range.selectNodeContents(document.body);
+
+ expect(Array.from(range.getClientRects())).toEqual([]);
+
+ const rect = range.getBoundingClientRect();
+ expect([rect.top, rect.left, rect.width, rect.height]).toEqual([0, 0, 0, 0]);
+ });
+
+ test('ProseMirror measures a document position instead of throwing', () => {
+ const { editor, container } = mountEditor();
+ try {
+ expect(() => editor.view.coordsAtPos(1)).not.toThrow();
+ } finally {
+ editor.destroy();
+ container.remove();
+ }
+ });
+
+ test("Tiptap's deferred focus() scrolls to the selection instead of leaking an unhandled error", () => {
+ const { editor, container } = mountEditor();
+ try {
+ // The body of `focus()`'s requestAnimationFrame callback, driven inline so
+ // the pin does not race the frame the way production does. The order is
+ // load-bearing: an unfocused view scrolls through a branch that never
+ // measures, so dropping `view.focus()` makes this pass either way.
+ editor.view.focus();
+ expect(() => editor.commands.scrollIntoView()).not.toThrow();
+ } finally {
+ editor.destroy();
+ container.remove();
+ }
+ });
+});
diff --git a/packages/app/tests/integration/marked-inline-leaf-bridge.test.ts b/packages/app/tests/integration/marked-inline-leaf-bridge.test.ts
new file mode 100644
index 000000000..319708b63
--- /dev/null
+++ b/packages/app/tests/integration/marked-inline-leaf-bridge.test.ts
@@ -0,0 +1,133 @@
+/**
+ * Marked inline leaf nodes survive the live server bridge.
+ *
+ * An inline *leaf* node — an inline node with no inline content, so ProseMirror
+ * computes an empty mark set for it — can still carry a mark when it arrives
+ * from parsed markdown: `**[[a]]**` yields a `wikiLink` node with `marks:
+ * [strong]`. The PM ⇄ Y.XmlFragment conversion is the only hop on the write
+ * path that can lose that mark, and losing it breaks precedent #38: the
+ * fragment no longer derives from Y.Text, so the persistence write-back reports
+ * a bridge-invariant violation and the doc re-derives its fragment on every
+ * drain without ever converging.
+ *
+ * Assertions here read the settled server state rather than the conversion
+ * functions directly, so they pin the user-visible outcome: what the editor
+ * renders and what the server considers a healthy document.
+ */
+import { randomUUID } from 'node:crypto';
+import { afterAll, beforeAll, describe, expect, test } from 'vitest';
+import { HARNESS_BOOT_TIMEOUT_MS } from './harness-boot-timeout';
+import {
+ agentWriteMd,
+ assertBridgeInvariant,
+ awaitDocQuiescence,
+ createTestServer,
+ getServerState,
+ pollUntil,
+ readTestDoc,
+ type TestServer,
+} from './test-harness';
+
+let server: TestServer;
+const warnLines: string[] = [];
+const origWarn = console.warn;
+
+beforeAll(async () => {
+ console.warn = (...args: unknown[]) => {
+ warnLines.push(args.map((a) => (typeof a === 'string' ? a : JSON.stringify(a))).join(' '));
+ origWarn(...args);
+ };
+ server = await createTestServer();
+}, HARNESS_BOOT_TIMEOUT_MS);
+
+afterAll(async () => {
+ console.warn = origWarn;
+ await server.cleanup();
+});
+
+/**
+ * Write through the real agent path and wait for the debounced persistence
+ * flush, which is the write-back that runs the bridge watchdog. Polling the
+ * on-disk file gates on that flush having happened rather than on a wall-clock
+ * guess.
+ */
+async function writeAndSettle(docName: string, markdown: string) {
+ await agentWriteMd(server.port, markdown, { docName, position: 'replace' });
+
+ const doc = server.instance.hocuspocus.documents.get(docName);
+ if (!doc) throw new Error(`server never opened ${docName}`);
+ await awaitDocQuiescence(doc, { timeoutMs: 5000 });
+ await pollUntil(() => readTestDoc(server.contentDir, docName).length > 0);
+
+ const state = getServerState(server, docName);
+ if (!state) throw new Error(`server has no state for ${docName} after the flush`);
+ return state;
+}
+
+/**
+ * Structured watchdog events for one document. The watchdog debounces per
+ * (site, docName), so a per-test unique docName keeps one test's events from
+ * suppressing another's.
+ */
+function bridgeEventsFor(docName: string): string[] {
+ return warnLines.filter((line) => {
+ if (!line.startsWith('{')) return false;
+ let parsed: unknown;
+ try {
+ parsed = JSON.parse(line);
+ } catch {
+ return false;
+ }
+ const event = parsed as { event?: unknown; 'doc.name'?: unknown };
+ return (
+ (event.event === 'bridge-invariant-violation' ||
+ event.event === 'bridge-split-brain-rederive') &&
+ event['doc.name'] === docName
+ );
+ });
+}
+
+describe('marked inline leaf nodes through the live bridge', () => {
+ test('a strong-marked wikilink keeps its mark', async () => {
+ const docName = `marked-inline-leaf-${randomUUID()}`;
+ const state = await writeAndSettle(docName, '**[[a]]**\n');
+
+ expect(state.ytext.toString()).toBe('**[[a]]**\n');
+ expect(state.md).toBe('**[[a]]**\n');
+ assertBridgeInvariant(state.ytext, state.fragment);
+ expect(bridgeEventsFor(docName)).toEqual([]);
+ }, 30000);
+
+ /**
+ * Inline JSX is the one inline node the shared schema already allows marks
+ * on, so it isolates the conversion layer from any question of schema
+ * legality.
+ *
+ */
+ test('a strong-marked inline JSX node keeps its mark', async () => {
+ const docName = `marked-inline-leaf-${randomUUID()}`;
+ const state = await writeAndSettle(docName, '**<Icon />**\n');
+
+ expect(state.ytext.toString()).toBe('**<Icon />**\n');
+ expect(state.md).toBe('**<Icon />**\n');
+ assertBridgeInvariant(state.ytext, state.fragment);
+ expect(bridgeEventsFor(docName)).toEqual([]);
+ }, 30000);
+
+ /**
+ * Control: marks on text runs already round-trip, and an unmarked leaf has
+ * no mark to lose. Both travel the same path as the cases above, so a
+ * failure here would mean the harness or the assertions are wrong rather
+ * than the bridge.
+ *
+ */
+ test('marked text and an unmarked wikilink are unaffected', async () => {
+ const docName = `marked-inline-leaf-control-${randomUUID()}`;
+ const state = await writeAndSettle(docName, '**bold text**\n\n[[a]]\n');
+
+ expect(state.ytext.toString()).toBe('**bold text**\n\n[[a]]\n');
+ expect(state.md).toBe('**bold text**\n\n[[a]]\n');
+ assertBridgeInvariant(state.ytext, state.fragment);
+ expect(bridgeEventsFor(docName)).toEqual([]);
+ }, 30000);
+});
diff --git a/packages/app/tests/integration/marked-inline-leaf-collab.test.ts b/packages/app/tests/integration/marked-inline-leaf-collab.test.ts
new file mode 100644
index 000000000..a65db1bcf
--- /dev/null
+++ b/packages/app/tests/integration/marked-inline-leaf-collab.test.ts
@@ -0,0 +1,134 @@
+/**
+ * Multi-client (two-peer) coverage for emphasis marks on inline leaf nodes.
+ *
+ * The Yjs-bridge fix stores an inline leaf's marks as reserved Y attributes, so
+ * they should ride normal CRDT attribute sync to a second peer and survive that
+ * peer's subsequent, unrelated edits. The storage-round-trip fidelity tests are
+ * single-Y.Doc; OK's rule is that conversion/observer changes require multi-client
+ * (C1-C10) coverage because single-client tests miss remote-peer WYSIWYG
+ * divergence. This drives a real two-peer Hocuspocus sync with the
+ * bridge-invariant watcher attached on both peers (default) — a dropped mark
+ * diverges `serialize(fragment)` from `ytext` and throws during drain, so the
+ * test fails on a regression even before the explicit mark assertions.
+ */
+
+import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';
+import { afterAll, beforeAll, describe, expect, test } from 'vitest';
+import * as Y from 'yjs';
+import { HARNESS_BOOT_TIMEOUT_MS } from './harness-boot-timeout';
+import {
+ assertAllConverged,
+ createTestClients,
+ createTestServer,
+ mdManager,
+ pollUntil,
+ schema,
+ serializeFragment,
+ type TestClient,
+ type TestServer,
+} from './test-harness';
+
+let server: TestServer;
+
+beforeAll(async () => {
+ server = await createTestServer();
+}, HARNESS_BOOT_TIMEOUT_MS);
+
+afterAll(async () => {
+ await server.cleanup();
+});
+
+/** Simulate a WYSIWYG edit: parse markdown -> PM node -> updateYFragment, in one Y transaction (the shape ySyncPlugin uses on every editor transaction). */
+function applyMarkdownToFragment(client: TestClient, md: string): void {
+ const pmNode = schema.nodeFromJSON(mdManager.parse(md));
+ const meta = { mapping: new Map(), isOMark: new Map() };
+ client.doc.transact(() => {
+ updateYFragment(client.doc, client.fragment, pmNode, meta);
+ });
+}
+
+/** An unrelated edit on a peer: append a plain paragraph via raw Y ops (leaves the wikiLink untouched). */
+function appendParagraph(client: TestClient, text: string): void {
+ const paragraph = new Y.XmlElement('paragraph');
+ const ytext = new Y.XmlText();
+ ytext.applyDelta([{ insert: text }]);
+ paragraph.insert(0, [ytext]);
+ client.fragment.push([paragraph]);
+}
+
+/** Whether the first inline leaf of the given type in the client's derived PM doc carries the strong mark. */
+function leafHasStrong(client: TestClient, typeName: string): boolean {
+ const root = yXmlFragmentToProseMirrorRootNode(client.fragment, schema);
+ let has = false;
+ root.descendants((node) => {
+ if (!has && node.type.name === typeName) {
+ has = node.marks.some((m) => m.type.name === 'strong');
+ }
+ return !has;
+ });
+ return has;
+}
+
+describe('marked inline leaf nodes through multi-client collaboration', () => {
+ test('a strong-marked wikilink syncs to a second peer and survives its edit', async () => {
+ const docName = `marked-leaf-collab-${crypto.randomUUID()}`;
+ const [clientA, clientB] = await createTestClients(server.port, {
+ count: 2,
+ docName,
+ perClientOptions: { skipInvariantWatcher: false },
+ });
+
+ try {
+ // Peer A authors **[[a]]** via a WYSIWYG-shaped edit.
+ applyMarkdownToFragment(clientA, '**[[a]]**\n');
+
+ // It converges to peer B carrying the strong mark (the reserved ymark:
+ // attribute rides normal CRDT attribute sync).
+ await pollUntil(() => clientB.ytext.toString().includes('[[a]]'), 8000);
+ await assertAllConverged([clientA, clientB], { timeout: 8000 });
+ expect(serializeFragment(clientB.fragment)).toContain('**[[a]]**');
+ expect(leafHasStrong(clientB, 'wikiLink')).toBe(true);
+
+ // Peer B makes an unrelated edit; A's marked wikilink must survive on both.
+ appendParagraph(clientB, 'edited by B');
+ await pollUntil(() => clientA.ytext.toString().includes('edited by B'), 8000);
+ await assertAllConverged([clientA, clientB], { timeout: 8000 });
+ expect(serializeFragment(clientA.fragment)).toContain('**[[a]]**');
+ expect(serializeFragment(clientB.fragment)).toContain('**[[a]]**');
+ expect(leafHasStrong(clientA, 'wikiLink')).toBe(true);
+ expect(leafHasStrong(clientB, 'wikiLink')).toBe(true);
+ } finally {
+ await clientA.cleanup();
+ await clientB.cleanup();
+ }
+ });
+
+ // The bridge stores marks as type-agnostic reserved Y attributes, so the
+ // sync-to-peer property holds for every inline leaf, not just wikiLink. Each
+ // case authors `**<leaf>**` on peer A and asserts the strong mark reaches B.
+ const LEAF_CASES: Array<{ name: string; md: string; type: string; needle: string }> = [
+ { name: 'image', md: '**![alt](file.png)**\n', type: 'image', needle: '![alt](file.png)' },
+ { name: 'tag', md: '**#mytag**\n', type: 'tag', needle: '#mytag' },
+ { name: 'inline math', md: '**$x = 1$**\n', type: 'mathInline', needle: '$x = 1$' },
+ ];
+ for (const c of LEAF_CASES) {
+ test(`a strong-marked ${c.name} syncs to a second peer`, async () => {
+ const docName = `marked-leaf-collab-${c.type}-${crypto.randomUUID()}`;
+ const [clientA, clientB] = await createTestClients(server.port, {
+ count: 2,
+ docName,
+ perClientOptions: { skipInvariantWatcher: false },
+ });
+ try {
+ applyMarkdownToFragment(clientA, c.md);
+ await pollUntil(() => clientB.ytext.toString().includes(c.needle), 8000);
+ await assertAllConverged([clientA, clientB], { timeout: 8000 });
+ expect(serializeFragment(clientB.fragment)).toContain(c.md.trim());
+ expect(leafHasStrong(clientB, c.type)).toBe(true);
+ } finally {
+ await clientA.cleanup();
+ await clientB.cleanup();
+ }
+ });
+ }
+});
diff --git a/packages/core/schema-snapshot.json b/packages/core/schema-snapshot.json
index 7e82fb8e6..b47cb1828 100644
--- a/packages/core/schema-snapshot.json
+++ b/packages/core/schema-snapshot.json
@@ -133,7 +133,7 @@
}
},
"content": "",
- "marks": "",
+ "marks": "_",
"group": "inline",
"inline": true,
"atom": true,
@@ -152,7 +152,7 @@
}
},
"content": "",
- "marks": "",
+ "marks": "_",
"group": "inline",
"inline": true,
"atom": false,
@@ -241,7 +241,7 @@
}
},
"content": "",
- "marks": "",
+ "marks": "_",
"group": "inline",
"inline": true,
"atom": false,
@@ -268,7 +268,7 @@
}
},
"content": "",
- "marks": "",
+ "marks": "_",
"group": "inline",
"inline": true,
"atom": true,
@@ -437,7 +437,7 @@
}
},
"content": "",
- "marks": "",
+ "marks": "_",
"group": "inline",
"inline": true,
"atom": true,
@@ -579,7 +579,7 @@
}
},
"content": "",
- "marks": "",
+ "marks": "_",
"group": "inline",
"inline": true,
"atom": true,
@@ -643,7 +643,7 @@
}
},
"content": "",
- "marks": "",
+ "marks": "_",
"group": "inline",
"inline": true,
"atom": true,
diff --git a/packages/core/src/extensions/footnote-reference.ts b/packages/core/src/extensions/footnote-reference.ts
index c7ae225de..9a0d45b74 100644
--- a/packages/core/src/extensions/footnote-reference.ts
+++ b/packages/core/src/extensions/footnote-reference.ts
@@ -129,6 +129,7 @@ export function findFootnoteDefinitionInsertPos(doc: FootnoteWalkableDoc): numbe
export const FootnoteReference = Node.create({
name: 'footnoteReference',
+ marks: '_', // legal mark carrier; see wiki-link.ts
group: 'inline',
inline: true,
atom: true,
diff --git a/packages/core/src/extensions/hard-break-fidelity.ts b/packages/core/src/extensions/hard-break-fidelity.ts
index b58ec1f42..10369a715 100644
--- a/packages/core/src/extensions/hard-break-fidelity.ts
+++ b/packages/core/src/extensions/hard-break-fidelity.ts
@@ -11,6 +11,7 @@
import HardBreak from '@tiptap/extension-hard-break';
export const HardBreakFidelity = HardBreak.extend({
+ marks: '_', // legal mark carrier; see wiki-link.ts
priority: 60,
addAttributes() {
diff --git a/packages/core/src/extensions/image-reference-fidelity.ts b/packages/core/src/extensions/image-reference-fidelity.ts
index fec684fd2..d7b30e220 100644
--- a/packages/core/src/extensions/image-reference-fidelity.ts
+++ b/packages/core/src/extensions/image-reference-fidelity.ts
@@ -16,6 +16,7 @@ import { Node } from '@tiptap/core';
export const ImageReferenceFidelity = Node.create({
name: 'imageReference',
+ marks: '_', // legal mark carrier; see wiki-link.ts
group: 'inline',
inline: true,
atom: true,
diff --git a/packages/core/src/extensions/image-src-fidelity.ts b/packages/core/src/extensions/image-src-fidelity.ts
index 2cb15a4a2..56a069f97 100644
--- a/packages/core/src/extensions/image-src-fidelity.ts
+++ b/packages/core/src/extensions/image-src-fidelity.ts
@@ -24,6 +24,7 @@ import Image from '@tiptap/extension-image';
import { toDesktopAssetHref } from '../utils/asset-href.ts';
export const ImageSrcFidelity = Image.extend({
+ marks: '_', // legal mark carrier; see wiki-link.ts
priority: 60,
addAttributes() {
diff --git a/packages/core/src/extensions/marked-inline-leaf-schema.test.ts b/packages/core/src/extensions/marked-inline-leaf-schema.test.ts
new file mode 100644
index 000000000..ed3b86690
--- /dev/null
+++ b/packages/core/src/extensions/marked-inline-leaf-schema.test.ts
@@ -0,0 +1,56 @@
+/**
+ * Schema-legality pin for emphasis marks on inline leaf/atom nodes.
+ *
+ * The Yjs-bridge fix preserves marks on these nodes through storage, but the
+ * ProseMirror schema must ALSO declare the marks legal. An inline leaf has no
+ * inline content, so PM computes an empty mark set for it unless the node spec
+ * sets `marks` — leaving `allowsMarkType(strong) === false`. While that holds, a
+ * real editor transaction can strip a parse-produced mark (schema normalization)
+ * and the user cannot apply one (`toggleBold` no-ops), so formatting on a
+ * wikilink/image/tag/math/hard-break survives storage but not editing.
+ *
+ * This pins the legality itself: every inline leaf the markdown pipeline can wrap
+ * in emphasis must accept those marks. See the editing/collab coverage in
+ * `packages/app/.../marked-inline-leaf-editing.dom.test.tsx` and
+ * `marked-inline-leaf-collab.test.ts` for the behavior this legality unblocks.
+ */
+
+import { getSchema } from '@tiptap/core';
+import { describe, expect, test } from 'vitest';
+import { sharedExtensions } from './shared.ts';
+
+const schema = getSchema(sharedExtensions);
+
+// Inline leaf/atom nodes the markdown pipeline can attach emphasis marks to via
+// `**[[a]]**`, `*![alt](x)*`, `~~$x$~~`, `**#tag**`, `**[^1]**`, `**a<br>b**`, etc.
+const MARKED_INLINE_LEAF_NODES = [
+ 'wikiLink',
+ 'tag',
+ 'mathInline',
+ 'imageReference',
+ 'image',
+ 'hardBreak',
+ 'footnoteReference',
+] as const;
+
+// The emphasis marks the pipeline actually produces on those nodes (mdast-canonical
+// names: `strong` not bold, `emphasis` not italic).
+const EMPHASIS_MARKS = ['strong', 'emphasis', 'strike'] as const;
+
+describe('inline leaf nodes are legal mark carriers (schema legality)', () => {
+ for (const nodeName of MARKED_INLINE_LEAF_NODES) {
+ const nodeType = schema.nodes[nodeName];
+
+ test(`${nodeName} exists in the shared schema`, () => {
+ expect(nodeType, `node ${nodeName} missing from schema`).toBeDefined();
+ });
+
+ for (const markName of EMPHASIS_MARKS) {
+ test(`${nodeName} allows the ${markName} mark`, () => {
+ const markType = schema.marks[markName];
+ expect(markType, `mark ${markName} missing from schema`).toBeDefined();
+ expect(nodeType.allowsMarkType(markType)).toBe(true);
+ });
+ }
+ }
+});
diff --git a/packages/core/src/extensions/math-inline.ts b/packages/core/src/extensions/math-inline.ts
index 841550ef8..4f44f1a00 100644
--- a/packages/core/src/extensions/math-inline.ts
+++ b/packages/core/src/extensions/math-inline.ts
@@ -45,6 +45,7 @@ declare module '@tiptap/core' {
*/
export const MathInline = Node.create({
name: 'mathInline',
+ marks: '_', // legal mark carrier; see wiki-link.ts
group: 'inline',
inline: true,
atom: true,
diff --git a/packages/core/src/extensions/tag.ts b/packages/core/src/extensions/tag.ts
index 5228b178e..c02a0333a 100644
--- a/packages/core/src/extensions/tag.ts
+++ b/packages/core/src/extensions/tag.ts
@@ -30,6 +30,7 @@ declare module '@tiptap/core' {
export const Tag = Node.create({
name: 'tag',
+ marks: '_', // legal mark carrier; see wiki-link.ts
group: 'inline',
inline: true,
atom: true,
diff --git a/packages/core/src/extensions/wiki-link.ts b/packages/core/src/extensions/wiki-link.ts
index 32a29702c..9362ec2be 100644
--- a/packages/core/src/extensions/wiki-link.ts
+++ b/packages/core/src/extensions/wiki-link.ts
@@ -58,6 +58,13 @@ export function renderWikiLink(attrs: Pick<WikiLinkAttrs, 'target' | 'alias' | '
export const WikiLink = Node.create({
name: 'wikiLink',
+ // Legal carrier for any mark this inline leaf preserves through the Yjs bridge
+ // (the reserved ymark: encoding is mark-agnostic). An inline leaf gets an empty
+ // mark set by default, leaving allowsMarkType() false, which desyncs menus and
+ // input-rules from the marks the node actually carries. Use '_' (all marks), not
+ // a named set: a named set makes prosemirror-model's gatherMarks throw in any
+ // partial schema that omits those marks (e.g. a focused test's minimal schema).
+ marks: '_',
group: 'inline',
inline: true,
atom: true,
diff --git a/patches/@tiptap%[email protected] b/patches/@tiptap%[email protected]
index 9e1d04008..fe02db895 100644
--- a/patches/@tiptap%[email protected]
+++ b/patches/@tiptap%[email protected]
@@ -1,8 +1,18 @@
diff --git a/dist/y-tiptap.cjs b/dist/y-tiptap.cjs
-index 4dd5b4df7c0c589f4781807bf775f791e216e92a..e8dcb7c7a3419e0e03c49cafd98736421c3e4b7f 100644
+index 4dd5b4df7c0c589f4781807bf775f791e216e92a..9d5c37c6e92d6db1b13c2af7946361f0d6e4058d 100644
--- a/dist/y-tiptap.cjs
+++ b/dist/y-tiptap.cjs
-@@ -891,10 +891,22 @@ const createNodeFromYElement = (
+@@ -887,14 +887,31 @@ const createNodeFromYElement = (
+ : { type: 'added' };
+ }
+ }
+- const node = schema.node(el.nodeName, attrs, children);
++ // Reserved mark keys are separated back out and rehydrated as the node's
++ // own marks. Yjs attribute iteration order diverges between peers, but PM's
++ // Mark.setFrom sorts by type.rank, so both peers reconstruct the same set.
++ const split = splitYAttrs(attrs);
++ const nodeMarks = attributesToMarks(split.marks, schema);
++ const node = schema.node(el.nodeName, split.plain, children, nodeMarks.length ? nodeMarks : undefined);
meta.mapping.set(el, node);
return node
} catch (e) {
@@ -29,7 +39,7 @@ index 4dd5b4df7c0c589f4781807bf775f791e216e92a..e8dcb7c7a3419e0e03c49cafd9873642
meta.mapping.delete(el);
return null
}
-@@ -926,10 +938,10 @@ const createTextNodesFromYText = (
+@@ -926,10 +943,10 @@ const createTextNodesFromYText = (
nodes.push(schema.text(delta.insert, attributesToMarks(delta.attributes, schema)));
}
} catch (e) {
@@ -44,11 +54,134 @@ index 4dd5b4df7c0c589f4781807bf775f791e216e92a..e8dcb7c7a3419e0e03c49cafd9873642
return null
}
// @ts-ignore
+@@ -968,6 +985,15 @@ const createTypeFromElementNode = (node, meta) => {
+ type.setAttribute(key, val);
+ }
+ }
++ // Marks live on the node, not in node.attrs, so they need their own pass.
++ // The spread is load-bearing: ProseMirror builds mark.attrs with
++ // Object.create(null), and Yjs's typeMapSet dispatches on value.constructor,
++ // which is undefined for a null-prototype object and falls through to
++ // 'Unexpected content type'.
++ const ymarks = marksToAttributes(node.marks || [], meta);
++ for (const key in ymarks) {
++ type.setAttribute(YMARK_PREFIX + key, { ...ymarks[key] });
++ }
+ type.insert(
+ 0,
+ normalizePNodeContent(node).map((n) =>
+@@ -1067,6 +1093,56 @@ const equalYTextPText = (ytext, ptexts) => {
+ )
+ };
+
++/**
++ * Marks carried ON an element node are persisted as reserved attributes, so an
++ * element round-trips as faithfully as a marked text run already does. The
++ * prefix is the whole namespace: any key starting with it is a mark and every
++ * other key is a node attribute, so a new mark type needs no registration.
++ * One reserved key per mark rather than one map for all of them, so that two
++ * peers marking the same node concurrently keep both marks instead of the
++ * whole map being resolved last-writer-wins.
++ */
++const YMARK_PREFIX = 'ymark:';
++
++/**
++ * @param {Object<string, any>} yattrs
++ */
++const splitYAttrs = (yattrs) => {
++ const plain = {};
++ const marks = {};
++ for (const key in yattrs) {
++ if (key.startsWith(YMARK_PREFIX)) {
++ marks[key.slice(YMARK_PREFIX.length)] = yattrs[key];
++ } else {
++ plain[key] = yattrs[key];
++ }
++ }
++ return { plain, marks }
++};
++
++/**
++ * Mirror of equalYTextPText's mark comparison, for marks carried on an element
++ * node. Takes no `meta` because three of equalYTypePNode's call sites (the
++ * recursive one and updateYFragment's two edge scans) do not have one in hand.
++ *
++ * @param {Object<string, any>} ymarkAttrs
++ * @param {Array<any>} pmarks
++ */
++const equalYMarks = (ymarkAttrs, pmarks) => {
++ const keys = Object.keys(ymarkAttrs);
++ if (keys.length !== pmarks.length) {
++ return false
++ }
++ return keys.every((yattrname) => {
++ const markname = yattr2markname(yattrname);
++ const pmark = pmarks.find((mark) => mark.type.name === markname);
++ if (!pmark) {
++ return false
++ }
++ return equalAttrs(ymarkAttrs[yattrname], pmark.attrs)
++ })
++};
++
+ /**
+ * @param {Y.XmlElement|Y.XmlText|Y.XmlHook} ytype
+ * @param {any|Array<any>} pnode
+@@ -1077,8 +1153,13 @@ const equalYTypePNode = (ytype, pnode) => {
+ matchNodeName(ytype, pnode)
+ ) {
+ const normalizedContent = normalizePNodeContent(pnode);
++ // Split before comparing: a reserved mark key is absent from pnode.attrs by
++ // construction, so leaving it in would make equalAttrs false on every
++ // comparison forever and rewrite the element on every drain.
++ const split = splitYAttrs(ytype.getAttributes());
+ return ytype._length === normalizedContent.length &&
+- equalAttrs(ytype.getAttributes(), pnode.attrs) &&
++ equalYMarks(split.marks, pnode.marks) &&
++ equalAttrs(split.plain, pnode.attrs) &&
+ ytype.toArray().every((ychild, i) =>
+ equalYTypePNode(ychild, normalizedContent[i])
+ )
+@@ -1263,7 +1344,23 @@ const updateYFragment = (y, yDomFragment, pNode, meta) => {
+ }
+ // remove all keys that are no longer in pAttrs
+ for (const key in yDomAttrs) {
+- if (pAttrs[key] === undefined) {
++ if (pAttrs[key] === undefined && !key.startsWith(YMARK_PREFIX)) {
++ yDomFragment.removeAttribute(key);
++ }
++ }
++ // Reconcile the marks carried on this element. The equality guard keeps the
++ // writes conditional: rewriting an unchanged attribute replaces the Y Item,
++ // which silently degrades Y.UndoManager attribution because that rides on
++ // Item identity (item-preservation invariant).
++ const pMarkAttrs = marksToAttributes(pNode.marks || [], meta);
++ for (const key in pMarkAttrs) {
++ const yMarkAttr = yDomAttrs[YMARK_PREFIX + key];
++ if (yMarkAttr === undefined || !equalAttrs(yMarkAttr, pMarkAttrs[key])) {
++ yDomFragment.setAttribute(YMARK_PREFIX + key, { ...pMarkAttrs[key] });
++ }
++ }
++ for (const key in yDomAttrs) {
++ if (key.startsWith(YMARK_PREFIX) && pMarkAttrs[key.slice(YMARK_PREFIX.length)] === undefined) {
+ yDomFragment.removeAttribute(key);
+ }
+ }
diff --git a/dist/y-tiptap.js b/dist/y-tiptap.js
-index 1cddd60120846234225be3c6768fd2da8410fc5c..c53665aef4003bdb769050caf6e8eb6fe465d7d1 100644
+index 1cddd60120846234225be3c6768fd2da8410fc5c..005101815c6207fd7ecafa0cc042067a3441a2d6 100644
--- a/dist/y-tiptap.js
+++ b/dist/y-tiptap.js
-@@ -857,10 +857,22 @@ const createNodeFromYElement = (
+@@ -853,14 +853,31 @@ const createNodeFromYElement = (
+ : { type: 'added' };
+ }
+ }
+- const node = schema.node(el.nodeName, attrs, children);
++ // Reserved mark keys are separated back out and rehydrated as the node's
++ // own marks. Yjs attribute iteration order diverges between peers, but PM's
++ // Mark.setFrom sorts by type.rank, so both peers reconstruct the same set.
++ const split = splitYAttrs(attrs);
++ const nodeMarks = attributesToMarks(split.marks, schema);
++ const node = schema.node(el.nodeName, split.plain, children, nodeMarks.length ? nodeMarks : undefined);
meta.mapping.set(el, node);
return node
} catch (e) {
@@ -75,7 +208,7 @@ index 1cddd60120846234225be3c6768fd2da8410fc5c..c53665aef4003bdb769050caf6e8eb6f
meta.mapping.delete(el);
return null
}
-@@ -892,10 +904,10 @@ const createTextNodesFromYText = (
+@@ -892,10 +909,10 @@ const createTextNodesFromYText = (
nodes.push(schema.text(delta.insert, attributesToMarks(delta.attributes, schema)));
}
} catch (e) {
@@ -90,3 +223,116 @@ index 1cddd60120846234225be3c6768fd2da8410fc5c..c53665aef4003bdb769050caf6e8eb6f
return null
}
// @ts-ignore
+@@ -934,6 +951,15 @@ const createTypeFromElementNode = (node, meta) => {
+ type.setAttribute(key, val);
+ }
+ }
++ // Marks live on the node, not in node.attrs, so they need their own pass.
++ // The spread is load-bearing: ProseMirror builds mark.attrs with
++ // Object.create(null), and Yjs's typeMapSet dispatches on value.constructor,
++ // which is undefined for a null-prototype object and falls through to
++ // 'Unexpected content type'.
++ const ymarks = marksToAttributes(node.marks || [], meta);
++ for (const key in ymarks) {
++ type.setAttribute(YMARK_PREFIX + key, { ...ymarks[key] });
++ }
+ type.insert(
+ 0,
+ normalizePNodeContent(node).map((n) =>
+@@ -1033,6 +1059,56 @@ const equalYTextPText = (ytext, ptexts) => {
+ )
+ };
+
++/**
++ * Marks carried ON an element node are persisted as reserved attributes, so an
++ * element round-trips as faithfully as a marked text run already does. The
++ * prefix is the whole namespace: any key starting with it is a mark and every
++ * other key is a node attribute, so a new mark type needs no registration.
++ * One reserved key per mark rather than one map for all of them, so that two
++ * peers marking the same node concurrently keep both marks instead of the
++ * whole map being resolved last-writer-wins.
++ */
++const YMARK_PREFIX = 'ymark:';
++
++/**
++ * @param {Object<string, any>} yattrs
++ */
++const splitYAttrs = (yattrs) => {
++ const plain = {};
++ const marks = {};
++ for (const key in yattrs) {
++ if (key.startsWith(YMARK_PREFIX)) {
++ marks[key.slice(YMARK_PREFIX.length)] = yattrs[key];
++ } else {
++ plain[key] = yattrs[key];
++ }
++ }
++ return { plain, marks }
++};
++
++/**
++ * Mirror of equalYTextPText's mark comparison, for marks carried on an element
++ * node. Takes no `meta` because three of equalYTypePNode's call sites (the
++ * recursive one and updateYFragment's two edge scans) do not have one in hand.
++ *
++ * @param {Object<string, any>} ymarkAttrs
++ * @param {Array<any>} pmarks
++ */
++const equalYMarks = (ymarkAttrs, pmarks) => {
++ const keys = Object.keys(ymarkAttrs);
++ if (keys.length !== pmarks.length) {
++ return false
++ }
++ return keys.every((yattrname) => {
++ const markname = yattr2markname(yattrname);
++ const pmark = pmarks.find((mark) => mark.type.name === markname);
++ if (!pmark) {
++ return false
++ }
++ return equalAttrs(ymarkAttrs[yattrname], pmark.attrs)
++ })
++};
++
+ /**
+ * @param {Y.XmlElement|Y.XmlText|Y.XmlHook} ytype
+ * @param {any|Array<any>} pnode
+@@ -1043,8 +1119,13 @@ const equalYTypePNode = (ytype, pnode) => {
+ matchNodeName(ytype, pnode)
+ ) {
+ const normalizedContent = normalizePNodeContent(pnode);
++ // Split before comparing: a reserved mark key is absent from pnode.attrs by
++ // construction, so leaving it in would make equalAttrs false on every
++ // comparison forever and rewrite the element on every drain.
++ const split = splitYAttrs(ytype.getAttributes());
+ return ytype._length === normalizedContent.length &&
+- equalAttrs(ytype.getAttributes(), pnode.attrs) &&
++ equalYMarks(split.marks, pnode.marks) &&
++ equalAttrs(split.plain, pnode.attrs) &&
+ ytype.toArray().every((ychild, i) =>
+ equalYTypePNode(ychild, normalizedContent[i])
+ )
+@@ -1229,7 +1310,23 @@ const updateYFragment = (y, yDomFragment, pNode, meta) => {
+ }
+ // remove all keys that are no longer in pAttrs
+ for (const key in yDomAttrs) {
+- if (pAttrs[key] === undefined) {
++ if (pAttrs[key] === undefined && !key.startsWith(YMARK_PREFIX)) {
++ yDomFragment.removeAttribute(key);
++ }
++ }
++ // Reconcile the marks carried on this element. The equality guard keeps the
++ // writes conditional: rewriting an unchanged attribute replaces the Y Item,
++ // which silently degrades Y.UndoManager attribution because that rides on
++ // Item identity (item-preservation invariant).
++ const pMarkAttrs = marksToAttributes(pNode.marks || [], meta);
++ for (const key in pMarkAttrs) {
++ const yMarkAttr = yDomAttrs[YMARK_PREFIX + key];
++ if (yMarkAttr === undefined || !equalAttrs(yMarkAttr, pMarkAttrs[key])) {
++ yDomFragment.setAttribute(YMARK_PREFIX + key, { ...pMarkAttrs[key] });
++ }
++ }
++ for (const key in yDomAttrs) {
++ if (key.startsWith(YMARK_PREFIX) && pMarkAttrs[key.slice(YMARK_PREFIX.length)] === undefined) {
+ yDomFragment.removeAttribute(key);
+ }
+ }
diff --git a/patches/[email protected] b/patches/[email protected]
index 4689b5b91..e76373635 100644
--- a/patches/[email protected]
+++ b/patches/[email protected]
@@ -1,11 +1,21 @@
-diff --git a/node_modules/y-prosemirror/.bun-tag-d9525f80a1b2e20a b/.bun-tag-d9525f80a1b2e20a
+diff --git a/.bun-tag-d9525f80a1b2e20a b/.bun-tag-d9525f80a1b2e20a
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/dist/y-prosemirror.cjs b/dist/y-prosemirror.cjs
-index de4d1e6609bba2ffbc2a57048023cdf5bad44b18..3cfd69804a774c945c4e74c9d771741861f184eb 100644
+index de4d1e6609bba2ffbc2a57048023cdf5bad44b18..a151ce5efe9834cabcb45995b25a6a2b087612e0 100644
--- a/dist/y-prosemirror.cjs
+++ b/dist/y-prosemirror.cjs
-@@ -876,10 +876,22 @@ const createNodeFromYElement = (
+@@ -872,14 +872,31 @@ const createNodeFromYElement = (
+ : { type: 'added' };
+ }
+ }
+- const node = schema.node(el.nodeName, attrs, children);
++ // Reserved mark keys are separated back out and rehydrated as the node's
++ // own marks. Yjs attribute iteration order diverges between peers, but PM's
++ // Mark.setFrom sorts by type.rank, so both peers reconstruct the same set.
++ const split = splitYAttrs(attrs);
++ const nodeMarks = attributesToMarks(split.marks, schema);
++ const node = schema.node(el.nodeName, split.plain, children, nodeMarks.length ? nodeMarks : undefined);
meta.mapping.set(el, node);
return node
} catch (e) {
@@ -32,7 +42,7 @@ index de4d1e6609bba2ffbc2a57048023cdf5bad44b18..3cfd69804a774c945c4e74c9d7717418
meta.mapping.delete(el);
return null
}
-@@ -911,10 +923,10 @@ const createTextNodesFromYText = (
+@@ -911,10 +928,10 @@ const createTextNodesFromYText = (
nodes.push(schema.text(delta.insert, attributesToMarks(delta.attributes, schema)));
}
} catch (e) {
@@ -47,11 +57,134 @@ index de4d1e6609bba2ffbc2a57048023cdf5bad44b18..3cfd69804a774c945c4e74c9d7717418
return null
}
// @ts-ignore
+@@ -953,6 +970,15 @@ const createTypeFromElementNode = (node, meta) => {
+ type.setAttribute(key, val);
+ }
+ }
++ // Marks live on the node, not in node.attrs, so they need their own pass.
++ // The spread is load-bearing: ProseMirror builds mark.attrs with
++ // Object.create(null), and Yjs's typeMapSet dispatches on value.constructor,
++ // which is undefined for a null-prototype object and falls through to
++ // 'Unexpected content type'.
++ const ymarks = marksToAttributes(node.marks || [], meta);
++ for (const key in ymarks) {
++ type.setAttribute(YMARK_PREFIX + key, { ...ymarks[key] });
++ }
+ type.insert(
+ 0,
+ normalizePNodeContent(node).map((n) =>
+@@ -1043,6 +1069,56 @@ const equalYTextPText = (ytext, ptexts) => {
+ )
+ };
+
++/**
++ * Marks carried ON an element node are persisted as reserved attributes, so an
++ * element round-trips as faithfully as a marked text run already does. The
++ * prefix is the whole namespace: any key starting with it is a mark and every
++ * other key is a node attribute, so a new mark type needs no registration.
++ * One reserved key per mark rather than one map for all of them, so that two
++ * peers marking the same node concurrently keep both marks instead of the
++ * whole map being resolved last-writer-wins.
++ */
++const YMARK_PREFIX = 'ymark:';
++
++/**
++ * @param {Object<string, any>} yattrs
++ */
++const splitYAttrs = (yattrs) => {
++ const plain = {};
++ const marks = {};
++ for (const key in yattrs) {
++ if (key.startsWith(YMARK_PREFIX)) {
++ marks[key.slice(YMARK_PREFIX.length)] = yattrs[key];
++ } else {
++ plain[key] = yattrs[key];
++ }
++ }
++ return { plain, marks }
++};
++
++/**
++ * Mirror of equalYTextPText's mark comparison, for marks carried on an element
++ * node. Takes no `meta` because three of equalYTypePNode's call sites (the
++ * recursive one and updateYFragment's two edge scans) do not have one in hand.
++ *
++ * @param {Object<string, any>} ymarkAttrs
++ * @param {Array<any>} pmarks
++ */
++const equalYMarks = (ymarkAttrs, pmarks) => {
++ const keys = Object.keys(ymarkAttrs);
++ if (keys.length !== pmarks.length) {
++ return false
++ }
++ return keys.every((yattrname) => {
++ const markname = yattr2markname(yattrname);
++ const pmark = pmarks.find((mark) => mark.type.name === markname);
++ if (!pmark) {
++ return false
++ }
++ return equalAttrs(ymarkAttrs[yattrname], pmark.attrs)
++ })
++};
++
+ /**
+ * @param {Y.XmlElement|Y.XmlText|Y.XmlHook} ytype
+ * @param {any|Array<any>} pnode
+@@ -1053,8 +1129,13 @@ const equalYTypePNode = (ytype, pnode) => {
+ matchNodeName(ytype, pnode)
+ ) {
+ const normalizedContent = normalizePNodeContent(pnode);
++ // Split before comparing: a reserved mark key is absent from pnode.attrs by
++ // construction, so leaving it in would make equalAttrs false on every
++ // comparison forever and rewrite the element on every drain.
++ const split = splitYAttrs(ytype.getAttributes());
+ return ytype._length === normalizedContent.length &&
+- equalAttrs(ytype.getAttributes(), pnode.attrs) &&
++ equalYMarks(split.marks, pnode.marks) &&
++ equalAttrs(split.plain, pnode.attrs) &&
+ ytype.toArray().every((ychild, i) =>
+ equalYTypePNode(ychild, normalizedContent[i])
+ )
+@@ -1239,7 +1320,23 @@ const updateYFragment = (y, yDomFragment, pNode, meta) => {
+ }
+ // remove all keys that are no longer in pAttrs
+ for (const key in yDomAttrs) {
+- if (pAttrs[key] === undefined) {
++ if (pAttrs[key] === undefined && !key.startsWith(YMARK_PREFIX)) {
++ yDomFragment.removeAttribute(key);
++ }
++ }
++ // Reconcile the marks carried on this element. The equality guard keeps the
++ // writes conditional: rewriting an unchanged attribute replaces the Y Item,
++ // which silently degrades Y.UndoManager attribution because that rides on
++ // Item identity (item-preservation invariant).
++ const pMarkAttrs = marksToAttributes(pNode.marks || [], meta);
++ for (const key in pMarkAttrs) {
++ const yMarkAttr = yDomAttrs[YMARK_PREFIX + key];
++ if (yMarkAttr === undefined || !equalAttrs(yMarkAttr, pMarkAttrs[key])) {
++ yDomFragment.setAttribute(YMARK_PREFIX + key, { ...pMarkAttrs[key] });
++ }
++ }
++ for (const key in yDomAttrs) {
++ if (key.startsWith(YMARK_PREFIX) && pMarkAttrs[key.slice(YMARK_PREFIX.length)] === undefined) {
+ yDomFragment.removeAttribute(key);
+ }
+ }
diff --git a/src/plugins/sync-plugin.js b/src/plugins/sync-plugin.js
-index dccfb76918c8c70fe5a5b12372cdabcc9d8c58dd..cdab2201d744aef62b74477f4766d5895b4eb852 100644
+index dccfb76918c8c70fe5a5b12372cdabcc9d8c58dd..7ecf9623cc29fc75c99e79bd9517106432e4c571 100644
--- a/src/plugins/sync-plugin.js
+++ b/src/plugins/sync-plugin.js
-@@ -802,10 +802,27 @@ export const createNodeFromYElement = (
+@@ -798,14 +798,36 @@ export const createNodeFromYElement = (
+ : { type: 'added' }
+ }
+ }
+- const node = schema.node(el.nodeName, attrs, children)
++ // Reserved mark keys are separated back out and rehydrated as the node's
++ // own marks. Yjs attribute iteration order diverges between peers, but PM's
++ // Mark.setFrom sorts by type.rank, so both peers reconstruct the same set.
++ const split = splitYAttrs(attrs)
++ const nodeMarks = attributesToMarks(split.marks, schema)
++ const node = schema.node(el.nodeName, split.plain, children, nodeMarks.length ? nodeMarks : undefined)
meta.mapping.set(el, node)
return node
} catch (e) {
@@ -83,7 +216,7 @@ index dccfb76918c8c70fe5a5b12372cdabcc9d8c58dd..cdab2201d744aef62b74477f4766d589
meta.mapping.delete(el)
return null
}
-@@ -837,10 +854,10 @@ const createTextNodesFromYText = (
+@@ -837,10 +859,10 @@ const createTextNodesFromYText = (
nodes.push(schema.text(delta.insert, attributesToMarks(delta.attributes, schema)))
}
} catch (e) {
@@ -98,3 +231,116 @@ index dccfb76918c8c70fe5a5b12372cdabcc9d8c58dd..cdab2201d744aef62b74477f4766d589
return null
}
// @ts-ignore
+@@ -879,6 +901,15 @@ const createTypeFromElementNode = (node, meta) => {
+ type.setAttribute(key, val)
+ }
+ }
++ // Marks live on the node, not in node.attrs, so they need their own pass.
++ // The spread is load-bearing: ProseMirror builds mark.attrs with
++ // Object.create(null), and Yjs's typeMapSet dispatches on value.constructor,
++ // which is undefined for a null-prototype object and falls through to
++ // 'Unexpected content type'.
++ const ymarks = marksToAttributes(node.marks || [], meta)
++ for (const key in ymarks) {
++ type.setAttribute(YMARK_PREFIX + key, { ...ymarks[key] })
++ }
+ type.insert(
+ 0,
+ normalizePNodeContent(node).map((n) =>
+@@ -969,6 +1000,56 @@ const equalYTextPText = (ytext, ptexts) => {
+ )
+ }
+
++/**
++ * Marks carried ON an element node are persisted as reserved attributes, so an
++ * element round-trips as faithfully as a marked text run already does. The
++ * prefix is the whole namespace: any key starting with it is a mark and every
++ * other key is a node attribute, so a new mark type needs no registration.
++ * One reserved key per mark rather than one map for all of them, so that two
++ * peers marking the same node concurrently keep both marks instead of the
++ * whole map being resolved last-writer-wins.
++ */
++const YMARK_PREFIX = 'ymark:'
++
++/**
++ * @param {Object<string, any>} yattrs
++ */
++const splitYAttrs = (yattrs) => {
++ const plain = {}
++ const marks = {}
++ for (const key in yattrs) {
++ if (key.startsWith(YMARK_PREFIX)) {
++ marks[key.slice(YMARK_PREFIX.length)] = yattrs[key]
++ } else {
++ plain[key] = yattrs[key]
++ }
++ }
++ return { plain, marks }
++}
++
++/**
++ * Mirror of equalYTextPText's mark comparison, for marks carried on an element
++ * node. Takes no `meta` because three of equalYTypePNode's call sites (the
++ * recursive one and updateYFragment's two edge scans) do not have one in hand.
++ *
++ * @param {Object<string, any>} ymarkAttrs
++ * @param {Array<any>} pmarks
++ */
++const equalYMarks = (ymarkAttrs, pmarks) => {
++ const keys = Object.keys(ymarkAttrs)
++ if (keys.length !== pmarks.length) {
++ return false
++ }
++ return keys.every((yattrname) => {
++ const markname = yattr2markname(yattrname)
++ const pmark = pmarks.find((mark) => mark.type.name === markname)
++ if (!pmark) {
++ return false
++ }
++ return equalAttrs(ymarkAttrs[yattrname], pmark.attrs)
++ })
++}
++
+ /**
+ * @param {Y.XmlElement|Y.XmlText|Y.XmlHook} ytype
+ * @param {any|Array<any>} pnode
+@@ -979,8 +1060,13 @@ const equalYTypePNode = (ytype, pnode) => {
+ matchNodeName(ytype, pnode)
+ ) {
+ const normalizedContent = normalizePNodeContent(pnode)
++ // Split before comparing: a reserved mark key is absent from pnode.attrs by
++ // construction, so leaving it in would make equalAttrs false on every
++ // comparison forever and rewrite the element on every drain.
++ const split = splitYAttrs(ytype.getAttributes())
+ return ytype._length === normalizedContent.length &&
+- equalAttrs(ytype.getAttributes(), pnode.attrs) &&
++ equalYMarks(split.marks, pnode.marks) &&
++ equalAttrs(split.plain, pnode.attrs) &&
+ ytype.toArray().every((ychild, i) =>
+ equalYTypePNode(ychild, normalizedContent[i])
+ )
+@@ -1165,7 +1251,23 @@ export const updateYFragment = (y, yDomFragment, pNode, meta) => {
+ }
+ // remove all keys that are no longer in pAttrs
+ for (const key in yDomAttrs) {
+- if (pAttrs[key] === undefined) {
++ if (pAttrs[key] === undefined && !key.startsWith(YMARK_PREFIX)) {
++ yDomFragment.removeAttribute(key)
++ }
++ }
++ // Reconcile the marks carried on this element. The equality guard keeps the
++ // writes conditional: rewriting an unchanged attribute replaces the Y Item,
++ // which silently degrades Y.UndoManager attribution because that rides on
++ // Item identity (item-preservation invariant).
++ const pMarkAttrs = marksToAttributes(pNode.marks || [], meta)
++ for (const key in pMarkAttrs) {
++ const yMarkAttr = yDomAttrs[YMARK_PREFIX + key]
++ if (yMarkAttr === undefined || !equalAttrs(yMarkAttr, pMarkAttrs[key])) {
++ yDomFragment.setAttribute(YMARK_PREFIX + key, { ...pMarkAttrs[key] })
++ }
++ }
++ for (const key in yDomAttrs) {
++ if (key.startsWith(YMARK_PREFIX) && pMarkAttrs[key.slice(YMARK_PREFIX.length)] === undefined) {
+ yDomFragment.removeAttribute(key)
+ }
+ }
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 8b88437ab..2fa637534 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -129,7 +129,7 @@ patchedDependencies:
hash: 1b9619bc7312665109e19145213057775714cfb21879fb32ab1237fbfbffcdc5
path: patches/@tiptap%[email protected]
'@tiptap/[email protected]':
- hash: b32cf18328a5bb868dc3a8367dab8d77caad031c96235d79d5a2101f2516bbf9
+ hash: 43915485b8dd39489356fd829d5364b627ad0bc65ad1fd07c8350b1bcca8f3e4
path: patches/@tiptap%[email protected]
hash: d59ed459a6ae570e843d0829f844dde24c0697b883351b198034f47606766517
@@ -138,7 +138,7 @@ patchedDependencies:
hash: bc95fab9af70f704280673eafabcb5a40cc180fd5122d62e6c44cac2f7076245
path: patches/[email protected]
- hash: df31dd90b326cc2cf5a69762eace45888ae10bb62f647c436c6f47492421eb6b
+ hash: b77fc38bdf246f08f73b6bc5d12ec24d29408b663f0a4224758d3f776ef124e7
path: patches/[email protected]
importers:
@@ -439,13 +439,13 @@ importers:
version: 3.22.3(@tiptap/[email protected])
'@tiptap/extension-collaboration':
specifier: 3.22.3
- version: 3.22.3(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected](patch_hash=b32cf18328a5bb868dc3a8367dab8d77caad031c96235d79d5a2101f2516bbf9)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])
+ version: 3.22.3(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected](patch_hash=43915485b8dd39489356fd829d5364b627ad0bc65ad1fd07c8350b1bcca8f3e4)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])
'@tiptap/extension-collaboration-cursor':
specifier: 3.0.0
- version: 3.0.0(@tiptap/[email protected](@tiptap/[email protected]))([email protected](patch_hash=df31dd90b326cc2cf5a69762eace45888ae10bb62f647c436c6f47492421eb6b)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))
+ version: 3.0.0(@tiptap/[email protected](@tiptap/[email protected]))([email protected](patch_hash=b77fc38bdf246f08f73b6bc5d12ec24d29408b663f0a4224758d3f776ef124e7)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))
'@tiptap/extension-drag-handle':
specifier: 3.22.3
- version: 3.22.3(patch_hash=1b9619bc7312665109e19145213057775714cfb21879fb32ab1237fbfbffcdc5)(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected](patch_hash=b32cf18328a5bb868dc3a8367dab8d77caad031c96235d79d5a2101f2516bbf9)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected](patch_hash=b32cf18328a5bb868dc3a8367dab8d77caad031c96235d79d5a2101f2516bbf9)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))
+ version: 3.22.3(patch_hash=1b9619bc7312665109e19145213057775714cfb21879fb32ab1237fbfbffcdc5)(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected](patch_hash=43915485b8dd39489356fd829d5364b627ad0bc65ad1fd07c8350b1bcca8f3e4)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected](patch_hash=43915485b8dd39489356fd829d5364b627ad0bc65ad1fd07c8350b1bcca8f3e4)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))
'@tiptap/extension-file-handler':
specifier: 3.22.3
version: 3.22.3(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected])))(@tiptap/[email protected])
@@ -463,7 +463,7 @@ importers:
version: 3.22.3(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
'@tiptap/y-tiptap':
specifier: 3.0.3
- version: 3.0.3(patch_hash=b32cf18328a5bb868dc3a8367dab8d77caad031c96235d79d5a2101f2516bbf9)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
+ version: 3.0.3(patch_hash=43915485b8dd39489356fd829d5364b627ad0bc65ad1fd07c8350b1bcca8f3e4)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
'@u-wave/react-vimeo':
specifier: ^0.9.12
version: 0.9.12([email protected])
@@ -1013,7 +1013,7 @@ importers:
version: 3.22.3(@tiptap/[email protected](@tiptap/[email protected]))
'@tiptap/y-tiptap':
specifier: 3.0.3
- version: 3.0.3(patch_hash=b32cf18328a5bb868dc3a8367dab8d77caad031c96235d79d5a2101f2516bbf9)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
+ version: 3.0.3(patch_hash=43915485b8dd39489356fd829d5364b627ad0bc65ad1fd07c8350b1bcca8f3e4)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
'@types/culori':
specifier: ^4.0.0
version: 4.0.1
@@ -1061,7 +1061,7 @@ importers:
version: 5.9.3
y-prosemirror:
specifier: 1.3.7
- version: 1.3.7(patch_hash=df31dd90b326cc2cf5a69762eace45888ae10bb62f647c436c6f47492421eb6b)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
+ version: 1.3.7(patch_hash=b77fc38bdf246f08f73b6bc5d12ec24d29408b663f0a4224758d3f776ef124e7)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
packages/desktop:
dependencies:
@@ -1203,7 +1203,7 @@ importers:
version: 3.22.4
'@tiptap/y-tiptap':
specifier: 3.0.3
- version: 3.0.3(patch_hash=b32cf18328a5bb868dc3a8367dab8d77caad031c96235d79d5a2101f2516bbf9)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
+ version: 3.0.3(patch_hash=43915485b8dd39489356fd829d5364b627ad0bc65ad1fd07c8350b1bcca8f3e4)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
'@types/busboy':
specifier: ^1.5.4
version: 1.5.4
@@ -15881,30 +15881,30 @@ snapshots:
dependencies:
'@tiptap/core': 3.22.3(@tiptap/[email protected])
- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))([email protected](patch_hash=df31dd90b326cc2cf5a69762eace45888ae10bb62f647c436c6f47492421eb6b)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))':
+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))([email protected](patch_hash=b77fc38bdf246f08f73b6bc5d12ec24d29408b663f0a4224758d3f776ef124e7)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))':
dependencies:
'@tiptap/core': 3.22.3(@tiptap/[email protected])
- y-prosemirror: 1.3.7(patch_hash=df31dd90b326cc2cf5a69762eace45888ae10bb62f647c436c6f47492421eb6b)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
+ y-prosemirror: 1.3.7(patch_hash=b77fc38bdf246f08f73b6bc5d12ec24d29408b663f0a4224758d3f776ef124e7)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
- '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected](patch_hash=b32cf18328a5bb868dc3a8367dab8d77caad031c96235d79d5a2101f2516bbf9)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])':
+ '@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected](patch_hash=43915485b8dd39489356fd829d5364b627ad0bc65ad1fd07c8350b1bcca8f3e4)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])':
dependencies:
'@tiptap/core': 3.22.3(@tiptap/[email protected])
'@tiptap/pm': 3.22.4
- '@tiptap/y-tiptap': 3.0.3(patch_hash=b32cf18328a5bb868dc3a8367dab8d77caad031c96235d79d5a2101f2516bbf9)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
+ '@tiptap/y-tiptap': 3.0.3(patch_hash=43915485b8dd39489356fd829d5364b627ad0bc65ad1fd07c8350b1bcca8f3e4)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
yjs: 13.6.31
dependencies:
'@tiptap/core': 3.22.3(@tiptap/[email protected])
- '@tiptap/[email protected](patch_hash=1b9619bc7312665109e19145213057775714cfb21879fb32ab1237fbfbffcdc5)(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected](patch_hash=b32cf18328a5bb868dc3a8367dab8d77caad031c96235d79d5a2101f2516bbf9)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected](patch_hash=b32cf18328a5bb868dc3a8367dab8d77caad031c96235d79d5a2101f2516bbf9)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))':
+ '@tiptap/[email protected](patch_hash=1b9619bc7312665109e19145213057775714cfb21879fb32ab1237fbfbffcdc5)(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected](patch_hash=43915485b8dd39489356fd829d5364b627ad0bc65ad1fd07c8350b1bcca8f3e4)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]))(@tiptap/[email protected](@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected](patch_hash=43915485b8dd39489356fd829d5364b627ad0bc65ad1fd07c8350b1bcca8f3e4)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))':
dependencies:
'@floating-ui/dom': 1.7.6
'@tiptap/core': 3.22.3(@tiptap/[email protected])
- '@tiptap/extension-collaboration': 3.22.3(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected](patch_hash=b32cf18328a5bb868dc3a8367dab8d77caad031c96235d79d5a2101f2516bbf9)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])
+ '@tiptap/extension-collaboration': 3.22.3(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])(@tiptap/[email protected](patch_hash=43915485b8dd39489356fd829d5364b627ad0bc65ad1fd07c8350b1bcca8f3e4)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])
'@tiptap/extension-node-range': 3.22.3(@tiptap/[email protected](@tiptap/[email protected]))(@tiptap/[email protected])
'@tiptap/pm': 3.22.4
- '@tiptap/y-tiptap': 3.0.3(patch_hash=b32cf18328a5bb868dc3a8367dab8d77caad031c96235d79d5a2101f2516bbf9)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
+ '@tiptap/y-tiptap': 3.0.3(patch_hash=43915485b8dd39489356fd829d5364b627ad0bc65ad1fd07c8350b1bcca8f3e4)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])
dependencies:
@@ -16078,7 +16078,7 @@ snapshots:
'@tiptap/core': 3.22.3(@tiptap/[email protected])
'@tiptap/pm': 3.22.4
- '@tiptap/[email protected](patch_hash=b32cf18328a5bb868dc3a8367dab8d77caad031c96235d79d5a2101f2516bbf9)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])':
+ '@tiptap/[email protected](patch_hash=43915485b8dd39489356fd829d5364b627ad0bc65ad1fd07c8350b1bcca8f3e4)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])':
dependencies:
lib0: 0.2.117
prosemirror-model: 1.25.4
@@ -23059,7 +23059,7 @@ snapshots:
lib0: 0.2.117
yjs: 13.6.31
- [email protected](patch_hash=df31dd90b326cc2cf5a69762eace45888ae10bb62f647c436c6f47492421eb6b)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]):
+ [email protected](patch_hash=b77fc38bdf246f08f73b6bc5d12ec24d29408b663f0a4224758d3f776ef124e7)([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]):
dependencies:
lib0: 0.2.117
prosemirror-model: 1.25.4