@firecms/core 3.0.0-canary.172 → 3.0.0-canary.173

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.umd.js CHANGED
@@ -13720,7 +13720,7 @@
13720
13720
  }, [hasValue, internalIds.length, value]);
13721
13721
  const insertInEnd = (e) => {
13722
13722
  e.preventDefault();
13723
- if (disabled || value.length >= max) return;
13723
+ if (disabled || (value ?? []).length >= max) return;
13724
13724
  const id = getRandomId$1();
13725
13725
  const newIds = [...internalIds, id];
13726
13726
  if (onInternalIdAdded) onInternalIdAdded(id);
@@ -13728,14 +13728,14 @@
13728
13728
  onValueChange([...value ?? [], newDefaultEntry]);
13729
13729
  };
13730
13730
  const remove = (index_0) => {
13731
- if (value.length <= min) return;
13731
+ if ((value ?? []).length <= min) return;
13732
13732
  const newIds_0 = [...internalIds];
13733
13733
  newIds_0.splice(index_0, 1);
13734
13734
  setInternalIds(newIds_0);
13735
13735
  onValueChange(value.filter((_, i) => i !== index_0));
13736
13736
  };
13737
13737
  const copy = (index_1) => {
13738
- if (value.length >= max) return;
13738
+ if ((value ?? []).length >= max) return;
13739
13739
  const id_0 = getRandomId$1();
13740
13740
  const copyingItem = value[index_1];
13741
13741
  const newIds_1 = [...internalIds.slice(0, index_1 + 1), id_0, ...internalIds.slice(index_1 + 1)];
@@ -13744,7 +13744,7 @@
13744
13744
  onValueChange([...value.slice(0, index_1 + 1), copyingItem, ...value.slice(index_1 + 1)]);
13745
13745
  };
13746
13746
  const addInIndex = (index_2) => {
13747
- if (value.length >= max) return;
13747
+ if ((value ?? []).length >= max) return;
13748
13748
  const id_1 = getRandomId$1();
13749
13749
  const newIds_2 = [...internalIds.slice(0, index_2), id_1, ...internalIds.slice(index_2)];
13750
13750
  if (onInternalIdAdded) onInternalIdAdded(id_1);
@@ -23035,10 +23035,8 @@
23035
23035
  const collectionPath = navigation.resolveIdsFrom(isNew ? lastCollectionEntry.path : lastEntityEntry.path);
23036
23036
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
23037
23037
  /* @__PURE__ */ jsxRuntime.jsx(EntityEditView, { entityId: isNew ? void 0 : entityId, collection, layout: "full_screen", path: collectionPath, selectedTab: selectedTab ?? void 0, onValuesModified: (modified) => blocked.current = modified, onSaved: (params) => {
23038
- console.log("EntityEditView Saved", params);
23039
23038
  updateUrl(params.entityId, params.selectedTab, true, params.path, isNew);
23040
23039
  }, onTabChange: (params_0) => {
23041
- console.log("EntityEditView onTabChange", params_0);
23042
23040
  updateUrl(params_0.entityId, params_0.selectedTab, !isNew, params_0.path, isNew);
23043
23041
  setSelectedTab(params_0.selectedTab);
23044
23042
  }, parentCollectionIds }, collection.id + "_" + (isNew ? "new" : entityId)),