@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.
- package/README.md +1 -1
- package/dist/controllers/analytics_controller.d.ts +2 -2
- package/dist/controllers/auth.d.ts +52 -6
- package/dist/controllers/client.d.ts +170 -0
- package/dist/controllers/collection_registry.d.ts +45 -0
- package/dist/controllers/customization_controller.d.ts +11 -1
- package/dist/controllers/data.d.ts +168 -0
- package/dist/controllers/data_driver.d.ts +160 -0
- package/dist/controllers/database_admin.d.ts +11 -0
- package/dist/controllers/effective_role.d.ts +4 -0
- package/dist/controllers/email.d.ts +34 -0
- package/dist/controllers/index.d.ts +12 -5
- package/dist/controllers/local_config_persistence.d.ts +4 -4
- package/dist/controllers/navigation.d.ts +12 -61
- package/dist/controllers/registry.d.ts +54 -0
- package/dist/controllers/side_entity_controller.d.ts +7 -7
- package/dist/controllers/storage.d.ts +24 -26
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +119 -14
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +118 -13
- package/dist/index.umd.js.map +1 -1
- package/dist/rebase_context.d.ts +40 -26
- package/dist/types/backend.d.ts +300 -18
- package/dist/types/builders.d.ts +15 -0
- package/dist/types/chips.d.ts +1 -1
- package/dist/types/collections.d.ts +324 -355
- package/dist/types/cron.d.ts +102 -0
- package/dist/types/data_source.d.ts +64 -0
- package/dist/types/entities.d.ts +29 -24
- package/dist/types/entity_actions.d.ts +12 -12
- package/dist/types/entity_callbacks.d.ts +12 -12
- package/dist/types/entity_link_builder.d.ts +1 -1
- package/dist/types/entity_overrides.d.ts +7 -2
- package/dist/types/entity_views.d.ts +61 -0
- package/dist/types/export_import.d.ts +3 -3
- package/dist/types/index.d.ts +9 -5
- package/dist/types/plugins.d.ts +228 -225
- package/dist/types/properties.d.ts +135 -62
- package/dist/types/property_config.d.ts +13 -11
- package/dist/types/relations.d.ts +1 -1
- package/dist/types/slots.d.ts +252 -0
- package/dist/types/translations.d.ts +870 -0
- package/dist/types/user_management_delegate.d.ts +43 -0
- package/dist/types/websockets.d.ts +45 -0
- package/dist/users/user.d.ts +4 -0
- package/package.json +99 -131
- package/src/controllers/analytics_controller.tsx +2 -2
- package/src/controllers/auth.tsx +55 -6
- package/src/controllers/client.ts +133 -0
- package/src/controllers/collection_registry.ts +57 -0
- package/src/controllers/customization_controller.tsx +12 -1
- package/src/controllers/data.ts +191 -0
- package/src/controllers/{datasource.ts → data_driver.ts} +50 -61
- package/src/controllers/database_admin.ts +22 -0
- package/src/controllers/effective_role.ts +4 -0
- package/src/controllers/email.ts +36 -0
- package/src/controllers/index.ts +15 -5
- package/src/controllers/local_config_persistence.tsx +4 -4
- package/src/controllers/navigation.ts +13 -76
- package/src/controllers/registry.ts +65 -0
- package/src/controllers/side_entity_controller.tsx +7 -7
- package/src/controllers/storage.ts +25 -28
- package/src/index.ts +0 -1
- package/src/rebase_context.tsx +41 -39
- package/src/types/backend.ts +359 -24
- package/src/types/builders.ts +17 -0
- package/src/types/chips.ts +15 -40
- package/src/types/collections.ts +375 -383
- package/src/types/cron.ts +149 -0
- package/src/types/data_source.ts +145 -0
- package/src/types/entities.ts +40 -33
- package/src/types/entity_actions.tsx +11 -11
- package/src/types/entity_callbacks.ts +12 -12
- package/src/types/entity_link_builder.ts +1 -1
- package/src/types/entity_overrides.tsx +7 -2
- package/src/types/entity_views.tsx +77 -0
- package/src/types/export_import.ts +3 -3
- package/src/types/index.ts +10 -5
- package/src/types/plugins.tsx +280 -261
- package/src/types/properties.ts +163 -61
- package/src/types/property_config.tsx +11 -11
- package/src/types/relations.ts +1 -1
- package/src/types/slots.tsx +297 -0
- package/src/types/translations.ts +977 -0
- package/src/types/user_management_delegate.ts +50 -7
- package/src/types/websockets.ts +48 -0
- package/src/users/roles.ts +0 -1
- package/src/users/user.ts +5 -0
- package/dist/components/EntityFormActionsProps.d.ts +0 -17
- package/dist/components/EntityFormProps.d.ts +0 -46
- package/dist/components/PropertyPreviewProps.d.ts +0 -50
- package/dist/components/formex.d.ts +0 -40
- package/dist/components/index.d.ts +0 -3
- package/dist/controllers/datasource.d.ts +0 -179
- package/dist/types/fields.d.ts +0 -221
- package/dist/types/rebase.d.ts +0 -180
- package/src/components/EntityFormActionsProps.tsx +0 -18
- package/src/components/EntityFormProps.tsx +0 -52
- package/src/components/PropertyPreviewProps.tsx +0 -61
- package/src/components/formex.tsx +0 -46
- package/src/components/index.ts +0 -3
- package/src/types/fields.tsx +0 -298
- 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
|
package/src/types/index.ts
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
export * from "./entities";
|
|
2
2
|
export * from "./chips";
|
|
3
|
-
|
|
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";
|