@fluid-app/portal-sdk 0.1.126 → 0.1.128

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/dist/index.cjs CHANGED
@@ -3499,6 +3499,21 @@ function createDefaultAuthConfig(overrides) {
3499
3499
  return { ...overrides };
3500
3500
  }
3501
3501
  //#endregion
3502
+ //#region src/utils/build-widget-registry.ts
3503
+ /**
3504
+ * Merges custom widget components from manifests into the default
3505
+ * SDK widget registry. Returns the default registry unchanged when
3506
+ * no custom widgets are provided (avoids unnecessary object creation).
3507
+ */
3508
+ function buildWidgetRegistry(manifests) {
3509
+ if (manifests.length === 0) return require_FluidProvider.DEFAULT_SDK_WIDGET_REGISTRY;
3510
+ const customEntries = Object.fromEntries(manifests.map((m) => [m.type, m.component]));
3511
+ return {
3512
+ ...require_FluidProvider.DEFAULT_SDK_WIDGET_REGISTRY,
3513
+ ...customEntries
3514
+ };
3515
+ }
3516
+ //#endregion
3502
3517
  //#region src/entry/create-portal.tsx
3503
3518
  /**
3504
3519
  * Bootstrap a Fluid portal with a single function call.
@@ -3538,6 +3553,7 @@ function createPortal(config = {}) {
3538
3553
  if (!rootElement) throw new Error(`Portal root element "#${config.rootId ?? "root"}" not found`);
3539
3554
  const fluidConfig = createDefaultFluidConfig(config.fluid);
3540
3555
  const authConfig = createDefaultAuthConfig(config.auth);
3556
+ const widgetRegistry = config.customWidgets?.length ? buildWidgetRegistry(config.customWidgets) : void 0;
3541
3557
  let app = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppShell, {
3542
3558
  customPages: config.customPages,
3543
3559
  ...config.shell
@@ -3550,6 +3566,7 @@ function createPortal(config = {}) {
3550
3566
  config: authConfig,
3551
3567
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FluidProvider.FluidProvider, {
3552
3568
  config: fluidConfig,
3569
+ widgetRegistry,
3553
3570
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RequireAuth, { children: app })
3554
3571
  })
3555
3572
  });
@@ -4742,21 +4759,6 @@ function registerCorePageTemplates() {
4742
4759
  }
4743
4760
  registerCorePageTemplates();
4744
4761
  //#endregion
4745
- //#region src/utils/build-widget-registry.ts
4746
- /**
4747
- * Merges custom widget components from manifests into the default
4748
- * SDK widget registry. Returns the default registry unchanged when
4749
- * no custom widgets are provided (avoids unnecessary object creation).
4750
- */
4751
- function buildWidgetRegistry(manifests) {
4752
- if (manifests.length === 0) return require_FluidProvider.DEFAULT_SDK_WIDGET_REGISTRY;
4753
- const customEntries = Object.fromEntries(manifests.map((m) => [m.type, m.component]));
4754
- return {
4755
- ...require_FluidProvider.DEFAULT_SDK_WIDGET_REGISTRY,
4756
- ...customEntries
4757
- };
4758
- }
4759
- //#endregion
4760
4762
  //#region src/shell/AppLink.tsx
4761
4763
  /**
4762
4764
  * SPA-aware link that renders a real `<a href>` for accessibility