@burdenoff/fe-libs 2026.719.4 → 2026.719.6

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.
@@ -34,10 +34,12 @@ export declare function filterProducts<T extends {
34
34
  /**
35
35
  * Resolve the product to render as "current" in the switcher trigger.
36
36
  *
37
- * If the active shell's slug isn't in the catalog yet, synthesize a neutral
38
- * product from the slug itself rather than mislabelling it as `products[0]`
39
- * (which would show the first catalog entry's brand). Falls back to
40
- * `products[0]` only when no slug is provided at all.
37
+ * Prefers the passed list (e.g. the API-driven access list). If the shell's own
38
+ * product isn't in that list common for shells whose product isn't returned
39
+ * by `myAccessibleProducts` fall back to the shared product catalog so the
40
+ * chip still shows the real display name + logo (derived from its app URL)
41
+ * instead of a bare slug + initial. Only when the slug is entirely unknown do we
42
+ * synthesize a neutral entry; `products[0]` is used only when no slug is given.
41
43
  */
42
44
  export declare function resolveCurrentProduct(products: Product[], currentProductId?: string): Product | undefined;
43
45
  export interface ProductSwitcherProps {
@@ -1 +1 @@
1
- {"version":3,"file":"ProductSwitcher.d.ts","sourceRoot":"","sources":["../../src/chrome/ProductSwitcher.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAShC,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,MAAM,GAAG,SAAS,CAKrB;AA0CD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EACzF,QAAQ,EAAE,CAAC,EAAE,EACb,KAAK,EAAE,MAAM,GACZ,CAAC,EAAE,CASL;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,OAAO,EAAE,EACnB,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,GAAG,SAAS,CAKrB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA4MpD,CAAC"}
1
+ {"version":3,"file":"ProductSwitcher.d.ts","sourceRoot":"","sources":["../../src/chrome/ProductSwitcher.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAUhC,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,MAAM,GAAG,SAAS,CAKrB;AA0CD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EACzF,QAAQ,EAAE,CAAC,EAAE,EACb,KAAK,EAAE,MAAM,GACZ,CAAC,EAAE,CASL;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,OAAO,EAAE,EACnB,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,GAAG,SAAS,CAOrB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA6MpD,CAAC"}
@@ -1,44 +1,45 @@
1
- import { useEffect as e, useMemo as t, useRef as n, useState as r } from "react";
2
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
1
+ import { getProductsWithUrls as e } from "../shared/config/products.js";
2
+ import { useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
3
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
3
4
  //#region src/chrome/ProductSwitcher.tsx
4
- var o = 6;
5
- function s(e) {
5
+ var s = 6;
6
+ function c(e) {
6
7
  if (e?.logoUrl) return e.logoUrl;
7
8
  let t = e?.url;
8
9
  if (!(!t || t === "#")) return `${t.replace(/\/+$/, "")}/icons/icon.svg`;
9
10
  }
10
- var c = ({ product: e, sizeClass: t, textClass: n }) => {
11
- let [a, o] = r(!1), c = s(e), l = !!c && !a;
12
- return /* @__PURE__ */ i("div", {
11
+ var l = ({ product: e, sizeClass: t, textClass: n }) => {
12
+ let [r, o] = i(!1), s = c(e), l = !!s && !r;
13
+ return /* @__PURE__ */ a("div", {
13
14
  className: `${t} rounded-md flex items-center justify-center flex-shrink-0 overflow-hidden ${l ? "bg-white p-0.5 ring-1 ring-border-default dark:ring-border-strong" : `text-text-inverse font-semibold ${n}`}`,
14
15
  style: l ? void 0 : { backgroundColor: e?.color || "var(--color-action-primary-bg)" },
15
- children: l ? /* @__PURE__ */ i("img", {
16
- src: c,
16
+ children: l ? /* @__PURE__ */ a("img", {
17
+ src: s,
17
18
  alt: e?.name ?? "",
18
19
  className: "size-full object-contain",
19
20
  onError: () => o(!0)
20
21
  }) : e?.icon || e?.name.charAt(0)
21
22
  });
22
23
  };
23
- function l(e, t) {
24
+ function u(e, t) {
24
25
  let n = t.trim().toLowerCase();
25
26
  return n ? e.filter((e) => e.name.toLowerCase().includes(n) || e.id.toLowerCase().includes(n) || (e.description ? e.description.toLowerCase().includes(n) : !1)) : e;
26
27
  }
27
- function u(e, t) {
28
- return e.find((e) => e.id === t) ?? (t ? {
29
- id: t,
30
- name: t,
28
+ function d(t, n) {
29
+ return t.find((e) => e.id === n) || (n ? e().find((e) => e.id === n) || {
30
+ id: n,
31
+ name: n,
31
32
  url: "#"
32
- } : e[0]);
33
+ } : t[0]);
33
34
  }
34
- var d = ({ products: s, currentProductId: d, onProductChange: f, compact: p = !1 }) => {
35
- let [m, h] = r(!1), [g, _] = r(""), v = n(null), y = n(null), b = u(s, d), x = s.length > o, S = t(() => l(s, g), [s, g]);
36
- e(() => {
35
+ var f = ({ products: e, currentProductId: c, onProductChange: f, compact: p = !1 }) => {
36
+ let [m, h] = i(!1), [g, _] = i(""), v = r(null), y = r(null), b = d(e, c), x = e.length > s, S = n(() => u(e, g), [e, g]);
37
+ t(() => {
37
38
  let e = (e) => {
38
39
  v.current && !v.current.contains(e.target) && h(!1);
39
40
  };
40
41
  if (m) return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
41
- }, [m]), e(() => {
42
+ }, [m]), t(() => {
42
43
  if (!m) {
43
44
  _("");
44
45
  return;
@@ -51,30 +52,30 @@ var d = ({ products: s, currentProductId: d, onProductChange: f, compact: p = !1
51
52
  let C = (e) => {
52
53
  e.comingSoon || (f ? f(e) : window.location.href = e.url, h(!1));
53
54
  };
54
- return /* @__PURE__ */ a("div", {
55
+ return /* @__PURE__ */ o("div", {
55
56
  className: "relative",
56
57
  ref: v,
57
- children: [/* @__PURE__ */ a("button", {
58
+ children: [/* @__PURE__ */ o("button", {
58
59
  onClick: () => h(!m),
59
60
  className: `flex items-center gap-2 px-3 py-2 rounded-button hover:bg-bg-sunken transition-colors ${m ? "bg-bg-sunken" : ""}`,
60
61
  "aria-label": "Switch product",
61
62
  "aria-expanded": m,
62
63
  children: [
63
- /* @__PURE__ */ i(c, {
64
+ /* @__PURE__ */ a(l, {
64
65
  product: b,
65
66
  sizeClass: "size-6",
66
67
  textClass: "text-xs"
67
68
  }),
68
- !p && /* @__PURE__ */ i("span", {
69
+ !p && /* @__PURE__ */ a("span", {
69
70
  className: "text-body-sm font-medium text-text-primary",
70
71
  children: b?.name
71
72
  }),
72
- !p && /* @__PURE__ */ i("svg", {
73
+ !p && /* @__PURE__ */ a("svg", {
73
74
  className: `w-4 h-4 text-text-secondary transition-transform ${m ? "rotate-180" : ""}`,
74
75
  fill: "none",
75
76
  stroke: "currentColor",
76
77
  viewBox: "0 0 24 24",
77
- children: /* @__PURE__ */ i("path", {
78
+ children: /* @__PURE__ */ a("path", {
78
79
  strokeLinecap: "round",
79
80
  strokeLinejoin: "round",
80
81
  strokeWidth: 2,
@@ -82,32 +83,32 @@ var d = ({ products: s, currentProductId: d, onProductChange: f, compact: p = !1
82
83
  })
83
84
  })
84
85
  ]
85
- }), m && /* @__PURE__ */ a("div", {
86
- className: "absolute right-0 mt-2 w-[calc(100vw-1.5rem)] sm:w-64 max-w-64 bg-bg-elevated border border-border-subtle rounded-card shadow-[var(--shadow-elevation-4)] z-50 py-2 overflow-hidden animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-200",
86
+ }), m && /* @__PURE__ */ o("div", {
87
+ className: "absolute right-0 mt-2 w-[calc(100vw-1.5rem)] sm:w-72 max-w-72 bg-bg-elevated border border-border-subtle rounded-card shadow-[var(--shadow-elevation-4)] z-50 py-2 overflow-hidden animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-200",
87
88
  children: [
88
- /* @__PURE__ */ i("div", {
89
+ /* @__PURE__ */ a("div", {
89
90
  className: "px-4 py-2 border-b border-border-subtle",
90
- children: /* @__PURE__ */ i("p", {
91
+ children: /* @__PURE__ */ a("p", {
91
92
  className: "text-[11px] font-medium text-text-muted uppercase tracking-wider",
92
93
  children: "Switch Product"
93
94
  })
94
95
  }),
95
- x && /* @__PURE__ */ a("div", {
96
+ x && /* @__PURE__ */ o("div", {
96
97
  className: "relative px-3 py-2 border-b border-border-subtle",
97
98
  children: [
98
- /* @__PURE__ */ i("svg", {
99
+ /* @__PURE__ */ a("svg", {
99
100
  className: "pointer-events-none absolute left-6 top-1/2 -translate-y-1/2 size-4 text-text-muted",
100
101
  fill: "none",
101
102
  stroke: "currentColor",
102
103
  viewBox: "0 0 24 24",
103
- children: /* @__PURE__ */ i("path", {
104
+ children: /* @__PURE__ */ a("path", {
104
105
  strokeLinecap: "round",
105
106
  strokeLinejoin: "round",
106
107
  strokeWidth: 2,
107
108
  d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
108
109
  })
109
110
  }),
110
- /* @__PURE__ */ i("input", {
111
+ /* @__PURE__ */ a("input", {
111
112
  ref: y,
112
113
  type: "text",
113
114
  value: g,
@@ -119,17 +120,17 @@ var d = ({ products: s, currentProductId: d, onProductChange: f, compact: p = !1
119
120
  "aria-label": "Search products",
120
121
  className: "w-full rounded-md border border-border-subtle bg-bg-surface py-2 pl-9 pr-8 text-sm text-text-primary placeholder:text-text-muted transition-all duration-200 focus:border-transparent focus:outline-none focus:ring-2 focus:ring-[var(--color-action-primary-border)]"
121
122
  }),
122
- g && /* @__PURE__ */ i("button", {
123
+ g && /* @__PURE__ */ a("button", {
123
124
  type: "button",
124
125
  onClick: () => _(""),
125
126
  "aria-label": "Clear search",
126
127
  className: "absolute right-5 top-1/2 -translate-y-1/2 rounded-button p-1 text-text-muted transition-colors hover:bg-bg-sunken hover:text-text-primary",
127
- children: /* @__PURE__ */ i("svg", {
128
+ children: /* @__PURE__ */ a("svg", {
128
129
  className: "size-4",
129
130
  fill: "none",
130
131
  stroke: "currentColor",
131
132
  viewBox: "0 0 24 24",
132
- children: /* @__PURE__ */ i("path", {
133
+ children: /* @__PURE__ */ a("path", {
133
134
  strokeLinecap: "round",
134
135
  strokeLinejoin: "round",
135
136
  strokeWidth: 2,
@@ -139,39 +140,39 @@ var d = ({ products: s, currentProductId: d, onProductChange: f, compact: p = !1
139
140
  })
140
141
  ]
141
142
  }),
142
- /* @__PURE__ */ a("div", {
143
+ /* @__PURE__ */ o("div", {
143
144
  className: "py-1 max-h-96 overflow-y-auto",
144
- children: [S.length === 0 && /* @__PURE__ */ a("p", {
145
+ children: [S.length === 0 && /* @__PURE__ */ o("p", {
145
146
  className: "px-4 py-6 text-center text-body-sm text-text-muted",
146
147
  children: [
147
148
  "No products match “",
148
149
  g,
149
150
  "”"
150
151
  ]
151
- }), S.map((e) => /* @__PURE__ */ a("button", {
152
+ }), S.map((e) => /* @__PURE__ */ o("button", {
152
153
  onClick: () => C(e),
153
154
  disabled: e.comingSoon,
154
155
  "aria-disabled": e.comingSoon,
155
- title: e.comingSoon ? "Coming soon" : void 0,
156
- className: `w-full flex items-center gap-3 px-4 py-2.5 text-body-sm transition-colors ${e.comingSoon ? "text-text-muted cursor-not-allowed opacity-60" : e.id === d ? "bg-[var(--color-accent-soft)] text-text-primary font-medium" : "text-text-primary hover:bg-bg-sunken"}`,
156
+ title: e.comingSoon ? "Soon" : e.name,
157
+ className: `w-full flex items-center gap-3 px-4 py-2.5 text-body-sm transition-colors ${e.comingSoon ? "text-text-muted cursor-not-allowed opacity-60" : e.id === c ? "bg-[var(--color-accent-soft)] text-text-primary font-medium" : "text-text-primary hover:bg-bg-sunken"}`,
157
158
  children: [
158
- /* @__PURE__ */ i(c, {
159
+ /* @__PURE__ */ a(l, {
159
160
  product: e,
160
161
  sizeClass: "size-8",
161
162
  textClass: "text-sm"
162
163
  }),
163
- /* @__PURE__ */ i("span", {
164
- className: "flex-1 truncate text-left",
164
+ /* @__PURE__ */ a("span", {
165
+ className: "flex-1 text-left leading-tight",
165
166
  children: e.name
166
167
  }),
167
- e.comingSoon ? /* @__PURE__ */ i("span", {
168
+ e.comingSoon ? /* @__PURE__ */ a("span", {
168
169
  className: "shrink-0 whitespace-nowrap rounded-full border border-border-subtle bg-bg-sunken px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-text-secondary",
169
- children: "Coming soon"
170
- }) : e.id === d && /* @__PURE__ */ i("svg", {
170
+ children: "Soon"
171
+ }) : e.id === c && /* @__PURE__ */ a("svg", {
171
172
  className: "size-5 text-action-primary-bg",
172
173
  fill: "currentColor",
173
174
  viewBox: "0 0 20 20",
174
- children: /* @__PURE__ */ i("path", {
175
+ children: /* @__PURE__ */ a("path", {
175
176
  fillRule: "evenodd",
176
177
  d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
177
178
  clipRule: "evenodd"
@@ -185,4 +186,4 @@ var d = ({ products: s, currentProductId: d, onProductChange: f, compact: p = !1
185
186
  });
186
187
  };
187
188
  //#endregion
188
- export { d as ProductSwitcher, l as filterProducts, s as resolveProductLogo };
189
+ export { f as ProductSwitcher, u as filterProducts, c as resolveProductLogo };
@@ -68,6 +68,16 @@ export declare const PRODUCT_URLS: {
68
68
  };
69
69
  export declare const PRODUCTS: ProductConfig[];
70
70
  export declare function getProductUrl(productId: string): string;
71
+ /**
72
+ * Absolute logo URL for a product — ALWAYS the production app's
73
+ * `/icons/icon.svg`, regardless of the current environment.
74
+ *
75
+ * The cross-product switcher renders logos for OTHER products, whose assets
76
+ * only exist at their production domains. It must not use the env-aware
77
+ * `getProductUrl` (which returns `localhost:*` in dev, or `#` for ids missing
78
+ * from the dev map) — that produced broken/absent logos for several products.
79
+ */
80
+ export declare function getProductLogoUrl(productId: string): string | undefined;
71
81
  /**
72
82
  * Get all products with environment-aware URLs.
73
83
  */
@@ -1 +1 @@
1
- {"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../../src/shared/config/products.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDf,CAAC;AAEX,eAAO,MAAM,QAAQ,EAAE,aAAa,EAkTnC,CAAC;AAOF,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAIvD;AAED;;GAEG;AACH,wBAAgB,mBAAmB;;QAlY7B,MAAM;UACJ,MAAM;UACN,MAAM;WACL,MAAM;kBACC,MAAM;IACpB;;;;;OAKG;iBACU,OAAO;IAyXrB"}
1
+ {"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../../src/shared/config/products.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDf,CAAC;AAEX,eAAO,MAAM,QAAQ,EAAE,aAAa,EAkTnC,CAAC;AAOF,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAIvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGvE;AAED;;GAEG;AACH,wBAAgB,mBAAmB;;QAhZ7B,MAAM;UACJ,MAAM;UACN,MAAM;WACL,MAAM;kBACC,MAAM;IACpB;;;;;OAKG;iBACU,OAAO;IAuYrB"}
@@ -357,11 +357,15 @@ function n() {
357
357
  function r(t) {
358
358
  return e[n()][t] || "#";
359
359
  }
360
- function i() {
360
+ function i(t) {
361
+ let n = e.production[t];
362
+ return n ? `${n}icons/icon.svg` : void 0;
363
+ }
364
+ function a() {
361
365
  return t.map((e) => ({
362
366
  ...e,
363
367
  url: r(e.id)
364
368
  }));
365
369
  }
366
370
  //#endregion
367
- export { t as PRODUCTS, e as PRODUCT_URLS, r as getProductUrl, i as getProductsWithUrls };
371
+ export { t as PRODUCTS, e as PRODUCT_URLS, i as getProductLogoUrl, r as getProductUrl, a as getProductsWithUrls };
@@ -1 +1 @@
1
- {"version":3,"file":"useProducts.d.ts","sourceRoot":"","sources":["../../../../src/shared/hooks/shell/useProducts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA8DH,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AA6DD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,iBAAiB,CAyD3E"}
1
+ {"version":3,"file":"useProducts.d.ts","sourceRoot":"","sources":["../../../../src/shared/hooks/shell/useProducts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA8DH,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAeD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,iBAAiB,CAsE3E"}
@@ -1,14 +1,14 @@
1
- import { PRODUCTS as e, getProductUrl as t } from "../../config/products.js";
2
- import { useGatewayClient as n } from "../../graphql/GatewayContext.js";
1
+ import { PRODUCTS as e, getProductLogoUrl as t, getProductUrl as n } from "../../config/products.js";
2
+ import { useGatewayClient as r } from "../../graphql/GatewayContext.js";
3
3
  import "../../../shared-graphql.js";
4
- import { useCallback as r, useEffect as i, useState as a } from "react";
5
- import { gql as o } from "@apollo/client/core";
4
+ import { useCallback as i, useEffect as a, useState as o } from "react";
5
+ import { gql as s } from "@apollo/client/core";
6
6
  //#region src/shared/hooks/shell/useProducts.ts
7
- var s = new Set(e.map((e) => e.id)), c = new Map(e.map((e) => [e.id, e.comingSoon === !0]));
8
- function l(e, t, n) {
9
- return c.get(e) ? !0 : t !== "ACTIVE" || !n;
7
+ var c = new Set(e.map((e) => e.id)), l = new Map(e.map((e) => [e.id, e.comingSoon === !0]));
8
+ function u(e, t, n) {
9
+ return l.get(e) ? !0 : t !== "ACTIVE" || !n;
10
10
  }
11
- var u = o`
11
+ var d = s`
12
12
  query GetAccessibleProducts($limit: Int, $offset: Int) {
13
13
  myAccessibleProducts(limit: $limit, offset: $offset) {
14
14
  items {
@@ -25,84 +25,62 @@ var u = o`
25
25
  }
26
26
  }
27
27
  `;
28
- function d(e) {
29
- return s.has(e);
28
+ function f(e) {
29
+ return c.has(e);
30
30
  }
31
- var f = {
32
- fluidgrids: "#3b82f6",
33
- bigconsole: "#8b5cf6",
34
- workspaces: "#06b6d4",
35
- vibecontrols: "#10b981",
36
- botlit: "#f59e0b"
37
- }, p = "#6b7280";
38
- function m(e, t) {
39
- let n = {
40
- fluidgrids: "FG",
41
- bigconsole: "BC",
42
- workspaces: "WS",
43
- vibecontrols: "VC",
44
- botlit: "BL"
45
- };
46
- if (n[t]) return n[t];
47
- let r = e.split(/\s+/);
48
- return r.length >= 2 ? (r[0][0] + r[1][0]).toUpperCase() : e.substring(0, 2).toUpperCase();
49
- }
50
- function h(e, t) {
51
- return t?.color && typeof t.color == "string" ? t.color : f[e] || p;
52
- }
53
- function g(e) {
54
- if (e) return `${e.replace(/\/+$/, "")}/icons/icon.svg`;
55
- }
56
- function _() {
31
+ function p() {
57
32
  return e.map((e) => ({
58
33
  id: e.id,
59
34
  name: e.name,
60
- url: t(e.id),
35
+ url: n(e.id),
61
36
  icon: e.icon,
62
37
  color: e.color,
63
- logoUrl: g(t(e.id)),
64
- comingSoon: e.comingSoon
38
+ logoUrl: t(e.id),
39
+ comingSoon: e.comingSoon === !0
65
40
  }));
66
41
  }
67
- function v(e) {
68
- let o = n("global"), [s, c] = a(_()), [f, p] = a(e?.autoFetch !== !1), [v, y] = a(null), b = r(async () => {
69
- p(!0), y(null);
42
+ function m(s) {
43
+ let c = r("global"), [l, m] = o(p()), [h, g] = o(s?.autoFetch !== !1), [_, v] = o(null), y = i(async () => {
44
+ g(!0), v(null);
70
45
  try {
71
- let e = ((await o.query({
72
- query: u,
46
+ let r = (await c.query({
47
+ query: d,
73
48
  variables: {
74
49
  limit: 50,
75
50
  offset: 0
76
51
  },
77
52
  fetchPolicy: "cache-first"
78
- })).data?.myAccessibleProducts?.items || []).filter((e) => d(e.slug)).map((e) => ({
79
- id: e.slug,
80
- name: e.name,
81
- url: e.appUrl || t(e.slug),
82
- icon: m(e.name, e.slug),
83
- color: h(e.slug, e.metadata),
84
- logoUrl: e.logoUrl || g(e.appUrl || t(e.slug)),
85
- comingSoon: l(e.slug, e.status, e.appUrl)
86
- }));
87
- e.sort((e, t) => e.name.localeCompare(t.name)), c(e.length > 0 ? e : _());
53
+ })).data?.myAccessibleProducts?.items || [], i = new Map(r.filter((e) => f(e.slug)).map((e) => [e.slug, e])), a = e.map((e) => {
54
+ let r = i.get(e.id);
55
+ return {
56
+ id: e.id,
57
+ name: e.name,
58
+ url: r?.appUrl || n(e.id),
59
+ icon: e.icon,
60
+ color: r?.metadata && typeof r.metadata.color == "string" ? r.metadata.color : e.color,
61
+ logoUrl: t(e.id),
62
+ comingSoon: r ? u(e.id, r.status, r.appUrl) : e.comingSoon === !0
63
+ };
64
+ });
65
+ a.sort((e, t) => e.name.localeCompare(t.name)), m(a);
88
66
  } catch (e) {
89
- y(e instanceof Error ? e.message : "Failed to fetch products"), c(_());
67
+ v(e instanceof Error ? e.message : "Failed to fetch products"), m(p());
90
68
  } finally {
91
- p(!1);
69
+ g(!1);
92
70
  }
93
- }, [o]);
94
- return i(() => {
95
- if (e?.autoFetch === !1) {
96
- p(!1);
71
+ }, [c]);
72
+ return a(() => {
73
+ if (s?.autoFetch === !1) {
74
+ g(!1);
97
75
  return;
98
76
  }
99
- b();
77
+ y();
100
78
  }, []), {
101
- products: s,
102
- isLoading: f,
103
- error: v,
104
- refetch: b
79
+ products: l,
80
+ isLoading: h,
81
+ error: _,
82
+ refetch: y
105
83
  };
106
84
  }
107
85
  //#endregion
108
- export { v as useProducts };
86
+ export { m as useProducts };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.719.4",
3
+ "version": "2026.719.6",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "type": "module",
6
6
  "imports": {