@tinacms/mdx 0.61.2 → 0.61.5

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.js +21 -8
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -244459,9 +244459,9 @@ var remarkToSlate = (root3, field, imageCallback) => {
244459
244459
  case "thematicBreak":
244460
244460
  case "table":
244461
244461
  case "html":
244462
- throw new Error(`${content4.type} inside list item is not supported`);
244462
+ throw new RichTextParseError(`${child.type} inside list item is not supported`, child.position);
244463
244463
  default:
244464
- throw new Error(`Unknown list item of type ${content4.type}`);
244464
+ throw new RichTextParseError(`Unknown list item of type ${child.type}`, child.position);
244465
244465
  }
244466
244466
  })
244467
244467
  };
@@ -244704,7 +244704,7 @@ var parseMDX = (value, field, imageCallback) => {
244704
244704
  if (e instanceof RichTextParseError) {
244705
244705
  return invalidMarkdown(e, value);
244706
244706
  }
244707
- throw e;
244707
+ return invalidMarkdown(new RichTextParseError(e.message), value);
244708
244708
  }
244709
244709
  };
244710
244710
  var invalidMarkdown = (e, value) => {
@@ -244953,7 +244953,7 @@ var replaceLinksWithTextNodes = (content3) => {
244953
244953
  type: "link",
244954
244954
  url: item.url,
244955
244955
  title: item.title,
244956
- children: [text4({ text: a.value })]
244956
+ children: [a]
244957
244957
  };
244958
244958
  }
244959
244959
  }));
@@ -245013,12 +245013,24 @@ var text4 = (content3) => {
245013
245013
  };
245014
245014
  };
245015
245015
  var eat2 = (c, field, imageCallback) => {
245016
+ var _a, _b;
245016
245017
  const content3 = replaceLinksWithTextNodes(c);
245017
245018
  const first = content3[0];
245018
245019
  if (!first) {
245019
245020
  return [];
245020
245021
  }
245021
245022
  if (first && (first == null ? void 0 : first.type) !== "text") {
245023
+ if (first.type === "a") {
245024
+ return [
245025
+ {
245026
+ type: "link",
245027
+ url: first.url,
245028
+ title: first.title,
245029
+ children: eat2(first.children, field, imageCallback)
245030
+ },
245031
+ ...eat2(content3.slice(1), field, imageCallback)
245032
+ ];
245033
+ }
245022
245034
  return [
245023
245035
  inlineElementExceptLink(first, field, imageCallback),
245024
245036
  ...eat2(content3.slice(1), field, imageCallback)
@@ -245074,11 +245086,12 @@ var eat2 = (c, field, imageCallback) => {
245074
245086
  if (nonMatchingSiblingIndex) {
245075
245087
  throw new Error(`Marks inside inline code are not supported`);
245076
245088
  }
245089
+ const node = {
245090
+ type: markToProcess,
245091
+ value: first.text
245092
+ };
245077
245093
  return [
245078
- {
245079
- type: markToProcess,
245080
- value: first.text
245081
- },
245094
+ (_b = (_a = first.linkifyTextNode) == null ? void 0 : _a.call(first, node)) != null ? _b : node,
245082
245095
  ...eat2(content3.slice(nonMatchingSiblingIndex + 1), field, imageCallback)
245083
245096
  ];
245084
245097
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/mdx",
3
- "version": "0.61.2",
3
+ "version": "0.61.5",
4
4
  "typings": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -18,7 +18,7 @@
18
18
  ]
19
19
  },
20
20
  "dependencies": {
21
- "@tinacms/schema-tools": "0.1.0",
21
+ "@tinacms/schema-tools": "0.1.1",
22
22
  "acorn": "^8.7.1",
23
23
  "lodash-es": "^4.17.21",
24
24
  "mdast-util-mdx-jsx": "^2.0.1",