@tinacms/app 1.0.0 → 1.0.2
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 +23 -23
- package/appFiles/node_modules/@babel/generator/lib/generators/methods.js +3 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/methods.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/index.js +11 -0
- package/appFiles/node_modules/@babel/generator/lib/index.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/printer.js +38 -21
- package/appFiles/node_modules/@babel/generator/lib/printer.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/package.json +3 -3
- package/appFiles/node_modules/@babel/parser/lib/index.js +164 -98
- 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 +1 -1
- package/appFiles/node_modules/@babel/runtime/helpers/checkInRHS.js +6 -0
- package/appFiles/node_modules/@babel/runtime/helpers/createClass.js +2 -1
- package/appFiles/node_modules/@babel/runtime/helpers/defineProperty.js +2 -0
- package/appFiles/node_modules/@babel/runtime/helpers/esm/checkInRHS.js +5 -0
- package/appFiles/node_modules/@babel/runtime/helpers/esm/createClass.js +2 -1
- package/appFiles/node_modules/@babel/runtime/helpers/esm/defineProperty.js +2 -0
- package/appFiles/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +23 -18
- package/appFiles/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js +8 -7
- package/appFiles/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +3 -8
- package/appFiles/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +23 -18
- package/appFiles/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js +8 -7
- package/appFiles/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +3 -8
- package/appFiles/node_modules/@babel/runtime/package.json +29 -20
- package/appFiles/node_modules/@babel/traverse/lib/path/context.js +3 -2
- package/appFiles/node_modules/@babel/traverse/lib/path/context.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/conversion.js +8 -4
- package/appFiles/node_modules/@babel/traverse/lib/path/conversion.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js +1 -0
- package/appFiles/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/scope/index.js +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/scope/index.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/package.json +4 -4
- package/appFiles/node_modules/@babel/types/lib/index.d.ts +64 -64
- package/appFiles/node_modules/@babel/types/package.json +3 -3
- package/appFiles/node_modules/regenerator-runtime/package.json +2 -2
- package/appFiles/node_modules/regenerator-runtime/runtime.js +18 -17
- package/appFiles/src/App.tsx +0 -12
- package/appFiles/src/fields/rich-text/monaco/mdx.js +0 -46
- package/appFiles/src/lib/machines/query-machine.ts +137 -2
- package/appFiles/src/preview.tsx +9 -15
- package/dist/index.js +7 -5
- package/package.json +3 -3
- package/appFiles/node_modules/@babel/parser/typings/babel-parser.source.d.ts +0 -151
|
@@ -12,7 +12,7 @@ interface CommentBlock extends BaseComment {
|
|
|
12
12
|
interface CommentLine extends BaseComment {
|
|
13
13
|
type: "CommentLine";
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
type Comment = CommentBlock | CommentLine;
|
|
16
16
|
interface SourceLocation {
|
|
17
17
|
start: {
|
|
18
18
|
line: number;
|
|
@@ -34,8 +34,8 @@ interface BaseNode {
|
|
|
34
34
|
range?: [number, number];
|
|
35
35
|
extra?: Record<string, unknown>;
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
type CommentTypeShorthand = "leading" | "inner" | "trailing";
|
|
38
|
+
type Node = AnyTypeAnnotation | ArgumentPlaceholder | ArrayExpression | ArrayPattern | ArrayTypeAnnotation | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | BinaryExpression | BindExpression | BlockStatement | BooleanLiteral | BooleanLiteralTypeAnnotation | BooleanTypeAnnotation | BreakStatement | CallExpression | CatchClause | ClassAccessorProperty | ClassBody | ClassDeclaration | ClassExpression | ClassImplements | ClassMethod | ClassPrivateMethod | ClassPrivateProperty | ClassProperty | ConditionalExpression | ContinueStatement | DebuggerStatement | DecimalLiteral | DeclareClass | DeclareExportAllDeclaration | DeclareExportDeclaration | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareOpaqueType | DeclareTypeAlias | DeclareVariable | DeclaredPredicate | Decorator | Directive | DirectiveLiteral | DoExpression | DoWhileStatement | EmptyStatement | EmptyTypeAnnotation | EnumBooleanBody | EnumBooleanMember | EnumDeclaration | EnumDefaultedMember | EnumNumberBody | EnumNumberMember | EnumStringBody | EnumStringMember | EnumSymbolBody | ExistsTypeAnnotation | ExportAllDeclaration | ExportDefaultDeclaration | ExportDefaultSpecifier | ExportNamedDeclaration | ExportNamespaceSpecifier | ExportSpecifier | ExpressionStatement | File | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | FunctionExpression | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | Identifier | IfStatement | Import | ImportAttribute | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | IndexedAccessType | InferredPredicate | InterfaceDeclaration | InterfaceExtends | InterfaceTypeAnnotation | InterpreterDirective | IntersectionTypeAnnotation | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LabeledStatement | LogicalExpression | MemberExpression | MetaProperty | MixedTypeAnnotation | ModuleExpression | NewExpression | Noop | NullLiteral | NullLiteralTypeAnnotation | NullableTypeAnnotation | NumberLiteral$1 | NumberLiteralTypeAnnotation | NumberTypeAnnotation | NumericLiteral | ObjectExpression | ObjectMethod | ObjectPattern | ObjectProperty | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeInternalSlot | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | OptionalCallExpression | OptionalIndexedAccessType | OptionalMemberExpression | ParenthesizedExpression | PipelineBareFunction | PipelinePrimaryTopicReference | PipelineTopicExpression | Placeholder | PrivateName | Program | QualifiedTypeIdentifier | RecordExpression | RegExpLiteral | RegexLiteral$1 | RestElement | RestProperty$1 | ReturnStatement | SequenceExpression | SpreadElement | SpreadProperty$1 | StaticBlock | StringLiteral | StringLiteralTypeAnnotation | StringTypeAnnotation | Super | SwitchCase | SwitchStatement | SymbolTypeAnnotation | TSAnyKeyword | TSArrayType | TSAsExpression | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSConditionalType | TSConstructSignatureDeclaration | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExpressionWithTypeArguments | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexSignature | TSIndexedAccessType | TSInferType | TSInstantiationExpression | TSInterfaceBody | TSInterfaceDeclaration | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPropertySignature | TSQualifiedName | TSRestType | TSSatisfiesExpression | TSStringKeyword | TSSymbolKeyword | TSThisType | TSTupleType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | TaggedTemplateExpression | TemplateElement | TemplateLiteral | ThisExpression | ThisTypeAnnotation | ThrowStatement | TopicReference | TryStatement | TupleExpression | TupleTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | TypeofTypeAnnotation | UnaryExpression | UnionTypeAnnotation | UpdateExpression | V8IntrinsicIdentifier | VariableDeclaration | VariableDeclarator | Variance | VoidTypeAnnotation | WhileStatement | WithStatement | YieldExpression;
|
|
39
39
|
interface ArrayExpression extends BaseNode {
|
|
40
40
|
type: "ArrayExpression";
|
|
41
41
|
elements: Array<null | Expression | SpreadElement>;
|
|
@@ -1428,55 +1428,55 @@ interface TSTypeParameter extends BaseNode {
|
|
|
1428
1428
|
in?: boolean | null;
|
|
1429
1429
|
out?: boolean | null;
|
|
1430
1430
|
}
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1431
|
+
type Standardized = ArrayExpression | AssignmentExpression | BinaryExpression | InterpreterDirective | Directive | DirectiveLiteral | BlockStatement | BreakStatement | CallExpression | CatchClause | ConditionalExpression | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | File | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | LabeledStatement | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | Program | ObjectExpression | ObjectMethod | ObjectProperty | RestElement | ReturnStatement | SequenceExpression | ParenthesizedExpression | SwitchCase | SwitchStatement | ThisExpression | ThrowStatement | TryStatement | UnaryExpression | UpdateExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | AssignmentPattern | ArrayPattern | ArrowFunctionExpression | ClassBody | ClassExpression | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ForOfStatement | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | MetaProperty | ClassMethod | ObjectPattern | SpreadElement | Super | TaggedTemplateExpression | TemplateElement | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | ExportNamespaceSpecifier | OptionalMemberExpression | OptionalCallExpression | ClassProperty | ClassAccessorProperty | ClassPrivateProperty | ClassPrivateMethod | PrivateName | StaticBlock;
|
|
1432
|
+
type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression | SequenceExpression | ParenthesizedExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression | ClassExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | OptionalMemberExpression | OptionalCallExpression | TypeCastExpression | JSXElement | JSXFragment | BindExpression | DoExpression | RecordExpression | TupleExpression | DecimalLiteral | ModuleExpression | TopicReference | PipelineTopicExpression | PipelineBareFunction | PipelinePrimaryTopicReference | TSInstantiationExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression;
|
|
1433
|
+
type Binary = BinaryExpression | LogicalExpression;
|
|
1434
|
+
type Scopable = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ClassExpression | ClassDeclaration | ForOfStatement | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock;
|
|
1435
|
+
type BlockParent = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ForOfStatement | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock;
|
|
1436
|
+
type Block = BlockStatement | Program | TSModuleBlock;
|
|
1437
|
+
type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForStatement | FunctionDeclaration | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | VariableDeclaration | WhileStatement | WithStatement | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ForOfStatement | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias | EnumDeclaration | TSDeclareFunction | TSInterfaceDeclaration | TSTypeAliasDeclaration | TSEnumDeclaration | TSModuleDeclaration | TSImportEqualsDeclaration | TSExportAssignment | TSNamespaceExportDeclaration;
|
|
1438
|
+
type Terminatorless = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement | YieldExpression | AwaitExpression;
|
|
1439
|
+
type CompletionStatement = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement;
|
|
1440
|
+
type Conditional = ConditionalExpression | IfStatement;
|
|
1441
|
+
type Loop = DoWhileStatement | ForInStatement | ForStatement | WhileStatement | ForOfStatement;
|
|
1442
|
+
type While = DoWhileStatement | WhileStatement;
|
|
1443
|
+
type ExpressionWrapper = ExpressionStatement | ParenthesizedExpression | TypeCastExpression;
|
|
1444
|
+
type For = ForInStatement | ForStatement | ForOfStatement;
|
|
1445
|
+
type ForXStatement = ForInStatement | ForOfStatement;
|
|
1446
|
+
type Function = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod;
|
|
1447
|
+
type FunctionParent = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock;
|
|
1448
|
+
type Pureish = FunctionDeclaration | FunctionExpression | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | ArrowFunctionExpression | BigIntLiteral | DecimalLiteral;
|
|
1449
|
+
type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias | EnumDeclaration | TSDeclareFunction | TSInterfaceDeclaration | TSTypeAliasDeclaration | TSEnumDeclaration | TSModuleDeclaration;
|
|
1450
|
+
type PatternLike = Identifier | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression;
|
|
1451
|
+
type LVal = Identifier | MemberExpression | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern | TSParameterProperty | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression;
|
|
1452
|
+
type TSEntityName = Identifier | TSQualifiedName;
|
|
1453
|
+
type Literal = StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | TemplateLiteral | BigIntLiteral | DecimalLiteral;
|
|
1454
|
+
type Immutable = StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | BigIntLiteral | JSXAttribute | JSXClosingElement | JSXElement | JSXExpressionContainer | JSXSpreadChild | JSXOpeningElement | JSXText | JSXFragment | JSXOpeningFragment | JSXClosingFragment | DecimalLiteral;
|
|
1455
|
+
type UserWhitespacable = ObjectMethod | ObjectProperty | ObjectTypeInternalSlot | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | ObjectTypeSpreadProperty;
|
|
1456
|
+
type Method = ObjectMethod | ClassMethod | ClassPrivateMethod;
|
|
1457
|
+
type ObjectMember = ObjectMethod | ObjectProperty;
|
|
1458
|
+
type Property = ObjectProperty | ClassProperty | ClassAccessorProperty | ClassPrivateProperty;
|
|
1459
|
+
type UnaryLike = UnaryExpression | SpreadElement;
|
|
1460
|
+
type Pattern = AssignmentPattern | ArrayPattern | ObjectPattern;
|
|
1461
|
+
type Class = ClassExpression | ClassDeclaration;
|
|
1462
|
+
type ModuleDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration;
|
|
1463
|
+
type ExportDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration;
|
|
1464
|
+
type ModuleSpecifier = ExportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | ExportNamespaceSpecifier | ExportDefaultSpecifier;
|
|
1465
|
+
type Accessor = ClassAccessorProperty;
|
|
1466
|
+
type Private = ClassPrivateProperty | ClassPrivateMethod | PrivateName;
|
|
1467
|
+
type Flow = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullLiteralTypeAnnotation | ClassImplements | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | DeclaredPredicate | ExistsTypeAnnotation | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | InferredPredicate | InterfaceExtends | InterfaceDeclaration | InterfaceTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NullableTypeAnnotation | NumberLiteralTypeAnnotation | NumberTypeAnnotation | ObjectTypeAnnotation | ObjectTypeInternalSlot | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | QualifiedTypeIdentifier | StringLiteralTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | UnionTypeAnnotation | Variance | VoidTypeAnnotation | EnumDeclaration | EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody | EnumBooleanMember | EnumNumberMember | EnumStringMember | EnumDefaultedMember | IndexedAccessType | OptionalIndexedAccessType;
|
|
1468
|
+
type FlowType = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullLiteralTypeAnnotation | ExistsTypeAnnotation | FunctionTypeAnnotation | GenericTypeAnnotation | InterfaceTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NullableTypeAnnotation | NumberLiteralTypeAnnotation | NumberTypeAnnotation | ObjectTypeAnnotation | StringLiteralTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | UnionTypeAnnotation | VoidTypeAnnotation | IndexedAccessType | OptionalIndexedAccessType;
|
|
1469
|
+
type FlowBaseAnnotation = AnyTypeAnnotation | BooleanTypeAnnotation | NullLiteralTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NumberTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | VoidTypeAnnotation;
|
|
1470
|
+
type FlowDeclaration = DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias;
|
|
1471
|
+
type FlowPredicate = DeclaredPredicate | InferredPredicate;
|
|
1472
|
+
type EnumBody = EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody;
|
|
1473
|
+
type EnumMember = EnumBooleanMember | EnumNumberMember | EnumStringMember | EnumDefaultedMember;
|
|
1474
|
+
type JSX = JSXAttribute | JSXClosingElement | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXSpreadChild | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXSpreadAttribute | JSXText | JSXFragment | JSXOpeningFragment | JSXClosingFragment;
|
|
1475
|
+
type Miscellaneous = Noop | Placeholder | V8IntrinsicIdentifier;
|
|
1476
|
+
type TypeScript = TSParameterProperty | TSDeclareFunction | TSDeclareMethod | TSQualifiedName | TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSPropertySignature | TSMethodSignature | TSIndexSignature | TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSFunctionType | TSConstructorType | TSTypeReference | TSTypePredicate | TSTypeQuery | TSTypeLiteral | TSArrayType | TSTupleType | TSOptionalType | TSRestType | TSNamedTupleMember | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSParenthesizedType | TSTypeOperator | TSIndexedAccessType | TSMappedType | TSLiteralType | TSExpressionWithTypeArguments | TSInterfaceDeclaration | TSInterfaceBody | TSTypeAliasDeclaration | TSInstantiationExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSEnumDeclaration | TSEnumMember | TSModuleDeclaration | TSModuleBlock | TSImportType | TSImportEqualsDeclaration | TSExternalModuleReference | TSNonNullExpression | TSExportAssignment | TSNamespaceExportDeclaration | TSTypeAnnotation | TSTypeParameterInstantiation | TSTypeParameterDeclaration | TSTypeParameter;
|
|
1477
|
+
type TSTypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSPropertySignature | TSMethodSignature | TSIndexSignature;
|
|
1478
|
+
type TSType = TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSFunctionType | TSConstructorType | TSTypeReference | TSTypePredicate | TSTypeQuery | TSTypeLiteral | TSArrayType | TSTupleType | TSOptionalType | TSRestType | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSParenthesizedType | TSTypeOperator | TSIndexedAccessType | TSMappedType | TSLiteralType | TSExpressionWithTypeArguments | TSImportType;
|
|
1479
|
+
type TSBaseType = TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSLiteralType;
|
|
1480
1480
|
interface Aliases {
|
|
1481
1481
|
Standardized: Standardized;
|
|
1482
1482
|
Expression: Expression;
|
|
@@ -1528,7 +1528,7 @@ interface Aliases {
|
|
|
1528
1528
|
TSType: TSType;
|
|
1529
1529
|
TSBaseType: TSBaseType;
|
|
1530
1530
|
}
|
|
1531
|
-
|
|
1531
|
+
type DeprecatedAliases = NumberLiteral$1 | RegexLiteral$1 | RestProperty$1 | SpreadProperty$1;
|
|
1532
1532
|
interface ParentMaps {
|
|
1533
1533
|
AnyTypeAnnotation: ArrayTypeAnnotation | DeclareExportDeclaration | DeclareOpaqueType | DeclareTypeAlias | DeclaredPredicate | FunctionTypeAnnotation | FunctionTypeParam | IndexedAccessType | IntersectionTypeAnnotation | NullableTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeInternalSlot | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | OptionalIndexedAccessType | TupleTypeAnnotation | TypeAlias | TypeAnnotation | TypeParameter | TypeParameterInstantiation | TypeofTypeAnnotation | UnionTypeAnnotation;
|
|
1534
1534
|
ArgumentPlaceholder: CallExpression | NewExpression | OptionalCallExpression;
|
|
@@ -1789,7 +1789,7 @@ interface ParentMaps {
|
|
|
1789
1789
|
|
|
1790
1790
|
declare function isCompatTag(tagName?: string): boolean;
|
|
1791
1791
|
|
|
1792
|
-
|
|
1792
|
+
type ReturnedChild = JSXSpreadChild | JSXElement | JSXFragment | Expression;
|
|
1793
1793
|
declare function buildChildren(node: JSXElement | JSXFragment): ReturnedChild[];
|
|
1794
1794
|
|
|
1795
1795
|
declare function assertNode(node?: any): asserts node is Node;
|
|
@@ -2674,13 +2674,13 @@ declare const BUILDER_KEYS: Record<string, string[]>;
|
|
|
2674
2674
|
declare const DEPRECATED_KEYS: Record<string, NodeTypesWithoutComment>;
|
|
2675
2675
|
declare const NODE_PARENT_VALIDATIONS: Record<string, Validator>;
|
|
2676
2676
|
declare function getType(val: any): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "null" | "array";
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2677
|
+
type NodeTypesWithoutComment = Node["type"] | keyof Aliases;
|
|
2678
|
+
type NodeTypes = NodeTypesWithoutComment | Comment["type"];
|
|
2679
|
+
type PrimitiveTypes = ReturnType<typeof getType>;
|
|
2680
|
+
type FieldDefinitions = {
|
|
2681
2681
|
[x: string]: FieldOptions;
|
|
2682
2682
|
};
|
|
2683
|
-
|
|
2683
|
+
type Validator = ({
|
|
2684
2684
|
type: PrimitiveTypes;
|
|
2685
2685
|
} | {
|
|
2686
2686
|
each: Validator;
|
|
@@ -2697,7 +2697,7 @@ declare type Validator = ({
|
|
|
2697
2697
|
[x: string]: FieldOptions;
|
|
2698
2698
|
};
|
|
2699
2699
|
} | {}) & ((node: Node, key: string, val: any) => void);
|
|
2700
|
-
|
|
2700
|
+
type FieldOptions = {
|
|
2701
2701
|
default?: string | number | boolean | [];
|
|
2702
2702
|
optional?: boolean;
|
|
2703
2703
|
validate?: Validator;
|
|
@@ -2725,7 +2725,7 @@ declare function inherits<T extends Node | null | undefined>(child: T, parent: N
|
|
|
2725
2725
|
*/
|
|
2726
2726
|
declare function prependToMemberExpression<T extends Pick<MemberExpression, "object" | "property">>(member: T, prepend: MemberExpression["object"]): T;
|
|
2727
2727
|
|
|
2728
|
-
|
|
2728
|
+
type Options = {
|
|
2729
2729
|
preserveComments?: boolean;
|
|
2730
2730
|
};
|
|
2731
2731
|
/**
|
|
@@ -2798,13 +2798,13 @@ declare const _default: {
|
|
|
2798
2798
|
};
|
|
2799
2799
|
//# sourceMappingURL=getOuterBindingIdentifiers.d.ts.map
|
|
2800
2800
|
|
|
2801
|
-
|
|
2801
|
+
type TraversalAncestors = Array<{
|
|
2802
2802
|
node: Node;
|
|
2803
2803
|
key: string;
|
|
2804
2804
|
index?: number;
|
|
2805
2805
|
}>;
|
|
2806
|
-
|
|
2807
|
-
|
|
2806
|
+
type TraversalHandler<T> = (this: undefined, node: Node, parent: TraversalAncestors, state: T) => void;
|
|
2807
|
+
type TraversalHandlers<T> = {
|
|
2808
2808
|
enter?: TraversalHandler<T>;
|
|
2809
2809
|
exit?: TraversalHandler<T>;
|
|
2810
2810
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babel/types",
|
|
3
|
-
"version": "7.20.
|
|
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.
|
|
33
|
-
"@babel/parser": "^7.20.
|
|
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.
|
|
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/
|
|
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
|
|
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
|
|
336
|
+
// method, or a missing .next mehtod, always terminate the
|
|
337
|
+
// yield* loop.
|
|
336
338
|
context.delegate = null;
|
|
337
339
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
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
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
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 '
|
|
357
|
+
"The iterator does not provide a '" + methodName + "' method");
|
|
357
358
|
}
|
|
358
359
|
|
|
359
360
|
return ContinueSentinel;
|
package/appFiles/src/App.tsx
CHANGED
|
@@ -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
|
|
400
|
+
return value
|
|
376
401
|
},
|
|
377
402
|
})
|
|
378
403
|
if (missingForms.length > 0) {
|
|
@@ -384,6 +409,113 @@ 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 (
|
|
429
|
+
[
|
|
430
|
+
'_internalSys',
|
|
431
|
+
'_internalValues',
|
|
432
|
+
'_sys',
|
|
433
|
+
META_KEY,
|
|
434
|
+
].includes(i)
|
|
435
|
+
) {
|
|
436
|
+
//going one step down in the object tree!!
|
|
437
|
+
yield* innerTraversal(o[i], itemPath)
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
yield* innerTraversal(o)
|
|
443
|
+
}
|
|
444
|
+
const nodePaths = []
|
|
445
|
+
for (let [key, value, path, parent] of traverse(newData.data)) {
|
|
446
|
+
if (value?._internalSys) {
|
|
447
|
+
nodePaths.push(path)
|
|
448
|
+
const fields = {}
|
|
449
|
+
const parents = nodePaths.filter((nodePath) => {
|
|
450
|
+
return path.join('.').startsWith(nodePath.join('.'))
|
|
451
|
+
})
|
|
452
|
+
|
|
453
|
+
const nearestParent = parents.reduce(function (a, b) {
|
|
454
|
+
return a.length < b.length ? a : b
|
|
455
|
+
})
|
|
456
|
+
Object.keys(value).map((key) => {
|
|
457
|
+
if (
|
|
458
|
+
[
|
|
459
|
+
'__typename',
|
|
460
|
+
'_internalSys',
|
|
461
|
+
'_internalValues',
|
|
462
|
+
'_sys',
|
|
463
|
+
].includes(key)
|
|
464
|
+
) {
|
|
465
|
+
return false
|
|
466
|
+
}
|
|
467
|
+
fields[key] = [
|
|
468
|
+
...path.slice(nearestParent.length + 1),
|
|
469
|
+
key,
|
|
470
|
+
].join('.')
|
|
471
|
+
})
|
|
472
|
+
value[META_KEY] = {
|
|
473
|
+
id: value?._internalSys.path,
|
|
474
|
+
name: path.slice(nearestParent.length).join('.'),
|
|
475
|
+
fields,
|
|
476
|
+
}
|
|
477
|
+
} else if (
|
|
478
|
+
typeof value === 'object' &&
|
|
479
|
+
!Array.isArray(value) &&
|
|
480
|
+
value !== null
|
|
481
|
+
) {
|
|
482
|
+
if (key !== META_KEY) {
|
|
483
|
+
const parents = nodePaths.filter((nodePath) => {
|
|
484
|
+
return path.join('.').startsWith(nodePath.join('.'))
|
|
485
|
+
})
|
|
486
|
+
if (parents.length) {
|
|
487
|
+
const nearestParent = parents.reduce(function (a, b) {
|
|
488
|
+
return a.length < b.length ? a : b
|
|
489
|
+
})
|
|
490
|
+
const parent = getIn(newData.data, nearestParent.join('.'))
|
|
491
|
+
const id = parent._internalSys.path
|
|
492
|
+
const fields = {}
|
|
493
|
+
Object.keys(value).map((key) => {
|
|
494
|
+
if (
|
|
495
|
+
[
|
|
496
|
+
'__typename',
|
|
497
|
+
'_internalSys',
|
|
498
|
+
'_internalValues',
|
|
499
|
+
'_sys',
|
|
500
|
+
].includes(key)
|
|
501
|
+
) {
|
|
502
|
+
return false
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
fields[key] = [
|
|
506
|
+
...path.slice(nearestParent.length),
|
|
507
|
+
key,
|
|
508
|
+
].join('.')
|
|
509
|
+
})
|
|
510
|
+
value[META_KEY] = {
|
|
511
|
+
id,
|
|
512
|
+
name: path.slice(nearestParent.length).join('.'),
|
|
513
|
+
fields,
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
387
519
|
return { data: newData.data }
|
|
388
520
|
},
|
|
389
521
|
initializer: async (context, event) => {
|
|
@@ -505,7 +637,10 @@ const resolveFormValue = <T extends Record<string, unknown>>({
|
|
|
505
637
|
const accum: Record<string, unknown> = {}
|
|
506
638
|
fields.forEach((field) => {
|
|
507
639
|
const v = values[field.name]
|
|
508
|
-
if (
|
|
640
|
+
if (typeof v === 'undefined') {
|
|
641
|
+
return
|
|
642
|
+
}
|
|
643
|
+
if (v === null) {
|
|
509
644
|
return
|
|
510
645
|
}
|
|
511
646
|
accum[field.name] = resolveFieldValue({
|
package/appFiles/src/preview.tsx
CHANGED
|
@@ -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
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
|