@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.
- package/node_modules/@hccm/web-tcl/CHANGELOG.md +161 -0
- package/node_modules/@hccm/web-tcl/README.md +99 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/cleanup-helper.d.ts +23 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/cleanup-helper.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/browser.d.ts +17 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/browser.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/coordinates.d.ts +6 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/coordinates.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/dom.d.ts +44 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/dom.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/element-extensions.d.ts +26 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/element-extensions.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/error.d.ts +7 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/error.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/local-store.d.ts +10 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/local-store.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/selection-info.d.ts +4 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/selection-info.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/string.d.ts +7 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/string.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/util.d.ts +73 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/common/util.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/logger/logging.d.ts +67 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/logger/logging.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/main.d.ts +8 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/main.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/package-info.d.ts +2 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/package-info.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/shared-data.d.ts +27 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/shared-data.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/speech-document.d.ts +91 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/speech-document.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/base-control.d.ts +100 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/base-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/contenteditable-control.d.ts +18 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/contenteditable-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/custom-control.d.ts +41 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/custom-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/factory.d.ts +9 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/factory.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/helpers.d.ts +33 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/helpers.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/index.d.ts +6 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/index.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/input-control.d.ts +7 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/input-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/processing-status.d.ts +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/processing-status.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/text-control-manager.d.ts +38 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/text-control-manager.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/text-control.d.ts +64 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/text-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/textarea-control.d.ts +7 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/textarea-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/tinymce-control.d.ts +11 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/text-control-lib/tinymce-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/channel.d.ts +15 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/channel.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/commands.d.ts +64 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/commands.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/custom-control.d.ts +212 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/custom-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/index.d.ts +6 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/index.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/input-custom-control.d.ts +2 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/input-custom-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/textarea-custom-control.d.ts +2 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/custom-controls/textarea-custom-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/diagnostics.d.ts +37 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/diagnostics.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/dom-observable.d.ts +13 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/dom-observable.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/events.d.ts +39 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/events.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/iframe-support.d.ts +29 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/iframe-support.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/index.d.ts +26 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/index.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/processing-status.d.ts +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/processing-status.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/state.d.ts +165 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/state.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/types.d.ts +21 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/types.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/utility-types.d.ts +3 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/utility-types.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/validation.d.ts +35 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/validation.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/webtcl-attributes.d.ts +104 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/webtcl-attributes.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/webtcl-client.d.ts +16 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/webtcl-client.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/webtcl-controller.d.ts +8 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/webtcl-controller.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/worker.d.ts +18 -0
- package/node_modules/@hccm/web-tcl/dist/cjs/webtcl/worker.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/cleanup-helper.d.ts +23 -0
- package/node_modules/@hccm/web-tcl/dist/esm/cleanup-helper.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/browser.d.ts +17 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/browser.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/coordinates.d.ts +6 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/coordinates.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/dom.d.ts +44 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/dom.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/element-extensions.d.ts +26 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/element-extensions.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/error.d.ts +7 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/error.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/local-store.d.ts +10 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/local-store.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/selection-info.d.ts +4 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/selection-info.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/string.d.ts +7 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/string.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/util.d.ts +73 -0
- package/node_modules/@hccm/web-tcl/dist/esm/common/util.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/logger/logging.d.ts +67 -0
- package/node_modules/@hccm/web-tcl/dist/esm/logger/logging.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/main.d.ts +8 -0
- package/node_modules/@hccm/web-tcl/dist/esm/main.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/package-info.d.ts +2 -0
- package/node_modules/@hccm/web-tcl/dist/esm/package-info.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/shared-data.d.ts +27 -0
- package/node_modules/@hccm/web-tcl/dist/esm/shared-data.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/speech-document.d.ts +91 -0
- package/node_modules/@hccm/web-tcl/dist/esm/speech-document.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/base-control.d.ts +100 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/base-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/contenteditable-control.d.ts +18 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/contenteditable-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/custom-control.d.ts +41 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/custom-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/factory.d.ts +9 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/factory.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/helpers.d.ts +33 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/helpers.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/index.d.ts +6 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/index.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/input-control.d.ts +7 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/input-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/processing-status.d.ts +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/processing-status.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/text-control-manager.d.ts +38 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/text-control-manager.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/text-control.d.ts +64 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/text-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/textarea-control.d.ts +7 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/textarea-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/tinymce-control.d.ts +11 -0
- package/node_modules/@hccm/web-tcl/dist/esm/text-control-lib/tinymce-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/channel.d.ts +15 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/channel.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/commands.d.ts +64 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/commands.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/custom-control.d.ts +212 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/custom-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/index.d.ts +6 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/index.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/input-custom-control.d.ts +2 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/input-custom-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/textarea-custom-control.d.ts +2 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/custom-controls/textarea-custom-control.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/diagnostics.d.ts +37 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/diagnostics.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/dom-observable.d.ts +13 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/dom-observable.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/events.d.ts +39 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/events.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/iframe-support.d.ts +29 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/iframe-support.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/index.d.ts +26 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/index.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/processing-status.d.ts +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/processing-status.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/state.d.ts +165 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/state.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/types.d.ts +21 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/types.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/utility-types.d.ts +3 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/utility-types.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/validation.d.ts +35 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/validation.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/webtcl-attributes.d.ts +104 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/webtcl-attributes.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/webtcl-client.d.ts +16 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/webtcl-client.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/webtcl-controller.d.ts +8 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/webtcl-controller.js +1 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/worker.d.ts +18 -0
- package/node_modules/@hccm/web-tcl/dist/esm/webtcl/worker.js +1 -0
- package/node_modules/@hccm/web-tcl/package.json +72 -0
- package/package.json +5 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function isEqual(value1: string, value2: string): boolean;
|
|
2
|
+
export function isEmpty(value: string | null | undefined): boolean;
|
|
3
|
+
export function remove(value: string, fromPos: number, toPos: number): string;
|
|
4
|
+
export function insert(value: string, insertPos: number, newValue: string): string;
|
|
5
|
+
export function replaceAll(value: string, searchValue: string, replaceValue: string): string;
|
|
6
|
+
export function endsWith(value: string, searchString: string): boolean;
|
|
7
|
+
export function endsWithLineBreak(text: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isEqual=function(t,n){if((t===null||t===void 0?void 0:t.length)!==(n===null||n===void 0?void 0:n.length)){return false}return t.toLowerCase()===n.toLowerCase()};export const isEmpty=function(t){return!(t===null||t===void 0?void 0:t.length)};export const remove=function(t,n,e){return t.slice(0,n)+t.slice(e)};export const insert=function(t,n,e){if(isEmpty(t)){return e}return t.slice(0,n)+e+t.slice(n)};export const replaceAll=function(t,n,e){if(isEmpty(t)){return""}return t.replaceAll(n,e)};export const endsWith=function(t,n){if(isEmpty(t)||isEmpty(n)){return false}return t.endsWith(n)};export const endsWithLineBreak=function(t){return endsWith(t,"\n")};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param value
|
|
4
|
+
* @return {Number}
|
|
5
|
+
*/
|
|
6
|
+
export function forceNumber(value: any): number;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param param
|
|
10
|
+
* @return {boolean}
|
|
11
|
+
*/
|
|
12
|
+
export function isNullOrUndefined(param: any): boolean;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param {HTMLElement} element
|
|
16
|
+
* @return {{top: (number|*), left: (number|*), height: number, width: number | *}}
|
|
17
|
+
*/
|
|
18
|
+
export function getScrollInfo(element: HTMLElement): {
|
|
19
|
+
top: (number | any);
|
|
20
|
+
left: (number | any);
|
|
21
|
+
height: number;
|
|
22
|
+
width: number | any;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param {HTMLElement} element
|
|
27
|
+
* @param {{top: number, left: number, height: number, width: number}} oldScrollInfo
|
|
28
|
+
* @return {boolean}
|
|
29
|
+
*/
|
|
30
|
+
export function adjustScrollPosition(element: HTMLElement, oldScrollInfo: {
|
|
31
|
+
top: number;
|
|
32
|
+
left: number;
|
|
33
|
+
height: number;
|
|
34
|
+
width: number;
|
|
35
|
+
}): boolean;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @param value
|
|
39
|
+
* @param minValue
|
|
40
|
+
* @param maxValue
|
|
41
|
+
* @param defaultValue
|
|
42
|
+
* @return {Number}
|
|
43
|
+
*/
|
|
44
|
+
export function verifyNumericValue(value: any, minValue: any, maxValue: any, defaultValue: any): number;
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @param {String} text
|
|
48
|
+
* @return {String}
|
|
49
|
+
*/
|
|
50
|
+
export function decodeHtml(text: string): string;
|
|
51
|
+
export const Instance: Util;
|
|
52
|
+
/**
|
|
53
|
+
* @class
|
|
54
|
+
* @property {Boolean} useSimpleGuid
|
|
55
|
+
* @property {Number} generatedSfId
|
|
56
|
+
* @property {Array} browserVersion
|
|
57
|
+
* @property {String} attributeControlId
|
|
58
|
+
* @property {String} attributeIgnore
|
|
59
|
+
* @property {String} class_cke_editable
|
|
60
|
+
*/
|
|
61
|
+
declare class Util {
|
|
62
|
+
useSimpleGuid: boolean;
|
|
63
|
+
generatedSfId: number;
|
|
64
|
+
browserBrand: any[];
|
|
65
|
+
isChromeOrEdge(): any;
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* @param createRealGuid
|
|
69
|
+
* @return {string}
|
|
70
|
+
*/
|
|
71
|
+
createGuid(createRealGuid?: boolean): string;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isEmpty as r}from"./string";import{setBrowser as e,BrowserBrand as t}from"./browser";export function forceNumber(r){if(isNaN(r))return null;if(r==="")return null;return Number(r)}export function isNullOrUndefined(r){return r===undefined||r===null}export function getScrollInfo(r){var e,t,n,o;return{top:(e=r===null||r===void 0?void 0:r.scrollTop)!==null&&e!==void 0?e:0,left:(t=r===null||r===void 0?void 0:r.scrollLeft)!==null&&t!==void 0?t:0,height:(n=r===null||r===void 0?void 0:r.scrollHeight)!==null&&n!==void 0?n:0,width:(o=r===null||r===void 0?void 0:r.scrollWidth)!==null&&o!==void 0?o:0}}export function adjustScrollPosition(r,e){let t=false;if(r.scrollHeight!==e.height){r.scrollTop=e.top+r.scrollHeight-e.height;t=true}if(r.scrollWidth!==e.width){r.scrollLeft=e.left+r.scrollWidth-e.width;t=true}return t}export function verifyNumericValue(r,e,t,n){if(isNullOrUndefined(r))return n;r=forceNumber(r);if(r===null)return n;if(r<e||r>t)return n;return r}export function decodeHtml(e){if(r(e))return"";return e.replace(/'/g,"'").replace(/"/g,'"').replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}class n{constructor(){this.useSimpleGuid=false;this.generatedSfId=0;this.browserBrand=[];e(this.browserBrand)}isChromeOrEdge(){var r;return(r=this.browserBrand[t.Chrome])!==null&&r!==void 0?r:this.browserBrand[t.Edge]}createGuid(r=false){if(r){try{return crypto.randomUUID()}catch(r){}}if(!r&&Instance.useSimpleGuid){++Instance.generatedSfId;return`B${Instance.generatedSfId}`}let e=Date.now();if(window.performance&&typeof window.performance.now==="function"){e+=window.performance.now()}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){const t=(e+Math.random()*16)%16|0;e=Math.floor(e/16);return(r==="x"?t:t&3|8).toString(16)})}}export const Instance=new n;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the log levels for logging messages.
|
|
3
|
+
*/
|
|
4
|
+
export declare const LogLevel: Readonly<{
|
|
5
|
+
Trace: -1;
|
|
6
|
+
Debug: 0;
|
|
7
|
+
Info: 1;
|
|
8
|
+
Warning: 2;
|
|
9
|
+
Error: 3;
|
|
10
|
+
Exclusive: 4;
|
|
11
|
+
Sensitive: 5;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Represents a log entry.
|
|
15
|
+
*/
|
|
16
|
+
export type LogEntry = {
|
|
17
|
+
level: (typeof LogLevel)[keyof typeof LogLevel];
|
|
18
|
+
method: string;
|
|
19
|
+
texts: string[];
|
|
20
|
+
error?: Error | null;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Observable stream for logging events.
|
|
24
|
+
*/
|
|
25
|
+
export declare const logging$: import("rxjs").Observable<LogEntry>;
|
|
26
|
+
/**
|
|
27
|
+
* The logger object provides methods for logging messages at different log levels.
|
|
28
|
+
*/
|
|
29
|
+
export declare const logger: {
|
|
30
|
+
/**
|
|
31
|
+
* Logs a debug message.
|
|
32
|
+
* @param method - The name of the method or function being logged.
|
|
33
|
+
* @param texts - The texts to be logged.
|
|
34
|
+
*/
|
|
35
|
+
debug: (method: string, ...texts: string[]) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Logs a trace message.
|
|
38
|
+
* @param method - The name of the method or function being logged.
|
|
39
|
+
* @param texts - The texts to be logged.
|
|
40
|
+
*/
|
|
41
|
+
trace: (method: string, ...texts: string[]) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Logs an info message.
|
|
44
|
+
* @param method - The name of the method or function being logged.
|
|
45
|
+
* @param texts - The texts to be logged.
|
|
46
|
+
*/
|
|
47
|
+
info: (method: string, ...texts: string[]) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Logs a warning message.
|
|
50
|
+
* @param method - The name of the method or function being logged.
|
|
51
|
+
* @param texts - The texts to be logged.
|
|
52
|
+
*/
|
|
53
|
+
warning: (method: string, ...texts: string[]) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Logs an error message.
|
|
56
|
+
* @param method - The name of the method or function being logged.
|
|
57
|
+
* @param text - The text to be logged.
|
|
58
|
+
* @param error - The error object to be logged.
|
|
59
|
+
*/
|
|
60
|
+
error: (method: string, text: string, error?: Error) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Logs a sensitive message
|
|
63
|
+
* @param method - The name of the method or function being logged.
|
|
64
|
+
* @param texts - The texts to be logged.
|
|
65
|
+
*/
|
|
66
|
+
logSensitive: (method: string, ...texts: string[]) => void;
|
|
67
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Subject as e}from"rxjs/internal/Subject";export const LogLevel=Object.freeze({Trace:-1,Debug:0,Info:1,Warning:2,Error:3,Exclusive:4,Sensitive:5});const t=new e;export const logging$=t.asObservable();export const logger={debug:(e,...o)=>{t.next({level:LogLevel.Debug,method:e,texts:o})},trace:(e,...o)=>{t.next({level:LogLevel.Trace,method:e,texts:o})},info:(e,...o)=>{t.next({level:LogLevel.Info,method:e,texts:o})},warning:(e,...o)=>{t.next({level:LogLevel.Warning,method:e,texts:o})},error:(e,o,r)=>{t.next({level:LogLevel.Error,method:e,texts:[o],error:r})},logSensitive:(e,...o)=>{t.next({level:LogLevel.Sensitive,method:e,texts:o})}};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createTextControl } from "./text-control-lib";
|
|
2
|
+
export declare const TextControlFactory: Readonly<{
|
|
3
|
+
createTextControl: typeof createTextControl;
|
|
4
|
+
}>;
|
|
5
|
+
export { LogLevel, logging$ } from "./logger/logging";
|
|
6
|
+
export { TextControlManager, textControlManager } from "./text-control-lib";
|
|
7
|
+
export { cleanupContainer, cleanupDocument } from "./cleanup-helper";
|
|
8
|
+
export * from "./webtcl";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createTextControl as o}from"./text-control-lib";export const TextControlFactory=Object.freeze({createTextControl:o});export{LogLevel,logging$}from"./logger/logging";export{TextControlManager,textControlManager}from"./text-control-lib";export{cleanupContainer,cleanupDocument}from"./cleanup-helper";export*from"./webtcl";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const name="@hccm/web-tcl";export const version="1.20.0";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param element
|
|
4
|
+
* @return {boolean}
|
|
5
|
+
* @function
|
|
6
|
+
*/
|
|
7
|
+
export function isElementAttributeEnabled(element: any): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Checks if an HTML element's 'data-nusa-enabled' or 'data-dragon-enabled' attribute is disabled.
|
|
10
|
+
* The function considers both the attribute's value and a global setting 'shouldEnableAllElements' from SharedData.
|
|
11
|
+
* @param {HTMLElement} element - The HTML element to check.
|
|
12
|
+
* @returns {boolean} - Returns true if the 'data-nusa-enabled' or 'data-dragon-enabled' attribute is considered disabled, false otherwise.
|
|
13
|
+
*/
|
|
14
|
+
export function isElementAttributeDisabled(element: HTMLElement): boolean;
|
|
15
|
+
export const Class_FocusedElement: "NUSA_focusedElement";
|
|
16
|
+
export const Class_ResultPending: "NUSAI_classResultPending";
|
|
17
|
+
export const Class_ActiveElement: "NUSAI_classActive";
|
|
18
|
+
export const Class_CkEditable: "cke_editable";
|
|
19
|
+
export const Attr_CustomContainerType: "data-nusa-custom-container-type";
|
|
20
|
+
export const Attr_CustomContainerId: "data-nusa-custom-container-id";
|
|
21
|
+
export namespace SharedData {
|
|
22
|
+
let shouldEnableAllElements: boolean;
|
|
23
|
+
let lastDanubeFocusId: string;
|
|
24
|
+
let lastFocusedSpeechElementId: string;
|
|
25
|
+
let activeDocument: Document;
|
|
26
|
+
let isRecording: boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{LocalStore as e}from"./common/local-store";import{getAttributeValue as t}from"./webtcl/webtcl-attributes";export const Class_FocusedElement="NUSA_focusedElement";export const Class_ResultPending="NUSAI_classResultPending";export const Class_ActiveElement="NUSAI_classActive";export const Class_CkEditable="cke_editable";export const Attr_CustomContainerType="data-nusa-custom-container-type";export const Attr_CustomContainerId="data-nusa-custom-container-id";const s="SharedData";const n=new e(s,true);export const SharedData={shouldEnableAllElements:true,lastDanubeFocusId:"",get lastFocusedSpeechElementId(){return n.get("lastFocusedSpeechElementId",null)},set lastFocusedSpeechElementId(e){n.set("lastFocusedSpeechElementId",e)},activeDocument:document,isRecording:false};export function isElementAttributeEnabled(e){if(!e){return false}const s=t(e,"isEnabled");return s?s.toLowerCase()==="true":false}export function isElementAttributeDisabled(e){var s;if(!e){return false}const n=(s=t(e,"isEnabled"))===null||s===void 0?void 0:s.toLowerCase();return SharedData.shouldEnableAllElements?n==="false":n!=="true"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { TextControlManager } from "./text-control-lib";
|
|
2
|
+
import type { AdditionalReplaceTextParameters } from "./webtcl/types";
|
|
3
|
+
import type { ProcessingStatus } from "./text-control-lib";
|
|
4
|
+
import type { CustomControlCollection } from "./webtcl/custom-controls";
|
|
5
|
+
type SpeechDocumentInitializationOptions = {
|
|
6
|
+
document: Document;
|
|
7
|
+
selector?: string;
|
|
8
|
+
disableGuiMarkup?: boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The SpeechDocument
|
|
12
|
+
*/
|
|
13
|
+
export declare class SpeechDocument {
|
|
14
|
+
#private;
|
|
15
|
+
constructor({ customControls }?: {
|
|
16
|
+
customControls?: CustomControlCollection;
|
|
17
|
+
});
|
|
18
|
+
get isInitialized(): boolean;
|
|
19
|
+
get textControlManager(): TextControlManager;
|
|
20
|
+
/**
|
|
21
|
+
* @description initialize and speech enable the supported controls in the document
|
|
22
|
+
*/
|
|
23
|
+
initialize({ document, selector, disableGuiMarkup }: SpeechDocumentInitializationOptions): void;
|
|
24
|
+
/**
|
|
25
|
+
* @function
|
|
26
|
+
* @name deInitialize
|
|
27
|
+
* @description remove speech enablement from the document
|
|
28
|
+
* @memberof SpeechDocument
|
|
29
|
+
* @returns {void}
|
|
30
|
+
*/
|
|
31
|
+
deInitialize(): void;
|
|
32
|
+
/**
|
|
33
|
+
* @description set the active css class of a control
|
|
34
|
+
* @param {string} controlId - the id of the control
|
|
35
|
+
* @param {boolean} active - true if recording is on, mark focused field as Class_FocusedElement
|
|
36
|
+
*/
|
|
37
|
+
setControlActive(controlId: string, active: boolean): void;
|
|
38
|
+
/**
|
|
39
|
+
* @description set the focus to the control
|
|
40
|
+
* @param {string} controlId - the id of the control
|
|
41
|
+
* @memberof SpeechDocument
|
|
42
|
+
*/
|
|
43
|
+
setControlFocus(controlId: string): void;
|
|
44
|
+
/**
|
|
45
|
+
* @description set the text of the control
|
|
46
|
+
* @param {string} controlId - the id of the control
|
|
47
|
+
* @param {string} text - the text to set
|
|
48
|
+
*/
|
|
49
|
+
setText(controlId: string, text: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* @description replace the text of the control
|
|
52
|
+
* @param {string} controlId - the id of the control
|
|
53
|
+
* @param {string} text - the text to set
|
|
54
|
+
* @param {number} fromPos - the start position
|
|
55
|
+
* @param {number} toPos - the end position
|
|
56
|
+
* @param {AdditionalReplaceTextParameters} additionalParameters - optional parameters including matchFormattingAtThe (start/end) to indicate which text formatting to choose.
|
|
57
|
+
*/
|
|
58
|
+
replaceText(controlId: string, text: string, fromPos: number, toPos: number, additionalParameters?: AdditionalReplaceTextParameters): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* @description set the selection of the control IF the selection has not been manually changed since the recognition started
|
|
61
|
+
* @param {string} controlId - the id of the control
|
|
62
|
+
* @param {number} start - the start position
|
|
63
|
+
* @param {number} length - the length
|
|
64
|
+
*/
|
|
65
|
+
setSelection(controlId: string, start: number, length: number): void;
|
|
66
|
+
selectNode(controlId: string, focusElement: boolean): void;
|
|
67
|
+
/**
|
|
68
|
+
* Undoes the last action performed on the text control, if undo is supported.
|
|
69
|
+
*
|
|
70
|
+
* @param controlId - The unique identifier of the text control to perform undo on.
|
|
71
|
+
*/
|
|
72
|
+
undo(controlId: string): void;
|
|
73
|
+
/**
|
|
74
|
+
* Redoes the last undone action for the specified text control, if redo is supported.
|
|
75
|
+
*
|
|
76
|
+
* @param controlId - The unique identifier of the text control to perform redo on.
|
|
77
|
+
*/
|
|
78
|
+
redo(controlId: string): void;
|
|
79
|
+
/**
|
|
80
|
+
* @description set the proecessing status of the control and apply some visuals
|
|
81
|
+
*/
|
|
82
|
+
setProcessingStatus(controlId: string, status: ProcessingStatus): void;
|
|
83
|
+
scanDocument(selector?: string): void;
|
|
84
|
+
/**
|
|
85
|
+
* @description check if the control has focus
|
|
86
|
+
* @param {string} controlId - the id of the control
|
|
87
|
+
* @returns {boolean} - true if the control has focus
|
|
88
|
+
*/
|
|
89
|
+
hasFocus(controlId: string): boolean;
|
|
90
|
+
}
|
|
91
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,t,n,i,o,s,l,c,r,a,u,f,d,m,h,g,p,v,b,S,E;import{__classPrivateFieldGet as I,__classPrivateFieldSet as y}from"tslib";import{IntegrationError as D,handleNoElement as x}from"./common/error";import{logger as F}from"./logger/logging";import{isEmpty as T}from"./common/string";import{CustomControl as C,TextControlManager as w}from"./text-control-lib";import{getCustomContainerType as M,getCustomControlContainer as k}from"./text-control-lib";import{getEventTarget as L,getInternalScriptLocation as N,isElementSpeechEnabled as A,isTextInput as W}from"./common/dom";import{createTextControl as B}from"./text-control-lib";import{Class_ActiveElement as z,Class_FocusedElement as H,Class_ResultPending as G,SharedData as V}from"./shared-data";import{decodeHtml as q}from"./common/util";import{isCustomControl as P,isCustomContainer as $}from"./webtcl/validation";import{isUndoableControl as _}from"./text-control-lib/text-control";import{getAttributeValue as R,removeAttribute as U,setAttributeValue as j}from"./webtcl/webtcl-attributes";const J="[data-nusa-container],[data-dragon-container]";const K=`[data-nusa-container]:not([data-nusa-enabled^='false' i]) *,[data-dragon-container]:not([data-nusa-enabled^='false' i]) *,\n [data-nusa-container]:not([data-dragon-enabled^='false' i]) *,[data-dragon-container]:not([data-dragon-enabled^='false' i]) *`;export class SpeechDocument{constructor({customControls:u={}}={}){e.add(this);t.set(this,null);n.set(this,new w);i.set(this,new Map);o.set(this,null);s.set(this,null);l.set(this,false);c.set(this,N()+"../");r.set(this,false);a.set(this,void 0);y(this,a,u,"f")}get isInitialized(){return I(this,t,"f")!==null}get textControlManager(){return I(this,n,"f")}initialize({document:e,selector:n="body",disableGuiMarkup:i=false}){if(I(this,t,"f")){this.deInitialize()}if(!e){F.debug("SpeechDocument.initialize","no root document for container");throw new D("argument is not valid {null|HTMLDocument|HTMLElement|Array}")}y(this,r,i,"f");y(this,t,e,"f");this.scanDocument(n)}deInitialize(){if(!I(this,t,"f")){F.info("SpeechDocument.deInitialize","no valid #document");return}I(this,e,"m",m).call(this);y(this,t,null,"f")}setControlActive(e,t){let i=I(this,n,"f").getTextControl(e);if(!i){x("SpeechDocument.setControlActive",e);return}i.htmlElement.classList.toggle(z,t);i=I(this,n,"f").getTextControl("_"+e);if(!i){return}i.htmlElement.classList.toggle(z,t)}setControlFocus(t){var i;const o=I(this,n,"f").getTextControl(t);if(!o){x("SpeechDocument.setControlFocus",t);return}if(o instanceof C){(i=o.onFocus)===null||i===void 0?void 0:i.call(o);I(this,e,"m",u).call(this,o.htmlElement,false);return}const s=o.htmlElement;if(!s){x("SpeechDocument.setControlFocus","tried all ids");return}V.lastDanubeFocusId=t;F.debug("SpeechDocument.setControlFocus","new NUSAI.Data.lastDanubeFocusId",V.lastDanubeFocusId);I(this,e,"m",u).call(this,s,true)}setText(e,t){if(!e)return;const i=I(this,n,"f").getTextControl(e);if(!i)return;i.setText(t)}replaceText(e,t,i,o,s){if(!e)return false;const l=I(this,n,"f").getTextControl(e);if(!l)return false;return l.replaceText(t,i,o-i,s)}setSelection(e,t,i){F.debug("SpeechDocument.setSelection",e,t.toString(),i.toString());if(!e){return}const o=I(this,n,"f").getTextControl(e);if(!o){return}o.setSelection(t,i)}selectNode(t,i){const o=I(this,n,"f").getTextControl(t);if(!!o&&o.isValid()){I(this,e,"m",u).call(this,o.htmlElement,i)}}undo(e){const t=I(this,n,"f").getTextControl(e);if(t&&_(t)){t.undo()}}redo(e){const t=I(this,n,"f").getTextControl(e);if(t&&_(t)){t.redo()}}setProcessingStatus(t,i){const o=I(this,n,"f").getTextControl(t);if(!!o&&o.isValid()){o.setProcessingStatus(i);I(this,e,"m",v).call(this,o.htmlElement,i==="pending")}}scanDocument(o){var s;I(this,n,"f").removeAll();I(this,i,"f").clear();if(!I(this,t,"f")){F.warning("SpeechDocument.scanDocument","no document");return}const l=o?(s=I(this,t,"f").querySelector(o))!==null&&s!==void 0?s:I(this,t,"f").body:I(this,t,"f").body;const c=l.querySelectorAll(K);if(!c||c.length===0){F.warning("SpeechDocument.scanDocument","no elements");return}F.info("SpeechDocument.scanDocument","elements to check: #"+c.length);I(this,e,"m",b).call(this,Array.from(c));F.info("SpeechDocument.scanDocument","textControls added: #"+this.textControlManager.textControlCount)}hasFocus(e){var n;if(!((n=I(this,t,"f"))===null||n===void 0?void 0:n.activeElement)){return false}return R(I(this,t,"f").activeElement,"controlId")===e}}t=new WeakMap,n=new WeakMap,i=new WeakMap,o=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakMap,r=new WeakMap,a=new WeakMap,e=new WeakSet,u=function n(i,o){var l;F.debug("SpeechDocument.#selectNodeElement",i===null||i===void 0?void 0:i.id.toString(),o.toString());if(!i){x("SpeechDocument.#selectNodeElement");return}I(this,e,"m",E).call(this,i,V.isRecording);const c=i.id;let r=i;const a=P(i);if(a){const e=k(i);if(e)r=e}if(r.classList.contains(G))I(this,e,"m",v).call(this,r,false);if(V.lastFocusedSpeechElementId){const n=(l=I(this,t,"f"))===null||l===void 0?void 0:l.getElementById(V.lastFocusedSpeechElementId);if(n)I(this,e,"m",v).call(this,n,n.classList.contains(G))}V.lastFocusedSpeechElementId=c;if("type"in i&&typeof i.type==="string"){F.debug("SpeechDocument.#selectNodeElement","type:"+i.type)}if(o&&!W(i)&&"type"in i&&i.type!=="textarea"&&!i.isContentEditable&&!a){i.focus();return}if(o&&I(this,s,"f")!==i){I(this,e,"m",S).call(this,i)}},f=function t(n){const i=L(n);if(i===null){F.debug("SpeechDocument.#onElementFocusInternal","no event target - ignore");return}y(this,s,i,"f");F.debug("SpeechDocument.#onElementFocusInternal",i.tagName+", "+i.id);if($(i)){F.debug("SpeechDocument.#onElementFocusInternal - custom container:",i.id);const e=M(i);F.debug("SpeechDocument.#onElementFocusInternal - customContainerType=",e!==null&&e!==void 0?e:"null")}const o=R(i,"controlId");if(T(o)){F.debug("SpeechDocument.#onElementFocusInternal","no sfId -> ignored");return}if(I(this,l,"f")){F.debug("SpeechDocument.#onElementFocusInternal","ignoring");return}if(i){I(this,e,"m",u).call(this,i,false)}},d=function e(t){const n=L(t);if(n===I(this,s,"f"))y(this,s,null,"f")},m=function t(){y(this,o,new Map(I(this,i,"f")),"f");for(const t of I(this,i,"f").keys()){const i=I(this,n,"f").getTextControl(t);if(!(i===null||i===void 0?void 0:i.isValid())){continue}const o=i.htmlElement;I(this,e,"m",p).call(this,o);if(V.lastFocusedSpeechElementId===o.id){o.classList.remove(H)}U(o,"controlId")}I(this,n,"f").removeAll();I(this,i,"f").clear()},h=function e(t){if(!I(this,o,"f"))return null;for(const[e,n]of I(this,o,"f").entries()){if(n===t)return e}return null},g=function e(t,n){const o=t.htmlElement;if(T(o.id))o.id=n;I(this,i,"f").set(n,o.id);t.cleanup(true)},p=function e(n){var i,o,s;if(P(n)||$(n))return;if(I(this,r,"f"))return;let l;const c=R(n,"markerContainer");if(c&&!T(c)){l=(i=I(this,t,"f"))===null||i===void 0?void 0:i.getElementById(c);if(!l)alert("Element with id="+c+" not found!\nThis is set as the marker container for element id="+n.id)}if(!l)l=n;else{l.style.visibility="hidden";l.style.display="none"}let a="";if(l.tagName==="IMG"&&((o=l.attributes)===null||o===void 0?void 0:o.getNamedItem("src"))){a=(s=l.attributes.getNamedItem("src"))===null||s===void 0?void 0:s.value;if(a===null||a===void 0?void 0:a.includes("nuance-bg."))l.setAttribute("src","");return}let u=l.style.cssText;if(u&&u.length>0){if(!u.includes("nuance-bg."))return}u=u.replace(/nuance-bg.(png|gif)/,"");l.style.cssText=u},v=function e(n,i){var o;if(I(this,r,"f"))return;F.debug("SpeechDocument.#addLogoToElement",n===null||n===void 0?void 0:n.id,i.toString());if(!n){F.warning("SpeechDocument.#addLogoToElement","empty element");return}let s;const l=R(n,"markerContainer");if(l&&!T(l)){s=(o=I(this,t,"f"))===null||o===void 0?void 0:o.getElementById(l);if(!s)alert("Element with id="+l+" not found!\nThis is set as the marker container for element id="+n.id)}if(!s){if(P(n)||$(n))return;s=n}else if(s instanceof HTMLElement){s.style.visibility="visible";s.style.display=""}let a="";if(s.tagName==="IMG"){if(i)a=I(this,c,"f")+"images/nuance-bg.gif";else a=I(this,c,"f")+"images/nuance-bg.png";s.setAttribute("src",a);return}let u=s instanceof HTMLElement?s.style.cssText:null;let f=true;if(u&&u.length>0){if(u.includes("nuance_bg."))f=false;else u+=";"}if(f){u+="background-image:url("+I(this,c,"f")+"images/nuance-bg."+(i?"gif":"png")+");background-repeat:no-repeat;background-position:right top;"}else if(u){if(i)u=u.replace("nuance-bg.png","nuance-bg.gif");else u=u.replace("nuance-bg.gif","nuance-bg.png")}if(u&&s instanceof HTMLElement){s.style.cssText=u}},b=function i(o){var s,l,c;let r=false;for(const t of o){if(!t||!A(t)){continue}const i=B(t,I(this,a,"f"));if(!i){continue}const o=t.closest(J);if(!o){continue}const c=(s=R(o,"container"))!==null&&s!==void 0?s:"";const u=R(o,"isEnabled");if((u===null||u===void 0?void 0:u.toLocaleLowerCase())==="false"){continue}F.debug("SpeechDocument.processElements","text control created",i.type);if(!(i instanceof C)){i.onFocus=I(this,e,"m",f).bind(this);i.onBlur=I(this,e,"m",d).bind(this)}const m=I(this,e,"m",h).call(this,t.id);let p=m!==null&&m!==void 0?m:"";F.debug("SpeechDocument.processElements",`old sfId for ${t.id}=${p}`);const b=R(t,"controlId");p=b!==null&&b!==void 0?b:p;const S=I(this,n,"f").addTextControl(i,p,c);p=S?S:"";I(this,e,"m",g).call(this,i,p);F.debug("SpeechDocument.processElements","text control - id and sfId set",t.id,p);if(V.lastFocusedSpeechElementId===t.id){r=true}let E=(l=R(t,"conceptName"))!==null&&l!==void 0?l:"";E=q(E);I(this,e,"m",v).call(this,t,false);let y=R(t,"documentFieldId");if(!y){y=t.id;j(t,"documentFieldId",y)}}if(!r&&V.lastFocusedSpeechElementId){const e=(c=I(this,t,"f"))===null||c===void 0?void 0:c.getElementById(V.lastFocusedSpeechElementId);e===null||e===void 0?void 0:e.classList.remove(H);V.lastFocusedSpeechElementId=""}},S=function e(i){var o;try{F.debug("SpeechDocument.focusSpeechElement - focus element");y(this,l,true,"f");i.focus();y(this,s,i,"f");if(!((o=I(this,t,"f"))===null||o===void 0?void 0:o.hasFocus())){const e=I(this,n,"f").getTextControlByElement(i);e===null||e===void 0?void 0:e.onElementFocus(null)}}finally{y(this,l,false,"f")}},E=function e(n,i){var o;let s;let l;if(V.lastFocusedSpeechElementId!=null){s=(o=I(this,t,"f"))===null||o===void 0?void 0:o.getElementById(V.lastFocusedSpeechElementId);if(!s)V.lastFocusedSpeechElementId="";else{if(P(s)){l=k(s);if(l!=null)s=l}s.classList.remove(H)}}let c=false;if(P(n)){l=k(n);if(l!=null){c=true}}if(i&&!c&&!I(this,r,"f")){n.classList.add(H)}};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/** @typedef {import('../common/selection-info').SelectionInfo} SelectionInfo */
|
|
2
|
+
/** @typedef {import('./processing-status').ProcessingStatus} ProcessingStatus */
|
|
3
|
+
/**
|
|
4
|
+
* The base class of all TextControls
|
|
5
|
+
* @class
|
|
6
|
+
*/
|
|
7
|
+
export class BaseControl {
|
|
8
|
+
constructor(element: any);
|
|
9
|
+
type: string;
|
|
10
|
+
/** @type {string|null} */
|
|
11
|
+
guid: string | null;
|
|
12
|
+
isMultiline: boolean;
|
|
13
|
+
/** @type {ProcessingStatus} */
|
|
14
|
+
processingStatus: ProcessingStatus;
|
|
15
|
+
/** @type {HTMLElement} */
|
|
16
|
+
htmlElement: HTMLElement;
|
|
17
|
+
newlineFormat: string;
|
|
18
|
+
paragraphFormat: string;
|
|
19
|
+
onFocus: any;
|
|
20
|
+
onBlur: any;
|
|
21
|
+
/** @param {SelectionInfo | null} selection */
|
|
22
|
+
set pendingSelection(selection: SelectionInfo | null);
|
|
23
|
+
/** @returns {SelectionInfo | null } */
|
|
24
|
+
get pendingSelection(): SelectionInfo | null;
|
|
25
|
+
/**
|
|
26
|
+
* Checks if the HTML element currently has focus.
|
|
27
|
+
*
|
|
28
|
+
* @returns {boolean} True if the HTML element has focus, otherwise false.
|
|
29
|
+
*/
|
|
30
|
+
get hasFocus(): boolean;
|
|
31
|
+
isValid(): boolean;
|
|
32
|
+
invalidate(): void;
|
|
33
|
+
onElementFocus(e: any): void;
|
|
34
|
+
/**
|
|
35
|
+
* @param {FocusEvent} e
|
|
36
|
+
*/
|
|
37
|
+
onElementBlur(e: FocusEvent): void;
|
|
38
|
+
getType(): string;
|
|
39
|
+
setGuid(guid: any): boolean;
|
|
40
|
+
getElementGuid(): string | null;
|
|
41
|
+
/**
|
|
42
|
+
* The dictation mode of the html element
|
|
43
|
+
* @return {string}
|
|
44
|
+
*/
|
|
45
|
+
get dictationMode(): string;
|
|
46
|
+
/**
|
|
47
|
+
* The concept name of the html element
|
|
48
|
+
* @return {string}
|
|
49
|
+
*/
|
|
50
|
+
get conceptName(): string;
|
|
51
|
+
/**
|
|
52
|
+
* The document field id of the html element
|
|
53
|
+
* @return {string}
|
|
54
|
+
*/
|
|
55
|
+
get documentFieldId(): string;
|
|
56
|
+
/** @returns {void} */
|
|
57
|
+
cleanup(_initialCleanup: any): void;
|
|
58
|
+
/**
|
|
59
|
+
* getText
|
|
60
|
+
* @returns {string}
|
|
61
|
+
*/
|
|
62
|
+
getText(): string;
|
|
63
|
+
/** @returns {void} */
|
|
64
|
+
setText(text: any): void;
|
|
65
|
+
/** @returns {boolean} */
|
|
66
|
+
replaceText(text: any, from: any, length: any): boolean;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @returns {SelectionInfo}
|
|
70
|
+
*/
|
|
71
|
+
getSelection(): SelectionInfo;
|
|
72
|
+
/**
|
|
73
|
+
* Sets the selection range of the input element.
|
|
74
|
+
*
|
|
75
|
+
* @param {number} [from=0] - The starting position of the selection.
|
|
76
|
+
* @param {number} [length=0] - The length of the selection.
|
|
77
|
+
*/
|
|
78
|
+
setSelection(from?: number, length?: number): void;
|
|
79
|
+
getTextLength(): number;
|
|
80
|
+
getNewlineFormatString(): string;
|
|
81
|
+
getParagraphFormatString(): string;
|
|
82
|
+
/** @returns {import("../common/coordinates").Coordinates} */
|
|
83
|
+
getSelectionCoordinates(): import("../common/coordinates").Coordinates;
|
|
84
|
+
getLineBreakSubstitute(): string;
|
|
85
|
+
getLineBreakText(node: any): string;
|
|
86
|
+
/**
|
|
87
|
+
* Gets the current processing status.
|
|
88
|
+
* @returns {ProcessingStatus}
|
|
89
|
+
*/
|
|
90
|
+
getProcessingStatus(): ProcessingStatus;
|
|
91
|
+
/**
|
|
92
|
+
* Sets the processing status.
|
|
93
|
+
* @param {ProcessingStatus} status
|
|
94
|
+
*/
|
|
95
|
+
setProcessingStatus(status: ProcessingStatus): void;
|
|
96
|
+
_ensureSelectionIsVisible(from: any, length: any): void;
|
|
97
|
+
#private;
|
|
98
|
+
}
|
|
99
|
+
export type SelectionInfo = import("../common/selection-info").SelectionInfo;
|
|
100
|
+
export type ProcessingStatus = import("./processing-status").ProcessingStatus;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t;import{__classPrivateFieldGet as e,__classPrivateFieldSet as n}from"tslib";import*as l from"../common/util";import*as i from"../common/string";import*as s from"../common/dom";import{BrowserBrand as o}from"../common/browser";import{elementAccessor as r}from"../common/element-extensions";import{fromEvent as h}from"rxjs";import{getAttributeValue as m,setAttributeValue as u}from"../webtcl/webtcl-attributes";export class BaseControl{constructor(e){t.set(this,void 0);this.type="TextControl";this.guid=null;this.isMultiline=true;this.processingStatus="idle";this.htmlElement=e;this.newlineFormat="\n";this.paragraphFormat="\n\n";this.onFocus=null;this.onBlur=null;n(this,t,!this.htmlElement?[]:[h(this.htmlElement,"focus").subscribe(t=>{this.onElementFocus(t)}),h(this.htmlElement,"blur").subscribe(t=>{this.onElementBlur(t)})],"f")}get pendingSelection(){var t;return(t=r.get(this.htmlElement,"pendingSelection"))!==null&&t!==void 0?t:null}set pendingSelection(t){r.set(this.htmlElement,"pendingSelection",t!==null&&t!==void 0?t:undefined);if(!this.hasFocus){this.htmlElement.dispatchEvent(new CustomEvent("pendingSelectionChanged"))}}get hasFocus(){return this.htmlElement===this.htmlElement.ownerDocument.activeElement}isValid(){return!!this.htmlElement}invalidate(){for(const n of e(this,t,"f")){n.unsubscribe()}e(this,t,"f").length=0;this.htmlElement=null;this.guid=null;this.onFocus=null;this.onBlur=null}onElementFocus(t){if(!this){return}const e=this.pendingSelection;if(e){this.pendingSelection=null;this.setSelection(e.start,e.length)}if(typeof this.onFocus==="function"){if(t===null){t={target:this.htmlElement}}this.onFocus(t)}}onElementBlur(t){if(!this)return;if(typeof this.onBlur==="function")this.onBlur(t)}getType(){return this.type}setGuid(t){this.guid=t;u(this.htmlElement,"controlId",t);return true}getElementGuid(){return m(this.htmlElement,"controlId")}get dictationMode(){var t;const e=(t=m(this.htmlElement,"dictationMode"))!==null&&t!==void 0?t:"";return l.decodeHtml(e)}get conceptName(){var t;const e=(t=m(this.htmlElement,"conceptName"))!==null&&t!==void 0?t:"";return l.decodeHtml(e)}get documentFieldId(){var t;const e=(t=m(this.htmlElement,"documentFieldId"))!==null&&t!==void 0?t:"";return l.decodeHtml(e)}cleanup(t){return false}getText(){if(this.htmlElement.value)return this.htmlElement.value;return""}setText(t){t!==null&&t!==void 0?t:t="";if(!this.isMultiline){t=i.replaceAll(t,"\n"," ")}const e=Object.getOwnPropertyDescriptor(this.htmlElement.constructor.prototype,"value").set;e.call(this.htmlElement,t);this.htmlElement.dispatchEvent(new Event("input",{bubbles:true}));return true}replaceText(t,e,n){let s=this.getText();const o=l.getScrollInfo(this.htmlElement);if(!this.isMultiline){t=i.replaceAll(t,"\n"," ")}e=l.forceNumber(e);n=l.forceNumber(n);if(s.length>0)s=i.remove(s,e,e+n);s=i.insert(s,e,t);this.setText(s);if(!l.adjustScrollPosition(this.htmlElement,o))this._ensureSelectionIsVisible(e+t.length,0);return true}getSelection(){var t;if(this.pendingSelection){return this.pendingSelection}const e=(t=this.htmlElement.selectionStart)!==null&&t!==void 0?t:0;const n=this.htmlElement.selectionEnd-e;return{start:e,length:n}}setSelection(t=0,e=0){t=Math.max(0,l.forceNumber(t));e=Math.max(0,l.forceNumber(e));if(!this.hasFocus){this.pendingSelection={start:t,length:e};return}const n=["text","search","tel","url","password"];if(this.type!=="Input"||n.includes(this.htmlElement.type)){this.htmlElement.selectionStart=t;this.htmlElement.selectionEnd=Number(t)+Number(e)}this._ensureSelectionIsVisible(t,e)}getTextLength(){return this.getText().length}getNewlineFormatString(){return this.newlineFormat}getParagraphFormatString(){return this.paragraphFormat}getSelectionCoordinates(){const t=this.getSelection(),e=s.getTextBoundingRect(this.htmlElement,t.start,t.length);return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}getLineBreakSubstitute(){return" "}getLineBreakText(t){if(!t||s.nodeNameEquals(t,"br"))return"\n";if((l.Instance.browserBrand[o.Chrome]||l.Instance.browserBrand[o.Edge])&&s.nodeNameEquals(t,"div"))return"\n";const e=t.nodeName.toLowerCase();if(e==="li"||e==="ul"||e==="ol")return"\n";if(e==="div"||e==="p"||e.match("h."))return"\f";if(s.nodeNameEquals(t,"td")||s.nodeNameEquals(t,"table"))return String.fromCharCode(127);return""}getProcessingStatus(){return this.processingStatus}setProcessingStatus(t){if(this.processingStatus===t){return}this.processingStatus=t;this.htmlElement.dispatchEvent(new CustomEvent("processingStatusChanged"))}_ensureSelectionIsVisible(t,e){if(t===0){this.htmlElement.scrollTop=this.htmlElement.scrollLeft=0;return}const n=s.getTextBoundingRect(this.htmlElement,t,t+e);const l=this.htmlElement.getBoundingClientRect();const i=n.top-this.htmlElement.scrollTop>=l.top&&n.bottom-this.htmlElement.scrollTop<=l.bottom;const o=n.left-this.htmlElement.scrollLeft>=l.left&&n.right-this.htmlElement.scrollLeft<=l.right;if(!o){this.htmlElement.scrollLeft=n.left-l.left-l.width/2}if(!i){this.htmlElement.scrollTop=n.top-l.top-l.height/2}}}t=new WeakMap;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** @typedef {import("../common/selection-info").SelectionInfo} SelectionInfo */
|
|
2
|
+
/**
|
|
3
|
+
* @class
|
|
4
|
+
*/
|
|
5
|
+
export class ContentEditableControl extends BaseControl {
|
|
6
|
+
keepEmptyTextNode: boolean;
|
|
7
|
+
adjustScrollPosition(element: any, scrollInfo: any, fromPosition: any): void;
|
|
8
|
+
/**
|
|
9
|
+
* Ensures that the specified text selection is visible within the contenteditable element
|
|
10
|
+
* by automatically scrolling the element if necessary.
|
|
11
|
+
* @private
|
|
12
|
+
* @param {number} [from] - The starting position of the selection. If not provided, uses current selection.
|
|
13
|
+
*/
|
|
14
|
+
private _ensureSelectionIsVisible;
|
|
15
|
+
#private;
|
|
16
|
+
}
|
|
17
|
+
export type SelectionInfo = import("../common/selection-info").SelectionInfo;
|
|
18
|
+
import { BaseControl } from "./base-control";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,t,n,i,l,o,s,r,a,d,h,c,u,f,m,g,N,p,b,C,x,E,v,S,T,w,B,q,I,y,L,k,O,V,F,M,D,A,R,P,W,H,j,_,z,G,$,U,J,K,Q,X,Y,Z,ee,te;import{__classPrivateFieldGet as ne}from"tslib";import{BaseControl as ie}from"./base-control";import{logger as le}from"../logger/logging";import*as oe from"../common/util";import*as se from"../common/string";import*as re from"../common/dom";import{BrowserBrand as ae}from"../common/browser";import{setAttributeValue as de,removeAttribute as he}from"../webtcl/webtcl-attributes";export class ContentEditableControl extends ie{constructor(t){super(t);e.add(this);te.set(this,new Set(["address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","li","main","nav","noscript","ol","p","pre","section","table","ul","output","summary","details","dialog"]));this.type="ContentEditable";this.newlineFormat="\n";this.paragraphFormat="\f";this.keepEmptyTextNode=false}invalidate(){super.invalidate.call(this)}onElementFocus(e){const t=this.pendingSelection;if(!(e===null||e===void 0?void 0:e.sourceCapabilities)){if(t){le.debug("ContentEditableControl.onElementFocus","pendingSelection");this.setSelection(t.start,t.length)}else{le.debug("ContentEditableControl.onElementFocus","firstTime: setting caret to end of field");this.setSelection(this.getTextLength(),0)}}if(e!==null&&typeof this.onFocus==="function"){this.onFocus(e)}}cleanup(t){var n;const i=this.htmlElement;let s,r;const d=re.selectionMarker;try{le.debug("ContentEditableControl.cleanup",i===null||i===void 0?void 0:i.id);if(!i||se.isEmpty(i.innerHTML)){return}if(i===i.ownerDocument.activeElement&&oe.Instance.browserBrand[ae.Mozilla]){({anchorNodeId:s,focusNodeId:r}=ne(this,e,"m",o).call(this,i))}const n=i.innerHTML.length;re.removeCommentNodes(i);const h=re.removeSourceBlanks(i.innerHTML);if(h.length!==n){i.innerHTML=h}if(oe.Instance.browserBrand[ae.Mozilla]){ne(this,e,"m",l).call(this,i,t)}if(!ne(this,e,"m",$).call(this,i)){const t=se.replaceAll(h,d,"");if(!se.isEmpty(t))ne(this,e,"m",N).call(this,i)}if(s)ne(this,e,"m",a).call(this,i,d,s,r)}catch(e){if(i===null||i===void 0?void 0:i.innerHTML){i.innerHTML=se.replaceAll(i.innerHTML,d,"")}le.error("ContentEditableControl.cleanup",(n=e===null||e===void 0?void 0:e.message)!==null&&n!==void 0?n:"unknown error",e)}}getText(){var t;try{le.debug("ContentEditableControl.getText");ne(this,e,"m",v).call(this);let t=ne(this,e,"m",h).call(this,this.htmlElement,this.htmlElement,"");t=se.replaceAll(t," "," ");return t}catch(e){le.error("ContentEditableControl.getText",(t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:"unknown error",e);return null}}setText(t){var n;try{le.debug("ContentEditableControl.setText");t!==null&&t!==void 0?t:t="";const n=oe.getScrollInfo(this.htmlElement);const i=this.getTextLength();ne(this,e,"m",c).call(this,t,0,i);this.adjustScrollPosition(this.htmlElement,n,0,i);if(this.hasFocus){ne(this,e,"m",f).call(this,this.getTextLength(),0)}return true}catch(e){le.error("ContentEditableControl.setText",(n=e===null||e===void 0?void 0:e.message)!==null&&n!==void 0?n:"unknown error",e);return false}}replaceText(t,n,i){var l;try{le.debug("ContentEditableControl.replaceText",n,i);const l=oe.getScrollInfo(this.htmlElement);n=oe.forceNumber(n);i=oe.forceNumber(i);ne(this,e,"m",c).call(this,t,n,n+i);this.adjustScrollPosition(this.htmlElement,l,n);return true}catch(e){le.error("ContentEditableControl.replaceText",(l=e===null||e===void 0?void 0:e.message)!==null&&l!==void 0?l:"unknown error",e);return false}}adjustScrollPosition(e,t,n){if(!oe.adjustScrollPosition(e,t)){this._ensureSelectionIsVisible(n)}}getSelection(){var t;try{le.debug("ContentEditableControl.getSelection");if(this.hasFocus){return this.pendingSelection=ne(this,e,"m",m).call(this)}if(this.pendingSelection){return ne(this,e,"m",d).call(this,this.pendingSelection.start,this.pendingSelection.length)}return{start:this.getTextLength(),length:0}}catch(e){le.error("ContentEditableControl.getSelection",(t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:"unknown error",e);return null}}setSelection(t=0,n=0){var i;try{le.debug("ContentEditableControl.setSelection",t,n);const i=ne(this,e,"m",d).call(this,t,n);if(!this.hasFocus){this.pendingSelection=i;return}ne(this,e,"m",f).call(this,i.start,i.length);const l=oe.getScrollInfo(this.htmlElement);this.adjustScrollPosition(this.htmlElement,l,i.start)}catch(e){le.error("ContentEditableControl.setSelection",(i=e===null||e===void 0?void 0:e.message)!==null&&i!==void 0?i:"unknown error",e)}}getSelectionCoordinates(){var e;try{le.debug("ContentEditableControl.getSelectionCoordinates");const e=window.getSelection();if(!e||e.rangeCount===0)return null;const t=e.getRangeAt(0).getBoundingClientRect();return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}catch(t){le.error("ContentEditableControl.getSelectionCoordinates",(e=t===null||t===void 0?void 0:t.message)!==null&&e!==void 0?e:"unknown error",t);return null}}_ensureSelectionIsVisible(e){var t;try{if(e===undefined){const t=this.getSelection();if(!t)return;e=t.start}const t=this.htmlElement;if(e===0){t.scrollTop=t.scrollLeft=0;return}const n=this.getSelectionCoordinates();if(!n||n.top===0&&n.bottom===0&&n.left===0&&n.right===0)return;const i=t.getBoundingClientRect();const l=i.top;const o=i.bottom;const s=i.left;const r=i.right;const a=n.top>=l&&n.bottom<=o;const d=n.left>=s&&n.right<=r;if(!a){const e=(n.top+n.bottom)/2;const i=(l+o)/2;const s=e-i;t.scrollTop+=s}if(!d){const e=(n.left+n.right)/2;const i=(s+r)/2;const l=e-i;t.scrollLeft+=l}}catch(e){le.error("ContentEditableControl._ensureSelectionIsVisible",(t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:"unknown error",e)}}}te=new WeakMap,e=new WeakSet,t=function e(t,n){while(n.indexOf(t)>=0)t+="]";return t},n=function e(t){var n;let i,l;if(!re.isTextNode(t.anchorNode)){i=(n=t.anchorNode.childNodes[t.anchorOffset-1])!==null&&n!==void 0?n:t.anchorNode;l=0}else{i=t.anchorNode;l=t.anchorOffset}return{anchorNode:i,anchorOffset:l}},i=function e(t){var n;let i,l;if(!re.isTextNode(t.focusNode)){i=(n=t.focusNode.childNodes[t.focusOffset-1])!==null&&n!==void 0?n:t.anchorNode;l=0}else{i=t.focusNode;l=t.focusOffset}return{focusNode:i,focusOffset:l}},l=function t(n,i){if(i)re.removeHiddenParagraphs(n);let l=n.getElementsByTagName("p");if(l){for(const t of l)ne(this,e,"m",B).call(this,t)}l=n.getElementsByTagName("div");if(l){for(const t of l)ne(this,e,"m",B).call(this,t)}},o=function l(o){var s,r;const a=ne(this,e,"m",t).call(this,re.selectionMarker,o.innerHTML);const d=re.getWindow(o).getSelection();const{anchorNode:h,anchorOffset:c}=ne(this,e,"m",n).call(this,d);const{focusNode:u,focusOffset:f}=ne(this,e,"m",i).call(this,d);(s=h.id)!==null&&s!==void 0?s:h.id=oe.Instance.createGuid(true);(r=u.id)!==null&&r!==void 0?r:u.id=oe.Instance.createGuid(true);if(h===u&&re.isTextNode(h)){let e,t;if(c<=f){e=c;t=f+a.length}else{e=f;t=c+a.length}h.textContent=h.textContent.substring(0,e)+a+h.textContent.substring(e);h.textContent=h.textContent.substring(0,t)+a+h.textContent.substring(t)}else{if(re.isTextNode(h))h.textContent=h.textContent.substring(0,c)+a+h.textContent.substring(c);if(re.isTextNode(u))u.textContent=u.textContent.substring(0,f)+a+u.textContent.substring(f)}return{anchorNodeId:h.id,focusNodeId:u.id}},s=function e(t,n,i){if(n.nodeType===3)t.setStart(n,i);else t.setStartBefore(n)},r=function e(t,n,i){if(n.nodeType===3)t.setEnd(n,i);else t.setEndBefore(n)},a=function t(n,i,l,o){var a,d,h;let c=n.ownerDocument.getElementById(l);c!==null&&c!==void 0?c:c=re.findTextNodeContainingText(n,null,i);let u=l===o?c:n.ownerDocument.getElementById(o);u!==null&&u!==void 0?u:u=re.findTextNodeContainingText(n,c,i);if(c!==u&&!(Node.DOCUMENT_POSITION_FOLLOWING&c.compareDocumentPosition(u))){const e=c;c=u;u=e}let f,m;if(re.isTextNode(c)){f=c.textContent.indexOf(i);if(f<0)f=0;else c.textContent=c.textContent.substring(0,f)+c.textContent.substring(f+i.length)}else f=0;if(re.isTextNode(u)){m=u.textContent.indexOf(i);if(m<0)m=0;else u.textContent=u.textContent.substring(0,m)+u.textContent.substring(m+i.length)}else m=0;const g=re.getWindow(n).getSelection();g.removeAllRanges();const N=n.ownerDocument.createRange();if(c)ne(this,e,"m",s).call(this,N,c,f);else N.setStart((a=n.firstChild)!==null&&a!==void 0?a:n,0);if(!u){u=(d=re.getVeryLastNodeOf(n))!==null&&d!==void 0?d:n;m=(h=u.textContent.length)!==null&&h!==void 0?h:0}ne(this,e,"m",r).call(this,N,u,m);g.addRange(N)},d=function e(t,n){t=Math.max(0,oe.forceNumber(t));n=Math.max(0,oe.forceNumber(n));const i=this.getTextLength();t=Math.min(t,i);if(t+n>i){n=i-t}le.debug("ContentEditableControl.#ensureValidSelection",`returning start: ${t}, length: ${n}`);return{start:t,length:n}},h=function t(n,i,l){let o,s;const r=re.isIgnoreNode(i)||re.isCommentNode(i);if(!r){if(re.isTextNode(i)&&i.nodeValue.length>0){l+=i.nodeValue}else if(ne(this,e,"m",W).call(this,n,i)){l+=this.getLineBreakText()}else if(ne(this,e,"m",H).call(this,i)){l+=ne(this,e,"m",j).call(this)}if(i.childNodes&&i.childNodes.length>0){for(const o of i.childNodes){l=ne(this,e,"m",t).call(this,n,o,l)}}}if(n!==i){o=re.getNextValidSibling(i);if(o&&!re.isIgnoreNode(o)&&!re.isCommentNode(o)){s=re.isEmptyTextNode(o);while(s){o=re.getNextValidSibling(o);if(!o)break;s=re.isEmptyTextNode(o)}const t=r?0:ne(this,e,"m",W).call(this,n,i);if(ne(this,e,"m",F).call(this,i)){if(ne(this,e,"m",y).call(this,l))return l;if(!s)l+=this.getLineBreakText(i)}else if(!t&&!re.isEmptyTextNode(i)){if(ne(this,e,"m",F).call(this,o))l+=this.getLineBreakText(o)}}}return l},c=function t(n,i,l){const o=this.htmlElement;const s=o.ownerDocument;let r=null;let a=null;const d=this.getTextLength();if(i!==l){a=ne(this,e,"m",w).call(this,o,i,l)}if(!n||n.length===0){if(d!==this.getTextLength()){this.htmlElement.dispatchEvent(new Event("input",{bubbles:true,cancelable:true}))}return}a!==null&&a!==void 0?a:a=ne(this,e,"m",S).call(this,o,i);r=a.node;if(!r)return;if(re.isTextNode(r)){i-=a.start;re.splitTextNode(r,i)}if(!re.isTextAllowed(r)){const e=s.createTextNode(n);if(r.nextSibling){r.parentNode.insertBefore(e,r.nextSibling)}else{r.parentNode.appendChild(e)}}else{ne(this,e,"m",x).call(this,o,r,n)}this.htmlElement.dispatchEvent(new Event("input",{bubbles:true,cancelable:true}))},u=function e(t){if(re.nodeNameEquals(t,"strong")||re.nodeNameEquals(t,"em")||re.nodeNameEquals(t,"span")||re.nodeNameEquals(t,"b")||re.nodeNameEquals(t,"i")||re.nodeNameEquals(t,"u")){return false}return true},f=function t(n,i){const l=this.htmlElement;const o=re.getWindow(l).getSelection();o.removeAllRanges();const s=l.ownerDocument;const r=s.createRange();const a=ne(this,e,"m",S).call(this,l,n);let d=n;d=d-a.start;if(re.nodeNameEquals(a.node,"br")&&d>0){const t=a.node;if(i===0&&!t.nextSibling&&!ne(this,e,"m",u).call(this,t.parentNode)){const e=l.ownerDocument;const n=e.createTextNode("");t.parentNode.appendChild(n);this.keepEmptyTextNode=true}r.setStartAfter(a.node)}else{r.setStart(a.node,d);this.keepEmptyTextNode=false}if(i===0){if(a.node.nodeName.toLowerCase()==="br"&&d>0)r.setEndAfter(a.node);else r.setEnd(a.node,d)}else{let t=Number(n)+Number(i);const o=ne(this,e,"m",S).call(this,l,t);t=Number(t)-Number(o.start);if(o.node.nodeName.toLowerCase()==="br")r.setEndAfter(o.node);else r.setEnd(o.node,t)}o.addRange(r);this.pendingSelection={start:n,length:i}},m=function t(){const n=this.htmlElement;const i=re.getWindow(n).getSelection();let l=i.anchorNode;let o=i.anchorOffset;if(ne(this,e,"m",M).call(this,l)&&l.hasChildNodes()){if(o>=l.childNodes.length){l=l.childNodes[l.childNodes.length-1];o=ne(this,e,"m",g).call(this,l)}else{l=l.childNodes[o];o=0}}let s=ne(this,e,"m",S).call(this,n,0,l);let r=s.textBefore.length;r+=o;const a=r;let d=i.focusNode;let h=i.focusOffset;if(ne(this,e,"m",M).call(this,d)&&d.hasChildNodes()){if(h>=d.childNodes.length){d=d.childNodes[d.childNodes.length-1];h=ne(this,e,"m",g).call(this,d)}else{d=d.childNodes[h];h=0}}s=ne(this,e,"m",S).call(this,n,0,d);let c=s.textBefore.length;c+=h;const u={};if(a>c){u.start=c;u.length=a-c}else{u.start=a;u.length=c-a}return u},g=function t(n){let i=ne(this,e,"m",h).call(this,n,n,"");i=se.replaceAll(i," "," ");return i.length},N=function t(n){const i=n.ownerDocument.createElement("div");while(n.firstChild&&!ne(this,e,"m",ee).call(this,n.firstChild)){i.appendChild(n.firstChild)}ne(this,e,"m",B).call(this,i);n.insertBefore(i,n.firstChild);return i},p=function t(n,i,l){if(!re.getTrailingBreak(i)||!re.isIgnoreNode(i.lastChild))ne(this,e,"m",G).call(this,i);if(re.nodeNameEquals(l,"br")&&!re.isIgnoreNode(l)){if(re.isIgnoreNode(l.nextSibling))l=l.nextSibling;else{const t=ne(this,e,"m",z).call(this,n);re.insertNodeAfter(l,t);l=t}}return l},b=function t(n){if(!n||n.nextSibling)return;const i=ne(this,e,"m",A).call(this,n);if(i&&re.getVeryLastNodeOf(i)===n){ne(this,e,"m",G).call(this,i)}},C=function t(n,i){if(!ne(this,e,"m",$).call(this,n)){const t=ne(this,e,"m",N).call(this,n);if(i===n){i=t}}return i},x=function t(n,i,l){const o=i;const s=n.ownerDocument;const r=ne(this,e,"m",k).call(this,s,l,i);if(!r||r.length===0)return;i=ne(this,e,"m",C).call(this,n,i);let a;if(n===i){a=ne(this,e,"m",L).call(this,n);const t=ne(this,e,"m",M).call(this,r[r.length-1]);if(!a&&!t){a=ne(this,e,"m",G).call(this,n)}}else if(re.nodeNameEquals(r[r.length-1],"br")){ne(this,e,"m",b).call(this,i)}for(const t of r){let l=t;if(re.nodeNameEquals(l,"p"))i=ne(this,e,"m",p).call(this,s,l,i);if(a){ne(this,e,"m",K).call(this,n,n.firstChild,l);a=null}else{const t=o===i&&ne(this,e,"m",M).call(this,i)&&ne(this,e,"m",M).call(this,l)&&!ne(this,e,"m",Z).call(this,i);const s=t?ne(this,e,"m",K).call(this,n,i,l):ne(this,e,"m",J).call(this,n,l,i);const r=s.container;const a=s.node===s.previousNode&&r!==n&&!re.nodeNameEquals(r,"div")&&ne(this,e,"m",D).call(this,r)&&l===r.lastChild&&re.nodeNameEquals(l,"br");if(a){ne(this,e,"m",G).call(this,r)}if(s.node!==s.previousNode){l=s.previousNode}}n.dispatchEvent(new Event("change",{bubbles:true,cancelable:true}));i=l}},E=function t(n){const i=n.getElementsByTagName("br");if(i&&i.length>0){for(const t of i){const n=ne(this,e,"m",P).call(this,t);if(n){de(t,"internalIgnore","true")}else{he(t,"internalIgnore")}}}},v=function t(){const n=this.htmlElement;if(!this.keepEmptyTextNode){re.removeEmptyTextNodes(n)}ne(this,e,"m",E).call(this,n)},S=function t(n,i,l){ne(this,e,"m",v).call(this);let o={start:0,end:0,node:null,textBefore:"",nodeFound:false};o=ne(this,e,"m",T).call(this,n,n,o,i,l);o.textBefore=se.replaceAll(o.textBefore,ne(this,e,"m",O).call(this),ne(this,e,"m",V).call(this));o.textBefore=se.replaceAll(o.textBefore,ne(this,e,"m",O).call(this,"div"),this.getNewlineFormatString());return o},T=function t(n,i,l,o,s){if(!i||l.nodeFound){return l}if(re.isCommentNode(i))return l;let r,a=l.end,d=l.end,h="",c,u,f,m;if(i===s||re.isSpanTagContainingOnlyBreakTag(i)&&i.childNodes[0]===s){l.nodeFound=true;return l}if(re.isIgnoreNode(i))return l;if(!s&&o<a){l.nodeFound=true;return l}if(i.nodeValue){h=i.nodeValue;d=a+h.length}else if(ne(this,e,"m",H).call(this,i)){if(!s&&o===a){l.nodeFound=true;return l}h=ne(this,e,"m",j).call(this);d=a+h.length}else{if(!s&&o===a&&i.nodeName==="BR"){l.nodeFound=true;return l}m=!(ne(this,e,"m",y).call(this,l.textBefore)||ne(this,e,"m",F).call(this,i.previousSibling)&&se.endsWithLineBreak(l.textBefore));c=ne(this,e,"m",F).call(this,i);if(m&&c>0&&l.textBefore.length>0){u=!ne(this,e,"m",y).call(this,l.textBefore);if(u){l.end+=c;l.textBefore+=ne(this,e,"m",O).call(this,i);a=d=l.end}}else if(ne(this,e,"m",W).call(this,n,i)){d+=ne(this,e,"m",W).call(this,n,i);h+=this.getLineBreakText()}}if(!s&&o>=a&&o<=d){l.node=i;l.start=a;l.end=d;if(re.isTextNode(i)){l.nodeFound=true;return l}}l.end=d;l.textBefore+=h;if(i.childNodes&&i.childNodes.length>0){f=l;for(r=0;r<i.childNodes.length;++r){f=ne(this,e,"m",t).call(this,n,i.childNodes[r],f,o,s);if(f.nodeFound){return l}if(!s&&re.isTextNode(f.node)&&o>=f.start&&o<=f.end){return f}l=f}}if(ne(this,e,"m",M).call(this,i)&&ne(this,e,"m",Z).call(this,i))m=true;else{if(ne(this,e,"m",F).call(this,i))m=!ne(this,e,"m",y).call(this,l.textBefore);else m=!(ne(this,e,"m",M).call(this,i)&&ne(this,e,"m",I).call(this,l.textBefore))}if(m&&ne(this,e,"m",F).call(this,i)){l.end+=this.getLineBreakText().length;l.textBefore+=ne(this,e,"m",O).call(this,i)}return l},w=function t(n,i,l){if(i===0){const e=this.getTextLength();if(e===l){while(n.firstChild){n.removeChild(n.firstChild)}return null}}const o=ne(this,e,"m",S).call(this,n,i);const s=ne(this,e,"m",S).call(this,n,l);const r=Number(i)-o.start;const a=Number(l)-s.start;if(o.node===s.node){o.node.nodeValue=se.remove(o.node.nodeValue,r,a);ne(this,e,"m",q).call(this,o.node.parentNode);return o}if(o.node.nodeValue)o.node.nodeValue=o.node.nodeValue.substring(0,r);let d=[];let h=re.getNextNode(n,o.node);while(h&&h!==s.node){if(!re.isDescendant(h,s.node))d.push(h);h=re.getNextNode(n,h)}for(const e of d){e.parentNode.removeChild(e)}d=[];if(s.node.nodeValue)s.node.nodeValue=s.node.nodeValue.substring(a);else d.push(s.node);let c;if(o.node.parentNode!==s.node.parentNode){let t=ne(this,e,"m",M).call(this,o.node)?o.node:o.node.parentNode,n,i=o.node;c=s.node;while(c){if(c.previousSibling===t){n=c;i=null;break}else if(c.previousSibling===o.node){n=c;break}c=c.parentNode}if(!n){t=null;n=s.node.parentNode;c=o.node;while(c){if(c.nextSibling===n){t=c;break}c=c.parentNode}}while(d.length>0){c=d.pop();c.parentNode.removeChild(c)}if(t&&n&&ne(this,e,"m",M).call(this,t)&&ne(this,e,"m",M).call(this,n)){re.appendToNewParent(n,t,i);ne(this,e,"m",B).call(this,t)}}while(d.length>0){c=d.pop();c.parentNode.removeChild(c)}ne(this,e,"m",B).call(this,o.node);return o},B=function t(n){if(ne(this,e,"m",M).call(this,n)&&!re.nodeNameEquals(n,"li")){if(!n.lastChild||!re.nodeNameEquals(n.lastChild,"br")&&!re.isIgnoreNode(n.lastChild)&&!ne(this,e,"m",F).call(this,n.lastChild)){ne(this,e,"m",G).call(this,n)}}},q=function t(n){if(!re.nodeNameEquals(n,"li"))return;if(n.textContent===""&&!re.nodeNameEquals(n.lastChild,"br")){ne(this,e,"m",G).call(this,n)}else if(n.textContent!==""&&re.nodeNameEquals(n.lastChild,"br")){n.removeChild(n.lastChild)}},I=function t(n){return ne(this,e,"m",y).call(this,n)||se.endsWithLineBreak(n)},y=function e(t){return se.endsWith(t,"\t")||se.endsWith(t,"\v")},L=function e(t){if(!(t===null||t===void 0?void 0:t.hasChildNodes()))return null;let n=t;while(n.lastChild){n=n.lastChild}return n.nodeName==="BR"?n:null},k=function t(n,i,l){i=se.replaceAll(i," "," ");i=i.replace(/^\x20|\x20$/g," ");const o=[];const s=i.split("\n");let r=null;for(let t=0;t<s.length;++t){const i=s[t].split("\f");for(let e=0;e<i.length;++e){if(i[e].length>0){const t=n.createTextNode(i[e]);if(r)r.appendChild(t);else o.push(t)}if(e<i.length-1){const e=n.createElement("P");o.push(e);r=e}}if(t<s.length-1){let t;if(re.nodeNameEquals(l.parentNode,"li")||re.nodeNameEquals(l,"li")){t=n.createElement("li");ne(this,e,"m",G).call(this,t)}else{t=n.createElement("BR")}if(r)r.appendChild(t);else o.push(t)}}return o},O=function e(t){if(oe.Instance.isChromeOrEdge()){if(t&&(se.isEqual(t,"div")||re.nodeNameEquals(t,"div")))return"\v"}return"\t"},V=function e(){return"\f"},F=function e(t){if(!t)return 0;const n=t.nodeName.toLowerCase();if(n==="div"||n==="p"||n.match("h.")||n==="table"||n==="li")return 1;if(n==="ul"||n==="ol"){if(t.parentNode&&re.nodeNameEquals(t.parentNode,"li")&&t.previousSibling)return 1}return 0},M=function e(t){if(!t)return false;return!re.isTextNode(t)&&!re.nodeNameEquals(t,"br")&&!re.nodeNameEquals(t,"img")&&!re.isCommentNode(t)},D=function t(n){if(!n)return false;const i=n.nodeName.toLowerCase();if(i==="div"||i==="p"||i==="li"||i.match("h."))return true;if(ne(this,e,"m",M).call(this,n)&&n.nextSibling)return ne(this,e,"m",F).call(this,n.nextSibling)>0;return false},A=function t(n){if(!n)return null;let i=n.parentNode;while(i){if(ne(this,e,"m",D).call(this,i))return i;if(i===this.htmlElement)return null;i=i.parentNode}return null},R=function t(n){if(!n||n.nextSibling)return false;if(!re.nodeNameEquals(n,"br"))return false;let i=n.parentNode;while(i){if(ne(this,e,"m",D).call(this,i))return true;if(i===this.htmlElement)return false;if(i.nextSibling)return false;i=i.parentNode}return false},P=function t(n){if(oe.Instance.browserBrand[ae.Mozilla]){if(re.nodeNameEquals(n.nextSibling,"p")&&!ne(this,e,"m",M).call(this,n.previousSibling))return true}if(re.nodeNameEquals(n.parentNode,"li")&&ne(this,e,"m",M).call(this,n.nextSibling))return true;return ne(this,e,"m",R).call(this,n)},W=function t(n,i){if(!i)return 0;if(ne(this,e,"m",_).call(this,n,i))return 1;if(re.nodeNameEquals(i,"td"))return 1;return 0},H=function e(t){return re.nodeNameEquals(t,"img")},j=function e(){return String.fromCharCode(127)},_=function e(t,n){if(!n||!re.nodeNameEquals(n,"br"))return false;return!re.isIgnoreNode(n)},z=function e(t){const n=t.createElement("BR");de(n,"internalIgnore","true");return n},G=function e(t){const n=t.ownerDocument;const i=n.createElement("BR");de(i,"internalIgnore","true");t.appendChild(i);return i},$=function t(n){if(!n.firstChild)return false;let i=n.firstChild;if(re.isCommentNode(i))i=re.getNextValidSibling(i);return i&&ne(this,e,"m",M).call(this,i)},U=function t(n,i){if(!ne(this,e,"m",M).call(this,n))return false;if(re.nodeNameEquals(n,"body"))return true;if(re.nodeNameEquals(n,"div"))return true;if(re.nodeNameEquals(n,"p"))return!re.nodeNameEquals(i,"p")&&!re.nodeNameEquals(i,"div");if(re.nodeNameEquals(n,"li")){return!re.nodeNameEquals(i,"li")&&!re.nodeNameEquals(i,"p")}if(re.nodeNameEquals(n,"ul")||re.nodeNameEquals(n,"ol")){return!re.nodeNameEquals(i,"p")}return!re.nodeNameEquals(i,"p")},J=function t(n,i,l){const o=n.ownerDocument,s={};let r,a,d;s.container=n;s.node=i;s.previousNode=i;if(n===l){n.appendChild(i);return s}if(ne(this,e,"m",M).call(this,l)&&!ne(this,e,"m",M).call(this,i)){r=l;l=null}else r=l.parentNode;while(!ne(this,e,"m",U).call(this,r,i)){if(r.lastChild===l||l&&r.lastChild===l.nextSibling&&re.isIgnoreNode(l.nextSibling)){l=r;r=r.parentNode;continue}a=ne(this,e,"m",Q).call(this,r,l);l=r;r=r.parentNode}s.node=i;s.previousNode=i;let h;if(l===null||l===void 0?void 0:l.nextSibling){h=l.nextSibling;if(re.nodeNameEquals(i,"li")&&a===h&&re.nodeNameEquals(h,"li")){s.previousNode=a}else{r.insertBefore(i,l.nextSibling)}}else if(!l&&r.hasChildNodes()){h=r.firstChild;r.insertBefore(i,r.firstChild)}else{h=null;r.appendChild(i)}if(re.nodeNameEquals(i,"p")){if(a===h&&re.nodeNameEquals(h,"p")){s.previousNode=re.moveToNewParent(o,i,h);s.node=h}else if(!ne(this,e,"m",M).call(this,h)){d=ne(this,e,"m",Y).call(this,o,i,h);s.node=i;if(d)s.previousNode=d}}ne(this,e,"m",q).call(this,r);s.container=r;return s},K=function t(n,i,l){const o={};let s=i.parentNode;o.node=l;o.previousNode=l;o.container=n;if(n===i||!i){n.appendChild(l);return o}while(!ne(this,e,"m",U).call(this,s,l)){i=ne(this,e,"m",X).call(this,s,i);s=s.parentNode}if(i){s.insertBefore(l,i)}else{s.appendChild(l)}o.node=l;o.previousNode=l;o.container=s;return o},Q=function t(n,i){const l=n.ownerDocument;const o=n.nodeName;const s=l.createElement(o);if(o.toLowerCase()==="li"&&!re.isTextNode(i===null||i===void 0?void 0:i.nextSibling)){s.appendChild(l.createTextNode(" "))}if(i){let e=i.nextSibling;while(e){const t=e.nextSibling;if(!re.isEmptyTextNode(e))s.appendChild(e);e=t}}if(n.nextSibling)n.parentNode.insertBefore(s,n.nextSibling);else n.parentNode.appendChild(s);ne(this,e,"m",B).call(this,n);ne(this,e,"m",B).call(this,s);ne(this,e,"m",B).call(this,i.parentNode);ne(this,e,"m",q).call(this,n);return s},X=function t(n,i){const l=n.ownerDocument;const o=l.createElement(n.nodeName);if(i){o.appendChild(i);let e=i.nextSibling;while(e){if(!re.isEmptyTextNode(e))o.appendChild(e);e=e.nextSibling}}if(n.nextSibling)n.parentNode.insertBefore(o,n.nextSibling);else n.parentNode.appendChild(o);ne(this,e,"m",B).call(this,n);ne(this,e,"m",B).call(this,o);return o},Y=function t(n,i,l){let o=false,s=false,r,a,d;const h=[];if(i===i.parentNode.firstChild)return null;r=i.previousSibling;while(r){if(!re.isEmptyTextNode(r)){s=true;break}r=r.previousSibling}if(!s)return null;r=null;if(l&&re.nodeNameEquals(i,"p")){if(re.isIgnoreNode(i.lastChild)&&re.nodeNameEquals(i.lastChild,"br")){a=i.lastChild}while(l&&ne(this,e,"m",U).call(this,i,l)){d=l;l=l.nextSibling;if(a){if(re.isIgnoreNode(d)&&re.nodeNameEquals(d,"br"))h.push(d);else i.insertBefore(d,a)}else{i.appendChild(d)}o=true;r!==null&&r!==void 0?r:r=d.previousSibling}for(const e of h)e.parentNode.removeChild(e)}if(o){if(!r){const e=n.createTextNode("");i.insertBefore(e,i.firstChild);r=e}}return r},Z=function e(t){if(!t.hasChildNodes())return true;if(t.childNodes.length===1&&re.isIgnoreNode(t.childNodes[0]))return true;for(const e of t.childNodes){if(re.isEmptyTextNode(e)||re.isIgnoreNode(e))continue;return false}return true},ee=function e(t){return ne(this,te,"f").has(t.nodeName.toLowerCase())};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type Observable } from "rxjs";
|
|
2
|
+
import type { CustomControlInitializer } from "../webtcl";
|
|
3
|
+
import type { Capabilities, TextControl } from "./text-control";
|
|
4
|
+
import type { ProcessingStatus } from "./processing-status";
|
|
5
|
+
import type { CustomControlState } from "../webtcl/custom-controls";
|
|
6
|
+
import type { AdditionalReplaceTextParameters } from "../webtcl/types";
|
|
7
|
+
export declare class CustomControl implements TextControl {
|
|
8
|
+
#private;
|
|
9
|
+
readonly state$: Observable<CustomControlState>;
|
|
10
|
+
readonly processingStatus$: Observable<ProcessingStatus>;
|
|
11
|
+
readonly type: string;
|
|
12
|
+
htmlElement: HTMLElement;
|
|
13
|
+
constructor(htmlElement: HTMLElement, initializer: CustomControlInitializer);
|
|
14
|
+
get newlineFormat(): string;
|
|
15
|
+
get paragraphFormat(): string;
|
|
16
|
+
get isMultiline(): boolean;
|
|
17
|
+
get capabilities(): Capabilities | undefined;
|
|
18
|
+
onFocus(): void;
|
|
19
|
+
onBlur(): void;
|
|
20
|
+
onElementFocus(_e: Event | null): void;
|
|
21
|
+
cleanup(): void;
|
|
22
|
+
invalidate(): void;
|
|
23
|
+
isValid(): boolean;
|
|
24
|
+
get guid(): string | null;
|
|
25
|
+
setGuid(guid: string): void;
|
|
26
|
+
get conceptName(): string | undefined;
|
|
27
|
+
get dictationMode(): string | undefined;
|
|
28
|
+
get documentFieldId(): string | undefined;
|
|
29
|
+
getProcessingStatus(): ProcessingStatus;
|
|
30
|
+
setProcessingStatus(status: ProcessingStatus): void;
|
|
31
|
+
getText(): string;
|
|
32
|
+
setText(text: string): void;
|
|
33
|
+
replaceText(text: string, start: number, length: number, additionalParameters?: AdditionalReplaceTextParameters): boolean;
|
|
34
|
+
getSelection(): {
|
|
35
|
+
start: number;
|
|
36
|
+
length: number;
|
|
37
|
+
};
|
|
38
|
+
setSelection(start: number, length: number): void;
|
|
39
|
+
undo(): void;
|
|
40
|
+
redo(): void;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t,e,i,s,n;import{__classPrivateFieldGet as l,__classPrivateFieldSet as a}from"tslib";import{BehaviorSubject as o,skip as r,Subject as u,withLatestFrom as h}from"rxjs";import{getAttributeValue as d,setAttributeValue as c}from"../webtcl/webtcl-attributes";export class CustomControl{constructor(d,c){t.set(this,new o({text:"",selection:{start:0,end:0},focus:false}));this.state$=l(this,t,"f").pipe(r(1));e.set(this,new o("idle"));this.processingStatus$=l(this,e,"f").asObservable();this.type="custom";i.set(this,void 0);s.set(this,void 0);n.set(this,new u);const p=new u;const f=[];a(this,i,{newline:"\n",paragraph:"\n\n",isMultiline:false,handle:(t,e)=>{f.push(l(this,n,"f").subscribe(i=>{if(i.type===t){e(i.payload)}}))},update:t=>{p.next(t)}},"f");const m=p.pipe(h(l(this,t,"f"))).subscribe(([e,i])=>l(this,t,"f").next(Object.assign(Object.assign({},i),e)));const v=c(d,l(this,i,"f"));a(this,s,()=>{v();m.unsubscribe();f.forEach(t=>t.unsubscribe())},"f");this.htmlElement=d}get newlineFormat(){return l(this,i,"f").newline}get paragraphFormat(){return l(this,i,"f").paragraph}get isMultiline(){return l(this,i,"f").isMultiline}get capabilities(){return l(this,i,"f").capabilities}onFocus(){l(this,n,"f").next({type:"focus",payload:true})}onBlur(){l(this,n,"f").next({type:"focus",payload:false})}onElementFocus(t){}cleanup(){}invalidate(){var t;(t=l(this,s,"f"))===null||t===void 0?void 0:t.call(this);this.htmlElement=null}isValid(){return!!this.htmlElement}get guid(){return d(this.htmlElement,"controlId")}setGuid(t){c(this.htmlElement,"controlId",t)}get conceptName(){var t;return(t=d(this.htmlElement,"conceptName"))!==null&&t!==void 0?t:undefined}get dictationMode(){var t;return(t=d(this.htmlElement,"dictationMode"))!==null&&t!==void 0?t:undefined}get documentFieldId(){var t;return(t=d(this.htmlElement,"documentFieldId"))!==null&&t!==void 0?t:undefined}getProcessingStatus(){return l(this,e,"f").value}setProcessingStatus(t){if(t!==this.getProcessingStatus()){l(this,e,"f").next(t)}}getText(){return l(this,t,"f").value.text}setText(t){l(this,n,"f").next({type:"text",payload:{value:t,start:0,length:t.length}})}replaceText(t,e,i,s){l(this,n,"f").next({type:"text",payload:{value:t,start:e,length:i,additionalParameters:s}});return true}getSelection(){var e,i,s,n;const a=(i=(e=l(this,t,"f").value.selection)===null||e===void 0?void 0:e.start)!==null&&i!==void 0?i:0;const o=(n=(s=l(this,t,"f").value.selection)===null||s===void 0?void 0:s.end)!==null&&n!==void 0?n:0;return{start:a,length:o-a}}setSelection(t,e){l(this,n,"f").next({type:"selection",payload:{start:t,end:t+e}})}undo(){l(this,n,"f").next({type:"undo",payload:undefined})}redo(){l(this,n,"f").next({type:"redo",payload:undefined})}}t=new WeakMap,e=new WeakMap,i=new WeakMap,s=new WeakMap,n=new WeakMap;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TextControl } from "./text-control";
|
|
2
|
+
import type { CustomControlCollection } from "../webtcl/custom-controls";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a text control based on the given element.
|
|
5
|
+
*
|
|
6
|
+
* @param element - The HTML element to create the text control from.
|
|
7
|
+
* @returns The created text control, or null if the element is invalid or unsupported.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createTextControl(element: HTMLElement, customControls?: CustomControlCollection): TextControl | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{InputControl as t}from"./input-control";import{TextAreaControl as n}from"./textarea-control";import{ContentEditableControl as r}from"./contenteditable-control";import{TinyMceControl as o}from"./tinymce-control";import{getCustomControlType as e,getTinyMceEditor as i}from"./helpers";import{isSupportedHtmlInputElement as f}from"../webtcl/validation";import{CustomControl as c}from"./custom-control";export function createTextControl(m,l={}){if(!m){return null}const u=e(m);if(u){const t=l[u];if(t&&typeof t==="function"){return new c(m,t)}}if(m instanceof HTMLInputElement&&f(m)){return new t(m)}if(m instanceof HTMLTextAreaElement){return new n(m)}const p=i(m);if(p){return new o(p)}if(m.contentEditable==="true"){return new r(m)}return null}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param element
|
|
3
|
+
* @return {?string}
|
|
4
|
+
* @function
|
|
5
|
+
*/
|
|
6
|
+
export function getCustomContainerType(element: any): string | null;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param element
|
|
10
|
+
* @return {?string}
|
|
11
|
+
* @function
|
|
12
|
+
*/
|
|
13
|
+
export function getCustomControlType(element: any): string | null;
|
|
14
|
+
/**
|
|
15
|
+
* get the container id of the customControl
|
|
16
|
+
* @param {HTMLElement} element
|
|
17
|
+
* @returns {string|null}
|
|
18
|
+
*/
|
|
19
|
+
export function getCustomContainerId(element: HTMLElement): string | null;
|
|
20
|
+
/**
|
|
21
|
+
* get the container of the customControl
|
|
22
|
+
* @param element
|
|
23
|
+
* @return {HTMLElement|null}
|
|
24
|
+
* @function
|
|
25
|
+
*/
|
|
26
|
+
export function getCustomControlContainer(element: any): HTMLElement | null;
|
|
27
|
+
/**
|
|
28
|
+
* get the tinymce editor if element is a tinymce control
|
|
29
|
+
* @param element
|
|
30
|
+
* @return {unknown | null} returns tinymce editor if element is a tinymce control, otherwise null.
|
|
31
|
+
* @function
|
|
32
|
+
*/
|
|
33
|
+
export function getTinyMceEditor(element: any): unknown | null;
|