@burdenoff/fe-libs 2026.1115.5 → 2026.1115.7

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.
@@ -1,102 +1,106 @@
1
1
  import { isDenied as e } from "../../agent-tools/ui/dom.js";
2
- import { useAskAboutStore as t } from "./askAboutStore.js";
3
- import { askAboutHintSeen as n, markAskAboutHintSeen as r } from "./hint.js";
4
- import { normaliseFocus as i } from "./focus.js";
5
- import { useEffect as a, useRef as o, useState as s } from "react";
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 c = 500, l = 10, u = 800, d = "input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])";
8
- function f(e) {
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 ? i(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 p(n, r) {
16
- if (t.getState().hosts === 0) return !1;
17
- let i = n instanceof Element ? n : r;
18
- return !i.closest(d) && !e(i) && !e(r);
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 m(e) {
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 h(e, i) {
25
- let a = null, o = null, s = 0, c = e.ownerDocument.defaultView ?? window, l = (n, i, a, o) => {
26
- r(), h(), t.getState().actions.openMenu({
27
- focus: n,
28
- x: i,
29
- y: a,
30
- returnFocusTo: o,
31
- anchor: e
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
- }, d = null, h = () => {
34
- d !== null && clearTimeout(d), d = null;
35
- }, g = (r) => {
36
- r.pointerType !== "mouse" || n() || p(r.target, e) && (h(), d = setTimeout(() => {
37
- d = null;
38
- let r = t.getState();
39
- n() || r.menu !== null || r.hint !== null || r.actions.showHint({ anchor: e });
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
- let t = Date.now() + u, n = (r) => {
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), u);
48
- }, y = (t) => {
49
- if (Date.now() - s < u) {
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 (_(), t.shiftKey || t.defaultPrevented || !p(t.target, e)) return;
54
- let n = f(i);
55
- n && (t.preventDefault(), l(n, t.clientX, t.clientY, m(e)));
56
- }, b = (t) => {
57
- h(), t.pointerType === "mouse" || !t.isPrimary || t.button > 0 || (_(), p(t.target, e) && (o = {
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
- }, c.addEventListener("scroll", _, !0), a = setTimeout(() => {
62
- let t = o;
63
- if (_(), !t) return;
64
- let n = f(i);
65
- n && (s = Date.now(), v(), l(n, t.x, t.y, m(e)));
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
- o && e.pointerId === o.pointerId && _();
71
- }, C = (t) => {
72
- if (!(t.key === "ContextMenu" || t.shiftKey && t.key === "F10") || t.defaultPrevented || !p(t.target, e)) return;
73
- let n = f(i);
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, a = r.getBoundingClientRect();
77
- l(n, a.left + Math.min(16, a.width / 2), a.bottom, r);
78
- }, w = e.style.getPropertyValue("-webkit-touch-callout");
79
- return e.style.setProperty("-webkit-touch-callout", "none"), e.addEventListener("contextmenu", y), e.addEventListener("pointerdown", b), e.addEventListener("pointermove", x), e.addEventListener("pointerup", S), e.addEventListener("pointercancel", S), e.addEventListener("keydown", C), e.addEventListener("pointerenter", g), e.addEventListener("pointerleave", h), () => {
80
- _(), h(), e.removeEventListener("pointerenter", g), e.removeEventListener("pointerleave", h), e.removeEventListener("contextmenu", y), e.removeEventListener("pointerdown", b), e.removeEventListener("pointermove", x), e.removeEventListener("pointerup", S), e.removeEventListener("pointercancel", S), e.removeEventListener("keydown", C), w ? e.style.setProperty("-webkit-touch-callout", w) : e.style.removeProperty("-webkit-touch-callout");
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 g(n, a = null) {
84
- let { hosts: o, actions: s } = t.getState();
85
- if (o === 0 || a !== null && e(a)) return !1;
86
- let c = i(n, {
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 ? (r(), s.pickAndOpen(c, a), !0) : !1;
94
+ return c ? (i(), s.pickAndOpen(c, r), !0) : !1;
91
95
  }
92
- function _(e, t = {}) {
93
- let [n, r] = s(null), i = o(e);
94
- a(() => {
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 c = t.disabled === !0;
98
- return a(() => {
99
- if (n && !c) return h(n, () => i.current());
100
- }, [n, c]), r;
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 { c as LONG_PRESS_MS, l as LONG_PRESS_SLOP_PX, g as askAssistantAbout, h as attachAskable, f as pickFocus, _ as useAskable };
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