@burdenoff/fe-libs 2026.926.4 → 2026.927.1
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/chrome/ProductPickerSheet.d.ts.map +1 -1
- package/dist/chrome/ProductPickerSheet.js +45 -44
- package/dist/chrome/ProductSwitcher.d.ts.map +1 -1
- package/dist/chrome/ProductSwitcher.js +83 -82
- package/dist/shared/assistant/conversation.d.ts +91 -3
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/gatewayClient.d.ts +15 -0
- package/dist/shared/assistant/gatewayClient.d.ts.map +1 -1
- package/dist/shared/assistant/gatewayClient.js +1 -1
- package/dist/shared/assistant/guardedStorage.d.ts +4 -2
- package/dist/shared/assistant/guardedStorage.d.ts.map +1 -1
- package/dist/shared/assistant/guardedStorage.js +1 -1
- package/dist/shared/assistant/history/historyApi.d.ts +38 -0
- package/dist/shared/assistant/history/historyApi.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyApi.js +153 -0
- package/dist/shared/assistant/history/historyEngine.d.ts +96 -0
- package/dist/shared/assistant/history/historyEngine.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyEngine.js +774 -0
- package/dist/shared/assistant/history/historyErrors.d.ts +72 -0
- package/dist/shared/assistant/history/historyErrors.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyErrors.js +74 -0
- package/dist/shared/assistant/history/historyList.d.ts +115 -0
- package/dist/shared/assistant/history/historyList.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyList.js +116 -0
- package/dist/shared/assistant/history/historyMapping.d.ts +65 -0
- package/dist/shared/assistant/history/historyMapping.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyMapping.js +383 -0
- package/dist/shared/assistant/history/historyMerge.d.ts +65 -0
- package/dist/shared/assistant/history/historyMerge.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyMerge.js +97 -0
- package/dist/shared/assistant/history/historyOperations.d.ts +24 -0
- package/dist/shared/assistant/history/historyOperations.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyOperations.js +125 -0
- package/dist/shared/assistant/history/historyResume.d.ts +56 -0
- package/dist/shared/assistant/history/historyResume.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyResume.js +55 -0
- package/dist/shared/assistant/history/historyStatus.d.ts +76 -0
- package/dist/shared/assistant/history/historyStatus.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyStatus.js +47 -0
- package/dist/shared/assistant/history/historyStore.d.ts +192 -0
- package/dist/shared/assistant/history/historyStore.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyStore.js +503 -0
- package/dist/shared/assistant/history/historyTimestamps.d.ts +11 -0
- package/dist/shared/assistant/history/historyTimestamps.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyTimestamps.js +9 -0
- package/dist/shared/assistant/history/historyTypes.d.ts +256 -0
- package/dist/shared/assistant/history/historyTypes.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyTypes.js +20 -0
- package/dist/shared/assistant/history/profileBoundStorage.d.ts +36 -0
- package/dist/shared/assistant/history/profileBoundStorage.d.ts.map +1 -0
- package/dist/shared/assistant/history/profileBoundStorage.js +74 -0
- package/dist/shared/assistant/history/stampRegistry.d.ts +84 -0
- package/dist/shared/assistant/history/stampRegistry.d.ts.map +1 -0
- package/dist/shared/assistant/history/stampRegistry.js +58 -0
- package/dist/shared/assistant/history/useAssistantServerHistory.d.ts +18 -0
- package/dist/shared/assistant/history/useAssistantServerHistory.d.ts.map +1 -0
- package/dist/shared/assistant/history/useAssistantServerHistory.js +12 -0
- package/dist/shared/assistant/i18nManifest.d.ts +18 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +18 -0
- package/dist/shared/assistant/index.d.ts +16 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/liveTurns.d.ts +7 -0
- package/dist/shared/assistant/liveTurns.d.ts.map +1 -1
- package/dist/shared/assistant/liveTurns.js +35 -32
- package/dist/shared/assistant/spokenTurns.d.ts +20 -0
- package/dist/shared/assistant/spokenTurns.d.ts.map +1 -1
- package/dist/shared/assistant/spokenTurns.js +13 -8
- package/dist/shared/assistant/store.d.ts +35 -1
- package/dist/shared/assistant/store.d.ts.map +1 -1
- package/dist/shared/assistant/store.js +93 -24
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts +16 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AIAssistantPanel.js +63 -60
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +730 -672
- package/dist/shared/assistant/ui/AssistantConversationList.d.ts +17 -0
- package/dist/shared/assistant/ui/AssistantConversationList.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantConversationList.js +252 -145
- package/dist/shared/assistant/ui/AssistantHistoryNotices.d.ts +36 -0
- package/dist/shared/assistant/ui/AssistantHistoryNotices.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantHistoryNotices.js +103 -0
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts +4 -0
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantOverlay.js +97 -94
- package/dist/shared/assistant/ui/AssistantSpokenTurnsNotice.d.ts +5 -3
- package/dist/shared/assistant/ui/AssistantSpokenTurnsNotice.d.ts.map +1 -1
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +6 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +54 -54
- package/dist/shared/assistant/ui/voice/VoiceTranscriptDrawer.d.ts +9 -0
- package/dist/shared/assistant/ui/voice/VoiceTranscriptDrawer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/VoiceTranscriptDrawer.js +37 -32
- package/dist/shared/assistant/voice/turnVisibility.d.ts +7 -5
- package/dist/shared/assistant/voice/turnVisibility.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceTranscript.d.ts +3 -2
- package/dist/shared/assistant/voice/voiceTranscript.d.ts.map +1 -1
- package/dist/shared/config/index.d.ts +3 -1
- package/dist/shared/config/index.d.ts.map +1 -1
- package/dist/shared/config/productSlug.d.ts +36 -0
- package/dist/shared/config/productSlug.d.ts.map +1 -0
- package/dist/shared/config/productSlug.js +23 -0
- package/dist/shared/config/products.d.ts +8 -1
- package/dist/shared/config/products.d.ts.map +1 -1
- package/dist/shared/config/products.js +21 -14
- package/dist/shared/hooks/shell/useProducts.d.ts +8 -0
- package/dist/shared/hooks/shell/useProducts.d.ts.map +1 -1
- package/dist/shared/hooks/shell/useProducts.js +46 -42
- package/dist/shared/providers/AppShellProvider.d.ts.map +1 -1
- package/dist/shared/providers/AppShellProvider.js +228 -227
- package/dist/shared/providers/shell/ThemeProvider.d.ts +1 -1
- package/dist/shared/providers/shell/ThemeProvider.d.ts.map +1 -1
- package/dist/shared/providers/shell/ThemeProvider.js +58 -57
- package/dist/shared/providers/shell/brandAttribute.d.ts +11 -0
- package/dist/shared/providers/shell/brandAttribute.d.ts.map +1 -0
- package/dist/shared/providers/shell/brandAttribute.js +7 -0
- package/dist/shared-assistant.js +153 -137
- package/dist/shared-config.js +11 -10
- package/dist/shared.js +121 -120
- package/package.json +2 -2
- package/src/vite/types.ts +4 -1
|
@@ -1,65 +1,70 @@
|
|
|
1
1
|
import { useAssistantTr as e } from "../../i18n.js";
|
|
2
2
|
import { ASSISTANT_PANEL_ATTR as t, focusIsInsidePanel as n } from "../panelOverlays.js";
|
|
3
3
|
import { VoiceConversationView as r } from "./VoiceConversationView.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { AssistantHistoryShowEarlier as i } from "../AssistantHistoryNotices.js";
|
|
5
|
+
import { useEffect as a, useRef as o } from "react";
|
|
6
|
+
import { ArrowRight as s, Download as c, X as l } from "lucide-react";
|
|
7
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
8
|
//#region src/shared/assistant/ui/voice/VoiceTranscriptDrawer.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
10
|
-
return
|
|
11
|
-
if (!
|
|
9
|
+
var f = ({ turns: f, onClose: p, onSave: m, onContinueInChat: h, closeOnEscape: g = !1, onShowEarlier: _, showEarlierDisabled: v = !1 }) => {
|
|
10
|
+
let y = e(), b = o(null);
|
|
11
|
+
return a(() => {
|
|
12
|
+
if (!g) return;
|
|
12
13
|
let e = (e) => {
|
|
13
14
|
if (e.key !== "Escape" || document.querySelector("[role=\"alertdialog\"]")) return;
|
|
14
|
-
let r =
|
|
15
|
-
n(r ?? null, i) && (e.preventDefault(), e.stopPropagation(),
|
|
15
|
+
let r = b.current?.closest(`[${t}]`), i = document.activeElement;
|
|
16
|
+
n(r ?? null, i) && (e.preventDefault(), e.stopPropagation(), p());
|
|
16
17
|
};
|
|
17
18
|
return document.addEventListener("keydown", e, !0), () => document.removeEventListener("keydown", e, !0);
|
|
18
|
-
}, [
|
|
19
|
-
ref:
|
|
19
|
+
}, [g, p]), /* @__PURE__ */ d("div", {
|
|
20
|
+
ref: b,
|
|
20
21
|
className: "absolute inset-0 z-30 flex flex-col bg-bg-sunken/95 backdrop-blur-sm",
|
|
21
22
|
role: "dialog",
|
|
22
|
-
"aria-label":
|
|
23
|
+
"aria-label": y("voiceSession.transcriptTitle", "Voice transcript"),
|
|
23
24
|
"data-testid": "assistant-voice-transcript",
|
|
24
25
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ d("div", {
|
|
26
27
|
className: "flex items-center justify-between border-b border-border-subtle px-4 py-3",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ d("div", {
|
|
28
29
|
className: "min-w-0",
|
|
29
|
-
children: [/* @__PURE__ */
|
|
30
|
+
children: [/* @__PURE__ */ u("h2", {
|
|
30
31
|
className: "text-sm font-semibold text-text-primary",
|
|
31
|
-
children:
|
|
32
|
-
}), /* @__PURE__ */
|
|
32
|
+
children: y("voiceSession.transcript", "Voice conversation")
|
|
33
|
+
}), /* @__PURE__ */ u("p", {
|
|
33
34
|
className: "truncate text-xs text-text-muted",
|
|
34
|
-
children:
|
|
35
|
+
children: y("voiceSession.transcriptHint", "Spoken turns in this conversation — kept out of your typed chat.")
|
|
35
36
|
})]
|
|
36
|
-
}), /* @__PURE__ */
|
|
37
|
+
}), /* @__PURE__ */ u("button", {
|
|
37
38
|
type: "button",
|
|
38
|
-
onClick:
|
|
39
|
+
onClick: p,
|
|
39
40
|
className: "flex size-8 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
40
|
-
"aria-label":
|
|
41
|
+
"aria-label": y("voiceSession.transcriptClose", "Close the transcript"),
|
|
41
42
|
"data-testid": "assistant-voice-transcript-close",
|
|
42
|
-
children: /* @__PURE__ */ l
|
|
43
|
+
children: /* @__PURE__ */ u(l, { className: "size-4" })
|
|
43
44
|
})]
|
|
44
45
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
46
|
+
_ ? /* @__PURE__ */ u(i, {
|
|
47
|
+
onShowEarlier: _,
|
|
48
|
+
disabled: v
|
|
49
|
+
}) : null,
|
|
50
|
+
/* @__PURE__ */ u(r, { turns: f }),
|
|
51
|
+
(m || h) && f.length > 0 ? /* @__PURE__ */ d("div", {
|
|
47
52
|
className: "flex items-center justify-end gap-2 border-t border-border-subtle px-4 py-3",
|
|
48
|
-
children: [
|
|
53
|
+
children: [m ? /* @__PURE__ */ d("button", {
|
|
49
54
|
type: "button",
|
|
50
|
-
onClick:
|
|
55
|
+
onClick: m,
|
|
51
56
|
className: "flex items-center gap-1.5 rounded-lg border border-border-default px-3 py-1.5 text-xs text-text-secondary transition-colors hover:bg-bg-elevated hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
52
57
|
"data-testid": "assistant-voice-save-transcript",
|
|
53
|
-
children: [/* @__PURE__ */
|
|
58
|
+
children: [/* @__PURE__ */ u(c, {
|
|
54
59
|
className: "size-3.5",
|
|
55
60
|
"aria-hidden": "true"
|
|
56
|
-
}),
|
|
57
|
-
}) : null,
|
|
61
|
+
}), y("voiceSession.save", "Save transcript")]
|
|
62
|
+
}) : null, h ? /* @__PURE__ */ d("button", {
|
|
58
63
|
type: "button",
|
|
59
|
-
onClick:
|
|
64
|
+
onClick: h,
|
|
60
65
|
className: "flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-fg transition-opacity hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
|
|
61
66
|
"data-testid": "assistant-voice-continue-in-chat",
|
|
62
|
-
children: [
|
|
67
|
+
children: [y("voiceSession.continueInChat", "Continue in chat"), /* @__PURE__ */ u(s, {
|
|
63
68
|
className: "size-3.5",
|
|
64
69
|
"aria-hidden": "true"
|
|
65
70
|
})]
|
|
@@ -69,4 +74,4 @@ var d = ({ turns: d, onClose: f, onSave: p, onContinueInChat: m, closeOnEscape:
|
|
|
69
74
|
});
|
|
70
75
|
};
|
|
71
76
|
//#endregion
|
|
72
|
-
export {
|
|
77
|
+
export { f as VoiceTranscriptDrawer };
|
|
@@ -12,11 +12,13 @@
|
|
|
12
12
|
* - the voice panel shows ONLY turns that happened in voice
|
|
13
13
|
*
|
|
14
14
|
* ★ Deliberately a DISPLAY split, not separate persistence. It survives a reload
|
|
15
|
-
* because the
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
15
|
+
* because the marker is persisted with the turn, and a conversation read back
|
|
16
|
+
* from server history (BOFF-7335) enters the store ONLY through
|
|
17
|
+
* `fromHistoryEntry`, which rebuilds the marker from the saved entry — so the
|
|
18
|
+
* split holds on every device. The backend session stays shared, so the model
|
|
19
|
+
* keeps full context across both surfaces, which is what makes "carry on where
|
|
20
|
+
* we left off" work. Genuinely separate backend sessions are a larger change
|
|
21
|
+
* and would cost that.
|
|
20
22
|
*
|
|
21
23
|
* ★ Product-agnostic by construction: it knows about turns and surfaces, never
|
|
22
24
|
* about crops, workflows or nodes. Nothing here needs to change for a product
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turnVisibility.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/voice/turnVisibility.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"turnVisibility.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/voice/turnVisibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,UAAU,QAAQ;IAChB,QAAQ,CAAC,EAAE,CAAC;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;CACjG;AAED,gEAAgE;AAChE,wBAAgB,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAEtD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAGtE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG;IAAE,KAAK,CAAC,EAAE,IAAI,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,CAEpG;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAEzE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAE9E;AAED,yEAAyE;AACzE,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC;;;OAGG;IACH,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,KAAK,EAAE,CAAC,EAAE,CAAC;CACZ;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAE9F;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,SAAS,GAC3C,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAWxB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;;;OASG;IACH,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B"}
|
|
@@ -46,8 +46,9 @@ export declare function voiceTranscriptFilename(product: string, now: Date): str
|
|
|
46
46
|
* free, which matters for a control people will press to get out of a voice
|
|
47
47
|
* session.
|
|
48
48
|
*
|
|
49
|
-
* ★ It tells the MODEL nothing, and does not need to. The
|
|
50
|
-
*
|
|
49
|
+
* ★ It tells the MODEL nothing, and does not need to. The backend session
|
|
50
|
+
* already holds every spoken turn (a new session in a conversation saved to
|
|
51
|
+
* server history is handed them as saved context, BOFF-7335) — so this note
|
|
51
52
|
* exists purely so the human can see, in the thread, what was discussed.
|
|
52
53
|
*/
|
|
53
54
|
export declare function buildContinuedFromVoiceNote(turns: readonly VoiceTranscriptTurn[], labels: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voiceTranscript.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/voice/voiceTranscript.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAgCvF;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,MAAM,EAAE;IACN,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB,EACD,GAAG,EAAE,IAAI,GACR,MAAM,CAmCR;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,GAAG,MAAM,CAI1E;AAED
|
|
1
|
+
{"version":3,"file":"voiceTranscript.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/voice/voiceTranscript.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAgCvF;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,MAAM,EAAE;IACN,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB,EACD,GAAG,EAAE,IAAI,GACR,MAAM,CAmCR;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,GAAG,MAAM,CAI1E;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;CAAE,GAC1E,MAAM,CAkBR"}
|
|
@@ -68,8 +68,10 @@ export { resolveGatewayUrls } from './gatewayUrls';
|
|
|
68
68
|
export type { RuntimeGatewayUrls } from './gatewayUrls';
|
|
69
69
|
export { resolveAuthBridgeConfig, resolveShellAuthBridgeConfig } from './authBridgeUrls';
|
|
70
70
|
export type { RuntimeAuthBridgeConfig } from './authBridgeUrls';
|
|
71
|
-
export { PRODUCTS, PRODUCT_URLS, getProductUrl, getProductsWithUrls } from './products';
|
|
71
|
+
export { PRODUCTS, PRODUCT_URLS, BOTMANOR_PRODUCT_SLUG, getProductUrl, getProductsWithUrls, findProductConfig, } from './products';
|
|
72
72
|
export type { ProductConfig } from './products';
|
|
73
|
+
export { PRODUCT_SLUG_RENAMES, PRODUCT_SLUG_EMIT, normalizeProductSlug, legacyProductSlug, isSameProductSlug, emitProductSlug, } from './productSlug';
|
|
74
|
+
export type { ProductSlugRename } from './productSlug';
|
|
73
75
|
export { getShellConfig, isShellLessRoute, shouldShowSidebar, shouldShowBreadcrumb, DEFAULT_SHELL_CONFIG, COMMON_SHELL_LESS_ROUTES, } from './shellRoutes';
|
|
74
76
|
export type { ShellRouteConfig } from './shellRoutes';
|
|
75
77
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC;;;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AC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product slug aliases for products whose machine slug is being renamed
|
|
3
|
+
* (today: `botlit` -> `botmanor`, botmanor-migration PLAN Stage 0 / WP-E).
|
|
4
|
+
*
|
|
5
|
+
* - Readers accept both slugs: compare with {@link isSameProductSlug}, look up
|
|
6
|
+
* keyed maps with `map[slug] ?? map[legacyProductSlug(slug)]`.
|
|
7
|
+
* - Writers emit {@link emitProductSlug}, which follows {@link PRODUCT_SLUG_EMIT}.
|
|
8
|
+
* It stays `"legacy"` until the stage that flips the slug; the flip is that
|
|
9
|
+
* one line plus a release.
|
|
10
|
+
*
|
|
11
|
+
* Local mirror of `@burdenoff/website-sdk`'s `utils/product-slug.ts` (and the
|
|
12
|
+
* product-slug concern of `@burdenoff/be-sdk/product-alias`), so fe-libs does
|
|
13
|
+
* not take a dependency on either SDK for ~20 lines of pure code.
|
|
14
|
+
*
|
|
15
|
+
* @module @burdenoff/fe-libs/shared/config/productSlug
|
|
16
|
+
*/
|
|
17
|
+
/** One product whose slug is being renamed. Both values are lowercase. */
|
|
18
|
+
export interface ProductSlugRename {
|
|
19
|
+
readonly legacy: string;
|
|
20
|
+
readonly current: string;
|
|
21
|
+
}
|
|
22
|
+
/** Every product slug rename in flight. */
|
|
23
|
+
export declare const PRODUCT_SLUG_RENAMES: readonly ProductSlugRename[];
|
|
24
|
+
/** Which slug writers emit: the old one until the rename stage flips it. */
|
|
25
|
+
export declare const PRODUCT_SLUG_EMIT: Readonly<{
|
|
26
|
+
productSlug: 'legacy' | 'current';
|
|
27
|
+
}>;
|
|
28
|
+
/** `botlit` (any case) -> `botmanor`; every other slug is returned unchanged. */
|
|
29
|
+
export declare function normalizeProductSlug(slug: string): string;
|
|
30
|
+
/** Old spelling of a renamed slug (`botmanor` -> `botlit`); every other slug unchanged. */
|
|
31
|
+
export declare function legacyProductSlug(slug: string): string;
|
|
32
|
+
/** True when `a` and `b` are the same product under the rename. */
|
|
33
|
+
export declare function isSameProductSlug(a: string | null | undefined, b: string | null | undefined): boolean;
|
|
34
|
+
/** The slug writers should use today, from either spelling. */
|
|
35
|
+
export declare function emitProductSlug(slug: string): string;
|
|
36
|
+
//# sourceMappingURL=productSlug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productSlug.d.ts","sourceRoot":"","sources":["../../../src/shared/config/productSlug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,0EAA0E;AAC1E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,2CAA2C;AAC3C,eAAO,MAAM,oBAAoB,EAAE,SAAS,iBAAiB,EAE3D,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC;IAAE,WAAW,EAAE,QAAQ,GAAG,SAAS,CAAA;CAAE,CAE5E,CAAC;AAOH,iFAAiF;AACjF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,mEAAmE;AACnE,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC5B,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC3B,OAAO,CAGT;AAED,+DAA+D;AAC/D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIpD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/shared/config/productSlug.ts
|
|
2
|
+
var e = Object.freeze([Object.freeze({
|
|
3
|
+
legacy: "botlit",
|
|
4
|
+
current: "botmanor"
|
|
5
|
+
})]), t = Object.freeze({ productSlug: "legacy" });
|
|
6
|
+
function n(t) {
|
|
7
|
+
let n = t.toLowerCase();
|
|
8
|
+
return e.find((e) => e.legacy === n || e.current === n);
|
|
9
|
+
}
|
|
10
|
+
function r(e) {
|
|
11
|
+
return n(e)?.current ?? e;
|
|
12
|
+
}
|
|
13
|
+
function i(e) {
|
|
14
|
+
return n(e)?.legacy ?? e;
|
|
15
|
+
}
|
|
16
|
+
function a(e, t) {
|
|
17
|
+
return e == null || t == null ? e === t : e === t || r(e) === r(t);
|
|
18
|
+
}
|
|
19
|
+
function o(e) {
|
|
20
|
+
return t.productSlug === "current" ? r(e) : i(e);
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { t as PRODUCT_SLUG_EMIT, e as PRODUCT_SLUG_RENAMES, o as emitProductSlug, a as isSameProductSlug, i as legacyProductSlug, r as normalizeProductSlug };
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module @burdenoff/fe-libs/shared/config/products
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* BotManor's product id (slug). Still the legacy `botlit` until the rename
|
|
8
|
+
* stage flips `PRODUCT_SLUG_EMIT`; readers must accept both spellings.
|
|
9
|
+
*/
|
|
10
|
+
export declare const BOTMANOR_PRODUCT_SLUG: string;
|
|
6
11
|
export interface ProductConfig {
|
|
7
12
|
id: string;
|
|
8
13
|
name: string;
|
|
@@ -23,7 +28,7 @@ export declare const PRODUCT_URLS: {
|
|
|
23
28
|
readonly bigconsole: "http://localhost:5148/";
|
|
24
29
|
readonly workspaces: "http://localhost:5149/";
|
|
25
30
|
readonly vibecontrols: "http://localhost:5151/";
|
|
26
|
-
readonly botlit: "http://localhost:
|
|
31
|
+
readonly botlit: "http://localhost:5260/";
|
|
27
32
|
};
|
|
28
33
|
readonly production: {
|
|
29
34
|
readonly fluidgrids: "https://app.fluidgrids.com/";
|
|
@@ -68,6 +73,8 @@ export declare const PRODUCT_URLS: {
|
|
|
68
73
|
};
|
|
69
74
|
export declare const PRODUCTS: ProductConfig[];
|
|
70
75
|
export declare function getProductUrl(productId: string): string;
|
|
76
|
+
/** Catalog entry for a product id, accepting either spelling of a renamed slug. */
|
|
77
|
+
export declare function findProductConfig(productId: string): ProductConfig | undefined;
|
|
71
78
|
/**
|
|
72
79
|
* Absolute logo URL for a product — ALWAYS the production app's
|
|
73
80
|
* `/icons/icon.svg`, regardless of the current environment.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../../src/shared/config/products.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../../src/shared/config/products.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAA8B,CAAC;AAEjE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDf,CAAC;AAEX,eAAO,MAAM,QAAQ,EAAE,aAAa,EA+QnC,CAAC;AAYF,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAE9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGvE;AAED;;GAEG;AACH,wBAAgB,mBAAmB;;QAxX7B,MAAM;UACJ,MAAM;UACN,MAAM;WACL,MAAM;kBACC,MAAM;IACpB;;;;;OAKG;iBACU,OAAO;IA+WrB"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { emitProductSlug as e, isSameProductSlug as t, legacyProductSlug as n } from "./productSlug.js";
|
|
1
2
|
//#region src/shared/config/products.ts
|
|
2
|
-
var e = {
|
|
3
|
+
var r = e("botmanor"), i = {
|
|
3
4
|
development: {
|
|
4
5
|
fluidgrids: "http://localhost:5147/",
|
|
5
6
|
bigconsole: "http://localhost:5148/",
|
|
6
7
|
workspaces: "http://localhost:5149/",
|
|
7
8
|
vibecontrols: "http://localhost:5151/",
|
|
8
|
-
botlit: "http://localhost:
|
|
9
|
+
botlit: "http://localhost:5260/"
|
|
9
10
|
},
|
|
10
11
|
production: {
|
|
11
12
|
fluidgrids: "https://app.fluidgrids.com/",
|
|
@@ -47,7 +48,7 @@ var e = {
|
|
|
47
48
|
theculturepost: "https://app.theculturepost.com/",
|
|
48
49
|
theglobalfuel: "https://app.theglobalfuel.com/"
|
|
49
50
|
}
|
|
50
|
-
},
|
|
51
|
+
}, a = [
|
|
51
52
|
{
|
|
52
53
|
id: "vibecontrols",
|
|
53
54
|
name: "VibeControls",
|
|
@@ -77,7 +78,7 @@ var e = {
|
|
|
77
78
|
description: "AI development console"
|
|
78
79
|
},
|
|
79
80
|
{
|
|
80
|
-
id:
|
|
81
|
+
id: r,
|
|
81
82
|
name: "BotManor",
|
|
82
83
|
icon: "BL",
|
|
83
84
|
color: "#f59e0b",
|
|
@@ -316,21 +317,27 @@ var e = {
|
|
|
316
317
|
description: "Energy, minerals & resources platform"
|
|
317
318
|
}
|
|
318
319
|
];
|
|
319
|
-
function
|
|
320
|
+
function o() {
|
|
320
321
|
return "production";
|
|
321
322
|
}
|
|
322
|
-
function
|
|
323
|
-
return e[n()]
|
|
323
|
+
function s(e, t) {
|
|
324
|
+
return e[t] ?? e[n(t)];
|
|
324
325
|
}
|
|
325
|
-
function
|
|
326
|
-
|
|
327
|
-
return n ? `${n}icons/icon.svg` : void 0;
|
|
326
|
+
function c(e) {
|
|
327
|
+
return s(i[o()], e) || "#";
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
return
|
|
329
|
+
function l(e) {
|
|
330
|
+
return a.find((n) => t(n.id, e));
|
|
331
|
+
}
|
|
332
|
+
function u(e) {
|
|
333
|
+
let t = s(i.production, e);
|
|
334
|
+
return t ? `${t}icons/icon.svg` : void 0;
|
|
335
|
+
}
|
|
336
|
+
function d() {
|
|
337
|
+
return a.map((e) => ({
|
|
331
338
|
...e,
|
|
332
|
-
url:
|
|
339
|
+
url: c(e.id)
|
|
333
340
|
}));
|
|
334
341
|
}
|
|
335
342
|
//#endregion
|
|
336
|
-
export {
|
|
343
|
+
export { r as BOTMANOR_PRODUCT_SLUG, a as PRODUCTS, i as PRODUCT_URLS, l as findProductConfig, u as getProductLogoUrl, c as getProductUrl, d as getProductsWithUrls };
|
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module @burdenoff/fe-libs/shared/hooks/shell/useProducts
|
|
8
8
|
*/
|
|
9
|
+
export declare function isKnownProductSlug(slug: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Index registry products by normalised slug so a catalog entry finds its API
|
|
12
|
+
* row whichever spelling of a renamed slug either side uses.
|
|
13
|
+
*/
|
|
14
|
+
export declare function indexApiProductsBySlug<T extends {
|
|
15
|
+
slug: string;
|
|
16
|
+
}>(apiProducts: readonly T[]): Map<string, T>;
|
|
9
17
|
/**
|
|
10
18
|
* Reject API appUrls that are clearly not production-safe: non-https schemes,
|
|
11
19
|
* localhost/loopback addresses, or empty values. The static catalog URL is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProducts.d.ts","sourceRoot":"","sources":["../../../../src/shared/hooks/shell/useProducts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"useProducts.d.ts","sourceRoot":"","sources":["../../../../src/shared/hooks/shell/useProducts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA+DH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAC/D,WAAW,EAAE,SAAS,CAAC,EAAE,GACxB,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAMhB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,GAAG,IAAI,MAAM,CAU7E;AAED,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,CAqE3E"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { normalizeProductSlug as e } from "../../config/productSlug.js";
|
|
2
|
+
import { PRODUCTS as t, getProductLogoUrl as n, getProductUrl as r } from "../../config/products.js";
|
|
3
|
+
import { useGatewayClient as i } from "../../graphql/GatewayContext.js";
|
|
3
4
|
import "../../../shared-graphql.js";
|
|
4
|
-
import { useCallback as
|
|
5
|
-
import { gql as
|
|
5
|
+
import { useCallback as a, useEffect as o, useState as s } from "react";
|
|
6
|
+
import { gql as c } from "@apollo/client/core";
|
|
6
7
|
//#region src/shared/hooks/shell/useProducts.ts
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
return
|
|
8
|
+
var l = new Set(t.map((t) => e(t.id))), u = new Map(t.map((t) => [e(t.id), t.comingSoon === !0]));
|
|
9
|
+
function d(t, n, r) {
|
|
10
|
+
return u.get(e(t)) ? !0 : n !== "ACTIVE" || !r;
|
|
10
11
|
}
|
|
11
|
-
var
|
|
12
|
+
var f = c`
|
|
12
13
|
query GetAccessibleProducts($limit: Int, $offset: Int) {
|
|
13
14
|
myAccessibleProducts(limit: $limit, offset: $offset) {
|
|
14
15
|
items {
|
|
@@ -25,10 +26,13 @@ var d = s`
|
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
`;
|
|
28
|
-
function
|
|
29
|
-
return
|
|
29
|
+
function p(t) {
|
|
30
|
+
return l.has(e(t));
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
+
function m(t) {
|
|
33
|
+
return new Map(t.filter((e) => p(e.slug)).map((t) => [e(t.slug), t]));
|
|
34
|
+
}
|
|
35
|
+
function h(e) {
|
|
32
36
|
if (!e || !e.startsWith("https://") || e.includes("localhost") || e.includes("127.0.0.1")) return !1;
|
|
33
37
|
try {
|
|
34
38
|
let t = new URL(e);
|
|
@@ -37,59 +41,59 @@ function p(e) {
|
|
|
37
41
|
return !1;
|
|
38
42
|
}
|
|
39
43
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
44
|
+
function g() {
|
|
45
|
+
return t.map((e) => ({
|
|
42
46
|
id: e.id,
|
|
43
47
|
name: e.name,
|
|
44
|
-
url:
|
|
48
|
+
url: r(e.id),
|
|
45
49
|
icon: e.icon,
|
|
46
50
|
color: e.color,
|
|
47
|
-
logoUrl:
|
|
51
|
+
logoUrl: n(e.id),
|
|
48
52
|
comingSoon: e.comingSoon === !0
|
|
49
53
|
}));
|
|
50
54
|
}
|
|
51
|
-
function
|
|
52
|
-
let
|
|
53
|
-
|
|
55
|
+
function _(c) {
|
|
56
|
+
let l = i("global"), [u, p] = s(g()), [_, v] = s(c?.autoFetch !== !1), [y, b] = s(null), x = a(async () => {
|
|
57
|
+
v(!0), b(null);
|
|
54
58
|
try {
|
|
55
|
-
let
|
|
56
|
-
query:
|
|
59
|
+
let i = m((await l.query({
|
|
60
|
+
query: f,
|
|
57
61
|
variables: {
|
|
58
62
|
limit: 50,
|
|
59
63
|
offset: 0
|
|
60
64
|
},
|
|
61
65
|
fetchPolicy: "cache-first"
|
|
62
|
-
})).data?.myAccessibleProducts?.items || []
|
|
63
|
-
let
|
|
66
|
+
})).data?.myAccessibleProducts?.items || []), a = t.map((t) => {
|
|
67
|
+
let a = i.get(e(t.id));
|
|
64
68
|
return {
|
|
65
|
-
id:
|
|
66
|
-
name:
|
|
67
|
-
url:
|
|
68
|
-
icon:
|
|
69
|
-
color:
|
|
70
|
-
logoUrl: t
|
|
71
|
-
comingSoon:
|
|
69
|
+
id: t.id,
|
|
70
|
+
name: t.name,
|
|
71
|
+
url: h(a?.appUrl) ? a.appUrl : r(t.id),
|
|
72
|
+
icon: t.icon,
|
|
73
|
+
color: a?.metadata && typeof a.metadata.color == "string" ? a.metadata.color : t.color,
|
|
74
|
+
logoUrl: n(t.id),
|
|
75
|
+
comingSoon: a ? d(t.id, a.status, a.appUrl) : t.comingSoon === !0
|
|
72
76
|
};
|
|
73
77
|
});
|
|
74
|
-
a.sort((e, t) => e.name.localeCompare(t.name)),
|
|
78
|
+
a.sort((e, t) => e.name.localeCompare(t.name)), p(a);
|
|
75
79
|
} catch (e) {
|
|
76
|
-
|
|
80
|
+
b(e instanceof Error ? e.message : "Failed to fetch products"), p(g());
|
|
77
81
|
} finally {
|
|
78
|
-
|
|
82
|
+
v(!1);
|
|
79
83
|
}
|
|
80
|
-
}, [
|
|
81
|
-
return
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
+
}, [l]);
|
|
85
|
+
return o(() => {
|
|
86
|
+
if (c?.autoFetch === !1) {
|
|
87
|
+
v(!1);
|
|
84
88
|
return;
|
|
85
89
|
}
|
|
86
|
-
|
|
90
|
+
x();
|
|
87
91
|
}, []), {
|
|
88
|
-
products:
|
|
89
|
-
isLoading:
|
|
90
|
-
error:
|
|
91
|
-
refetch:
|
|
92
|
+
products: u,
|
|
93
|
+
isLoading: _,
|
|
94
|
+
error: y,
|
|
95
|
+
refetch: x
|
|
92
96
|
};
|
|
93
97
|
}
|
|
94
98
|
//#endregion
|
|
95
|
-
export {
|
|
99
|
+
export { _ as useProducts };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellProvider.d.ts","sourceRoot":"","sources":["../../../src/shared/providers/AppShellProvider.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAqD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAa1F,OAAO,EAEL,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"AppShellProvider.d.ts","sourceRoot":"","sources":["../../../src/shared/providers/AppShellProvider.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAqD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAa1F,OAAO,EAEL,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAc/B,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EASL,KAAK,kBAAkB,EACxB,MAAM,WAAW,CAA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