@gooddata/sdk-ui-pluggable-host 11.58.0-alpha.3 → 11.58.0-alpha.5

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.
@@ -263,7 +263,7 @@ export declare function Root({ callbacks }: {
263
263
  *
264
264
  * @remarks
265
265
  * This indirection keeps the chrome free of any hard dependency on a specific pricing
266
- * dialog implementation (e.g. `gdc-pricing-dialog`). The host app supplies
266
+ * dialog implementation (e.g. `@gooddata/gdc-pricing-dialog`). The host app supplies
267
267
  * the extension at boot; removing the extension is a one-line change.
268
268
  *
269
269
  * Contract:
@@ -1 +1 @@
1
- {"version":3,"file":"HostChrome.d.ts","sourceRoot":"","sources":["../../src/ui/HostChrome.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuC,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;AAElG,OAAO,EACH,KAAK,iBAAiB,EAEtB,KAAK,gCAAgC,EACxC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACxB,MAAM,2CAA2C,CAAC;AAGnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AA2B7D,OAAO,mBAAmB,CAAC;AAK3B,OAAO,0CAA0C,CAAC;AAClD,OAAO,6CAA6C,CAAC;AACrD,OAAO,sDAAsD,CAAC;AAC9D,OAAO,0DAA0D,CAAC;AAkBlE,MAAM,WAAW,gBAAgB;IAC7B,GAAG,EAAE,gBAAgB,CAAC;IACtB,oBAAoB,EAAE,gCAAgC,EAAE,CAAC;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,YAAY,CAAC,EAAE,mBAAmB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  import { getActiveInternalApplication } from "../loader/routing.js";
11
11
  import { getBackend } from "../platformContext/backend.js";
12
12
  import { buildAppMenu, getLocalizedTitle } from "./appMenuItems.js";
13
- import { getUserDisplayName, isPlainLeftClick, swapWorkspaceInPath } from "./chromeHelpers.js";
13
+ import { getUserDisplayName, getWorkspaceSwitchPath, isPlainLeftClick } from "./chromeHelpers.js";
14
14
  import { b, e } from "./hostChromeBem.js";
15
15
  import { HostIntlProvider } from "./HostIntlProvider.js";
16
16
  import { HostNotificationDispatcher } from "./HostNotificationDispatcher.js";
@@ -98,13 +98,15 @@ export function HostChrome({ ctx, resolvedApplications, pathname, onNavigate, on
98
98
  }, [onNavigate]);
99
99
  const handleWorkspaceSelect = useCallback((workspace) => {
100
100
  const newId = workspace.id;
101
- if (!newId) {
101
+ // The picker reports a click on the current workspace too; navigating would leave the
102
+ // application's own in-app route (which the host router does not observe) behind.
103
+ if (!newId || newId === features.workspaceId) {
102
104
  return;
103
105
  }
104
106
  const search = typeof window === "undefined" ? "" : window.location.search;
105
- const newPath = swapWorkspaceInPath(pathname, newId);
107
+ const newPath = getWorkspaceSwitchPath(pathname, newId, resolvedApplications, ctx);
106
108
  onNavigate(`${newPath}${search}`);
107
- }, [pathname, onNavigate]);
109
+ }, [pathname, onNavigate, resolvedApplications, ctx, features.workspaceId]);
108
110
  const organizationTitle = ctx.organization?.title ?? ctx.organization?.id;
109
111
  const workspacePicker = features.isWorkspaceApp && features.workspaceId ? (_jsx(AppHeaderWorkspacePicker, { backend: getBackend(), userId: ctx.user.login, workspaceId: features.workspaceId, onWorkspaceSelect: handleWorkspaceSelect })) : organizationTitle ? (_jsx("div", { className: "gd-header-project", children: organizationTitle })) : null;
110
112
  const hasTierEntitlement = ctx.entitlements?.some((e) => e.name === "Tier" && e.value);
@@ -1,5 +1,6 @@
1
1
  import { type MouseEvent } from "react";
2
- import { type IUser } from "@gooddata/sdk-model";
2
+ import { type IUser, type PluggableApplicationRegistryItem } from "@gooddata/sdk-model";
3
+ import { type IPlatformContext } from "@gooddata/sdk-pluggable-application-model";
3
4
  /**
4
5
  * Builds the display name shown for the current user in the host header.
5
6
  *
@@ -16,6 +17,18 @@ export declare function getUserDisplayName(user: IUser): string;
16
17
  * an organization-scoped route).
17
18
  */
18
19
  export declare function swapWorkspaceInPath(pathname: string, newWorkspaceId: string): string;
20
+ /**
21
+ * Returns the path a workspace switch made from `pathname` should land on: the active
22
+ * application's landing route in the new workspace.
23
+ *
24
+ * @remarks
25
+ * The whole in-app remainder of the path is dropped, screens as well as object ids. The host
26
+ * cannot tell them apart — it knows an application only by its route base — and a remainder
27
+ * kept across the switch carries ids of objects that exist in the old workspace only, which
28
+ * lands the user on a "not found" page. A path no workspace-scoped application claims keeps
29
+ * the plain workspace swap.
30
+ */
31
+ export declare function getWorkspaceSwitchPath(pathname: string, newWorkspaceId: string, apps: PluggableApplicationRegistryItem[], ctx: IPlatformContext): string;
19
32
  /**
20
33
  * Whether a click on a link may be taken over with `preventDefault`, rather than left to the
21
34
  * browser's own handling of the href.
@@ -1 +1 @@
1
- {"version":3,"file":"chromeHelpers.d.ts","sourceRoot":"","sources":["../../src/ui/chromeHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAStD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAGpF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CASpE"}
1
+ {"version":3,"file":"chromeHelpers.d.ts","sourceRoot":"","sources":["../../src/ui/chromeHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAIlF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAStD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAGpF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAClC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,gCAAgC,EAAE,EACxC,GAAG,EAAE,gBAAgB,GACtB,MAAM,CAMR;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CASpE"}
@@ -1,4 +1,5 @@
1
1
  // (C) 2026 GoodData Corporation
2
+ import { getActiveInternalApplication, getApplicationHref } from "../loader/routing.js";
2
3
  /**
3
4
  * Builds the display name shown for the current user in the host header.
4
5
  *
@@ -27,6 +28,24 @@ export function swapWorkspaceInPath(pathname, newWorkspaceId) {
27
28
  const replaced = pathname.replace(/^\/workspace\/[^/]+/, `/workspace/${newWorkspaceId}`);
28
29
  return replaced === pathname ? `/workspace/${newWorkspaceId}` : replaced;
29
30
  }
31
+ /**
32
+ * Returns the path a workspace switch made from `pathname` should land on: the active
33
+ * application's landing route in the new workspace.
34
+ *
35
+ * @remarks
36
+ * The whole in-app remainder of the path is dropped, screens as well as object ids. The host
37
+ * cannot tell them apart — it knows an application only by its route base — and a remainder
38
+ * kept across the switch carries ids of objects that exist in the old workspace only, which
39
+ * lands the user on a "not found" page. A path no workspace-scoped application claims keeps
40
+ * the plain workspace swap.
41
+ */
42
+ export function getWorkspaceSwitchPath(pathname, newWorkspaceId, apps, ctx) {
43
+ const activeApp = getActiveInternalApplication(apps, ctx, pathname);
44
+ if (activeApp?.applicationScope === "workspace") {
45
+ return getApplicationHref(activeApp, { ...ctx, currentWorkspaceId: newWorkspaceId });
46
+ }
47
+ return swapWorkspaceInPath(pathname, newWorkspaceId);
48
+ }
30
49
  /**
31
50
  * Whether a click on a link may be taken over with `preventDefault`, rather than left to the
32
51
  * browser's own handling of the href.
@@ -32,7 +32,7 @@ export type UseHostPricingExtension = (ctx: IPlatformContext, locale: string) =>
32
32
  *
33
33
  * @remarks
34
34
  * This indirection keeps the chrome free of any hard dependency on a specific pricing
35
- * dialog implementation (e.g. `gdc-pricing-dialog`). The host app supplies
35
+ * dialog implementation (e.g. `@gooddata/gdc-pricing-dialog`). The host app supplies
36
36
  * the extension at boot; removing the extension is a one-line change.
37
37
  *
38
38
  * Contract:
@@ -7,7 +7,7 @@ let registeredPricingExtension;
7
7
  *
8
8
  * @remarks
9
9
  * This indirection keeps the chrome free of any hard dependency on a specific pricing
10
- * dialog implementation (e.g. `gdc-pricing-dialog`). The host app supplies
10
+ * dialog implementation (e.g. `@gooddata/gdc-pricing-dialog`). The host app supplies
11
11
  * the extension at boot; removing the extension is a one-line change.
12
12
  *
13
13
  * Contract:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-ui-pluggable-host",
3
- "version": "11.58.0-alpha.3",
3
+ "version": "11.58.0-alpha.5",
4
4
  "description": "GoodData SDK runtime for hosting pluggable applications — registry, loader, routing, platform context, default UI chrome",
5
5
  "license": "MIT",
6
6
  "author": "GoodData Corporation",
@@ -29,20 +29,20 @@
29
29
  "dependencies": {
30
30
  "@module-federation/runtime": "2.6.0",
31
31
  "lodash-es": "^4.17.23",
32
- "@gooddata/sdk-backend-base": "11.58.0-alpha.3",
33
- "@gooddata/sdk-backend-tiger": "11.58.0-alpha.3",
34
- "@gooddata/sdk-backend-spi": "11.58.0-alpha.3",
35
- "@gooddata/sdk-embedding": "11.58.0-alpha.3",
36
- "@gooddata/sdk-model": "11.58.0-alpha.3",
37
- "@gooddata/sdk-ui": "11.58.0-alpha.3",
38
- "@gooddata/sdk-pluggable-application-model": "11.58.0-alpha.3",
39
- "@gooddata/sdk-ui-application-header": "11.58.0-alpha.3",
40
- "@gooddata/sdk-ui-ext": "11.58.0-alpha.3",
41
- "@gooddata/sdk-ui-kit": "11.58.0-alpha.3",
42
- "@gooddata/sdk-ui-theme-provider": "11.58.0-alpha.3",
43
- "@gooddata/sdk-ui-semantic-search": "11.58.0-alpha.3",
44
- "@gooddata/util": "11.58.0-alpha.3",
45
- "@gooddata/sdk-ui-gen-ai": "11.58.0-alpha.3"
32
+ "@gooddata/sdk-backend-base": "11.58.0-alpha.5",
33
+ "@gooddata/sdk-backend-tiger": "11.58.0-alpha.5",
34
+ "@gooddata/sdk-backend-spi": "11.58.0-alpha.5",
35
+ "@gooddata/sdk-embedding": "11.58.0-alpha.5",
36
+ "@gooddata/sdk-model": "11.58.0-alpha.5",
37
+ "@gooddata/sdk-pluggable-application-model": "11.58.0-alpha.5",
38
+ "@gooddata/sdk-ui": "11.58.0-alpha.5",
39
+ "@gooddata/sdk-ui-application-header": "11.58.0-alpha.5",
40
+ "@gooddata/sdk-ui-gen-ai": "11.58.0-alpha.5",
41
+ "@gooddata/sdk-ui-ext": "11.58.0-alpha.5",
42
+ "@gooddata/sdk-ui-kit": "11.58.0-alpha.5",
43
+ "@gooddata/sdk-ui-semantic-search": "11.58.0-alpha.5",
44
+ "@gooddata/sdk-ui-theme-provider": "11.58.0-alpha.5",
45
+ "@gooddata/util": "11.58.0-alpha.5"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@microsoft/api-documenter": "7.30.10",
@@ -81,8 +81,8 @@
81
81
  "vite": "8.0.16",
82
82
  "vitest": "4.1.11",
83
83
  "vitest-dom": "0.1.1",
84
- "@gooddata/oxlint-config": "11.58.0-alpha.3",
85
- "@gooddata/eslint-config": "11.58.0-alpha.3"
84
+ "@gooddata/eslint-config": "11.58.0-alpha.5",
85
+ "@gooddata/oxlint-config": "11.58.0-alpha.5"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "react": ">=18.3.1",