@rebasepro/types 0.0.1-canary.0 → 0.0.1-canary.0e2f892

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 (104) hide show
  1. package/README.md +1 -1
  2. package/dist/controllers/analytics_controller.d.ts +2 -2
  3. package/dist/controllers/auth.d.ts +52 -6
  4. package/dist/controllers/client.d.ts +170 -0
  5. package/dist/controllers/collection_registry.d.ts +45 -0
  6. package/dist/controllers/customization_controller.d.ts +11 -1
  7. package/dist/controllers/data.d.ts +168 -0
  8. package/dist/controllers/data_driver.d.ts +160 -0
  9. package/dist/controllers/database_admin.d.ts +11 -0
  10. package/dist/controllers/effective_role.d.ts +4 -0
  11. package/dist/controllers/email.d.ts +34 -0
  12. package/dist/controllers/index.d.ts +12 -5
  13. package/dist/controllers/local_config_persistence.d.ts +4 -4
  14. package/dist/controllers/navigation.d.ts +12 -61
  15. package/dist/controllers/registry.d.ts +54 -0
  16. package/dist/controllers/side_entity_controller.d.ts +7 -7
  17. package/dist/controllers/storage.d.ts +24 -26
  18. package/dist/index.d.ts +0 -1
  19. package/dist/index.es.js +119 -14
  20. package/dist/index.es.js.map +1 -1
  21. package/dist/index.umd.js +118 -13
  22. package/dist/index.umd.js.map +1 -1
  23. package/dist/rebase_context.d.ts +40 -26
  24. package/dist/types/backend.d.ts +300 -18
  25. package/dist/types/builders.d.ts +15 -0
  26. package/dist/types/chips.d.ts +1 -1
  27. package/dist/types/collections.d.ts +324 -355
  28. package/dist/types/cron.d.ts +102 -0
  29. package/dist/types/data_source.d.ts +64 -0
  30. package/dist/types/entities.d.ts +29 -24
  31. package/dist/types/entity_actions.d.ts +12 -12
  32. package/dist/types/entity_callbacks.d.ts +12 -12
  33. package/dist/types/entity_link_builder.d.ts +1 -1
  34. package/dist/types/entity_overrides.d.ts +7 -2
  35. package/dist/types/entity_views.d.ts +61 -0
  36. package/dist/types/export_import.d.ts +3 -3
  37. package/dist/types/index.d.ts +9 -5
  38. package/dist/types/plugins.d.ts +228 -225
  39. package/dist/types/properties.d.ts +135 -62
  40. package/dist/types/property_config.d.ts +13 -11
  41. package/dist/types/relations.d.ts +1 -1
  42. package/dist/types/slots.d.ts +252 -0
  43. package/dist/types/translations.d.ts +870 -0
  44. package/dist/types/user_management_delegate.d.ts +43 -0
  45. package/dist/types/websockets.d.ts +45 -0
  46. package/dist/users/user.d.ts +4 -0
  47. package/package.json +99 -131
  48. package/src/controllers/analytics_controller.tsx +2 -2
  49. package/src/controllers/auth.tsx +55 -6
  50. package/src/controllers/client.ts +133 -0
  51. package/src/controllers/collection_registry.ts +57 -0
  52. package/src/controllers/customization_controller.tsx +12 -1
  53. package/src/controllers/data.ts +191 -0
  54. package/src/controllers/{datasource.ts → data_driver.ts} +50 -61
  55. package/src/controllers/database_admin.ts +22 -0
  56. package/src/controllers/effective_role.ts +4 -0
  57. package/src/controllers/email.ts +36 -0
  58. package/src/controllers/index.ts +15 -5
  59. package/src/controllers/local_config_persistence.tsx +4 -4
  60. package/src/controllers/navigation.ts +13 -76
  61. package/src/controllers/registry.ts +65 -0
  62. package/src/controllers/side_entity_controller.tsx +7 -7
  63. package/src/controllers/storage.ts +25 -28
  64. package/src/index.ts +0 -1
  65. package/src/rebase_context.tsx +41 -39
  66. package/src/types/backend.ts +359 -24
  67. package/src/types/builders.ts +17 -0
  68. package/src/types/chips.ts +15 -40
  69. package/src/types/collections.ts +375 -383
  70. package/src/types/cron.ts +149 -0
  71. package/src/types/data_source.ts +145 -0
  72. package/src/types/entities.ts +40 -33
  73. package/src/types/entity_actions.tsx +11 -11
  74. package/src/types/entity_callbacks.ts +12 -12
  75. package/src/types/entity_link_builder.ts +1 -1
  76. package/src/types/entity_overrides.tsx +7 -2
  77. package/src/types/entity_views.tsx +77 -0
  78. package/src/types/export_import.ts +3 -3
  79. package/src/types/index.ts +10 -5
  80. package/src/types/plugins.tsx +280 -261
  81. package/src/types/properties.ts +163 -61
  82. package/src/types/property_config.tsx +11 -11
  83. package/src/types/relations.ts +1 -1
  84. package/src/types/slots.tsx +297 -0
  85. package/src/types/translations.ts +977 -0
  86. package/src/types/user_management_delegate.ts +50 -7
  87. package/src/types/websockets.ts +48 -0
  88. package/src/users/roles.ts +0 -1
  89. package/src/users/user.ts +5 -0
  90. package/dist/components/EntityFormActionsProps.d.ts +0 -17
  91. package/dist/components/EntityFormProps.d.ts +0 -46
  92. package/dist/components/PropertyPreviewProps.d.ts +0 -50
  93. package/dist/components/formex.d.ts +0 -40
  94. package/dist/components/index.d.ts +0 -3
  95. package/dist/controllers/datasource.d.ts +0 -179
  96. package/dist/types/fields.d.ts +0 -221
  97. package/dist/types/rebase.d.ts +0 -180
  98. package/src/components/EntityFormActionsProps.tsx +0 -18
  99. package/src/components/EntityFormProps.tsx +0 -52
  100. package/src/components/PropertyPreviewProps.tsx +0 -61
  101. package/src/components/formex.tsx +0 -46
  102. package/src/components/index.ts +0 -3
  103. package/src/types/fields.tsx +0 -298
  104. package/src/types/rebase.tsx +0 -211
@@ -0,0 +1,77 @@
1
+ import React from "react";
2
+ import type { Entity, EntityValues } from "./entities";
3
+ import type { EntityCollection } from "./collections";
4
+
5
+ /**
6
+ * Context passed to custom fields and entity views.
7
+ * This is the base definition — `@rebasepro/admin` re-exports a
8
+ * fully-typed version that narrows the `formex` field.
9
+ * @group Form custom fields
10
+ */
11
+ export interface FormContext<M extends Record<string, unknown> = Record<string, unknown>> {
12
+
13
+ /**
14
+ * Current values of the entity
15
+ */
16
+ values: M;
17
+
18
+ /**
19
+ * Update the value of a field
20
+ */
21
+ setFieldValue: (key: string, value: unknown, shouldValidate?: boolean) => void;
22
+
23
+ /**
24
+ * Save the entity.
25
+ */
26
+ save: (values: M) => void;
27
+
28
+ /**
29
+ * Collection of the entity being modified
30
+ */
31
+ collection?: EntityCollection<M>;
32
+
33
+ /**
34
+ * Entity id, it can be undefined if it's a new entity
35
+ */
36
+ entityId?: string | number;
37
+
38
+ /**
39
+ * Path this entity is located at
40
+ */
41
+ path?: string;
42
+
43
+ status: "new" | "existing" | "copy";
44
+
45
+ entity?: Entity<M>;
46
+
47
+ savingError?: Error;
48
+
49
+ openEntityMode: "side_panel" | "full_screen" | "split";
50
+
51
+ /**
52
+ * The underlying formex controller that powers the form.
53
+ * Prefer importing `FormContext` from `@rebasepro/admin` for the
54
+ * fully-typed `FormexController<M>` version.
55
+ */
56
+ formex: Record<string, unknown>;
57
+
58
+ disabled: boolean;
59
+ }
60
+
61
+
62
+ export type EntityCustomView<M extends Record<string, unknown> = Record<string, unknown>> = {
63
+ key: string;
64
+ name: string;
65
+ tabComponent?: React.ReactNode;
66
+ includeActions?: boolean | "bottom";
67
+ Builder?: React.ComponentType<EntityCustomViewParams<M>>;
68
+ position?: "start" | "end";
69
+ };
70
+
71
+ export interface EntityCustomViewParams<M extends Record<string, unknown> = Record<string, unknown>> {
72
+ collection: EntityCollection<M>;
73
+ entity?: Entity<M>;
74
+ modifiedValues?: EntityValues<M>;
75
+ formContext: FormContext<M>;
76
+ parentCollectionIds?: string[];
77
+ }
@@ -1,6 +1,6 @@
1
- import { Entity } from "./entities";
2
- import { User } from "../users";
3
- import { RebaseContext } from "../rebase_context";
1
+ import type { Entity } from "./entities";
2
+ import type { User } from "../users";
3
+ import type { RebaseContext } from "../rebase_context";
4
4
 
5
5
  /**
6
6
  * You can use this configuration to add additional fields to the data
@@ -1,20 +1,25 @@
1
1
  export * from "./entities";
2
2
  export * from "./chips";
3
- export * from "./entity_actions";
3
+
4
4
  export * from "./properties";
5
5
  export * from "./collections";
6
6
  export * from "./relations";
7
7
 
8
8
  export * from "./locales";
9
- export * from "./fields";
10
- export * from "./property_config";
11
9
  export * from "./entity_link_builder";
12
10
  export * from "./user_management_delegate";
13
11
  export * from "./entity_callbacks";
14
12
  export * from "./entity_overrides";
15
- export * from "./plugins";
16
- export * from "./rebase";
17
13
  export * from "./export_import";
18
14
  export * from "./modify_collections";
19
15
  export * from "./websockets";
20
16
  export * from "./backend";
17
+ export * from "./translations";
18
+ export * from "./plugins";
19
+ export * from "./builders";
20
+ export * from "./slots";
21
+ export * from "./entity_actions";
22
+ export * from "./property_config";
23
+ export * from "./entity_views";
24
+ export * from "./data_source";
25
+ export * from "./cron";