@getgreenline/blaze-ui 1.0.52 → 1.0.54-beta.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.
|
@@ -14,10 +14,6 @@ declare const AppsConfig: readonly [{
|
|
|
14
14
|
readonly name: "Sites";
|
|
15
15
|
readonly logo: import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
readonly subdomain: "cms";
|
|
17
|
-
}, {
|
|
18
|
-
readonly name: "Lighthouse";
|
|
19
|
-
readonly logo: import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
readonly subdomain: "lighthouse";
|
|
21
17
|
}, {
|
|
22
18
|
readonly name: "Growth";
|
|
23
19
|
readonly logo: import("react/jsx-runtime").JSX.Element;
|
|
@@ -26,11 +22,17 @@ declare const AppsConfig: readonly [{
|
|
|
26
22
|
readonly name: "Billing";
|
|
27
23
|
readonly logo: import("react/jsx-runtime").JSX.Element;
|
|
28
24
|
readonly subdomain: "billing";
|
|
29
|
-
readonly badge: "Soon";
|
|
30
25
|
}, {
|
|
31
26
|
readonly name: "Settings";
|
|
32
27
|
readonly logo: import("react/jsx-runtime").JSX.Element;
|
|
33
28
|
readonly subdomain: "app";
|
|
29
|
+
readonly path: "/settings/shop";
|
|
30
|
+
}, {
|
|
31
|
+
readonly name: "Lighthouse";
|
|
32
|
+
readonly logo: import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
readonly subdomain: "lighthouse";
|
|
34
|
+
readonly disabled: true;
|
|
35
|
+
readonly badge: "Soon";
|
|
34
36
|
}];
|
|
35
37
|
type AppName = (typeof AppsConfig)[number]["name"];
|
|
36
38
|
type AppSubdomain = NonNullable<(typeof AppsConfig)[number]["subdomain"]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-app-switcher.d.ts","sourceRoot":"","sources":["../../src/components/header-app-switcher.tsx"],"names":[],"mappings":"AAyBA,QAAA,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"header-app-switcher.d.ts","sourceRoot":"","sources":["../../src/components/header-app-switcher.tsx"],"names":[],"mappings":"AAyBA,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN,CAAA;AAEV,KAAK,OAAO,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAA;AAClD,KAAK,YAAY,GAAG,WAAW,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,CAAA;AAoGzE,KAAK,sBAAsB,GAAG;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,kEAAkE;IAClE,WAAW,CAAC,EAAE,YAAY,EAAE,CAAA;IAC5B,6CAA6C;IAC7C,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACvB,2FAA2F;IAC3F,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAsBD,iBAAS,iBAAiB,CAAC,EACzB,UAAU,EACV,UAAqB,EACrB,WAAW,EACX,OAAO,EACP,WAAW,GACZ,EAAE,sBAAsB,2CAoGxB;AAED,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,OAAO,EACZ,KAAK,YAAY,GAClB,CAAA"}
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { Badge } from './badge.js';
|
|
4
4
|
import { Button } from './button.js';
|
|
5
5
|
import { Popover, PopoverTrigger, PopoverContent } from './popover.js';
|
|
6
|
-
import { RetailLogo, PosLogo, EcomLogo, SitesLogo,
|
|
6
|
+
import { RetailLogo, PosLogo, EcomLogo, SitesLogo, GrowthLogo, BillingLogo, SettingsLogo, LighthouseLogo, AppsGridIcon } from '../svgs/header-app-switcher-logos.js';
|
|
7
7
|
import { cn } from '../lib/utils.js';
|
|
8
8
|
|
|
9
9
|
const AppsConfig = [
|
|
@@ -11,11 +11,6 @@ const AppsConfig = [
|
|
|
11
11
|
{ name: "POS", logo: jsx(PosLogo, {}), subdomain: "pos" },
|
|
12
12
|
{ name: "Ecom", logo: jsx(EcomLogo, {}), subdomain: "ecom" },
|
|
13
13
|
{ name: "Sites", logo: jsx(SitesLogo, {}), subdomain: "cms" },
|
|
14
|
-
{
|
|
15
|
-
name: "Lighthouse",
|
|
16
|
-
logo: jsx(LighthouseLogo, {}),
|
|
17
|
-
subdomain: "lighthouse",
|
|
18
|
-
},
|
|
19
14
|
{
|
|
20
15
|
name: "Growth",
|
|
21
16
|
logo: jsx(GrowthLogo, {}),
|
|
@@ -25,12 +20,19 @@ const AppsConfig = [
|
|
|
25
20
|
name: "Billing",
|
|
26
21
|
logo: jsx(BillingLogo, {}),
|
|
27
22
|
subdomain: "billing",
|
|
28
|
-
badge: "Soon",
|
|
29
23
|
},
|
|
30
24
|
{
|
|
31
25
|
name: "Settings",
|
|
32
26
|
logo: jsx(SettingsLogo, {}),
|
|
33
27
|
subdomain: "app",
|
|
28
|
+
path: "/settings/shop",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "Lighthouse",
|
|
32
|
+
logo: jsx(LighthouseLogo, {}),
|
|
33
|
+
subdomain: "lighthouse",
|
|
34
|
+
disabled: true,
|
|
35
|
+
badge: "Soon",
|
|
34
36
|
},
|
|
35
37
|
];
|
|
36
38
|
const trimSlashes = (value) => value.trim().replace(/\/+$/, "");
|
|
@@ -96,10 +98,12 @@ const resolveHostInfo = (commonHost) => {
|
|
|
96
98
|
host: "blaze.me",
|
|
97
99
|
};
|
|
98
100
|
};
|
|
99
|
-
const buildAppUrl = (subdomain, base, ssoRedirect) => {
|
|
101
|
+
const buildAppUrl = (subdomain, base, ssoRedirect, path) => {
|
|
100
102
|
if (!subdomain)
|
|
101
103
|
return "#";
|
|
102
104
|
const url = new URL(`${base.protocol}//${subdomain}.${base.host}`);
|
|
105
|
+
if (path)
|
|
106
|
+
url.pathname = path;
|
|
103
107
|
if (ssoRedirect)
|
|
104
108
|
url.searchParams.set("sso", "true");
|
|
105
109
|
return url.toString();
|
|
@@ -129,7 +133,7 @@ function HeaderAppSwitcher({ commonHost, currentApp = "Retail", visibleApps, col
|
|
|
129
133
|
return filtered.map((app) => ({
|
|
130
134
|
...app,
|
|
131
135
|
isCurrent: currentApp === app.name,
|
|
132
|
-
href: buildAppUrl(app.subdomain, base, ssoRedirect),
|
|
136
|
+
href: buildAppUrl(app.subdomain, base, ssoRedirect, "path" in app ? app.path : undefined),
|
|
133
137
|
}));
|
|
134
138
|
}, [commonHost, currentApp, visibleApps, ssoRedirect]);
|
|
135
139
|
const resolvedColumns = columns ?? 3;
|