@crewlethq/ui 0.190.2 → 0.191.0

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 (184) hide show
  1. package/README.md +9 -1
  2. package/dist/AgentHandoffPanel/index.js +11 -7
  3. package/dist/AgentIdentity/index.js +8 -7
  4. package/dist/Announcer/index.js +2 -1
  5. package/dist/AppShell/index.js +4 -3
  6. package/dist/ArrangeFrame/index.js +3 -2
  7. package/dist/ArrangeList/index.js +7 -6
  8. package/dist/ArtifactBar/index.js +6 -5
  9. package/dist/ArtifactCard/index.js +6 -5
  10. package/dist/AvatarPicker/index.js +6 -6
  11. package/dist/Canvas/index.js +3 -2
  12. package/dist/CanvasBoard/index.js +5 -4
  13. package/dist/CanvasToolbar/index.js +4 -3
  14. package/dist/CharacterCount/index.js +3 -2
  15. package/dist/CheckGrid/index.js +6 -5
  16. package/dist/Checkbox/index.js +5 -4
  17. package/dist/ChipField/index.js +3 -2
  18. package/dist/ColorField/index.js +5 -4
  19. package/dist/Combobox/index.js +5 -4
  20. package/dist/CommandPalette/index.js +11 -9
  21. package/dist/CommentThread/index.js +12 -8
  22. package/dist/Composer/Composer.d.ts +7 -0
  23. package/dist/Composer/index.d.ts +1 -0
  24. package/dist/Composer/index.js +12 -6
  25. package/dist/{Composer-YO275MFX.css → Composer-YCD6UPMO.css} +3 -2
  26. package/dist/ConfirmField/index.js +5 -4
  27. package/dist/ConsequenceList/index.js +6 -5
  28. package/dist/DataGrid/index.js +8 -7
  29. package/dist/DataTable/index.js +9 -8
  30. package/dist/DataView/index.js +13 -11
  31. package/dist/DatasetSource/index.js +2 -2
  32. package/dist/Dictation/fake.d.ts +59 -0
  33. package/dist/Dictation/index.d.ts +8 -0
  34. package/dist/Dictation/index.js +17 -0
  35. package/dist/Dictation/labels.d.ts +4 -0
  36. package/dist/Dictation/machine.d.ts +126 -0
  37. package/dist/Dictation/microphone.d.ts +5 -0
  38. package/dist/Dictation/session.d.ts +31 -0
  39. package/dist/Dictation/slot.d.ts +69 -0
  40. package/dist/Dictation/types.d.ts +158 -0
  41. package/dist/Dictation/webSpeech.d.ts +13 -0
  42. package/dist/Dictation/webSpeechLocal.d.ts +9 -0
  43. package/dist/Dictation-MGLRANB4.css +141 -0
  44. package/dist/DocTabsEditor/index.js +6 -5
  45. package/dist/DurationField/index.js +10 -9
  46. package/dist/{Editor-FZOUNP6V.js → Editor-ZQUOI3WV.js} +5 -4
  47. package/dist/EmojiPicker/index.js +5 -4
  48. package/dist/GraphCanvas/index.js +4 -3
  49. package/dist/HuePicker/index.js +4 -4
  50. package/dist/InboxList/index.js +1 -1
  51. package/dist/InlineEditor/index.js +3 -2
  52. package/dist/Input/index.js +4 -3
  53. package/dist/Kbd/index.js +2 -1
  54. package/dist/KeyValueRows/index.js +5 -4
  55. package/dist/LinkInterstitial/index.js +8 -7
  56. package/dist/ListInput/index.js +8 -6
  57. package/dist/MarkdownEditor/index.js +4 -4
  58. package/dist/MemberPicker/index.js +6 -5
  59. package/dist/MergeConflicts/index.js +4 -4
  60. package/dist/MessageActions/index.js +6 -5
  61. package/dist/Modal/index.js +7 -6
  62. package/dist/MoneyField/index.js +5 -4
  63. package/dist/NewItemsNotice/index.js +3 -2
  64. package/dist/NumberField/index.js +9 -8
  65. package/dist/OrgTable/index.js +10 -9
  66. package/dist/PresenterView/index.js +2 -2
  67. package/dist/PresetChips/index.js +4 -4
  68. package/dist/PrincipalPicker/index.js +7 -6
  69. package/dist/ProposalCard/index.js +9 -8
  70. package/dist/RailList/index.js +2 -2
  71. package/dist/ReactionBar/index.js +6 -5
  72. package/dist/Reorder/index.js +3 -2
  73. package/dist/RichEditor/index.js +1 -1
  74. package/dist/ScopeList/index.js +6 -5
  75. package/dist/SegmentedControl/index.js +3 -3
  76. package/dist/SelectionBar/index.js +3 -2
  77. package/dist/SendKeys/index.js +3 -2
  78. package/dist/SettingForm/index.js +5 -4
  79. package/dist/SetupWizard/index.js +3 -3
  80. package/dist/ShareDialog/index.js +11 -10
  81. package/dist/SheetColumnEditor/index.js +12 -10
  82. package/dist/SheetGrid/index.js +5 -4
  83. package/dist/SlideFilmstrip/index.js +6 -4
  84. package/dist/Switcher/index.js +10 -9
  85. package/dist/Tabs/index.js +2 -2
  86. package/dist/TagGroup/index.js +3 -2
  87. package/dist/TagsInput/index.js +3 -2
  88. package/dist/ThemeSwitcher/index.js +4 -4
  89. package/dist/TimeRangePicker/index.js +12 -11
  90. package/dist/TimeWindowPicker/index.js +5 -4
  91. package/dist/ToolCallLog/index.js +2 -2
  92. package/dist/TreeCanvas/index.js +4 -3
  93. package/dist/TreeGrid/index.js +9 -8
  94. package/dist/ValueField/index.js +6 -5
  95. package/dist/VersionCompare/index.js +5 -5
  96. package/dist/VersionTimeline/index.js +1 -1
  97. package/dist/{chunk-VBBLHS2Y.js → chunk-25LIX6UI.js} +0 -1
  98. package/dist/{chunk-XKC7EJGR.js → chunk-2DFB7NHX.js} +39 -13
  99. package/dist/{chunk-YHLLBQJA.js → chunk-2EALNWKD.js} +1 -1
  100. package/dist/{chunk-TDRWUWGV.js → chunk-2SSTJDRV.js} +1 -1
  101. package/dist/{chunk-ZLHVKPAQ.js → chunk-4ODGBPYT.js} +2 -2
  102. package/dist/{chunk-EK5NJV6K.js → chunk-4P24HLY3.js} +2 -2
  103. package/dist/{chunk-ERNIXJMN.js → chunk-4RQTYNJB.js} +1 -1
  104. package/dist/{chunk-BE5NESX4.js → chunk-4X33B7RC.js} +1 -1
  105. package/dist/{chunk-LR56IYSL.js → chunk-5V52XBVL.js} +2 -2
  106. package/dist/{chunk-CUQN6WSD.js → chunk-6AU73W3Y.js} +2 -2
  107. package/dist/{chunk-S6ES6MMW.js → chunk-6EJS374X.js} +2 -2
  108. package/dist/{chunk-C4BENQB3.js → chunk-A24SEWF7.js} +2 -2
  109. package/dist/{chunk-5F62NQON.js → chunk-A4XJHBMM.js} +1 -1
  110. package/dist/{chunk-2XC4MYBB.js → chunk-AWBLC4KR.js} +1 -1
  111. package/dist/{chunk-OAWECVU2.js → chunk-B4TAERAM.js} +1 -1
  112. package/dist/{chunk-TEXK4RK6.js → chunk-BGVJBX7E.js} +1 -1
  113. package/dist/{chunk-HWJVQFXQ.js → chunk-BNI2532M.js} +3 -3
  114. package/dist/chunk-CB6MUWCA.js +206 -0
  115. package/dist/chunk-CI4HUVNI.js +197 -0
  116. package/dist/{chunk-FOJ3TVKJ.js → chunk-DON7AM43.js} +1 -1
  117. package/dist/{chunk-WLYNWP34.js → chunk-DZSDUUH6.js} +1 -1
  118. package/dist/{chunk-WASYD3IL.js → chunk-E266WLN7.js} +1 -1
  119. package/dist/{chunk-DDVUPYJW.js → chunk-EDHRJQZT.js} +1 -1
  120. package/dist/{chunk-2OYEVTF4.js → chunk-ESP65SIP.js} +2 -2
  121. package/dist/{chunk-H77NQVS7.js → chunk-ETWGKTMC.js} +1 -1
  122. package/dist/{chunk-237WBIAN.js → chunk-EZO5MYII.js} +1 -1
  123. package/dist/{chunk-SQPT4UZ4.js → chunk-GEFO45DZ.js} +1 -1
  124. package/dist/{chunk-2SGJAD7O.js → chunk-HC5Y4ZVY.js} +1 -1
  125. package/dist/{chunk-WLYAGMZA.js → chunk-HI3AFP34.js} +1 -1
  126. package/dist/{chunk-IF5RMDDV.js → chunk-HQTBYW7G.js} +4 -4
  127. package/dist/{chunk-U7AHXPYA.js → chunk-HWFUKEVT.js} +4 -4
  128. package/dist/{chunk-HUZ27VZ7.js → chunk-IFL6DM5K.js} +1 -1
  129. package/dist/chunk-JNTOZ5LE.js +49 -0
  130. package/dist/{chunk-NJBKJF3Q.js → chunk-JXVDEPBK.js} +3 -3
  131. package/dist/{chunk-YUVQUJND.js → chunk-K657TVMA.js} +1 -1
  132. package/dist/{chunk-NCQC5Y4E.js → chunk-LIOO7OMN.js} +1 -1
  133. package/dist/{chunk-R72QM6WV.js → chunk-LJSW7NWJ.js} +1 -1
  134. package/dist/{chunk-BD2HPIZ2.js → chunk-LN7IMSCU.js} +1 -1
  135. package/dist/{chunk-QR4LRVWK.js → chunk-MI6QDL4N.js} +2 -2
  136. package/dist/{chunk-KIPEB2UV.js → chunk-MKOWEHDH.js} +1 -1
  137. package/dist/{chunk-U2TENSNB.js → chunk-MZAMX65M.js} +1 -1
  138. package/dist/chunk-MZP5A3NQ.js +1 -0
  139. package/dist/{chunk-IAOROOL6.js → chunk-N6LUM6AG.js} +4 -4
  140. package/dist/{chunk-MSKRVYGH.js → chunk-N72QMEEA.js} +1 -1
  141. package/dist/{chunk-Y5GBXHA6.js → chunk-NB5HDW7O.js} +2 -2
  142. package/dist/{chunk-NIII72XP.js → chunk-NCXSYDWQ.js} +2 -2
  143. package/dist/{chunk-ZR276S44.js → chunk-NLYURJUF.js} +2 -2
  144. package/dist/{chunk-R5UTN5QB.js → chunk-NPKNO4RL.js} +3 -3
  145. package/dist/chunk-NQ7LG6BU.js +1 -0
  146. package/dist/{chunk-VNEUVMUR.js → chunk-NXTELLHC.js} +3 -3
  147. package/dist/{chunk-YSYORPVE.js → chunk-OOKLFQMR.js} +2 -2
  148. package/dist/{chunk-J6QNUNZD.js → chunk-ORX3PYX3.js} +1 -1
  149. package/dist/{chunk-QVSG3XSW.js → chunk-QGZPXZHE.js} +2 -2
  150. package/dist/{chunk-2FWNVZSX.js → chunk-QJEC2XZH.js} +2 -2
  151. package/dist/{chunk-4RVDOEJR.js → chunk-RTLBWYVV.js} +2 -2
  152. package/dist/{chunk-7UYWPNFG.js → chunk-RZEUVQJ7.js} +1 -1
  153. package/dist/{chunk-FTOKCN4I.js → chunk-SFBIOHM3.js} +2 -2
  154. package/dist/{chunk-2KQGMYAQ.js → chunk-SHU6ZR7Z.js} +1 -1
  155. package/dist/{chunk-PDQPSTK2.js → chunk-SW7BVEOI.js} +1 -1
  156. package/dist/{chunk-H7V4QAOV.js → chunk-SXCUNON2.js} +1 -1
  157. package/dist/{chunk-ZDENBTBY.js → chunk-SXUKSA6U.js} +1 -1
  158. package/dist/{chunk-G5UBUODG.js → chunk-T2DGBIFD.js} +1 -1
  159. package/dist/{chunk-MFJYXWN5.js → chunk-UN5BTYDI.js} +5 -5
  160. package/dist/{chunk-ZQTEBONP.js → chunk-VNCKUYYT.js} +1 -1
  161. package/dist/{chunk-TN5RHSI5.js → chunk-WM2CPCBH.js} +1 -1
  162. package/dist/{chunk-SETK4FN5.js → chunk-WXMSQOBV.js} +1 -1
  163. package/dist/{chunk-MFRXKQAF.js → chunk-XHQ6BRGS.js} +1 -1
  164. package/dist/{chunk-RYS3SN7J.js → chunk-XTT2XWVQ.js} +1 -1
  165. package/dist/{chunk-ZCKC7ENV.js → chunk-Y22OHIVL.js} +2 -2
  166. package/dist/{chunk-2DESFB7K.js → chunk-YER6BEBM.js} +1 -1
  167. package/dist/{chunk-M4XBRBZL.js → chunk-YNPIGUJF.js} +1 -1
  168. package/dist/{chunk-KQTWO46B.js → chunk-YOGPQDXA.js} +1 -1
  169. package/dist/{chunk-4TLKCRE4.js → chunk-YW3IH3EU.js} +1 -1
  170. package/dist/{chunk-EPVQ4OZ3.js → chunk-YXRMGI4B.js} +1 -1
  171. package/dist/{chunk-NHQ3CXFN.js → chunk-ZUTLS4HX.js} +2 -2
  172. package/dist/generated/index.d.ts +1 -0
  173. package/dist/generated/index.js +120 -115
  174. package/dist/index.js +120 -115
  175. package/dist/session-XDRRVFVE.js +789 -0
  176. package/dist/styles.css +148 -3
  177. package/dist/webSpeech-CJNDQU3D.js +165 -0
  178. package/package.json +3 -3
  179. package/dist/{chunk-UIRMNARM.js → chunk-7RFF2FUG.js} +1 -1
  180. package/dist/{chunk-WGMKERCR.js → chunk-AZQBGKPR.js} +0 -0
  181. package/dist/{chunk-DKE2QLXX.js → chunk-EHEM4QDV.js} +1 -1
  182. package/dist/{chunk-LE7SVMCB.js → chunk-JJEGPEV7.js} +0 -0
  183. package/dist/{chunk-MENY4GKL.js → chunk-N2I2WGZN.js} +1 -1
  184. package/dist/{chunk-Y4A7AYX4.js → chunk-XSJNLTA6.js} +1 -1
@@ -6,8 +6,8 @@ import '../chunk-SHVK6EOL.js';
6
6
  import '../chunk-QRCF7KFB.js';
7
7
  import '../chunk-SWZV6R46.js';
8
8
  import '../chunk-YMFFGPFE.js';
9
- import '../chunk-XDUXAQIS.js';
10
9
  import '../chunk-WSIJDWUG.js';
10
+ import '../chunk-XDUXAQIS.js';
11
11
  import '../chunk-YVMIT2OW.js';
12
12
  import '../chunk-XSPCITPN.js';
13
13
  import '../chunk-TDFLCUBE.js';
@@ -1,6 +1,5 @@
1
1
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
- import './Kbd-YO5U2PSZ.css';
4
3
  import { Fragment } from 'react';
5
4
  import { jsx, jsxs } from 'react/jsx-runtime';
6
5
 
@@ -1,10 +1,13 @@
1
- import { useSendOnEnter, SendKeysHint } from './chunk-YUVQUJND.js';
2
- import { Textarea } from './chunk-ZR276S44.js';
1
+ import { useSendOnEnter, SendKeysHint } from './chunk-K657TVMA.js';
2
+ import { useDictationSlot } from './chunk-CI4HUVNI.js';
3
+ import { Textarea } from './chunk-NLYURJUF.js';
4
+ import { useComposedRef } from './chunk-L72URIHR.js';
3
5
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
4
6
  import { cx } from './chunk-ODEQTPFM.js';
5
7
  import './ChatScale-LGESYXCO.css';
6
- import './Composer-YO275MFX.css';
7
- import { forwardRef, useId } from 'react';
8
+ import './Composer-YCD6UPMO.css';
9
+ import './Dictation-MGLRANB4.css';
10
+ import { forwardRef, useId, useRef } from 'react';
8
11
  import { jsxs, jsx } from 'react/jsx-runtime';
9
12
 
10
13
  var COMPOSER_COUNTER_AT = 0.8;
@@ -24,6 +27,7 @@ var Composer = forwardRef(function Composer2({
24
27
  attachments,
25
28
  attachmentsLabel = "Attached to this message",
26
29
  disabledReason,
30
+ dictation,
27
31
  disabled: disabledProp,
28
32
  placeholder,
29
33
  maxLength,
@@ -35,17 +39,30 @@ var Composer = forwardRef(function Composer2({
35
39
  ...rest
36
40
  }, ref) {
37
41
  const reasonId = useId();
42
+ const dictatingId = useId();
38
43
  const disabled = Boolean(disabledProp) || disabledReason !== void 0;
39
44
  const inline = present(trailing);
40
45
  const near = maxLength !== void 0 && value.length >= maxLength * COMPOSER_COUNTER_AT;
41
- const hasActions = present(actions) || present(tools);
46
+ const field = useRef(null);
47
+ const fieldRef = useComposedRef(ref, field);
48
+ const dictate = useDictationSlot(dictation, {
49
+ label,
50
+ field,
51
+ value,
52
+ onChange,
53
+ heldReason: disabled ? disabledReason ?? "" : void 0
54
+ });
55
+ const live = dictate?.live ?? false;
56
+ const active = dictate?.active ?? false;
57
+ const hasActions = present(actions) || present(tools) || dictate !== null && !inline;
42
58
  const send = useSendOnEnter({
43
59
  onSend: disabled ? void 0 : onSubmit,
44
60
  canSend: canSubmit ?? value.trim() !== "",
45
61
  labels: sendLabels
46
62
  });
47
- const hint = sendHint && send.describedBy !== void 0;
63
+ const hint = sendHint && send.describedBy !== void 0 && !active;
48
64
  const keyDown = (event) => {
65
+ if (dictate?.keyDown(event)) return;
49
66
  onKeyDown?.(event);
50
67
  send.onKeyDown(event);
51
68
  };
@@ -58,6 +75,7 @@ var Composer = forwardRef(function Composer2({
58
75
  inline && "crewlet-composer--inline",
59
76
  value === "" && "is-empty",
60
77
  disabled && "is-disabled",
78
+ live && "is-dictating",
61
79
  className
62
80
  ),
63
81
  children: [
@@ -67,33 +85,41 @@ var Composer = forwardRef(function Composer2({
67
85
  /* @__PURE__ */ jsx(
68
86
  Textarea,
69
87
  {
70
- ref,
88
+ ref: fieldRef,
71
89
  className: "crewlet-composer__field",
72
90
  "aria-label": label,
73
91
  role,
74
92
  "aria-multiline": role === void 0 || role === "textbox" ? true : void 0,
75
- "aria-describedby": cx(describedBy, send.describedBy, disabledReason === void 0 ? void 0 : reasonId) || void 0,
93
+ "aria-describedby": cx(describedBy, !active && send.describedBy, disabledReason === void 0 ? void 0 : reasonId, live && dictatingId) || void 0,
76
94
  value,
77
95
  onChange: (event) => onChange(event.target.value),
78
96
  onKeyDown: keyDown,
79
97
  maxLength,
80
98
  rows: rows ?? (inline ? 1 : 3),
81
99
  disabled,
82
- placeholder: disabledReason ?? placeholder,
100
+ placeholder: live ? "" : disabledReason ?? placeholder,
83
101
  autoResize: true,
84
- ...rest
102
+ ...rest,
103
+ readOnly: active || rest.readOnly
85
104
  }
86
105
  ),
87
- inline ? /* @__PURE__ */ jsx("div", { className: "crewlet-composer__trailing", children: trailing }) : null
106
+ dictate?.layer,
107
+ inline ? /* @__PURE__ */ jsxs("div", { className: "crewlet-composer__trailing", children: [
108
+ dictate?.controls,
109
+ live ? null : trailing
110
+ ] }) : null
88
111
  ] }),
112
+ dictate?.note,
89
113
  send.description,
90
114
  disabledReason === void 0 ? null : /* @__PURE__ */ jsx(VisuallyHidden, { id: reasonId, children: disabledReason }),
115
+ live ? /* @__PURE__ */ jsx(VisuallyHidden, { id: dictatingId, children: dictate?.describe }) : null,
91
116
  hint || near || hasActions ? /* @__PURE__ */ jsxs("div", { className: "crewlet-composer__footer", "data-hint-only": !near && !hasActions || void 0, children: [
92
- present(tools) ? /* @__PURE__ */ jsx("div", { className: "crewlet-composer__tools", children: tools }) : null,
117
+ present(tools) ? /* @__PURE__ */ jsx("div", { className: "crewlet-composer__tools", inert: live, children: tools }) : null,
93
118
  hint ? /* @__PURE__ */ jsx(SendKeysHint, { className: "crewlet-composer__hint", labels: sendLabels, "aria-hidden": true }) : null,
94
119
  near ? /* @__PURE__ */ jsx("span", { className: "crewlet-composer__counter", "aria-live": "polite", children: `${value.length.toLocaleString()} / ${maxLength.toLocaleString()}` }) : null,
95
120
  /* @__PURE__ */ jsx("span", { className: "crewlet-composer__spacer" }),
96
- actions
121
+ inline ? null : dictate?.controls,
122
+ live && !inline ? null : actions
97
123
  ] }) : null
98
124
  ]
99
125
  }
@@ -1,5 +1,5 @@
1
1
  import { useTreeState, useMeasuredSizes, layoutForest, treeAncestors, useLayoutAnchor, treeExpandable, layoutConnectors, treeItemAction, treeStep, treePosInSet, treeSetSize, treeLevel, placeGroups } from './chunk-MY374UUD.js';
2
- import { CANVAS_COMPOSE_CONTEXT, CANVAS_FIT_MAX_ZOOM, Canvas } from './chunk-WLYAGMZA.js';
2
+ import { CANVAS_COMPOSE_CONTEXT, CANVAS_FIT_MAX_ZOOM, Canvas } from './chunk-HI3AFP34.js';
3
3
  import { useMediaMatch, REDUCED_MOTION_QUERY } from './chunk-COS6LJ4K.js';
4
4
  import { focusables } from './chunk-EDPMHSLZ.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,6 +1,6 @@
1
1
  import { Toolbar } from './chunk-NPEI2QAN.js';
2
2
  import { Popover } from './chunk-SWZV6R46.js';
3
- import { Input } from './chunk-ZR276S44.js';
3
+ import { Input } from './chunk-NLYURJUF.js';
4
4
  import { Tooltip } from './chunk-ZF5ELYJ3.js';
5
5
  import { isComposing } from './chunk-EDPMHSLZ.js';
6
6
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,5 +1,5 @@
1
- import { PresetChips } from './chunk-WLYNWP34.js';
2
- import { Input } from './chunk-ZR276S44.js';
1
+ import { PresetChips } from './chunk-DZSDUUH6.js';
2
+ import { Input } from './chunk-NLYURJUF.js';
3
3
  import { useFieldError } from './chunk-JLKO7PSK.js';
4
4
  import { IconButton } from './chunk-66H4BC5Z.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,8 +1,8 @@
1
1
  import { groupInOrder } from './chunk-JADTOJUL.js';
2
2
  import { Text } from './chunk-475DOAWF.js';
3
- import { Checkbox } from './chunk-2DESFB7K.js';
3
+ import { Checkbox } from './chunk-YER6BEBM.js';
4
4
  import { Button } from './chunk-YVMIT2OW.js';
5
- import { Input } from './chunk-ZR276S44.js';
5
+ import { Input } from './chunk-NLYURJUF.js';
6
6
  import { headingTag, useHeadingLevel } from './chunk-PQADV6P6.js';
7
7
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
8
8
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,5 +1,5 @@
1
1
  import { Button } from './chunk-YVMIT2OW.js';
2
- import { FormField } from './chunk-ZR276S44.js';
2
+ import { FormField } from './chunk-NLYURJUF.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './SettingForm-ODVZZ7JZ.css';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -1,7 +1,7 @@
1
1
  import { useMeasuredSizes, isTypeAheadKey, typeAheadBuffer } from './chunk-MY374UUD.js';
2
2
  import { FullscreenToggle } from './chunk-56NHLXZK.js';
3
3
  import { FilterChip } from './chunk-L6HUVA33.js';
4
- import { CANVAS_FIT_PADDING, Canvas } from './chunk-WLYAGMZA.js';
4
+ import { CANVAS_FIT_PADDING, Canvas } from './chunk-HI3AFP34.js';
5
5
  import { Text } from './chunk-475DOAWF.js';
6
6
  import { LayerHost } from './chunk-NCM4VYRF.js';
7
7
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
@@ -1,14 +1,14 @@
1
- import { TagGroup } from './chunk-H7V4QAOV.js';
1
+ import { TagGroup } from './chunk-SXCUNON2.js';
2
2
  import { CursorFlag } from './chunk-MMCYH5LB.js';
3
3
  import { presenceHueClass } from './chunk-EFX2YC5T.js';
4
4
  import { ChangeMark } from './chunk-466TIYTK.js';
5
5
  import { isEmptyValue, displayText, ratingMax, findPerson, findOption, statusTone, editText, textMax, sheetLabels, normalizeValue, sameValue, spokenText, drawnColumns, fitSamples, fittedWidth, columnWidth, SHEET_COLUMN_BOUNDS, sortRows, SHEET_ROW_HEIGHT, cellKey, columnOffsets, SHEET_ROW_NUMBER_WIDTH, rangeOf, presenceByCell, presenceByRow, presenceByColumn, scrollToRow, planClear, visibleRows, cellDescription, nextSort, rowName, inRange, hasPrevious, flagText, toTSV, planPaste, parseTSV, isMod, moveFrom, isTypingKey, editorSide, optionHue, parseText, liveOptions, checkValue } from './chunk-LFSIKGRQ.js';
6
6
  import { presenceLabels } from './chunk-Z7JYG5TF.js';
7
- import { Menu } from './chunk-43N4EHFR.js';
8
7
  import { Popover } from './chunk-SWZV6R46.js';
9
8
  import { Avatar } from './chunk-YMFFGPFE.js';
10
9
  import { Tag } from './chunk-ASBBB5AJ.js';
11
10
  import { StatusDot } from './chunk-QRE6JCHS.js';
11
+ import { Menu } from './chunk-43N4EHFR.js';
12
12
  import { Button } from './chunk-YVMIT2OW.js';
13
13
  import { IconButton } from './chunk-66H4BC5Z.js';
14
14
  import { Tooltip } from './chunk-ZF5ELYJ3.js';
@@ -1,6 +1,6 @@
1
+ import { useReorder } from './chunk-ETWGKTMC.js';
1
2
  import { Menu } from './chunk-43N4EHFR.js';
2
- import { useReorder } from './chunk-H77NQVS7.js';
3
- import { Input } from './chunk-ZR276S44.js';
3
+ import { Input } from './chunk-NLYURJUF.js';
4
4
  import { IconButton } from './chunk-66H4BC5Z.js';
5
5
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
6
6
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,6 +1,6 @@
1
1
  import { Switch } from './chunk-6YYRFGXO.js';
2
- import { useReorder } from './chunk-H77NQVS7.js';
3
- import { Checkbox } from './chunk-2DESFB7K.js';
2
+ import { useReorder } from './chunk-ETWGKTMC.js';
3
+ import { Checkbox } from './chunk-YER6BEBM.js';
4
4
  import { IconButton } from './chunk-66H4BC5Z.js';
5
5
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
6
6
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,6 +1,6 @@
1
1
  import { Button } from './chunk-YVMIT2OW.js';
2
- import { FormField, Label, Input } from './chunk-ZR276S44.js';
3
- import { announce } from './chunk-WGMKERCR.js';
2
+ import { FormField, Label, Input } from './chunk-NLYURJUF.js';
3
+ import { announce } from './chunk-AZQBGKPR.js';
4
4
  import { IconButton } from './chunk-66H4BC5Z.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
6
6
  import './KeyValueRows-US5KW7JK.css';
@@ -1,5 +1,5 @@
1
1
  import { NODE_HUES, NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
2
- import { SegmentedControl } from './chunk-2XC4MYBB.js';
2
+ import { SegmentedControl } from './chunk-AWBLC4KR.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
@@ -1,4 +1,4 @@
1
- import { tabId } from './chunk-Y4A7AYX4.js';
1
+ import { tabId } from './chunk-XSJNLTA6.js';
2
2
  import { useRoving, tabStop } from './chunk-7F3OPUM5.js';
3
3
  import { HIT_AREA_CLASS } from './chunk-2YTOOH3A.js';
4
4
  import { Count } from './chunk-6YKTRAWI.js';
@@ -1,4 +1,4 @@
1
- import { emojiOfShortcode, emojiName, EmojiPicker } from './chunk-TDRWUWGV.js';
1
+ import { emojiOfShortcode, emojiName, EmojiPicker } from './chunk-2SSTJDRV.js';
2
2
  import { heldHint } from './chunk-TDFLCUBE.js';
3
3
  import { Tooltip } from './chunk-ZF5ELYJ3.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
@@ -1,4 +1,4 @@
1
- import { announce } from './chunk-WGMKERCR.js';
1
+ import { announce } from './chunk-AZQBGKPR.js';
2
2
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './CharacterCount-S735DICR.css';
@@ -1,8 +1,8 @@
1
1
  import { useListbox, useHighlightRest } from './chunk-KW7T23RT.js';
2
- import { Kbd } from './chunk-VBBLHS2Y.js';
2
+ import { useScrollerFocus, Modal } from './chunk-YOGPQDXA.js';
3
+ import { Kbd } from './chunk-25LIX6UI.js';
3
4
  import { HIT_AREA_CLASS } from './chunk-2YTOOH3A.js';
4
- import { useScrollerFocus, Modal } from './chunk-KQTWO46B.js';
5
- import { Input } from './chunk-ZR276S44.js';
5
+ import { Input } from './chunk-NLYURJUF.js';
6
6
  import { Count } from './chunk-6YKTRAWI.js';
7
7
  import { isComposing } from './chunk-EDPMHSLZ.js';
8
8
  import { VisuallyHidden } from './chunk-RRRK2KB6.js';
@@ -0,0 +1,206 @@
1
+ import './Dictation-MGLRANB4.css';
2
+
3
+ // src/Dictation/index.ts
4
+
5
+ // src/Dictation/fake.ts
6
+ var FAKE_SCRIPT = [
7
+ "Let\u2019s move the launch review to Thursday morning.",
8
+ "Please send the updated pricing table to the whole team before then.",
9
+ "If the billing page is not ready, we ship the checklist first and follow up next week."
10
+ ];
11
+ function unpunctuated(sentence) {
12
+ return sentence.replace(/[.,!?;:]/g, "").split(/\s+/).filter(Boolean);
13
+ }
14
+ function fakeTransport(options = {}) {
15
+ const script = options.script ?? FAKE_SCRIPT;
16
+ const pace = options.pace ?? 180;
17
+ const calls = [];
18
+ let events = null;
19
+ let timer;
20
+ let sentence = 0;
21
+ let word = 0;
22
+ let spoken = 0;
23
+ const tick = () => {
24
+ if (!events) return;
25
+ const { fail, quietAfter } = options;
26
+ if (fail && spoken >= (fail.after ?? 0)) {
27
+ const out = events;
28
+ events = null;
29
+ out.error(fail.code);
30
+ return;
31
+ }
32
+ if (quietAfter !== void 0 && spoken >= quietAfter) return;
33
+ if (sentence >= script.length) return;
34
+ const words = unpunctuated(script[sentence]);
35
+ word += 1;
36
+ spoken += 1;
37
+ if (word < words.length) events.partial(words.slice(0, word).join(" "));
38
+ else {
39
+ events.final(script[sentence]);
40
+ sentence = options.loop === false ? sentence + 1 : (sentence + 1) % script.length;
41
+ word = 0;
42
+ }
43
+ timer = setTimeout(tick, pace);
44
+ };
45
+ return {
46
+ calls,
47
+ picksDevice: options.picksDevice,
48
+ available: () => options.available ?? true,
49
+ start(deviceId, next) {
50
+ calls.push(`start:${deviceId ?? "default"}`);
51
+ clearTimeout(timer);
52
+ events = next;
53
+ word = 0;
54
+ const { prepare, fail } = options;
55
+ if (fail && !fail.after && (fail.code === "busy" || fail.code === "unavailable")) {
56
+ events = null;
57
+ next.error(fail.code);
58
+ return;
59
+ }
60
+ if (!prepare) {
61
+ timer = setTimeout(tick, pace);
62
+ return;
63
+ }
64
+ const step = (done) => {
65
+ if (events !== next) return;
66
+ if (done < 5) {
67
+ next.preparing?.(done / 5);
68
+ timer = setTimeout(() => step(done + 1), prepare / 5);
69
+ } else {
70
+ next.ready?.();
71
+ timer = setTimeout(tick, pace);
72
+ }
73
+ };
74
+ step(0);
75
+ },
76
+ switchStream(_stream, deviceId) {
77
+ calls.push(`switch:${deviceId ?? "default"}`);
78
+ },
79
+ flush() {
80
+ calls.push("flush");
81
+ clearTimeout(timer);
82
+ const out = events;
83
+ events = null;
84
+ return new Promise((resolve) => {
85
+ setTimeout(() => {
86
+ if (out && word > 0) {
87
+ out.final(`${unpunctuated(script[sentence]).slice(0, word).join(" ")}.`);
88
+ sentence = (sentence + 1) % script.length;
89
+ word = 0;
90
+ }
91
+ resolve();
92
+ }, options.flushDelay ?? 120);
93
+ });
94
+ },
95
+ cancel() {
96
+ calls.push("cancel");
97
+ clearTimeout(timer);
98
+ events = null;
99
+ }
100
+ };
101
+ }
102
+ var FAKE_DEVICES = [
103
+ { deviceId: "default", label: "Default - Studio Display Microphone" },
104
+ { deviceId: "studio", label: "Studio Display Microphone" },
105
+ { deviceId: "headset", label: "Wireless Headset" }
106
+ ];
107
+ function named(name) {
108
+ return Object.assign(new Error(name), { name });
109
+ }
110
+ function fakeMicrophone(options = {}) {
111
+ let permission = options.permission ?? "granted";
112
+ let devices = [...options.devices ?? FAKE_DEVICES];
113
+ const permissionListeners = /* @__PURE__ */ new Set();
114
+ const deviceListeners = /* @__PURE__ */ new Set();
115
+ const open = /* @__PURE__ */ new Set();
116
+ let waiting = null;
117
+ const capture = () => {
118
+ const handle = { ended: /* @__PURE__ */ new Set() };
119
+ open.add(handle);
120
+ const born = Date.now();
121
+ return {
122
+ stream: null,
123
+ level() {
124
+ if (options.level === "silent") return 0;
125
+ const t = Date.now() - born;
126
+ return Math.min(1, 0.2 + 0.6 * Math.abs(Math.sin(t / 140) * Math.sin(t / 410 + 1)));
127
+ },
128
+ onEnded(listener) {
129
+ handle.ended.add(listener);
130
+ },
131
+ stop() {
132
+ open.delete(handle);
133
+ }
134
+ };
135
+ };
136
+ return {
137
+ check: () => options.block,
138
+ permission: async () => permission,
139
+ onPermissionChange(listener) {
140
+ permissionListeners.add(listener);
141
+ return () => permissionListeners.delete(listener);
142
+ },
143
+ devices: async () => permission === "granted" ? devices : devices.slice(0, 1).map(() => ({ deviceId: "", label: "" })),
144
+ onDeviceChange(listener) {
145
+ deviceListeners.add(listener);
146
+ return () => deviceListeners.delete(listener);
147
+ },
148
+ async open(deviceId) {
149
+ switch (options.open) {
150
+ case "denied":
151
+ permission = "denied";
152
+ throw named("NotAllowedError");
153
+ case "missing":
154
+ throw named("NotFoundError");
155
+ case "busy":
156
+ throw named("NotReadableError");
157
+ case "wait":
158
+ if (permission !== "granted")
159
+ await new Promise((resolve) => {
160
+ waiting = resolve;
161
+ });
162
+ }
163
+ if (deviceId !== void 0 && !devices.some((d) => d.deviceId === deviceId)) throw named("OverconstrainedError");
164
+ permission = "granted";
165
+ return capture();
166
+ },
167
+ unplug() {
168
+ for (const handle of [...open]) for (const listener of handle.ended) listener();
169
+ devices = devices.slice(0, -1);
170
+ for (const listener of deviceListeners) listener();
171
+ },
172
+ setPermission(state) {
173
+ permission = state;
174
+ for (const listener of permissionListeners) listener(state);
175
+ },
176
+ setDevices(next) {
177
+ devices = [...next];
178
+ for (const listener of deviceListeners) listener();
179
+ },
180
+ settle() {
181
+ waiting?.();
182
+ waiting = null;
183
+ },
184
+ get openCount() {
185
+ return open.size;
186
+ }
187
+ };
188
+ }
189
+
190
+ // src/Dictation/webSpeechLocal.ts
191
+ function webSpeechLocalTransport(options = {}) {
192
+ let route = null;
193
+ const load = async () => route ??= (await import('./webSpeech-CJNDQU3D.js')).createWebSpeechLocal(options);
194
+ return {
195
+ get picksDevice() {
196
+ return route?.picksDevice;
197
+ },
198
+ available: async () => (await load()).available(),
199
+ start: async (deviceId, events, stream) => (await load()).start(deviceId, events, stream),
200
+ switchStream: (stream, deviceId) => route?.switchStream?.(stream, deviceId),
201
+ flush: () => route?.flush() ?? Promise.resolve(),
202
+ cancel: () => route?.cancel()
203
+ };
204
+ }
205
+
206
+ export { FAKE_DEVICES, FAKE_SCRIPT, fakeMicrophone, fakeTransport, webSpeechLocalTransport };