@burdenoff/fe-libs 2026.911.5 → 2026.912.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/shared/assistant/index.d.ts +3 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/preview/previewTransitions.d.ts +12 -0
- package/dist/shared/assistant/preview/previewTransitions.d.ts.map +1 -1
- package/dist/shared/assistant/preview/previewTransitions.js +57 -44
- package/dist/shared/assistant/preview/runIdentity.d.ts +44 -0
- package/dist/shared/assistant/preview/runIdentity.d.ts.map +1 -0
- package/dist/shared/assistant/preview/runIdentity.js +33 -0
- package/dist/shared/assistant/preview/surfaceState.d.ts +133 -0
- package/dist/shared/assistant/preview/surfaceState.d.ts.map +1 -0
- package/dist/shared/assistant/preview/surfaceState.js +92 -0
- package/dist/shared/assistant/preview/types.d.ts +33 -0
- package/dist/shared/assistant/preview/types.d.ts.map +1 -1
- package/dist/shared/assistant/preview/useAssistantPreviewBridge.d.ts.map +1 -1
- package/dist/shared/assistant/preview/useAssistantPreviewBridge.js +47 -39
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AIAssistantPanel.js +67 -63
- package/dist/shared/assistant/ui/AssistantConversationList.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantConversationList.js +1 -1
- package/dist/shared/assistant/ui/AssistantMoreMenu.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMoreMenu.js +58 -59
- package/dist/shared/assistant/ui/composer/AssistantAttachmentButton.d.ts.map +1 -1
- package/dist/shared/assistant/ui/composer/AssistantAttachmentButton.js +49 -50
- package/dist/shared/assistant/ui/panelOverlays.d.ts +52 -3
- package/dist/shared/assistant/ui/panelOverlays.d.ts.map +1 -1
- package/dist/shared/assistant/ui/panelOverlays.js +11 -7
- package/dist/shared/assistant/ui/useDropdownEscape.d.ts +34 -0
- package/dist/shared/assistant/ui/useDropdownEscape.d.ts.map +1 -0
- package/dist/shared/assistant/ui/useDropdownEscape.js +23 -0
- package/dist/shared/assistant/ui/useOverlayFocus.d.ts.map +1 -1
- package/dist/shared/assistant/useAssistantKeyboardShortcuts.d.ts.map +1 -1
- package/dist/shared/assistant/useAssistantKeyboardShortcuts.js +26 -21
- package/dist/shared-assistant.js +46 -43
- package/package.json +1 -1
|
@@ -57,6 +57,15 @@ export declare function escapeDismisses(current: PanelOverlayState): "overlay" |
|
|
|
57
57
|
* This one is load-bearing at runtime.
|
|
58
58
|
*/
|
|
59
59
|
export declare const ASSISTANT_PANEL_ATTR = "data-assistant-panel";
|
|
60
|
+
/**
|
|
61
|
+
* Attribute naming the full-surface overlay the panel is currently showing.
|
|
62
|
+
*
|
|
63
|
+
* ★★ Present only while one is open, and read by `assistantPanelOwnsEscape` —
|
|
64
|
+
* see the "focus fell to `<body>`" case there. Absent means no overlay.
|
|
65
|
+
*/
|
|
66
|
+
export declare const ASSISTANT_OVERLAY_ATTR = "data-assistant-overlay";
|
|
67
|
+
/** Which overlay is showing, as the attribute value — `null` when none is. */
|
|
68
|
+
export declare function activePanelOverlay(current: PanelOverlayState): "history" | "preview" | null;
|
|
60
69
|
/**
|
|
61
70
|
* Is `active` the panel itself, or inside it?
|
|
62
71
|
*
|
|
@@ -98,8 +107,48 @@ export declare function focusIsInsidePanel(panel: {
|
|
|
98
107
|
* - focus inside the panel -> the panel decides (overlay first, then close)
|
|
99
108
|
* - focus anywhere else -> the host closes the panel, exactly as before
|
|
100
109
|
*
|
|
101
|
-
* That partition is total and disjoint
|
|
102
|
-
*
|
|
110
|
+
* That partition is total and disjoint BETWEEN THESE TWO LISTENERS, whichever
|
|
111
|
+
* runs first. It says nothing about any other Escape handler on the page, and
|
|
112
|
+
* the qualifier matters — the first draft of this comment claimed Escape was
|
|
113
|
+
* "neither dropped nor double-handled" full stop, which is not true:
|
|
114
|
+
*
|
|
115
|
+
* - SUB-LAYERS INSIDE THE PANEL still need their own answer. The More menu
|
|
116
|
+
* and the attachment menu each own Escape while open; they take it in the
|
|
117
|
+
* CAPTURE phase and stop it, so it never reaches either listener here.
|
|
118
|
+
* Before that, the panel's hook saw focus inside the panel, found no
|
|
119
|
+
* full-surface overlay open, and closed the whole assistant — one press
|
|
120
|
+
* dismissed a dropdown and destroyed the in-flight turn.
|
|
121
|
+
* - ESCAPE CAN STILL BE DROPPED when focus is OUTSIDE the panel and a
|
|
122
|
+
* `role="dialog"` descendant is mounted inside it (the read-only voice
|
|
123
|
+
* transcript drawer): the host defers to the dialog, the dialog and this
|
|
124
|
+
* package both require focus inside the panel, and nothing acts. Pre-dates
|
|
125
|
+
* this contract and is not fixed by it.
|
|
126
|
+
* - A FULL-SURFACE OVERLAY OPEN WITH FOCUS ON A REAL ELEMENT OUTSIDE the
|
|
127
|
+
* panel still closes the whole assistant rather than backing out of the
|
|
128
|
+
* overlay. Pre-existing. Note this no longer covers focus of "nothing"
|
|
129
|
+
* (`<body>` or null), which is the common way to get here and is handled
|
|
130
|
+
* above — a control unmounting itself on click drops focus to `<body>`
|
|
131
|
+
* without the user going anywhere.
|
|
132
|
+
*
|
|
133
|
+
* This list is kept current deliberately. Earlier drafts described gaps that
|
|
134
|
+
* had been closed and missed one that was reachable in three clicks, which is
|
|
135
|
+
* worse than no list at all: the next reader trusts it.
|
|
103
136
|
*/
|
|
104
|
-
export declare function assistantPanelOwnsEscape(doc?: Pick<Document, "querySelectorAll" | "activeElement">): boolean;
|
|
137
|
+
export declare function assistantPanelOwnsEscape(doc?: Pick<Document, "querySelectorAll" | "activeElement" | "body">): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Does THIS panel claim Escape, given what is focused?
|
|
140
|
+
*
|
|
141
|
+
* ★★★ ONE definition, used by both sides. `assistantPanelOwnsEscape` maps it
|
|
142
|
+
* over every mounted panel for the hosts; `useAssistantKeyboardShortcuts` asks
|
|
143
|
+
* it about its own panel. They MUST agree: the host declines exactly what the
|
|
144
|
+
* panel accepts. When they drifted — the predicate widened to cover focus of
|
|
145
|
+
* "nothing" and the hook's guard was left asking only "is focus inside?" — the
|
|
146
|
+
* host deferred and the panel declined the same key, and Escape did nothing at
|
|
147
|
+
* all with the history drawer still open. A zero-handler case is quieter than
|
|
148
|
+
* the double-handler it replaced and no better.
|
|
149
|
+
*/
|
|
150
|
+
export declare function panelOwnsEscape(panel: {
|
|
151
|
+
contains(node: Node | null): boolean;
|
|
152
|
+
hasAttribute(name: string): boolean;
|
|
153
|
+
} | null, active: Node | null, body: Node | null): boolean;
|
|
105
154
|
//# sourceMappingURL=panelOverlays.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelOverlays.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/panelOverlays.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED,sDAAsD;AACtD,eAAO,MAAM,gBAAgB,EAAE,iBAG9B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,SAAS,GAAG,SAAS,GAC7B,iBAAiB,CAOnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,iBAAiB,GACzB,SAAS,GAAG,OAAO,CAErB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,OAAO,CAAA;CAAE,GAAG,IAAI,EACtD,MAAM,EAAE,IAAI,GAAG,IAAI,GAClB,OAAO,CAGT;AAED
|
|
1
|
+
{"version":3,"file":"panelOverlays.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/panelOverlays.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED,sDAAsD;AACtD,eAAO,MAAM,gBAAgB,EAAE,iBAG9B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,SAAS,GAAG,SAAS,GAC7B,iBAAiB,CAOnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,iBAAiB,GACzB,SAAS,GAAG,OAAO,CAErB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAE/D,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,iBAAiB,GACzB,SAAS,GAAG,SAAS,GAAG,IAAI,CAI9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,OAAO,CAAA;CAAE,GAAG,IAAI,EACtD,MAAM,EAAE,IAAI,GAAG,IAAI,GAClB,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,GAAE,IAAI,CAAC,QAAQ,EAAE,kBAAkB,GAAG,eAAe,GAAG,MAAM,CAAY,GAC5E,OAAO,CAqBT;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE;IACL,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,OAAO,CAAC;IACrC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACrC,GAAG,IAAI,EACR,MAAM,EAAE,IAAI,GAAG,IAAI,EACnB,IAAI,EAAE,IAAI,GAAG,IAAI,GAChB,OAAO,CAKT"}
|
|
@@ -12,15 +12,19 @@ function t(t, n) {
|
|
|
12
12
|
function n(e) {
|
|
13
13
|
return e.historyOpen || e.previewOpen ? "overlay" : "panel";
|
|
14
14
|
}
|
|
15
|
-
var r = "data-assistant-panel";
|
|
16
|
-
function
|
|
15
|
+
var r = "data-assistant-panel", i = "data-assistant-overlay";
|
|
16
|
+
function a(e) {
|
|
17
|
+
return e.historyOpen ? "history" : e.previewOpen ? "preview" : null;
|
|
18
|
+
}
|
|
19
|
+
function o(e, t) {
|
|
17
20
|
return !e || !t ? !1 : e === t || e.contains(t);
|
|
18
21
|
}
|
|
19
|
-
function
|
|
22
|
+
function s(e = document) {
|
|
20
23
|
let t = e.activeElement;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
return Array.from(e.querySelectorAll(`[${r}]`)).some((n) => c(n, t, e.body));
|
|
25
|
+
}
|
|
26
|
+
function c(e, t, n) {
|
|
27
|
+
return e ? o(e, t) ? !0 : (t === null || t === n) && e.hasAttribute("data-assistant-overlay") : !1;
|
|
24
28
|
}
|
|
25
29
|
//#endregion
|
|
26
|
-
export { r as ASSISTANT_PANEL_ATTR, e as NO_PANEL_OVERLAY, a as assistantPanelOwnsEscape, n as escapeDismisses,
|
|
30
|
+
export { i as ASSISTANT_OVERLAY_ATTR, r as ASSISTANT_PANEL_ATTR, e as NO_PANEL_OVERLAY, a as activePanelOverlay, s as assistantPanelOwnsEscape, n as escapeDismisses, o as focusIsInsidePanel, t as nextPanelOverlays, c as panelOwnsEscape };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Escape closes a dropdown inside the assistant panel — and closes ONLY it.
|
|
4
|
+
*
|
|
5
|
+
* ★★★ WHY CAPTURE. Both dropdowns used to listen on `window` in the bubble
|
|
6
|
+
* phase. `window` is the LAST node an event reaches, so the panel's own
|
|
7
|
+
* shortcut hook — on `document`, also bubbling — always ran first, saw focus
|
|
8
|
+
* inside the panel, found no full-surface overlay open, and closed the WHOLE
|
|
9
|
+
* assistant. One press dismissed a dropdown and destroyed the streaming turn,
|
|
10
|
+
* the draft and the attachments; this handler then ran on an unmounted
|
|
11
|
+
* component. Capture on `document` reaches this node ahead of every bubble
|
|
12
|
+
* listener on it, whatever order they registered in — the only placement that
|
|
13
|
+
* reliably wins.
|
|
14
|
+
*
|
|
15
|
+
* ★★★ WHY IT IS STILL SCOPED TO FOCUS. Consuming Escape unconditionally while
|
|
16
|
+
* open is the same mistake pointing the other way: the dropdown stays mounted
|
|
17
|
+
* when focus leaves it without a click (open it from the keyboard, Tab to the
|
|
18
|
+
* transcript toggle, press Enter), and it would then swallow an Escape meant
|
|
19
|
+
* for the layer the user actually opened last, closing a menu they cannot even
|
|
20
|
+
* see. So the key is taken only while focus is still inside the menu or on its
|
|
21
|
+
* trigger — the same containment question `focusIsInsidePanel` answers for the
|
|
22
|
+
* panel, and the same one this component's outside-click handler already asks.
|
|
23
|
+
*
|
|
24
|
+
* ★ `stopPropagation`, NOT `stopImmediatePropagation`: stopping in the capture
|
|
25
|
+
* phase already prevents every bubble listener from seeing the key. The
|
|
26
|
+
* immediate variant would additionally kill unrelated capture listeners on
|
|
27
|
+
* `document`, which are none of a dropdown's business.
|
|
28
|
+
*
|
|
29
|
+
* Shared by `AssistantMoreMenu` and `AssistantAttachmentButton` so the rule
|
|
30
|
+
* lives in one place — the two copies had drifted into being identical
|
|
31
|
+
* comment-for-comment, which is a third copy waiting to happen.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useDropdownEscape(open: boolean, menuRef: RefObject<HTMLElement | null>, buttonRef: RefObject<HTMLElement | null>, close: () => void): void;
|
|
34
|
+
//# sourceMappingURL=useDropdownEscape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDropdownEscape.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/useDropdownEscape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACtC,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACxC,KAAK,EAAE,MAAM,IAAI,GAChB,IAAI,CAiCN"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { focusIsInsidePanel as e } from "./panelOverlays.js";
|
|
2
|
+
import { useEffect as t, useRef as n } from "react";
|
|
3
|
+
//#region src/shared/assistant/ui/useDropdownEscape.ts
|
|
4
|
+
function r(r, i, a, o) {
|
|
5
|
+
let s = n(o);
|
|
6
|
+
t(() => {
|
|
7
|
+
s.current = o;
|
|
8
|
+
}, [o]), t(() => {
|
|
9
|
+
if (!r) return;
|
|
10
|
+
let t = (t) => {
|
|
11
|
+
if (t.key !== "Escape") return;
|
|
12
|
+
let n = document.activeElement;
|
|
13
|
+
(e(i.current, n) || e(a.current, n)) && (t.preventDefault(), t.stopPropagation(), s.current(), a.current?.focus());
|
|
14
|
+
};
|
|
15
|
+
return document.addEventListener("keydown", t, !0), () => document.removeEventListener("keydown", t, !0);
|
|
16
|
+
}, [
|
|
17
|
+
r,
|
|
18
|
+
i,
|
|
19
|
+
a
|
|
20
|
+
]);
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { r as useDropdownEscape };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOverlayFocus.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/useOverlayFocus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useOverlayFocus.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/useOverlayFocus.ts"],"names":[],"mappings":"AAkEA,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW;AACnD,8EAA8E;AAC9E,iBAAiB,CAAC,EAAE,MAAM,uCAgE3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAssistantKeyboardShortcuts.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/useAssistantKeyboardShortcuts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlD,UAAU,OAAO;IACf,QAAQ,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC3C,QAAQ,CAAC,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACjD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,6BAA6B,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"useAssistantKeyboardShortcuts.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/useAssistantKeyboardShortcuts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlD,UAAU,OAAO;IACf,QAAQ,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC3C,QAAQ,CAAC,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACjD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,6BAA6B,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,QA+ErF"}
|
|
@@ -1,36 +1,41 @@
|
|
|
1
1
|
import { useAssistantStore as e } from "./store.js";
|
|
2
|
-
import { focusIsInsidePanel as t } from "./ui/panelOverlays.js";
|
|
3
|
-
import { useEffect as
|
|
2
|
+
import { focusIsInsidePanel as t, panelOwnsEscape as n } from "./ui/panelOverlays.js";
|
|
3
|
+
import { useEffect as r } from "react";
|
|
4
4
|
//#region src/shared/assistant/useAssistantKeyboardShortcuts.ts
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
let
|
|
8
|
-
let
|
|
9
|
-
if (!
|
|
10
|
-
let
|
|
11
|
-
if (
|
|
12
|
-
n
|
|
5
|
+
function i({ panelRef: i, inputRef: a, onClose: o }) {
|
|
6
|
+
r(() => {
|
|
7
|
+
let r = (r) => {
|
|
8
|
+
let s = i.current;
|
|
9
|
+
if (!s) return;
|
|
10
|
+
let c = document.activeElement;
|
|
11
|
+
if (r.key === "Escape") {
|
|
12
|
+
if (!n(s, c, document.body)) return;
|
|
13
|
+
r.preventDefault(), o();
|
|
13
14
|
return;
|
|
14
15
|
}
|
|
15
|
-
if (s
|
|
16
|
-
|
|
16
|
+
if (!t(s, c)) return;
|
|
17
|
+
let l = r.ctrlKey || r.metaKey;
|
|
18
|
+
if (l && r.shiftKey && (r.key === "N" || r.key === "n")) {
|
|
19
|
+
r.preventDefault(), e.getState().createConversation();
|
|
17
20
|
return;
|
|
18
21
|
}
|
|
19
|
-
if (
|
|
20
|
-
|
|
22
|
+
if (l && r.shiftKey && (r.key === "E" || r.key === "e")) {
|
|
23
|
+
r.preventDefault();
|
|
24
|
+
let e = s.querySelector("[data-testid=\"assistant-more\"]");
|
|
25
|
+
e?.focus(), e?.click();
|
|
21
26
|
return;
|
|
22
27
|
}
|
|
23
|
-
if (
|
|
24
|
-
let e =
|
|
25
|
-
e !== "INPUT" && e !== "TEXTAREA" && (
|
|
28
|
+
if (r.key === "/" && !l && !r.shiftKey) {
|
|
29
|
+
let e = c?.tagName;
|
|
30
|
+
e !== "INPUT" && e !== "TEXTAREA" && (r.preventDefault(), a?.current?.focus());
|
|
26
31
|
}
|
|
27
32
|
};
|
|
28
|
-
return document.addEventListener("keydown",
|
|
33
|
+
return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
29
34
|
}, [
|
|
30
|
-
r,
|
|
31
35
|
i,
|
|
32
|
-
a
|
|
36
|
+
a,
|
|
37
|
+
o
|
|
33
38
|
]);
|
|
34
39
|
}
|
|
35
40
|
//#endregion
|
|
36
|
-
export {
|
|
41
|
+
export { i as useAssistantKeyboardShortcuts };
|
package/dist/shared-assistant.js
CHANGED
|
@@ -57,46 +57,49 @@ import { AssistantSpeakButton as $r } from "./shared/assistant/ui/AssistantSpeak
|
|
|
57
57
|
import { AssistantSpokenTurnsNotice as ei } from "./shared/assistant/ui/AssistantSpokenTurnsNotice.js";
|
|
58
58
|
import { AssistantConnectSourceProvider as ti, useAssistantConnectSource as ni } from "./shared/assistant/ui/composer/connectSource.js";
|
|
59
59
|
import { AssistantConnectSourceItem as ri } from "./shared/assistant/ui/composer/AssistantConnectSourceItem.js";
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
|
|
60
|
+
import { ASSISTANT_OVERLAY_ATTR as ii, ASSISTANT_PANEL_ATTR as ai, NO_PANEL_OVERLAY as oi, activePanelOverlay as si, assistantPanelOwnsEscape as ci, escapeDismisses as li, focusIsInsidePanel as ui, nextPanelOverlays as di, panelOwnsEscape as fi } from "./shared/assistant/ui/panelOverlays.js";
|
|
61
|
+
import { useDropdownEscape as pi } from "./shared/assistant/ui/useDropdownEscape.js";
|
|
62
|
+
import { AssistantAttachmentButton as mi } from "./shared/assistant/ui/composer/AssistantAttachmentButton.js";
|
|
63
|
+
import { AssistantAttachmentChips as hi } from "./shared/assistant/ui/composer/AssistantAttachmentChips.js";
|
|
64
|
+
import { AssistantPreviewProvider as gi, useAssistantPreview as _i } from "./shared/assistant/preview/context.js";
|
|
65
|
+
import { IDLE_PREVIEW_STATE as vi, isRunningStatus as yi, nextPreviewEvents as bi } from "./shared/assistant/preview/previewTransitions.js";
|
|
66
|
+
import { IDLE_PREVIEW as xi, NO_OWNER as Si, applyPreviewEvent as Ci, createAssistantPreviewSurface as wi, currentPreviewOwner as Ti, runBelongsTo as Ei, sameOwner as Di } from "./shared/assistant/preview/surfaceState.js";
|
|
67
|
+
import { createRunIdentityCache as Oi, runIdentities as ki } from "./shared/assistant/preview/runIdentity.js";
|
|
68
|
+
import { useOverlayFocus as Ai } from "./shared/assistant/ui/useOverlayFocus.js";
|
|
69
|
+
import { useAssistantPreviewBridge as ji } from "./shared/assistant/preview/useAssistantPreviewBridge.js";
|
|
70
|
+
import { AssistantPreviewOverlay as Mi } from "./shared/assistant/preview/AssistantPreviewOverlay.js";
|
|
71
|
+
import { AssistantLanguageSelector as Ni, FOLLOW_APP_LOCALE as Pi } from "./shared/assistant/ui/composer/AssistantLanguageSelector.js";
|
|
72
|
+
import { ASSISTANT_MODE_META as Fi, AssistantModeSelector as Ii, nextModeIndex as Li } from "./shared/assistant/ui/composer/AssistantModeSelector.js";
|
|
73
|
+
import { AssistantVoiceButton as Ri } from "./shared/assistant/ui/composer/AssistantVoiceButton.js";
|
|
74
|
+
import { AUTO_VOICE as zi, AssistantVoiceSelector as Bi } from "./shared/assistant/ui/composer/AssistantVoiceSelector.js";
|
|
75
|
+
import { AssistantVoiceOrb as Vi } from "./shared/assistant/ui/voice/AssistantVoiceOrb.js";
|
|
76
|
+
import { AssistantVoiceSessionButton as Hi } from "./shared/assistant/ui/voice/AssistantVoiceSessionButton.js";
|
|
77
|
+
import { CAPTION_SCROLL_ATTR as Ui, VoiceCaption as Wi } from "./shared/assistant/ui/voice/VoiceCaption.js";
|
|
78
|
+
import { VoiceConversationView as Gi } from "./shared/assistant/ui/voice/VoiceConversationView.js";
|
|
79
|
+
import { VoiceWaveform as Ki } from "./shared/assistant/ui/voice/VoiceWaveform.js";
|
|
80
|
+
import { VoiceMiniController as qi } from "./shared/assistant/ui/voice/VoiceMiniController.js";
|
|
81
|
+
import { VoiceStage as Ji } from "./shared/assistant/ui/voice/VoiceStage.js";
|
|
82
|
+
import { VoiceTranscriptDrawer as Yi } from "./shared/assistant/ui/voice/VoiceTranscriptDrawer.js";
|
|
83
|
+
import { downloadFile as Xi, exportConversation as Zi } from "./shared/assistant/exportConversation.js";
|
|
84
|
+
import { AssistantMoreMenu as Qi } from "./shared/assistant/ui/AssistantMoreMenu.js";
|
|
85
|
+
import { AssistantHeader as $i } from "./shared/assistant/ui/AssistantHeader.js";
|
|
86
|
+
import { AssistantConversationList as ea } from "./shared/assistant/ui/AssistantConversationList.js";
|
|
87
|
+
import { AssistantEmptyState as ta } from "./shared/assistant/ui/AssistantEmptyState.js";
|
|
88
|
+
import { AssistantMessageItem as na } from "./shared/assistant/ui/AssistantMessageItem.js";
|
|
89
|
+
import { AssistantMessageList as ra } from "./shared/assistant/ui/AssistantMessageList.js";
|
|
90
|
+
import { AssistantVoiceSession as ia } from "./shared/assistant/ui/voice/AssistantVoiceSession.js";
|
|
91
|
+
import { useAssistantApiAccess as aa } from "./shared/assistant/useAssistantApiAccess.js";
|
|
92
|
+
import { useConversationTurns as oa } from "./shared/assistant/useConversationTurns.js";
|
|
93
|
+
import { isMultimodalBodyRejection as sa, isRecoverableAssistantError as ca } from "./shared/assistant/transportErrors.js";
|
|
94
|
+
import { aiCreditsUpdatedEventName as la, dispatchAssistantQuotaExhausted as ua, notifyAiCreditsUpdated as da } from "./shared/assistant/aiCredits.js";
|
|
95
|
+
import { useWorkspaceWriteAccess as fa } from "./shared/assistant/useWorkspaceWriteAccess.js";
|
|
96
|
+
import { extractDocumentText as pa } from "./shared/assistant/documentExtract.js";
|
|
97
|
+
import { useAssistantAttachments as ma } from "./shared/assistant/useAssistantAttachments.js";
|
|
98
|
+
import { AssistantComposer as ha } from "./shared/assistant/ui/composer/AssistantComposer.js";
|
|
99
|
+
import { isProdRuntime as ga } from "./shared/assistant/env.js";
|
|
100
|
+
import { useAssistantHeartbeat as _a } from "./shared/assistant/useAssistantHeartbeat.js";
|
|
101
|
+
import { useAssistantKeyboardShortcuts as va } from "./shared/assistant/useAssistantKeyboardShortcuts.js";
|
|
102
|
+
import { AssistantApiCallsConsentDialog as ya } from "./shared/assistant/ui/AssistantApiCallsConsentDialog.js";
|
|
103
|
+
import { AssistantChatArea as ba } from "./shared/assistant/ui/AssistantChatArea.js";
|
|
104
|
+
import { AIAssistantPanel as xa } from "./shared/assistant/ui/AIAssistantPanel.js";
|
|
105
|
+
export { xa as AIAssistantPanel, L as ASSISTANT_API_AUTH_STRATEGY, sn as ASSISTANT_LANGUAGES, Fi as ASSISTANT_MODE_META, ii as ASSISTANT_OVERLAY_ATTR, ai as ASSISTANT_PANEL_ATTR, Kn as ATTACHMENT_ACCEPT, Hr as ATTACHMENT_SOURCES, zi as AUTO_VOICE, ya as AssistantApiCallsConsentDialog, mi as AssistantAttachmentButton, hi as AssistantAttachmentChips, Jr as AssistantAutoSpeakToggle, ba as AssistantChatArea, ha as AssistantComposer, ri as AssistantConnectSourceItem, ti as AssistantConnectSourceProvider, ea as AssistantConversationList, ta as AssistantEmptyState, $i as AssistantHeader, s as AssistantI18nProvider, Zr as AssistantLanguageMenu, Ni as AssistantLanguageSelector, f as AssistantMarkdownImage, h as AssistantMarkdownRenderer, Yr as AssistantMessageAttachments, na as AssistantMessageItem, ra as AssistantMessageList, Ii as AssistantModeSelector, Qi as AssistantMoreMenu, g as AssistantNavigateProvider, Xr as AssistantPendingWriteCard, Mi as AssistantPreviewOverlay, gi as AssistantPreviewProvider, t as AssistantProductProvider, Qr as AssistantReplyLanguageSelector, _e as AssistantRuntimeManager, $r as AssistantSpeakButton, Ir as AssistantSpeechProvider, ei as AssistantSpokenTurnsNotice, Pr as AssistantToolActivity, Ri as AssistantVoiceButton, Vi as AssistantVoiceOrb, Bi as AssistantVoiceSelector, ia as AssistantVoiceSession, Hi as AssistantVoiceSessionButton, qn as AttachmentRejectedError, En as BOILERPLATE_PAGE_SHARE, Ui as CAPTION_SCROLL_ATTR, O as CHECK_AI_CREDITS, k as CREATE_SANDBOX, zt as DEFAULT_SPEAKABLE_LABELS, cn as DEFAULT_SPEECH_RATE, ft as ENDPOINT_GRACE_MS, A as EXTEND_SANDBOX_TTL, Pi as FOLLOW_APP_LOCALE, j as GET_ACTIVE_SANDBOXES, M as GET_SANDBOX, He as HOSTED_TTS_MAX_CHARS, Re as HOSTED_TTS_TIER, ze as HOSTED_VOICES, yn as IDLE_PLAYBACK, xi as IDLE_PREVIEW, vi as IDLE_PREVIEW_STATE, pt as INITIAL_SESSION, Jn as INLINE_IMAGE_MAX_DIM, Yn as INLINE_IMAGE_QUALITY, mt as INTERRUPT_MAX_MS, ht as INTERRUPT_MIN_MS, Xn as MAX_ATTACHMENTS, Dn as MAX_BOILERPLATE_LINE_CHARS, On as MAX_EXTRACTED_CHARS, Zn as MAX_FILE_BYTES, Qn as MAX_INLINE_CHARS_PER_FILE, $n as MAX_INLINE_CHARS_TOTAL, wn as MAX_INLINE_IMAGE_BASE64_BYTES, er as MAX_INLINE_IMAGE_BASE64_CHARS, tr as MAX_INLINE_IMAGE_PARTS, nr as MAX_INLINE_TURN_BODY_BYTES, kn as MAX_PDF_PAGES_SCANNED, Tn as MAX_REQUEST_BODY_BYTES, Bt as MAX_SPEAKABLE_CHARS, Vt as MAX_SPOKEN_TABLE_ROWS, rr as MAX_TURN_BODY_BYTES, Zt as MINI_CAPTION_BUDGET, An as MIN_PAGE_TEXT_CHARS, jn as MIN_TEXT_PAGE_SHARE, Si as NO_OWNER, oi as NO_PANEL_OVERLAY, Dr as PHRASE_ROTATE_MS, $t as POLL_FAST_MS, en as POLL_FAST_UNTIL_MS, tn as POLL_SLOW_MS, nn as POLL_STEADY_MS, rn as POLL_STEADY_UNTIL_MS, Yt as PREVIEW_LANGUAGES, ir as PROMPT_ENVELOPE_RESERVE_BYTES, N as PROXY_SANDBOX_REQUEST, P as REPORT_AI_TOKEN_USAGE, Gr as SANDBOX_READY_TTL_MS, gt as SILENCE_SUBMIT_MS, Ue as SPEAKING_RATE_MAX, We as SPEAKING_RATE_MAX_STREAMING, Ge as SPEAKING_RATE_MAX_SYNC, Ke as SPEAKING_RATE_MIN, Ht as SPEECH_CHUNK_CHARS, Ut as SPEECH_CHUNK_CJK_CHARS, wt as SPEECH_LANG, hn as SPOKEN_LABEL_LANGUAGES, Or as STAGE_COPY, F as STOP_ASSISTANT_SANDBOX, kr as THINKING_PHRASES, ar as TURN_BODY_HEADROOM_BYTES, Tt as VOICE_LIST_TIMEOUT_MS, Wi as VoiceCaption, Gi as VoiceConversationView, qi as VoiceMiniController, Ji as VoiceStage, Yi as VoiceTranscriptDrawer, Ki as VoiceWaveform, I as WAIT_FOR_SANDBOX_RUNNING, q as abortAssistantTurn, si as activePanelOverlay, la as aiCreditsUpdatedEventName, Ci as applyPreviewEvent, J as approvePendingWrite, ci as assistantPanelOwnsEscape, _ as assistantRoutePath, c as assistantTranslationKey, v as assistantUrlTransform, Ur as availableAttachmentSources, qe as base64ToBytes, y as browserShouldHandle, Le as browserSpeechEngine, Y as buildAssistantSandboxEnv, or as buildAttachmentPromptBlock, It as buildContinuedFromVoiceNote, ve as buildProgress, sr as buildPromptParts, X as buildPromptRequestBody, cr as buildPromptWithAttachments, Je as buildRequest, E as buildSandboxContextInput, Lt as buildVoiceTranscriptMarkdown, Ae as chatTurns, Z as checkAssistantAiCredits, Wt as chunkForSpeech, b as classifyAssistantHref, lr as classifyAttachment, Ye as classifyHttpFailure, S as classifyQuotaError, Mn as columnLetterToIndex, tt as configureSpeechEngine, Gt as containsCjk, d as copyToClipboard, ur as countInlineImageCandidates, dr as countInlinedImageParts, wi as createAssistantPreviewSurface, Q as createAssistantSandbox, $ as createAssistantSession, $e as createHostedTtsEngine, Kr as createReadinessTracker, et as createRoutingSpeechEngine, Oi as createRunIdentityCache, Oe as createSandboxAssistantTransport, nt as createSpeechEngines, Ti as currentPreviewOwner, Xe as decodeAudioResponse, Nn as decodeXmlEntities, C as describeQuotaError, fr as detectDocumentFormat, _n as detectScriptLocale, Wr as deviceHasCamera, ua as dispatchAssistantQuotaExhausted, Pn as docxXmlToText, ee as downloadAssistantArtifact, Xi as downloadFile, li as escapeDismisses, pr as estimateTurnBodyBytes, D as executeSandboxGraphQL, Zi as exportConversation, te as extendAssistantSandboxTTL, pa as extractDocumentText, ln as findAssistantLanguage, ne as findExistingSandbox, pn as findPendingWrite, Fn as fitPdfPages, ui as focusIsInsidePanel, mr as formatBytes, In as formatPageRanges, zr as getActorId, re as getAssistantArtifacts, ye as getAssistantMedia, ie as getAssistantMessages, ae as getAssistantSession, oe as getAssistantStreamAccess, be as getAssistantText, hr as getAttachmentSendBlocker, U as getCapability, gr as getExtension, R as getImageForMode, z as getImageTagForMode, Br as getOrganizationId, xe as getRawMessageCreatedAt, B as getResourcesForMode, V as getSandboxImageRegistry, _r as getSendableAttachments, rt as getSpeechEngine, Se as getToolProgress, Vr as getWorkspaceId, je as groupBySession, Me as groupConsecutiveBySession, vr as hasAttachmentWorkInFlight, Be as hostedLocaleFor, Ve as hostedSupportsLanguage, p as imageHostLabel, _t as isCapturing, vt as isEcho, Ln as isMostlyImagePages, sa as isMultimodalBodyRejection, ga as isProdRuntime, w as isQuotaExhaustedError, Ce as isReapedSandboxConnectionError, qr as isRecentlyVerified, we as isRecoverable, ca as isRecoverableAssistantError, m as isRemoteImageSrc, yi as isRunningStatus, bn as isSpeakingMessage, Et as isSpeechBlocked, Ar as isStageCopy, yt as isSubmittable, wr as isTurnInFlight, W as isUnknownFieldError, Ne as isVoiceTurn, Rn as joinSheets, Dt as languageDisplayName, Te as mapSessionToHistory, G as markSupported, K as markUnsupported, Ee as mergeMessagesById, ot as micIsInterrupt, se as modeRequiresConfirmWrites, Li as nextModeIndex, di as nextPanelOverlays, bi as nextPreviewEvents, Ot as normalizeLangTag, da as notifyAiCreditsUpdated, bt as orbMode, zn as pageMarker, fi as panelOwnsEscape, mn as parseConfirmationRefusal, yr as parseDataUrl, Bn as parseSharedStrings, Fr as parseToolActivity, Vn as parseWorkbookSheets, Hn as pdfTextItemsToPage, Tr as planAbandonedTurn, xt as planReplyConsumption, Er as planTurnAbort, an as pollDelayMs, kt as primaryLanguageSubtag, xn as publishedChunks, T as quotaExhaustedEventName, it as readSpeechEngineConfig, ce as releaseSupersededAssistantSandboxes, dn as replyFollowsInput, le as reportAssistantAiTokenUsage, Sn as requiresCancel, at as resetSpeechEngine, un as resolveAssistantLanguage, fn as resolveLanguagePair, n as resolveModeConfig, H as resolveSandboxAssistantMode, vn as resolveSpeechLocale, Ei as runBelongsTo, ki as runIdentities, Di as sameOwner, De as sanitize, ue as selectExistingAssistantSandbox, de as selectSupersededAssistantSandboxes, At as selectVoiceForLocale, fe as sendAssistantPromptAsync, pe as sendHeartbeat, Un as sheetXmlToRows, Ze as shouldDisableEngine, Qt as showPreviousChunk, st as showsAssistantCaption, ct as showsUserCaption, Kt as speakableEmail, jt as speechGate, gn as speechLabelsFor, Mt as speechLangForLocale, Cn as speechPlaybackReducer, Qe as splitForVendor, qt as splitTableRow, St as spokenSoFar, jr as stageText, Mr as statusStageCopy, me as stopReapedAssistantSandbox, Wn as summarisePageText, Nr as thinkingPhrase, on as toCaptionText, br as toMessageAttachment, Jt as toSpeakableText, xr as truncateForInline, Gn as truncatePagesForInline, aa as useAssistantApiAccess, ma as useAssistantAttachments, ni as useAssistantConnectSource, _a as useAssistantHeartbeat, l as useAssistantI18nNamespace, va as useAssistantKeyboardShortcuts, x as useAssistantNavigate, r as useAssistantPageLabel, _i as useAssistantPreview, ji as useAssistantPreviewBridge, i as useAssistantProduct, a as useAssistantProductOrNull, Lr as useAssistantSpeech, o as useAssistantStorageFolders, Cr as useAssistantStore, u as useAssistantTr, oa as useConversationTurns, pi as useDropdownEscape, Ai as useOverlayFocus, ke as useSandboxAssistantTransport, e as useVoiceInput, Rr as useVoiceSession, fa as useWorkspaceWriteAccess, Sr as validateFile, Nt as voiceAvailability, Pe as voiceMarker, Xt as voicePreviewText, Pt as voiceQualityRank, Fe as voiceSessionIdOf, Ct as voiceSessionReducer, lt as voiceStageState, Rt as voiceTranscriptFilename, Ie as voiceTurnsOnly, Ft as voicesForLocale, he as waitForAssistantServiceReady, ge as waitForSandboxRunning, ut as waveformIsActive, dt as waveformIsSettled };
|