@microsoft/dragon-copilot-sdk-lexical-react 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/node_modules/@hccm/web-tcl/CHANGELOG.md +161 -0
  2. package/node_modules/@hccm/web-tcl/README.md +99 -0
  3. package/node_modules/@hccm/web-tcl/dist/cjs/cleanup-helper.d.ts +23 -0
  4. package/node_modules/@hccm/web-tcl/dist/cjs/cleanup-helper.js +1 -0
  5. package/node_modules/@hccm/web-tcl/dist/cjs/common/browser.d.ts +17 -0
  6. package/node_modules/@hccm/web-tcl/dist/cjs/common/browser.js +1 -0
  7. package/node_modules/@hccm/web-tcl/dist/cjs/common/coordinates.d.ts +6 -0
  8. package/node_modules/@hccm/web-tcl/dist/cjs/common/coordinates.js +1 -0
  9. package/node_modules/@hccm/web-tcl/dist/cjs/common/dom.d.ts +44 -0
  10. package/node_modules/@hccm/web-tcl/dist/cjs/common/dom.js +1 -0
  11. package/node_modules/@hccm/web-tcl/dist/cjs/common/element-extensions.d.ts +26 -0
  12. package/node_modules/@hccm/web-tcl/dist/cjs/common/element-extensions.js +1 -0
  13. package/node_modules/@hccm/web-tcl/dist/cjs/common/error.d.ts +7 -0
  14. package/node_modules/@hccm/web-tcl/dist/cjs/common/error.js +1 -0
  15. package/node_modules/@hccm/web-tcl/dist/cjs/common/local-store.d.ts +10 -0
  16. package/node_modules/@hccm/web-tcl/dist/cjs/common/local-store.js +1 -0
  17. package/node_modules/@hccm/web-tcl/dist/cjs/common/selection-info.d.ts +4 -0
  18. package/node_modules/@hccm/web-tcl/dist/cjs/common/selection-info.js +1 -0
  19. package/node_modules/@hccm/web-tcl/dist/cjs/common/string.d.ts +7 -0
  20. package/node_modules/@hccm/web-tcl/dist/cjs/common/string.js +1 -0
  21. package/node_modules/@hccm/web-tcl/dist/cjs/common/util.d.ts +73 -0
  22. package/node_modules/@hccm/web-tcl/dist/cjs/common/util.js +1 -0
  23. package/node_modules/@hccm/web-tcl/dist/cjs/logger/logging.d.ts +67 -0
  24. package/node_modules/@hccm/web-tcl/dist/cjs/logger/logging.js +1 -0
  25. package/node_modules/@hccm/web-tcl/dist/cjs/main.d.ts +8 -0
  26. package/node_modules/@hccm/web-tcl/dist/cjs/main.js +1 -0
  27. package/node_modules/@hccm/web-tcl/dist/cjs/package-info.d.ts +2 -0
  28. package/node_modules/@hccm/web-tcl/dist/cjs/package-info.js +1 -0
  29. package/node_modules/@hccm/web-tcl/dist/cjs/shared-data.d.ts +27 -0
  30. package/node_modules/@hccm/web-tcl/dist/cjs/shared-data.js +1 -0
  31. package/node_modules/@hccm/web-tcl/dist/cjs/speech-document.d.ts +91 -0
  32. package/node_modules/@hccm/web-tcl/dist/cjs/speech-document.js +1 -0
  33. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/base-control.d.ts +100 -0
  34. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/base-control.js +1 -0
  35. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/contenteditable-control.d.ts +18 -0
  36. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/contenteditable-control.js +1 -0
  37. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/custom-control.d.ts +41 -0
  38. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/custom-control.js +1 -0
  39. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/factory.d.ts +9 -0
  40. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/factory.js +1 -0
  41. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/helpers.d.ts +33 -0
  42. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/helpers.js +1 -0
  43. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/index.d.ts +6 -0
  44. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/index.js +1 -0
  45. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/input-control.d.ts +7 -0
  46. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/input-control.js +1 -0
  47. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/processing-status.d.ts +1 -0
  48. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/processing-status.js +1 -0
  49. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/text-control-manager.d.ts +38 -0
  50. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/text-control-manager.js +1 -0
  51. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/text-control.d.ts +64 -0
  52. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/text-control.js +1 -0
  53. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/textarea-control.d.ts +7 -0
  54. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/textarea-control.js +1 -0
  55. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/tinymce-control.d.ts +11 -0
  56. package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/tinymce-control.js +1 -0
  57. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/channel.d.ts +15 -0
  58. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/channel.js +1 -0
  59. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/commands.d.ts +64 -0
  60. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/commands.js +1 -0
  61. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/custom-control.d.ts +212 -0
  62. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/custom-control.js +1 -0
  63. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/index.d.ts +6 -0
  64. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/index.js +1 -0
  65. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/input-custom-control.d.ts +2 -0
  66. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/input-custom-control.js +1 -0
  67. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/textarea-custom-control.d.ts +2 -0
  68. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/textarea-custom-control.js +1 -0
  69. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/diagnostics.d.ts +37 -0
  70. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/diagnostics.js +1 -0
  71. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/dom-observable.d.ts +13 -0
  72. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/dom-observable.js +1 -0
  73. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/events.d.ts +39 -0
  74. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/events.js +1 -0
  75. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/iframe-support.d.ts +29 -0
  76. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/iframe-support.js +1 -0
  77. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/index.d.ts +26 -0
  78. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/index.js +1 -0
  79. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/processing-status.d.ts +1 -0
  80. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/processing-status.js +1 -0
  81. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/state.d.ts +165 -0
  82. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/state.js +1 -0
  83. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/types.d.ts +21 -0
  84. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/types.js +1 -0
  85. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/utility-types.d.ts +3 -0
  86. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/utility-types.js +1 -0
  87. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/validation.d.ts +35 -0
  88. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/validation.js +1 -0
  89. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/webtcl-attributes.d.ts +104 -0
  90. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/webtcl-attributes.js +1 -0
  91. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/webtcl-client.d.ts +16 -0
  92. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/webtcl-client.js +1 -0
  93. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/webtcl-controller.d.ts +8 -0
  94. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/webtcl-controller.js +1 -0
  95. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/worker.d.ts +18 -0
  96. package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/worker.js +1 -0
  97. package/node_modules/@hccm/web-tcl/dist/esm/cleanup-helper.d.ts +23 -0
  98. package/node_modules/@hccm/web-tcl/dist/esm/cleanup-helper.js +1 -0
  99. package/node_modules/@hccm/web-tcl/dist/esm/common/browser.d.ts +17 -0
  100. package/node_modules/@hccm/web-tcl/dist/esm/common/browser.js +1 -0
  101. package/node_modules/@hccm/web-tcl/dist/esm/common/coordinates.d.ts +6 -0
  102. package/node_modules/@hccm/web-tcl/dist/esm/common/coordinates.js +1 -0
  103. package/node_modules/@hccm/web-tcl/dist/esm/common/dom.d.ts +44 -0
  104. package/node_modules/@hccm/web-tcl/dist/esm/common/dom.js +1 -0
  105. package/node_modules/@hccm/web-tcl/dist/esm/common/element-extensions.d.ts +26 -0
  106. package/node_modules/@hccm/web-tcl/dist/esm/common/element-extensions.js +1 -0
  107. package/node_modules/@hccm/web-tcl/dist/esm/common/error.d.ts +7 -0
  108. package/node_modules/@hccm/web-tcl/dist/esm/common/error.js +1 -0
  109. package/node_modules/@hccm/web-tcl/dist/esm/common/local-store.d.ts +10 -0
  110. package/node_modules/@hccm/web-tcl/dist/esm/common/local-store.js +1 -0
  111. package/node_modules/@hccm/web-tcl/dist/esm/common/selection-info.d.ts +4 -0
  112. package/node_modules/@hccm/web-tcl/dist/esm/common/selection-info.js +1 -0
  113. package/node_modules/@hccm/web-tcl/dist/esm/common/string.d.ts +7 -0
  114. package/node_modules/@hccm/web-tcl/dist/esm/common/string.js +1 -0
  115. package/node_modules/@hccm/web-tcl/dist/esm/common/util.d.ts +73 -0
  116. package/node_modules/@hccm/web-tcl/dist/esm/common/util.js +1 -0
  117. package/node_modules/@hccm/web-tcl/dist/esm/logger/logging.d.ts +67 -0
  118. package/node_modules/@hccm/web-tcl/dist/esm/logger/logging.js +1 -0
  119. package/node_modules/@hccm/web-tcl/dist/esm/main.d.ts +8 -0
  120. package/node_modules/@hccm/web-tcl/dist/esm/main.js +1 -0
  121. package/node_modules/@hccm/web-tcl/dist/esm/package-info.d.ts +2 -0
  122. package/node_modules/@hccm/web-tcl/dist/esm/package-info.js +1 -0
  123. package/node_modules/@hccm/web-tcl/dist/esm/shared-data.d.ts +27 -0
  124. package/node_modules/@hccm/web-tcl/dist/esm/shared-data.js +1 -0
  125. package/node_modules/@hccm/web-tcl/dist/esm/speech-document.d.ts +91 -0
  126. package/node_modules/@hccm/web-tcl/dist/esm/speech-document.js +1 -0
  127. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/base-control.d.ts +100 -0
  128. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/base-control.js +1 -0
  129. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/contenteditable-control.d.ts +18 -0
  130. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/contenteditable-control.js +1 -0
  131. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/custom-control.d.ts +41 -0
  132. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/custom-control.js +1 -0
  133. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/factory.d.ts +9 -0
  134. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/factory.js +1 -0
  135. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/helpers.d.ts +33 -0
  136. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/helpers.js +1 -0
  137. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/index.d.ts +6 -0
  138. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/index.js +1 -0
  139. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/input-control.d.ts +7 -0
  140. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/input-control.js +1 -0
  141. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/processing-status.d.ts +1 -0
  142. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/processing-status.js +1 -0
  143. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/text-control-manager.d.ts +38 -0
  144. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/text-control-manager.js +1 -0
  145. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/text-control.d.ts +64 -0
  146. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/text-control.js +1 -0
  147. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/textarea-control.d.ts +7 -0
  148. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/textarea-control.js +1 -0
  149. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/tinymce-control.d.ts +11 -0
  150. package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/tinymce-control.js +1 -0
  151. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/channel.d.ts +15 -0
  152. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/channel.js +1 -0
  153. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/commands.d.ts +64 -0
  154. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/commands.js +1 -0
  155. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/custom-control.d.ts +212 -0
  156. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/custom-control.js +1 -0
  157. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/index.d.ts +6 -0
  158. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/index.js +1 -0
  159. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/input-custom-control.d.ts +2 -0
  160. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/input-custom-control.js +1 -0
  161. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/textarea-custom-control.d.ts +2 -0
  162. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/textarea-custom-control.js +1 -0
  163. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/diagnostics.d.ts +37 -0
  164. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/diagnostics.js +1 -0
  165. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/dom-observable.d.ts +13 -0
  166. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/dom-observable.js +1 -0
  167. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/events.d.ts +39 -0
  168. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/events.js +1 -0
  169. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/iframe-support.d.ts +29 -0
  170. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/iframe-support.js +1 -0
  171. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/index.d.ts +26 -0
  172. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/index.js +1 -0
  173. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/processing-status.d.ts +1 -0
  174. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/processing-status.js +1 -0
  175. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/state.d.ts +165 -0
  176. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/state.js +1 -0
  177. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/types.d.ts +21 -0
  178. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/types.js +1 -0
  179. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/utility-types.d.ts +3 -0
  180. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/utility-types.js +1 -0
  181. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/validation.d.ts +35 -0
  182. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/validation.js +1 -0
  183. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/webtcl-attributes.d.ts +104 -0
  184. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/webtcl-attributes.js +1 -0
  185. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/webtcl-client.d.ts +16 -0
  186. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/webtcl-client.js +1 -0
  187. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/webtcl-controller.d.ts +8 -0
  188. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/webtcl-controller.js +1 -0
  189. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/worker.d.ts +18 -0
  190. package/node_modules/@hccm/web-tcl/dist/esm/webtcl/worker.js +1 -0
  191. package/node_modules/@hccm/web-tcl/package.json +72 -0
  192. package/package.json +5 -3
@@ -0,0 +1,165 @@
1
+ import { type Observable } from "rxjs";
2
+ import type { WebTCLEvent, WebTCLEvents } from "./events";
3
+ import type { Capabilities } from "../text-control-lib/text-control";
4
+ export type WebTCLState = {
5
+ timestamp: number;
6
+ isInitialized: boolean;
7
+ isDisabled: boolean;
8
+ focusedControl: string | null;
9
+ textControls: {
10
+ id: string;
11
+ containerId: string;
12
+ text: string;
13
+ selection: {
14
+ start: number;
15
+ length: number;
16
+ };
17
+ status: "pending" | "idle";
18
+ paragraph: string;
19
+ newLine: string;
20
+ capabilities?: Capabilities;
21
+ conceptName?: string;
22
+ documentFieldId?: string;
23
+ dictationMode?: string;
24
+ isMultiline?: boolean;
25
+ }[];
26
+ };
27
+ export type Reducers<TState, TMap> = {
28
+ [K in keyof TMap]: ({ state, payload }: {
29
+ state: TState;
30
+ payload: TMap[K];
31
+ }) => Partial<WebTCLState> | undefined;
32
+ };
33
+ export declare function createState(event$: Observable<WebTCLEvent>, initialState: WebTCLState, reducers: Reducers<WebTCLState, WebTCLEvents>): Observable<WebTCLState>;
34
+ export declare const stateReducers: {
35
+ readonly initialized: ({ payload }: {
36
+ state: WebTCLState;
37
+ payload: {
38
+ type: "initialized";
39
+ timestamp: number;
40
+ } & Pick<WebTCLState, "isInitialized" | "isDisabled">;
41
+ }) => {
42
+ timestamp: number;
43
+ isInitialized: boolean;
44
+ isDisabled: boolean;
45
+ };
46
+ readonly disposed: ({ payload }: {
47
+ state: WebTCLState;
48
+ payload: {
49
+ type: "disposed";
50
+ timestamp: number;
51
+ };
52
+ }) => {
53
+ timestamp: number;
54
+ focusedControl: string;
55
+ isInitialized: false;
56
+ isDisabled: false;
57
+ textControls: never[];
58
+ };
59
+ readonly focusChanged: ({ state, payload }: {
60
+ state: WebTCLState;
61
+ payload: {
62
+ type: "focusChanged";
63
+ timestamp: number;
64
+ } & {
65
+ id: string;
66
+ isFocused: boolean;
67
+ };
68
+ }) => {
69
+ timestamp: number;
70
+ focusedControl: string;
71
+ } | undefined;
72
+ readonly controlChanged: ({ state, payload }: {
73
+ state: WebTCLState;
74
+ payload: {
75
+ type: "controlChanged";
76
+ timestamp: number;
77
+ } & {
78
+ id: string;
79
+ text: string;
80
+ selection: {
81
+ start: number;
82
+ length: number;
83
+ };
84
+ };
85
+ }) => {
86
+ timestamp: number;
87
+ textControls: {
88
+ id: string;
89
+ containerId: string;
90
+ text: string;
91
+ selection: {
92
+ start: number;
93
+ length: number;
94
+ };
95
+ status: "pending" | "idle";
96
+ paragraph: string;
97
+ newLine: string;
98
+ capabilities?: Capabilities;
99
+ conceptName?: string;
100
+ documentFieldId?: string;
101
+ dictationMode?: string;
102
+ isMultiline?: boolean;
103
+ }[];
104
+ } | undefined;
105
+ readonly controlsChanged: ({ payload }: {
106
+ state: WebTCLState;
107
+ payload: {
108
+ type: "controlsChanged";
109
+ timestamp: number;
110
+ } & Pick<WebTCLState, "textControls" | "focusedControl">;
111
+ }) => {
112
+ timestamp: number;
113
+ textControls: {
114
+ id: string;
115
+ containerId: string;
116
+ text: string;
117
+ selection: {
118
+ start: number;
119
+ length: number;
120
+ };
121
+ status: "pending" | "idle";
122
+ paragraph: string;
123
+ newLine: string;
124
+ capabilities?: Capabilities;
125
+ conceptName?: string;
126
+ documentFieldId?: string;
127
+ dictationMode?: string;
128
+ isMultiline?: boolean;
129
+ }[];
130
+ focusedControl: string | null;
131
+ };
132
+ readonly statusChanged: ({ state, payload }: {
133
+ state: WebTCLState;
134
+ payload: {
135
+ type: "statusChanged";
136
+ timestamp: number;
137
+ } & {
138
+ id: string;
139
+ status: import("./processing-status").ProcessingStatus;
140
+ };
141
+ }) => {
142
+ timestamp: number;
143
+ textControls: {
144
+ id: string;
145
+ containerId: string;
146
+ text: string;
147
+ selection: {
148
+ start: number;
149
+ length: number;
150
+ };
151
+ status: "pending" | "idle";
152
+ paragraph: string;
153
+ newLine: string;
154
+ capabilities?: Capabilities;
155
+ conceptName?: string;
156
+ documentFieldId?: string;
157
+ dictationMode?: string;
158
+ isMultiline?: boolean;
159
+ }[];
160
+ } | undefined;
161
+ };
162
+ export declare function reduceState({ state, event }: {
163
+ state: WebTCLState;
164
+ event: WebTCLEvent;
165
+ }): Partial<WebTCLState>;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.stateReducers=void 0;exports.createState=e;exports.reduceState=s;const t=require("rxjs");function e(e,s,o){return e.pipe((0,t.filter)(t=>t.type in o),(0,t.scan)((t,e)=>{const s=o[e.type];return Object.assign(Object.assign({},t),s({state:t,payload:e}))},s),(0,t.startWith)(s),(0,t.shareReplay)(1))}exports.stateReducers={initialized({payload:t}){return{timestamp:t.timestamp,isInitialized:t.isInitialized,isDisabled:t.isDisabled}},disposed({payload:t}){return{timestamp:t.timestamp,focusedControl:"",isInitialized:false,isDisabled:false,textControls:[]}},focusChanged({state:t,payload:e}){if(e.isFocused&&t.focusedControl!==e.id){return{timestamp:e.timestamp,focusedControl:e.id}}if(!e.isFocused&&t.focusedControl!==""){return{timestamp:e.timestamp,focusedControl:""}}return undefined},controlChanged({state:t,payload:e}){const s=t.textControls.findIndex(t=>t.id===e.id);const o=s>-1?t.textControls[s]:undefined;if(!o||o.text===e.text&&o.selection.start===e.selection.start&&o.selection.length===e.selection.length){return undefined}return{timestamp:e.timestamp,textControls:[...t.textControls.slice(0,s),Object.assign(Object.assign({},o),{text:e.text,selection:e.selection}),...t.textControls.slice(s+1)]}},controlsChanged({payload:t}){return{timestamp:t.timestamp,textControls:t.textControls,focusedControl:t.focusedControl}},statusChanged({state:t,payload:e}){const s=t.textControls.findIndex(t=>t.id===e.id);const o=s>-1?t.textControls[s]:undefined;if(!o||o.status===e.status){return undefined}return{timestamp:e.timestamp,textControls:[...t.textControls.slice(0,s),Object.assign(Object.assign({},o),{status:e.status}),...t.textControls.slice(s+1)]}}};function s({state:t,event:e}){const s=exports.stateReducers[e.type];if(!s){throw new Error(`Event type: ${e.type} has no reducers`)}return s({state:t,payload:e})}
@@ -0,0 +1,21 @@
1
+ import { type NextObserver, type Observable } from "rxjs";
2
+ import type { WebTCLCommand } from "./commands";
3
+ import type { WebTCLEvent } from "./events";
4
+ export type WebTCLController = {
5
+ isValidCommand: (type: WebTCLCommand) => boolean;
6
+ readonly commands: NextObserver<WebTCLCommand>;
7
+ readonly event$: Observable<WebTCLEvent>;
8
+ };
9
+ /**
10
+ * Enum representing values to determine text formatting based on cursor position.
11
+ * @param Start Use start side text format (bold, italic, etc) of of the defined selection.
12
+ * @param End Use end side text format (bold, italic, etc) of of the defined selection.
13
+ */
14
+ export declare const FormattingBoundaries: Readonly<{
15
+ Start: "start";
16
+ End: "end";
17
+ }>;
18
+ export type FormattingBoundary = (typeof FormattingBoundaries)[keyof typeof FormattingBoundaries];
19
+ export type AdditionalReplaceTextParameters = {
20
+ matchFormattingAtThe?: FormattingBoundary;
21
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FormattingBoundaries=void 0;exports.FormattingBoundaries=Object.freeze({Start:"start",End:"end"});
@@ -0,0 +1,3 @@
1
+ export type DeepPartial<T> = T extends object ? Partial<{
2
+ [K in keyof T]: DeepPartial<T[K]>;
3
+ }> : Partial<T>;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Checks if the given HTML element is supported by the text control library.
3
+ *
4
+ * @param element - The HTML element to check.
5
+ * @returns A boolean indicating whether the element is supported or not.
6
+ */
7
+ export declare function isSupportedHtmlElement(element: HTMLElement): boolean;
8
+ /**
9
+ * Checks if the given HTML element or any of its children are supported HTML elements.
10
+ *
11
+ * @param element - The HTML element to check.
12
+ * @returns A boolean indicating whether the element or any of its children are supported HTML elements.
13
+ */
14
+ export declare function containsSupportedHtmlElement(element: HTMLElement): boolean;
15
+ /**
16
+ * Checks if the given HTMLInputElement is a supported input type.
17
+ *
18
+ * @param element - The HTMLInputElement to check.
19
+ * @returns A boolean indicating whether the input type is supported or not.
20
+ */
21
+ export declare function isSupportedHtmlInputElement(element: HTMLInputElement): boolean;
22
+ /**
23
+ * Checks if the given HTML element is a custom control.
24
+ *
25
+ * @param element - The HTML element to check.
26
+ * @returns `true` if the element is a custom control, otherwise `false`.
27
+ */
28
+ export declare function isCustomControl(element: HTMLElement): boolean;
29
+ /**
30
+ * Checks if the given HTML element is a custom container.
31
+ *
32
+ * @param element - The HTML element to check.
33
+ * @returns A boolean indicating whether the element is a custom container.
34
+ */
35
+ export declare function isCustomContainer(element: HTMLElement): boolean;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.isSupportedHtmlElement=r;exports.containsSupportedHtmlElement=n;exports.isSupportedHtmlInputElement=u;exports.isCustomControl=o;exports.isCustomContainer=i;const e=require("../shared-data");const t=require("../text-control-lib");function r(e){if(o(e))return true;if(e instanceof HTMLInputElement)return u(e);if(e instanceof HTMLTextAreaElement)return true;if((0,t.getTinyMceEditor)(e))return true;if(e.contentEditable==="true")return true;return false}function n(e){if(r(e)){return true}for(const t of e.children){if(n(t)){return true}}return false}function u(t){const r=t.type?t.type.toLowerCase():"";if(r==="text"){return true}else if(r==="search"||r==="number"){return(0,e.isElementAttributeEnabled)(t)}return false}function o(e){return(0,t.getCustomControlType)(e)!=null}function i(e){return(0,t.getCustomContainerType)(e)!=null}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * A frozen mapping of logical attribute names to their corresponding HTML data attribute names
3
+ * for both "dragon" and "nusa" naming conventions. "nusa" is only for backwards compatibility.
4
+ *
5
+ * Each key represents a logical attribute used within the application, and its value is a tuple
6
+ * containing the "dragon" and "nusa" data attribute names, respectively.
7
+ *
8
+ * This map is used to ensure consistent access and manipulation of custom data attributes
9
+ * across different naming schemes in the codebase.
10
+ *
11
+ * @property controlId - Unique identifier for speech enabled controls
12
+ * @property container - Identifies elements that contain controls to speech enable
13
+ * @property conceptName - Semantic name for voice commands and accessibility
14
+ * @property isEnabled - Controls whether a control should be speech enabled or not
15
+ * @property dictationMode - Specifies the dictation mode (e.g., "dictation", "nli")
16
+ * @property documentFieldId - Links controls to document field identifiers
17
+ * @property markerContainer - Identifies containers for Dragon logo/marker elements
18
+ * @property internalIgnore - Internal attribute that is used for contenteditable support
19
+ * @property customControlType - Specifies the type of a custom control implementation
20
+ */
21
+ export declare const DragonAttributesMap: Readonly<{
22
+ readonly controlId: readonly ["data-dragon-id", "data-nusa-id"];
23
+ readonly container: readonly ["data-dragon-container", "data-nusa-container"];
24
+ readonly conceptName: readonly ["data-dragon-concept-name", "data-nusa-concept-name"];
25
+ readonly isEnabled: readonly ["data-dragon-enabled", "data-nusa-enabled"];
26
+ readonly dictationMode: readonly ["data-dragon-dictation-mode", "data-nusa-dictation-mode"];
27
+ readonly documentFieldId: readonly ["data-dragon-document-field-id", "data-nusa-document-field-id"];
28
+ readonly markerContainer: readonly ["data-dragon-marker-container", "data-nusa-marker-container"];
29
+ readonly internalIgnore: readonly ["data-dragon-internal-ignore", "data-nusai-ignore"];
30
+ readonly customControlType: readonly ["data-dragon-custom-control-type", "data-nusa-custom-control-type"];
31
+ }>;
32
+ /**
33
+ * Represents the set of valid attribute names defined in the `DragonAttributesMap` object.
34
+ *
35
+ * This type is a union of all string keys present in `DragonAttributesMap`, ensuring type safety
36
+ * when working with attribute names throughout the application.
37
+ */
38
+ export type DragonAttribute = keyof typeof DragonAttributesMap;
39
+ /**
40
+ * Retrieves the value of a specified attribute from a given DOM element.
41
+ *
42
+ * Looks up the attribute key in the `DragonAttributesMap` to find possible attribute names,
43
+ * then attempts to get the value of the first attribute. If not found, it tries the second attribute.
44
+ *
45
+ * @param element - The DOM element from which to retrieve the attribute value.
46
+ * @param key - The key used to look up possible attribute names in `DragonAttributesMap`.
47
+ * @returns The value of the found attribute, or `null` if neither attribute is present.
48
+ *
49
+ * @example
50
+ * ```typescript
51
+ * // Assuming 'element' is a DOM element and a data-dragon-id or data-nusa-id attribute is set
52
+ * const value = getAttributeValue(element, 'controlId');
53
+ * // value === '123'
54
+ * ```
55
+ */
56
+ export declare function getAttributeValue(element: Element, key: DragonAttribute): string | null;
57
+ /**
58
+ * Sets the value of a specified attribute on a given DOM element using the Dragon attribute mapping.
59
+ *
60
+ * @param element - The DOM element on which to set the attribute.
61
+ * @param key - The DragonAttribute key used to look up the corresponding attribute name.
62
+ * @param value - The value to assign to the attribute.
63
+ *
64
+ * @example
65
+ * ```typescript
66
+ * // Assuming 'element' is a DOM element
67
+ * setAttributeValue(element, 'controlId', '123');
68
+ * // The element now has the mapped 'data-dragon-id' attribute set to '123'
69
+ * ```
70
+ */
71
+ export declare function setAttributeValue(element: Element, key: DragonAttribute, value: string): void;
72
+ /**
73
+ * Removes the specified attribute from the given DOM element.
74
+ *
75
+ * This function looks up the attribute mapping for the provided `key` using `DragonAttributesMap`,
76
+ * and removes the mapped attribute names from the element.
77
+ *
78
+ * @param element - The DOM element from which the attribute(s) will be removed.
79
+ * @param key - The logical attribute key, used to look up the actual attribute names in `DragonAttributesMap`.
80
+ *
81
+ * @example
82
+ * ```typescript
83
+ * // Assuming 'element' is a DOM element and a data-dragon-id or data-nusa-id attribute is set
84
+ * removeAttribute(element, 'controlId');
85
+ * ```
86
+ */
87
+ export declare function removeAttribute(element: Element, key: DragonAttribute): void;
88
+ /**
89
+ * Checks if the specified element has the given Dragon attribute.
90
+ *
91
+ * This function looks up the attribute key in the `DragonAttributesMap` and checks
92
+ * if the element has either the primary or secondary attribute name associated with the key.
93
+ *
94
+ * @param element - The DOM element to check for the attribute.
95
+ * @param key - The Dragon attribute key to look up in the `DragonAttributesMap`.
96
+ * @returns `true` if the element has the attribute, otherwise `false`.
97
+ *
98
+ * @example
99
+ * ```typescript
100
+ * // Assuming 'element' is a DOM element and a data-dragon-id or data-nusa-id attribute is set
101
+ * const hasControlId = hasAttribute(element, 'controlId'); // returns true
102
+ * ```
103
+ */
104
+ export declare function hasAttribute(element: Element, key: DragonAttribute): boolean;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.DragonAttributesMap=void 0;exports.getAttributeValue=t;exports.setAttributeValue=e;exports.removeAttribute=a;exports.hasAttribute=n;exports.DragonAttributesMap=Object.freeze({controlId:["data-dragon-id","data-nusa-id"],container:["data-dragon-container","data-nusa-container"],conceptName:["data-dragon-concept-name","data-nusa-concept-name"],isEnabled:["data-dragon-enabled","data-nusa-enabled"],dictationMode:["data-dragon-dictation-mode","data-nusa-dictation-mode"],documentFieldId:["data-dragon-document-field-id","data-nusa-document-field-id"],markerContainer:["data-dragon-marker-container","data-nusa-marker-container"],internalIgnore:["data-dragon-internal-ignore","data-nusai-ignore"],customControlType:["data-dragon-custom-control-type","data-nusa-custom-control-type"]});function t(t,e){const a=exports.DragonAttributesMap[e];const n=t.getAttribute(a[0]);return n!==null&&n!==void 0?n:t.getAttribute(a[1])}function e(t,e,a){const n=exports.DragonAttributesMap[e][0];t.setAttribute(n,a)}function a(t,e){const a=exports.DragonAttributesMap[e];t.removeAttribute(a[0]);t.removeAttribute(a[1])}function n(t,e){const a=exports.DragonAttributesMap[e];const n=t.hasAttribute(a[0]);return n?n:t.hasAttribute(a[1])}
@@ -0,0 +1,16 @@
1
+ import { type Observable } from "rxjs";
2
+ import type { WebTCLEvents } from "./events";
3
+ import type { WebTCLCommands } from "./commands";
4
+ import type { WebTCLState } from "./state";
5
+ import { type ChannelReceiver, type ChannelSender } from "./channel";
6
+ import type { WebTCLController } from "./types";
7
+ export type WebTCLClient = Readonly<{
8
+ commands: ChannelSender<WebTCLCommands>;
9
+ events: ChannelReceiver<WebTCLEvents>;
10
+ state$: Observable<WebTCLState>;
11
+ currentState: WebTCLState;
12
+ dispose(this: void): void;
13
+ }>;
14
+ export declare function createClient({ controller }: {
15
+ controller: WebTCLController;
16
+ }): WebTCLClient;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createClient=r;const e=require("rxjs");const t=require("./channel");const s=require("./worker");function r({controller:r}){const n={focusedControl:"",isDisabled:false,isInitialized:false,textControls:[],timestamp:0};const o=new e.Subject;const c=new e.Subject;const a=new e.BehaviorSubject(n);const l=(0,s.createWorker)({controller:r,client:{command$:o.asObservable(),events:c},states:a});return{commands:(0,t.channelSender)(o),events:(0,t.channelReceiver)(c.asObservable()),state$:a.asObservable(),get currentState(){return a.value},dispose(){o.next({type:"dispose"});l.dispose()}}}
@@ -0,0 +1,8 @@
1
+ import type { SpeechDocument } from "../speech-document";
2
+ import type { WebTCLController } from "./types";
3
+ type ControllerOptions = {
4
+ speechdocument: SpeechDocument;
5
+ selector?: string;
6
+ };
7
+ export declare function createController({ speechdocument, selector }: ControllerOptions): WebTCLController;
8
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createController=r;const t=require("../text-control-lib");const e=require("../shared-data");const n=require("./events");const s=require("rxjs");const i=require("./dom-observable");const o=require("./validation");function r({speechdocument:t,selector:o}){const r=new s.Subject;const l={};let d=s.Subscription.EMPTY;const f={activate(e){t.setControlActive(e.id,true)},deactivate(e){t.setControlActive(e.id,false)},dispose(){m({subscriptions:l});d.unsubscribe();t.deInitialize();const e=(0,n.currentTimestamp)();r.next({type:"controlsChanged",timestamp:e,focusedControl:"",textControls:[]});r.next({type:"disposed",timestamp:e})},focus(e){t.setControlFocus(e.id)},initialize(m){var f;e.SharedData.shouldEnableAllElements=!m.isDisabled;t.initialize({document:document,selector:o,disableGuiMarkup:!m.useGuiMarkup});const g=(0,n.currentTimestamp)();r.next({type:"initialized",timestamp:g,isDisabled:m.isDisabled,isInitialized:t.isInitialized});u({speechdocument:t,events:r,subscriptions:l});const b=p({speechdocument:t,timestamp:g});r.next(b);const v=(f=o?document.querySelector(o):document.body)!==null&&f!==void 0?f:document.body;d=(0,i.createDomObservable)(v).pipe((0,s.map)(c),(0,s.filter)(t=>t),(0,s.bufferTime)(200),(0,s.filter)(t=>t.length>0),(0,s.tap)(()=>a({speechdocument:t,selector:o,events:r,subscriptions:l}))).subscribe()},replaceText(e){t.replaceText(e.id,e.text,e.selection.start,e.selection.start+e.selection.length,e.additionalParameters)},selectNode(e){t.selectNode(e.id,e.shouldFocus)},setRecordingState(t){e.SharedData.isRecording=t.state==="started"},setSelection(e){t.setSelection(e.id,e.selection.start,e.selection.length)},setStatus(e){t.setProcessingStatus(e.id,e.status)},setText(e){t.setText(e.id,e.text)},redo(e){t.redo(e.id)},undo(e){t.undo(e.id)}};const g=t=>{if(!t.type){return false}return!!f[t.type]};return{isValidCommand:g,commands:{next(t){const e=f[t.type];if(!e){throw new Error(`Command type: ${t.type} has no handlers`)}e(t)}},event$:r.asObservable()}}function c(t){if(!(t.target instanceof HTMLElement)){return false}switch(t.type){case"childList":if(!t.target.isContentEditable&&t.target.tagName!=="TEXTAREA"&&!!t.target.parentElement){return t.added.some(o.containsSupportedHtmlElement)||t.removed.some(o.containsSupportedHtmlElement)}else{return false}case"attributes":return i.attributesToObserve.some(e=>t.attributeName===e);default:return false}}function a({speechdocument:t,events:e,subscriptions:s,selector:i}){const o=(0,n.currentTimestamp)();t.scanDocument(i);u({speechdocument:t,events:e,subscriptions:s});const r=p({speechdocument:t,timestamp:o});e.next(r)}function u({speechdocument:e,events:n,subscriptions:s}){m({subscriptions:s});const i=e.textControlManager.getTextControls();for(const e of i){if(!e.isValid()||!e.guid){continue}const i=e.guid;s[i]=e instanceof t.CustomControl?d({textControl:e,events:n}):l({textControl:e,events:n})}}function l({textControl:t,events:e}){var i;const o=(i=t.guid)!==null&&i!==void 0?i:"";const r=t.htmlElement;const c=(0,s.fromEvent)(document,"selectionchange");const a=(0,s.fromEvent)(document,"mouseup");const u=new s.Subject;const l=new MutationObserver(t=>u.next({type:"mutation"}));l.observe(r,{attributes:true,attributeFilter:["value"],characterData:true,subtree:true,childList:true});const d=(0,s.fromEvent)(r,"keyup");const m=(0,s.fromEvent)(r,"keydown");const p=(0,s.fromEvent)(r,"mouseup");const g=(0,s.fromEvent)(r,"mousedown");const b=(0,s.fromEvent)(r,"change");const v=(0,s.fromEvent)(r,"focusout");const h=(0,s.fromEvent)(r,"focusin");const x=(0,s.fromEvent)(r,"input");const C=(0,s.fromEvent)(r,"touchend");const y=(0,s.fromEvent)(r,"processingStatusChanged");const E=(0,s.fromEvent)(r,"pendingSelectionChanged");const T=(0,s.merge)(m.pipe((0,s.map)(t=>t.shiftKey&&(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"))),d.pipe((0,s.map)(()=>false)),g.pipe((0,s.map)(()=>true)),a.pipe((0,s.map)(()=>false))).pipe((0,s.startWith)(false),(0,s.distinctUntilChanged)());const S=(0,s.merge)(c,T).pipe((0,s.withLatestFrom)(T),(0,s.filter)(([,t])=>{if(t){return false}const e=document.getSelection();if(!e||e.rangeCount===0){return false}return document.activeElement===r}));const w=(0,s.merge)(E,T).pipe((0,s.withLatestFrom)(T),(0,s.filter)(([,t])=>{if(r===document.activeElement){return false}return!t}));const M=(0,s.merge)(h,v).subscribe(t=>{const s=t.type==="focusin";e.next({type:"focusChanged",id:o,isFocused:s,timestamp:(0,n.currentTimestamp)()})});const F=(0,s.merge)(d,p,b,S,w,x,C,u).pipe((0,s.concatMap)(e=>(0,s.of)(e).pipe((0,s.delay)(0),(0,s.map)(()=>{var e;const{start:s,length:i}=t.getSelection();return{type:"controlChanged",id:(e=t.guid)!==null&&e!==void 0?e:"",timestamp:(0,n.currentTimestamp)(),selection:{start:s,length:i},text:t.getText()}}))),(0,s.distinctUntilChanged)(f),(0,s.tap)(t=>e.next(t))).subscribe();const A=y.pipe((0,s.map)(e=>{var s;return{type:"statusChanged",id:(s=t.guid)!==null&&s!==void 0?s:"",timestamp:(0,n.currentTimestamp)(),status:t.getProcessingStatus()}}),(0,s.distinctUntilChanged)((t,e)=>t.status===e.status),(0,s.tap)(t=>e.next(t))).subscribe();return()=>{M.unsubscribe();F.unsubscribe();A.unsubscribe();l.disconnect()}}function d({textControl:t,events:e}){const i=t.state$.pipe((0,s.filter)(t=>t.focus!==null),(0,s.map)(e=>{var s;return{type:"focusChanged",id:(s=t.guid)!==null&&s!==void 0?s:"",isFocused:e.focus,timestamp:(0,n.currentTimestamp)()}}),(0,s.distinctUntilChanged)(g),(0,s.tap)(t=>e.next(t))).subscribe();const o=t.state$.pipe((0,s.filter)(t=>t.selection!==null||t.text!==null),(0,s.map)(()=>{var e;return{type:"controlChanged",id:(e=t.guid)!==null&&e!==void 0?e:"",timestamp:(0,n.currentTimestamp)(),selection:t.getSelection(),text:t.getText()}}),(0,s.distinctUntilChanged)(f),(0,s.tap)(t=>e.next(t))).subscribe();const r=t.processingStatus$.pipe((0,s.map)(e=>{var s;return{type:"statusChanged",id:(s=t.guid)!==null&&s!==void 0?s:"",timestamp:(0,n.currentTimestamp)(),status:t.getProcessingStatus()}}),(0,s.distinctUntilChanged)((t,e)=>t.status===e.status),(0,s.tap)(t=>e.next(t))).subscribe();return()=>{i===null||i===void 0?void 0:i.unsubscribe();o===null||o===void 0?void 0:o.unsubscribe();r.unsubscribe()}}function m({subscriptions:t}){for(const[e,n]of Object.entries(t)){n();delete t[e]}}function p({speechdocument:t,timestamp:e}){var n,s;const i=t.textControlManager.getContainers();const o=t.textControlManager.getTextControls();const r=o.map(t=>{var e,n;const s=(e=t.guid)!==null&&e!==void 0?e:"";const{start:o,length:r}=t.getSelection();return{id:s,containerId:(n=i[s])!==null&&n!==void 0?n:"",newLine:t.newlineFormat,paragraph:t.paragraphFormat,selection:{start:o,length:r},status:t.getProcessingStatus(),text:t.getText(),conceptName:t.conceptName,dictationMode:t.dictationMode,isMultiline:t.isMultiline,documentFieldId:t.documentFieldId,capabilities:t.capabilities}});const c=(s=(n=o.find(t=>document.activeElement===t.htmlElement))===null||n===void 0?void 0:n.guid)!==null&&s!==void 0?s:"";return{type:"controlsChanged",timestamp:e,focusedControl:c,textControls:r}}function f(t,e){if(!t||!e){return false}return t.id===e.id&&t.text===e.text&&t.selection.start===e.selection.start&&t.selection.length===e.selection.length}function g(t,e){if(!t||!e){return false}return t.id===e.id&&t.isFocused===e.isFocused}
@@ -0,0 +1,18 @@
1
+ import { type BehaviorSubject, type NextObserver, type Observable } from "rxjs";
2
+ import { type WebTCLState } from "./state";
3
+ import type { WebTCLCommand } from "./commands";
4
+ import type { WebTCLEvent } from "./events";
5
+ export type WebTCLWorkerOptions = {
6
+ client: {
7
+ command$: Observable<WebTCLCommand>;
8
+ events: NextObserver<WebTCLEvent>;
9
+ };
10
+ controller: {
11
+ commands: NextObserver<WebTCLCommand>;
12
+ event$: Observable<WebTCLEvent>;
13
+ };
14
+ states: BehaviorSubject<WebTCLState>;
15
+ };
16
+ export declare function createWorker({ client, controller, states }: WebTCLWorkerOptions): {
17
+ dispose(this: void): void;
18
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createWorker=n;const e=require("rxjs");const t=require("./state");const s=require("./diagnostics");function n({client:n,controller:r,states:c}){const a=(0,s.createDiagnostics)();const i=[n.command$.subscribe(e=>{if(a.isEnabled){a.trace({type:"command-executing",command:e})}r.commands.next(e);if(a.isEnabled){a.trace({type:"command-executed",command:e})}}),r.event$.pipe((0,e.withLatestFrom)(c)).subscribe(([e,s])=>{const r=(0,t.reduceState)({state:s,event:e});if(!r){return}const i=Object.assign({},s,r);c.next(i);if(a.isEnabled){a.trace({type:"state-changed",state:s,newState:i,trigger:e});a.trace({type:"event-dispatching",event:e})}n.events.next(e);if(a.isEnabled){a.trace({type:"event-dispatched",event:e})}})];if(a.isEnabled){a.trace({type:"worker-created"})}return{dispose(){for(const e of i){e.unsubscribe()}if(a.isEnabled){a.trace({type:"worker-destroyed"})}}}}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Cleans up the given `Document` by traversing its body children and applying cleanup logic
3
+ * to each child node, except for nodes that should be ignored (such as scripts and certain node types).
4
+ *
5
+ * - Logs a warning and returns the input if the document is null or undefined.
6
+ * - Logs a warning and returns `null` if the document is the global `window.document`.
7
+ * - Ignores nodes of types: TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, and DOCUMENT_TYPE_NODE.
8
+ * - Ignores nodes with the tag name "script".
9
+ *
10
+ * @param document - The `Document` to be cleaned up.
11
+ * @returns The cleaned `Document`, or `null` if the input is the global document.
12
+ */
13
+ export declare function cleanupDocument(document: Document): Document | null;
14
+ /**
15
+ * Cleans up the specified container element and its children.
16
+ *
17
+ * If the container is still connected to a parent node, a warning is logged and the function returns `null`.
18
+ * Otherwise, it performs cleanup on the container and its children, then returns the container.
19
+ *
20
+ * @param container - The DOM element to be cleaned up.
21
+ * @returns The cleaned-up container element, or `null` if the container is still connected.
22
+ */
23
+ export declare function cleanupContainer(container: Element): Element | null;
@@ -0,0 +1 @@
1
+ import{logger as n}from"./logger/logging";import{webTCLAttributes as e}from"./webtcl";export function cleanupDocument(e){if(e===window.document){n.warning("CleanupHelper.cleanupDocument","the document must not be the SharedData.activeDocument");return null}const o=e.body.children;const t=["script"];const r=[Node.TEXT_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_TYPE_NODE];for(const n of o){if(r.includes(n.nodeType)||t.includes(n.nodeName.toLowerCase())){continue}u(n)}return e}export function cleanupContainer(e){if(e.parentNode!=null){n.warning("CleanupHelper.cleanupContainer","the container must not be connected");return null}u(e);return e}function o(n){return n.nodeName==="BR"&&n.nodeType===Node.ELEMENT_NODE&&e.getValue(n,"internalIgnore")==="true"}function t(n,e){if(!n.classList||n.classList.length===0){return}const o=[...n.classList].filter(n=>n.startsWith(e));for(const e of o){n.classList.remove(e)}}function r(n,e){var o;for(const t of e){(o=n===null||n===void 0?void 0:n.style)===null||o===void 0?void 0:o.removeProperty(t)}}function c(n){if(o(n)){e.remove(n,"internalIgnore")}else{for(const e of["NUSA_","NUSAI_"]){t(n,e)}if(e.has(n,"controlId")){i(n)}}}function i(n){r(n,["background-image","background-repeat","background-position"]);e.remove(n,"controlId");e.remove(n,"documentFieldId")}function u(n){c(n);for(const e of n.children){u(e)}}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * check the browser brand and version
3
+ * initialize brandArray
4
+ */
5
+ export function setBrowser(brandArray: any): void;
6
+ /**
7
+ * All the browser versions we are dealing with
8
+ */
9
+ export type BrowserBrand = string;
10
+ export namespace BrowserBrand {
11
+ let NotSupported: string;
12
+ let Edge: string;
13
+ let Chrome: string;
14
+ let Mozilla: string;
15
+ let Safari: string;
16
+ let FireFox: string;
17
+ }
@@ -0,0 +1 @@
1
+ import{logger as r}from"../logger/logging";export const BrowserBrand={NotSupported:"NotSupported",Edge:"Edge",Chrome:"Chrome",Mozilla:"Mozilla",Safari:"Safari",FireFox:"FireFox"};const e={Chrome:41,Firefox:38,Safari:"11.0.2",iPhone:"0",iPad:"0",AudioWorkletChrome:66};function n(r,e){if(r===e)return 0;if(!r)return-1;if(!e)return 1;const n=r.split(".");const o=e.split(".");const i=Math.max(n.length,o.length);for(let r=0;r<i;++r){if(!n[r])n.push(0);if(!o[r])o.push(0);if(n[r]<o[r])return-1;if(n[r]>o[r])return 1}return 0}function o(r){const e=navigator.userAgent.indexOf(r);if(e<0)return null;let n=navigator.userAgent.slice(e+r.length+1);const o=n.indexOf(".");n=n.slice(0,o);return n}function i(){const r=navigator.userAgent.indexOf("OS ");if(r<0)return null;let e=navigator.userAgent.slice(r+3);while(e.includes("_")){e=e.replace("_",".")}return e}function t(){let t=o("Chrome");if(t)return Number(t)>=e.Chrome;t=o("Firefox");if(t)return Number(t)>=e.Firefox;let a=navigator.userAgent.indexOf("Safari");if(a>=0){a=navigator.userAgent.indexOf("Version/");t=navigator.userAgent.slice(a+8);r.info("browser:isCurrentBrowserVersionSupported","Safari - checking version: "+t);return n(t,e.Safari)>=0}a=navigator.userAgent.indexOf("iPhone");if(a>=0){t=i();r.info("browser:isCurrentBrowserVersionSupported","iPhone - checking version: "+t);return n(t,e.iPhone)>=0}a=navigator.userAgent.indexOf("iPad");if(a>=0){t=i();r.info("browser:isCurrentBrowserVersionSupported","iPad - checking version: "+t);return n(t,e.iPad)>=0}return false}export function setBrowser(r){if(!r)return;r[BrowserBrand.NotSupported]=false;r[BrowserBrand.Mozilla]=navigator.appName.includes("Netscape");if(!r[BrowserBrand.Mozilla]){r[BrowserBrand.Mozilla]=true;r[BrowserBrand.NotSupported]=true;return}const e=navigator.userAgent.toLowerCase();r[BrowserBrand.Edge]=e.includes(" edge")||e.includes(" edg/");if(r[BrowserBrand.Edge])return;r[BrowserBrand.Chrome]=e.includes("chrome");if(!r[BrowserBrand.Chrome]){r[BrowserBrand.Safari]=e.includes("safari");if(r[BrowserBrand.Safari]){r[BrowserBrand.NotSupported]=!t();return}r[BrowserBrand.FireFox]=e.includes("firefox");if(r[BrowserBrand.FireFox])return;r[BrowserBrand.NotSupported]=true}}
@@ -0,0 +1,6 @@
1
+ export type Coordinates = {
2
+ left: number;
3
+ top: number;
4
+ right: number;
5
+ bottom: number;
6
+ };
@@ -0,0 +1,44 @@
1
+ /**
2
+ *
3
+ * @param element
4
+ * @return {Window}
5
+ */
6
+ export function getWindow(element: any): Window;
7
+ /**
8
+ *
9
+ * @param {Document} document
10
+ * @return {Window}
11
+ */
12
+ export function getWindowOfDocument(document: Document): Window;
13
+ /**
14
+ *
15
+ * @param e
16
+ * @return {HTMLElement}
17
+ */
18
+ export function getEventTarget(e: any): HTMLElement;
19
+ export const selectionMarker: "\u00A7";
20
+ export function removeEmptyTextNodes(node: HTMLElement | Node): void;
21
+ export function removeHiddenParagraphs(root: HTMLElement): void;
22
+ export function removeCommentNodes(node: HTMLElement | Node): void;
23
+ export function removeSourceBlanks(text: string | undefined): string;
24
+ export function nodeNameEquals(node: Node | undefined, name: string): boolean;
25
+ export function isElementSpeechEnabled(element: any): boolean;
26
+ export function isEmptyTextNode(node: Node | undefined): boolean;
27
+ export function isSpanTagContainingOnlyBreakTag(node: Node): boolean;
28
+ export function isIgnoreNode(node: Node | undefined): boolean;
29
+ export function isTextNode(node: Node | undefined): boolean;
30
+ export function isTextInput(element: HTMLElement | Element): boolean;
31
+ export function isCommentNode(node: Node): boolean;
32
+ export function isTextAllowed(node: Node | undefined): boolean;
33
+ export function getNextValidSibling(node: Node | undefined): Node | undefined;
34
+ export function getVeryLastNodeOf(node: Node | undefined): Node | undefined;
35
+ export function getNextNode(root: Node | undefined, node: Node | undefined): Node | undefined;
36
+ export function findTextNodeContainingText(node: Node, startNode: Node | null, text: string): Node | null;
37
+ export function isDescendant(parent: Node | undefined, node: Node | undefined): boolean;
38
+ export function insertNodeAfter(previousNode: Node | undefined, newNode: Node | undefined): boolean;
39
+ export function appendToNewParent(oldParent: Node | undefined, newParent: Node | undefined, insertAfterNode: Node | undefined): boolean;
40
+ export function moveToNewParent(activeDocument: Document, oldParent: Node | undefined, newParent: Node | undefined): HTMLElement | undefined;
41
+ export function splitTextNode(node: Node, pos: number): Node;
42
+ export function getTrailingBreak(node: Node): Node | undefined;
43
+ export function getInternalScriptLocation(): string;
44
+ export function getTextBoundingRect(input: HTMLInputElement | undefined, selectionStart: number | string, selectionEnd: number | string, debug?: boolean): DOMRect;
@@ -0,0 +1 @@
1
+ import{endsWith as e,isEmpty as t}from"./string";import{SharedData as n,isElementAttributeDisabled as o,isElementAttributeEnabled as r}from"../shared-data";import{getAttributeValue as i,hasAttribute as l}from"../webtcl/webtcl-attributes";export const selectionMarker="§";export const removeEmptyTextNodes=function(e){if(!(e===null||e===void 0?void 0:e.hasChildNodes())){return}const t=[];const n=e.childNodes.length;for(let o=0;o<n;++o){if(isEmptyTextNode(e.childNodes[o])){t.push(e.childNodes[o])}else{removeEmptyTextNodes(e.childNodes[o])}}for(const n of t){e.removeChild(n)}};export const removeHiddenParagraphs=function(e){if(!e)return;const t=e.getElementsByTagName("p");if(!t||t.length===0){return}const n=[];for(const e of t){if(!e.hasChildNodes()){n.push(e)}}for(const e of n){e.parentNode.removeChild(e)}};export const removeCommentNodes=function(e){const t=document.createNodeIterator(e,NodeFilter.SHOW_COMMENT,function(){return NodeFilter.FILTER_ACCEPT},false);let n;const o=[];while(n=t.nextNode()){o.push(n)}for(const e of o){e.parentNode.removeChild(e)}};export const removeSourceBlanks=function(t){if(!t){return""}let n="";const o=t.split("\n");for(const t of o){let o=t.replace(/^\x20+/g,"");o=o.replace(/\x20+$/g,"");if(n.length>0&&n.search(/[/,\x20]p>$/g)<0&&n.search(/[/,\x20]div>$/g)<0&&!e(n,selectionMarker)){if(o.search(/^<p[>,\x20]/g)!=0&&o.search(/^<div[>,\x20]/g)!=0&&o.indexOf(selectionMarker)!=0){n+=" "}}n+=o}t=n;t=t.replace(/\x20\x20+/g," ");t=t.replace(/\x20<[^/<>]*>\x20/g,e=>e.trimEnd());t=t.replace(/\x20<\/[^<>]*>\x20/g,e=>e.trimStart());return t};const s=function(e){if(!e)return null;return window.getComputedStyle(e,"")};export const nodeNameEquals=function(e,n){if(!e){return false}if(t(n)){return false}return e.nodeName.toLowerCase()===n};export const isElementSpeechEnabled=function(e){if(!e.nodeType){return false}if(!l(e,"isEnabled")&&!n.shouldEnableAllElements){return false}const t=s(e);const i=r(e);if(!i&&(e.disabled||(t===null||t===void 0?void 0:t.visibility)==="hidden"||(t===null||t===void 0?void 0:t.display)==="none")){return false}return!o(e)};export const isEmptyTextNode=function(e){return isTextNode(e)&&(!e.nodeValue||e.nodeValue==="")};export const isSpanTagContainingOnlyBreakTag=function(e){if(!nodeNameEquals(e,"span")){return false}return e.childNodes.length===1&&nodeNameEquals(e.childNodes[0],"br")};export const isIgnoreNode=function(e){if(!e){return false}if(isSpanTagContainingOnlyBreakTag(e)){e=e.childNodes[0]}if(!(e===null||e===void 0?void 0:e.attributes)){return false}return i(e,"internalIgnore")==="true"};export const isTextNode=function(e){return e&&e.nodeType===Node.TEXT_NODE};export const isTextInput=function(e){if(!(e===null||e===void 0?void 0:e.type))return false;const t=e.type.toLowerCase();return t=="text"||t=="search"||t=="number"};export const isCommentNode=function(e){if(e.nodeType===Node.COMMENT_NODE||e.nodeType===Node.TEXT_NODE&&e.nodeValue&&e.nodeValue.lastIndexOf("\n\n",0)===0){return true}return e.nodeName.toLowerCase()==="style"};export const isTextAllowed=function(e){return!nodeNameEquals(e,"img")};export const getNextValidSibling=function(e){if(!e){return null}let t=e.nextSibling;while(t&&isCommentNode(t)){t=t.nextSibling}return t};export const getVeryLastNodeOf=function(e){while(e===null||e===void 0?void 0:e.lastChild){e=e.lastChild}return e};export const getNextNode=function(e,t){if(!t){return null}if(t.childNodes&&t.childNodes.length>0){return t.childNodes[0]}if(t===e){return null}if(t.nextSibling){return t.nextSibling}t=t.parentNode;if(t===e){return null}while(t&&!t.nextSibling){t=t.parentNode;if(t&&t===e){return null}}return t?t.nextSibling:null};export const findTextNodeContainingText=function(e,t,n){var o;const r=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,function(){return NodeFilter.FILTER_ACCEPT},false);let i;let l=!t;while(i=r.nextNode()){if(l===true&&((o=i.nodeValue)===null||o===void 0?void 0:o.includes(n))){return i}if(i===t){l=true}}return null};export const isDescendant=function(e,t){if(!e||!t){return false}return e.contains(t)};export const insertNodeAfter=function(e,t){if(!e||!t){return false}e.after(t);return true};export const appendToNewParent=function(e,t,n){if(!e||!t){return false}let o;if(n){o=n.nextSibling}else if(isIgnoreNode(t.lastChild)){o=t.lastChild}const r=e.childNodes.length;for(let n=0;n<r;++n){if(isIgnoreNode(e.firstChild)){e.removeChild(e.firstChild);continue}if(o){t.insertBefore(e.firstChild,o)}else{t.appendChild(e.firstChild)}}const i=e.parentNode;if(i)i.removeChild(e);return true};export const moveToNewParent=function(e,t,n){if(!t||!n){return null}const o=n.firstChild;let r;const i=t.childNodes.length;for(let e=0;e<i;++e){if(isIgnoreNode(t.childNodes[0])){t.removeChild(t.childNodes[0]);continue}r=t.childNodes[0];if(o)n.insertBefore(r,o);else n.appendChild(r)}if(!r){const t=e.createTextNode("");if(o){n.insertBefore(t,o)}else{n.appendChild(t)}r=t}const l=t.parentNode;l.removeChild(t);return r};export const splitTextNode=function(e,t){const n=e.nodeValue;if(t>n.length-1){return e.nextSibling}return e.splitText(t)};export const getTrailingBreak=function(e){if(!e.hasChildNodes()){return null}while(e.lastChild){e=e.lastChild}return nodeNameEquals(e,"br")?e:null};const d=(e,n)=>{const o=document.getElementsByTagName(e);let r="";if(!o)return r;for(const e of o){r=e.src;if(t(r))r=e.href;if(t(r))continue;r=r.toLowerCase();const o=r.indexOf(n);if(o>=0){r=r.slice(0,o);return r}r=""}return r};export const getInternalScriptLocation=()=>d("script","speech-anywhere.js");export const getTextBoundingRect=function(e,t,n,o=false){if(!e||!("value"in e)){return e}if(typeof t==="string"){t=parseFloat(t)}if(typeof t!=="number"||isNaN(t)){t=0}t=t>=0?Math.min(e.value.length,t):0;if(typeof n==="string"){n=parseFloat(n)}if(typeof n!=="number"||isNaN(n)||n<t){n=t}n=n>=0?Math.min(e.value.length,n):0;const r=N();const i=m("width",true);const l=m("height",true);let s=r.top;let d=r.left;let c="padding:0;margin:0;";const u=["direction","font-family","font-size","font-size-adjust","font-variant","font-weight","font-style","letter-spacing","line-height","text-align","text-indent","text-transform","word-wrap","word-spacing","white-space-collapse","text-wrap-mode"];s+=m("padding-top",true);s+=m("border-top-width",true);d+=m("padding-left",true);d+=m("border-left-width",true);d+=1;for(const e of u){c+=`${e}:${m(e)};`}const f=e.value;const a=f.length;const p=document.createElement("div");if(t>0){x(0,t)}const h=x(t,n);if(a>n){x(n,a)}p.style.cssText=c;p.style.position="absolute";p.style.top=s+"px";p.style.left=d+"px";p.style.width=i+"px";p.style.height=l+"px";document.body.appendChild(p);const g=h.getBoundingClientRect();if(!o){p.parentNode.removeChild(p)}return g;function x(e,t){const n=document.createElement("span");n.style.cssText=c;n.textContent=f.substring(e,t);p.appendChild(n);return n}function N(){const t=document.body;const n=document.defaultView;const o=document.documentElement;let r=document.createElement("div");r.style.paddingLeft=r.style.width="1px";t.appendChild(r);const i=r.offsetWidth===2;t.removeChild(r);r=e.getBoundingClientRect();const l=o.clientTop||t.clientTop||0;const s=o.clientLeft||t.clientLeft||0;const d=n.pageYOffset||i&&o.scrollTop||t.scrollTop;const c=n.pageXOffset||i&&o.scrollLeft||t.scrollLeft;return{top:r.top+d-l,left:r.left+c-s}}function m(t,n){const o=document.defaultView.getComputedStyle(e,null).getPropertyValue(t);return n?parseFloat(o):o}};export function getWindow(e){if(!e)return window;return getWindowOfDocument(e.ownerDocument)}export function getWindowOfDocument(e){if(!e)return window;return e.defaultView}export function getEventTarget(e){if(!e)return null;let t;if(e.target)t=e.target;else if(e.srcElement)t=e.srcElement;if(t.nodeType===Node.TEXT_NODE)t=t.parentNode;return t}
@@ -0,0 +1,26 @@
1
+ import type { SelectionInfo } from "./selection-info";
2
+ export type ElementProperties = {
3
+ pendingSelection: SelectionInfo;
4
+ };
5
+ /**
6
+ * Extension properties for HTMLElement's.
7
+ * Keeps track of values associated with an HTMLElement.
8
+ */
9
+ export type ElementExtensions = {
10
+ /**
11
+ * Gets value for an element and key. When element or key does not exist, returns undefined.
12
+ * @param element
13
+ * @param key
14
+ * @returns value or undefined
15
+ */
16
+ get<K extends keyof ElementProperties>(element: HTMLElement, key: K): ElementProperties[K] | undefined;
17
+ /**
18
+ * Sets value for an element and key. When element is not valid, or key does not exist, returns undefined.
19
+ * @param element
20
+ * @param key
21
+ * @param value
22
+ */
23
+ set<K extends keyof ElementProperties>(element: HTMLElement, key: K, value: ElementProperties[K] | undefined): void;
24
+ };
25
+ export declare const elementProperties: WeakMap<HTMLElement, Partial<ElementProperties>>;
26
+ export declare const elementAccessor: ElementExtensions;
@@ -0,0 +1 @@
1
+ export const elementProperties=new WeakMap;export const elementAccessor={get(e,t){const n=elementProperties.get(e);return!!n&&t in n?n[t]:undefined},set(e,t,n){if(!e||typeof e!=="object"){return}const r=elementProperties.get(e);if(r){Object.assign(r,{[t]:n})}else{elementProperties.set(e,{[t]:n})}}};
@@ -0,0 +1,7 @@
1
+ export declare const handleNoElement: (methodName: string, elementId?: string | null) => void;
2
+ /**
3
+ * @class
4
+ */
5
+ export declare class IntegrationError extends Error {
6
+ constructor(text: string);
7
+ }
@@ -0,0 +1 @@
1
+ import{logger as r}from"../logger/logging";export const handleNoElement=(e,o=null)=>{r.error(e,"Element no longer available: "+o,Error(undefined))};export class IntegrationError extends Error{constructor(r){r="WebTcl Integration Error: "+r;super(r)}}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @class
3
+ */
4
+ export class LocalStore {
5
+ constructor(namespace: any, session?: boolean);
6
+ set(key: any, value: any): void;
7
+ get(key: any, defaultValue?: string): string;
8
+ remove(key: any): void;
9
+ #private;
10
+ }
@@ -0,0 +1 @@
1
+ var t,e,s,i,a;import{__classPrivateFieldGet as o,__classPrivateFieldSet as r}from"tslib";export class LocalStore{constructor(i,a=false){t.add(this);e.set(this,void 0);s.set(this,void 0);r(this,e,i,"f");r(this,s,a,"f")}set(e,s){o(this,t,"a",i).setItem(o(this,t,"m",a).call(this,e),s)}get(e,s=""){var r;return(r=o(this,t,"a",i).getItem(o(this,t,"m",a).call(this,e)))!==null&&r!==void 0?r:s}remove(e){o(this,t,"a",i).removeItem(o(this,t,"m",a).call(this,e))}}e=new WeakMap,s=new WeakMap,t=new WeakSet,i=function t(){return o(this,s,"f")?sessionStorage:localStorage},a=function t(s){return`${o(this,e,"f")}.${s}`};
@@ -0,0 +1,4 @@
1
+ export type SelectionInfo = {
2
+ start: number;
3
+ length: number;
4
+ };