impact-nova 3.0.0-alpha.7 → 3.0.0-alpha.9

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.
Files changed (103) hide show
  1. package/README.md +1 -1
  2. package/dist/components/data/expandable-list-item/sku-picker-chrome.d.ts +4 -0
  3. package/dist/components/data/expandable-list-item/sku-picker-chrome.js +37 -42
  4. package/dist/components/data-display/stereo-scatter/index.d.ts +2 -0
  5. package/dist/components/data-display/stereo-scatter/index.js +10 -0
  6. package/dist/components/data-display/stereo-scatter/internals/stereo-engine-frame.d.ts +41 -0
  7. package/dist/components/data-display/stereo-scatter/internals/stereo-engine-frame.js +178 -0
  8. package/dist/components/data-display/stereo-scatter/internals/stereo-engine-theme.d.ts +14 -0
  9. package/dist/components/data-display/stereo-scatter/internals/stereo-engine-theme.js +29 -0
  10. package/dist/components/data-display/stereo-scatter/internals/stereo-engine-wedges.d.ts +23 -0
  11. package/dist/components/data-display/stereo-scatter/internals/stereo-engine-wedges.js +80 -0
  12. package/dist/components/data-display/stereo-scatter/internals/stereo-engine.d.ts +120 -0
  13. package/dist/components/data-display/stereo-scatter/internals/stereo-engine.js +519 -0
  14. package/dist/components/data-display/stereo-scatter/internals/stereo-math.d.ts +64 -0
  15. package/dist/components/data-display/stereo-scatter/internals/stereo-math.js +129 -0
  16. package/dist/components/data-display/stereo-scatter/internals/stereo-model.d.ts +37 -0
  17. package/dist/components/data-display/stereo-scatter/internals/stereo-model.js +71 -0
  18. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-context.d.ts +33 -0
  19. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-context.js +19 -0
  20. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-key.d.ts +4 -0
  21. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-key.js +19 -0
  22. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-legend.d.ts +2 -0
  23. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-legend.js +75 -0
  24. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-scene.d.ts +2 -0
  25. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-scene.js +149 -0
  26. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-toolbar.d.ts +13 -0
  27. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-toolbar.js +93 -0
  28. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-tooltip.d.ts +2 -0
  29. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-tooltip.js +62 -0
  30. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-viewport.d.ts +3 -0
  31. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-viewport.js +41 -0
  32. package/dist/components/data-display/stereo-scatter/stereo-scatter.d.ts +12 -0
  33. package/dist/components/data-display/stereo-scatter/stereo-scatter.js +107 -0
  34. package/dist/components/data-display/stereo-scatter/stereo-scatter.stories-data.d.ts +11 -0
  35. package/dist/components/data-display/stereo-scatter/stereo-scatter.types.d.ts +69 -0
  36. package/dist/components/data-display/stereo-scatter/stereo-scatter.variants.d.ts +13 -0
  37. package/dist/components/data-display/stereo-scatter/stereo-scatter.variants.js +42 -0
  38. package/dist/components/feedback/tooltip/button-icon-tooltip.d.ts +3 -1
  39. package/dist/components/feedback/tooltip/button-icon-tooltip.js +22 -19
  40. package/dist/components/flows/iris-chat/IrisChatComposerVoiceCapture.d.ts +5 -0
  41. package/dist/components/flows/iris-chat/IrisChatComposerVoiceCapture.js +73 -0
  42. package/dist/components/flows/iris-chat/IrisChatVoiceWaveform.d.ts +3 -0
  43. package/dist/components/flows/iris-chat/IrisChatVoiceWaveform.js +25 -0
  44. package/dist/components/flows/iris-chat/index.d.ts +3 -1
  45. package/dist/components/flows/iris-chat/index.js +58 -53
  46. package/dist/components/flows/iris-chat/iris-chat-chrome.d.ts +39 -0
  47. package/dist/components/flows/iris-chat/iris-chat-chrome.js +325 -0
  48. package/dist/components/flows/iris-chat/iris-chat-close-animation.d.ts +12 -0
  49. package/dist/components/flows/iris-chat/iris-chat-close-animation.js +21 -0
  50. package/dist/components/flows/iris-chat/iris-chat-composer.js +266 -238
  51. package/dist/components/flows/iris-chat/iris-chat-context.d.ts +13 -0
  52. package/dist/components/flows/iris-chat/iris-chat-context.js +14 -10
  53. package/dist/components/flows/iris-chat/iris-chat-copy-feedback.d.ts +4 -0
  54. package/dist/components/flows/iris-chat/iris-chat-copy-feedback.js +16 -0
  55. package/dist/components/flows/iris-chat/iris-chat-frame.d.ts +31 -0
  56. package/dist/components/flows/iris-chat/iris-chat-frame.js +79 -0
  57. package/dist/components/flows/iris-chat/iris-chat-icons.d.ts +1 -0
  58. package/dist/components/flows/iris-chat/iris-chat-icons.js +28 -15
  59. package/dist/components/flows/iris-chat/iris-chat-launch-animation.d.ts +11 -0
  60. package/dist/components/flows/iris-chat/iris-chat-launch-animation.js +35 -0
  61. package/dist/components/flows/iris-chat/iris-chat-markdown.js +70 -50
  62. package/dist/components/flows/iris-chat/iris-chat-menu.js +91 -86
  63. package/dist/components/flows/iris-chat/iris-chat-speech.d.ts +52 -0
  64. package/dist/components/flows/iris-chat/iris-chat-speech.js +121 -0
  65. package/dist/components/flows/iris-chat/iris-chat-thread.d.ts +3 -0
  66. package/dist/components/flows/iris-chat/iris-chat-thread.js +241 -190
  67. package/dist/components/flows/iris-chat/iris-chat-window-chrome.d.ts +30 -0
  68. package/dist/components/flows/iris-chat/iris-chat-window-chrome.js +34 -0
  69. package/dist/components/flows/iris-chat/iris-chat-window-geometry-context.d.ts +14 -0
  70. package/dist/components/flows/iris-chat/iris-chat-window-geometry-context.js +15 -0
  71. package/dist/components/flows/iris-chat/iris-chat-window-geometry.d.ts +12 -0
  72. package/dist/components/flows/iris-chat/iris-chat-window-geometry.js +113 -0
  73. package/dist/components/flows/iris-chat/iris-chat-window-handles.d.ts +6 -0
  74. package/dist/components/flows/iris-chat/iris-chat-window-handles.js +50 -0
  75. package/dist/components/flows/iris-chat/iris-chat-window-shell.d.ts +8 -0
  76. package/dist/components/flows/iris-chat/iris-chat-window-shell.js +37 -0
  77. package/dist/components/flows/iris-chat/iris-chat.d.ts +3 -39
  78. package/dist/components/flows/iris-chat/iris-chat.js +22 -330
  79. package/dist/components/flows/iris-chat/iris-chat.types.d.ts +18 -0
  80. package/dist/components/flows/iris-chat/iris-chat.variants.d.ts +3 -3
  81. package/dist/components/flows/iris-chat/iris-chat.variants.js +21 -16
  82. package/dist/components/flows/iris-chat/use-iris-chat-root.d.ts +26 -0
  83. package/dist/components/flows/iris-chat/use-iris-chat-root.js +140 -0
  84. package/dist/components/forms/choice-card/choice-card.d.ts +1 -0
  85. package/dist/components/forms/choice-card/choice-card.js +183 -186
  86. package/dist/components/layout/header/header.js +1 -0
  87. package/dist/form-react/Fields/SelectField.js +66 -57
  88. package/dist/form-react/Fields/VirtualizedListField.js +140 -96
  89. package/dist/form-react/index.d.ts +1 -1
  90. package/dist/form-react/types/fields.types.d.ts +27 -0
  91. package/dist/form-react/types/reactHookForm.types.d.ts +18 -1
  92. package/dist/i18n/defaultMessages.d.ts +37 -0
  93. package/dist/i18n/defaultMessages.js +54 -18
  94. package/dist/i18n/index.d.ts +1 -1
  95. package/dist/i18n/locales/de.js +36 -0
  96. package/dist/i18n/locales/es.js +36 -0
  97. package/dist/i18n/locales/hi.js +36 -0
  98. package/dist/i18n/locales/kn.js +36 -0
  99. package/dist/impact-nova-components.css +19 -0
  100. package/dist/impact-nova.css +1 -1
  101. package/dist/llms/rules/installation.js +1 -1
  102. package/dist/llms/rules/requirements.js +1 -1
  103. package/package.json +5 -1
@@ -1,52 +1,52 @@
1
1
  import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
- import { useRef as S, useState as g } from "react";
3
- import { FunnelShow as I, ThreeDots as L, Pin as M, Pencil as A, Bin as D, ChevronRight as T } from "impact-nova-icons";
4
- import { DropdownMenu as C, DropdownMenuTrigger as v, DropdownMenuContent as b, DropdownMenuItem as p } from "../../feedback/dropdown-menu/dropdown-menu.js";
5
- import { ButtonIconTooltip as N } from "../../feedback/tooltip/button-icon-tooltip.js";
6
- import { Button as x } from "../../primitives/button/button.js";
7
- import { Accordion as j, AccordionItem as k, AccordionTrigger as R, AccordionContent as E } from "../../primitives/accordion/accordion.js";
8
- import { useImpactNovaI18n as w } from "../../../i18n/use-impact-nova-i18n.js";
9
- import { useVirtualizedList as B } from "../../../lib/virtualized/useVirtualizedList.js";
10
- import { createComponent as O } from "../../../lib/primitives/create-component.js";
11
- import { cn as y } from "../../../lib/utils.js";
12
- import { IrisChatAttachIcon as $ } from "./iris-chat-icons.js";
13
- const z = ["type", "status", "lastActivity"], ee = O(
2
+ import { useRef as L, useState as C } from "react";
3
+ import { FunnelShow as z, ThreeDots as M, Pin as T, Pencil as A, Bin as D, ChevronRight as j } from "impact-nova-icons";
4
+ import { DropdownMenu as v, DropdownMenuTrigger as b, DropdownMenuContent as N, DropdownMenuItem as p } from "../../feedback/dropdown-menu/dropdown-menu.js";
5
+ import { ButtonIconTooltip as w } from "../../feedback/tooltip/button-icon-tooltip.js";
6
+ import { Button as g } from "../../primitives/button/button.js";
7
+ import { Accordion as k, AccordionItem as E, AccordionTrigger as R, AccordionContent as B } from "../../primitives/accordion/accordion.js";
8
+ import { useImpactNovaI18n as I } from "../../../i18n/use-impact-nova-i18n.js";
9
+ import { useVirtualizedList as O } from "../../../lib/virtualized/useVirtualizedList.js";
10
+ import { createComponent as $ } from "../../../lib/primitives/create-component.js";
11
+ import { cn as x } from "../../../lib/utils.js";
12
+ import { IrisChatAttachIcon as P } from "./iris-chat-icons.js";
13
+ const S = ["type", "status", "lastActivity"], te = $(
14
14
  "IrisChatMenu",
15
15
  ({ className: t, children: d, ...l }, o) => /* @__PURE__ */ e(
16
16
  "div",
17
17
  {
18
18
  ref: o,
19
19
  "data-component": "iris-chat-menu",
20
- className: y("flex flex-col gap-4 py-4", t),
20
+ className: x("flex flex-col gap-4 py-4", t),
21
21
  ...l,
22
- children: /* @__PURE__ */ e(j, { type: "multiple", defaultValue: ["recent", "artifacts"], className: "flex flex-col gap-4", children: d })
22
+ children: /* @__PURE__ */ e(k, { type: "multiple", defaultValue: ["recent", "artifacts"], className: "flex flex-col gap-4", children: d })
23
23
  }
24
24
  )
25
- ), P = ({
25
+ ), V = ({
26
26
  value: t,
27
27
  title: d,
28
28
  onFilterSelect: l,
29
29
  onViewMore: o,
30
- viewMoreLabel: a,
30
+ viewMoreLabel: r,
31
31
  className: h,
32
- children: f
32
+ children: u
33
33
  }) => {
34
- const { t: i } = w(), m = {
34
+ const { t: i } = I(), m = {
35
35
  type: i("irisChat.filterType"),
36
36
  status: i("irisChat.filterStatus"),
37
37
  lastActivity: i("irisChat.filterLastActivity")
38
38
  };
39
39
  return /* @__PURE__ */ s(
40
- k,
40
+ E,
41
41
  {
42
42
  value: t,
43
43
  "data-component": "iris-chat-menu-section",
44
- className: y("rounded-none border-0 bg-transparent shadow-none", h),
44
+ className: x("rounded-none border-0 bg-transparent shadow-none", h),
45
45
  children: [
46
46
  /* @__PURE__ */ s("div", { className: "flex h-10 items-center justify-between gap-2", children: [
47
47
  /* @__PURE__ */ s(R, { variant: "plain", headingLevel: 3, className: "flex min-w-0 flex-1 items-center gap-2 py-0", children: [
48
48
  /* @__PURE__ */ e("span", { className: "flex size-6 shrink-0 items-center justify-center rounded-full bg-secondary text-content-secondary", children: /* @__PURE__ */ e(
49
- T,
49
+ j,
50
50
  {
51
51
  size: 14,
52
52
  className: "rotate-90 transition-transform group-data-[state=open]:-rotate-90"
@@ -54,41 +54,41 @@ const z = ["type", "status", "lastActivity"], ee = O(
54
54
  ) }),
55
55
  /* @__PURE__ */ e("span", { className: "text-sm font-medium text-content", children: d })
56
56
  ] }),
57
- /* @__PURE__ */ s(C, { children: [
57
+ /* @__PURE__ */ s(v, { children: [
58
58
  /* @__PURE__ */ e(
59
- N,
59
+ w,
60
60
  {
61
61
  label: i("irisChat.filter"),
62
62
  variant: "secondary",
63
63
  align: "end",
64
64
  side: "top",
65
- children: /* @__PURE__ */ e(v, { asChild: !0, children: /* @__PURE__ */ e(
66
- x,
65
+ children: /* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(
66
+ g,
67
67
  {
68
68
  type: "button",
69
69
  variant: "ghost",
70
70
  size: "iconSm",
71
71
  "aria-label": i("irisChat.filter"),
72
72
  "data-testid": `iris-chat-filter-${t}`,
73
- children: /* @__PURE__ */ e(I, { size: 16 })
73
+ children: /* @__PURE__ */ e(z, { size: 16 })
74
74
  }
75
75
  ) })
76
76
  }
77
77
  ),
78
- /* @__PURE__ */ e(b, { align: "end", children: z.map((c) => /* @__PURE__ */ e(p, { onSelect: () => l?.(c), children: m[c] }, c)) })
78
+ /* @__PURE__ */ e(N, { align: "end", children: S.map((c) => /* @__PURE__ */ e(p, { onSelect: () => l?.(c), children: m[c] }, c)) })
79
79
  ] })
80
80
  ] }),
81
- /* @__PURE__ */ s(E, { className: "px-0 pb-1 pt-1", children: [
82
- /* @__PURE__ */ e("div", { className: "flex flex-col", children: f }),
81
+ /* @__PURE__ */ s(B, { className: "px-0 pb-1 pt-1", children: [
82
+ /* @__PURE__ */ e("div", { className: "flex flex-col", children: u }),
83
83
  o ? /* @__PURE__ */ e(
84
- x,
84
+ g,
85
85
  {
86
86
  type: "button",
87
87
  variant: "link",
88
88
  "data-testid": `iris-chat-view-more-${t}`,
89
89
  className: "mt-1 h-auto justify-start px-2 text-sm",
90
90
  onClick: o,
91
- children: a ?? i("irisChat.viewMore")
91
+ children: r ?? i("irisChat.viewMore")
92
92
  }
93
93
  ) : null
94
94
  ] })
@@ -96,22 +96,23 @@ const z = ["type", "status", "lastActivity"], ee = O(
96
96
  }
97
97
  );
98
98
  };
99
- P.displayName = "IrisChatMenuSection";
100
- const V = ({ title: t, onSelect: d, onAction: l, className: o }) => {
101
- const { t: a } = w(), [h, f] = g(!1), [i, m] = g(!1), [c, u] = g(t), n = () => {
102
- const r = c.trim();
103
- if (m(!1), !r || r === t) {
104
- u(t);
99
+ V.displayName = "IrisChatMenuSection";
100
+ const F = ({ title: t, onSelect: d, onAction: l, className: o }) => {
101
+ const { t: r } = I(), [h, u] = C(!1), [i, m] = C(!1), [c, f] = C(t), a = () => {
102
+ const n = c.trim();
103
+ if (m(!1), !n || n === t) {
104
+ f(t);
105
105
  return;
106
106
  }
107
- l?.("rename", r);
107
+ l?.("rename", n);
108
108
  };
109
109
  return /* @__PURE__ */ s(
110
110
  "div",
111
111
  {
112
112
  "data-component": "iris-chat-list-item",
113
113
  "data-menu-open": h ? "" : void 0,
114
- className: y(
114
+ "data-editing": i ? "" : void 0,
115
+ className: x(
115
116
  "flex min-h-10 items-center justify-between gap-2 rounded-full px-3",
116
117
  (h || i) && "bg-secondary",
117
118
  "hover:bg-secondary",
@@ -123,13 +124,16 @@ const V = ({ title: t, onSelect: d, onAction: l, className: o }) => {
123
124
  {
124
125
  value: c,
125
126
  autoFocus: !0,
126
- "aria-label": a("irisChat.rename"),
127
+ "aria-label": r("irisChat.rename"),
127
128
  "data-testid": "iris-chat-item-rename",
128
129
  className: "min-w-0 flex-1 bg-transparent text-sm text-content outline-none",
129
- onChange: (r) => u(r.target.value),
130
- onBlur: n,
131
- onKeyDown: (r) => {
132
- r.key === "Enter" && (r.preventDefault(), n()), r.key === "Escape" && (u(t), m(!1));
130
+ onChange: (n) => f(n.target.value),
131
+ onBlur: (n) => {
132
+ const y = n.relatedTarget;
133
+ y instanceof Element && (y.closest('[data-component="dropdown-menu-content"]') || y.closest('[data-testid="iris-chat-item-more"]')) || a();
134
+ },
135
+ onKeyDown: (n) => {
136
+ n.key === "Enter" && (n.preventDefault(), a()), n.key === "Escape" && (f(t), m(!1));
133
137
  }
134
138
  }
135
139
  ) : /* @__PURE__ */ e(
@@ -141,52 +145,53 @@ const V = ({ title: t, onSelect: d, onAction: l, className: o }) => {
141
145
  children: t
142
146
  }
143
147
  ),
144
- /* @__PURE__ */ s(C, { open: h, onOpenChange: f, children: [
148
+ /* @__PURE__ */ s(v, { open: h, onOpenChange: u, children: [
145
149
  /* @__PURE__ */ e(
146
- N,
150
+ w,
147
151
  {
148
- label: a("irisChat.moreActions"),
152
+ label: r("irisChat.moreActions"),
149
153
  variant: "secondary",
150
154
  align: "end",
151
155
  side: "top",
152
- children: /* @__PURE__ */ e(v, { asChild: !0, children: /* @__PURE__ */ e(
153
- x,
156
+ children: /* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(
157
+ g,
154
158
  {
155
159
  type: "button",
156
160
  variant: "ghost",
157
161
  size: "iconSm",
158
- "aria-label": a("irisChat.moreActions"),
162
+ "aria-label": r("irisChat.moreActions"),
159
163
  "data-testid": "iris-chat-item-more",
160
- children: /* @__PURE__ */ e(L, { size: 16 })
164
+ children: /* @__PURE__ */ e(M, { size: 16 })
161
165
  }
162
166
  ) })
163
167
  }
164
168
  ),
165
- /* @__PURE__ */ s(b, { align: "end", className: "w-[182px]", children: [
169
+ /* @__PURE__ */ s(N, { align: "end", className: "w-[182px]", children: [
166
170
  /* @__PURE__ */ e(
167
171
  p,
168
172
  {
169
- icon: /* @__PURE__ */ e(M, { size: 16 }),
173
+ icon: /* @__PURE__ */ e(T, { size: 16 }),
170
174
  onSelect: () => l?.("pin"),
171
- children: a("irisChat.pin")
175
+ children: r("irisChat.pin")
172
176
  }
173
177
  ),
174
178
  /* @__PURE__ */ e(
175
179
  p,
176
180
  {
177
181
  icon: /* @__PURE__ */ e(A, { size: 16 }),
182
+ "data-testid": "iris-chat-item-rename-action",
178
183
  onSelect: () => {
179
- u(t), window.setTimeout(() => m(!0), 0);
184
+ f(t), m(!0), u(!1);
180
185
  },
181
- children: a("irisChat.rename")
186
+ children: r("irisChat.rename")
182
187
  }
183
188
  ),
184
189
  /* @__PURE__ */ e(
185
190
  p,
186
191
  {
187
- icon: /* @__PURE__ */ e($, {}),
192
+ icon: /* @__PURE__ */ e(P, {}),
188
193
  onSelect: () => l?.("archive"),
189
- children: a("irisChat.archive")
194
+ children: r("irisChat.archive")
190
195
  }
191
196
  ),
192
197
  /* @__PURE__ */ e(
@@ -195,7 +200,7 @@ const V = ({ title: t, onSelect: d, onAction: l, className: o }) => {
195
200
  icon: /* @__PURE__ */ e(D, { size: 16 }),
196
201
  className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
197
202
  onSelect: () => l?.("delete"),
198
- children: a("irisChat.delete")
203
+ children: r("irisChat.delete")
199
204
  }
200
205
  )
201
206
  ] })
@@ -204,24 +209,24 @@ const V = ({ title: t, onSelect: d, onAction: l, className: o }) => {
204
209
  }
205
210
  );
206
211
  };
207
- V.displayName = "IrisChatListItem";
208
- function F({
212
+ F.displayName = "IrisChatListItem";
213
+ function K({
209
214
  items: t,
210
215
  getItemId: d,
211
216
  renderItem: l,
212
217
  title: o,
213
- onFilterSelect: a,
218
+ onFilterSelect: r,
214
219
  estimateSize: h = 32,
215
- className: f
220
+ className: u
216
221
  }) {
217
- const { t: i } = w(), m = S(null), c = B({
222
+ const { t: i } = I(), m = L(null), c = O({
218
223
  rowCount: t.length,
219
- getRowData: (n) => t[n],
220
- getRowId: (n) => d(t[n]),
224
+ getRowData: (a) => t[a],
225
+ getRowId: (a) => d(t[a]),
221
226
  estimateSize: () => h,
222
227
  scrollElementRef: m,
223
228
  hasMore: !1
224
- }), u = {
229
+ }), f = {
225
230
  type: i("irisChat.filterType"),
226
231
  status: i("irisChat.filterStatus"),
227
232
  lastActivity: i("irisChat.filterLastActivity")
@@ -230,57 +235,57 @@ function F({
230
235
  "div",
231
236
  {
232
237
  "data-component": "iris-chat-list",
233
- className: y("flex min-h-0 flex-1 flex-col", f),
238
+ className: x("flex min-h-0 flex-1 flex-col", u),
234
239
  children: [
235
- o || a ? /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-2 py-3", children: [
240
+ o || r ? /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-2 py-3", children: [
236
241
  o ? /* @__PURE__ */ e("p", { className: "text-sm font-medium text-content", children: o }) : /* @__PURE__ */ e("span", {}),
237
- a ? /* @__PURE__ */ s(C, { children: [
242
+ r ? /* @__PURE__ */ s(v, { children: [
238
243
  /* @__PURE__ */ e(
239
- N,
244
+ w,
240
245
  {
241
246
  label: i("irisChat.filter"),
242
247
  variant: "secondary",
243
248
  align: "end",
244
249
  side: "top",
245
- children: /* @__PURE__ */ e(v, { asChild: !0, children: /* @__PURE__ */ e(
246
- x,
250
+ children: /* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(
251
+ g,
247
252
  {
248
253
  type: "button",
249
254
  variant: "ghost",
250
255
  size: "iconSm",
251
256
  "aria-label": i("irisChat.filter"),
252
257
  "data-testid": "iris-chat-filter-list",
253
- children: /* @__PURE__ */ e(I, { size: 16 })
258
+ children: /* @__PURE__ */ e(z, { size: 16 })
254
259
  }
255
260
  ) })
256
261
  }
257
262
  ),
258
- /* @__PURE__ */ e(b, { align: "end", children: z.map((n) => /* @__PURE__ */ e(p, { onSelect: () => a(n), children: u[n] }, n)) })
263
+ /* @__PURE__ */ e(N, { align: "end", children: S.map((a) => /* @__PURE__ */ e(p, { onSelect: () => r(a), children: f[a] }, a)) })
259
264
  ] }) : null
260
265
  ] }) : null,
261
- /* @__PURE__ */ e("div", { ref: m, className: "min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ e("div", { style: { height: c.virtualizer.getTotalSize(), position: "relative" }, children: c.virtualizer.getVirtualItems().map((n) => {
262
- const r = t[n.index];
266
+ /* @__PURE__ */ e("div", { ref: m, className: "min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ e("div", { style: { height: c.virtualizer.getTotalSize(), position: "relative" }, children: c.virtualizer.getVirtualItems().map((a) => {
267
+ const n = t[a.index];
263
268
  return /* @__PURE__ */ e(
264
269
  "div",
265
270
  {
266
271
  className: "absolute inset-x-0",
267
272
  style: {
268
- height: n.size,
269
- transform: `translateY(${n.start}px)`
273
+ height: a.size,
274
+ transform: `translateY(${a.start}px)`
270
275
  },
271
- children: l(r)
276
+ children: l(n)
272
277
  },
273
- d(r)
278
+ d(n)
274
279
  );
275
280
  }) }) })
276
281
  ]
277
282
  }
278
283
  );
279
284
  }
280
- F.displayName = "IrisChatList";
285
+ K.displayName = "IrisChatList";
281
286
  export {
282
- F as IrisChatList,
283
- V as IrisChatListItem,
284
- ee as IrisChatMenu,
285
- P as IrisChatMenuSection
287
+ K as IrisChatList,
288
+ F as IrisChatListItem,
289
+ te as IrisChatMenu,
290
+ V as IrisChatMenuSection
286
291
  };
@@ -0,0 +1,52 @@
1
+ export type IrisChatSpeechNoticeKind = "unsupported" | "permission" | "error";
2
+ export type IrisChatSpeechNotice = {
3
+ kind: IrisChatSpeechNoticeKind;
4
+ messageKey: "speechUnsupported" | "speechPermissionDenied" | "speechNoSpeech" | "speechNetwork" | "speechError" | "speechEmpty";
5
+ };
6
+ export type SpeechRecognitionHandle = {
7
+ continuous: boolean;
8
+ interimResults: boolean;
9
+ lang: string;
10
+ start: () => void;
11
+ stop: () => void;
12
+ abort: () => void;
13
+ onresult: ((event: {
14
+ resultIndex: number;
15
+ results: ArrayLike<ArrayLike<{
16
+ transcript?: string;
17
+ } & {
18
+ isFinal?: boolean;
19
+ }>>;
20
+ }) => void) | null;
21
+ onerror: ((event: {
22
+ error?: string;
23
+ }) => void) | null;
24
+ onend: (() => void) | null;
25
+ onstart: (() => void) | null;
26
+ };
27
+ export declare function readSpeechRecognitionConstructor(): (new () => SpeechRecognitionHandle) | undefined;
28
+ export declare function readSpeechRecognitionLocale(locale?: string): string;
29
+ export declare function readSpeechRecognitionErrorNotice(errorCode: string): IrisChatSpeechNotice;
30
+ export declare function readSpeechSessionTranscript(results: ArrayLike<ArrayLike<{
31
+ transcript?: string;
32
+ }>>): string;
33
+ export declare function startComposerSpeechRecognition(input: {
34
+ locale: string;
35
+ readBaseText: () => string;
36
+ shouldContinueListening: () => boolean;
37
+ onDraftChange: (nextText: string) => void;
38
+ onListeningChange: (listening: boolean) => void;
39
+ onNotice?: (notice: IrisChatSpeechNotice) => void;
40
+ }): SpeechRecognitionHandle | null;
41
+ export declare function readBasicMarkdownSpeakableText(markdown: string): string;
42
+ export declare function readIrisChatActionsSpeakText(input: {
43
+ speakText?: string;
44
+ copyText?: string;
45
+ }): string;
46
+ export declare function cancelPlainTextSpeech(): void;
47
+ export declare function speakPlainText(input: {
48
+ text: string;
49
+ locale?: string;
50
+ onSpeakingChange: (speaking: boolean) => void;
51
+ onNotice?: (notice: IrisChatSpeechNotice) => void;
52
+ }): void;
@@ -0,0 +1,121 @@
1
+ function u() {
2
+ if (typeof window > "u")
3
+ return;
4
+ const e = window;
5
+ return e.SpeechRecognition ?? e.webkitSpeechRecognition;
6
+ }
7
+ function a(e) {
8
+ let n = "en-US";
9
+ return e && e.trim().length > 0 ? n = e.trim() : typeof document < "u" && document.documentElement.lang && (n = document.documentElement.lang.trim()), n === "en" ? "en-US" : n;
10
+ }
11
+ function f(e) {
12
+ return e === "not-allowed" || e === "service-not-allowed" ? { kind: "permission", messageKey: "speechPermissionDenied" } : e === "no-speech" ? { kind: "error", messageKey: "speechNoSpeech" } : e === "network" ? { kind: "error", messageKey: "speechNetwork" } : { kind: "error", messageKey: "speechError" };
13
+ }
14
+ function h(e, n) {
15
+ const t = e.trimEnd(), s = n.trim();
16
+ return s ? t ? `${t} ${s}` : s : t;
17
+ }
18
+ function g(e) {
19
+ let n = "";
20
+ for (let t = 0; t < e.length; t += 1)
21
+ n += e[t]?.[0]?.transcript ?? "";
22
+ return n;
23
+ }
24
+ function x(e) {
25
+ const n = u();
26
+ if (!n)
27
+ return e.onNotice?.({ kind: "unsupported", messageKey: "speechUnsupported" }), null;
28
+ const t = new n();
29
+ t.continuous = !0, t.interimResults = !0, t.lang = a(e.locale);
30
+ const s = { current: e.readBaseText() };
31
+ t.onresult = (r) => {
32
+ const o = g(r.results), i = h(s.current, o);
33
+ e.onDraftChange(i);
34
+ const c = r.results.length - 1;
35
+ r.results[c]?.[0]?.isFinal && (s.current = i);
36
+ }, t.onerror = (r) => {
37
+ const o = f(r.error ?? "unknown");
38
+ e.onNotice?.(o);
39
+ }, t.onend = () => {
40
+ if (e.shouldContinueListening()) {
41
+ try {
42
+ t.start();
43
+ } catch {
44
+ e.onListeningChange(!1);
45
+ }
46
+ return;
47
+ }
48
+ e.onListeningChange(!1);
49
+ }, t.onstart = () => {
50
+ e.onListeningChange(!0);
51
+ };
52
+ try {
53
+ t.start();
54
+ } catch {
55
+ return e.onNotice?.({ kind: "error", messageKey: "speechError" }), e.onListeningChange(!1), null;
56
+ }
57
+ return t;
58
+ }
59
+ function d(e) {
60
+ let n = e;
61
+ return n = n.replace(/```[\s\S]*?```/g, " "), n = n.replace(/`([^`]+)`/g, "$1"), n = n.replace(/!\[([^\]]*)\]\([^)]+\)/g, "$1"), n = n.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1"), n = n.replace(/^#{1,6}\s+/gm, ""), n = n.replace(/[*_~>#-]+/g, " "), n = n.replace(/\s+/g, " ").trim(), n;
62
+ }
63
+ function T(e) {
64
+ const n = e.speakText ?? e.copyText ?? "";
65
+ return d(n);
66
+ }
67
+ let l = !1;
68
+ function p() {
69
+ typeof window > "u" || typeof window.speechSynthesis > "u" || (window.speechSynthesis.getVoices(), !l && (l = !0, window.speechSynthesis.onvoiceschanged = () => {
70
+ window.speechSynthesis.getVoices();
71
+ }));
72
+ }
73
+ function w(e, n, t) {
74
+ const s = e.name.toLowerCase();
75
+ let r = 0;
76
+ return e.lang === n ? r += 40 : e.lang.startsWith(t) && (r += 25), s.includes("google") && (r += 30), (s.includes("natural") || s.includes("neural") || s.includes("premium")) && (r += 35), (s.includes("samantha") || s.includes("karen") || s.includes("daniel") || s.includes("moira") || s.includes("zira")) && (r += 28), e.localService === !1 && (r += 20), e.default && (r += 5), (s.includes("compact") || s.includes("fred") || s.includes("bad news")) && (r -= 25), r;
77
+ }
78
+ function m(e) {
79
+ const n = window.speechSynthesis.getVoices();
80
+ if (n.length === 0)
81
+ return;
82
+ const t = a(e), s = t.split("-")[0] ?? t;
83
+ let r, o = Number.NEGATIVE_INFINITY;
84
+ for (const i of n) {
85
+ const c = w(i, t, s);
86
+ c > o && (o = c, r = i);
87
+ }
88
+ return r;
89
+ }
90
+ function S() {
91
+ typeof window < "u" && typeof window.speechSynthesis < "u" && window.speechSynthesis.cancel();
92
+ }
93
+ function N(e) {
94
+ if (typeof window > "u" || typeof window.speechSynthesis > "u") {
95
+ e.onNotice?.({ kind: "unsupported", messageKey: "speechUnsupported" });
96
+ return;
97
+ }
98
+ const n = d(e.text);
99
+ if (n.length === 0) {
100
+ e.onNotice?.({ kind: "error", messageKey: "speechEmpty" });
101
+ return;
102
+ }
103
+ S(), p();
104
+ const t = new SpeechSynthesisUtterance(n), s = a(e.locale);
105
+ t.lang = s;
106
+ const r = m(e.locale ?? s);
107
+ r && (t.voice = r), t.rate = 0.93, t.pitch = 1.02, t.onend = () => e.onSpeakingChange(!1), t.onerror = () => {
108
+ e.onSpeakingChange(!1), e.onNotice?.({ kind: "error", messageKey: "speechError" });
109
+ }, e.onSpeakingChange(!0), window.speechSynthesis.paused && window.speechSynthesis.resume(), window.speechSynthesis.speak(t);
110
+ }
111
+ export {
112
+ S as cancelPlainTextSpeech,
113
+ d as readBasicMarkdownSpeakableText,
114
+ T as readIrisChatActionsSpeakText,
115
+ u as readSpeechRecognitionConstructor,
116
+ f as readSpeechRecognitionErrorNotice,
117
+ a as readSpeechRecognitionLocale,
118
+ g as readSpeechSessionTranscript,
119
+ N as speakPlainText,
120
+ x as startComposerSpeechRecognition
121
+ };
@@ -21,11 +21,14 @@ declare const IrisChatActions: React.ForwardRefExoticComponent<React.HTMLAttribu
21
21
  liked?: boolean;
22
22
  disliked?: boolean;
23
23
  copyText?: string;
24
+ speakText?: string;
25
+ speechLocale?: string;
24
26
  onLike?: () => void;
25
27
  onDislike?: () => void;
26
28
  onCopy?: () => void;
27
29
  onRetry?: () => void;
28
30
  onSpeak?: () => void;
31
+ onSpeechNotice?: (notice: import('./iris-chat.types').IrisChatSpeechNotice) => void;
29
32
  onFeedback?: (feedback: import('./iris-chat.types').IrisChatFeedback) => void;
30
33
  } & React.RefAttributes<HTMLDivElement>>;
31
34
  declare const IrisChatFollowUps: React.ForwardRefExoticComponent<IrisChatFollowUpListProps & React.RefAttributes<HTMLDivElement>>;