@rebasepro/admin 0.1.0 → 0.2.1
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-MbvXGzEq.js → CollectionEditorDialog-BXIh2AXg.js} +40 -31
- package/dist/CollectionEditorDialog-BXIh2AXg.js.map +1 -0
- package/dist/{CollectionsStudioView-D9X6aiAr.js → CollectionsStudioView-jR8iz_ja.js} +6 -8
- package/dist/CollectionsStudioView-jR8iz_ja.js.map +1 -0
- package/dist/{ContentHomePage-CfVB1eUo.js → ContentHomePage-BQZWuOFb.js} +5 -7
- package/dist/ContentHomePage-BQZWuOFb.js.map +1 -0
- package/dist/{ExportCollectionAction-CUwJg4F9.js → ExportCollectionAction-CMdiiv1L.js} +36 -38
- package/dist/ExportCollectionAction-CMdiiv1L.js.map +1 -0
- package/dist/{ImportCollectionAction-DGa_SF_8.js → ImportCollectionAction-C05lE0IW.js} +5 -7
- package/dist/ImportCollectionAction-C05lE0IW.js.map +1 -0
- package/dist/{PropertyEditView-C4nlYmAc.js → PropertyEditView-BB5xjnhZ.js} +261 -165
- package/dist/PropertyEditView-BB5xjnhZ.js.map +1 -0
- package/dist/{RolesView-CNWxnR8e.js → RolesView-CULIHWZ9.js} +22 -11
- package/dist/RolesView-CULIHWZ9.js.map +1 -0
- package/dist/{UsersView-YiTIcXkA.js → UsersView-D7_AtJ44.js} +7 -71
- package/dist/UsersView-D7_AtJ44.js.map +1 -0
- package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +2 -2
- 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-CtzpHzMQ.js → index-BAM9KCmM.js} +4 -6
- package/dist/index-BAM9KCmM.js.map +1 -0
- package/dist/{index-DKlrVD1m.js → index-CoSNm3e3.js} +3 -3
- package/dist/index-CoSNm3e3.js.map +1 -0
- package/dist/{index-kHJXfLNI.js → index-D5OQhv-T.js} +3 -3
- package/dist/index-D5OQhv-T.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-CwLmSpGp.js → util-DtbWD7LF.js} +5312 -2580
- package/dist/util-DtbWD7LF.js.map +1 -0
- package/package.json +45 -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 +22 -7
- 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/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 +9 -9
- 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 +19 -9
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +2 -2
- 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 +3 -4
- 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/EntityCard.tsx +2 -2
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +18 -16
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +16 -17
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +90 -21
- 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 +4 -4
- 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-MbvXGzEq.js.map +0 -1
- package/dist/CollectionsStudioView-D9X6aiAr.js.map +0 -1
- package/dist/ContentHomePage-CfVB1eUo.js.map +0 -1
- package/dist/ExportCollectionAction-CUwJg4F9.js.map +0 -1
- package/dist/ImportCollectionAction-DGa_SF_8.js.map +0 -1
- package/dist/PropertyEditView-C4nlYmAc.js.map +0 -1
- package/dist/RolesView-CNWxnR8e.js.map +0 -1
- package/dist/UsersView-YiTIcXkA.js.map +0 -1
- package/dist/index-CtzpHzMQ.js.map +0 -1
- package/dist/index-DKlrVD1m.js.map +0 -1
- package/dist/index-kHJXfLNI.js.map +0 -1
- package/dist/util-CwLmSpGp.js.map +0 -1
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import { EditorState, Transaction } from "prosemirror-state";
|
|
3
3
|
import { EditorBubbleItem } from "../components";
|
|
4
4
|
import type { SelectorItem } from "./node-selector";
|
|
5
|
-
import { Button, cls } from "@rebasepro/ui";
|
|
6
|
-
import { BoldIcon, ItalicIcon, StrikethroughIcon, UnderlineIcon, CodeIcon } from "lucide-react";
|
|
5
|
+
import { BoldIcon, Button, cls, CodeIcon, ItalicIcon, StrikethroughIcon, UnderlineIcon } from "@rebasepro/ui";
|
|
7
6
|
import { useProseMirrorContext } from "../hooks/useProseMirrorContext";
|
|
8
7
|
import { isMarkActive } from "../utils/prosemirror-utils";
|
|
9
8
|
import { schema } from "../schema";
|
|
@@ -12,7 +12,7 @@ export function isNodeActive(state: EditorState, type: NodeType, attrs: Record<s
|
|
|
12
12
|
if (!state || !type) return false;
|
|
13
13
|
const selection = state.selection;
|
|
14
14
|
const { $from, to } = selection;
|
|
15
|
-
const node = selection instanceof TextSelection ? undefined : (selection as
|
|
15
|
+
const node = selection instanceof TextSelection ? undefined : (selection as { node?: ProseMirrorNode }).node;
|
|
16
16
|
if (node) {
|
|
17
17
|
return node.type === type && (!attrs || Object.keys(attrs).every((key) => node.attrs[key] === attrs[key]));
|
|
18
18
|
}
|
package/src/form/EntityForm.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import type { EntityFormProps, OnUpdateParams } from "../types/components/Entity
|
|
|
7
7
|
import { deepEqual as equal } from "fast-equals";
|
|
8
8
|
|
|
9
9
|
import { ErrorBoundary } from "@rebasepro/ui";
|
|
10
|
-
import { AlignLeftIcon, CheckIcon, PencilIcon } from "
|
|
10
|
+
import { AlignLeftIcon, CheckIcon, PencilIcon, useDebouncedCallback } from "@rebasepro/ui";
|
|
11
11
|
import { getDefaultValuesFor, getLocalChangesBackup, isHidden, isReadOnly } from "@rebasepro/common";
|
|
12
12
|
|
|
13
13
|
import { saveEntityWithCallbacks, useAuthController, useCustomizationController, useData, useSnackbarController, useTranslation, useSlot } from "@rebasepro/core";
|
|
@@ -15,6 +15,7 @@ import { getFormFieldKeys } from "@rebasepro/core";
|
|
|
15
15
|
import { Alert, Chip, cls, iconSize, paperMixin, Tooltip, Typography } from "@rebasepro/ui";
|
|
16
16
|
import { Formex, FormexController, getIn, setIn, useCreateFormex } from "@rebasepro/formex";
|
|
17
17
|
import { useAnalyticsController } from "@rebasepro/core";
|
|
18
|
+
|
|
18
19
|
import { FormEntry, FormLayout, LabelWithIconAndTooltip, PropertyFieldBinding } from "../form";
|
|
19
20
|
import { z } from "zod";
|
|
20
21
|
import {
|
|
@@ -30,7 +31,6 @@ import { EntityFormActions } from "./EntityFormActions";
|
|
|
30
31
|
import type { EntityFormActionsProps } from "../types/components/EntityFormActionsProps";
|
|
31
32
|
import { LocalChangesMenu } from "./components/LocalChangesMenu";
|
|
32
33
|
|
|
33
|
-
import { useDebouncedCallback } from "@rebasepro/ui";
|
|
34
34
|
import { getEntityTitlePropertyKey } from "../util/previews";
|
|
35
35
|
import { getValueInPath, isObject, mergeDeep } from "@rebasepro/utils";
|
|
36
36
|
import { useCollectionRegistryController, useSideEntityController, useCMSContext } from "../index";
|
|
@@ -163,6 +163,7 @@ export function EntityForm<M extends Record<string, unknown>>({
|
|
|
163
163
|
EntityFormActionsComponent = EntityFormActions,
|
|
164
164
|
showDefaultActions = true,
|
|
165
165
|
showEntityPath = true,
|
|
166
|
+
navigateBack: navigateBackProp,
|
|
166
167
|
children
|
|
167
168
|
}: EntityFormProps<M>) {
|
|
168
169
|
const { t } = useTranslation();
|
|
@@ -170,13 +171,17 @@ export function EntityForm<M extends Record<string, unknown>>({
|
|
|
170
171
|
const collectionRegistryController = useCollectionRegistryController();
|
|
171
172
|
|
|
172
173
|
const navigateBack = useCallback(() => {
|
|
173
|
-
if (
|
|
174
|
-
|
|
174
|
+
if (navigateBackProp) {
|
|
175
|
+
navigateBackProp();
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (openEntityMode === "side_panel" || openEntityMode === "dialog") {
|
|
179
|
+
// If we are in side panel mode or dialog mode, we close the panel
|
|
175
180
|
sideEntityController.close();
|
|
176
181
|
} else {
|
|
177
182
|
window.history.back();
|
|
178
183
|
}
|
|
179
|
-
}, []);
|
|
184
|
+
}, [navigateBackProp, openEntityMode, sideEntityController]);
|
|
180
185
|
|
|
181
186
|
const authController = useAuthController();
|
|
182
187
|
const [status, setStatus] = useState<EntityStatus>(initialStatus);
|
|
@@ -755,7 +760,12 @@ export function EntityForm<M extends Record<string, unknown>>({
|
|
|
755
760
|
id={`form_${path}`}
|
|
756
761
|
className={cls("relative flex flex-row max-w-4xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-6xl w-full h-fit")}>
|
|
757
762
|
|
|
758
|
-
<div className={cls(
|
|
763
|
+
<div className={cls(
|
|
764
|
+
"flex flex-col w-full",
|
|
765
|
+
openEntityMode === "dialog"
|
|
766
|
+
? "pt-4 pb-12 px-6 sm:px-8"
|
|
767
|
+
: "pt-12 pb-16 px-4 sm:px-8 md:px-10"
|
|
768
|
+
)}>
|
|
759
769
|
<div
|
|
760
770
|
className={"flex flex-row gap-4 self-end sticky top-4 z-10"}>
|
|
761
771
|
|
|
@@ -5,8 +5,16 @@ import type { EntityAction, SideEntityController } from "@rebasepro/types";
|
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { Entity, RebaseContext } from "@rebasepro/types";
|
|
7
7
|
import type { EntityFormActionsProps } from "../types/components/EntityFormActionsProps";
|
|
8
|
-
import {
|
|
9
|
-
|
|
8
|
+
import {
|
|
9
|
+
AlertCircleIcon,
|
|
10
|
+
Button,
|
|
11
|
+
cls,
|
|
12
|
+
defaultBorderMixin,
|
|
13
|
+
DialogActions,
|
|
14
|
+
IconButton,
|
|
15
|
+
LoadingButton,
|
|
16
|
+
Typography
|
|
17
|
+
} from "@rebasepro/ui";
|
|
10
18
|
import { useTranslation } from "@rebasepro/core";
|
|
11
19
|
import { FormexController } from "@rebasepro/formex";
|
|
12
20
|
import { useCMSContext } from "../index";
|
|
@@ -90,7 +98,7 @@ type ActionsViewProps<M extends Record<string, unknown>> = {
|
|
|
90
98
|
disabled: boolean,
|
|
91
99
|
status: "new" | "existing" | "copy",
|
|
92
100
|
pluginActions?: any[],
|
|
93
|
-
openEntityMode: "side_panel" | "full_screen" | "split";
|
|
101
|
+
openEntityMode: "side_panel" | "full_screen" | "split" | "dialog";
|
|
94
102
|
navigateBack: () => void;
|
|
95
103
|
formContext: FormContext,
|
|
96
104
|
formex: FormexController<any>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EntityCollection } from "@rebasepro/types";
|
|
1
|
+
import type { EntityCollection, FieldProps as CoreFieldProps } from "@rebasepro/types";
|
|
2
2
|
import type { FieldProps, PropertyFieldBindingProps } from "../types/fields";
|
|
3
3
|
import type { RebasePlugin, PluginFieldBuilderParams, Property } from "@rebasepro/types";
|
|
4
4
|
import React, { ComponentType, ReactElement, Suspense, useCallback, useRef } from "react";
|
|
@@ -118,18 +118,11 @@ function PropertyFieldBindingInternal<M extends Record<string, unknown> = Record
|
|
|
118
118
|
} else if (resolvedProperty.ui?.Field) {
|
|
119
119
|
const resolved = resolveComponentRef(resolvedProperty.ui.Field);
|
|
120
120
|
if (resolved) {
|
|
121
|
-
Component = resolved as ComponentType<FieldProps<
|
|
121
|
+
Component = resolved as ComponentType<FieldProps<Property, unknown, M>>;
|
|
122
122
|
}
|
|
123
123
|
} else {
|
|
124
124
|
const propertyConfig = getFieldConfig(resolvedProperty, customizationController.propertyConfigs);
|
|
125
125
|
if (!propertyConfig) {
|
|
126
|
-
console.log("INTERNAL: Could not find field config for property", {
|
|
127
|
-
propertyKey,
|
|
128
|
-
property,
|
|
129
|
-
resolvedProperty,
|
|
130
|
-
fields: customizationController.propertyConfigs,
|
|
131
|
-
propertyConfig
|
|
132
|
-
});
|
|
133
126
|
throw new Error(`INTERNAL: Could not find field config for property ${propertyKey}`);
|
|
134
127
|
}
|
|
135
128
|
const configProperty = resolveProperty({
|
|
@@ -327,14 +320,14 @@ function useWrappedComponent<T, M extends Record<string, any> = any>(
|
|
|
327
320
|
fieldConfigId: fieldId,
|
|
328
321
|
propertyKey,
|
|
329
322
|
property,
|
|
330
|
-
Field: Component as
|
|
323
|
+
Field: Component as unknown as ComponentType<CoreFieldProps<Property, unknown, Record<string, unknown>>>,
|
|
331
324
|
plugin,
|
|
332
325
|
path,
|
|
333
|
-
collection: collection as
|
|
326
|
+
collection: collection as EntityCollection | undefined
|
|
334
327
|
};
|
|
335
328
|
const enabled = plugin.fieldBuilder.enabled?.(params);
|
|
336
329
|
if (enabled === undefined || enabled)
|
|
337
|
-
Wrapper = plugin.fieldBuilder.wrap(params) as any
|
|
330
|
+
Wrapper = (plugin.fieldBuilder.wrap(params) as unknown as ComponentType<FieldProps<any, any, M>> | null) ?? Wrapper;
|
|
338
331
|
}
|
|
339
332
|
if (!fieldId) {
|
|
340
333
|
console.warn("INTERNAL: Field id not found for property", property);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Property } from "@rebasepro/types";
|
|
2
|
-
import { IconButton, Tooltip, Typography } from "@rebasepro/ui";
|
|
3
|
-
import { InfoIcon } from "lucide-react";
|
|
2
|
+
import { IconButton, InfoIcon, Tooltip, Typography } from "@rebasepro/ui";
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* Normalize an error value to a displayable string.
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
|
|
2
2
|
import type { Properties } from "@rebasepro/types";
|
|
3
3
|
import React, { useState } from "react";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
AlertTriangleIcon,
|
|
6
|
+
Button,
|
|
7
|
+
CheckIcon,
|
|
8
|
+
ChevronDownIcon,
|
|
9
|
+
defaultBorderMixin,
|
|
10
|
+
Dialog,
|
|
11
|
+
DialogActions,
|
|
12
|
+
DialogContent,
|
|
13
|
+
DialogTitle,
|
|
14
|
+
EyeIcon,
|
|
15
|
+
iconSize,
|
|
16
|
+
Menu,
|
|
17
|
+
MenuItem,
|
|
18
|
+
Typography,
|
|
19
|
+
XCircleIcon
|
|
20
|
+
} from "@rebasepro/ui";
|
|
6
21
|
import { FormexController } from "@rebasepro/formex";
|
|
7
22
|
import { useSnackbarController, useTranslation } from "@rebasepro/core";
|
|
8
23
|
import { flattenKeys, removeEntityFromCache } from "@rebasepro/core";
|
|
@@ -5,8 +5,7 @@ import { PreviewSize } from "../../types/components/PropertyPreviewProps";
|
|
|
5
5
|
import { PropertyPreview } from "../../preview";
|
|
6
6
|
|
|
7
7
|
import { cls, IconButton, paperMixin, Tooltip } from "@rebasepro/ui";
|
|
8
|
-
import { FileTextIcon, MinusIcon } from "
|
|
9
|
-
import { ErrorBoundary } from "@rebasepro/ui";
|
|
8
|
+
import { ErrorBoundary, FileTextIcon, MinusIcon } from "@rebasepro/ui";
|
|
10
9
|
import { useTranslation } from "@rebasepro/core";
|
|
11
10
|
|
|
12
11
|
interface StorageItemPreviewProps {
|
|
@@ -11,8 +11,7 @@ import { getIconForProperty } from "../../util/property_utils";
|
|
|
11
11
|
import { getReferenceFrom } from "@rebasepro/common";
|
|
12
12
|
|
|
13
13
|
import { useTranslation, ErrorView } from "@rebasepro/core";
|
|
14
|
-
import { Button, cls, ExpandablePanel, fieldBackgroundMixin, Typography } from "@rebasepro/ui";
|
|
15
|
-
import { PencilIcon } from "lucide-react";
|
|
14
|
+
import { Button, cls, ExpandablePanel, fieldBackgroundMixin, PencilIcon, Typography } from "@rebasepro/ui";
|
|
16
15
|
import { useClearRestoreValue } from "../useClearRestoreValue";
|
|
17
16
|
import { useCollectionRegistryController } from "../../index";
|
|
18
17
|
|
|
@@ -6,8 +6,23 @@ import { DataType, GeoPoint } from "@rebasepro/types";
|
|
|
6
6
|
|
|
7
7
|
import { ArrayContainer } from "../../components/ArrayContainer";
|
|
8
8
|
import { FieldHelperText, LabelWithIconAndTooltip } from "../components";
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import {
|
|
10
|
+
BooleanSwitchWithLabel,
|
|
11
|
+
Button,
|
|
12
|
+
ChevronDownIcon,
|
|
13
|
+
cls,
|
|
14
|
+
DateTimeField,
|
|
15
|
+
defaultBorderMixin,
|
|
16
|
+
ExpandablePanel,
|
|
17
|
+
IconButton,
|
|
18
|
+
iconSize,
|
|
19
|
+
Menu,
|
|
20
|
+
MenuItem,
|
|
21
|
+
MinusIcon,
|
|
22
|
+
PlusIcon,
|
|
23
|
+
TextField,
|
|
24
|
+
Typography
|
|
25
|
+
} from "@rebasepro/ui";
|
|
11
26
|
import { getIconForProperty } from "../../util/property_utils";
|
|
12
27
|
import { useCustomizationController, useTranslation } from "@rebasepro/core";
|
|
13
28
|
import { getIn } from "@rebasepro/formex";
|
|
@@ -125,7 +125,7 @@ export function MapFieldBinding({
|
|
|
125
125
|
|
|
126
126
|
<FieldHelperText includeDescription={includeDescription}
|
|
127
127
|
showError={showError ?? false}
|
|
128
|
-
error={error && !partOfArray ? error
|
|
128
|
+
error={error && !partOfArray ? error : undefined}
|
|
129
129
|
disabled={disabled}
|
|
130
130
|
property={property}/>
|
|
131
131
|
|
|
@@ -4,8 +4,15 @@ import { useAuthController, useStorageSource } from "@rebasepro/core";
|
|
|
4
4
|
import { getIconForProperty } from "../../util/property_utils";
|
|
5
5
|
import type { FieldProps } from "../../types/fields";
|
|
6
6
|
import type { ArrayProperty, StringProperty } from "@rebasepro/types";
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import {
|
|
8
|
+
cls,
|
|
9
|
+
fieldBackgroundDisabledMixin,
|
|
10
|
+
fieldBackgroundHoverMixin,
|
|
11
|
+
fieldBackgroundMixin,
|
|
12
|
+
IconButton,
|
|
13
|
+
Skeleton,
|
|
14
|
+
XIcon
|
|
15
|
+
} from "@rebasepro/ui";
|
|
9
16
|
import type { RebaseEditorProps } from "../../editor";
|
|
10
17
|
import { resolveStorageFilenameString, resolveStoragePathString } from "@rebasepro/common";
|
|
11
18
|
import { randomString } from "@rebasepro/utils";
|
|
@@ -93,7 +100,7 @@ export function MarkdownEditorFieldBinding({
|
|
|
93
100
|
// Update canonical ref with the proper round-tripped value now that ProseMirror is loaded
|
|
94
101
|
canonicalRef.current = canonicalizeMarkdown(value);
|
|
95
102
|
});
|
|
96
|
-
}, []);
|
|
103
|
+
}, []);
|
|
97
104
|
|
|
98
105
|
// Compute the canonical (round-tripped) form of the initial value ONCE.
|
|
99
106
|
// This is what ProseMirror will produce after parse → serialize, so any
|
|
@@ -7,8 +7,7 @@ import { FieldHelperText, LabelWithIconAndTooltip } from "../components";
|
|
|
7
7
|
import { EnumValuesChip } from "../../preview";
|
|
8
8
|
import { getIconForProperty } from "../../util/property_utils";
|
|
9
9
|
import { enumToObjectEntries, getLabelOrConfigFrom } from "@rebasepro/common";
|
|
10
|
-
import { MultiSelect, MultiSelectItem
|
|
11
|
-
import { XIcon } from "lucide-react";
|
|
10
|
+
import { iconSize, MultiSelect, MultiSelectItem, XIcon } from "@rebasepro/ui";
|
|
12
11
|
import { useClearRestoreValue } from "../useClearRestoreValue";
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -9,8 +9,7 @@ import { getIconForProperty } from "../../util/property_utils";
|
|
|
9
9
|
import { getRelationFrom, resolveRelationProperty } from "@rebasepro/common";
|
|
10
10
|
|
|
11
11
|
import { useTranslation, ErrorView } from "@rebasepro/core";
|
|
12
|
-
import { Button, cls, ExpandablePanel, fieldBackgroundMixin, Typography } from "@rebasepro/ui";
|
|
13
|
-
import { PencilIcon } from "lucide-react";
|
|
12
|
+
import { Button, cls, ExpandablePanel, fieldBackgroundMixin, PencilIcon, Typography } from "@rebasepro/ui";
|
|
14
13
|
import { RelationPreview } from "../../preview";
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -23,7 +23,7 @@ import { useCollectionRegistryController } from "../../index";
|
|
|
23
23
|
* @group Form fields
|
|
24
24
|
*/
|
|
25
25
|
export function ReferenceAsStringFieldBinding(props: FieldProps<StringProperty>) {
|
|
26
|
-
if (typeof
|
|
26
|
+
if (typeof props.property.reference?.path !== "string") {
|
|
27
27
|
return <ReadOnlyFieldBinding {...props as FieldProps<Property>}/>;
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -43,7 +43,7 @@ function ReferenceAsStringFieldBindingInternal({
|
|
|
43
43
|
includeDescription,
|
|
44
44
|
size = "medium"
|
|
45
45
|
}: FieldProps<StringProperty>) {
|
|
46
|
-
if (!
|
|
46
|
+
if (!property.reference?.path) {
|
|
47
47
|
throw new Error("Property path is required for ReferenceAsStringFieldBinding");
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -54,7 +54,7 @@ function ReferenceAsStringFieldBindingInternal({
|
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
const collectionRegistryController = useCollectionRegistryController();
|
|
57
|
-
const path =
|
|
57
|
+
const path = property.reference!.path;
|
|
58
58
|
const collection: EntityCollection | undefined = useMemo(() => {
|
|
59
59
|
return path ? collectionRegistryController.getCollection(path) : undefined;
|
|
60
60
|
}, [path]);
|
|
@@ -81,7 +81,7 @@ path });
|
|
|
81
81
|
collection,
|
|
82
82
|
onSingleEntitySelected,
|
|
83
83
|
selectedEntityIds: value ? [value] : undefined,
|
|
84
|
-
fixedFilter:
|
|
84
|
+
fixedFilter: property.reference?.fixedFilter
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
87
|
|
|
@@ -106,13 +106,13 @@ path });
|
|
|
106
106
|
|
|
107
107
|
{referenceValue && <ReferencePreview
|
|
108
108
|
disabled={!path}
|
|
109
|
-
previewProperties={
|
|
109
|
+
previewProperties={property.reference?.ui?.previewProperties}
|
|
110
110
|
hover={!disabled}
|
|
111
111
|
size={size}
|
|
112
112
|
onClick={disabled || isSubmitting ? undefined : onEntryClick}
|
|
113
113
|
reference={referenceValue}
|
|
114
|
-
includeEntityLink={
|
|
115
|
-
includeId={
|
|
114
|
+
includeEntityLink={property.reference?.includeEntityLink}
|
|
115
|
+
includeId={property.reference?.includeId}
|
|
116
116
|
/>}
|
|
117
117
|
|
|
118
118
|
{!value && <div className="justify-center text-left">
|