@rebasepro/admin 0.0.1-canary.eae7889 → 0.1.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.
Files changed (197) hide show
  1. package/dist/{CollectionEditorDialog-B2M9lCyL.js → CollectionEditorDialog-MbvXGzEq.js} +42 -31
  2. package/dist/CollectionEditorDialog-MbvXGzEq.js.map +1 -0
  3. package/dist/{CollectionsStudioView-WG6soyfs.js → CollectionsStudioView-D9X6aiAr.js} +12 -12
  4. package/dist/CollectionsStudioView-D9X6aiAr.js.map +1 -0
  5. package/dist/{ContentHomePage-CDF_a6Lp.js → ContentHomePage-CfVB1eUo.js} +26 -26
  6. package/dist/ContentHomePage-CfVB1eUo.js.map +1 -0
  7. package/dist/{ExportCollectionAction-Dc0VOWMN.js → ExportCollectionAction-CUwJg4F9.js} +2 -2
  8. package/dist/{ExportCollectionAction-Dc0VOWMN.js.map → ExportCollectionAction-CUwJg4F9.js.map} +1 -1
  9. package/dist/{ImportCollectionAction-DpCagAOy.js → ImportCollectionAction-DGa_SF_8.js} +2 -2
  10. package/dist/{ImportCollectionAction-DpCagAOy.js.map → ImportCollectionAction-DGa_SF_8.js.map} +1 -1
  11. package/dist/{PropertyEditView-DS67DxoT.js → PropertyEditView-C4nlYmAc.js} +82 -104
  12. package/dist/PropertyEditView-C4nlYmAc.js.map +1 -0
  13. package/dist/{RolesView-CIuYBimF.js → RolesView-CNWxnR8e.js} +7 -5
  14. package/dist/RolesView-CNWxnR8e.js.map +1 -0
  15. package/dist/{UsersView-B5zelXnH.js → UsersView-YiTIcXkA.js} +14 -35
  16. package/dist/UsersView-YiTIcXkA.js.map +1 -0
  17. package/dist/collection_editor/ConfigControllerProvider.d.ts +0 -4
  18. package/dist/collection_editor/types/collection_editor_controller.d.ts +6 -3
  19. package/dist/collection_editor/types/config_controller.d.ts +14 -7
  20. package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +3 -2
  21. package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +3 -2
  22. package/dist/collection_editor/ui/EditorCollectionAction.d.ts +1 -1
  23. package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +1 -1
  24. package/dist/collection_editor/ui/EditorEntityAction.d.ts +1 -1
  25. package/dist/collection_editor/ui/KanbanSetupAction.d.ts +3 -2
  26. package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +3 -2
  27. package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +3 -4
  28. package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +2 -3
  29. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +1 -2
  30. package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +3 -2
  31. package/dist/collection_editor_ui.js +3 -3
  32. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +1 -1
  33. package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +1 -1
  34. package/dist/components/EntityCollectionTable/column_utils.d.ts +2 -2
  35. package/dist/components/EntityCollectionTable/fields/TableMultipleRelationField.d.ts +1 -1
  36. package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +1 -1
  37. package/dist/components/EntityCollectionTable/fields/TableRelationField.d.ts +1 -1
  38. package/dist/components/EntityCollectionTable/fields/TableRelationSelectorField.d.ts +2 -2
  39. package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +5 -1
  40. package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +3 -2
  41. package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +2 -1
  42. package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +4 -2
  43. package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +4 -2
  44. package/dist/components/EntityCollectionView/FiltersDialog.d.ts +2 -2
  45. package/dist/components/EntityCollectionView/SplitListView.d.ts +3 -2
  46. package/dist/components/EntityEditView.d.ts +9 -2
  47. package/dist/components/RebaseCMS.d.ts +1 -1
  48. package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +2 -2
  49. package/dist/components/ReferenceWidget.d.ts +2 -2
  50. package/dist/components/RelationSelector.d.ts +1 -1
  51. package/dist/components/SelectableTable/SelectableTable.d.ts +2 -2
  52. package/dist/editor.js +2 -2
  53. package/dist/editor.js.map +1 -1
  54. package/dist/hooks/navigation/useNavigationRegistry.d.ts +2 -1
  55. package/dist/hooks/useEntityHistory.d.ts +1 -1
  56. package/dist/{index-CHxgwt6E.js → index-CtzpHzMQ.js} +11 -4
  57. package/dist/index-CtzpHzMQ.js.map +1 -0
  58. package/dist/{index-Dey5WJpO.js → index-DKlrVD1m.js} +3 -3
  59. package/dist/index-DKlrVD1m.js.map +1 -0
  60. package/dist/{index-CBhrgpR7.js → index-kHJXfLNI.js} +3 -3
  61. package/dist/index-kHJXfLNI.js.map +1 -0
  62. package/dist/index.js +79 -63
  63. package/dist/index.js.map +1 -1
  64. package/dist/{useEntityHistory-Dcj4zhGj.js → useEntityHistory-UVsSclfZ.js} +3 -1
  65. package/dist/useEntityHistory-UVsSclfZ.js.map +1 -0
  66. package/dist/util/navigation_utils.d.ts +10 -1
  67. package/dist/{util-BQ82ySL3.js → util-CwLmSpGp.js} +1653 -1257
  68. package/dist/util-CwLmSpGp.js.map +1 -0
  69. package/package.json +9 -17
  70. package/src/collection_editor/ConfigControllerProvider.tsx +19 -28
  71. package/src/collection_editor/types/collection_editor_controller.tsx +3 -3
  72. package/src/collection_editor/types/config_controller.tsx +7 -7
  73. package/src/collection_editor/ui/AddKanbanColumnAction.tsx +4 -4
  74. package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +3 -3
  75. package/src/collection_editor/ui/EditorCollectionAction.tsx +3 -3
  76. package/src/collection_editor/ui/EditorCollectionActionStart.tsx +7 -7
  77. package/src/collection_editor/ui/EditorEntityAction.tsx +3 -3
  78. package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +4 -2
  79. package/src/collection_editor/ui/KanbanSetupAction.tsx +4 -3
  80. package/src/collection_editor/ui/MissingReferenceWidget.tsx +3 -2
  81. package/src/collection_editor/ui/NewCollectionButton.tsx +2 -1
  82. package/src/collection_editor/ui/NewCollectionCard.tsx +2 -1
  83. package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +3 -3
  84. package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +5 -50
  85. package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +12 -20
  86. package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +1 -3
  87. package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +17 -2
  88. package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +3 -3
  89. package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +2 -1
  90. package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +18 -12
  91. package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +1 -2
  92. package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +1 -2
  93. package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +6 -6
  94. package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +4 -4
  95. package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +2 -2
  96. package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +15 -49
  97. package/src/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +4 -5
  98. package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +1 -1
  99. package/src/collection_editor/ui/collection_editor/templates/products_template.ts +2 -2
  100. package/src/components/DefaultAppBar.tsx +2 -2
  101. package/src/components/DefaultDrawer.tsx +25 -17
  102. package/src/components/DrawerNavigationGroup.tsx +4 -4
  103. package/src/components/DrawerNavigationItem.tsx +6 -6
  104. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +4 -4
  105. package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +1 -1
  106. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +4 -4
  107. package/src/components/EntityCollectionTable/column_utils.tsx +3 -3
  108. package/src/components/EntityCollectionTable/fields/TableMultipleRelationField.tsx +3 -3
  109. package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +3 -3
  110. package/src/components/EntityCollectionTable/fields/TableRelationField.tsx +4 -4
  111. package/src/components/EntityCollectionTable/fields/TableRelationSelectorField.tsx +3 -3
  112. package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +8 -2
  113. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +1 -1
  114. package/src/components/EntityCollectionTable/internal/common.tsx +5 -5
  115. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -1
  116. package/src/components/EntityCollectionTable/table_bindings.tsx +45 -35
  117. package/src/components/EntityCollectionView/EntityBoardCard.tsx +18 -19
  118. package/src/components/EntityCollectionView/EntityCard.tsx +2 -2
  119. package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +42 -14
  120. package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +4 -3
  121. package/src/components/EntityCollectionView/EntityCollectionListView.tsx +157 -54
  122. package/src/components/EntityCollectionView/EntityCollectionView.tsx +169 -75
  123. package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +23 -13
  124. package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +21 -12
  125. package/src/components/EntityCollectionView/FiltersDialog.tsx +7 -7
  126. package/src/components/EntityCollectionView/SplitListView.tsx +24 -8
  127. package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +33 -5
  128. package/src/components/EntityEditView.tsx +85 -85
  129. package/src/components/EntitySidePanel.tsx +18 -10
  130. package/src/components/HomePage/ContentHomePage.tsx +24 -15
  131. package/src/components/HomePage/NavigationCard.tsx +4 -4
  132. package/src/components/HomePage/NavigationGroup.tsx +2 -2
  133. package/src/components/RebaseAuthGate.tsx +2 -0
  134. package/src/components/RebaseCMS.tsx +4 -3
  135. package/src/components/RebaseNavigation.tsx +8 -5
  136. package/src/components/ReferenceTable/EntitySelectionTable.tsx +4 -4
  137. package/src/components/ReferenceWidget.tsx +3 -3
  138. package/src/components/RelationSelector.tsx +33 -5
  139. package/src/components/SelectableTable/SelectableTable.tsx +6 -6
  140. package/src/components/UserSelector.tsx +1 -1
  141. package/src/components/admin/RolesView.tsx +10 -3
  142. package/src/components/admin/UsersView.tsx +13 -25
  143. package/src/components/app/Scaffold.tsx +4 -4
  144. package/src/components/field_configs.tsx +29 -32
  145. package/src/components/history/EntityHistoryView.tsx +12 -1
  146. package/src/editor/editor.tsx +2 -2
  147. package/src/form/EntityForm.tsx +5 -4
  148. package/src/form/PropertyFieldBinding.tsx +14 -10
  149. package/src/form/components/FieldHelperText.tsx +1 -1
  150. package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +3 -3
  151. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +5 -5
  152. package/src/form/field_bindings/BlockFieldBinding.tsx +4 -4
  153. package/src/form/field_bindings/DateTimeFieldBinding.tsx +1 -1
  154. package/src/form/field_bindings/KeyValueFieldBinding.tsx +1 -1
  155. package/src/form/field_bindings/MapFieldBinding.tsx +7 -7
  156. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +1 -1
  157. package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +3 -3
  158. package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +7 -7
  159. package/src/form/field_bindings/ReferenceFieldBinding.tsx +2 -2
  160. package/src/form/field_bindings/RelationFieldBinding.tsx +4 -4
  161. package/src/form/field_bindings/RepeatFieldBinding.tsx +5 -5
  162. package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
  163. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +1 -1
  164. package/src/form/field_bindings/SwitchFieldBinding.tsx +1 -1
  165. package/src/form/field_bindings/TextFieldBinding.tsx +7 -7
  166. package/src/form/field_bindings/UserSelectFieldBinding.tsx +1 -1
  167. package/src/form/useClearRestoreValue.tsx +1 -1
  168. package/src/form/validation.ts +1 -1
  169. package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +2 -1
  170. package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +15 -3
  171. package/src/hooks/navigation/useNavigationRegistry.ts +14 -3
  172. package/src/hooks/navigation/useResolvedViews.tsx +1 -3
  173. package/src/hooks/navigation/useTopLevelNavigation.ts +1 -1
  174. package/src/hooks/navigation/utils.ts +1 -1
  175. package/src/hooks/useEntityHistory.ts +7 -2
  176. package/src/preview/PropertyPreview.tsx +27 -23
  177. package/src/preview/components/StorageThumbnail.tsx +4 -1
  178. package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -1
  179. package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +1 -1
  180. package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +1 -1
  181. package/src/preview/property_previews/SkeletonPropertyComponent.tsx +3 -3
  182. package/src/preview/property_previews/StringPropertyPreview.tsx +3 -3
  183. package/src/routes/RebaseRoute.tsx +57 -11
  184. package/src/util/navigation_utils.ts +21 -2
  185. package/src/util/previews.ts +15 -6
  186. package/src/util/property_utils.tsx +3 -3
  187. package/dist/CollectionEditorDialog-B2M9lCyL.js.map +0 -1
  188. package/dist/CollectionsStudioView-WG6soyfs.js.map +0 -1
  189. package/dist/ContentHomePage-CDF_a6Lp.js.map +0 -1
  190. package/dist/PropertyEditView-DS67DxoT.js.map +0 -1
  191. package/dist/RolesView-CIuYBimF.js.map +0 -1
  192. package/dist/UsersView-B5zelXnH.js.map +0 -1
  193. package/dist/index-CBhrgpR7.js.map +0 -1
  194. package/dist/index-CHxgwt6E.js.map +0 -1
  195. package/dist/index-Dey5WJpO.js.map +0 -1
  196. package/dist/useEntityHistory-Dcj4zhGj.js.map +0 -1
  197. package/dist/util-BQ82ySL3.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
3
  import { useAuthController, useCustomizationController, IconForView, useSnackbarController, useLargeLayout, AIIcon, useRebaseContext, ErrorView, ConfirmationDialog, useUnsavedChangesDialog, UnsavedChangesDialog } from "@rebasepro/core";
4
- import { bk as useCollectionsConfigController, a3 as FieldCaption, ar as SearchIconsView, d as getFieldConfig, P as PropertyConfigBadge, aX as getFullId, b0 as idToPropertiesPath, b4 as namespaceToPropertiesOrderPath, br as validateCollectionJson, e as useCollectionRegistryController, K as CollectionGenerationApiError, s as useCollectionEditorController, I as ImportFileUpload, a as getInferenceType, a8 as ImportNewPropertyFieldPreview, D as DataNewPropertiesMapping, aW as getFieldId, f as useSelectionController, h as convertDataToEntity, E as EntityCollectionTable, m as useNavigationStateController, u as useImportConfig, j as useUrlController, b as ImportSaveInProgress, aY as getFullIdPath } from "./util-BQ82ySL3.js";
4
+ import { bk as useCollectionsConfigController, a3 as FieldCaption, ar as SearchIconsView, d as getFieldConfig, P as PropertyConfigBadge, aX as getFullId, b0 as idToPropertiesPath, b4 as namespaceToPropertiesOrderPath, br as validateCollectionJson, e as useCollectionRegistryController, K as CollectionGenerationApiError, s as useCollectionEditorController, I as ImportFileUpload, a as getInferenceType, a8 as ImportNewPropertyFieldPreview, D as DataNewPropertiesMapping, aW as getFieldId, f as useSelectionController, h as convertDataToEntity, E as EntityCollectionTable, m as useNavigationStateController, u as useImportConfig, j as useUrlController, b as ImportSaveInProgress, aY as getFullIdPath } from "./util-CwLmSpGp.js";
5
5
  import * as React from "react";
6
6
  import React__default, { useState, useRef, useMemo, useEffect } from "react";
7
7
  import { Chip, Typography, cls, Tooltip, IconButton, TextField, DebouncedTextField, Dialog, Container, ToggleButtonGroup, Select, SelectItem, iconSize, Button, BooleanSwitchWithLabel, DialogTitle, DialogContent, DialogActions, CircularProgress, ErrorBoundary, defaultBorderMixin, Table, TableHeader, TableCell, TableBody, TableRow, Menu, Card, CircularProgressCenter, Paper, MultiSelect, MultiSelectItem, coolIconKeys, Tabs, Tab, LoadingButton } from "@rebasepro/ui";
@@ -23,7 +23,7 @@ import "xlsx";
23
23
  import { buildPropertyFromData, buildEntityPropertiesFromData } from "@rebasepro/schema-inference";
24
24
  import "date-fns";
25
25
  import "date-fns/locale";
26
- import { a as PropertyFormDialog, u as useAIModifiedPaths, b as PropertyTree, P as PropertyForm, s as supportedFields, c as updatePropertyFromWidget, A as AIModifiedPathsProvider } from "./PropertyEditView-DS67DxoT.js";
26
+ import { a as PropertyFormDialog, u as useAIModifiedPaths, b as PropertyTree, P as PropertyForm, s as supportedFields, c as updatePropertyFromWidget, A as AIModifiedPathsProvider } from "./PropertyEditView-C4nlYmAc.js";
27
27
  import JSON5 from "json5";
28
28
  import { Highlight, themes } from "prism-react-renderer";
29
29
  const CollectionEditorSchema = z.object({
@@ -893,8 +893,10 @@ function DisplaySettingsForm({
893
893
  /* @__PURE__ */ jsx(PropertyFormDialog, { open: orderPropertyDialogOpen, onCancel: () => setOrderPropertyDialogOpen(false), property: {
894
894
  type: "string",
895
895
  name: dialogPropertyName,
896
- disabled: true,
897
- hideFromCollection: true
896
+ ui: {
897
+ disabled: true,
898
+ hideFromCollection: true
899
+ }
898
900
  }, propertyKey: dialogPropertyKey, existingProperty: false, autoOpenTypeSelect: false, autoUpdateId: false, inArray: false, allowDataInference: false, propertyConfigs: customizationController.propertyConfigs, existingPropertyKeys: Object.keys(values.properties ?? {}), onPropertyChanged: ({
899
901
  id,
900
902
  property
@@ -1108,8 +1110,7 @@ function collectionToCode(collection) {
1108
1110
  path: collection.slug,
1109
1111
  description: collection.description,
1110
1112
  icon: collection.icon,
1111
- group: collection.group,
1112
- filter: collection.filter,
1113
+ defaultFilter: collection.defaultFilter,
1113
1114
  sort: collection.sort,
1114
1115
  properties: Object.entries({
1115
1116
  ...collection.properties ?? {}
@@ -1128,7 +1129,6 @@ function CollectionPropertiesEditorForm({
1128
1129
  propertyErrorsRef,
1129
1130
  onPropertyError,
1130
1131
  setDirty,
1131
- reservedGroups,
1132
1132
  extraIcon,
1133
1133
  getUser,
1134
1134
  getData,
@@ -1344,7 +1344,7 @@ function CollectionPropertiesEditorForm({
1344
1344
  setSelectedPropertyKey(propertyKey_1);
1345
1345
  setSelectedPropertyNamespace(namespace_6);
1346
1346
  };
1347
- const body = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-2 h-full bg-surface dark:bg-surface-dark", children: [
1347
+ const body = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-2 h-full bg-white dark:bg-surface-950", children: [
1348
1348
  /* @__PURE__ */ jsxs("div", { className: cls("bg-surface-50 dark:bg-surface-900", "p-4 md:p-8", "col-span-12 lg:col-span-5 h-full overflow-auto", !asDialog && "border-r " + defaultBorderMixin), children: [
1349
1349
  /* @__PURE__ */ jsxs("div", { className: "flex my-2", children: [
1350
1350
  /* @__PURE__ */ jsxs("div", { className: "grow mb-4", children: [
@@ -1480,7 +1480,7 @@ function CollectionRelationsTab() {
1480
1480
  ] }),
1481
1481
  /* @__PURE__ */ jsx(Dialog, { open: !!editingRelationState, onOpenChange: (open) => !open && handleCancel(), maxWidth: "2xl", children: editingRelationState && /* @__PURE__ */ jsxs(Fragment, { children: [
1482
1482
  /* @__PURE__ */ jsx(DialogTitle, { className: "flex justify-between items-center w-full", variant: "h6", children: editingRelationIndex === -1 ? "New Relation" : "Edit Relation" }),
1483
- /* @__PURE__ */ jsx(DialogContent, { includeMargin: false, className: "p-4 md:p-6 border-t dark:border-surface-700 bg-surface-50 dark:bg-surface-800", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 max-w-2xl mx-auto", children: [
1483
+ /* @__PURE__ */ jsx(DialogContent, { includeMargin: false, className: cls("p-4 md:p-6 border-t bg-white dark:bg-surface-900", defaultBorderMixin), children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 max-w-2xl mx-auto", children: [
1484
1484
  /* @__PURE__ */ jsx(TextField, { label: "Relation Name", name: "relationName", placeholder: "e.g. posts", value: editingRelationState.relationName || "", onChange: (e_1) => setEditingRelationState((prev) => prev ? {
1485
1485
  ...prev,
1486
1486
  relationName: e_1.target.value
@@ -1512,7 +1512,7 @@ function CollectionRelationsTab() {
1512
1512
  /* @__PURE__ */ jsx(SelectItem, { value: "owning", children: "Owning" }),
1513
1513
  /* @__PURE__ */ jsx(SelectItem, { value: "inverse", children: "Inverse" })
1514
1514
  ] }),
1515
- editingRelationState.cardinality === "many" && editingRelationState.direction === "owning" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 mt-4 pt-4 border-t dark:border-surface-800", children: [
1515
+ editingRelationState.cardinality === "many" && editingRelationState.direction === "owning" && /* @__PURE__ */ jsxs("div", { className: cls("flex flex-col gap-4 mt-4 pt-4 border-t", defaultBorderMixin), children: [
1516
1516
  /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "text-text-primary", children: "Intermediate Table" }),
1517
1517
  /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-text-secondary -mt-3", children: "Required for many-to-many relationships. This defines the junction table linking both collections." }),
1518
1518
  /* @__PURE__ */ jsx(TextField, { label: "Table Name", name: "throughTable", placeholder: "e.g. user_roles", value: editingRelationState.through?.table || "", onChange: (e_2) => setEditingRelationState((prev_3) => prev_3 ? {
@@ -1861,7 +1861,9 @@ const productsCollectionTemplate = {
1861
1861
  available: {
1862
1862
  type: "boolean",
1863
1863
  name: "Available",
1864
- columnWidth: 100,
1864
+ ui: {
1865
+ columnWidth: 100
1866
+ },
1865
1867
  description: "Is this product available in the website"
1866
1868
  },
1867
1869
  price: {
@@ -1875,7 +1877,9 @@ const productsCollectionTemplate = {
1875
1877
  images: {
1876
1878
  type: "array",
1877
1879
  name: "Images",
1878
- hideFromCollection: true,
1880
+ ui: {
1881
+ hideFromCollection: true
1882
+ },
1879
1883
  of: {
1880
1884
  type: "string",
1881
1885
  storage: {
@@ -2250,7 +2254,9 @@ const pagesCollectionTemplate = {
2250
2254
  is_published: {
2251
2255
  type: "boolean",
2252
2256
  name: "Is Published",
2253
- columnWidth: 100,
2257
+ ui: {
2258
+ columnWidth: 100
2259
+ },
2254
2260
  description: "Should this page be live on the site?"
2255
2261
  }
2256
2262
  }
@@ -3344,6 +3350,12 @@ function cleanPropertiesFromImport(properties, parentSlug = "") {
3344
3350
  idColumn
3345
3351
  };
3346
3352
  }
3353
+ function sanitizeSqlIdentifier(name) {
3354
+ if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(name)) {
3355
+ throw new Error(`Invalid SQL identifier: "${name}". Only letters, digits, and underscores are allowed.`);
3356
+ }
3357
+ return `"${name}"`;
3358
+ }
3347
3359
  function CollectionRLSTab() {
3348
3360
  const {
3349
3361
  values,
@@ -3362,10 +3374,12 @@ function CollectionRLSTab() {
3362
3374
  if (!tableName || !databaseAdmin?.executeSql) return;
3363
3375
  setIsLoadingDb(true);
3364
3376
  try {
3377
+ const safeTableName = sanitizeSqlIdentifier(tableName);
3378
+ const quotedName = safeTableName.slice(1, -1);
3365
3379
  const sql = `
3366
3380
  SELECT policyname, permissive, roles, cmd, qual, with_check
3367
3381
  FROM pg_policies
3368
- WHERE tablename = '${tableName}' AND schemaname NOT IN ('information_schema', 'pg_catalog');
3382
+ WHERE tablename = '${quotedName}' AND schemaname NOT IN ('information_schema', 'pg_catalog');
3369
3383
  `;
3370
3384
  const result = await databaseAdmin.executeSql(sql);
3371
3385
  const extractRows = (res) => {
@@ -4185,7 +4199,7 @@ function CollectionEditor(props) {
4185
4199
  } = collectionRegistry;
4186
4200
  const initialValuesProp = props.initialValues;
4187
4201
  const copyFromProp = props.copyFrom;
4188
- const includeTemplates = !copyFromProp && !initialValuesProp?.slug && (props.parentCollectionIds ?? []).length === 0;
4202
+ const includeTemplates = !copyFromProp && !initialValuesProp?.slug && (props.parentCollectionSlugs ?? []).length === 0;
4189
4203
  const collectionsInThisLevel = (props.parentCollection ? getSubcollections(props.parentCollection) : collections) ?? [];
4190
4204
  const existingPaths = collectionsInThisLevel.map((col) => getTableName(col)?.trim().toLowerCase()).filter(Boolean);
4191
4205
  const existingIds = collectionsInThisLevel.map((col_0) => col_0.slug?.trim().toLowerCase()).filter(Boolean);
@@ -4195,7 +4209,7 @@ function CollectionEditor(props) {
4195
4209
  try {
4196
4210
  if (collectionRegistry.initialised) {
4197
4211
  if (props.editedCollectionId) {
4198
- const collectionPath = [...props.parentCollectionIds ?? [], props.editedCollectionId].reduce((acc, segment, i) => i === 0 ? segment : `${acc}/fake_id/${segment}`, "");
4212
+ const collectionPath = [...props.parentCollectionSlugs ?? [], props.editedCollectionId].reduce((acc, segment, i) => i === 0 ? segment : `${acc}/fake_id/${segment}`, "");
4199
4213
  setCollection(collectionRegistry.getRawCollection(collectionPath));
4200
4214
  } else {
4201
4215
  setCollection(void 0);
@@ -4205,8 +4219,7 @@ function CollectionEditor(props) {
4205
4219
  } catch (e) {
4206
4220
  console.error(e);
4207
4221
  }
4208
- }, [props.editedCollectionId, props.parentCollectionIds, collectionRegistry.initialised, collectionRegistry.getRawCollection]);
4209
- const groups = topLevelNavigation?.groups ?? [];
4222
+ }, [props.editedCollectionId, props.parentCollectionSlugs, props.parentEntityIds, collectionRegistry.initialised, collectionRegistry.getRawCollection]);
4210
4223
  const initialCollection = collection ? {
4211
4224
  ...collection,
4212
4225
  slug: collection.slug ?? randomString(16)
@@ -4225,7 +4238,6 @@ function CollectionEditor(props) {
4225
4238
  slug: initialValuesProp?.slug ?? randomString(16),
4226
4239
  table: initialValuesProp?.slug ?? "",
4227
4240
  name: initialValuesProp?.name ?? "",
4228
- group: initialValuesProp?.group ?? "",
4229
4241
  properties: {},
4230
4242
  propertiesOrder: [],
4231
4243
  icon: coolIconKeys[Math.floor(Math.random() * coolIconKeys.length)],
@@ -4237,17 +4249,17 @@ function CollectionEditor(props) {
4237
4249
  if (!props.isNewCollection && (!collectionRegistry.initialised || !initialLoadingCompleted)) {
4238
4250
  return /* @__PURE__ */ jsx(CircularProgressCenter, {});
4239
4251
  }
4240
- return /* @__PURE__ */ jsx(CollectionEditorInternal, { ...props, initialValues, existingPaths, existingIds, includeTemplates, collection, setCollection, groups, propertyConfigs });
4252
+ return /* @__PURE__ */ jsx(CollectionEditorInternal, { ...props, initialValues, existingPaths, existingIds, includeTemplates, collection, setCollection, propertyConfigs });
4241
4253
  }
4242
4254
  function CollectionEditorInternal({
4243
4255
  isNewCollection,
4244
4256
  configController,
4245
4257
  editedCollectionId,
4246
- parentCollectionIds,
4258
+ parentCollectionSlugs,
4259
+ parentEntityIds,
4247
4260
  path,
4248
4261
  collectionInference,
4249
4262
  handleClose,
4250
- reservedGroups,
4251
4263
  extraView,
4252
4264
  handleCancel,
4253
4265
  setFormDirty,
@@ -4261,7 +4273,6 @@ function CollectionEditorInternal({
4261
4273
  setCollection,
4262
4274
  initialValues,
4263
4275
  propertyConfigs,
4264
- groups,
4265
4276
  existingEntities,
4266
4277
  initialView: initialViewProp,
4267
4278
  expandKanban,
@@ -4285,7 +4296,7 @@ function CollectionEditorInternal({
4285
4296
  id,
4286
4297
  collectionData: updatedCollection,
4287
4298
  previousId: editedCollectionId,
4288
- parentCollectionIds
4299
+ parentCollectionSlugs
4289
4300
  }).then(() => {
4290
4301
  setError(void 0);
4291
4302
  return true;
@@ -4488,7 +4499,7 @@ function CollectionEditorInternal({
4488
4499
  } = formController;
4489
4500
  const usedPath = getTableName(values_1);
4490
4501
  const pathError_0 = validatePath(usedPath, isNewCollection, existingPaths, values_1.slug);
4491
- const parentPaths = !pathError_0 && parentCollectionIds ? collectionRegistry.convertIdsToPaths(parentCollectionIds) : void 0;
4502
+ const parentPaths = !pathError_0 && parentCollectionSlugs ? collectionRegistry.convertIdsToPaths(parentCollectionSlugs) : void 0;
4492
4503
  const updatedFullPath = parentPaths && parentPaths.length > 0 ? [...parentPaths, usedPath].join("/fake_id/") : path?.includes("/") ? path.split("/").slice(0, -1).join("/") + "/" + usedPath : usedPath;
4493
4504
  const resolvedPath = !pathError_0 ? urlController.resolveDatabasePathsFrom(updatedFullPath) : void 0;
4494
4505
  const getDataWithPath = resolvedPath && getData ? async () => {
@@ -4555,9 +4566,9 @@ function CollectionEditorInternal({
4555
4566
  aiModifiedPaths.addModifiedPaths(operations);
4556
4567
  }
4557
4568
  };
4558
- return /* @__PURE__ */ jsxs("div", { className: "h-full w-full flex flex-col bg-white dark:bg-surface-800", children: [
4569
+ return /* @__PURE__ */ jsxs("div", { className: "h-full w-full flex flex-col bg-white dark:bg-surface-950", children: [
4559
4570
  /* @__PURE__ */ jsx(Formex, { value: formController, children: /* @__PURE__ */ jsxs(Fragment, { children: [
4560
- !isNewCollection && /* @__PURE__ */ jsxs("div", { className: cls("px-4 py-2 w-full flex shrink-0 items-center justify-between gap-4 bg-white dark:bg-surface-800 border-b", defaultBorderMixin), children: [
4571
+ !isNewCollection && /* @__PURE__ */ jsxs("div", { className: cls("px-4 py-2 w-full flex shrink-0 items-center justify-between gap-4 bg-surface-50 dark:bg-surface-950 border-b", defaultBorderMixin), children: [
4561
4572
  /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center justify-end gap-4 min-w-0", children: /* @__PURE__ */ jsxs(Tabs, { value: currentView, className: "bg-transparent !w-fit max-w-full", onValueChange: (v) => setCurrentView(v), children: [
4562
4573
  /* @__PURE__ */ jsx(Tab, { value: "general", children: "General" }),
4563
4574
  /* @__PURE__ */ jsx(Tab, { value: "display", children: "Display" }),
@@ -4606,7 +4617,7 @@ function CollectionEditorInternal({
4606
4617
  currentView === "display" && /* @__PURE__ */ jsx(DisplaySettingsForm, { expandKanban }),
4607
4618
  currentView === "relations" && getDataSourceCapabilities(values_1.driver).supportsRelations && /* @__PURE__ */ jsx(CollectionRelationsTab, {}),
4608
4619
  currentView === "rls" && getDataSourceCapabilities(values_1.driver).supportsRLS && /* @__PURE__ */ jsx(CollectionRLSTab, {}),
4609
- currentView === "properties" && /* @__PURE__ */ jsx(CollectionPropertiesEditorForm, { showErrors: submitCount > 0, isNewCollection, reservedGroups, onPropertyError: (propertyKey, namespace, error_0) => {
4620
+ currentView === "properties" && /* @__PURE__ */ jsx(CollectionPropertiesEditorForm, { showErrors: submitCount > 0, isNewCollection, onPropertyError: (propertyKey, namespace, error_0) => {
4610
4621
  const current = removeUndefined({
4611
4622
  ...propertyErrorsRef.current,
4612
4623
  [getFullIdPath(propertyKey, namespace)]: removeUndefined(error_0, true)
@@ -4615,7 +4626,7 @@ function CollectionEditorInternal({
4615
4626
  formController.validate();
4616
4627
  }, getUser, getData: getDataWithPath, doCollectionInference, propertyConfigs, extraIcon: extraView?.icon && /* @__PURE__ */ jsx(IconButton, { color: "primary", onClick: () => setCurrentView("extra_view"), children: extraView.icon }) })
4617
4628
  ] }),
4618
- (!fullScreen || isNewCollection || !!error) && /* @__PURE__ */ jsxs("div", { className: "shrink-0 w-full p-4 sm:px-6 sm:py-4 border-t border-surface-200 dark:border-surface-800 flex items-center justify-between gap-4 bg-white dark:bg-surface-800", children: [
4629
+ (!fullScreen || isNewCollection || !!error) && /* @__PURE__ */ jsxs("div", { className: "shrink-0 w-full p-4 sm:px-6 sm:py-4 border-t border-surface-200 dark:border-surface-900 flex items-center justify-between gap-4 bg-white dark:bg-surface-950", children: [
4619
4630
  error && /* @__PURE__ */ jsx(ErrorView, { error }),
4620
4631
  isNewCollection && includeTemplates && currentView === "import_data_mapping" && /* @__PURE__ */ jsx(Button, { variant: "text", type: "button", onClick: () => {
4621
4632
  importConfig.setInUse(false);
@@ -4637,7 +4648,7 @@ function CollectionEditorInternal({
4637
4648
  isNewCollection && currentView === "import_data_preview" && /* @__PURE__ */ jsx(Button, { variant: "filled", color: "primary", onClick: () => {
4638
4649
  setNextMode();
4639
4650
  }, children: "Next" }),
4640
- isNewCollection && (currentView === "general" || currentView === "properties") && /* @__PURE__ */ jsxs(LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, disabled: isSubmitting || currentView === "general" && !validValues, startIcon: currentView === "properties" ? /* @__PURE__ */ jsx(CheckIcon, {}) : void 0, children: [
4651
+ isNewCollection && (currentView === "general" || currentView === "properties") && /* @__PURE__ */ jsxs(LoadingButton, { variant: "filled", color: "primary", type: "submit", loading: isSubmitting, disabled: isSubmitting || currentView === "general" && !validValues || configController?.readOnly, startIcon: currentView === "properties" ? /* @__PURE__ */ jsx(CheckIcon, {}) : void 0, children: [
4641
4652
  currentView === "general" && "Next",
4642
4653
  currentView === "properties" && "Create collection"
4643
4654
  ] }),
@@ -4717,4 +4728,4 @@ export {
4717
4728
  CollectionEditor,
4718
4729
  CollectionEditorDialog
4719
4730
  };
4720
- //# sourceMappingURL=CollectionEditorDialog-B2M9lCyL.js.map
4731
+ //# sourceMappingURL=CollectionEditorDialog-MbvXGzEq.js.map