@rebasepro/admin 0.2.3 → 0.3.0

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 (210) hide show
  1. package/dist/{CollectionEditorDialog-CmGXXSY9.js → CollectionEditorDialog-D0VqpLPO.js} +70 -77
  2. package/dist/CollectionEditorDialog-D0VqpLPO.js.map +1 -0
  3. package/dist/{CollectionsStudioView-DcLHT5bU.js → CollectionsStudioView-Bc3Rxxc2.js} +5 -4
  4. package/dist/{CollectionsStudioView-DcLHT5bU.js.map → CollectionsStudioView-Bc3Rxxc2.js.map} +1 -1
  5. package/dist/{ExportCollectionAction-BfN34eWX.js → ExportCollectionAction-Ckc-09BQ.js} +4 -3
  6. package/dist/ExportCollectionAction-Ckc-09BQ.js.map +1 -0
  7. package/dist/{ImportCollectionAction-SZrInjhx.js → ImportCollectionAction-BqjIrC3Z.js} +3 -2
  8. package/dist/{ImportCollectionAction-SZrInjhx.js.map → ImportCollectionAction-BqjIrC3Z.js.map} +1 -1
  9. package/dist/{PropertyEditView-Cvryrb3B.js → PropertyEditView-CvRSV-A2.js} +128 -121
  10. package/dist/PropertyEditView-CvRSV-A2.js.map +1 -0
  11. package/dist/collection_editor/ConfigControllerProvider.d.ts +0 -5
  12. package/dist/collection_editor/index.d.ts +0 -1
  13. package/dist/collection_editor/types/collection_editor_controller.d.ts +0 -2
  14. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +3 -3
  15. package/dist/collection_editor_ui.js +3 -3
  16. package/dist/components/ArrayContainer.d.ts +2 -2
  17. package/dist/components/DefaultAppBar.d.ts +18 -1
  18. package/dist/components/DefaultDrawer.d.ts +51 -3
  19. package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
  20. package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +2 -2
  21. package/dist/components/EntityCollectionTable/table_bindings.d.ts +4 -3
  22. package/dist/components/EntityCollectionView/hooks/useKanbanDragAndDrop.d.ts +4 -3
  23. package/dist/components/EntityEditView.d.ts +2 -1
  24. package/dist/components/HomePage/HomePageDnD.d.ts +3 -3
  25. package/dist/components/PropertyCollectionView.d.ts +1 -1
  26. package/dist/components/PropertyIdCopyTooltip.d.ts +1 -1
  27. package/dist/components/SelectableTable/SelectionStore.d.ts +4 -1
  28. package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -2
  29. package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -2
  30. package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -2
  31. package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -2
  32. package/dist/components/admin/RolesView.d.ts +3 -3
  33. package/dist/components/admin/UsersView.d.ts +3 -3
  34. package/dist/components/app/Drawer.d.ts +8 -1
  35. package/dist/data_export/export/export.d.ts +3 -3
  36. package/dist/editor/components/editor-bubble.d.ts +5 -1
  37. package/dist/editor/components/image-bubble.d.ts +5 -1
  38. package/dist/editor/components/index.d.ts +3 -3
  39. package/dist/editor/components/table-bubble.d.ts +5 -1
  40. package/dist/editor/nodeViews/ReactNodeView.d.ts +4 -1
  41. package/dist/editor/useProseMirror.d.ts +2 -2
  42. package/dist/editor/utils/remove_classes.d.ts +1 -1
  43. package/dist/editor.js +15 -14
  44. package/dist/editor.js.map +1 -1
  45. package/dist/form/EntityForm.d.ts +2 -2
  46. package/dist/form/components/StorageUploadProgress.d.ts +2 -2
  47. package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +1 -1
  48. package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +1 -1
  49. package/dist/form/validation.d.ts +3 -3
  50. package/dist/hooks/navigation/useResolvedCollections.d.ts +6 -0
  51. package/dist/hooks/navigation/useResolvedViews.d.ts +3 -4
  52. package/dist/{index-PLIQXpTt.js → index-BCcLwgfe.js} +3 -2
  53. package/dist/{index-PLIQXpTt.js.map → index-BCcLwgfe.js.map} +1 -1
  54. package/dist/{index-DjduZG1T.js → index-DY2k5TtG.js} +3 -3
  55. package/dist/index-DY2k5TtG.js.map +1 -0
  56. package/dist/{index-MKPc70-v.js → index-UQOMHwt1.js} +3 -3
  57. package/dist/index-UQOMHwt1.js.map +1 -0
  58. package/dist/index.d.ts +1 -1
  59. package/dist/index.js +2813 -372
  60. package/dist/index.js.map +1 -1
  61. package/dist/{markdown-z2Ir7Cgo.js → markdown-DD2JDU1X.js} +2 -2
  62. package/dist/markdown-DD2JDU1X.js.map +1 -0
  63. package/dist/preview/components/UrlComponentPreview.d.ts +1 -0
  64. package/dist/types/components/EntityFormActionsProps.d.ts +1 -1
  65. package/dist/types/components/EntityFormProps.d.ts +2 -2
  66. package/dist/types/fields.d.ts +1 -1
  67. package/dist/{util-DbWax_sV.js → util-ZM9gQuCv.js} +2031 -2078
  68. package/dist/util-ZM9gQuCv.js.map +1 -0
  69. package/package.json +8 -8
  70. package/src/collection_editor/ConfigControllerProvider.tsx +3 -13
  71. package/src/collection_editor/index.ts +1 -3
  72. package/src/collection_editor/types/collection_editor_controller.tsx +0 -3
  73. package/src/collection_editor/ui/EditorCollectionAction.tsx +1 -6
  74. package/src/collection_editor/ui/EditorCollectionActionStart.tsx +1 -6
  75. package/src/collection_editor/ui/EditorEntityAction.tsx +1 -6
  76. package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +7 -14
  77. package/src/collection_editor/ui/NewCollectionCard.tsx +1 -5
  78. package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +3 -8
  79. package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +8 -12
  80. package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +21 -21
  81. package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +4 -4
  82. package/src/collection_editor/ui/collection_editor/EnumForm.tsx +1 -1
  83. package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +3 -3
  84. package/src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx +3 -3
  85. package/src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx +8 -8
  86. package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +5 -5
  87. package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +2 -2
  88. package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +5 -5
  89. package/src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx +5 -5
  90. package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +2 -2
  91. package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +2 -2
  92. package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +8 -8
  93. package/src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx +5 -5
  94. package/src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx +3 -2
  95. package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +2 -2
  96. package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +2 -2
  97. package/src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +1 -1
  98. package/src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +4 -7
  99. package/src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +4 -4
  100. package/src/components/ArrayContainer.tsx +3 -3
  101. package/src/components/DefaultAppBar.tsx +52 -31
  102. package/src/components/DefaultDrawer.tsx +279 -66
  103. package/src/components/DrawerNavigationItem.tsx +1 -1
  104. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +6 -5
  105. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +9 -7
  106. package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +5 -5
  107. package/src/components/EntityCollectionTable/fields/VirtualTableNumberInput.tsx +12 -9
  108. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +2 -2
  109. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -1
  110. package/src/components/EntityCollectionTable/table_bindings.tsx +5 -4
  111. package/src/components/EntityCollectionView/EntityCollectionView.tsx +6 -4
  112. package/src/components/EntityCollectionView/hooks/useCollectionInlineEditor.ts +1 -1
  113. package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +7 -6
  114. package/src/components/EntityDetailView.tsx +46 -24
  115. package/src/components/EntityEditView.tsx +51 -28
  116. package/src/components/EntityEditViewFormActions.tsx +4 -4
  117. package/src/components/EntityPreview.tsx +9 -4
  118. package/src/components/HomePage/HomePageDnD.tsx +3 -2
  119. package/src/components/PropertyCollectionView.tsx +1 -1
  120. package/src/components/PropertyIdCopyTooltip.tsx +1 -1
  121. package/src/components/RebaseLayout.tsx +5 -1
  122. package/src/components/RebaseNavigation.tsx +2 -2
  123. package/src/components/RebaseRouteDefs.tsx +4 -7
  124. package/src/components/RebaseShell.tsx +16 -13
  125. package/src/components/SearchIconsView.tsx +1 -8
  126. package/src/components/SelectableTable/SelectableTable.tsx +8 -11
  127. package/src/components/SelectableTable/SelectionStore.ts +1 -1
  128. package/src/components/SelectableTable/filters/BooleanFilterField.tsx +3 -3
  129. package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +3 -3
  130. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +5 -5
  131. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +3 -3
  132. package/src/components/SideEntityProvider.tsx +2 -1
  133. package/src/components/admin/RolesView.tsx +7 -2
  134. package/src/components/admin/UsersView.tsx +12 -6
  135. package/src/components/app/Drawer.tsx +9 -1
  136. package/src/components/app/Scaffold.tsx +5 -1
  137. package/src/data_export/export/export.ts +17 -17
  138. package/src/data_import/components/DataNewPropertiesMapping.tsx +1 -1
  139. package/src/editor/components/editor-bubble.tsx +32 -9
  140. package/src/editor/components/image-bubble.tsx +27 -11
  141. package/src/editor/components/index.ts +3 -3
  142. package/src/editor/components/table-bubble.tsx +79 -17
  143. package/src/editor/extensions/HighlightDecorationExtension.ts +3 -2
  144. package/src/editor/nodeViews/ReactNodeView.tsx +1 -1
  145. package/src/editor/nodeViews/TaskItemComponent.tsx +9 -8
  146. package/src/editor/schema.ts +135 -59
  147. package/src/editor/selectors/link-selector.tsx +8 -5
  148. package/src/editor/useProseMirror.ts +2 -2
  149. package/src/editor/utils/remove_classes.ts +6 -5
  150. package/src/form/EntityForm.tsx +15 -15
  151. package/src/form/EntityFormActions.tsx +2 -2
  152. package/src/form/PropertyFieldBinding.tsx +64 -64
  153. package/src/form/components/FieldHelperText.tsx +4 -4
  154. package/src/form/components/StorageUploadProgress.tsx +2 -2
  155. package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +1 -1
  156. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +1 -1
  157. package/src/form/field_bindings/BlockFieldBinding.tsx +54 -53
  158. package/src/form/field_bindings/KeyValueFieldBinding.tsx +290 -289
  159. package/src/form/field_bindings/MapFieldBinding.tsx +2 -2
  160. package/src/form/field_bindings/MultiSelectFieldBinding.tsx +2 -2
  161. package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +1 -1
  162. package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +1 -1
  163. package/src/form/field_bindings/ReferenceFieldBinding.tsx +8 -6
  164. package/src/form/field_bindings/RelationFieldBinding.tsx +4 -4
  165. package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
  166. package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
  167. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +84 -84
  168. package/src/form/field_bindings/SwitchFieldBinding.tsx +16 -16
  169. package/src/form/field_bindings/TextFieldBinding.tsx +77 -73
  170. package/src/form/field_bindings/UserSelectFieldBinding.tsx +17 -17
  171. package/src/form/validation.ts +43 -43
  172. package/src/hooks/navigation/useBuildNavigationStateController.tsx +3 -5
  173. package/src/hooks/navigation/useResolvedCollections.ts +27 -7
  174. package/src/hooks/navigation/useResolvedViews.tsx +24 -44
  175. package/src/index.ts +2 -0
  176. package/src/preview/PropertyPreview.tsx +2 -2
  177. package/src/preview/components/ImagePreview.tsx +2 -1
  178. package/src/preview/components/UrlComponentPreview.tsx +11 -2
  179. package/src/preview/components/UserPreview.tsx +1 -1
  180. package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -2
  181. package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +4 -4
  182. package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +3 -3
  183. package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +3 -3
  184. package/src/preview/property_previews/ArrayOfStringsPreview.tsx +3 -2
  185. package/src/preview/property_previews/ArrayOneOfPreview.tsx +6 -8
  186. package/src/preview/property_previews/ArrayPropertyEnumPreview.tsx +1 -1
  187. package/src/preview/property_previews/ArrayPropertyPreview.tsx +3 -3
  188. package/src/preview/property_previews/MapPropertyPreview.tsx +4 -3
  189. package/src/preview/property_previews/NumberPropertyPreview.tsx +5 -3
  190. package/src/preview/property_previews/StringPropertyPreview.tsx +10 -8
  191. package/src/types/components/EntityFormActionsProps.tsx +1 -1
  192. package/src/types/components/EntityFormProps.tsx +2 -2
  193. package/src/types/fields.tsx +2 -2
  194. package/dist/CollectionEditorDialog-CmGXXSY9.js.map +0 -1
  195. package/dist/ContentHomePage-C7vFqKSe.js +0 -1784
  196. package/dist/ContentHomePage-C7vFqKSe.js.map +0 -1
  197. package/dist/ExportCollectionAction-BfN34eWX.js.map +0 -1
  198. package/dist/PropertyEditView-Cvryrb3B.js.map +0 -1
  199. package/dist/RoleChip-QtUFXeTp.js +0 -67
  200. package/dist/RoleChip-QtUFXeTp.js.map +0 -1
  201. package/dist/RolesView-BCb7qwWs.js +0 -437
  202. package/dist/RolesView-BCb7qwWs.js.map +0 -1
  203. package/dist/UsersView-Cex24r8H.js +0 -408
  204. package/dist/UsersView-Cex24r8H.js.map +0 -1
  205. package/dist/collection_editor/types/config_permissions.d.ts +0 -19
  206. package/dist/index-DjduZG1T.js.map +0 -1
  207. package/dist/index-MKPc70-v.js.map +0 -1
  208. package/dist/markdown-z2Ir7Cgo.js.map +0 -1
  209. package/dist/util-DbWax_sV.js.map +0 -1
  210. package/src/collection_editor/types/config_permissions.ts +0 -20
@@ -7,6 +7,15 @@ import { cls, ExternalLinkIcon, FileTextIcon, Tooltip, Typography } from "@rebas
7
7
  import { EmptyValue } from "./EmptyValue";
8
8
  import { getThumbnailMeasure } from "../util";
9
9
 
10
+ export function sanitizeUrl(url: string | undefined): string {
11
+ if (!url) return "about:blank";
12
+ const trimmed = url.trim();
13
+ if (/^(?:javascript|data|vbscript):/i.test(trimmed)) {
14
+ return "about:blank";
15
+ }
16
+ return trimmed;
17
+ }
18
+
10
19
  /**
11
20
  * @group Preview components
12
21
  */
@@ -31,7 +40,7 @@ export function UrlComponentPreview({
31
40
  if (!url || !url.trim()) return <EmptyValue/>;
32
41
  return (
33
42
  <a className="flex gap-4 break-words items-center font-medium text-primary visited:text-primary dark:visited:text-primary dark:text-primary"
34
- href={url}
43
+ href={sanitizeUrl(url)}
35
44
  rel="noopener noreferrer"
36
45
  onMouseDown={(e: React.MouseEvent) => {
37
46
  e.preventDefault();
@@ -60,7 +69,7 @@ export function UrlComponentPreview({
60
69
  return (
61
70
  <Tooltip title={hint}>
62
71
  <a
63
- href={url}
72
+ href={sanitizeUrl(url)}
64
73
  rel="noopener noreferrer"
65
74
  target="_blank"
66
75
  onClick={(e) => e.stopPropagation()}
@@ -17,7 +17,7 @@ import { User } from "@rebasepro/types";
17
17
  export function UserPreview({ value }: PropertyPreviewProps<StringProperty>) {
18
18
  const getUser = useInternalUserManagementController<User>()?.getUser;
19
19
 
20
- if (!value) {
20
+ if (typeof value !== "string" || !value) {
21
21
  return <EmptyValue/>;
22
22
  }
23
23
 
@@ -27,7 +27,7 @@ export function ArrayOfMapsPreview({
27
27
  if (!properties) {
28
28
  throw Error(`You need to specify a 'properties' prop (or specify a custom field) in your map property ${propertyKey}`);
29
29
  }
30
- const values = value;
30
+ const values = value as Record<string, unknown>[];
31
31
  const previewProperties: string[] | undefined = (mapProperty as MapProperty).previewProperties;
32
32
 
33
33
  if (!values) return null;
@@ -43,7 +43,7 @@ export function ArrayOfMapsPreview({
43
43
  <div className="table-auto text-xs">
44
44
  <div>
45
45
  {values &&
46
- values.map((v: any, index: number) => {
46
+ values.map((v, index: number) => {
47
47
  return (
48
48
  <div key={`table_${v}_${index}`}
49
49
  className="border-b last:border-b-0 py-2">
@@ -1,4 +1,4 @@
1
- import type { ArrayProperty, ReferenceProperty } from "@rebasepro/types";
1
+ import type { ArrayProperty, ReferenceProperty, EntityReference } from "@rebasepro/types";
2
2
  import type { PropertyPreviewProps, PreviewSize } from "../../types/components/PropertyPreviewProps";
3
3
  import { ReferencePreview } from "../components/ReferencePreview";
4
4
 
@@ -23,8 +23,8 @@ export function ArrayOfReferencesPreview({
23
23
 
24
24
  return (
25
25
  <div className="flex flex-col w-full">
26
- {value &&
27
- value.map((reference: any, index: number) => {
26
+ {value ?
27
+ (value as EntityReference[]).map((reference, index: number) => {
28
28
  const ofProperty = property.of as ReferenceProperty;
29
29
  return <div className="mt-1 mb-1 w-full"
30
30
  key={`preview_array_ref_${propertyKey}_${index}`}>
@@ -38,7 +38,7 @@ export function ArrayOfReferencesPreview({
38
38
  />
39
39
  </div>;
40
40
  }
41
- )}
41
+ ) : null}
42
42
  </div>
43
43
  );
44
44
  }
@@ -25,8 +25,8 @@ export function ArrayOfRelationsPreview({
25
25
 
26
26
  return (
27
27
  <div className="flex flex-col w-full gap-0.5">
28
- {value &&
29
- value.map((relation: unknown, index: number) => {
28
+ {value ?
29
+ (value as unknown[]).map((relation: unknown, index: number) => {
30
30
  const entityRelation = normalizeToEntityRelation(relation);
31
31
 
32
32
  if (!entityRelation) return null;
@@ -44,7 +44,7 @@ export function ArrayOfRelationsPreview({
44
44
  />
45
45
  </div>
46
46
  );
47
- })}
47
+ }) : null}
48
48
  </div>
49
49
  );
50
50
  }
@@ -34,8 +34,8 @@ export function ArrayOfStorageComponentsPreview({
34
34
  }
35
35
  return (
36
36
  <div className={"flex flex-wrap gap-2"}>
37
- {value &&
38
- value.map((v: any, index: number) =>
37
+ {value ?
38
+ (value as string[]).map((v, index: number) =>
39
39
  <ErrorBoundary key={`preview_array_storage_${propertyKey}_${index}`}>
40
40
  <PropertyPreview
41
41
  propertyKey={propertyKey}
@@ -43,7 +43,7 @@ export function ArrayOfStorageComponentsPreview({
43
43
  property={property.of as Property}
44
44
  size={childSize}/>
45
45
  </ErrorBoundary>
46
- )}
46
+ ) : null}
47
47
  </div>
48
48
  );
49
49
  }
@@ -25,11 +25,12 @@ export function ArrayOfStringsPreview({
25
25
  return <div>{`Unexpected value: ${value}`}</div>;
26
26
  }
27
27
  const stringProperty = property.of as StringProperty;
28
+ const arrayValues = value as string[];
28
29
 
29
30
  return (
30
31
  <div className="flex flex-col gap-2">
31
- {value &&
32
- value.map((v: any, index: number) =>
32
+ {arrayValues &&
33
+ arrayValues.map((v, index: number) =>
33
34
  <div key={`preview_array_strings_${propertyKey}_${index}`}>
34
35
  <ErrorBoundary>
35
36
  <StringPropertyPreview propertyKey={propertyKey}
@@ -33,7 +33,7 @@ export function ArrayOneOfPreview({
33
33
  throw Error(`You need to specify an 'of' or 'oneOf' prop (or specify a custom field) in your array property ${propertyKey}`);
34
34
  }
35
35
 
36
- const values = value;
36
+ const values = value as Record<string, unknown>[];
37
37
 
38
38
  if (!values) return null;
39
39
 
@@ -46,20 +46,18 @@ export function ArrayOneOfPreview({
46
46
  return (
47
47
  <div className={"flex flex-col"}>
48
48
  {values &&
49
- values.map((value: any, index: number) => {
50
- const resolvedProperty = properties[value?.[typeField]];
51
- if (!value || !resolvedProperty) return null;
49
+ values.map((val, index: number) => {
50
+ const resolvedProperty = properties[val?.[typeField] as string];
51
+ if (!val || !resolvedProperty) return null;
52
52
  return (
53
53
  <React.Fragment
54
- key={"preview_array_" + value + "_" + index}>
54
+ key={"preview_array_" + index}>
55
55
  <div className={cls(defaultBorderMixin, "m-1 border-b last:border-b-0 py-2")}>
56
56
  <ErrorBoundary>
57
57
  <PropertyPreview
58
58
  propertyKey={propertyKey}
59
- // @ts-ignore
60
- value={value[valueField]}
59
+ value={val[valueField]}
61
60
  // entity={entity}
62
- // @ts-ignore
63
61
  property={resolvedProperty as Property}
64
62
  size={childSize}/>
65
63
  </ErrorBoundary>
@@ -29,7 +29,7 @@ export function ArrayPropertyEnumPreview({
29
29
  )
30
30
 
31
31
  return <ArrayEnumPreview name={propertyKey}
32
- value={value}
32
+ value={value as string[] | number[]}
33
33
  enumValues={enumValues}
34
34
  size={size}/>;
35
35
  }
@@ -34,7 +34,7 @@ export function ArrayPropertyPreview({
34
34
  authController
35
35
  });
36
36
 
37
- const values = value;
37
+ const values = value as unknown[];
38
38
 
39
39
  if (!values) return null;
40
40
 
@@ -43,7 +43,7 @@ export function ArrayPropertyPreview({
43
43
  return (
44
44
  <div className="w-full flex flex-col gap-2">
45
45
  {values &&
46
- values.map((value: any, index: number) => {
46
+ values.map((val, index: number) => {
47
47
  if (!resolvedProperties) {
48
48
  throw Error("Property resolvedProperties is undefined");
49
49
  }
@@ -56,7 +56,7 @@ export function ArrayPropertyPreview({
56
56
  <ErrorBoundary>
57
57
  <PropertyPreview
58
58
  propertyKey={propertyKey}
59
- value={value}
59
+ value={val}
60
60
  property={of}
61
61
  size={childSize}/>
62
62
  </ErrorBoundary>
@@ -30,6 +30,7 @@ export function MapPropertyPreview({
30
30
  }
31
31
 
32
32
  if (!value) return null;
33
+ const mapValue = value as Record<string, unknown>;
33
34
 
34
35
  const mapPropertyKeys: string[] = Object.keys(mapProperty.properties)
35
36
 
@@ -41,7 +42,7 @@ export function MapPropertyPreview({
41
42
  <ErrorBoundary
42
43
  key={"map_preview_" + mapProperty.name + key + index}>
43
44
  <PropertyPreview propertyKey={key}
44
- value={(value)[key]}
45
+ value={mapValue[key]}
45
46
  property={mapProperty.properties![key]}
46
47
  // entity={entity}
47
48
  size={size}/>
@@ -78,7 +79,7 @@ export function MapPropertyPreview({
78
79
  {!isArrayOrMap &&
79
80
  <PropertyPreview
80
81
  propertyKey={key}
81
- value={(value)[key]}
82
+ value={mapValue[key]}
82
83
  property={childProperty}
83
84
  // entity={entity}
84
85
  size={size}/>}
@@ -90,7 +91,7 @@ export function MapPropertyPreview({
90
91
  <div className={cls(defaultBorderMixin, "border-l pl-4 ml-2 my-2")}>
91
92
  <PropertyPreview
92
93
  propertyKey={key}
93
- value={(value)[key]}
94
+ value={mapValue[key]}
94
95
  property={childProperty}
95
96
  // entity={entity}
96
97
  size={size}/>
@@ -14,16 +14,18 @@ export function NumberPropertyPreview({
14
14
  size
15
15
  }: PropertyPreviewProps<NumberProperty>): React.ReactElement {
16
16
 
17
+ const numValue = value as number;
18
+
17
19
  if (property.enum) {
18
- const enumKey = value;
20
+ const enumKey = numValue;
19
21
  const enumValues = enumToObjectEntries(property.enum);
20
22
  if (!enumValues)
21
- return <span className={size === "small" ? "text-sm" : ""}>{value}</span>;
23
+ return <span className={size === "small" ? "text-sm" : ""}>{numValue}</span>;
22
24
  return <EnumValuesChip
23
25
  enumKey={enumKey}
24
26
  enumValues={enumValues}
25
27
  size={size !== "medium" ? "small" : "medium"}/>;
26
28
  } else {
27
- return <span className={size === "small" ? "text-sm" : ""}>{value}</span>;
29
+ return <span className={size === "small" ? "text-sm" : ""}>{numValue}</span>;
28
30
  }
29
31
  }
@@ -18,8 +18,10 @@ export function StringPropertyPreview({
18
18
  size
19
19
  }: PropertyPreviewProps<StringProperty>): React.ReactElement {
20
20
 
21
+ const strValue = value as string;
22
+
21
23
  if (property.enum) {
22
- const enumKey = value;
24
+ const enumKey = strValue;
23
25
  return <EnumValuesChip
24
26
  enumKey={enumKey}
25
27
  enumValues={property.enum}
@@ -31,19 +33,19 @@ export function StringPropertyPreview({
31
33
  <Chip
32
34
  colorScheme={colorScheme}
33
35
  size={size}>
34
- {value}
36
+ {strValue}
35
37
  </Chip>
36
38
  </ErrorBoundary>);
37
39
  } else if (property.ui?.url) {
38
40
  return (
39
41
  <UrlComponentPreview size={size}
40
- url={value}
42
+ url={strValue}
41
43
  previewType={typeof property.ui?.url === "string" ? property.ui?.url as PreviewType : undefined}/>
42
44
  );
43
45
  } else {
44
- if (!value) return <></>;
45
- const lines = value.split("\n");
46
- return value && value.includes("\n")
46
+ if (!strValue) return <></>;
47
+ const lines = strValue.split("\n");
48
+ return strValue && strValue.includes("\n")
47
49
  ? <div className={cls("overflow-x-scroll overflow-hidden", size === "small" ? "text-sm" : "")}>
48
50
  {lines.map((str: any, index: number) =>
49
51
  <React.Fragment key={`string_preview_${index}`}>
@@ -52,8 +54,8 @@ export function StringPropertyPreview({
52
54
  </React.Fragment>)}
53
55
  </div>
54
56
  : (size === "small"
55
- ? <span className={"text-sm"}>{value}</span>
56
- : <>{value}</>
57
+ ? <span className={"text-sm"}>{strValue}</span>
58
+ : <>{strValue}</>
57
59
  );
58
60
  }
59
61
  }
@@ -9,7 +9,7 @@ export interface EntityFormActionsProps {
9
9
  entity?: Entity;
10
10
  layout: "bottom" | "side" | "responsive";
11
11
  savingError?: Error;
12
- formex: FormexController<any>;
12
+ formex: FormexController<Record<string, unknown>>;
13
13
  disabled: boolean;
14
14
  status: "new" | "existing" | "copy";
15
15
  pluginActions: React.ReactNode[];
@@ -47,10 +47,10 @@ export type EntityFormProps<M extends Record<string, unknown>> = {
47
47
  };
48
48
 
49
49
  export type OnUpdateParams = {
50
- entity: Entity<any>,
50
+ entity: Entity<Record<string, unknown>>,
51
51
  status: EntityStatus,
52
52
  path: string,
53
53
  entityId?: string | number;
54
54
  selectedTab?: string;
55
- collection: EntityCollection<any>
55
+ collection: EntityCollection<Record<string, unknown>>
56
56
  };
@@ -39,8 +39,8 @@ export type DefaultFieldConfig =
39
39
  */
40
40
  export interface FieldProps<
41
41
  P extends Property | Property = Property,
42
- CustomProps = any,
43
- M extends Record<string, any> = any> {
42
+ CustomProps = unknown,
43
+ M extends Record<string, unknown> = Record<string, unknown>> {
44
44
 
45
45
  /**
46
46
  * Key of the property