@haklex/rich-litexml 0.48.1 → 0.49.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/browser.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as createDefaultRegistry, c as LitexmlRegistry, d as registerParseHTML, i as deserializeNodesFromXml, l as registerCustomReaders, n as serializeToXml, o as registerCustomWriters, r as deserializeFromXml, s as registerBuiltinWriters, t as serializeNodesToXml, u as registerBuiltinReaders } from "./src-
|
|
1
|
+
import { a as createDefaultRegistry, c as LitexmlRegistry, d as registerParseHTML, i as deserializeNodesFromXml, l as registerCustomReaders, n as serializeToXml, o as registerCustomWriters, r as deserializeFromXml, s as registerBuiltinWriters, t as serializeNodesToXml, u as registerBuiltinReaders } from "./src-COIhAhyB.js";
|
|
2
2
|
//#region src/index-browser.ts
|
|
3
3
|
registerParseHTML((html) => new DOMParser().parseFromString(html, "text/html"));
|
|
4
4
|
//#endregion
|
package/dist/node.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as createDefaultRegistry, c as LitexmlRegistry, d as registerParseHTML, i as deserializeNodesFromXml, l as registerCustomReaders, n as serializeToXml, o as registerCustomWriters, r as deserializeFromXml, s as registerBuiltinWriters, t as serializeNodesToXml, u as registerBuiltinReaders } from "./src-
|
|
1
|
+
import { a as createDefaultRegistry, c as LitexmlRegistry, d as registerParseHTML, i as deserializeNodesFromXml, l as registerCustomReaders, n as serializeToXml, o as registerCustomWriters, r as deserializeFromXml, s as registerBuiltinWriters, t as serializeNodesToXml, u as registerBuiltinReaders } from "./src-COIhAhyB.js";
|
|
2
2
|
import { parseHTML } from "linkedom";
|
|
3
3
|
//#region src/index-node.ts
|
|
4
4
|
registerParseHTML((html) => parseHTML(html).document);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../src/readers/custom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA0FnD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../src/readers/custom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA0FnD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAwgBrE"}
|
|
@@ -453,6 +453,12 @@ function registerCustomReaders(registry) {
|
|
|
453
453
|
snapshot: extractCdataText(el) || el.getAttribute("snapshot") || el.textContent?.trim() || "",
|
|
454
454
|
version: 1
|
|
455
455
|
}));
|
|
456
|
+
registry.registerReader("chart", (el) => ({
|
|
457
|
+
type: "chart",
|
|
458
|
+
...extractBlockId(el),
|
|
459
|
+
spec: extractRawText(el).trim(),
|
|
460
|
+
version: 1
|
|
461
|
+
}));
|
|
456
462
|
registry.registerReader("dynamic", (el) => {
|
|
457
463
|
let props = {};
|
|
458
464
|
const raw = (extractCdataText(el) ?? el.textContent ?? "").trim();
|
|
@@ -881,6 +887,20 @@ function registerCustomWriters(registry) {
|
|
|
881
887
|
children: [{ cdata: n.snapshot }]
|
|
882
888
|
};
|
|
883
889
|
});
|
|
890
|
+
registry.registerWriter("chart", (node) => {
|
|
891
|
+
const n = node;
|
|
892
|
+
const spec = typeof n.spec === "string" ? n.spec : "";
|
|
893
|
+
if (!spec) return {
|
|
894
|
+
tag: "chart",
|
|
895
|
+
attrs: optAttr(blockId(n)),
|
|
896
|
+
selfClosing: true
|
|
897
|
+
};
|
|
898
|
+
return {
|
|
899
|
+
tag: "chart",
|
|
900
|
+
attrs: optAttr(blockId(n)),
|
|
901
|
+
children: [{ cdata: spec }]
|
|
902
|
+
};
|
|
903
|
+
});
|
|
884
904
|
registry.registerWriter("dynamic", (node) => {
|
|
885
905
|
const n = node;
|
|
886
906
|
const attrs = optAttr({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../src/writers/custom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAenD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../src/writers/custom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAenD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAiYrE"}
|