@tinacms/app 1.1.0 → 1.1.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 +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/error-message.tsx +1 -1
- package/appFiles/src/fields/rich-text/monaco/mdx.js +13517 -8946
- package/appFiles/src/lib/machines/document-machine.ts +4 -9
- package/appFiles/src/lib/machines/query-machine.ts +0 -13
- package/appFiles/src/preview.tsx +23 -0
- package/dist/index.js +3 -1
- package/package.json +5 -5
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Client, Field, Form, FormOptions, TinaCMS } from 'tinacms'
|
|
5
5
|
import { assign, createMachine, sendParent } from 'xstate'
|
|
6
|
-
import {
|
|
7
|
-
resolveForm,
|
|
8
|
-
Templateable,
|
|
9
|
-
TinaFieldEnriched,
|
|
10
|
-
TinaSchema,
|
|
11
|
-
} from 'tinacms'
|
|
6
|
+
import { resolveForm, Template, TinaFieldEnriched, TinaSchema } from 'tinacms'
|
|
12
7
|
|
|
13
8
|
export type FieldType = Field & TinaFieldEnriched
|
|
14
9
|
export type FormValues = Record<string, unknown>
|
|
@@ -53,7 +48,7 @@ export const documentMachine =
|
|
|
53
48
|
/** @xstate-layout N4IgpgJg5mDOIC5QAoC2BDAxgCwJYDswBKAOgNwBdd0AbXALwKgGIIB7Qs-ANzYGswJNFjyFS5KrQZMEBXpnRUOAbQAMAXUSgADm1iVcHLSAAeiAEwAWSyUsA2VQE4AzAHYArABoQAT0QAORxJHEMdLd1d7d3NXWIBfOO9hHAJiLgMpRnwWMAAnXLZckm0aRQAzQtQhDBSxdMk6LKhZHjYFJXw1TSQQXX0O4zMEKxt7JzcvXwtVd2DQu2d-ZwBGVWX-dwTEkHw2CDhjZNE0iWpGpmM+gyMeoctzbz8EVaDLUNdAtfvIze2j1NIuTA6AgTx0emu+EGiEszlUtlcdncdnMkyey3WtlC-mWjmW7ncTlRCSSNWOpDyBVylwhA1uMLhCKRKLRFlxcxC4UiSJikRJIH+Yhp-UMUPpz38j0Q6y2cSAA */
|
|
54
49
|
createMachine(
|
|
55
50
|
{
|
|
56
|
-
tsTypes: {} as
|
|
51
|
+
// tsTypes: {} as ,
|
|
57
52
|
schema: {
|
|
58
53
|
context: {} as ContextType,
|
|
59
54
|
services: {} as {
|
|
@@ -174,14 +169,14 @@ export const documentMachine =
|
|
|
174
169
|
const collection = schema.getCollection(
|
|
175
170
|
node._internalSys.collection.name
|
|
176
171
|
)
|
|
177
|
-
let template:
|
|
172
|
+
let template: Template
|
|
178
173
|
if (collection.templates) {
|
|
179
174
|
template = collection.templates.find((template) => {
|
|
180
175
|
if (typeof template === 'string') {
|
|
181
176
|
throw new Error(`Global templates not supported`)
|
|
182
177
|
}
|
|
183
178
|
return template.name === node._internalSys.template
|
|
184
|
-
}) as
|
|
179
|
+
}) as Template
|
|
185
180
|
} else {
|
|
186
181
|
template = collection
|
|
187
182
|
}
|
|
@@ -564,19 +564,6 @@ export const queryMachine =
|
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
566
|
})
|
|
567
|
-
if (context.cms) {
|
|
568
|
-
context.cms.events.subscribe(`forms:fields:onChange`, (event) => {
|
|
569
|
-
// Nested forms from rich-text also trigger this event
|
|
570
|
-
if (Object.keys(context.documentMap).includes(event.formId)) {
|
|
571
|
-
callback({ type: 'FIELD_CHANGE' })
|
|
572
|
-
}
|
|
573
|
-
})
|
|
574
|
-
context.cms.events.subscribe(`forms:reset`, (event) => {
|
|
575
|
-
if (Object.keys(context.documentMap).includes(event.formId)) {
|
|
576
|
-
callback({ type: 'FIELD_CHANGE' })
|
|
577
|
-
}
|
|
578
|
-
})
|
|
579
|
-
}
|
|
580
567
|
},
|
|
581
568
|
},
|
|
582
569
|
}
|
package/appFiles/src/preview.tsx
CHANGED
|
@@ -51,6 +51,7 @@ export const Preview = (
|
|
|
51
51
|
/>
|
|
52
52
|
)}
|
|
53
53
|
<iframe
|
|
54
|
+
data-test="tina-iframe"
|
|
54
55
|
id="tina-iframe"
|
|
55
56
|
ref={props.iframeRef}
|
|
56
57
|
className="h-screen w-full bg-white"
|
|
@@ -81,6 +82,28 @@ const QueryMachine = (props: {
|
|
|
81
82
|
)
|
|
82
83
|
|
|
83
84
|
const [state, send] = useMachine(machine)
|
|
85
|
+
React.useEffect(() => {
|
|
86
|
+
const unsubscribeFieldChange = cms.events.subscribe(
|
|
87
|
+
`forms:fields:onChange`,
|
|
88
|
+
(event) => {
|
|
89
|
+
// Nested forms from rich-text also trigger this event
|
|
90
|
+
if (Object.keys(state.context.documentMap).includes(event.formId)) {
|
|
91
|
+
send({ type: 'FIELD_CHANGE' })
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
const unsubscribeReset = cms.events.subscribe(`forms:reset`, (event) => {
|
|
96
|
+
if (Object.keys(state.context.documentMap).includes(event.formId)) {
|
|
97
|
+
send({ type: 'FIELD_CHANGE' })
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
return () => {
|
|
102
|
+
unsubscribeFieldChange()
|
|
103
|
+
unsubscribeReset()
|
|
104
|
+
}
|
|
105
|
+
}, [cms, state.context.documentMap])
|
|
106
|
+
|
|
84
107
|
React.useEffect(() => {
|
|
85
108
|
if (state.matches('pipeline.ready')) {
|
|
86
109
|
cms.events.dispatch({ type: 'forms:register', value: 'complete' })
|
package/dist/index.js
CHANGED
|
@@ -339,6 +339,7 @@ var viteBuild = async ({
|
|
|
339
339
|
const localBuild = l;
|
|
340
340
|
const node_env = JSON.stringify(process.env.NODE_ENV);
|
|
341
341
|
const generatedPath = import_path2.default.join(rootPath, ".tina", "__generated__");
|
|
342
|
+
const schemaImport = import_path2.default.join(generatedPath, "_graphql.json");
|
|
342
343
|
const outputPath = import_path2.default.join(rootPath, publicFolder, outputFolder);
|
|
343
344
|
const appCopyPath = import_path2.default.join(__dirname, "..", "appFiles");
|
|
344
345
|
const appRootPath = import_path2.default.join(generatedPath, "app");
|
|
@@ -373,7 +374,8 @@ var viteBuild = async ({
|
|
|
373
374
|
}
|
|
374
375
|
await (0, import_vite.build)(prebuildConfig);
|
|
375
376
|
const alias = {
|
|
376
|
-
TINA_IMPORT: configPrebuildPath
|
|
377
|
+
TINA_IMPORT: configPrebuildPath,
|
|
378
|
+
SCHEMA_IMPORT: schemaImport
|
|
377
379
|
};
|
|
378
380
|
const publicEnv = {};
|
|
379
381
|
Object.keys(process.env).forEach((key) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/app",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"@types/fs-extra": "^9.0.1",
|
|
37
37
|
"@types/react": "17.0.2",
|
|
38
38
|
"@types/react-dom": "17.0.2",
|
|
39
|
-
"@tinacms/scripts": "1.0.
|
|
40
|
-
"tinacms": "1.
|
|
41
|
-
"@tinacms/toolkit": "1.
|
|
42
|
-
"@tinacms/mdx": "1.3.
|
|
39
|
+
"@tinacms/scripts": "1.0.3",
|
|
40
|
+
"tinacms": "1.3.0",
|
|
41
|
+
"@tinacms/toolkit": "1.4.0",
|
|
42
|
+
"@tinacms/mdx": "1.3.2",
|
|
43
43
|
"jest": "^27.0.6"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|