@rebasepro/app 0.9.1-canary.16c42e9 → 0.9.1-canary.1d2d8b5

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.
@@ -15,4 +15,3 @@ export * from "./RebaseClientInstanceContext";
15
15
  export * from "./CustomizationControllerContext";
16
16
  export * from "./ComponentOverrideContext";
17
17
  export * from "./CollectionScopeContext";
18
- export * from "./CollectionResolverContext";
package/dist/index.es.js CHANGED
@@ -296,24 +296,6 @@ function CollectionScopeProvider({ collection, children }) {
296
296
  });
297
297
  }
298
298
  //#endregion
299
- //#region src/contexts/CollectionResolverContext.tsx
300
- /**
301
- * Lets the layer that owns the collections hand a resolver *up* to the data
302
- * layer, which needs a collection's primary keys to give its rows an address.
303
- *
304
- * The inversion is forced by the composition: `<Rebase client>` builds the data
305
- * layer, and `<RebaseAdmin collections>` sits inside it — so the collections are
306
- * not in scope where the data is created, and `Rebase` cannot take them as a
307
- * prop without giving every headless BaaS app a collections argument it has no
308
- * use for.
309
- *
310
- * Registration is a ref write, so it is safe to call during render — and it has
311
- * to be. The views that fetch rows are *below* the registrar, and child effects
312
- * run before parent effects, so registering in an effect would bind after the
313
- * first page of rows had already been converted.
314
- */
315
- var CollectionResolverRegistrationContext = React.createContext(() => void 0);
316
- //#endregion
317
299
  //#region src/hooks/data/useData.tsx
318
300
  /**
319
301
  * Use this hook to access the unified data API.
@@ -9193,10 +9175,10 @@ function LoginForm({ onClose, onForgotPassword, authController, registrationMode
9193
9175
  };
9194
9176
  }, [onClose]);
9195
9177
  function handleEnterPassword() {
9196
- if (email && password && authController.emailPasswordLogin) Promise.resolve(authController.emailPasswordLogin(email, password)).catch(() => void 0);
9178
+ if (email && password && authController.emailPasswordLogin) authController.emailPasswordLogin(email, password);
9197
9179
  }
9198
9180
  function handleRegistration() {
9199
- if (email && password && authController.register) Promise.resolve(authController.register(email, password, displayName)).catch(() => void 0);
9181
+ if (email && password && authController.register) authController.register(email, password, displayName);
9200
9182
  }
9201
9183
  const handleSubmit = (event) => {
9202
9184
  event.preventDefault();
@@ -15450,11 +15432,6 @@ function Rebase(props) {
15450
15432
  const normalizedDataSources = useMemo(() => {
15451
15433
  return dataSourcesProp ?? [];
15452
15434
  }, [dataSourcesProp]);
15453
- const collectionResolverRef = useRef(void 0);
15454
- const registerCollectionResolver = React.useCallback((resolver) => {
15455
- collectionResolverRef.current = resolver;
15456
- }, []);
15457
- const entityDataOptions = useMemo(() => ({ resolveCollection: (slug) => collectionResolverRef.current?.(slug) }), []);
15458
15435
  const dataSourcesRef = useRef(null);
15459
15436
  const dataSourcesValue = useMemo(() => {
15460
15437
  const sig = normalizedDataSources.map((d) => ({
@@ -15473,7 +15450,7 @@ function Rebase(props) {
15473
15450
  ...definition,
15474
15451
  transport: ds.transport ?? (driver ? "direct" : "server")
15475
15452
  };
15476
- if (driver) sources[ds.key] = buildRebaseData(driver, entityDataOptions);
15453
+ if (driver) sources[ds.key] = buildRebaseData(driver);
15477
15454
  }
15478
15455
  const value = {
15479
15456
  registry,
@@ -15484,20 +15461,16 @@ function Rebase(props) {
15484
15461
  value
15485
15462
  };
15486
15463
  return value;
15487
- }, [normalizedDataSources, entityDataOptions]);
15464
+ }, [normalizedDataSources]);
15488
15465
  const resolvedData = useMemo(() => {
15489
15466
  const registeredDefault = dataSourcesValue.sources[DEFAULT_DATA_SOURCE_KEY];
15490
15467
  if (registeredDefault) return registeredDefault;
15491
- if (client?.data) return wrapAsEntityData(client.data, entityDataOptions);
15468
+ if (client?.data) return wrapAsEntityData(client.data);
15492
15469
  const built = Object.values(dataSourcesValue.sources);
15493
15470
  if (built.length === 1) return built[0];
15494
15471
  if (built.length > 1) throw new Error("[Rebase] Several data sources are registered but none is the default. Pass a `client`, or key one `dataSources` entry \"(default)\".");
15495
15472
  throw new Error("Rebase requires either `client` or a `dataSources` entry with a driver to be provided");
15496
- }, [
15497
- client,
15498
- dataSourcesValue,
15499
- entityDataOptions
15500
- ]);
15473
+ }, [client, dataSourcesValue]);
15501
15474
  const resolvedStorage = storageSourceProp ?? client?.storage;
15502
15475
  const [remoteStorageSources, setRemoteStorageSources] = useState([]);
15503
15476
  const authUser = authController.user;
@@ -15642,23 +15615,20 @@ function Rebase(props) {
15642
15615
  value: storageSourcesValue,
15643
15616
  children: /* @__PURE__ */ jsx(StorageSourceContext.Provider, {
15644
15617
  value: resolvedStorage,
15645
- children: /* @__PURE__ */ jsx(CollectionResolverRegistrationContext.Provider, {
15646
- value: registerCollectionResolver,
15647
- children: /* @__PURE__ */ jsx(DataSourcesContext.Provider, {
15648
- value: dataSourcesValue,
15649
- children: /* @__PURE__ */ jsx(RebaseDataContext.Provider, {
15650
- value: resolvedData,
15651
- children: /* @__PURE__ */ jsx(DatabaseAdminContext.Provider, {
15652
- value: resolvedDatabaseAdmin,
15653
- children: /* @__PURE__ */ jsx(AuthControllerContext.Provider, {
15654
- value: authController,
15655
- children: /* @__PURE__ */ jsx(EffectiveRoleControllerContext.Provider, {
15656
- value: activeEffectiveRoleController,
15657
- children: /* @__PURE__ */ jsx(DialogsProvider, { children: /* @__PURE__ */ jsx(SchemaDriftProvider, { children: /* @__PURE__ */ jsx(RebaseRegistryProvider, { children: /* @__PURE__ */ jsx(RebaseInternal, {
15658
- loading,
15659
- children
15660
- }) }) }) })
15661
- })
15618
+ children: /* @__PURE__ */ jsx(DataSourcesContext.Provider, {
15619
+ value: dataSourcesValue,
15620
+ children: /* @__PURE__ */ jsx(RebaseDataContext.Provider, {
15621
+ value: resolvedData,
15622
+ children: /* @__PURE__ */ jsx(DatabaseAdminContext.Provider, {
15623
+ value: resolvedDatabaseAdmin,
15624
+ children: /* @__PURE__ */ jsx(AuthControllerContext.Provider, {
15625
+ value: authController,
15626
+ children: /* @__PURE__ */ jsx(EffectiveRoleControllerContext.Provider, {
15627
+ value: activeEffectiveRoleController,
15628
+ children: /* @__PURE__ */ jsx(DialogsProvider, { children: /* @__PURE__ */ jsx(SchemaDriftProvider, { children: /* @__PURE__ */ jsx(RebaseRegistryProvider, { children: /* @__PURE__ */ jsx(RebaseInternal, {
15629
+ loading,
15630
+ children
15631
+ }) }) }) })
15662
15632
  })
15663
15633
  })
15664
15634
  })
@@ -16888,6 +16858,6 @@ function useBridgeRegistration(key, value) {
16888
16858
  ]);
16889
16859
  }
16890
16860
  //#endregion
16891
- export { ADDITIONAL_TAB_WIDTH, AIIcon, AIModifiedIndicator, AdminModeControllerContext, AdminModeControllerProvider, AnalyticsContext, ApiConfigProvider, AuthApiError, AuthControllerContext, CONTAINER_FULL_WIDTH, CollectionComponentOverrideProvider, CollectionResolverRegistrationContext, CollectionScopeContext, CollectionScopeProvider, ComponentOverrideContext, ConfirmationDialog, CrmDashboardDemo, CustomizationControllerContext, DEFAULT_PAGE_SIZE, DataDriverContext, DataSourcesContext, DialogsControllerContext, DialogsProvider, EffectiveRoleControllerContext, EffectiveRoleControllerProvider, ErrorTooltip, ErrorView, FORM_CONTAINER_WIDTH, GlobalComponentOverrideProvider, IconForView, LanguageToggle, LoginView, ModeControllerContext, ModeControllerProvider, NotFoundPage, PluginProviderStack, REBASE_LOCALE_STORAGE_KEY, Rebase, RebaseAuth, RebaseClientInstanceContext, RebaseDataContext, RebaseI18nProvider, RebaseLogo, RebaseRegistryProvider, RebaseRouter, RebaseRoutes, STUDIO_NAVIGATION_GROUPS, SchemaDriftBanner, SchemaDriftProvider, SnackbarProvider, StorageSourceContext, StorageSourcesContext, StudioBridgeContext, StudioBridgeProvider, StudioBridgeRegistryContext, StudioBridgeRegistryProvider, UIReferenceView, UIStyleGuide, UnsavedChangesDialog, UserConfigurationPersistenceContext, UserDisplay, UserSelectPopover, UserSettingsView, buildCollapsedDefaults, buildEnumLabel, clearAuthConfigCache, clearFetchCache, createAuthConfigCache, createFormexStub, deleteEntityWithCallbacks, en, es, fetchAuthConfig, flattenKeys, getColorScheme, getColumnKeysForProperty, getEntityFromCache, getEntityFromMemoryCache, getEntityPreviewKeys, getEntityTitlePropertyKey, getFormFieldKeys, getIcon, getRelationIncludeParams, getRowHeight, getSubcollectionColumnId, iconsSearch, isEnumValueDisabled, isSchemaDriftError, populateFetchCache, removeEntityFromCache, removeEntityFromMemoryCache, resolveComponentRef, saveEntityToCache, saveEntityToMemoryCache, saveEntityWithCallbacks, useAdminModeController, useAnalyticsController, useApiConfig, useAuthController, useAuthSubscription, useBackendStorageSource, useBridgeRegistration, useBrowserTitleAndIcon, useBuildAdminModeController, useBuildEffectiveRoleController, useBuildLocalConfigurationPersistence, useBuildModeController, useClipboard, useCollapsedGroups, useCollection, useCollectionScope, useColumnIds, useComponentOverride, useCustomizationController, useData, useDataSources, useDataTableController, useDebouncedData, useDialogsController, useEffectiveRoleController, useFetch, useLargeLayout, useModeController, usePermissions, useRebaseAuthController, useRebaseClient, useRebaseContext, useRebaseRegistry, useRebaseRegistryDispatch, useRelationSelector, useResolvedComponent, useRestoreScroll, useSchemaDriftContext, useScrollRestoration, useSlot, useSnackbarController, useStorageSource, useStorageSources, useStorageUploadController, useStudioBreadcrumbs, useStudioCollectionRegistry, useStudioNavigationState, useStudioSidePanelController, useStudioUrlController, useTranslation, useUnsavedChangesDialog, useUserConfigurationPersistence };
16861
+ export { ADDITIONAL_TAB_WIDTH, AIIcon, AIModifiedIndicator, AdminModeControllerContext, AdminModeControllerProvider, AnalyticsContext, ApiConfigProvider, AuthApiError, AuthControllerContext, CONTAINER_FULL_WIDTH, CollectionComponentOverrideProvider, CollectionScopeContext, CollectionScopeProvider, ComponentOverrideContext, ConfirmationDialog, CrmDashboardDemo, CustomizationControllerContext, DEFAULT_PAGE_SIZE, DataDriverContext, DataSourcesContext, DialogsControllerContext, DialogsProvider, EffectiveRoleControllerContext, EffectiveRoleControllerProvider, ErrorTooltip, ErrorView, FORM_CONTAINER_WIDTH, GlobalComponentOverrideProvider, IconForView, LanguageToggle, LoginView, ModeControllerContext, ModeControllerProvider, NotFoundPage, PluginProviderStack, REBASE_LOCALE_STORAGE_KEY, Rebase, RebaseAuth, RebaseClientInstanceContext, RebaseDataContext, RebaseI18nProvider, RebaseLogo, RebaseRegistryProvider, RebaseRouter, RebaseRoutes, STUDIO_NAVIGATION_GROUPS, SchemaDriftBanner, SchemaDriftProvider, SnackbarProvider, StorageSourceContext, StorageSourcesContext, StudioBridgeContext, StudioBridgeProvider, StudioBridgeRegistryContext, StudioBridgeRegistryProvider, UIReferenceView, UIStyleGuide, UnsavedChangesDialog, UserConfigurationPersistenceContext, UserDisplay, UserSelectPopover, UserSettingsView, buildCollapsedDefaults, buildEnumLabel, clearAuthConfigCache, clearFetchCache, createAuthConfigCache, createFormexStub, deleteEntityWithCallbacks, en, es, fetchAuthConfig, flattenKeys, getColorScheme, getColumnKeysForProperty, getEntityFromCache, getEntityFromMemoryCache, getEntityPreviewKeys, getEntityTitlePropertyKey, getFormFieldKeys, getIcon, getRelationIncludeParams, getRowHeight, getSubcollectionColumnId, iconsSearch, isEnumValueDisabled, isSchemaDriftError, populateFetchCache, removeEntityFromCache, removeEntityFromMemoryCache, resolveComponentRef, saveEntityToCache, saveEntityToMemoryCache, saveEntityWithCallbacks, useAdminModeController, useAnalyticsController, useApiConfig, useAuthController, useAuthSubscription, useBackendStorageSource, useBridgeRegistration, useBrowserTitleAndIcon, useBuildAdminModeController, useBuildEffectiveRoleController, useBuildLocalConfigurationPersistence, useBuildModeController, useClipboard, useCollapsedGroups, useCollection, useCollectionScope, useColumnIds, useComponentOverride, useCustomizationController, useData, useDataSources, useDataTableController, useDebouncedData, useDialogsController, useEffectiveRoleController, useFetch, useLargeLayout, useModeController, usePermissions, useRebaseAuthController, useRebaseClient, useRebaseContext, useRebaseRegistry, useRebaseRegistryDispatch, useRelationSelector, useResolvedComponent, useRestoreScroll, useSchemaDriftContext, useScrollRestoration, useSlot, useSnackbarController, useStorageSource, useStorageSources, useStorageUploadController, useStudioBreadcrumbs, useStudioCollectionRegistry, useStudioNavigationState, useStudioSidePanelController, useStudioUrlController, useTranslation, useUnsavedChangesDialog, useUserConfigurationPersistence };
16892
16862
 
16893
16863
  //# sourceMappingURL=index.es.js.map