@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.
Files changed (242) hide show
  1. package/LICENSE +21 -6
  2. package/dist/{CollectionEditorDialog-MbvXGzEq.js → CollectionEditorDialog-BXIh2AXg.js} +40 -31
  3. package/dist/CollectionEditorDialog-BXIh2AXg.js.map +1 -0
  4. package/dist/{CollectionsStudioView-D9X6aiAr.js → CollectionsStudioView-jR8iz_ja.js} +6 -8
  5. package/dist/CollectionsStudioView-jR8iz_ja.js.map +1 -0
  6. package/dist/{ContentHomePage-CfVB1eUo.js → ContentHomePage-BQZWuOFb.js} +5 -7
  7. package/dist/ContentHomePage-BQZWuOFb.js.map +1 -0
  8. package/dist/{ExportCollectionAction-CUwJg4F9.js → ExportCollectionAction-CMdiiv1L.js} +36 -38
  9. package/dist/ExportCollectionAction-CMdiiv1L.js.map +1 -0
  10. package/dist/{ImportCollectionAction-DGa_SF_8.js → ImportCollectionAction-C05lE0IW.js} +5 -7
  11. package/dist/ImportCollectionAction-C05lE0IW.js.map +1 -0
  12. package/dist/{PropertyEditView-C4nlYmAc.js → PropertyEditView-BB5xjnhZ.js} +261 -165
  13. package/dist/PropertyEditView-BB5xjnhZ.js.map +1 -0
  14. package/dist/{RolesView-CNWxnR8e.js → RolesView-CULIHWZ9.js} +22 -11
  15. package/dist/RolesView-CULIHWZ9.js.map +1 -0
  16. package/dist/{UsersView-YiTIcXkA.js → UsersView-D7_AtJ44.js} +7 -71
  17. package/dist/UsersView-D7_AtJ44.js.map +1 -0
  18. package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +2 -2
  19. package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.d.ts +3 -0
  20. package/dist/collection_editor_ui.js +5 -5
  21. package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +1 -1
  22. package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +1 -1
  23. package/dist/components/EntityCollectionView/EntityCollectionListView.d.ts +18 -2
  24. package/dist/components/EntityCollectionView/FilterPresetsButton.d.ts +21 -0
  25. package/dist/components/EntityDetailView.d.ts +31 -0
  26. package/dist/components/EntityEditView.d.ts +3 -2
  27. package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +1 -1
  28. package/dist/components/admin/CreationResultDialog.d.ts +5 -0
  29. package/dist/components/admin/RolesFilterSelect.d.ts +2 -0
  30. package/dist/components/admin/UserRolesSelectField.d.ts +2 -0
  31. package/dist/components/common/default_entity_actions.d.ts +7 -1
  32. package/dist/components/field_configs.d.ts +1 -1
  33. package/dist/components/index.d.ts +1 -0
  34. package/dist/data_import/utils/data.d.ts +1 -1
  35. package/dist/data_import/utils/file_headers.d.ts +6 -1
  36. package/dist/data_import/utils/file_to_json.d.ts +1 -11
  37. package/dist/data_import/utils/transforms.d.ts +11 -0
  38. package/dist/editor.js +2 -4
  39. package/dist/editor.js.map +1 -1
  40. package/dist/form/EntityForm.d.ts +1 -1
  41. package/dist/form/field_bindings/RelationFieldBinding.d.ts +1 -1
  42. package/dist/form/field_bindings/VectorFieldBinding.d.ts +11 -0
  43. package/dist/form/index.d.ts +1 -0
  44. package/dist/hooks/navigation/useResolvedViews.d.ts +2 -1
  45. package/dist/{index-CtzpHzMQ.js → index-BAM9KCmM.js} +4 -6
  46. package/dist/index-BAM9KCmM.js.map +1 -0
  47. package/dist/{index-DKlrVD1m.js → index-CoSNm3e3.js} +3 -3
  48. package/dist/index-CoSNm3e3.js.map +1 -0
  49. package/dist/{index-kHJXfLNI.js → index-D5OQhv-T.js} +3 -3
  50. package/dist/index-D5OQhv-T.js.map +1 -0
  51. package/dist/index.d.ts +4 -1
  52. package/dist/index.js +352 -148
  53. package/dist/index.js.map +1 -1
  54. package/dist/types/components/EntityFormActionsProps.d.ts +1 -1
  55. package/dist/types/components/EntityFormProps.d.ts +2 -1
  56. package/dist/types/fields.d.ts +3 -3
  57. package/dist/util/navigation_utils.d.ts +1 -1
  58. package/dist/{util-CwLmSpGp.js → util-DtbWD7LF.js} +5312 -2580
  59. package/dist/util-DtbWD7LF.js.map +1 -0
  60. package/package.json +45 -39
  61. package/src/collection_editor/ConfigControllerProvider.tsx +1 -1
  62. package/src/collection_editor/ui/AddKanbanColumnAction.tsx +12 -2
  63. package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +1 -2
  64. package/src/collection_editor/ui/EditorCollectionAction.tsx +1 -2
  65. package/src/collection_editor/ui/EditorCollectionActionStart.tsx +1 -2
  66. package/src/collection_editor/ui/EditorEntityAction.tsx +1 -2
  67. package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +1 -2
  68. package/src/collection_editor/ui/NewCollectionButton.tsx +1 -2
  69. package/src/collection_editor/ui/NewCollectionCard.tsx +4 -6
  70. package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +1 -2
  71. package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +10 -2
  72. package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +18 -2
  73. package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +22 -7
  74. package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +16 -2
  75. package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +19 -9
  76. package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +13 -2
  77. package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +24 -2
  78. package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +22 -3
  79. package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +1 -2
  80. package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +11 -2
  81. package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +12 -2
  82. package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +16 -3
  83. package/src/collection_editor/ui/collection_editor/EnumForm.tsx +17 -2
  84. package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +18 -2
  85. package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +1 -2
  86. package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +1 -2
  87. package/src/collection_editor/ui/collection_editor/LayoutModeSwitch.tsx +17 -5
  88. package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +32 -6
  89. package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +7 -7
  90. package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +14 -2
  91. package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +16 -2
  92. package/src/collection_editor/ui/collection_editor/ViewModeSwitch.tsx +9 -2
  93. package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +1 -2
  94. package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +1 -2
  95. package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +9 -2
  96. package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +11 -2
  97. package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +34 -0
  98. package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +15 -7
  99. package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.tsx +1 -2
  100. package/src/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.tsx +15 -3
  101. package/src/collection_editor/ui/collection_editor/properties/conditions/property_paths.ts +1 -1
  102. package/src/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.tsx +1 -2
  103. package/src/collection_editor/useLocalCollectionsConfigController.tsx +0 -2
  104. package/src/collection_editor/validateCollectionJson.ts +9 -9
  105. package/src/components/AdminModeSyncer.tsx +1 -1
  106. package/src/components/ArrayContainer.tsx +19 -15
  107. package/src/components/ClearFilterSortButton.tsx +1 -2
  108. package/src/components/CollectionEditorDialogs.tsx +1 -1
  109. package/src/components/DefaultAppBar.tsx +15 -3
  110. package/src/components/DefaultDrawer.tsx +3 -3
  111. package/src/components/DrawerNavigationGroup.tsx +1 -2
  112. package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +19 -9
  113. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +2 -2
  114. package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +1 -1
  115. package/src/components/EntityCollectionTable/fields/TableMultipleRelationField.tsx +1 -2
  116. package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +1 -2
  117. package/src/components/EntityCollectionTable/fields/TableRelationField.tsx +1 -2
  118. package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +1 -2
  119. package/src/components/EntityCollectionTable/fields/VirtualTableSelect.tsx +0 -1
  120. package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +15 -27
  121. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +3 -4
  122. package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +1 -2
  123. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +3 -5
  124. package/src/components/EntityCollectionTable/table_bindings.tsx +51 -45
  125. package/src/components/EntityCollectionView/Board.tsx +1 -2
  126. package/src/components/EntityCollectionView/BoardColumn.tsx +9 -2
  127. package/src/components/EntityCollectionView/BoardColumnTitle.tsx +5 -4
  128. package/src/components/EntityCollectionView/EntityCard.tsx +2 -2
  129. package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +18 -16
  130. package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +16 -17
  131. package/src/components/EntityCollectionView/EntityCollectionListView.tsx +90 -21
  132. package/src/components/EntityCollectionView/EntityCollectionView.tsx +20 -11
  133. package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +6 -7
  134. package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +14 -5
  135. package/src/components/EntityCollectionView/FilterPresetsButton.tsx +292 -0
  136. package/src/components/EntityCollectionView/FiltersDialog.tsx +1 -2
  137. package/src/components/EntityCollectionView/SplitListView.tsx +76 -25
  138. package/src/components/EntityCollectionView/ViewModeToggle.tsx +20 -7
  139. package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +1 -1
  140. package/src/components/EntityCollectionView/useBoardDataController.tsx +74 -6
  141. package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +1 -1
  142. package/src/components/EntityDetailView.tsx +619 -0
  143. package/src/components/EntityEditView.tsx +29 -10
  144. package/src/components/EntityEditViewFormActions.tsx +20 -7
  145. package/src/components/EntityPreview.tsx +14 -5
  146. package/src/components/EntitySidePanel.tsx +116 -62
  147. package/src/components/EntityView.tsx +1 -2
  148. package/src/components/HomePage/ContentHomePage.tsx +1 -1
  149. package/src/components/HomePage/FavouritesView.tsx +1 -2
  150. package/src/components/HomePage/NavigationCard.tsx +1 -2
  151. package/src/components/HomePage/NavigationCardBinding.tsx +1 -2
  152. package/src/components/HomePage/NavigationGroup.tsx +1 -2
  153. package/src/components/HomePage/SmallNavigationCard.tsx +1 -2
  154. package/src/components/PropertyIdCopyTooltip.tsx +1 -2
  155. package/src/components/RebaseAuthGate.tsx +2 -2
  156. package/src/components/RebaseNavigation.tsx +9 -7
  157. package/src/components/ReferenceTable/EntitySelectionTable.tsx +12 -8
  158. package/src/components/RelationSelector.tsx +34 -6
  159. package/src/components/SearchIconsView.tsx +10 -2
  160. package/src/components/SelectableTable/SelectableTable.tsx +4 -4
  161. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +1 -2
  162. package/src/components/SideDialogs.tsx +63 -38
  163. package/src/components/UserSelector.tsx +30 -6
  164. package/src/components/admin/CreationResultDialog.tsx +135 -0
  165. package/src/components/admin/RolesFilterSelect.tsx +45 -0
  166. package/src/components/admin/RolesView.tsx +53 -14
  167. package/src/components/admin/UserRolesSelectField.tsx +50 -0
  168. package/src/components/admin/UsersView.tsx +41 -124
  169. package/src/components/app/Scaffold.tsx +1 -2
  170. package/src/components/common/default_entity_actions.tsx +119 -12
  171. package/src/components/field_configs.tsx +39 -3
  172. package/src/components/history/EntityHistoryEntry.tsx +1 -2
  173. package/src/components/history/EntityHistoryView.tsx +1 -2
  174. package/src/components/index.ts +2 -0
  175. package/src/data_export/export/BasicExportAction.tsx +35 -38
  176. package/src/data_export/export/ExportCollectionAction.tsx +39 -40
  177. package/src/data_import/components/DataNewPropertiesMapping.tsx +15 -2
  178. package/src/data_import/components/ImportFileUpload.tsx +1 -2
  179. package/src/data_import/components/ImportNewPropertyFieldPreview.tsx +1 -2
  180. package/src/data_import/import/ImportCollectionAction.tsx +21 -8
  181. package/src/data_import/utils/data.ts +23 -5
  182. package/src/data_import/utils/file_headers.ts +13 -89
  183. package/src/data_import/utils/file_to_json.ts +43 -68
  184. package/src/data_import/utils/transforms.ts +47 -0
  185. package/src/editor/components/SlashCommandMenu.tsx +17 -2
  186. package/src/editor/components/editor-bubble-item.tsx +1 -1
  187. package/src/editor/extensions/Image/index.ts +1 -1
  188. package/src/editor/extensions/Image.ts +1 -1
  189. package/src/editor/selectors/color-selector.tsx +1 -2
  190. package/src/editor/selectors/link-selector.tsx +1 -2
  191. package/src/editor/selectors/node-selector.tsx +16 -2
  192. package/src/editor/selectors/text-buttons.tsx +1 -2
  193. package/src/editor/utils/prosemirror-utils.ts +1 -1
  194. package/src/form/EntityForm.tsx +16 -6
  195. package/src/form/EntityFormActions.tsx +11 -3
  196. package/src/form/PropertyFieldBinding.tsx +5 -12
  197. package/src/form/components/FieldHelperText.tsx +1 -2
  198. package/src/form/components/LocalChangesMenu.tsx +17 -2
  199. package/src/form/components/StorageItemPreview.tsx +1 -2
  200. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +1 -2
  201. package/src/form/field_bindings/KeyValueFieldBinding.tsx +17 -2
  202. package/src/form/field_bindings/MapFieldBinding.tsx +1 -1
  203. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +10 -3
  204. package/src/form/field_bindings/MultiSelectFieldBinding.tsx +1 -2
  205. package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +1 -2
  206. package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +7 -7
  207. package/src/form/field_bindings/RelationFieldBinding.tsx +150 -147
  208. package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
  209. package/src/form/field_bindings/SelectFieldBinding.tsx +1 -2
  210. package/src/form/field_bindings/TextFieldBinding.tsx +10 -2
  211. package/src/form/field_bindings/VectorFieldBinding.tsx +202 -0
  212. package/src/form/index.tsx +1 -0
  213. package/src/form/validation.ts +54 -2
  214. package/src/hooks/navigation/useBuildNavigationStateController.tsx +2 -1
  215. package/src/hooks/navigation/useResolvedViews.tsx +30 -15
  216. package/src/hooks/navigation/useTopLevelNavigation.ts +1 -1
  217. package/src/index.ts +6 -0
  218. package/src/preview/PropertyPreview.tsx +1 -1
  219. package/src/preview/components/ImagePreview.tsx +1 -1
  220. package/src/preview/components/UrlComponentPreview.tsx +1 -2
  221. package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -2
  222. package/src/preview/property_previews/SkeletonPropertyComponent.tsx +23 -24
  223. package/src/routes/RebaseRoute.tsx +64 -35
  224. package/src/types/components/EntityFormActionsProps.tsx +1 -1
  225. package/src/types/components/EntityFormProps.tsx +3 -1
  226. package/src/types/fields.tsx +4 -3
  227. package/src/util/navigation_utils.ts +4 -3
  228. package/src/util/previews.ts +1 -1
  229. package/src/util/property_utils.tsx +22 -6
  230. package/src/util/resolutions.ts +2 -2
  231. package/dist/CollectionEditorDialog-MbvXGzEq.js.map +0 -1
  232. package/dist/CollectionsStudioView-D9X6aiAr.js.map +0 -1
  233. package/dist/ContentHomePage-CfVB1eUo.js.map +0 -1
  234. package/dist/ExportCollectionAction-CUwJg4F9.js.map +0 -1
  235. package/dist/ImportCollectionAction-DGa_SF_8.js.map +0 -1
  236. package/dist/PropertyEditView-C4nlYmAc.js.map +0 -1
  237. package/dist/RolesView-CNWxnR8e.js.map +0 -1
  238. package/dist/UsersView-YiTIcXkA.js.map +0 -1
  239. package/dist/index-CtzpHzMQ.js.map +0 -1
  240. package/dist/index-DKlrVD1m.js.map +0 -1
  241. package/dist/index-kHJXfLNI.js.map +0 -1
  242. 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 unknown as { node?: ProseMirrorNode }).node;
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
  }
@@ -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 "lucide-react";
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 (openEntityMode === "side_panel") {
174
- // If we are in side panel mode, we close the side panel
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("flex flex-col w-full pt-12 pb-16 px-4 sm:px-8 md:px-10")}>
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 { Button, cls, defaultBorderMixin, DialogActions, IconButton, LoadingButton, Typography } from "@rebasepro/ui";
9
- import { AlertCircleIcon } from "lucide-react";
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<any>>;
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 any,
323
+ Field: Component as unknown as ComponentType<CoreFieldProps<Property, unknown, Record<string, unknown>>>,
331
324
  plugin,
332
325
  path,
333
- collection: collection as any
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 || Wrapper;
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 { Button, defaultBorderMixin, Dialog, DialogActions, DialogContent, DialogTitle, Menu, MenuItem, Typography , iconSize } from "@rebasepro/ui";
5
- import { XCircleIcon, CheckIcon, ChevronDownIcon, EyeIcon, AlertTriangleIcon } from "lucide-react";
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 "lucide-react";
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 { BooleanSwitchWithLabel, Button, cls, DateTimeField, defaultBorderMixin, ExpandablePanel, IconButton, Menu, MenuItem, TextField, Typography , iconSize } from "@rebasepro/ui";
10
- import { PlusIcon, ChevronDownIcon, MinusIcon } from "lucide-react";
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 as any : undefined}
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 { cls, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, fieldBackgroundMixin, IconButton, Skeleton } from "@rebasepro/ui";
8
- import { XIcon } from "lucide-react";
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
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
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 , iconSize } from "@rebasepro/ui";
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 (props.property as any).reference?.path !== "string") {
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 (!(property as any).reference?.path) {
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 = (property as any).reference.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: (property as any).reference.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={(property as any).reference?.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={(property as any).reference?.includeEntityLink}
115
- includeId={(property as any).reference?.includeId}
114
+ includeEntityLink={property.reference?.includeEntityLink}
115
+ includeId={property.reference?.includeId}
116
116
  />}
117
117
 
118
118
  {!value && <div className="justify-center text-left">