@epam/ai-dial-conversation-input 1.2.0-dev.46 → 1.2.0-dev.50
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/components/Input/Input.d.ts.map +1 -1
- package/components/Input/ModelSelectorControl.d.ts.map +1 -1
- package/components/ModelSelectorBottomSheet/ModelSelectorBottomSheet.d.ts.map +1 -1
- package/constants/public-class-names.d.ts +30 -0
- package/constants/public-class-names.d.ts.map +1 -0
- package/hooks/useModelSelector.d.ts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +280 -262
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAGL,KAAK,EAAE,EAOR,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAGL,KAAK,EAAE,EAOR,MAAM,OAAO,CAAC;AAaf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AASrD,wIAAwI;AACxI,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAs1BhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelSelectorControl.d.ts","sourceRoot":"","sources":["../../../src/components/Input/ModelSelectorControl.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAGf,MAAM,2BAA2B,CAAC;AASnC,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ModelSelectorControl.d.ts","sourceRoot":"","sources":["../../../src/components/Input/ModelSelectorControl.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAGf,MAAM,2BAA2B,CAAC;AASnC,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAGzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAK9D,UAAU,KAAK;IACb,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;IACrB,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC;IACxD,wEAAwE;IACxE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,uEAAuE;IACvE,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED,8FAA8F;AAC9F,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,KAAK,CAqN1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelSelectorBottomSheet.d.ts","sourceRoot":"","sources":["../../../src/components/ModelSelectorBottomSheet/ModelSelectorBottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,2BAA2B,CAAC;AAUnC,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,EAAE,EAAuB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ModelSelectorBottomSheet.d.ts","sourceRoot":"","sources":["../../../src/components/ModelSelectorBottomSheet/ModelSelectorBottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,2BAA2B,CAAC;AAUnC,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,EAAE,EAAuB,MAAM,OAAO,CAAC;AAIzE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAKnF,sGAAsG;AACtG,UAAU,8BAA8B;IACtC,wGAAwG;IACxG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mHAAmH;IACnH,KAAK,CAAC,EAAE,sBAAsB,CAAC;CAChC;AA6ED,wDAAwD;AACxD,MAAM,WAAW,6BAA6B;IAC5C,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kFAAkF;IAClF,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kJAAkJ;IAClJ,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,oFAAoF;IACpF,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,iFAAiF;IACjF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iGAAiG;IACjG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wDAAwD;IACxD,MAAM,CAAC,EAAE,8BAA8B,CAAC;CACzC;AAED,wFAAwF;AACxF,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,6BAA6B,CAkHtE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const CONVERSATION_INPUT_CLASS: {
|
|
2
|
+
/** The composer's outer bordered container. */
|
|
3
|
+
readonly wrapper: "dial-ci-wrapper";
|
|
4
|
+
/** The row holding the textarea, add button, tool chips, and footer actions. */
|
|
5
|
+
readonly actionRow: "dial-ci-action-row";
|
|
6
|
+
/** The wrapper around the textarea area inside the action row. */
|
|
7
|
+
readonly textareaWrap: "dial-ci-textarea-wrap";
|
|
8
|
+
/** The wrapper around the add-attachment button. */
|
|
9
|
+
readonly addCluster: "dial-ci-add-cluster";
|
|
10
|
+
/** The trailing cluster: model selector, mic, and send/stop buttons. */
|
|
11
|
+
readonly footerActions: "dial-ci-footer-actions";
|
|
12
|
+
/** The model selector trigger button, in every presentation. */
|
|
13
|
+
readonly modelSelectorButton: "dial-ci-model-selector-button";
|
|
14
|
+
/**
|
|
15
|
+
* The model menu root. Present on all three presentations: the desktop
|
|
16
|
+
* dropdown, the host-supplied `modelPickerOverlay` dropdown, and the mobile
|
|
17
|
+
* bottom sheet.
|
|
18
|
+
*/
|
|
19
|
+
readonly modelMenu: "dial-ci-model-menu";
|
|
20
|
+
/** The sticky search header inside the model menu. */
|
|
21
|
+
readonly modelMenuSearch: "dial-ci-model-menu-search";
|
|
22
|
+
/** Every deployment row in the model menu. */
|
|
23
|
+
readonly modelMenuItem: "dial-ci-model-menu-item";
|
|
24
|
+
/**
|
|
25
|
+
* The currently selected deployment row, additive to `modelMenuItem`. The
|
|
26
|
+
* check mark itself is drawn by `@epam/ai-dial-ui-kit` and has no class here.
|
|
27
|
+
*/
|
|
28
|
+
readonly modelMenuItemSelected: "dial-ci-model-menu-item-selected";
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=public-class-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-class-names.d.ts","sourceRoot":"","sources":["../../src/constants/public-class-names.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,wBAAwB;IACnC,+CAA+C;;IAE/C,gFAAgF;;IAEhF,kEAAkE;;IAElE,oDAAoD;;IAEpD,wEAAwE;;IAExE,gEAAgE;;IAEhE;;;;OAIG;;IAEH,sDAAsD;;IAEtD,8CAA8C;;IAE9C;;;OAGG;;CAEK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModelSelector.d.ts","sourceRoot":"","sources":["../../src/hooks/useModelSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,YAAY,EAKb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useModelSelector.d.ts","sourceRoot":"","sources":["../../src/hooks/useModelSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,YAAY,EAKb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAO1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAQ3D,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACtC,gIAAgI;IAChI,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,wCAAwC;IACxC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,yDAAyD;IACzD,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,+CAA+C;IAC/C,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mHAAmH;IACnH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,wDAAwD;IACxD,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B;AAED,qFAAqF;AACrF,UAAU,mBAAmB;IAC3B,sEAAsE;IACtE,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,6CAA6C;AAC7C,MAAM,WAAW,sBAAsB;IACrC,wCAAwC;IACxC,YAAY,EAAE,SAAS,CAAC;IACxB,+CAA+C;IAC/C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,0GAA0G;IAC1G,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,6IAA6I;IAC7I,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,8CAA8C;IAC9C,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,0DAA0D;IAC1D,UAAU,EAAE,SAAS,CAAC;IACtB,wFAAwF;IACxF,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAED,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB,GAAI,gHAO9B,uBAAuB,KAAG,sBAoJ5B,CAAC"}
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { CONVERSATION_INPUT_CLASS } from './constants/public-class-names';
|
|
1
2
|
export { BottomSheetShell } from './components/BottomSheetShell/BottomSheetShell';
|
|
2
3
|
export type { BottomSheetShellProps } from './components/BottomSheetShell/BottomSheetShell';
|
|
3
4
|
export { ConversationInput } from './components/ConversationInput/ConversationInput';
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,YAAY,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,iBAAiB,EACjB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,kDAAkD,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,YAAY,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,iBAAiB,EACjB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,kDAAkD,CAAC"}
|
package/index.js
CHANGED
|
@@ -5,8 +5,19 @@ import { createElement as me, memo as he, useCallback as L, useEffect as R, useI
|
|
|
5
5
|
import { createPortal as H } from "react-dom";
|
|
6
6
|
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
7
7
|
import { AttachmentTray as ve, MAX_UPLOADS_PER_MINUTE as ye, generateAttachmentId as be, useClipboardPaste as xe } from "@epam/ai-dial-attachment-input";
|
|
8
|
-
//#region src/
|
|
9
|
-
var
|
|
8
|
+
//#region src/constants/public-class-names.ts
|
|
9
|
+
var K = {
|
|
10
|
+
wrapper: "dial-ci-wrapper",
|
|
11
|
+
actionRow: "dial-ci-action-row",
|
|
12
|
+
textareaWrap: "dial-ci-textarea-wrap",
|
|
13
|
+
addCluster: "dial-ci-add-cluster",
|
|
14
|
+
footerActions: "dial-ci-footer-actions",
|
|
15
|
+
modelSelectorButton: "dial-ci-model-selector-button",
|
|
16
|
+
modelMenu: "dial-ci-model-menu",
|
|
17
|
+
modelMenuSearch: "dial-ci-model-menu-search",
|
|
18
|
+
modelMenuItem: "dial-ci-model-menu-item",
|
|
19
|
+
modelMenuItemSelected: "dial-ci-model-menu-item-selected"
|
|
20
|
+
}, Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", Ce = (e, t, n) => {
|
|
10
21
|
R(() => {
|
|
11
22
|
if (!e) return;
|
|
12
23
|
let n = (e) => {
|
|
@@ -536,7 +547,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
536
547
|
a
|
|
537
548
|
])
|
|
538
549
|
};
|
|
539
|
-
}, Je = { label: "_label_14i7c_1" },
|
|
550
|
+
}, Je = { label: "_label_14i7c_1" }, q = ({ features: e, responseFormat: t, systemPrompt: n, temperature: i, onResponseFormatChange: o, onSystemPromptChange: l, onTemperatureChange: u, responseFormatLabel: d = "Response format", responseFormatHint: f = "Applies to new and existing messages", responseFormatMarkdownLabel: p = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: h = "System prompt", systemPromptTooltip: g = "Enter a prompt", temperatureLabel: _ = "Temperature", temperatureLabels: v = [
|
|
540
551
|
"Precise",
|
|
541
552
|
"Neutral",
|
|
542
553
|
"Creative"
|
|
@@ -610,7 +621,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
610
621
|
onBack: t,
|
|
611
622
|
backLabel: n,
|
|
612
623
|
style: a,
|
|
613
|
-
children: [/* @__PURE__ */ W(
|
|
624
|
+
children: [/* @__PURE__ */ W(q, {
|
|
614
625
|
features: o,
|
|
615
626
|
responseFormat: T,
|
|
616
627
|
systemPrompt: E,
|
|
@@ -670,7 +681,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
670
681
|
})
|
|
671
682
|
})
|
|
672
683
|
}),
|
|
673
|
-
children: /* @__PURE__ */ W(
|
|
684
|
+
children: /* @__PURE__ */ W(q, {
|
|
674
685
|
features: e,
|
|
675
686
|
responseFormat: b,
|
|
676
687
|
systemPrompt: x,
|
|
@@ -1014,7 +1025,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1014
1025
|
})
|
|
1015
1026
|
})]
|
|
1016
1027
|
}, e.id))
|
|
1017
|
-
}),
|
|
1028
|
+
}), J = {
|
|
1018
1029
|
wrapper: "_wrapper_q1jcl_2",
|
|
1019
1030
|
wrapperDisabled: "_wrapperDisabled_q1jcl_9",
|
|
1020
1031
|
textarea: "_textarea_q1jcl_13",
|
|
@@ -1118,7 +1129,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1118
1129
|
className: d,
|
|
1119
1130
|
children: [/* @__PURE__ */ G("div", {
|
|
1120
1131
|
style: u,
|
|
1121
|
-
className: c("flex w-full min-w-0 flex-col justify-center gap-2", !f &&
|
|
1132
|
+
className: c("flex w-full min-w-0 flex-col justify-center gap-2", !f && J.wrapper, !f && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md", S && at.wrapperError),
|
|
1122
1133
|
children: [/* @__PURE__ */ G("div", {
|
|
1123
1134
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
1124
1135
|
children: [x && /* @__PURE__ */ W("span", {
|
|
@@ -1183,16 +1194,16 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1183
1194
|
"aria-hidden": "true",
|
|
1184
1195
|
children: [/* @__PURE__ */ W(ft, {}), /* @__PURE__ */ W(pt, {})]
|
|
1185
1196
|
}, t))
|
|
1186
|
-
}), ht = (e) => e.displayName ?? e.id,
|
|
1197
|
+
}), ht = (e) => e.displayName ?? e.id, Y = (e, t) => {
|
|
1187
1198
|
let n = t.trim().toLowerCase();
|
|
1188
1199
|
return n ? e.filter((e) => ht(e).toLowerCase().includes(n)) : e;
|
|
1189
|
-
},
|
|
1200
|
+
}, X = (e, t, r, i = 18, a) => /* @__PURE__ */ W(n, {
|
|
1190
1201
|
src: e,
|
|
1191
1202
|
size: i,
|
|
1192
1203
|
labels: { tooltip: a },
|
|
1193
1204
|
initialsName: r
|
|
1194
1205
|
}), gt = { searchHeader: "_searchHeader_1728o_1" }, _t = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = gt.searchHeader, colors: a }) => {
|
|
1195
|
-
let [o, l] = V(""), u = z(() => e?.find((e) => e.id === t), [e, t]), d = r?.loading !== void 0, f = !d && !u && !!t, m = z(() => d ? /* @__PURE__ */ W(ft, { size: p.LG }) :
|
|
1206
|
+
let [o, l] = V(""), u = z(() => e?.find((e) => e.id === t), [e, t]), d = r?.loading !== void 0, f = !d && !u && !!t, m = z(() => d ? /* @__PURE__ */ W(ft, { size: p.LG }) : X(u?.iconUrl, u?.type, u?.displayName ?? u?.id ?? "", p.LG, f ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
|
|
1196
1207
|
d,
|
|
1197
1208
|
u,
|
|
1198
1209
|
f,
|
|
@@ -1218,16 +1229,17 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1218
1229
|
disabled: !0
|
|
1219
1230
|
}] : [];
|
|
1220
1231
|
}
|
|
1221
|
-
return
|
|
1232
|
+
return Y(e, o).map((e) => ({
|
|
1222
1233
|
key: e.id,
|
|
1223
1234
|
label: /* @__PURE__ */ W(y, {
|
|
1224
1235
|
text: ht(e),
|
|
1225
1236
|
query: o,
|
|
1226
1237
|
maxLines: 1
|
|
1227
1238
|
}),
|
|
1228
|
-
icon:
|
|
1239
|
+
icon: X(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1229
1240
|
mark: b.Check,
|
|
1230
1241
|
checked: e.id === t,
|
|
1242
|
+
className: c(K.modelMenuItem, e.id === t && K.modelMenuItemSelected),
|
|
1231
1243
|
onClick: () => n?.(e.id)
|
|
1232
1244
|
}));
|
|
1233
1245
|
}, [
|
|
@@ -1240,7 +1252,7 @@ var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1240
1252
|
]),
|
|
1241
1253
|
menuHeader: z(() => !d && e && e.length > 0 ? /* @__PURE__ */ W("div", {
|
|
1242
1254
|
style: s({ "--ms-search-header-bg": a?.searchHeaderBackground }),
|
|
1243
|
-
className: c("sticky top-0 z-10 pb-1 pe-2 pt-2", i),
|
|
1255
|
+
className: c("sticky top-0 z-10 pb-1 pe-2 pt-2", i, K.modelMenuSearch),
|
|
1244
1256
|
children: /* @__PURE__ */ W(O, {
|
|
1245
1257
|
value: o,
|
|
1246
1258
|
placeholder: r?.searchPlaceholder ?? "Search",
|
|
@@ -1314,18 +1326,18 @@ function xt(e) {
|
|
|
1314
1326
|
t.current = e;
|
|
1315
1327
|
}, [e]), L((e) => t.current?.(e), [t]);
|
|
1316
1328
|
}
|
|
1317
|
-
var
|
|
1318
|
-
function
|
|
1319
|
-
if (
|
|
1329
|
+
var Z = null;
|
|
1330
|
+
function Q(e = !1) {
|
|
1331
|
+
if (Z === null || e) {
|
|
1320
1332
|
let e = document.createElement("div"), t = e.style;
|
|
1321
1333
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
1322
1334
|
let n = document.createElement("div"), r = n.style;
|
|
1323
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1335
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? Z = "positive-descending" : (e.scrollLeft = 1, Z = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), Z;
|
|
1324
1336
|
}
|
|
1325
|
-
return
|
|
1337
|
+
return Z;
|
|
1326
1338
|
}
|
|
1327
|
-
function
|
|
1328
|
-
if (t === "horizontal" && n) switch (
|
|
1339
|
+
function $({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1340
|
+
if (t === "horizontal" && n) switch (Q()) {
|
|
1329
1341
|
case "negative": return -r;
|
|
1330
1342
|
case "positive-descending":
|
|
1331
1343
|
if (e) {
|
|
@@ -1336,26 +1348,26 @@ function Q({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1336
1348
|
}
|
|
1337
1349
|
return r;
|
|
1338
1350
|
}
|
|
1339
|
-
function
|
|
1351
|
+
function St(e, t = "Assertion error") {
|
|
1340
1352
|
if (!e) throw console.error(t), Error(t);
|
|
1341
1353
|
}
|
|
1342
|
-
function
|
|
1354
|
+
function Ct(e, t) {
|
|
1343
1355
|
if (e === t) return !0;
|
|
1344
|
-
if (!!e != !!t || (
|
|
1356
|
+
if (!!e != !!t || (St(e !== void 0), St(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1345
1357
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1346
1358
|
return !0;
|
|
1347
1359
|
}
|
|
1348
|
-
function
|
|
1360
|
+
function wt({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1349
1361
|
if (t === 0) return 0;
|
|
1350
1362
|
if (typeof n == "number") return t * n;
|
|
1351
1363
|
{
|
|
1352
1364
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
1353
|
-
return
|
|
1365
|
+
return St(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1354
1366
|
}
|
|
1355
1367
|
}
|
|
1356
|
-
function
|
|
1368
|
+
function Tt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1357
1369
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1358
|
-
let s =
|
|
1370
|
+
let s = wt({
|
|
1359
1371
|
cachedBounds: t,
|
|
1360
1372
|
itemCount: r,
|
|
1361
1373
|
itemSize: i
|
|
@@ -1367,7 +1379,7 @@ function wt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
1367
1379
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
1368
1380
|
}
|
|
1369
1381
|
}
|
|
1370
|
-
function
|
|
1382
|
+
function Et({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1371
1383
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
1372
1384
|
for (; u < a;) {
|
|
1373
1385
|
let n = e.get(u);
|
|
@@ -1386,11 +1398,11 @@ function Tt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
1386
1398
|
stopIndexOverscan: l
|
|
1387
1399
|
};
|
|
1388
1400
|
}
|
|
1389
|
-
function
|
|
1401
|
+
function Dt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1390
1402
|
let r = /* @__PURE__ */ new Map();
|
|
1391
1403
|
return {
|
|
1392
1404
|
get(i) {
|
|
1393
|
-
for (
|
|
1405
|
+
for (St(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
|
|
1394
1406
|
let e = r.size, a;
|
|
1395
1407
|
switch (typeof n) {
|
|
1396
1408
|
case "function":
|
|
@@ -1406,14 +1418,14 @@ function Et({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1406
1418
|
});
|
|
1407
1419
|
else {
|
|
1408
1420
|
let t = r.get(e - 1);
|
|
1409
|
-
|
|
1421
|
+
St(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
1410
1422
|
scrollOffset: t.scrollOffset + t.size,
|
|
1411
1423
|
size: a
|
|
1412
1424
|
});
|
|
1413
1425
|
}
|
|
1414
1426
|
}
|
|
1415
1427
|
let a = r.get(i);
|
|
1416
|
-
return
|
|
1428
|
+
return St(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
1417
1429
|
},
|
|
1418
1430
|
set(e, t) {
|
|
1419
1431
|
r.set(e, t);
|
|
@@ -1423,8 +1435,8 @@ function Et({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1423
1435
|
}
|
|
1424
1436
|
};
|
|
1425
1437
|
}
|
|
1426
|
-
function
|
|
1427
|
-
return z(() =>
|
|
1438
|
+
function Ot({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1439
|
+
return z(() => Dt({
|
|
1428
1440
|
itemCount: e,
|
|
1429
1441
|
itemProps: t,
|
|
1430
1442
|
itemSize: n
|
|
@@ -1434,11 +1446,11 @@ function Dt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1434
1446
|
n
|
|
1435
1447
|
]);
|
|
1436
1448
|
}
|
|
1437
|
-
function
|
|
1449
|
+
function kt({ containerSize: e, itemSize: t }) {
|
|
1438
1450
|
let n;
|
|
1439
1451
|
switch (typeof t) {
|
|
1440
1452
|
case "string":
|
|
1441
|
-
|
|
1453
|
+
St(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), St(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
|
|
1442
1454
|
break;
|
|
1443
1455
|
default:
|
|
1444
1456
|
n = t;
|
|
@@ -1446,7 +1458,7 @@ function Ot({ containerSize: e, itemSize: t }) {
|
|
|
1446
1458
|
}
|
|
1447
1459
|
return n;
|
|
1448
1460
|
}
|
|
1449
|
-
function
|
|
1461
|
+
function At({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1450
1462
|
let { height: u = n, width: d = n } = bt({
|
|
1451
1463
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1452
1464
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
@@ -1456,7 +1468,7 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1456
1468
|
}), f = B({
|
|
1457
1469
|
height: 0,
|
|
1458
1470
|
width: 0
|
|
1459
|
-
}), p = r === "vertical" ? u : d, m =
|
|
1471
|
+
}), p = r === "vertical" ? u : d, m = kt({
|
|
1460
1472
|
containerSize: p,
|
|
1461
1473
|
itemSize: s
|
|
1462
1474
|
});
|
|
@@ -1473,11 +1485,11 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1473
1485
|
c,
|
|
1474
1486
|
d
|
|
1475
1487
|
]);
|
|
1476
|
-
let h =
|
|
1488
|
+
let h = Ot({
|
|
1477
1489
|
itemCount: a,
|
|
1478
1490
|
itemProps: o,
|
|
1479
1491
|
itemSize: m
|
|
1480
|
-
}), g = L((e) => h.get(e), [h]), [_, v] = V(() =>
|
|
1492
|
+
}), g = L((e) => h.get(e), [h]), [_, v] = V(() => Et({
|
|
1481
1493
|
cachedBounds: h,
|
|
1482
1494
|
containerScrollOffset: 0,
|
|
1483
1495
|
containerSize: p,
|
|
@@ -1488,7 +1500,7 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1488
1500
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1489
1501
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1490
1502
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1491
|
-
}, C = L(() =>
|
|
1503
|
+
}, C = L(() => wt({
|
|
1492
1504
|
cachedBounds: h,
|
|
1493
1505
|
itemCount: a,
|
|
1494
1506
|
itemSize: m
|
|
@@ -1496,9 +1508,9 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1496
1508
|
h,
|
|
1497
1509
|
a,
|
|
1498
1510
|
m
|
|
1499
|
-
]), w = L((t) =>
|
|
1511
|
+
]), w = L((t) => Et({
|
|
1500
1512
|
cachedBounds: h,
|
|
1501
|
-
containerScrollOffset:
|
|
1513
|
+
containerScrollOffset: $({
|
|
1502
1514
|
containerElement: e,
|
|
1503
1515
|
direction: r,
|
|
1504
1516
|
isRtl: i,
|
|
@@ -1526,9 +1538,9 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1526
1538
|
if (!e) return;
|
|
1527
1539
|
let t = () => {
|
|
1528
1540
|
v((t) => {
|
|
1529
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
1541
|
+
let { scrollLeft: n, scrollTop: o } = e, s = Et({
|
|
1530
1542
|
cachedBounds: h,
|
|
1531
|
-
containerScrollOffset:
|
|
1543
|
+
containerScrollOffset: $({
|
|
1532
1544
|
containerElement: e,
|
|
1533
1545
|
direction: r,
|
|
1534
1546
|
isRtl: i,
|
|
@@ -1538,7 +1550,7 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1538
1550
|
itemCount: a,
|
|
1539
1551
|
overscanCount: l
|
|
1540
1552
|
});
|
|
1541
|
-
return
|
|
1553
|
+
return Ct(s, t) ? t : s;
|
|
1542
1554
|
});
|
|
1543
1555
|
};
|
|
1544
1556
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1555,7 +1567,7 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1555
1567
|
getCellBounds: g,
|
|
1556
1568
|
getEstimatedSize: C,
|
|
1557
1569
|
scrollToIndex: xt(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1558
|
-
let s =
|
|
1570
|
+
let s = Tt({
|
|
1559
1571
|
align: t,
|
|
1560
1572
|
cachedBounds: h,
|
|
1561
1573
|
containerScrollOffset: n,
|
|
@@ -1565,14 +1577,14 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1565
1577
|
itemSize: m
|
|
1566
1578
|
});
|
|
1567
1579
|
if (e) {
|
|
1568
|
-
if (s =
|
|
1580
|
+
if (s = $({
|
|
1569
1581
|
containerElement: e,
|
|
1570
1582
|
direction: r,
|
|
1571
1583
|
isRtl: i,
|
|
1572
1584
|
scrollOffset: s
|
|
1573
1585
|
}), typeof e.scrollTo != "function") {
|
|
1574
1586
|
let e = w(s);
|
|
1575
|
-
|
|
1587
|
+
Ct(_, e) || v(e);
|
|
1576
1588
|
}
|
|
1577
1589
|
return s;
|
|
1578
1590
|
}
|
|
@@ -1583,19 +1595,19 @@ function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1583
1595
|
stopIndexVisible: x
|
|
1584
1596
|
};
|
|
1585
1597
|
}
|
|
1586
|
-
function
|
|
1598
|
+
function jt(e) {
|
|
1587
1599
|
return z(() => e, Object.values(e));
|
|
1588
1600
|
}
|
|
1589
|
-
function
|
|
1601
|
+
function Mt(e, t) {
|
|
1590
1602
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1591
|
-
return
|
|
1603
|
+
return Ct(n, a) && Ct(r, o) && Ct(i, s);
|
|
1592
1604
|
}
|
|
1593
|
-
function
|
|
1605
|
+
function Nt(e) {
|
|
1594
1606
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1595
1607
|
}
|
|
1596
|
-
var
|
|
1597
|
-
function
|
|
1598
|
-
let m =
|
|
1608
|
+
var Pt = "data-react-window-index";
|
|
1609
|
+
function Ft({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
|
|
1610
|
+
let m = jt(u), h = z(() => he(s, Mt), [s]), [g, _] = V(null), v = Nt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = At({
|
|
1599
1611
|
containerElement: g,
|
|
1600
1612
|
containerStyle: f,
|
|
1601
1613
|
defaultContainerSize: n,
|
|
@@ -1626,7 +1638,7 @@ function Pt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1626
1638
|
let e = Array.from(g.children).filter((e, t) => {
|
|
1627
1639
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
1628
1640
|
let n = `${S + t}`;
|
|
1629
|
-
return e.setAttribute(
|
|
1641
|
+
return e.setAttribute(Pt, n), !0;
|
|
1630
1642
|
});
|
|
1631
1643
|
if (v) return l.observeRowElements(e);
|
|
1632
1644
|
}, [
|
|
@@ -1703,23 +1715,23 @@ function Pt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1703
1715
|
}
|
|
1704
1716
|
}, E, e, D);
|
|
1705
1717
|
}
|
|
1706
|
-
var
|
|
1718
|
+
var It = {
|
|
1707
1719
|
divider: "_divider_1tiyp_1",
|
|
1708
1720
|
item: "_item_1tiyp_5",
|
|
1709
1721
|
itemIcon: "_itemIcon_1tiyp_15",
|
|
1710
1722
|
checkIcon: "_checkIcon_1tiyp_19",
|
|
1711
1723
|
stateLabel: "_stateLabel_1tiyp_23"
|
|
1712
|
-
},
|
|
1713
|
-
let l = r[e], u =
|
|
1724
|
+
}, Lt = 44, Rt = 8, zt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, onSelect: s }) => {
|
|
1725
|
+
let l = r[e], u = X(l.iconUrl, l.type, l.displayName ?? l.id, p.SM), f = l.id === i;
|
|
1714
1726
|
return /* @__PURE__ */ W("div", {
|
|
1715
1727
|
style: t,
|
|
1716
1728
|
...n,
|
|
1717
1729
|
children: /* @__PURE__ */ W(d, {
|
|
1718
1730
|
type: "button",
|
|
1719
1731
|
"aria-current": f ? "true" : void 0,
|
|
1720
|
-
className: c(
|
|
1732
|
+
className: c(It.item, "h-full w-full gap-3 px-4"),
|
|
1721
1733
|
iconBefore: /* @__PURE__ */ W("span", {
|
|
1722
|
-
className:
|
|
1734
|
+
className: It.itemIcon,
|
|
1723
1735
|
children: u
|
|
1724
1736
|
}),
|
|
1725
1737
|
label: /* @__PURE__ */ G("span", {
|
|
@@ -1731,7 +1743,7 @@ var Ft = {
|
|
|
1731
1743
|
className: c(a, "min-w-0 flex-1 text-start")
|
|
1732
1744
|
}), f && /* @__PURE__ */ W(P, {
|
|
1733
1745
|
size: p.SM,
|
|
1734
|
-
className:
|
|
1746
|
+
className: It.checkIcon,
|
|
1735
1747
|
"aria-hidden": !0,
|
|
1736
1748
|
stroke: m
|
|
1737
1749
|
})]
|
|
@@ -1739,12 +1751,12 @@ var Ft = {
|
|
|
1739
1751
|
onClick: () => s(l.id)
|
|
1740
1752
|
})
|
|
1741
1753
|
});
|
|
1742
|
-
},
|
|
1754
|
+
}, Bt = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: _ }) => {
|
|
1743
1755
|
let [v, y] = V("");
|
|
1744
1756
|
R(() => {
|
|
1745
1757
|
e || y("");
|
|
1746
1758
|
}, [e]);
|
|
1747
|
-
let b = a && a.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ?
|
|
1759
|
+
let b = a && a.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ? Y(a, v) : [], w = (e) => {
|
|
1748
1760
|
l(e), i();
|
|
1749
1761
|
}, T = s({
|
|
1750
1762
|
"--ci-sheet-divider": _?.divider,
|
|
@@ -1761,7 +1773,7 @@ var Ft = {
|
|
|
1761
1773
|
onClose: i,
|
|
1762
1774
|
style: p,
|
|
1763
1775
|
titleClassName: m,
|
|
1764
|
-
className: "max-h-[80dvh]",
|
|
1776
|
+
className: c("max-h-[80dvh]", K.modelMenu),
|
|
1765
1777
|
colors: _?.shell,
|
|
1766
1778
|
children: /* @__PURE__ */ G("div", {
|
|
1767
1779
|
className: "contents",
|
|
@@ -1774,17 +1786,17 @@ var Ft = {
|
|
|
1774
1786
|
size: g.Standard,
|
|
1775
1787
|
onChange: (e) => y(e ?? "")
|
|
1776
1788
|
})
|
|
1777
|
-
}), /* @__PURE__ */ W("div", { className: c(
|
|
1789
|
+
}), /* @__PURE__ */ W("div", { className: c(It.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ W(mt, { loadingLabel: u }) : S ? /* @__PURE__ */ W("div", {
|
|
1778
1790
|
role: "list",
|
|
1779
|
-
className: c(
|
|
1791
|
+
className: c(It.stateLabel, h, "px-4 py-4"),
|
|
1780
1792
|
children: S
|
|
1781
|
-
}) : /* @__PURE__ */ W(
|
|
1793
|
+
}) : /* @__PURE__ */ W(Ft, {
|
|
1782
1794
|
role: "list",
|
|
1783
1795
|
className: "overflow-y-auto",
|
|
1784
|
-
style: { height: Math.min(C.length,
|
|
1785
|
-
rowComponent:
|
|
1796
|
+
style: { height: Math.min(C.length, Rt) * Lt },
|
|
1797
|
+
rowComponent: zt,
|
|
1786
1798
|
rowCount: C.length,
|
|
1787
|
-
rowHeight:
|
|
1799
|
+
rowHeight: Lt,
|
|
1788
1800
|
rowProps: {
|
|
1789
1801
|
items: C,
|
|
1790
1802
|
selectedDeploymentId: o,
|
|
@@ -1795,7 +1807,7 @@ var Ft = {
|
|
|
1795
1807
|
})]
|
|
1796
1808
|
})
|
|
1797
1809
|
});
|
|
1798
|
-
},
|
|
1810
|
+
}, Vt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: l, modelPickerOverlay: u, isPickerOpen: d, onPickerToggle: f, onPickerOpenChange: g }) => {
|
|
1799
1811
|
let [_, y] = V(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, selectedVersion: C, menuItems: w, menuHeader: T, onOpenChange: E } = _t({
|
|
1800
1812
|
deployments: e,
|
|
1801
1813
|
selectedDeploymentId: t,
|
|
@@ -1805,11 +1817,11 @@ var Ft = {
|
|
|
1805
1817
|
if (!e) return null;
|
|
1806
1818
|
let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ W(F, {
|
|
1807
1819
|
size: p.SM,
|
|
1808
|
-
className:
|
|
1820
|
+
className: J.modelSelectorCaret,
|
|
1809
1821
|
"aria-hidden": !0,
|
|
1810
1822
|
stroke: m
|
|
1811
1823
|
});
|
|
1812
|
-
|
|
1824
|
+
if (a) return /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(N, {
|
|
1813
1825
|
tooltip: S,
|
|
1814
1826
|
children: /* @__PURE__ */ W(v, {
|
|
1815
1827
|
icon: /* @__PURE__ */ G("div", {
|
|
@@ -1820,7 +1832,7 @@ var Ft = {
|
|
|
1820
1832
|
onClick: () => {
|
|
1821
1833
|
s || y(!0);
|
|
1822
1834
|
},
|
|
1823
|
-
className: c("w-[50px]",
|
|
1835
|
+
className: c("w-[50px]", J.modelSelectorButton, D, K.modelSelectorButton)
|
|
1824
1836
|
})
|
|
1825
1837
|
}), u ? /* @__PURE__ */ W(Te, {
|
|
1826
1838
|
isOpen: _,
|
|
@@ -1828,8 +1840,9 @@ var Ft = {
|
|
|
1828
1840
|
closeLabel: r?.closeLabel ?? "Close",
|
|
1829
1841
|
onClose: () => y(!1),
|
|
1830
1842
|
style: l,
|
|
1843
|
+
className: K.modelMenu,
|
|
1831
1844
|
children: u(() => y(!1))
|
|
1832
|
-
}) : /* @__PURE__ */ W(
|
|
1845
|
+
}) : /* @__PURE__ */ W(Bt, {
|
|
1833
1846
|
isOpen: _,
|
|
1834
1847
|
title: r?.ariaLabel ?? "Select model",
|
|
1835
1848
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -1842,42 +1855,47 @@ var Ft = {
|
|
|
1842
1855
|
errorLabel: r?.error,
|
|
1843
1856
|
emptyLabel: r?.empty,
|
|
1844
1857
|
style: l
|
|
1845
|
-
})] })
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1858
|
+
})] });
|
|
1859
|
+
if (u) {
|
|
1860
|
+
let e = C ? `${S} · ${C}` : S;
|
|
1861
|
+
return /* @__PURE__ */ W(h, {
|
|
1862
|
+
placement: "top-end",
|
|
1863
|
+
matchReferenceWidth: !1,
|
|
1864
|
+
open: d,
|
|
1865
|
+
onOpenChange: g,
|
|
1866
|
+
trigger: [],
|
|
1867
|
+
outsideClosable: !0,
|
|
1868
|
+
renderOverlay: () => u(() => g?.(!1)),
|
|
1869
|
+
listClassName: c("!w-[368px] !bg-layer-raised", K.modelMenu),
|
|
1870
|
+
children: /* @__PURE__ */ W(N, {
|
|
1871
|
+
tooltip: e,
|
|
1872
|
+
children: /* @__PURE__ */ G("button", {
|
|
1873
|
+
type: "button",
|
|
1874
|
+
"aria-label": x,
|
|
1875
|
+
"aria-disabled": s || void 0,
|
|
1876
|
+
className: c("flex min-w-0 items-center gap-1.5 rounded-full py-1.5 pe-2 ps-1.5", J.modelSelectorButton, D, s && J.modelSelectorButtonDisabled, K.modelSelectorButton),
|
|
1877
|
+
onClick: () => {
|
|
1878
|
+
!i && !s && f?.();
|
|
1879
|
+
},
|
|
1880
|
+
children: [
|
|
1881
|
+
b,
|
|
1882
|
+
/* @__PURE__ */ G("span", {
|
|
1883
|
+
className: "flex min-w-0 max-w-[180px] items-baseline gap-1",
|
|
1884
|
+
children: [/* @__PURE__ */ W("span", {
|
|
1885
|
+
className: c("dial-small-text max-w-[180px] shrink-0 truncate", J.modelSelectorName),
|
|
1886
|
+
children: S
|
|
1887
|
+
}), C && /* @__PURE__ */ W("span", {
|
|
1888
|
+
className: c("dial-tiny-text min-w-0 truncate", J.modelSelectorVersion),
|
|
1889
|
+
children: C
|
|
1890
|
+
})]
|
|
1891
|
+
}),
|
|
1892
|
+
O
|
|
1893
|
+
]
|
|
1894
|
+
})
|
|
1878
1895
|
})
|
|
1879
|
-
})
|
|
1880
|
-
}
|
|
1896
|
+
});
|
|
1897
|
+
}
|
|
1898
|
+
return /* @__PURE__ */ W("div", {
|
|
1881
1899
|
className: c(s && D),
|
|
1882
1900
|
"aria-disabled": s || void 0,
|
|
1883
1901
|
children: /* @__PURE__ */ W(h, {
|
|
@@ -1886,7 +1904,7 @@ var Ft = {
|
|
|
1886
1904
|
placement: "bottom-end",
|
|
1887
1905
|
matchReferenceWidth: !1,
|
|
1888
1906
|
maxDropdownHeight: o,
|
|
1889
|
-
listClassName: "!w-[240px]",
|
|
1907
|
+
listClassName: c("!w-[240px]", K.modelMenu),
|
|
1890
1908
|
disabled: s,
|
|
1891
1909
|
onOpenChange: s ? void 0 : E,
|
|
1892
1910
|
children: /* @__PURE__ */ W(N, {
|
|
@@ -1895,14 +1913,14 @@ var Ft = {
|
|
|
1895
1913
|
type: "button",
|
|
1896
1914
|
"aria-label": x,
|
|
1897
1915
|
"aria-disabled": s || void 0,
|
|
1898
|
-
className: c("flex items-center gap-1 rounded-full p-1.5",
|
|
1916
|
+
className: c("flex items-center gap-1 rounded-full p-1.5", J.modelSelectorButton, s && J.modelSelectorButtonDisabled, K.modelSelectorButton),
|
|
1899
1917
|
children: [b, O]
|
|
1900
1918
|
})
|
|
1901
1919
|
})
|
|
1902
1920
|
})
|
|
1903
1921
|
});
|
|
1904
|
-
},
|
|
1905
|
-
let pt = l(), [mt, ht] = V(!1),
|
|
1922
|
+
}, Ht = ({ message: e = "", messageRevision: t, textInsertion: n, onSend: r, onUploadAttachment: i, onStop: a, isStreaming: o = !1, onChange: d, onAttachmentsChange: f, placeholder: g = "Type a message...", ariaLabel: y, attachLabel: b = "Attach file", fileAccept: x, addMenuTitle: S = "Add", menuTitle: C = "Menu", menuCloseLabel: w = "Close", removeLabel: T, retryLabel: E, uploadingLabel: D, sendLabel: O, sendTooltip: k, stopLabel: ee, micLabel: A = "Dictate", recordVoiceLabel: te = "Record voice", stopRecordingLabel: j, discardRecordingLabel: ne, colors: M, typography: N, className: re, pendingDropFiles: ie = [], onDropFilesConsumed: P, pendingAttachments: F = [], onPendingAttachmentsConsumed: ae, pasteTextThreshold: ce = 4e3, maxMessageLength: I = 5e4, deployments: le, selectedDeploymentId: ue, onDeploymentChange: de, modelSelectorLabels: fe, initialAttachments: pe = [], hideAddButton: me = !1, hideAttachFile: he = !1, hideActionBar: ge = !1, renderFooterActions: _e, isInputDisabled: H = !1, isModelSelectorDisabled: ye = !1, isSendDisabled: be = !1, isAudioMessageSupported: Se = !1, isVoiceRecordingSupported: Ce = Se, onTranscribeAudio: we, transcribingLabel: Te, voiceErrorLabel: Ee, sendOnEnter: Oe = We.Enter, prefixAttachments: Ae = [], onRemovePrefixAttachment: je, chatSettings: Pe, toolsMenuItems: Fe, onToolToggle: ze, canRemoveTools: Be = !0, toolsMenuTitle: Ve, toolsBackLabel: He, toolsChipLabels: Ge, menuOverlays: Ke, inlineStartSlot: qe, onInlineStartRemove: Je, commandMenu: q, autoFocus: Ye = !1, messageHistory: Xe, onDialFileSystemClick: Ze, dialFileSystemLabel: Qe, validateAttachment: $e, onAttachmentClick: et, modelPickerOverlay: nt, maximumAttachmentsAmount: rt, onAttachmentsLimitExceeded: at, isAttachmentsEnabled: ot = !0, isTextAttachmentsAllowed: st = !0, usageLimitsSlot: ct, onMessageTooLong: ft }) => {
|
|
1923
|
+
let pt = l(), [mt, ht] = V(!1), Y = Me(Xe), X = qe != null, [gt, _t] = V(null), [vt, yt] = V(0), bt = z(() => s({
|
|
1906
1924
|
"--ci-bg": M?.background,
|
|
1907
1925
|
"--ci-text": M?.text,
|
|
1908
1926
|
"--ci-border": M?.border,
|
|
@@ -1917,10 +1935,10 @@ var Ft = {
|
|
|
1917
1935
|
"--ci-voice-error": M?.voiceError,
|
|
1918
1936
|
"--ci-voice-waveform": M?.voiceWaveform,
|
|
1919
1937
|
"--ci-voice-accent": M?.voiceAccent,
|
|
1920
|
-
"--ci-first-line-indent":
|
|
1938
|
+
"--ci-first-line-indent": X ? `calc(${vt}px + 4px)` : void 0
|
|
1921
1939
|
}), [
|
|
1922
1940
|
M,
|
|
1923
|
-
|
|
1941
|
+
X,
|
|
1924
1942
|
vt
|
|
1925
1943
|
]), xt = z(() => Ze ? [{
|
|
1926
1944
|
key: "dial-fs",
|
|
@@ -1931,31 +1949,31 @@ var Ft = {
|
|
|
1931
1949
|
stroke: m
|
|
1932
1950
|
}),
|
|
1933
1951
|
onClick: Ze
|
|
1934
|
-
}] : [], [Ze, Qe]), { message:
|
|
1952
|
+
}] : [], [Ze, Qe]), { message: Z, setMessage: Q, textareaRef: $ } = Ne({
|
|
1935
1953
|
messageProp: e,
|
|
1936
1954
|
messageRevision: t
|
|
1937
|
-
}), { handleUndoKeyDown:
|
|
1955
|
+
}), { handleUndoKeyDown: St } = Ie({
|
|
1938
1956
|
insertion: n,
|
|
1939
|
-
textareaRef:
|
|
1940
|
-
}), { isMenuOpen:
|
|
1941
|
-
config:
|
|
1942
|
-
message:
|
|
1943
|
-
}),
|
|
1944
|
-
if (
|
|
1945
|
-
|
|
1946
|
-
let t = `${
|
|
1947
|
-
if (!
|
|
1948
|
-
let n =
|
|
1949
|
-
|
|
1957
|
+
textareaRef: $
|
|
1958
|
+
}), { isMenuOpen: Ct, query: wt, dismiss: Tt, handleValueChange: Et } = ke({
|
|
1959
|
+
config: q,
|
|
1960
|
+
message: Z
|
|
1961
|
+
}), Dt = q?.emptyQueryHint != null, Ot = Dt && Ct && wt === "", kt = L((e) => {
|
|
1962
|
+
if (q == null || (Tt(), !e?.consumeQuery)) return;
|
|
1963
|
+
$.current?.focus();
|
|
1964
|
+
let t = `${q.triggerPrefix}${wt}`;
|
|
1965
|
+
if (!Z.startsWith(t)) return;
|
|
1966
|
+
let n = Z.slice(t.length);
|
|
1967
|
+
Q(n), Y.notifyChange(), d?.(n);
|
|
1950
1968
|
}, [
|
|
1951
|
-
|
|
1969
|
+
q,
|
|
1970
|
+
Tt,
|
|
1952
1971
|
wt,
|
|
1953
|
-
Ct,
|
|
1954
|
-
X,
|
|
1955
1972
|
Z,
|
|
1956
|
-
|
|
1973
|
+
Q,
|
|
1974
|
+
Y,
|
|
1957
1975
|
d,
|
|
1958
|
-
|
|
1976
|
+
$
|
|
1959
1977
|
]);
|
|
1960
1978
|
R(() => {
|
|
1961
1979
|
if (gt == null) return;
|
|
@@ -1965,7 +1983,7 @@ var Ft = {
|
|
|
1965
1983
|
});
|
|
1966
1984
|
return e.observe(gt), () => e.disconnect();
|
|
1967
1985
|
}, [gt]);
|
|
1968
|
-
let { attachments:
|
|
1986
|
+
let { attachments: At, buildAttachments: jt, addAttachments: Mt, resetAttachments: Nt, handleRemove: Pt, handleRetry: Ft, handleExpand: It, hasBlockedAttachments: Lt } = De({
|
|
1969
1987
|
initialAttachments: pe,
|
|
1970
1988
|
onUploadAttachment: i,
|
|
1971
1989
|
onAttachmentsChange: f,
|
|
@@ -1975,171 +1993,171 @@ var Ft = {
|
|
|
1975
1993
|
pendingAttachments: F,
|
|
1976
1994
|
onPendingAttachmentsConsumed: ae,
|
|
1977
1995
|
onExpandPastedText: L((e) => {
|
|
1978
|
-
|
|
1979
|
-
}, [
|
|
1996
|
+
Q((t) => t ? `${t}\n${e}` : e);
|
|
1997
|
+
}, [Q]),
|
|
1980
1998
|
maximumAttachmentsAmount: rt,
|
|
1981
1999
|
baseAttachmentsAmount: Ae.length,
|
|
1982
2000
|
onAttachmentsLimitExceeded: at
|
|
1983
|
-
}),
|
|
1984
|
-
jt(
|
|
1985
|
-
}, [
|
|
1986
|
-
|
|
1987
|
-
let [
|
|
2001
|
+
}), Rt = L((e) => {
|
|
2002
|
+
Mt(jt([e]));
|
|
2003
|
+
}, [Mt, jt]), zt = B(!1), Bt = B(Z);
|
|
2004
|
+
Bt.current = Z;
|
|
2005
|
+
let [Ht, Ut] = V({
|
|
1988
2006
|
text: "",
|
|
1989
2007
|
revision: 0
|
|
1990
|
-
}), { state:
|
|
1991
|
-
onAttachAudio:
|
|
2008
|
+
}), { state: Wt, analyserNodeRef: Gt, errorMessage: Kt, startRecording: qt, stopRecording: Jt, discardRecording: Yt } = Ue({
|
|
2009
|
+
onAttachAudio: Rt,
|
|
1992
2010
|
onTranscribeAudio: we,
|
|
1993
2011
|
onTranscript: L((e) => {
|
|
1994
2012
|
let t = e.trim();
|
|
1995
2013
|
if (t) {
|
|
1996
|
-
let e =
|
|
1997
|
-
|
|
2014
|
+
let e = Bt.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
|
|
2015
|
+
Bt.current = n, Q(n), Ut((e) => ({
|
|
1998
2016
|
text: t,
|
|
1999
2017
|
revision: e.revision + 1
|
|
2000
|
-
})),
|
|
2018
|
+
})), Y.notifyChange(), d?.(n);
|
|
2001
2019
|
}
|
|
2002
|
-
|
|
2020
|
+
zt.current = !0;
|
|
2003
2021
|
}, [
|
|
2004
|
-
|
|
2005
|
-
|
|
2022
|
+
Q,
|
|
2023
|
+
Y,
|
|
2006
2024
|
d
|
|
2007
2025
|
]),
|
|
2008
2026
|
errorLabel: Ee
|
|
2009
|
-
}),
|
|
2027
|
+
}), Xt = Wt === Le.Recording || Wt === Le.Processing;
|
|
2010
2028
|
R(() => {
|
|
2011
|
-
(
|
|
2012
|
-
}, [
|
|
2013
|
-
let
|
|
2014
|
-
if (
|
|
2029
|
+
(Wt === Le.Error || Wt === Le.Idle && zt.current) && (zt.current = !1, $.current?.focus());
|
|
2030
|
+
}, [Wt, $]);
|
|
2031
|
+
let Zt = B(null), Qt = B(null), $t = ot && st, { handlePaste: en } = xe(Mt, $t ? ce : Infinity), tn = L((e) => {
|
|
2032
|
+
if (!$t) {
|
|
2015
2033
|
let t = e.clipboardData.getData("text/plain");
|
|
2016
2034
|
t.length >= I && ft?.(t.length, I);
|
|
2017
2035
|
}
|
|
2018
|
-
|
|
2036
|
+
en(e);
|
|
2019
2037
|
}, [
|
|
2020
|
-
|
|
2038
|
+
$t,
|
|
2021
2039
|
I,
|
|
2022
2040
|
ft,
|
|
2023
|
-
|
|
2024
|
-
]),
|
|
2041
|
+
en
|
|
2042
|
+
]), nn = (Z.trim().length > 0 || At.length > 0 || X) && !Lt && !be && !Xt, [rn, an] = V([]);
|
|
2025
2043
|
R(() => {
|
|
2026
|
-
|
|
2044
|
+
an([]);
|
|
2027
2045
|
}, [(Fe ?? []).map((e) => e.id).join("|")]);
|
|
2028
|
-
let
|
|
2046
|
+
let on = z(() => {
|
|
2029
2047
|
let e = Fe ?? [];
|
|
2030
|
-
return Be ? e.filter((e) => e.isSelected || !
|
|
2048
|
+
return Be ? e.filter((e) => e.isSelected || !rn.includes(e.id)) : e;
|
|
2031
2049
|
}, [
|
|
2032
2050
|
Fe,
|
|
2033
|
-
|
|
2051
|
+
rn,
|
|
2034
2052
|
Be
|
|
2035
|
-
]),
|
|
2036
|
-
|
|
2037
|
-
}, [Fe, ze]),
|
|
2038
|
-
if (be ||
|
|
2039
|
-
if (
|
|
2040
|
-
ft?.(
|
|
2053
|
+
]), sn = L((e) => {
|
|
2054
|
+
an((t) => t.includes(e) ? t : [...t, e]), Fe?.find((t) => t.id === e)?.isSelected && ze?.(e);
|
|
2055
|
+
}, [Fe, ze]), cn = le === void 0 || ue != null, ln = Se && !o, un = async () => {
|
|
2056
|
+
if (be || Xt) return;
|
|
2057
|
+
if (Z.length >= I) {
|
|
2058
|
+
ft?.(Z.length, I);
|
|
2041
2059
|
return;
|
|
2042
2060
|
}
|
|
2043
|
-
let e =
|
|
2044
|
-
|
|
2061
|
+
let e = Z, t = At;
|
|
2062
|
+
Q(""), Y.reset();
|
|
2045
2063
|
try {
|
|
2046
2064
|
await r?.(e, t), t.forEach((e) => {
|
|
2047
2065
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
2048
|
-
}),
|
|
2066
|
+
}), Nt([]);
|
|
2049
2067
|
} catch {
|
|
2050
|
-
|
|
2068
|
+
Q(e), Nt(t);
|
|
2051
2069
|
}
|
|
2052
|
-
},
|
|
2053
|
-
if (!
|
|
2070
|
+
}, dn = (e) => {
|
|
2071
|
+
if (!Xt && !St(e)) {
|
|
2054
2072
|
if (!e.nativeEvent.isComposing && !H && !o) {
|
|
2055
2073
|
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
2056
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
2074
|
+
let t = e.currentTarget.selectionStart ?? 0, n = Y.navigate(e.key === "ArrowUp" ? "up" : "down", Z, t);
|
|
2057
2075
|
if (n !== null) {
|
|
2058
|
-
e.preventDefault(),
|
|
2076
|
+
e.preventDefault(), Q(n);
|
|
2059
2077
|
return;
|
|
2060
2078
|
}
|
|
2061
2079
|
}
|
|
2062
|
-
if (e.key === "Backspace" &&
|
|
2080
|
+
if (e.key === "Backspace" && X && Je != null && e.currentTarget.selectionStart === 0 && e.currentTarget.selectionEnd === 0) {
|
|
2063
2081
|
e.preventDefault(), Je();
|
|
2064
2082
|
return;
|
|
2065
2083
|
}
|
|
2066
2084
|
}
|
|
2067
|
-
e.key === "Enter" && (Oe === We.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !o &&
|
|
2085
|
+
e.key === "Enter" && (Oe === We.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !o && nn && cn && !H && un());
|
|
2068
2086
|
}
|
|
2069
|
-
},
|
|
2087
|
+
}, fn = (e) => {
|
|
2070
2088
|
let t = Array.from(e.target.files ?? []);
|
|
2071
2089
|
if (t.length === 0) return;
|
|
2072
|
-
let n =
|
|
2073
|
-
e.target.value = "",
|
|
2074
|
-
},
|
|
2075
|
-
className: c(
|
|
2076
|
-
ref:
|
|
2090
|
+
let n = jt(t);
|
|
2091
|
+
e.target.value = "", Mt(n);
|
|
2092
|
+
}, pn = /* @__PURE__ */ W("textarea", {
|
|
2093
|
+
className: c(J.textarea, X && J.textareaIndented, N?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
|
|
2094
|
+
ref: $,
|
|
2077
2095
|
autoFocus: Ye,
|
|
2078
|
-
value:
|
|
2096
|
+
value: Z,
|
|
2079
2097
|
onChange: (e) => {
|
|
2080
|
-
|
|
2098
|
+
Q(e.target.value), Y.notifyChange();
|
|
2081
2099
|
let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
|
|
2082
|
-
|
|
2100
|
+
Et(e.target.value, t?.isComposing ?? !1, t?.inputType), d?.(e.target.value);
|
|
2083
2101
|
},
|
|
2084
|
-
onKeyDown:
|
|
2085
|
-
onPaste:
|
|
2086
|
-
placeholder:
|
|
2102
|
+
onKeyDown: dn,
|
|
2103
|
+
onPaste: tn,
|
|
2104
|
+
placeholder: X ? void 0 : g,
|
|
2087
2105
|
"aria-label": y,
|
|
2088
2106
|
disabled: H,
|
|
2089
|
-
readOnly:
|
|
2107
|
+
readOnly: Xt,
|
|
2090
2108
|
rows: 1
|
|
2091
|
-
}),
|
|
2109
|
+
}), mn = q == null ? pn : /* @__PURE__ */ W(h, {
|
|
2092
2110
|
className: "w-full",
|
|
2093
|
-
open:
|
|
2111
|
+
open: Ct,
|
|
2094
2112
|
onOpenChange: (e) => {
|
|
2095
|
-
e ||
|
|
2113
|
+
e || Tt();
|
|
2096
2114
|
},
|
|
2097
2115
|
placement: "top-start",
|
|
2098
2116
|
trigger: [],
|
|
2099
2117
|
initialFocus: -1,
|
|
2100
2118
|
matchReferenceWidth: !1,
|
|
2101
|
-
outsidePressIgnoreRef:
|
|
2119
|
+
outsidePressIgnoreRef: $,
|
|
2102
2120
|
renderOverlay: () => {
|
|
2103
|
-
let e =
|
|
2104
|
-
query:
|
|
2105
|
-
close:
|
|
2121
|
+
let e = q.renderMenu({
|
|
2122
|
+
query: wt,
|
|
2123
|
+
close: kt
|
|
2106
2124
|
});
|
|
2107
|
-
return
|
|
2125
|
+
return q.menuLabel == null ? e : /* @__PURE__ */ W("div", {
|
|
2108
2126
|
role: "group",
|
|
2109
|
-
"aria-label":
|
|
2127
|
+
"aria-label": q.menuLabel,
|
|
2110
2128
|
children: e
|
|
2111
2129
|
});
|
|
2112
2130
|
},
|
|
2113
|
-
children:
|
|
2114
|
-
}),
|
|
2131
|
+
children: pn
|
|
2132
|
+
}), hn = X || Dt ? /* @__PURE__ */ G("div", {
|
|
2115
2133
|
className: "relative w-full",
|
|
2116
2134
|
children: [
|
|
2117
|
-
|
|
2135
|
+
X && /* @__PURE__ */ W("div", {
|
|
2118
2136
|
ref: _t,
|
|
2119
2137
|
className: "absolute start-0 top-0",
|
|
2120
2138
|
children: qe
|
|
2121
2139
|
}),
|
|
2122
|
-
|
|
2123
|
-
className: c(
|
|
2140
|
+
Ot && q != null && /* @__PURE__ */ G("span", {
|
|
2141
|
+
className: c(J.commandHint, "pointer-events-none absolute start-[var(--ci-first-line-indent,0px)] top-0", N?.fontClassName || "dial-body-paragraph-text"),
|
|
2124
2142
|
"aria-hidden": !0,
|
|
2125
2143
|
children: [/* @__PURE__ */ W("span", {
|
|
2126
2144
|
className: "invisible",
|
|
2127
|
-
children:
|
|
2128
|
-
}),
|
|
2145
|
+
children: q.triggerPrefix
|
|
2146
|
+
}), q.emptyQueryHint]
|
|
2129
2147
|
}),
|
|
2130
|
-
|
|
2148
|
+
mn
|
|
2131
2149
|
]
|
|
2132
|
-
}) :
|
|
2133
|
-
onAttachClick: he ? void 0 : () =>
|
|
2150
|
+
}) : mn, gn = me ? void 0 : /* @__PURE__ */ W(tt, {
|
|
2151
|
+
onAttachClick: he ? void 0 : () => Zt.current?.click(),
|
|
2134
2152
|
attachLabel: b,
|
|
2135
2153
|
addMenuTitle: S,
|
|
2136
2154
|
menuTitle: C,
|
|
2137
2155
|
menuCloseLabel: w,
|
|
2138
2156
|
style: bt,
|
|
2139
|
-
isDisabled: H ||
|
|
2157
|
+
isDisabled: H || Xt,
|
|
2140
2158
|
chatSettings: Pe,
|
|
2141
2159
|
extraMenuItems: xt,
|
|
2142
|
-
onRecordVoice: Ce && ot && !o && !
|
|
2160
|
+
onRecordVoice: Ce && ot && !o && !Xt ? () => qt(Re.Attachment) : void 0,
|
|
2143
2161
|
recordVoiceLabel: te,
|
|
2144
2162
|
toolsMenuItems: Be ? Fe : void 0,
|
|
2145
2163
|
onToolToggle: ze,
|
|
@@ -2148,83 +2166,83 @@ var Ft = {
|
|
|
2148
2166
|
menuOverlays: Ke
|
|
2149
2167
|
});
|
|
2150
2168
|
return /* @__PURE__ */ G("div", {
|
|
2151
|
-
ref:
|
|
2169
|
+
ref: Qt,
|
|
2152
2170
|
style: bt,
|
|
2153
|
-
className: c(
|
|
2171
|
+
className: c(J.wrapper, H && J.wrapperDisabled, H && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", At.length > 6 ? "py-4 ps-4" : "p-4", re, K.wrapper),
|
|
2154
2172
|
children: [
|
|
2155
|
-
(Ae.length > 0 ||
|
|
2156
|
-
attachments: [...Ae, ...
|
|
2173
|
+
(Ae.length > 0 || At.length > 0) && /* @__PURE__ */ W(ve, {
|
|
2174
|
+
attachments: [...Ae, ...At],
|
|
2157
2175
|
onRemove: (e) => {
|
|
2158
|
-
Ae.some((t) => t.id === e) ? je?.(e) :
|
|
2176
|
+
Ae.some((t) => t.id === e) ? je?.(e) : Pt(e);
|
|
2159
2177
|
},
|
|
2160
|
-
onRetry:
|
|
2161
|
-
onExpand:
|
|
2178
|
+
onRetry: Ft,
|
|
2179
|
+
onExpand: It,
|
|
2162
2180
|
labels: {
|
|
2163
2181
|
removeLabel: T,
|
|
2164
2182
|
retryLabel: E,
|
|
2165
2183
|
uploadingLabel: D
|
|
2166
2184
|
},
|
|
2167
2185
|
onAttachmentClick: et == null ? void 0 : (e) => {
|
|
2168
|
-
let t = [...Ae, ...
|
|
2186
|
+
let t = [...Ae, ...At].find((t) => t.id === e);
|
|
2169
2187
|
t != null && et(t);
|
|
2170
2188
|
}
|
|
2171
2189
|
}),
|
|
2172
2190
|
!me && /* @__PURE__ */ W("input", {
|
|
2173
|
-
ref:
|
|
2191
|
+
ref: Zt,
|
|
2174
2192
|
type: "file",
|
|
2175
2193
|
multiple: !0,
|
|
2176
2194
|
accept: x,
|
|
2177
2195
|
className: "sr-only",
|
|
2178
2196
|
"aria-hidden": !0,
|
|
2179
2197
|
tabIndex: -1,
|
|
2180
|
-
onChange:
|
|
2198
|
+
onChange: fn
|
|
2181
2199
|
}),
|
|
2182
|
-
|
|
2183
|
-
text:
|
|
2200
|
+
Kt && /* @__PURE__ */ W(_, {
|
|
2201
|
+
text: Kt,
|
|
2184
2202
|
className: "min-w-0 break-words px-1"
|
|
2185
2203
|
}),
|
|
2186
|
-
|
|
2204
|
+
Xt && /* @__PURE__ */ W(lt, {
|
|
2187
2205
|
embedded: !0,
|
|
2188
|
-
state:
|
|
2189
|
-
analyserNodeRef:
|
|
2190
|
-
errorMessage:
|
|
2191
|
-
onStop:
|
|
2192
|
-
onDiscard:
|
|
2193
|
-
attachButton:
|
|
2206
|
+
state: Wt,
|
|
2207
|
+
analyserNodeRef: Gt,
|
|
2208
|
+
errorMessage: Kt,
|
|
2209
|
+
onStop: Jt,
|
|
2210
|
+
onDiscard: Yt,
|
|
2211
|
+
attachButton: gn,
|
|
2194
2212
|
stopLabel: j,
|
|
2195
2213
|
discardLabel: ne,
|
|
2196
2214
|
processingLabel: Te
|
|
2197
2215
|
}),
|
|
2198
|
-
!
|
|
2199
|
-
!
|
|
2200
|
-
className: "flex flex-wrap items-center gap-2",
|
|
2216
|
+
!Xt && ge && hn,
|
|
2217
|
+
!Xt && !ge && /* @__PURE__ */ G("div", {
|
|
2218
|
+
className: c("flex flex-wrap items-center gap-2", K.actionRow),
|
|
2201
2219
|
children: [
|
|
2202
2220
|
/* @__PURE__ */ W("div", {
|
|
2203
|
-
className: "flex w-full min-w-0 items-center self-stretch",
|
|
2204
|
-
children: mn
|
|
2205
|
-
}),
|
|
2206
|
-
hn && /* @__PURE__ */ W("div", {
|
|
2207
|
-
className: "flex",
|
|
2221
|
+
className: c("flex w-full min-w-0 items-center self-stretch", K.textareaWrap),
|
|
2208
2222
|
children: hn
|
|
2209
2223
|
}),
|
|
2210
|
-
|
|
2224
|
+
gn && /* @__PURE__ */ W("div", {
|
|
2225
|
+
className: c("flex", K.addCluster),
|
|
2226
|
+
children: gn
|
|
2227
|
+
}),
|
|
2228
|
+
on.length > 0 && ze != null && /* @__PURE__ */ W("div", {
|
|
2211
2229
|
className: "min-w-0 flex-1",
|
|
2212
2230
|
children: /* @__PURE__ */ W(it, {
|
|
2213
|
-
items:
|
|
2231
|
+
items: on,
|
|
2214
2232
|
onToolToggle: ze,
|
|
2215
|
-
onToolDismiss:
|
|
2233
|
+
onToolDismiss: sn,
|
|
2216
2234
|
canRemove: Be,
|
|
2217
2235
|
removeLabel: Ge?.removeLabel
|
|
2218
2236
|
})
|
|
2219
2237
|
}),
|
|
2220
2238
|
/* @__PURE__ */ W("div", {
|
|
2221
|
-
className: "ms-auto flex flex-shrink-0 items-center gap-2",
|
|
2239
|
+
className: c("ms-auto flex flex-shrink-0 items-center gap-2", K.footerActions),
|
|
2222
2240
|
children: _e ? _e({
|
|
2223
|
-
canSend:
|
|
2224
|
-
onSend:
|
|
2241
|
+
canSend: nn,
|
|
2242
|
+
onSend: un
|
|
2225
2243
|
}) : /* @__PURE__ */ G(U, { children: [
|
|
2226
2244
|
ct,
|
|
2227
|
-
/* @__PURE__ */ W(
|
|
2245
|
+
/* @__PURE__ */ W(Vt, {
|
|
2228
2246
|
deployments: le,
|
|
2229
2247
|
selectedDeploymentId: ue,
|
|
2230
2248
|
onDeploymentChange: de,
|
|
@@ -2238,7 +2256,7 @@ var Ft = {
|
|
|
2238
2256
|
onPickerToggle: () => ht((e) => !e),
|
|
2239
2257
|
onPickerOpenChange: ht
|
|
2240
2258
|
}),
|
|
2241
|
-
|
|
2259
|
+
ln && /* @__PURE__ */ W(v, {
|
|
2242
2260
|
icon: /* @__PURE__ */ W(se, {
|
|
2243
2261
|
size: p.LG,
|
|
2244
2262
|
stroke: m,
|
|
@@ -2247,15 +2265,15 @@ var Ft = {
|
|
|
2247
2265
|
"aria-label": A,
|
|
2248
2266
|
tooltipProps: { tooltip: A },
|
|
2249
2267
|
className: "size-[40px] flex-shrink-0 mobile:min-h-11 mobile:min-w-11",
|
|
2250
|
-
onClick: () =>
|
|
2268
|
+
onClick: () => qt(Re.Dictation),
|
|
2251
2269
|
disabled: H || o
|
|
2252
2270
|
}),
|
|
2253
2271
|
o && a ? /* @__PURE__ */ W(dt, {
|
|
2254
2272
|
onStop: a,
|
|
2255
2273
|
ariaLabel: ee
|
|
2256
2274
|
}) : !o && /* @__PURE__ */ W(ut, {
|
|
2257
|
-
onSend:
|
|
2258
|
-
isDisabled: !
|
|
2275
|
+
onSend: un,
|
|
2276
|
+
isDisabled: !cn || !nn,
|
|
2259
2277
|
ariaLabel: O,
|
|
2260
2278
|
sendTooltip: k
|
|
2261
2279
|
})
|
|
@@ -2268,14 +2286,14 @@ var Ft = {
|
|
|
2268
2286
|
role: "status",
|
|
2269
2287
|
"aria-live": "polite",
|
|
2270
2288
|
"aria-atomic": "true",
|
|
2271
|
-
children: /* @__PURE__ */ W("span", { children:
|
|
2289
|
+
children: /* @__PURE__ */ W("span", { children: Ht.text }, Ht.revision)
|
|
2272
2290
|
})
|
|
2273
2291
|
]
|
|
2274
2292
|
});
|
|
2275
|
-
},
|
|
2293
|
+
}, Ut = {
|
|
2276
2294
|
welcome: "_welcome_1icyo_1",
|
|
2277
2295
|
description: "_description_1icyo_5"
|
|
2278
|
-
},
|
|
2296
|
+
}, Wt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, styles: i, className: a, inputClassName: o, isInputDisabled: l = !1, ...u }) => {
|
|
2279
2297
|
let { colors: d, typography: f } = i ?? {};
|
|
2280
2298
|
return /* @__PURE__ */ G("div", {
|
|
2281
2299
|
style: s({
|
|
@@ -2286,15 +2304,15 @@ var Ft = {
|
|
|
2286
2304
|
children: [n && /* @__PURE__ */ G("div", {
|
|
2287
2305
|
className: "flex flex-col items-center gap-4 text-center",
|
|
2288
2306
|
children: [/* @__PURE__ */ W("h1", {
|
|
2289
|
-
className: c(
|
|
2307
|
+
className: c(Ut.welcome, "m-0", f?.welcomeClassName || "dial-display2-text"),
|
|
2290
2308
|
children: n
|
|
2291
2309
|
}), r && /* @__PURE__ */ W("p", {
|
|
2292
|
-
className: c(
|
|
2310
|
+
className: c(Ut.description, "m-0 max-w-[540px]", f?.descriptionClassName || "dial-body-paragraph-text"),
|
|
2293
2311
|
children: r
|
|
2294
2312
|
})]
|
|
2295
2313
|
}), /* @__PURE__ */ W("div", {
|
|
2296
2314
|
className: c("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
|
|
2297
|
-
children: /* @__PURE__ */ W(
|
|
2315
|
+
children: /* @__PURE__ */ W(Ht, {
|
|
2298
2316
|
placeholder: t,
|
|
2299
2317
|
isStreaming: e,
|
|
2300
2318
|
isInputDisabled: l,
|
|
@@ -2305,7 +2323,7 @@ var Ft = {
|
|
|
2305
2323
|
})
|
|
2306
2324
|
})]
|
|
2307
2325
|
});
|
|
2308
|
-
},
|
|
2326
|
+
}, Gt = ({ message: e, inlineStartSlot: t, onInlineStartRemove: n, initialAttachments: r = [], onCancel: a, onSave: o, onUploadAttachment: s, cancelLabel: l = "Cancel", saveLabel: d = "Save & Submit", ariaLabel: f, removeLabel: p, retryLabel: h, uploadingLabel: g, addMenuTitle: _ = "Add", attachLabel: v = "Attach file", menuTitle: y = "Menu", menuCloseLabel: b = "Close", className: S, pendingDropFiles: C, onDropFilesConsumed: T, validateAttachment: E, isAttachmentsEnabled: D, isTextAttachmentsAllowed: O, hideAttachFile: k = !1, fileAccept: ee, maximumAttachmentsAmount: A, onAttachmentsLimitExceeded: te, onDialFileSystemClick: j, dialFileSystemLabel: ne, pendingAttachments: M, onPendingAttachmentsConsumed: N, onAttachmentClick: re, pasteTextThreshold: ie, maxMessageLength: P = 5e4, onMessageTooLong: F }) => {
|
|
2309
2327
|
let ae = B(null), [se, ce] = V([]);
|
|
2310
2328
|
R(() => {
|
|
2311
2329
|
C?.length && (ce(C), T?.());
|
|
@@ -2337,7 +2355,7 @@ var Ft = {
|
|
|
2337
2355
|
}] : [], [j, ne]);
|
|
2338
2356
|
return /* @__PURE__ */ G("div", {
|
|
2339
2357
|
className: c("flex w-full flex-col gap-2", S),
|
|
2340
|
-
children: [/* @__PURE__ */ W(
|
|
2358
|
+
children: [/* @__PURE__ */ W(Ht, {
|
|
2341
2359
|
message: e,
|
|
2342
2360
|
inlineStartSlot: t,
|
|
2343
2361
|
onInlineStartRemove: n,
|
|
@@ -2402,4 +2420,4 @@ var Ft = {
|
|
|
2402
2420
|
});
|
|
2403
2421
|
};
|
|
2404
2422
|
//#endregion
|
|
2405
|
-
export { Te as BottomSheetShell, Ze as ChatSettingsModal,
|
|
2423
|
+
export { Te as BottomSheetShell, K as CONVERSATION_INPUT_CLASS, Ze as ChatSettingsModal, Wt as ConversationInput, Gt as EditMessageInput, Ht as Input, We as SendOnEnter };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-conversation-input",
|
|
3
3
|
"description": "Conversation message input with model selection, attachments, voice input, and edit mode",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.50",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"react-window": "^2.2.7",
|
|
21
21
|
"@tabler/icons-react": "^3.44.0",
|
|
22
|
-
"@epam/ai-dial-attachment-input": "1.2.0-dev.
|
|
22
|
+
"@epam/ai-dial-attachment-input": "1.2.0-dev.50"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.50",
|
|
26
26
|
"react": "^19.2.8",
|
|
27
27
|
"react-dom": "^19.2.8",
|
|
28
|
-
"@epam/ai-dial-ui-kit": "^0.
|
|
28
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.7"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|