@rebasepro/admin 0.12.1-canary.gdfba2a1 → 0.12.1-canary.ge191fb7

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.
Files changed (173) hide show
  1. package/README.md +1 -1
  2. package/dist/{CollectionEditorDialog-B8j6HArJ.js → CollectionEditorDialog-Dhn0S4FT.js} +59 -54
  3. package/dist/{CollectionEditorDialog-B8j6HArJ.js.map → CollectionEditorDialog-Dhn0S4FT.js.map} +1 -1
  4. package/dist/{PropertyEditView-D2b9_nbC.js → PropertyEditView-JPN12E-0.js} +26 -9
  5. package/dist/{PropertyEditView-D2b9_nbC.js.map → PropertyEditView-JPN12E-0.js.map} +1 -1
  6. package/dist/{RouterCollectionsStudioView-CXUtYIc1.js → RouterCollectionsStudioView-Cv0tAxtu.js} +5 -5
  7. package/dist/{RouterCollectionsStudioView-CXUtYIc1.js.map → RouterCollectionsStudioView-Cv0tAxtu.js.map} +1 -1
  8. package/dist/collection_editor/serializable_types.d.ts +4 -1
  9. package/dist/collection_editor/ui/collection_editor/CollectionRelationsTab.d.ts +1 -0
  10. package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +8 -0
  11. package/dist/collection_editor_ui.js +5 -5
  12. package/dist/collection_editor_ui.js.map +1 -1
  13. package/dist/components/CollectionTableBinding/column_utils.d.ts +17 -0
  14. package/dist/components/CollectionViewBinding/CollectionViewStartActions.d.ts +7 -2
  15. package/dist/components/CollectionViewBinding/SortButton.d.ts +24 -0
  16. package/dist/components/CollectionViewBinding/SplitListCloseButton.d.ts +10 -0
  17. package/dist/components/CollectionViewBinding/SplitViewContext.d.ts +23 -0
  18. package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.d.ts +26 -0
  19. package/dist/components/DetailViewBinding.d.ts +5 -0
  20. package/dist/components/EditFormActions.d.ts +12 -1
  21. package/dist/components/EditViewBinding.d.ts +6 -1
  22. package/dist/components/EntityIdentityBar.d.ts +53 -0
  23. package/dist/components/EntityInspector.d.ts +29 -0
  24. package/dist/components/EntityPreviewNesting.d.ts +25 -0
  25. package/dist/components/EntityViewBinding.d.ts +9 -0
  26. package/dist/components/InlineEntityPreview.d.ts +47 -0
  27. package/dist/components/index.d.ts +2 -0
  28. package/dist/{export-CrDJOGKn.js → export-DghFk-W0.js} +2 -2
  29. package/dist/{export-CrDJOGKn.js.map → export-DghFk-W0.js.map} +1 -1
  30. package/dist/form/EntityForm.d.ts +1 -1
  31. package/dist/form/EntityFormActions.d.ts +11 -1
  32. package/dist/form/PropertyFieldBinding.d.ts +1 -1
  33. package/dist/form/components/FieldBlock.d.ts +30 -0
  34. package/dist/form/components/FormRail.d.ts +18 -0
  35. package/dist/form/components/FormSections.d.ts +16 -0
  36. package/dist/form/components/index.d.ts +3 -2
  37. package/dist/form/components/useRailVisible.d.ts +24 -0
  38. package/dist/form/field_bindings/BinaryFieldBinding.d.ts +1 -1
  39. package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +1 -1
  40. package/dist/form/field_bindings/GeopointFieldBinding.d.ts +1 -1
  41. package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +1 -1
  42. package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +1 -1
  43. package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +1 -1
  44. package/dist/form/field_bindings/SelectFieldBinding.d.ts +1 -1
  45. package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +1 -1
  46. package/dist/form/field_bindings/SwitchFieldBinding.d.ts +1 -1
  47. package/dist/form/field_bindings/TextFieldBinding.d.ts +1 -1
  48. package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +1 -1
  49. package/dist/form/field_bindings/VectorFieldBinding.d.ts +1 -1
  50. package/dist/{history-s6Nzt7RF.js → history-c-iE7d4k.js} +32 -31
  51. package/dist/history-c-iE7d4k.js.map +1 -0
  52. package/dist/hooks/navigation/utils.d.ts +16 -0
  53. package/dist/hooks/useBuildSidePanel.d.ts +14 -0
  54. package/dist/hooks/useEntityDisplayTitle.d.ts +18 -0
  55. package/dist/hooks/useRecordActions.d.ts +17 -0
  56. package/dist/{import-Ci32nU0G.js → import-DLY5UYDa.js} +2 -2
  57. package/dist/{import-Ci32nU0G.js.map → import-DLY5UYDa.js.map} +1 -1
  58. package/dist/index.js +95 -29
  59. package/dist/index.js.map +1 -1
  60. package/dist/preview/components/InlineEntityListPreview.d.ts +15 -0
  61. package/dist/preview/index.d.ts +1 -0
  62. package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +1 -1
  63. package/dist/preview/property_previews/ArrayOfRelationsPreview.d.ts +1 -1
  64. package/dist/types/components/EntityFormActionsProps.d.ts +0 -1
  65. package/dist/types/components/EntityFormProps.d.ts +0 -5
  66. package/dist/types/fields.d.ts +24 -0
  67. package/dist/{util-BwZuV81o.js → util-BnRLzp4j.js} +2013 -1072
  68. package/dist/util-BnRLzp4j.js.map +1 -0
  69. package/package.json +18 -20
  70. package/src/collection_editor/ConfigControllerProvider.tsx +1 -1
  71. package/src/collection_editor/serializable_types.ts +4 -3
  72. package/src/collection_editor/serializable_utils.ts +51 -17
  73. package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +65 -22
  74. package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +38 -30
  75. package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +3 -1
  76. package/src/collection_editor/ui/collection_editor/RouterCollectionStudioView.tsx +1 -1
  77. package/src/collection_editor/ui/collection_editor/RouterCollectionsStudioView.tsx +1 -1
  78. package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +16 -0
  79. package/src/collection_editor/useLocalCollectionsConfigController.tsx +127 -15
  80. package/src/collection_editor/validateCollectionJson.ts +3 -3
  81. package/src/components/AdminModeSyncer.tsx +1 -1
  82. package/src/components/CollectionTableBinding/PropertyTableCell.tsx +10 -2
  83. package/src/components/CollectionTableBinding/column_utils.tsx +59 -2
  84. package/src/components/CollectionTableBinding/table_bindings.tsx +2 -1
  85. package/src/components/CollectionViewBinding/CollectionBoardViewBinding.tsx +23 -16
  86. package/src/components/CollectionViewBinding/CollectionViewActions.tsx +7 -1
  87. package/src/components/CollectionViewBinding/CollectionViewBinding.tsx +9 -2
  88. package/src/components/CollectionViewBinding/CollectionViewStartActions.tsx +47 -12
  89. package/src/components/CollectionViewBinding/SortButton.tsx +189 -0
  90. package/src/components/CollectionViewBinding/SplitListCloseButton.tsx +33 -0
  91. package/src/components/CollectionViewBinding/SplitListView.tsx +18 -3
  92. package/src/components/CollectionViewBinding/SplitViewContext.tsx +34 -0
  93. package/src/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.ts +48 -9
  94. package/src/components/CollectionViewBinding/useBoardDataController.tsx +80 -25
  95. package/src/components/CollectionViewBinding/usePreviewSlots.ts +18 -6
  96. package/src/components/DefaultAppBar.tsx +1 -1
  97. package/src/components/DefaultDrawer.tsx +1 -1
  98. package/src/components/DetailViewBinding.tsx +100 -143
  99. package/src/components/DrawerNavigationItem.tsx +1 -1
  100. package/src/components/EditFormActions.tsx +54 -129
  101. package/src/components/EditViewBinding.tsx +182 -93
  102. package/src/components/EntityIdentityBar.tsx +288 -0
  103. package/src/components/EntityInspector.tsx +132 -0
  104. package/src/components/EntityPreviewBinding.tsx +6 -2
  105. package/src/components/EntityPreviewNesting.tsx +50 -0
  106. package/src/components/EntityViewBinding.tsx +35 -32
  107. package/src/components/HomePage/FavouritesView.tsx +1 -1
  108. package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
  109. package/src/components/HomePage/SmallNavigationCard.tsx +1 -1
  110. package/src/components/InlineEntityPreview.tsx +149 -0
  111. package/src/components/RebaseLayout.tsx +1 -1
  112. package/src/components/RebaseNavigation.tsx +45 -5
  113. package/src/components/RebaseRouteDefs.tsx +1 -1
  114. package/src/components/SelectableTable/SelectableTable.tsx +2 -2
  115. package/src/components/SidePanelBinding.tsx +19 -13
  116. package/src/components/UserSelector.tsx +12 -6
  117. package/src/components/common/default_entity_actions.tsx +4 -3
  118. package/src/components/history/EntityHistoryEntry.tsx +28 -7
  119. package/src/components/history/EntityHistoryView.tsx +20 -20
  120. package/src/components/history/LastEditedByIndicator.tsx +4 -3
  121. package/src/components/index.ts +2 -0
  122. package/src/data_import/utils/get_import_inference_type.ts +6 -0
  123. package/src/form/EntityForm.tsx +267 -179
  124. package/src/form/EntityFormActions.tsx +50 -99
  125. package/src/form/EntityFormBinding.tsx +4 -2
  126. package/src/form/PropertyFieldBinding.tsx +4 -0
  127. package/src/form/components/FieldBlock.tsx +119 -0
  128. package/src/form/components/FormRail.tsx +125 -0
  129. package/src/form/components/FormSections.tsx +118 -0
  130. package/src/form/components/index.tsx +3 -2
  131. package/src/form/components/useRailVisible.tsx +46 -0
  132. package/src/form/field_bindings/BinaryFieldBinding.tsx +3 -2
  133. package/src/form/field_bindings/DateTimeFieldBinding.tsx +3 -2
  134. package/src/form/field_bindings/GeopointFieldBinding.tsx +3 -2
  135. package/src/form/field_bindings/MapFieldBinding.tsx +1 -2
  136. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +3 -2
  137. package/src/form/field_bindings/MultiSelectFieldBinding.tsx +2 -1
  138. package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +2 -1
  139. package/src/form/field_bindings/ReferenceFieldBinding.tsx +2 -1
  140. package/src/form/field_bindings/RelationFieldBinding.tsx +6 -4
  141. package/src/form/field_bindings/RepeatFieldBinding.tsx +4 -1
  142. package/src/form/field_bindings/SelectFieldBinding.tsx +3 -2
  143. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +31 -8
  144. package/src/form/field_bindings/SwitchFieldBinding.tsx +7 -3
  145. package/src/form/field_bindings/TextFieldBinding.tsx +18 -16
  146. package/src/form/field_bindings/UserSelectFieldBinding.tsx +3 -2
  147. package/src/form/field_bindings/VectorFieldBinding.tsx +2 -1
  148. package/src/hooks/navigation/useBuildUrlController.tsx +1 -1
  149. package/src/hooks/navigation/useTopLevelNavigation.ts +18 -7
  150. package/src/hooks/navigation/utils.ts +20 -0
  151. package/src/hooks/useBuildSideDialogsController.tsx +2 -2
  152. package/src/hooks/useBuildSidePanel.tsx +22 -61
  153. package/src/hooks/useEntityDisplayTitle.tsx +60 -0
  154. package/src/hooks/useHistory.ts +6 -5
  155. package/src/hooks/useRecordActions.tsx +69 -0
  156. package/src/hooks/useResolvedUsers.ts +10 -5
  157. package/src/preview/PropertyPreview.tsx +48 -22
  158. package/src/preview/components/InlineEntityListPreview.tsx +42 -0
  159. package/src/preview/components/ReferencePreview.tsx +34 -14
  160. package/src/preview/components/RelationPreview.tsx +34 -14
  161. package/src/preview/index.ts +1 -0
  162. package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +24 -1
  163. package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +25 -1
  164. package/src/routes/RebaseRoute.tsx +2 -2
  165. package/src/types/components/EntityFormActionsProps.tsx +0 -1
  166. package/src/types/components/EntityFormProps.tsx +0 -6
  167. package/src/types/fields.tsx +27 -0
  168. package/dist/form/components/FormEntry.d.ts +0 -6
  169. package/dist/form/components/FormLayout.d.ts +0 -5
  170. package/dist/history-s6Nzt7RF.js.map +0 -1
  171. package/dist/util-BwZuV81o.js.map +0 -1
  172. package/src/form/components/FormEntry.tsx +0 -22
  173. package/src/form/components/FormLayout.tsx +0 -16
package/README.md CHANGED
@@ -8,7 +8,7 @@ CMS frontend — content management views, forms, routing, visual schema editor,
8
8
  pnpm add @rebasepro/admin
9
9
  ```
10
10
 
11
- **Peer dependencies:** `react >= 19`, `react-dom >= 19`, `react-router ^7`, `react-router-dom ^7`
11
+ **Peer dependencies:** `react >= 19.2.7`, `react-dom >= 19.2.7`, `react-router ^8`
12
12
 
13
13
  ## What This Package Does
14
14
 
@@ -1,14 +1,14 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { $t as CollectionTableBinding, A as getFieldId, Ct as convertDataToEntity, Dt as useImportConfig, Et as getInferenceType, Ft as FieldCaption, In as useCollectionRegistryController, Nt as PropertyConfigBadge, Ot as ImportSaveInProgress, Pt as SearchIconsView, St as DataNewPropertiesMapping, Zt as useSelectionController, _ as useCollectionsConfigController, i as namespaceToPropertiesOrderPath, in as useUrlController, k as getFieldConfig, kt as ImportFileUpload, l as validateCollectionJson, m as toSerializableCollectionConfig, n as getFullIdPath, o as CollectionGenerationApiError, on as useNavigationStateController, r as idToPropertiesPath, t as getFullId, vt as useCollectionEditorController, xt as ImportNewPropertyFieldPreview } from "./util-BwZuV81o.js";
3
- import { a as updatePropertyFromWidget, c as useAIModifiedPaths, i as supportedFields, l as useSafeSnackbarController, n as PropertyForm, o as PropertyTree, r as PropertyFormDialog, s as AIModifiedPathsProvider } from "./PropertyEditView-D2b9_nbC.js";
2
+ import { $t as CollectionTableBinding, A as getFieldId, Ct as convertDataToEntity, Dt as useImportConfig, Et as getInferenceType, Ft as FieldCaption, Ln as useCollectionRegistryController, Nt as PropertyConfigBadge, Ot as ImportSaveInProgress, Pt as SearchIconsView, St as DataNewPropertiesMapping, Zt as useSelectionController, _ as useCollectionsConfigController, i as namespaceToPropertiesOrderPath, in as useUrlController, k as getFieldConfig, kt as ImportFileUpload, l as validateCollectionJson, m as toSerializableCollectionConfig, n as getFullIdPath, o as CollectionGenerationApiError, on as useNavigationStateController, r as idToPropertiesPath, t as getFullId, vt as useCollectionEditorController, xt as ImportNewPropertyFieldPreview } from "./util-BnRLzp4j.js";
3
+ import { a as updatePropertyFromWidget, c as useAIModifiedPaths, i as supportedFields, l as useSafeSnackbarController, n as PropertyForm, o as PropertyTree, r as PropertyFormDialog, s as AIModifiedPathsProvider } from "./PropertyEditView-JPN12E-0.js";
4
4
  import * as React$1 from "react";
5
5
  import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
6
6
  import { Alert, AppWindow, ArrowLeftIcon, BooleanSwitchWithLabel, Button, Card, CheckIcon, Chip, CircularProgress, CircularProgressCenter, CodeIcon, ColumnsIcon, Container, CopyIcon, DebouncedTextField, Dialog, DialogActions, DialogContent, DialogTitle, ErrorBoundary, FileIcon, FileSearchIcon, FileTextIcon, IconButton, KanbanIcon, KeyIcon, LayoutGridIcon, ListIcon, LoadingButton, Menu, MultiSelect, MultiSelectItem, PanelLeftIcon, Paper, PlusIcon, Select, SelectItem, ShoppingCartIcon, SquareIcon, Tab, TableIcon, Tabs, TextField, ToggleButtonGroup, Tooltip, Trash2Icon, Typography, UserIcon, XIcon, cls, coolIconKeys, defaultBorderMixin, iconSize } from "@rebasepro/ui";
7
- import { buildCollectionFromTableMetadata, getEffectiveSecurityRules, getSubcollections, getTableName, isPropertyBuilder } from "@rebasepro/common";
7
+ import { buildCollectionFromTableMetadata, getGeneratedPolicyNames, getSubcollections, getTableName, isPropertyBuilder } from "@rebasepro/common";
8
8
  import { AIIcon, ConfirmationDialog, ErrorView, IconForView, UnsavedChangesDialog, removeInitialAndTrailingSlashes, useAuthController, useCustomizationController, useLargeLayout, useRebaseContext, useUnsavedChangesDialog } from "@rebasepro/app";
9
9
  import { Field, Formex, clone, getIn, useCreateFormex, useFormex } from "@rebasepro/forms";
10
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
- import { camelCase, getPolicyNamesForRule, getPolicyNamesForRules, isEmptyObject, mergeDeep, prettifyIdentifier, randomString, removeUndefined, singular, slugify, toSnakeCase, unslugify } from "@rebasepro/utils";
11
+ import { camelCase, getPolicyNamesForRule, isEmptyObject, mergeDeep, prettifyIdentifier, randomString, removeUndefined, singular, slugify, toSnakeCase, unslugify } from "@rebasepro/utils";
12
12
  import { getDataSourceCapabilities } from "@rebasepro/types";
13
13
  import { z } from "zod";
14
14
  import { buildEntityPropertiesFromData, buildPropertyFromData } from "@rebasepro/inference";
@@ -2385,6 +2385,8 @@ function toSecurityRule(policy) {
2385
2385
  function CollectionRLSTab() {
2386
2386
  const { values, setFieldValue } = useFormex();
2387
2387
  const [editingPolicy, setEditingPolicy] = useState(null);
2388
+ const { readOnly, readOnlyReason } = useCollectionsConfigController();
2389
+ const readOnlyTitle = readOnlyReason || "This backend does not accept collection edits.";
2388
2390
  const rules = values.securityRules || [];
2389
2391
  const { databaseAdmin } = useRebaseContext();
2390
2392
  const [dbPolicies, setDbPolicies] = useState([]);
@@ -2468,27 +2470,10 @@ function CollectionRLSTab() {
2468
2470
  };
2469
2471
  }, [databaseAdmin]);
2470
2472
  const tableName = values.id || values.table || values.alias;
2471
- /**
2472
- * Every policy name `rebase db push` would write for this collection.
2473
- *
2474
- * Two things make this more than `rules.map(r => r.name)`:
2475
- * - a rule without an explicit `name` becomes `<table>_<op>_<hash>`, so
2476
- * comparing `rule.name` to `policyname` never matches for it;
2477
- * - the generator also injects the safe-by-default baseline
2478
- * (`<table>_default_admin_*`), which is in no collection's `securityRules`.
2479
- *
2480
- * Missing either made Rebase's own policies look hand-written, and offered to
2481
- * import them back into the codebase that produced them.
2482
- */
2483
2473
  const generatedPolicyNames = useMemo(() => {
2484
2474
  if (!tableName) return /* @__PURE__ */ new Set();
2485
- const effectiveRules = getEffectiveSecurityRules(values);
2486
- return getPolicyNamesForRules([...rules, ...effectiveRules], tableName);
2487
- }, [
2488
- rules,
2489
- tableName,
2490
- values
2491
- ]);
2475
+ return getGeneratedPolicyNames(values);
2476
+ }, [tableName, values]);
2492
2477
  const unmappedPolicies = dbPolicies.filter((dp) => !generatedPolicyNames.has(dp.policyname));
2493
2478
  const handleSave = async (newPolicy) => {
2494
2479
  const rule = toSecurityRule(newPolicy);
@@ -2511,11 +2496,15 @@ function CollectionRLSTab() {
2511
2496
  children: [/* @__PURE__ */ jsx(Typography, {
2512
2497
  variant: "h5",
2513
2498
  children: "Row Level Security"
2514
- }), /* @__PURE__ */ jsx(Button, {
2515
- variant: "filled",
2516
- color: "neutral",
2517
- onClick: () => setEditingPolicy("new"),
2518
- children: "CREATE POLICY"
2499
+ }), /* @__PURE__ */ jsx(Tooltip, {
2500
+ title: readOnly ? readOnlyTitle : void 0,
2501
+ children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, {
2502
+ variant: "filled",
2503
+ color: "neutral",
2504
+ disabled: readOnly,
2505
+ onClick: () => setEditingPolicy("new"),
2506
+ children: "CREATE POLICY"
2507
+ }) })
2519
2508
  })]
2520
2509
  }),
2521
2510
  rules.length === 0 ? /* @__PURE__ */ jsx("div", {
@@ -2557,6 +2546,7 @@ function CollectionRLSTab() {
2557
2546
  children: [/* @__PURE__ */ jsx(Button, {
2558
2547
  size: "small",
2559
2548
  variant: "text",
2549
+ disabled: readOnly,
2560
2550
  onClick: () => setEditingPolicy({
2561
2551
  policyname: rule.name ?? "",
2562
2552
  tablename: values.id || values.table || values.alias || "your_table",
@@ -2569,6 +2559,7 @@ function CollectionRLSTab() {
2569
2559
  children: "EDIT"
2570
2560
  }), /* @__PURE__ */ jsx(IconButton, {
2571
2561
  size: "small",
2562
+ disabled: readOnly,
2572
2563
  onClick: () => {
2573
2564
  setFieldValue("securityRules", rules.filter((r) => r.name !== rule.name));
2574
2565
  },
@@ -2637,15 +2628,19 @@ function CollectionRLSTab() {
2637
2628
  })]
2638
2629
  }), /* @__PURE__ */ jsx("div", {
2639
2630
  className: "flex items-center gap-1 sm:gap-2 shrink-0",
2640
- children: /* @__PURE__ */ jsx(Button, {
2641
- size: "small",
2642
- variant: "outlined",
2643
- color: "primary",
2644
- onClick: () => {
2645
- const rule = toSecurityRule(dp);
2646
- setFieldValue("securityRules", [...rules, rule]);
2647
- },
2648
- children: "Import to codebase"
2631
+ children: /* @__PURE__ */ jsx(Tooltip, {
2632
+ title: readOnly ? readOnlyTitle : void 0,
2633
+ children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, {
2634
+ size: "small",
2635
+ variant: "outlined",
2636
+ color: "primary",
2637
+ disabled: readOnly,
2638
+ onClick: () => {
2639
+ const rule = toSecurityRule(dp);
2640
+ setFieldValue("securityRules", [...rules, rule]);
2641
+ },
2642
+ children: "Import to codebase"
2643
+ }) })
2649
2644
  })
2650
2645
  })]
2651
2646
  }, dp.policyname))
@@ -2971,10 +2966,12 @@ function CollectionEditor(props) {
2971
2966
  }, [collection, fallbackSlug]);
2972
2967
  const initialValues = React$1.useMemo(() => {
2973
2968
  return initialCollection ? applyPropertyConfigs(initialCollection, propertyConfigs) : copyFromProp ? (() => {
2974
- const { subcollections: _sub, ...rest } = copyFromProp;
2969
+ const { subcollections: _sub, schema: _schema, auth: _auth, ...rest } = copyFromProp;
2975
2970
  return {
2976
2971
  ...rest,
2977
2972
  name: "",
2973
+ slug: fallbackSlug,
2974
+ table: "",
2978
2975
  ownerId: authController.user?.uid ?? ""
2979
2976
  };
2980
2977
  })() : {
@@ -3009,6 +3006,8 @@ function CollectionEditor(props) {
3009
3006
  });
3010
3007
  }
3011
3008
  function CollectionEditorInternal({ isNewCollection, configController, editedCollectionId, parentCollectionSlugs, parentEntityIds, path, collectionInference, handleClose, extraView, handleCancel, setFormDirty, getUser, parentCollection, getData, existingPaths, existingIds, includeTemplates, collection, setCollection, initialValues, propertyConfigs, existingEntities, initialView: initialViewProp, expandKanban, generateCollection, onAnalyticsEvent, fullScreen, unmappedTables, onFetchTableMetadata, propertyTypePresets, hiddenPropertyTypes, renderExtraPropertyFields, renderExtraCollectionFields, visibleTabs, standalone }) {
3009
+ /** Why the submit buttons below are dead, straight from the backend. */
3010
+ const readOnlyTitle = configController?.readOnlyReason || "This backend does not accept collection edits.";
3012
3011
  const importConfigRaw = useImportConfig();
3013
3012
  const urlControllerRaw = useUrlController();
3014
3013
  const collectionRegistryRaw = useCollectionRegistryController();
@@ -3292,14 +3291,17 @@ function CollectionEditorInternal({ isNewCollection, configController, editedCol
3292
3291
  onAnalyticsEvent
3293
3292
  }), fullScreen && !isNewCollection && /* @__PURE__ */ jsx("div", {
3294
3293
  className: "flex items-center gap-2",
3295
- children: /* @__PURE__ */ jsx(LoadingButton, {
3296
- variant: "filled",
3297
- color: "primary",
3298
- type: "submit",
3299
- onClick: () => formController.handleSubmit(),
3300
- disabled: !dirty || isSubmitting || configController?.readOnly,
3301
- loading: isSubmitting,
3302
- children: configController?.readOnly ? "Update (Read-only)" : "Update"
3294
+ children: /* @__PURE__ */ jsx(Tooltip, {
3295
+ title: configController?.readOnly ? readOnlyTitle : void 0,
3296
+ children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(LoadingButton, {
3297
+ variant: "filled",
3298
+ color: "primary",
3299
+ type: "submit",
3300
+ onClick: () => formController.handleSubmit(),
3301
+ disabled: !dirty || isSubmitting || configController?.readOnly,
3302
+ loading: isSubmitting,
3303
+ children: configController?.readOnly ? "Update (Read-only)" : "Update"
3304
+ }) })
3303
3305
  })
3304
3306
  })]
3305
3307
  })]
@@ -3470,13 +3472,16 @@ function CollectionEditorInternal({ isNewCollection, configController, editedCol
3470
3472
  startIcon: currentView === "properties" ? /* @__PURE__ */ jsx(CheckIcon, {}) : void 0,
3471
3473
  children: [currentView === "general" && "Next", currentView === "properties" && "Create collection"]
3472
3474
  }),
3473
- !isNewCollection && !fullScreen && /* @__PURE__ */ jsx(LoadingButton, {
3474
- variant: "filled",
3475
- color: "primary",
3476
- type: "submit",
3477
- disabled: isSubmitting || configController?.readOnly,
3478
- loading: isSubmitting,
3479
- children: configController?.readOnly ? "Update collection (Read-only)" : "Update collection"
3475
+ !isNewCollection && !fullScreen && /* @__PURE__ */ jsx(Tooltip, {
3476
+ title: configController?.readOnly ? readOnlyTitle : void 0,
3477
+ children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(LoadingButton, {
3478
+ variant: "filled",
3479
+ color: "primary",
3480
+ type: "submit",
3481
+ disabled: isSubmitting || configController?.readOnly,
3482
+ loading: isSubmitting,
3483
+ children: configController?.readOnly ? "Update collection (Read-only)" : "Update collection"
3484
+ }) })
3480
3485
  })
3481
3486
  ]
3482
3487
  })]
@@ -3545,4 +3550,4 @@ var validateId = (value, isNewCollection, existingPaths, existingIds) => {
3545
3550
  //#endregion
3546
3551
  export { CollectionEditorDialog as n, CollectionEditorDialog_exports as r, CollectionEditor as t };
3547
3552
 
3548
- //# sourceMappingURL=CollectionEditorDialog-B8j6HArJ.js.map
3553
+ //# sourceMappingURL=CollectionEditorDialog-Dhn0S4FT.js.map