@crewlethq/ui 0.190.2 → 0.192.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 (160) hide show
  1. package/README.md +11 -3
  2. package/dist/AgentHandoffPanel/AgentHandoffPanel.d.ts +4 -1
  3. package/dist/AgentHandoffPanel/index.js +11 -7
  4. package/dist/AgentIdentity/index.js +8 -7
  5. package/dist/Announcer/index.js +2 -1
  6. package/dist/AppShell/index.js +4 -3
  7. package/dist/ArrangeFrame/index.js +3 -2
  8. package/dist/ArrangeList/index.js +7 -6
  9. package/dist/ArtifactBar/index.js +3 -2
  10. package/dist/ArtifactCard/index.js +6 -5
  11. package/dist/AvatarPicker/index.js +1 -1
  12. package/dist/Canvas/index.js +3 -2
  13. package/dist/CanvasBoard/index.js +5 -4
  14. package/dist/CanvasToolbar/index.js +4 -3
  15. package/dist/CharacterCount/index.js +3 -2
  16. package/dist/CheckGrid/index.js +6 -5
  17. package/dist/Checkbox/index.js +5 -4
  18. package/dist/ChipField/index.js +3 -2
  19. package/dist/ColorField/index.js +5 -4
  20. package/dist/Combobox/index.js +5 -4
  21. package/dist/CommandPalette/index.js +10 -8
  22. package/dist/CommentThread/CommentThread.d.ts +4 -1
  23. package/dist/CommentThread/index.js +11 -7
  24. package/dist/Composer/Composer.d.ts +7 -0
  25. package/dist/Composer/index.d.ts +1 -0
  26. package/dist/Composer/index.js +12 -6
  27. package/dist/{Composer-YO275MFX.css → Composer-YCD6UPMO.css} +3 -2
  28. package/dist/ConfirmField/index.js +5 -4
  29. package/dist/ConsequenceList/index.js +6 -5
  30. package/dist/DataGrid/index.js +7 -6
  31. package/dist/DataTable/index.js +8 -7
  32. package/dist/DataView/index.js +12 -10
  33. package/dist/Dictation/fake.d.ts +59 -0
  34. package/dist/Dictation/index.d.ts +8 -0
  35. package/dist/Dictation/index.js +17 -0
  36. package/dist/Dictation/labels.d.ts +4 -0
  37. package/dist/Dictation/machine.d.ts +126 -0
  38. package/dist/Dictation/microphone.d.ts +5 -0
  39. package/dist/Dictation/session.d.ts +31 -0
  40. package/dist/Dictation/slot.d.ts +69 -0
  41. package/dist/Dictation/types.d.ts +158 -0
  42. package/dist/Dictation/webSpeech.d.ts +13 -0
  43. package/dist/Dictation/webSpeechLocal.d.ts +9 -0
  44. package/dist/Dictation-MGLRANB4.css +141 -0
  45. package/dist/DocTabsEditor/index.js +6 -5
  46. package/dist/DurationField/index.js +6 -5
  47. package/dist/{Editor-FZOUNP6V.js → Editor-ZQUOI3WV.js} +5 -4
  48. package/dist/EmojiPicker/index.js +5 -4
  49. package/dist/GraphCanvas/index.js +4 -3
  50. package/dist/InlineEditor/index.js +3 -2
  51. package/dist/Input/index.js +4 -3
  52. package/dist/Kbd/index.js +2 -1
  53. package/dist/KeyValueRows/index.js +5 -4
  54. package/dist/LinkInterstitial/index.js +8 -7
  55. package/dist/ListInput/index.js +8 -6
  56. package/dist/MemberPicker/index.js +6 -5
  57. package/dist/MessageActions/index.js +6 -5
  58. package/dist/Modal/index.js +7 -6
  59. package/dist/MoneyField/index.js +5 -4
  60. package/dist/NewItemsNotice/index.js +3 -2
  61. package/dist/NumberField/index.js +5 -4
  62. package/dist/OrgTable/index.js +9 -8
  63. package/dist/PrincipalPicker/index.js +6 -5
  64. package/dist/ProposalCard/index.js +8 -7
  65. package/dist/ReactionBar/index.js +6 -5
  66. package/dist/Reorder/index.js +3 -2
  67. package/dist/RichEditor/index.js +1 -1
  68. package/dist/ScopeList/index.js +6 -5
  69. package/dist/SelectionBar/index.js +3 -2
  70. package/dist/SendKeys/index.js +3 -2
  71. package/dist/SettingForm/index.js +5 -4
  72. package/dist/ShareDialog/index.js +8 -7
  73. package/dist/SheetColumnEditor/index.js +8 -6
  74. package/dist/SheetGrid/index.js +5 -4
  75. package/dist/SlideFilmstrip/index.js +6 -4
  76. package/dist/Switcher/index.js +8 -7
  77. package/dist/TagGroup/index.js +3 -2
  78. package/dist/TagsInput/index.js +3 -2
  79. package/dist/TimeRangePicker/index.js +8 -7
  80. package/dist/TimeWindowPicker/index.js +5 -4
  81. package/dist/TreeCanvas/index.js +4 -3
  82. package/dist/TreeGrid/index.js +8 -7
  83. package/dist/ValueField/index.js +6 -5
  84. package/dist/VersionCompare/index.js +1 -1
  85. package/dist/{chunk-VBBLHS2Y.js → chunk-25LIX6UI.js} +0 -1
  86. package/dist/{chunk-XKC7EJGR.js → chunk-2DFB7NHX.js} +39 -13
  87. package/dist/{chunk-YHLLBQJA.js → chunk-2EALNWKD.js} +1 -1
  88. package/dist/{chunk-TDRWUWGV.js → chunk-2SSTJDRV.js} +1 -1
  89. package/dist/{chunk-VNEUVMUR.js → chunk-2ZNOHIT4.js} +2 -2
  90. package/dist/{chunk-EK5NJV6K.js → chunk-4P24HLY3.js} +2 -2
  91. package/dist/{chunk-ERNIXJMN.js → chunk-4RQTYNJB.js} +1 -1
  92. package/dist/{chunk-BE5NESX4.js → chunk-4X33B7RC.js} +1 -1
  93. package/dist/{chunk-NIII72XP.js → chunk-5AOJFG2K.js} +1 -1
  94. package/dist/{chunk-ZLHVKPAQ.js → chunk-5PCC5XTZ.js} +1 -1
  95. package/dist/{chunk-IAOROOL6.js → chunk-5YYAI32W.js} +4 -4
  96. package/dist/{chunk-CUQN6WSD.js → chunk-6AU73W3Y.js} +2 -2
  97. package/dist/{chunk-S6ES6MMW.js → chunk-6EJS374X.js} +2 -2
  98. package/dist/{chunk-C4BENQB3.js → chunk-A24SEWF7.js} +2 -2
  99. package/dist/{chunk-NHQ3CXFN.js → chunk-ANCFMQBV.js} +1 -1
  100. package/dist/{chunk-OAWECVU2.js → chunk-B4TAERAM.js} +1 -1
  101. package/dist/{chunk-TEXK4RK6.js → chunk-BGVJBX7E.js} +1 -1
  102. package/dist/chunk-CB6MUWCA.js +206 -0
  103. package/dist/{chunk-R72QM6WV.js → chunk-CC4TFCOT.js} +4 -1
  104. package/dist/chunk-CI4HUVNI.js +197 -0
  105. package/dist/{chunk-SETK4FN5.js → chunk-CVNUXLMI.js} +1 -1
  106. package/dist/{chunk-FOJ3TVKJ.js → chunk-DON7AM43.js} +1 -1
  107. package/dist/{chunk-DDVUPYJW.js → chunk-EDHRJQZT.js} +1 -1
  108. package/dist/{chunk-HWJVQFXQ.js → chunk-EJDWUXFJ.js} +3 -3
  109. package/dist/{chunk-H77NQVS7.js → chunk-ETWGKTMC.js} +1 -1
  110. package/dist/{chunk-237WBIAN.js → chunk-EZO5MYII.js} +1 -1
  111. package/dist/{chunk-SQPT4UZ4.js → chunk-GEFO45DZ.js} +1 -1
  112. package/dist/{chunk-2SGJAD7O.js → chunk-HC5Y4ZVY.js} +1 -1
  113. package/dist/{chunk-WLYAGMZA.js → chunk-HI3AFP34.js} +1 -1
  114. package/dist/{chunk-WASYD3IL.js → chunk-I6D4QYZL.js} +4 -2
  115. package/dist/{chunk-HUZ27VZ7.js → chunk-IFL6DM5K.js} +1 -1
  116. package/dist/chunk-JNTOZ5LE.js +49 -0
  117. package/dist/{chunk-YUVQUJND.js → chunk-K657TVMA.js} +1 -1
  118. package/dist/{chunk-NCQC5Y4E.js → chunk-LIOO7OMN.js} +1 -1
  119. package/dist/{chunk-BD2HPIZ2.js → chunk-LN7IMSCU.js} +1 -1
  120. package/dist/{chunk-R5UTN5QB.js → chunk-LNPN3DV2.js} +2 -2
  121. package/dist/{chunk-KIPEB2UV.js → chunk-MKOWEHDH.js} +1 -1
  122. package/dist/{chunk-U2TENSNB.js → chunk-MZAMX65M.js} +1 -1
  123. package/dist/chunk-MZP5A3NQ.js +1 -0
  124. package/dist/{chunk-2OYEVTF4.js → chunk-N2AIHIYX.js} +2 -2
  125. package/dist/{chunk-MSKRVYGH.js → chunk-N72QMEEA.js} +1 -1
  126. package/dist/{chunk-Y5GBXHA6.js → chunk-NB5HDW7O.js} +2 -2
  127. package/dist/{chunk-ZR276S44.js → chunk-NLYURJUF.js} +2 -2
  128. package/dist/chunk-NQ7LG6BU.js +1 -0
  129. package/dist/{chunk-J6QNUNZD.js → chunk-ORX3PYX3.js} +1 -1
  130. package/dist/{chunk-QVSG3XSW.js → chunk-QGZPXZHE.js} +2 -2
  131. package/dist/{chunk-2FWNVZSX.js → chunk-QJEC2XZH.js} +2 -2
  132. package/dist/{chunk-4RVDOEJR.js → chunk-RTLBWYVV.js} +2 -2
  133. package/dist/{chunk-FTOKCN4I.js → chunk-SFBIOHM3.js} +2 -2
  134. package/dist/{chunk-H7V4QAOV.js → chunk-SXCUNON2.js} +1 -1
  135. package/dist/{chunk-ZDENBTBY.js → chunk-SXUKSA6U.js} +1 -1
  136. package/dist/{chunk-G5UBUODG.js → chunk-T2DGBIFD.js} +1 -1
  137. package/dist/{chunk-LR56IYSL.js → chunk-TJFJMMCR.js} +2 -2
  138. package/dist/{chunk-MFJYXWN5.js → chunk-UN5BTYDI.js} +5 -5
  139. package/dist/{chunk-ZQTEBONP.js → chunk-VNCKUYYT.js} +1 -1
  140. package/dist/{chunk-MFRXKQAF.js → chunk-XHQ6BRGS.js} +1 -1
  141. package/dist/{chunk-NJBKJF3Q.js → chunk-XKFZBWXA.js} +2 -2
  142. package/dist/{chunk-U7AHXPYA.js → chunk-XLB7QIXK.js} +3 -3
  143. package/dist/{chunk-IF5RMDDV.js → chunk-XLOBTFLR.js} +3 -3
  144. package/dist/{chunk-RYS3SN7J.js → chunk-XTT2XWVQ.js} +1 -1
  145. package/dist/{chunk-ZCKC7ENV.js → chunk-Y22OHIVL.js} +2 -2
  146. package/dist/{chunk-2DESFB7K.js → chunk-YER6BEBM.js} +1 -1
  147. package/dist/{chunk-M4XBRBZL.js → chunk-YNPIGUJF.js} +1 -1
  148. package/dist/{chunk-KQTWO46B.js → chunk-YOGPQDXA.js} +1 -1
  149. package/dist/{chunk-4TLKCRE4.js → chunk-YW3IH3EU.js} +1 -1
  150. package/dist/{chunk-EPVQ4OZ3.js → chunk-YXRMGI4B.js} +1 -1
  151. package/dist/{chunk-QR4LRVWK.js → chunk-ZH45BDTS.js} +1 -1
  152. package/dist/generated/index.d.ts +1 -0
  153. package/dist/generated/index.js +96 -91
  154. package/dist/index.js +96 -91
  155. package/dist/session-XDRRVFVE.js +789 -0
  156. package/dist/styles.css +148 -3
  157. package/dist/webSpeech-CJNDQU3D.js +165 -0
  158. package/package.json +3 -3
  159. /package/dist/{chunk-WGMKERCR.js → chunk-AZQBGKPR.js} +0 -0
  160. /package/dist/{chunk-LE7SVMCB.js → chunk-JJEGPEV7.js} +0 -0
@@ -1,20 +1,21 @@
1
- export { ChooserList, ColumnChooser, DATA_GRID_ICON_TRACK, DataGrid, columnChoicesOf, countDataGridRows, fitGridColumns, sortGridRows, useAnyDataGridDriving, useDataGridDriving } from '../chunk-NJBKJF3Q.js';
1
+ export { ChooserList, ColumnChooser, DATA_GRID_ICON_TRACK, DataGrid, columnChoicesOf, countDataGridRows, fitGridColumns, sortGridRows, useAnyDataGridDriving, useDataGridDriving } from '../chunk-XKFZBWXA.js';
2
2
  export { nextGridSort, parseGridSort } from '../chunk-T76E2NIF.js';
3
3
  import '../chunk-WFAJYBLX.js';
4
- import '../chunk-H77NQVS7.js';
4
+ import '../chunk-ETWGKTMC.js';
5
5
  import '../chunk-HG7J6I65.js';
6
6
  import '../chunk-SK4BIFTG.js';
7
7
  import '../chunk-COS6LJ4K.js';
8
- import '../chunk-2DESFB7K.js';
8
+ import '../chunk-YER6BEBM.js';
9
9
  import '../chunk-WSIJDWUG.js';
10
10
  import '../chunk-YVMIT2OW.js';
11
11
  import '../chunk-XSPCITPN.js';
12
- import '../chunk-ZR276S44.js';
12
+ import '../chunk-NLYURJUF.js';
13
13
  import '../chunk-NICEDVZM.js';
14
14
  import '../chunk-JLKO7PSK.js';
15
15
  import '../chunk-AKLZJTOJ.js';
16
- import '../chunk-TEXK4RK6.js';
17
- import '../chunk-WGMKERCR.js';
16
+ import '../chunk-BGVJBX7E.js';
17
+ import '../chunk-MZP5A3NQ.js';
18
+ import '../chunk-AZQBGKPR.js';
18
19
  import '../chunk-66H4BC5Z.js';
19
20
  import '../chunk-TDFLCUBE.js';
20
21
  import '../chunk-ZF5ELYJ3.js';
@@ -1,11 +1,11 @@
1
- export { ALL_ITEMS, CopyableCell, DATA_TABLE_LABELS, DataTable, RowActionsMenu } from '../chunk-VNEUVMUR.js';
1
+ export { ALL_ITEMS, CopyableCell, DATA_TABLE_LABELS, DataTable, RowActionsMenu } from '../chunk-2ZNOHIT4.js';
2
2
  import '../chunk-WGLOH33S.js';
3
3
  import '../chunk-AV2DXAEL.js';
4
4
  import '../chunk-43N4EHFR.js';
5
5
  import '../chunk-STJ7QBC3.js';
6
6
  import '../chunk-DTIW4CHZ.js';
7
- import '../chunk-KQTWO46B.js';
8
- import '../chunk-237WBIAN.js';
7
+ import '../chunk-YOGPQDXA.js';
8
+ import '../chunk-EZO5MYII.js';
9
9
  import '../chunk-XXHIU65G.js';
10
10
  import '../chunk-7XUP32RY.js';
11
11
  import '../chunk-RK4XPHVG.js';
@@ -13,17 +13,18 @@ import '../chunk-E3XKFND2.js';
13
13
  import '../chunk-T4JEGIUW.js';
14
14
  import '../chunk-ASBBB5AJ.js';
15
15
  import '../chunk-QRE6JCHS.js';
16
- import '../chunk-2DESFB7K.js';
16
+ import '../chunk-YER6BEBM.js';
17
17
  import '../chunk-WSIJDWUG.js';
18
18
  import '../chunk-RUROK3EU.js';
19
19
  import '../chunk-YVMIT2OW.js';
20
20
  import '../chunk-XSPCITPN.js';
21
- import '../chunk-ZR276S44.js';
21
+ import '../chunk-NLYURJUF.js';
22
22
  import '../chunk-NICEDVZM.js';
23
23
  import '../chunk-JLKO7PSK.js';
24
24
  import '../chunk-AKLZJTOJ.js';
25
- import '../chunk-TEXK4RK6.js';
26
- import '../chunk-WGMKERCR.js';
25
+ import '../chunk-BGVJBX7E.js';
26
+ import '../chunk-MZP5A3NQ.js';
27
+ import '../chunk-AZQBGKPR.js';
27
28
  import '../chunk-66H4BC5Z.js';
28
29
  import '../chunk-TDFLCUBE.js';
29
30
  import '../chunk-ZF5ELYJ3.js';
@@ -1,21 +1,22 @@
1
- export { DATA_VIEW_TOOLBAR_LABELS, DataView, DataViewToolbar, FILTER_AXIS_LABELS, FilterAxisBar, FilterAxisChip, applyColumnFilters, applyFilters, blankFilterValue, defaultOperator, filterDefsFromColumns, filterHasValue, filterPredicate, formatFilterValue, operatorOf, tableColumns } from '../chunk-IAOROOL6.js';
1
+ export { DATA_VIEW_TOOLBAR_LABELS, DataView, DataViewToolbar, FILTER_AXIS_LABELS, FilterAxisBar, FilterAxisChip, applyColumnFilters, applyFilters, blankFilterValue, defaultOperator, filterDefsFromColumns, filterHasValue, filterPredicate, formatFilterValue, operatorOf, tableColumns } from '../chunk-5YYAI32W.js';
2
2
  import '../chunk-FPDIHEM4.js';
3
3
  import '../chunk-GR6Y53EC.js';
4
4
  import '../chunk-LY7XCIMS.js';
5
- import '../chunk-VNEUVMUR.js';
5
+ import '../chunk-2ZNOHIT4.js';
6
6
  import '../chunk-KW7T23RT.js';
7
7
  import '../chunk-EE3DJMSQ.js';
8
8
  import '../chunk-NPEI2QAN.js';
9
9
  import '../chunk-5ZL3PXEL.js';
10
10
  import '../chunk-WGLOH33S.js';
11
11
  import '../chunk-AV2DXAEL.js';
12
- import '../chunk-43N4EHFR.js';
13
12
  import '../chunk-SWZV6R46.js';
14
- import '../chunk-VBBLHS2Y.js';
13
+ import '../chunk-NQ7LG6BU.js';
14
+ import '../chunk-25LIX6UI.js';
15
+ import '../chunk-43N4EHFR.js';
15
16
  import '../chunk-STJ7QBC3.js';
16
17
  import '../chunk-DTIW4CHZ.js';
17
- import '../chunk-KQTWO46B.js';
18
- import '../chunk-237WBIAN.js';
18
+ import '../chunk-YOGPQDXA.js';
19
+ import '../chunk-EZO5MYII.js';
19
20
  import '../chunk-XXHIU65G.js';
20
21
  import '../chunk-7XUP32RY.js';
21
22
  import '../chunk-RK4XPHVG.js';
@@ -23,17 +24,18 @@ import '../chunk-E3XKFND2.js';
23
24
  import '../chunk-T4JEGIUW.js';
24
25
  import '../chunk-ASBBB5AJ.js';
25
26
  import '../chunk-QRE6JCHS.js';
26
- import '../chunk-2DESFB7K.js';
27
+ import '../chunk-YER6BEBM.js';
27
28
  import '../chunk-WSIJDWUG.js';
28
29
  import '../chunk-RUROK3EU.js';
29
30
  import '../chunk-YVMIT2OW.js';
30
31
  import '../chunk-XSPCITPN.js';
31
- import '../chunk-ZR276S44.js';
32
+ import '../chunk-NLYURJUF.js';
32
33
  import '../chunk-NICEDVZM.js';
33
34
  import '../chunk-JLKO7PSK.js';
34
35
  import '../chunk-AKLZJTOJ.js';
35
- import '../chunk-TEXK4RK6.js';
36
- import '../chunk-WGMKERCR.js';
36
+ import '../chunk-BGVJBX7E.js';
37
+ import '../chunk-MZP5A3NQ.js';
38
+ import '../chunk-AZQBGKPR.js';
37
39
  import '../chunk-66H4BC5Z.js';
38
40
  import '../chunk-TDFLCUBE.js';
39
41
  import '../chunk-ZF5ELYJ3.js';
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Deterministic doubles for stories, tests and demos: a transport that speaks
3
+ * a script and a microphone that opens, refuses or unplugs on request.
4
+ */
5
+ import type { DictationBlock, DictationDevice, DictationErrorCode, DictationMicrophone, DictationPermission, DictationTransport } from './types.js';
6
+ export declare const FAKE_SCRIPT: readonly string[];
7
+ export interface FakeTransportOptions {
8
+ /** Sentences said in turn: each a word at a time as provisional text, then sent punctuated. */
9
+ script?: readonly string[] | undefined;
10
+ /** Milliseconds between words. */
11
+ pace?: number | undefined;
12
+ /** Ends the session with `code` after `after` words (0 by default). */
13
+ fail?: {
14
+ code: DictationErrorCode;
15
+ after?: number | undefined;
16
+ } | undefined;
17
+ /** Stops speaking after this many words, with the session left open. */
18
+ quietAfter?: number | undefined;
19
+ /** Milliseconds `flush` takes to send the last words. */
20
+ flushDelay?: number | undefined;
21
+ /** Starts the script again after its last sentence (true by default). */
22
+ loop?: boolean | undefined;
23
+ /** Milliseconds spent preparing (a model loading) before the first word, with progress. */
24
+ prepare?: number | undefined;
25
+ /** What `available()` answers; true by default. */
26
+ available?: boolean | undefined;
27
+ /** The browser, not the chosen device, picks the microphone on this route. */
28
+ picksDevice?: boolean | undefined;
29
+ }
30
+ export interface FakeTransport extends DictationTransport {
31
+ /** Every call the composer made, in order: `start:<device>`, `switch:<device>`, `flush`, `cancel`. */
32
+ readonly calls: string[];
33
+ }
34
+ /** A transport that says `script`, the same way every run. */
35
+ export declare function fakeTransport(options?: FakeTransportOptions): FakeTransport;
36
+ export declare const FAKE_DEVICES: readonly DictationDevice[];
37
+ export interface FakeMicrophoneOptions {
38
+ devices?: readonly DictationDevice[] | undefined;
39
+ permission?: DictationPermission | undefined;
40
+ /** What opening a device does; `wait` asks, and settles only when `settle()` is called. */
41
+ open?: 'ok' | 'denied' | 'missing' | 'busy' | 'wait' | undefined;
42
+ /** Why capture cannot work in this page. */
43
+ block?: DictationBlock | undefined;
44
+ /** A level that moves like speech, or silence. */
45
+ level?: 'speech' | 'silent' | undefined;
46
+ }
47
+ export interface FakeMicrophone extends DictationMicrophone {
48
+ /** Takes the open device away, as pulling its cable does. */
49
+ unplug(): void;
50
+ /** Changes the permission, as the browser's site settings do. */
51
+ setPermission(state: DictationPermission): void;
52
+ setDevices(devices: readonly DictationDevice[]): void;
53
+ /** Settles a pending `open` (`open: 'wait'`) as allowed. */
54
+ settle(): void;
55
+ /** How many devices are open now. */
56
+ readonly openCount: number;
57
+ }
58
+ /** A microphone that does what it is told, with a level that moves like speech. */
59
+ export declare function fakeMicrophone(options?: FakeMicrophoneOptions): FakeMicrophone;
@@ -0,0 +1,8 @@
1
+ import './Dictation.css';
2
+ export { DICTATION_SHORTCUT, preloadDictation } from './slot.js';
3
+ export { DICTATION_LABELS, dictationLabels } from './labels.js';
4
+ export { FAKE_DEVICES, FAKE_SCRIPT, fakeMicrophone, fakeTransport } from './fake.js';
5
+ export type { FakeMicrophone, FakeMicrophoneOptions, FakeTransport, FakeTransportOptions } from './fake.js';
6
+ export { webSpeechLocalTransport } from './webSpeechLocal.js';
7
+ export type { WebSpeechLocalOptions } from './webSpeechLocal.js';
8
+ export type { DictationBlock, DictationCapture, DictationDevice, DictationErrorCode, DictationLabels, DictationMicrophone, DictationPermission, DictationSource, DictationStopReason, DictationTransport, DictationTransportEvents, } from './types.js';
@@ -0,0 +1,17 @@
1
+ export { FAKE_DEVICES, FAKE_SCRIPT, fakeMicrophone, fakeTransport, webSpeechLocalTransport } from '../chunk-CB6MUWCA.js';
2
+ export { DICTATION_LABELS, dictationLabels } from '../chunk-JNTOZ5LE.js';
3
+ export { DICTATION_SHORTCUT, preloadDictation } from '../chunk-CI4HUVNI.js';
4
+ import '../chunk-25LIX6UI.js';
5
+ import '../chunk-43N4EHFR.js';
6
+ import '../chunk-YVMIT2OW.js';
7
+ import '../chunk-XSPCITPN.js';
8
+ import '../chunk-66H4BC5Z.js';
9
+ import '../chunk-TDFLCUBE.js';
10
+ import '../chunk-ZF5ELYJ3.js';
11
+ import '../chunk-HTS5RJ7S.js';
12
+ import '../chunk-L72URIHR.js';
13
+ import '../chunk-NCM4VYRF.js';
14
+ import '../chunk-EDPMHSLZ.js';
15
+ import '../chunk-4ITETIGZ.js';
16
+ import '../chunk-RRRK2KB6.js';
17
+ import '../chunk-ODEQTPFM.js';
@@ -0,0 +1,4 @@
1
+ import type { DictationLabels } from './types.js';
2
+ export declare const DICTATION_LABELS: DictationLabels;
3
+ /** A source's labels over the defaults. */
4
+ export declare function dictationLabels(overrides: Partial<DictationLabels> | undefined): DictationLabels;
@@ -0,0 +1,126 @@
1
+ /**
2
+ * Dictation's state machine, one per tab: at most one session, the
3
+ * microphone's permission and devices, and the words a session holds until
4
+ * Accept splices them into the draft with one `onChange`.
5
+ */
6
+ import type { KeyboardEvent } from 'react';
7
+ import type { MenuEntry } from '../Menu/index.js';
8
+ import { type DictationOwner } from './slot.js';
9
+ import type { DictationCapture, DictationDevice, DictationLabels, DictationMicrophone, DictationPermission, DictationSource, DictationStopReason, DictationTransport } from './types.js';
10
+ /** How long Accept waits for the last words before inserting what it has. */
11
+ export declare const FLUSH_MS = 1500;
12
+ /** The level under which the room counts as silent. */
13
+ export declare const SILENT_LEVEL = 0.08;
14
+ export type DictationPhase = 'pending' | 'preparing' | 'listening' | 'stopped' | 'accepting';
15
+ /** What one microphone is known to allow, per tab. */
16
+ export interface MicState {
17
+ mic: DictationMicrophone;
18
+ permission: DictationPermission;
19
+ /** Null until listed. */
20
+ devices: DictationDevice[] | null;
21
+ /** The device in use; undefined is the default. */
22
+ chosen: string | undefined;
23
+ /** The remembered device is not connected, so the default is used. */
24
+ gone: boolean;
25
+ /** The last route used lets the browser pick the microphone. */
26
+ picks: boolean;
27
+ }
28
+ export interface Session {
29
+ owner: DictationOwner;
30
+ label: string;
31
+ source: DictationSource;
32
+ labels: DictationLabels;
33
+ mic: MicState;
34
+ /** The draft and selection when the session began. */
35
+ value: string;
36
+ from: number;
37
+ to: number;
38
+ finals: string[];
39
+ partial: string;
40
+ phase: DictationPhase;
41
+ reason: DictationStopReason | null;
42
+ quiet: boolean;
43
+ capture: DictationCapture | null;
44
+ /** The route in use, and its place in the source's list. */
45
+ transport: DictationTransport | null;
46
+ index: number;
47
+ /** Before the route's first word or `ready`: a `busy` or `unavailable` moves to the next route. */
48
+ opening: boolean;
49
+ /** The route said it is preparing, so it will say when it is ready. */
50
+ prepared: boolean;
51
+ progress: number | undefined;
52
+ /** Why the routes tried so far declined: `busy` outranks `unavailable`. */
53
+ declined: 'busy' | 'unavailable' | null;
54
+ /** The transport has nothing more to send. */
55
+ ended: boolean;
56
+ flushing: Promise<void> | null;
57
+ heard: number;
58
+ timer: ReturnType<typeof setInterval> | undefined;
59
+ /** Accepted, cancelled or released: nothing it does reaches the composer now. */
60
+ over: boolean;
61
+ }
62
+ export declare function subscribeWords(listener: () => void): () => void;
63
+ export declare function wordsVersion(): number;
64
+ export declare function activeSession(): Session | null;
65
+ /** Whether the words so far can be added to by pressing the mic again. */
66
+ export declare function resumable(reason: DictationStopReason | null): boolean;
67
+ /** A source's microphone, probed for its permission and devices the first time it is asked for. */
68
+ export declare function micState(source: DictationSource): MicState;
69
+ export interface DictationView {
70
+ phase: DictationPhase | null;
71
+ held: string | undefined;
72
+ /** Draw the mic-off glyph: the browser blocked the microphone. */
73
+ off: boolean;
74
+ /** Held because another composer is dictating. */
75
+ elsewhere: boolean;
76
+ note: string | undefined;
77
+ describe: string;
78
+ /** The mic's name while it resumes a paused session, else undefined. */
79
+ resume: string | undefined;
80
+ }
81
+ /** What a composer's controls draw now. */
82
+ export declare function view(owner: DictationOwner): DictationView;
83
+ /** Moves focus to the composer that is dictating. */
84
+ export declare function focusActive(): void;
85
+ /** Starts a session in `owner`'s composer, unless one runs already. */
86
+ export declare function start(owner: DictationOwner): void;
87
+ /** A source's routes, in order. */
88
+ export declare function transportsOf(source: DictationSource): readonly DictationTransport[];
89
+ /** Capture stops; the words stay provisional until Accept or Cancel. */
90
+ export declare function stop(s: Session, reason: DictationStopReason): void;
91
+ /** Starts capture again after a pause or a silence, keeping the words so far. */
92
+ export declare function resume(s: Session): Promise<void>;
93
+ /** Resumes `owner`'s paused session. */
94
+ export declare function resumeOwner(owner: DictationOwner): void;
95
+ /** The words joined into one run, a space between segments. */
96
+ export declare function joinWords(parts: readonly string[]): string;
97
+ /**
98
+ * `text` put in place of `value`'s `from` to `to`, with a space where a
99
+ * neighbour needs one, and where the caret goes: after the inserted words.
100
+ */
101
+ export declare function splice(value: string, from: number, to: number, text: string): {
102
+ value: string;
103
+ caret: number;
104
+ };
105
+ /** Accept: the last words arrive (at most `FLUSH_MS`), then go into the draft with one `onChange`. */
106
+ export declare function accept(s: Session): Promise<void>;
107
+ /** Cancel: the draft and the caret are as they were. */
108
+ export declare function cancel(s: Session): void;
109
+ /** The composer is going away: its finished words stay in the draft, and the microphone is released. */
110
+ export declare function releaseOwner(owner: DictationOwner): void;
111
+ /** Enter accepts, Escape cancels and the shortcut pauses or resumes, each marked handled. */
112
+ export declare function keyDown(owner: DictationOwner, event: KeyboardEvent<HTMLTextAreaElement>): boolean;
113
+ /** Uses a device from now on, and in the running session if there is one. */
114
+ export declare function choose(m: MicState, id: string | undefined): Promise<void>;
115
+ /** Asks for the microphone so the devices can be named. */
116
+ export declare function allow(m: MicState): Promise<void>;
117
+ /** Why the microphone menu cannot list devices, as lines above it. */
118
+ export declare function menuNotes(owner: DictationOwner): string[];
119
+ /** Whether the menu can draw a live level: the device is allowed and nothing holds it. */
120
+ export declare function meterable(owner: DictationOwner): boolean;
121
+ /** The microphone menu's rows: the devices, the chosen one ticked, then a setup action. */
122
+ export declare function menuItems(owner: DictationOwner): MenuEntry[];
123
+ /** Ends every session and forgets every microphone; for tests. */
124
+ export declare function resetDictation(): void;
125
+ /** Forgets what a microphone was found to allow, so the next ask probes it again; for tests and demos. */
126
+ export declare function forgetMicrophone(mic: DictationMicrophone): void;
@@ -0,0 +1,5 @@
1
+ /** The browser's microphone: `getUserMedia`, and the level from an `AnalyserNode`. */
2
+ import type { DictationCapture, DictationMicrophone } from './types.js';
3
+ /** A level from 0 to 1, and the device's release, over an open stream. */
4
+ export declare function captureOf(stream: MediaStream): DictationCapture;
5
+ export declare function browserMicrophone(): DictationMicrophone;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Dictation's lazy chunk: the session's controls, the provisional words over
3
+ * the field, the live level and the microphone menu's meter. Fetched by
4
+ * `slot.tsx` on the mic's first hover, focus or press.
5
+ */
6
+ import type { DictationOwner } from './slot.js';
7
+ export { focusActive, keyDown, menuItems, releaseOwner as release, resumeOwner, start, view } from './machine.js';
8
+ export { MicOffGlyph } from '@crewlethq/icons/glyphs';
9
+ /** The live level while dictating: a short history of bars, flat once capture stops. */
10
+ export declare function Wave({ owner }: {
11
+ owner: DictationOwner;
12
+ }): import("react").JSX.Element;
13
+ /** Cancel and Accept in the send slot's place. */
14
+ export declare function Swap({ owner }: {
15
+ owner: DictationOwner;
16
+ }): import("react").JSX.Element | null;
17
+ /**
18
+ * The draft as it will read, over the field: the words before the caret, the
19
+ * provisional words in the muted italic, then the words after. The field
20
+ * underneath keeps its value and caret, drawn transparent, and is held at
21
+ * least as tall as this layer.
22
+ */
23
+ export declare function Layer({ owner }: {
24
+ owner: DictationOwner;
25
+ }): import("react").JSX.Element;
26
+ /** Whether the menu has a head to draw. */
27
+ export declare function hasHeader(owner: DictationOwner): boolean;
28
+ /** Above the devices: the live level, or why there is none. */
29
+ export declare function MenuHeader({ owner }: {
30
+ owner: DictationOwner;
31
+ }): import("react").JSX.Element;
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Dictation's entry: the mic and chevron a `Composer` draws, and the wiring
3
+ * that hands everything else to the lazy session chunk (`session.tsx`),
4
+ * fetched on the mic's first hover, focus or press.
5
+ */
6
+ import { type KeyboardEvent, type ReactNode, type RefObject } from 'react';
7
+ import type { DictationBlock, DictationSource } from './types.js';
8
+ /** Redraws every composer's dictation controls. */
9
+ export declare function notify(): void;
10
+ /** Fetches dictation's code ahead of the first press. */
11
+ export declare function preloadDictation(): Promise<void>;
12
+ /** The words the entry itself says; the chunk carries the rest. */
13
+ export declare const ENTRY_LABELS: {
14
+ dictate: string;
15
+ chooseMicrophone: string;
16
+ unsupported: string;
17
+ insecure: string;
18
+ policy: string;
19
+ };
20
+ /** Mod+Shift+Space: free in the dashboard's keymap and in the common OS and browser chords. */
21
+ export declare const DICTATION_SHORTCUT: readonly string[];
22
+ /** Why the browser's microphone cannot work in this page, or undefined. */
23
+ export declare function browserBlock(): DictationBlock | undefined;
24
+ /** Whether a key press is `chord` (`Mod` is Command on Apple platforms, Control elsewhere). */
25
+ export declare function chordMatches(chord: readonly string[], event: KeyboardEvent | globalThis.KeyboardEvent, apple: boolean): boolean;
26
+ /** What a composer reads off its owner while a session runs. */
27
+ export interface DictationOwner {
28
+ get(): {
29
+ source: DictationSource;
30
+ label: string;
31
+ field: RefObject<HTMLTextAreaElement | null>;
32
+ value: string;
33
+ onChange: (value: string) => void;
34
+ };
35
+ /** Where the caret goes once the accepted value is drawn. */
36
+ caret: {
37
+ value: string;
38
+ at: number;
39
+ } | null;
40
+ /** The field has had focus, so its caret is where the writer left it. */
41
+ touched: boolean;
42
+ }
43
+ export interface DictationSlotOptions {
44
+ label: string;
45
+ field: RefObject<HTMLTextAreaElement | null>;
46
+ value: string;
47
+ onChange: (value: string) => void;
48
+ /** The composer's own reason it cannot be written in, which holds the mic too. */
49
+ heldReason: string | undefined;
50
+ }
51
+ /** The pieces a composer lays out. */
52
+ export interface DictationSlot {
53
+ /** A session is running here: the send slot swaps and the layer draws the words. */
54
+ live: boolean;
55
+ /** A session is starting or running here: Enter is dictation's and the field is read only. */
56
+ active: boolean;
57
+ /** The mic and chevron, before the send slot; while live, the level, chevron, Cancel and Accept. */
58
+ controls: ReactNode;
59
+ /** The provisional words over the field, while live. */
60
+ layer: ReactNode;
61
+ /** A line under the field: a stop's reason, a hint, a busy microphone. */
62
+ note: ReactNode;
63
+ /** The field's added description while live. */
64
+ describe: string | undefined;
65
+ /** Routes a key pressed in the field; true when dictation took it. */
66
+ keyDown: (event: KeyboardEvent<HTMLTextAreaElement>) => boolean;
67
+ }
68
+ /** Wires dictation into a composer. Null without a source. */
69
+ export declare function useDictationSlot(source: DictationSource | undefined, options: DictationSlotOptions): DictationSlot | null;
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Dictation's contracts: the transport that turns speech into words, the
3
+ * microphone it listens through, and the source a `Composer` is given.
4
+ */
5
+ /** Why a transport ended a session on its own. The words so far stay provisional. */
6
+ export type DictationErrorCode =
7
+ /** The connection or the provider dropped. */
8
+ 'dropped'
9
+ /** The provider refused the session (not set up, key refused). */
10
+ | 'refused'
11
+ /** The company's speech spend window is used up. */
12
+ | 'quota'
13
+ /** The session reached its maximum length. */
14
+ | 'length'
15
+ /** No speech for too long. */
16
+ | 'silence'
17
+ /** The service is full right now; answered before `start` settles, the next transport is tried. */
18
+ | 'busy'
19
+ /** This route cannot work here; answered before `start` settles, the next transport is tried. */
20
+ | 'unavailable';
21
+ /** Why capture stopped while the words wait for Accept or Cancel. */
22
+ export type DictationStopReason = Exclude<DictationErrorCode, 'busy' | 'unavailable'> | 'unplugged' | 'paused';
23
+ /** What a transport tells the composer while a session runs. */
24
+ export interface DictationTransportEvents {
25
+ /** Replaces the provisional words of the segment being spoken. */
26
+ partial(text: string): void;
27
+ /** Appends a finished, punctuated segment and clears the provisional words. */
28
+ final(text: string): void;
29
+ /** Ends the session from the transport's side. */
30
+ error(code: DictationErrorCode): void;
31
+ /** Getting ready before the first word (a model loading), with progress from 0 to 1 when known. */
32
+ preparing?(progress?: number): void;
33
+ /** Ready to listen. A transport that never says `preparing` is ready once `start` settles. */
34
+ ready?(): void;
35
+ }
36
+ /**
37
+ * Turns the microphone's audio into words: the engine relay in an
38
+ * application, `fakeTransport` in stories and tests.
39
+ */
40
+ export interface DictationTransport {
41
+ /** Whether this route can work in this browser at all; false skips it in a list. */
42
+ available?(): boolean | Promise<boolean>;
43
+ /** The browser, not the chosen device, decides which microphone this route hears. */
44
+ readonly picksDevice?: boolean | undefined;
45
+ /**
46
+ * Opens a session on `deviceId` (undefined is the default device). `stream`
47
+ * is the open microphone's audio, or null from a microphone that has none.
48
+ */
49
+ start(deviceId: string | undefined, events: DictationTransportEvents, stream: MediaStream | null): void | Promise<void>;
50
+ /** The microphone changed mid-session; already recognised words are kept. */
51
+ switchStream?(stream: MediaStream | null, deviceId: string | undefined): void;
52
+ /** Stops listening and settles once the last final segment has arrived. */
53
+ flush(): Promise<void>;
54
+ /** Drops the session at once. No event follows. */
55
+ cancel(): void;
56
+ }
57
+ /** One audio input. */
58
+ export interface DictationDevice {
59
+ deviceId: string;
60
+ label: string;
61
+ }
62
+ export type DictationPermission = 'granted' | 'denied' | 'prompt' | 'unknown';
63
+ /** Why capture cannot work in this page at all. */
64
+ export type DictationBlock = 'insecure' | 'unsupported' | 'policy';
65
+ /** An open microphone. */
66
+ export interface DictationCapture {
67
+ stream: MediaStream | null;
68
+ /** The input level now, from 0 to 1. */
69
+ level(): number;
70
+ /** Called once if the device goes away while open. */
71
+ onEnded(listener: () => void): void;
72
+ /** Stops capture and releases the device. */
73
+ stop(): void;
74
+ }
75
+ /**
76
+ * Where audio comes from: the browser's microphone by default, a scripted one
77
+ * in stories and tests (`fakeMicrophone`).
78
+ */
79
+ export interface DictationMicrophone {
80
+ /** Why capture cannot work in this page, or undefined. */
81
+ check(): DictationBlock | undefined;
82
+ permission(): Promise<DictationPermission>;
83
+ onPermissionChange?(listener: (state: DictationPermission) => void): () => void;
84
+ /** The audio inputs. Labels are blank until permission is granted. */
85
+ devices(): Promise<DictationDevice[]>;
86
+ onDeviceChange?(listener: () => void): () => void;
87
+ /**
88
+ * Opens a device. Rejects with an error named `NotAllowedError`,
89
+ * `NotFoundError` or `NotReadableError`, as `getUserMedia` does.
90
+ */
91
+ open(deviceId: string | undefined): Promise<DictationCapture>;
92
+ }
93
+ /** Every word dictation says. */
94
+ export interface DictationLabels {
95
+ dictate: string;
96
+ resume: string;
97
+ chooseMicrophone: string;
98
+ cancel: string;
99
+ accept: string;
100
+ listening: string;
101
+ /** The field's description and the announcement while dictating. */
102
+ dictating: string;
103
+ pending: string;
104
+ cancelled: string;
105
+ inserted: (words: number) => string;
106
+ nothing: string;
107
+ unsupported: string;
108
+ insecure: string;
109
+ policy: string;
110
+ denied: string;
111
+ noDevice: string;
112
+ busy: string;
113
+ elsewhere: (composer: string) => string;
114
+ quiet: string;
115
+ preparing: (progress: number | undefined) => string;
116
+ serviceBusy: string;
117
+ unavailable: string;
118
+ browserPicks: string;
119
+ stopped: Record<DictationStopReason, string>;
120
+ defaultDevice: string;
121
+ allowToChoose: string;
122
+ deniedHelp: string;
123
+ retry: string;
124
+ recheck: string;
125
+ gone: string;
126
+ switched: (device: string) => string;
127
+ level: string;
128
+ }
129
+ /** Turns a `Composer`'s dictation on. */
130
+ export interface DictationSource {
131
+ /**
132
+ * One transport, or several in order: the first available is used, and the
133
+ * next is tried when one answers `busy` or `unavailable` before its first word.
134
+ */
135
+ transport: DictationTransport | readonly DictationTransport[];
136
+ /** The browser's microphone when left out. */
137
+ microphone?: DictationMicrophone | undefined;
138
+ /**
139
+ * Dictation is not available here, and why ("Dictation is not set up for
140
+ * this company"). The mic is drawn held with this reason.
141
+ */
142
+ unavailableReason?: string | undefined;
143
+ /** For a reader who can fix it: an action at the foot of the microphone menu. */
144
+ setup?: {
145
+ label: string;
146
+ onSelect: () => void;
147
+ } | undefined;
148
+ labels?: Partial<DictationLabels> | undefined;
149
+ /** Seconds of silence before the "Still listening" hint, and before capture stops. */
150
+ silence?: {
151
+ hint: number;
152
+ stop: number;
153
+ } | undefined;
154
+ /** The chord that starts and pauses dictation from the field, or false for none. */
155
+ shortcut?: readonly string[] | false | undefined;
156
+ /** A session started or ended here, so a proposal for this box can wait for it. */
157
+ onActiveChange?: ((active: boolean) => void) | undefined;
158
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The browser's own speech recognition, on the device only. It never uses
3
+ * the browser's cloud service: where on-device recognition is missing, or its
4
+ * language pack cannot be installed, it answers `unavailable`.
5
+ */
6
+ import type { DictationTransport } from './types.js';
7
+ export interface WebSpeechLocalOptions {
8
+ /** The language to recognise, as a BCP 47 tag. The browser's own by default. */
9
+ lang?: string | undefined;
10
+ }
11
+ /** A pack not installed within this counts as unavailable; the browser may finish it for a later press. */
12
+ export declare const INSTALL_MS = 60000;
13
+ export declare function createWebSpeechLocal(options?: WebSpeechLocalOptions): DictationTransport;
@@ -0,0 +1,9 @@
1
+ import type { DictationTransport } from './types.js';
2
+ import type { WebSpeechLocalOptions } from './webSpeech.js';
3
+ export type { WebSpeechLocalOptions } from './webSpeech.js';
4
+ /**
5
+ * The browser's on-device speech recognition as a dictation route, never its
6
+ * cloud service: a fallback after the application's own relay. Its code loads
7
+ * the first time it is asked whether it is available.
8
+ */
9
+ export declare function webSpeechLocalTransport(options?: WebSpeechLocalOptions): DictationTransport;