@burdenoff/fe-libs 2026.1113.4 → 2026.1113.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.
- package/dist/button/Button.d.ts +1 -1
- package/dist/chrome/DynamicFooter.js +14 -14
- package/dist/chrome/HeaderBar.js +4 -4
- package/dist/shared/assistant/askAbout/AskAboutLayer.js +93 -69
- package/dist/shared/assistant/askAbout/placement.d.ts +14 -0
- package/dist/shared/assistant/askAbout/placement.js +11 -1
- package/dist/shared/components/ContextConversationWidget.js +4 -4
- package/dist/shared/graphql/fetch.js +29 -29
- package/dist/shared/pages/LegalPage.js +13 -13
- package/dist/shared/providers/shell/ProfileI18nBridge.js +14 -14
- package/dist/shared/providers/shell/ProfileStorageManager.d.ts +9 -0
- package/dist/shared/providers/shell/ProfileStorageManager.js +83 -64
- package/dist/shared-assistant.js +302 -302
- package/dist/shared-hooks.js +6 -6
- package/dist/shared.js +44 -44
- package/dist/ui/access-gate.d.ts +22 -0
- package/dist/ui/access-gate.js +26 -0
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/index.d.ts +4 -0
- package/dist/ui/optional-fields.d.ts +13 -1
- package/dist/ui/optional-fields.js +76 -20
- package/dist/ui/page-tabs.d.ts +42 -0
- package/dist/ui/page-tabs.js +172 -0
- package/dist/ui/show-technical-details.d.ts +17 -0
- package/dist/ui/show-technical-details.js +73 -0
- package/dist/ui/use-remembered-open.d.ts +8 -0
- package/dist/ui/use-remembered-open.js +36 -0
- package/dist/ui.js +52 -48
- package/package.json +1 -1
package/dist/button/Button.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "link" | "default" | "destructive" | "
|
|
4
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
5
|
size?: "icon" | "default" | "sm" | "lg" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DEFAULT_FOOTER_COLUMNS as e, DEFAULT_SOCIAL_LINKS as t, Footer as n } from "./Footer.js";
|
|
2
|
+
import { useGatewayClient as r } from "../shared/graphql/GatewayContext.js";
|
|
3
3
|
import { BrandMark as i } from "./BrandMark.js";
|
|
4
4
|
import { useActiveContext as a } from "../shared/providers/shell/ActiveContextProvider.js";
|
|
5
5
|
import "../shared-graphql.js";
|
|
@@ -7,17 +7,17 @@ import { useI18n as o } from "../shared/providers/shell/I18nProvider.js";
|
|
|
7
7
|
import { useEffect as s, useMemo as c, useState as l } from "react";
|
|
8
8
|
import { Github as u, Globe as d, Linkedin as f, MessageCircle as p, Twitter as m, Youtube as h } from "lucide-react";
|
|
9
9
|
import { jsx as g } from "react/jsx-runtime";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { Link as _ } from "react-router";
|
|
11
|
+
import { gql as v } from "@apollo/client/core";
|
|
12
12
|
// src/chrome/DynamicFooter.tsx
|
|
13
|
-
var y =
|
|
13
|
+
var y = v`
|
|
14
14
|
query GetFooterPublicProduct($slug: String!) {
|
|
15
15
|
publicProduct(slug: $slug) {
|
|
16
16
|
id
|
|
17
17
|
socialLinks
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
`, b =
|
|
20
|
+
`, b = v`
|
|
21
21
|
query GetFooterPublicContentPages($productId: String!, $limit: Int) {
|
|
22
22
|
publicContentPages(productId: $productId, limit: $limit) {
|
|
23
23
|
items {
|
|
@@ -60,8 +60,8 @@ var y = _`
|
|
|
60
60
|
function w(e) {
|
|
61
61
|
return e.trim().replace(/[^A-Za-z0-9 ]/g, "").split(/\s+/).map((e, t) => t === 0 ? e.toLowerCase() : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join("");
|
|
62
62
|
}
|
|
63
|
-
function T({ productSlug: u, productName: f, tagline: p, version: m = "v1.0.0", copyright: h, columns:
|
|
64
|
-
let { workspaceId: k, projectId: A } = a(), j =
|
|
63
|
+
function T({ productSlug: u, productName: f, tagline: p, version: m = "v1.0.0", copyright: h, columns: v, socialLinks: T, legalPageOrder: E = C, deferRemoteData: D = !1, hideOnInstalledApp: O = !0 }) {
|
|
64
|
+
let { workspaceId: k, projectId: A } = a(), j = r("global"), { t: M } = o(), [N, P] = l(null), [F, I] = l(null);
|
|
65
65
|
s(() => {
|
|
66
66
|
if (!j || D) return;
|
|
67
67
|
let e = !1;
|
|
@@ -115,10 +115,10 @@ function T({ productSlug: u, productName: f, tagline: p, version: m = "v1.0.0",
|
|
|
115
115
|
u
|
|
116
116
|
]);
|
|
117
117
|
let L = c(() => {
|
|
118
|
-
let
|
|
118
|
+
let t = v ?? e, n = N ? t.map((e) => e.title === "Legal" ? {
|
|
119
119
|
...e,
|
|
120
120
|
links: N
|
|
121
|
-
} : e) :
|
|
121
|
+
} : e) : t, r = (e, t) => {
|
|
122
122
|
let n = M(e);
|
|
123
123
|
return n === e ? t : n;
|
|
124
124
|
};
|
|
@@ -132,15 +132,15 @@ function T({ productSlug: u, productName: f, tagline: p, version: m = "v1.0.0",
|
|
|
132
132
|
}));
|
|
133
133
|
}, [
|
|
134
134
|
N,
|
|
135
|
-
|
|
135
|
+
v,
|
|
136
136
|
M
|
|
137
137
|
]);
|
|
138
|
-
return /* @__PURE__ */ g(
|
|
138
|
+
return /* @__PURE__ */ g(n, {
|
|
139
139
|
logo: /* @__PURE__ */ g(i, { size: "sidenav" }),
|
|
140
140
|
productName: f,
|
|
141
141
|
tagline: p,
|
|
142
142
|
columns: L,
|
|
143
|
-
socialLinks: T ?? F ??
|
|
143
|
+
socialLinks: T ?? F ?? t,
|
|
144
144
|
version: m,
|
|
145
145
|
copyright: h,
|
|
146
146
|
hideOnInstalledApp: O,
|
|
@@ -154,7 +154,7 @@ function T({ productSlug: u, productName: f, tagline: p, version: m = "v1.0.0",
|
|
|
154
154
|
rel: "noopener noreferrer",
|
|
155
155
|
className: r,
|
|
156
156
|
children: n
|
|
157
|
-
}) : /* @__PURE__ */ g(
|
|
157
|
+
}) : /* @__PURE__ */ g(_, {
|
|
158
158
|
to: e,
|
|
159
159
|
className: r,
|
|
160
160
|
children: n
|
package/dist/chrome/HeaderBar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { HeaderThemeSwitcher as e } from "./HeaderThemeSwitcher.js";
|
|
2
|
+
import { isInstalledApp as t } from "../shared/native/platform.js";
|
|
3
3
|
import "../shared-native.js";
|
|
4
4
|
import { useShellLabel as n } from "../shared/providers/shell/useShellLabel.js";
|
|
5
5
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
@@ -48,7 +48,7 @@ var a = ({ logo: a, appName: o, onLogoClick: s, onMenuToggle: c, onSearchClick:
|
|
|
48
48
|
className: "flex items-center gap-1 md:gap-control-gap",
|
|
49
49
|
children: [
|
|
50
50
|
b,
|
|
51
|
-
x && !
|
|
51
|
+
x && !t() && /* @__PURE__ */ r("div", {
|
|
52
52
|
className: E ? "hidden md:block empty:hidden" : "empty:hidden",
|
|
53
53
|
children: x
|
|
54
54
|
}),
|
|
@@ -118,7 +118,7 @@ var a = ({ logo: a, appName: o, onLogoClick: s, onMenuToggle: c, onSearchClick:
|
|
|
118
118
|
})
|
|
119
119
|
}), f > 0 && /* @__PURE__ */ r("span", { className: "absolute top-1 end-1 size-2 bg-status-error-bg rounded-full border border-bg-elevated" })]
|
|
120
120
|
}) : null),
|
|
121
|
-
g && /* @__PURE__ */ r(
|
|
121
|
+
g && /* @__PURE__ */ r(e, { mobileOptimized: E }),
|
|
122
122
|
w
|
|
123
123
|
]
|
|
124
124
|
})]
|
|
@@ -2,30 +2,30 @@ import { useAssistantTr as e } from "../i18n.js";
|
|
|
2
2
|
import { useAskAboutStore as t } from "./askAboutStore.js";
|
|
3
3
|
import { ASK_ABOUT_HINT_SHOWN_MS as n, markAskAboutHintSeen as r } from "./hint.js";
|
|
4
4
|
import { readAskableSelection as i } from "./askableSelection.js";
|
|
5
|
-
import { placeAskAboutMenu as a, placeAskSelectionButton as o, scrollClosesMenu as s } from "./placement.js";
|
|
6
|
-
import { useEffect as
|
|
7
|
-
import { Sparkles as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { createPortal as
|
|
5
|
+
import { placeAskAboutMenu as a, placeAskSelectionButton as o, scrollClosesMenu as s, visiblePart as c } from "./placement.js";
|
|
6
|
+
import { useEffect as l, useRef as u, useState as d } from "react";
|
|
7
|
+
import { Sparkles as f } from "lucide-react";
|
|
8
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
|
+
import { createPortal as g } from "react-dom";
|
|
10
10
|
// src/shared/assistant/askAbout/AskAboutLayer.tsx
|
|
11
|
-
var
|
|
12
|
-
|
|
11
|
+
var _ = ({ onOpenAssistant: e }) => {
|
|
12
|
+
l(() => t.getState().actions.registerHost(), []);
|
|
13
13
|
let n = (n, r) => {
|
|
14
14
|
t.getState().actions.pick(n, r), e();
|
|
15
|
-
}, r = t((e) => e.openRequested), i =
|
|
16
|
-
return
|
|
15
|
+
}, r = t((e) => e.openRequested), i = u(e);
|
|
16
|
+
return l(() => {
|
|
17
17
|
i.current = e;
|
|
18
|
-
}, [e]),
|
|
18
|
+
}, [e]), l(() => {
|
|
19
19
|
r && (t.getState().actions.opened(), i.current());
|
|
20
|
-
}, [r]), /* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
20
|
+
}, [r]), /* @__PURE__ */ h(p, { children: [
|
|
21
|
+
/* @__PURE__ */ m(v, { onAsk: n }),
|
|
22
|
+
/* @__PURE__ */ m(T, {}),
|
|
23
|
+
/* @__PURE__ */ m(E, {}),
|
|
24
|
+
/* @__PURE__ */ m(y, { onAsk: n })
|
|
25
25
|
] });
|
|
26
|
-
},
|
|
27
|
-
let r = e(), i = t((e) => e.menu), o =
|
|
28
|
-
if (
|
|
26
|
+
}, v = ({ onAsk: n }) => {
|
|
27
|
+
let r = e(), i = t((e) => e.menu), o = u(null);
|
|
28
|
+
if (l(() => {
|
|
29
29
|
if (!i) return;
|
|
30
30
|
let { closeMenu: e } = t.getState().actions;
|
|
31
31
|
o.current?.querySelector("[role=\"menuitem\"]")?.focus({ preventScroll: !0 });
|
|
@@ -38,13 +38,13 @@ var g = ({ onOpenAssistant: e }) => {
|
|
|
38
38
|
document.removeEventListener("pointerdown", n, !0), window.removeEventListener("scroll", r, !0), window.removeEventListener("resize", e), window.removeEventListener("popstate", e), window.removeEventListener("blur", e);
|
|
39
39
|
};
|
|
40
40
|
}, [i]), !i || typeof document > "u") return null;
|
|
41
|
-
let { left:
|
|
41
|
+
let { left: c, top: d } = a(i, {
|
|
42
42
|
width: window.innerWidth,
|
|
43
43
|
height: window.innerHeight
|
|
44
|
-
}),
|
|
44
|
+
}), p = () => {
|
|
45
45
|
t.getState().actions.closeMenu(), i.returnFocusTo?.focus({ preventScroll: !0 });
|
|
46
46
|
};
|
|
47
|
-
return
|
|
47
|
+
return g(/* @__PURE__ */ m("div", {
|
|
48
48
|
ref: o,
|
|
49
49
|
role: "menu",
|
|
50
50
|
"aria-label": r("askAbout.menuLabel", "Ask AI"),
|
|
@@ -52,11 +52,11 @@ var g = ({ onOpenAssistant: e }) => {
|
|
|
52
52
|
"data-testid": "assistant-ask-about-menu",
|
|
53
53
|
onKeyDown: (e) => {
|
|
54
54
|
if (e.key === "Escape") {
|
|
55
|
-
e.preventDefault(), e.stopPropagation(),
|
|
55
|
+
e.preventDefault(), e.stopPropagation(), p();
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
if (e.key === "Tab") {
|
|
59
|
-
e.preventDefault(),
|
|
59
|
+
e.preventDefault(), p();
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
let t = Array.from(o.current?.querySelectorAll("[role=\"menuitem\"]") ?? []);
|
|
@@ -67,34 +67,34 @@ var g = ({ onOpenAssistant: e }) => {
|
|
|
67
67
|
onContextMenu: (e) => e.preventDefault(),
|
|
68
68
|
className: "fixed z-[1100] max-w-[calc(100vw-16px)] overflow-hidden rounded-card border border-border-subtle bg-bg-elevated p-1 shadow-[var(--shadow-elevation-4)]",
|
|
69
69
|
style: {
|
|
70
|
-
left:
|
|
71
|
-
top:
|
|
70
|
+
left: c,
|
|
71
|
+
top: d,
|
|
72
72
|
width: 256
|
|
73
73
|
},
|
|
74
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ h("button", {
|
|
75
75
|
type: "button",
|
|
76
76
|
role: "menuitem",
|
|
77
77
|
onClick: () => n(i.focus, i.anchor ?? null),
|
|
78
78
|
className: "flex w-full items-start gap-2 rounded-button px-3 py-2 text-start text-sm text-text-primary transition-colors hover:bg-bg-sunken focus:bg-bg-sunken focus:outline-none",
|
|
79
79
|
"data-testid": "assistant-ask-about-item",
|
|
80
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ m(f, {
|
|
81
81
|
className: "mt-0.5 size-4 shrink-0 text-action-primary-bg",
|
|
82
82
|
"aria-hidden": "true"
|
|
83
|
-
}), /* @__PURE__ */
|
|
83
|
+
}), /* @__PURE__ */ h("span", {
|
|
84
84
|
className: "min-w-0",
|
|
85
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ m("span", {
|
|
86
86
|
className: "block font-medium",
|
|
87
87
|
children: r("askAbout.menuItem", "Ask AI about this")
|
|
88
|
-
}), /* @__PURE__ */
|
|
88
|
+
}), /* @__PURE__ */ m("span", {
|
|
89
89
|
className: "block truncate text-xs text-text-muted",
|
|
90
90
|
children: i.focus.label
|
|
91
91
|
})]
|
|
92
92
|
})]
|
|
93
93
|
})
|
|
94
94
|
}), document.body);
|
|
95
|
-
},
|
|
96
|
-
let n = e(), [r, a] =
|
|
97
|
-
|
|
95
|
+
}, y = ({ onAsk: t }) => {
|
|
96
|
+
let n = e(), [r, a] = d(null);
|
|
97
|
+
l(() => {
|
|
98
98
|
let e = 0, t = () => {
|
|
99
99
|
e = 0, a(i(document));
|
|
100
100
|
}, n = () => {
|
|
@@ -105,18 +105,18 @@ var g = ({ onOpenAssistant: e }) => {
|
|
|
105
105
|
};
|
|
106
106
|
}, []);
|
|
107
107
|
let s = r !== null;
|
|
108
|
-
if (
|
|
108
|
+
if (l(() => {
|
|
109
109
|
if (!s) return;
|
|
110
110
|
let e = () => a(null);
|
|
111
111
|
return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
112
112
|
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
113
113
|
};
|
|
114
114
|
}, [s]), !r || typeof document > "u") return null;
|
|
115
|
-
let { left:
|
|
115
|
+
let { left: c, top: u } = o(r.rect, {
|
|
116
116
|
width: window.innerWidth,
|
|
117
117
|
height: window.innerHeight
|
|
118
118
|
});
|
|
119
|
-
return
|
|
119
|
+
return g(/* @__PURE__ */ h("button", {
|
|
120
120
|
type: "button",
|
|
121
121
|
"data-agent": "deny",
|
|
122
122
|
"data-testid": "assistant-ask-about-selection",
|
|
@@ -126,41 +126,65 @@ var g = ({ onOpenAssistant: e }) => {
|
|
|
126
126
|
},
|
|
127
127
|
className: "fixed z-[1100] inline-flex items-center gap-1.5 rounded-full border border-border-subtle bg-bg-elevated px-3 py-1.5 text-xs font-medium text-text-primary shadow-[var(--shadow-elevation-4)] transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
128
128
|
style: {
|
|
129
|
-
left:
|
|
130
|
-
top:
|
|
129
|
+
left: c,
|
|
130
|
+
top: u
|
|
131
131
|
},
|
|
132
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ m(f, {
|
|
133
133
|
className: "size-3.5 text-action-primary-bg",
|
|
134
134
|
"aria-hidden": "true"
|
|
135
135
|
}), n("askAbout.selectionButton", "Ask AI")]
|
|
136
136
|
}), document.body);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
}, b = /* @__PURE__ */ new Set([
|
|
138
|
+
"hidden",
|
|
139
|
+
"clip",
|
|
140
|
+
"auto",
|
|
141
|
+
"scroll",
|
|
142
|
+
"overlay"
|
|
143
|
+
]);
|
|
144
|
+
function x(e) {
|
|
145
|
+
let t = [], n = e.ownerDocument.defaultView;
|
|
146
|
+
for (let r = e.parentElement; r && n; r = r.parentElement) {
|
|
147
|
+
let e = n.getComputedStyle(r);
|
|
148
|
+
[
|
|
149
|
+
e.overflow,
|
|
150
|
+
e.overflowX,
|
|
151
|
+
e.overflowY
|
|
152
|
+
].some((e) => b.has(e)) && t.push(r);
|
|
153
|
+
}
|
|
154
|
+
return t;
|
|
155
|
+
}
|
|
156
|
+
var S = (e) => ({
|
|
157
|
+
left: e.left,
|
|
158
|
+
top: e.top,
|
|
159
|
+
width: e.width,
|
|
160
|
+
height: e.height
|
|
161
|
+
});
|
|
162
|
+
function C(e, t = {}) {
|
|
163
|
+
let n = t.clip === !0, [r, i] = d(null);
|
|
164
|
+
return l(() => {
|
|
141
165
|
if (!e) {
|
|
142
|
-
|
|
166
|
+
i(null);
|
|
143
167
|
return;
|
|
144
168
|
}
|
|
145
|
-
let t = 0, r = "",
|
|
169
|
+
let t = 0, r = "", a = n ? x(e) : [], o = () => {
|
|
146
170
|
if (!e.isConnected) {
|
|
147
|
-
|
|
171
|
+
i(null);
|
|
148
172
|
return;
|
|
149
173
|
}
|
|
150
|
-
let
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
174
|
+
let s = S(e.getBoundingClientRect()), l = n ? c(s, [...a.map((e) => S(e.getBoundingClientRect())), {
|
|
175
|
+
left: 0,
|
|
176
|
+
top: 0,
|
|
177
|
+
width: window.innerWidth,
|
|
178
|
+
height: window.innerHeight
|
|
179
|
+
}]) : s, u = l ? `${l.left},${l.top},${l.width},${l.height}` : "none";
|
|
180
|
+
u !== r && (r = u, i(l)), t = requestAnimationFrame(o);
|
|
157
181
|
};
|
|
158
|
-
return
|
|
159
|
-
}, [e]),
|
|
182
|
+
return o(), () => cancelAnimationFrame(t);
|
|
183
|
+
}, [e, n]), r;
|
|
160
184
|
}
|
|
161
|
-
var
|
|
162
|
-
let e = t((e) => e.pending ? e.pendingAnchor : null), n =
|
|
163
|
-
return
|
|
185
|
+
var w = 4, T = () => {
|
|
186
|
+
let e = t((e) => e.pending ? e.pendingAnchor : null), n = C(e, { clip: !0 });
|
|
187
|
+
return l(() => {
|
|
164
188
|
if (!e) return;
|
|
165
189
|
let t = setTimeout(() => {
|
|
166
190
|
if (!e.isConnected) return;
|
|
@@ -171,21 +195,21 @@ var b = 4, x = () => {
|
|
|
171
195
|
});
|
|
172
196
|
}, 250);
|
|
173
197
|
return () => clearTimeout(t);
|
|
174
|
-
}, [e]), !n || typeof document > "u" ? null :
|
|
198
|
+
}, [e]), !n || typeof document > "u" ? null : g(/* @__PURE__ */ m("div", {
|
|
175
199
|
"aria-hidden": "true",
|
|
176
200
|
"data-agent": "deny",
|
|
177
201
|
"data-testid": "assistant-ask-about-highlight",
|
|
178
202
|
className: "pointer-events-none fixed z-[45] rounded-card border-2 border-action-primary-bg shadow-[0_0_0_4px_var(--color-focus-ring)] transition-[left,top,width,height] duration-75",
|
|
179
203
|
style: {
|
|
180
|
-
left: n.left -
|
|
181
|
-
top: n.top -
|
|
204
|
+
left: n.left - w,
|
|
205
|
+
top: n.top - w,
|
|
182
206
|
width: n.width + 8,
|
|
183
207
|
height: n.height + 8
|
|
184
208
|
}
|
|
185
209
|
}), document.body);
|
|
186
|
-
},
|
|
187
|
-
let i = e(), a = t((e) => e.hint)?.anchor ?? null, s =
|
|
188
|
-
if (
|
|
210
|
+
}, E = () => {
|
|
211
|
+
let i = e(), a = t((e) => e.hint)?.anchor ?? null, s = C(a);
|
|
212
|
+
if (l(() => {
|
|
189
213
|
if (!a) return;
|
|
190
214
|
r();
|
|
191
215
|
let { hideHint: e } = t.getState().actions, i = setTimeout(e, n);
|
|
@@ -196,7 +220,7 @@ var b = 4, x = () => {
|
|
|
196
220
|
clearTimeout(i), window.removeEventListener("pointerdown", e, !0), window.removeEventListener("keydown", e, !0), window.removeEventListener("scroll", e, !0), window.removeEventListener("wheel", e, !0), a.removeEventListener("pointerleave", e);
|
|
197
221
|
};
|
|
198
222
|
}, [a]), !s || typeof document > "u") return null;
|
|
199
|
-
let { left:
|
|
223
|
+
let { left: c, top: u } = o({
|
|
200
224
|
left: s.left,
|
|
201
225
|
top: s.top,
|
|
202
226
|
bottom: s.top + s.height
|
|
@@ -204,19 +228,19 @@ var b = 4, x = () => {
|
|
|
204
228
|
width: window.innerWidth,
|
|
205
229
|
height: window.innerHeight
|
|
206
230
|
});
|
|
207
|
-
return
|
|
231
|
+
return g(/* @__PURE__ */ h("div", {
|
|
208
232
|
role: "status",
|
|
209
233
|
"data-agent": "deny",
|
|
210
234
|
"data-testid": "assistant-ask-about-hint",
|
|
211
235
|
className: "pointer-events-none fixed z-[1100] inline-flex max-w-[calc(100vw-16px)] items-center gap-1.5 rounded-full border border-border-subtle bg-bg-elevated px-3 py-1.5 text-xs text-text-primary shadow-[var(--shadow-elevation-4)]",
|
|
212
236
|
style: {
|
|
213
|
-
left:
|
|
237
|
+
left: c,
|
|
214
238
|
top: u
|
|
215
239
|
},
|
|
216
|
-
children: [/* @__PURE__ */
|
|
240
|
+
children: [/* @__PURE__ */ m(f, {
|
|
217
241
|
className: "size-3.5 shrink-0 text-action-primary-bg",
|
|
218
242
|
"aria-hidden": "true"
|
|
219
243
|
}), i("askAbout.hint", "Right-click to ask AI about this")]
|
|
220
244
|
}), document.body);
|
|
221
245
|
};
|
|
222
|
-
export {
|
|
246
|
+
export { _ as AskAboutLayer };
|
|
@@ -29,3 +29,17 @@ export declare function placeAskSelectionButton(rect: AskableSelectionOffer['rec
|
|
|
29
29
|
* outside the menu closes it.
|
|
30
30
|
*/
|
|
31
31
|
export declare function scrollClosesMenu(target: unknown, anchor: unknown, menu: unknown): boolean;
|
|
32
|
+
/** A box in viewport coordinates. */
|
|
33
|
+
export interface ScreenBox {
|
|
34
|
+
readonly left: number;
|
|
35
|
+
readonly top: number;
|
|
36
|
+
readonly width: number;
|
|
37
|
+
readonly height: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* ★ BOFF-13381: the part of `box` inside every one of `clips` (the areas that
|
|
41
|
+
* cut off what they hold, and the viewport), or null when none of it shows.
|
|
42
|
+
* The ring around a picked thing is drawn over this part only, so a step half
|
|
43
|
+
* under a side panel is not outlined across the panel.
|
|
44
|
+
*/
|
|
45
|
+
export declare function visiblePart(box: ScreenBox, clips: readonly ScreenBox[]): ScreenBox | null;
|
|
@@ -17,4 +17,14 @@ var r = (e) => typeof e == "object" && !!e && typeof e.nodeType == "number" && t
|
|
|
17
17
|
function i(e, t, n) {
|
|
18
18
|
return r(e) && r(n) && n.contains(e) ? !1 : !r(t) || !r(e) || e.nodeType === 9 || e.contains(t);
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
function a(e, t) {
|
|
21
|
+
let n = e.left, r = e.top, i = e.left + e.width, a = e.top + e.height;
|
|
22
|
+
for (let e of t) n = Math.max(n, e.left), r = Math.max(r, e.top), i = Math.min(i, e.left + e.width), a = Math.min(a, e.top + e.height);
|
|
23
|
+
return i - n < 1 || a - r < 1 ? null : {
|
|
24
|
+
left: n,
|
|
25
|
+
top: r,
|
|
26
|
+
width: i - n,
|
|
27
|
+
height: a - r
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export { e as ASK_ABOUT_MENU_WIDTH, t as placeAskAboutMenu, n as placeAskSelectionButton, i as scrollClosesMenu, a as visiblePart };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useI18n as e } from "../providers/shell/I18nProvider.js";
|
|
2
|
+
import { useGatewayClient as t } from "../graphql/GatewayContext.js";
|
|
2
3
|
import "../../ui.js";
|
|
3
|
-
import { useI18n as t } from "../providers/shell/I18nProvider.js";
|
|
4
4
|
import { useAuth as n } from "../providers/shell/AuthProvider.js";
|
|
5
5
|
import { useActiveContext as r } from "../providers/shell/ActiveContextProvider.js";
|
|
6
6
|
import { Card as ee, CardContent as te } from "../../ui/card.js";
|
|
@@ -22,11 +22,11 @@ import { getSourceContext as c, getString as fe, normalizeThreadSegment as l, so
|
|
|
22
22
|
import { WidgetHeader as me } from "./contextConversationWidget/WidgetHeader.js";
|
|
23
23
|
import { useEffect as u, useMemo as d, useRef as he, useState as f } from "react";
|
|
24
24
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
25
|
-
import { useQuery as h } from "@apollo/client/react";
|
|
26
25
|
import { useNavigate as ge } from "react-router";
|
|
26
|
+
import { useQuery as h } from "@apollo/client/react";
|
|
27
27
|
// src/shared/components/ContextConversationWidget.tsx
|
|
28
28
|
function g({ className: g, widgetKey: _ }) {
|
|
29
|
-
let { t: v } =
|
|
29
|
+
let { t: v } = e(), { workspaceId: y } = r(), b = n(), x = ne(), S = t("workspace"), C = ge(), [w, T] = f(null), [E, D] = f(null), [O, k] = f(""), [A, _e] = f(() => typeof window < "u" && window.innerWidth < 768), [j, M] = f(null), [N, P] = f(null), [F, I] = f(""), [L, R] = f(null), [z, B] = f([]), V = he(null), H = d(() => (e, t) => {
|
|
30
30
|
let n = v(e);
|
|
31
31
|
return n === e ? t : n;
|
|
32
32
|
}, [v]), U = b.user?.id ?? null, W = _ ?? x.widgetKey ?? "default", G = d(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GATEWAYS as e } from "../../shared-config.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { getActiveWorkspaceToken as t, resolveActiveProfileId as n, setProfileWorkspaceToken as r } from "../providers/shell/ProfileStorageManager.js";
|
|
3
|
+
import { resolveGatewayUrls as i } from "../config/gatewayUrls.js";
|
|
4
4
|
import { readActiveContextValueWithUrlPrecedence as a } from "../providers/shell/ActiveContextStorage.js";
|
|
5
5
|
import { getValidAccessTokenFromStorage as o, sanitizeExtraHeaders as s, sanitizeGeography as c, validateGatewayBaseUrl as l } from "./security.js";
|
|
6
6
|
import { isWorkspaceTokenValidForContext as u } from "./workspaceToken.js";
|
|
@@ -28,7 +28,7 @@ function b() {
|
|
|
28
28
|
}
|
|
29
29
|
function x() {
|
|
30
30
|
try {
|
|
31
|
-
return
|
|
31
|
+
return t();
|
|
32
32
|
} catch {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
@@ -116,16 +116,16 @@ function ne(e) {
|
|
|
116
116
|
projectId: typeof e.projectId == "string" ? e.projectId : k() || void 0
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
function j(e, t,
|
|
119
|
+
function j(e, t, i) {
|
|
120
120
|
try {
|
|
121
|
-
let a =
|
|
121
|
+
let a = n() ?? S();
|
|
122
122
|
if (!a) return;
|
|
123
|
-
|
|
123
|
+
r(a, t), sessionStorage.setItem("burdenoff-active-context-workspace", e), i && sessionStorage.setItem("burdenoff-active-context-organization", i);
|
|
124
124
|
} catch {}
|
|
125
125
|
}
|
|
126
126
|
function M() {
|
|
127
127
|
try {
|
|
128
|
-
return
|
|
128
|
+
return n() ?? S();
|
|
129
129
|
} catch {
|
|
130
130
|
return null;
|
|
131
131
|
}
|
|
@@ -189,9 +189,9 @@ async function P(e) {
|
|
|
189
189
|
});
|
|
190
190
|
return y.set(_, S), N(S, s, null);
|
|
191
191
|
}
|
|
192
|
-
function F(
|
|
193
|
-
let
|
|
194
|
-
return `${s.endsWith("/") ? s.slice(0, -1) : s}${
|
|
192
|
+
function F(t, n) {
|
|
193
|
+
let r = e[t], a = i(), o = t === "global" ? a.globalBaseUrl : a.workspaceBaseUrl, s = n || o;
|
|
194
|
+
return `${s.endsWith("/") ? s.slice(0, -1) : s}${r.graphql}`;
|
|
195
195
|
}
|
|
196
196
|
function I(e) {
|
|
197
197
|
return e.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
@@ -397,9 +397,9 @@ function _e(e, t, n) {
|
|
|
397
397
|
i && (r.delete(n), i.timer &&= (clearTimeout(i.timer), null), he(e, t, i.requests));
|
|
398
398
|
}
|
|
399
399
|
async function $(e) {
|
|
400
|
-
let { gateway:
|
|
400
|
+
let { gateway: t, query: n, variables: r, operationName: a, authToken: o, workspaceToken: c, workspaceId: d, organizationId: f, tenantId: h, projectId: g, locale: v, baseUrl: y, extraHeaders: S, signal: C, suppressGlobalErrorEvent: E, keepalive: D, batch: k } = e;
|
|
401
401
|
L(C);
|
|
402
|
-
let A = l(F(
|
|
402
|
+
let A = l(F(t, y));
|
|
403
403
|
if (e.authTokenMode !== void 0 && !["refreshable", "pinned"].includes(e.authTokenMode)) throw Error("Invalid request authentication mode.");
|
|
404
404
|
let j = e.authTokenMode === "pinned";
|
|
405
405
|
if (j && Object.keys(S ?? {}).some((e) => [
|
|
@@ -415,11 +415,11 @@ async function $(e) {
|
|
|
415
415
|
if (!M && !j && !e.skipAuthRetry && typeof window < "u" && !window.location.pathname.startsWith("/auth/") && ee()) {
|
|
416
416
|
let e = await import("../utils/authErrorHandling.js");
|
|
417
417
|
await e.attemptTokenRefresh({
|
|
418
|
-
globalBaseUrl:
|
|
418
|
+
globalBaseUrl: t === "global" && y ? y : i().globalBaseUrl,
|
|
419
419
|
...e.getSharedTokenRefreshRefs()
|
|
420
420
|
}) ? M = b() : _({
|
|
421
421
|
operationName: a,
|
|
422
|
-
gateway:
|
|
422
|
+
gateway: t
|
|
423
423
|
}), L(C);
|
|
424
424
|
}
|
|
425
425
|
let N = v ?? T(), I = ne({
|
|
@@ -433,9 +433,9 @@ async function $(e) {
|
|
|
433
433
|
};
|
|
434
434
|
M && (R.Authorization = `Bearer ${M}`), N && (R["Accept-Language"] = N);
|
|
435
435
|
let z = te();
|
|
436
|
-
if (z?.country && (R["X-Geo-Country"] = z.country), z?.currency && (R["X-Geo-Currency"] = z.currency), z?.timezone && (R["X-Geo-Timezone"] = z.timezone),
|
|
436
|
+
if (z?.country && (R["X-Geo-Country"] = z.country), z?.currency && (R["X-Geo-Currency"] = z.currency), z?.timezone && (R["X-Geo-Timezone"] = z.timezone), t === "workspace" ? c !== !1 : c) {
|
|
437
437
|
let e = typeof c == "string" ? c : x();
|
|
438
|
-
e && !u(e, I) && (e = null), !e && (c === !0 ||
|
|
438
|
+
e && !u(e, I) && (e = null), !e && (c === !0 || t === "workspace" && c === void 0 || typeof c == "string") && (e = await P({
|
|
439
439
|
url: A,
|
|
440
440
|
authToken: M,
|
|
441
441
|
workspaceId: I.workspaceId,
|
|
@@ -443,14 +443,14 @@ async function $(e) {
|
|
|
443
443
|
projectId: I.projectId,
|
|
444
444
|
locale: N,
|
|
445
445
|
signal: C,
|
|
446
|
-
currentQuery:
|
|
446
|
+
currentQuery: n
|
|
447
447
|
}), L(C)), e && (R["X-Workspace-Authorization"] = `Bearer ${e}`);
|
|
448
448
|
}
|
|
449
|
-
if (
|
|
449
|
+
if (t === "workspace" || d) {
|
|
450
450
|
let e = I.workspaceId;
|
|
451
451
|
e && (R["x-workspace-id"] = e);
|
|
452
452
|
}
|
|
453
|
-
if (
|
|
453
|
+
if (t === "global" || f) {
|
|
454
454
|
let e = I.organizationId;
|
|
455
455
|
e && (R["x-org-id"] = e);
|
|
456
456
|
}
|
|
@@ -458,20 +458,20 @@ async function $(e) {
|
|
|
458
458
|
let e = typeof h == "string" ? h : O();
|
|
459
459
|
e && (R["x-tenant-id"] = e);
|
|
460
460
|
}
|
|
461
|
-
if (
|
|
461
|
+
if (t === "workspace" || g) {
|
|
462
462
|
let e = I.projectId;
|
|
463
463
|
e && (R["x-project-id"] = e);
|
|
464
464
|
}
|
|
465
465
|
let B = s(S);
|
|
466
466
|
B && Object.assign(R, B);
|
|
467
|
-
let V = { query:
|
|
468
|
-
|
|
469
|
-
let H = async (
|
|
470
|
-
if (j || e.skipAuthRetry || !M || typeof window > "u" || !
|
|
471
|
-
let
|
|
472
|
-
return
|
|
473
|
-
globalBaseUrl:
|
|
474
|
-
...
|
|
467
|
+
let V = { query: n };
|
|
468
|
+
r && (V.variables = r), a && (V.operationName = a);
|
|
469
|
+
let H = async (n) => {
|
|
470
|
+
if (j || e.skipAuthRetry || !M || typeof window > "u" || !n?.length) return null;
|
|
471
|
+
let r = await import("../utils/authErrorHandling.js");
|
|
472
|
+
return r.hasAuthGraphQLErrors(n) ? await r.attemptTokenRefresh({
|
|
473
|
+
globalBaseUrl: t === "global" && y ? y : i().globalBaseUrl,
|
|
474
|
+
...r.getSharedTokenRefreshRefs()
|
|
475
475
|
}) ? $({
|
|
476
476
|
...e,
|
|
477
477
|
authToken: void 0,
|
|
@@ -479,7 +479,7 @@ async function $(e) {
|
|
|
479
479
|
skipAuthRetry: !0
|
|
480
480
|
}) : (_({
|
|
481
481
|
operationName: a,
|
|
482
|
-
gateway:
|
|
482
|
+
gateway: t
|
|
483
483
|
}), null) : null;
|
|
484
484
|
};
|
|
485
485
|
try {
|