tinacms 0.70.0 → 0.70.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/dist/hooks/formify/spec/schema.d.ts +2 -2
- package/dist/index.d.ts +41 -10
- package/dist/index.es.js +4 -3
- package/dist/index.js +4 -3
- package/package.json +2 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const schema:
|
|
2
|
-
export declare const tinaConfig: import("@tinacms/schema-tools").
|
|
1
|
+
declare const schema: any;
|
|
2
|
+
export declare const tinaConfig: import("@tinacms/schema-tools/dist/types").Config<(cms: import("@tinacms/toolkit/dist/tina-cms").TinaCMS) => import("@tinacms/toolkit/dist/tina-cms").TinaCMS, import("../../use-graphql-forms").formifyCallback, import("../../use-content-creator").DocumentCreatorArgs, undefined>;
|
|
3
3
|
export default schema;
|
package/dist/index.d.ts
CHANGED
|
@@ -27,15 +27,46 @@ export type { TinaCMSProviderDefaultProps };
|
|
|
27
27
|
export default TinaCMSProvider2;
|
|
28
28
|
import { TinaCMS } from '@tinacms/toolkit';
|
|
29
29
|
import { formifyCallback } from './hooks/use-graphql-forms';
|
|
30
|
-
import type { TinaCloudSchema as TinaCloudSchemaBase, TinaCloudCollection as TinaCloudCollectionBase, TinaCloudTemplateBase, TinaTemplate, TinaFieldBase, TinaCMSConfig } from '@tinacms/schema-tools';
|
|
31
30
|
export { NAMER, resolveForm } from '@tinacms/schema-tools';
|
|
32
|
-
|
|
33
|
-
export
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export type
|
|
38
|
-
|
|
31
|
+
import type { Config, SchemaField, Schema, Collection, Template } from '@tinacms/schema-tools/dist/types';
|
|
32
|
+
export type { Config, Schema, Collection, Template, SchemaField };
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated use `SchemaField` instead
|
|
35
|
+
*/
|
|
36
|
+
export declare type TinaFieldEnriched = SchemaField;
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated use `SchemaField` instead
|
|
39
|
+
*/
|
|
40
|
+
export declare type TinaField = SchemaField;
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated use `Template` instead
|
|
43
|
+
*/
|
|
44
|
+
export declare type TinaTemplate = Template;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated use `Template` instead
|
|
47
|
+
*/
|
|
48
|
+
export declare type Templateable = Template;
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated use `Template` instead
|
|
51
|
+
*/
|
|
52
|
+
export declare type TinaCloudTemplatebase = Template;
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated use `Collection` instead
|
|
55
|
+
*/
|
|
56
|
+
export declare type TinaCloudCollection = Collection;
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated use `Collection` instead
|
|
59
|
+
*/
|
|
60
|
+
export declare type TinaCollection = Collection;
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated use `Schema` instead
|
|
63
|
+
*/
|
|
64
|
+
export declare type TinaSchema = Schema;
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated use `Schema` instead
|
|
67
|
+
*/
|
|
68
|
+
export declare type TinaCloudSchema = Schema;
|
|
69
|
+
export declare const defineSchema: (config: Schema) => Schema;
|
|
39
70
|
export declare const defineLegacyConfig: (config: Omit<TinaCMSProviderDefaultProps, 'children'>) => Omit<TinaCMSProviderDefaultProps, "children">;
|
|
40
|
-
export declare const defineStaticConfig: (config:
|
|
41
|
-
export declare const defineConfig: (config:
|
|
71
|
+
export declare const defineStaticConfig: (config: Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, undefined>) => Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, undefined>;
|
|
72
|
+
export declare const defineConfig: (config: Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, undefined>) => Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, undefined>;
|
package/dist/index.es.js
CHANGED
|
@@ -5288,7 +5288,7 @@ const FilenameInput = (props) => {
|
|
|
5288
5288
|
}));
|
|
5289
5289
|
};
|
|
5290
5290
|
const RenderForm$1 = ({ cms, collection, templateName, mutationInfo }) => {
|
|
5291
|
-
var _a, _b, _c, _d, _e;
|
|
5291
|
+
var _a, _b, _c, _d, _e, _f;
|
|
5292
5292
|
const navigate = useNavigate();
|
|
5293
5293
|
const [formIsPristine, setFormIsPristine] = useState(true);
|
|
5294
5294
|
const schema = cms.api.tina.schema;
|
|
@@ -5313,10 +5313,11 @@ const RenderForm$1 = ({ cms, collection, templateName, mutationInfo }) => {
|
|
|
5313
5313
|
};
|
|
5314
5314
|
}
|
|
5315
5315
|
}
|
|
5316
|
+
const defaultItem = ((_d = template.ui) == null ? void 0 : _d.defaultItem) || (template == null ? void 0 : template.defaultItem);
|
|
5316
5317
|
const form = useMemo(() => {
|
|
5317
5318
|
var _a2, _b2;
|
|
5318
5319
|
return new Form({
|
|
5319
|
-
initialValues: typeof
|
|
5320
|
+
initialValues: typeof defaultItem === "function" ? defaultItem() : defaultItem,
|
|
5320
5321
|
extraSubscribeValues: { active: true, submitting: true, touched: true },
|
|
5321
5322
|
onChange: (values) => {
|
|
5322
5323
|
var _a3;
|
|
@@ -5372,7 +5373,7 @@ const RenderForm$1 = ({ cms, collection, templateName, mutationInfo }) => {
|
|
|
5372
5373
|
const windowWidth = useWindowWidth();
|
|
5373
5374
|
const renderNavToggle = windowWidth < navBreakpoint + 1;
|
|
5374
5375
|
const headerPadding = renderNavToggle ? "px-20" : "px-6";
|
|
5375
|
-
return /* @__PURE__ */ React.createElement(PageWrapper, null, /* @__PURE__ */ React.createElement(React.Fragment, null, ((
|
|
5376
|
+
return /* @__PURE__ */ React.createElement(PageWrapper, null, /* @__PURE__ */ React.createElement(React.Fragment, null, ((_f = (_e = cms == null ? void 0 : cms.api) == null ? void 0 : _e.tina) == null ? void 0 : _f.isLocalMode) && /* @__PURE__ */ React.createElement(LocalWarning, null), /* @__PURE__ */ React.createElement("div", {
|
|
5376
5377
|
className: `py-4 border-b border-gray-200 bg-white ${headerPadding}`
|
|
5377
5378
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
5378
5379
|
className: "max-w-form mx-auto"
|
package/dist/index.js
CHANGED
|
@@ -5304,7 +5304,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
5304
5304
|
}));
|
|
5305
5305
|
};
|
|
5306
5306
|
const RenderForm$1 = ({ cms, collection, templateName, mutationInfo }) => {
|
|
5307
|
-
var _a, _b, _c, _d, _e;
|
|
5307
|
+
var _a, _b, _c, _d, _e, _f;
|
|
5308
5308
|
const navigate = reactRouterDom.useNavigate();
|
|
5309
5309
|
const [formIsPristine, setFormIsPristine] = React.useState(true);
|
|
5310
5310
|
const schema = cms.api.tina.schema;
|
|
@@ -5329,10 +5329,11 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
5329
5329
|
};
|
|
5330
5330
|
}
|
|
5331
5331
|
}
|
|
5332
|
+
const defaultItem = ((_d = template.ui) == null ? void 0 : _d.defaultItem) || (template == null ? void 0 : template.defaultItem);
|
|
5332
5333
|
const form = React.useMemo(() => {
|
|
5333
5334
|
var _a2, _b2;
|
|
5334
5335
|
return new toolkit.Form({
|
|
5335
|
-
initialValues: typeof
|
|
5336
|
+
initialValues: typeof defaultItem === "function" ? defaultItem() : defaultItem,
|
|
5336
5337
|
extraSubscribeValues: { active: true, submitting: true, touched: true },
|
|
5337
5338
|
onChange: (values) => {
|
|
5338
5339
|
var _a3;
|
|
@@ -5388,7 +5389,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
5388
5389
|
const windowWidth = windowSize.useWindowWidth();
|
|
5389
5390
|
const renderNavToggle = windowWidth < navBreakpoint + 1;
|
|
5390
5391
|
const headerPadding = renderNavToggle ? "px-20" : "px-6";
|
|
5391
|
-
return /* @__PURE__ */ React__default["default"].createElement(PageWrapper, null, /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, ((
|
|
5392
|
+
return /* @__PURE__ */ React__default["default"].createElement(PageWrapper, null, /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, ((_f = (_e = cms == null ? void 0 : cms.api) == null ? void 0 : _e.tina) == null ? void 0 : _f.isLocalMode) && /* @__PURE__ */ React__default["default"].createElement(toolkit.LocalWarning, null), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5392
5393
|
className: `py-4 border-b border-gray-200 bg-white ${headerPadding}`
|
|
5393
5394
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
5394
5395
|
className: "max-w-form mx-auto"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinacms",
|
|
3
|
-
"version": "0.70.
|
|
3
|
+
"version": "0.70.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "./dist/index.es.js",
|
|
6
6
|
"exports": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@headlessui/react": "^1.5.0",
|
|
56
56
|
"@heroicons/react": "^1.0.4",
|
|
57
57
|
"@react-hook/window-size": "^3.0.7",
|
|
58
|
-
"@tinacms/schema-tools": "0.2.
|
|
58
|
+
"@tinacms/schema-tools": "0.2.1",
|
|
59
59
|
"@tinacms/sharedctx": "0.1.3",
|
|
60
60
|
"@tinacms/toolkit": "0.58.5",
|
|
61
61
|
"crypto-js": "^4.0.0",
|