@the-portland-company/shell 0.44.0 → 0.45.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/dist/app-chrome.cjs +16 -5
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.js +16 -5
- package/dist/app-chrome.js.map +1 -1
- package/package.json +1 -1
package/dist/app-chrome.cjs
CHANGED
|
@@ -3095,6 +3095,15 @@ var standardNavIcons = {
|
|
|
3095
3095
|
var ORG_STORAGE_KEY = "vrm.activeOrg";
|
|
3096
3096
|
var MODE_STORAGE_KEY = "vrm.activeMode";
|
|
3097
3097
|
var CORE_BASE_URL = "https://app.politogyvrm.com";
|
|
3098
|
+
var CORE_BASE_URL_STAGING = "https://staging-app.politogyvrm.com";
|
|
3099
|
+
function getCoreBaseUrl() {
|
|
3100
|
+
if (typeof window !== "undefined") {
|
|
3101
|
+
if (window.location.hostname.toLowerCase().includes("staging")) {
|
|
3102
|
+
return CORE_BASE_URL_STAGING;
|
|
3103
|
+
}
|
|
3104
|
+
}
|
|
3105
|
+
return CORE_BASE_URL;
|
|
3106
|
+
}
|
|
3098
3107
|
var ChromeStateContext = react.createContext(null);
|
|
3099
3108
|
function useChromeState() {
|
|
3100
3109
|
return react.useContext(ChromeStateContext);
|
|
@@ -3440,13 +3449,14 @@ function useChromeUserMenu({
|
|
|
3440
3449
|
const theme = useThemePreference();
|
|
3441
3450
|
const activeOrg = state?.orgs.find((o) => o.id === state.orgId) ?? null;
|
|
3442
3451
|
const orgSuffix = activeOrg ? `?org=${activeOrg.id}` : "";
|
|
3452
|
+
const coreBase = getCoreBaseUrl();
|
|
3443
3453
|
return {
|
|
3444
3454
|
// My Profile is global — NOT org-suffixed (main-app ShellChromeBridge).
|
|
3445
|
-
myProfileHref: `${
|
|
3446
|
-
organizationSettingsHref: `${
|
|
3455
|
+
myProfileHref: `${coreBase}/my-profile`,
|
|
3456
|
+
organizationSettingsHref: `${coreBase}/organization-settings${orgSuffix}`,
|
|
3447
3457
|
roles: (state?.orgs ?? []).filter((o) => o.rawRole || o.role).map((o) => ({ role: o.rawRole ?? o.role, orgName: o.name })),
|
|
3448
3458
|
accounts: [{ id: userId, name: userName, email, avatarUrl: null, active: true }],
|
|
3449
|
-
addAccountHref: `${
|
|
3459
|
+
addAccountHref: `${coreBase}/my-profile#accounts`,
|
|
3450
3460
|
theme: { value: theme.value, onChange: theme.setValue }
|
|
3451
3461
|
};
|
|
3452
3462
|
}
|
|
@@ -3519,9 +3529,10 @@ function useChromeMode(arg = {}) {
|
|
|
3519
3529
|
localStorage.setItem(MODE_STORAGE_KEY, id);
|
|
3520
3530
|
} catch {
|
|
3521
3531
|
}
|
|
3522
|
-
const
|
|
3532
|
+
const href = def.href.replace(CORE_BASE_URL, getCoreBaseUrl());
|
|
3533
|
+
const sep = href.includes("?") ? "&" : "?";
|
|
3523
3534
|
window.location.assign(
|
|
3524
|
-
def.orgQuery && suffix ? `${
|
|
3535
|
+
def.orgQuery && suffix ? `${href}${sep}${suffix.slice(1)}` : href
|
|
3525
3536
|
);
|
|
3526
3537
|
} : void 0
|
|
3527
3538
|
};
|