@tinacms/app 0.0.28 → 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 (211) hide show
  1. package/appFiles/node_modules/.package-lock.json +23 -23
  2. package/appFiles/node_modules/@babel/generator/lib/generators/base.js.map +1 -1
  3. package/appFiles/node_modules/@babel/generator/lib/generators/classes.js +1 -1
  4. package/appFiles/node_modules/@babel/generator/lib/generators/classes.js.map +1 -1
  5. package/appFiles/node_modules/@babel/generator/lib/generators/expressions.js +9 -15
  6. package/appFiles/node_modules/@babel/generator/lib/generators/expressions.js.map +1 -1
  7. package/appFiles/node_modules/@babel/generator/lib/generators/methods.js +12 -25
  8. package/appFiles/node_modules/@babel/generator/lib/generators/methods.js.map +1 -1
  9. package/appFiles/node_modules/@babel/generator/lib/generators/modules.js +6 -14
  10. package/appFiles/node_modules/@babel/generator/lib/generators/modules.js.map +1 -1
  11. package/appFiles/node_modules/@babel/generator/lib/generators/statements.js +1 -16
  12. package/appFiles/node_modules/@babel/generator/lib/generators/statements.js.map +1 -1
  13. package/appFiles/node_modules/@babel/generator/lib/index.js +11 -0
  14. package/appFiles/node_modules/@babel/generator/lib/index.js.map +1 -1
  15. package/appFiles/node_modules/@babel/generator/lib/printer.js +112 -86
  16. package/appFiles/node_modules/@babel/generator/lib/printer.js.map +1 -1
  17. package/appFiles/node_modules/@babel/generator/package.json +3 -3
  18. package/appFiles/node_modules/@babel/parser/lib/index.js +165 -99
  19. package/appFiles/node_modules/@babel/parser/lib/index.js.map +1 -1
  20. package/appFiles/node_modules/@babel/parser/package.json +2 -2
  21. package/appFiles/node_modules/@babel/parser/typings/babel-parser.d.ts +92 -80
  22. package/appFiles/node_modules/@babel/runtime/helpers/checkInRHS.js +6 -0
  23. package/appFiles/node_modules/@babel/runtime/helpers/createClass.js +2 -1
  24. package/appFiles/node_modules/@babel/runtime/helpers/defineProperty.js +2 -0
  25. package/appFiles/node_modules/@babel/runtime/helpers/esm/checkInRHS.js +5 -0
  26. package/appFiles/node_modules/@babel/runtime/helpers/esm/createClass.js +2 -1
  27. package/appFiles/node_modules/@babel/runtime/helpers/esm/defineProperty.js +2 -0
  28. package/appFiles/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +23 -18
  29. package/appFiles/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js +8 -7
  30. package/appFiles/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +3 -8
  31. package/appFiles/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +23 -18
  32. package/appFiles/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js +8 -7
  33. package/appFiles/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +3 -8
  34. package/appFiles/node_modules/@babel/runtime/package.json +29 -20
  35. package/appFiles/node_modules/@babel/traverse/lib/path/context.js +3 -2
  36. package/appFiles/node_modules/@babel/traverse/lib/path/context.js.map +1 -1
  37. package/appFiles/node_modules/@babel/traverse/lib/path/conversion.js +8 -4
  38. package/appFiles/node_modules/@babel/traverse/lib/path/conversion.js.map +1 -1
  39. package/appFiles/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js +1 -0
  40. package/appFiles/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js.map +1 -1
  41. package/appFiles/node_modules/@babel/traverse/lib/scope/index.js +1 -1
  42. package/appFiles/node_modules/@babel/traverse/lib/scope/index.js.map +1 -1
  43. package/appFiles/node_modules/@babel/traverse/package.json +4 -4
  44. package/appFiles/node_modules/@babel/types/lib/asserts/assertNode.js +0 -3
  45. package/appFiles/node_modules/@babel/types/lib/asserts/assertNode.js.map +1 -1
  46. package/appFiles/node_modules/@babel/types/lib/asserts/generated/index.js +0 -303
  47. package/appFiles/node_modules/@babel/types/lib/asserts/generated/index.js.map +1 -1
  48. package/appFiles/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js +0 -4
  49. package/appFiles/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map +1 -1
  50. package/appFiles/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js +0 -11
  51. package/appFiles/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js.map +1 -1
  52. package/appFiles/node_modules/@babel/types/lib/builders/generated/index.js +0 -253
  53. package/appFiles/node_modules/@babel/types/lib/builders/generated/index.js.map +1 -1
  54. package/appFiles/node_modules/@babel/types/lib/builders/generated/uppercase.js +0 -1
  55. package/appFiles/node_modules/@babel/types/lib/builders/generated/uppercase.js.map +1 -1
  56. package/appFiles/node_modules/@babel/types/lib/builders/react/buildChildren.js +0 -7
  57. package/appFiles/node_modules/@babel/types/lib/builders/react/buildChildren.js.map +1 -1
  58. package/appFiles/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js +0 -5
  59. package/appFiles/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js.map +1 -1
  60. package/appFiles/node_modules/@babel/types/lib/builders/validateNode.js +0 -5
  61. package/appFiles/node_modules/@babel/types/lib/builders/validateNode.js.map +1 -1
  62. package/appFiles/node_modules/@babel/types/lib/clone/clone.js +0 -2
  63. package/appFiles/node_modules/@babel/types/lib/clone/clone.js.map +1 -1
  64. package/appFiles/node_modules/@babel/types/lib/clone/cloneDeep.js +0 -2
  65. package/appFiles/node_modules/@babel/types/lib/clone/cloneDeep.js.map +1 -1
  66. package/appFiles/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js +0 -2
  67. package/appFiles/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js.map +1 -1
  68. package/appFiles/node_modules/@babel/types/lib/clone/cloneNode.js +4 -22
  69. package/appFiles/node_modules/@babel/types/lib/clone/cloneNode.js.map +1 -1
  70. package/appFiles/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js +0 -2
  71. package/appFiles/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js.map +1 -1
  72. package/appFiles/node_modules/@babel/types/lib/comments/addComment.js +0 -2
  73. package/appFiles/node_modules/@babel/types/lib/comments/addComment.js.map +1 -1
  74. package/appFiles/node_modules/@babel/types/lib/comments/addComments.js +0 -3
  75. package/appFiles/node_modules/@babel/types/lib/comments/addComments.js.map +1 -1
  76. package/appFiles/node_modules/@babel/types/lib/comments/inheritInnerComments.js +0 -2
  77. package/appFiles/node_modules/@babel/types/lib/comments/inheritInnerComments.js.map +1 -1
  78. package/appFiles/node_modules/@babel/types/lib/comments/inheritLeadingComments.js +0 -2
  79. package/appFiles/node_modules/@babel/types/lib/comments/inheritLeadingComments.js.map +1 -1
  80. package/appFiles/node_modules/@babel/types/lib/comments/inheritTrailingComments.js +0 -2
  81. package/appFiles/node_modules/@babel/types/lib/comments/inheritTrailingComments.js.map +1 -1
  82. package/appFiles/node_modules/@babel/types/lib/comments/inheritsComments.js +0 -4
  83. package/appFiles/node_modules/@babel/types/lib/comments/inheritsComments.js.map +1 -1
  84. package/appFiles/node_modules/@babel/types/lib/comments/removeComments.js +0 -3
  85. package/appFiles/node_modules/@babel/types/lib/comments/removeComments.js.map +1 -1
  86. package/appFiles/node_modules/@babel/types/lib/constants/generated/index.js +0 -1
  87. package/appFiles/node_modules/@babel/types/lib/constants/generated/index.js.map +1 -1
  88. package/appFiles/node_modules/@babel/types/lib/constants/index.js.map +1 -1
  89. package/appFiles/node_modules/@babel/types/lib/converters/ensureBlock.js +0 -2
  90. package/appFiles/node_modules/@babel/types/lib/converters/ensureBlock.js.map +1 -1
  91. package/appFiles/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js +2 -12
  92. package/appFiles/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js.map +1 -1
  93. package/appFiles/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js +0 -2
  94. package/appFiles/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js.map +1 -1
  95. package/appFiles/node_modules/@babel/types/lib/converters/toBlock.js +0 -7
  96. package/appFiles/node_modules/@babel/types/lib/converters/toBlock.js.map +1 -1
  97. package/appFiles/node_modules/@babel/types/lib/converters/toComputedKey.js +2 -4
  98. package/appFiles/node_modules/@babel/types/lib/converters/toComputedKey.js.map +1 -1
  99. package/appFiles/node_modules/@babel/types/lib/converters/toExpression.js +0 -4
  100. package/appFiles/node_modules/@babel/types/lib/converters/toExpression.js.map +1 -1
  101. package/appFiles/node_modules/@babel/types/lib/converters/toIdentifier.js +2 -6
  102. package/appFiles/node_modules/@babel/types/lib/converters/toIdentifier.js.map +1 -1
  103. package/appFiles/node_modules/@babel/types/lib/converters/toKeyAlias.js +0 -7
  104. package/appFiles/node_modules/@babel/types/lib/converters/toKeyAlias.js.map +1 -1
  105. package/appFiles/node_modules/@babel/types/lib/converters/toSequenceExpression.js +0 -3
  106. package/appFiles/node_modules/@babel/types/lib/converters/toSequenceExpression.js.map +1 -1
  107. package/appFiles/node_modules/@babel/types/lib/converters/toStatement.js +1 -7
  108. package/appFiles/node_modules/@babel/types/lib/converters/toStatement.js.map +1 -1
  109. package/appFiles/node_modules/@babel/types/lib/converters/valueToNode.js +2 -18
  110. package/appFiles/node_modules/@babel/types/lib/converters/valueToNode.js.map +1 -1
  111. package/appFiles/node_modules/@babel/types/lib/definitions/core.js +33 -61
  112. package/appFiles/node_modules/@babel/types/lib/definitions/core.js.map +1 -1
  113. package/appFiles/node_modules/@babel/types/lib/definitions/experimental.js +3 -1
  114. package/appFiles/node_modules/@babel/types/lib/definitions/experimental.js.map +1 -1
  115. package/appFiles/node_modules/@babel/types/lib/definitions/flow.js +1 -3
  116. package/appFiles/node_modules/@babel/types/lib/definitions/flow.js.map +1 -1
  117. package/appFiles/node_modules/@babel/types/lib/definitions/index.js +0 -18
  118. package/appFiles/node_modules/@babel/types/lib/definitions/index.js.map +1 -1
  119. package/appFiles/node_modules/@babel/types/lib/definitions/jsx.js +0 -1
  120. package/appFiles/node_modules/@babel/types/lib/definitions/jsx.js.map +1 -1
  121. package/appFiles/node_modules/@babel/types/lib/definitions/misc.js +0 -2
  122. package/appFiles/node_modules/@babel/types/lib/definitions/misc.js.map +1 -1
  123. package/appFiles/node_modules/@babel/types/lib/definitions/placeholders.js +0 -5
  124. package/appFiles/node_modules/@babel/types/lib/definitions/placeholders.js.map +1 -1
  125. package/appFiles/node_modules/@babel/types/lib/definitions/typescript.js +4 -15
  126. package/appFiles/node_modules/@babel/types/lib/definitions/typescript.js.map +1 -1
  127. package/appFiles/node_modules/@babel/types/lib/definitions/utils.js +1 -65
  128. package/appFiles/node_modules/@babel/types/lib/definitions/utils.js.map +1 -1
  129. package/appFiles/node_modules/@babel/types/lib/index.d.ts +64 -65
  130. package/appFiles/node_modules/@babel/types/lib/index.js +1 -75
  131. package/appFiles/node_modules/@babel/types/lib/index.js.map +1 -1
  132. package/appFiles/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js +0 -2
  133. package/appFiles/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js.map +1 -1
  134. package/appFiles/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js +3 -12
  135. package/appFiles/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js.map +1 -1
  136. package/appFiles/node_modules/@babel/types/lib/modifications/inherits.js +0 -4
  137. package/appFiles/node_modules/@babel/types/lib/modifications/inherits.js.map +1 -1
  138. package/appFiles/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js +0 -4
  139. package/appFiles/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js.map +1 -1
  140. package/appFiles/node_modules/@babel/types/lib/modifications/removeProperties.js +3 -8
  141. package/appFiles/node_modules/@babel/types/lib/modifications/removeProperties.js.map +1 -1
  142. package/appFiles/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js +0 -3
  143. package/appFiles/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js.map +1 -1
  144. package/appFiles/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js +1 -10
  145. package/appFiles/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js.map +1 -1
  146. package/appFiles/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js +4 -14
  147. package/appFiles/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js.map +1 -1
  148. package/appFiles/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js +0 -3
  149. package/appFiles/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js.map +1 -1
  150. package/appFiles/node_modules/@babel/types/lib/traverse/traverse.js +0 -7
  151. package/appFiles/node_modules/@babel/types/lib/traverse/traverse.js.map +1 -1
  152. package/appFiles/node_modules/@babel/types/lib/traverse/traverseFast.js +2 -5
  153. package/appFiles/node_modules/@babel/types/lib/traverse/traverseFast.js.map +1 -1
  154. package/appFiles/node_modules/@babel/types/lib/utils/inherit.js +0 -1
  155. package/appFiles/node_modules/@babel/types/lib/utils/inherit.js.map +1 -1
  156. package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js +1 -8
  157. package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js.map +1 -1
  158. package/appFiles/node_modules/@babel/types/lib/utils/shallowEqual.js +2 -4
  159. package/appFiles/node_modules/@babel/types/lib/utils/shallowEqual.js.map +1 -1
  160. package/appFiles/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js +0 -2
  161. package/appFiles/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js.map +1 -1
  162. package/appFiles/node_modules/@babel/types/lib/validators/generated/index.js +0 -906
  163. package/appFiles/node_modules/@babel/types/lib/validators/generated/index.js.map +1 -1
  164. package/appFiles/node_modules/@babel/types/lib/validators/is.js +0 -8
  165. package/appFiles/node_modules/@babel/types/lib/validators/is.js.map +1 -1
  166. package/appFiles/node_modules/@babel/types/lib/validators/isBinding.js +4 -8
  167. package/appFiles/node_modules/@babel/types/lib/validators/isBinding.js.map +1 -1
  168. package/appFiles/node_modules/@babel/types/lib/validators/isBlockScoped.js +0 -3
  169. package/appFiles/node_modules/@babel/types/lib/validators/isBlockScoped.js.map +1 -1
  170. package/appFiles/node_modules/@babel/types/lib/validators/isImmutable.js +0 -5
  171. package/appFiles/node_modules/@babel/types/lib/validators/isImmutable.js.map +1 -1
  172. package/appFiles/node_modules/@babel/types/lib/validators/isLet.js +2 -4
  173. package/appFiles/node_modules/@babel/types/lib/validators/isLet.js.map +1 -1
  174. package/appFiles/node_modules/@babel/types/lib/validators/isNode.js +0 -2
  175. package/appFiles/node_modules/@babel/types/lib/validators/isNode.js.map +1 -1
  176. package/appFiles/node_modules/@babel/types/lib/validators/isNodesEquivalent.js +2 -16
  177. package/appFiles/node_modules/@babel/types/lib/validators/isNodesEquivalent.js.map +1 -1
  178. package/appFiles/node_modules/@babel/types/lib/validators/isPlaceholderType.js +0 -4
  179. package/appFiles/node_modules/@babel/types/lib/validators/isPlaceholderType.js.map +1 -1
  180. package/appFiles/node_modules/@babel/types/lib/validators/isReferenced.js +0 -13
  181. package/appFiles/node_modules/@babel/types/lib/validators/isReferenced.js.map +1 -1
  182. package/appFiles/node_modules/@babel/types/lib/validators/isScope.js +0 -3
  183. package/appFiles/node_modules/@babel/types/lib/validators/isScope.js.map +1 -1
  184. package/appFiles/node_modules/@babel/types/lib/validators/isSpecifierDefault.js +2 -3
  185. package/appFiles/node_modules/@babel/types/lib/validators/isSpecifierDefault.js.map +1 -1
  186. package/appFiles/node_modules/@babel/types/lib/validators/isType.js +1 -5
  187. package/appFiles/node_modules/@babel/types/lib/validators/isType.js.map +1 -1
  188. package/appFiles/node_modules/@babel/types/lib/validators/isValidES3Identifier.js +0 -2
  189. package/appFiles/node_modules/@babel/types/lib/validators/isValidES3Identifier.js.map +1 -1
  190. package/appFiles/node_modules/@babel/types/lib/validators/isValidIdentifier.js +0 -4
  191. package/appFiles/node_modules/@babel/types/lib/validators/isValidIdentifier.js.map +1 -1
  192. package/appFiles/node_modules/@babel/types/lib/validators/isVar.js +2 -4
  193. package/appFiles/node_modules/@babel/types/lib/validators/isVar.js.map +1 -1
  194. package/appFiles/node_modules/@babel/types/lib/validators/matchesPattern.js +0 -8
  195. package/appFiles/node_modules/@babel/types/lib/validators/matchesPattern.js.map +1 -1
  196. package/appFiles/node_modules/@babel/types/lib/validators/react/isCompatTag.js +0 -1
  197. package/appFiles/node_modules/@babel/types/lib/validators/react/isCompatTag.js.map +1 -1
  198. package/appFiles/node_modules/@babel/types/lib/validators/react/isReactComponent.js +0 -2
  199. package/appFiles/node_modules/@babel/types/lib/validators/react/isReactComponent.js.map +1 -1
  200. package/appFiles/node_modules/@babel/types/lib/validators/validate.js +0 -4
  201. package/appFiles/node_modules/@babel/types/lib/validators/validate.js.map +1 -1
  202. package/appFiles/node_modules/@babel/types/package.json +3 -3
  203. package/appFiles/node_modules/regenerator-runtime/package.json +2 -2
  204. package/appFiles/node_modules/regenerator-runtime/runtime.js +18 -17
  205. package/appFiles/src/App.tsx +0 -12
  206. package/appFiles/src/fields/rich-text/monaco/mdx.js +0 -46
  207. package/appFiles/src/lib/machines/query-machine.ts +130 -2
  208. package/appFiles/src/preview.tsx +9 -15
  209. package/dist/index.js +1 -1
  210. package/package.json +4 -4
  211. package/appFiles/node_modules/@babel/types/lib/index.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["isVar","node","isVariableDeclaration","kind","BLOCK_SCOPED_SYMBOL"],"sources":["../../src/validators/isVar.ts"],"sourcesContent":["import { isVariableDeclaration } from \"./generated\";\nimport { BLOCK_SCOPED_SYMBOL } from \"../constants\";\nimport type * as t from \"..\";\n\n/**\n * Check if the input `node` is a variable declaration.\n */\nexport default function isVar(node: t.Node): boolean {\n return (\n isVariableDeclaration(node, { kind: \"var\" }) &&\n !(\n // @ts-expect-error document private properties\n node[BLOCK_SCOPED_SYMBOL]\n )\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAMe,SAASA,KAAT,CAAeC,IAAf,EAAsC;EACnD,OACE,IAAAC,gCAAA,EAAsBD,IAAtB,EAA4B;IAAEE,IAAI,EAAE;EAAR,CAA5B,KACA,CAEEF,IAAI,CAACG,8BAAD,CAJR;AAOD"}
1
+ {"version":3,"names":["isVar","node","isVariableDeclaration","kind","BLOCK_SCOPED_SYMBOL"],"sources":["../../src/validators/isVar.ts"],"sourcesContent":["import { isVariableDeclaration } from \"./generated\";\nimport { BLOCK_SCOPED_SYMBOL } from \"../constants\";\nimport type * as t from \"..\";\n\n/**\n * Check if the input `node` is a variable declaration.\n */\nexport default function isVar(node: t.Node): boolean {\n return (\n isVariableDeclaration(node, { kind: \"var\" }) &&\n !(\n // @ts-expect-error document private properties\n node[BLOCK_SCOPED_SYMBOL]\n )\n );\n}\n"],"mappings":";;;;;;AAAA;AACA;AAMe,SAASA,KAAK,CAACC,IAAY,EAAW;EACnD,OACE,IAAAC,gCAAqB,EAACD,IAAI,EAAE;IAAEE,IAAI,EAAE;EAAM,CAAC,CAAC,IAC5C;EAEEF,IAAI,CAACG,8BAAmB,CACzB;AAEL"}
@@ -4,27 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = matchesPattern;
7
-
8
7
  var _generated = require("./generated");
9
-
10
8
  function matchesPattern(member, match, allowPartial) {
11
9
  if (!(0, _generated.isMemberExpression)(member)) return false;
12
10
  const parts = Array.isArray(match) ? match : match.split(".");
13
11
  const nodes = [];
14
12
  let node;
15
-
16
13
  for (node = member; (0, _generated.isMemberExpression)(node); node = node.object) {
17
14
  nodes.push(node.property);
18
15
  }
19
-
20
16
  nodes.push(node);
21
17
  if (nodes.length < parts.length) return false;
22
18
  if (!allowPartial && nodes.length > parts.length) return false;
23
-
24
19
  for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {
25
20
  const node = nodes[j];
26
21
  let value;
27
-
28
22
  if ((0, _generated.isIdentifier)(node)) {
29
23
  value = node.name;
30
24
  } else if ((0, _generated.isStringLiteral)(node)) {
@@ -34,10 +28,8 @@ function matchesPattern(member, match, allowPartial) {
34
28
  } else {
35
29
  return false;
36
30
  }
37
-
38
31
  if (parts[i] !== value) return false;
39
32
  }
40
-
41
33
  return true;
42
34
  }
43
35
 
@@ -1 +1 @@
1
- {"version":3,"names":["matchesPattern","member","match","allowPartial","isMemberExpression","parts","Array","isArray","split","nodes","node","object","push","property","length","i","j","value","isIdentifier","name","isStringLiteral","isThisExpression"],"sources":["../../src/validators/matchesPattern.ts"],"sourcesContent":["import {\n isIdentifier,\n isMemberExpression,\n isStringLiteral,\n isThisExpression,\n} from \"./generated\";\nimport type * as t from \"..\";\n\n/**\n * Determines whether or not the input node `member` matches the\n * input `match`.\n *\n * For example, given the match `React.createClass` it would match the\n * parsed nodes of `React.createClass` and `React[\"createClass\"]`.\n */\nexport default function matchesPattern(\n member: t.Node | null | undefined,\n match: string | string[],\n allowPartial?: boolean,\n): boolean {\n // not a member expression\n if (!isMemberExpression(member)) return false;\n\n const parts = Array.isArray(match) ? match : match.split(\".\");\n const nodes = [];\n\n let node;\n for (node = member; isMemberExpression(node); node = node.object) {\n nodes.push(node.property);\n }\n nodes.push(node);\n\n if (nodes.length < parts.length) return false;\n if (!allowPartial && nodes.length > parts.length) return false;\n\n for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {\n const node = nodes[j];\n let value;\n if (isIdentifier(node)) {\n value = node.name;\n } else if (isStringLiteral(node)) {\n value = node.value;\n } else if (isThisExpression(node)) {\n value = \"this\";\n } else {\n return false;\n }\n\n if (parts[i] !== value) return false;\n }\n\n return true;\n}\n"],"mappings":";;;;;;;AAAA;;AAee,SAASA,cAAT,CACbC,MADa,EAEbC,KAFa,EAGbC,YAHa,EAIJ;EAET,IAAI,CAAC,IAAAC,6BAAA,EAAmBH,MAAnB,CAAL,EAAiC,OAAO,KAAP;EAEjC,MAAMI,KAAK,GAAGC,KAAK,CAACC,OAAN,CAAcL,KAAd,IAAuBA,KAAvB,GAA+BA,KAAK,CAACM,KAAN,CAAY,GAAZ,CAA7C;EACA,MAAMC,KAAK,GAAG,EAAd;EAEA,IAAIC,IAAJ;;EACA,KAAKA,IAAI,GAAGT,MAAZ,EAAoB,IAAAG,6BAAA,EAAmBM,IAAnB,CAApB,EAA8CA,IAAI,GAAGA,IAAI,CAACC,MAA1D,EAAkE;IAChEF,KAAK,CAACG,IAAN,CAAWF,IAAI,CAACG,QAAhB;EACD;;EACDJ,KAAK,CAACG,IAAN,CAAWF,IAAX;EAEA,IAAID,KAAK,CAACK,MAAN,GAAeT,KAAK,CAACS,MAAzB,EAAiC,OAAO,KAAP;EACjC,IAAI,CAACX,YAAD,IAAiBM,KAAK,CAACK,MAAN,GAAeT,KAAK,CAACS,MAA1C,EAAkD,OAAO,KAAP;;EAElD,KAAK,IAAIC,CAAC,GAAG,CAAR,EAAWC,CAAC,GAAGP,KAAK,CAACK,MAAN,GAAe,CAAnC,EAAsCC,CAAC,GAAGV,KAAK,CAACS,MAAhD,EAAwDC,CAAC,IAAIC,CAAC,EAA9D,EAAkE;IAChE,MAAMN,IAAI,GAAGD,KAAK,CAACO,CAAD,CAAlB;IACA,IAAIC,KAAJ;;IACA,IAAI,IAAAC,uBAAA,EAAaR,IAAb,CAAJ,EAAwB;MACtBO,KAAK,GAAGP,IAAI,CAACS,IAAb;IACD,CAFD,MAEO,IAAI,IAAAC,0BAAA,EAAgBV,IAAhB,CAAJ,EAA2B;MAChCO,KAAK,GAAGP,IAAI,CAACO,KAAb;IACD,CAFM,MAEA,IAAI,IAAAI,2BAAA,EAAiBX,IAAjB,CAAJ,EAA4B;MACjCO,KAAK,GAAG,MAAR;IACD,CAFM,MAEA;MACL,OAAO,KAAP;IACD;;IAED,IAAIZ,KAAK,CAACU,CAAD,CAAL,KAAaE,KAAjB,EAAwB,OAAO,KAAP;EACzB;;EAED,OAAO,IAAP;AACD"}
1
+ {"version":3,"names":["matchesPattern","member","match","allowPartial","isMemberExpression","parts","Array","isArray","split","nodes","node","object","push","property","length","i","j","value","isIdentifier","name","isStringLiteral","isThisExpression"],"sources":["../../src/validators/matchesPattern.ts"],"sourcesContent":["import {\n isIdentifier,\n isMemberExpression,\n isStringLiteral,\n isThisExpression,\n} from \"./generated\";\nimport type * as t from \"..\";\n\n/**\n * Determines whether or not the input node `member` matches the\n * input `match`.\n *\n * For example, given the match `React.createClass` it would match the\n * parsed nodes of `React.createClass` and `React[\"createClass\"]`.\n */\nexport default function matchesPattern(\n member: t.Node | null | undefined,\n match: string | string[],\n allowPartial?: boolean,\n): boolean {\n // not a member expression\n if (!isMemberExpression(member)) return false;\n\n const parts = Array.isArray(match) ? match : match.split(\".\");\n const nodes = [];\n\n let node;\n for (node = member; isMemberExpression(node); node = node.object) {\n nodes.push(node.property);\n }\n nodes.push(node);\n\n if (nodes.length < parts.length) return false;\n if (!allowPartial && nodes.length > parts.length) return false;\n\n for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {\n const node = nodes[j];\n let value;\n if (isIdentifier(node)) {\n value = node.name;\n } else if (isStringLiteral(node)) {\n value = node.value;\n } else if (isThisExpression(node)) {\n value = \"this\";\n } else {\n return false;\n }\n\n if (parts[i] !== value) return false;\n }\n\n return true;\n}\n"],"mappings":";;;;;;AAAA;AAee,SAASA,cAAc,CACpCC,MAAiC,EACjCC,KAAwB,EACxBC,YAAsB,EACb;EAET,IAAI,CAAC,IAAAC,6BAAkB,EAACH,MAAM,CAAC,EAAE,OAAO,KAAK;EAE7C,MAAMI,KAAK,GAAGC,KAAK,CAACC,OAAO,CAACL,KAAK,CAAC,GAAGA,KAAK,GAAGA,KAAK,CAACM,KAAK,CAAC,GAAG,CAAC;EAC7D,MAAMC,KAAK,GAAG,EAAE;EAEhB,IAAIC,IAAI;EACR,KAAKA,IAAI,GAAGT,MAAM,EAAE,IAAAG,6BAAkB,EAACM,IAAI,CAAC,EAAEA,IAAI,GAAGA,IAAI,CAACC,MAAM,EAAE;IAChEF,KAAK,CAACG,IAAI,CAACF,IAAI,CAACG,QAAQ,CAAC;EAC3B;EACAJ,KAAK,CAACG,IAAI,CAACF,IAAI,CAAC;EAEhB,IAAID,KAAK,CAACK,MAAM,GAAGT,KAAK,CAACS,MAAM,EAAE,OAAO,KAAK;EAC7C,IAAI,CAACX,YAAY,IAAIM,KAAK,CAACK,MAAM,GAAGT,KAAK,CAACS,MAAM,EAAE,OAAO,KAAK;EAE9D,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAGP,KAAK,CAACK,MAAM,GAAG,CAAC,EAAEC,CAAC,GAAGV,KAAK,CAACS,MAAM,EAAEC,CAAC,EAAE,EAAEC,CAAC,EAAE,EAAE;IAChE,MAAMN,IAAI,GAAGD,KAAK,CAACO,CAAC,CAAC;IACrB,IAAIC,KAAK;IACT,IAAI,IAAAC,uBAAY,EAACR,IAAI,CAAC,EAAE;MACtBO,KAAK,GAAGP,IAAI,CAACS,IAAI;IACnB,CAAC,MAAM,IAAI,IAAAC,0BAAe,EAACV,IAAI,CAAC,EAAE;MAChCO,KAAK,GAAGP,IAAI,CAACO,KAAK;IACpB,CAAC,MAAM,IAAI,IAAAI,2BAAgB,EAACX,IAAI,CAAC,EAAE;MACjCO,KAAK,GAAG,MAAM;IAChB,CAAC,MAAM;MACL,OAAO,KAAK;IACd;IAEA,IAAIZ,KAAK,CAACU,CAAC,CAAC,KAAKE,KAAK,EAAE,OAAO,KAAK;EACtC;EAEA,OAAO,IAAI;AACb"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = isCompatTag;
7
-
8
7
  function isCompatTag(tagName) {
9
8
  return !!tagName && /^[a-z]/.test(tagName);
10
9
  }
@@ -1 +1 @@
1
- {"version":3,"names":["isCompatTag","tagName","test"],"sources":["../../../src/validators/react/isCompatTag.ts"],"sourcesContent":["export default function isCompatTag(tagName?: string): boolean {\n // Must start with a lowercase ASCII letter\n return !!tagName && /^[a-z]/.test(tagName);\n}\n"],"mappings":";;;;;;;AAAe,SAASA,WAAT,CAAqBC,OAArB,EAAgD;EAE7D,OAAO,CAAC,CAACA,OAAF,IAAa,SAASC,IAAT,CAAcD,OAAd,CAApB;AACD"}
1
+ {"version":3,"names":["isCompatTag","tagName","test"],"sources":["../../../src/validators/react/isCompatTag.ts"],"sourcesContent":["export default function isCompatTag(tagName?: string): boolean {\n // Must start with a lowercase ASCII letter\n return !!tagName && /^[a-z]/.test(tagName);\n}\n"],"mappings":";;;;;;AAAe,SAASA,WAAW,CAACC,OAAgB,EAAW;EAE7D,OAAO,CAAC,CAACA,OAAO,IAAI,QAAQ,CAACC,IAAI,CAACD,OAAO,CAAC;AAC5C"}
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _buildMatchMemberExpression = require("../buildMatchMemberExpression");
9
-
10
8
  const isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component");
11
9
  var _default = isReactComponent;
12
10
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"names":["isReactComponent","buildMatchMemberExpression"],"sources":["../../../src/validators/react/isReactComponent.ts"],"sourcesContent":["import buildMatchMemberExpression from \"../buildMatchMemberExpression\";\n\nconst isReactComponent = buildMatchMemberExpression(\"React.Component\");\n\nexport default isReactComponent;\n"],"mappings":";;;;;;;AAAA;;AAEA,MAAMA,gBAAgB,GAAG,IAAAC,mCAAA,EAA2B,iBAA3B,CAAzB;eAEeD,gB"}
1
+ {"version":3,"names":["isReactComponent","buildMatchMemberExpression"],"sources":["../../../src/validators/react/isReactComponent.ts"],"sourcesContent":["import buildMatchMemberExpression from \"../buildMatchMemberExpression\";\n\nconst isReactComponent = buildMatchMemberExpression(\"React.Component\");\n\nexport default isReactComponent;\n"],"mappings":";;;;;;AAAA;AAEA,MAAMA,gBAAgB,GAAG,IAAAC,mCAA0B,EAAC,iBAAiB,CAAC;AAAC,eAExDD,gBAAgB;AAAA"}
@@ -6,9 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = validate;
7
7
  exports.validateChild = validateChild;
8
8
  exports.validateField = validateField;
9
-
10
9
  var _definitions = require("../definitions");
11
-
12
10
  function validate(node, key, val) {
13
11
  if (!node) return;
14
12
  const fields = _definitions.NODE_FIELDS[node.type];
@@ -17,13 +15,11 @@ function validate(node, key, val) {
17
15
  validateField(node, key, val, field);
18
16
  validateChild(node, key, val);
19
17
  }
20
-
21
18
  function validateField(node, key, val, field) {
22
19
  if (!(field != null && field.validate)) return;
23
20
  if (field.optional && val == null) return;
24
21
  field.validate(node, key, val);
25
22
  }
26
-
27
23
  function validateChild(node, key, val) {
28
24
  if (val == null) return;
29
25
  const validate = _definitions.NODE_PARENT_VALIDATIONS[val.type];
@@ -1 +1 @@
1
- {"version":3,"names":["validate","node","key","val","fields","NODE_FIELDS","type","field","validateField","validateChild","optional","NODE_PARENT_VALIDATIONS"],"sources":["../../src/validators/validate.ts"],"sourcesContent":["import {\n NODE_FIELDS,\n NODE_PARENT_VALIDATIONS,\n type FieldOptions,\n} from \"../definitions\";\nimport type * as t from \"..\";\n\nexport default function validate(\n node: t.Node | undefined | null,\n key: string,\n val: any,\n): void {\n if (!node) return;\n\n const fields = NODE_FIELDS[node.type];\n if (!fields) return;\n\n const field = fields[key];\n validateField(node, key, val, field);\n validateChild(node, key, val);\n}\n\nexport function validateField(\n node: t.Node | undefined | null,\n key: string,\n val: any,\n field: FieldOptions | undefined | null,\n): void {\n if (!field?.validate) return;\n if (field.optional && val == null) return;\n\n field.validate(node, key, val);\n}\n\nexport function validateChild(\n node: t.Node | undefined | null,\n key: string,\n val?: t.Node | undefined | null,\n) {\n if (val == null) return;\n const validate = NODE_PARENT_VALIDATIONS[val.type];\n if (!validate) return;\n validate(node, key, val);\n}\n"],"mappings":";;;;;;;;;AAAA;;AAOe,SAASA,QAAT,CACbC,IADa,EAEbC,GAFa,EAGbC,GAHa,EAIP;EACN,IAAI,CAACF,IAAL,EAAW;EAEX,MAAMG,MAAM,GAAGC,wBAAA,CAAYJ,IAAI,CAACK,IAAjB,CAAf;EACA,IAAI,CAACF,MAAL,EAAa;EAEb,MAAMG,KAAK,GAAGH,MAAM,CAACF,GAAD,CAApB;EACAM,aAAa,CAACP,IAAD,EAAOC,GAAP,EAAYC,GAAZ,EAAiBI,KAAjB,CAAb;EACAE,aAAa,CAACR,IAAD,EAAOC,GAAP,EAAYC,GAAZ,CAAb;AACD;;AAEM,SAASK,aAAT,CACLP,IADK,EAELC,GAFK,EAGLC,GAHK,EAILI,KAJK,EAKC;EACN,IAAI,EAACA,KAAD,YAACA,KAAK,CAAEP,QAAR,CAAJ,EAAsB;EACtB,IAAIO,KAAK,CAACG,QAAN,IAAkBP,GAAG,IAAI,IAA7B,EAAmC;EAEnCI,KAAK,CAACP,QAAN,CAAeC,IAAf,EAAqBC,GAArB,EAA0BC,GAA1B;AACD;;AAEM,SAASM,aAAT,CACLR,IADK,EAELC,GAFK,EAGLC,GAHK,EAIL;EACA,IAAIA,GAAG,IAAI,IAAX,EAAiB;EACjB,MAAMH,QAAQ,GAAGW,oCAAA,CAAwBR,GAAG,CAACG,IAA5B,CAAjB;EACA,IAAI,CAACN,QAAL,EAAe;EACfA,QAAQ,CAACC,IAAD,EAAOC,GAAP,EAAYC,GAAZ,CAAR;AACD"}
1
+ {"version":3,"names":["validate","node","key","val","fields","NODE_FIELDS","type","field","validateField","validateChild","optional","NODE_PARENT_VALIDATIONS"],"sources":["../../src/validators/validate.ts"],"sourcesContent":["import {\n NODE_FIELDS,\n NODE_PARENT_VALIDATIONS,\n type FieldOptions,\n} from \"../definitions\";\nimport type * as t from \"..\";\n\nexport default function validate(\n node: t.Node | undefined | null,\n key: string,\n val: any,\n): void {\n if (!node) return;\n\n const fields = NODE_FIELDS[node.type];\n if (!fields) return;\n\n const field = fields[key];\n validateField(node, key, val, field);\n validateChild(node, key, val);\n}\n\nexport function validateField(\n node: t.Node | undefined | null,\n key: string,\n val: any,\n field: FieldOptions | undefined | null,\n): void {\n if (!field?.validate) return;\n if (field.optional && val == null) return;\n\n field.validate(node, key, val);\n}\n\nexport function validateChild(\n node: t.Node | undefined | null,\n key: string,\n val?: t.Node | undefined | null,\n) {\n if (val == null) return;\n const validate = NODE_PARENT_VALIDATIONS[val.type];\n if (!validate) return;\n validate(node, key, val);\n}\n"],"mappings":";;;;;;;;AAAA;AAOe,SAASA,QAAQ,CAC9BC,IAA+B,EAC/BC,GAAW,EACXC,GAAQ,EACF;EACN,IAAI,CAACF,IAAI,EAAE;EAEX,MAAMG,MAAM,GAAGC,wBAAW,CAACJ,IAAI,CAACK,IAAI,CAAC;EACrC,IAAI,CAACF,MAAM,EAAE;EAEb,MAAMG,KAAK,GAAGH,MAAM,CAACF,GAAG,CAAC;EACzBM,aAAa,CAACP,IAAI,EAAEC,GAAG,EAAEC,GAAG,EAAEI,KAAK,CAAC;EACpCE,aAAa,CAACR,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;AAC/B;AAEO,SAASK,aAAa,CAC3BP,IAA+B,EAC/BC,GAAW,EACXC,GAAQ,EACRI,KAAsC,EAChC;EACN,IAAI,EAACA,KAAK,YAALA,KAAK,CAAEP,QAAQ,GAAE;EACtB,IAAIO,KAAK,CAACG,QAAQ,IAAIP,GAAG,IAAI,IAAI,EAAE;EAEnCI,KAAK,CAACP,QAAQ,CAACC,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;AAChC;AAEO,SAASM,aAAa,CAC3BR,IAA+B,EAC/BC,GAAW,EACXC,GAA+B,EAC/B;EACA,IAAIA,GAAG,IAAI,IAAI,EAAE;EACjB,MAAMH,QAAQ,GAAGW,oCAAuB,CAACR,GAAG,CAACG,IAAI,CAAC;EAClD,IAAI,CAACN,QAAQ,EAAE;EACfA,QAAQ,CAACC,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;AAC1B"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babel/types",
3
- "version": "7.20.0",
3
+ "version": "7.20.5",
4
4
  "description": "Babel Types is a Lodash-esque utility library for AST nodes",
5
5
  "author": "The Babel Team (https://babel.dev/team)",
6
6
  "homepage": "https://babel.dev/docs/en/next/babel-types",
@@ -29,8 +29,8 @@
29
29
  "to-fast-properties": "^2.0.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@babel/generator": "^7.20.0",
33
- "@babel/parser": "^7.20.0",
32
+ "@babel/generator": "^7.20.5",
33
+ "@babel/parser": "^7.20.5",
34
34
  "chalk": "^4.1.0",
35
35
  "glob": "^7.2.0"
36
36
  },
@@ -2,7 +2,7 @@
2
2
  "name": "regenerator-runtime",
3
3
  "author": "Ben Newman <bn@cs.stanford.edu>",
4
4
  "description": "Runtime for Regenerator-compiled generator and async functions.",
5
- "version": "0.13.10",
5
+ "version": "0.13.11",
6
6
  "main": "runtime.js",
7
7
  "keywords": [
8
8
  "regenerator",
@@ -13,7 +13,7 @@
13
13
  "sideEffects": true,
14
14
  "repository": {
15
15
  "type": "git",
16
- "url": "https://github.com/facebook/regenerator/tree/master/packages/runtime"
16
+ "url": "https://github.com/facebook/regenerator/tree/main/packages/runtime"
17
17
  },
18
18
  "license": "MIT"
19
19
  }
@@ -329,31 +329,32 @@ var runtime = (function (exports) {
329
329
  // delegate iterator, or by modifying context.method and context.arg,
330
330
  // setting context.delegate to null, and returning the ContinueSentinel.
331
331
  function maybeInvokeDelegate(delegate, context) {
332
- var method = delegate.iterator[context.method];
332
+ var methodName = context.method;
333
+ var method = delegate.iterator[methodName];
333
334
  if (method === undefined) {
334
335
  // A .throw or .return when the delegate iterator has no .throw
335
- // method always terminates the yield* loop.
336
+ // method, or a missing .next mehtod, always terminate the
337
+ // yield* loop.
336
338
  context.delegate = null;
337
339
 
338
- if (context.method === "throw") {
339
- // Note: ["return"] must be used for ES3 parsing compatibility.
340
- if (delegate.iterator["return"]) {
341
- // If the delegate iterator has a return method, give it a
342
- // chance to clean up.
343
- context.method = "return";
344
- context.arg = undefined;
345
- maybeInvokeDelegate(delegate, context);
340
+ // Note: ["return"] must be used for ES3 parsing compatibility.
341
+ if (methodName === "throw" && delegate.iterator["return"]) {
342
+ // If the delegate iterator has a return method, give it a
343
+ // chance to clean up.
344
+ context.method = "return";
345
+ context.arg = undefined;
346
+ maybeInvokeDelegate(delegate, context);
346
347
 
347
- if (context.method === "throw") {
348
- // If maybeInvokeDelegate(context) changed context.method from
349
- // "return" to "throw", let that override the TypeError below.
350
- return ContinueSentinel;
351
- }
348
+ if (context.method === "throw") {
349
+ // If maybeInvokeDelegate(context) changed context.method from
350
+ // "return" to "throw", let that override the TypeError below.
351
+ return ContinueSentinel;
352
352
  }
353
-
353
+ }
354
+ if (methodName !== "return") {
354
355
  context.method = "throw";
355
356
  context.arg = new TypeError(
356
- "The iterator does not provide a 'throw' method");
357
+ "The iterator does not provide a '" + methodName + "' method");
357
358
  }
358
359
 
359
360
  return ContinueSentinel;
@@ -74,15 +74,3 @@ function App() {
74
74
  )
75
75
  }
76
76
  export default App
77
-
78
- // import config from './config'
79
-
80
- // function App() {
81
- // return (
82
- // <div className="max-w-6xl mx-4 xl:mx-auto border rounded-md shadow-lg my-24 p-4 sm:p-12">
83
- // <pre>{JSON.stringify(config, null, 2)}</pre>
84
- // </div>
85
- // )
86
- // }
87
-
88
- // export default App
@@ -30111,49 +30111,6 @@ 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
-
30157
30114
  // ../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
30158
30115
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
30159
30116
  var freeGlobal_default = freeGlobal;
@@ -30563,8 +30520,6 @@ var remarkToSlate = (root3, field, imageCallback) => {
30563
30520
  return code2(content4);
30564
30521
  case "paragraph":
30565
30522
  return paragraph2(content4);
30566
- case "image":
30567
- return image2(content4);
30568
30523
  case "mdxJsxFlowElement":
30569
30524
  return mdxJsxElement(content4, field, imageCallback);
30570
30525
  case "thematicBreak":
@@ -30871,7 +30826,6 @@ var markdownToAst = (value, field) => {
30871
30826
  if (!tree) {
30872
30827
  throw new Error("Error parsing markdown");
30873
30828
  }
30874
- remarkUnwrapImages({})(tree);
30875
30829
  return tree;
30876
30830
  } catch (e) {
30877
30831
  throw new RichTextParseError(e, e.position);
@@ -25,6 +25,7 @@ import * as G from 'graphql'
25
25
  import { formify } from '../formify'
26
26
  import { Data, documentMachine } from './document-machine'
27
27
  import type { ActorRefFrom } from 'xstate'
28
+ import { getIn } from 'final-form'
28
29
 
29
30
  export type DataType = Record<string, unknown>
30
31
  type DocumentInfo = {
@@ -299,6 +300,30 @@ export const queryMachine =
299
300
  variableValues: context.variables,
300
301
  fieldResolver: (source, args, _context, info) => {
301
302
  const fieldName = info.fieldName
303
+
304
+ /**
305
+ * Since the `source` for this resolver is the query that
306
+ * ran before passing it into `useTina`, we need to take aliases
307
+ * into consideration, so if an alias is provided we try to
308
+ * see if that has the value we're looking for. This isn't a perfect
309
+ * solution as the `value` gets overwritten depending on the alias
310
+ * query.
311
+ */
312
+ const aliases: string[] = []
313
+ info.fieldNodes.forEach((fieldNode) => {
314
+ if (fieldNode.alias) {
315
+ aliases.push(fieldNode.alias.value)
316
+ }
317
+ })
318
+ let value = source[fieldName]
319
+ if (!value) {
320
+ aliases.forEach((alias) => {
321
+ const aliasValue = source[alias]
322
+ if (aliasValue) {
323
+ value = aliasValue
324
+ }
325
+ })
326
+ }
302
327
  /**
303
328
  * Formify adds `_internalSys` and `_internalValues` to the query
304
329
  * and a user's query might also include `_values` or `_sys`, but
@@ -372,7 +397,7 @@ export const queryMachine =
372
397
  return null
373
398
  }
374
399
  }
375
- return source[fieldName]
400
+ return value
376
401
  },
377
402
  })
378
403
  if (missingForms.length > 0) {
@@ -384,6 +409,106 @@ export const queryMachine =
384
409
  missingForm.skipFormRegister
385
410
  )
386
411
  }
412
+ // Populate __meta__ property for use
413
+ // in active field indicator utility
414
+ const META_KEY = '__meta__'
415
+ function* traverse(o) {
416
+ const memory = new Set()
417
+ function* innerTraversal(o, path = []) {
418
+ if (memory.has(o)) {
419
+ // we've seen this object before don't iterate it
420
+ return
421
+ }
422
+ // add the new object to our memory.
423
+ memory.add(o)
424
+ for (let i of Object.keys(o)) {
425
+ const itemPath = path.concat(i)
426
+ yield [i, o[i], itemPath, o]
427
+ if (o[i] !== null && typeof o[i] == 'object') {
428
+ if (i !== META_KEY) {
429
+ //going one step down in the object tree!!
430
+ yield* innerTraversal(o[i], itemPath)
431
+ }
432
+ }
433
+ }
434
+ }
435
+ yield* innerTraversal(o)
436
+ }
437
+ const nodePaths = []
438
+ for (let [key, value, path, parent] of traverse(newData.data)) {
439
+ if (value?._internalSys) {
440
+ nodePaths.push(path)
441
+ const fields = {}
442
+ const parents = nodePaths.filter((nodePath) => {
443
+ return path.join('.').startsWith(nodePath.join('.'))
444
+ })
445
+
446
+ const nearestParent = parents.reduce(function (a, b) {
447
+ return a.length < b.length ? a : b
448
+ })
449
+ Object.keys(value).map((key) => {
450
+ if (
451
+ [
452
+ '__typename',
453
+ '_internalSys',
454
+ '_internalValues',
455
+ '_sys',
456
+ ].includes(key)
457
+ ) {
458
+ return false
459
+ }
460
+ fields[key] = [
461
+ ...path.slice(nearestParent.length + 1),
462
+ key,
463
+ ].join('.')
464
+ })
465
+ value[META_KEY] = {
466
+ id: value?._internalSys.path,
467
+ name: path.slice(nearestParent.length).join('.'),
468
+ fields,
469
+ }
470
+ } else if (
471
+ typeof value === 'object' &&
472
+ !Array.isArray(value) &&
473
+ value !== null
474
+ ) {
475
+ if (key !== META_KEY) {
476
+ const parents = nodePaths.filter((nodePath) => {
477
+ return path.join('.').startsWith(nodePath.join('.'))
478
+ })
479
+ if (parents.length) {
480
+ const nearestParent = parents.reduce(function (a, b) {
481
+ return a.length < b.length ? a : b
482
+ })
483
+ const parent = getIn(newData.data, nearestParent.join('.'))
484
+ const id = parent._internalSys.path
485
+ const fields = {}
486
+ Object.keys(value).map((key) => {
487
+ if (
488
+ [
489
+ '__typename',
490
+ '_internalSys',
491
+ '_internalValues',
492
+ '_sys',
493
+ ].includes(key)
494
+ ) {
495
+ return false
496
+ }
497
+
498
+ fields[key] = [
499
+ ...path.slice(nearestParent.length),
500
+ key,
501
+ ].join('.')
502
+ })
503
+ value[META_KEY] = {
504
+ id,
505
+ name: path.slice(nearestParent.length).join('.'),
506
+ fields,
507
+ }
508
+ }
509
+ }
510
+ }
511
+ }
387
512
  return { data: newData.data }
388
513
  },
389
514
  initializer: async (context, event) => {
@@ -505,7 +630,10 @@ const resolveFormValue = <T extends Record<string, unknown>>({
505
630
  const accum: Record<string, unknown> = {}
506
631
  fields.forEach((field) => {
507
632
  const v = values[field.name]
508
- if (!v) {
633
+ if (typeof v === 'undefined') {
634
+ return
635
+ }
636
+ if (v === null) {
509
637
  return
510
638
  }
511
639
  accum[field.name] = resolveFieldValue({
@@ -14,6 +14,7 @@ import React from 'react'
14
14
  import { useMachine } from '@xstate/react'
15
15
  import { queryMachine, initialContext } from './lib/machines/query-machine'
16
16
  import { useCMS, defineConfig } from 'tinacms'
17
+ import type { formifyCallback as FormifyCallback } from 'tinacms/dist/hooks/use-graphql-forms'
17
18
 
18
19
  type Config = Parameters<typeof defineConfig>[0]
19
20
 
@@ -48,23 +49,15 @@ export const Preview = (
48
49
  key={activeQuery.id}
49
50
  payload={activeQuery}
50
51
  iframeRef={props.iframeRef}
52
+ formifyCallback={props.formifyCallback}
51
53
  />
52
54
  )}
53
- <div className="h-full overflow-scroll">
54
- <div className="">
55
- <div className="col-span-5 ">
56
- <div className="h-screen flex flex-col">
57
- <div className="relative flex-1 bg-gray-300 col-span-2 overflow-scroll flex items-center justify-center">
58
- <iframe
59
- ref={props.iframeRef}
60
- className="h-full w-full bg-white"
61
- src={props.url}
62
- />
63
- </div>
64
- </div>
65
- </div>
66
- </div>
67
- </div>
55
+ <iframe
56
+ id="tina-iframe"
57
+ ref={props.iframeRef}
58
+ className="h-screen w-full bg-white"
59
+ src={props.url}
60
+ />
68
61
  </div>
69
62
  )
70
63
  }
@@ -72,6 +65,7 @@ export const Preview = (
72
65
  const QueryMachine = (props: {
73
66
  payload: PostMessage
74
67
  iframeRef: React.MutableRefObject<HTMLIFrameElement>
68
+ formifyCallback: FormifyCallback
75
69
  }) => {
76
70
  const cms = useCMS()
77
71
 
package/dist/index.js CHANGED
@@ -378,7 +378,7 @@ var viteBuild = async ({
378
378
  mode: local ? "development" : "production",
379
379
  plugins: [(0, import_vite.splitVendorChunkPlugin)(), (0, import_plugin_react.default)(), viteTina()],
380
380
  define: {
381
- "process.env": "new Object()",
381
+ "process.env": `new Object(${JSON.stringify(process.env)})`,
382
382
  __API_URL__: `"${apiUrl}"`
383
383
  },
384
384
  esbuild: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/app",
3
- "version": "0.0.28",
3
+ "version": "1.0.1",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -36,9 +36,9 @@
36
36
  "@types/fs-extra": "^9.0.1",
37
37
  "@types/react": "17.0.2",
38
38
  "@types/react-dom": "17.0.2",
39
- "@tinacms/scripts": "0.51.3",
40
- "tinacms": "0.70.2",
41
- "@tinacms/mdx": "0.61.17",
39
+ "@tinacms/scripts": "1.0.0",
40
+ "tinacms": "1.0.2",
41
+ "@tinacms/mdx": "1.0.2",
42
42
  "jest": "^27.0.6"
43
43
  },
44
44
  "dependencies": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}