@selenium/atoms 4.51.0-nightly202609302012 → 4.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -1
- package/dist/typescript/active-element.d.ts +2 -0
- package/dist/typescript/active-element.d.ts.map +1 -0
- package/dist/typescript/active-element.js +19 -0
- package/dist/typescript/active-element.js.map +1 -0
- package/dist/typescript/clear-local-storage.d.ts +3 -0
- package/dist/typescript/clear-local-storage.d.ts.map +1 -0
- package/dist/typescript/clear-local-storage.js +25 -0
- package/dist/typescript/clear-local-storage.js.map +1 -0
- package/dist/typescript/clear-session-storage.d.ts +3 -0
- package/dist/typescript/clear-session-storage.d.ts.map +1 -0
- package/dist/typescript/clear-session-storage.js +25 -0
- package/dist/typescript/clear-session-storage.js.map +1 -0
- package/dist/typescript/clear.d.ts +3 -0
- package/dist/typescript/clear.d.ts.map +1 -0
- package/dist/typescript/clear.js +67 -0
- package/dist/typescript/clear.js.map +1 -0
- package/dist/typescript/click.d.ts +4 -0
- package/dist/typescript/click.d.ts.map +1 -0
- package/dist/typescript/click.js +52 -0
- package/dist/typescript/click.js.map +1 -0
- package/dist/typescript/core/attribute.d.ts +3 -0
- package/dist/typescript/core/attribute.d.ts.map +1 -0
- package/dist/typescript/core/attribute.js +60 -0
- package/dist/typescript/core/attribute.js.map +1 -0
- package/dist/typescript/core/color.d.ts +2 -0
- package/dist/typescript/core/color.d.ts.map +1 -0
- package/dist/typescript/core/color.js +248 -0
- package/dist/typescript/core/color.js.map +1 -0
- package/dist/typescript/core/editable.d.ts +5 -0
- package/dist/typescript/core/editable.d.ts.map +1 -0
- package/dist/typescript/core/editable.js +55 -0
- package/dist/typescript/core/editable.js.map +1 -0
- package/dist/typescript/core/element.d.ts +6 -0
- package/dist/typescript/core/element.d.ts.map +1 -0
- package/dist/typescript/core/element.js +97 -0
- package/dist/typescript/core/element.js.map +1 -0
- package/dist/typescript/core/enabled.d.ts +2 -0
- package/dist/typescript/core/enabled.d.ts.map +1 -0
- package/dist/typescript/core/enabled.js +69 -0
- package/dist/typescript/core/enabled.js.map +1 -0
- package/dist/typescript/core/error.d.ts +13 -0
- package/dist/typescript/core/error.d.ts.map +1 -0
- package/dist/typescript/core/error.js +40 -0
- package/dist/typescript/core/error.js.map +1 -0
- package/dist/typescript/core/events.d.ts +91 -0
- package/dist/typescript/core/events.d.ts.map +1 -0
- package/dist/typescript/core/events.js +131 -0
- package/dist/typescript/core/events.js.map +1 -0
- package/dist/typescript/core/focus.d.ts +4 -0
- package/dist/typescript/core/focus.d.ts.map +1 -0
- package/dist/typescript/core/focus.js +88 -0
- package/dist/typescript/core/focus.js.map +1 -0
- package/dist/typescript/core/focusable.d.ts +2 -0
- package/dist/typescript/core/focusable.d.ts.map +1 -0
- package/dist/typescript/core/focusable.js +36 -0
- package/dist/typescript/core/focusable.js.map +1 -0
- package/dist/typescript/core/form.d.ts +2 -0
- package/dist/typescript/core/form.d.ts.map +1 -0
- package/dist/typescript/core/form.js +76 -0
- package/dist/typescript/core/form.js.map +1 -0
- package/dist/typescript/core/frame.d.ts +8 -0
- package/dist/typescript/core/frame.d.ts.map +1 -0
- package/dist/typescript/core/frame.js +95 -0
- package/dist/typescript/core/frame.js.map +1 -0
- package/dist/typescript/core/geometry.d.ts +28 -0
- package/dist/typescript/core/geometry.d.ts.map +1 -0
- package/dist/typescript/core/geometry.js +134 -0
- package/dist/typescript/core/geometry.js.map +1 -0
- package/dist/typescript/core/inject.d.ts +21 -0
- package/dist/typescript/core/inject.d.ts.map +1 -0
- package/dist/typescript/core/inject.js +282 -0
- package/dist/typescript/core/inject.js.map +1 -0
- package/dist/typescript/core/interactable.d.ts +2 -0
- package/dist/typescript/core/interactable.d.ts.map +1 -0
- package/dist/typescript/core/interactable.js +27 -0
- package/dist/typescript/core/interactable.js.map +1 -0
- package/dist/typescript/core/keyboard.d.ts +15 -0
- package/dist/typescript/core/keyboard.d.ts.map +1 -0
- package/dist/typescript/core/keyboard.js +356 -0
- package/dist/typescript/core/keyboard.js.map +1 -0
- package/dist/typescript/core/keys.d.ts +65 -0
- package/dist/typescript/core/keys.d.ts.map +1 -0
- package/dist/typescript/core/keys.js +125 -0
- package/dist/typescript/core/keys.js.map +1 -0
- package/dist/typescript/core/locators.d.ts +6 -0
- package/dist/typescript/core/locators.d.ts.map +1 -0
- package/dist/typescript/core/locators.js +610 -0
- package/dist/typescript/core/locators.js.map +1 -0
- package/dist/typescript/core/mouse.d.ts +17 -0
- package/dist/typescript/core/mouse.d.ts.map +1 -0
- package/dist/typescript/core/mouse.js +186 -0
- package/dist/typescript/core/mouse.js.map +1 -0
- package/dist/typescript/core/overflow.d.ts +5 -0
- package/dist/typescript/core/overflow.d.ts.map +1 -0
- package/dist/typescript/core/overflow.js +133 -0
- package/dist/typescript/core/overflow.js.map +1 -0
- package/dist/typescript/core/scroll.d.ts +3 -0
- package/dist/typescript/core/scroll.d.ts.map +1 -0
- package/dist/typescript/core/scroll.js +77 -0
- package/dist/typescript/core/scroll.js.map +1 -0
- package/dist/typescript/core/shown.d.ts +3 -0
- package/dist/typescript/core/shown.d.ts.map +1 -0
- package/dist/typescript/core/shown.js +190 -0
- package/dist/typescript/core/shown.js.map +1 -0
- package/dist/typescript/core/storage.d.ts +14 -0
- package/dist/typescript/core/storage.d.ts.map +1 -0
- package/dist/typescript/core/storage.js +98 -0
- package/dist/typescript/core/storage.js.map +1 -0
- package/dist/typescript/core/style.d.ts +2 -0
- package/dist/typescript/core/style.d.ts.map +1 -0
- package/dist/typescript/core/style.js +32 -0
- package/dist/typescript/core/style.js.map +1 -0
- package/dist/typescript/core/useragent.d.ts +3 -0
- package/dist/typescript/core/useragent.d.ts.map +1 -0
- package/dist/typescript/core/useragent.js +31 -0
- package/dist/typescript/core/useragent.js.map +1 -0
- package/dist/typescript/default-content.d.ts +2 -0
- package/dist/typescript/default-content.d.ts.map +1 -0
- package/dist/typescript/default-content.js +20 -0
- package/dist/typescript/default-content.js.map +1 -0
- package/dist/typescript/execute-async-script.d.ts +2 -0
- package/dist/typescript/execute-async-script.d.ts.map +1 -0
- package/dist/typescript/execute-async-script.js +20 -0
- package/dist/typescript/execute-async-script.js.map +1 -0
- package/dist/typescript/execute-script.d.ts +2 -0
- package/dist/typescript/execute-script.d.ts.map +1 -0
- package/dist/typescript/execute-script.js +20 -0
- package/dist/typescript/execute-script.js.map +1 -0
- package/dist/typescript/find-element-fragment.d.ts +8 -0
- package/dist/typescript/find-element-fragment.d.ts.map +1 -0
- package/dist/typescript/find-element-fragment.js +39 -0
- package/dist/typescript/find-element-fragment.js.map +1 -0
- package/dist/typescript/find-element.d.ts +2 -0
- package/dist/typescript/find-element.d.ts.map +1 -0
- package/dist/typescript/find-element.js +18 -0
- package/dist/typescript/find-element.js.map +1 -0
- package/dist/typescript/find-elements.d.ts +1 -2
- package/dist/typescript/find-elements.d.ts.map +1 -1
- package/dist/typescript/find-elements.js +1 -289
- package/dist/typescript/find-elements.js.map +1 -1
- package/dist/typescript/frame-by-id-or-name.d.ts +2 -0
- package/dist/typescript/frame-by-id-or-name.d.ts.map +1 -0
- package/dist/typescript/frame-by-id-or-name.js +22 -0
- package/dist/typescript/frame-by-id-or-name.js.map +1 -0
- package/dist/typescript/frame-by-index.d.ts +2 -0
- package/dist/typescript/frame-by-index.d.ts.map +1 -0
- package/dist/typescript/frame-by-index.js +19 -0
- package/dist/typescript/frame-by-index.js.map +1 -0
- package/dist/typescript/get-attribute-value.d.ts +2 -0
- package/dist/typescript/get-attribute-value.d.ts.map +1 -0
- package/dist/typescript/get-attribute-value.js +22 -0
- package/dist/typescript/get-attribute-value.js.map +1 -0
- package/dist/typescript/get-effective-style.d.ts +3 -0
- package/dist/typescript/get-effective-style.d.ts.map +1 -0
- package/dist/typescript/get-effective-style.js +84 -0
- package/dist/typescript/get-effective-style.js.map +1 -0
- package/dist/typescript/get-element-from-cache.d.ts +2 -0
- package/dist/typescript/get-element-from-cache.d.ts.map +1 -0
- package/dist/typescript/get-element-from-cache.js +20 -0
- package/dist/typescript/get-element-from-cache.js.map +1 -0
- package/dist/typescript/get-frame-window.d.ts +2 -0
- package/dist/typescript/get-frame-window.d.ts.map +1 -0
- package/dist/typescript/get-frame-window.js +22 -0
- package/dist/typescript/get-frame-window.js.map +1 -0
- package/dist/typescript/get-local-storage-item.d.ts +3 -0
- package/dist/typescript/get-local-storage-item.d.ts.map +1 -0
- package/dist/typescript/get-local-storage-item.js +25 -0
- package/dist/typescript/get-local-storage-item.js.map +1 -0
- package/dist/typescript/get-local-storage-key.d.ts +3 -0
- package/dist/typescript/get-local-storage-key.d.ts.map +1 -0
- package/dist/typescript/get-local-storage-key.js +26 -0
- package/dist/typescript/get-local-storage-key.js.map +1 -0
- package/dist/typescript/get-local-storage-keys.d.ts +3 -0
- package/dist/typescript/get-local-storage-keys.d.ts.map +1 -0
- package/dist/typescript/get-local-storage-keys.js +25 -0
- package/dist/typescript/get-local-storage-keys.js.map +1 -0
- package/dist/typescript/get-local-storage-size.d.ts +3 -0
- package/dist/typescript/get-local-storage-size.d.ts.map +1 -0
- package/dist/typescript/get-local-storage-size.js +25 -0
- package/dist/typescript/get-local-storage-size.js.map +1 -0
- package/dist/typescript/get-location.d.ts +9 -0
- package/dist/typescript/get-location.d.ts.map +1 -0
- package/dist/typescript/get-location.js +49 -0
- package/dist/typescript/get-location.js.map +1 -0
- package/dist/typescript/get-session-storage-item.d.ts +3 -0
- package/dist/typescript/get-session-storage-item.d.ts.map +1 -0
- package/dist/typescript/get-session-storage-item.js +25 -0
- package/dist/typescript/get-session-storage-item.js.map +1 -0
- package/dist/typescript/get-session-storage-key.d.ts +3 -0
- package/dist/typescript/get-session-storage-key.d.ts.map +1 -0
- package/dist/typescript/get-session-storage-key.js +26 -0
- package/dist/typescript/get-session-storage-key.js.map +1 -0
- package/dist/typescript/get-session-storage-keys.d.ts +3 -0
- package/dist/typescript/get-session-storage-keys.d.ts.map +1 -0
- package/dist/typescript/get-session-storage-keys.js +25 -0
- package/dist/typescript/get-session-storage-keys.js.map +1 -0
- package/dist/typescript/get-session-storage-size.d.ts +3 -0
- package/dist/typescript/get-session-storage-size.d.ts.map +1 -0
- package/dist/typescript/get-session-storage-size.js +25 -0
- package/dist/typescript/get-session-storage-size.js.map +1 -0
- package/dist/typescript/get-size.d.ts +7 -0
- package/dist/typescript/get-size.d.ts.map +1 -0
- package/dist/typescript/get-size.js +36 -0
- package/dist/typescript/get-size.js.map +1 -0
- package/dist/typescript/get-text.d.ts +3 -0
- package/dist/typescript/get-text.d.ts.map +1 -0
- package/dist/typescript/get-text.js +294 -0
- package/dist/typescript/get-text.js.map +1 -0
- package/dist/typescript/get-top-left-coordinates.d.ts +4 -0
- package/dist/typescript/get-top-left-coordinates.d.ts.map +1 -0
- package/dist/typescript/get-top-left-coordinates.js +36 -0
- package/dist/typescript/get-top-left-coordinates.js.map +1 -0
- package/dist/typescript/is-displayed.d.ts +1 -2
- package/dist/typescript/is-displayed.d.ts.map +1 -1
- package/dist/typescript/is-displayed.js +3 -396
- package/dist/typescript/is-displayed.js.map +1 -1
- package/dist/typescript/is-editable.d.ts +2 -0
- package/dist/typescript/is-editable.d.ts.map +1 -0
- package/dist/typescript/is-editable.js +18 -0
- package/dist/typescript/is-editable.js.map +1 -0
- package/dist/typescript/is-enabled.d.ts +2 -0
- package/dist/typescript/is-enabled.d.ts.map +1 -0
- package/dist/typescript/is-enabled.js +18 -0
- package/dist/typescript/is-enabled.js.map +1 -0
- package/dist/typescript/is-focusable.d.ts +2 -0
- package/dist/typescript/is-focusable.d.ts.map +1 -0
- package/dist/typescript/is-focusable.js +20 -0
- package/dist/typescript/is-focusable.js.map +1 -0
- package/dist/typescript/is-interactable.d.ts +2 -0
- package/dist/typescript/is-interactable.d.ts.map +1 -0
- package/dist/typescript/is-interactable.js +19 -0
- package/dist/typescript/is-interactable.js.map +1 -0
- package/dist/typescript/is-selected.d.ts +3 -0
- package/dist/typescript/is-selected.d.ts.map +1 -0
- package/dist/typescript/is-selected.js +29 -0
- package/dist/typescript/is-selected.js.map +1 -0
- package/dist/typescript/remove-local-storage-item.d.ts +3 -0
- package/dist/typescript/remove-local-storage-item.d.ts.map +1 -0
- package/dist/typescript/remove-local-storage-item.js +25 -0
- package/dist/typescript/remove-local-storage-item.js.map +1 -0
- package/dist/typescript/remove-session-storage-item.d.ts +3 -0
- package/dist/typescript/remove-session-storage-item.d.ts.map +1 -0
- package/dist/typescript/remove-session-storage-item.js +25 -0
- package/dist/typescript/remove-session-storage-item.js.map +1 -0
- package/dist/typescript/set-local-storage-item.d.ts +3 -0
- package/dist/typescript/set-local-storage-item.d.ts.map +1 -0
- package/dist/typescript/set-local-storage-item.js +26 -0
- package/dist/typescript/set-local-storage-item.js.map +1 -0
- package/dist/typescript/set-session-storage-item.d.ts +3 -0
- package/dist/typescript/set-session-storage-item.d.ts.map +1 -0
- package/dist/typescript/set-session-storage-item.js +26 -0
- package/dist/typescript/set-session-storage-item.js.map +1 -0
- package/dist/typescript/submit.d.ts +3 -0
- package/dist/typescript/submit.d.ts.map +1 -0
- package/dist/typescript/submit.js +50 -0
- package/dist/typescript/submit.js.map +1 -0
- package/dist/typescript/type.d.ts +3 -0
- package/dist/typescript/type.d.ts.map +1 -0
- package/dist/typescript/type.js +201 -0
- package/dist/typescript/type.js.map +1 -0
- package/index.ts +40 -0
- package/package.json +296 -5
- package/typescript/active-element.ts +19 -0
- package/typescript/clear-local-storage.ts +27 -0
- package/typescript/clear-session-storage.ts +27 -0
- package/typescript/clear.ts +73 -0
- package/typescript/click.ts +55 -0
- package/typescript/core/attribute.ts +68 -0
- package/typescript/core/color.ts +257 -0
- package/typescript/core/editable.ts +63 -0
- package/typescript/core/element.ts +110 -0
- package/typescript/core/enabled.ts +76 -0
- package/typescript/core/error.ts +41 -0
- package/typescript/core/events.ts +268 -0
- package/typescript/core/focus.ts +92 -0
- package/typescript/core/focusable.ts +38 -0
- package/typescript/core/form.ts +81 -0
- package/typescript/core/frame.ts +105 -0
- package/typescript/core/geometry.ts +183 -0
- package/typescript/core/inject.ts +336 -0
- package/typescript/core/interactable.ts +30 -0
- package/typescript/core/keyboard.ts +369 -0
- package/typescript/core/keys.ts +204 -0
- package/typescript/core/locators.ts +704 -0
- package/typescript/core/mouse.ts +211 -0
- package/typescript/core/overflow.ts +172 -0
- package/typescript/core/scroll.ts +92 -0
- package/typescript/core/shown.ts +233 -0
- package/typescript/core/storage.ts +111 -0
- package/typescript/core/style.ts +32 -0
- package/typescript/core/useragent.ts +33 -0
- package/typescript/default-content.ts +20 -0
- package/typescript/execute-async-script.ts +20 -0
- package/typescript/execute-script.ts +20 -0
- package/typescript/find-element-fragment.ts +45 -0
- package/typescript/find-element.ts +18 -0
- package/typescript/find-elements.ts +1 -326
- package/typescript/frame-by-id-or-name.ts +22 -0
- package/typescript/frame-by-index.ts +19 -0
- package/typescript/get-attribute-value.ts +22 -0
- package/typescript/get-effective-style.ts +93 -0
- package/typescript/get-element-from-cache.ts +20 -0
- package/typescript/get-frame-window.ts +22 -0
- package/typescript/get-local-storage-item.ts +27 -0
- package/typescript/get-local-storage-key.ts +28 -0
- package/typescript/get-local-storage-keys.ts +27 -0
- package/typescript/get-local-storage-size.ts +27 -0
- package/typescript/get-location.ts +63 -0
- package/typescript/get-session-storage-item.ts +27 -0
- package/typescript/get-session-storage-key.ts +28 -0
- package/typescript/get-session-storage-keys.ts +27 -0
- package/typescript/get-session-storage-size.ts +27 -0
- package/typescript/get-size.ts +43 -0
- package/typescript/get-text.ts +353 -0
- package/typescript/get-top-left-coordinates.ts +38 -0
- package/typescript/is-displayed.ts +3 -498
- package/typescript/is-editable.ts +18 -0
- package/typescript/is-enabled.ts +18 -0
- package/typescript/is-focusable.ts +20 -0
- package/typescript/is-interactable.ts +19 -0
- package/typescript/is-selected.ts +31 -0
- package/typescript/remove-local-storage-item.ts +27 -0
- package/typescript/remove-session-storage-item.ts +27 -0
- package/typescript/set-local-storage-item.ts +28 -0
- package/typescript/set-session-storage-item.ts +28 -0
- package/typescript/submit.ts +53 -0
- package/typescript/type.ts +210 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The SFC licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with the License. You may obtain a copy of the License at
|
|
8
|
+
//
|
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
//
|
|
11
|
+
// Unless required by applicable law or agreed to in writing,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
import { getLocalStorage } from './core/storage.js';
|
|
18
|
+
// Removes a key and returns the value it held, or null when absent.
|
|
19
|
+
//
|
|
20
|
+
// optWindow targets a frame other than the one the atom is running in.
|
|
21
|
+
function removeLocalStorageItem(key, optWindow) {
|
|
22
|
+
return getLocalStorage(optWindow).removeItem(key);
|
|
23
|
+
}
|
|
24
|
+
export default removeLocalStorageItem;
|
|
25
|
+
//# sourceMappingURL=remove-local-storage-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-local-storage-item.js","sourceRoot":"","sources":["../../typescript/remove-local-storage-item.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AAC7D,oDAAoD;AACpD,6DAA6D;AAC7D,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6DAA6D;AAC7D,8DAA8D;AAC9D,yDAAyD;AACzD,4DAA4D;AAC5D,0DAA0D;AAC1D,qBAAqB;AAErB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,SAAS,sBAAsB,CAAC,GAAW,EAAE,SAAkB;IAC7D,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AACnD,CAAC;AAED,eAAe,sBAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-session-storage-item.d.ts","sourceRoot":"","sources":["../../typescript/remove-session-storage-item.ts"],"names":[],"mappings":"AAsBA,iBAAS,wBAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEhF;AAED,eAAe,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The SFC licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with the License. You may obtain a copy of the License at
|
|
8
|
+
//
|
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
//
|
|
11
|
+
// Unless required by applicable law or agreed to in writing,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
import { getSessionStorage } from './core/storage.js';
|
|
18
|
+
// Removes a key and returns the value it held, or null when absent.
|
|
19
|
+
//
|
|
20
|
+
// optWindow targets a frame other than the one the atom is running in.
|
|
21
|
+
function removeSessionStorageItem(key, optWindow) {
|
|
22
|
+
return getSessionStorage(optWindow).removeItem(key);
|
|
23
|
+
}
|
|
24
|
+
export default removeSessionStorageItem;
|
|
25
|
+
//# sourceMappingURL=remove-session-storage-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-session-storage-item.js","sourceRoot":"","sources":["../../typescript/remove-session-storage-item.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AAC7D,oDAAoD;AACpD,6DAA6D;AAC7D,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6DAA6D;AAC7D,8DAA8D;AAC9D,yDAAyD;AACzD,4DAA4D;AAC5D,0DAA0D;AAC1D,qBAAqB;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAErD,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,SAAS,wBAAwB,CAAC,GAAW,EAAE,SAAkB;IAC/D,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AACrD,CAAC;AAED,eAAe,wBAAwB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-local-storage-item.d.ts","sourceRoot":"","sources":["../../typescript/set-local-storage-item.ts"],"names":[],"mappings":"AAuBA,iBAAS,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAElF;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The SFC licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with the License. You may obtain a copy of the License at
|
|
8
|
+
//
|
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
//
|
|
11
|
+
// Unless required by applicable law or agreed to in writing,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
import { getLocalStorage } from './core/storage.js';
|
|
18
|
+
// Stores a value, coerced to a string. See core/storage.ts for why null
|
|
19
|
+
// becomes the string "null".
|
|
20
|
+
//
|
|
21
|
+
// optWindow targets a frame other than the one the atom is running in.
|
|
22
|
+
function setLocalStorageItem(key, value, optWindow) {
|
|
23
|
+
getLocalStorage(optWindow).setItem(key, value);
|
|
24
|
+
}
|
|
25
|
+
export default setLocalStorageItem;
|
|
26
|
+
//# sourceMappingURL=set-local-storage-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-local-storage-item.js","sourceRoot":"","sources":["../../typescript/set-local-storage-item.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AAC7D,oDAAoD;AACpD,6DAA6D;AAC7D,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6DAA6D;AAC7D,8DAA8D;AAC9D,yDAAyD;AACzD,4DAA4D;AAC5D,0DAA0D;AAC1D,qBAAqB;AAErB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,wEAAwE;AACxE,6BAA6B;AAC7B,EAAE;AACF,uEAAuE;AACvE,SAAS,mBAAmB,CAAC,GAAW,EAAE,KAAc,EAAE,SAAkB;IAC1E,eAAe,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;AAChD,CAAC;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-session-storage-item.d.ts","sourceRoot":"","sources":["../../typescript/set-session-storage-item.ts"],"names":[],"mappings":"AAuBA,iBAAS,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAEpF;AAED,eAAe,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The SFC licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with the License. You may obtain a copy of the License at
|
|
8
|
+
//
|
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
//
|
|
11
|
+
// Unless required by applicable law or agreed to in writing,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
import { getSessionStorage } from './core/storage.js';
|
|
18
|
+
// Stores a value, coerced to a string. See core/storage.ts for why null
|
|
19
|
+
// becomes the string "null".
|
|
20
|
+
//
|
|
21
|
+
// optWindow targets a frame other than the one the atom is running in.
|
|
22
|
+
function setSessionStorageItem(key, value, optWindow) {
|
|
23
|
+
getSessionStorage(optWindow).setItem(key, value);
|
|
24
|
+
}
|
|
25
|
+
export default setSessionStorageItem;
|
|
26
|
+
//# sourceMappingURL=set-session-storage-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-session-storage-item.js","sourceRoot":"","sources":["../../typescript/set-session-storage-item.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AAC7D,oDAAoD;AACpD,6DAA6D;AAC7D,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6DAA6D;AAC7D,8DAA8D;AAC9D,yDAAyD;AACzD,4DAA4D;AAC5D,0DAA0D;AAC1D,qBAAqB;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAErD,wEAAwE;AACxE,6BAA6B;AAC7B,EAAE;AACF,uEAAuE;AACvE,SAAS,qBAAqB,CAAC,GAAW,EAAE,KAAc,EAAE,SAAkB;IAC5E,iBAAiB,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;AAClD,CAAC;AAED,eAAe,qBAAqB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit.d.ts","sourceRoot":"","sources":["../../typescript/submit.ts"],"names":[],"mappings":"AA2BA,iBAAS,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAStC;AAgBD,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The SFC licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with the License. You may obtain a copy of the License at
|
|
8
|
+
//
|
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
//
|
|
11
|
+
// Unless required by applicable law or agreed to in writing,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
import { NO_SUCH_ELEMENT, botError } from './core/error.js';
|
|
18
|
+
import { EventType, fire } from './core/events.js';
|
|
19
|
+
// Submits the element's form without simulating a click or a key press: a
|
|
20
|
+
// submit event, then, unless it was cancelled, the form's own submit(). That
|
|
21
|
+
// skips constraint validation, as bot.action.submit always did; a caller that
|
|
22
|
+
// wants validation should click the submit button or press Enter instead.
|
|
23
|
+
//
|
|
24
|
+
// The method comes from the prototype because a control named or id'd
|
|
25
|
+
// "submit" masks form.submit.
|
|
26
|
+
function submit(element) {
|
|
27
|
+
const form = findForm(element);
|
|
28
|
+
if (!form) {
|
|
29
|
+
throw botError(NO_SUCH_ELEMENT, 'Element was not in a form, so could not submit.');
|
|
30
|
+
}
|
|
31
|
+
if (fire(form, EventType.SUBMIT, { submitter: null })) {
|
|
32
|
+
const win = (form.ownerDocument.defaultView || window);
|
|
33
|
+
win.HTMLFormElement.prototype.submit.call(form);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// A control's form owner honours the form= attribute; anything else falls
|
|
37
|
+
// back to the nearest ancestor form. Reading .form off a <form> itself would
|
|
38
|
+
// find a control named "form" instead.
|
|
39
|
+
function findForm(element) {
|
|
40
|
+
if (element.tagName.toUpperCase() === 'FORM') {
|
|
41
|
+
return element;
|
|
42
|
+
}
|
|
43
|
+
const owner = element.form;
|
|
44
|
+
if (owner) {
|
|
45
|
+
return owner;
|
|
46
|
+
}
|
|
47
|
+
return element.closest('form');
|
|
48
|
+
}
|
|
49
|
+
export default submit;
|
|
50
|
+
//# sourceMappingURL=submit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit.js","sourceRoot":"","sources":["../../typescript/submit.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6D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O,CAAC,MAAM,CAAC,CAAA;AAChC,CAAC;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../typescript/type.ts"],"names":[],"mappings":"AAqHA,iBAAS,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,YAAY,CAAC,EAAE,OAAO,EAAE,mBAAmB,CAAC,EAAE,OAAO,GAAG,IAAI,CA0C3G;AAkDD,eAAe,IAAI,CAAA"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The SFC licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with the License. You may obtain a copy of the License at
|
|
8
|
+
//
|
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
//
|
|
11
|
+
// Unless required by applicable law or agreed to in writing,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
import { isEditable } from './core/editable.js';
|
|
18
|
+
import { isElement } from './core/element.js';
|
|
19
|
+
import { ELEMENT_NOT_INTERACTABLE, INVALID_ARGUMENT, botError } from './core/error.js';
|
|
20
|
+
import { EventType, fire } from './core/events.js';
|
|
21
|
+
import { getActiveElementFrom, holdsFocus } from './core/focus.js';
|
|
22
|
+
import { isInteractable } from './core/interactable.js';
|
|
23
|
+
import { Keyboard } from './core/keyboard.js';
|
|
24
|
+
import { Keys, fromChar, isModifier } from './core/keys.js';
|
|
25
|
+
import { scrollIntoView } from './core/scroll.js';
|
|
26
|
+
// The numpad digits and function keys are generated into Keys, so their names
|
|
27
|
+
// are not in its type.
|
|
28
|
+
const NAMED = Keys;
|
|
29
|
+
// The WebDriver key code points (U+E000-U+E03D) the keyboard can press. NULL
|
|
30
|
+
// is handled separately: it releases every held modifier.
|
|
31
|
+
const NULL = '\uE000';
|
|
32
|
+
const WEBDRIVER_KEYS = {
|
|
33
|
+
'\uE003': Keys.BACKSPACE,
|
|
34
|
+
'\uE004': Keys.TAB,
|
|
35
|
+
'\uE006': Keys.ENTER,
|
|
36
|
+
// RETURN and ENTER differ on a real keyboard; browsers treat them alike.
|
|
37
|
+
'\uE007': Keys.ENTER,
|
|
38
|
+
'\uE008': Keys.SHIFT,
|
|
39
|
+
'\uE009': Keys.CONTROL,
|
|
40
|
+
'\uE00A': Keys.ALT,
|
|
41
|
+
'\uE00B': Keys.PAUSE,
|
|
42
|
+
'\uE00C': Keys.ESC,
|
|
43
|
+
'\uE00D': Keys.SPACE,
|
|
44
|
+
'\uE00E': Keys.PAGE_UP,
|
|
45
|
+
'\uE00F': Keys.PAGE_DOWN,
|
|
46
|
+
'\uE010': Keys.END,
|
|
47
|
+
'\uE011': Keys.HOME,
|
|
48
|
+
'\uE012': Keys.LEFT,
|
|
49
|
+
'\uE013': Keys.UP,
|
|
50
|
+
'\uE014': Keys.RIGHT,
|
|
51
|
+
'\uE015': Keys.DOWN,
|
|
52
|
+
'\uE016': Keys.INSERT,
|
|
53
|
+
'\uE017': Keys.DELETE,
|
|
54
|
+
'\uE018': Keys.SEMICOLON,
|
|
55
|
+
'\uE019': Keys.EQUALS,
|
|
56
|
+
'\uE01A': NAMED['NUM_ZERO'],
|
|
57
|
+
'\uE01B': NAMED['NUM_ONE'],
|
|
58
|
+
'\uE01C': NAMED['NUM_TWO'],
|
|
59
|
+
'\uE01D': NAMED['NUM_THREE'],
|
|
60
|
+
'\uE01E': NAMED['NUM_FOUR'],
|
|
61
|
+
'\uE01F': NAMED['NUM_FIVE'],
|
|
62
|
+
'\uE020': NAMED['NUM_SIX'],
|
|
63
|
+
'\uE021': NAMED['NUM_SEVEN'],
|
|
64
|
+
'\uE022': NAMED['NUM_EIGHT'],
|
|
65
|
+
'\uE023': NAMED['NUM_NINE'],
|
|
66
|
+
'\uE024': Keys.NUM_MULTIPLY,
|
|
67
|
+
'\uE025': Keys.NUM_PLUS,
|
|
68
|
+
'\uE026': Keys.SEPARATOR,
|
|
69
|
+
'\uE027': Keys.NUM_MINUS,
|
|
70
|
+
'\uE028': Keys.NUM_PERIOD,
|
|
71
|
+
'\uE029': Keys.NUM_DIVISION,
|
|
72
|
+
'\uE031': NAMED['F1'],
|
|
73
|
+
'\uE032': NAMED['F2'],
|
|
74
|
+
'\uE033': NAMED['F3'],
|
|
75
|
+
'\uE034': NAMED['F4'],
|
|
76
|
+
'\uE035': NAMED['F5'],
|
|
77
|
+
'\uE036': NAMED['F6'],
|
|
78
|
+
'\uE037': NAMED['F7'],
|
|
79
|
+
'\uE038': NAMED['F8'],
|
|
80
|
+
'\uE039': NAMED['F9'],
|
|
81
|
+
'\uE03A': NAMED['F10'],
|
|
82
|
+
'\uE03B': NAMED['F11'],
|
|
83
|
+
'\uE03C': NAMED['F12'],
|
|
84
|
+
'\uE03D': Keys.META,
|
|
85
|
+
};
|
|
86
|
+
const ALIASES = {
|
|
87
|
+
'\n': Keys.ENTER,
|
|
88
|
+
'\t': Keys.TAB,
|
|
89
|
+
'\b': Keys.BACKSPACE,
|
|
90
|
+
};
|
|
91
|
+
// Controls whose value no key sequence can edit, even from a real keyboard
|
|
92
|
+
// driven by script: their UI is a picker. They take a well-formed value
|
|
93
|
+
// directly instead, with the events a picker commit produces.
|
|
94
|
+
const PICKER_TYPES = new Set(['date', 'datetime-local', 'month', 'time', 'week', 'color']);
|
|
95
|
+
// Types `keys` into the element with a virtual keyboard: webdriver.atoms.
|
|
96
|
+
// element.type. Each string is split into characters; WebDriver key code
|
|
97
|
+
// points press that key, and modifiers stay down until pressed again, NULL,
|
|
98
|
+
// or the end of the call (unless `optPersistModifiers`).
|
|
99
|
+
//
|
|
100
|
+
// Differences from the Closure atom, toward what typing by hand produces:
|
|
101
|
+
// - See core/keyboard.ts for the key events and edits themselves.
|
|
102
|
+
// - Picker inputs (date, time, colour...) take the whole value with input and
|
|
103
|
+
// change in every engine. Closure did this for date alone, only in
|
|
104
|
+
// Chrome-like WebKit, and fired synthetic touch, focus and blur events.
|
|
105
|
+
// - An element hidden from the mouse but already focused can still be typed
|
|
106
|
+
// into, as before; otherwise it must be interactable, and fails with
|
|
107
|
+
// "element not interactable" rather than "invalid element state".
|
|
108
|
+
// - An unsupported WebDriver key fails with "invalid argument" instead of a
|
|
109
|
+
// plain Error.
|
|
110
|
+
// The third argument (a keyboard to reuse) never crossed the wire and is
|
|
111
|
+
// ignored.
|
|
112
|
+
function type(element, keys, _optKeyboard, optPersistModifiers) {
|
|
113
|
+
if (!holdsFocus(element)) {
|
|
114
|
+
if (!isInteractable(element)) {
|
|
115
|
+
throw botError(ELEMENT_NOT_INTERACTABLE, 'Element is not currently interactable and may not be manipulated');
|
|
116
|
+
}
|
|
117
|
+
scrollIntoView(element);
|
|
118
|
+
}
|
|
119
|
+
const keyboard = new Keyboard();
|
|
120
|
+
keyboard.moveCursor(element);
|
|
121
|
+
// A host whose shadow tree holds focus passes its keys to the field inside.
|
|
122
|
+
const receiver = holdsFocus(element) ? getActiveElementFrom(element) || element : element;
|
|
123
|
+
// A read-only picker falls through to the keyboard, which fires the keys
|
|
124
|
+
// but edits nothing, as it does for a read-only text field.
|
|
125
|
+
if (isElement(receiver, 'INPUT') && PICKER_TYPES.has(receiver.type) && isEditable(receiver)) {
|
|
126
|
+
if (setPickerValue(receiver, keys.join(''))) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
for (const sequence of keys) {
|
|
131
|
+
for (const ch of Array.from(sequence)) {
|
|
132
|
+
if (ch === NULL) {
|
|
133
|
+
keyboard.releaseModifiers();
|
|
134
|
+
}
|
|
135
|
+
else if ('\uE000' <= ch && ch <= '\uE03D') {
|
|
136
|
+
const key = WEBDRIVER_KEYS[ch];
|
|
137
|
+
if (!key) {
|
|
138
|
+
throw botError(INVALID_ARGUMENT, 'Unsupported WebDriver key: \\u' + ch.charCodeAt(0).toString(16));
|
|
139
|
+
}
|
|
140
|
+
pressWebDriverKey(keyboard, key);
|
|
141
|
+
}
|
|
142
|
+
else if (ALIASES[ch]) {
|
|
143
|
+
tap(keyboard, ALIASES[ch]);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
typeCharacter(keyboard, ch);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (!optPersistModifiers) {
|
|
151
|
+
keyboard.releaseModifiers();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// A modifier toggles; anything else is pressed and released.
|
|
155
|
+
function pressWebDriverKey(keyboard, key) {
|
|
156
|
+
if (!isModifier(key)) {
|
|
157
|
+
tap(keyboard, key);
|
|
158
|
+
}
|
|
159
|
+
else if (keyboard.isPressed(key)) {
|
|
160
|
+
keyboard.releaseKey(key);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
keyboard.pressKey(key);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function tap(keyboard, key) {
|
|
167
|
+
keyboard.pressKey(key);
|
|
168
|
+
keyboard.releaseKey(key);
|
|
169
|
+
}
|
|
170
|
+
// Shift is held around a character that needs it, unless already held.
|
|
171
|
+
function typeCharacter(keyboard, ch) {
|
|
172
|
+
const { key, shift } = fromChar(ch);
|
|
173
|
+
const addShift = shift && !keyboard.isPressed(Keys.SHIFT);
|
|
174
|
+
if (addShift) {
|
|
175
|
+
keyboard.pressKey(Keys.SHIFT);
|
|
176
|
+
}
|
|
177
|
+
tap(keyboard, key);
|
|
178
|
+
if (addShift) {
|
|
179
|
+
keyboard.releaseKey(Keys.SHIFT);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// Whether the input accepted `text` as its value. A value the control would
|
|
183
|
+
// sanitise away is rejected and left to the keyboard, as before. A colour
|
|
184
|
+
// input stores hex digits in lower case, so "#FF0000" is accepted as
|
|
185
|
+
// "#ff0000".
|
|
186
|
+
function setPickerValue(input, text) {
|
|
187
|
+
const previous = input.value;
|
|
188
|
+
const expected = input.type === 'color' ? text.toLowerCase() : text;
|
|
189
|
+
input.value = text;
|
|
190
|
+
if (input.value !== expected) {
|
|
191
|
+
input.value = previous;
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
if (previous !== expected) {
|
|
195
|
+
fire(input, EventType.INPUT, { inputType: 'insertReplacementText', data: null });
|
|
196
|
+
fire(input, EventType.CHANGE, undefined);
|
|
197
|
+
}
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
export default type;
|
|
201
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../typescript/type.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AAC7D,oDAAoD;AACpD,6DAA6D;AAC7D,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6DAA6D;AAC7D,8DAA8D;AAC9D,yDAAyD;AACzD,4DAA4D;AAC5D,0DAA0D;AAC1D,qBAAqB;AAErB,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACtF,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAClE,OAA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AAK,GAAG,IAAI,CAAA;IAClB,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC7B,KAAK,CAAC,KAAK,GAAG,QAAQ,CAAA;QACtB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,uBAAuB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;QAChF,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAC1C,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,eAAe,IAAI,CAAA"}
|
package/index.ts
CHANGED
|
@@ -20,4 +20,44 @@
|
|
|
20
20
|
// written here is what consumers resolve against.
|
|
21
21
|
export { default as getAttribute } from './typescript/get-attribute.js'
|
|
22
22
|
export { default as findElements } from './typescript/find-elements.js'
|
|
23
|
+
export { default as findElement } from './typescript/find-element.js'
|
|
24
|
+
export { default as activeElement } from './typescript/active-element.js'
|
|
25
|
+
export { default as defaultContent } from './typescript/default-content.js'
|
|
26
|
+
export { default as frameByIdOrName } from './typescript/frame-by-id-or-name.js'
|
|
27
|
+
export { default as frameByIndex } from './typescript/frame-by-index.js'
|
|
28
|
+
export { default as getFrameWindow } from './typescript/get-frame-window.js'
|
|
23
29
|
export { default as isDisplayed } from './typescript/is-displayed.js'
|
|
30
|
+
export { default as isEnabled } from './typescript/is-enabled.js'
|
|
31
|
+
export { default as isSelected } from './typescript/is-selected.js'
|
|
32
|
+
export { default as isEditable } from './typescript/is-editable.js'
|
|
33
|
+
export { default as isFocusable } from './typescript/is-focusable.js'
|
|
34
|
+
export { default as isInteractable } from './typescript/is-interactable.js'
|
|
35
|
+
export { default as getAttributeValue } from './typescript/get-attribute-value.js'
|
|
36
|
+
export { default as getSize } from './typescript/get-size.js'
|
|
37
|
+
export { default as getLocation } from './typescript/get-location.js'
|
|
38
|
+
export { default as getEffectiveStyle } from './typescript/get-effective-style.js'
|
|
39
|
+
export { default as getValueOfCssProperty } from './typescript/get-effective-style.js'
|
|
40
|
+
export { default as getTopLeftCoordinates } from './typescript/get-top-left-coordinates.js'
|
|
41
|
+
export { default as getText } from './typescript/get-text.js'
|
|
42
|
+
export { default as getLocalStorageItem } from './typescript/get-local-storage-item.js'
|
|
43
|
+
export { default as getLocalStorageKey } from './typescript/get-local-storage-key.js'
|
|
44
|
+
export { default as getLocalStorageKeys } from './typescript/get-local-storage-keys.js'
|
|
45
|
+
export { default as getLocalStorageSize } from './typescript/get-local-storage-size.js'
|
|
46
|
+
export { default as setLocalStorageItem } from './typescript/set-local-storage-item.js'
|
|
47
|
+
export { default as removeLocalStorageItem } from './typescript/remove-local-storage-item.js'
|
|
48
|
+
export { default as clearLocalStorage } from './typescript/clear-local-storage.js'
|
|
49
|
+
export { default as getSessionStorageItem } from './typescript/get-session-storage-item.js'
|
|
50
|
+
export { default as getSessionStorageKey } from './typescript/get-session-storage-key.js'
|
|
51
|
+
export { default as getSessionStorageKeys } from './typescript/get-session-storage-keys.js'
|
|
52
|
+
export { default as getSessionStorageSize } from './typescript/get-session-storage-size.js'
|
|
53
|
+
export { default as setSessionStorageItem } from './typescript/set-session-storage-item.js'
|
|
54
|
+
export { default as removeSessionStorageItem } from './typescript/remove-session-storage-item.js'
|
|
55
|
+
export { default as clearSessionStorage } from './typescript/clear-session-storage.js'
|
|
56
|
+
export { default as executeScript } from './typescript/execute-script.js'
|
|
57
|
+
export { default as executeAsyncScript } from './typescript/execute-async-script.js'
|
|
58
|
+
export { default as getElementFromCache } from './typescript/get-element-from-cache.js'
|
|
59
|
+
export { default as findElementFragment } from './typescript/find-element-fragment.js'
|
|
60
|
+
export { default as click } from './typescript/click.js'
|
|
61
|
+
export { default as type } from './typescript/type.js'
|
|
62
|
+
export { default as clear } from './typescript/clear.js'
|
|
63
|
+
export { default as submit } from './typescript/submit.js'
|