@rebasepro/app 0.17.3 → 0.18.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.
- package/README.md +4 -1
- package/dist/components/index.d.ts +0 -3
- package/dist/contexts/AuthControllerContext.d.ts +2 -1
- package/dist/contexts/CustomizationControllerContext.d.ts +2 -1
- package/dist/contexts/DialogsProvider.d.ts +2 -1
- package/dist/contexts/RebaseDataContext.d.ts +10 -1
- package/dist/contexts/StorageSourceContext.d.ts +11 -1
- package/dist/core/RebaseProps.d.ts +2 -12
- package/dist/debug/index.d.ts +19 -0
- package/dist/debug.js +3631 -0
- package/dist/hooks/data/delete.d.ts +16 -7
- package/dist/hooks/data/save.d.ts +18 -4
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useAdminModeController.d.ts +5 -4
- package/dist/hooks/useNavigationGroupLabel.d.ts +17 -0
- package/dist/hooks/useStudioBridge.d.ts +33 -0
- package/dist/index.es.js +2599 -6980
- package/dist/index.es.js.map +1 -1
- package/dist/vitePlugin.d.ts +22 -0
- package/dist/vitePlugin.js +40 -1
- package/package.json +42 -31
- package/src/auth/api.ts +0 -134
- package/src/auth/index.ts +0 -26
- package/src/auth/types.ts +0 -115
- package/src/auth/useRebaseAuthController.ts +0 -345
- package/src/collections/collection_view_config.ts +0 -76
- package/src/collections/entity-display-cache.ts +0 -195
- package/src/collections/entity-display.ts +0 -77
- package/src/collections/entity_image_preview.ts +0 -61
- package/src/collections/filter-operator-resolution.ts +0 -119
- package/src/collections/form-layout.ts +0 -394
- package/src/collections/index.ts +0 -13
- package/src/collections/navigation_from_path.ts +0 -123
- package/src/collections/navigation_utils.ts +0 -171
- package/src/collections/parent_references_from_path.ts +0 -59
- package/src/collections/property-path.ts +0 -30
- package/src/collections/property_presentation.ts +0 -264
- package/src/collections/summary-property.ts +0 -114
- package/src/collections/title-property.ts +0 -312
- package/src/components/AIIcon.tsx +0 -47
- package/src/components/AuthSimulationMenu.tsx +0 -0
- package/src/components/ConfirmationDialog.tsx +0 -48
- package/src/components/Debug/UIReferenceView.tsx +0 -1053
- package/src/components/Debug/UIStyleGuide.tsx +0 -159
- package/src/components/Debug/collection-views/CardViewDemo.tsx +0 -87
- package/src/components/Debug/collection-views/CollectionTableDemo.tsx +0 -107
- package/src/components/Debug/collection-views/KanbanBoardDemo.tsx +0 -89
- package/src/components/Debug/collection-views/index.ts +0 -3
- package/src/components/Debug/collection-views/sample_data.ts +0 -44
- package/src/components/Debug/crm-dashboard/CalendarWidget.tsx +0 -387
- package/src/components/Debug/crm-dashboard/CrmDashboardDemo.tsx +0 -1100
- package/src/components/Debug/crm-dashboard/DashboardMetrics.tsx +0 -131
- package/src/components/Debug/crm-dashboard/PipelineOverview.tsx +0 -288
- package/src/components/Debug/crm-dashboard/RecentActivity.tsx +0 -213
- package/src/components/Debug/crm-dashboard/TaskFilters.tsx +0 -182
- package/src/components/Debug/crm-dashboard/TaskTable.tsx +0 -425
- package/src/components/Debug/crm-dashboard/TasksView.tsx +0 -234
- package/src/components/ErrorTooltip.tsx +0 -12
- package/src/components/ErrorView.tsx +0 -94
- package/src/components/LanguageToggle.tsx +0 -59
- package/src/components/LoginView/LoginView.tsx +0 -1235
- package/src/components/LoginView/index.ts +0 -2
- package/src/components/LoginView/oauth-redirect-flow.ts +0 -184
- package/src/components/NotFoundPage.tsx +0 -27
- package/src/components/RebaseAuth.tsx +0 -27
- package/src/components/RebaseLogo.tsx +0 -88
- package/src/components/SchemaDriftBanner.tsx +0 -102
- package/src/components/UnsavedChangesDialog.tsx +0 -46
- package/src/components/UserDisplay.tsx +0 -54
- package/src/components/UserSelectPopover.tsx +0 -399
- package/src/components/UserSettingsView.tsx +0 -318
- package/src/components/common/index.ts +0 -6
- package/src/components/common/table_height.tsx +0 -21
- package/src/components/common/types.tsx +0 -66
- package/src/components/common/useColumnsIds.tsx +0 -261
- package/src/components/common/useDataTableController.tsx +0 -571
- package/src/components/common/useDebouncedData.ts +0 -49
- package/src/components/common/useScrollRestoration.tsx +0 -68
- package/src/components/index.tsx +0 -26
- package/src/contexts/AdminModeController.tsx +0 -11
- package/src/contexts/AnalyticsContext.tsx +0 -4
- package/src/contexts/AuthControllerContext.tsx +0 -4
- package/src/contexts/CollectionResolverContext.tsx +0 -24
- package/src/contexts/CollectionScopeContext.tsx +0 -68
- package/src/contexts/ComponentOverrideContext.tsx +0 -81
- package/src/contexts/CustomizationControllerContext.tsx +0 -4
- package/src/contexts/DataDriverContext.tsx +0 -4
- package/src/contexts/DataSourcesContext.tsx +0 -36
- package/src/contexts/DatabaseAdminContext.tsx +0 -4
- package/src/contexts/DialogsProvider.tsx +0 -56
- package/src/contexts/EffectiveRoleController.tsx +0 -12
- package/src/contexts/ModeController.tsx +0 -11
- package/src/contexts/RebaseClientInstanceContext.tsx +0 -7
- package/src/contexts/RebaseDataContext.tsx +0 -4
- package/src/contexts/SnackbarProvider.tsx +0 -15
- package/src/contexts/StorageSourceContext.tsx +0 -4
- package/src/contexts/StorageSourcesContext.tsx +0 -30
- package/src/contexts/UserConfigurationPersistenceContext.tsx +0 -4
- package/src/contexts/index.ts +0 -18
- package/src/core/PluginLifecycleManager.tsx +0 -96
- package/src/core/PluginProviderStack.tsx +0 -40
- package/src/core/Rebase.tsx +0 -488
- package/src/core/RebaseProps.tsx +0 -333
- package/src/core/RebaseRouter.tsx +0 -18
- package/src/core/RebaseRoutes.tsx +0 -24
- package/src/core/index.tsx +0 -5
- package/src/hooks/ApiConfigContext.tsx +0 -83
- package/src/hooks/data/collectionQuery.ts +0 -55
- package/src/hooks/data/delete.ts +0 -56
- package/src/hooks/data/save.ts +0 -78
- package/src/hooks/data/useCollection.tsx +0 -183
- package/src/hooks/data/useData.tsx +0 -18
- package/src/hooks/data/useDataOrder.ts +0 -26
- package/src/hooks/data/useFetch.tsx +0 -156
- package/src/hooks/data/useRelationSelector.tsx +0 -280
- package/src/hooks/index.tsx +0 -45
- package/src/hooks/useAdminModeController.tsx +0 -23
- package/src/hooks/useAnalyticsController.tsx +0 -8
- package/src/hooks/useAuthController.tsx +0 -15
- package/src/hooks/useAuthSubscription.ts +0 -130
- package/src/hooks/useBackendStorageSource.ts +0 -295
- package/src/hooks/useBridgeRegistration.tsx +0 -32
- package/src/hooks/useBrowserTitleAndIcon.tsx +0 -23
- package/src/hooks/useBuildAdminModeController.tsx +0 -29
- package/src/hooks/useBuildEffectiveRoleController.tsx +0 -30
- package/src/hooks/useBuildLocalConfigurationPersistence.tsx +0 -83
- package/src/hooks/useBuildModeController.tsx +0 -73
- package/src/hooks/useClipboard.tsx +0 -158
- package/src/hooks/useCollapsedGroups.ts +0 -116
- package/src/hooks/useComponentOverride.tsx +0 -59
- package/src/hooks/useCustomizationController.tsx +0 -14
- package/src/hooks/useDialogsController.tsx +0 -15
- package/src/hooks/useEffectiveRoleController.tsx +0 -10
- package/src/hooks/useLargeLayout.tsx +0 -65
- package/src/hooks/useModeController.tsx +0 -23
- package/src/hooks/useNavigationBlocker.tsx +0 -108
- package/src/hooks/usePermissions.ts +0 -45
- package/src/hooks/useRebaseClient.tsx +0 -10
- package/src/hooks/useRebaseContext.tsx +0 -84
- package/src/hooks/useRebaseRegistry.tsx +0 -91
- package/src/hooks/useResolvedComponent.tsx +0 -195
- package/src/hooks/useSlot.tsx +0 -64
- package/src/hooks/useSnackbarController.tsx +0 -80
- package/src/hooks/useStorageSource.tsx +0 -11
- package/src/hooks/useStudioBridge.tsx +0 -258
- package/src/hooks/useTranslation.ts +0 -38
- package/src/hooks/useUnsavedChangesDialog.tsx +0 -67
- package/src/hooks/useUserConfigurationPersistence.tsx +0 -11
- package/src/i18n/RebaseI18nProvider.tsx +0 -159
- package/src/index.ts +0 -32
- package/src/internal/common.tsx +0 -28
- package/src/internal/useRestoreScroll.tsx +0 -69
- package/src/locales/de.ts +0 -941
- package/src/locales/en.ts +0 -1021
- package/src/locales/es.ts +0 -962
- package/src/locales/fr.ts +0 -941
- package/src/locales/hi.ts +0 -941
- package/src/locales/it.ts +0 -941
- package/src/locales/pt.ts +0 -949
- package/src/util/constants.ts +0 -7
- package/src/util/createFormexStub.tsx +0 -66
- package/src/util/entity_cache.ts +0 -242
- package/src/util/enums.ts +0 -34
- package/src/util/icon_list.ts +0 -22
- package/src/util/icons.tsx +0 -129
- package/src/util/index.ts +0 -13
- package/src/util/local_storage.ts +0 -66
- package/src/util/previews.ts +0 -127
- package/src/util/useStorageUploadController.tsx +0 -354
- package/src/vitePlugin.ts +0 -215
- /package/dist/{components/Debug → debug}/UIReferenceView.d.ts +0 -0
- /package/dist/{components/Debug → debug}/UIStyleGuide.d.ts +0 -0
- /package/dist/{components/Debug → debug}/collection-views/CardViewDemo.d.ts +0 -0
- /package/dist/{components/Debug → debug}/collection-views/CollectionTableDemo.d.ts +0 -0
- /package/dist/{components/Debug → debug}/collection-views/KanbanBoardDemo.d.ts +0 -0
- /package/dist/{components/Debug → debug}/collection-views/index.d.ts +0 -0
- /package/dist/{components/Debug → debug}/collection-views/sample_data.d.ts +0 -0
- /package/dist/{components/Debug → debug}/crm-dashboard/CalendarWidget.d.ts +0 -0
- /package/dist/{components/Debug → debug}/crm-dashboard/CrmDashboardDemo.d.ts +0 -0
- /package/dist/{components/Debug → debug}/crm-dashboard/DashboardMetrics.d.ts +0 -0
- /package/dist/{components/Debug → debug}/crm-dashboard/PipelineOverview.d.ts +0 -0
- /package/dist/{components/Debug → debug}/crm-dashboard/RecentActivity.d.ts +0 -0
- /package/dist/{components/Debug → debug}/crm-dashboard/TaskFilters.d.ts +0 -0
- /package/dist/{components/Debug → debug}/crm-dashboard/TaskTable.d.ts +0 -0
- /package/dist/{components/Debug → debug}/crm-dashboard/TasksView.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Entity,
|
|
1
|
+
import { Entity, User } from "@rebasepro/types";
|
|
2
2
|
import { RebaseContext, AdminCollection } from "@rebasepro/cms-types";
|
|
3
3
|
import { RebaseData } from "@rebasepro/types";
|
|
4
4
|
/**
|
|
@@ -7,26 +7,35 @@ import { RebaseData } from "@rebasepro/types";
|
|
|
7
7
|
export type DeleteEntityWithCallbacksProps<M extends Record<string, any>, USER extends User = User> = {
|
|
8
8
|
entity: Entity<M>;
|
|
9
9
|
collection?: AdminCollection<M>;
|
|
10
|
-
callbacks?: CollectionCallbacks<M, USER>;
|
|
11
10
|
onDeleteSuccess?: (entity: Entity<M>) => void;
|
|
12
11
|
onDeleteFailure?: (entity: Entity<M>, e: Error) => void;
|
|
13
12
|
};
|
|
14
13
|
/**
|
|
15
14
|
* This function is in charge of deleting a entity.
|
|
16
|
-
*
|
|
17
|
-
* It
|
|
18
|
-
*
|
|
15
|
+
*
|
|
16
|
+
* It runs the collection's **`admin.browserCallbacks`** around the delete —
|
|
17
|
+
* `beforeDelete`, then `afterDelete`. Not `callbacks`: that block belongs to
|
|
18
|
+
* the server, which runs it inside the delete it serves, and its bodies are
|
|
19
|
+
* stripped from this bundle entirely.
|
|
20
|
+
*
|
|
21
|
+
* Which matters most for a collection on a `direct`/`custom` transport, where
|
|
22
|
+
* the panel talks to the store itself and no server sees the delete at all —
|
|
23
|
+
* before this ran them, such a collection had no delete callbacks anywhere.
|
|
24
|
+
* This function has been named `deleteEntityWithCallbacks` since it was written
|
|
25
|
+
* and did not run any; it even took a `callbacks` prop and ignored it.
|
|
26
|
+
*
|
|
27
|
+
* A `beforeDelete` that throws blocks the delete, exactly as the server's does:
|
|
28
|
+
* nothing is sent, and `onDeleteFailure` hears about it.
|
|
19
29
|
*
|
|
20
30
|
* @param data
|
|
21
31
|
* @param entity
|
|
22
32
|
* @param collection
|
|
23
|
-
* @param callbacks
|
|
24
33
|
* @param onDeleteSuccess
|
|
25
34
|
* @param onDeleteFailure
|
|
26
35
|
* @param context
|
|
27
36
|
* @group Hooks and utilities
|
|
28
37
|
*/
|
|
29
|
-
export declare function deleteEntityWithCallbacks<M extends Record<string, any>, USER extends User>({ data, entity, collection,
|
|
38
|
+
export declare function deleteEntityWithCallbacks<M extends Record<string, any>, USER extends User>({ data, entity, collection, onDeleteSuccess, onDeleteFailure, context }: DeleteEntityWithCallbacksProps<M> & {
|
|
30
39
|
collection: AdminCollection<M>;
|
|
31
40
|
data: RebaseData;
|
|
32
41
|
context: RebaseContext<USER>;
|
|
@@ -16,14 +16,28 @@ export type SaveEntityWithCallbacksProps<M extends Record<string, unknown>> = {
|
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* This function is in charge of saving a entity.
|
|
19
|
-
*
|
|
20
|
-
* It
|
|
21
|
-
*
|
|
19
|
+
*
|
|
20
|
+
* It runs the collection's **`admin.browserCallbacks`** around the write —
|
|
21
|
+
* `beforeSave`, then `afterSave` or `afterSaveError`. Not `callbacks`: that
|
|
22
|
+
* block belongs to the server, which runs it inside the write it serves, and
|
|
23
|
+
* its bodies are stripped from this bundle entirely.
|
|
24
|
+
*
|
|
25
|
+
* Which matters most for a collection on a `direct`/`custom` transport, where
|
|
26
|
+
* the panel talks to the store itself and no server sees the write at all —
|
|
27
|
+
* before this ran them, such a collection had no write callbacks anywhere. This
|
|
28
|
+
* function has been named `saveEntityWithCallbacks` since it was written and
|
|
29
|
+
* did not run any.
|
|
30
|
+
*
|
|
31
|
+
* A `beforeSave` that throws blocks the write, exactly as the server's does:
|
|
32
|
+
* nothing is sent, and the error reaches `afterSaveError` and the caller.
|
|
33
|
+
*
|
|
34
|
+
* `afterSave`/`afterSaveError` below are the *caller's* UI callbacks — the
|
|
35
|
+
* form's "close the dialog", the table's "clear the editing state" — and are
|
|
36
|
+
* unrelated to the collection's. Both run: the collection's first.
|
|
22
37
|
*
|
|
23
38
|
* @param collection
|
|
24
39
|
* @param path
|
|
25
40
|
* @param entityId
|
|
26
|
-
* @param callbacks
|
|
27
41
|
* @param values
|
|
28
42
|
* @param previousValues
|
|
29
43
|
* @param status
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export * from "./useBackendStorageSource.js";
|
|
|
29
29
|
export * from "./usePermissions.js";
|
|
30
30
|
export * from "./ApiConfigContext.js";
|
|
31
31
|
export * from "./useTranslation.js";
|
|
32
|
+
export * from "./useNavigationGroupLabel.js";
|
|
32
33
|
export * from "./useRebaseClient.js";
|
|
33
34
|
export * from "./useAnalyticsController.js";
|
|
34
35
|
export * from "./useUserConfigurationPersistence.js";
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Use this controller to change the admin mode
|
|
2
|
+
* Use this controller to change the admin mode: `"cms"` for editing data,
|
|
3
|
+
* `"studio"` for the developer tools.
|
|
3
4
|
* @group Hooks and utilities
|
|
4
5
|
*/
|
|
5
6
|
export interface AdminModeController {
|
|
6
|
-
mode: "cms" | "studio"
|
|
7
|
-
setMode: (mode: "cms" | "studio"
|
|
7
|
+
mode: "cms" | "studio";
|
|
8
|
+
setMode: (mode: "cms" | "studio") => void;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
|
-
* Hook to retrieve the current admin mode ("
|
|
11
|
+
* Hook to retrieve the current admin mode (`"cms"` | `"studio"`), and `setMode`
|
|
11
12
|
* to change it.
|
|
12
13
|
*
|
|
13
14
|
* Consider that in order to use this hook you need to have a parent
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The display label for a navigation group.
|
|
3
|
+
*
|
|
4
|
+
* A group *name* is an identifier: `StudioHomePage` orders the built-in groups
|
|
5
|
+
* by comparing against `["Database", "Compute", …]`, `navigationGroupMappings`
|
|
6
|
+
* keys its icons off it, and `AppView.group` sorts views into one by string
|
|
7
|
+
* equality. Translating the name at the point it is declared therefore breaks
|
|
8
|
+
* the ordering and drops the icons in every locale but English — which is
|
|
9
|
+
* exactly what happened the first time the Studio tool list was translated.
|
|
10
|
+
*
|
|
11
|
+
* So the name stays English and the *label* is translated here, at the one
|
|
12
|
+
* place it is drawn. A group Rebase does not ship — anything an app declares
|
|
13
|
+
* itself — has no key and is rendered as written.
|
|
14
|
+
*
|
|
15
|
+
* @group Hooks and utilities
|
|
16
|
+
*/
|
|
17
|
+
export declare function useNavigationGroupLabel(): (group: string) => string;
|
|
@@ -7,8 +7,36 @@ export type { BreadcrumbEntry, BreadcrumbsController };
|
|
|
7
7
|
* When the admin is present, a bridge provider injects real implementations.
|
|
8
8
|
* When the admin is absent, noop defaults ensure Studio works standalone.
|
|
9
9
|
*/
|
|
10
|
+
/**
|
|
11
|
+
* Editing a collection's source through the admin's plan/apply flow.
|
|
12
|
+
*
|
|
13
|
+
* Studio has its own writers — the RLS editor saves a policy, the collection
|
|
14
|
+
* editor saves a property — and until this existed they did not go to the same
|
|
15
|
+
* place. Saving a policy on a mapped table POSTed the rules straight to
|
|
16
|
+
* `/schema-editor/collection/save`: no plan, no dialog, no record of what SQL
|
|
17
|
+
* the change would produce, while the identical edit made two tabs away in the
|
|
18
|
+
* collection editor showed all three.
|
|
19
|
+
*
|
|
20
|
+
* `available` is false when there is no collection editor above this Studio —
|
|
21
|
+
* the hosted console against somebody else's container, or a panel that never
|
|
22
|
+
* enabled it — and the caller falls back to whatever it did before.
|
|
23
|
+
*/
|
|
24
|
+
export interface StudioSchemaEditing {
|
|
25
|
+
available: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Merge `patch` into the collection and take it through plan → confirm →
|
|
28
|
+
* apply: the same dialog `useLiveSchemaEditing` shows the collection
|
|
29
|
+
* editor.
|
|
30
|
+
*
|
|
31
|
+
* Resolves once the change has been applied, or written source-only if
|
|
32
|
+
* that is what was chosen. Rejects with `SchemaChangeCancelled` when the
|
|
33
|
+
* dialog was closed — which is not an error to report, it is an answer.
|
|
34
|
+
*/
|
|
35
|
+
updateCollection: (collectionId: string, patch: Record<string, unknown>) => Promise<void>;
|
|
36
|
+
}
|
|
10
37
|
export interface StudioBridge {
|
|
11
38
|
collectionRegistry: CollectionRegistryController;
|
|
39
|
+
schemaEditing: StudioSchemaEditing;
|
|
12
40
|
sidePanelController: SidePanelController;
|
|
13
41
|
urlController: UrlController;
|
|
14
42
|
navigationState: NavigationStateController;
|
|
@@ -61,6 +89,11 @@ export declare function StudioBridgeProvider({ value, children }: {
|
|
|
61
89
|
value: Partial<StudioBridge>;
|
|
62
90
|
children: React.ReactNode;
|
|
63
91
|
}): React.JSX.Element;
|
|
92
|
+
/**
|
|
93
|
+
* Source editing through the admin's plan/apply dialog. `available` is false
|
|
94
|
+
* when no collection editor is mounted.
|
|
95
|
+
*/
|
|
96
|
+
export declare function useStudioSchemaEditing(): StudioSchemaEditing;
|
|
64
97
|
/** Collection registry — returns noop if the admin is not present. */
|
|
65
98
|
export declare function useStudioCollectionRegistry(): CollectionRegistryController;
|
|
66
99
|
/** Side panel controller — returns noop if the admin is not present. */
|