@haklex/rich-litexml-cli 0.48.1 → 0.49.1
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/cli.mjs +48 -8
- package/package.json +4 -4
package/dist/cli.mjs
CHANGED
|
@@ -11728,6 +11728,18 @@ var MERMAID_BLOCK_TRANSFORMER = {
|
|
|
11728
11728
|
replace: NOOP,
|
|
11729
11729
|
type: "element"
|
|
11730
11730
|
};
|
|
11731
|
+
var CHART_BLOCK_TRANSFORMER = {
|
|
11732
|
+
dependencies: [],
|
|
11733
|
+
export: (node) => {
|
|
11734
|
+
if (node.getType() !== "chart") return null;
|
|
11735
|
+
const spec = node.__spec ?? "";
|
|
11736
|
+
const f = fence(spec);
|
|
11737
|
+
return `${f}chart\n${spec}\n${f}`;
|
|
11738
|
+
},
|
|
11739
|
+
regExp: NEVER,
|
|
11740
|
+
replace: NOOP,
|
|
11741
|
+
type: "element"
|
|
11742
|
+
};
|
|
11731
11743
|
var NESTED_DOC_BLOCK_TRANSFORMER = {
|
|
11732
11744
|
dependencies: [],
|
|
11733
11745
|
export: (node) => {
|
|
@@ -11874,6 +11886,7 @@ var allHeadlessTransformers = [
|
|
|
11874
11886
|
LEGACY_CODE_NODE_TRANSFORMER,
|
|
11875
11887
|
LINK_CARD_BLOCK_TRANSFORMER,
|
|
11876
11888
|
MERMAID_BLOCK_TRANSFORMER,
|
|
11889
|
+
CHART_BLOCK_TRANSFORMER,
|
|
11877
11890
|
NESTED_DOC_BLOCK_TRANSFORMER,
|
|
11878
11891
|
GRID_CONTAINER_BLOCK_TRANSFORMER,
|
|
11879
11892
|
HORIZONTAL_RULE_BLOCK_TRANSFORMER,
|
|
@@ -11997,7 +12010,7 @@ var RubyNode = class RubyNode extends pl {
|
|
|
11997
12010
|
const json = _json;
|
|
11998
12011
|
const node = new RubyNode();
|
|
11999
12012
|
node.__reading = json.reading ?? "";
|
|
12000
|
-
return node;
|
|
12013
|
+
return node.updateFromJSON(json);
|
|
12001
12014
|
}
|
|
12002
12015
|
exportJSON() {
|
|
12003
12016
|
return {
|
|
@@ -12037,7 +12050,7 @@ var DetailsNode = class DetailsNode extends pl {
|
|
|
12037
12050
|
const node = new DetailsNode();
|
|
12038
12051
|
node.__summary = json.summary ?? "";
|
|
12039
12052
|
node.__open = json.open ?? false;
|
|
12040
|
-
return node;
|
|
12053
|
+
return node.updateFromJSON(json);
|
|
12041
12054
|
}
|
|
12042
12055
|
exportJSON() {
|
|
12043
12056
|
return {
|
|
@@ -12071,7 +12084,7 @@ var RichQuoteNode = class RichQuoteNode extends $t$2 {
|
|
|
12071
12084
|
const json = _json;
|
|
12072
12085
|
const node = new RichQuoteNode();
|
|
12073
12086
|
node.__attribution = json.attribution ?? null;
|
|
12074
|
-
return node;
|
|
12087
|
+
return node.updateFromJSON(json);
|
|
12075
12088
|
}
|
|
12076
12089
|
exportJSON() {
|
|
12077
12090
|
return {
|
|
@@ -12105,10 +12118,11 @@ function headlessDecorator(type, propKeys, defaults, inline = false) {
|
|
|
12105
12118
|
const json = _json;
|
|
12106
12119
|
const node = new Node();
|
|
12107
12120
|
for (const k of propKeys) node[`__${k}`] = json[k] ?? defaults[k];
|
|
12108
|
-
return node;
|
|
12121
|
+
return node.updateFromJSON(json);
|
|
12109
12122
|
}
|
|
12110
12123
|
exportJSON() {
|
|
12111
12124
|
const out = {
|
|
12125
|
+
...super.exportJSON(),
|
|
12112
12126
|
type,
|
|
12113
12127
|
version: 1
|
|
12114
12128
|
};
|
|
@@ -12235,6 +12249,7 @@ var GalleryNode = headlessDecorator("gallery", [
|
|
|
12235
12249
|
maxItemHeight: void 0
|
|
12236
12250
|
});
|
|
12237
12251
|
var ExcalidrawNode = headlessDecorator("excalidraw", ["snapshot"], { snapshot: "" });
|
|
12252
|
+
var ChartNode = headlessDecorator("chart", ["spec"], { spec: "" });
|
|
12238
12253
|
var DynamicNode = headlessDecorator("dynamic", [
|
|
12239
12254
|
"url",
|
|
12240
12255
|
"props",
|
|
@@ -12290,6 +12305,7 @@ var customHeadlessNodes = [
|
|
|
12290
12305
|
CodeSnippetNode,
|
|
12291
12306
|
GalleryNode,
|
|
12292
12307
|
ExcalidrawNode,
|
|
12308
|
+
ChartNode,
|
|
12293
12309
|
DynamicNode,
|
|
12294
12310
|
TagNode,
|
|
12295
12311
|
CommentNode,
|
|
@@ -12313,10 +12329,11 @@ var customHeadlessNodes = [
|
|
|
12313
12329
|
const node = new BannerNode();
|
|
12314
12330
|
node.__bannerType = json.bannerType ?? "note";
|
|
12315
12331
|
node.__contentState = json.content ?? null;
|
|
12316
|
-
return node;
|
|
12332
|
+
return node.updateFromJSON(json);
|
|
12317
12333
|
}
|
|
12318
12334
|
exportJSON() {
|
|
12319
12335
|
return {
|
|
12336
|
+
...super.exportJSON(),
|
|
12320
12337
|
type: "banner",
|
|
12321
12338
|
version: 1,
|
|
12322
12339
|
bannerType: this.__bannerType,
|
|
@@ -12359,10 +12376,11 @@ var customHeadlessNodes = [
|
|
|
12359
12376
|
const node = new AlertQuoteNode();
|
|
12360
12377
|
node.__alertType = json.alertType ?? "note";
|
|
12361
12378
|
node.__contentState = json.content ?? null;
|
|
12362
|
-
return node;
|
|
12379
|
+
return node.updateFromJSON(json);
|
|
12363
12380
|
}
|
|
12364
12381
|
exportJSON() {
|
|
12365
12382
|
return {
|
|
12383
|
+
...super.exportJSON(),
|
|
12366
12384
|
type: "alert-quote",
|
|
12367
12385
|
version: 1,
|
|
12368
12386
|
alertType: this.__alertType,
|
|
@@ -12402,10 +12420,11 @@ var customHeadlessNodes = [
|
|
|
12402
12420
|
const json = _json;
|
|
12403
12421
|
const node = new NestedDocNode();
|
|
12404
12422
|
node.__contentState = json.content ?? null;
|
|
12405
|
-
return node;
|
|
12423
|
+
return node.updateFromJSON(json);
|
|
12406
12424
|
}
|
|
12407
12425
|
exportJSON() {
|
|
12408
12426
|
return {
|
|
12427
|
+
...super.exportJSON(),
|
|
12409
12428
|
type: "nested-doc",
|
|
12410
12429
|
version: 1,
|
|
12411
12430
|
content: this.__contentState
|
|
@@ -12451,10 +12470,11 @@ var customHeadlessNodes = [
|
|
|
12451
12470
|
const rawGap = json.gap;
|
|
12452
12471
|
node.__gap = typeof rawGap === "number" ? `${rawGap}px` : rawGap ?? "16px";
|
|
12453
12472
|
node.__cells = json.cells ?? [];
|
|
12454
|
-
return node;
|
|
12473
|
+
return node.updateFromJSON(json);
|
|
12455
12474
|
}
|
|
12456
12475
|
exportJSON() {
|
|
12457
12476
|
return {
|
|
12477
|
+
...super.exportJSON(),
|
|
12458
12478
|
type: "grid-container",
|
|
12459
12479
|
version: 1,
|
|
12460
12480
|
cols: this.__cols,
|
|
@@ -25247,6 +25267,12 @@ function registerCustomReaders(registry) {
|
|
|
25247
25267
|
snapshot: extractCdataText(el) || el.getAttribute("snapshot") || el.textContent?.trim() || "",
|
|
25248
25268
|
version: 1
|
|
25249
25269
|
}));
|
|
25270
|
+
registry.registerReader("chart", (el) => ({
|
|
25271
|
+
type: "chart",
|
|
25272
|
+
...extractBlockId(el),
|
|
25273
|
+
spec: extractRawText(el).trim(),
|
|
25274
|
+
version: 1
|
|
25275
|
+
}));
|
|
25250
25276
|
registry.registerReader("dynamic", (el) => {
|
|
25251
25277
|
let props = {};
|
|
25252
25278
|
const raw = (extractCdataText(el) ?? el.textContent ?? "").trim();
|
|
@@ -25675,6 +25701,20 @@ function registerCustomWriters(registry) {
|
|
|
25675
25701
|
children: [{ cdata: n.snapshot }]
|
|
25676
25702
|
};
|
|
25677
25703
|
});
|
|
25704
|
+
registry.registerWriter("chart", (node) => {
|
|
25705
|
+
const n = node;
|
|
25706
|
+
const spec = typeof n.spec === "string" ? n.spec : "";
|
|
25707
|
+
if (!spec) return {
|
|
25708
|
+
tag: "chart",
|
|
25709
|
+
attrs: optAttr(blockId(n)),
|
|
25710
|
+
selfClosing: true
|
|
25711
|
+
};
|
|
25712
|
+
return {
|
|
25713
|
+
tag: "chart",
|
|
25714
|
+
attrs: optAttr(blockId(n)),
|
|
25715
|
+
children: [{ cdata: spec }]
|
|
25716
|
+
};
|
|
25717
|
+
});
|
|
25678
25718
|
registry.registerWriter("dynamic", (node) => {
|
|
25679
25719
|
const n = node;
|
|
25680
25720
|
const attrs = optAttr({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-litexml-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.1",
|
|
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",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@haklex/rich-compose": "0.
|
|
20
|
-
"@haklex/rich-headless": "0.
|
|
21
|
-
"@haklex/rich-litexml": "0.
|
|
19
|
+
"@haklex/rich-compose": "0.49.1",
|
|
20
|
+
"@haklex/rich-headless": "0.49.1",
|
|
21
|
+
"@haklex/rich-litexml": "0.49.1",
|
|
22
22
|
"@lexical/headless": "^0.52.0",
|
|
23
23
|
"lexical": "^0.52.0"
|
|
24
24
|
},
|