@rebasepro/app 0.17.3-canary.gdd23447 → 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.
Files changed (185) hide show
  1. package/README.md +4 -1
  2. package/dist/components/index.d.ts +0 -3
  3. package/dist/contexts/AuthControllerContext.d.ts +2 -1
  4. package/dist/contexts/CustomizationControllerContext.d.ts +2 -1
  5. package/dist/contexts/DialogsProvider.d.ts +2 -1
  6. package/dist/contexts/RebaseDataContext.d.ts +10 -1
  7. package/dist/contexts/StorageSourceContext.d.ts +11 -1
  8. package/dist/core/RebaseProps.d.ts +2 -12
  9. package/dist/debug/index.d.ts +19 -0
  10. package/dist/debug.js +3631 -0
  11. package/dist/hooks/data/delete.d.ts +16 -7
  12. package/dist/hooks/data/save.d.ts +18 -4
  13. package/dist/hooks/index.d.ts +1 -0
  14. package/dist/hooks/useAdminModeController.d.ts +5 -4
  15. package/dist/hooks/useNavigationGroupLabel.d.ts +17 -0
  16. package/dist/hooks/useStudioBridge.d.ts +33 -0
  17. package/dist/index.es.js +2599 -6980
  18. package/dist/index.es.js.map +1 -1
  19. package/dist/vitePlugin.d.ts +22 -0
  20. package/dist/vitePlugin.js +40 -1
  21. package/package.json +42 -31
  22. package/src/auth/api.ts +0 -134
  23. package/src/auth/index.ts +0 -26
  24. package/src/auth/types.ts +0 -115
  25. package/src/auth/useRebaseAuthController.ts +0 -345
  26. package/src/collections/collection_view_config.ts +0 -76
  27. package/src/collections/entity-display-cache.ts +0 -195
  28. package/src/collections/entity-display.ts +0 -77
  29. package/src/collections/entity_image_preview.ts +0 -61
  30. package/src/collections/filter-operator-resolution.ts +0 -119
  31. package/src/collections/form-layout.ts +0 -394
  32. package/src/collections/index.ts +0 -13
  33. package/src/collections/navigation_from_path.ts +0 -123
  34. package/src/collections/navigation_utils.ts +0 -171
  35. package/src/collections/parent_references_from_path.ts +0 -59
  36. package/src/collections/property-path.ts +0 -30
  37. package/src/collections/property_presentation.ts +0 -264
  38. package/src/collections/summary-property.ts +0 -114
  39. package/src/collections/title-property.ts +0 -312
  40. package/src/components/AIIcon.tsx +0 -47
  41. package/src/components/AuthSimulationMenu.tsx +0 -0
  42. package/src/components/ConfirmationDialog.tsx +0 -48
  43. package/src/components/Debug/UIReferenceView.tsx +0 -1053
  44. package/src/components/Debug/UIStyleGuide.tsx +0 -159
  45. package/src/components/Debug/collection-views/CardViewDemo.tsx +0 -87
  46. package/src/components/Debug/collection-views/CollectionTableDemo.tsx +0 -107
  47. package/src/components/Debug/collection-views/KanbanBoardDemo.tsx +0 -89
  48. package/src/components/Debug/collection-views/index.ts +0 -3
  49. package/src/components/Debug/collection-views/sample_data.ts +0 -44
  50. package/src/components/Debug/crm-dashboard/CalendarWidget.tsx +0 -387
  51. package/src/components/Debug/crm-dashboard/CrmDashboardDemo.tsx +0 -1100
  52. package/src/components/Debug/crm-dashboard/DashboardMetrics.tsx +0 -131
  53. package/src/components/Debug/crm-dashboard/PipelineOverview.tsx +0 -288
  54. package/src/components/Debug/crm-dashboard/RecentActivity.tsx +0 -213
  55. package/src/components/Debug/crm-dashboard/TaskFilters.tsx +0 -182
  56. package/src/components/Debug/crm-dashboard/TaskTable.tsx +0 -425
  57. package/src/components/Debug/crm-dashboard/TasksView.tsx +0 -234
  58. package/src/components/ErrorTooltip.tsx +0 -12
  59. package/src/components/ErrorView.tsx +0 -94
  60. package/src/components/LanguageToggle.tsx +0 -59
  61. package/src/components/LoginView/LoginView.tsx +0 -1235
  62. package/src/components/LoginView/index.ts +0 -2
  63. package/src/components/LoginView/oauth-redirect-flow.ts +0 -184
  64. package/src/components/NotFoundPage.tsx +0 -27
  65. package/src/components/RebaseAuth.tsx +0 -27
  66. package/src/components/RebaseLogo.tsx +0 -88
  67. package/src/components/SchemaDriftBanner.tsx +0 -102
  68. package/src/components/UnsavedChangesDialog.tsx +0 -46
  69. package/src/components/UserDisplay.tsx +0 -54
  70. package/src/components/UserSelectPopover.tsx +0 -399
  71. package/src/components/UserSettingsView.tsx +0 -318
  72. package/src/components/common/index.ts +0 -6
  73. package/src/components/common/table_height.tsx +0 -21
  74. package/src/components/common/types.tsx +0 -66
  75. package/src/components/common/useColumnsIds.tsx +0 -261
  76. package/src/components/common/useDataTableController.tsx +0 -571
  77. package/src/components/common/useDebouncedData.ts +0 -49
  78. package/src/components/common/useScrollRestoration.tsx +0 -68
  79. package/src/components/index.tsx +0 -26
  80. package/src/contexts/AdminModeController.tsx +0 -11
  81. package/src/contexts/AnalyticsContext.tsx +0 -4
  82. package/src/contexts/AuthControllerContext.tsx +0 -4
  83. package/src/contexts/CollectionResolverContext.tsx +0 -24
  84. package/src/contexts/CollectionScopeContext.tsx +0 -68
  85. package/src/contexts/ComponentOverrideContext.tsx +0 -81
  86. package/src/contexts/CustomizationControllerContext.tsx +0 -4
  87. package/src/contexts/DataDriverContext.tsx +0 -4
  88. package/src/contexts/DataSourcesContext.tsx +0 -36
  89. package/src/contexts/DatabaseAdminContext.tsx +0 -4
  90. package/src/contexts/DialogsProvider.tsx +0 -56
  91. package/src/contexts/EffectiveRoleController.tsx +0 -12
  92. package/src/contexts/ModeController.tsx +0 -11
  93. package/src/contexts/RebaseClientInstanceContext.tsx +0 -7
  94. package/src/contexts/RebaseDataContext.tsx +0 -4
  95. package/src/contexts/SnackbarProvider.tsx +0 -15
  96. package/src/contexts/StorageSourceContext.tsx +0 -4
  97. package/src/contexts/StorageSourcesContext.tsx +0 -30
  98. package/src/contexts/UserConfigurationPersistenceContext.tsx +0 -4
  99. package/src/contexts/index.ts +0 -18
  100. package/src/core/PluginLifecycleManager.tsx +0 -96
  101. package/src/core/PluginProviderStack.tsx +0 -40
  102. package/src/core/Rebase.tsx +0 -488
  103. package/src/core/RebaseProps.tsx +0 -333
  104. package/src/core/RebaseRouter.tsx +0 -18
  105. package/src/core/RebaseRoutes.tsx +0 -24
  106. package/src/core/index.tsx +0 -5
  107. package/src/hooks/ApiConfigContext.tsx +0 -83
  108. package/src/hooks/data/collectionQuery.ts +0 -55
  109. package/src/hooks/data/delete.ts +0 -56
  110. package/src/hooks/data/save.ts +0 -78
  111. package/src/hooks/data/useCollection.tsx +0 -183
  112. package/src/hooks/data/useData.tsx +0 -18
  113. package/src/hooks/data/useDataOrder.ts +0 -26
  114. package/src/hooks/data/useFetch.tsx +0 -156
  115. package/src/hooks/data/useRelationSelector.tsx +0 -280
  116. package/src/hooks/index.tsx +0 -45
  117. package/src/hooks/useAdminModeController.tsx +0 -23
  118. package/src/hooks/useAnalyticsController.tsx +0 -8
  119. package/src/hooks/useAuthController.tsx +0 -15
  120. package/src/hooks/useAuthSubscription.ts +0 -130
  121. package/src/hooks/useBackendStorageSource.ts +0 -295
  122. package/src/hooks/useBridgeRegistration.tsx +0 -32
  123. package/src/hooks/useBrowserTitleAndIcon.tsx +0 -23
  124. package/src/hooks/useBuildAdminModeController.tsx +0 -29
  125. package/src/hooks/useBuildEffectiveRoleController.tsx +0 -30
  126. package/src/hooks/useBuildLocalConfigurationPersistence.tsx +0 -83
  127. package/src/hooks/useBuildModeController.tsx +0 -73
  128. package/src/hooks/useClipboard.tsx +0 -158
  129. package/src/hooks/useCollapsedGroups.ts +0 -116
  130. package/src/hooks/useComponentOverride.tsx +0 -59
  131. package/src/hooks/useCustomizationController.tsx +0 -14
  132. package/src/hooks/useDialogsController.tsx +0 -15
  133. package/src/hooks/useEffectiveRoleController.tsx +0 -10
  134. package/src/hooks/useLargeLayout.tsx +0 -65
  135. package/src/hooks/useModeController.tsx +0 -23
  136. package/src/hooks/useNavigationBlocker.tsx +0 -108
  137. package/src/hooks/usePermissions.ts +0 -45
  138. package/src/hooks/useRebaseClient.tsx +0 -10
  139. package/src/hooks/useRebaseContext.tsx +0 -84
  140. package/src/hooks/useRebaseRegistry.tsx +0 -91
  141. package/src/hooks/useResolvedComponent.tsx +0 -195
  142. package/src/hooks/useSlot.tsx +0 -64
  143. package/src/hooks/useSnackbarController.tsx +0 -80
  144. package/src/hooks/useStorageSource.tsx +0 -11
  145. package/src/hooks/useStudioBridge.tsx +0 -258
  146. package/src/hooks/useTranslation.ts +0 -38
  147. package/src/hooks/useUnsavedChangesDialog.tsx +0 -67
  148. package/src/hooks/useUserConfigurationPersistence.tsx +0 -11
  149. package/src/i18n/RebaseI18nProvider.tsx +0 -159
  150. package/src/index.ts +0 -32
  151. package/src/internal/common.tsx +0 -28
  152. package/src/internal/useRestoreScroll.tsx +0 -69
  153. package/src/locales/de.ts +0 -941
  154. package/src/locales/en.ts +0 -1021
  155. package/src/locales/es.ts +0 -962
  156. package/src/locales/fr.ts +0 -941
  157. package/src/locales/hi.ts +0 -941
  158. package/src/locales/it.ts +0 -941
  159. package/src/locales/pt.ts +0 -949
  160. package/src/util/constants.ts +0 -7
  161. package/src/util/createFormexStub.tsx +0 -66
  162. package/src/util/entity_cache.ts +0 -242
  163. package/src/util/enums.ts +0 -34
  164. package/src/util/icon_list.ts +0 -22
  165. package/src/util/icons.tsx +0 -129
  166. package/src/util/index.ts +0 -13
  167. package/src/util/local_storage.ts +0 -66
  168. package/src/util/previews.ts +0 -127
  169. package/src/util/useStorageUploadController.tsx +0 -354
  170. package/src/vitePlugin.ts +0 -215
  171. /package/dist/{components/Debug → debug}/UIReferenceView.d.ts +0 -0
  172. /package/dist/{components/Debug → debug}/UIStyleGuide.d.ts +0 -0
  173. /package/dist/{components/Debug → debug}/collection-views/CardViewDemo.d.ts +0 -0
  174. /package/dist/{components/Debug → debug}/collection-views/CollectionTableDemo.d.ts +0 -0
  175. /package/dist/{components/Debug → debug}/collection-views/KanbanBoardDemo.d.ts +0 -0
  176. /package/dist/{components/Debug → debug}/collection-views/index.d.ts +0 -0
  177. /package/dist/{components/Debug → debug}/collection-views/sample_data.d.ts +0 -0
  178. /package/dist/{components/Debug → debug}/crm-dashboard/CalendarWidget.d.ts +0 -0
  179. /package/dist/{components/Debug → debug}/crm-dashboard/CrmDashboardDemo.d.ts +0 -0
  180. /package/dist/{components/Debug → debug}/crm-dashboard/DashboardMetrics.d.ts +0 -0
  181. /package/dist/{components/Debug → debug}/crm-dashboard/PipelineOverview.d.ts +0 -0
  182. /package/dist/{components/Debug → debug}/crm-dashboard/RecentActivity.d.ts +0 -0
  183. /package/dist/{components/Debug → debug}/crm-dashboard/TaskFilters.d.ts +0 -0
  184. /package/dist/{components/Debug → debug}/crm-dashboard/TaskTable.d.ts +0 -0
  185. /package/dist/{components/Debug → debug}/crm-dashboard/TasksView.d.ts +0 -0
package/README.md CHANGED
@@ -8,6 +8,10 @@ Framework-agnostic runtime for data-driven admin panels — React hooks, provide
8
8
  pnpm add @rebasepro/app
9
9
  ```
10
10
 
11
+ ESM-only: `"type": "module"` with no CommonJS build, so it is loaded with
12
+ `import`. `require()` of it resolves only on Node 22.12+, which supports
13
+ `require(esm)`.
14
+
11
15
  **Peer dependencies:** `react >= 19.2.7`, `react-dom >= 19.2.7`, `react-router ^8`
12
16
 
13
17
  ## What This Package Does
@@ -97,7 +101,6 @@ This package is **framework-agnostic** in the sense that it doesn't depend on an
97
101
  | `LanguageToggle` | i18n language switcher |
98
102
  | `BootstrapAdminBanner` | First-user setup banner |
99
103
  | `RebaseLogo` | Rebase branding logo |
100
- | `UIStyleGuide` / `UIReferenceView` | Debug/reference components |
101
104
 
102
105
  ### Contexts
103
106
 
@@ -6,9 +6,6 @@ export * from "./ConfirmationDialog.js";
6
6
  export * from "./ErrorTooltip.js";
7
7
  export * from "./RebaseLogo.js";
8
8
  export * from "./AIIcon.js";
9
- export * from "./Debug/UIStyleGuide.js";
10
- export * from "./Debug/UIReferenceView.js";
11
- export { CrmDashboardDemo } from "./Debug/crm-dashboard/CrmDashboardDemo.js";
12
9
  export * from "./UserSettingsView.js";
13
10
  export * from "./LanguageToggle.js";
14
11
  export * from "./UserSelectPopover.js";
@@ -1,3 +1,4 @@
1
1
  import React from "react";
2
2
  import { AuthController } from "@rebasepro/cms-types";
3
- export declare const AuthControllerContext: React.Context<AuthController<any, any>>;
3
+ /** `null` outside `<Rebase>` — see {@link RebaseDataContext}. */
4
+ export declare const AuthControllerContext: React.Context<AuthController<any, any> | null>;
@@ -1,3 +1,4 @@
1
1
  import type { CustomizationController } from "@rebasepro/cms-types";
2
2
  import React from "react";
3
- export declare const CustomizationControllerContext: React.Context<CustomizationController>;
3
+ /** `null` outside `<Rebase>` — see {@link RebaseDataContext}. */
4
+ export declare const CustomizationControllerContext: React.Context<CustomizationController | null>;
@@ -1,4 +1,5 @@
1
1
  import type { DialogsController } from "@rebasepro/cms-types";
2
2
  import React, { PropsWithChildren } from "react";
3
- export declare const DialogsControllerContext: React.Context<DialogsController>;
3
+ /** `null` outside `<Rebase>` — see `RebaseDataContext`. */
4
+ export declare const DialogsControllerContext: React.Context<DialogsController | null>;
4
5
  export declare const DialogsProvider: React.FC<PropsWithChildren>;
@@ -1,3 +1,12 @@
1
1
  import React from "react";
2
2
  import { RebaseData } from "@rebasepro/types";
3
- export declare const RebaseDataContext: React.Context<RebaseData>;
3
+ /**
4
+ * `null` outside `<Rebase>`, so {@link useData} can say so.
5
+ *
6
+ * The default used to be `{} as RebaseData` — a lie the type system agreed
7
+ * with. A hook called outside the tree handed back an empty object, and the
8
+ * first thing anyone does with it is `data.collection("posts")`, which fails as
9
+ * "data.collection is not a function" somewhere in a component's render. That
10
+ * names neither the hook nor the missing provider.
11
+ */
12
+ export declare const RebaseDataContext: React.Context<RebaseData | null>;
@@ -1,3 +1,13 @@
1
1
  import React from "react";
2
2
  import { StorageSource } from "@rebasepro/types";
3
- export declare const StorageSourceContext: React.Context<StorageSource>;
3
+ /**
4
+ * Three states, and they mean different things:
5
+ *
6
+ * - `null` — outside `<Rebase>`.
7
+ * - `undefined` — inside it, but the project configured no storage. `<Rebase>`
8
+ * already warns about this on the console.
9
+ * - a source — the resolved default storage.
10
+ *
11
+ * See {@link RebaseDataContext} for why the default is not `{}`.
12
+ */
13
+ export declare const StorageSourceContext: React.Context<StorageSource | null | undefined>;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { User, DataDriver, DataSourceDefinition, StorageSource, StorageSourceDefinition, DatabaseAdmin, RebaseClient } from "@rebasepro/types";
3
- import { Locale, AuthController, AnalyticsEvent, UserConfigurationPersistence, RebaseContext, EntityLinkBuilder, RebasePlugin, SlotContribution, PropertyConfig, EntityCustomView, CollectionCustomView, EntityAction, RebaseTranslations, ComponentOverrideMap } from "@rebasepro/cms-types";
3
+ import { Locale, AuthController, AnalyticsEvent, UserConfigurationPersistence, RebaseContext, EntityLinkBuilder, RebasePlugin, AnySlotContribution, PropertyConfig, EntityCustomView, CollectionCustomView, EntityAction, RebaseTranslations, ComponentOverrideMap } from "@rebasepro/cms-types";
4
4
  /**
5
5
  * A data source registered on `<Rebase>`. Extends the shared
6
6
  * {@link DataSourceDefinition} with the frontend {@link DataDriver} used for
@@ -108,16 +108,6 @@ export type RebaseProps<USER extends User, DB = unknown> = {
108
108
  context: RebaseContext;
109
109
  loading: boolean;
110
110
  }) => React.ReactNode);
111
- /**
112
- * Optional base path for the entire Rebase app.
113
- * Defaults to "/"
114
- */
115
- basePath?: string;
116
- /**
117
- * Optional base path for the admin collections.
118
- * Defaults to "/c"
119
- */
120
- baseCollectionPath?: string;
121
111
  /**
122
112
  * Base URL for the backend API (e.g. "http://localhost:3001").
123
113
  * When provided, this is available via `useApiConfig()` to any hook
@@ -249,7 +239,7 @@ export type RebaseProps<USER extends User, DB = unknown> = {
249
239
  /**
250
240
  * Extra slots for the admin
251
241
  */
252
- slots?: SlotContribution[];
242
+ slots?: AnySlotContribution[];
253
243
  /**
254
244
  * Property configs (widgets)
255
245
  */
@@ -0,0 +1,19 @@
1
+ /**
2
+ * `@rebasepro/app/debug` — the design reference and the demo dashboard.
3
+ *
4
+ * These three used to be on the package's main barrel, which meant every
5
+ * consumer shipped them: `UIReferenceView` is a single file that renders every
6
+ * component in the kit, `CrmDashboardDemo` is a fake CRM with sample data, and
7
+ * `UIStyleGuide` is a token sheet. Nobody building an admin panel imports any
8
+ * of them, and nothing in the framework does either — the `/debug/ui` route
9
+ * that rendered `UIReferenceView` was hardcoded into `RebaseRouteDefs`, so the
10
+ * whole reference was a static dependency of the admin's route table.
11
+ *
12
+ * They are not dead, though: `/debug/ui` in the dogfood app is where the design
13
+ * language is read from, and the marketing site renders both on public pages.
14
+ * A subpath is what that shape wants — reachable by name, paid for only by
15
+ * whoever asks.
16
+ */
17
+ export * from "./UIStyleGuide.js";
18
+ export * from "./UIReferenceView.js";
19
+ export { CrmDashboardDemo } from "./crm-dashboard/CrmDashboardDemo.js";