@haklex/rich-litexml 0.9.0 → 0.9.2

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/index.mjs +14 -13
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -175,7 +175,7 @@ function registerCustomReaders(registry) {
175
175
  height: numAttr(el, "height"),
176
176
  version: 1
177
177
  }));
178
- registry.registerReader("linkcard", (el) => ({
178
+ registry.registerReader("link-card", (el) => ({
179
179
  type: "link-card",
180
180
  ...extractBlockId(el),
181
181
  url: el.getAttribute("url") ?? "",
@@ -255,7 +255,7 @@ function registerCustomReaders(registry) {
255
255
  version: 1
256
256
  };
257
257
  });
258
- registry.registerReader("nesteddoc", (el, ctx) => {
258
+ registry.registerReader("nested-doc", (el, ctx) => {
259
259
  const content = { root: {
260
260
  type: "root",
261
261
  children: ctx.parseChildren(el),
@@ -333,7 +333,7 @@ function registerCustomReaders(registry) {
333
333
  identifier: el.getAttribute("ref") ?? "",
334
334
  version: 1
335
335
  }));
336
- registry.registerReader("footnotesection", (el) => {
336
+ registry.registerReader("footnote-section", (el) => {
337
337
  const definitions = {};
338
338
  for (const child of el.children) if (child.tagName.toLowerCase() === "def") {
339
339
  const ref = child.getAttribute("ref") ?? "";
@@ -388,14 +388,14 @@ function registerCustomReaders(registry) {
388
388
  version: 1
389
389
  };
390
390
  });
391
- registry.registerReader("agentdiff", (el) => ({
391
+ registry.registerReader("agent-diff", (el) => ({
392
392
  type: "agent-diff",
393
393
  ...extractBlockId(el),
394
394
  opType: el.getAttribute("op") ?? "insert",
395
395
  diffEntryId: el.getAttribute("entry") ?? "",
396
396
  version: 1
397
397
  }));
398
- registry.registerReader("codesnippet", (el) => {
398
+ registry.registerReader("code-snippet", (el) => {
399
399
  const files = [];
400
400
  for (const child of el.children) if (child.tagName.toLowerCase() === "file") files.push({
401
401
  filename: child.getAttribute("name") ?? "",
@@ -637,7 +637,7 @@ function registerCustomWriters(registry) {
637
637
  registry.registerWriter("link-card", (node) => {
638
638
  const n = node;
639
639
  return {
640
- tag: "linkcard",
640
+ tag: "link-card",
641
641
  attrs: optAttr({
642
642
  ...blockId(n),
643
643
  url: n.url,
@@ -727,7 +727,7 @@ function registerCustomWriters(registry) {
727
727
  registry.registerWriter("nested-doc", (node, ctx) => {
728
728
  const n = node;
729
729
  return {
730
- tag: "nesteddoc",
730
+ tag: "nested-doc",
731
731
  attrs: blockId(n),
732
732
  children: ctx.serializeNestedState(n.content ?? n.contentState)
733
733
  };
@@ -764,7 +764,7 @@ function registerCustomWriters(registry) {
764
764
  registry.registerWriter("agent-diff", (node) => {
765
765
  const n = node;
766
766
  return {
767
- tag: "agentdiff",
767
+ tag: "agent-diff",
768
768
  attrs: optAttr({
769
769
  ...blockId(n),
770
770
  op: n.opType,
@@ -839,7 +839,7 @@ function registerCustomWriters(registry) {
839
839
  children: [text]
840
840
  }));
841
841
  return {
842
- tag: "footnotesection",
842
+ tag: "footnote-section",
843
843
  attrs: blockId(n),
844
844
  children
845
845
  };
@@ -874,7 +874,7 @@ function registerCustomWriters(registry) {
874
874
  children: [f.code ?? ""]
875
875
  }));
876
876
  return {
877
- tag: "codesnippet",
877
+ tag: "code-snippet",
878
878
  attrs: blockId(n),
879
879
  children: files
880
880
  };
@@ -1031,10 +1031,11 @@ var BLOCK_TAGS = new Set([
1031
1031
  "alert",
1032
1032
  "banner",
1033
1033
  "details",
1034
- "nesteddoc",
1034
+ "nested-doc",
1035
1035
  "gallery",
1036
- "codesnippet",
1037
- "footnotesection",
1036
+ "codeblock",
1037
+ "code-snippet",
1038
+ "footnote-section",
1038
1039
  "grid",
1039
1040
  "cell",
1040
1041
  "excalidraw"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-litexml",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "Bidirectional Lexical SerializedNode <-> XML conversion with plugin registry",
5
5
  "repository": {
6
6
  "type": "git",