@haklex/rich-litexml-cli 0.22.1 → 0.24.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/cli.mjs +58 -7
- package/package.json +4 -4
package/dist/cli.mjs
CHANGED
|
@@ -10845,6 +10845,38 @@ var DetailsNode = class DetailsNode extends go {
|
|
|
10845
10845
|
return false;
|
|
10846
10846
|
}
|
|
10847
10847
|
};
|
|
10848
|
+
var RichQuoteNode = class RichQuoteNode extends Xe$1 {
|
|
10849
|
+
static getType() {
|
|
10850
|
+
return "rich-quote";
|
|
10851
|
+
}
|
|
10852
|
+
static clone(node) {
|
|
10853
|
+
const n = new RichQuoteNode(node.__key);
|
|
10854
|
+
n.__attribution = node.__attribution;
|
|
10855
|
+
return n;
|
|
10856
|
+
}
|
|
10857
|
+
constructor(key) {
|
|
10858
|
+
super(key);
|
|
10859
|
+
this.__attribution = null;
|
|
10860
|
+
}
|
|
10861
|
+
static importJSON(json) {
|
|
10862
|
+
const node = new RichQuoteNode();
|
|
10863
|
+
node.__attribution = json.attribution ?? null;
|
|
10864
|
+
return node;
|
|
10865
|
+
}
|
|
10866
|
+
exportJSON() {
|
|
10867
|
+
return {
|
|
10868
|
+
...super.exportJSON(),
|
|
10869
|
+
type: "rich-quote",
|
|
10870
|
+
attribution: this.__attribution
|
|
10871
|
+
};
|
|
10872
|
+
}
|
|
10873
|
+
createDOM() {
|
|
10874
|
+
return stubDOM();
|
|
10875
|
+
}
|
|
10876
|
+
updateDOM() {
|
|
10877
|
+
return false;
|
|
10878
|
+
}
|
|
10879
|
+
};
|
|
10848
10880
|
function headlessDecorator(type, propKeys, defaults, inline = false) {
|
|
10849
10881
|
class Node extends yo {
|
|
10850
10882
|
constructor(key) {
|
|
@@ -10990,6 +11022,7 @@ var customHeadlessNodes = [
|
|
|
10990
11022
|
SpoilerNode,
|
|
10991
11023
|
RubyNode,
|
|
10992
11024
|
DetailsNode,
|
|
11025
|
+
RichQuoteNode,
|
|
10993
11026
|
ImageNode,
|
|
10994
11027
|
VideoNode,
|
|
10995
11028
|
LinkCardNode,
|
|
@@ -22303,6 +22336,20 @@ function numAttr(el, name) {
|
|
|
22303
22336
|
const v = el.getAttribute(name);
|
|
22304
22337
|
return v !== null ? Number(v) : void 0;
|
|
22305
22338
|
}
|
|
22339
|
+
var IMAGE_LAYOUTS = new Set([
|
|
22340
|
+
"align-left",
|
|
22341
|
+
"align-right",
|
|
22342
|
+
"float-left",
|
|
22343
|
+
"float-right"
|
|
22344
|
+
]);
|
|
22345
|
+
function imageDisplayWidthAttr(el) {
|
|
22346
|
+
const v = numAttr(el, "display-width");
|
|
22347
|
+
return v !== void 0 && Number.isFinite(v) && v >= 10 && v <= 100 ? v : void 0;
|
|
22348
|
+
}
|
|
22349
|
+
function imageLayoutAttr(el) {
|
|
22350
|
+
const v = el.getAttribute("layout");
|
|
22351
|
+
return v !== null && IMAGE_LAYOUTS.has(v) ? v : void 0;
|
|
22352
|
+
}
|
|
22306
22353
|
/**
|
|
22307
22354
|
* Extract CDATA text content from an element.
|
|
22308
22355
|
* linkedom (HTML parser) converts <![CDATA[...]]> to a comment node
|
|
@@ -22331,6 +22378,8 @@ function registerCustomReaders(registry) {
|
|
|
22331
22378
|
caption: el.getAttribute("caption") ?? void 0,
|
|
22332
22379
|
thumbhash: el.getAttribute("thumbhash") ?? void 0,
|
|
22333
22380
|
accent: el.getAttribute("accent") ?? void 0,
|
|
22381
|
+
displayWidth: imageDisplayWidthAttr(el),
|
|
22382
|
+
layout: imageLayoutAttr(el),
|
|
22334
22383
|
version: 1
|
|
22335
22384
|
};
|
|
22336
22385
|
});
|
|
@@ -22783,13 +22832,15 @@ function registerCustomWriters(registry) {
|
|
|
22783
22832
|
tag: "img",
|
|
22784
22833
|
attrs: optAttr({
|
|
22785
22834
|
...blockId(n),
|
|
22786
|
-
src: n.src,
|
|
22787
|
-
alt: n.altText,
|
|
22788
|
-
width: n.width != null ? String(n.width) : void 0,
|
|
22789
|
-
height: n.height != null ? String(n.height) : void 0,
|
|
22790
|
-
caption: n.caption,
|
|
22791
|
-
thumbhash: n.thumbhash,
|
|
22792
|
-
accent: n.accent
|
|
22835
|
+
"src": n.src,
|
|
22836
|
+
"alt": n.altText,
|
|
22837
|
+
"width": n.width != null ? String(n.width) : void 0,
|
|
22838
|
+
"height": n.height != null ? String(n.height) : void 0,
|
|
22839
|
+
"caption": n.caption,
|
|
22840
|
+
"thumbhash": n.thumbhash,
|
|
22841
|
+
"accent": n.accent,
|
|
22842
|
+
"display-width": n.displayWidth != null ? String(n.displayWidth) : void 0,
|
|
22843
|
+
"layout": n.layout
|
|
22793
22844
|
}),
|
|
22794
22845
|
selfClosing: true
|
|
22795
22846
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-litexml-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.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-compose": "0.
|
|
22
|
-
"@haklex/rich-headless": "0.
|
|
23
|
-
"@haklex/rich-litexml": "0.
|
|
21
|
+
"@haklex/rich-compose": "0.24.0",
|
|
22
|
+
"@haklex/rich-headless": "0.24.0",
|
|
23
|
+
"@haklex/rich-litexml": "0.24.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "25.6.0",
|