@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.
- package/LICENSE +21 -6
- package/dist/{CollectionEditorDialog-ywdxhs1L.js → CollectionEditorDialog-CmGXXSY9.js} +42 -209
- package/dist/CollectionEditorDialog-CmGXXSY9.js.map +1 -0
- package/dist/{CollectionsStudioView-BDzMFzqH.js → CollectionsStudioView-DcLHT5bU.js} +6 -8
- package/dist/CollectionsStudioView-DcLHT5bU.js.map +1 -0
- package/dist/{ContentHomePage-0tHuEIm_.js → ContentHomePage-C7vFqKSe.js} +5 -7
- package/dist/ContentHomePage-C7vFqKSe.js.map +1 -0
- package/dist/{ExportCollectionAction-BIrq92To.js → ExportCollectionAction-BfN34eWX.js} +36 -38
- package/dist/ExportCollectionAction-BfN34eWX.js.map +1 -0
- package/dist/{ImportCollectionAction-h8yg_To8.js → ImportCollectionAction-SZrInjhx.js} +5 -7
- package/dist/ImportCollectionAction-SZrInjhx.js.map +1 -0
- package/dist/{PropertyEditView-BuZrNnBN.js → PropertyEditView-Cvryrb3B.js} +563 -489
- package/dist/PropertyEditView-Cvryrb3B.js.map +1 -0
- package/dist/{RolesView-CMPsaIXo.js → RolesView-BCb7qwWs.js} +22 -11
- package/dist/RolesView-BCb7qwWs.js.map +1 -0
- package/dist/{UsersView-BkeblMVT.js → UsersView-Cex24r8H.js} +7 -71
- package/dist/UsersView-Cex24r8H.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +2 -2
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.d.ts +1 -7
- package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.d.ts +3 -0
- package/dist/collection_editor_ui.js +5 -5
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionListView.d.ts +18 -2
- package/dist/components/EntityCollectionView/FilterPresetsButton.d.ts +21 -0
- package/dist/components/EntityDetailView.d.ts +31 -0
- package/dist/components/EntityEditView.d.ts +3 -2
- package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +1 -1
- package/dist/components/admin/CreationResultDialog.d.ts +5 -0
- package/dist/components/admin/RolesFilterSelect.d.ts +2 -0
- package/dist/components/admin/UserRolesSelectField.d.ts +2 -0
- package/dist/components/common/default_entity_actions.d.ts +7 -1
- package/dist/components/field_configs.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/data_import/utils/data.d.ts +1 -1
- package/dist/data_import/utils/file_headers.d.ts +6 -1
- package/dist/data_import/utils/file_to_json.d.ts +1 -11
- package/dist/data_import/utils/transforms.d.ts +11 -0
- package/dist/editor.js +2 -4
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +1 -1
- package/dist/form/field_bindings/RelationFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/VectorFieldBinding.d.ts +11 -0
- package/dist/form/index.d.ts +1 -0
- package/dist/hooks/navigation/useResolvedViews.d.ts +2 -1
- package/dist/{index-eRJbMvHi.js → index-DjduZG1T.js} +3 -3
- package/dist/index-DjduZG1T.js.map +1 -0
- package/dist/{index-BuZaHcyc.js → index-MKPc70-v.js} +3 -3
- package/dist/index-MKPc70-v.js.map +1 -0
- package/dist/{index-CS6uJ7oW.js → index-PLIQXpTt.js} +4 -6
- package/dist/index-PLIQXpTt.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +352 -148
- package/dist/index.js.map +1 -1
- package/dist/types/components/EntityFormActionsProps.d.ts +1 -1
- package/dist/types/components/EntityFormProps.d.ts +2 -1
- package/dist/types/fields.d.ts +3 -3
- package/dist/util/navigation_utils.d.ts +1 -1
- package/dist/{util-zfU1zOCX.js → util-DbWax_sV.js} +5453 -2641
- package/dist/util-DbWax_sV.js.map +1 -0
- package/package.json +46 -39
- package/src/collection_editor/ConfigControllerProvider.tsx +1 -1
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +12 -2
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +1 -2
- package/src/collection_editor/ui/EditorCollectionAction.tsx +1 -2
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +1 -2
- package/src/collection_editor/ui/EditorEntityAction.tsx +1 -2
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +1 -2
- package/src/collection_editor/ui/NewCollectionButton.tsx +1 -2
- package/src/collection_editor/ui/NewCollectionCard.tsx +4 -6
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +10 -2
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +18 -2
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +23 -17
- package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +16 -2
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +19 -9
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +13 -2
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +24 -2
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +22 -3
- package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +11 -2
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +12 -2
- package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +16 -3
- package/src/collection_editor/ui/collection_editor/EnumForm.tsx +17 -2
- package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +18 -2
- package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/LayoutModeSwitch.tsx +17 -5
- package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +32 -6
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +7 -7
- package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +14 -2
- package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +16 -2
- package/src/collection_editor/ui/collection_editor/ViewModeSwitch.tsx +9 -2
- package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +9 -2
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +37 -57
- package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +11 -2
- package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +34 -0
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +15 -7
- package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.tsx +15 -3
- package/src/collection_editor/ui/collection_editor/properties/conditions/property_paths.ts +1 -1
- package/src/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.tsx +1 -2
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +0 -2
- package/src/collection_editor/validateCollectionJson.ts +97 -10
- package/src/components/AdminModeSyncer.tsx +1 -1
- package/src/components/ArrayContainer.tsx +19 -15
- package/src/components/ClearFilterSortButton.tsx +1 -2
- package/src/components/CollectionEditorDialogs.tsx +1 -1
- package/src/components/DefaultAppBar.tsx +15 -3
- package/src/components/DefaultDrawer.tsx +3 -3
- package/src/components/DrawerNavigationGroup.tsx +1 -2
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +14 -6
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +1 -1
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +1 -1
- package/src/components/EntityCollectionTable/fields/TableMultipleRelationField.tsx +1 -2
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +1 -2
- package/src/components/EntityCollectionTable/fields/TableRelationField.tsx +1 -2
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +1 -2
- package/src/components/EntityCollectionTable/fields/VirtualTableSelect.tsx +0 -1
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +15 -27
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +1 -2
- package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +1 -2
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +3 -5
- package/src/components/EntityCollectionTable/table_bindings.tsx +51 -45
- package/src/components/EntityCollectionView/Board.tsx +1 -2
- package/src/components/EntityCollectionView/BoardColumn.tsx +9 -2
- package/src/components/EntityCollectionView/BoardColumnTitle.tsx +5 -4
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +18 -16
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +16 -17
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +87 -18
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +20 -11
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +6 -7
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +14 -5
- package/src/components/EntityCollectionView/FilterPresetsButton.tsx +292 -0
- package/src/components/EntityCollectionView/FiltersDialog.tsx +1 -2
- package/src/components/EntityCollectionView/SplitListView.tsx +76 -25
- package/src/components/EntityCollectionView/ViewModeToggle.tsx +20 -7
- package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +1 -1
- package/src/components/EntityCollectionView/useBoardDataController.tsx +74 -6
- package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +1 -1
- package/src/components/EntityDetailView.tsx +619 -0
- package/src/components/EntityEditView.tsx +29 -10
- package/src/components/EntityEditViewFormActions.tsx +20 -7
- package/src/components/EntityPreview.tsx +14 -5
- package/src/components/EntitySidePanel.tsx +116 -62
- package/src/components/EntityView.tsx +1 -2
- package/src/components/HomePage/ContentHomePage.tsx +1 -1
- package/src/components/HomePage/FavouritesView.tsx +1 -2
- package/src/components/HomePage/NavigationCard.tsx +1 -2
- package/src/components/HomePage/NavigationCardBinding.tsx +1 -2
- package/src/components/HomePage/NavigationGroup.tsx +1 -2
- package/src/components/HomePage/SmallNavigationCard.tsx +1 -2
- package/src/components/PropertyIdCopyTooltip.tsx +1 -2
- package/src/components/RebaseAuthGate.tsx +2 -2
- package/src/components/RebaseNavigation.tsx +9 -7
- package/src/components/ReferenceTable/EntitySelectionTable.tsx +12 -8
- package/src/components/RelationSelector.tsx +34 -6
- package/src/components/SearchIconsView.tsx +10 -2
- package/src/components/SelectableTable/SelectableTable.tsx +2 -2
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +1 -2
- package/src/components/SideDialogs.tsx +63 -38
- package/src/components/UserSelector.tsx +30 -6
- package/src/components/admin/CreationResultDialog.tsx +135 -0
- package/src/components/admin/RolesFilterSelect.tsx +45 -0
- package/src/components/admin/RolesView.tsx +53 -14
- package/src/components/admin/UserRolesSelectField.tsx +50 -0
- package/src/components/admin/UsersView.tsx +41 -124
- package/src/components/app/Scaffold.tsx +1 -2
- package/src/components/common/default_entity_actions.tsx +119 -12
- package/src/components/field_configs.tsx +39 -3
- package/src/components/history/EntityHistoryEntry.tsx +1 -2
- package/src/components/history/EntityHistoryView.tsx +1 -2
- package/src/components/index.ts +2 -0
- package/src/data_export/export/BasicExportAction.tsx +35 -38
- package/src/data_export/export/ExportCollectionAction.tsx +39 -40
- package/src/data_import/components/DataNewPropertiesMapping.tsx +15 -2
- package/src/data_import/components/ImportFileUpload.tsx +1 -2
- package/src/data_import/components/ImportNewPropertyFieldPreview.tsx +1 -2
- package/src/data_import/import/ImportCollectionAction.tsx +21 -8
- package/src/data_import/utils/data.ts +23 -5
- package/src/data_import/utils/file_headers.ts +13 -89
- package/src/data_import/utils/file_to_json.ts +43 -68
- package/src/data_import/utils/transforms.ts +47 -0
- package/src/editor/components/SlashCommandMenu.tsx +17 -2
- package/src/editor/components/editor-bubble-item.tsx +1 -1
- package/src/editor/extensions/Image/index.ts +1 -1
- package/src/editor/extensions/Image.ts +1 -1
- package/src/editor/selectors/color-selector.tsx +1 -2
- package/src/editor/selectors/link-selector.tsx +1 -2
- package/src/editor/selectors/node-selector.tsx +16 -2
- package/src/editor/selectors/text-buttons.tsx +1 -2
- package/src/editor/utils/prosemirror-utils.ts +1 -1
- package/src/form/EntityForm.tsx +16 -6
- package/src/form/EntityFormActions.tsx +11 -3
- package/src/form/PropertyFieldBinding.tsx +5 -12
- package/src/form/components/FieldHelperText.tsx +1 -2
- package/src/form/components/LocalChangesMenu.tsx +17 -2
- package/src/form/components/StorageItemPreview.tsx +1 -2
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +1 -2
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +17 -2
- package/src/form/field_bindings/MapFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +10 -3
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +1 -2
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +1 -2
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +7 -7
- package/src/form/field_bindings/RelationFieldBinding.tsx +150 -147
- package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
- package/src/form/field_bindings/SelectFieldBinding.tsx +1 -2
- package/src/form/field_bindings/TextFieldBinding.tsx +10 -2
- package/src/form/field_bindings/VectorFieldBinding.tsx +202 -0
- package/src/form/index.tsx +1 -0
- package/src/form/validation.ts +54 -2
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +2 -1
- package/src/hooks/navigation/useResolvedViews.tsx +30 -15
- package/src/hooks/navigation/useTopLevelNavigation.ts +1 -1
- package/src/index.ts +6 -0
- package/src/preview/PropertyPreview.tsx +1 -1
- package/src/preview/components/ImagePreview.tsx +1 -1
- package/src/preview/components/UrlComponentPreview.tsx +1 -2
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -2
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +23 -24
- package/src/routes/RebaseRoute.tsx +64 -35
- package/src/types/components/EntityFormActionsProps.tsx +1 -1
- package/src/types/components/EntityFormProps.tsx +3 -1
- package/src/types/fields.tsx +4 -3
- package/src/util/navigation_utils.ts +4 -3
- package/src/util/previews.ts +1 -1
- package/src/util/property_utils.tsx +22 -6
- package/src/util/resolutions.ts +2 -2
- package/dist/CollectionEditorDialog-ywdxhs1L.js.map +0 -1
- package/dist/CollectionsStudioView-BDzMFzqH.js.map +0 -1
- package/dist/ContentHomePage-0tHuEIm_.js.map +0 -1
- package/dist/ExportCollectionAction-BIrq92To.js.map +0 -1
- package/dist/ImportCollectionAction-h8yg_To8.js.map +0 -1
- package/dist/PropertyEditView-BuZrNnBN.js.map +0 -1
- package/dist/RolesView-CMPsaIXo.js.map +0 -1
- package/dist/UsersView-BkeblMVT.js.map +0 -1
- package/dist/index-BuZaHcyc.js.map +0 -1
- package/dist/index-CS6uJ7oW.js.map +0 -1
- package/dist/index-eRJbMvHi.js.map +0 -1
- 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 {
|
|
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 "
|
|
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(
|
|
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 =
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
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
|
-
|
|
1839
|
+
t5 = $[5];
|
|
1839
1840
|
}
|
|
1840
|
-
let
|
|
1841
|
-
if ($[
|
|
1842
|
-
|
|
1843
|
-
$[
|
|
1844
|
-
$[
|
|
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
|
-
|
|
1847
|
+
t6 = $[7];
|
|
1847
1848
|
}
|
|
1848
|
-
let
|
|
1849
|
-
if ($[
|
|
1850
|
-
|
|
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
|
-
$[
|
|
1855
|
-
$[
|
|
1856
|
-
$[
|
|
1857
|
-
$[
|
|
1855
|
+
$[8] = includeName;
|
|
1856
|
+
$[9] = property;
|
|
1857
|
+
$[10] = propertyKey;
|
|
1858
|
+
$[11] = t7;
|
|
1858
1859
|
} else {
|
|
1859
|
-
|
|
1860
|
+
t7 = $[11];
|
|
1860
1861
|
}
|
|
1861
|
-
const
|
|
1862
|
-
let
|
|
1863
|
-
if ($[
|
|
1864
|
-
|
|
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
|
-
|
|
1869
|
+
t9 = $[13];
|
|
1869
1870
|
}
|
|
1870
|
-
let
|
|
1871
|
-
if ($[
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
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
|
-
$[
|
|
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
|
-
|
|
1881
|
+
t10 = $[16];
|
|
1890
1882
|
}
|
|
1883
|
+
const t11 = ("columnType" in property ? property.columnType : void 0) || property.type;
|
|
1891
1884
|
let t12;
|
|
1892
|
-
if ($[
|
|
1893
|
-
t12 =
|
|
1894
|
-
$[
|
|
1895
|
-
$[
|
|
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 = $[
|
|
1890
|
+
t12 = $[18];
|
|
1898
1891
|
}
|
|
1899
1892
|
let t13;
|
|
1900
|
-
if ($[
|
|
1901
|
-
t13 = /* @__PURE__ */
|
|
1902
|
-
|
|
1903
|
-
|
|
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 = $[
|
|
1898
|
+
t13 = $[20];
|
|
1915
1899
|
}
|
|
1916
1900
|
let t14;
|
|
1917
|
-
if ($[
|
|
1918
|
-
t14 = /* @__PURE__ */
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
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 = $[
|
|
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
|
|
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/
|
|
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(
|
|
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.
|
|
5512
|
-
t1 = values.
|
|
5513
|
-
$[0] = values.
|
|
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
|
|
5519
|
-
const
|
|
5520
|
-
const
|
|
5521
|
-
const
|
|
5522
|
-
const
|
|
5523
|
-
const
|
|
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 =
|
|
5529
|
-
const onDelete =
|
|
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.
|
|
5627
|
+
if ($[2] !== setFieldValue || $[3] !== values.through) {
|
|
5535
5628
|
t2 = (patch) => {
|
|
5536
|
-
const
|
|
5537
|
-
|
|
5538
|
-
|
|
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.
|
|
5640
|
+
$[3] = values.through;
|
|
5544
5641
|
$[4] = t2;
|
|
5545
5642
|
} else {
|
|
5546
5643
|
t2 = $[4];
|
|
5547
5644
|
}
|
|
5548
|
-
const
|
|
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 ($[
|
|
5571
|
-
|
|
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
|
-
|
|
5577
|
-
$[
|
|
5578
|
-
$[
|
|
5579
|
-
$[
|
|
5654
|
+
t4 = [targetSlug, relationName, setFieldValue];
|
|
5655
|
+
$[5] = relationName;
|
|
5656
|
+
$[6] = setFieldValue;
|
|
5657
|
+
$[7] = targetSlug;
|
|
5658
|
+
$[8] = t3;
|
|
5659
|
+
$[9] = t4;
|
|
5580
5660
|
} else {
|
|
5581
|
-
|
|
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 =
|
|
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
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
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
|
-
|
|
5691
|
+
t7 = $[18];
|
|
5610
5692
|
}
|
|
5611
|
-
const
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
$[
|
|
5617
|
-
$[
|
|
5618
|
-
$[
|
|
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
|
-
|
|
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 ($[
|
|
5627
|
-
t11 = /* @__PURE__ */
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
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 = $[
|
|
5714
|
+
t11 = $[24];
|
|
5633
5715
|
}
|
|
5634
5716
|
let t12;
|
|
5635
|
-
if ($[
|
|
5636
|
-
t12 =
|
|
5637
|
-
|
|
5638
|
-
|
|
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 = $[
|
|
5722
|
+
t12 = $[26];
|
|
5645
5723
|
}
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
$[
|
|
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
|
-
|
|
5734
|
+
t14 = $[31];
|
|
5653
5735
|
}
|
|
5654
|
-
const
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
$[
|
|
5660
|
-
$[
|
|
5661
|
-
$[
|
|
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
|
-
|
|
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 ($[
|
|
5670
|
-
t18 = /* @__PURE__ */
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
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 = $[
|
|
5757
|
+
t18 = $[37];
|
|
5676
5758
|
}
|
|
5677
5759
|
let t19;
|
|
5678
|
-
if ($[
|
|
5679
|
-
t19 =
|
|
5680
|
-
|
|
5681
|
-
|
|
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 = $[
|
|
5765
|
+
t19 = $[39];
|
|
5688
5766
|
}
|
|
5689
5767
|
let t20;
|
|
5690
|
-
if ($[
|
|
5691
|
-
t20 = (
|
|
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
|
-
$[
|
|
5773
|
+
$[40] = t20;
|
|
5706
5774
|
} else {
|
|
5707
|
-
|
|
5775
|
+
t20 = $[40];
|
|
5708
5776
|
}
|
|
5709
|
-
let
|
|
5710
|
-
if ($[
|
|
5711
|
-
|
|
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
|
-
$[
|
|
5783
|
+
$[41] = t21;
|
|
5716
5784
|
} else {
|
|
5717
|
-
|
|
5785
|
+
t21 = $[41];
|
|
5718
5786
|
}
|
|
5719
|
-
let
|
|
5720
|
-
if ($[
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
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
|
-
$[
|
|
5726
|
-
$[
|
|
5727
|
-
$[
|
|
5728
|
-
$[
|
|
5793
|
+
$[42] = cardinality;
|
|
5794
|
+
$[43] = disabled;
|
|
5795
|
+
$[44] = t19;
|
|
5796
|
+
$[45] = t22;
|
|
5729
5797
|
} else {
|
|
5730
|
-
|
|
5798
|
+
t22 = $[45];
|
|
5731
5799
|
}
|
|
5732
|
-
let
|
|
5733
|
-
if ($[
|
|
5734
|
-
|
|
5735
|
-
$[
|
|
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
|
-
|
|
5805
|
+
t23 = $[46];
|
|
5738
5806
|
}
|
|
5739
|
-
let
|
|
5740
|
-
if ($[
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
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
|
-
$[
|
|
5746
|
-
$[
|
|
5813
|
+
$[47] = t22;
|
|
5814
|
+
$[48] = t24;
|
|
5747
5815
|
} else {
|
|
5748
|
-
|
|
5816
|
+
t24 = $[48];
|
|
5749
5817
|
}
|
|
5750
|
-
let
|
|
5751
|
-
if ($[
|
|
5752
|
-
|
|
5753
|
-
|
|
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
|
-
|
|
5824
|
+
t25 = $[50];
|
|
5759
5825
|
}
|
|
5760
|
-
let
|
|
5761
|
-
if ($[
|
|
5762
|
-
|
|
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
|
-
$[
|
|
5832
|
+
$[51] = t26;
|
|
5767
5833
|
} else {
|
|
5768
|
-
|
|
5834
|
+
t26 = $[51];
|
|
5769
5835
|
}
|
|
5770
|
-
let
|
|
5771
|
-
if ($[
|
|
5772
|
-
|
|
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
|
-
$[
|
|
5842
|
+
$[52] = t27;
|
|
5777
5843
|
} else {
|
|
5778
|
-
|
|
5844
|
+
t27 = $[52];
|
|
5779
5845
|
}
|
|
5780
|
-
let
|
|
5781
|
-
if ($[
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
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
|
-
$[
|
|
5787
|
-
$[
|
|
5788
|
-
$[
|
|
5789
|
-
$[
|
|
5852
|
+
$[53] = direction;
|
|
5853
|
+
$[54] = disabled;
|
|
5854
|
+
$[55] = t25;
|
|
5855
|
+
$[56] = t28;
|
|
5790
5856
|
} else {
|
|
5791
|
-
|
|
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 ($[
|
|
5795
|
-
t30 = /* @__PURE__ */
|
|
5796
|
-
|
|
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 = $[
|
|
5875
|
+
t30 = $[59];
|
|
5799
5876
|
}
|
|
5800
5877
|
let t31;
|
|
5801
|
-
if ($[63] !==
|
|
5802
|
-
t31 = /* @__PURE__ */ jsxs("div", { className: "col-span-12
|
|
5803
|
-
|
|
5804
|
-
|
|
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
|
-
$[
|
|
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] !==
|
|
5813
|
-
t32 =
|
|
5814
|
-
/* @__PURE__ */ jsx(TextField, { value:
|
|
5815
|
-
|
|
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] =
|
|
5821
|
-
$[67] =
|
|
5822
|
-
$[68] =
|
|
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] !==
|
|
5829
|
-
t33 =
|
|
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
|
-
$[
|
|
5869
|
-
$[
|
|
5870
|
-
$[
|
|
5871
|
-
$[
|
|
5872
|
-
$[
|
|
5873
|
-
$[
|
|
5874
|
-
$[
|
|
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 = $[
|
|
5946
|
+
t34 = $[78];
|
|
5877
5947
|
}
|
|
5878
5948
|
let t35;
|
|
5879
|
-
if ($[
|
|
5880
|
-
t35 = (
|
|
5881
|
-
|
|
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 = $[
|
|
5953
|
+
t35 = $[79];
|
|
5887
5954
|
}
|
|
5888
5955
|
let t36;
|
|
5889
|
-
if ($[
|
|
5890
|
-
t36 =
|
|
5891
|
-
$[
|
|
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 = $[
|
|
5963
|
+
t36 = $[83];
|
|
5894
5964
|
}
|
|
5895
5965
|
let t37;
|
|
5896
|
-
if ($[
|
|
5897
|
-
t37 = /* @__PURE__ */ jsx(
|
|
5898
|
-
$[
|
|
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 = $[
|
|
5970
|
+
t37 = $[84];
|
|
5904
5971
|
}
|
|
5905
5972
|
let t38;
|
|
5906
|
-
if ($[
|
|
5907
|
-
t38 = /* @__PURE__ */
|
|
5908
|
-
|
|
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 = $[
|
|
5981
|
+
t38 = $[86];
|
|
5911
5982
|
}
|
|
5912
5983
|
let t39;
|
|
5913
|
-
if ($[
|
|
5914
|
-
t39 =
|
|
5915
|
-
|
|
5916
|
-
|
|
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 = $[
|
|
5989
|
+
t39 = $[88];
|
|
5922
5990
|
}
|
|
5923
5991
|
let t40;
|
|
5924
|
-
if ($[
|
|
5925
|
-
t40 = (
|
|
5926
|
-
|
|
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 = $[
|
|
5996
|
+
t40 = $[89];
|
|
5932
5997
|
}
|
|
5933
5998
|
let t41;
|
|
5934
|
-
if ($[
|
|
5935
|
-
t41 =
|
|
5936
|
-
$[
|
|
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 = $[
|
|
6006
|
+
t41 = $[93];
|
|
5939
6007
|
}
|
|
5940
6008
|
let t42;
|
|
5941
|
-
if ($[
|
|
5942
|
-
t42 = /* @__PURE__ */ jsx(
|
|
5943
|
-
$[
|
|
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 = $[
|
|
6013
|
+
t42 = $[94];
|
|
5949
6014
|
}
|
|
5950
6015
|
let t43;
|
|
5951
|
-
if ($[
|
|
5952
|
-
t43 = /* @__PURE__ */
|
|
5953
|
-
|
|
5954
|
-
|
|
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
|
-
$[
|
|
5964
|
-
$[
|
|
6021
|
+
$[95] = t41;
|
|
6022
|
+
$[96] = t43;
|
|
5965
6023
|
} else {
|
|
5966
|
-
|
|
6024
|
+
t43 = $[96];
|
|
5967
6025
|
}
|
|
5968
|
-
let
|
|
5969
|
-
if ($[
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
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
|
-
|
|
5978
|
-
|
|
5979
|
-
t44
|
|
6036
|
+
t38,
|
|
6037
|
+
t43
|
|
5980
6038
|
] });
|
|
5981
|
-
$[
|
|
5982
|
-
$[
|
|
5983
|
-
$[
|
|
5984
|
-
$[
|
|
5985
|
-
$[
|
|
5986
|
-
$[
|
|
5987
|
-
$[
|
|
5988
|
-
$[
|
|
5989
|
-
$[
|
|
5990
|
-
$[
|
|
5991
|
-
} else {
|
|
5992
|
-
|
|
5993
|
-
}
|
|
5994
|
-
return
|
|
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(
|
|
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
|
-
|
|
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 ($[
|
|
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
|
-
$[
|
|
7580
|
-
$[
|
|
7652
|
+
$[99] = disabled;
|
|
7653
|
+
$[100] = t10;
|
|
7581
7654
|
} else {
|
|
7582
|
-
t10 = $[
|
|
7655
|
+
t10 = $[100];
|
|
7583
7656
|
}
|
|
7584
7657
|
const t11 = selectedFieldConfigId;
|
|
7585
7658
|
let t12;
|
|
7586
|
-
if ($[
|
|
7659
|
+
if ($[101] !== onWidgetSelectChanged) {
|
|
7587
7660
|
t12 = (value) => onWidgetSelectChanged(value);
|
|
7588
|
-
$[
|
|
7589
|
-
$[
|
|
7661
|
+
$[101] = onWidgetSelectChanged;
|
|
7662
|
+
$[102] = t12;
|
|
7590
7663
|
} else {
|
|
7591
|
-
t12 = $[
|
|
7664
|
+
t12 = $[102];
|
|
7592
7665
|
}
|
|
7593
7666
|
let t13;
|
|
7594
|
-
if ($[
|
|
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
|
-
$[
|
|
7602
|
-
$[
|
|
7674
|
+
$[103] = onDismiss;
|
|
7675
|
+
$[104] = t13;
|
|
7603
7676
|
} else {
|
|
7604
|
-
t13 = $[
|
|
7677
|
+
t13 = $[104];
|
|
7605
7678
|
}
|
|
7606
7679
|
const t14 = Boolean(selectedWidgetError);
|
|
7607
7680
|
let t15;
|
|
7608
|
-
if ($[
|
|
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
|
-
$[
|
|
7611
|
-
$[
|
|
7612
|
-
$[
|
|
7613
|
-
$[
|
|
7614
|
-
$[
|
|
7615
|
-
$[
|
|
7616
|
-
$[
|
|
7617
|
-
$[
|
|
7618
|
-
$[
|
|
7619
|
-
$[
|
|
7620
|
-
$[
|
|
7621
|
-
} else {
|
|
7622
|
-
t15 = $[
|
|
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 ($[
|
|
7698
|
+
if ($[116] !== selectedWidgetError) {
|
|
7626
7699
|
t16 = !!selectedWidgetError && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "ml-3.5", color: "error", children: "Required" });
|
|
7627
|
-
$[
|
|
7628
|
-
$[
|
|
7700
|
+
$[116] = selectedWidgetError;
|
|
7701
|
+
$[117] = t16;
|
|
7629
7702
|
} else {
|
|
7630
|
-
t16 = $[
|
|
7703
|
+
t16 = $[117];
|
|
7631
7704
|
}
|
|
7632
7705
|
let t17;
|
|
7633
|
-
if ($[
|
|
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
|
-
$[
|
|
7639
|
-
$[
|
|
7640
|
-
$[
|
|
7711
|
+
$[118] = t15;
|
|
7712
|
+
$[119] = t16;
|
|
7713
|
+
$[120] = t17;
|
|
7641
7714
|
} else {
|
|
7642
|
-
t17 = $[
|
|
7715
|
+
t17 = $[120];
|
|
7643
7716
|
}
|
|
7644
7717
|
let t18;
|
|
7645
|
-
if ($[
|
|
7646
|
-
t18 = onDelete && values?.id && /* @__PURE__ */ jsx(IconButton, { variant: "ghost", className: "
|
|
7647
|
-
$[
|
|
7648
|
-
$[
|
|
7649
|
-
$[
|
|
7650
|
-
$[
|
|
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 = $[
|
|
7725
|
+
t18 = $[124];
|
|
7653
7726
|
}
|
|
7654
7727
|
let t19;
|
|
7655
|
-
if ($[
|
|
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
|
-
$[
|
|
7661
|
-
$[
|
|
7662
|
-
$[
|
|
7733
|
+
$[125] = t17;
|
|
7734
|
+
$[126] = t18;
|
|
7735
|
+
$[127] = t19;
|
|
7663
7736
|
} else {
|
|
7664
|
-
t19 = $[
|
|
7737
|
+
t19 = $[127];
|
|
7665
7738
|
}
|
|
7666
7739
|
let t20;
|
|
7667
|
-
if ($[
|
|
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
|
-
$[
|
|
7670
|
-
$[
|
|
7671
|
-
$[
|
|
7672
|
-
$[
|
|
7673
|
-
$[
|
|
7674
|
-
$[
|
|
7742
|
+
$[128] = autoUpdateId;
|
|
7743
|
+
$[129] = disabled;
|
|
7744
|
+
$[130] = existing;
|
|
7745
|
+
$[131] = includeIdAndTitle;
|
|
7746
|
+
$[132] = showErrors;
|
|
7747
|
+
$[133] = t20;
|
|
7675
7748
|
} else {
|
|
7676
|
-
t20 = $[
|
|
7749
|
+
t20 = $[133];
|
|
7677
7750
|
}
|
|
7678
7751
|
let t21;
|
|
7679
|
-
if ($[
|
|
7752
|
+
if ($[134] !== disabled) {
|
|
7680
7753
|
t21 = /* @__PURE__ */ jsx("div", { className: "col-span-12", children: /* @__PURE__ */ jsx(AdvancedPropertyValidation, { disabled }) });
|
|
7681
|
-
$[
|
|
7682
|
-
$[
|
|
7754
|
+
$[134] = disabled;
|
|
7755
|
+
$[135] = t21;
|
|
7683
7756
|
} else {
|
|
7684
|
-
t21 = $[
|
|
7757
|
+
t21 = $[135];
|
|
7685
7758
|
}
|
|
7686
7759
|
let t22;
|
|
7687
|
-
if ($[
|
|
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
|
-
$[
|
|
7694
|
-
$[
|
|
7695
|
-
$[
|
|
7696
|
-
$[
|
|
7766
|
+
$[136] = childComponent;
|
|
7767
|
+
$[137] = t20;
|
|
7768
|
+
$[138] = t21;
|
|
7769
|
+
$[139] = t22;
|
|
7697
7770
|
} else {
|
|
7698
|
-
t22 = $[
|
|
7771
|
+
t22 = $[139];
|
|
7699
7772
|
}
|
|
7700
7773
|
let t23;
|
|
7701
|
-
if ($[
|
|
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
|
-
$[
|
|
7708
|
-
$[
|
|
7709
|
-
$[
|
|
7710
|
-
$[
|
|
7711
|
-
$[
|
|
7780
|
+
$[140] = deleteDialogOpen;
|
|
7781
|
+
$[141] = onDelete;
|
|
7782
|
+
$[142] = propertyNamespace;
|
|
7783
|
+
$[143] = values?.id;
|
|
7784
|
+
$[144] = t23;
|
|
7712
7785
|
} else {
|
|
7713
|
-
t23 = $[
|
|
7786
|
+
t23 = $[144];
|
|
7714
7787
|
}
|
|
7715
7788
|
let t24;
|
|
7716
|
-
if ($[
|
|
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
|
-
$[
|
|
7724
|
-
$[
|
|
7725
|
-
$[
|
|
7726
|
-
$[
|
|
7727
|
-
$[
|
|
7796
|
+
$[145] = t10;
|
|
7797
|
+
$[146] = t19;
|
|
7798
|
+
$[147] = t22;
|
|
7799
|
+
$[148] = t23;
|
|
7800
|
+
$[149] = t24;
|
|
7728
7801
|
} else {
|
|
7729
|
-
t24 = $[
|
|
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
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
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
|
-
|
|
8188
|
+
updatePropertyFromWidget as u
|
|
8115
8189
|
};
|
|
8116
|
-
//# sourceMappingURL=PropertyEditView-
|
|
8190
|
+
//# sourceMappingURL=PropertyEditView-Cvryrb3B.js.map
|