@haklex/rich-litexml-cli 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.mjs +44 -0
  2. package/package.json +4 -4
package/dist/cli.mjs CHANGED
@@ -10992,6 +10992,15 @@ var GalleryNode = headlessDecorator("gallery", ["images", "layout"], {
10992
10992
  layout: "grid"
10993
10993
  });
10994
10994
  var ExcalidrawNode = headlessDecorator("excalidraw", ["snapshot"], { snapshot: "" });
10995
+ var DynamicNode = headlessDecorator("dynamic", [
10996
+ "url",
10997
+ "props",
10998
+ "initialHeight"
10999
+ ], {
11000
+ url: "",
11001
+ props: {},
11002
+ initialHeight: 320
11003
+ });
10995
11004
  var TagNode = headlessDecorator("tag", ["text"], { text: "" }, true);
10996
11005
  var CommentNode = headlessDecorator("comment", ["text"], { text: "" }, true);
10997
11006
  var PollNode = headlessDecorator("poll", [
@@ -11037,6 +11046,7 @@ var customHeadlessNodes = [
11037
11046
  CodeSnippetNode,
11038
11047
  GalleryNode,
11039
11048
  ExcalidrawNode,
11049
+ DynamicNode,
11040
11050
  TagNode,
11041
11051
  CommentNode,
11042
11052
  class BannerNode extends yo {
@@ -22583,6 +22593,22 @@ function registerCustomReaders(registry) {
22583
22593
  snapshot: extractCdataText(el) || el.getAttribute("snapshot") || el.textContent?.trim() || "",
22584
22594
  version: 1
22585
22595
  }));
22596
+ registry.registerReader("dynamic", (el) => {
22597
+ let props = {};
22598
+ const raw = (extractCdataText(el) ?? el.textContent ?? "").trim();
22599
+ if (raw) try {
22600
+ const parsed = JSON.parse(raw);
22601
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) props = parsed;
22602
+ } catch {}
22603
+ return {
22604
+ type: "dynamic",
22605
+ ...extractBlockId(el),
22606
+ url: el.getAttribute("url") ?? "",
22607
+ props,
22608
+ initialHeight: numAttr(el, "initial-height") ?? 320,
22609
+ version: 1
22610
+ };
22611
+ });
22586
22612
  registry.registerReader("grid", (el, ctx) => {
22587
22613
  const cells = [];
22588
22614
  for (const child of el.children) if (child.tagName.toLowerCase() === "cell") {
@@ -22973,6 +22999,24 @@ function registerCustomWriters(registry) {
22973
22999
  children: [{ cdata: n.snapshot }]
22974
23000
  };
22975
23001
  });
23002
+ registry.registerWriter("dynamic", (node) => {
23003
+ const n = node;
23004
+ const attrs = optAttr({
23005
+ ...blockId(n),
23006
+ "url": n.url,
23007
+ "initial-height": n.initialHeight != null ? String(n.initialHeight) : void 0
23008
+ });
23009
+ if (!n.props || Object.keys(n.props).length === 0) return {
23010
+ tag: "dynamic",
23011
+ attrs,
23012
+ selfClosing: true
23013
+ };
23014
+ return {
23015
+ tag: "dynamic",
23016
+ attrs,
23017
+ children: [{ cdata: JSON.stringify(n.props) }]
23018
+ };
23019
+ });
22976
23020
  registry.registerWriter("grid-container", (node, ctx) => {
22977
23021
  const n = node;
22978
23022
  const cells = (n.cells ?? []).map((cellState) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-litexml-cli",
3
- "version": "0.23.0",
3
+ "version": "0.25.0",
4
4
  "description": "Unified CLI for haklex LiteXML: convert LiteXML or Lexical JSON to HTML, JSON, or Markdown.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,9 +18,9 @@
18
18
  "dependencies": {
19
19
  "@lexical/headless": "^0.45.0",
20
20
  "lexical": "^0.45.0",
21
- "@haklex/rich-headless": "0.23.0",
22
- "@haklex/rich-compose": "0.23.0",
23
- "@haklex/rich-litexml": "0.23.0"
21
+ "@haklex/rich-compose": "0.25.0",
22
+ "@haklex/rich-headless": "0.25.0",
23
+ "@haklex/rich-litexml": "0.25.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "25.6.0",