@cube-drone/marquee-react-renderer 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/render.js +19 -0
- package/package.json +7 -7
- package/src/render.ts +19 -0
package/dist/render.js
CHANGED
|
@@ -312,6 +312,25 @@ function directive(node, ctx, key) {
|
|
|
312
312
|
case "spoiler":
|
|
313
313
|
// Block spoiler: same click-to-reveal as the inline one, on a div.
|
|
314
314
|
return h(Spoiler, nodeProps(node, ctx, { key, tag: "div", className: "mq-spoiler mq-spoiler-block" }), ...kids);
|
|
315
|
+
case "conflict":
|
|
316
|
+
// A read-time merge conflict, synthesized by the embedder. Mirrors the
|
|
317
|
+
// static renderer's mq-conflict/mq-variant contract.
|
|
318
|
+
return h("div", nodeProps(node, ctx, { key, className: "mq-conflict" }), ...kids);
|
|
319
|
+
case "variant": {
|
|
320
|
+
const head = [];
|
|
321
|
+
if (attrs["label"] !== undefined) {
|
|
322
|
+
head.push(h("span", { key: "l", className: "mq-variant-label" }, attrs["label"]));
|
|
323
|
+
}
|
|
324
|
+
if (attrs["when"] !== undefined) {
|
|
325
|
+
if (head.length > 0) {
|
|
326
|
+
head.push(" ");
|
|
327
|
+
}
|
|
328
|
+
head.push(h("span", { key: "w", className: "mq-variant-when" }, attrs["when"]));
|
|
329
|
+
}
|
|
330
|
+
const cls = attrs["role"] === "base" ? "mq-variant mq-variant-base" : "mq-variant";
|
|
331
|
+
const headEl = head.length === 0 ? null : h("div", { className: "mq-variant-head" }, ...head);
|
|
332
|
+
return h("div", nodeProps(node, ctx, { key, className: cls }), headEl, ...kids);
|
|
333
|
+
}
|
|
315
334
|
}
|
|
316
335
|
// Unknown vocabulary: a container renders its children with an affordance;
|
|
317
336
|
// a leaf renders the inert placeholder. Never eat authored content.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cube-drone/marquee-react-renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Interactive React renderer for the Marquee markup language: the JS halves of the animation contract (start-on-visible, tap-to-skip) plus source-position scroll sync for side-by-side editors",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"demo": "node --conditions=marquee-src scripts/demo.ts"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@cube-drone/marquee-html-renderer": "^0.
|
|
38
|
-
"@cube-drone/marquee-parser": "^0.
|
|
37
|
+
"@cube-drone/marquee-html-renderer": "^0.6.0",
|
|
38
|
+
"@cube-drone/marquee-parser": "^0.6.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": ">=18"
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"react": "^19.0.0",
|
|
49
49
|
"react-dom": "^19.0.0",
|
|
50
50
|
"typescript": "^5.9.0",
|
|
51
|
-
"@cube-drone/marquee-css": "^0.
|
|
52
|
-
"@cube-drone/marquee-fonts": "^0.
|
|
53
|
-
"@cube-drone/marquee-emoji": "^0.
|
|
54
|
-
"@cube-drone/marquee-turbolink": "^0.
|
|
51
|
+
"@cube-drone/marquee-css": "^0.6.0",
|
|
52
|
+
"@cube-drone/marquee-fonts": "^0.6.0",
|
|
53
|
+
"@cube-drone/marquee-emoji": "^0.6.0",
|
|
54
|
+
"@cube-drone/marquee-turbolink": "^0.6.0"
|
|
55
55
|
}
|
|
56
56
|
}
|
package/src/render.ts
CHANGED
|
@@ -424,6 +424,25 @@ function directive(node: Node & { type: "directive" }, ctx: Ctx, key: string): R
|
|
|
424
424
|
nodeProps(node, ctx, { key, tag: "div", className: "mq-spoiler mq-spoiler-block" }),
|
|
425
425
|
...kids,
|
|
426
426
|
);
|
|
427
|
+
case "conflict":
|
|
428
|
+
// A read-time merge conflict, synthesized by the embedder. Mirrors the
|
|
429
|
+
// static renderer's mq-conflict/mq-variant contract.
|
|
430
|
+
return h("div", nodeProps(node, ctx, { key, className: "mq-conflict" }), ...kids);
|
|
431
|
+
case "variant": {
|
|
432
|
+
const head: ReactNode[] = [];
|
|
433
|
+
if (attrs["label"] !== undefined) {
|
|
434
|
+
head.push(h("span", { key: "l", className: "mq-variant-label" }, attrs["label"]));
|
|
435
|
+
}
|
|
436
|
+
if (attrs["when"] !== undefined) {
|
|
437
|
+
if (head.length > 0) {
|
|
438
|
+
head.push(" ");
|
|
439
|
+
}
|
|
440
|
+
head.push(h("span", { key: "w", className: "mq-variant-when" }, attrs["when"]));
|
|
441
|
+
}
|
|
442
|
+
const cls = attrs["role"] === "base" ? "mq-variant mq-variant-base" : "mq-variant";
|
|
443
|
+
const headEl = head.length === 0 ? null : h("div", { className: "mq-variant-head" }, ...head);
|
|
444
|
+
return h("div", nodeProps(node, ctx, { key, className: cls }), headEl, ...kids);
|
|
445
|
+
}
|
|
427
446
|
}
|
|
428
447
|
// Unknown vocabulary: a container renders its children with an affordance;
|
|
429
448
|
// a leaf renders the inert placeholder. Never eat authored content.
|