@rebasepro/admin 0.2.3 → 0.2.5

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 (225) hide show
  1. package/dist/{CollectionEditorDialog-CmGXXSY9.js → CollectionEditorDialog-Cn8-tGyL.js} +89 -79
  2. package/dist/CollectionEditorDialog-Cn8-tGyL.js.map +1 -0
  3. package/dist/{CollectionsStudioView-DcLHT5bU.js → CollectionsStudioView-C-Ts1rZt.js} +5 -4
  4. package/dist/{CollectionsStudioView-DcLHT5bU.js.map → CollectionsStudioView-C-Ts1rZt.js.map} +1 -1
  5. package/dist/{ExportCollectionAction-BfN34eWX.js → ExportCollectionAction-BRdKM3DF.js} +4 -3
  6. package/dist/ExportCollectionAction-BRdKM3DF.js.map +1 -0
  7. package/dist/{ImportCollectionAction-SZrInjhx.js → ImportCollectionAction-U-v7lGxO.js} +3 -2
  8. package/dist/{ImportCollectionAction-SZrInjhx.js.map → ImportCollectionAction-U-v7lGxO.js.map} +1 -1
  9. package/dist/{PropertyEditView-Cvryrb3B.js → PropertyEditView-BDNYkfNf.js} +128 -121
  10. package/dist/PropertyEditView-BDNYkfNf.js.map +1 -0
  11. package/dist/collection_editor/ConfigControllerProvider.d.ts +0 -5
  12. package/dist/collection_editor/index.d.ts +0 -1
  13. package/dist/collection_editor/types/collection_editor_controller.d.ts +0 -2
  14. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +3 -3
  15. package/dist/collection_editor_ui.js +3 -3
  16. package/dist/components/ArrayContainer.d.ts +2 -2
  17. package/dist/components/DefaultAppBar.d.ts +18 -1
  18. package/dist/components/DefaultDrawer.d.ts +51 -3
  19. package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
  20. package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +2 -2
  21. package/dist/components/EntityCollectionTable/table_bindings.d.ts +4 -3
  22. package/dist/components/EntityCollectionView/hooks/useKanbanDragAndDrop.d.ts +4 -3
  23. package/dist/components/EntityEditView.d.ts +2 -1
  24. package/dist/components/HomePage/HomePageDnD.d.ts +3 -3
  25. package/dist/components/PropertyCollectionView.d.ts +1 -1
  26. package/dist/components/PropertyIdCopyTooltip.d.ts +1 -1
  27. package/dist/components/RebaseRouteDefs.d.ts +1 -1
  28. package/dist/components/SelectableTable/SelectionStore.d.ts +4 -1
  29. package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -2
  30. package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -2
  31. package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -2
  32. package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -2
  33. package/dist/components/admin/index.d.ts +1 -3
  34. package/dist/components/app/Drawer.d.ts +8 -1
  35. package/dist/data_export/export/export.d.ts +3 -3
  36. package/dist/editor/components/editor-bubble.d.ts +5 -1
  37. package/dist/editor/components/image-bubble.d.ts +5 -1
  38. package/dist/editor/components/index.d.ts +3 -3
  39. package/dist/editor/components/table-bubble.d.ts +5 -1
  40. package/dist/editor/nodeViews/ReactNodeView.d.ts +4 -1
  41. package/dist/editor/useProseMirror.d.ts +2 -2
  42. package/dist/editor/utils/remove_classes.d.ts +1 -1
  43. package/dist/editor.js +15 -14
  44. package/dist/editor.js.map +1 -1
  45. package/dist/form/EntityForm.d.ts +2 -2
  46. package/dist/form/components/StorageUploadProgress.d.ts +2 -2
  47. package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +1 -1
  48. package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +1 -1
  49. package/dist/form/validation.d.ts +3 -3
  50. package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +1 -1
  51. package/dist/hooks/navigation/useResolvedCollections.d.ts +6 -0
  52. package/dist/hooks/navigation/useResolvedViews.d.ts +3 -7
  53. package/dist/{index-DjduZG1T.js → index-DHaOV-7A.js} +3 -3
  54. package/dist/index-DHaOV-7A.js.map +1 -0
  55. package/dist/{index-MKPc70-v.js → index-DJSL_SCr.js} +3 -3
  56. package/dist/index-DJSL_SCr.js.map +1 -0
  57. package/dist/{index-PLIQXpTt.js → index-XMII4H3d.js} +3 -2
  58. package/dist/{index-PLIQXpTt.js.map → index-XMII4H3d.js.map} +1 -1
  59. package/dist/index.d.ts +1 -3
  60. package/dist/index.js +2688 -452
  61. package/dist/index.js.map +1 -1
  62. package/dist/{markdown-z2Ir7Cgo.js → markdown-DD2JDU1X.js} +2 -2
  63. package/dist/markdown-DD2JDU1X.js.map +1 -0
  64. package/dist/preview/components/UrlComponentPreview.d.ts +1 -0
  65. package/dist/types/components/EntityFormActionsProps.d.ts +1 -1
  66. package/dist/types/components/EntityFormProps.d.ts +2 -2
  67. package/dist/types/fields.d.ts +1 -1
  68. package/dist/{util-DbWax_sV.js → util-0GYaJqL_.js} +1505 -2043
  69. package/dist/util-0GYaJqL_.js.map +1 -0
  70. package/package.json +8 -8
  71. package/src/collection_editor/ConfigControllerProvider.tsx +3 -13
  72. package/src/collection_editor/index.ts +1 -3
  73. package/src/collection_editor/pgColumnToProperty.ts +19 -2
  74. package/src/collection_editor/types/collection_editor_controller.tsx +0 -3
  75. package/src/collection_editor/ui/EditorCollectionAction.tsx +1 -6
  76. package/src/collection_editor/ui/EditorCollectionActionStart.tsx +1 -6
  77. package/src/collection_editor/ui/EditorEntityAction.tsx +1 -6
  78. package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +7 -14
  79. package/src/collection_editor/ui/NewCollectionCard.tsx +1 -5
  80. package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +3 -8
  81. package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +8 -12
  82. package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +21 -21
  83. package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +4 -4
  84. package/src/collection_editor/ui/collection_editor/EnumForm.tsx +1 -1
  85. package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +3 -3
  86. package/src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx +3 -3
  87. package/src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx +8 -8
  88. package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +5 -5
  89. package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +2 -2
  90. package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +5 -5
  91. package/src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx +5 -5
  92. package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +2 -2
  93. package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +2 -2
  94. package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +8 -8
  95. package/src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx +5 -5
  96. package/src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx +3 -2
  97. package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +2 -2
  98. package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +2 -2
  99. package/src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +1 -1
  100. package/src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +4 -7
  101. package/src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +4 -4
  102. package/src/components/ArrayContainer.tsx +3 -3
  103. package/src/components/DefaultAppBar.tsx +52 -31
  104. package/src/components/DefaultDrawer.tsx +280 -67
  105. package/src/components/DrawerNavigationItem.tsx +1 -1
  106. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +6 -5
  107. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +9 -7
  108. package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +5 -5
  109. package/src/components/EntityCollectionTable/fields/VirtualTableNumberInput.tsx +12 -9
  110. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +2 -2
  111. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -1
  112. package/src/components/EntityCollectionTable/table_bindings.tsx +5 -4
  113. package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +4 -4
  114. package/src/components/EntityCollectionView/EntityCollectionListView.tsx +7 -0
  115. package/src/components/EntityCollectionView/EntityCollectionView.tsx +10 -5
  116. package/src/components/EntityCollectionView/hooks/useCollectionInlineEditor.ts +1 -1
  117. package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +7 -6
  118. package/src/components/EntityDetailView.tsx +46 -24
  119. package/src/components/EntityEditView.tsx +51 -28
  120. package/src/components/EntityEditViewFormActions.tsx +4 -4
  121. package/src/components/EntityPreview.tsx +9 -4
  122. package/src/components/HomePage/HomePageDnD.tsx +3 -2
  123. package/src/components/PropertyCollectionView.tsx +1 -1
  124. package/src/components/PropertyIdCopyTooltip.tsx +1 -1
  125. package/src/components/RebaseLayout.tsx +5 -1
  126. package/src/components/RebaseNavigation.tsx +2 -2
  127. package/src/components/RebaseRouteDefs.tsx +6 -11
  128. package/src/components/RebaseShell.tsx +16 -13
  129. package/src/components/SearchIconsView.tsx +1 -8
  130. package/src/components/SelectableTable/SelectableTable.tsx +8 -11
  131. package/src/components/SelectableTable/SelectionStore.ts +1 -1
  132. package/src/components/SelectableTable/filters/BooleanFilterField.tsx +3 -3
  133. package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +3 -3
  134. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +5 -5
  135. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +3 -3
  136. package/src/components/SideEntityProvider.tsx +2 -1
  137. package/src/components/admin/index.ts +1 -3
  138. package/src/components/app/Drawer.tsx +9 -1
  139. package/src/components/app/Scaffold.tsx +5 -1
  140. package/src/components/index.ts +1 -3
  141. package/src/data_export/export/export.ts +17 -17
  142. package/src/data_import/components/DataNewPropertiesMapping.tsx +1 -1
  143. package/src/editor/components/editor-bubble.tsx +32 -9
  144. package/src/editor/components/image-bubble.tsx +27 -11
  145. package/src/editor/components/index.ts +3 -3
  146. package/src/editor/components/table-bubble.tsx +79 -17
  147. package/src/editor/extensions/HighlightDecorationExtension.ts +3 -2
  148. package/src/editor/nodeViews/ReactNodeView.tsx +1 -1
  149. package/src/editor/nodeViews/TaskItemComponent.tsx +9 -8
  150. package/src/editor/schema.ts +135 -59
  151. package/src/editor/selectors/link-selector.tsx +8 -5
  152. package/src/editor/useProseMirror.ts +2 -2
  153. package/src/editor/utils/remove_classes.ts +6 -5
  154. package/src/form/EntityForm.tsx +15 -15
  155. package/src/form/EntityFormActions.tsx +2 -2
  156. package/src/form/PropertyFieldBinding.tsx +64 -64
  157. package/src/form/components/FieldHelperText.tsx +4 -4
  158. package/src/form/components/StorageUploadProgress.tsx +2 -2
  159. package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +1 -1
  160. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +1 -1
  161. package/src/form/field_bindings/BlockFieldBinding.tsx +54 -53
  162. package/src/form/field_bindings/KeyValueFieldBinding.tsx +290 -289
  163. package/src/form/field_bindings/MapFieldBinding.tsx +2 -2
  164. package/src/form/field_bindings/MultiSelectFieldBinding.tsx +2 -2
  165. package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +1 -1
  166. package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +1 -1
  167. package/src/form/field_bindings/ReferenceFieldBinding.tsx +8 -6
  168. package/src/form/field_bindings/RelationFieldBinding.tsx +4 -4
  169. package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
  170. package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
  171. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +84 -84
  172. package/src/form/field_bindings/SwitchFieldBinding.tsx +16 -16
  173. package/src/form/field_bindings/TextFieldBinding.tsx +77 -73
  174. package/src/form/field_bindings/UserSelectFieldBinding.tsx +17 -17
  175. package/src/form/validation.ts +43 -43
  176. package/src/hooks/navigation/useBuildNavigationStateController.tsx +4 -7
  177. package/src/hooks/navigation/useResolvedCollections.ts +27 -7
  178. package/src/hooks/navigation/useResolvedViews.tsx +8 -70
  179. package/src/index.ts +4 -3
  180. package/src/preview/PropertyPreview.tsx +2 -2
  181. package/src/preview/components/ImagePreview.tsx +2 -1
  182. package/src/preview/components/UrlComponentPreview.tsx +11 -2
  183. package/src/preview/components/UserPreview.tsx +1 -1
  184. package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -2
  185. package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +4 -4
  186. package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +3 -3
  187. package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +3 -3
  188. package/src/preview/property_previews/ArrayOfStringsPreview.tsx +3 -2
  189. package/src/preview/property_previews/ArrayOneOfPreview.tsx +6 -8
  190. package/src/preview/property_previews/ArrayPropertyEnumPreview.tsx +1 -1
  191. package/src/preview/property_previews/ArrayPropertyPreview.tsx +3 -3
  192. package/src/preview/property_previews/MapPropertyPreview.tsx +4 -3
  193. package/src/preview/property_previews/NumberPropertyPreview.tsx +5 -3
  194. package/src/preview/property_previews/StringPropertyPreview.tsx +10 -8
  195. package/src/types/components/EntityFormActionsProps.tsx +1 -1
  196. package/src/types/components/EntityFormProps.tsx +2 -2
  197. package/src/types/fields.tsx +2 -2
  198. package/src/util/previews.ts +9 -1
  199. package/dist/CollectionEditorDialog-CmGXXSY9.js.map +0 -1
  200. package/dist/ContentHomePage-C7vFqKSe.js +0 -1784
  201. package/dist/ContentHomePage-C7vFqKSe.js.map +0 -1
  202. package/dist/ExportCollectionAction-BfN34eWX.js.map +0 -1
  203. package/dist/PropertyEditView-Cvryrb3B.js.map +0 -1
  204. package/dist/RoleChip-QtUFXeTp.js +0 -67
  205. package/dist/RoleChip-QtUFXeTp.js.map +0 -1
  206. package/dist/RolesView-BCb7qwWs.js +0 -437
  207. package/dist/RolesView-BCb7qwWs.js.map +0 -1
  208. package/dist/UsersView-Cex24r8H.js +0 -408
  209. package/dist/UsersView-Cex24r8H.js.map +0 -1
  210. package/dist/collection_editor/types/config_permissions.d.ts +0 -19
  211. package/dist/components/admin/RoleChip.d.ts +0 -4
  212. package/dist/components/admin/RolesFilterSelect.d.ts +0 -2
  213. package/dist/components/admin/RolesView.d.ts +0 -4
  214. package/dist/components/admin/UserRolesSelectField.d.ts +0 -2
  215. package/dist/components/admin/UsersView.d.ts +0 -4
  216. package/dist/index-DjduZG1T.js.map +0 -1
  217. package/dist/index-MKPc70-v.js.map +0 -1
  218. package/dist/markdown-z2Ir7Cgo.js.map +0 -1
  219. package/dist/util-DbWax_sV.js.map +0 -1
  220. package/src/collection_editor/types/config_permissions.ts +0 -20
  221. package/src/components/admin/RoleChip.tsx +0 -23
  222. package/src/components/admin/RolesFilterSelect.tsx +0 -45
  223. package/src/components/admin/RolesView.tsx +0 -465
  224. package/src/components/admin/UserRolesSelectField.tsx +0 -50
  225. package/src/components/admin/UsersView.tsx +0 -687
@@ -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 { bi as useCollectionsConfigController, J as FieldCaption, ad as SearchIconsView, aL as getFieldConfig, $ as PropertyConfigBadge, aN as getFullId, aV as idToPropertiesPath, aZ as namespaceToPropertiesOrderPath, bu as validateCollectionJson, bh as useCollectionRegistryController, C as CollectionGenerationApiError, bg as useCollectionEditorController, O as ImportFileUpload, aR as getInferenceType, P as ImportNewPropertyFieldPreview, p as DataNewPropertiesMapping, aM as getFieldId, bp as useSelectionController, ay as convertDataToEntity, w as EntityCollectionTable, bm as useNavigationStateController, bk as useImportConfig, bt as useUrlController, Q as ImportSaveInProgress, aO as getFullIdPath } from "./util-DbWax_sV.js";
4
+ import { bm as useCollectionsConfigController, N as FieldCaption, ag as SearchIconsView, aO as getFieldConfig, a4 as PropertyConfigBadge, aQ as getFullId, aY as idToPropertiesPath, b0 as namespaceToPropertiesOrderPath, by as validateCollectionJson, bl as useCollectionRegistryController, l as CollectionGenerationApiError, bk as useCollectionEditorController, S as ImportFileUpload, aU as getInferenceType, T as ImportNewPropertyFieldPreview, p as DataNewPropertiesMapping, aP as getFieldId, bt as useSelectionController, aB as convertDataToEntity, y as EntityCollectionTable, bq as useNavigationStateController, bo as useImportConfig, bx as useUrlController, U as ImportSaveInProgress, aR as getFullIdPath } from "./util-0GYaJqL_.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, ColumnsIcon, SquareIcon, PanelLeftIcon, AppWindow, ToggleButtonGroup, ListIcon, TableIcon, LayoutGridIcon, KanbanIcon, Select, SelectItem, XIcon, iconSize, Button, BooleanSwitchWithLabel, DialogTitle, DialogContent, CopyIcon, DialogActions, CircularProgress, FileSearchIcon, PlusIcon, ErrorBoundary, defaultBorderMixin, CodeIcon, Alert, Menu, ShoppingCartIcon, UserIcon, FileTextIcon, FileIcon, Card, CircularProgressCenter, Paper, KeyIcon, Trash2Icon, MultiSelect, MultiSelectItem, coolIconKeys, Tabs, Tab, LoadingButton, ArrowLeftIcon, CheckIcon } from "@rebasepro/ui";
@@ -21,7 +21,8 @@ import "exceljs";
21
21
  import { buildPropertyFromData, buildEntityPropertiesFromData } from "@rebasepro/schema-inference";
22
22
  import "date-fns";
23
23
  import "date-fns/locale";
24
- import { b as PropertyFormDialog, d as useAIModifiedPaths, c as PropertyTree, a as PropertyForm, s as supportedFields, u as updatePropertyFromWidget, A as AIModifiedPathsProvider } from "./PropertyEditView-Cvryrb3B.js";
24
+ import "fuse.js";
25
+ import { b as PropertyFormDialog, d as useAIModifiedPaths, c as PropertyTree, a as PropertyForm, s as supportedFields, u as updatePropertyFromWidget, A as AIModifiedPathsProvider } from "./PropertyEditView-BDNYkfNf.js";
25
26
  import JSON5 from "json5";
26
27
  import { Highlight, themes } from "prism-react-renderer";
27
28
  const CollectionEditorSchema = z.object({
@@ -1192,8 +1193,8 @@ function CollectionPropertiesEditorForm({
1192
1193
  const newProp = newProps[key];
1193
1194
  if (!existingProp) {
1194
1195
  keys.push(fullKey);
1195
- } else if (typeof newProp === "object" && "type" in newProp && newProp.dataType === "map" && newProp.properties) {
1196
- const existingMapProps = typeof existingProp === "object" && "type" in existingProp && existingProp.dataType === "map" ? existingProp.properties : void 0;
1196
+ } else if (typeof newProp === "object" && "type" in newProp && newProp.type === "map" && newProp.properties) {
1197
+ const existingMapProps = typeof existingProp === "object" && "type" in existingProp && existingProp.type === "map" ? existingProp.properties : void 0;
1197
1198
  keys.push(...findNewPropertyKeys(existingMapProps, newProp.properties, fullKey));
1198
1199
  }
1199
1200
  }
@@ -1210,7 +1211,7 @@ function CollectionPropertiesEditorForm({
1210
1211
  const newProp_0 = newProps_0[key_0];
1211
1212
  if (!existingProp_0) {
1212
1213
  result[key_0] = newProp_0;
1213
- } else if (typeof existingProp_0 === "object" && "type" in existingProp_0 && existingProp_0.dataType === "map" && typeof newProp_0 === "object" && "type" in newProp_0 && newProp_0.dataType === "map" && newProp_0.properties) {
1214
+ } else if (typeof existingProp_0 === "object" && "type" in existingProp_0 && existingProp_0.type === "map" && typeof newProp_0 === "object" && "type" in newProp_0 && newProp_0.type === "map" && newProp_0.properties) {
1214
1215
  const existingMapProps_0 = existingProp_0.properties;
1215
1216
  if (existingMapProps_0) {
1216
1217
  result[key_0] = {
@@ -1373,7 +1374,7 @@ function CollectionPropertiesEditorForm({
1373
1374
  /* @__PURE__ */ jsx(Button, { className: "mt-4 xl:mt-8 w-full", variant: "filled", color: "neutral", disabled: configController?.readOnly, onClick: () => setNewPropertyDialogOpen(true), startIcon: /* @__PURE__ */ jsx(PlusIcon, {}), children: "Add new property" })
1374
1375
  ] }),
1375
1376
  !asDialog && /* @__PURE__ */ jsx("div", { className: "col-span-12 lg:col-span-7 p-4 md:py-8 md:px-4 h-full overflow-auto", children: /* @__PURE__ */ jsxs("div", { className: "sticky top-8 min-h-full w-full flex flex-col justify-center", children: [
1376
- selectedPropertyFullId && selectedProperty && !isPropertyBuilder(selectedProperty) && /* @__PURE__ */ jsx(PropertyForm, { inArray: false, existingProperty: !isNewCollection, autoUpdateId: false, allowDataInference: !isNewCollection, autoOpenTypeSelect: false, propertyKey: selectedPropertyKey, propertyNamespace: selectedPropertyNamespace, property: selectedProperty, onPropertyChanged, onDelete: deleteProperty, onError: onPropertyErrorInternal, forceShowErrors: showErrors, initialErrors, getData, propertyConfigs }, `edit_view_${selectedPropertyIndex}_${generationCounter}`),
1377
+ selectedPropertyFullId && !!selectedProperty && !isPropertyBuilder(selectedProperty) && /* @__PURE__ */ jsx(PropertyForm, { inArray: false, existingProperty: !isNewCollection, autoUpdateId: false, allowDataInference: !isNewCollection, autoOpenTypeSelect: false, propertyKey: selectedPropertyKey, propertyNamespace: selectedPropertyNamespace, property: selectedProperty, onPropertyChanged, onDelete: deleteProperty, onError: onPropertyErrorInternal, forceShowErrors: showErrors, initialErrors, getData, propertyConfigs }, `edit_view_${selectedPropertyIndex}_${generationCounter}`),
1377
1378
  !selectedProperty && /* @__PURE__ */ jsxs("div", { className: "w-full flex flex-col items-center justify-center h-full gap-4", children: [
1378
1379
  /* @__PURE__ */ jsx(Typography, { variant: "label", className: "", children: emptyCollection ? "Now you can add your first property" : "Select a property to edit it" }),
1379
1380
  /* @__PURE__ */ jsxs(Button, { disabled: configController?.readOnly, onClick: () => setNewPropertyDialogOpen(true), children: [
@@ -1381,7 +1382,7 @@ function CollectionPropertiesEditorForm({
1381
1382
  "Add new property"
1382
1383
  ] })
1383
1384
  ] }),
1384
- selectedProperty && isPropertyBuilder(selectedProperty) && /* @__PURE__ */ jsx(Typography, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
1385
+ !!selectedProperty && isPropertyBuilder(selectedProperty) && /* @__PURE__ */ jsx(Typography, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
1385
1386
  ] }) }),
1386
1387
  asDialog && /* @__PURE__ */ jsx(PropertyFormDialog, { inArray: false, open: selectedPropertyIndex !== void 0, autoUpdateId: !selectedProperty, allowDataInference: !isNewCollection, existingProperty: true, autoOpenTypeSelect: false, propertyKey: selectedPropertyKey, propertyNamespace: selectedPropertyNamespace, property: selectedProperty, onPropertyChanged, onDelete: deleteProperty, onError: onPropertyErrorInternal, forceShowErrors: showErrors, initialErrors, getData, propertyConfigs, onCancel: closePropertyDialog, onOkClicked: asDialog ? closePropertyDialog : void 0 }, `edit_view_${selectedPropertyIndex}_${generationCounter}`)
1387
1388
  ] });
@@ -1413,7 +1414,7 @@ const EXAMPLE_JSON = `{
1413
1414
  }
1414
1415
  }`;
1415
1416
  function CollectionJsonImportDialog(t0) {
1416
- const $ = c(46);
1417
+ const $ = c(44);
1417
1418
  const {
1418
1419
  open,
1419
1420
  onClose,
@@ -1548,105 +1549,97 @@ function CollectionJsonImportDialog(t0) {
1548
1549
  } else {
1549
1550
  t11 = $[18];
1550
1551
  }
1551
- const t12 = errors.length > 0 && touched ? "border-red-500 dark:border-red-400" : "border-surface-300 dark:border-surface-600";
1552
+ const t12 = errors.length > 0 && touched;
1552
1553
  let t13;
1553
- if ($[19] !== t12) {
1554
- t13 = cls("w-full p-3 font-mono text-sm rounded-md border resize-none overflow-y-auto", "bg-surface-50 dark:bg-surface-800", "focus:outline-none focus:ring-2 focus:ring-primary", "h-[300px]", t12);
1555
- $[19] = t12;
1556
- $[20] = t13;
1554
+ if ($[19] !== jsonValue || $[20] !== t12) {
1555
+ t13 = /* @__PURE__ */ jsx(TextField, { multiline: true, minRows: 12, value: jsonValue, onChange: handleJsonChange, placeholder: EXAMPLE_JSON, error: t12, className: "w-full", inputClassName: "font-mono text-sm resize-none overflow-y-auto h-[300px]" });
1556
+ $[19] = jsonValue;
1557
+ $[20] = t12;
1558
+ $[21] = t13;
1557
1559
  } else {
1558
- t13 = $[20];
1560
+ t13 = $[21];
1559
1561
  }
1560
1562
  let t14;
1561
- if ($[21] !== jsonValue || $[22] !== t13) {
1562
- t14 = /* @__PURE__ */ jsx("textarea", { value: jsonValue, onChange: handleJsonChange, placeholder: EXAMPLE_JSON, rows: 12, className: t13 });
1563
- $[21] = jsonValue;
1564
- $[22] = t13;
1565
- $[23] = t14;
1566
- } else {
1567
- t14 = $[23];
1568
- }
1569
- let t15;
1570
- if ($[24] !== errors || $[25] !== touched) {
1571
- t15 = errors.length > 0 && touched && /* @__PURE__ */ jsxs(Alert, { color: "error", children: [
1563
+ if ($[22] !== errors || $[23] !== touched) {
1564
+ t14 = errors.length > 0 && touched && /* @__PURE__ */ jsxs(Alert, { color: "error", children: [
1572
1565
  /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "font-medium mb-2", children: "Validation errors:" }),
1573
1566
  /* @__PURE__ */ jsx("ul", { className: "list-disc list-inside space-y-1", children: errors.map(_temp$3) })
1574
1567
  ] });
1575
- $[24] = errors;
1576
- $[25] = touched;
1568
+ $[22] = errors;
1569
+ $[23] = touched;
1570
+ $[24] = t14;
1571
+ } else {
1572
+ t14 = $[24];
1573
+ }
1574
+ let t15;
1575
+ if ($[25] !== isValid) {
1576
+ t15 = isValid && /* @__PURE__ */ jsx(Alert, { color: "success", children: /* @__PURE__ */ jsx(Typography, { variant: "body2", children: "✓ JSON is valid and ready to import" }) });
1577
+ $[25] = isValid;
1577
1578
  $[26] = t15;
1578
1579
  } else {
1579
1580
  t15 = $[26];
1580
1581
  }
1581
1582
  let t16;
1582
- if ($[27] !== isValid) {
1583
- t16 = isValid && /* @__PURE__ */ jsx(Alert, { color: "success", children: /* @__PURE__ */ jsx(Typography, { variant: "body2", children: "✓ JSON is valid and ready to import" }) });
1584
- $[27] = isValid;
1585
- $[28] = t16;
1586
- } else {
1587
- t16 = $[28];
1588
- }
1589
- let t17;
1590
- if ($[29] !== t14 || $[30] !== t15 || $[31] !== t16) {
1591
- t17 = /* @__PURE__ */ jsxs(DialogContent, { className: "flex flex-col gap-4", children: [
1583
+ if ($[27] !== t13 || $[28] !== t14 || $[29] !== t15) {
1584
+ t16 = /* @__PURE__ */ jsxs(DialogContent, { className: "flex flex-col gap-4", children: [
1592
1585
  t11,
1586
+ t13,
1593
1587
  t14,
1594
- t15,
1595
- t16
1588
+ t15
1596
1589
  ] });
1597
- $[29] = t14;
1598
- $[30] = t15;
1599
- $[31] = t16;
1590
+ $[27] = t13;
1591
+ $[28] = t14;
1592
+ $[29] = t15;
1593
+ $[30] = t16;
1594
+ } else {
1595
+ t16 = $[30];
1596
+ }
1597
+ let t17;
1598
+ if ($[31] !== handleClose) {
1599
+ t17 = /* @__PURE__ */ jsx(Button, { variant: "text", onClick: handleClose, children: "Cancel" });
1600
+ $[31] = handleClose;
1600
1601
  $[32] = t17;
1601
1602
  } else {
1602
1603
  t17 = $[32];
1603
1604
  }
1604
- let t18;
1605
- if ($[33] !== handleClose) {
1606
- t18 = /* @__PURE__ */ jsx(Button, { variant: "text", onClick: handleClose, children: "Cancel" });
1607
- $[33] = handleClose;
1605
+ const t18 = !isValid;
1606
+ let t19;
1607
+ if ($[33] !== handleImport || $[34] !== t18) {
1608
+ t19 = /* @__PURE__ */ jsx(Button, { variant: "filled", color: "primary", onClick: handleImport, disabled: t18, children: "Import Collection" });
1609
+ $[33] = handleImport;
1608
1610
  $[34] = t18;
1611
+ $[35] = t19;
1609
1612
  } else {
1610
- t18 = $[34];
1613
+ t19 = $[35];
1611
1614
  }
1612
- const t19 = !isValid;
1613
1615
  let t20;
1614
- if ($[35] !== handleImport || $[36] !== t19) {
1615
- t20 = /* @__PURE__ */ jsx(Button, { variant: "filled", color: "primary", onClick: handleImport, disabled: t19, children: "Import Collection" });
1616
- $[35] = handleImport;
1617
- $[36] = t19;
1618
- $[37] = t20;
1619
- } else {
1620
- t20 = $[37];
1621
- }
1622
- let t21;
1623
- if ($[38] !== t18 || $[39] !== t20) {
1624
- t21 = /* @__PURE__ */ jsxs(DialogActions, { children: [
1625
- t18,
1626
- t20
1616
+ if ($[36] !== t17 || $[37] !== t19) {
1617
+ t20 = /* @__PURE__ */ jsxs(DialogActions, { children: [
1618
+ t17,
1619
+ t19
1627
1620
  ] });
1628
- $[38] = t18;
1629
- $[39] = t20;
1630
- $[40] = t21;
1621
+ $[36] = t17;
1622
+ $[37] = t19;
1623
+ $[38] = t20;
1631
1624
  } else {
1632
- t21 = $[40];
1625
+ t20 = $[38];
1633
1626
  }
1634
- let t22;
1635
- if ($[41] !== open || $[42] !== t17 || $[43] !== t21 || $[44] !== t6) {
1636
- t22 = /* @__PURE__ */ jsxs(Dialog, { open, onOpenChange: t6, maxWidth: "2xl", children: [
1627
+ let t21;
1628
+ if ($[39] !== open || $[40] !== t16 || $[41] !== t20 || $[42] !== t6) {
1629
+ t21 = /* @__PURE__ */ jsxs(Dialog, { open, onOpenChange: t6, maxWidth: "2xl", children: [
1637
1630
  t7,
1638
- t17,
1639
- t21
1631
+ t16,
1632
+ t20
1640
1633
  ] });
1641
- $[41] = open;
1642
- $[42] = t17;
1634
+ $[39] = open;
1635
+ $[40] = t16;
1636
+ $[41] = t20;
1637
+ $[42] = t6;
1643
1638
  $[43] = t21;
1644
- $[44] = t6;
1645
- $[45] = t22;
1646
1639
  } else {
1647
- t22 = $[45];
1640
+ t21 = $[43];
1648
1641
  }
1649
- return t22;
1642
+ return t21;
1650
1643
  }
1651
1644
  function _temp$3(error, index) {
1652
1645
  return /* @__PURE__ */ jsx("li", { className: "text-sm", children: error.path ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -3800,14 +3793,31 @@ function pgTypeToRebaseProperty(column) {
3800
3793
  properties: {}
3801
3794
  };
3802
3795
  case "array":
3803
- case "ARRAY":
3796
+ case "ARRAY": {
3797
+ let innerType = "string";
3798
+ let colType = void 0;
3799
+ if (udt_name === "_text" || udt_name === "_varchar") {
3800
+ innerType = "string";
3801
+ colType = "text[]";
3802
+ } else if (udt_name === "_int4" || udt_name === "_int2" || udt_name === "_int8") {
3803
+ innerType = "number";
3804
+ colType = "integer[]";
3805
+ } else if (udt_name === "_bool") {
3806
+ innerType = "boolean";
3807
+ colType = "boolean[]";
3808
+ } else if (udt_name === "_numeric") {
3809
+ innerType = "number";
3810
+ colType = "numeric[]";
3811
+ }
3804
3812
  return {
3805
3813
  type: "array",
3806
3814
  name: prettifiedName,
3815
+ columnType: colType,
3807
3816
  of: {
3808
- type: "string"
3817
+ type: innerType
3809
3818
  }
3810
3819
  };
3820
+ }
3811
3821
  default:
3812
3822
  return {
3813
3823
  type: "string",
@@ -4561,4 +4571,4 @@ export {
4561
4571
  CollectionEditor,
4562
4572
  CollectionEditorDialog
4563
4573
  };
4564
- //# sourceMappingURL=CollectionEditorDialog-CmGXXSY9.js.map
4574
+ //# sourceMappingURL=CollectionEditorDialog-Cn8-tGyL.js.map