@tinacms/mdx 0.61.17 → 1.0.1

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 +8 -54
  2. package/package.json +3 -4
package/dist/index.js CHANGED
@@ -6670,7 +6670,7 @@ var require_doc = __commonJS({
6670
6670
  if (parts.length === 0) {
6671
6671
  break;
6672
6672
  }
6673
- const [content3, whitespace2] = parts;
6673
+ const [content3, whitespace] = parts;
6674
6674
  const contentFlatCmd = [ind, MODE_FLAT, content3];
6675
6675
  const contentBreakCmd = [ind, MODE_BREAK, content3];
6676
6676
  const contentFits = fits(contentFlatCmd, [], rem, options, lineSuffix.length > 0, true);
@@ -6682,8 +6682,8 @@ var require_doc = __commonJS({
6682
6682
  }
6683
6683
  break;
6684
6684
  }
6685
- const whitespaceFlatCmd = [ind, MODE_FLAT, whitespace2];
6686
- const whitespaceBreakCmd = [ind, MODE_BREAK, whitespace2];
6685
+ const whitespaceFlatCmd = [ind, MODE_FLAT, whitespace];
6686
+ const whitespaceBreakCmd = [ind, MODE_BREAK, whitespace];
6687
6687
  if (parts.length === 2) {
6688
6688
  if (contentFits) {
6689
6689
  cmds.push(whitespaceFlatCmd, contentFlatCmd);
@@ -6695,7 +6695,7 @@ var require_doc = __commonJS({
6695
6695
  parts.splice(0, 2);
6696
6696
  const remainingCmd = [ind, mode, fill(parts)];
6697
6697
  const secondContent = parts[0];
6698
- const firstAndSecondContentFlatCmd = [ind, MODE_FLAT, [content3, whitespace2, secondContent]];
6698
+ const firstAndSecondContentFlatCmd = [ind, MODE_FLAT, [content3, whitespace, secondContent]];
6699
6699
  const firstAndSecondContentFits = fits(firstAndSecondContentFlatCmd, [], rem, options, lineSuffix.length > 0, true);
6700
6700
  if (firstAndSecondContentFits) {
6701
6701
  cmds.push(remainingCmd, whitespaceFlatCmd, contentFlatCmd);
@@ -197710,7 +197710,7 @@ var require_prettier = __commonJS({
197710
197710
  const {
197711
197711
  logger = console,
197712
197712
  descriptor = defaults_1.defaultDescriptor,
197713
- unknown: unknown3 = defaults_1.defaultUnknownHandler,
197713
+ unknown: unknown2 = defaults_1.defaultUnknownHandler,
197714
197714
  invalid: invalid2 = defaults_1.defaultInvalidHandler,
197715
197715
  deprecated = defaults_1.defaultDeprecatedHandler
197716
197716
  } = opts || {};
@@ -197727,7 +197727,7 @@ var require_prettier = __commonJS({
197727
197727
  normalizeRedirectResult: utils_1.normalizeRedirectResult,
197728
197728
  normalizeValidateResult: utils_1.normalizeValidateResult
197729
197729
  };
197730
- this._unknownHandler = unknown3;
197730
+ this._unknownHandler = unknown2;
197731
197731
  this._invalidHandler = invalid2;
197732
197732
  this._deprecatedHandler = deprecated;
197733
197733
  this.cleanHistory();
@@ -197926,7 +197926,7 @@ var require_prettier = __commonJS({
197926
197926
  colorsModule = null,
197927
197927
  levenshteinDistance = null
197928
197928
  } = {}) {
197929
- const unknown3 = !passThrough ? (key, value, options2) => {
197929
+ const unknown2 = !passThrough ? (key, value, options2) => {
197930
197930
  const _options2$schemas = options2.schemas, {
197931
197931
  _
197932
197932
  } = _options2$schemas, schemas2 = _objectWithoutProperties(_options2$schemas, _excluded2);
@@ -197946,7 +197946,7 @@ var require_prettier = __commonJS({
197946
197946
  });
197947
197947
  const normalizer = new vnopts.Normalizer(schemas, {
197948
197948
  logger,
197949
- unknown: unknown3,
197949
+ unknown: unknown2,
197950
197950
  descriptor
197951
197951
  });
197952
197952
  const shouldSuppressDuplicateDeprecationWarnings = logger !== false;
@@ -243985,49 +243985,6 @@ function remarkMdx(options = {}) {
243985
243985
  }
243986
243986
  }
243987
243987
 
243988
- // ../../../node_modules/.pnpm/hast-util-whitespace@2.0.0/node_modules/hast-util-whitespace/index.js
243989
- function whitespace(thing) {
243990
- var value = thing && typeof thing === "object" && thing.type === "text" ? thing.value || "" : thing;
243991
- return typeof value === "string" && value.replace(/[ \t\n\f\r]/g, "") === "";
243992
- }
243993
-
243994
- // ../../../node_modules/.pnpm/remark-unwrap-images@3.0.1/node_modules/remark-unwrap-images/index.js
243995
- var unknown2 = 1;
243996
- var containsImage = 2;
243997
- var containsOther = 3;
243998
- function remarkUnwrapImages() {
243999
- return (tree) => {
244000
- visit(tree, "paragraph", (node, index2, parent) => {
244001
- if (parent && typeof index2 === "number" && applicable(node) === containsImage) {
244002
- parent.children.splice(index2, 1, ...node.children);
244003
- return [SKIP, index2];
244004
- }
244005
- });
244006
- };
244007
- }
244008
- function applicable(node, inLink) {
244009
- let image2 = unknown2;
244010
- let index2 = -1;
244011
- while (++index2 < node.children.length) {
244012
- const child = node.children[index2];
244013
- if (whitespace(child)) {
244014
- } else if (child.type === "image" || child.type === "imageReference") {
244015
- image2 = containsImage;
244016
- } else if (!inLink && (child.type === "link" || child.type === "linkReference")) {
244017
- const linkResult = applicable(child, true);
244018
- if (linkResult === containsOther) {
244019
- return containsOther;
244020
- }
244021
- if (linkResult === containsImage) {
244022
- image2 = containsImage;
244023
- }
244024
- } else {
244025
- return containsOther;
244026
- }
244027
- }
244028
- return image2;
244029
- }
244030
-
244031
243988
  // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
244032
243989
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
244033
243990
  var freeGlobal_default = freeGlobal;
@@ -244439,8 +244396,6 @@ var remarkToSlate = (root3, field, imageCallback) => {
244439
244396
  return code2(content4);
244440
244397
  case "paragraph":
244441
244398
  return paragraph2(content4);
244442
- case "image":
244443
- return image2(content4);
244444
244399
  case "mdxJsxFlowElement":
244445
244400
  return mdxJsxElement(content4, field, imageCallback);
244446
244401
  case "thematicBreak":
@@ -244745,7 +244700,6 @@ var markdownToAst = (value, field) => {
244745
244700
  if (!tree) {
244746
244701
  throw new Error("Error parsing markdown");
244747
244702
  }
244748
- remarkUnwrapImages({})(tree);
244749
244703
  return tree;
244750
244704
  } catch (e) {
244751
244705
  throw new RichTextParseError(e, e.position);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/mdx",
3
- "version": "0.61.17",
3
+ "version": "1.0.1",
4
4
  "typings": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -19,7 +19,7 @@
19
19
  ]
20
20
  },
21
21
  "dependencies": {
22
- "@tinacms/schema-tools": "0.2.2",
22
+ "@tinacms/schema-tools": "1.0.1",
23
23
  "acorn": "^8.7.1",
24
24
  "lodash-es": "^4.17.21",
25
25
  "mdast-util-mdx-jsx": "^2.0.1",
@@ -27,7 +27,6 @@
27
27
  "prettier": "^2.7.1",
28
28
  "remark": "^14.0.2",
29
29
  "remark-mdx": "^2.1.2",
30
- "remark-unwrap-images": "^3.0.1",
31
30
  "unist-util-visit": "^4.1.0",
32
31
  "vfile": "^4.2.0"
33
32
  },
@@ -41,7 +40,7 @@
41
40
  "devDependencies": {
42
41
  "@swc/core": "^1.2.210",
43
42
  "@swc/jest": "^0.2.21",
44
- "@tinacms/scripts": "0.51.3",
43
+ "@tinacms/scripts": "1.0.0",
45
44
  "@types/cors": "^2.8.7",
46
45
  "@types/estree": "^0.0.50",
47
46
  "@types/estree-jsx": "^1.0.0",