@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,271 @@
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
+ /**
9
+ * Registry mapping slot names to their component prop types.
10
+ * Each key represents a UI extension point in the CMS.
11
+ * @group Plugins
12
+ */
13
+ export interface SlotRegistry {
14
+ // ── Home page ─────────────────────────────────────────────────────
15
+ "home.actions": PluginGenericProps;
16
+ "home.cards": PluginHomePageAdditionalCardsProps;
17
+ "home.children.start": PluginGenericProps;
18
+ "home.children.end": PluginGenericProps;
19
+ "home.collection.actions": PluginHomePageActionsProps;
20
+
21
+ // ── Navigation / Drawer ───────────────────────────────────────────
22
+ /** Rendered below the logo in the sidebar drawer. */
23
+ "navigation.header": NavigationSlotProps;
24
+ /** Rendered above the collapse toggle at the bottom of the drawer. */
25
+ "navigation.footer": NavigationSlotProps;
26
+
27
+ // ── Collection view ───────────────────────────────────────────────
28
+ "collection.actions": CollectionActionsProps;
29
+ "collection.actions.start": CollectionActionsProps;
30
+ "collection.header.action": CollectionHeaderActionProps;
31
+ "collection.add-column": CollectionAddColumnProps;
32
+ "collection.error": CollectionErrorProps;
33
+ /** Extra widgets rendered inside the collection toolbar row. */
34
+ "collection.toolbar": CollectionToolbarProps;
35
+ /** Custom empty-state component when a collection has no data. */
36
+ "collection.empty-state": CollectionEmptyStateProps;
37
+
38
+ // ── Entity / Form ─────────────────────────────────────────────────
39
+ "form.actions": PluginFormActionProps;
40
+ "form.actions.top": PluginFormActionProps;
41
+ /** Rendered before the form title / field list. */
42
+ "form.before": PluginFormActionProps;
43
+ /** Rendered after the form field list. */
44
+ "form.after": PluginFormActionProps;
45
+
46
+ // ── Entity row actions ────────────────────────────────────────────
47
+ /** Per-row actions in entity tables (e.g. bulk actions, row context menus). */
48
+ "entity.row.actions": EntityRowActionsProps;
49
+
50
+ // ── Entity field decoration ───────────────────────────────────────
51
+ /** Inject UI before an individual form field. */
52
+ "entity.field.before": EntityFieldSlotProps;
53
+ /** Inject UI after an individual form field. */
54
+ "entity.field.after": EntityFieldSlotProps;
55
+
56
+ // ── Collection filter panel ───────────────────────────────────────
57
+ /** Custom filter sidebar for a collection. */
58
+ "collection.filter-panel": CollectionFilterPanelProps;
59
+
60
+ // ── Dashboard ─────────────────────────────────────────────────────
61
+ /** Widget rendered on the dashboard / home page. */
62
+ "dashboard.widget": DashboardWidgetProps;
63
+
64
+ // ── Global ────────────────────────────────────────────────────────
65
+ /** Cross-collection search bar component. */
66
+ "global.search": GlobalSearchProps;
67
+ /** Top-level toolbar actions rendered in the shell toolbar area. */
68
+ "shell.toolbar": ShellToolbarProps;
69
+
70
+ // ── Kanban ────────────────────────────────────────────────────────
71
+ "kanban.setup": KanbanSetupProps;
72
+ "kanban.add-column": KanbanAddColumnProps;
73
+ }
74
+
75
+ /**
76
+ * Valid slot names for UI extension points.
77
+ * @group Plugins
78
+ */
79
+ export type SlotName = keyof SlotRegistry;
80
+
81
+ /**
82
+ * A single UI component contribution to a named slot.
83
+ * @group Plugins
84
+ */
85
+ export interface SlotContribution<K extends SlotName = SlotName> {
86
+ /**
87
+ * Which slot to contribute to.
88
+ */
89
+ slot: K;
90
+
91
+ /**
92
+ * The component to render in the slot.
93
+ * Typed loosely so mixed-slot arrays work.
94
+ * Type safety is provided at the `useSlot` call site.
95
+ */
96
+ Component: React.ComponentType<any>;
97
+
98
+ /**
99
+ * Additional props to merge into the slot props before rendering.
100
+ */
101
+ props?: Record<string, any>;
102
+
103
+ /**
104
+ * Ordering hint. Lower values render first. Defaults to 50.
105
+ */
106
+ order?: number;
107
+ }
108
+
109
+ // ── Prop interfaces for slots ─────────────────────────────────────────
110
+
111
+ /**
112
+ * Props for `navigation.header` and `navigation.footer` slots.
113
+ * @group Plugins
114
+ */
115
+ export interface NavigationSlotProps {
116
+ drawerOpen: boolean;
117
+ drawerHovered: boolean;
118
+ context: RebaseContext;
119
+ }
120
+
121
+ /**
122
+ * Props for the `collection.toolbar` slot.
123
+ * @group Plugins
124
+ */
125
+ export interface CollectionToolbarProps {
126
+ path: string;
127
+ collection: EntityCollection;
128
+ parentCollectionIds: string[];
129
+ tableController: EntityTableController;
130
+ selectionController: SelectionController;
131
+ }
132
+
133
+ /**
134
+ * Props for the `collection.empty-state` slot.
135
+ * @group Plugins
136
+ */
137
+ export interface CollectionEmptyStateProps {
138
+ path: string;
139
+ collection: EntityCollection;
140
+ parentCollectionIds: string[];
141
+ canCreate: boolean;
142
+ onNewClick?: () => void;
143
+ }
144
+
145
+ /**
146
+ * Props for the `collection.header.action` slot.
147
+ * @group Plugins
148
+ */
149
+ export interface CollectionHeaderActionProps {
150
+ property: Property;
151
+ propertyKey: string;
152
+ path: string;
153
+ parentCollectionIds: string[];
154
+ onHover: boolean;
155
+ collection: EntityCollection;
156
+ tableController: EntityTableController;
157
+ }
158
+
159
+ /**
160
+ * Props for the `collection.add-column` slot.
161
+ * @group Plugins
162
+ */
163
+ export interface CollectionAddColumnProps {
164
+ path: string;
165
+ parentCollectionIds: string[];
166
+ collection: EntityCollection;
167
+ tableController: EntityTableController;
168
+ }
169
+
170
+ /**
171
+ * Props for the `collection.error` slot.
172
+ * @group Plugins
173
+ */
174
+ export interface CollectionErrorProps {
175
+ path: string;
176
+ collection: EntityCollection;
177
+ parentCollectionIds?: string[];
178
+ error: Error;
179
+ }
180
+
181
+ /**
182
+ * Props for the `kanban.setup` slot.
183
+ * @group Plugins
184
+ */
185
+ export interface KanbanSetupProps {
186
+ collection: EntityCollection;
187
+ fullPath: string;
188
+ parentCollectionIds: string[];
189
+ }
190
+
191
+ /**
192
+ * Props for the `kanban.add-column` slot.
193
+ * @group Plugins
194
+ */
195
+ export interface KanbanAddColumnProps {
196
+ collection: EntityCollection;
197
+ fullPath: string;
198
+ parentCollectionIds: string[];
199
+ columnProperty: string;
200
+ }
201
+
202
+ // ── New slot prop interfaces ──────────────────────────────────────────
203
+
204
+ /**
205
+ * Props for `entity.row.actions` slot.
206
+ * Rendered for each row in an entity collection table.
207
+ * @group Plugins
208
+ */
209
+ export interface EntityRowActionsProps {
210
+ entity: Entity;
211
+ entityId: string;
212
+ path: string;
213
+ collection: EntityCollection;
214
+ parentCollectionIds: string[];
215
+ selectionController: SelectionController;
216
+ context: RebaseContext;
217
+ }
218
+
219
+ /**
220
+ * Props for `entity.field.before` and `entity.field.after` slots.
221
+ * Rendered around individual form fields in the entity edit view.
222
+ * @group Plugins
223
+ */
224
+ export interface EntityFieldSlotProps {
225
+ propertyKey: string;
226
+ property: Property;
227
+ path: string;
228
+ entityId?: string | number;
229
+ collection: EntityCollection;
230
+ context: RebaseContext;
231
+ }
232
+
233
+ /**
234
+ * Props for `collection.filter-panel` slot.
235
+ * Custom filter sidebar rendered alongside the collection table.
236
+ * @group Plugins
237
+ */
238
+ export interface CollectionFilterPanelProps {
239
+ path: string;
240
+ collection: EntityCollection;
241
+ parentCollectionIds: string[];
242
+ tableController: EntityTableController;
243
+ context: RebaseContext;
244
+ }
245
+
246
+ /**
247
+ * Props for `dashboard.widget` slot.
248
+ * Widgets rendered on the home / dashboard page.
249
+ * @group Plugins
250
+ */
251
+ export interface DashboardWidgetProps {
252
+ context: RebaseContext;
253
+ }
254
+
255
+ /**
256
+ * Props for `global.search` slot.
257
+ * Cross-collection search bar rendered in the app shell.
258
+ * @group Plugins
259
+ */
260
+ export interface GlobalSearchProps {
261
+ context: RebaseContext;
262
+ }
263
+
264
+ /**
265
+ * Props for `shell.toolbar` slot.
266
+ * Actions rendered in the top-level toolbar / app bar area.
267
+ * @group Plugins
268
+ */
269
+ export interface ShellToolbarProps {
270
+ context: RebaseContext;
271
+ }