@rebasepro/admin 0.1.2 → 0.2.3

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 (243) hide show
  1. package/LICENSE +21 -6
  2. package/dist/{CollectionEditorDialog-ywdxhs1L.js → CollectionEditorDialog-CmGXXSY9.js} +42 -209
  3. package/dist/CollectionEditorDialog-CmGXXSY9.js.map +1 -0
  4. package/dist/{CollectionsStudioView-BDzMFzqH.js → CollectionsStudioView-DcLHT5bU.js} +6 -8
  5. package/dist/CollectionsStudioView-DcLHT5bU.js.map +1 -0
  6. package/dist/{ContentHomePage-0tHuEIm_.js → ContentHomePage-C7vFqKSe.js} +5 -7
  7. package/dist/ContentHomePage-C7vFqKSe.js.map +1 -0
  8. package/dist/{ExportCollectionAction-BIrq92To.js → ExportCollectionAction-BfN34eWX.js} +36 -38
  9. package/dist/ExportCollectionAction-BfN34eWX.js.map +1 -0
  10. package/dist/{ImportCollectionAction-h8yg_To8.js → ImportCollectionAction-SZrInjhx.js} +5 -7
  11. package/dist/ImportCollectionAction-SZrInjhx.js.map +1 -0
  12. package/dist/{PropertyEditView-BuZrNnBN.js → PropertyEditView-Cvryrb3B.js} +563 -489
  13. package/dist/PropertyEditView-Cvryrb3B.js.map +1 -0
  14. package/dist/{RolesView-CMPsaIXo.js → RolesView-BCb7qwWs.js} +22 -11
  15. package/dist/RolesView-BCb7qwWs.js.map +1 -0
  16. package/dist/{UsersView-BkeblMVT.js → UsersView-Cex24r8H.js} +7 -71
  17. package/dist/UsersView-Cex24r8H.js.map +1 -0
  18. package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +2 -2
  19. package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.d.ts +1 -7
  20. package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.d.ts +3 -0
  21. package/dist/collection_editor_ui.js +5 -5
  22. package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +1 -1
  23. package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +1 -1
  24. package/dist/components/EntityCollectionView/EntityCollectionListView.d.ts +18 -2
  25. package/dist/components/EntityCollectionView/FilterPresetsButton.d.ts +21 -0
  26. package/dist/components/EntityDetailView.d.ts +31 -0
  27. package/dist/components/EntityEditView.d.ts +3 -2
  28. package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +1 -1
  29. package/dist/components/admin/CreationResultDialog.d.ts +5 -0
  30. package/dist/components/admin/RolesFilterSelect.d.ts +2 -0
  31. package/dist/components/admin/UserRolesSelectField.d.ts +2 -0
  32. package/dist/components/common/default_entity_actions.d.ts +7 -1
  33. package/dist/components/field_configs.d.ts +1 -1
  34. package/dist/components/index.d.ts +1 -0
  35. package/dist/data_import/utils/data.d.ts +1 -1
  36. package/dist/data_import/utils/file_headers.d.ts +6 -1
  37. package/dist/data_import/utils/file_to_json.d.ts +1 -11
  38. package/dist/data_import/utils/transforms.d.ts +11 -0
  39. package/dist/editor.js +2 -4
  40. package/dist/editor.js.map +1 -1
  41. package/dist/form/EntityForm.d.ts +1 -1
  42. package/dist/form/field_bindings/RelationFieldBinding.d.ts +1 -1
  43. package/dist/form/field_bindings/VectorFieldBinding.d.ts +11 -0
  44. package/dist/form/index.d.ts +1 -0
  45. package/dist/hooks/navigation/useResolvedViews.d.ts +2 -1
  46. package/dist/{index-eRJbMvHi.js → index-DjduZG1T.js} +3 -3
  47. package/dist/index-DjduZG1T.js.map +1 -0
  48. package/dist/{index-BuZaHcyc.js → index-MKPc70-v.js} +3 -3
  49. package/dist/index-MKPc70-v.js.map +1 -0
  50. package/dist/{index-CS6uJ7oW.js → index-PLIQXpTt.js} +4 -6
  51. package/dist/index-PLIQXpTt.js.map +1 -0
  52. package/dist/index.d.ts +4 -1
  53. package/dist/index.js +352 -148
  54. package/dist/index.js.map +1 -1
  55. package/dist/types/components/EntityFormActionsProps.d.ts +1 -1
  56. package/dist/types/components/EntityFormProps.d.ts +2 -1
  57. package/dist/types/fields.d.ts +3 -3
  58. package/dist/util/navigation_utils.d.ts +1 -1
  59. package/dist/{util-zfU1zOCX.js → util-DbWax_sV.js} +5453 -2641
  60. package/dist/util-DbWax_sV.js.map +1 -0
  61. package/package.json +46 -39
  62. package/src/collection_editor/ConfigControllerProvider.tsx +1 -1
  63. package/src/collection_editor/ui/AddKanbanColumnAction.tsx +12 -2
  64. package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +1 -2
  65. package/src/collection_editor/ui/EditorCollectionAction.tsx +1 -2
  66. package/src/collection_editor/ui/EditorCollectionActionStart.tsx +1 -2
  67. package/src/collection_editor/ui/EditorEntityAction.tsx +1 -2
  68. package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +1 -2
  69. package/src/collection_editor/ui/NewCollectionButton.tsx +1 -2
  70. package/src/collection_editor/ui/NewCollectionCard.tsx +4 -6
  71. package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +1 -2
  72. package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +10 -2
  73. package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +18 -2
  74. package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +23 -17
  75. package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +16 -2
  76. package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +19 -9
  77. package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +13 -2
  78. package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +24 -2
  79. package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +22 -3
  80. package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +1 -2
  81. package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +11 -2
  82. package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +12 -2
  83. package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +16 -3
  84. package/src/collection_editor/ui/collection_editor/EnumForm.tsx +17 -2
  85. package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +18 -2
  86. package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +1 -2
  87. package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +1 -2
  88. package/src/collection_editor/ui/collection_editor/LayoutModeSwitch.tsx +17 -5
  89. package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +32 -6
  90. package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +7 -7
  91. package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +14 -2
  92. package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +16 -2
  93. package/src/collection_editor/ui/collection_editor/ViewModeSwitch.tsx +9 -2
  94. package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +1 -2
  95. package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +1 -2
  96. package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +9 -2
  97. package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +37 -57
  98. package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +11 -2
  99. package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +34 -0
  100. package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +15 -7
  101. package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.tsx +1 -2
  102. package/src/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.tsx +15 -3
  103. package/src/collection_editor/ui/collection_editor/properties/conditions/property_paths.ts +1 -1
  104. package/src/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.tsx +1 -2
  105. package/src/collection_editor/useLocalCollectionsConfigController.tsx +0 -2
  106. package/src/collection_editor/validateCollectionJson.ts +97 -10
  107. package/src/components/AdminModeSyncer.tsx +1 -1
  108. package/src/components/ArrayContainer.tsx +19 -15
  109. package/src/components/ClearFilterSortButton.tsx +1 -2
  110. package/src/components/CollectionEditorDialogs.tsx +1 -1
  111. package/src/components/DefaultAppBar.tsx +15 -3
  112. package/src/components/DefaultDrawer.tsx +3 -3
  113. package/src/components/DrawerNavigationGroup.tsx +1 -2
  114. package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +14 -6
  115. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +1 -1
  116. package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +1 -1
  117. package/src/components/EntityCollectionTable/fields/TableMultipleRelationField.tsx +1 -2
  118. package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +1 -2
  119. package/src/components/EntityCollectionTable/fields/TableRelationField.tsx +1 -2
  120. package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +1 -2
  121. package/src/components/EntityCollectionTable/fields/VirtualTableSelect.tsx +0 -1
  122. package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +15 -27
  123. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +1 -2
  124. package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +1 -2
  125. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +3 -5
  126. package/src/components/EntityCollectionTable/table_bindings.tsx +51 -45
  127. package/src/components/EntityCollectionView/Board.tsx +1 -2
  128. package/src/components/EntityCollectionView/BoardColumn.tsx +9 -2
  129. package/src/components/EntityCollectionView/BoardColumnTitle.tsx +5 -4
  130. package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +18 -16
  131. package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +16 -17
  132. package/src/components/EntityCollectionView/EntityCollectionListView.tsx +87 -18
  133. package/src/components/EntityCollectionView/EntityCollectionView.tsx +20 -11
  134. package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +6 -7
  135. package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +14 -5
  136. package/src/components/EntityCollectionView/FilterPresetsButton.tsx +292 -0
  137. package/src/components/EntityCollectionView/FiltersDialog.tsx +1 -2
  138. package/src/components/EntityCollectionView/SplitListView.tsx +76 -25
  139. package/src/components/EntityCollectionView/ViewModeToggle.tsx +20 -7
  140. package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +1 -1
  141. package/src/components/EntityCollectionView/useBoardDataController.tsx +74 -6
  142. package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +1 -1
  143. package/src/components/EntityDetailView.tsx +619 -0
  144. package/src/components/EntityEditView.tsx +29 -10
  145. package/src/components/EntityEditViewFormActions.tsx +20 -7
  146. package/src/components/EntityPreview.tsx +14 -5
  147. package/src/components/EntitySidePanel.tsx +116 -62
  148. package/src/components/EntityView.tsx +1 -2
  149. package/src/components/HomePage/ContentHomePage.tsx +1 -1
  150. package/src/components/HomePage/FavouritesView.tsx +1 -2
  151. package/src/components/HomePage/NavigationCard.tsx +1 -2
  152. package/src/components/HomePage/NavigationCardBinding.tsx +1 -2
  153. package/src/components/HomePage/NavigationGroup.tsx +1 -2
  154. package/src/components/HomePage/SmallNavigationCard.tsx +1 -2
  155. package/src/components/PropertyIdCopyTooltip.tsx +1 -2
  156. package/src/components/RebaseAuthGate.tsx +2 -2
  157. package/src/components/RebaseNavigation.tsx +9 -7
  158. package/src/components/ReferenceTable/EntitySelectionTable.tsx +12 -8
  159. package/src/components/RelationSelector.tsx +34 -6
  160. package/src/components/SearchIconsView.tsx +10 -2
  161. package/src/components/SelectableTable/SelectableTable.tsx +2 -2
  162. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +1 -2
  163. package/src/components/SideDialogs.tsx +63 -38
  164. package/src/components/UserSelector.tsx +30 -6
  165. package/src/components/admin/CreationResultDialog.tsx +135 -0
  166. package/src/components/admin/RolesFilterSelect.tsx +45 -0
  167. package/src/components/admin/RolesView.tsx +53 -14
  168. package/src/components/admin/UserRolesSelectField.tsx +50 -0
  169. package/src/components/admin/UsersView.tsx +41 -124
  170. package/src/components/app/Scaffold.tsx +1 -2
  171. package/src/components/common/default_entity_actions.tsx +119 -12
  172. package/src/components/field_configs.tsx +39 -3
  173. package/src/components/history/EntityHistoryEntry.tsx +1 -2
  174. package/src/components/history/EntityHistoryView.tsx +1 -2
  175. package/src/components/index.ts +2 -0
  176. package/src/data_export/export/BasicExportAction.tsx +35 -38
  177. package/src/data_export/export/ExportCollectionAction.tsx +39 -40
  178. package/src/data_import/components/DataNewPropertiesMapping.tsx +15 -2
  179. package/src/data_import/components/ImportFileUpload.tsx +1 -2
  180. package/src/data_import/components/ImportNewPropertyFieldPreview.tsx +1 -2
  181. package/src/data_import/import/ImportCollectionAction.tsx +21 -8
  182. package/src/data_import/utils/data.ts +23 -5
  183. package/src/data_import/utils/file_headers.ts +13 -89
  184. package/src/data_import/utils/file_to_json.ts +43 -68
  185. package/src/data_import/utils/transforms.ts +47 -0
  186. package/src/editor/components/SlashCommandMenu.tsx +17 -2
  187. package/src/editor/components/editor-bubble-item.tsx +1 -1
  188. package/src/editor/extensions/Image/index.ts +1 -1
  189. package/src/editor/extensions/Image.ts +1 -1
  190. package/src/editor/selectors/color-selector.tsx +1 -2
  191. package/src/editor/selectors/link-selector.tsx +1 -2
  192. package/src/editor/selectors/node-selector.tsx +16 -2
  193. package/src/editor/selectors/text-buttons.tsx +1 -2
  194. package/src/editor/utils/prosemirror-utils.ts +1 -1
  195. package/src/form/EntityForm.tsx +16 -6
  196. package/src/form/EntityFormActions.tsx +11 -3
  197. package/src/form/PropertyFieldBinding.tsx +5 -12
  198. package/src/form/components/FieldHelperText.tsx +1 -2
  199. package/src/form/components/LocalChangesMenu.tsx +17 -2
  200. package/src/form/components/StorageItemPreview.tsx +1 -2
  201. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +1 -2
  202. package/src/form/field_bindings/KeyValueFieldBinding.tsx +17 -2
  203. package/src/form/field_bindings/MapFieldBinding.tsx +1 -1
  204. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +10 -3
  205. package/src/form/field_bindings/MultiSelectFieldBinding.tsx +1 -2
  206. package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +1 -2
  207. package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +7 -7
  208. package/src/form/field_bindings/RelationFieldBinding.tsx +150 -147
  209. package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
  210. package/src/form/field_bindings/SelectFieldBinding.tsx +1 -2
  211. package/src/form/field_bindings/TextFieldBinding.tsx +10 -2
  212. package/src/form/field_bindings/VectorFieldBinding.tsx +202 -0
  213. package/src/form/index.tsx +1 -0
  214. package/src/form/validation.ts +54 -2
  215. package/src/hooks/navigation/useBuildNavigationStateController.tsx +2 -1
  216. package/src/hooks/navigation/useResolvedViews.tsx +30 -15
  217. package/src/hooks/navigation/useTopLevelNavigation.ts +1 -1
  218. package/src/index.ts +6 -0
  219. package/src/preview/PropertyPreview.tsx +1 -1
  220. package/src/preview/components/ImagePreview.tsx +1 -1
  221. package/src/preview/components/UrlComponentPreview.tsx +1 -2
  222. package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -2
  223. package/src/preview/property_previews/SkeletonPropertyComponent.tsx +23 -24
  224. package/src/routes/RebaseRoute.tsx +64 -35
  225. package/src/types/components/EntityFormActionsProps.tsx +1 -1
  226. package/src/types/components/EntityFormProps.tsx +3 -1
  227. package/src/types/fields.tsx +4 -3
  228. package/src/util/navigation_utils.ts +4 -3
  229. package/src/util/previews.ts +1 -1
  230. package/src/util/property_utils.tsx +22 -6
  231. package/src/util/resolutions.ts +2 -2
  232. package/dist/CollectionEditorDialog-ywdxhs1L.js.map +0 -1
  233. package/dist/CollectionsStudioView-BDzMFzqH.js.map +0 -1
  234. package/dist/ContentHomePage-0tHuEIm_.js.map +0 -1
  235. package/dist/ExportCollectionAction-BIrq92To.js.map +0 -1
  236. package/dist/ImportCollectionAction-h8yg_To8.js.map +0 -1
  237. package/dist/PropertyEditView-BuZrNnBN.js.map +0 -1
  238. package/dist/RolesView-CMPsaIXo.js.map +0 -1
  239. package/dist/UsersView-BkeblMVT.js.map +0 -1
  240. package/dist/index-BuZaHcyc.js.map +0 -1
  241. package/dist/index-CS6uJ7oW.js.map +0 -1
  242. package/dist/index-eRJbMvHi.js.map +0 -1
  243. package/dist/util-zfU1zOCX.js.map +0 -1
@@ -4,10 +4,9 @@ import React__default, { useEffect, useMemo, useContext, createContext, useState
4
4
  import { deepEqual } from "fast-equals";
5
5
  import { useFormex, getIn, Field, useCreateFormex, Formex } from "@rebasepro/formex";
6
6
  import { useTranslation, useSnackbarController, useCustomizationController, AIModifiedIndicator, IconForView, ConfirmationDialog } from "@rebasepro/core";
7
- import { t as ArrayContainer, a3 as FieldCaption, d as getFieldConfig, P as PropertyConfigBadge, aY as getFullIdPath, aX as getFullId, b0 as idToPropertiesPath, b4 as namespaceToPropertiesOrderPath, b5 as namespaceToPropertiesPath, e as useCollectionRegistryController, O as DEFAULT_FIELD_CONFIGS, aW as getFieldId } from "./util-zfU1zOCX.js";
7
+ import { a as ArrayContainer, J as FieldCaption, aL as getFieldConfig, $ as PropertyConfigBadge, aO as getFullIdPath, aN as getFullId, aV as idToPropertiesPath, aZ as namespaceToPropertiesOrderPath, a_ as namespaceToPropertiesPath, bh as useCollectionRegistryController, o as DEFAULT_FIELD_CONFIGS, aM as getFieldId } from "./util-DbWax_sV.js";
8
8
  import { resolveEnumValues, isPropertyBuilder } from "@rebasepro/common";
9
- import { iconSize, Badge, IconButton, Typography, DebouncedTextField, Button, CircularProgress, Paper, DialogTitle, DialogContent, DialogActions, Dialog, BooleanSwitchWithLabel, Tooltip, ExpandablePanel, Select, SelectItem, MultiSelectItem, MultiSelect, cls, ErrorBoundary, defaultBorderMixin, MenuItem, Menu, TextField, InfoLabel, Card } from "@rebasepro/ui";
10
- import { RefreshCcwIcon, SettingsIcon, ListIcon, CheckSquareIcon, UploadCloudIcon, FunctionSquareIcon, MinusCircleIcon, FileSearchIcon, Trash2Icon, MoreVerticalIcon, ArrowUpToLineIcon, ArrowDownToLineIcon, PlusIcon, AlertTriangleIcon } from "lucide-react";
9
+ import { RefreshCcwIcon, iconSize, Badge, IconButton, SettingsIcon, Typography, DebouncedTextField, ListIcon, Button, CircularProgress, Paper, DialogTitle, DialogContent, DialogActions, Dialog, BooleanSwitchWithLabel, Tooltip, CheckSquareIcon, ExpandablePanel, Select, SelectItem, MultiSelectItem, UploadCloudIcon, MultiSelect, cls, ErrorBoundary, FunctionSquareIcon, MinusCircleIcon, FileSearchIcon, Trash2Icon, MoreVerticalIcon, ArrowUpToLineIcon, ArrowDownToLineIcon, defaultBorderMixin, MenuItem, Menu, PlusIcon, TextField, InfoLabel, AlertTriangleIcon, Card } from "@rebasepro/ui";
11
10
  import "zod";
12
11
  import { serializeRegExp, toSnakeCase, prettifyIdentifier, mergeDeep, isValidRegExp } from "@rebasepro/utils";
13
12
  import "react-dropzone";
@@ -15,9 +14,8 @@ import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, close
15
14
  import { SortableContext, verticalListSortingStrategy, useSortable, sortableKeyboardCoordinates } from "@dnd-kit/sortable";
16
15
  import { CSS } from "@dnd-kit/utilities";
17
16
  import "@rebasepro/types";
18
- import "react-router";
19
17
  import "react-router-dom";
20
- import "xlsx";
18
+ import "exceljs";
21
19
  import { extractEnumFromValues } from "@rebasepro/schema-inference";
22
20
  import "date-fns";
23
21
  import "date-fns/locale";
@@ -1804,7 +1802,7 @@ function _temp$8(v) {
1804
1802
  return fileTypes[v];
1805
1803
  }
1806
1804
  function PropertyFieldPreview(t0) {
1807
- const $ = c(30);
1805
+ const $ = c(31);
1808
1806
  const {
1809
1807
  property,
1810
1808
  propertyKey,
@@ -1827,103 +1825,106 @@ function PropertyFieldPreview(t0) {
1827
1825
  t1 = $[2];
1828
1826
  }
1829
1827
  const propertyConfig = t1;
1828
+ const borderColorClass = hasError ? "border-red-500 dark:border-red-500 border-red-500/100 dark:border-red-500/100 ring-0 dark:ring-0" : selected ? "border-primary" : "";
1830
1829
  const t2 = onClick ? "cursor-pointer" : "";
1831
- const t3 = selected ? "bg-primary/5 dark:bg-primary/10 ring-1 ring-inset ring-primary border-primary/30" : "hover:bg-surface-50 dark:hover:bg-surface-750";
1832
- let t4;
1833
- if ($[3] !== t3) {
1834
- t4 = cls("w-full flex flex-row gap-3 items-center px-3 py-2 rounded-lg transition-all duration-200 border bg-white dark:bg-surface-800 border-surface-200 dark:border-surface-700 shadow-xs", t3);
1830
+ const t3 = borderColorClass || "border-surface-200 dark:border-surface-700";
1831
+ const t4 = selected ? "bg-primary/10 text-primary dark:bg-primary/20 dark:text-primary-light ring-1 ring-inset ring-primary border-primary/30" : "hover:bg-surface-50 dark:hover:bg-surface-700";
1832
+ let t5;
1833
+ if ($[3] !== t3 || $[4] !== t4) {
1834
+ t5 = cls("w-full flex flex-row gap-3 items-center px-3 py-2 rounded-lg transition-all duration-200 border bg-white dark:bg-surface-800 shadow-xs", t3, t4);
1835
1835
  $[3] = t3;
1836
1836
  $[4] = t4;
1837
+ $[5] = t5;
1837
1838
  } else {
1838
- t4 = $[4];
1839
+ t5 = $[5];
1839
1840
  }
1840
- let t5;
1841
- if ($[5] !== propertyConfig) {
1842
- t5 = /* @__PURE__ */ jsx(PropertyConfigBadge, { propertyConfig, size: "small" });
1843
- $[5] = propertyConfig;
1844
- $[6] = t5;
1841
+ let t6;
1842
+ if ($[6] !== propertyConfig) {
1843
+ t6 = /* @__PURE__ */ jsx(PropertyConfigBadge, { propertyConfig, size: "small" });
1844
+ $[6] = propertyConfig;
1845
+ $[7] = t6;
1845
1846
  } else {
1846
- t5 = $[6];
1847
+ t6 = $[7];
1847
1848
  }
1848
- let t6;
1849
- if ($[7] !== includeName || $[8] !== property || $[9] !== propertyKey) {
1850
- t6 = includeName && /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1849
+ let t7;
1850
+ if ($[8] !== includeName || $[9] !== property || $[10] !== propertyKey) {
1851
+ t7 = includeName && /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1851
1852
  /* @__PURE__ */ jsx(Typography, { variant: "body2", component: "span", children: property.name || propertyKey || " " }),
1852
1853
  property.name && propertyKey && property.name !== propertyKey && /* @__PURE__ */ jsx(Typography, { variant: "caption", component: "span", color: "secondary", className: "font-mono", children: propertyKey })
1853
1854
  ] }) });
1854
- $[7] = includeName;
1855
- $[8] = property;
1856
- $[9] = propertyKey;
1857
- $[10] = t6;
1855
+ $[8] = includeName;
1856
+ $[9] = property;
1857
+ $[10] = propertyKey;
1858
+ $[11] = t7;
1858
1859
  } else {
1859
- t6 = $[10];
1860
+ t7 = $[11];
1860
1861
  }
1861
- const t7 = propertyConfig?.name;
1862
- let t8;
1863
- if ($[11] !== t7) {
1864
- t8 = /* @__PURE__ */ jsx("div", { className: "flex flex-row items-center gap-2 mt-0.5", children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Typography, { variant: "caption", component: "span", className: "text-text-secondary dark:text-text-secondary-dark font-medium", children: t7 }) }) });
1865
- $[11] = t7;
1862
+ const t8 = propertyConfig?.name;
1863
+ let t9;
1864
+ if ($[12] !== t8) {
1865
+ t9 = /* @__PURE__ */ jsx("div", { className: "flex flex-row items-center gap-2 mt-0.5", children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Typography, { variant: "caption", component: "span", className: "text-text-secondary dark:text-text-secondary-dark font-medium", children: t8 }) }) });
1866
1866
  $[12] = t8;
1867
+ $[13] = t9;
1867
1868
  } else {
1868
- t8 = $[12];
1869
+ t9 = $[13];
1869
1870
  }
1870
- let t9;
1871
- if ($[13] !== t6 || $[14] !== t8) {
1872
- t9 = /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col min-w-0 pr-8", children: [
1873
- t6,
1874
- t8
1871
+ let t10;
1872
+ if ($[14] !== t7 || $[15] !== t9) {
1873
+ t10 = /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col min-w-0 pr-8", children: [
1874
+ t7,
1875
+ t9
1875
1876
  ] });
1876
- $[13] = t6;
1877
- $[14] = t8;
1877
+ $[14] = t7;
1878
1878
  $[15] = t9;
1879
- } else {
1880
- t9 = $[15];
1881
- }
1882
- const t10 = ("columnType" in property ? property.columnType : void 0) || property.type;
1883
- let t11;
1884
- if ($[16] !== t10) {
1885
- t11 = /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Typography, { variant: "caption", component: "span", className: "ml-auto shrink-0 text-text-disabled dark:text-text-disabled-dark font-mono bg-surface-100 dark:bg-surface-900 px-1.5 py-0.5 rounded mr-8", children: t10 }) });
1886
1879
  $[16] = t10;
1887
- $[17] = t11;
1888
1880
  } else {
1889
- t11 = $[17];
1881
+ t10 = $[16];
1890
1882
  }
1883
+ const t11 = ("columnType" in property ? property.columnType : void 0) || property.type;
1891
1884
  let t12;
1892
- if ($[18] !== includeEditButton) {
1893
- t12 = includeEditButton && /* @__PURE__ */ jsx(Typography, { variant: "button", children: "EDIT" });
1894
- $[18] = includeEditButton;
1895
- $[19] = t12;
1885
+ if ($[17] !== t11) {
1886
+ t12 = /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(Typography, { variant: "caption", component: "span", className: "ml-auto shrink-0 text-text-disabled dark:text-text-disabled-dark font-mono bg-surface-100 dark:bg-surface-900 px-1.5 py-0.5 rounded mr-8", children: t11 }) });
1887
+ $[17] = t11;
1888
+ $[18] = t12;
1896
1889
  } else {
1897
- t12 = $[19];
1890
+ t12 = $[18];
1898
1891
  }
1899
1892
  let t13;
1900
- if ($[20] !== t11 || $[21] !== t12 || $[22] !== t4 || $[23] !== t5 || $[24] !== t9) {
1901
- t13 = /* @__PURE__ */ jsxs(Paper, { className: t4, children: [
1902
- t5,
1903
- t9,
1904
- t11,
1905
- t12
1906
- ] });
1907
- $[20] = t11;
1908
- $[21] = t12;
1909
- $[22] = t4;
1910
- $[23] = t5;
1911
- $[24] = t9;
1912
- $[25] = t13;
1893
+ if ($[19] !== includeEditButton) {
1894
+ t13 = includeEditButton && /* @__PURE__ */ jsx(Typography, { variant: "button", children: "EDIT" });
1895
+ $[19] = includeEditButton;
1896
+ $[20] = t13;
1913
1897
  } else {
1914
- t13 = $[25];
1898
+ t13 = $[20];
1915
1899
  }
1916
1900
  let t14;
1917
- if ($[26] !== onClick || $[27] !== t13 || $[28] !== t2) {
1918
- t14 = /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx("div", { onClick, className: t2, children: t13 }) });
1919
- $[26] = onClick;
1920
- $[27] = t13;
1921
- $[28] = t2;
1922
- $[29] = t14;
1901
+ if ($[21] !== t10 || $[22] !== t12 || $[23] !== t13 || $[24] !== t5 || $[25] !== t6) {
1902
+ t14 = /* @__PURE__ */ jsxs(Paper, { className: t5, children: [
1903
+ t6,
1904
+ t10,
1905
+ t12,
1906
+ t13
1907
+ ] });
1908
+ $[21] = t10;
1909
+ $[22] = t12;
1910
+ $[23] = t13;
1911
+ $[24] = t5;
1912
+ $[25] = t6;
1913
+ $[26] = t14;
1923
1914
  } else {
1924
- t14 = $[29];
1915
+ t14 = $[26];
1916
+ }
1917
+ let t15;
1918
+ if ($[27] !== onClick || $[28] !== t14 || $[29] !== t2) {
1919
+ t15 = /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx("div", { onClick, className: t2, children: t14 }) });
1920
+ $[27] = onClick;
1921
+ $[28] = t14;
1922
+ $[29] = t2;
1923
+ $[30] = t15;
1924
+ } else {
1925
+ t15 = $[30];
1925
1926
  }
1926
- return t14;
1927
+ return t15;
1927
1928
  }
1928
1929
  function NonEditablePropertyPreview(t0) {
1929
1930
  const $ = c(39);
@@ -1947,7 +1948,7 @@ function NonEditablePropertyPreview(t0) {
1947
1948
  }
1948
1949
  const propertyConfig = t1;
1949
1950
  const t2 = onClick ? "cursor-pointer" : "";
1950
- const t3 = selected ? "bg-primary/5 dark:bg-primary/10 ring-1 ring-inset ring-primary border-primary/30" : "hover:bg-surface-50 dark:hover:bg-surface-750";
1951
+ const t3 = selected ? "bg-primary/10 text-primary dark:bg-primary/20 dark:text-primary-light ring-1 ring-inset ring-primary border-primary/30" : "hover:bg-surface-50 dark:hover:bg-surface-700";
1951
1952
  let t4;
1952
1953
  if ($[3] !== t3) {
1953
1954
  t4 = cls("w-full flex flex-row gap-3 items-center px-3 py-2 rounded-lg transition-all duration-200 border bg-white dark:bg-surface-800 border-surface-200 dark:border-surface-700 shadow-xs", t3);
@@ -5479,6 +5480,85 @@ function AdvancedPropertyValidation(t0) {
5479
5480
  }
5480
5481
  return t3;
5481
5482
  }
5483
+ function VectorPropertyField(t0) {
5484
+ const $ = c(18);
5485
+ const {
5486
+ disabled
5487
+ } = t0;
5488
+ const {
5489
+ values,
5490
+ setFieldValue,
5491
+ touched,
5492
+ errors
5493
+ } = useFormex();
5494
+ let t1;
5495
+ if ($[0] !== values) {
5496
+ t1 = getIn(values, "dimensions");
5497
+ $[0] = values;
5498
+ $[1] = t1;
5499
+ } else {
5500
+ t1 = $[1];
5501
+ }
5502
+ const dimensionsValue = t1;
5503
+ let t2;
5504
+ if ($[2] !== errors || $[3] !== touched) {
5505
+ t2 = getIn(touched, "dimensions") && getIn(errors, "dimensions");
5506
+ $[2] = errors;
5507
+ $[3] = touched;
5508
+ $[4] = t2;
5509
+ } else {
5510
+ t2 = $[4];
5511
+ }
5512
+ const dimensionsError = t2;
5513
+ let t3;
5514
+ if ($[5] !== setFieldValue) {
5515
+ t3 = (e) => {
5516
+ const parsedVal = parseInt(e.target.value);
5517
+ setFieldValue("dimensions", isNaN(parsedVal) ? void 0 : parsedVal);
5518
+ };
5519
+ $[5] = setFieldValue;
5520
+ $[6] = t3;
5521
+ } else {
5522
+ t3 = $[6];
5523
+ }
5524
+ const t4 = dimensionsValue ?? "";
5525
+ const t5 = Boolean(dimensionsError);
5526
+ let t6;
5527
+ if ($[7] !== disabled || $[8] !== t3 || $[9] !== t4 || $[10] !== t5) {
5528
+ t6 = /* @__PURE__ */ jsx(TextField, { name: "dimensions", disabled, type: "number", onChange: t3, label: "Vector Dimensions", value: t4, error: t5 });
5529
+ $[7] = disabled;
5530
+ $[8] = t3;
5531
+ $[9] = t4;
5532
+ $[10] = t5;
5533
+ $[11] = t6;
5534
+ } else {
5535
+ t6 = $[11];
5536
+ }
5537
+ const t7 = Boolean(dimensionsError);
5538
+ const t8 = dimensionsError ?? "The dimension size of the vector embeddings (e.g., 1536 for OpenAI text-embedding-3-small).";
5539
+ let t9;
5540
+ if ($[12] !== t7 || $[13] !== t8) {
5541
+ t9 = /* @__PURE__ */ jsx(FieldCaption, { error: t7, children: t8 });
5542
+ $[12] = t7;
5543
+ $[13] = t8;
5544
+ $[14] = t9;
5545
+ } else {
5546
+ t9 = $[14];
5547
+ }
5548
+ let t10;
5549
+ if ($[15] !== t6 || $[16] !== t9) {
5550
+ t10 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
5551
+ t6,
5552
+ t9
5553
+ ] });
5554
+ $[15] = t6;
5555
+ $[16] = t9;
5556
+ $[17] = t10;
5557
+ } else {
5558
+ t10 = $[17];
5559
+ }
5560
+ return t10;
5561
+ }
5482
5562
  function KeyValuePropertyField(t0) {
5483
5563
  const $ = c(2);
5484
5564
  const {
@@ -5495,8 +5575,22 @@ function KeyValuePropertyField(t0) {
5495
5575
  return t1;
5496
5576
  }
5497
5577
  const ON_ACTION_OPTIONS = ["cascade", "restrict", "no action", "set null", "set default"];
5578
+ function getTargetSlug(target) {
5579
+ if (!target) return "";
5580
+ if (typeof target === "string") return target;
5581
+ try {
5582
+ const resolved = target();
5583
+ if (typeof resolved === "string") return resolved;
5584
+ if (resolved && typeof resolved === "object" && "slug" in resolved && typeof resolved.slug === "string") {
5585
+ return resolved.slug;
5586
+ }
5587
+ return "";
5588
+ } catch {
5589
+ return "";
5590
+ }
5591
+ }
5498
5592
  function RelationPropertyField(t0) {
5499
- const $ = c(112);
5593
+ const $ = c(107);
5500
5594
  const {
5501
5595
  disabled,
5502
5596
  showErrors
@@ -5508,341 +5602,309 @@ function RelationPropertyField(t0) {
5508
5602
  const collectionRegistry = useCollectionRegistryController();
5509
5603
  const relationName = values.relationName ?? "";
5510
5604
  let t1;
5511
- if ($[0] !== values._relationConfig) {
5512
- t1 = values._relationConfig ?? {};
5513
- $[0] = values._relationConfig;
5605
+ if ($[0] !== values.target) {
5606
+ t1 = getTargetSlug(values.target);
5607
+ $[0] = values.target;
5514
5608
  $[1] = t1;
5515
5609
  } else {
5516
5610
  t1 = $[1];
5517
5611
  }
5518
- const relationConfig = t1;
5519
- const targetSlug = relationConfig._targetSlug ?? "";
5520
- const cardinality = relationConfig.cardinality ?? "one";
5521
- const direction = relationConfig.direction ?? "owning";
5522
- const localKey = relationConfig.localKey ?? "";
5523
- const foreignKeyOnTarget = relationConfig.foreignKeyOnTarget ?? "";
5524
- const through = relationConfig.through;
5612
+ const targetSlug = t1;
5613
+ const cardinality = values.cardinality ?? "one";
5614
+ const direction = values.direction ?? "owning";
5615
+ const localKey = values.localKey ?? "";
5616
+ const foreignKeyOnTarget = values.foreignKeyOnTarget ?? "";
5617
+ const through = values.through;
5525
5618
  const throughTable = through?.table ?? "";
5526
5619
  const throughSourceColumn = through?.sourceColumn ?? "";
5527
5620
  const throughTargetColumn = through?.targetColumn ?? "";
5528
- const onUpdate = relationConfig.onUpdate ?? "no action";
5529
- const onDelete = relationConfig.onDelete ?? "no action";
5621
+ const onUpdate = values.onUpdate ?? "no action";
5622
+ const onDelete = values.onDelete ?? "no action";
5530
5623
  const showThrough = cardinality === "many" && direction === "owning";
5531
5624
  const showLocalKey = direction === "owning" && cardinality === "one";
5532
5625
  const showForeignKey = direction === "inverse";
5533
5626
  let t2;
5534
- if ($[2] !== setFieldValue || $[3] !== values._relationConfig) {
5627
+ if ($[2] !== setFieldValue || $[3] !== values.through) {
5535
5628
  t2 = (patch) => {
5536
- const current = values._relationConfig ?? {};
5537
- setFieldValue("_relationConfig", {
5538
- ...current,
5629
+ const currentThrough = values.through ?? {
5630
+ table: "",
5631
+ sourceColumn: "",
5632
+ targetColumn: ""
5633
+ };
5634
+ setFieldValue("through", {
5635
+ ...currentThrough,
5539
5636
  ...patch
5540
5637
  });
5541
5638
  };
5542
5639
  $[2] = setFieldValue;
5543
- $[3] = values._relationConfig;
5640
+ $[3] = values.through;
5544
5641
  $[4] = t2;
5545
5642
  } else {
5546
5643
  t2 = $[4];
5547
5644
  }
5548
- const updateRelationConfig = t2;
5645
+ const updateThrough = t2;
5549
5646
  let t3;
5550
- if ($[5] !== setFieldValue || $[6] !== values._relationConfig) {
5551
- t3 = (patch_0) => {
5552
- const current_0 = values._relationConfig ?? {};
5553
- const currentThrough = current_0.through ?? {};
5554
- setFieldValue("_relationConfig", {
5555
- ...current_0,
5556
- through: {
5557
- ...currentThrough,
5558
- ...patch_0
5559
- }
5560
- });
5561
- };
5562
- $[5] = setFieldValue;
5563
- $[6] = values._relationConfig;
5564
- $[7] = t3;
5565
- } else {
5566
- t3 = $[7];
5567
- }
5568
- const updateThrough = t3;
5569
5647
  let t4;
5570
- if ($[8] !== relationName || $[9] !== setFieldValue || $[10] !== targetSlug) {
5571
- t4 = () => {
5648
+ if ($[5] !== relationName || $[6] !== setFieldValue || $[7] !== targetSlug) {
5649
+ t3 = () => {
5572
5650
  if (targetSlug && !relationName) {
5573
5651
  setFieldValue("relationName", targetSlug);
5574
5652
  }
5575
5653
  };
5576
- $[8] = relationName;
5577
- $[9] = setFieldValue;
5578
- $[10] = targetSlug;
5579
- $[11] = t4;
5654
+ t4 = [targetSlug, relationName, setFieldValue];
5655
+ $[5] = relationName;
5656
+ $[6] = setFieldValue;
5657
+ $[7] = targetSlug;
5658
+ $[8] = t3;
5659
+ $[9] = t4;
5580
5660
  } else {
5581
- t4 = $[11];
5661
+ t3 = $[8];
5662
+ t4 = $[9];
5582
5663
  }
5664
+ useEffect(t3, t4);
5665
+ collectionRegistry?.collections ?? [];
5583
5666
  let t5;
5584
- if ($[12] !== targetSlug) {
5585
- t5 = [targetSlug];
5667
+ if ($[10] !== relationName || $[11] !== setFieldValue || $[12] !== targetSlug) {
5668
+ t5 = (_, value) => {
5669
+ setFieldValue("target", value);
5670
+ if (!relationName || relationName === targetSlug) {
5671
+ setFieldValue("relationName", value);
5672
+ }
5673
+ };
5674
+ $[10] = relationName;
5675
+ $[11] = setFieldValue;
5586
5676
  $[12] = targetSlug;
5587
5677
  $[13] = t5;
5588
5678
  } else {
5589
5679
  t5 = $[13];
5590
5680
  }
5591
- useEffect(t4, t5);
5592
- collectionRegistry?.collections ?? [];
5593
- let t6;
5594
- if ($[14] !== relationName || $[15] !== setFieldValue || $[16] !== targetSlug || $[17] !== updateRelationConfig) {
5595
- t6 = (_, value) => {
5596
- updateRelationConfig({
5597
- _targetSlug: value
5598
- });
5599
- if (!relationName || relationName === targetSlug) {
5600
- setFieldValue("relationName", value);
5601
- }
5602
- };
5603
- $[14] = relationName;
5604
- $[15] = setFieldValue;
5605
- $[16] = targetSlug;
5606
- $[17] = updateRelationConfig;
5607
- $[18] = t6;
5681
+ const t6 = showErrors && !targetSlug ? "You must select a target collection" : void 0;
5682
+ let t7;
5683
+ if ($[14] !== disabled || $[15] !== t5 || $[16] !== t6 || $[17] !== targetSlug) {
5684
+ t7 = /* @__PURE__ */ jsx(CollectionsSelect, { disabled, pathPath: "target", value: targetSlug, setFieldValue: t5, error: t6 });
5685
+ $[14] = disabled;
5686
+ $[15] = t5;
5687
+ $[16] = t6;
5688
+ $[17] = targetSlug;
5689
+ $[18] = t7;
5608
5690
  } else {
5609
- t6 = $[18];
5691
+ t7 = $[18];
5610
5692
  }
5611
- const t7 = showErrors && !targetSlug ? "You must select a target collection" : void 0;
5612
- let t8;
5613
- if ($[19] !== disabled || $[20] !== t6 || $[21] !== t7 || $[22] !== targetSlug) {
5614
- t8 = /* @__PURE__ */ jsx(CollectionsSelect, { disabled, pathPath: "_relationConfig._targetSlug", value: targetSlug, setFieldValue: t6, error: t7 });
5615
- $[19] = disabled;
5616
- $[20] = t6;
5617
- $[21] = t7;
5618
- $[22] = targetSlug;
5619
- $[23] = t8;
5693
+ const t8 = showErrors && !targetSlug;
5694
+ const t9 = showErrors && !targetSlug ? "You must select a target collection" : "The collection this relation points to";
5695
+ let t10;
5696
+ if ($[19] !== t8 || $[20] !== t9) {
5697
+ t10 = /* @__PURE__ */ jsx(FieldCaption, { error: t8, children: t9 });
5698
+ $[19] = t8;
5699
+ $[20] = t9;
5700
+ $[21] = t10;
5620
5701
  } else {
5621
- t8 = $[23];
5702
+ t10 = $[21];
5622
5703
  }
5623
- const t9 = showErrors && !targetSlug;
5624
- const t10 = showErrors && !targetSlug ? "You must select a target collection" : "The collection this relation points to";
5625
5704
  let t11;
5626
- if ($[24] !== t10 || $[25] !== t9) {
5627
- t11 = /* @__PURE__ */ jsx(FieldCaption, { error: t9, children: t10 });
5628
- $[24] = t10;
5629
- $[25] = t9;
5630
- $[26] = t11;
5705
+ if ($[22] !== t10 || $[23] !== t7) {
5706
+ t11 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
5707
+ t7,
5708
+ t10
5709
+ ] });
5710
+ $[22] = t10;
5711
+ $[23] = t7;
5712
+ $[24] = t11;
5631
5713
  } else {
5632
- t11 = $[26];
5714
+ t11 = $[24];
5633
5715
  }
5634
5716
  let t12;
5635
- if ($[27] !== t11 || $[28] !== t8) {
5636
- t12 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
5637
- t8,
5638
- t11
5639
- ] });
5640
- $[27] = t11;
5641
- $[28] = t8;
5642
- $[29] = t12;
5717
+ if ($[25] !== setFieldValue) {
5718
+ t12 = (e) => setFieldValue("relationName", e.target.value);
5719
+ $[25] = setFieldValue;
5720
+ $[26] = t12;
5643
5721
  } else {
5644
- t12 = $[29];
5722
+ t12 = $[26];
5645
5723
  }
5646
- let t13;
5647
- if ($[30] !== setFieldValue) {
5648
- t13 = (e) => setFieldValue("relationName", e.target.value);
5649
- $[30] = setFieldValue;
5650
- $[31] = t13;
5724
+ const t13 = showErrors && !relationName;
5725
+ let t14;
5726
+ if ($[27] !== disabled || $[28] !== relationName || $[29] !== t12 || $[30] !== t13) {
5727
+ t14 = /* @__PURE__ */ jsx(TextField, { value: relationName, onChange: t12, label: "Relation name", disabled, error: t13 });
5728
+ $[27] = disabled;
5729
+ $[28] = relationName;
5730
+ $[29] = t12;
5731
+ $[30] = t13;
5732
+ $[31] = t14;
5651
5733
  } else {
5652
- t13 = $[31];
5734
+ t14 = $[31];
5653
5735
  }
5654
- const t14 = showErrors && !relationName;
5655
- let t15;
5656
- if ($[32] !== disabled || $[33] !== relationName || $[34] !== t13 || $[35] !== t14) {
5657
- t15 = /* @__PURE__ */ jsx(TextField, { value: relationName, onChange: t13, label: "Relation name", disabled, error: t14 });
5658
- $[32] = disabled;
5659
- $[33] = relationName;
5660
- $[34] = t13;
5661
- $[35] = t14;
5662
- $[36] = t15;
5736
+ const t15 = showErrors && !relationName;
5737
+ const t16 = showErrors && !relationName ? "Required" : "Identifier for this relation (used to link the property to the relation config)";
5738
+ let t17;
5739
+ if ($[32] !== t15 || $[33] !== t16) {
5740
+ t17 = /* @__PURE__ */ jsx(FieldCaption, { error: t15, children: t16 });
5741
+ $[32] = t15;
5742
+ $[33] = t16;
5743
+ $[34] = t17;
5663
5744
  } else {
5664
- t15 = $[36];
5745
+ t17 = $[34];
5665
5746
  }
5666
- const t16 = showErrors && !relationName;
5667
- const t17 = showErrors && !relationName ? "Required" : "Identifier for this relation (used to link the property to the relation config)";
5668
5747
  let t18;
5669
- if ($[37] !== t16 || $[38] !== t17) {
5670
- t18 = /* @__PURE__ */ jsx(FieldCaption, { error: t16, children: t17 });
5671
- $[37] = t16;
5672
- $[38] = t17;
5673
- $[39] = t18;
5748
+ if ($[35] !== t14 || $[36] !== t17) {
5749
+ t18 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
5750
+ t14,
5751
+ t17
5752
+ ] });
5753
+ $[35] = t14;
5754
+ $[36] = t17;
5755
+ $[37] = t18;
5674
5756
  } else {
5675
- t18 = $[39];
5757
+ t18 = $[37];
5676
5758
  }
5677
5759
  let t19;
5678
- if ($[40] !== t15 || $[41] !== t18) {
5679
- t19 = /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
5680
- t15,
5681
- t18
5682
- ] });
5683
- $[40] = t15;
5684
- $[41] = t18;
5685
- $[42] = t19;
5760
+ if ($[38] !== setFieldValue) {
5761
+ t19 = (v) => setFieldValue("cardinality", v);
5762
+ $[38] = setFieldValue;
5763
+ $[39] = t19;
5686
5764
  } else {
5687
- t19 = $[42];
5765
+ t19 = $[39];
5688
5766
  }
5689
5767
  let t20;
5690
- if ($[43] !== updateRelationConfig) {
5691
- t20 = (v) => updateRelationConfig({
5692
- cardinality: v
5693
- });
5694
- $[43] = updateRelationConfig;
5695
- $[44] = t20;
5696
- } else {
5697
- t20 = $[44];
5698
- }
5699
- let t21;
5700
- if ($[45] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5701
- t21 = /* @__PURE__ */ jsx(SelectItem, { value: "one", children: /* @__PURE__ */ jsxs("div", { children: [
5768
+ if ($[40] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5769
+ t20 = /* @__PURE__ */ jsx(SelectItem, { value: "one", children: /* @__PURE__ */ jsxs("div", { children: [
5702
5770
  /* @__PURE__ */ jsx(Typography, { variant: "body2", children: "One (has-one)" }),
5703
5771
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "This property references a single record" })
5704
5772
  ] }) });
5705
- $[45] = t21;
5773
+ $[40] = t20;
5706
5774
  } else {
5707
- t21 = $[45];
5775
+ t20 = $[40];
5708
5776
  }
5709
- let t22;
5710
- if ($[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5711
- t22 = /* @__PURE__ */ jsx(SelectItem, { value: "many", children: /* @__PURE__ */ jsxs("div", { children: [
5777
+ let t21;
5778
+ if ($[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5779
+ t21 = /* @__PURE__ */ jsx(SelectItem, { value: "many", children: /* @__PURE__ */ jsxs("div", { children: [
5712
5780
  /* @__PURE__ */ jsx(Typography, { variant: "body2", children: "Many (has-many)" }),
5713
5781
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "This property references multiple records" })
5714
5782
  ] }) });
5715
- $[46] = t22;
5783
+ $[41] = t21;
5716
5784
  } else {
5717
- t22 = $[46];
5785
+ t21 = $[41];
5718
5786
  }
5719
- let t23;
5720
- if ($[47] !== cardinality || $[48] !== disabled || $[49] !== t20) {
5721
- t23 = /* @__PURE__ */ jsxs(Select, { value: cardinality, onValueChange: t20, label: "Cardinality", disabled, fullWidth: true, renderValue: _temp$2, children: [
5722
- t21,
5723
- t22
5787
+ let t22;
5788
+ if ($[42] !== cardinality || $[43] !== disabled || $[44] !== t19) {
5789
+ t22 = /* @__PURE__ */ jsxs(Select, { value: cardinality, onValueChange: t19, label: "Cardinality", disabled, fullWidth: true, renderValue: _temp$2, children: [
5790
+ t20,
5791
+ t21
5724
5792
  ] });
5725
- $[47] = cardinality;
5726
- $[48] = disabled;
5727
- $[49] = t20;
5728
- $[50] = t23;
5793
+ $[42] = cardinality;
5794
+ $[43] = disabled;
5795
+ $[44] = t19;
5796
+ $[45] = t22;
5729
5797
  } else {
5730
- t23 = $[50];
5798
+ t22 = $[45];
5731
5799
  }
5732
- let t24;
5733
- if ($[51] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5734
- t24 = /* @__PURE__ */ jsx(FieldCaption, { children: "Whether the relation returns one or multiple records" });
5735
- $[51] = t24;
5800
+ let t23;
5801
+ if ($[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5802
+ t23 = /* @__PURE__ */ jsx(FieldCaption, { children: "Whether the relation returns one or multiple records" });
5803
+ $[46] = t23;
5736
5804
  } else {
5737
- t24 = $[51];
5805
+ t23 = $[46];
5738
5806
  }
5739
- let t25;
5740
- if ($[52] !== t23) {
5741
- t25 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 sm:col-span-6", children: [
5742
- t23,
5743
- t24
5807
+ let t24;
5808
+ if ($[47] !== t22) {
5809
+ t24 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 sm:col-span-6", children: [
5810
+ t22,
5811
+ t23
5744
5812
  ] });
5745
- $[52] = t23;
5746
- $[53] = t25;
5813
+ $[47] = t22;
5814
+ $[48] = t24;
5747
5815
  } else {
5748
- t25 = $[53];
5816
+ t24 = $[48];
5749
5817
  }
5750
- let t26;
5751
- if ($[54] !== updateRelationConfig) {
5752
- t26 = (v_1) => updateRelationConfig({
5753
- direction: v_1
5754
- });
5755
- $[54] = updateRelationConfig;
5756
- $[55] = t26;
5818
+ let t25;
5819
+ if ($[49] !== setFieldValue) {
5820
+ t25 = (v_1) => setFieldValue("direction", v_1);
5821
+ $[49] = setFieldValue;
5822
+ $[50] = t25;
5757
5823
  } else {
5758
- t26 = $[55];
5824
+ t25 = $[50];
5759
5825
  }
5760
- let t27;
5761
- if ($[56] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5762
- t27 = /* @__PURE__ */ jsx(SelectItem, { value: "owning", children: /* @__PURE__ */ jsxs("div", { children: [
5826
+ let t26;
5827
+ if ($[51] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5828
+ t26 = /* @__PURE__ */ jsx(SelectItem, { value: "owning", children: /* @__PURE__ */ jsxs("div", { children: [
5763
5829
  /* @__PURE__ */ jsx(Typography, { variant: "body2", children: "Owning" }),
5764
5830
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "This table stores the foreign key (or owns the junction table)" })
5765
5831
  ] }) });
5766
- $[56] = t27;
5832
+ $[51] = t26;
5767
5833
  } else {
5768
- t27 = $[56];
5834
+ t26 = $[51];
5769
5835
  }
5770
- let t28;
5771
- if ($[57] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5772
- t28 = /* @__PURE__ */ jsx(SelectItem, { value: "inverse", children: /* @__PURE__ */ jsxs("div", { children: [
5836
+ let t27;
5837
+ if ($[52] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5838
+ t27 = /* @__PURE__ */ jsx(SelectItem, { value: "inverse", children: /* @__PURE__ */ jsxs("div", { children: [
5773
5839
  /* @__PURE__ */ jsx(Typography, { variant: "body2", children: "Inverse" }),
5774
5840
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "The target table stores the foreign key pointing back here" })
5775
5841
  ] }) });
5776
- $[57] = t28;
5842
+ $[52] = t27;
5777
5843
  } else {
5778
- t28 = $[57];
5844
+ t27 = $[52];
5779
5845
  }
5780
- let t29;
5781
- if ($[58] !== direction || $[59] !== disabled || $[60] !== t26) {
5782
- t29 = /* @__PURE__ */ jsxs(Select, { value: direction, onValueChange: t26, label: "Direction", disabled, fullWidth: true, renderValue: _temp2$1, children: [
5783
- t27,
5784
- t28
5846
+ let t28;
5847
+ if ($[53] !== direction || $[54] !== disabled || $[55] !== t25) {
5848
+ t28 = /* @__PURE__ */ jsxs(Select, { value: direction, onValueChange: t25, label: "Direction", disabled, fullWidth: true, renderValue: _temp2$1, children: [
5849
+ t26,
5850
+ t27
5785
5851
  ] });
5786
- $[58] = direction;
5787
- $[59] = disabled;
5788
- $[60] = t26;
5789
- $[61] = t29;
5852
+ $[53] = direction;
5853
+ $[54] = disabled;
5854
+ $[55] = t25;
5855
+ $[56] = t28;
5790
5856
  } else {
5791
- t29 = $[61];
5857
+ t28 = $[56];
5858
+ }
5859
+ let t29;
5860
+ if ($[57] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5861
+ t29 = /* @__PURE__ */ jsx(FieldCaption, { children: "Which side of the relation owns the persistence" });
5862
+ $[57] = t29;
5863
+ } else {
5864
+ t29 = $[57];
5792
5865
  }
5793
5866
  let t30;
5794
- if ($[62] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5795
- t30 = /* @__PURE__ */ jsx(FieldCaption, { children: "Which side of the relation owns the persistence" });
5796
- $[62] = t30;
5867
+ if ($[58] !== t28) {
5868
+ t30 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 sm:col-span-6", children: [
5869
+ t28,
5870
+ t29
5871
+ ] });
5872
+ $[58] = t28;
5873
+ $[59] = t30;
5797
5874
  } else {
5798
- t30 = $[62];
5875
+ t30 = $[59];
5799
5876
  }
5800
5877
  let t31;
5801
- if ($[63] !== t29) {
5802
- t31 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 sm:col-span-6", children: [
5803
- t29,
5804
- t30
5878
+ if ($[60] !== disabled || $[61] !== localKey || $[62] !== setFieldValue || $[63] !== showLocalKey) {
5879
+ t31 = showLocalKey && /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
5880
+ /* @__PURE__ */ jsx(TextField, { value: localKey, onChange: (e_0) => setFieldValue("localKey", e_0.target.value), label: "Local key (foreign key column on this table)", disabled, placeholder: "e.g. author_id" }),
5881
+ /* @__PURE__ */ jsx(FieldCaption, { children: "Column on this table that references the target's primary key" })
5805
5882
  ] });
5806
- $[63] = t29;
5883
+ $[60] = disabled;
5884
+ $[61] = localKey;
5885
+ $[62] = setFieldValue;
5886
+ $[63] = showLocalKey;
5807
5887
  $[64] = t31;
5808
5888
  } else {
5809
5889
  t31 = $[64];
5810
5890
  }
5811
5891
  let t32;
5812
- if ($[65] !== disabled || $[66] !== localKey || $[67] !== showLocalKey || $[68] !== updateRelationConfig) {
5813
- t32 = showLocalKey && /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
5814
- /* @__PURE__ */ jsx(TextField, { value: localKey, onChange: (e_0) => updateRelationConfig({
5815
- localKey: e_0.target.value
5816
- }), label: "Local key (foreign key column on this table)", disabled, placeholder: "e.g. author_id" }),
5817
- /* @__PURE__ */ jsx(FieldCaption, { children: "Column on this table that references the target's primary key" })
5892
+ if ($[65] !== disabled || $[66] !== foreignKeyOnTarget || $[67] !== setFieldValue || $[68] !== showForeignKey) {
5893
+ t32 = showForeignKey && /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
5894
+ /* @__PURE__ */ jsx(TextField, { value: foreignKeyOnTarget, onChange: (e_1) => setFieldValue("foreignKeyOnTarget", e_1.target.value), label: "Foreign key on target table", disabled, placeholder: "e.g. post_id" }),
5895
+ /* @__PURE__ */ jsx(FieldCaption, { children: "Column on the target table that references this table's primary key" })
5818
5896
  ] });
5819
5897
  $[65] = disabled;
5820
- $[66] = localKey;
5821
- $[67] = showLocalKey;
5822
- $[68] = updateRelationConfig;
5898
+ $[66] = foreignKeyOnTarget;
5899
+ $[67] = setFieldValue;
5900
+ $[68] = showForeignKey;
5823
5901
  $[69] = t32;
5824
5902
  } else {
5825
5903
  t32 = $[69];
5826
5904
  }
5827
5905
  let t33;
5828
- if ($[70] !== disabled || $[71] !== foreignKeyOnTarget || $[72] !== showForeignKey || $[73] !== updateRelationConfig) {
5829
- t33 = showForeignKey && /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
5830
- /* @__PURE__ */ jsx(TextField, { value: foreignKeyOnTarget, onChange: (e_1) => updateRelationConfig({
5831
- foreignKeyOnTarget: e_1.target.value
5832
- }), label: "Foreign key on target table", disabled, placeholder: "e.g. post_id" }),
5833
- /* @__PURE__ */ jsx(FieldCaption, { children: "Column on the target table that references this table's primary key" })
5834
- ] });
5835
- $[70] = disabled;
5836
- $[71] = foreignKeyOnTarget;
5837
- $[72] = showForeignKey;
5838
- $[73] = updateRelationConfig;
5839
- $[74] = t33;
5840
- } else {
5841
- t33 = $[74];
5842
- }
5843
- let t34;
5844
- if ($[75] !== disabled || $[76] !== showThrough || $[77] !== throughSourceColumn || $[78] !== throughTable || $[79] !== throughTargetColumn || $[80] !== updateThrough) {
5845
- t34 = showThrough && /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
5906
+ if ($[70] !== disabled || $[71] !== showThrough || $[72] !== throughSourceColumn || $[73] !== throughTable || $[74] !== throughTargetColumn || $[75] !== updateThrough) {
5907
+ t33 = showThrough && /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
5846
5908
  /* @__PURE__ */ jsx(Typography, { variant: "label", className: "mb-2", children: "Junction table (many-to-many)" }),
5847
5909
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-4", children: [
5848
5910
  /* @__PURE__ */ jsxs("div", { className: "col-span-12", children: [
@@ -5865,133 +5927,129 @@ function RelationPropertyField(t0) {
5865
5927
  ] })
5866
5928
  ] })
5867
5929
  ] });
5868
- $[75] = disabled;
5869
- $[76] = showThrough;
5870
- $[77] = throughSourceColumn;
5871
- $[78] = throughTable;
5872
- $[79] = throughTargetColumn;
5873
- $[80] = updateThrough;
5874
- $[81] = t34;
5930
+ $[70] = disabled;
5931
+ $[71] = showThrough;
5932
+ $[72] = throughSourceColumn;
5933
+ $[73] = throughTable;
5934
+ $[74] = throughTargetColumn;
5935
+ $[75] = updateThrough;
5936
+ $[76] = t33;
5937
+ } else {
5938
+ t33 = $[76];
5939
+ }
5940
+ let t34;
5941
+ if ($[77] !== setFieldValue) {
5942
+ t34 = (v_3) => setFieldValue("onUpdate", v_3);
5943
+ $[77] = setFieldValue;
5944
+ $[78] = t34;
5875
5945
  } else {
5876
- t34 = $[81];
5946
+ t34 = $[78];
5877
5947
  }
5878
5948
  let t35;
5879
- if ($[82] !== updateRelationConfig) {
5880
- t35 = (v_3) => updateRelationConfig({
5881
- onUpdate: v_3
5882
- });
5883
- $[82] = updateRelationConfig;
5884
- $[83] = t35;
5949
+ if ($[79] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5950
+ t35 = ON_ACTION_OPTIONS.map(_temp4$1);
5951
+ $[79] = t35;
5885
5952
  } else {
5886
- t35 = $[83];
5953
+ t35 = $[79];
5887
5954
  }
5888
5955
  let t36;
5889
- if ($[84] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5890
- t36 = ON_ACTION_OPTIONS.map(_temp4$1);
5891
- $[84] = t36;
5956
+ if ($[80] !== disabled || $[81] !== onUpdate || $[82] !== t34) {
5957
+ t36 = /* @__PURE__ */ jsx(Select, { value: onUpdate, onValueChange: t34, label: "On update", disabled, fullWidth: true, renderValue: _temp3$1, children: t35 });
5958
+ $[80] = disabled;
5959
+ $[81] = onUpdate;
5960
+ $[82] = t34;
5961
+ $[83] = t36;
5892
5962
  } else {
5893
- t36 = $[84];
5963
+ t36 = $[83];
5894
5964
  }
5895
5965
  let t37;
5896
- if ($[85] !== disabled || $[86] !== onUpdate || $[87] !== t35) {
5897
- t37 = /* @__PURE__ */ jsx(Select, { value: onUpdate, onValueChange: t35, label: "On update", disabled, fullWidth: true, renderValue: _temp3$1, children: t36 });
5898
- $[85] = disabled;
5899
- $[86] = onUpdate;
5900
- $[87] = t35;
5901
- $[88] = t37;
5966
+ if ($[84] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5967
+ t37 = /* @__PURE__ */ jsx(FieldCaption, { children: "Action when the referenced record is updated" });
5968
+ $[84] = t37;
5902
5969
  } else {
5903
- t37 = $[88];
5970
+ t37 = $[84];
5904
5971
  }
5905
5972
  let t38;
5906
- if ($[89] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5907
- t38 = /* @__PURE__ */ jsx(FieldCaption, { children: "Action when the referenced record is updated" });
5908
- $[89] = t38;
5973
+ if ($[85] !== t36) {
5974
+ t38 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 sm:col-span-6", children: [
5975
+ t36,
5976
+ t37
5977
+ ] });
5978
+ $[85] = t36;
5979
+ $[86] = t38;
5909
5980
  } else {
5910
- t38 = $[89];
5981
+ t38 = $[86];
5911
5982
  }
5912
5983
  let t39;
5913
- if ($[90] !== t37) {
5914
- t39 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 sm:col-span-6", children: [
5915
- t37,
5916
- t38
5917
- ] });
5918
- $[90] = t37;
5919
- $[91] = t39;
5984
+ if ($[87] !== setFieldValue) {
5985
+ t39 = (v_5) => setFieldValue("onDelete", v_5);
5986
+ $[87] = setFieldValue;
5987
+ $[88] = t39;
5920
5988
  } else {
5921
- t39 = $[91];
5989
+ t39 = $[88];
5922
5990
  }
5923
5991
  let t40;
5924
- if ($[92] !== updateRelationConfig) {
5925
- t40 = (v_5) => updateRelationConfig({
5926
- onDelete: v_5
5927
- });
5928
- $[92] = updateRelationConfig;
5929
- $[93] = t40;
5992
+ if ($[89] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5993
+ t40 = ON_ACTION_OPTIONS.map(_temp6);
5994
+ $[89] = t40;
5930
5995
  } else {
5931
- t40 = $[93];
5996
+ t40 = $[89];
5932
5997
  }
5933
5998
  let t41;
5934
- if ($[94] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5935
- t41 = ON_ACTION_OPTIONS.map(_temp6);
5936
- $[94] = t41;
5999
+ if ($[90] !== disabled || $[91] !== onDelete || $[92] !== t39) {
6000
+ t41 = /* @__PURE__ */ jsx(Select, { value: onDelete, onValueChange: t39, label: "On delete", disabled, fullWidth: true, renderValue: _temp5, children: t40 });
6001
+ $[90] = disabled;
6002
+ $[91] = onDelete;
6003
+ $[92] = t39;
6004
+ $[93] = t41;
5937
6005
  } else {
5938
- t41 = $[94];
6006
+ t41 = $[93];
5939
6007
  }
5940
6008
  let t42;
5941
- if ($[95] !== disabled || $[96] !== onDelete || $[97] !== t40) {
5942
- t42 = /* @__PURE__ */ jsx(Select, { value: onDelete, onValueChange: t40, label: "On delete", disabled, fullWidth: true, renderValue: _temp5, children: t41 });
5943
- $[95] = disabled;
5944
- $[96] = onDelete;
5945
- $[97] = t40;
5946
- $[98] = t42;
6009
+ if ($[94] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6010
+ t42 = /* @__PURE__ */ jsx(FieldCaption, { children: "Action when the referenced record is deleted" });
6011
+ $[94] = t42;
5947
6012
  } else {
5948
- t42 = $[98];
6013
+ t42 = $[94];
5949
6014
  }
5950
6015
  let t43;
5951
- if ($[99] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
5952
- t43 = /* @__PURE__ */ jsx(FieldCaption, { children: "Action when the referenced record is deleted" });
5953
- $[99] = t43;
5954
- } else {
5955
- t43 = $[99];
5956
- }
5957
- let t44;
5958
- if ($[100] !== t42) {
5959
- t44 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 sm:col-span-6", children: [
5960
- t42,
5961
- t43
6016
+ if ($[95] !== t41) {
6017
+ t43 = /* @__PURE__ */ jsxs("div", { className: "col-span-12 sm:col-span-6", children: [
6018
+ t41,
6019
+ t42
5962
6020
  ] });
5963
- $[100] = t42;
5964
- $[101] = t44;
6021
+ $[95] = t41;
6022
+ $[96] = t43;
5965
6023
  } else {
5966
- t44 = $[101];
6024
+ t43 = $[96];
5967
6025
  }
5968
- let t45;
5969
- if ($[102] !== t12 || $[103] !== t19 || $[104] !== t25 || $[105] !== t31 || $[106] !== t32 || $[107] !== t33 || $[108] !== t34 || $[109] !== t39 || $[110] !== t44) {
5970
- t45 = /* @__PURE__ */ jsxs(Fragment, { children: [
5971
- t12,
5972
- t19,
5973
- t25,
6026
+ let t44;
6027
+ if ($[97] !== t11 || $[98] !== t18 || $[99] !== t24 || $[100] !== t30 || $[101] !== t31 || $[102] !== t32 || $[103] !== t33 || $[104] !== t38 || $[105] !== t43) {
6028
+ t44 = /* @__PURE__ */ jsxs(Fragment, { children: [
6029
+ t11,
6030
+ t18,
6031
+ t24,
6032
+ t30,
5974
6033
  t31,
5975
6034
  t32,
5976
6035
  t33,
5977
- t34,
5978
- t39,
5979
- t44
6036
+ t38,
6037
+ t43
5980
6038
  ] });
5981
- $[102] = t12;
5982
- $[103] = t19;
5983
- $[104] = t25;
5984
- $[105] = t31;
5985
- $[106] = t32;
5986
- $[107] = t33;
5987
- $[108] = t34;
5988
- $[109] = t39;
5989
- $[110] = t44;
5990
- $[111] = t45;
5991
- } else {
5992
- t45 = $[111];
5993
- }
5994
- return t45;
6039
+ $[97] = t11;
6040
+ $[98] = t18;
6041
+ $[99] = t24;
6042
+ $[100] = t30;
6043
+ $[101] = t31;
6044
+ $[102] = t32;
6045
+ $[103] = t33;
6046
+ $[104] = t38;
6047
+ $[105] = t43;
6048
+ $[106] = t44;
6049
+ } else {
6050
+ t44 = $[106];
6051
+ }
6052
+ return t44;
5995
6053
  }
5996
6054
  function _temp6(action_0) {
5997
6055
  return /* @__PURE__ */ jsx(SelectItem, { value: action_0, children: action_0 }, action_0);
@@ -6961,6 +7019,9 @@ const PropertyForm = React__default.memo(function PropertyForm2(props) {
6961
7019
  if (values.type === "reference" && !values.path) {
6962
7020
  errors.slug = "You must specify a target collection for the field";
6963
7021
  }
7022
+ if (values.type === "vector" && (!values.dimensions || isNaN(Number(values.dimensions)) || Number(values.dimensions) <= 0)) {
7023
+ errors.dimensions = "Vector dimensions must be a positive number";
7024
+ }
6964
7025
  if (values.propertyConfig === "repeat") {
6965
7026
  if (!("of" in values) || !values.of) {
6966
7027
  errors.of = "You need to specify a repeat field";
@@ -7187,7 +7248,7 @@ function PropertyFormDialog(t0) {
7187
7248
  return t11;
7188
7249
  }
7189
7250
  function PropertyEditFormFields(t0) {
7190
- const $ = c(148);
7251
+ const $ = c(150);
7191
7252
  const {
7192
7253
  values,
7193
7254
  errors,
@@ -7551,7 +7612,19 @@ function PropertyEditFormFields(t0) {
7551
7612
  }
7552
7613
  childComponent = t102;
7553
7614
  } else {
7554
- childComponent = null;
7615
+ if (selectedFieldConfigId === "vector_input") {
7616
+ let t102;
7617
+ if ($[97] !== disabled) {
7618
+ t102 = /* @__PURE__ */ jsx(VectorPropertyField, { disabled });
7619
+ $[97] = disabled;
7620
+ $[98] = t102;
7621
+ } else {
7622
+ t102 = $[98];
7623
+ }
7624
+ childComponent = t102;
7625
+ } else {
7626
+ childComponent = null;
7627
+ }
7555
7628
  }
7556
7629
  }
7557
7630
  }
@@ -7571,162 +7644,162 @@ function PropertyEditFormFields(t0) {
7571
7644
  }
7572
7645
  }
7573
7646
  let t10;
7574
- if ($[97] !== disabled) {
7647
+ if ($[99] !== disabled) {
7575
7648
  t10 = disabled && /* @__PURE__ */ jsxs(InfoLabel, { mode: "warn", children: [
7576
7649
  /* @__PURE__ */ jsx(Typography, { children: "This property can't be edited" }),
7577
7650
  /* @__PURE__ */ jsx(Typography, { variant: "caption", children: "You may not have permission to edit it or it is defined in code and cannot be modified." })
7578
7651
  ] });
7579
- $[97] = disabled;
7580
- $[98] = t10;
7652
+ $[99] = disabled;
7653
+ $[100] = t10;
7581
7654
  } else {
7582
- t10 = $[98];
7655
+ t10 = $[100];
7583
7656
  }
7584
7657
  const t11 = selectedFieldConfigId;
7585
7658
  let t12;
7586
- if ($[99] !== onWidgetSelectChanged) {
7659
+ if ($[101] !== onWidgetSelectChanged) {
7587
7660
  t12 = (value) => onWidgetSelectChanged(value);
7588
- $[99] = onWidgetSelectChanged;
7589
- $[100] = t12;
7661
+ $[101] = onWidgetSelectChanged;
7662
+ $[102] = t12;
7590
7663
  } else {
7591
- t12 = $[100];
7664
+ t12 = $[102];
7592
7665
  }
7593
7666
  let t13;
7594
- if ($[101] !== onDismiss) {
7667
+ if ($[103] !== onDismiss) {
7595
7668
  t13 = (open, hasValue) => {
7596
7669
  if (!hasValue) {
7597
7670
  onDismiss?.();
7598
7671
  }
7599
7672
  setSelectOpen(open);
7600
7673
  };
7601
- $[101] = onDismiss;
7602
- $[102] = t13;
7674
+ $[103] = onDismiss;
7675
+ $[104] = t13;
7603
7676
  } else {
7604
- t13 = $[102];
7677
+ t13 = $[104];
7605
7678
  }
7606
7679
  const t14 = Boolean(selectedWidgetError);
7607
7680
  let t15;
7608
- if ($[103] !== disabled || $[104] !== existing || $[105] !== inArray || $[106] !== propertyConfigs || $[107] !== selectOpen || $[108] !== t11 || $[109] !== t12 || $[110] !== t13 || $[111] !== t14 || $[112] !== values) {
7681
+ if ($[105] !== disabled || $[106] !== existing || $[107] !== inArray || $[108] !== propertyConfigs || $[109] !== selectOpen || $[110] !== t11 || $[111] !== t12 || $[112] !== t13 || $[113] !== t14 || $[114] !== values) {
7609
7682
  t15 = /* @__PURE__ */ jsx(WidgetSelectView, { initialProperty: values, value: t11, onValueChange: t12, open: selectOpen, onOpenChange: t13, disabled, showError: t14, existing, propertyConfigs, inArray });
7610
- $[103] = disabled;
7611
- $[104] = existing;
7612
- $[105] = inArray;
7613
- $[106] = propertyConfigs;
7614
- $[107] = selectOpen;
7615
- $[108] = t11;
7616
- $[109] = t12;
7617
- $[110] = t13;
7618
- $[111] = t14;
7619
- $[112] = values;
7620
- $[113] = t15;
7621
- } else {
7622
- t15 = $[113];
7683
+ $[105] = disabled;
7684
+ $[106] = existing;
7685
+ $[107] = inArray;
7686
+ $[108] = propertyConfigs;
7687
+ $[109] = selectOpen;
7688
+ $[110] = t11;
7689
+ $[111] = t12;
7690
+ $[112] = t13;
7691
+ $[113] = t14;
7692
+ $[114] = values;
7693
+ $[115] = t15;
7694
+ } else {
7695
+ t15 = $[115];
7623
7696
  }
7624
7697
  let t16;
7625
- if ($[114] !== selectedWidgetError) {
7698
+ if ($[116] !== selectedWidgetError) {
7626
7699
  t16 = !!selectedWidgetError && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "ml-3.5", color: "error", children: "Required" });
7627
- $[114] = selectedWidgetError;
7628
- $[115] = t16;
7700
+ $[116] = selectedWidgetError;
7701
+ $[117] = t16;
7629
7702
  } else {
7630
- t16 = $[115];
7703
+ t16 = $[117];
7631
7704
  }
7632
7705
  let t17;
7633
- if ($[116] !== t15 || $[117] !== t16) {
7706
+ if ($[118] !== t15 || $[119] !== t16) {
7634
7707
  t17 = /* @__PURE__ */ jsxs("div", { className: "w-full flex flex-col gap-2", children: [
7635
7708
  t15,
7636
7709
  t16
7637
7710
  ] });
7638
- $[116] = t15;
7639
- $[117] = t16;
7640
- $[118] = t17;
7711
+ $[118] = t15;
7712
+ $[119] = t16;
7713
+ $[120] = t17;
7641
7714
  } else {
7642
- t17 = $[118];
7715
+ t17 = $[120];
7643
7716
  }
7644
7717
  let t18;
7645
- if ($[119] !== disabled || $[120] !== onDelete || $[121] !== values?.id) {
7646
- t18 = onDelete && values?.id && /* @__PURE__ */ jsx(IconButton, { variant: "ghost", className: "m-4", disabled, onClick: () => setDeleteDialogOpen(true), children: /* @__PURE__ */ jsx(Trash2Icon, {}) });
7647
- $[119] = disabled;
7648
- $[120] = onDelete;
7649
- $[121] = values?.id;
7650
- $[122] = t18;
7718
+ if ($[121] !== disabled || $[122] !== onDelete || $[123] !== values?.id) {
7719
+ t18 = onDelete && values?.id && /* @__PURE__ */ jsx(IconButton, { variant: "ghost", className: "mt-1 shrink-0", disabled, onClick: () => setDeleteDialogOpen(true), children: /* @__PURE__ */ jsx(Trash2Icon, { size: iconSize.small }) });
7720
+ $[121] = disabled;
7721
+ $[122] = onDelete;
7722
+ $[123] = values?.id;
7723
+ $[124] = t18;
7651
7724
  } else {
7652
- t18 = $[122];
7725
+ t18 = $[124];
7653
7726
  }
7654
7727
  let t19;
7655
- if ($[123] !== t17 || $[124] !== t18) {
7656
- t19 = /* @__PURE__ */ jsxs("div", { className: "flex mt-2 justify-between", children: [
7728
+ if ($[125] !== t17 || $[126] !== t18) {
7729
+ t19 = /* @__PURE__ */ jsxs("div", { className: "flex mt-2 items-start justify-between", children: [
7657
7730
  t17,
7658
7731
  t18
7659
7732
  ] });
7660
- $[123] = t17;
7661
- $[124] = t18;
7662
- $[125] = t19;
7733
+ $[125] = t17;
7734
+ $[126] = t18;
7735
+ $[127] = t19;
7663
7736
  } else {
7664
- t19 = $[125];
7737
+ t19 = $[127];
7665
7738
  }
7666
7739
  let t20;
7667
- if ($[126] !== autoUpdateId || $[127] !== disabled || $[128] !== existing || $[129] !== includeIdAndTitle || $[130] !== showErrors) {
7740
+ if ($[128] !== autoUpdateId || $[129] !== disabled || $[130] !== existing || $[131] !== includeIdAndTitle || $[132] !== showErrors) {
7668
7741
  t20 = includeIdAndTitle && /* @__PURE__ */ jsx(CommonPropertyFields, { showErrors, disabledId: existing, isNewProperty: !existing, disabled, autoUpdateId, ref: nameFieldRef });
7669
- $[126] = autoUpdateId;
7670
- $[127] = disabled;
7671
- $[128] = existing;
7672
- $[129] = includeIdAndTitle;
7673
- $[130] = showErrors;
7674
- $[131] = t20;
7742
+ $[128] = autoUpdateId;
7743
+ $[129] = disabled;
7744
+ $[130] = existing;
7745
+ $[131] = includeIdAndTitle;
7746
+ $[132] = showErrors;
7747
+ $[133] = t20;
7675
7748
  } else {
7676
- t20 = $[131];
7749
+ t20 = $[133];
7677
7750
  }
7678
7751
  let t21;
7679
- if ($[132] !== disabled) {
7752
+ if ($[134] !== disabled) {
7680
7753
  t21 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(AdvancedPropertyValidation, { disabled }) });
7681
- $[132] = disabled;
7682
- $[133] = t21;
7754
+ $[134] = disabled;
7755
+ $[135] = t21;
7683
7756
  } else {
7684
- t21 = $[133];
7757
+ t21 = $[135];
7685
7758
  }
7686
7759
  let t22;
7687
- if ($[134] !== childComponent || $[135] !== t20 || $[136] !== t21) {
7760
+ if ($[136] !== childComponent || $[137] !== t20 || $[138] !== t21) {
7688
7761
  t22 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-y-8 mt-6 mb-8", children: [
7689
7762
  t20,
7690
7763
  childComponent,
7691
7764
  t21
7692
7765
  ] });
7693
- $[134] = childComponent;
7694
- $[135] = t20;
7695
- $[136] = t21;
7696
- $[137] = t22;
7766
+ $[136] = childComponent;
7767
+ $[137] = t20;
7768
+ $[138] = t21;
7769
+ $[139] = t22;
7697
7770
  } else {
7698
- t22 = $[137];
7771
+ t22 = $[139];
7699
7772
  }
7700
7773
  let t23;
7701
- if ($[138] !== deleteDialogOpen || $[139] !== onDelete || $[140] !== propertyNamespace || $[141] !== values?.id) {
7774
+ if ($[140] !== deleteDialogOpen || $[141] !== onDelete || $[142] !== propertyNamespace || $[143] !== values?.id) {
7702
7775
  t23 = onDelete && /* @__PURE__ */ jsx(ConfirmationDialog, { open: deleteDialogOpen, onAccept: () => onDelete(values?.id, propertyNamespace), onCancel: () => setDeleteDialogOpen(false), title: /* @__PURE__ */ jsx("div", { children: "Delete this property?" }), body: /* @__PURE__ */ jsxs("div", { children: [
7703
7776
  " This will ",
7704
7777
  /* @__PURE__ */ jsx("b", { children: "not delete any data" }),
7705
7778
  ", only modify the collection."
7706
7779
  ] }) });
7707
- $[138] = deleteDialogOpen;
7708
- $[139] = onDelete;
7709
- $[140] = propertyNamespace;
7710
- $[141] = values?.id;
7711
- $[142] = t23;
7780
+ $[140] = deleteDialogOpen;
7781
+ $[141] = onDelete;
7782
+ $[142] = propertyNamespace;
7783
+ $[143] = values?.id;
7784
+ $[144] = t23;
7712
7785
  } else {
7713
- t23 = $[142];
7786
+ t23 = $[144];
7714
7787
  }
7715
7788
  let t24;
7716
- if ($[143] !== t10 || $[144] !== t19 || $[145] !== t22 || $[146] !== t23) {
7789
+ if ($[145] !== t10 || $[146] !== t19 || $[147] !== t22 || $[148] !== t23) {
7717
7790
  t24 = /* @__PURE__ */ jsxs(Fragment, { children: [
7718
7791
  t10,
7719
7792
  t19,
7720
7793
  t22,
7721
7794
  t23
7722
7795
  ] });
7723
- $[143] = t10;
7724
- $[144] = t19;
7725
- $[145] = t22;
7726
- $[146] = t23;
7727
- $[147] = t24;
7796
+ $[145] = t10;
7797
+ $[146] = t19;
7798
+ $[147] = t22;
7799
+ $[148] = t23;
7800
+ $[149] = t24;
7728
7801
  } else {
7729
- t24 = $[147];
7802
+ t24 = $[149];
7730
7803
  }
7731
7804
  return t24;
7732
7805
  }
@@ -7775,7 +7848,8 @@ const WIDGET_TYPE_MAP = {
7775
7848
  key_value: "Group",
7776
7849
  repeat: "Array",
7777
7850
  custom_array: "Array",
7778
- block: "Group"
7851
+ block: "Group",
7852
+ vector_input: "Number"
7779
7853
  };
7780
7854
  function WidgetSelectView(t0) {
7781
7855
  const $ = c(55);
@@ -8105,12 +8179,12 @@ const PropertyEditView = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
8105
8179
  }, Symbol.toStringTag, { value: "Module" }));
8106
8180
  export {
8107
8181
  AIModifiedPathsProvider as A,
8108
- PropertyForm as P,
8109
- PropertyFormDialog as a,
8110
- PropertyTree as b,
8111
- updatePropertyFromWidget as c,
8112
- PropertyEditView as d,
8182
+ PropertyEditView as P,
8183
+ PropertyForm as a,
8184
+ PropertyFormDialog as b,
8185
+ PropertyTree as c,
8186
+ useAIModifiedPaths as d,
8113
8187
  supportedFields as s,
8114
- useAIModifiedPaths as u
8188
+ updatePropertyFromWidget as u
8115
8189
  };
8116
- //# sourceMappingURL=PropertyEditView-BuZrNnBN.js.map
8190
+ //# sourceMappingURL=PropertyEditView-Cvryrb3B.js.map