@tinacms/app 1.0.7 → 1.1.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.
- package/appFiles/node_modules/.package-lock.json +29 -28
- package/appFiles/node_modules/@babel/generator/lib/buffer.js +34 -10
- package/appFiles/node_modules/@babel/generator/lib/buffer.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/classes.js +3 -4
- package/appFiles/node_modules/@babel/generator/lib/generators/classes.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/expressions.js +7 -0
- package/appFiles/node_modules/@babel/generator/lib/generators/expressions.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/methods.js +51 -8
- package/appFiles/node_modules/@babel/generator/lib/generators/methods.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/modules.js +7 -10
- package/appFiles/node_modules/@babel/generator/lib/generators/modules.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/types.js +2 -0
- package/appFiles/node_modules/@babel/generator/lib/generators/types.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/typescript.js +2 -2
- package/appFiles/node_modules/@babel/generator/lib/generators/typescript.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/index.js +1 -1
- package/appFiles/node_modules/@babel/generator/lib/index.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/node/parentheses.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/printer.js +7 -0
- package/appFiles/node_modules/@babel/generator/lib/printer.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/source-map.js +40 -9
- package/appFiles/node_modules/@babel/generator/lib/source-map.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/package.json +5 -5
- package/appFiles/node_modules/@babel/helper-function-name/lib/index.js +0 -31
- package/appFiles/node_modules/@babel/helper-function-name/lib/index.js.map +1 -1
- package/appFiles/node_modules/@babel/helper-function-name/package.json +3 -3
- package/appFiles/node_modules/@babel/parser/lib/index.js +1901 -1885
- package/appFiles/node_modules/@babel/parser/lib/index.js.map +1 -1
- package/appFiles/node_modules/@babel/parser/package.json +2 -2
- package/appFiles/node_modules/@babel/parser/typings/babel-parser.d.ts +12 -0
- package/appFiles/node_modules/@babel/runtime/helpers/applyDecs2203R.js +173 -170
- package/appFiles/node_modules/@babel/runtime/helpers/applyDecs2301.js +221 -0
- package/appFiles/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js +173 -170
- package/appFiles/node_modules/@babel/runtime/helpers/esm/applyDecs2301.js +220 -0
- package/appFiles/node_modules/@babel/runtime/package.json +10 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/modification.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/visitors.js +11 -5
- package/appFiles/node_modules/@babel/traverse/lib/visitors.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/package.json +5 -5
- package/appFiles/node_modules/@babel/types/lib/asserts/generated/index.js +12 -7
- package/appFiles/node_modules/@babel/types/lib/asserts/generated/index.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/ast-types/generated/index.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/builders/generated/index.js +5 -5
- package/appFiles/node_modules/@babel/types/lib/builders/generated/index.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/clone/cloneNode.js +2 -6
- package/appFiles/node_modules/@babel/types/lib/clone/cloneNode.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/constants/generated/index.js +5 -4
- package/appFiles/node_modules/@babel/types/lib/constants/generated/index.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/toComputedKey.js +1 -2
- package/appFiles/node_modules/@babel/types/lib/converters/toComputedKey.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/toExpression.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/converters/toExpression.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/toIdentifier.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/converters/toIdentifier.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/toKeyAlias.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/converters/toKeyAlias.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/toSequenceExpression.js +0 -1
- package/appFiles/node_modules/@babel/types/lib/converters/toSequenceExpression.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/toStatement.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/converters/toStatement.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/valueToNode.js +1 -9
- package/appFiles/node_modules/@babel/types/lib/converters/valueToNode.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/definitions/core.js +21 -57
- package/appFiles/node_modules/@babel/types/lib/definitions/core.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/definitions/deprecated-aliases.js +12 -0
- package/appFiles/node_modules/@babel/types/lib/definitions/deprecated-aliases.js.map +1 -0
- package/appFiles/node_modules/@babel/types/lib/definitions/experimental.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/definitions/experimental.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/definitions/flow.js +0 -1
- package/appFiles/node_modules/@babel/types/lib/definitions/flow.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/definitions/index.js +10 -0
- package/appFiles/node_modules/@babel/types/lib/definitions/index.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/definitions/typescript.js +6 -4
- package/appFiles/node_modules/@babel/types/lib/definitions/typescript.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/definitions/utils.js +0 -2
- package/appFiles/node_modules/@babel/types/lib/definitions/utils.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/index-legacy.d.ts +10 -3
- package/appFiles/node_modules/@babel/types/lib/index.d.ts +23 -6
- package/appFiles/node_modules/@babel/types/lib/index.js +9 -2
- package/appFiles/node_modules/@babel/types/lib/index.js.flow +8 -3
- package/appFiles/node_modules/@babel/types/lib/index.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js +1 -9
- package/appFiles/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/modifications/inherits.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/modifications/inherits.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/modifications/removeProperties.js +1 -3
- package/appFiles/node_modules/@babel/types/lib/modifications/removeProperties.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js +0 -8
- package/appFiles/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js +2 -6
- package/appFiles/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/traverse/traverseFast.js +1 -2
- package/appFiles/node_modules/@babel/types/lib/traverse/traverseFast.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/utils/deprecationWarning.js +30 -0
- package/appFiles/node_modules/@babel/types/lib/utils/deprecationWarning.js.map +1 -0
- package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/utils/shallowEqual.js +1 -2
- package/appFiles/node_modules/@babel/types/lib/utils/shallowEqual.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/generated/index.js +11 -6
- package/appFiles/node_modules/@babel/types/lib/validators/generated/index.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isBinding.js +2 -4
- package/appFiles/node_modules/@babel/types/lib/validators/isBinding.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isLet.js +1 -2
- package/appFiles/node_modules/@babel/types/lib/validators/isLet.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isNodesEquivalent.js +1 -2
- package/appFiles/node_modules/@babel/types/lib/validators/isNodesEquivalent.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isReferenced.js +0 -21
- package/appFiles/node_modules/@babel/types/lib/validators/isReferenced.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isScope.js +0 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isScope.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isSpecifierDefault.js +1 -2
- package/appFiles/node_modules/@babel/types/lib/validators/isSpecifierDefault.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isType.js +0 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isType.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isValidES3Identifier.js +0 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isValidES3Identifier.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isVar.js +1 -2
- package/appFiles/node_modules/@babel/types/lib/validators/isVar.js.map +1 -1
- package/appFiles/node_modules/@babel/types/package.json +3 -3
- package/appFiles/node_modules/css-to-react-native/index.d.ts +17 -0
- package/appFiles/node_modules/css-to-react-native/index.js +15 -0
- package/appFiles/node_modules/css-to-react-native/package.json +2 -1
- package/appFiles/node_modules/css-to-react-native/src/__tests__/aspectRatio.js +23 -0
- package/appFiles/node_modules/css-to-react-native/src/transforms/aspectRatio.js +12 -0
- package/appFiles/node_modules/css-to-react-native/src/transforms/index.js +2 -0
- package/appFiles/src/App.tsx +3 -5
- package/appFiles/src/fields/rich-text/monaco/mdx.js +8573 -3668
- package/appFiles/src/lib/machines/query-machine.ts +0 -13
- package/appFiles/src/preview.tsx +22 -0
- package/dist/index.js +3 -1
- package/package.json +4 -4
|
@@ -9,13 +9,11 @@ function isBinding(node, parent, grandparent) {
|
|
|
9
9
|
if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") {
|
|
10
10
|
return false;
|
|
11
11
|
}
|
|
12
|
-
const keys =
|
|
13
|
-
_getBindingIdentifiers.default.keys[parent.type];
|
|
12
|
+
const keys = _getBindingIdentifiers.default.keys[parent.type];
|
|
14
13
|
if (keys) {
|
|
15
14
|
for (let i = 0; i < keys.length; i++) {
|
|
16
15
|
const key = keys[i];
|
|
17
|
-
const val =
|
|
18
|
-
parent[key];
|
|
16
|
+
const val = parent[key];
|
|
19
17
|
if (Array.isArray(val)) {
|
|
20
18
|
if (val.indexOf(node) >= 0) return true;
|
|
21
19
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isBinding","node","parent","grandparent","type","keys","getBindingIdentifiers","i","length","key","val","Array","isArray","indexOf"],"sources":["../../src/validators/isBinding.ts"],"sourcesContent":["import getBindingIdentifiers from \"../retrievers/getBindingIdentifiers\";\nimport type * as t from \"..\";\n/**\n * Check if the input `node` is a binding identifier.\n */\nexport default function isBinding(\n node: t.Node,\n parent: t.Node,\n grandparent?: t.Node,\n): boolean {\n if (\n grandparent &&\n node.type === \"Identifier\" &&\n parent.type === \"ObjectProperty\" &&\n grandparent.type === \"ObjectExpression\"\n ) {\n // We need to special-case this, because getBindingIdentifiers\n // has an ObjectProperty->value entry for destructuring patterns.\n return false;\n }\n\n const keys =\n // @ts-expect-error getBindingIdentifiers.keys does not cover all AST types\n getBindingIdentifiers.keys[parent.type];\n if (keys) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const val =\n // @ts-expect-error key must present in parent\n parent[key];\n if (Array.isArray(val)) {\n if (val.indexOf(node) >= 0) return true;\n } else {\n if (val === node) return true;\n }\n }\n }\n\n return false;\n}\n"],"mappings":";;;;;;AAAA;AAKe,SAASA,SAAS,CAC/BC,IAAY,EACZC,MAAc,EACdC,WAAoB,EACX;EACT,IACEA,WAAW,IACXF,IAAI,CAACG,IAAI,KAAK,YAAY,IAC1BF,MAAM,CAACE,IAAI,KAAK,gBAAgB,IAChCD,WAAW,CAACC,IAAI,KAAK,kBAAkB,EACvC;IAGA,OAAO,KAAK;EACd;EAEA,MAAMC,IAAI
|
|
1
|
+
{"version":3,"names":["isBinding","node","parent","grandparent","type","keys","getBindingIdentifiers","i","length","key","val","Array","isArray","indexOf"],"sources":["../../src/validators/isBinding.ts"],"sourcesContent":["import getBindingIdentifiers from \"../retrievers/getBindingIdentifiers\";\nimport type * as t from \"..\";\n/**\n * Check if the input `node` is a binding identifier.\n */\nexport default function isBinding(\n node: t.Node,\n parent: t.Node,\n grandparent?: t.Node,\n): boolean {\n if (\n grandparent &&\n node.type === \"Identifier\" &&\n parent.type === \"ObjectProperty\" &&\n grandparent.type === \"ObjectExpression\"\n ) {\n // We need to special-case this, because getBindingIdentifiers\n // has an ObjectProperty->value entry for destructuring patterns.\n return false;\n }\n\n const keys =\n // @ts-expect-error getBindingIdentifiers.keys does not cover all AST types\n getBindingIdentifiers.keys[parent.type];\n if (keys) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const val =\n // @ts-expect-error key must present in parent\n parent[key];\n if (Array.isArray(val)) {\n if (val.indexOf(node) >= 0) return true;\n } else {\n if (val === node) return true;\n }\n }\n }\n\n return false;\n}\n"],"mappings":";;;;;;AAAA;AAKe,SAASA,SAAS,CAC/BC,IAAY,EACZC,MAAc,EACdC,WAAoB,EACX;EACT,IACEA,WAAW,IACXF,IAAI,CAACG,IAAI,KAAK,YAAY,IAC1BF,MAAM,CAACE,IAAI,KAAK,gBAAgB,IAChCD,WAAW,CAACC,IAAI,KAAK,kBAAkB,EACvC;IAGA,OAAO,KAAK;EACd;EAEA,MAAMC,IAAI,GAERC,8BAAqB,CAACD,IAAI,CAACH,MAAM,CAACE,IAAI,CAAC;EACzC,IAAIC,IAAI,EAAE;IACR,KAAK,IAAIE,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,IAAI,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;MACpC,MAAME,GAAG,GAAGJ,IAAI,CAACE,CAAC,CAAC;MACnB,MAAMG,GAAG,GAEPR,MAAM,CAACO,GAAG,CAAC;MACb,IAAIE,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,EAAE;QACtB,IAAIA,GAAG,CAACG,OAAO,CAACZ,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,IAAI;MACzC,CAAC,MAAM;QACL,IAAIS,GAAG,KAAKT,IAAI,EAAE,OAAO,IAAI;MAC/B;IACF;EACF;EAEA,OAAO,KAAK;AACd"}
|
|
@@ -7,8 +7,7 @@ exports.default = isLet;
|
|
|
7
7
|
var _generated = require("./generated");
|
|
8
8
|
var _constants = require("../constants");
|
|
9
9
|
function isLet(node) {
|
|
10
|
-
return (0, _generated.isVariableDeclaration)(node) && (node.kind !== "var" ||
|
|
11
|
-
node[_constants.BLOCK_SCOPED_SYMBOL]);
|
|
10
|
+
return (0, _generated.isVariableDeclaration)(node) && (node.kind !== "var" || node[_constants.BLOCK_SCOPED_SYMBOL]);
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
//# sourceMappingURL=isLet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isLet","node","isVariableDeclaration","kind","BLOCK_SCOPED_SYMBOL"],"sources":["../../src/validators/isLet.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 `let` variable declaration.\n */\nexport default function isLet(node: t.Node): boolean {\n return (\n isVariableDeclaration(node) &&\n (node.kind !== \"var\" ||\n // @ts-expect-error Fixme: document private properties\n node[BLOCK_SCOPED_SYMBOL])\n );\n}\n"],"mappings":";;;;;;AAAA;AACA;AAMe,SAASA,KAAK,CAACC,IAAY,EAAW;EACnD,OACE,IAAAC,gCAAqB,EAACD,IAAI,CAAC,KAC1BA,IAAI,CAACE,IAAI,KAAK,KAAK
|
|
1
|
+
{"version":3,"names":["isLet","node","isVariableDeclaration","kind","BLOCK_SCOPED_SYMBOL"],"sources":["../../src/validators/isLet.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 `let` variable declaration.\n */\nexport default function isLet(node: t.Node): boolean {\n return (\n isVariableDeclaration(node) &&\n (node.kind !== \"var\" ||\n // @ts-expect-error Fixme: document private properties\n node[BLOCK_SCOPED_SYMBOL])\n );\n}\n"],"mappings":";;;;;;AAAA;AACA;AAMe,SAASA,KAAK,CAACC,IAAY,EAAW;EACnD,OACE,IAAAC,gCAAqB,EAACD,IAAI,CAAC,KAC1BA,IAAI,CAACE,IAAI,KAAK,KAAK,IAElBF,IAAI,CAACG,8BAAmB,CAAC,CAAC;AAEhC"}
|
|
@@ -15,8 +15,7 @@ function isNodesEquivalent(a, b) {
|
|
|
15
15
|
const fields = Object.keys(_definitions.NODE_FIELDS[a.type] || a.type);
|
|
16
16
|
const visitorKeys = _definitions.VISITOR_KEYS[a.type];
|
|
17
17
|
for (const field of fields) {
|
|
18
|
-
const val_a =
|
|
19
|
-
a[field];
|
|
18
|
+
const val_a = a[field];
|
|
20
19
|
const val_b = b[field];
|
|
21
20
|
if (typeof val_a !== typeof val_b) {
|
|
22
21
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isNodesEquivalent","a","b","type","fields","Object","keys","NODE_FIELDS","visitorKeys","VISITOR_KEYS","field","val_a","val_b","Array","isArray","length","i","includes","key"],"sources":["../../src/validators/isNodesEquivalent.ts"],"sourcesContent":["import { NODE_FIELDS, VISITOR_KEYS } from \"../definitions\";\nimport type * as t from \"..\";\n\n/**\n * Check if two nodes are equivalent\n */\nexport default function isNodesEquivalent<T extends Partial<t.Node>>(\n a: T,\n b: any,\n): b is T {\n if (\n typeof a !== \"object\" ||\n typeof b !== \"object\" ||\n a == null ||\n b == null\n ) {\n return a === b;\n }\n\n if (a.type !== b.type) {\n return false;\n }\n\n const fields = Object.keys(NODE_FIELDS[a.type] || a.type);\n const visitorKeys = VISITOR_KEYS[a.type];\n\n for (const field of fields) {\n const val_a =\n // @ts-expect-error field must present in a\n a[field];\n const val_b = b[field];\n if (typeof val_a !== typeof val_b) {\n return false;\n }\n if (val_a == null && val_b == null) {\n continue;\n } else if (val_a == null || val_b == null) {\n return false;\n }\n\n if (Array.isArray(val_a)) {\n if (!Array.isArray(val_b)) {\n return false;\n }\n if (val_a.length !== val_b.length) {\n return false;\n }\n\n for (let i = 0; i < val_a.length; i++) {\n if (!isNodesEquivalent(val_a[i], val_b[i])) {\n return false;\n }\n }\n continue;\n }\n\n if (typeof val_a === \"object\" && !visitorKeys?.includes(field)) {\n for (const key of Object.keys(val_a)) {\n if (val_a[key] !== val_b[key]) {\n return false;\n }\n }\n continue;\n }\n\n if (!isNodesEquivalent(val_a, val_b)) {\n return false;\n }\n }\n\n return true;\n}\n"],"mappings":";;;;;;AAAA;AAMe,SAASA,iBAAiB,CACvCC,CAAI,EACJC,CAAM,EACE;EACR,IACE,OAAOD,CAAC,KAAK,QAAQ,IACrB,OAAOC,CAAC,KAAK,QAAQ,IACrBD,CAAC,IAAI,IAAI,IACTC,CAAC,IAAI,IAAI,EACT;IACA,OAAOD,CAAC,KAAKC,CAAC;EAChB;EAEA,IAAID,CAAC,CAACE,IAAI,KAAKD,CAAC,CAACC,IAAI,EAAE;IACrB,OAAO,KAAK;EACd;EAEA,MAAMC,MAAM,GAAGC,MAAM,CAACC,IAAI,CAACC,wBAAW,CAACN,CAAC,CAACE,IAAI,CAAC,IAAIF,CAAC,CAACE,IAAI,CAAC;EACzD,MAAMK,WAAW,GAAGC,yBAAY,CAACR,CAAC,CAACE,IAAI,CAAC;EAExC,KAAK,MAAMO,KAAK,IAAIN,MAAM,EAAE;IAC1B,MAAMO,KAAK
|
|
1
|
+
{"version":3,"names":["isNodesEquivalent","a","b","type","fields","Object","keys","NODE_FIELDS","visitorKeys","VISITOR_KEYS","field","val_a","val_b","Array","isArray","length","i","includes","key"],"sources":["../../src/validators/isNodesEquivalent.ts"],"sourcesContent":["import { NODE_FIELDS, VISITOR_KEYS } from \"../definitions\";\nimport type * as t from \"..\";\n\n/**\n * Check if two nodes are equivalent\n */\nexport default function isNodesEquivalent<T extends Partial<t.Node>>(\n a: T,\n b: any,\n): b is T {\n if (\n typeof a !== \"object\" ||\n typeof b !== \"object\" ||\n a == null ||\n b == null\n ) {\n return a === b;\n }\n\n if (a.type !== b.type) {\n return false;\n }\n\n const fields = Object.keys(NODE_FIELDS[a.type] || a.type);\n const visitorKeys = VISITOR_KEYS[a.type];\n\n for (const field of fields) {\n const val_a =\n // @ts-expect-error field must present in a\n a[field];\n const val_b = b[field];\n if (typeof val_a !== typeof val_b) {\n return false;\n }\n if (val_a == null && val_b == null) {\n continue;\n } else if (val_a == null || val_b == null) {\n return false;\n }\n\n if (Array.isArray(val_a)) {\n if (!Array.isArray(val_b)) {\n return false;\n }\n if (val_a.length !== val_b.length) {\n return false;\n }\n\n for (let i = 0; i < val_a.length; i++) {\n if (!isNodesEquivalent(val_a[i], val_b[i])) {\n return false;\n }\n }\n continue;\n }\n\n if (typeof val_a === \"object\" && !visitorKeys?.includes(field)) {\n for (const key of Object.keys(val_a)) {\n if (val_a[key] !== val_b[key]) {\n return false;\n }\n }\n continue;\n }\n\n if (!isNodesEquivalent(val_a, val_b)) {\n return false;\n }\n }\n\n return true;\n}\n"],"mappings":";;;;;;AAAA;AAMe,SAASA,iBAAiB,CACvCC,CAAI,EACJC,CAAM,EACE;EACR,IACE,OAAOD,CAAC,KAAK,QAAQ,IACrB,OAAOC,CAAC,KAAK,QAAQ,IACrBD,CAAC,IAAI,IAAI,IACTC,CAAC,IAAI,IAAI,EACT;IACA,OAAOD,CAAC,KAAKC,CAAC;EAChB;EAEA,IAAID,CAAC,CAACE,IAAI,KAAKD,CAAC,CAACC,IAAI,EAAE;IACrB,OAAO,KAAK;EACd;EAEA,MAAMC,MAAM,GAAGC,MAAM,CAACC,IAAI,CAACC,wBAAW,CAACN,CAAC,CAACE,IAAI,CAAC,IAAIF,CAAC,CAACE,IAAI,CAAC;EACzD,MAAMK,WAAW,GAAGC,yBAAY,CAACR,CAAC,CAACE,IAAI,CAAC;EAExC,KAAK,MAAMO,KAAK,IAAIN,MAAM,EAAE;IAC1B,MAAMO,KAAK,GAETV,CAAC,CAACS,KAAK,CAAC;IACV,MAAME,KAAK,GAAGV,CAAC,CAACQ,KAAK,CAAC;IACtB,IAAI,OAAOC,KAAK,KAAK,OAAOC,KAAK,EAAE;MACjC,OAAO,KAAK;IACd;IACA,IAAID,KAAK,IAAI,IAAI,IAAIC,KAAK,IAAI,IAAI,EAAE;MAClC;IACF,CAAC,MAAM,IAAID,KAAK,IAAI,IAAI,IAAIC,KAAK,IAAI,IAAI,EAAE;MACzC,OAAO,KAAK;IACd;IAEA,IAAIC,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,EAAE;MACxB,IAAI,CAACE,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;QACzB,OAAO,KAAK;MACd;MACA,IAAID,KAAK,CAACI,MAAM,KAAKH,KAAK,CAACG,MAAM,EAAE;QACjC,OAAO,KAAK;MACd;MAEA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,KAAK,CAACI,MAAM,EAAEC,CAAC,EAAE,EAAE;QACrC,IAAI,CAAChB,iBAAiB,CAACW,KAAK,CAACK,CAAC,CAAC,EAAEJ,KAAK,CAACI,CAAC,CAAC,CAAC,EAAE;UAC1C,OAAO,KAAK;QACd;MACF;MACA;IACF;IAEA,IAAI,OAAOL,KAAK,KAAK,QAAQ,IAAI,EAACH,WAAW,YAAXA,WAAW,CAAES,QAAQ,CAACP,KAAK,CAAC,GAAE;MAC9D,KAAK,MAAMQ,GAAG,IAAIb,MAAM,CAACC,IAAI,CAACK,KAAK,CAAC,EAAE;QACpC,IAAIA,KAAK,CAACO,GAAG,CAAC,KAAKN,KAAK,CAACM,GAAG,CAAC,EAAE;UAC7B,OAAO,KAAK;QACd;MACF;MACA;IACF;IAEA,IAAI,CAAClB,iBAAiB,CAACW,KAAK,EAAEC,KAAK,CAAC,EAAE;MACpC,OAAO,KAAK;IACd;EACF;EAEA,OAAO,IAAI;AACb"}
|
|
@@ -16,13 +16,10 @@ function isReferenced(node, parent, grandparent) {
|
|
|
16
16
|
return parent.object === node;
|
|
17
17
|
case "VariableDeclarator":
|
|
18
18
|
return parent.init === node;
|
|
19
|
-
|
|
20
19
|
case "ArrowFunctionExpression":
|
|
21
20
|
return parent.body === node;
|
|
22
|
-
|
|
23
21
|
case "PrivateName":
|
|
24
22
|
return false;
|
|
25
|
-
|
|
26
23
|
case "ClassMethod":
|
|
27
24
|
case "ClassPrivateMethod":
|
|
28
25
|
case "ObjectMethod":
|
|
@@ -30,7 +27,6 @@ function isReferenced(node, parent, grandparent) {
|
|
|
30
27
|
return !!parent.computed;
|
|
31
28
|
}
|
|
32
29
|
return false;
|
|
33
|
-
|
|
34
30
|
case "ObjectProperty":
|
|
35
31
|
if (parent.key === node) {
|
|
36
32
|
return !!parent.computed;
|
|
@@ -44,67 +40,50 @@ function isReferenced(node, parent, grandparent) {
|
|
|
44
40
|
return true;
|
|
45
41
|
case "ClassPrivateProperty":
|
|
46
42
|
return parent.key !== node;
|
|
47
|
-
|
|
48
43
|
case "ClassDeclaration":
|
|
49
44
|
case "ClassExpression":
|
|
50
45
|
return parent.superClass === node;
|
|
51
|
-
|
|
52
46
|
case "AssignmentExpression":
|
|
53
47
|
return parent.right === node;
|
|
54
|
-
|
|
55
48
|
case "AssignmentPattern":
|
|
56
49
|
return parent.right === node;
|
|
57
|
-
|
|
58
50
|
case "LabeledStatement":
|
|
59
51
|
return false;
|
|
60
|
-
|
|
61
52
|
case "CatchClause":
|
|
62
53
|
return false;
|
|
63
|
-
|
|
64
54
|
case "RestElement":
|
|
65
55
|
return false;
|
|
66
56
|
case "BreakStatement":
|
|
67
57
|
case "ContinueStatement":
|
|
68
58
|
return false;
|
|
69
|
-
|
|
70
59
|
case "FunctionDeclaration":
|
|
71
60
|
case "FunctionExpression":
|
|
72
61
|
return false;
|
|
73
|
-
|
|
74
62
|
case "ExportNamespaceSpecifier":
|
|
75
63
|
case "ExportDefaultSpecifier":
|
|
76
64
|
return false;
|
|
77
|
-
|
|
78
65
|
case "ExportSpecifier":
|
|
79
66
|
if (grandparent != null && grandparent.source) {
|
|
80
67
|
return false;
|
|
81
68
|
}
|
|
82
69
|
return parent.local === node;
|
|
83
|
-
|
|
84
70
|
case "ImportDefaultSpecifier":
|
|
85
71
|
case "ImportNamespaceSpecifier":
|
|
86
72
|
case "ImportSpecifier":
|
|
87
73
|
return false;
|
|
88
|
-
|
|
89
74
|
case "ImportAttribute":
|
|
90
75
|
return false;
|
|
91
|
-
|
|
92
76
|
case "JSXAttribute":
|
|
93
77
|
return false;
|
|
94
|
-
|
|
95
78
|
case "ObjectPattern":
|
|
96
79
|
case "ArrayPattern":
|
|
97
80
|
return false;
|
|
98
|
-
|
|
99
81
|
case "MetaProperty":
|
|
100
82
|
return false;
|
|
101
|
-
|
|
102
83
|
case "ObjectTypeProperty":
|
|
103
84
|
return parent.key !== node;
|
|
104
|
-
|
|
105
85
|
case "TSEnumMember":
|
|
106
86
|
return parent.id !== node;
|
|
107
|
-
|
|
108
87
|
case "TSPropertySignature":
|
|
109
88
|
if (parent.key === node) {
|
|
110
89
|
return !!parent.computed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isReferenced","node","parent","grandparent","type","property","computed","object","init","body","key","superClass","right","source","local","id"],"sources":["../../src/validators/isReferenced.ts"],"sourcesContent":["import type * as t from \"..\";\n\n/**\n * Check if the input `node` is a reference to a bound variable.\n */\nexport default function isReferenced(\n node: t.Node,\n parent: t.Node,\n grandparent?: t.Node,\n): boolean {\n switch (parent.type) {\n // yes: PARENT[NODE]\n // yes: NODE.child\n // no: parent.NODE\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n if (parent.property === node) {\n return !!parent.computed;\n }\n return parent.object === node;\n\n case \"JSXMemberExpression\":\n return parent.object === node;\n // no: let NODE = init;\n // yes: let id = NODE;\n case \"VariableDeclarator\":\n return parent.init === node;\n\n // yes: () => NODE\n // no: (NODE) => {}\n case \"ArrowFunctionExpression\":\n return parent.body === node;\n\n // no: class { #NODE; }\n // no: class { get #NODE() {} }\n // no: class { #NODE() {} }\n // no: class { fn() { return this.#NODE; } }\n case \"PrivateName\":\n return false;\n\n // no: class { NODE() {} }\n // yes: class { [NODE]() {} }\n // no: class { foo(NODE) {} }\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n case \"ObjectMethod\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return false;\n\n // yes: { [NODE]: \"\" }\n // no: { NODE: \"\" }\n // depends: { NODE }\n // depends: { key: NODE }\n case \"ObjectProperty\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n // parent.value === node\n return !grandparent || grandparent.type !== \"ObjectPattern\";\n // no: class { NODE = value; }\n // yes: class { [NODE] = value; }\n // yes: class { key = NODE; }\n case \"ClassProperty\":\n case \"ClassAccessorProperty\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return true;\n case \"ClassPrivateProperty\":\n return parent.key !== node;\n\n // no: class NODE {}\n // yes: class Foo extends NODE {}\n case \"ClassDeclaration\":\n case \"ClassExpression\":\n return parent.superClass === node;\n\n // yes: left = NODE;\n // no: NODE = right;\n case \"AssignmentExpression\":\n return parent.right === node;\n\n // no: [NODE = foo] = [];\n // yes: [foo = NODE] = [];\n case \"AssignmentPattern\":\n return parent.right === node;\n\n // no: NODE: for (;;) {}\n case \"LabeledStatement\":\n return false;\n\n // no: try {} catch (NODE) {}\n case \"CatchClause\":\n return false;\n\n // no: function foo(...NODE) {}\n case \"RestElement\":\n return false;\n\n case \"BreakStatement\":\n case \"ContinueStatement\":\n return false;\n\n // no: function NODE() {}\n // no: function foo(NODE) {}\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n return false;\n\n // no: export NODE from \"foo\";\n // no: export * as NODE from \"foo\";\n case \"ExportNamespaceSpecifier\":\n case \"ExportDefaultSpecifier\":\n return false;\n\n // no: export { foo as NODE };\n // yes: export { NODE as foo };\n // no: export { NODE as foo } from \"foo\";\n case \"ExportSpecifier\":\n // @ts-expect-error todo(flow->ts): Property 'source' does not exist on type 'AnyTypeAnnotation'.\n if (grandparent?.source) {\n return false;\n }\n return parent.local === node;\n\n // no: import NODE from \"foo\";\n // no: import * as NODE from \"foo\";\n // no: import { NODE as foo } from \"foo\";\n // no: import { foo as NODE } from \"foo\";\n // no: import NODE from \"bar\";\n case \"ImportDefaultSpecifier\":\n case \"ImportNamespaceSpecifier\":\n case \"ImportSpecifier\":\n return false;\n\n // no: import \"foo\" assert { NODE: \"json\" }\n case \"ImportAttribute\":\n return false;\n\n // no: <div NODE=\"foo\" />\n case \"JSXAttribute\":\n return false;\n\n // no: [NODE] = [];\n // no: ({ NODE }) = [];\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n return false;\n\n // no: new.NODE\n // no: NODE.target\n case \"MetaProperty\":\n return false;\n\n // yes: type X = {
|
|
1
|
+
{"version":3,"names":["isReferenced","node","parent","grandparent","type","property","computed","object","init","body","key","superClass","right","source","local","id"],"sources":["../../src/validators/isReferenced.ts"],"sourcesContent":["import type * as t from \"..\";\n\n/**\n * Check if the input `node` is a reference to a bound variable.\n */\nexport default function isReferenced(\n node: t.Node,\n parent: t.Node,\n grandparent?: t.Node,\n): boolean {\n switch (parent.type) {\n // yes: PARENT[NODE]\n // yes: NODE.child\n // no: parent.NODE\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n if (parent.property === node) {\n return !!parent.computed;\n }\n return parent.object === node;\n\n case \"JSXMemberExpression\":\n return parent.object === node;\n // no: let NODE = init;\n // yes: let id = NODE;\n case \"VariableDeclarator\":\n return parent.init === node;\n\n // yes: () => NODE\n // no: (NODE) => {}\n case \"ArrowFunctionExpression\":\n return parent.body === node;\n\n // no: class { #NODE; }\n // no: class { get #NODE() {} }\n // no: class { #NODE() {} }\n // no: class { fn() { return this.#NODE; } }\n case \"PrivateName\":\n return false;\n\n // no: class { NODE() {} }\n // yes: class { [NODE]() {} }\n // no: class { foo(NODE) {} }\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n case \"ObjectMethod\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return false;\n\n // yes: { [NODE]: \"\" }\n // no: { NODE: \"\" }\n // depends: { NODE }\n // depends: { key: NODE }\n case \"ObjectProperty\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n // parent.value === node\n return !grandparent || grandparent.type !== \"ObjectPattern\";\n // no: class { NODE = value; }\n // yes: class { [NODE] = value; }\n // yes: class { key = NODE; }\n case \"ClassProperty\":\n case \"ClassAccessorProperty\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n return true;\n case \"ClassPrivateProperty\":\n return parent.key !== node;\n\n // no: class NODE {}\n // yes: class Foo extends NODE {}\n case \"ClassDeclaration\":\n case \"ClassExpression\":\n return parent.superClass === node;\n\n // yes: left = NODE;\n // no: NODE = right;\n case \"AssignmentExpression\":\n return parent.right === node;\n\n // no: [NODE = foo] = [];\n // yes: [foo = NODE] = [];\n case \"AssignmentPattern\":\n return parent.right === node;\n\n // no: NODE: for (;;) {}\n case \"LabeledStatement\":\n return false;\n\n // no: try {} catch (NODE) {}\n case \"CatchClause\":\n return false;\n\n // no: function foo(...NODE) {}\n case \"RestElement\":\n return false;\n\n case \"BreakStatement\":\n case \"ContinueStatement\":\n return false;\n\n // no: function NODE() {}\n // no: function foo(NODE) {}\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n return false;\n\n // no: export NODE from \"foo\";\n // no: export * as NODE from \"foo\";\n case \"ExportNamespaceSpecifier\":\n case \"ExportDefaultSpecifier\":\n return false;\n\n // no: export { foo as NODE };\n // yes: export { NODE as foo };\n // no: export { NODE as foo } from \"foo\";\n case \"ExportSpecifier\":\n // @ts-expect-error todo(flow->ts): Property 'source' does not exist on type 'AnyTypeAnnotation'.\n if (grandparent?.source) {\n return false;\n }\n return parent.local === node;\n\n // no: import NODE from \"foo\";\n // no: import * as NODE from \"foo\";\n // no: import { NODE as foo } from \"foo\";\n // no: import { foo as NODE } from \"foo\";\n // no: import NODE from \"bar\";\n case \"ImportDefaultSpecifier\":\n case \"ImportNamespaceSpecifier\":\n case \"ImportSpecifier\":\n return false;\n\n // no: import \"foo\" assert { NODE: \"json\" }\n case \"ImportAttribute\":\n return false;\n\n // no: <div NODE=\"foo\" />\n case \"JSXAttribute\":\n return false;\n\n // no: [NODE] = [];\n // no: ({ NODE }) = [];\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n return false;\n\n // no: new.NODE\n // no: NODE.target\n case \"MetaProperty\":\n return false;\n\n // yes: type X = { someProperty: NODE }\n // no: type X = { NODE: OtherType }\n case \"ObjectTypeProperty\":\n return parent.key !== node;\n\n // yes: enum X { Foo = NODE }\n // no: enum X { NODE }\n case \"TSEnumMember\":\n return parent.id !== node;\n\n // yes: { [NODE]: value }\n // no: { NODE: value }\n case \"TSPropertySignature\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n\n return true;\n }\n\n return true;\n}\n"],"mappings":";;;;;;AAKe,SAASA,YAAY,CAClCC,IAAY,EACZC,MAAc,EACdC,WAAoB,EACX;EACT,QAAQD,MAAM,CAACE,IAAI;IAIjB,KAAK,kBAAkB;IACvB,KAAK,0BAA0B;MAC7B,IAAIF,MAAM,CAACG,QAAQ,KAAKJ,IAAI,EAAE;QAC5B,OAAO,CAAC,CAACC,MAAM,CAACI,QAAQ;MAC1B;MACA,OAAOJ,MAAM,CAACK,MAAM,KAAKN,IAAI;IAE/B,KAAK,qBAAqB;MACxB,OAAOC,MAAM,CAACK,MAAM,KAAKN,IAAI;IAG/B,KAAK,oBAAoB;MACvB,OAAOC,MAAM,CAACM,IAAI,KAAKP,IAAI;IAI7B,KAAK,yBAAyB;MAC5B,OAAOC,MAAM,CAACO,IAAI,KAAKR,IAAI;IAM7B,KAAK,aAAa;MAChB,OAAO,KAAK;IAKd,KAAK,aAAa;IAClB,KAAK,oBAAoB;IACzB,KAAK,cAAc;MACjB,IAAIC,MAAM,CAACQ,GAAG,KAAKT,IAAI,EAAE;QACvB,OAAO,CAAC,CAACC,MAAM,CAACI,QAAQ;MAC1B;MACA,OAAO,KAAK;IAMd,KAAK,gBAAgB;MACnB,IAAIJ,MAAM,CAACQ,GAAG,KAAKT,IAAI,EAAE;QACvB,OAAO,CAAC,CAACC,MAAM,CAACI,QAAQ;MAC1B;MAEA,OAAO,CAACH,WAAW,IAAIA,WAAW,CAACC,IAAI,KAAK,eAAe;IAI7D,KAAK,eAAe;IACpB,KAAK,uBAAuB;MAC1B,IAAIF,MAAM,CAACQ,GAAG,KAAKT,IAAI,EAAE;QACvB,OAAO,CAAC,CAACC,MAAM,CAACI,QAAQ;MAC1B;MACA,OAAO,IAAI;IACb,KAAK,sBAAsB;MACzB,OAAOJ,MAAM,CAACQ,GAAG,KAAKT,IAAI;IAI5B,KAAK,kBAAkB;IACvB,KAAK,iBAAiB;MACpB,OAAOC,MAAM,CAACS,UAAU,KAAKV,IAAI;IAInC,KAAK,sBAAsB;MACzB,OAAOC,MAAM,CAACU,KAAK,KAAKX,IAAI;IAI9B,KAAK,mBAAmB;MACtB,OAAOC,MAAM,CAACU,KAAK,KAAKX,IAAI;IAG9B,KAAK,kBAAkB;MACrB,OAAO,KAAK;IAGd,KAAK,aAAa;MAChB,OAAO,KAAK;IAGd,KAAK,aAAa;MAChB,OAAO,KAAK;IAEd,KAAK,gBAAgB;IACrB,KAAK,mBAAmB;MACtB,OAAO,KAAK;IAId,KAAK,qBAAqB;IAC1B,KAAK,oBAAoB;MACvB,OAAO,KAAK;IAId,KAAK,0BAA0B;IAC/B,KAAK,wBAAwB;MAC3B,OAAO,KAAK;IAKd,KAAK,iBAAiB;MAEpB,IAAIE,WAAW,YAAXA,WAAW,CAAEU,MAAM,EAAE;QACvB,OAAO,KAAK;MACd;MACA,OAAOX,MAAM,CAACY,KAAK,KAAKb,IAAI;IAO9B,KAAK,wBAAwB;IAC7B,KAAK,0BAA0B;IAC/B,KAAK,iBAAiB;MACpB,OAAO,KAAK;IAGd,KAAK,iBAAiB;MACpB,OAAO,KAAK;IAGd,KAAK,cAAc;MACjB,OAAO,KAAK;IAId,KAAK,eAAe;IACpB,KAAK,cAAc;MACjB,OAAO,KAAK;IAId,KAAK,cAAc;MACjB,OAAO,KAAK;IAId,KAAK,oBAAoB;MACvB,OAAOC,MAAM,CAACQ,GAAG,KAAKT,IAAI;IAI5B,KAAK,cAAc;MACjB,OAAOC,MAAM,CAACa,EAAE,KAAKd,IAAI;IAI3B,KAAK,qBAAqB;MACxB,IAAIC,MAAM,CAACQ,GAAG,KAAKT,IAAI,EAAE;QACvB,OAAO,CAAC,CAACC,MAAM,CAACI,QAAQ;MAC1B;MAEA,OAAO,IAAI;EAAC;EAGhB,OAAO,IAAI;AACb"}
|
|
@@ -9,7 +9,6 @@ function isScope(node, parent) {
|
|
|
9
9
|
if ((0, _generated.isBlockStatement)(node) && ((0, _generated.isFunction)(parent) || (0, _generated.isCatchClause)(parent))) {
|
|
10
10
|
return false;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
12
|
if ((0, _generated.isPattern)(node) && ((0, _generated.isFunction)(parent) || (0, _generated.isCatchClause)(parent))) {
|
|
14
13
|
return true;
|
|
15
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isScope","node","parent","isBlockStatement","isFunction","isCatchClause","isPattern","isScopable"],"sources":["../../src/validators/isScope.ts"],"sourcesContent":["import {\n isFunction,\n isCatchClause,\n isBlockStatement,\n isScopable,\n isPattern,\n} from \"./generated\";\nimport type * as t from \"..\";\n\n/**\n * Check if the input `node` is a scope.\n */\nexport default function isScope(node: t.Node, parent: t.Node): boolean {\n // If a BlockStatement is an immediate descendent of a Function/CatchClause, it must be in the body.\n // Hence we skipped the parentKey === \"params\" check\n if (isBlockStatement(node) && (isFunction(parent) || isCatchClause(parent))) {\n return false;\n }\n\n // If a Pattern is an immediate descendent of a Function/CatchClause, it must be in the params.\n // Hence we skipped the parentKey === \"params\" check\n if (isPattern(node) && (isFunction(parent) || isCatchClause(parent))) {\n return true;\n }\n\n return isScopable(node);\n}\n"],"mappings":";;;;;;AAAA;AAYe,SAASA,OAAO,CAACC,IAAY,EAAEC,MAAc,EAAW;EAGrE,IAAI,IAAAC,2BAAgB,EAACF,IAAI,CAAC,KAAK,IAAAG,qBAAU,EAACF,MAAM,CAAC,IAAI,IAAAG,wBAAa,EAACH,MAAM,CAAC,CAAC,EAAE;IAC3E,OAAO,KAAK;EACd
|
|
1
|
+
{"version":3,"names":["isScope","node","parent","isBlockStatement","isFunction","isCatchClause","isPattern","isScopable"],"sources":["../../src/validators/isScope.ts"],"sourcesContent":["import {\n isFunction,\n isCatchClause,\n isBlockStatement,\n isScopable,\n isPattern,\n} from \"./generated\";\nimport type * as t from \"..\";\n\n/**\n * Check if the input `node` is a scope.\n */\nexport default function isScope(node: t.Node, parent: t.Node): boolean {\n // If a BlockStatement is an immediate descendent of a Function/CatchClause, it must be in the body.\n // Hence we skipped the parentKey === \"params\" check\n if (isBlockStatement(node) && (isFunction(parent) || isCatchClause(parent))) {\n return false;\n }\n\n // If a Pattern is an immediate descendent of a Function/CatchClause, it must be in the params.\n // Hence we skipped the parentKey === \"params\" check\n if (isPattern(node) && (isFunction(parent) || isCatchClause(parent))) {\n return true;\n }\n\n return isScopable(node);\n}\n"],"mappings":";;;;;;AAAA;AAYe,SAASA,OAAO,CAACC,IAAY,EAAEC,MAAc,EAAW;EAGrE,IAAI,IAAAC,2BAAgB,EAACF,IAAI,CAAC,KAAK,IAAAG,qBAAU,EAACF,MAAM,CAAC,IAAI,IAAAG,wBAAa,EAACH,MAAM,CAAC,CAAC,EAAE;IAC3E,OAAO,KAAK;EACd;EAIA,IAAI,IAAAI,oBAAS,EAACL,IAAI,CAAC,KAAK,IAAAG,qBAAU,EAACF,MAAM,CAAC,IAAI,IAAAG,wBAAa,EAACH,MAAM,CAAC,CAAC,EAAE;IACpE,OAAO,IAAI;EACb;EAEA,OAAO,IAAAK,qBAAU,EAACN,IAAI,CAAC;AACzB"}
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = isSpecifierDefault;
|
|
7
7
|
var _generated = require("./generated");
|
|
8
8
|
function isSpecifierDefault(specifier) {
|
|
9
|
-
return (0, _generated.isImportDefaultSpecifier)(specifier) ||
|
|
10
|
-
(0, _generated.isIdentifier)(specifier.imported || specifier.exported, {
|
|
9
|
+
return (0, _generated.isImportDefaultSpecifier)(specifier) || (0, _generated.isIdentifier)(specifier.imported || specifier.exported, {
|
|
11
10
|
name: "default"
|
|
12
11
|
});
|
|
13
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isSpecifierDefault","specifier","isImportDefaultSpecifier","isIdentifier","imported","exported","name"],"sources":["../../src/validators/isSpecifierDefault.ts"],"sourcesContent":["import { isIdentifier, isImportDefaultSpecifier } from \"./generated\";\nimport type * as t from \"..\";\n\n/**\n * Check if the input `specifier` is a `default` import or export.\n */\nexport default function isSpecifierDefault(\n specifier: t.ModuleSpecifier,\n): boolean {\n return (\n isImportDefaultSpecifier(specifier) ||\n // @ts-expect-error todo(flow->ts): stricter type for specifier\n isIdentifier(specifier.imported || specifier.exported, {\n name: \"default\",\n })\n );\n}\n"],"mappings":";;;;;;AAAA;AAMe,SAASA,kBAAkB,CACxCC,SAA4B,EACnB;EACT,OACE,IAAAC,mCAAwB,EAACD,SAAS,CAAC
|
|
1
|
+
{"version":3,"names":["isSpecifierDefault","specifier","isImportDefaultSpecifier","isIdentifier","imported","exported","name"],"sources":["../../src/validators/isSpecifierDefault.ts"],"sourcesContent":["import { isIdentifier, isImportDefaultSpecifier } from \"./generated\";\nimport type * as t from \"..\";\n\n/**\n * Check if the input `specifier` is a `default` import or export.\n */\nexport default function isSpecifierDefault(\n specifier: t.ModuleSpecifier,\n): boolean {\n return (\n isImportDefaultSpecifier(specifier) ||\n // @ts-expect-error todo(flow->ts): stricter type for specifier\n isIdentifier(specifier.imported || specifier.exported, {\n name: \"default\",\n })\n );\n}\n"],"mappings":";;;;;;AAAA;AAMe,SAASA,kBAAkB,CACxCC,SAA4B,EACnB;EACT,OACE,IAAAC,mCAAwB,EAACD,SAAS,CAAC,IAEnC,IAAAE,uBAAY,EAACF,SAAS,CAACG,QAAQ,IAAIH,SAAS,CAACI,QAAQ,EAAE;IACrDC,IAAI,EAAE;EACR,CAAC,CAAC;AAEN"}
|
|
@@ -7,7 +7,6 @@ exports.default = isType;
|
|
|
7
7
|
var _definitions = require("../definitions");
|
|
8
8
|
function isType(nodeType, targetType) {
|
|
9
9
|
if (nodeType === targetType) return true;
|
|
10
|
-
|
|
11
10
|
if (_definitions.ALIAS_KEYS[targetType]) return false;
|
|
12
11
|
const aliases = _definitions.FLIPPED_ALIAS_KEYS[targetType];
|
|
13
12
|
if (aliases) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isType","nodeType","targetType","ALIAS_KEYS","aliases","FLIPPED_ALIAS_KEYS","alias"],"sources":["../../src/validators/isType.ts"],"sourcesContent":["import { FLIPPED_ALIAS_KEYS, ALIAS_KEYS } from \"../definitions\";\nimport type * as t from \"..\";\n\nexport default function isType<T extends t.Node[\"type\"]>(\n nodeType: string,\n targetType: T,\n): nodeType is T;\n\nexport default function isType(\n nodeType: string | null | undefined,\n targetType: string,\n): boolean;\n\n/**\n * Test if a `nodeType` is a `targetType` or if `targetType` is an alias of `nodeType`.\n */\nexport default function isType(nodeType: string, targetType: string): boolean {\n if (nodeType === targetType) return true;\n\n // This is a fast-path. If the test above failed, but an alias key is found, then the\n // targetType was a primary node type, so there's no need to check the aliases.\n // @ts-expect-error targetType may not index ALIAS_KEYS\n if (ALIAS_KEYS[targetType]) return false;\n\n const aliases: Array<string> | undefined = FLIPPED_ALIAS_KEYS[targetType];\n if (aliases) {\n if (aliases[0] === nodeType) return true;\n\n for (const alias of aliases) {\n if (nodeType === alias) return true;\n }\n }\n\n return false;\n}\n"],"mappings":";;;;;;AAAA;AAgBe,SAASA,MAAM,CAACC,QAAgB,EAAEC,UAAkB,EAAW;EAC5E,IAAID,QAAQ,KAAKC,UAAU,EAAE,OAAO,IAAI
|
|
1
|
+
{"version":3,"names":["isType","nodeType","targetType","ALIAS_KEYS","aliases","FLIPPED_ALIAS_KEYS","alias"],"sources":["../../src/validators/isType.ts"],"sourcesContent":["import { FLIPPED_ALIAS_KEYS, ALIAS_KEYS } from \"../definitions\";\nimport type * as t from \"..\";\n\nexport default function isType<T extends t.Node[\"type\"]>(\n nodeType: string,\n targetType: T,\n): nodeType is T;\n\nexport default function isType(\n nodeType: string | null | undefined,\n targetType: string,\n): boolean;\n\n/**\n * Test if a `nodeType` is a `targetType` or if `targetType` is an alias of `nodeType`.\n */\nexport default function isType(nodeType: string, targetType: string): boolean {\n if (nodeType === targetType) return true;\n\n // This is a fast-path. If the test above failed, but an alias key is found, then the\n // targetType was a primary node type, so there's no need to check the aliases.\n // @ts-expect-error targetType may not index ALIAS_KEYS\n if (ALIAS_KEYS[targetType]) return false;\n\n const aliases: Array<string> | undefined = FLIPPED_ALIAS_KEYS[targetType];\n if (aliases) {\n if (aliases[0] === nodeType) return true;\n\n for (const alias of aliases) {\n if (nodeType === alias) return true;\n }\n }\n\n return false;\n}\n"],"mappings":";;;;;;AAAA;AAgBe,SAASA,MAAM,CAACC,QAAgB,EAAEC,UAAkB,EAAW;EAC5E,IAAID,QAAQ,KAAKC,UAAU,EAAE,OAAO,IAAI;EAKxC,IAAIC,uBAAU,CAACD,UAAU,CAAC,EAAE,OAAO,KAAK;EAExC,MAAME,OAAkC,GAAGC,+BAAkB,CAACH,UAAU,CAAC;EACzE,IAAIE,OAAO,EAAE;IACX,IAAIA,OAAO,CAAC,CAAC,CAAC,KAAKH,QAAQ,EAAE,OAAO,IAAI;IAExC,KAAK,MAAMK,KAAK,IAAIF,OAAO,EAAE;MAC3B,IAAIH,QAAQ,KAAKK,KAAK,EAAE,OAAO,IAAI;IACrC;EACF;EAEA,OAAO,KAAK;AACd"}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = isValidES3Identifier;
|
|
7
7
|
var _isValidIdentifier = require("./isValidIdentifier");
|
|
8
8
|
const RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]);
|
|
9
|
-
|
|
10
9
|
function isValidES3Identifier(name) {
|
|
11
10
|
return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name);
|
|
12
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RESERVED_WORDS_ES3_ONLY","Set","isValidES3Identifier","name","isValidIdentifier","has"],"sources":["../../src/validators/isValidES3Identifier.ts"],"sourcesContent":["import isValidIdentifier from \"./isValidIdentifier\";\n\nconst RESERVED_WORDS_ES3_ONLY: Set<string> = new Set([\n \"abstract\",\n \"boolean\",\n \"byte\",\n \"char\",\n \"double\",\n \"enum\",\n \"final\",\n \"float\",\n \"goto\",\n \"implements\",\n \"int\",\n \"interface\",\n \"long\",\n \"native\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"short\",\n \"static\",\n \"synchronized\",\n \"throws\",\n \"transient\",\n \"volatile\",\n]);\n\n/**\n * Check if the input `name` is a valid identifier name according to the ES3 specification.\n *\n * Additional ES3 reserved words are\n */\nexport default function isValidES3Identifier(name: string): boolean {\n return isValidIdentifier(name) && !RESERVED_WORDS_ES3_ONLY.has(name);\n}\n"],"mappings":";;;;;;AAAA;AAEA,MAAMA,uBAAoC,GAAG,IAAIC,GAAG,CAAC,CACnD,UAAU,EACV,SAAS,EACT,MAAM,EACN,MAAM,EACN,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,EACP,MAAM,EACN,YAAY,EACZ,KAAK,EACL,WAAW,EACX,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,WAAW,EACX,UAAU,CACX,CAAC
|
|
1
|
+
{"version":3,"names":["RESERVED_WORDS_ES3_ONLY","Set","isValidES3Identifier","name","isValidIdentifier","has"],"sources":["../../src/validators/isValidES3Identifier.ts"],"sourcesContent":["import isValidIdentifier from \"./isValidIdentifier\";\n\nconst RESERVED_WORDS_ES3_ONLY: Set<string> = new Set([\n \"abstract\",\n \"boolean\",\n \"byte\",\n \"char\",\n \"double\",\n \"enum\",\n \"final\",\n \"float\",\n \"goto\",\n \"implements\",\n \"int\",\n \"interface\",\n \"long\",\n \"native\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"short\",\n \"static\",\n \"synchronized\",\n \"throws\",\n \"transient\",\n \"volatile\",\n]);\n\n/**\n * Check if the input `name` is a valid identifier name according to the ES3 specification.\n *\n * Additional ES3 reserved words are\n */\nexport default function isValidES3Identifier(name: string): boolean {\n return isValidIdentifier(name) && !RESERVED_WORDS_ES3_ONLY.has(name);\n}\n"],"mappings":";;;;;;AAAA;AAEA,MAAMA,uBAAoC,GAAG,IAAIC,GAAG,CAAC,CACnD,UAAU,EACV,SAAS,EACT,MAAM,EACN,MAAM,EACN,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,EACP,MAAM,EACN,YAAY,EACZ,KAAK,EACL,WAAW,EACX,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,WAAW,EACX,UAAU,CACX,CAAC;AAOa,SAASC,oBAAoB,CAACC,IAAY,EAAW;EAClE,OAAO,IAAAC,0BAAiB,EAACD,IAAI,CAAC,IAAI,CAACH,uBAAuB,CAACK,GAAG,CAACF,IAAI,CAAC;AACtE"}
|
|
@@ -9,8 +9,7 @@ var _constants = require("../constants");
|
|
|
9
9
|
function isVar(node) {
|
|
10
10
|
return (0, _generated.isVariableDeclaration)(node, {
|
|
11
11
|
kind: "var"
|
|
12
|
-
}) && !
|
|
13
|
-
node[_constants.BLOCK_SCOPED_SYMBOL];
|
|
12
|
+
}) && !node[_constants.BLOCK_SCOPED_SYMBOL];
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=isVar.js.map
|
|
@@ -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,KAAK,CAACC,IAAY,EAAW;EACnD,OACE,IAAAC,gCAAqB,EAACD,IAAI,EAAE;IAAEE,IAAI,EAAE;EAAM,CAAC,CAAC,IAC5C
|
|
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,CAEEF,IAAI,CAACG,8BAAmB,CACzB;AAEL"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babel/types",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.21.2",
|
|
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.
|
|
33
|
-
"@babel/parser": "^7.
|
|
32
|
+
"@babel/generator": "^7.21.1",
|
|
33
|
+
"@babel/parser": "^7.21.2",
|
|
34
34
|
"chalk": "^4.1.0",
|
|
35
35
|
"glob": "^7.2.0"
|
|
36
36
|
},
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type StyleTuple = [string, string]
|
|
2
|
+
|
|
3
|
+
export interface Style {
|
|
4
|
+
[key: string]: string | number | Style
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function getPropertyName(name: string): string
|
|
8
|
+
export function getStylesForProperty(
|
|
9
|
+
name: string,
|
|
10
|
+
value: string,
|
|
11
|
+
allowShorthand?: boolean
|
|
12
|
+
): Style
|
|
13
|
+
|
|
14
|
+
export default function transform(
|
|
15
|
+
styleTuples: StyleTuple[],
|
|
16
|
+
shorthandBlacklist?: string[]
|
|
17
|
+
): Style
|
|
@@ -96,6 +96,20 @@ var IDENT = regExpToken(identRe);
|
|
|
96
96
|
var STRING = matchString;
|
|
97
97
|
var COLOR = matchColor;
|
|
98
98
|
var LINE = regExpToken(/^(none|underline|line-through)$/i);
|
|
99
|
+
|
|
100
|
+
var aspectRatio = function aspectRatio(tokenStream) {
|
|
101
|
+
var aspectRatio = tokenStream.expect(NUMBER);
|
|
102
|
+
|
|
103
|
+
if (tokenStream.hasTokens()) {
|
|
104
|
+
tokenStream.expect(SLASH);
|
|
105
|
+
aspectRatio /= tokenStream.expect(NUMBER);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return {
|
|
109
|
+
aspectRatio: aspectRatio
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
|
|
99
113
|
var BORDER_STYLE = regExpToken(/^(solid|dashed|dotted)$/);
|
|
100
114
|
var defaultBorderWidth = 1;
|
|
101
115
|
var defaultBorderColor = 'black';
|
|
@@ -673,6 +687,7 @@ var textShadowOffset = function textShadowOffset(tokenStream) {
|
|
|
673
687
|
};
|
|
674
688
|
|
|
675
689
|
var transforms = {
|
|
690
|
+
aspectRatio: aspectRatio,
|
|
676
691
|
background: background,
|
|
677
692
|
border: border,
|
|
678
693
|
borderColor: borderColor,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "css-to-react-native",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Convert CSS text to a React Native stylesheet object",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"index.js",
|
|
18
|
+
"index.d.ts",
|
|
18
19
|
"src"
|
|
19
20
|
],
|
|
20
21
|
"repository": {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import transformCss from '..'
|
|
2
|
+
|
|
3
|
+
it('handles regular aspect ratio values', () => {
|
|
4
|
+
expect(transformCss([['aspect-ratio', '1.5']])).toEqual({
|
|
5
|
+
aspectRatio: 1.5,
|
|
6
|
+
})
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
it('handles CSS-style aspect ratios', () => {
|
|
10
|
+
expect(transformCss([['aspect-ratio', '3 / 2']])).toEqual({
|
|
11
|
+
aspectRatio: 1.5,
|
|
12
|
+
})
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
it('handles CSS-style aspect ratios without spaces', () => {
|
|
16
|
+
expect(transformCss([['aspect-ratio', '3/2']])).toEqual({
|
|
17
|
+
aspectRatio: 1.5,
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
it('throws when omitting second value after slash', () => {
|
|
22
|
+
expect(() => transformCss([['aspect-ratio', '3/']])).toThrow()
|
|
23
|
+
})
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NUMBER, SLASH } from '../tokenTypes'
|
|
2
|
+
|
|
3
|
+
export default tokenStream => {
|
|
4
|
+
let aspectRatio = tokenStream.expect(NUMBER)
|
|
5
|
+
|
|
6
|
+
if (tokenStream.hasTokens()) {
|
|
7
|
+
tokenStream.expect(SLASH)
|
|
8
|
+
aspectRatio /= tokenStream.expect(NUMBER)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return { aspectRatio }
|
|
12
|
+
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
UNSUPPORTED_LENGTH_UNIT,
|
|
7
7
|
WORD,
|
|
8
8
|
} from '../tokenTypes'
|
|
9
|
+
import aspectRatio from './aspectRatio'
|
|
9
10
|
import border from './border'
|
|
10
11
|
import boxShadow from './boxShadow'
|
|
11
12
|
import flex from './flex'
|
|
@@ -51,6 +52,7 @@ const textShadowOffset = tokenStream => ({
|
|
|
51
52
|
})
|
|
52
53
|
|
|
53
54
|
export default {
|
|
55
|
+
aspectRatio,
|
|
54
56
|
background,
|
|
55
57
|
border,
|
|
56
58
|
borderColor,
|
package/appFiles/src/App.tsx
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
1
|
import React, { Suspense } from 'react'
|
|
6
2
|
import TinaCMS, { TinaAdmin, useCMS, MdxFieldPluginExtendible } from 'tinacms'
|
|
7
3
|
import { TinaEditProvider, useEditState } from 'tinacms/dist/edit-state'
|
|
@@ -10,6 +6,8 @@ import { Preview } from './preview'
|
|
|
10
6
|
// TODO: Resolve this to local file in tsconfig.json
|
|
11
7
|
// @ts-expect-error
|
|
12
8
|
import config from 'TINA_IMPORT'
|
|
9
|
+
// @ts-expect-error
|
|
10
|
+
import schemaJson from 'SCHEMA_IMPORT'
|
|
13
11
|
|
|
14
12
|
const RawEditor = React.lazy(() => import('./fields/rich-text'))
|
|
15
13
|
|
|
@@ -46,7 +44,7 @@ export const TinaAdminWrapper = () => {
|
|
|
46
44
|
// @ts-ignore JSX element type 'TinaCMS' does not have any construct or call signatures.ts(2604)
|
|
47
45
|
<TinaCMS {...config} schema={schema} client={{ apiUrl: __API_URL__ }}>
|
|
48
46
|
<SetPreview outputFolder={config.build.outputFolder} />
|
|
49
|
-
<TinaAdmin preview={Preview} config={config} />
|
|
47
|
+
<TinaAdmin preview={Preview} config={config} schemaJson={schemaJson} />
|
|
50
48
|
</TinaCMS>
|
|
51
49
|
)
|
|
52
50
|
}
|