@tinacms/app 1.0.2 → 1.0.4

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 (68) hide show
  1. package/appFiles/node_modules/.package-lock.json +24 -24
  2. package/appFiles/node_modules/@babel/generator/lib/node/parentheses.js +5 -1
  3. package/appFiles/node_modules/@babel/generator/lib/node/parentheses.js.map +1 -1
  4. package/appFiles/node_modules/@babel/generator/lib/printer.js +3 -2
  5. package/appFiles/node_modules/@babel/generator/lib/printer.js.map +1 -1
  6. package/appFiles/node_modules/@babel/generator/package.json +3 -3
  7. package/appFiles/node_modules/@babel/parser/lib/index.js +22 -11
  8. package/appFiles/node_modules/@babel/parser/lib/index.js.map +1 -1
  9. package/appFiles/node_modules/@babel/parser/package.json +1 -1
  10. package/appFiles/node_modules/@babel/runtime/helpers/applyDecs.js +3 -9
  11. package/appFiles/node_modules/@babel/runtime/helpers/applyDecs2203.js +3 -9
  12. package/appFiles/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +1 -3
  13. package/appFiles/node_modules/@babel/runtime/helpers/classNameTDZError.js +1 -1
  14. package/appFiles/node_modules/@babel/runtime/helpers/defineAccessor.js +8 -0
  15. package/appFiles/node_modules/@babel/runtime/helpers/esm/applyDecs.js +3 -9
  16. package/appFiles/node_modules/@babel/runtime/helpers/esm/applyDecs2203.js +3 -9
  17. package/appFiles/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +1 -3
  18. package/appFiles/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js +1 -1
  19. package/appFiles/node_modules/@babel/runtime/helpers/esm/defineAccessor.js +7 -0
  20. package/appFiles/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +1 -3
  21. package/appFiles/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js +1 -3
  22. package/appFiles/node_modules/@babel/runtime/helpers/esm/jsx.js +2 -6
  23. package/appFiles/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +3 -9
  24. package/appFiles/node_modules/@babel/runtime/helpers/esm/set.js +1 -1
  25. package/appFiles/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js +1 -3
  26. package/appFiles/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +1 -3
  27. package/appFiles/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js +1 -3
  28. package/appFiles/node_modules/@babel/runtime/helpers/jsx.js +2 -6
  29. package/appFiles/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +3 -9
  30. package/appFiles/node_modules/@babel/runtime/helpers/set.js +1 -1
  31. package/appFiles/node_modules/@babel/runtime/helpers/wrapRegExp.js +1 -3
  32. package/appFiles/node_modules/@babel/runtime/package.json +10 -1
  33. package/appFiles/node_modules/@babel/template/lib/builder.js +3 -15
  34. package/appFiles/node_modules/@babel/template/lib/builder.js.map +1 -0
  35. package/appFiles/node_modules/@babel/template/lib/formatters.js +3 -8
  36. package/appFiles/node_modules/@babel/template/lib/formatters.js.map +1 -0
  37. package/appFiles/node_modules/@babel/template/lib/index.js +2 -5
  38. package/appFiles/node_modules/@babel/template/lib/index.js.map +1 -0
  39. package/appFiles/node_modules/@babel/template/lib/literal.js +3 -13
  40. package/appFiles/node_modules/@babel/template/lib/literal.js.map +1 -0
  41. package/appFiles/node_modules/@babel/template/lib/options.js +10 -19
  42. package/appFiles/node_modules/@babel/template/lib/options.js.map +1 -0
  43. package/appFiles/node_modules/@babel/template/lib/parse.js +3 -23
  44. package/appFiles/node_modules/@babel/template/lib/parse.js.map +1 -0
  45. package/appFiles/node_modules/@babel/template/lib/populate.js +3 -15
  46. package/appFiles/node_modules/@babel/template/lib/populate.js.map +1 -0
  47. package/appFiles/node_modules/@babel/template/lib/string.js +3 -5
  48. package/appFiles/node_modules/@babel/template/lib/string.js.map +1 -0
  49. package/appFiles/node_modules/@babel/template/package.json +3 -3
  50. package/appFiles/node_modules/@babel/traverse/lib/path/conversion.js.map +1 -1
  51. package/appFiles/node_modules/@babel/traverse/lib/path/index.js.map +1 -1
  52. package/appFiles/node_modules/@babel/traverse/lib/path/introspection.js +7 -2
  53. package/appFiles/node_modules/@babel/traverse/lib/path/introspection.js.map +1 -1
  54. package/appFiles/node_modules/@babel/traverse/lib/path/modification.js +9 -4
  55. package/appFiles/node_modules/@babel/traverse/lib/path/modification.js.map +1 -1
  56. package/appFiles/node_modules/@babel/traverse/lib/scope/index.js +20 -11
  57. package/appFiles/node_modules/@babel/traverse/lib/scope/index.js.map +1 -1
  58. package/appFiles/node_modules/@babel/traverse/lib/scope/lib/renamer.js +6 -8
  59. package/appFiles/node_modules/@babel/traverse/lib/scope/lib/renamer.js.map +1 -1
  60. package/appFiles/node_modules/@babel/traverse/package.json +4 -4
  61. package/appFiles/node_modules/@babel/types/lib/asserts/assertNode.js.map +1 -1
  62. package/appFiles/node_modules/@babel/types/lib/traverse/traverse.js.map +1 -1
  63. package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js +2 -1
  64. package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js.map +1 -1
  65. package/appFiles/node_modules/@babel/types/package.json +3 -3
  66. package/appFiles/src/preview.tsx +7 -7
  67. package/dist/index.js +3 -1
  68. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"names":["renameVisitor","ReferencedIdentifier","node","state","name","oldName","newName","Scope","path","scope","bindingIdentifierEquals","binding","identifier","skip","isMethod","requeueComputedKeyAndDecorators","isVariableDeclaration","ids","getOuterBindingIdentifiers","Renamer","constructor","maybeConvertFromExportDeclaration","parentDeclar","maybeExportDeclar","parentPath","isExportDeclaration","isExportDefaultDeclaration","declaration","t","isDeclaration","id","isExportAllDeclaration","splitExportDeclaration","maybeConvertFromClassFunctionDeclaration","maybeConvertFromClassFunctionExpression","rename","block","find","isFunctionExpression","isClassExpression","bindingIds","blockToTraverse","type","cases","forEach","c","traverse","removeOwnBinding","bindings"],"sources":["../../../src/scope/lib/renamer.ts"],"sourcesContent":["import type Binding from \"../binding\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\nimport * as t from \"@babel/types\";\nimport type { NodePath, Visitor } from \"../..\";\nimport { requeueComputedKeyAndDecorators } from \"@babel/helper-environment-visitor\";\n\nconst renameVisitor: Visitor<Renamer> = {\n ReferencedIdentifier({ node }, state) {\n if (node.name === state.oldName) {\n node.name = state.newName;\n }\n },\n\n Scope(path, state) {\n if (\n !path.scope.bindingIdentifierEquals(\n state.oldName,\n state.binding.identifier,\n )\n ) {\n path.skip();\n if (path.isMethod()) {\n requeueComputedKeyAndDecorators(path);\n }\n }\n },\n\n \"AssignmentExpression|Declaration|VariableDeclarator\"(\n path: NodePath<t.AssignmentPattern | t.Declaration | t.VariableDeclarator>,\n state,\n ) {\n if (path.isVariableDeclaration()) return;\n const ids = path.getOuterBindingIdentifiers();\n\n for (const name in ids) {\n if (name === state.oldName) ids[name].name = state.newName;\n }\n },\n};\n\nexport default class Renamer {\n constructor(binding: Binding, oldName: string, newName: string) {\n this.newName = newName;\n this.oldName = oldName;\n this.binding = binding;\n }\n\n declare oldName: string;\n declare newName: string;\n declare binding: Binding;\n\n maybeConvertFromExportDeclaration(parentDeclar: NodePath) {\n const maybeExportDeclar = parentDeclar.parentPath;\n\n if (!maybeExportDeclar.isExportDeclaration()) {\n return;\n }\n\n if (maybeExportDeclar.isExportDefaultDeclaration()) {\n const { declaration } = maybeExportDeclar.node;\n if (t.isDeclaration(declaration) && !declaration.id) {\n return;\n }\n }\n\n if (maybeExportDeclar.isExportAllDeclaration()) {\n return;\n }\n\n splitExportDeclaration(\n maybeExportDeclar as NodePath<\n Exclude<t.ExportDeclaration, t.ExportAllDeclaration>\n >,\n );\n }\n\n maybeConvertFromClassFunctionDeclaration(path: NodePath) {\n return path; // TODO\n\n // // retain the `name` of a class/function declaration\n\n // if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return;\n // if (this.binding.kind !== \"hoisted\") return;\n\n // path.node.id = identifier(this.oldName);\n // path.node._blockHoist = 3;\n\n // path.replaceWith(\n // variableDeclaration(\"let\", [\n // variableDeclarator(identifier(this.newName), toExpression(path.node)),\n // ]),\n // );\n }\n\n maybeConvertFromClassFunctionExpression(path: NodePath) {\n return path; // TODO\n\n // // retain the `name` of a class/function expression\n\n // if (!path.isFunctionExpression() && !path.isClassExpression()) return;\n // if (this.binding.kind !== \"local\") return;\n\n // path.node.id = identifier(this.oldName);\n\n // this.binding.scope.parent.push({\n // id: identifier(this.newName),\n // });\n\n // path.replaceWith(\n // assignmentExpression(\"=\", identifier(this.newName), path.node),\n // );\n }\n\n rename(block?: t.Pattern | t.Scopable) {\n const { binding, oldName, newName } = this;\n const { scope, path } = binding;\n\n const parentDeclar = path.find(\n path =>\n path.isDeclaration() ||\n path.isFunctionExpression() ||\n path.isClassExpression(),\n );\n if (parentDeclar) {\n const bindingIds = parentDeclar.getOuterBindingIdentifiers();\n if (bindingIds[oldName] === binding.identifier) {\n // When we are renaming an exported identifier, we need to ensure that\n // the exported binding keeps the old name.\n this.maybeConvertFromExportDeclaration(parentDeclar);\n }\n }\n\n const blockToTraverse = block || scope.block;\n if (blockToTraverse?.type === \"SwitchStatement\") {\n // discriminant is not part of current scope, should be skipped.\n blockToTraverse.cases.forEach(c => {\n scope.traverse(c, renameVisitor, this);\n });\n } else {\n scope.traverse(blockToTraverse, renameVisitor, this);\n }\n\n if (!block) {\n scope.removeOwnBinding(oldName);\n scope.bindings[newName] = binding;\n this.binding.identifier.name = newName;\n }\n\n if (parentDeclar) {\n this.maybeConvertFromClassFunctionDeclaration(path);\n this.maybeConvertFromClassFunctionExpression(path);\n }\n }\n}\n"],"mappings":";;;;;;AACA;AACA;AAEA;AAEA,MAAMA,aAA+B,GAAG;EACtCC,oBAAoB,CAAC;IAAEC;EAAK,CAAC,EAAEC,KAAK,EAAE;IACpC,IAAID,IAAI,CAACE,IAAI,KAAKD,KAAK,CAACE,OAAO,EAAE;MAC/BH,IAAI,CAACE,IAAI,GAAGD,KAAK,CA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OAAO,CAAC;MAC/BI,KAAK,CAACuC,QAAQ,CAAC1C,OAAO,CAAC,GAAGK,OAAO;MACjC,IAAI,CAACA,OAAO,CAACC,UAAU,CAACR,IAAI,GAAGE,OAAO;IACxC;IAEA,IAAIgB,YAAY,EAAE;MAChB,IAAI,CAACW,wCAAwC,CAACzB,IAAI,CAAC;MACnD,IAAI,CAAC0B,uCAAuC,CAAC1B,IAAI,CAAC;IACpD;EACF;AACF;AAAC"}
1
+ {"version":3,"names":["renameVisitor","ReferencedIdentifier","node","state","name","oldName","newName","Scope","path","scope","bindingIdentifierEquals","binding","identifier","skip","isMethod","requeueComputedKeyAndDecorators","isVariableDeclaration","ids","getOuterBindingIdentifiers","Renamer","constructor","maybeConvertFromExportDeclaration","parentDeclar","maybeExportDeclar","parentPath","isExportDeclaration","isExportDefaultDeclaration","declaration","t","isDeclaration","id","isExportAllDeclaration","splitExportDeclaration","maybeConvertFromClassFunctionDeclaration","maybeConvertFromClassFunctionExpression","rename","block","find","isFunctionExpression","isClassExpression","bindingIds","traverseNode","explode","discriminant","removeOwnBinding","bindings"],"sources":["../../../src/scope/lib/renamer.ts"],"sourcesContent":["import type Binding from \"../binding\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\nimport * as t from \"@babel/types\";\nimport type { NodePath, Visitor } from \"../..\";\nimport { requeueComputedKeyAndDecorators } from \"@babel/helper-environment-visitor\";\nimport { traverseNode } from \"../../traverse-node\";\nimport { explode } from \"../../visitors\";\n\nconst renameVisitor: Visitor<Renamer> = {\n ReferencedIdentifier({ node }, state) {\n if (node.name === state.oldName) {\n node.name = state.newName;\n }\n },\n\n Scope(path, state) {\n if (\n !path.scope.bindingIdentifierEquals(\n state.oldName,\n state.binding.identifier,\n )\n ) {\n path.skip();\n if (path.isMethod()) {\n requeueComputedKeyAndDecorators(path);\n }\n }\n },\n\n \"AssignmentExpression|Declaration|VariableDeclarator\"(\n path: NodePath<t.AssignmentPattern | t.Declaration | t.VariableDeclarator>,\n state,\n ) {\n if (path.isVariableDeclaration()) return;\n const ids = path.getOuterBindingIdentifiers();\n\n for (const name in ids) {\n if (name === state.oldName) ids[name].name = state.newName;\n }\n },\n};\n\nexport default class Renamer {\n constructor(binding: Binding, oldName: string, newName: string) {\n this.newName = newName;\n this.oldName = oldName;\n this.binding = binding;\n }\n\n declare oldName: string;\n declare newName: string;\n declare binding: Binding;\n\n maybeConvertFromExportDeclaration(parentDeclar: NodePath) {\n const maybeExportDeclar = parentDeclar.parentPath;\n\n if (!maybeExportDeclar.isExportDeclaration()) {\n return;\n }\n\n if (maybeExportDeclar.isExportDefaultDeclaration()) {\n const { declaration } = maybeExportDeclar.node;\n if (t.isDeclaration(declaration) && !declaration.id) {\n return;\n }\n }\n\n if (maybeExportDeclar.isExportAllDeclaration()) {\n return;\n }\n\n splitExportDeclaration(\n maybeExportDeclar as NodePath<\n Exclude<t.ExportDeclaration, t.ExportAllDeclaration>\n >,\n );\n }\n\n maybeConvertFromClassFunctionDeclaration(path: NodePath) {\n return path; // TODO\n\n // // retain the `name` of a class/function declaration\n\n // if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return;\n // if (this.binding.kind !== \"hoisted\") return;\n\n // path.node.id = identifier(this.oldName);\n // path.node._blockHoist = 3;\n\n // path.replaceWith(\n // variableDeclaration(\"let\", [\n // variableDeclarator(identifier(this.newName), toExpression(path.node)),\n // ]),\n // );\n }\n\n maybeConvertFromClassFunctionExpression(path: NodePath) {\n return path; // TODO\n\n // // retain the `name` of a class/function expression\n\n // if (!path.isFunctionExpression() && !path.isClassExpression()) return;\n // if (this.binding.kind !== \"local\") return;\n\n // path.node.id = identifier(this.oldName);\n\n // this.binding.scope.parent.push({\n // id: identifier(this.newName),\n // });\n\n // path.replaceWith(\n // assignmentExpression(\"=\", identifier(this.newName), path.node),\n // );\n }\n\n // TODO(Babel 8): Remove this `block` parameter. It's not needed anywhere.\n rename(block?: t.Pattern | t.Scopable) {\n const { binding, oldName, newName } = this;\n const { scope, path } = binding;\n\n const parentDeclar = path.find(\n path =>\n path.isDeclaration() ||\n path.isFunctionExpression() ||\n path.isClassExpression(),\n );\n if (parentDeclar) {\n const bindingIds = parentDeclar.getOuterBindingIdentifiers();\n if (bindingIds[oldName] === binding.identifier) {\n // When we are renaming an exported identifier, we need to ensure that\n // the exported binding keeps the old name.\n this.maybeConvertFromExportDeclaration(parentDeclar);\n }\n }\n\n traverseNode(\n block || scope.block,\n explode(renameVisitor),\n scope,\n this,\n scope.path,\n // When blockToTraverse is a SwitchStatement, the discriminant\n // is not part of the current scope and thus should be skipped.\n { discriminant: true },\n );\n\n if (!block) {\n scope.removeOwnBinding(oldName);\n scope.bindings[newName] = binding;\n this.binding.identifier.name = newName;\n }\n\n if (parentDeclar) {\n this.maybeConvertFromClassFunctionDeclaration(path);\n this.maybeConvertFromClassFunctionExpression(path);\n }\n }\n}\n"],"mappings":";;;;;;AACA;AACA;AAEA;AACA;AACA;AAEA,MAAMA,aAA+B,GAAG;EACtCC,oBAAoB,CAAC;IAAEC;EAAK,CAAC,EAAEC,KAAK,EAAE;IACpC,IAAID,IAAI,CAACE,IAAI,KAAKD,KAAK,CAACE,OAAO,EAAE;MAC/BH,IAAI,CAACE,IAAI,GAAGD,KAAK,CAACG,OAAO;IAC3B;EACF,CAAC;EAEDC,KAAK,CAACC,IAAI,EAAEL,KAAK,EAAE;IACjB,IACE,CAACK,IAAI,CAACC,KAAK,CAACC,uBAAuB,CACjCP,KAAK,CAACE,OAAO,EACbF,KAAK,CAACQ,OAAO,CAACC,UAAU,CACzB,EACD;MACAJ,IAAI,CAACK,IAAI,EAAE;MACX,IAAIL,IAAI,CAACM,QAAQ,EAAE,EAAE;QACnB,IAAAC,yDAA+B,EAACP,IAAI,CAAC;MACvC;IACF;EACF,CAAC;EAED,qDAAqD,CACnDA,IAA0E,EAC1EL,KAAK,EACL;IACA,IAAIK,IAAI,CAACQ,qBAAqB,EAAE,EAAE;IAClC,MAAMC,GAAG,GAAGT,IAAI,CAACU,0B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IAAI,CAACqB,aAAa,EAAE,IACpBrB,IAAI,CAAC8B,oBAAoB,EAAE,IAC3B9B,IAAI,CAAC+B,iBAAiB,EAAE,CAC3B;IACD,IAAIjB,YAAY,EAAE;MAChB,MAAMkB,UAAU,GAAGlB,YAAY,CAACJ,0BAA0B,EAAE;MAC5D,IAAIsB,UAAU,CAACnC,OAAO,CAAC,KAAKM,OAAO,CAACC,UAAU,EAAE;QAG9C,IAAI,CAACS,iCAAiC,CAACC,YAAY,CAAC;MACtD;IACF;IAEA,IAAAmB,0BAAY,EACVL,KAAK,IAAI3B,KAAK,CAAC2B,KAAK,EACpB,IAAAM,iBAAO,EAAC1C,aAAa,CAAC,EACtBS,KAAK,EACL,IAAI,EACJA,KAAK,CAACD,IAAI;IAGV;MAAEmC,YAAY,EAAE;IAAK,CAAC,CACvB;IAED,IAAI,CAACP,KAAK,EAAE;MACV3B,KAAK,CAACmC,gBAAgB,CAACvC,OAAO,CAAC;MAC/BI,KAAK,CAACoC,QAAQ,CAACvC,OAAO,CAAC,GAAGK,OAAO;MACjC,IAAI,CAACA,OAAO,CAACC,UAAU,CAACR,IAAI,GAAGE,OAAO;IACxC;IAEA,IAAIgB,YAAY,EAAE;MAChB,IAAI,CAACW,wCAAwC,CAACzB,IAAI,CAAC;MACnD,IAAI,CAAC0B,uCAAuC,CAAC1B,IAAI,CAAC;IACpD;EACF;AACF;AAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babel/traverse",
3
- "version": "7.20.5",
3
+ "version": "7.20.8",
4
4
  "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes",
5
5
  "author": "The Babel Team (https://babel.dev/team)",
6
6
  "homepage": "https://babel.dev/docs/en/next/babel-traverse",
@@ -17,13 +17,13 @@
17
17
  "main": "./lib/index.js",
18
18
  "dependencies": {
19
19
  "@babel/code-frame": "^7.18.6",
20
- "@babel/generator": "^7.20.5",
20
+ "@babel/generator": "^7.20.7",
21
21
  "@babel/helper-environment-visitor": "^7.18.9",
22
22
  "@babel/helper-function-name": "^7.19.0",
23
23
  "@babel/helper-hoist-variables": "^7.18.6",
24
24
  "@babel/helper-split-export-declaration": "^7.18.6",
25
- "@babel/parser": "^7.20.5",
26
- "@babel/types": "^7.20.5",
25
+ "@babel/parser": "^7.20.7",
26
+ "@babel/types": "^7.20.7",
27
27
  "debug": "^4.1.0",
28
28
  "globals": "^11.1.0"
29
29
  },
@@ -1 +1 @@
1
- {"version":3,"names":["assertNode","node","isNode","type","JSON","stringify","TypeError"],"sources":["../../src/asserts/assertNode.ts"],"sourcesContent":["import isNode from \"../validators/isNode\";\nimport type * as t from \"..\";\n\nexport default function assertNode(node?: any): asserts node is t.Node {\n if (!isNode(node)) {\n const type = node?.type ?? JSON.stringify(node);\n throw new TypeError(`Not a valid node of type \"${type as any}\"`);\n }\n}\n"],"mappings":";;;;;;AAAA;AAGe,SAASA,UAAU,CAACC,IAAU,EAA0B;EACrE,IAAI,CAAC,IAAAC,eAAM,EAACD,IAAI,CAAC,EAAE;IAAA;IACjB,MAAME,IAAI,iBAAGF,IAAI,oBAAJA,IAAI,CAAEE,IAAI,yBAAIC,IAAI,CAACC,SAAS,CAACJ,IAAI,CAAC;IAC/C,MAAM,IAAIK,SAAS,CAAE,6BAA4BH,IAAY,GAAE,CAAC;EAClE;AACF"}
1
+ {"version":3,"names":["assertNode","node","isNode","type","JSON","stringify","TypeError"],"sources":["../../src/asserts/assertNode.ts"],"sourcesContent":["import isNode from \"../validators/isNode\";\nimport type * as t from \"..\";\n\nexport default function assertNode(node?: any): asserts node is t.Node {\n if (!isNode(node)) {\n const type = node?.type ?? JSON.stringify(node);\n throw new TypeError(`Not a valid node of type \"${type}\"`);\n }\n}\n"],"mappings":";;;;;;AAAA;AAGe,SAASA,UAAU,CAACC,IAAU,EAA0B;EACrE,IAAI,CAAC,IAAAC,eAAM,EAACD,IAAI,CAAC,EAAE;IAAA;IACjB,MAAME,IAAI,iBAAGF,IAAI,oBAAJA,IAAI,CAAEE,IAAI,yBAAIC,IAAI,CAACC,SAAS,CAACJ,IAAI,CAAC;IAC/C,MAAM,IAAIK,SAAS,CAAE,6BAA4BH,IAAK,GAAE,CAAC;EAC3D;AACF"}
@@ -1 +1 @@
1
- {"version":3,"names":["traverse","node","handlers","state","enter","exit","traverseSimpleImpl","ancestors","keys","VISITOR_KEYS","type","key","subNode","Array","isArray","i","length","child","push","index","pop"],"sources":["../../src/traverse/traverse.ts"],"sourcesContent":["import { VISITOR_KEYS } from \"../definitions\";\nimport type * as t from \"..\";\n\nexport type TraversalAncestors = Array<{\n node: t.Node;\n key: string;\n index?: number;\n}>;\n\nexport type TraversalHandler<T> = (\n this: undefined,\n node: t.Node,\n parent: TraversalAncestors,\n state: T,\n) => void;\n\nexport type TraversalHandlers<T> = {\n enter?: TraversalHandler<T>;\n exit?: TraversalHandler<T>;\n};\n\n/**\n * A general AST traversal with both prefix and postfix handlers, and a\n * state object. Exposes ancestry data to each handler so that more complex\n * AST data can be taken into account.\n */\nexport default function traverse<T>(\n node: t.Node,\n handlers: TraversalHandler<T> | TraversalHandlers<T>,\n state?: T,\n): void {\n if (typeof handlers === \"function\") {\n handlers = { enter: handlers };\n }\n\n const { enter, exit } = handlers as TraversalHandlers<T>;\n\n traverseSimpleImpl(node, enter, exit, state, []);\n}\n\nfunction traverseSimpleImpl<T>(\n node: any,\n enter: Function | undefined,\n exit: Function | undefined,\n state: T | undefined,\n ancestors: TraversalAncestors,\n) {\n const keys = VISITOR_KEYS[node.type];\n if (!keys) return;\n\n if (enter) enter(node, ancestors, state);\n\n for (const key of keys) {\n const subNode = node[key];\n\n if (Array.isArray(subNode)) {\n for (let i = 0; i < subNode.length; i++) {\n const child = subNode[i];\n if (!child) continue;\n\n ancestors.push({\n node,\n key,\n index: i,\n });\n\n traverseSimpleImpl(child, enter, exit, state, ancestors);\n\n ancestors.pop();\n }\n } else if (subNode) {\n ancestors.push({\n node,\n key,\n });\n\n traverseSimpleImpl(subNode, enter, exit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CAAC,MAAM,IAAIR,OAAO,EAAE;MAClBL,SAAS,CAACW,IAAI,CAAC;QACbjB,IAAI;QACJU;MACF,CAAC,CAAC;MAEFL,kBAAkB,CAACM,OAAO,EAAER,KAAK,EAAEC,IAAI,EAAEF,KAAK,EAAEI,SAAS,CAAC;MAE1DA,SAAS,CAACa,GAAG,EAAE;IACjB;EACF;EAEA,IAAIf,IAAI,EAAEA,IAAI,CAACJ,IAAI,EAAEM,SAAS,EAAEJ,KAAK,CAAC;AACxC"}
1
+ {"version":3,"names":["traverse","node","handlers","state","enter","exit","traverseSimpleImpl","ancestors","keys","VISITOR_KEYS","type","key","subNode","Array","isArray","i","length","child","push","index","pop"],"sources":["../../src/traverse/traverse.ts"],"sourcesContent":["import { VISITOR_KEYS } from \"../definitions\";\nimport type * as t from \"..\";\n\nexport type TraversalAncestors = Array<{\n node: t.Node;\n key: string;\n index?: number;\n}>;\n\nexport type TraversalHandler<T> = (\n this: undefined,\n node: t.Node,\n parent: TraversalAncestors,\n state: T,\n) => void;\n\nexport type TraversalHandlers<T> = {\n enter?: TraversalHandler<T>;\n exit?: TraversalHandler<T>;\n};\n\n/**\n * A general AST traversal with both prefix and postfix handlers, and a\n * state object. Exposes ancestry data to each handler so that more complex\n * AST data can be taken into account.\n */\nexport default function traverse<T>(\n node: t.Node,\n handlers: TraversalHandler<T> | TraversalHandlers<T>,\n state?: T,\n): void {\n if (typeof handlers === \"function\") {\n handlers = { enter: handlers };\n }\n\n const { enter, exit } = handlers;\n\n traverseSimpleImpl(node, enter, exit, state, []);\n}\n\nfunction traverseSimpleImpl<T>(\n node: any,\n enter: Function | undefined,\n exit: Function | undefined,\n state: T | undefined,\n ancestors: TraversalAncestors,\n) {\n const keys = VISITOR_KEYS[node.type];\n if (!keys) return;\n\n if (enter) enter(node, ancestors, state);\n\n for (const key of keys) {\n const subNode = node[key];\n\n if (Array.isArray(subNode)) {\n for (let i = 0; i < subNode.length; i++) {\n const child = subNode[i];\n if (!child) continue;\n\n ancestors.push({\n node,\n key,\n index: i,\n });\n\n traverseSimpleImpl(child, enter, exit, state, ancestors);\n\n ancestors.pop();\n }\n } else if (subNode) {\n ancestors.push({\n node,\n key,\n });\n\n traverseSimpleImpl(subNode, enter, exit, state, ancestors);\n\n ancestors.pop();\n }\n }\n\n if (exit) exit(node, ancestors, state);\n}\n"],"mappings":";;;;;;AAAA;AA0Be,SAASA,QAAQ,CAC9BC,IAAY,EACZC,QAAoD,EACpDC,KAAS,EACH;EACN,IAAI,OAAOD,QAAQ,KAAK,UAAU,EAAE;IAClCA,QAAQ,GAAG;MAAEE,KAAK,EAAEF;IAAS,CAAC;EAChC;EAEA,MAAM;IAAEE,KAAK;IAAEC;EAAK,CAAC,GAAGH,QAAQ;EAEhCI,kBAAkB,CAACL,IAAI,EAAEG,KAAK,EAAEC,IAAI,EAAEF,KAAK,EAAE,EAAE,CAAC;AAClD;AAEA,SAASG,kBAAkB,CACzBL,IAAS,EACTG,KAA2B,EAC3BC,IAA0B,EAC1BF,KAAoB,EACpBI,SAA6B,EAC7B;EACA,MAAMC,IAAI,GAAGC,yBAAY,CAACR,IAAI,CAACS,IAAI,CAAC;EACpC,IAAI,CAACF,IAAI,EAAE;EAEX,IAAIJ,KAAK,EAAEA,KAAK,CAACH,IAAI,EAAEM,SAAS,EAAEJ,KAAK,CAAC;EAExC,KAAK,MAAMQ,GAAG,IAAIH,IAAI,EAAE;IACtB,MAAMI,OAAO,GAAGX,IAAI,CAACU,GAAG,CAAC;IAEzB,IAAIE,KAAK,CAACC,OAAO,CAACF,OAAO,CAAC,EAAE;MAC1B,KAAK,IAAIG,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,OAAO,CAACI,MAAM,EAAED,CAAC,EAAE,EAAE;QACvC,MAAME,KAAK,GAAGL,OAAO,CAACG,CAAC,CAAC;QACxB,IAAI,CAACE,KAAK,EAAE;QAEZV,SAAS,CAACW,IAAI,CAAC;UACbjB,IAAI;UACJU,GAAG;UACHQ,KAAK,EAAEJ;QACT,CAAC,CAAC;QAEFT,kBAAkB,CAACW,KAAK,EAAEb,KAAK,EAAEC,IAAI,EAAEF,KAAK,EAAEI,SAAS,CAAC;QAExDA,SAAS,CAACa,GAAG,EAAE;MACjB;IACF,CAAC,MAAM,IAAIR,OAAO,EAAE;MAClBL,SAAS,CAACW,IAAI,CAAC;QACbjB,IAAI;QACJU;MACF,CAAC,CAAC;MAEFL,kBAAkB,CAACM,OAAO,EAAER,KAAK,EAAEC,IAAI,EAAEF,KAAK,EAAEI,SAAS,CAAC;MAE1DA,SAAS,CAACa,GAAG,EAAE;IACjB;EACF;EAEA,IAAIf,IAAI,EAAEA,IAAI,CAACJ,IAAI,EAAEM,SAAS,EAAEJ,KAAK,CAAC;AACxC"}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = cleanJSXElementLiteralChild;
7
7
  var _generated = require("../../builders/generated");
8
+ var _ = require("../..");
8
9
  function cleanJSXElementLiteralChild(child, args) {
9
10
  const lines = child.value.split(/\r\n|\n|\r/);
10
11
  let lastNonEmptyLine = 0;
@@ -36,7 +37,7 @@ function cleanJSXElementLiteralChild(child, args) {
36
37
  str += trimmedLine;
37
38
  }
38
39
  }
39
- if (str) args.push((0, _generated.stringLiteral)(str));
40
+ if (str) args.push((0, _.inherits)((0, _generated.stringLiteral)(str), child));
40
41
  }
41
42
 
42
43
  //# sourceMappingURL=cleanJSXElementLiteralChild.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["cleanJSXElementLiteralChild","child","args","lines","value","split","lastNonEmptyLine","i","length","match","str","line","isFirstLine","isLastLine","isLastNonEmptyLine","trimmedLine","replace","push","stringLiteral"],"sources":["../../../src/utils/react/cleanJSXElementLiteralChild.ts"],"sourcesContent":["import { stringLiteral } from \"../../builders/generated\";\nimport type * as t from \"../..\";\n\nexport default function cleanJSXElementLiteralChild(\n child: {\n value: string;\n },\n args: Array<t.Node>,\n) {\n const lines = child.value.split(/\\r\\n|\\n|\\r/);\n\n let lastNonEmptyLine = 0;\n\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].match(/[^ \\t]/)) {\n lastNonEmptyLine = i;\n }\n }\n\n let str = \"\";\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n\n const isFirstLine = i === 0;\n const isLastLine = i === lines.length - 1;\n const isLastNonEmptyLine = i === lastNonEmptyLine;\n\n // replace rendered whitespace tabs with spaces\n let trimmedLine = line.replace(/\\t/g, \" \");\n\n // trim whitespace touching a newline\n if (!isFirstLine) {\n trimmedLine = trimmedLine.replace(/^[ ]+/, \"\");\n }\n\n // trim whitespace touching an endline\n if (!isLastLine) {\n trimmedLine = trimmedLine.replace(/[ ]+$/, \"\");\n }\n\n if (trimmedLine) {\n if (!isLastNonEmptyLine) {\n trimmedLine += \" \";\n }\n\n str += trimmedLine;\n }\n }\n\n if (str) args.push(stringLiteral(str));\n}\n"],"mappings":";;;;;;AAAA;AAGe,SAASA,2BAA2B,CACjDC,KAEC,EACDC,IAAmB,EACnB;EACA,MAAMC,KAAK,GAAGF,KAAK,CAACG,KAAK,CAACC,KAAK,CAAC,YAAY,CAAC;EAE7C,IAAIC,gBAAgB,GAAG,CAAC;EAExB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGJ,KAAK,CAACK,MAAM,EAAED,CAAC,EAAE,EAAE;IACrC,IAAIJ,KAAK,CAACI,CAAC,CAAC,CAACE,KAAK,CAAC,QAAQ,CAAC,EAAE;MAC5BH,gBAAgB,GAAGC,CAAC;IACtB;EACF;EAEA,IAAIG,GAAG,GAAG,EAAE;EAEZ,KAAK,IAAIH,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGJ,KAAK,CAACK,MAAM,EAAED,CAAC,EAAE,EAAE;IACrC,MAAMI,IAAI,GAAGR,KAAK,CAACI,CAAC,CAAC;IAErB,MAAMK,WAAW,GAAGL,CAAC,KAAK,CAAC;IAC3B,MAAMM,UAAU,GAAGN,CAAC,KAAKJ,KAAK,CAACK,MAAM,GAAG,CAAC;IACzC,MAAMM,kBAAkB,GAAGP,CAAC,KAAKD,gBAAgB;;IAGjD,IAAIS,WAAW,GAAGJ,IAAI,CAACK,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;;IAG1C,IAAI,CAACJ,WAAW,EAAE;MAChBG,WAAW,GAAGA,WAAW,CAACC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;IAChD;;IAGA,IAAI,CAACH,UAAU,EAAE;MACfE,WAAW,GAAGA,WAAW,CAACC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;IAChD;IAEA,IAAID,WAAW,EAAE;MACf,IAAI,CAACD,kBAAkB,EAAE;QACvBC,WAAW,IAAI,GAAG;MACpB;MAEAL,GAAG,IAAIK,WAAW;IACpB;EACF;EAEA,IAAIL,GAAG,EAAER,IAAI,CAACe,IAAI,CAAC,IAAAC,wBAAa,EAACR,GAAG,CAAC,CAAC;AACxC"}
1
+ {"version":3,"names":["cleanJSXElementLiteralChild","child","args","lines","value","split","lastNonEmptyLine","i","length","match","str","line","isFirstLine","isLastLine","isLastNonEmptyLine","trimmedLine","replace","push","inherits","stringLiteral"],"sources":["../../../src/utils/react/cleanJSXElementLiteralChild.ts"],"sourcesContent":["import { stringLiteral } from \"../../builders/generated\";\nimport type * as t from \"../..\";\nimport { inherits } from \"../..\";\n\nexport default function cleanJSXElementLiteralChild(\n child: t.JSXText,\n args: Array<t.Node>,\n) {\n const lines = child.value.split(/\\r\\n|\\n|\\r/);\n\n let lastNonEmptyLine = 0;\n\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].match(/[^ \\t]/)) {\n lastNonEmptyLine = i;\n }\n }\n\n let str = \"\";\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n\n const isFirstLine = i === 0;\n const isLastLine = i === lines.length - 1;\n const isLastNonEmptyLine = i === lastNonEmptyLine;\n\n // replace rendered whitespace tabs with spaces\n let trimmedLine = line.replace(/\\t/g, \" \");\n\n // trim whitespace touching a newline\n if (!isFirstLine) {\n trimmedLine = trimmedLine.replace(/^[ ]+/, \"\");\n }\n\n // trim whitespace touching an endline\n if (!isLastLine) {\n trimmedLine = trimmedLine.replace(/[ ]+$/, \"\");\n }\n\n if (trimmedLine) {\n if (!isLastNonEmptyLine) {\n trimmedLine += \" \";\n }\n\n str += trimmedLine;\n }\n }\n\n if (str) args.push(inherits(stringLiteral(str), child));\n}\n"],"mappings":";;;;;;AAAA;AAEA;AAEe,SAASA,2BAA2B,CACjDC,KAAgB,EAChBC,IAAmB,EACnB;EACA,MAAMC,KAAK,GAAGF,KAAK,CAACG,KAAK,CAACC,KAAK,CAAC,YAAY,CAAC;EAE7C,IAAIC,gBAAgB,GAAG,CAAC;EAExB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGJ,KAAK,CAACK,MAAM,EAAED,CAAC,EAAE,EAAE;IACrC,IAAIJ,KAAK,CAACI,CAAC,CAAC,CAACE,KAAK,CAAC,QAAQ,CAAC,EAAE;MAC5BH,gBAAgB,GAAGC,CAAC;IACtB;EACF;EAEA,IAAIG,GAAG,GAAG,EAAE;EAEZ,KAAK,IAAIH,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGJ,KAAK,CAACK,MAAM,EAAED,CAAC,EAAE,EAAE;IACrC,MAAMI,IAAI,GAAGR,KAAK,CAACI,CAAC,CAAC;IAErB,MAAMK,WAAW,GAAGL,CAAC,KAAK,CAAC;IAC3B,MAAMM,UAAU,GAAGN,CAAC,KAAKJ,KAAK,CAACK,MAAM,GAAG,CAAC;IACzC,MAAMM,kBAAkB,GAAGP,CAAC,KAAKD,gBAAgB;;IAGjD,IAAIS,WAAW,GAAGJ,IAAI,CAACK,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;;IAG1C,IAAI,CAACJ,WAAW,EAAE;MAChBG,WAAW,GAAGA,WAAW,CAACC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;IAChD;;IAGA,IAAI,CAACH,UAAU,EAAE;MACfE,WAAW,GAAGA,WAAW,CAACC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;IAChD;IAEA,IAAID,WAAW,EAAE;MACf,IAAI,CAACD,kBAAkB,EAAE;QACvBC,WAAW,IAAI,GAAG;MACpB;MAEAL,GAAG,IAAIK,WAAW;IACpB;EACF;EAEA,IAAIL,GAAG,EAAER,IAAI,CAACe,IAAI,CAAC,IAAAC,UAAQ,EAAC,IAAAC,wBAAa,EAACT,GAAG,CAAC,EAAET,KAAK,CAAC,CAAC;AACzD"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babel/types",
3
- "version": "7.20.5",
3
+ "version": "7.20.7",
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.5",
33
- "@babel/parser": "^7.20.5",
32
+ "@babel/generator": "^7.20.7",
33
+ "@babel/parser": "^7.20.7",
34
34
  "chalk": "^4.1.0",
35
35
  "glob": "^7.2.0"
36
36
  },
@@ -39,6 +39,13 @@ export const Preview = (
39
39
  setActiveQuery(event.data)
40
40
  }
41
41
  })
42
+ window.addEventListener('message', (event: MessageEvent<PostMessage>) => {
43
+ if (event?.data?.type === 'isEditMode') {
44
+ props.iframeRef?.current?.contentWindow?.postMessage({
45
+ type: 'tina:editMode',
46
+ })
47
+ }
48
+ })
42
49
  }
43
50
  }, [props.iframeRef.current])
44
51
 
@@ -93,13 +100,6 @@ const QueryMachine = (props: {
93
100
 
94
101
  React.useEffect(() => {
95
102
  if (props.iframeRef.current) {
96
- window.addEventListener('message', (event: MessageEvent<PostMessage>) => {
97
- if (event?.data?.type === 'isEditMode') {
98
- props.iframeRef?.current?.contentWindow?.postMessage({
99
- type: 'tina:editMode',
100
- })
101
- }
102
- })
103
103
  send({ type: 'IFRAME_MOUNTED', value: props.iframeRef.current })
104
104
  if (props.payload.type === 'open') {
105
105
  send({ type: 'ADD_QUERY', value: props.payload })
package/dist/index.js CHANGED
@@ -332,7 +332,8 @@ var viteBuild = async ({
332
332
  outputFolder,
333
333
  publicFolder,
334
334
  local: l,
335
- apiUrl
335
+ apiUrl,
336
+ host
336
337
  }) => {
337
338
  const local = l;
338
339
  const localBuild = l;
@@ -387,6 +388,7 @@ var viteBuild = async ({
387
388
  target: "es2020"
388
389
  },
389
390
  server: {
391
+ host,
390
392
  port: 5173,
391
393
  fs: {
392
394
  strict: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/app",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
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": "1.0.0",
40
- "tinacms": "1.1.0",
41
- "@tinacms/mdx": "1.0.2",
40
+ "tinacms": "1.1.2",
41
+ "@tinacms/mdx": "1.0.4",
42
42
  "jest": "^27.0.6"
43
43
  },
44
44
  "dependencies": {