tinacms 1.5.30 → 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 CHANGED
@@ -2107,13 +2107,15 @@ var __publicField = (obj, key, value) => {
2107
2107
  })
2108
2108
  };
2109
2109
  } else {
2110
- const childrenIndex = namePathIndex + 1;
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) {
package/dist/index.mjs CHANGED
@@ -2115,13 +2115,15 @@ class Form {
2115
2115
  })
2116
2116
  };
2117
2117
  } else {
2118
- const childrenIndex = namePathIndex + 1;
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinacms",
3
- "version": "1.5.30",
3
+ "version": "1.6.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "exports": {