@tinacms/app 0.0.0-20221102192420 → 0.0.0-20221103131546

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.
@@ -30111,6 +30111,49 @@ function remarkMdx(options = {}) {
30111
30111
  }
30112
30112
  }
30113
30113
 
30114
+ // ../../../node_modules/.pnpm/hast-util-whitespace@2.0.0/node_modules/hast-util-whitespace/index.js
30115
+ function whitespace(thing) {
30116
+ var value = thing && typeof thing === "object" && thing.type === "text" ? thing.value || "" : thing;
30117
+ return typeof value === "string" && value.replace(/[ \t\n\f\r]/g, "") === "";
30118
+ }
30119
+
30120
+ // ../../../node_modules/.pnpm/remark-unwrap-images@3.0.1/node_modules/remark-unwrap-images/index.js
30121
+ var unknown2 = 1;
30122
+ var containsImage = 2;
30123
+ var containsOther = 3;
30124
+ function remarkUnwrapImages() {
30125
+ return (tree) => {
30126
+ visit(tree, "paragraph", (node, index2, parent) => {
30127
+ if (parent && typeof index2 === "number" && applicable(node) === containsImage) {
30128
+ parent.children.splice(index2, 1, ...node.children);
30129
+ return [SKIP, index2];
30130
+ }
30131
+ });
30132
+ };
30133
+ }
30134
+ function applicable(node, inLink) {
30135
+ let image2 = unknown2;
30136
+ let index2 = -1;
30137
+ while (++index2 < node.children.length) {
30138
+ const child = node.children[index2];
30139
+ if (whitespace(child)) {
30140
+ } else if (child.type === "image" || child.type === "imageReference") {
30141
+ image2 = containsImage;
30142
+ } else if (!inLink && (child.type === "link" || child.type === "linkReference")) {
30143
+ const linkResult = applicable(child, true);
30144
+ if (linkResult === containsOther) {
30145
+ return containsOther;
30146
+ }
30147
+ if (linkResult === containsImage) {
30148
+ image2 = containsImage;
30149
+ }
30150
+ } else {
30151
+ return containsOther;
30152
+ }
30153
+ }
30154
+ return image2;
30155
+ }
30156
+
30114
30157
  // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
30115
30158
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
30116
30159
  var freeGlobal_default = freeGlobal;
@@ -30510,6 +30553,8 @@ var remarkToSlate = (root3, field, imageCallback) => {
30510
30553
  return code2(content4);
30511
30554
  case "paragraph":
30512
30555
  return paragraph2(content4);
30556
+ case "image":
30557
+ return image2(content4);
30513
30558
  case "mdxJsxFlowElement":
30514
30559
  return mdxJsxElement(content4, field, imageCallback);
30515
30560
  case "thematicBreak":
@@ -30816,6 +30861,7 @@ var markdownToAst = (value, field) => {
30816
30861
  if (!tree) {
30817
30862
  throw new Error("Error parsing markdown");
30818
30863
  }
30864
+ remarkUnwrapImages({})(tree);
30819
30865
  return tree;
30820
30866
  } catch (e) {
30821
30867
  throw new RichTextParseError(e, e.position);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/app",
3
- "version": "0.0.0-20221102192420",
3
+ "version": "0.0.0-20221103131546",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -37,8 +37,8 @@
37
37
  "@types/react": "17.0.2",
38
38
  "@types/react-dom": "17.0.2",
39
39
  "@tinacms/scripts": "0.51.3",
40
- "tinacms": "0.0.0-20221102192420",
41
- "@tinacms/mdx": "0.0.0-20221102192420",
40
+ "tinacms": "0.70.0",
41
+ "@tinacms/mdx": "0.0.0-20221103131546",
42
42
  "jest": "^27.0.6"
43
43
  },
44
44
  "dependencies": {