@rebasepro/types 0.0.1-canary.2 → 0.0.1-canary.4d4fb3e

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 (86) 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 +50 -6
  4. package/dist/controllers/client.d.ts +58 -0
  5. package/dist/controllers/collection_registry.d.ts +44 -0
  6. package/dist/controllers/customization_controller.d.ts +5 -1
  7. package/dist/controllers/data.d.ts +141 -0
  8. package/dist/controllers/{datasource.d.ts → data_driver.d.ts} +25 -36
  9. package/dist/controllers/database_admin.d.ts +11 -0
  10. package/dist/controllers/effective_role.d.ts +4 -0
  11. package/dist/controllers/index.d.ts +11 -5
  12. package/dist/controllers/navigation.d.ts +9 -58
  13. package/dist/controllers/registry.d.ts +51 -0
  14. package/dist/controllers/side_entity_controller.d.ts +1 -2
  15. package/dist/index.d.ts +0 -1
  16. package/dist/index.es.js +113 -12
  17. package/dist/index.es.js.map +1 -1
  18. package/dist/index.umd.js +112 -11
  19. package/dist/index.umd.js.map +1 -1
  20. package/dist/rebase_context.d.ts +35 -25
  21. package/dist/types/backend.d.ts +296 -17
  22. package/dist/types/builders.d.ts +14 -0
  23. package/dist/types/collections.d.ts +166 -241
  24. package/dist/types/data_source.d.ts +64 -0
  25. package/dist/types/entities.d.ts +29 -24
  26. package/dist/types/entity_actions.d.ts +7 -7
  27. package/dist/types/entity_callbacks.d.ts +4 -4
  28. package/dist/types/entity_overrides.d.ts +6 -2
  29. package/dist/types/entity_views.d.ts +61 -0
  30. package/dist/types/index.d.ts +8 -5
  31. package/dist/types/plugins.d.ts +170 -221
  32. package/dist/types/properties.d.ts +17 -29
  33. package/dist/types/property_config.d.ts +13 -11
  34. package/dist/types/slots.d.ts +228 -0
  35. package/dist/types/translations.d.ts +826 -0
  36. package/dist/types/user_management_delegate.d.ts +42 -0
  37. package/dist/types/websockets.d.ts +45 -0
  38. package/dist/users/user.d.ts +4 -0
  39. package/package.json +7 -39
  40. package/src/controllers/analytics_controller.tsx +2 -2
  41. package/src/controllers/auth.tsx +53 -6
  42. package/src/controllers/client.ts +74 -0
  43. package/src/controllers/collection_registry.ts +53 -0
  44. package/src/controllers/customization_controller.tsx +6 -1
  45. package/src/controllers/data.ts +153 -0
  46. package/src/controllers/{datasource.ts → data_driver.ts} +41 -37
  47. package/src/controllers/database_admin.ts +22 -0
  48. package/src/controllers/effective_role.ts +4 -0
  49. package/src/controllers/index.ts +14 -5
  50. package/src/controllers/navigation.ts +9 -73
  51. package/src/controllers/registry.ts +62 -0
  52. package/src/controllers/side_entity_controller.tsx +1 -2
  53. package/src/index.ts +0 -1
  54. package/src/rebase_context.tsx +37 -33
  55. package/src/types/backend.ts +351 -19
  56. package/src/types/builders.ts +16 -0
  57. package/src/types/collections.ts +196 -259
  58. package/src/types/data_source.ts +156 -0
  59. package/src/types/entities.ts +35 -28
  60. package/src/types/entity_actions.tsx +6 -6
  61. package/src/types/entity_callbacks.ts +4 -4
  62. package/src/types/entity_overrides.tsx +6 -2
  63. package/src/types/entity_views.tsx +77 -0
  64. package/src/types/index.ts +9 -5
  65. package/src/types/plugins.tsx +198 -256
  66. package/src/types/properties.ts +22 -31
  67. package/src/types/property_config.tsx +11 -11
  68. package/src/types/slots.tsx +271 -0
  69. package/src/types/translations.ts +923 -0
  70. package/src/types/user_management_delegate.ts +43 -0
  71. package/src/types/websockets.ts +48 -0
  72. package/src/users/user.ts +5 -0
  73. package/dist/components/EntityFormActionsProps.d.ts +0 -17
  74. package/dist/components/EntityFormProps.d.ts +0 -46
  75. package/dist/components/PropertyPreviewProps.d.ts +0 -50
  76. package/dist/components/formex.d.ts +0 -40
  77. package/dist/components/index.d.ts +0 -3
  78. package/dist/types/fields.d.ts +0 -221
  79. package/dist/types/rebase.d.ts +0 -180
  80. package/src/components/EntityFormActionsProps.tsx +0 -18
  81. package/src/components/EntityFormProps.tsx +0 -52
  82. package/src/components/PropertyPreviewProps.tsx +0 -61
  83. package/src/components/formex.tsx +0 -46
  84. package/src/components/index.ts +0 -3
  85. package/src/types/fields.tsx +0 -298
  86. package/src/types/rebase.tsx +0 -211
@@ -0,0 +1,228 @@
1
+ import React from "react";
2
+ import { CollectionActionsProps, EntityTableController, SelectionController, EntityCollection } from "./collections";
3
+ import { Entity } from "./entities";
4
+ import { PluginFormActionProps, PluginGenericProps, PluginHomePageActionsProps, PluginHomePageAdditionalCardsProps } from "./plugins";
5
+ import { Property } from "./properties";
6
+ import { RebaseContext } from "../rebase_context";
7
+ /**
8
+ * Registry mapping slot names to their component prop types.
9
+ * Each key represents a UI extension point in the CMS.
10
+ * @group Plugins
11
+ */
12
+ export interface SlotRegistry {
13
+ "home.actions": PluginGenericProps;
14
+ "home.cards": PluginHomePageAdditionalCardsProps;
15
+ "home.children.start": PluginGenericProps;
16
+ "home.children.end": PluginGenericProps;
17
+ "home.collection.actions": PluginHomePageActionsProps;
18
+ /** Rendered below the logo in the sidebar drawer. */
19
+ "navigation.header": NavigationSlotProps;
20
+ /** Rendered above the collapse toggle at the bottom of the drawer. */
21
+ "navigation.footer": NavigationSlotProps;
22
+ "collection.actions": CollectionActionsProps;
23
+ "collection.actions.start": CollectionActionsProps;
24
+ "collection.header.action": CollectionHeaderActionProps;
25
+ "collection.add-column": CollectionAddColumnProps;
26
+ "collection.error": CollectionErrorProps;
27
+ /** Extra widgets rendered inside the collection toolbar row. */
28
+ "collection.toolbar": CollectionToolbarProps;
29
+ /** Custom empty-state component when a collection has no data. */
30
+ "collection.empty-state": CollectionEmptyStateProps;
31
+ "form.actions": PluginFormActionProps;
32
+ "form.actions.top": PluginFormActionProps;
33
+ /** Rendered before the form title / field list. */
34
+ "form.before": PluginFormActionProps;
35
+ /** Rendered after the form field list. */
36
+ "form.after": PluginFormActionProps;
37
+ /** Per-row actions in entity tables (e.g. bulk actions, row context menus). */
38
+ "entity.row.actions": EntityRowActionsProps;
39
+ /** Inject UI before an individual form field. */
40
+ "entity.field.before": EntityFieldSlotProps;
41
+ /** Inject UI after an individual form field. */
42
+ "entity.field.after": EntityFieldSlotProps;
43
+ /** Custom filter sidebar for a collection. */
44
+ "collection.filter-panel": CollectionFilterPanelProps;
45
+ /** Widget rendered on the dashboard / home page. */
46
+ "dashboard.widget": DashboardWidgetProps;
47
+ /** Cross-collection search bar component. */
48
+ "global.search": GlobalSearchProps;
49
+ /** Top-level toolbar actions rendered in the shell toolbar area. */
50
+ "shell.toolbar": ShellToolbarProps;
51
+ "kanban.setup": KanbanSetupProps;
52
+ "kanban.add-column": KanbanAddColumnProps;
53
+ }
54
+ /**
55
+ * Valid slot names for UI extension points.
56
+ * @group Plugins
57
+ */
58
+ export type SlotName = keyof SlotRegistry;
59
+ /**
60
+ * A single UI component contribution to a named slot.
61
+ * @group Plugins
62
+ */
63
+ export interface SlotContribution<K extends SlotName = SlotName> {
64
+ /**
65
+ * Which slot to contribute to.
66
+ */
67
+ slot: K;
68
+ /**
69
+ * The component to render in the slot.
70
+ * Typed loosely so mixed-slot arrays work.
71
+ * Type safety is provided at the `useSlot` call site.
72
+ */
73
+ Component: React.ComponentType<any>;
74
+ /**
75
+ * Additional props to merge into the slot props before rendering.
76
+ */
77
+ props?: Record<string, any>;
78
+ /**
79
+ * Ordering hint. Lower values render first. Defaults to 50.
80
+ */
81
+ order?: number;
82
+ }
83
+ /**
84
+ * Props for `navigation.header` and `navigation.footer` slots.
85
+ * @group Plugins
86
+ */
87
+ export interface NavigationSlotProps {
88
+ drawerOpen: boolean;
89
+ drawerHovered: boolean;
90
+ context: RebaseContext;
91
+ }
92
+ /**
93
+ * Props for the `collection.toolbar` slot.
94
+ * @group Plugins
95
+ */
96
+ export interface CollectionToolbarProps {
97
+ path: string;
98
+ collection: EntityCollection;
99
+ parentCollectionIds: string[];
100
+ tableController: EntityTableController;
101
+ selectionController: SelectionController;
102
+ }
103
+ /**
104
+ * Props for the `collection.empty-state` slot.
105
+ * @group Plugins
106
+ */
107
+ export interface CollectionEmptyStateProps {
108
+ path: string;
109
+ collection: EntityCollection;
110
+ parentCollectionIds: string[];
111
+ canCreate: boolean;
112
+ onNewClick?: () => void;
113
+ }
114
+ /**
115
+ * Props for the `collection.header.action` slot.
116
+ * @group Plugins
117
+ */
118
+ export interface CollectionHeaderActionProps {
119
+ property: Property;
120
+ propertyKey: string;
121
+ path: string;
122
+ parentCollectionIds: string[];
123
+ onHover: boolean;
124
+ collection: EntityCollection;
125
+ tableController: EntityTableController;
126
+ }
127
+ /**
128
+ * Props for the `collection.add-column` slot.
129
+ * @group Plugins
130
+ */
131
+ export interface CollectionAddColumnProps {
132
+ path: string;
133
+ parentCollectionIds: string[];
134
+ collection: EntityCollection;
135
+ tableController: EntityTableController;
136
+ }
137
+ /**
138
+ * Props for the `collection.error` slot.
139
+ * @group Plugins
140
+ */
141
+ export interface CollectionErrorProps {
142
+ path: string;
143
+ collection: EntityCollection;
144
+ parentCollectionIds?: string[];
145
+ error: Error;
146
+ }
147
+ /**
148
+ * Props for the `kanban.setup` slot.
149
+ * @group Plugins
150
+ */
151
+ export interface KanbanSetupProps {
152
+ collection: EntityCollection;
153
+ fullPath: string;
154
+ parentCollectionIds: string[];
155
+ }
156
+ /**
157
+ * Props for the `kanban.add-column` slot.
158
+ * @group Plugins
159
+ */
160
+ export interface KanbanAddColumnProps {
161
+ collection: EntityCollection;
162
+ fullPath: string;
163
+ parentCollectionIds: string[];
164
+ columnProperty: string;
165
+ }
166
+ /**
167
+ * Props for `entity.row.actions` slot.
168
+ * Rendered for each row in an entity collection table.
169
+ * @group Plugins
170
+ */
171
+ export interface EntityRowActionsProps {
172
+ entity: Entity;
173
+ entityId: string;
174
+ path: string;
175
+ collection: EntityCollection;
176
+ parentCollectionIds: string[];
177
+ selectionController: SelectionController;
178
+ context: RebaseContext;
179
+ }
180
+ /**
181
+ * Props for `entity.field.before` and `entity.field.after` slots.
182
+ * Rendered around individual form fields in the entity edit view.
183
+ * @group Plugins
184
+ */
185
+ export interface EntityFieldSlotProps {
186
+ propertyKey: string;
187
+ property: Property;
188
+ path: string;
189
+ entityId?: string | number;
190
+ collection: EntityCollection;
191
+ context: RebaseContext;
192
+ }
193
+ /**
194
+ * Props for `collection.filter-panel` slot.
195
+ * Custom filter sidebar rendered alongside the collection table.
196
+ * @group Plugins
197
+ */
198
+ export interface CollectionFilterPanelProps {
199
+ path: string;
200
+ collection: EntityCollection;
201
+ parentCollectionIds: string[];
202
+ tableController: EntityTableController;
203
+ context: RebaseContext;
204
+ }
205
+ /**
206
+ * Props for `dashboard.widget` slot.
207
+ * Widgets rendered on the home / dashboard page.
208
+ * @group Plugins
209
+ */
210
+ export interface DashboardWidgetProps {
211
+ context: RebaseContext;
212
+ }
213
+ /**
214
+ * Props for `global.search` slot.
215
+ * Cross-collection search bar rendered in the app shell.
216
+ * @group Plugins
217
+ */
218
+ export interface GlobalSearchProps {
219
+ context: RebaseContext;
220
+ }
221
+ /**
222
+ * Props for `shell.toolbar` slot.
223
+ * Actions rendered in the top-level toolbar / app bar area.
224
+ * @group Plugins
225
+ */
226
+ export interface ShellToolbarProps {
227
+ context: RebaseContext;
228
+ }