@burdenoff/fe-libs 2026.1115.5 → 2026.1115.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/shared/assistant/askAbout/AskAboutLayer.d.ts +5 -0
- package/dist/shared/assistant/askAbout/AskAboutLayer.js +187 -105
- package/dist/shared/assistant/askAbout/askAboutStore.d.ts +7 -0
- package/dist/shared/assistant/askAbout/askAnywhere.d.ts +16 -0
- package/dist/shared/assistant/askAbout/askAnywhere.js +76 -0
- package/dist/shared/assistant/askAbout/askableSelection.d.ts +20 -8
- package/dist/shared/assistant/askAbout/askableSelection.js +43 -38
- package/dist/shared/assistant/askAbout/describeAnything.d.ts +47 -0
- package/dist/shared/assistant/askAbout/describeAnything.js +294 -0
- package/dist/shared/assistant/askAbout/placement.d.ts +3 -1
- package/dist/shared/assistant/askAbout/placement.js +10 -9
- package/dist/shared/assistant/askAbout/useAskable.js +71 -67
- package/dist/shared/assistant/i18nManifest.d.ts +16 -0
- package/dist/shared/assistant/i18nManifest.js +16 -0
- package/dist/shared/assistant/index.d.ts +2 -0
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts +8 -0
- package/dist/shared/assistant/ui/AssistantOverlay.js +240 -237
- package/dist/shared-assistant.js +325 -323
- package/package.json +1 -1
|
@@ -1,102 +1,106 @@
|
|
|
1
1
|
import { isDenied as e } from "../../agent-tools/ui/dom.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { menuExtrasAt as t } from "./askAnywhere.js";
|
|
3
|
+
import { useAskAboutStore as n } from "./askAboutStore.js";
|
|
4
|
+
import { askAboutHintSeen as r, markAskAboutHintSeen as i } from "./hint.js";
|
|
5
|
+
import { normaliseFocus as a } from "./focus.js";
|
|
6
|
+
import { useEffect as o, useRef as s, useState as c } from "react";
|
|
6
7
|
// src/shared/assistant/askAbout/useAskable.ts
|
|
7
|
-
var
|
|
8
|
-
function
|
|
8
|
+
var l = 500, u = 10, d = 800, f = "input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])";
|
|
9
|
+
function p(e) {
|
|
9
10
|
let t = e();
|
|
10
|
-
return t ?
|
|
11
|
+
return t ? a(t, {
|
|
11
12
|
route: window.location.pathname,
|
|
12
13
|
pickedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
13
14
|
}) : null;
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
if (
|
|
17
|
-
let i =
|
|
18
|
-
return !i.closest(
|
|
16
|
+
function m(t, r) {
|
|
17
|
+
if (n.getState().hosts === 0) return !1;
|
|
18
|
+
let i = t instanceof Element ? t : r;
|
|
19
|
+
return !i.closest(f) && !e(i) && !e(r);
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function h(e) {
|
|
21
22
|
let t = e.ownerDocument.activeElement;
|
|
22
23
|
return t instanceof HTMLElement && t !== e.ownerDocument.body ? t : null;
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
function g(e, a) {
|
|
26
|
+
let o = null, s = null, c = 0, l = e.ownerDocument.defaultView ?? window, u = (r, a, o, s, c = null) => {
|
|
27
|
+
i(), g();
|
|
28
|
+
let l = c instanceof Element ? t(c) : {};
|
|
29
|
+
n.getState().actions.openMenu({
|
|
30
|
+
focus: r,
|
|
31
|
+
x: a,
|
|
32
|
+
y: o,
|
|
33
|
+
returnFocusTo: s,
|
|
34
|
+
anchor: e,
|
|
35
|
+
...l
|
|
32
36
|
});
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
let
|
|
39
|
-
|
|
37
|
+
}, f = null, g = () => {
|
|
38
|
+
f !== null && clearTimeout(f), f = null;
|
|
39
|
+
}, _ = (t) => {
|
|
40
|
+
t.pointerType !== "mouse" || r() || m(t.target, e) && (g(), f = setTimeout(() => {
|
|
41
|
+
f = null;
|
|
42
|
+
let t = n.getState();
|
|
43
|
+
r() || t.menu !== null || t.hint !== null || t.actions.showHint({ anchor: e });
|
|
40
44
|
}, 900));
|
|
41
|
-
}, _ = () => {
|
|
42
|
-
a !== null && clearTimeout(a), a = null, o = null, c.removeEventListener("scroll", _, !0);
|
|
43
45
|
}, v = () => {
|
|
44
|
-
|
|
46
|
+
o !== null && clearTimeout(o), o = null, s = null, l.removeEventListener("scroll", v, !0);
|
|
47
|
+
}, y = () => {
|
|
48
|
+
let t = Date.now() + d, n = (r) => {
|
|
45
49
|
e.removeEventListener("click", n, !0), Date.now() > t || (r.preventDefault(), r.stopPropagation());
|
|
46
50
|
};
|
|
47
|
-
e.addEventListener("click", n, !0), setTimeout(() => e.removeEventListener("click", n, !0),
|
|
48
|
-
},
|
|
49
|
-
if (Date.now() -
|
|
51
|
+
e.addEventListener("click", n, !0), setTimeout(() => e.removeEventListener("click", n, !0), d);
|
|
52
|
+
}, b = (t) => {
|
|
53
|
+
if (Date.now() - c < d) {
|
|
50
54
|
t.preventDefault();
|
|
51
55
|
return;
|
|
52
56
|
}
|
|
53
|
-
if (
|
|
54
|
-
let n =
|
|
55
|
-
n && (t.preventDefault(),
|
|
56
|
-
},
|
|
57
|
-
|
|
57
|
+
if (v(), t.shiftKey || t.defaultPrevented || !m(t.target, e)) return;
|
|
58
|
+
let n = p(a);
|
|
59
|
+
n && (t.preventDefault(), u(n, t.clientX, t.clientY, h(e), t.target));
|
|
60
|
+
}, x = (t) => {
|
|
61
|
+
g(), t.pointerType === "mouse" || !t.isPrimary || t.button > 0 || (v(), m(t.target, e) && (s = {
|
|
58
62
|
x: t.clientX,
|
|
59
63
|
y: t.clientY,
|
|
60
64
|
pointerId: t.pointerId
|
|
61
|
-
},
|
|
62
|
-
let t =
|
|
63
|
-
if (
|
|
64
|
-
let n =
|
|
65
|
-
n && (
|
|
65
|
+
}, l.addEventListener("scroll", v, !0), o = setTimeout(() => {
|
|
66
|
+
let t = s;
|
|
67
|
+
if (v(), !t) return;
|
|
68
|
+
let n = p(a);
|
|
69
|
+
n && (c = Date.now(), y(), u(n, t.x, t.y, h(e)));
|
|
66
70
|
}, 500)));
|
|
67
|
-
}, x = (e) => {
|
|
68
|
-
o && e.pointerId === o.pointerId && Math.hypot(e.clientX - o.x, e.clientY - o.y) > 10 && _();
|
|
69
71
|
}, S = (e) => {
|
|
70
|
-
|
|
71
|
-
}, C = (
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
s && e.pointerId === s.pointerId && Math.hypot(e.clientX - s.x, e.clientY - s.y) > 10 && v();
|
|
73
|
+
}, C = (e) => {
|
|
74
|
+
s && e.pointerId === s.pointerId && v();
|
|
75
|
+
}, w = (t) => {
|
|
76
|
+
if (!(t.key === "ContextMenu" || t.shiftKey && t.key === "F10") || t.defaultPrevented || !m(t.target, e)) return;
|
|
77
|
+
let n = p(a);
|
|
74
78
|
if (!n) return;
|
|
75
79
|
t.preventDefault();
|
|
76
|
-
let r = t.target instanceof HTMLElement ? t.target : e,
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
return e.style.setProperty("-webkit-touch-callout", "none"), e.addEventListener("contextmenu",
|
|
80
|
-
|
|
80
|
+
let r = t.target instanceof HTMLElement ? t.target : e, i = r.getBoundingClientRect();
|
|
81
|
+
u(n, i.left + Math.min(16, i.width / 2), i.bottom, r);
|
|
82
|
+
}, T = e.style.getPropertyValue("-webkit-touch-callout");
|
|
83
|
+
return e.style.setProperty("-webkit-touch-callout", "none"), e.addEventListener("contextmenu", b), e.addEventListener("pointerdown", x), e.addEventListener("pointermove", S), e.addEventListener("pointerup", C), e.addEventListener("pointercancel", C), e.addEventListener("keydown", w), e.addEventListener("pointerenter", _), e.addEventListener("pointerleave", g), () => {
|
|
84
|
+
v(), g(), e.removeEventListener("pointerenter", _), e.removeEventListener("pointerleave", g), e.removeEventListener("contextmenu", b), e.removeEventListener("pointerdown", x), e.removeEventListener("pointermove", S), e.removeEventListener("pointerup", C), e.removeEventListener("pointercancel", C), e.removeEventListener("keydown", w), T ? e.style.setProperty("-webkit-touch-callout", T) : e.style.removeProperty("-webkit-touch-callout");
|
|
81
85
|
};
|
|
82
86
|
}
|
|
83
|
-
function
|
|
84
|
-
let { hosts: o, actions: s } =
|
|
85
|
-
if (o === 0 ||
|
|
86
|
-
let c =
|
|
87
|
+
function _(t, r = null) {
|
|
88
|
+
let { hosts: o, actions: s } = n.getState();
|
|
89
|
+
if (o === 0 || r !== null && e(r)) return !1;
|
|
90
|
+
let c = a(t, {
|
|
87
91
|
route: window.location.pathname,
|
|
88
92
|
pickedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
89
93
|
});
|
|
90
|
-
return c ? (
|
|
94
|
+
return c ? (i(), s.pickAndOpen(c, r), !0) : !1;
|
|
91
95
|
}
|
|
92
|
-
function
|
|
93
|
-
let [n, r] =
|
|
94
|
-
|
|
96
|
+
function v(e, t = {}) {
|
|
97
|
+
let [n, r] = c(null), i = s(e);
|
|
98
|
+
o(() => {
|
|
95
99
|
i.current = e;
|
|
96
100
|
}, [e]);
|
|
97
|
-
let
|
|
98
|
-
return
|
|
99
|
-
if (n && !
|
|
100
|
-
}, [n,
|
|
101
|
+
let a = t.disabled === !0;
|
|
102
|
+
return o(() => {
|
|
103
|
+
if (n && !a) return g(n, () => i.current());
|
|
104
|
+
}, [n, a]), r;
|
|
101
105
|
}
|
|
102
|
-
export {
|
|
106
|
+
export { l as LONG_PRESS_MS, u as LONG_PRESS_SLOP_PX, _ as askAssistantAbout, g as attachAskable, p as pickFocus, v as useAskable };
|
|
@@ -193,9 +193,25 @@ export declare const ASSISTANT_I18N_LITERAL_COPY: {
|
|
|
193
193
|
readonly 'appControl.workspaceSwitched': "Switching to {{name}}.";
|
|
194
194
|
readonly 'askAbout.chipLabel': "About: {{name}}";
|
|
195
195
|
readonly 'askAbout.chipRemove': "Stop asking about {{name}}";
|
|
196
|
+
readonly 'askAbout.copy': "Copy";
|
|
197
|
+
readonly 'askAbout.copyLink': "Copy link address";
|
|
196
198
|
readonly 'askAbout.hint': "Right-click to ask AI about this";
|
|
199
|
+
readonly 'askAbout.kind.button': "button";
|
|
200
|
+
readonly 'askAbout.kind.card': "card";
|
|
201
|
+
readonly 'askAbout.kind.dialog': "dialog";
|
|
202
|
+
readonly 'askAbout.kind.formField': "form field";
|
|
203
|
+
readonly 'askAbout.kind.heading': "heading";
|
|
204
|
+
readonly 'askAbout.kind.image': "image";
|
|
205
|
+
readonly 'askAbout.kind.link': "link";
|
|
206
|
+
readonly 'askAbout.kind.listItem': "list item";
|
|
207
|
+
readonly 'askAbout.kind.menuItem': "menu item";
|
|
208
|
+
readonly 'askAbout.kind.page': "page";
|
|
209
|
+
readonly 'askAbout.kind.section': "section";
|
|
210
|
+
readonly 'askAbout.kind.tab': "tab";
|
|
211
|
+
readonly 'askAbout.kind.tableRow': "table row";
|
|
197
212
|
readonly 'askAbout.menuItem': "Ask AI about this";
|
|
198
213
|
readonly 'askAbout.menuLabel': "Ask AI";
|
|
214
|
+
readonly 'askAbout.openLinkNewTab': "Open link in new tab";
|
|
199
215
|
readonly 'askAbout.placeholder': "Ask about {{name}}…";
|
|
200
216
|
readonly 'askAbout.selectionButton': "Ask AI";
|
|
201
217
|
readonly 'askAbout.suggestionsLabel': "Suggested questions";
|
|
@@ -86,9 +86,25 @@ var g = {
|
|
|
86
86
|
"appControl.workspaceSwitched": "Switching to {{name}}.",
|
|
87
87
|
"askAbout.chipLabel": "About: {{name}}",
|
|
88
88
|
"askAbout.chipRemove": "Stop asking about {{name}}",
|
|
89
|
+
"askAbout.copy": "Copy",
|
|
90
|
+
"askAbout.copyLink": "Copy link address",
|
|
89
91
|
"askAbout.hint": "Right-click to ask AI about this",
|
|
92
|
+
"askAbout.kind.button": "button",
|
|
93
|
+
"askAbout.kind.card": "card",
|
|
94
|
+
"askAbout.kind.dialog": "dialog",
|
|
95
|
+
"askAbout.kind.formField": "form field",
|
|
96
|
+
"askAbout.kind.heading": "heading",
|
|
97
|
+
"askAbout.kind.image": "image",
|
|
98
|
+
"askAbout.kind.link": "link",
|
|
99
|
+
"askAbout.kind.listItem": "list item",
|
|
100
|
+
"askAbout.kind.menuItem": "menu item",
|
|
101
|
+
"askAbout.kind.page": "page",
|
|
102
|
+
"askAbout.kind.section": "section",
|
|
103
|
+
"askAbout.kind.tab": "tab",
|
|
104
|
+
"askAbout.kind.tableRow": "table row",
|
|
90
105
|
"askAbout.menuItem": "Ask AI about this",
|
|
91
106
|
"askAbout.menuLabel": "Ask AI",
|
|
107
|
+
"askAbout.openLinkNewTab": "Open link in new tab",
|
|
92
108
|
"askAbout.placeholder": "Ask about {{name}}…",
|
|
93
109
|
"askAbout.selectionButton": "Ask AI",
|
|
94
110
|
"askAbout.suggestionsLabel": "Suggested questions",
|
|
@@ -115,6 +115,8 @@ export * from './askAbout/askableSelection';
|
|
|
115
115
|
export * from './askAbout/AskAboutLayer';
|
|
116
116
|
export * from './askAbout/placement';
|
|
117
117
|
export * from './askAbout/hint';
|
|
118
|
+
export * from './askAbout/describeAnything';
|
|
119
|
+
export * from './askAbout/askAnywhere';
|
|
118
120
|
export * from './attachmentCommit';
|
|
119
121
|
export * from './voiceCommit';
|
|
120
122
|
export * from './useAttachmentCommitter';
|
|
@@ -302,6 +302,14 @@ export interface AssistantOverlayProps {
|
|
|
302
302
|
* using the page (`signInWarm.ts`). On by default; `false` opts a shell out.
|
|
303
303
|
*/
|
|
304
304
|
warmOnSignIn?: boolean;
|
|
305
|
+
/**
|
|
306
|
+
* ★ BOFF-14630: "Ask AI about this" on anything, not only what the product
|
|
307
|
+
* marked askable. A right-click anywhere outside text fields and editors
|
|
308
|
+
* opens the assistant's menu in place of the browser's (Shift+right-click
|
|
309
|
+
* still gives the browser's), and any selected text gets the "Ask AI"
|
|
310
|
+
* button. Off by default: a product turns it on once it has checked it.
|
|
311
|
+
*/
|
|
312
|
+
askAnywhere?: boolean;
|
|
305
313
|
}
|
|
306
314
|
/**
|
|
307
315
|
* The launcher and the window. Renders nothing without an
|