@burdenoff/fe-libs 2026.1113.2 → 2026.1113.4

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,81 +1,102 @@
1
1
  import { isDenied as e } from "../../agent-tools/ui/dom.js";
2
2
  import { useAskAboutStore as t } from "./askAboutStore.js";
3
- import { normaliseFocus as n } from "./focus.js";
4
- import { useEffect as r, useRef as i, useState as a } from "react";
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";
5
6
  // src/shared/assistant/askAbout/useAskable.ts
6
- var o = 500, s = 10, c = 800, l = "input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])";
7
- function u(e) {
7
+ var c = 500, l = 10, u = 800, d = "input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])";
8
+ function f(e) {
8
9
  let t = e();
9
- return t ? n(t, {
10
+ return t ? i(t, {
10
11
  route: window.location.pathname,
11
12
  pickedAt: (/* @__PURE__ */ new Date()).toISOString()
12
13
  }) : null;
13
14
  }
14
- function d(n, r) {
15
+ function p(n, r) {
15
16
  if (t.getState().hosts === 0) return !1;
16
17
  let i = n instanceof Element ? n : r;
17
- return !i.closest(l) && !e(i) && !e(r);
18
+ return !i.closest(d) && !e(i) && !e(r);
18
19
  }
19
- function f(e) {
20
+ function m(e) {
20
21
  let t = e.ownerDocument.activeElement;
21
22
  return t instanceof HTMLElement && t !== e.ownerDocument.body ? t : null;
22
23
  }
23
- function p(e, n) {
24
- let r = null, i = null, a = 0, o = e.ownerDocument.defaultView ?? window, s = (e, n, r, i) => t.getState().actions.openMenu({
25
- focus: e,
26
- x: n,
27
- y: r,
28
- returnFocusTo: i
29
- }), l = () => {
30
- r !== null && clearTimeout(r), r = null, i = null, o.removeEventListener("scroll", l, !0);
31
- }, p = () => {
32
- let t = Date.now() + c, n = (r) => {
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
32
+ });
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 });
40
+ }, 900));
41
+ }, _ = () => {
42
+ a !== null && clearTimeout(a), a = null, o = null, c.removeEventListener("scroll", _, !0);
43
+ }, v = () => {
44
+ let t = Date.now() + u, n = (r) => {
33
45
  e.removeEventListener("click", n, !0), Date.now() > t || (r.preventDefault(), r.stopPropagation());
34
46
  };
35
- e.addEventListener("click", n, !0), setTimeout(() => e.removeEventListener("click", n, !0), c);
36
- }, m = (t) => {
37
- if (Date.now() - a < c) {
47
+ e.addEventListener("click", n, !0), setTimeout(() => e.removeEventListener("click", n, !0), u);
48
+ }, y = (t) => {
49
+ if (Date.now() - s < u) {
38
50
  t.preventDefault();
39
51
  return;
40
52
  }
41
- if (l(), t.shiftKey || t.defaultPrevented || !d(t.target, e)) return;
42
- let r = u(n);
43
- r && (t.preventDefault(), s(r, t.clientX, t.clientY, f(e)));
44
- }, h = (t) => {
45
- t.pointerType === "mouse" || !t.isPrimary || t.button > 0 || (l(), d(t.target, e) && (i = {
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 = {
46
58
  x: t.clientX,
47
59
  y: t.clientY,
48
60
  pointerId: t.pointerId
49
- }, o.addEventListener("scroll", l, !0), r = setTimeout(() => {
50
- let t = i;
51
- if (l(), !t) return;
52
- let r = u(n);
53
- r && (a = Date.now(), p(), s(r, t.x, t.y, f(e)));
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)));
54
66
  }, 500)));
55
- }, g = (e) => {
56
- i && e.pointerId === i.pointerId && Math.hypot(e.clientX - i.x, e.clientY - i.y) > 10 && l();
57
- }, _ = (e) => {
58
- i && e.pointerId === i.pointerId && l();
59
- }, v = (t) => {
60
- if (!(t.key === "ContextMenu" || t.shiftKey && t.key === "F10") || t.defaultPrevented || !d(t.target, e)) return;
61
- let r = u(n);
62
- if (!r) return;
67
+ }, x = (e) => {
68
+ o && e.pointerId === o.pointerId && Math.hypot(e.clientX - o.x, e.clientY - o.y) > 10 && _();
69
+ }, 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);
74
+ if (!n) return;
63
75
  t.preventDefault();
64
- let i = t.target instanceof HTMLElement ? t.target : e, a = i.getBoundingClientRect();
65
- s(r, a.left + Math.min(16, a.width / 2), a.bottom, i);
66
- }, y = e.style.getPropertyValue("-webkit-touch-callout");
67
- return e.style.setProperty("-webkit-touch-callout", "none"), e.addEventListener("contextmenu", m), e.addEventListener("pointerdown", h), e.addEventListener("pointermove", g), e.addEventListener("pointerup", _), e.addEventListener("pointercancel", _), e.addEventListener("keydown", v), () => {
68
- l(), e.removeEventListener("contextmenu", m), e.removeEventListener("pointerdown", h), e.removeEventListener("pointermove", g), e.removeEventListener("pointerup", _), e.removeEventListener("pointercancel", _), e.removeEventListener("keydown", v), y ? e.style.setProperty("-webkit-touch-callout", y) : e.style.removeProperty("-webkit-touch-callout");
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");
69
81
  };
70
82
  }
71
- function m(e, t = {}) {
72
- let [n, o] = a(null), s = i(e);
73
- r(() => {
74
- s.current = e;
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
+ route: window.location.pathname,
88
+ pickedAt: (/* @__PURE__ */ new Date()).toISOString()
89
+ });
90
+ return c ? (r(), s.pickAndOpen(c, a), !0) : !1;
91
+ }
92
+ function _(e, t = {}) {
93
+ let [n, r] = s(null), i = o(e);
94
+ a(() => {
95
+ i.current = e;
75
96
  }, [e]);
76
97
  let c = t.disabled === !0;
77
- return r(() => {
78
- if (n && !c) return p(n, () => s.current());
79
- }, [n, c]), o;
98
+ return a(() => {
99
+ if (n && !c) return h(n, () => i.current());
100
+ }, [n, c]), r;
80
101
  }
81
- export { o as LONG_PRESS_MS, s as LONG_PRESS_SLOP_PX, p as attachAskable, u as pickFocus, m as useAskable };
102
+ export { c as LONG_PRESS_MS, l as LONG_PRESS_SLOP_PX, g as askAssistantAbout, h as attachAskable, f as pickFocus, _ as useAskable };
@@ -193,10 +193,12 @@ 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.hint': "Right-click to ask AI about this";
196
197
  readonly 'askAbout.menuItem': "Ask AI about this";
197
198
  readonly 'askAbout.menuLabel': "Ask AI";
198
199
  readonly 'askAbout.placeholder': "Ask about {{name}}…";
199
200
  readonly 'askAbout.selectionButton': "Ask AI";
201
+ readonly 'askAbout.suggestionsLabel': "Suggested questions";
200
202
  readonly 'attachments.blockedMany': "{{count}} attachments didn't upload. Retry or remove them before sending.";
201
203
  readonly 'attachments.blockedOne': "{{name}} didn't upload. Retry or remove it before sending.";
202
204
  readonly 'attachments.cancelSaving': "Cancel";
@@ -86,10 +86,12 @@ 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.hint": "Right-click to ask AI about this",
89
90
  "askAbout.menuItem": "Ask AI about this",
90
91
  "askAbout.menuLabel": "Ask AI",
91
92
  "askAbout.placeholder": "Ask about {{name}}…",
92
93
  "askAbout.selectionButton": "Ask AI",
94
+ "askAbout.suggestionsLabel": "Suggested questions",
93
95
  "attachments.blockedMany": "{{count}} attachments didn't upload. Retry or remove them before sending.",
94
96
  "attachments.blockedOne": "{{name}} didn't upload. Retry or remove it before sending.",
95
97
  "attachments.cancelSaving": "Cancel",
@@ -113,6 +113,7 @@ export * from './askAbout/useAskable';
113
113
  export * from './askAbout/askableSelection';
114
114
  export * from './askAbout/AskAboutLayer';
115
115
  export * from './askAbout/placement';
116
+ export * from './askAbout/hint';
116
117
  export * from './attachmentCommit';
117
118
  export * from './voiceCommit';
118
119
  export * from './useAttachmentCommitter';