tinacms 2.5.0 → 2.5.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/dist/client.js +4 -7
- package/dist/client.mjs +2 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +40 -6
- package/dist/index.mjs +40 -6
- package/package.json +4 -5
package/dist/client.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports
|
|
3
|
-
})(this, function(exports2
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tinacms = {}));
|
|
3
|
+
})(this, function(exports2) {
|
|
4
4
|
"use strict";
|
|
5
|
-
const { fetch: fetchPonyfillFN, Headers: HeadersPonyfill } = fetchPonyfill();
|
|
6
|
-
const fetchDefined = typeof fetch === "undefined" ? fetchPonyfillFN : fetch;
|
|
7
|
-
const HeadersDefined = typeof Headers === "undefined" ? HeadersPonyfill : Headers;
|
|
8
5
|
const TINA_HOST = "content.tinajs.io";
|
|
9
6
|
class TinaClient {
|
|
10
7
|
constructor({
|
|
@@ -39,7 +36,7 @@
|
|
|
39
36
|
var _a;
|
|
40
37
|
await this.init();
|
|
41
38
|
const errorPolicyDefined = errorPolicy || this.errorPolicy;
|
|
42
|
-
const headers = new
|
|
39
|
+
const headers = new Headers();
|
|
43
40
|
if (this.readonlyToken) {
|
|
44
41
|
headers.append("X-API-KEY", this.readonlyToken);
|
|
45
42
|
}
|
|
@@ -72,7 +69,7 @@
|
|
|
72
69
|
return value;
|
|
73
70
|
}
|
|
74
71
|
}
|
|
75
|
-
const res = await
|
|
72
|
+
const res = await fetch(url, optionsObject);
|
|
76
73
|
if (!res.ok) {
|
|
77
74
|
let additionalInfo = "";
|
|
78
75
|
if (res.status === 401) {
|
package/dist/client.mjs
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import fetchPonyfill from "fetch-ponyfill";
|
|
2
|
-
const { fetch: fetchPonyfillFN, Headers: HeadersPonyfill } = fetchPonyfill();
|
|
3
|
-
const fetchDefined = typeof fetch === "undefined" ? fetchPonyfillFN : fetch;
|
|
4
|
-
const HeadersDefined = typeof Headers === "undefined" ? HeadersPonyfill : Headers;
|
|
5
1
|
const TINA_HOST = "content.tinajs.io";
|
|
6
2
|
class TinaClient {
|
|
7
3
|
constructor({
|
|
@@ -36,7 +32,7 @@ class TinaClient {
|
|
|
36
32
|
var _a;
|
|
37
33
|
await this.init();
|
|
38
34
|
const errorPolicyDefined = errorPolicy || this.errorPolicy;
|
|
39
|
-
const headers = new
|
|
35
|
+
const headers = new Headers();
|
|
40
36
|
if (this.readonlyToken) {
|
|
41
37
|
headers.append("X-API-KEY", this.readonlyToken);
|
|
42
38
|
}
|
|
@@ -69,7 +65,7 @@ class TinaClient {
|
|
|
69
65
|
return value;
|
|
70
66
|
}
|
|
71
67
|
}
|
|
72
|
-
const res = await
|
|
68
|
+
const res = await fetch(url, optionsObject);
|
|
73
69
|
if (!res.ok) {
|
|
74
70
|
let additionalInfo = "";
|
|
75
71
|
if (res.status === 401) {
|
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export type TinaCollection = Collection;
|
|
|
53
53
|
export type TinaCloudSchema = Schema;
|
|
54
54
|
export declare const defineSchema: (config: Schema) => Schema<false>;
|
|
55
55
|
export declare const defineLegacyConfig: (config: Omit<TinaCMSProviderDefaultProps, "children">) => Omit<TinaCMSProviderDefaultProps, "children">;
|
|
56
|
-
interface MediaStoreClass {
|
|
56
|
+
export interface MediaStoreClass {
|
|
57
57
|
new (...args: any[]): MediaStore;
|
|
58
58
|
}
|
|
59
59
|
export declare const defineStaticConfig: (config: Config<(cms: TinaCMS) => TinaCMS, formifyCallback, DocumentCreatorCallback, MediaStoreClass>) => Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, MediaStoreClass, undefined>;
|
package/dist/index.js
CHANGED
|
@@ -862,13 +862,23 @@ var __publicField = (obj, key, value) => {
|
|
|
862
862
|
className,
|
|
863
863
|
...props
|
|
864
864
|
}) => {
|
|
865
|
+
if (typeof children === "string") {
|
|
866
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
867
|
+
"span",
|
|
868
|
+
{
|
|
869
|
+
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0 ${className}`,
|
|
870
|
+
...props,
|
|
871
|
+
dangerouslySetInnerHTML: { __html: children }
|
|
872
|
+
}
|
|
873
|
+
);
|
|
874
|
+
}
|
|
865
875
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
866
876
|
"span",
|
|
867
877
|
{
|
|
868
878
|
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0 ${className}`,
|
|
869
|
-
...props
|
|
870
|
-
|
|
871
|
-
|
|
879
|
+
...props
|
|
880
|
+
},
|
|
881
|
+
children
|
|
872
882
|
);
|
|
873
883
|
};
|
|
874
884
|
const FieldError = ({
|
|
@@ -4925,7 +4935,28 @@ flowchart TD
|
|
|
4925
4935
|
onChange,
|
|
4926
4936
|
value,
|
|
4927
4937
|
step
|
|
4928
|
-
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
4938
|
+
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
4939
|
+
Input,
|
|
4940
|
+
{
|
|
4941
|
+
type: "number",
|
|
4942
|
+
step,
|
|
4943
|
+
value,
|
|
4944
|
+
onChange: (event) => {
|
|
4945
|
+
const inputValue = event.target.value;
|
|
4946
|
+
const newValue = inputValue === "" ? void 0 : inputValue;
|
|
4947
|
+
if (onChange) {
|
|
4948
|
+
const syntheticEvent = {
|
|
4949
|
+
...event,
|
|
4950
|
+
target: {
|
|
4951
|
+
...event.target,
|
|
4952
|
+
value: newValue
|
|
4953
|
+
}
|
|
4954
|
+
};
|
|
4955
|
+
onChange(syntheticEvent);
|
|
4956
|
+
}
|
|
4957
|
+
}
|
|
4958
|
+
}
|
|
4959
|
+
);
|
|
4929
4960
|
function useCMS() {
|
|
4930
4961
|
return useCMS$1();
|
|
4931
4962
|
}
|
|
@@ -8002,7 +8033,10 @@ flowchart TD
|
|
|
8002
8033
|
ReactDateTimeWithStyles,
|
|
8003
8034
|
{
|
|
8004
8035
|
value: input.value,
|
|
8005
|
-
onChange:
|
|
8036
|
+
onChange: (value) => {
|
|
8037
|
+
const newValue = value === "" ? void 0 : value;
|
|
8038
|
+
input.onChange(newValue);
|
|
8039
|
+
},
|
|
8006
8040
|
dateFormat: dateFormat || DEFAULT_DATE_DISPLAY_FORMAT,
|
|
8007
8041
|
timeFormat: timeFormat || false,
|
|
8008
8042
|
inputProps: { className: textFieldClasses },
|
|
@@ -10333,7 +10367,7 @@ flowchart TD
|
|
|
10333
10367
|
"Event Log"
|
|
10334
10368
|
));
|
|
10335
10369
|
};
|
|
10336
|
-
const version = "2.5.
|
|
10370
|
+
const version = "2.5.2";
|
|
10337
10371
|
const Nav = ({
|
|
10338
10372
|
isLocalMode,
|
|
10339
10373
|
className = "",
|
package/dist/index.mjs
CHANGED
|
@@ -889,13 +889,23 @@ const FieldDescription = ({
|
|
|
889
889
|
className,
|
|
890
890
|
...props
|
|
891
891
|
}) => {
|
|
892
|
+
if (typeof children === "string") {
|
|
893
|
+
return /* @__PURE__ */ React.createElement(
|
|
894
|
+
"span",
|
|
895
|
+
{
|
|
896
|
+
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0 ${className}`,
|
|
897
|
+
...props,
|
|
898
|
+
dangerouslySetInnerHTML: { __html: children }
|
|
899
|
+
}
|
|
900
|
+
);
|
|
901
|
+
}
|
|
892
902
|
return /* @__PURE__ */ React.createElement(
|
|
893
903
|
"span",
|
|
894
904
|
{
|
|
895
905
|
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0 ${className}`,
|
|
896
|
-
...props
|
|
897
|
-
|
|
898
|
-
|
|
906
|
+
...props
|
|
907
|
+
},
|
|
908
|
+
children
|
|
899
909
|
);
|
|
900
910
|
};
|
|
901
911
|
const FieldError = ({
|
|
@@ -4952,7 +4962,28 @@ const NumberInput = ({
|
|
|
4952
4962
|
onChange,
|
|
4953
4963
|
value,
|
|
4954
4964
|
step
|
|
4955
|
-
}) => /* @__PURE__ */ React.createElement(
|
|
4965
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
4966
|
+
Input,
|
|
4967
|
+
{
|
|
4968
|
+
type: "number",
|
|
4969
|
+
step,
|
|
4970
|
+
value,
|
|
4971
|
+
onChange: (event) => {
|
|
4972
|
+
const inputValue = event.target.value;
|
|
4973
|
+
const newValue = inputValue === "" ? void 0 : inputValue;
|
|
4974
|
+
if (onChange) {
|
|
4975
|
+
const syntheticEvent = {
|
|
4976
|
+
...event,
|
|
4977
|
+
target: {
|
|
4978
|
+
...event.target,
|
|
4979
|
+
value: newValue
|
|
4980
|
+
}
|
|
4981
|
+
};
|
|
4982
|
+
onChange(syntheticEvent);
|
|
4983
|
+
}
|
|
4984
|
+
}
|
|
4985
|
+
}
|
|
4986
|
+
);
|
|
4956
4987
|
function useCMS() {
|
|
4957
4988
|
return useCMS$1();
|
|
4958
4989
|
}
|
|
@@ -8029,7 +8060,10 @@ const DateField = wrapFieldsWithMeta(
|
|
|
8029
8060
|
ReactDateTimeWithStyles,
|
|
8030
8061
|
{
|
|
8031
8062
|
value: input.value,
|
|
8032
|
-
onChange:
|
|
8063
|
+
onChange: (value) => {
|
|
8064
|
+
const newValue = value === "" ? void 0 : value;
|
|
8065
|
+
input.onChange(newValue);
|
|
8066
|
+
},
|
|
8033
8067
|
dateFormat: dateFormat || DEFAULT_DATE_DISPLAY_FORMAT,
|
|
8034
8068
|
timeFormat: timeFormat || false,
|
|
8035
8069
|
inputProps: { className: textFieldClasses },
|
|
@@ -10360,7 +10394,7 @@ const SyncStatus = ({ cms, setEventsOpen }) => {
|
|
|
10360
10394
|
"Event Log"
|
|
10361
10395
|
));
|
|
10362
10396
|
};
|
|
10363
|
-
const version = "2.5.
|
|
10397
|
+
const version = "2.5.2";
|
|
10364
10398
|
const Nav = ({
|
|
10365
10399
|
isLocalMode,
|
|
10366
10400
|
className = "",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinacms",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -98,7 +98,6 @@
|
|
|
98
98
|
"color-string": "^1.9.1",
|
|
99
99
|
"crypto-js": "^4.2.0",
|
|
100
100
|
"date-fns": "2.30.0",
|
|
101
|
-
"fetch-ponyfill": "^7.1.0",
|
|
102
101
|
"final-form": "4.20.10",
|
|
103
102
|
"final-form-arrays": "^3.1.0",
|
|
104
103
|
"final-form-set-field-data": "^1.0.2",
|
|
@@ -129,9 +128,9 @@
|
|
|
129
128
|
"webfontloader": "1.6.28",
|
|
130
129
|
"yup": "^1.4.0",
|
|
131
130
|
"zod": "^3.23.8",
|
|
132
|
-
"@tinacms/mdx": "1.5.
|
|
133
|
-
"@tinacms/search": "1.0.
|
|
134
|
-
"@tinacms/schema-tools": "1.6.
|
|
131
|
+
"@tinacms/mdx": "1.5.3",
|
|
132
|
+
"@tinacms/search": "1.0.36",
|
|
133
|
+
"@tinacms/schema-tools": "1.6.9"
|
|
135
134
|
},
|
|
136
135
|
"devDependencies": {
|
|
137
136
|
"@graphql-tools/utils": "^10.5.6",
|