@firecms/collection_editor 3.0.0-canary.178 → 3.0.0-canary.179

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
@@ -29,7 +29,7 @@
29
29
  return React.useContext(CollectionEditorContext);
30
30
  };
31
31
  function LayoutModeSwitch(t0) {
32
- const $ = reactCompilerRuntime.c(28);
32
+ const $ = reactCompilerRuntime.c(29);
33
33
  const {
34
34
  value,
35
35
  onChange,
@@ -147,26 +147,35 @@
147
147
  t16 = $[24];
148
148
  }
149
149
  let t17;
150
- if ($[25] !== t1 || $[26] !== t16) {
151
- t17 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t1, children: [
150
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
151
+ t17 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", color: "secondary", className: "ml-3.5", children: "Should documents be opened full screen or in an inline side dialog" });
152
+ $[25] = t17;
153
+ } else {
154
+ t17 = $[25];
155
+ }
156
+ let t18;
157
+ if ($[26] !== t1 || $[27] !== t16) {
158
+ t18 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t1, children: [
152
159
  t2,
153
- t16
160
+ t16,
161
+ t17
154
162
  ] });
155
- $[25] = t1;
156
- $[26] = t16;
157
- $[27] = t17;
163
+ $[26] = t1;
164
+ $[27] = t16;
165
+ $[28] = t18;
158
166
  } else {
159
- t17 = $[27];
167
+ t18 = $[28];
160
168
  }
161
- return t17;
169
+ return t18;
162
170
  }
163
171
  function CollectionDetailsForm(t0) {
164
- const $ = reactCompilerRuntime.c(174);
172
+ const $ = reactCompilerRuntime.c(177);
165
173
  const {
166
174
  isNewCollection,
167
175
  reservedGroups,
168
176
  groups,
169
- parentCollection
177
+ parentCollection,
178
+ children
170
179
  } = t0;
171
180
  const groupRef = React.useRef(null);
172
181
  const {
@@ -846,7 +855,7 @@
846
855
  }
847
856
  let t97;
848
857
  if ($[151] !== advancedPanelExpanded || $[152] !== t96) {
849
- t97 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12 mt-8", children: /* @__PURE__ */ jsxRuntime.jsx(ui.ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t41, initiallyExpanded: false, children: t96 }) });
858
+ t97 = /* @__PURE__ */ jsxRuntime.jsx(ui.ExpandablePanel, { expanded: advancedPanelExpanded, onExpandedChange: setAdvancedPanelExpanded, title: t41, initiallyExpanded: false, children: t96 });
850
859
  $[151] = advancedPanelExpanded;
851
860
  $[152] = t96;
852
861
  $[153] = t97;
@@ -854,78 +863,90 @@
854
863
  t97 = $[153];
855
864
  }
856
865
  let t98;
857
- if ($[154] !== t27 || $[155] !== t36 || $[156] !== t37 || $[157] !== t40 || $[158] !== t97) {
858
- t98 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t19, children: [
866
+ if ($[154] !== children || $[155] !== t97) {
867
+ t98 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12 mt-8", children: [
868
+ t97,
869
+ children
870
+ ] });
871
+ $[154] = children;
872
+ $[155] = t97;
873
+ $[156] = t98;
874
+ } else {
875
+ t98 = $[156];
876
+ }
877
+ let t99;
878
+ if ($[157] !== t27 || $[158] !== t36 || $[159] !== t37 || $[160] !== t40 || $[161] !== t98) {
879
+ t99 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t19, children: [
859
880
  t27,
860
881
  t36,
861
882
  t37,
862
883
  t40,
863
- t97
884
+ t98
864
885
  ] });
865
- $[154] = t27;
866
- $[155] = t36;
867
- $[156] = t37;
868
- $[157] = t40;
869
- $[158] = t97;
870
- $[159] = t98;
886
+ $[157] = t27;
887
+ $[158] = t36;
888
+ $[159] = t37;
889
+ $[160] = t40;
890
+ $[161] = t98;
891
+ $[162] = t99;
871
892
  } else {
872
- t98 = $[159];
893
+ t99 = $[162];
873
894
  }
874
- let t99;
875
- if ($[160] === Symbol.for("react.memo_cache_sentinel")) {
876
- t99 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
895
+ let t100;
896
+ if ($[163] === Symbol.for("react.memo_cache_sentinel")) {
897
+ t100 = /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
877
898
  height: "52px"
878
899
  } });
879
- $[160] = t99;
900
+ $[163] = t100;
880
901
  } else {
881
- t99 = $[160];
902
+ t100 = $[163];
882
903
  }
883
- let t100;
884
- if ($[161] !== setFieldValue) {
885
- t100 = (icon) => {
904
+ let t101;
905
+ if ($[164] !== setFieldValue) {
906
+ t101 = (icon) => {
886
907
  setIconDialogOpen(false);
887
908
  setFieldValue("icon", icon);
888
909
  };
889
- $[161] = setFieldValue;
890
- $[162] = t100;
891
- } else {
892
- t100 = $[162];
893
- }
894
- let t101;
895
- if ($[163] !== t100 || $[164] !== values.icon) {
896
- t101 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsxRuntime.jsx(core.SearchIconsView, { selectedIcon: values.icon, onIconSelected: t100 }) });
897
- $[163] = t100;
898
- $[164] = values.icon;
910
+ $[164] = setFieldValue;
899
911
  $[165] = t101;
900
912
  } else {
901
913
  t101 = $[165];
902
914
  }
903
915
  let t102;
904
- if ($[166] !== iconDialogOpen || $[167] !== t101) {
905
- t102 = /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t101 });
906
- $[166] = iconDialogOpen;
907
- $[167] = t101;
916
+ if ($[166] !== t101 || $[167] !== values.icon) {
917
+ t102 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ jsxRuntime.jsx(core.SearchIconsView, { selectedIcon: values.icon, onIconSelected: t101 }) });
918
+ $[166] = t101;
919
+ $[167] = values.icon;
908
920
  $[168] = t102;
909
921
  } else {
910
922
  t102 = $[168];
911
923
  }
912
924
  let t103;
913
- if ($[169] !== T0 || $[170] !== t102 || $[171] !== t18 || $[172] !== t98) {
914
- t103 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: t7, children: /* @__PURE__ */ jsxRuntime.jsxs(T0, { maxWidth: t8, className: t9, children: [
925
+ if ($[169] !== iconDialogOpen || $[170] !== t102) {
926
+ t103 = /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open: iconDialogOpen, onOpenChange: setIconDialogOpen, maxWidth: "xl", fullWidth: true, children: t102 });
927
+ $[169] = iconDialogOpen;
928
+ $[170] = t102;
929
+ $[171] = t103;
930
+ } else {
931
+ t103 = $[171];
932
+ }
933
+ let t104;
934
+ if ($[172] !== T0 || $[173] !== t103 || $[174] !== t18 || $[175] !== t99) {
935
+ t104 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: t7, children: /* @__PURE__ */ jsxRuntime.jsxs(T0, { maxWidth: t8, className: t9, children: [
915
936
  t18,
916
- t98,
917
937
  t99,
918
- t102
938
+ t100,
939
+ t103
919
940
  ] }) });
920
- $[169] = T0;
921
- $[170] = t102;
922
- $[171] = t18;
923
- $[172] = t98;
941
+ $[172] = T0;
924
942
  $[173] = t103;
943
+ $[174] = t18;
944
+ $[175] = t99;
945
+ $[176] = t104;
925
946
  } else {
926
- t103 = $[173];
947
+ t104 = $[176];
927
948
  }
928
- return t103;
949
+ return t104;
929
950
  }
930
951
  function _temp3$4(value_3) {
931
952
  if (value_3 === "code_defined") {
@@ -8463,10 +8484,8 @@
8463
8484
  editable: true
8464
8485
  };
8465
8486
  if (propertyPath_0) {
8466
- if (inferredNewProperty) {
8487
+ {
8467
8488
  setFieldValue(propertyPath_0, inferredNewProperty, false);
8468
- } else {
8469
- setFieldValue(propertyPath_0, property_1, false);
8470
8489
  }
8471
8490
  setFieldTouched(propertyPath_0, true, false);
8472
8491
  }
@@ -9365,82 +9384,109 @@
9365
9384
  setNextMode();
9366
9385
  };
9367
9386
  const editable = collection?.editable === void 0 || collection?.editable === true;
9387
+ const isMergedCollection = collection?.merged ?? false;
9368
9388
  const collectionEditable = editable || isNewCollection;
9369
- return /* @__PURE__ */ jsxRuntime.jsx(ui.DialogContent, { fullHeight: true, children: /* @__PURE__ */ jsxRuntime.jsx(formex.Formex, { value: formController, children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9370
- !isNewCollection && /* @__PURE__ */ jsxRuntime.jsxs(ui.Tabs, { value: currentView, innerClassName: ui.cls(ui.defaultBorderMixin, "px-4 h-14 w-full justify-end bg-surface-50 dark:bg-surface-950 border-b"), onValueChange: (v) => setCurrentView(v), children: [
9371
- /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "details", children: "Details" }),
9372
- /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "properties", children: "Properties" }),
9373
- /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "subcollections", children: "Additional views" })
9374
- ] }),
9375
- /* @__PURE__ */ jsxRuntime.jsxs("form", { noValidate: true, onSubmit: formController.handleSubmit, className: ui.cls(isNewCollection ? "h-full" : "h-[calc(100%-48px)]", "flex-grow flex flex-col relative"), children: [
9376
- currentView === "loading" && /* @__PURE__ */ jsxRuntime.jsx(core.CircularProgressCenter, {}),
9377
- currentView === "extra_view" && path && extraView?.View && /* @__PURE__ */ jsxRuntime.jsx(extraView.View, { path }),
9378
- currentView === "welcome" && /* @__PURE__ */ jsxRuntime.jsx(CollectionEditorWelcomeView, { path, onContinue: (importData, propertiesOrder_0) => {
9379
- if (importData) {
9380
- onImportDataSet(importData, propertiesOrder_0);
9381
- setCurrentView("import_data_mapping");
9382
- } else {
9383
- setCurrentView("details");
9384
- }
9385
- }, existingCollectionPaths: existingPaths, parentCollection, pathSuggestions }),
9386
- currentView === "import_data_mapping" && importConfig && /* @__PURE__ */ jsxRuntime.jsx(CollectionEditorImportMapping, { importConfig, collectionEditable, propertyConfigs }),
9387
- currentView === "import_data_preview" && importConfig && /* @__PURE__ */ jsxRuntime.jsx(CollectionEditorImportDataPreview, { importConfig, properties: values_1.properties, propertiesOrder: values_1.propertiesOrder }),
9388
- currentView === "import_data_saving" && importConfig && /* @__PURE__ */ jsxRuntime.jsx(data_import_export.ImportSaveInProgress, { importConfig, collection: values_1, path, onImportSuccess: async (importedCollection) => {
9389
- snackbarController.open({
9390
- type: "info",
9391
- message: "Data imported successfully"
9392
- });
9393
- await saveCollection(values_1);
9394
- handleClose(importedCollection);
9395
- } }),
9396
- currentView === "details" && /* @__PURE__ */ jsxRuntime.jsx(CollectionDetailsForm, { existingPaths, existingIds, groups, parentCollectionIds, parentCollection, isNewCollection }),
9397
- currentView === "subcollections" && collection && /* @__PURE__ */ jsxRuntime.jsx(SubcollectionsEditTab, { parentCollection, configController, getUser, collectionInference, parentCollectionIds, collection }),
9398
- currentView === "properties" && /* @__PURE__ */ jsxRuntime.jsx(CollectionPropertiesEditorForm, { showErrors: submitCount > 0, isNewCollection, reservedGroups, onPropertyError: (propertyKey, namespace, error_0) => {
9399
- const current = core.removeUndefined({
9400
- ...propertyErrorsRef.current,
9401
- [getFullIdPath(propertyKey, namespace)]: core.removeUndefined(error_0, true)
9402
- }, true);
9403
- propertyErrorsRef.current = current;
9404
- formController.validate();
9405
- }, getUser, getData: getDataWithPath, doCollectionInference, propertyConfigs, collectionEditable, extraIcon: extraView?.icon && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "primary", onClick: () => setCurrentView("extra_view"), children: extraView.icon }) }),
9406
- currentView !== "welcome" && /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogActions, { position: "absolute", children: [
9407
- error && /* @__PURE__ */ jsxRuntime.jsx(core.ErrorView, { error }),
9408
- isNewCollection && includeTemplates && currentView === "import_data_mapping" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => {
9409
- importConfig.setInUse(false);
9410
- return setCurrentView("welcome");
9411
- }, children: [
9412
- /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9413
- "Back"
9414
- ] }),
9415
- isNewCollection && includeTemplates && currentView === "import_data_preview" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => {
9416
- setCurrentView("import_data_mapping");
9417
- }, children: [
9418
- /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9419
- "Back"
9420
- ] }),
9421
- isNewCollection && includeTemplates && currentView === "details" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => setCurrentView("welcome"), children: [
9422
- /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9423
- "Back"
9424
- ] }),
9425
- isNewCollection && currentView === "properties" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => setCurrentView("details"), children: [
9426
- /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9427
- "Back"
9428
- ] }),
9429
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", onClick: () => {
9430
- handleCancel();
9431
- }, children: "Cancel" }),
9432
- isNewCollection && currentView === "import_data_mapping" && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", color: "primary", onClick: onImportMappingComplete, children: "Next" }),
9433
- isNewCollection && currentView === "import_data_preview" && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", color: "primary", onClick: () => {
9434
- setNextMode();
9435
- }, children: "Next" }),
9436
- isNewCollection && (currentView === "details" || currentView === "properties") && /* @__PURE__ */ jsxRuntime.jsxs(ui.LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, disabled: isSubmitting || currentView === "details" && !validValues, startIcon: currentView === "properties" ? /* @__PURE__ */ jsxRuntime.jsx(ui.CheckIcon, {}) : void 0, children: [
9437
- currentView === "details" && "Next",
9438
- currentView === "properties" && "Create collection"
9439
- ] }),
9440
- !isNewCollection && /* @__PURE__ */ jsxRuntime.jsx(ui.LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, children: "Update collection" })
9389
+ const [deleteRequested, setDeleteRequested] = React.useState(false);
9390
+ const deleteCollection = () => {
9391
+ if (!collection) return;
9392
+ configController?.deleteCollection({
9393
+ id: collection.id
9394
+ }).then(() => {
9395
+ setDeleteRequested(false);
9396
+ handleCancel();
9397
+ snackbarController.open({
9398
+ message: "Collection deleted",
9399
+ type: "success"
9400
+ });
9401
+ });
9402
+ };
9403
+ return /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogContent, { fullHeight: true, children: [
9404
+ /* @__PURE__ */ jsxRuntime.jsx(formex.Formex, { value: formController, children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9405
+ !isNewCollection && /* @__PURE__ */ jsxRuntime.jsxs(ui.Tabs, { value: currentView, innerClassName: ui.cls(ui.defaultBorderMixin, "px-4 h-14 w-full justify-end bg-surface-50 dark:bg-surface-950 border-b"), onValueChange: (v) => setCurrentView(v), children: [
9406
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "details", children: "Details" }),
9407
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "properties", children: "Properties" }),
9408
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "subcollections", children: "Additional views" })
9409
+ ] }),
9410
+ /* @__PURE__ */ jsxRuntime.jsxs("form", { noValidate: true, onSubmit: formController.handleSubmit, className: ui.cls(isNewCollection ? "h-full" : "h-[calc(100%-48px)]", "flex-grow flex flex-col relative"), children: [
9411
+ currentView === "loading" && /* @__PURE__ */ jsxRuntime.jsx(core.CircularProgressCenter, {}),
9412
+ currentView === "extra_view" && path && extraView?.View && /* @__PURE__ */ jsxRuntime.jsx(extraView.View, { path }),
9413
+ currentView === "welcome" && /* @__PURE__ */ jsxRuntime.jsx(CollectionEditorWelcomeView, { path, onContinue: (importData, propertiesOrder_0) => {
9414
+ if (importData) {
9415
+ onImportDataSet(importData, propertiesOrder_0);
9416
+ setCurrentView("import_data_mapping");
9417
+ } else {
9418
+ setCurrentView("details");
9419
+ }
9420
+ }, existingCollectionPaths: existingPaths, parentCollection, pathSuggestions }),
9421
+ currentView === "import_data_mapping" && importConfig && /* @__PURE__ */ jsxRuntime.jsx(CollectionEditorImportMapping, { importConfig, collectionEditable, propertyConfigs }),
9422
+ currentView === "import_data_preview" && importConfig && /* @__PURE__ */ jsxRuntime.jsx(CollectionEditorImportDataPreview, { importConfig, properties: values_1.properties, propertiesOrder: values_1.propertiesOrder }),
9423
+ currentView === "import_data_saving" && importConfig && /* @__PURE__ */ jsxRuntime.jsx(data_import_export.ImportSaveInProgress, { importConfig, collection: values_1, path, onImportSuccess: async (importedCollection) => {
9424
+ snackbarController.open({
9425
+ type: "info",
9426
+ message: "Data imported successfully"
9427
+ });
9428
+ await saveCollection(values_1);
9429
+ handleClose(importedCollection);
9430
+ } }),
9431
+ currentView === "details" && /* @__PURE__ */ jsxRuntime.jsx(CollectionDetailsForm, { existingPaths, existingIds, groups, parentCollectionIds, parentCollection, isNewCollection, children: !isNewCollection && isMergedCollection && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 mt-8", children: [
9432
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", color: "secondary", children: "This collection is defined in code. The changes done in this editor will override the properties defined in code. You can delete the overridden values to revert to the state defined in code." }),
9433
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "neutral", onClick: () => {
9434
+ setDeleteRequested(true);
9435
+ }, children: "Reset to code" })
9436
+ ] }) }),
9437
+ currentView === "subcollections" && collection && /* @__PURE__ */ jsxRuntime.jsx(SubcollectionsEditTab, { parentCollection, configController, getUser, collectionInference, parentCollectionIds, collection }),
9438
+ currentView === "properties" && /* @__PURE__ */ jsxRuntime.jsx(CollectionPropertiesEditorForm, { showErrors: submitCount > 0, isNewCollection, reservedGroups, onPropertyError: (propertyKey, namespace, error_0) => {
9439
+ const current = core.removeUndefined({
9440
+ ...propertyErrorsRef.current,
9441
+ [getFullIdPath(propertyKey, namespace)]: core.removeUndefined(error_0, true)
9442
+ }, true);
9443
+ propertyErrorsRef.current = current;
9444
+ formController.validate();
9445
+ }, getUser, getData: getDataWithPath, doCollectionInference, propertyConfigs, collectionEditable, extraIcon: extraView?.icon && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "primary", onClick: () => setCurrentView("extra_view"), children: extraView.icon }) }),
9446
+ currentView !== "welcome" && /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogActions, { position: "absolute", children: [
9447
+ error && /* @__PURE__ */ jsxRuntime.jsx(core.ErrorView, { error }),
9448
+ isNewCollection && includeTemplates && currentView === "import_data_mapping" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => {
9449
+ importConfig.setInUse(false);
9450
+ return setCurrentView("welcome");
9451
+ }, children: [
9452
+ /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9453
+ "Back"
9454
+ ] }),
9455
+ isNewCollection && includeTemplates && currentView === "import_data_preview" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => {
9456
+ setCurrentView("import_data_mapping");
9457
+ }, children: [
9458
+ /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9459
+ "Back"
9460
+ ] }),
9461
+ isNewCollection && includeTemplates && currentView === "details" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => setCurrentView("welcome"), children: [
9462
+ /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9463
+ "Back"
9464
+ ] }),
9465
+ isNewCollection && currentView === "properties" && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "text", type: "button", onClick: () => setCurrentView("details"), children: [
9466
+ /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowBackIcon, {}),
9467
+ "Back"
9468
+ ] }),
9469
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", onClick: () => {
9470
+ handleCancel();
9471
+ }, children: "Cancel" }),
9472
+ isNewCollection && currentView === "import_data_mapping" && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", color: "primary", onClick: onImportMappingComplete, children: "Next" }),
9473
+ isNewCollection && currentView === "import_data_preview" && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", color: "primary", onClick: () => {
9474
+ setNextMode();
9475
+ }, children: "Next" }),
9476
+ isNewCollection && (currentView === "details" || currentView === "properties") && /* @__PURE__ */ jsxRuntime.jsxs(ui.LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, disabled: isSubmitting || currentView === "details" && !validValues, startIcon: currentView === "properties" ? /* @__PURE__ */ jsxRuntime.jsx(ui.CheckIcon, {}) : void 0, children: [
9477
+ currentView === "details" && "Next",
9478
+ currentView === "properties" && "Create collection"
9479
+ ] }),
9480
+ !isNewCollection && /* @__PURE__ */ jsxRuntime.jsx(ui.LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, children: "Update collection" })
9481
+ ] })
9441
9482
  ] })
9442
- ] })
9443
- ] }) }) });
9483
+ ] }) }),
9484
+ /* @__PURE__ */ jsxRuntime.jsx(core.ConfirmationDialog, { open: deleteRequested, onAccept: deleteCollection, onCancel: () => setDeleteRequested(false), title: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: "Delete the stored config?" }), body: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9485
+ " This will ",
9486
+ /* @__PURE__ */ jsxRuntime.jsx("b", { children: "not delete any data" }),
9487
+ ", only the stored config, and reset to the code state."
9488
+ ] }) })
9489
+ ] });
9444
9490
  }
9445
9491
  function applyPropertyConfigs(collection, propertyConfigs) {
9446
9492
  const {
@@ -10617,18 +10663,19 @@
10617
10663
  }
10618
10664
  return t6;
10619
10665
  }
10620
- const mergeCollections = (baseCollections, backendCollections, modifyCollection) => {
10666
+ const mergeCollections = (baseCollections, backendCollections = [], modifyCollection) => {
10621
10667
  const markAsEditable = (c) => {
10622
10668
  core.makePropertiesEditable(c.properties);
10623
10669
  c.subcollections?.forEach(markAsEditable);
10624
10670
  };
10625
- const storedCollections = backendCollections ?? [];
10626
- storedCollections.forEach(markAsEditable);
10627
- console.debug("Collections specified in code:", baseCollections);
10628
- console.debug("Collections stored in the backend", storedCollections);
10629
- const result = core.joinCollectionLists(baseCollections, storedCollections, [], modifyCollection);
10671
+ backendCollections.forEach(markAsEditable);
10672
+ const result = core.joinCollectionLists(baseCollections, backendCollections, [], modifyCollection);
10630
10673
  result.sort((a, b) => baseCollections.findIndex((c) => c.id === a.id) - baseCollections.findIndex((c) => c.id === b.id));
10631
- console.debug("Collections after joining:", result);
10674
+ console.debug("Collections result", {
10675
+ baseCollections,
10676
+ backendCollections,
10677
+ result
10678
+ });
10632
10679
  return result;
10633
10680
  };
10634
10681
  function MissingReferenceWidget(t0) {