tinacms 1.5.29 → 1.6.0
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/index.js +8 -6
- package/dist/index.mjs +8 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2107,13 +2107,15 @@ var __publicField = (obj, key, value) => {
|
|
|
2107
2107
|
})
|
|
2108
2108
|
};
|
|
2109
2109
|
} else {
|
|
2110
|
-
const childrenIndex =
|
|
2110
|
+
const childrenIndex = namePath.findIndex(
|
|
2111
|
+
(value2) => value2 === "children"
|
|
2112
|
+
);
|
|
2111
2113
|
const propsIndex = namePath.slice(childrenIndex).findIndex((value2) => value2 === "props") + childrenIndex;
|
|
2112
2114
|
const itemName = namePath.slice(childrenIndex, propsIndex).join(".");
|
|
2113
2115
|
const item = finalForm.getIn(value, itemName);
|
|
2114
2116
|
const props = item.props;
|
|
2115
2117
|
const templateString = item.name;
|
|
2116
|
-
const currentPathIndex = namePathIndex + 3;
|
|
2118
|
+
const currentPathIndex = namePathIndex + Math.max(propsIndex, 3);
|
|
2117
2119
|
const isLastItem2 = currentPathIndex + 1 === namePath.length;
|
|
2118
2120
|
const template = field.templates.find(
|
|
2119
2121
|
(t) => t.name === templateString
|
|
@@ -2148,7 +2150,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2148
2150
|
};
|
|
2149
2151
|
}
|
|
2150
2152
|
if (!isLastItem2) {
|
|
2151
|
-
if (currentPathIndex === namePath.length) {
|
|
2153
|
+
if (currentPathIndex === namePath.length || propsIndex === 0) {
|
|
2152
2154
|
return {
|
|
2153
2155
|
...formOrObjectField,
|
|
2154
2156
|
name: namePath.slice(0, namePathIndex).join("."),
|
|
@@ -2167,7 +2169,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2167
2169
|
formOrObjectField: template,
|
|
2168
2170
|
values: props,
|
|
2169
2171
|
namePath,
|
|
2170
|
-
namePathIndex: namePathIndex + 4
|
|
2172
|
+
namePathIndex: namePathIndex + Math.max(4, childrenIndex + propsIndex)
|
|
2171
2173
|
});
|
|
2172
2174
|
}
|
|
2173
2175
|
if (!template) {
|
|
@@ -8652,10 +8654,10 @@ var __publicField = (obj, key, value) => {
|
|
|
8652
8654
|
const [syncStatus, setSyncStatus] = React.useState({ state: "loading", message: "Loading..." });
|
|
8653
8655
|
React__namespace.useEffect(() => {
|
|
8654
8656
|
const interval = setInterval(async () => {
|
|
8655
|
-
var _a2, _b2, _c, _d;
|
|
8657
|
+
var _a2, _b2, _c, _d, _e;
|
|
8656
8658
|
let doFetchEvents = false;
|
|
8657
8659
|
if (!((_b2 = (_a2 = cms.api) == null ? void 0 : _a2.tina) == null ? void 0 : _b2.isCustomContentApi)) {
|
|
8658
|
-
doFetchEvents = await ((_d = (_c = cms.api) == null ? void 0 : _c.tina) == null ? void 0 : _d.isAuthenticated());
|
|
8660
|
+
doFetchEvents = await ((_e = (_d = (_c = cms.api) == null ? void 0 : _c.tina) == null ? void 0 : _d.authProvider) == null ? void 0 : _e.isAuthenticated());
|
|
8659
8661
|
}
|
|
8660
8662
|
if (doFetchEvents) {
|
|
8661
8663
|
const { events } = await cms.api.tina.fetchEvents();
|
package/dist/index.mjs
CHANGED
|
@@ -2115,13 +2115,15 @@ class Form {
|
|
|
2115
2115
|
})
|
|
2116
2116
|
};
|
|
2117
2117
|
} else {
|
|
2118
|
-
const childrenIndex =
|
|
2118
|
+
const childrenIndex = namePath.findIndex(
|
|
2119
|
+
(value2) => value2 === "children"
|
|
2120
|
+
);
|
|
2119
2121
|
const propsIndex = namePath.slice(childrenIndex).findIndex((value2) => value2 === "props") + childrenIndex;
|
|
2120
2122
|
const itemName = namePath.slice(childrenIndex, propsIndex).join(".");
|
|
2121
2123
|
const item = getIn(value, itemName);
|
|
2122
2124
|
const props = item.props;
|
|
2123
2125
|
const templateString = item.name;
|
|
2124
|
-
const currentPathIndex = namePathIndex + 3;
|
|
2126
|
+
const currentPathIndex = namePathIndex + Math.max(propsIndex, 3);
|
|
2125
2127
|
const isLastItem2 = currentPathIndex + 1 === namePath.length;
|
|
2126
2128
|
const template = field.templates.find(
|
|
2127
2129
|
(t) => t.name === templateString
|
|
@@ -2156,7 +2158,7 @@ class Form {
|
|
|
2156
2158
|
};
|
|
2157
2159
|
}
|
|
2158
2160
|
if (!isLastItem2) {
|
|
2159
|
-
if (currentPathIndex === namePath.length) {
|
|
2161
|
+
if (currentPathIndex === namePath.length || propsIndex === 0) {
|
|
2160
2162
|
return {
|
|
2161
2163
|
...formOrObjectField,
|
|
2162
2164
|
name: namePath.slice(0, namePathIndex).join("."),
|
|
@@ -2175,7 +2177,7 @@ class Form {
|
|
|
2175
2177
|
formOrObjectField: template,
|
|
2176
2178
|
values: props,
|
|
2177
2179
|
namePath,
|
|
2178
|
-
namePathIndex: namePathIndex + 4
|
|
2180
|
+
namePathIndex: namePathIndex + Math.max(4, childrenIndex + propsIndex)
|
|
2179
2181
|
});
|
|
2180
2182
|
}
|
|
2181
2183
|
if (!template) {
|
|
@@ -8660,10 +8662,10 @@ function useSyncStatus$1(cms) {
|
|
|
8660
8662
|
const [syncStatus, setSyncStatus] = useState({ state: "loading", message: "Loading..." });
|
|
8661
8663
|
React.useEffect(() => {
|
|
8662
8664
|
const interval = setInterval(async () => {
|
|
8663
|
-
var _a2, _b2, _c, _d;
|
|
8665
|
+
var _a2, _b2, _c, _d, _e;
|
|
8664
8666
|
let doFetchEvents = false;
|
|
8665
8667
|
if (!((_b2 = (_a2 = cms.api) == null ? void 0 : _a2.tina) == null ? void 0 : _b2.isCustomContentApi)) {
|
|
8666
|
-
doFetchEvents = await ((_d = (_c = cms.api) == null ? void 0 : _c.tina) == null ? void 0 : _d.isAuthenticated());
|
|
8668
|
+
doFetchEvents = await ((_e = (_d = (_c = cms.api) == null ? void 0 : _c.tina) == null ? void 0 : _d.authProvider) == null ? void 0 : _e.isAuthenticated());
|
|
8667
8669
|
}
|
|
8668
8670
|
if (doFetchEvents) {
|
|
8669
8671
|
const { events } = await cms.api.tina.fetchEvents();
|