From 047827fd86fbd70224c00f4508133d783c9edec4 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 15 Sep 2026 19:18:49 +0200 Subject: [PATCH 1/2] 4.4: the real payloads --- AGENTS.md | 7 +- browser-tests/convert-corpus.js | 5 + browser-tests/run.js | 15 +- corpus/real-payloads/code-blocks.json | 173 +++++ corpus/real-payloads/inline-nodes.json | 254 +++++++ corpus/real-payloads/lists-and-blocks.json | 527 +++++++++++++++ corpus/real-payloads/media.json | 106 +++ corpus/real-payloads/panels-and-expands.json | 292 ++++++++ .../real-payloads/release-planning-notes.json | 630 ++++++++++++++++++ corpus/real-payloads/smart-links.json | 124 ++++ corpus/real-payloads/synced-block.json | 124 ++++ corpus/real-payloads/tables.json | 620 +++++++++++++++++ corpus/real-payloads/tasks-and-decisions.json | 195 ++++++ corpus/real-payloads/text-formatting.json | 288 ++++++++ src/corpus.test.ts | 19 +- 15 files changed, 3373 insertions(+), 6 deletions(-) create mode 100644 corpus/real-payloads/code-blocks.json create mode 100644 corpus/real-payloads/inline-nodes.json create mode 100644 corpus/real-payloads/lists-and-blocks.json create mode 100644 corpus/real-payloads/media.json create mode 100644 corpus/real-payloads/panels-and-expands.json create mode 100644 corpus/real-payloads/release-planning-notes.json create mode 100644 corpus/real-payloads/smart-links.json create mode 100644 corpus/real-payloads/synced-block.json create mode 100644 corpus/real-payloads/tables.json create mode 100644 corpus/real-payloads/tasks-and-decisions.json create mode 100644 corpus/real-payloads/text-formatting.json diff --git a/AGENTS.md b/AGENTS.md index 7228e9a..9786496 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -208,9 +208,10 @@ resolver maps them, under `NodeNext` alone; a `.d.ts` reader that is not `tsc` s `node-floor.js` round-trips the installed package under a Node pinned to `engines.node`'s floor. A fourth engine reads the build rather than the source: a headless Firefox loads `dist/index.js` -over HTTP and converts the round-trip, normalization and error fixtures — the `commonmark-spec` -sort is the Node suite's to check — which is §6's browser half and the only SpiderMonkey -there is — the gate's other three engines are two V8s and a JavaScriptCore that is not Safari's. +over HTTP and converts the round-trip, normalization and error fixtures and the real payloads — +the `commonmark-spec` sort is the Node suite's to check — which is §6's browser half and the only +SpiderMonkey there is — the gate's other three engines are two V8s and a JavaScriptCore that is +not Safari's. A WebDriver session is what carries a verdict back out, the driver and the page's server sharing one network namespace so each is the other's `127.0.0.1`; `--headless --screenshot` has no such channel, and loading `dist/index.js` in a globals-stripped realm buys one by not running a browser. diff --git a/browser-tests/convert-corpus.js b/browser-tests/convert-corpus.js index 0d44e36..28a6808 100644 --- a/browser-tests/convert-corpus.js +++ b/browser-tests/convert-corpus.js @@ -3,6 +3,11 @@ try { window.convertCorpus = (corpus) => ({ errors: corpus.errors.map(({ markdown, name }) => ({ name, parsed: markdownToAdf(markdown) })), normalization: corpus.normalization.map(({ markdown, name }) => ({ name, parsed: markdownToAdf(markdown) })), + realPayloads: corpus.realPayloads.map(({ json, name }) => { + const adf = JSON.parse(json) + const emitted = adfToMarkdown(adf) + return { emitted, isDocument: isAdfDocument(adf), name, parsed: emitted.ok ? markdownToAdf(emitted.value) : undefined } + }), roundTrip: corpus.roundTrip.map(({ json, markdown, name }) => { const adf = JSON.parse(json) return { emitted: adfToMarkdown(adf), isDocument: isAdfDocument(adf), name, parsed: markdownToAdf(markdown) } diff --git a/browser-tests/run.js b/browser-tests/run.js index 605cb18..3967467 100644 --- a/browser-tests/run.js +++ b/browser-tests/run.js @@ -67,6 +67,7 @@ async function whenDriverAnswers() { const corpus = { errors: fixtureNames('errors', '.md').map((name) => ({ markdown: fixture(name, '.md'), name })), normalization: fixtureNames('normalization', '.md').map((name) => ({ markdown: fixture(name, '.md'), name })), + realPayloads: fixtureNames('real-payloads', '.json').map((name) => ({ json: fixture(name, '.json'), name })), roundTrip: fixtureNames('round-trip', '.json').map((name) => ({ json: fixture(name, '.json'), markdown: fixture(name, '.md'), name })), } assert.deepEqual( @@ -75,7 +76,7 @@ assert.deepEqual( .map((entry) => entry.name) .filter((name) => name !== 'commonmark-spec') .sort(), - ['errors', 'normalization', 'round-trip'], + ['errors', 'normalization', 'real-payloads', 'round-trip'], 'a corpus kind the browser leg does not convert', ) for (const [kind, fixtures] of Object.entries(corpus)) assert.ok(fixtures.length > 0, `the browser leg found no ${kind} fixture to convert`) @@ -118,6 +119,16 @@ for (const [index, { name }] of corpus.normalization.entries()) { }) } +for (const [index, { json, name }] of corpus.realPayloads.entries()) { + const result = results.realPayloads[index] + checking(name, result, () => { + assert.ok(result.isDocument, `${name}.json is no ADF document`) + assert.ok(result.emitted.ok, `it did not emit — ${refusal(result.emitted)}`) + assert.ok(result.parsed.ok, `it did not parse back — ${refusal(result.parsed)}`) + assert.deepEqual(toEditorNormal(result.parsed.value), JSON.parse(json)) + }) +} + for (const [index, { name }] of corpus.errors.entries()) { const result = results.errors[index] checking(name, result, () => { @@ -127,5 +138,5 @@ for (const [index, { name }] of corpus.errors.entries()) { } console.log( - `Firefox ${session.capabilities.browserVersion} converted ${corpus.roundTrip.length} round-trip, ${corpus.normalization.length} normalization and ${corpus.errors.length} error fixtures`, + `Firefox ${session.capabilities.browserVersion} converted ${corpus.roundTrip.length} round-trip, ${corpus.normalization.length} normalization and ${corpus.errors.length} error fixtures and ${corpus.realPayloads.length} real payloads`, ) diff --git a/corpus/real-payloads/code-blocks.json b/corpus/real-payloads/code-blocks.json new file mode 100644 index 0000000..26e7263 --- /dev/null +++ b/corpus/real-payloads/code-blocks.json @@ -0,0 +1,173 @@ +{ + "content": [ + { + "attrs": { + "level": 2, + "localId": "0d42e7ff24ba" + }, + "content": [ + { + "text": "Code blocks", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "a971506228e7" + }, + "content": [ + { + "text": "Run the setup once, then start the server with ", + "type": "text" + }, + { + "marks": [ + { + "type": "code" + } + ], + "text": "npm start", + "type": "text" + }, + { + "text": " and open the page.", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "language": "javascript", + "localId": "eaf42046-6454-451d-ab13-8bd5ed2333bb", + "wrap": true + }, + "content": [ + { + "text": "function greet(name) {\n return `Hello, ${name}!`\n}", + "type": "text" + } + ], + "type": "codeBlock" + }, + { + "attrs": { + "localId": "d69616dee641" + }, + "content": [ + { + "text": "The same idea in Python:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "language": "python", + "localId": "2094b559-280a-49d5-9be3-182572e5d2d8", + "wrap": true + }, + "content": [ + { + "text": "def total(prices):\n return sum(prices)\n\nprint(total([3, 4.5]))", + "type": "text" + } + ], + "type": "codeBlock" + }, + { + "attrs": { + "localId": "abe1971d1f18" + }, + "content": [ + { + "text": "A query that lists visitors by city:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "language": "sql", + "localId": "5551dc8e-8fe0-455e-a9cf-22e48b589fe8", + "wrap": true + }, + "content": [ + { + "text": "SELECT name, city\nFROM visitors\nWHERE city = 'Lund'\nORDER BY name;", + "type": "text" + } + ], + "type": "codeBlock" + }, + { + "attrs": { + "localId": "51efdd2f1f02" + }, + "content": [ + { + "text": "Plain output, no language chosen:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "d0f83c92-c252-4a70-9e31-dfb5ac255cd1", + "wrap": true + }, + "content": [ + { + "text": "$ ./setup\nChecking folders... done\n 3 files copied", + "type": "text" + } + ], + "type": "codeBlock" + }, + { + "attrs": { + "localId": "3dac57e146fa" + }, + "content": [ + { + "text": "Keep ", + "type": "text" + }, + { + "marks": [ + { + "type": "code" + } + ], + "text": ".env", + "type": "text" + }, + { + "text": " files out of version control, and never paste a ", + "type": "text" + }, + { + "marks": [ + { + "type": "code" + } + ], + "text": "password", + "type": "text" + }, + { + "text": " into a ticket.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "doc", + "version": 1 +} diff --git a/corpus/real-payloads/inline-nodes.json b/corpus/real-payloads/inline-nodes.json new file mode 100644 index 0000000..69c03b1 --- /dev/null +++ b/corpus/real-payloads/inline-nodes.json @@ -0,0 +1,254 @@ +{ + "content": [ + { + "attrs": { + "level": 2, + "localId": "0fcbc98aec1f" + }, + "content": [ + { + "text": "Where things stand", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "32b6266eb05c" + }, + "content": [ + { + "text": "Office move ", + "type": "text" + }, + { + "attrs": { + "color": "blue", + "localId": "1ab19511-a0fa-41a1-b6d0-6729813c0526", + "style": "mixedCase", + "text": "In progress" + }, + "type": "status" + }, + { + "text": " since ", + "type": "text" + }, + { + "attrs": { + "localId": "493624162706", + "timestamp": "1790812800000" + }, + "type": "date" + }, + { + "text": " , owned by ", + "type": "text" + }, + { + "attrs": { + "accessLevel": "", + "id": "712020:78bf5058-bc76-4783-99af-6d70cb593cee", + "localId": "604060e1-e533-4019-aa28-21952dfdea19", + "text": "@Larvit Developer" + }, + "type": "mention" + }, + { + "text": " .", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "73a94328c89f" + }, + "content": [ + { + "text": "Furniture ", + "type": "text" + }, + { + "attrs": { + "color": "green", + "localId": "7b27ff33-1483-452b-8982-311cf9429023", + "style": "mixedCase", + "text": "Done" + }, + "type": "status" + }, + { + "text": " , cabling ", + "type": "text" + }, + { + "attrs": { + "color": "red", + "localId": "b6eb05a9-e0e7-4269-9cbd-e912640364a6", + "style": "mixedCase", + "text": "Blocked" + }, + "type": "status" + }, + { + "text": " , signage ", + "type": "text" + }, + { + "attrs": { + "color": "yellow", + "localId": "ff7ed7fb-1846-48cb-b5ea-8be6b598ccc6", + "style": "mixedCase", + "text": "Waiting" + }, + "type": "status" + }, + { + "text": " , parking ", + "type": "text" + }, + { + "attrs": { + "color": "purple", + "localId": "e9218ff4-6fcb-4e43-b36a-b1bef8a19376", + "style": "mixedCase", + "text": "Maybe" + }, + "type": "status" + }, + { + "text": " and keys ", + "type": "text" + }, + { + "attrs": { + "color": "neutral", + "localId": "f1455340-2469-4bc6-a371-ed6b1f54386c", + "style": "mixedCase", + "text": "Not started" + }, + "type": "status" + }, + { + "text": " ", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "8d9e2dc70265" + }, + "content": [ + { + "attrs": { + "accessLevel": "", + "id": "712020:78bf5058-bc76-4783-99af-6d70cb593cee", + "localId": "ab5b7997-43ce-4238-b540-db3864e0965c", + "text": "@Larvit Developer" + }, + "type": "mention" + }, + { + "text": " please confirm the handover on ", + "type": "text" + }, + { + "attrs": { + "localId": "77e2bdefa7fd", + "timestamp": "1795132800000" + }, + "type": "date" + }, + { + "text": " before lunch.", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "f7fb8a7527a3" + }, + "content": [ + { + "text": "Great work so far ", + "type": "text" + }, + { + "attrs": { + "id": "1f44d", + "localId": "8fe9a02e94ce", + "shortName": ":thumbsup:", + "text": "👍" + }, + "type": "emoji" + }, + { + "text": " and thanks for the snacks ", + "type": "text" + }, + { + "attrs": { + "id": "1f389", + "localId": "c19496cc742f", + "shortName": ":tada:", + "text": "🎉" + }, + "type": "emoji" + }, + { + "text": " ", + "type": "text" + }, + { + "attrs": { + "id": "1f600", + "localId": "c05a6757d0ee", + "shortName": ":grinning:", + "text": "😀" + }, + "type": "emoji" + }, + { + "text": " ", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "b75918031ebd" + }, + "content": [ + { + "text": "Deliveries go to:", + "type": "text" + }, + { + "type": "hardBreak" + }, + { + "text": "Building C, third floor", + "type": "text" + }, + { + "type": "hardBreak" + }, + { + "text": "Ring the bell twice", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "doc", + "version": 1 +} diff --git a/corpus/real-payloads/lists-and-blocks.json b/corpus/real-payloads/lists-and-blocks.json new file mode 100644 index 0000000..f69273c --- /dev/null +++ b/corpus/real-payloads/lists-and-blocks.json @@ -0,0 +1,527 @@ +{ + "content": [ + { + "attrs": { + "level": 1, + "localId": "cfdcc54363d9" + }, + "content": [ + { + "text": "Project handbook", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "91177a27b0ff" + }, + "content": [ + { + "text": "Welcome to the handbook for the spring project.", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "level": 2, + "localId": "7e7d9113a89b" + }, + "content": [ + { + "text": "Getting started", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "e65711ca96b6" + }, + "content": [ + { + "text": "Pack the following before the first day:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "b5c36c57fe79" + }, + "content": [ + { + "attrs": { + "localId": "1f4aa02de452" + }, + "content": [ + { + "attrs": { + "localId": "8993e22a13aa" + }, + "content": [ + { + "text": "Laptop", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "2b335a4504ab" + }, + "content": [ + { + "attrs": { + "localId": "c9180347caf0" + }, + "content": [ + { + "attrs": { + "localId": "60990e48da32" + }, + "content": [ + { + "text": "Charger", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + }, + { + "attrs": { + "localId": "fc5d4c8a875d" + }, + "content": [ + { + "attrs": { + "localId": "3b8ec5318463" + }, + "content": [ + { + "text": "Mouse", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + } + ], + "type": "bulletList" + } + ], + "type": "listItem" + }, + { + "attrs": { + "localId": "90f5f37a8a8f" + }, + "content": [ + { + "attrs": { + "localId": "90fab5a310c5" + }, + "content": [ + { + "text": "Notebook", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "46840b8bd24b", + "order": 1 + }, + "content": [ + { + "attrs": { + "localId": "b4f06fbd15ef" + }, + "content": [ + { + "attrs": { + "localId": "93db4583bdba" + }, + "content": [ + { + "text": "Lined for notes", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + }, + { + "attrs": { + "localId": "6904c80dd06d" + }, + "content": [ + { + "attrs": { + "localId": "0bc1c819d38d" + }, + "content": [ + { + "text": "Squared for sketches", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + } + ], + "type": "orderedList" + } + ], + "type": "listItem" + }, + { + "attrs": { + "localId": "65bd0afce26e" + }, + "content": [ + { + "attrs": { + "localId": "a753e5ecdad3" + }, + "content": [ + { + "text": "Water bottle", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + } + ], + "type": "bulletList" + }, + { + "attrs": { + "level": 3, + "localId": "5b6a671499c5" + }, + "content": [ + { + "text": "Unpacking", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "f460abd3a962" + }, + "content": [ + { + "text": "The first two steps happen at reception, so ours start at three:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "baf0046a0432", + "order": 3 + }, + "content": [ + { + "attrs": { + "localId": "b4df865a31a9" + }, + "content": [ + { + "attrs": { + "localId": "3f1b32f952d0" + }, + "content": [ + { + "text": "Unpack the boxes", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + }, + { + "attrs": { + "localId": "f64930d87d4e" + }, + "content": [ + { + "attrs": { + "localId": "d953389c865a" + }, + "content": [ + { + "text": "Label the shelves", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + }, + { + "attrs": { + "localId": "840daad9cb43" + }, + "content": [ + { + "attrs": { + "localId": "8708b8c7aeec" + }, + "content": [ + { + "text": "Recycle the cardboard", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + } + ], + "type": "orderedList" + }, + { + "attrs": { + "level": 4, + "localId": "27d1d408ae3e" + }, + "content": [ + { + "text": "Shelf labels", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "8b5cf239dbb5", + "order": 1 + }, + "content": [ + { + "attrs": { + "localId": "0948562abdc3" + }, + "content": [ + { + "attrs": { + "localId": "4da9d4f45923" + }, + "content": [ + { + "text": "Top shelf", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "36edf97d8e2c" + }, + "content": [ + { + "attrs": { + "localId": "7915e252429c" + }, + "content": [ + { + "attrs": { + "localId": "9b15cc9fa8a1" + }, + "content": [ + { + "text": "Binders", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + }, + { + "attrs": { + "localId": "efe607ab9e41" + }, + "content": [ + { + "attrs": { + "localId": "d559a2f29321" + }, + "content": [ + { + "text": "Archive boxes", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + } + ], + "type": "bulletList" + } + ], + "type": "listItem" + }, + { + "attrs": { + "localId": "229692097876" + }, + "content": [ + { + "attrs": { + "localId": "928b1862c273" + }, + "content": [ + { + "text": "Bottom shelf", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + } + ], + "type": "orderedList" + }, + { + "attrs": { + "level": 5, + "localId": "353a84ef9126" + }, + "content": [ + { + "text": "Quiet hours", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "9c11b949ed48" + }, + "content": [ + { + "attrs": { + "localId": "bd576489e8b6" + }, + "content": [ + { + "text": "Good tools make good work, and quiet rooms make good thinking.", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "727fda576a9d" + }, + "content": [ + { + "text": "Please keep calls in the booths.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "blockquote" + }, + { + "attrs": { + "level": 6, + "localId": "b12277440bc7" + }, + "content": [ + { + "text": "Small print", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "9f6fbb5a19af" + }, + "type": "rule" + }, + { + "attrs": { + "localId": "8a6e253c110e" + }, + "content": [ + { + "text": "Office hours:", + "type": "text" + }, + { + "type": "hardBreak" + }, + { + "text": "Monday to Thursday, eight to five", + "type": "text" + }, + { + "type": "hardBreak" + }, + { + "text": "Friday, eight to three", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "b9c3f5daa373" + }, + "content": [ + { + "text": "That is all for now.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "doc", + "version": 1 +} diff --git a/corpus/real-payloads/media.json b/corpus/real-payloads/media.json new file mode 100644 index 0000000..e4323c0 --- /dev/null +++ b/corpus/real-payloads/media.json @@ -0,0 +1,106 @@ +{ + "content": [ + { + "attrs": { + "level": 2, + "localId": "d5c3a2503683" + }, + "content": [ + { + "text": "Media and attachments", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "f71287760586" + }, + "content": [ + { + "text": "A photo of the meadow behind the office:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "layout": "align-start", + "localId": "95de25bcdecc", + "width": 320, + "widthType": "pixel" + }, + "content": [ + { + "attrs": { + "alt": "Green meadow under a yellow sun", + "collection": "", + "height": 180, + "id": "8c586460-fb0d-44f6-949f-d800d5dd0f45", + "localId": "630d0d0457b8", + "type": "file", + "width": 320 + }, + "marks": [ + { + "attrs": { + "color": "#091e4224", + "size": 2 + }, + "type": "border" + } + ], + "type": "media" + } + ], + "type": "mediaSingle" + }, + { + "attrs": { + "localId": "b4bfee3ad3ec" + }, + "type": "paragraph" + }, + { + "attrs": { + "localId": "ffe5710ea995" + }, + "content": [ + { + "text": "The packing list is attached as a file:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "content": [ + { + "attrs": { + "collection": "", + "id": "8dfd7046-2382-4377-b3ba-ec31e34cd01a", + "type": "file" + }, + "type": "media" + } + ], + "type": "mediaGroup" + }, + { + "attrs": { + "localId": "77fcb609f709" + }, + "content": [ + { + "text": "Both were uploaded from the editor.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "doc", + "version": 1 +} diff --git a/corpus/real-payloads/panels-and-expands.json b/corpus/real-payloads/panels-and-expands.json new file mode 100644 index 0000000..b5f2376 --- /dev/null +++ b/corpus/real-payloads/panels-and-expands.json @@ -0,0 +1,292 @@ +{ + "content": [ + { + "attrs": { + "level": 2, + "localId": "d483ec27f809" + }, + "content": [ + { + "text": "Panels", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "cb02f8e9812b" + }, + "content": [ + { + "text": "Each colour of panel below holds a short note for the visiting team.", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "b6d76c21e77e", + "panelType": "info" + }, + "content": [ + { + "attrs": { + "localId": "2d871d80f6e1" + }, + "content": [ + { + "text": "The workshop starts at nine in the morning.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "panel" + }, + { + "attrs": { + "localId": "cbaab515445c", + "panelType": "note" + }, + "content": [ + { + "attrs": { + "localId": "13cafc26c42d" + }, + "content": [ + { + "text": "Bring your own laptop charger.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "panel" + }, + { + "attrs": { + "localId": "c5fa8b34e2aa", + "panelType": "success" + }, + "content": [ + { + "attrs": { + "localId": "e186fca354d9" + }, + "content": [ + { + "text": "All rooms are booked for the week.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "panel" + }, + { + "attrs": { + "localId": "ee223a0f886e", + "panelType": "warning" + }, + "content": [ + { + "attrs": { + "localId": "e0006fb2b972" + }, + "content": [ + { + "text": "The east entrance closes early on Fridays.", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "ea6a56b9c863" + }, + "content": [ + { + "text": "Use the main door after four.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "panel" + }, + { + "attrs": { + "localId": "fedbadc6d1c7", + "panelType": "error" + }, + "content": [ + { + "attrs": { + "localId": "c0f6122d81b7" + }, + "content": [ + { + "text": "The projector in room two is out of order.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "panel" + }, + { + "attrs": { + "level": 2, + "localId": "afe638de11c5" + }, + "content": [ + { + "text": "Expands", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "e635bf2eac43", + "title": "Agenda for the first day" + }, + "content": [ + { + "attrs": { + "localId": "c8beb4c392ee" + }, + "content": [ + { + "attrs": { + "localId": "6d6ff472d878" + }, + "content": [ + { + "attrs": { + "localId": "d1186101c5a1" + }, + "content": [ + { + "text": "Welcome and introductions", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + }, + { + "attrs": { + "localId": "01d203b97343" + }, + "content": [ + { + "attrs": { + "localId": "61bfec91218d" + }, + "content": [ + { + "text": "Tour of the building", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + }, + { + "attrs": { + "localId": "004e47604c2a" + }, + "content": [ + { + "attrs": { + "localId": "726aa40e1e38" + }, + "content": [ + { + "text": "Lunch in the courtyard", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + } + ], + "type": "bulletList" + } + ], + "type": "expand" + }, + { + "attrs": { + "localId": "cb6e48b9d746" + }, + "content": [ + { + "text": "Questions go to the organisers before the event.", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "32a8832682b2", + "title": "Travel details" + }, + "content": [ + { + "attrs": { + "localId": "00b05814cccb" + }, + "content": [ + { + "text": "Trains leave the central station every twenty minutes.", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "eec0df0ed4f1", + "panelType": "note" + }, + "content": [ + { + "attrs": { + "localId": "712c49fa7ecc" + }, + "content": [ + { + "text": "Tickets are cheaper before seven.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "panel" + } + ], + "type": "expand" + } + ], + "type": "doc", + "version": 1 +} diff --git a/corpus/real-payloads/release-planning-notes.json b/corpus/real-payloads/release-planning-notes.json new file mode 100644 index 0000000..4ee69fc --- /dev/null +++ b/corpus/real-payloads/release-planning-notes.json @@ -0,0 +1,630 @@ +{ + "content": [ + { + "attrs": { + "localId": "3b911072ce78" + }, + "content": [ + { + "text": "Summary of the planning session on Thursday. Attendees: ", + "type": "text" + }, + { + "attrs": { + "accessLevel": "", + "id": "712020:78bf5058-bc76-4783-99af-6d70cb593cee", + "localId": "c8b64b9f-d396-4525-9456-38cf690ade1e", + "text": "@Larvit Developer" + }, + "type": "mention" + }, + { + "text": " and two guests from the design team.", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "level": 2, + "localId": "3e97ef36cbc3" + }, + "content": [ + { + "text": "Where we are", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "530e0e3aa621" + }, + "content": [ + { + "text": "The beta is ", + "type": "text" + }, + { + "attrs": { + "color": "green", + "localId": "ac0975eb-fafe-44ad-8293-8a12fdbcaebc", + "style": "mixedCase", + "text": "On track" + }, + "type": "status" + }, + { + "text": " and the public launch is set for ", + "type": "text" + }, + { + "attrs": { + "localId": "84d9a1cde860", + "timestamp": "1793664000000" + }, + "type": "date" + }, + { + "text": " .", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "ffcd53578640", + "panelType": "warning" + }, + "content": [ + { + "attrs": { + "localId": "0f0e8b9e13bb" + }, + "content": [ + { + "text": "Translation files are still ", + "type": "text" + }, + { + "marks": [ + { + "type": "strong" + } + ], + "text": "missing", + "type": "text" + }, + { + "text": " for two languages.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "panel" + }, + { + "attrs": { + "level": 2, + "localId": "d9b590d479ad" + }, + "content": [ + { + "text": "Decisions", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "69dc2d52-34f7-43bb-8d6c-36d52a47179e" + }, + "content": [ + { + "attrs": { + "localId": "852a35a7-f660-4161-85dd-2d54adaf662b", + "state": "DECIDED" + }, + "content": [ + { + "text": "Ship the beta to internal users first", + "type": "text" + } + ], + "type": "decisionItem" + }, + { + "attrs": { + "localId": "2df16457-331f-4d26-90ba-539f82949d70", + "state": "DECIDED" + }, + "content": [ + { + "text": "Keep the old export for one more release", + "type": "text" + } + ], + "type": "decisionItem" + } + ], + "type": "decisionList" + }, + { + "attrs": { + "level": 2, + "localId": "7813370b5e89" + }, + "content": [ + { + "text": "Next steps", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "21a7a33c-199d-4396-a148-c8404f70554f" + }, + "content": [ + { + "attrs": { + "localId": "5343dfdb-e70d-4ce6-bca5-8a382123c7bd", + "state": "TODO" + }, + "content": [ + { + "text": "Draft the release notes", + "type": "text" + } + ], + "type": "taskItem" + }, + { + "attrs": { + "localId": "67d65eb8-17e9-4cd6-93cb-7d495f84e01d", + "state": "TODO" + }, + "content": [ + { + "text": "Book the demo room", + "type": "text" + } + ], + "type": "taskItem" + } + ], + "type": "taskList" + }, + { + "attrs": { + "level": 2, + "localId": "e5806b037d61" + }, + "content": [ + { + "text": "Numbers", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "isNumberColumnEnabled": false, + "layout": "align-start", + "localId": "cbae6bea-3c35-42b9-9a8f-3b37749e1a87" + }, + "content": [ + { + "attrs": { + "localId": "e4d343447bf5" + }, + "content": [ + { + "attrs": { + "localId": "4fcec7ad0a0f" + }, + "content": [ + { + "attrs": { + "localId": "974849d6e63c" + }, + "content": [ + { + "marks": [ + { + "type": "strong" + } + ], + "text": "Metric", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableHeader" + }, + { + "attrs": { + "localId": "42df5203769e" + }, + "content": [ + { + "attrs": { + "localId": "8b0da0854a0a" + }, + "content": [ + { + "marks": [ + { + "type": "strong" + } + ], + "text": "Beta", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableHeader" + }, + { + "attrs": { + "localId": "cbdae6c8508d" + }, + "content": [ + { + "attrs": { + "localId": "2584f222d6c3" + }, + "content": [ + { + "marks": [ + { + "type": "strong" + } + ], + "text": "Goal", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableHeader" + } + ], + "type": "tableRow" + }, + { + "attrs": { + "localId": "65e4d7a700c0" + }, + "content": [ + { + "attrs": { + "localId": "a37175350eea" + }, + "content": [ + { + "attrs": { + "localId": "7efe32972497" + }, + "content": [ + { + "text": "Sign-ups", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + }, + { + "attrs": { + "localId": "e0a95cdbd3c5" + }, + "content": [ + { + "attrs": { + "localId": "4628a3afe71b" + }, + "content": [ + { + "text": "140", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + }, + { + "attrs": { + "localId": "b802fc652961" + }, + "content": [ + { + "attrs": { + "localId": "94c6ec93acb2" + }, + "content": [ + { + "text": "200", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + } + ], + "type": "tableRow" + }, + { + "attrs": { + "localId": "bd6465cc546d" + }, + "content": [ + { + "attrs": { + "localId": "b6dcef3c6ac5" + }, + "content": [ + { + "attrs": { + "localId": "ba5c99353d30" + }, + "content": [ + { + "text": "Crash reports", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + }, + { + "attrs": { + "localId": "554b7b5a8e71" + }, + "content": [ + { + "attrs": { + "localId": "569a134488bc" + }, + "content": [ + { + "text": "3", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + }, + { + "attrs": { + "localId": "fb03db2017b1" + }, + "content": [ + { + "attrs": { + "localId": "c0ce0ada482c" + }, + "content": [ + { + "text": "0", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + } + ], + "type": "tableRow" + } + ], + "type": "table" + }, + { + "attrs": { + "localId": "b4eb1362eb9f" + }, + "content": [ + { + "text": "The flag that turns the beta on:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "language": "yaml", + "localId": "14298a36-6632-458f-a548-7fccd4b7186b", + "wrap": true + }, + "content": [ + { + "text": "beta:\n enabled: true\n audience: internal", + "type": "text" + } + ], + "type": "codeBlock" + }, + { + "attrs": { + "localId": "a98274e22eaa" + }, + "content": [ + { + "text": "Risks we talked about:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "fb3e387688ff" + }, + "content": [ + { + "attrs": { + "localId": "fdeee4ce0678" + }, + "content": [ + { + "attrs": { + "localId": "5ff2e05f1c7e" + }, + "content": [ + { + "text": "Late translations", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + }, + { + "attrs": { + "localId": "043a7ded718e" + }, + "content": [ + { + "attrs": { + "localId": "73a4d8e4ef0d" + }, + "content": [ + { + "text": "The holiday week", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "3e32c1b868a1" + }, + "content": [ + { + "attrs": { + "localId": "98969cd5548e" + }, + "content": [ + { + "attrs": { + "localId": "3b9989413325" + }, + "content": [ + { + "text": "Half the team is away", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + } + ], + "type": "bulletList" + } + ], + "type": "listItem" + } + ], + "type": "bulletList" + }, + { + "attrs": { + "localId": "ba7d8422f4c6" + }, + "content": [ + { + "attrs": { + "localId": "a6837cfad3f5" + }, + "content": [ + { + "text": "Small steps, shipped often.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "blockquote" + }, + { + "attrs": { + "localId": "6ec9ef8df224" + }, + "content": [ + { + "text": "Thanks, everyone ", + "type": "text" + }, + { + "attrs": { + "id": "1f389", + "localId": "2481c60576e0", + "shortName": ":tada:", + "text": "🎉" + }, + "type": "emoji" + }, + { + "text": " ", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "782129bf30c1", + "title": "Raw notes" + }, + "content": [ + { + "attrs": { + "localId": "e9614e389875" + }, + "content": [ + { + "text": "We spent twenty minutes on the colour of the launch banner.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "expand" + } + ], + "type": "doc", + "version": 1 +} diff --git a/corpus/real-payloads/smart-links.json b/corpus/real-payloads/smart-links.json new file mode 100644 index 0000000..64a4394 --- /dev/null +++ b/corpus/real-payloads/smart-links.json @@ -0,0 +1,124 @@ +{ + "content": [ + { + "attrs": { + "level": 2, + "localId": "e632994a13ae" + }, + "content": [ + { + "text": "Smart links", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "dcfa975dde87" + }, + "content": [ + { + "text": "An inline card sits in a sentence, like ", + "type": "text" + }, + { + "attrs": { + "localId": "042b9a548674", + "url": "https://en.wikipedia.org/wiki/Markdown" + }, + "type": "inlineCard" + }, + { + "text": " which keeps the text flowing.", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "c138d931a131" + }, + "content": [ + { + "text": "A block card stands on its own line:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "9e527ae5f2bd" + }, + "type": "paragraph" + }, + { + "attrs": { + "localId": "88bd10974ec6", + "url": "https://spec.commonmark.org/" + }, + "type": "blockCard" + }, + { + "attrs": { + "localId": "9879bb1368ea" + }, + "content": [ + { + "text": " An embed shows the page itself, where the site allows it:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "ccbed18139bb" + }, + "type": "paragraph" + }, + { + "attrs": { + "layout": "wide", + "localId": "8320cf243168", + "originalHeight": 480, + "originalWidth": 853.344, + "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw", + "width": 100 + }, + "type": "embedCard" + }, + { + "attrs": { + "localId": "22f60b236c1c" + }, + "content": [ + { + "text": " And a plain address stays a link: ", + "type": "text" + }, + { + "marks": [ + { + "attrs": { + "href": "https://www.markdownguide.org/" + }, + "type": "link" + } + ], + "text": "https://www.markdownguide.org/", + "type": "text" + }, + { + "text": " for reference.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "doc", + "version": 1 +} diff --git a/corpus/real-payloads/synced-block.json b/corpus/real-payloads/synced-block.json new file mode 100644 index 0000000..7537f91 --- /dev/null +++ b/corpus/real-payloads/synced-block.json @@ -0,0 +1,124 @@ +{ + "content": [ + { + "attrs": { + "level": 2, + "localId": "3265660b5792" + }, + "content": [ + { + "text": "Shared checklist", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "c7d94ae59a47" + }, + "content": [ + { + "text": "The block below is synced, so an edit shows up wherever it is used.", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "72651b28-757c-44a1-be0b-586c3e6df546", + "resourceId": "03a667ab-4c6b-402d-adae-0c55582e32eb" + }, + "content": [ + { + "attrs": { + "localId": "0eb44ec3924b" + }, + "content": [ + { + "text": "Before every release:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "4beeefa0c6fa" + }, + "content": [ + { + "attrs": { + "localId": "07d19212447f" + }, + "content": [ + { + "attrs": { + "localId": "2fd9fc0e5d71" + }, + "content": [ + { + "text": "Run the tests", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + }, + { + "attrs": { + "localId": "7f5f50f7642c" + }, + "content": [ + { + "attrs": { + "localId": "14d3435ce5f4" + }, + "content": [ + { + "text": "Update the changelog", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + } + ], + "type": "bulletList" + }, + { + "attrs": { + "localId": "e405ebea5e00" + }, + "content": [ + { + "text": "Ask for a second pair of eyes.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "bodiedSyncBlock" + }, + { + "attrs": { + "localId": "73b5f0a1ef05" + }, + "content": [ + { + "text": "Anything specific to this release goes below the synced block.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "doc", + "version": 1 +} diff --git a/corpus/real-payloads/tables.json b/corpus/real-payloads/tables.json new file mode 100644 index 0000000..8e694f4 --- /dev/null +++ b/corpus/real-payloads/tables.json @@ -0,0 +1,620 @@ +{ + "content": [ + { + "attrs": { + "level": 2, + "localId": "a0c750451c14" + }, + "content": [ + { + "text": "A simple table", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "944306a6da33" + }, + "content": [ + { + "text": "Rooms for the week:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "isNumberColumnEnabled": false, + "layout": "align-start", + "localId": "92b28760-e51b-436d-82f0-45c6b6bf5b60" + }, + "content": [ + { + "attrs": { + "localId": "d53d5ad740cb" + }, + "content": [ + { + "attrs": { + "localId": "a8c82e01543e" + }, + "content": [ + { + "attrs": { + "localId": "00c1bde1a44d" + }, + "content": [ + { + "marks": [ + { + "type": "strong" + } + ], + "text": "Room", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableHeader" + }, + { + "attrs": { + "localId": "c736c185bcd0" + }, + "content": [ + { + "attrs": { + "localId": "3dc846d8aaf9" + }, + "content": [ + { + "marks": [ + { + "type": "strong" + } + ], + "text": "Capacity", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableHeader" + }, + { + "attrs": { + "localId": "b484834a890d" + }, + "content": [ + { + "attrs": { + "localId": "5b0671aadeed" + }, + "content": [ + { + "marks": [ + { + "type": "strong" + } + ], + "text": "Notes", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableHeader" + } + ], + "type": "tableRow" + }, + { + "attrs": { + "localId": "45395ea36f04" + }, + "content": [ + { + "attrs": { + "localId": "8b19b08b6a93" + }, + "content": [ + { + "attrs": { + "localId": "363cf87d44be" + }, + "content": [ + { + "text": "North", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + }, + { + "attrs": { + "localId": "e189034484f3" + }, + "content": [ + { + "attrs": { + "localId": "42a5bad514ea" + }, + "content": [ + { + "text": "12", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + }, + { + "attrs": { + "localId": "9cfc78f9a553" + }, + "content": [ + { + "attrs": { + "localId": "2ae747c00211" + }, + "content": [ + { + "text": "Projector", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + } + ], + "type": "tableRow" + }, + { + "attrs": { + "localId": "8bc7abba3229" + }, + "content": [ + { + "attrs": { + "localId": "0e7980a31697" + }, + "content": [ + { + "attrs": { + "localId": "a001411b475e" + }, + "content": [ + { + "text": "South", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + }, + { + "attrs": { + "localId": "e61493f2b3d9" + }, + "content": [ + { + "attrs": { + "localId": "79c522faf7e8" + }, + "content": [ + { + "text": "8", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + }, + { + "attrs": { + "localId": "db911772081a" + }, + "content": [ + { + "attrs": { + "localId": "6721e0a4f29f" + }, + "content": [ + { + "text": "Quiet corner", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + } + ], + "type": "tableRow" + } + ], + "type": "table" + }, + { + "attrs": { + "level": 2, + "localId": "c21221cbaeda" + }, + "content": [ + { + "text": "A richer table", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "b9cdc4e693ca" + }, + "content": [ + { + "text": "Budget by season, with merged, coloured and resized cells:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "isNumberColumnEnabled": false, + "layout": "align-start", + "localId": "ac1b1f4b-3d7a-4cd2-a0a7-05ece633ba69" + }, + "content": [ + { + "attrs": { + "localId": "c411338ed251" + }, + "content": [ + { + "attrs": { + "background": "#b3d4ff", + "colwidth": [ + 135 + ], + "localId": "798f1dea331f" + }, + "content": [ + { + "attrs": { + "localId": "b605b3c1f598" + }, + "content": [ + { + "marks": [ + { + "type": "strong" + } + ], + "text": "Item", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableHeader" + }, + { + "attrs": { + "colwidth": [ + 233 + ], + "localId": "db4768c076d4" + }, + "content": [ + { + "attrs": { + "localId": "b4890b2d833e" + }, + "content": [ + { + "marks": [ + { + "type": "strong" + } + ], + "text": "Spring", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableHeader" + }, + { + "attrs": { + "colwidth": [ + 184 + ], + "localId": "4dde2fbfb921" + }, + "content": [ + { + "attrs": { + "localId": "7986b41ed947" + }, + "content": [ + { + "marks": [ + { + "type": "strong" + } + ], + "text": "Autumn", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableHeader" + } + ], + "type": "tableRow" + }, + { + "attrs": { + "localId": "b4ac97bec992" + }, + "content": [ + { + "attrs": { + "colwidth": [ + 135 + ], + "localId": "ba92b57558d8" + }, + "content": [ + { + "attrs": { + "localId": "f23f030e9233" + }, + "content": [ + { + "text": "Venue", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableHeader" + }, + { + "attrs": { + "background": "#abf5d1", + "colspan": 2, + "colwidth": [ + 233, + 184 + ], + "localId": "51af31d44baa" + }, + "content": [ + { + "attrs": { + "localId": "ba55f45dc035" + }, + "content": [ + { + "text": "Booked for both", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + } + ], + "type": "tableRow" + }, + { + "attrs": { + "localId": "e911af70b656" + }, + "content": [ + { + "attrs": { + "colwidth": [ + 135 + ], + "localId": "50a820456456" + }, + "content": [ + { + "attrs": { + "localId": "b04d0749aee7" + }, + "content": [ + { + "text": "Catering", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableHeader" + }, + { + "attrs": { + "colwidth": [ + 233 + ], + "localId": "d0cc276de239" + }, + "content": [ + { + "attrs": { + "localId": "90211ae7a504" + }, + "content": [ + { + "text": "400", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + }, + { + "attrs": { + "colwidth": [ + 184 + ], + "localId": "1962d05e8763" + }, + "content": [ + { + "attrs": { + "localId": "221cf059e38d" + }, + "content": [ + { + "text": "450", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + } + ], + "type": "tableRow" + }, + { + "attrs": { + "localId": "2c8a06942ac4" + }, + "content": [ + { + "attrs": { + "colwidth": [ + 135 + ], + "localId": "ba4e1cb93e92" + }, + "content": [ + { + "attrs": { + "localId": "e6bb346c5fd4" + }, + "content": [ + { + "text": "Notes", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableHeader" + }, + { + "attrs": { + "colwidth": [ + 233 + ], + "localId": "d7a1dec97b03" + }, + "content": [ + { + "attrs": { + "localId": "5cbd8813deab" + }, + "content": [ + { + "text": "Spring is confirmed.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "tableCell" + }, + { + "attrs": { + "colwidth": [ + 184 + ], + "localId": "85f9a8dab00b" + }, + "content": [ + { + "attrs": { + "localId": "da90346e9a26", + "title": "Payment terms" + }, + "content": [ + { + "attrs": { + "localId": "ef6c6f374bca" + }, + "content": [ + { + "text": "Invoices arrive monthly.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "nestedExpand" + } + ], + "type": "tableCell" + } + ], + "type": "tableRow" + } + ], + "type": "table" + }, + { + "attrs": { + "localId": "10d03e65eff2" + }, + "content": [ + { + "text": "Figures are estimates.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "doc", + "version": 1 +} diff --git a/corpus/real-payloads/tasks-and-decisions.json b/corpus/real-payloads/tasks-and-decisions.json new file mode 100644 index 0000000..d1860ff --- /dev/null +++ b/corpus/real-payloads/tasks-and-decisions.json @@ -0,0 +1,195 @@ +{ + "content": [ + { + "attrs": { + "level": 2, + "localId": "26d50a5240c3" + }, + "content": [ + { + "text": "Action items", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "f8b236b2-3b7c-412a-a0df-6c523af43a76" + }, + "content": [ + { + "attrs": { + "localId": "eebe3cb9-5773-4753-b6a3-5a5df104b6e8", + "state": "DONE" + }, + "content": [ + { + "text": "Book the meeting room", + "type": "text" + } + ], + "type": "taskItem" + }, + { + "attrs": { + "localId": "2263a39a-c49c-4711-8f00-cca6e8f3ea35", + "state": "TODO" + }, + "content": [ + { + "text": "Order name badges", + "type": "text" + } + ], + "type": "taskItem" + }, + { + "attrs": { + "localId": "e323e762-8880-43c0-945d-17a7341fdefb" + }, + "content": [ + { + "attrs": { + "localId": "55523903-9f79-4711-b276-ec1bc98be977", + "state": "DONE" + }, + "content": [ + { + "text": "Print a spare set for the front desk", + "type": "text" + } + ], + "type": "taskItem" + } + ], + "type": "taskList" + }, + { + "attrs": { + "localId": "680d665a-a859-4345-b032-d5a46fd6db0d", + "state": "TODO" + }, + "content": [ + { + "text": "Send the agenda to everyone", + "type": "text" + } + ], + "type": "taskItem" + }, + { + "attrs": { + "localId": "48d45b93-2180-4b80-b0ed-f9eb458ed1ed", + "state": "TODO" + }, + "content": [ + { + "text": "Ask ", + "type": "text" + }, + { + "attrs": { + "accessLevel": "", + "id": "712020:78bf5058-bc76-4783-99af-6d70cb593cee", + "localId": "09321e9b-b551-48ee-8868-5339e8b86863", + "text": "@Larvit Developer" + }, + "type": "mention" + }, + { + "text": " about parking by ", + "type": "text" + }, + { + "attrs": { + "localId": "16c6b2a1718e", + "timestamp": "1792022400000" + }, + "type": "date" + }, + { + "text": " ", + "type": "text" + } + ], + "type": "taskItem" + } + ], + "type": "taskList" + }, + { + "attrs": { + "localId": "90a7d38e3ed7" + }, + "type": "paragraph" + }, + { + "attrs": { + "localId": "8c510497da2e" + }, + "type": "paragraph" + }, + { + "attrs": { + "level": 2, + "localId": "3b52fc685167" + }, + "content": [ + { + "text": "Decisions", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "82dbc28b-49c8-428c-8c21-65cc000ef7c5" + }, + "content": [ + { + "attrs": { + "localId": "2f7a7680-2c41-4b45-9162-29d97f922a7b", + "state": "DECIDED" + }, + "content": [ + { + "text": "Hold the kickoff on the second floor", + "type": "text" + } + ], + "type": "decisionItem" + }, + { + "attrs": { + "localId": "c94ef59b-6db4-4ddc-8d22-576821020306", + "state": "DECIDED" + }, + "content": [ + { + "text": "Keep the budget under the agreed limit", + "type": "text" + } + ], + "type": "decisionItem" + } + ], + "type": "decisionList" + }, + { + "attrs": { + "localId": "562121f961a8" + }, + "content": [ + { + "text": "Done items are ticked; the rest are still open.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "doc", + "version": 1 +} diff --git a/corpus/real-payloads/text-formatting.json b/corpus/real-payloads/text-formatting.json new file mode 100644 index 0000000..147416a --- /dev/null +++ b/corpus/real-payloads/text-formatting.json @@ -0,0 +1,288 @@ +{ + "content": [ + { + "attrs": { + "level": 2, + "localId": "ef39f25be439" + }, + "content": [ + { + "text": "Text formatting", + "type": "text" + } + ], + "type": "heading" + }, + { + "attrs": { + "localId": "4a24d2441f4b" + }, + "content": [ + { + "text": "This sentence has ", + "type": "text" + }, + { + "marks": [ + { + "type": "strong" + } + ], + "text": "bold", + "type": "text" + }, + { + "text": ", ", + "type": "text" + }, + { + "marks": [ + { + "type": "em" + } + ], + "text": "italic", + "type": "text" + }, + { + "text": ", ", + "type": "text" + }, + { + "marks": [ + { + "type": "underline" + } + ], + "text": "underlined", + "type": "text" + }, + { + "text": ", ", + "type": "text" + }, + { + "marks": [ + { + "type": "strike" + } + ], + "text": "struck", + "type": "text" + }, + { + "text": " and ", + "type": "text" + }, + { + "marks": [ + { + "type": "code" + } + ], + "text": "inline code", + "type": "text" + }, + { + "text": " words in it.", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "707e9aa736b2" + }, + "content": [ + { + "text": "Water is H", + "type": "text" + }, + { + "marks": [ + { + "attrs": { + "type": "sub" + }, + "type": "subsup" + } + ], + "text": "2", + "type": "text" + }, + { + "text": "O and the room measures 20 m", + "type": "text" + }, + { + "marks": [ + { + "attrs": { + "type": "sup" + }, + "type": "subsup" + } + ], + "text": "2", + "type": "text" + }, + { + "text": ".", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "a03bd1fe3442" + }, + "content": [ + { + "text": "Some words are ", + "type": "text" + }, + { + "marks": [ + { + "attrs": { + "color": "#ff5630" + }, + "type": "textColor" + } + ], + "text": "red", + "type": "text" + }, + { + "text": ", some are ", + "type": "text" + }, + { + "marks": [ + { + "attrs": { + "color": "#0747a6" + }, + "type": "textColor" + } + ], + "text": "bold blue", + "type": "text" + }, + { + "text": ", and one is ", + "type": "text" + }, + { + "marks": [ + { + "attrs": { + "color": "#f8e6a0" + }, + "type": "backgroundColor" + } + ], + "text": "highlighted", + "type": "text" + }, + { + "text": ".", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "f3a744347f56" + }, + "content": [ + { + "text": "A ", + "type": "text" + }, + { + "marks": [ + { + "type": "em" + }, + { + "type": "strong" + } + ], + "text": "bold italic", + "type": "text" + }, + { + "text": " phrase, and a ", + "type": "text" + }, + { + "marks": [ + { + "type": "strike" + }, + { + "type": "underline" + } + ], + "text": "struck underlined", + "type": "text" + }, + { + "text": " one.", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "643a019d97c1" + }, + "content": [ + { + "text": "Read the ", + "type": "text" + }, + { + "marks": [ + { + "attrs": { + "href": "https://spec.commonmark.org/0.31.2/" + }, + "type": "link" + } + ], + "text": "CommonMark spec", + "type": "text" + }, + { + "text": " or the ", + "type": "text" + }, + { + "marks": [ + { + "attrs": { + "href": "https://www.markdownguide.org/basic-syntax/" + }, + "type": "link" + } + ], + "text": "basic syntax guide", + "type": "text" + }, + { + "text": " before you edit.", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "doc", + "version": 1 +} diff --git a/src/corpus.test.ts b/src/corpus.test.ts index 33d752d..a23c4f7 100644 --- a/src/corpus.test.ts +++ b/src/corpus.test.ts @@ -14,6 +14,7 @@ import { toEditorNormal } from './adf/editor-normal.ts' const corpusRoot = join(dirname(fileURLToPath(import.meta.url)), '..', 'corpus') const errorsRoot = join(corpusRoot, 'errors') const normalizationRoot = join(corpusRoot, 'normalization') +const realPayloadsRoot = join(corpusRoot, 'real-payloads') const roundTripRoot = join(corpusRoot, 'round-trip') const roundTripDirectories = ['block-nodes', 'combinations', 'commonmark-subset', 'inline-nodes', 'opaque-carry'] @@ -60,7 +61,7 @@ function corpusJsonPaths(): string[] { } test('every corpus directory is a kind the runner reads', () => { - assert.deepEqual(directoryNames(corpusRoot), ['commonmark-spec', 'errors', 'normalization', 'round-trip']) + assert.deepEqual(directoryNames(corpusRoot), ['commonmark-spec', 'errors', 'normalization', 'real-payloads', 'round-trip']) }) test('every round-trip directory is a kind the runner reads', () => { @@ -182,6 +183,22 @@ for (const name of pairedNames(normalizationRoot, '.md', '.json')) { }) } +test('real-payloads holds payloads', () => { + assert.ok(names(realPayloadsRoot, '.json').length > 0) +}) + +for (const name of names(realPayloadsRoot, '.json')) { + test(`real-payloads/${name} emits markdown that reads back to it`, () => { + const payload: unknown = JSON.parse(readFileSync(join(realPayloadsRoot, `${name}.json`), 'utf8')) + assert.ok(isAdfDocument(payload), `${name}.json is not an ADF document`) + const emitted = adfToMarkdown(payload) + assert.ok(emitted.ok, emitted.ok ? '' : `${emitted.error.code}: ${emitted.error.message}`) + const parsed = markdownToAdf(emitted.value) + assert.ok(parsed.ok, parsed.ok ? '' : `${parsed.error.code}: ${parsed.error.message}`) + assert.deepEqual(toEditorNormal(parsed.value), payload) + }) +} + // The position the input itself gives an offset, recomputed rather than trusted from the parser. function lineStarting(markdown: string, offset: number): { line: number; offset: number } | undefined { const before = markdown.slice(0, offset) -- 2.52.0 From 2901a28fcb4ed82745222011d4c345cef361c9ae Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 15 Sep 2026 19:21:53 +0200 Subject: [PATCH 2/2] 4.4: a review comment as a real payload --- corpus/real-payloads/review-comment.json | 118 +++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 corpus/real-payloads/review-comment.json diff --git a/corpus/real-payloads/review-comment.json b/corpus/real-payloads/review-comment.json new file mode 100644 index 0000000..92d933d --- /dev/null +++ b/corpus/real-payloads/review-comment.json @@ -0,0 +1,118 @@ +{ + "content": [ + { + "attrs": { + "localId": "3e9517d02129" + }, + "content": [ + { + "text": "Looks good to me. Two small things:", + "type": "text" + } + ], + "type": "paragraph" + }, + { + "attrs": { + "localId": "5738867bf15d", + "order": 1 + }, + "content": [ + { + "attrs": { + "localId": "ccd8d283e36d" + }, + "content": [ + { + "attrs": { + "localId": "638111edfab4" + }, + "content": [ + { + "text": "Rename ", + "type": "text" + }, + { + "marks": [ + { + "type": "code" + } + ], + "text": "beta.enabled", + "type": "text" + }, + { + "text": " before the launch", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + }, + { + "attrs": { + "localId": "0adfb25bb321" + }, + "content": [ + { + "attrs": { + "localId": "980750fad0fe" + }, + "content": [ + { + "text": "Move the demo to the ", + "type": "text" + }, + { + "marks": [ + { + "type": "em" + } + ], + "text": "large", + "type": "text" + }, + { + "text": " room", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "listItem" + } + ], + "type": "orderedList" + }, + { + "attrs": { + "localId": "40e080c7acd4" + }, + "content": [ + { + "text": "Thanks ", + "type": "text" + }, + { + "attrs": { + "accessLevel": "", + "id": "712020:78bf5058-bc76-4783-99af-6d70cb593cee", + "localId": "c4e073cd-8b3a-48b2-93a0-ade57b4ec2cf", + "text": "@Larvit Developer" + }, + "type": "mention" + }, + { + "text": " !", + "type": "text" + } + ], + "type": "paragraph" + } + ], + "type": "doc", + "version": 1 +} -- 2.52.0