@wordpress/dom 3.7.0 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +8 -9
  3. package/build/dom/document-has-selection.js +4 -4
  4. package/build/dom/document-has-selection.js.map +1 -1
  5. package/build/dom/document-has-uncollapsed-selection.js +4 -4
  6. package/build/dom/document-has-uncollapsed-selection.js.map +1 -1
  7. package/build/dom/input-field-has-uncollapsed-selection.js +24 -18
  8. package/build/dom/input-field-has-uncollapsed-selection.js.map +1 -1
  9. package/build/dom/is-html-input-element.js +1 -1
  10. package/build/dom/is-html-input-element.js.map +1 -1
  11. package/build/dom/is-number-input.js +14 -4
  12. package/build/dom/is-number-input.js.map +1 -1
  13. package/build/dom/is-text-field.js +1 -1
  14. package/build/dom/is-text-field.js.map +1 -1
  15. package/build-module/dom/document-has-selection.js +4 -4
  16. package/build-module/dom/document-has-selection.js.map +1 -1
  17. package/build-module/dom/document-has-uncollapsed-selection.js +4 -4
  18. package/build-module/dom/document-has-uncollapsed-selection.js.map +1 -1
  19. package/build-module/dom/input-field-has-uncollapsed-selection.js +24 -18
  20. package/build-module/dom/input-field-has-uncollapsed-selection.js.map +1 -1
  21. package/build-module/dom/is-html-input-element.js +1 -1
  22. package/build-module/dom/is-html-input-element.js.map +1 -1
  23. package/build-module/dom/is-number-input.js +13 -4
  24. package/build-module/dom/is-number-input.js.map +1 -1
  25. package/build-module/dom/is-text-field.js +1 -1
  26. package/build-module/dom/is-text-field.js.map +1 -1
  27. package/build-types/dom/document-has-selection.d.ts +2 -2
  28. package/build-types/dom/document-has-uncollapsed-selection.d.ts +4 -4
  29. package/build-types/dom/input-field-has-uncollapsed-selection.d.ts +9 -5
  30. package/build-types/dom/input-field-has-uncollapsed-selection.d.ts.map +1 -1
  31. package/build-types/dom/is-number-input.d.ts +2 -3
  32. package/build-types/dom/is-number-input.d.ts.map +1 -1
  33. package/build-types/dom/is-text-field.d.ts.map +1 -1
  34. package/package.json +3 -2
  35. package/src/dom/document-has-selection.js +5 -5
  36. package/src/dom/document-has-uncollapsed-selection.js +4 -4
  37. package/src/dom/input-field-has-uncollapsed-selection.js +26 -18
  38. package/src/dom/is-html-input-element.js +1 -1
  39. package/src/dom/is-number-input.js +12 -4
  40. package/src/dom/is-text-field.js +2 -0
  41. package/src/test/dom.js +3 -23
  42. package/tsconfig.json +1 -3
  43. package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 3.10.0 (2022-06-01)
6
+
7
+ ## 3.9.0 (2022-05-18)
8
+
9
+ ### Deprecation
10
+
11
+ - Deprecate `isNumberInput`, as it is no longer used internally ([#40896](https://github.com/WordPress/gutenberg/pull/40896)).
12
+
13
+ ## 3.8.0 (2022-05-04)
14
+
5
15
  ## 3.7.0 (2022-04-21)
6
16
 
7
17
  ## 3.6.0 (2022-04-08)
package/README.md CHANGED
@@ -28,8 +28,8 @@ _Returns_
28
28
 
29
29
  ### documentHasSelection
30
30
 
31
- Check whether the current document has a selection. This checks for both
32
- focus in an input field and general text selection.
31
+ Check whether the current document has a selection. This includes focus in
32
+ input fields, textareas, and general rich-text selection.
33
33
 
34
34
  _Parameters_
35
35
 
@@ -57,9 +57,9 @@ _Returns_
57
57
 
58
58
  ### documentHasUncollapsedSelection
59
59
 
60
- Check whether the current document has any sort of selection. This includes
61
- ranges of text across elements and any selection inside `<input>` and
62
- `<textarea>` elements.
60
+ Check whether the current document has any sort of (uncollapsed) selection.
61
+ This includes ranges of text across elements and any selection inside
62
+ textual `<input>` and `<textarea>` elements.
63
63
 
64
64
  _Parameters_
65
65
 
@@ -67,7 +67,7 @@ _Parameters_
67
67
 
68
68
  _Returns_
69
69
 
70
- - `boolean`: Whether there is any sort of "selection" in the document.
70
+ - `boolean`: Whether there is any recognizable text selection in the document.
71
71
 
72
72
  ### focus
73
73
 
@@ -211,8 +211,7 @@ _Returns_
211
211
 
212
212
  ### isNumberInput
213
213
 
214
- Check whether the given element is an input field of type number
215
- and has a valueAsNumber
214
+ Check whether the given element is an input field of type number.
216
215
 
217
216
  _Parameters_
218
217
 
@@ -220,7 +219,7 @@ _Parameters_
220
219
 
221
220
  _Returns_
222
221
 
223
- - `node is HTMLInputElement`: True if the node is input and holds a number.
222
+ - `node is HTMLInputElement`: True if the node is number input.
224
223
 
225
224
  ### isPhrasingContent
226
225
 
@@ -9,7 +9,7 @@ exports.default = documentHasSelection;
9
9
 
10
10
  var _isTextField = _interopRequireDefault(require("./is-text-field"));
11
11
 
12
- var _isNumberInput = _interopRequireDefault(require("./is-number-input"));
12
+ var _isHtmlInputElement = _interopRequireDefault(require("./is-html-input-element"));
13
13
 
14
14
  var _documentHasTextSelection = _interopRequireDefault(require("./document-has-text-selection"));
15
15
 
@@ -18,14 +18,14 @@ var _documentHasTextSelection = _interopRequireDefault(require("./document-has-t
18
18
  */
19
19
 
20
20
  /**
21
- * Check whether the current document has a selection. This checks for both
22
- * focus in an input field and general text selection.
21
+ * Check whether the current document has a selection. This includes focus in
22
+ * input fields, textareas, and general rich-text selection.
23
23
  *
24
24
  * @param {Document} doc The document to check.
25
25
  *
26
26
  * @return {boolean} True if there is selection, false if not.
27
27
  */
28
28
  function documentHasSelection(doc) {
29
- return !!doc.activeElement && ((0, _isTextField.default)(doc.activeElement) || (0, _isNumberInput.default)(doc.activeElement) || (0, _documentHasTextSelection.default)(doc));
29
+ return !!doc.activeElement && ((0, _isHtmlInputElement.default)(doc.activeElement) || (0, _isTextField.default)(doc.activeElement) || (0, _documentHasTextSelection.default)(doc));
30
30
  }
31
31
  //# sourceMappingURL=document-has-selection.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/document-has-selection.js"],"names":["documentHasSelection","doc","activeElement"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,oBAAT,CAA+BC,GAA/B,EAAqC;AACnD,SACC,CAAC,CAAEA,GAAG,CAACC,aAAP,KACE,0BAAaD,GAAG,CAACC,aAAjB,KACD,4BAAeD,GAAG,CAACC,aAAnB,CADC,IAED,uCAA0BD,GAA1B,CAHD,CADD;AAMA","sourcesContent":["/**\n * Internal dependencies\n */\nimport isTextField from './is-text-field';\nimport isNumberInput from './is-number-input';\nimport documentHasTextSelection from './document-has-text-selection';\n\n/**\n * Check whether the current document has a selection. This checks for both\n * focus in an input field and general text selection.\n *\n * @param {Document} doc The document to check.\n *\n * @return {boolean} True if there is selection, false if not.\n */\nexport default function documentHasSelection( doc ) {\n\treturn (\n\t\t!! doc.activeElement &&\n\t\t( isTextField( doc.activeElement ) ||\n\t\t\tisNumberInput( doc.activeElement ) ||\n\t\t\tdocumentHasTextSelection( doc ) )\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/dom/src/dom/document-has-selection.js"],"names":["documentHasSelection","doc","activeElement"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,oBAAT,CAA+BC,GAA/B,EAAqC;AACnD,SACC,CAAC,CAAEA,GAAG,CAACC,aAAP,KACE,iCAAoBD,GAAG,CAACC,aAAxB,KACD,0BAAaD,GAAG,CAACC,aAAjB,CADC,IAED,uCAA0BD,GAA1B,CAHD,CADD;AAMA","sourcesContent":["/**\n * Internal dependencies\n */\nimport isTextField from './is-text-field';\nimport isHTMLInputElement from './is-html-input-element';\nimport documentHasTextSelection from './document-has-text-selection';\n\n/**\n * Check whether the current document has a selection. This includes focus in\n * input fields, textareas, and general rich-text selection.\n *\n * @param {Document} doc The document to check.\n *\n * @return {boolean} True if there is selection, false if not.\n */\nexport default function documentHasSelection( doc ) {\n\treturn (\n\t\t!! doc.activeElement &&\n\t\t( isHTMLInputElement( doc.activeElement ) ||\n\t\t\tisTextField( doc.activeElement ) ||\n\t\t\tdocumentHasTextSelection( doc ) )\n\t);\n}\n"]}
@@ -16,13 +16,13 @@ var _inputFieldHasUncollapsedSelection = _interopRequireDefault(require("./input
16
16
  */
17
17
 
18
18
  /**
19
- * Check whether the current document has any sort of selection. This includes
20
- * ranges of text across elements and any selection inside `<input>` and
21
- * `<textarea>` elements.
19
+ * Check whether the current document has any sort of (uncollapsed) selection.
20
+ * This includes ranges of text across elements and any selection inside
21
+ * textual `<input>` and `<textarea>` elements.
22
22
  *
23
23
  * @param {Document} doc The document to check.
24
24
  *
25
- * @return {boolean} Whether there is any sort of "selection" in the document.
25
+ * @return {boolean} Whether there is any recognizable text selection in the document.
26
26
  */
27
27
  function documentHasUncollapsedSelection(doc) {
28
28
  return (0, _documentHasTextSelection.default)(doc) || !!doc.activeElement && (0, _inputFieldHasUncollapsedSelection.default)(doc.activeElement);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/document-has-uncollapsed-selection.js"],"names":["documentHasUncollapsedSelection","doc","activeElement"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,+BAAT,CAA0CC,GAA1C,EAAgD;AAC9D,SACC,uCAA0BA,GAA1B,KACE,CAAC,CAAEA,GAAG,CAACC,aAAP,IACD,gDAAmCD,GAAG,CAACC,aAAvC,CAHF;AAKA","sourcesContent":["/**\n * Internal dependencies\n */\nimport documentHasTextSelection from './document-has-text-selection';\nimport inputFieldHasUncollapsedSelection from './input-field-has-uncollapsed-selection';\n\n/**\n * Check whether the current document has any sort of selection. This includes\n * ranges of text across elements and any selection inside `<input>` and\n * `<textarea>` elements.\n *\n * @param {Document} doc The document to check.\n *\n * @return {boolean} Whether there is any sort of \"selection\" in the document.\n */\nexport default function documentHasUncollapsedSelection( doc ) {\n\treturn (\n\t\tdocumentHasTextSelection( doc ) ||\n\t\t( !! doc.activeElement &&\n\t\t\tinputFieldHasUncollapsedSelection( doc.activeElement ) )\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/dom/src/dom/document-has-uncollapsed-selection.js"],"names":["documentHasUncollapsedSelection","doc","activeElement"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,+BAAT,CAA0CC,GAA1C,EAAgD;AAC9D,SACC,uCAA0BA,GAA1B,KACE,CAAC,CAAEA,GAAG,CAACC,aAAP,IACD,gDAAmCD,GAAG,CAACC,aAAvC,CAHF;AAKA","sourcesContent":["/**\n * Internal dependencies\n */\nimport documentHasTextSelection from './document-has-text-selection';\nimport inputFieldHasUncollapsedSelection from './input-field-has-uncollapsed-selection';\n\n/**\n * Check whether the current document has any sort of (uncollapsed) selection.\n * This includes ranges of text across elements and any selection inside\n * textual `<input>` and `<textarea>` elements.\n *\n * @param {Document} doc The document to check.\n *\n * @return {boolean} Whether there is any recognizable text selection in the document.\n */\nexport default function documentHasUncollapsedSelection( doc ) {\n\treturn (\n\t\tdocumentHasTextSelection( doc ) ||\n\t\t( !! doc.activeElement &&\n\t\t\tinputFieldHasUncollapsedSelection( doc.activeElement ) )\n\t);\n}\n"]}
@@ -9,29 +9,36 @@ exports.default = inputFieldHasUncollapsedSelection;
9
9
 
10
10
  var _isTextField = _interopRequireDefault(require("./is-text-field"));
11
11
 
12
- var _isNumberInput = _interopRequireDefault(require("./is-number-input"));
12
+ var _isHtmlInputElement = _interopRequireDefault(require("./is-html-input-element"));
13
13
 
14
14
  /**
15
15
  * Internal dependencies
16
16
  */
17
17
 
18
18
  /**
19
- * Check whether the given element, assumed an input field or textarea,
20
- * contains a (uncollapsed) selection of text.
19
+ * Check whether the given input field or textarea contains a (uncollapsed)
20
+ * selection of text.
21
21
  *
22
- * Note: this is perhaps an abuse of the term "selection", since these elements
23
- * manage selection differently and aren't covered by Selection#collapsed.
22
+ * CAVEAT: Only specific text-based HTML inputs support the selection APIs
23
+ * needed to determine whether they have a collapsed or uncollapsed selection.
24
+ * This function defaults to returning `true` when the selection cannot be
25
+ * inspected, such as with `<input type="time">`. The rationale is that this
26
+ * should cause the block editor to defer to the browser's native selection
27
+ * handling (e.g. copying and pasting), thereby reducing friction for the user.
24
28
  *
25
- * See: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects.
29
+ * See: https://html.spec.whatwg.org/multipage/input.html#do-not-apply
26
30
  *
27
31
  * @param {Element} element The HTML element.
28
32
  *
29
33
  * @return {boolean} Whether the input/textareaa element has some "selection".
30
34
  */
31
35
  function inputFieldHasUncollapsedSelection(element) {
32
- if (!(0, _isTextField.default)(element) && !(0, _isNumberInput.default)(element)) {
36
+ if (!(0, _isHtmlInputElement.default)(element) && !(0, _isTextField.default)(element)) {
33
37
  return false;
34
- }
38
+ } // Safari throws a type error when trying to get `selectionStart` and
39
+ // `selectionEnd` on non-text <input> elements, so a try/catch construct is
40
+ // necessary.
41
+
35
42
 
36
43
  try {
37
44
  const {
@@ -40,17 +47,16 @@ function inputFieldHasUncollapsedSelection(element) {
40
47
  } =
41
48
  /** @type {HTMLInputElement | HTMLTextAreaElement} */
42
49
  element;
43
- return selectionStart !== null && selectionStart !== selectionEnd;
50
+ return (// `null` means the input type doesn't implement selection, thus we
51
+ // cannot determine whether the selection is collapsed, so we
52
+ // default to true.
53
+ selectionStart === null || // when not null, compare the two points
54
+ selectionStart !== selectionEnd
55
+ );
44
56
  } catch (error) {
45
- // Safari throws an exception when trying to get `selectionStart`
46
- // on non-text <input> elements (which, understandably, don't
47
- // have the text selection API). We catch this via a try/catch
48
- // block, as opposed to a more explicit check of the element's
49
- // input types, because of Safari's non-standard behavior. This
50
- // also means we don't have to worry about the list of input
51
- // types that support `selectionStart` changing as the HTML spec
52
- // evolves over time.
53
- return false;
57
+ // This is Safari's way of saying that the input type doesn't implement
58
+ // selection, so we default to true.
59
+ return true;
54
60
  }
55
61
  }
56
62
  //# sourceMappingURL=input-field-has-uncollapsed-selection.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/input-field-has-uncollapsed-selection.js"],"names":["inputFieldHasUncollapsedSelection","element","selectionStart","selectionEnd","error"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,iCAAT,CAA4CC,OAA5C,EAAsD;AACpE,MAAK,CAAE,0BAAaA,OAAb,CAAF,IAA4B,CAAE,4BAAeA,OAAf,CAAnC,EAA8D;AAC7D,WAAO,KAAP;AACA;;AACD,MAAI;AACH,UAAM;AACLC,MAAAA,cADK;AAELC,MAAAA;AAFK;AAGF;AAAwDF,IAAAA,OAH5D;AAKA,WAAOC,cAAc,KAAK,IAAnB,IAA2BA,cAAc,KAAKC,YAArD;AACA,GAPD,CAOE,OAAQC,KAAR,EAAgB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAO,KAAP;AACA;AACD","sourcesContent":["/**\n * Internal dependencies\n */\nimport isTextField from './is-text-field';\nimport isNumberInput from './is-number-input';\n\n/**\n * Check whether the given element, assumed an input field or textarea,\n * contains a (uncollapsed) selection of text.\n *\n * Note: this is perhaps an abuse of the term \"selection\", since these elements\n * manage selection differently and aren't covered by Selection#collapsed.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects.\n *\n * @param {Element} element The HTML element.\n *\n * @return {boolean} Whether the input/textareaa element has some \"selection\".\n */\nexport default function inputFieldHasUncollapsedSelection( element ) {\n\tif ( ! isTextField( element ) && ! isNumberInput( element ) ) {\n\t\treturn false;\n\t}\n\ttry {\n\t\tconst {\n\t\t\tselectionStart,\n\t\t\tselectionEnd,\n\t\t} = /** @type {HTMLInputElement | HTMLTextAreaElement} */ ( element );\n\n\t\treturn selectionStart !== null && selectionStart !== selectionEnd;\n\t} catch ( error ) {\n\t\t// Safari throws an exception when trying to get `selectionStart`\n\t\t// on non-text <input> elements (which, understandably, don't\n\t\t// have the text selection API). We catch this via a try/catch\n\t\t// block, as opposed to a more explicit check of the element's\n\t\t// input types, because of Safari's non-standard behavior. This\n\t\t// also means we don't have to worry about the list of input\n\t\t// types that support `selectionStart` changing as the HTML spec\n\t\t// evolves over time.\n\t\treturn false;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/dom/src/dom/input-field-has-uncollapsed-selection.js"],"names":["inputFieldHasUncollapsedSelection","element","selectionStart","selectionEnd","error"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,iCAAT,CAA4CC,OAA5C,EAAsD;AACpE,MAAK,CAAE,iCAAoBA,OAApB,CAAF,IAAmC,CAAE,0BAAaA,OAAb,CAA1C,EAAmE;AAClE,WAAO,KAAP;AACA,GAHmE,CAKpE;AACA;AACA;;;AACA,MAAI;AACH,UAAM;AACLC,MAAAA,cADK;AAELC,MAAAA;AAFK;AAGF;AAAwDF,IAAAA,OAH5D;AAIA,WACC;AACA;AACA;AACAC,MAAAA,cAAc,KAAK,IAAnB,IACA;AACAA,MAAAA,cAAc,KAAKC;AANpB;AAQA,GAbD,CAaE,OAAQC,KAAR,EAAgB;AACjB;AACA;AACA,WAAO,IAAP;AACA;AACD","sourcesContent":["/**\n * Internal dependencies\n */\nimport isTextField from './is-text-field';\nimport isHTMLInputElement from './is-html-input-element';\n\n/**\n * Check whether the given input field or textarea contains a (uncollapsed)\n * selection of text.\n *\n * CAVEAT: Only specific text-based HTML inputs support the selection APIs\n * needed to determine whether they have a collapsed or uncollapsed selection.\n * This function defaults to returning `true` when the selection cannot be\n * inspected, such as with `<input type=\"time\">`. The rationale is that this\n * should cause the block editor to defer to the browser's native selection\n * handling (e.g. copying and pasting), thereby reducing friction for the user.\n *\n * See: https://html.spec.whatwg.org/multipage/input.html#do-not-apply\n *\n * @param {Element} element The HTML element.\n *\n * @return {boolean} Whether the input/textareaa element has some \"selection\".\n */\nexport default function inputFieldHasUncollapsedSelection( element ) {\n\tif ( ! isHTMLInputElement( element ) && ! isTextField( element ) ) {\n\t\treturn false;\n\t}\n\n\t// Safari throws a type error when trying to get `selectionStart` and\n\t// `selectionEnd` on non-text <input> elements, so a try/catch construct is\n\t// necessary.\n\ttry {\n\t\tconst {\n\t\t\tselectionStart,\n\t\t\tselectionEnd,\n\t\t} = /** @type {HTMLInputElement | HTMLTextAreaElement} */ ( element );\n\t\treturn (\n\t\t\t// `null` means the input type doesn't implement selection, thus we\n\t\t\t// cannot determine whether the selection is collapsed, so we\n\t\t\t// default to true.\n\t\t\tselectionStart === null ||\n\t\t\t// when not null, compare the two points\n\t\t\tselectionStart !== selectionEnd\n\t\t);\n\t} catch ( error ) {\n\t\t// This is Safari's way of saying that the input type doesn't implement\n\t\t// selection, so we default to true.\n\t\treturn true;\n\t}\n}\n"]}
@@ -13,6 +13,6 @@ exports.default = isHTMLInputElement;
13
13
  */
14
14
  function isHTMLInputElement(node) {
15
15
  /* eslint-enable jsdoc/valid-types */
16
- return !!node && node.nodeName === 'INPUT';
16
+ return (node === null || node === void 0 ? void 0 : node.nodeName) === 'INPUT';
17
17
  }
18
18
  //# sourceMappingURL=is-html-input-element.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-html-input-element.js"],"names":["isHTMLInputElement","node","nodeName"],"mappings":";;;;;;;AAAA;;AACA;AACA;AACA;AACA;AACe,SAASA,kBAAT,CAA6BC,IAA7B,EAAoC;AAClD;AACA,SAAO,CAAC,CAAEA,IAAH,IAAWA,IAAI,CAACC,QAAL,KAAkB,OAApC;AACA","sourcesContent":["/* eslint-disable jsdoc/valid-types */\n/**\n * @param {Node} node\n * @return {node is HTMLInputElement} Whether the node is an HTMLInputElement.\n */\nexport default function isHTMLInputElement( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\treturn !! node && node.nodeName === 'INPUT';\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/dom/src/dom/is-html-input-element.js"],"names":["isHTMLInputElement","node","nodeName"],"mappings":";;;;;;;AAAA;;AACA;AACA;AACA;AACA;AACe,SAASA,kBAAT,CAA6BC,IAA7B,EAAoC;AAClD;AACA,SAAO,CAAAA,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEC,QAAN,MAAmB,OAA1B;AACA","sourcesContent":["/* eslint-disable jsdoc/valid-types */\n/**\n * @param {Node} node\n * @return {node is HTMLInputElement} Whether the node is an HTMLInputElement.\n */\nexport default function isHTMLInputElement( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\treturn node?.nodeName === 'INPUT';\n}\n"]}
@@ -7,8 +7,14 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = isNumberInput;
9
9
 
10
+ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
11
+
10
12
  var _isHtmlInputElement = _interopRequireDefault(require("./is-html-input-element"));
11
13
 
14
+ /**
15
+ * WordPress dependencies
16
+ */
17
+
12
18
  /**
13
19
  * Internal dependencies
14
20
  */
@@ -16,15 +22,19 @@ var _isHtmlInputElement = _interopRequireDefault(require("./is-html-input-elemen
16
22
  /* eslint-disable jsdoc/valid-types */
17
23
 
18
24
  /**
19
- * Check whether the given element is an input field of type number
20
- * and has a valueAsNumber
25
+ * Check whether the given element is an input field of type number.
21
26
  *
22
27
  * @param {Node} node The HTML node.
23
28
  *
24
- * @return {node is HTMLInputElement} True if the node is input and holds a number.
29
+ * @return {node is HTMLInputElement} True if the node is number input.
25
30
  */
26
31
  function isNumberInput(node) {
32
+ (0, _deprecated.default)('wp.dom.isNumberInput', {
33
+ since: '6.1',
34
+ version: '6.5'
35
+ });
27
36
  /* eslint-enable jsdoc/valid-types */
28
- return (0, _isHtmlInputElement.default)(node) && node.type === 'number' && !!node.valueAsNumber;
37
+
38
+ return (0, _isHtmlInputElement.default)(node) && node.type === 'number' && !isNaN(node.valueAsNumber);
29
39
  }
30
40
  //# sourceMappingURL=is-number-input.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-number-input.js"],"names":["isNumberInput","node","type","valueAsNumber"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,aAAT,CAAwBC,IAAxB,EAA+B;AAC7C;AACA,SACC,iCAAoBA,IAApB,KACAA,IAAI,CAACC,IAAL,KAAc,QADd,IAEA,CAAC,CAAED,IAAI,CAACE,aAHT;AAKA","sourcesContent":["/**\n * Internal dependencies\n */\nimport isHTMLInputElement from './is-html-input-element';\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Check whether the given element is an input field of type number\n * and has a valueAsNumber\n *\n * @param {Node} node The HTML node.\n *\n * @return {node is HTMLInputElement} True if the node is input and holds a number.\n */\nexport default function isNumberInput( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\treturn (\n\t\tisHTMLInputElement( node ) &&\n\t\tnode.type === 'number' &&\n\t\t!! node.valueAsNumber\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/dom/src/dom/is-number-input.js"],"names":["isNumberInput","node","since","version","type","isNaN","valueAsNumber"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,aAAT,CAAwBC,IAAxB,EAA+B;AAC7C,2BAAY,sBAAZ,EAAoC;AACnCC,IAAAA,KAAK,EAAE,KAD4B;AAEnCC,IAAAA,OAAO,EAAE;AAF0B,GAApC;AAIA;;AACA,SACC,iCAAoBF,IAApB,KACAA,IAAI,CAACG,IAAL,KAAc,QADd,IAEA,CAAEC,KAAK,CAAEJ,IAAI,CAACK,aAAP,CAHR;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport isHTMLInputElement from './is-html-input-element';\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Check whether the given element is an input field of type number.\n *\n * @param {Node} node The HTML node.\n *\n * @return {node is HTMLInputElement} True if the node is number input.\n */\nexport default function isNumberInput( node ) {\n\tdeprecated( 'wp.dom.isNumberInput', {\n\t\tsince: '6.1',\n\t\tversion: '6.5',\n\t} );\n\t/* eslint-enable jsdoc/valid-types */\n\treturn (\n\t\tisHTMLInputElement( node ) &&\n\t\tnode.type === 'number' &&\n\t\t! isNaN( node.valueAsNumber )\n\t);\n}\n"]}
@@ -26,7 +26,7 @@ var _isHtmlInputElement = _interopRequireDefault(require("./is-html-input-elemen
26
26
  */
27
27
  function isTextField(node) {
28
28
  /* eslint-enable jsdoc/valid-types */
29
- const nonTextInputs = ['button', 'checkbox', 'hidden', 'file', 'radio', 'image', 'range', 'reset', 'submit', 'number'];
29
+ const nonTextInputs = ['button', 'checkbox', 'hidden', 'file', 'radio', 'image', 'range', 'reset', 'submit', 'number', 'email', 'time'];
30
30
  return (0, _isHtmlInputElement.default)(node) && node.type && !nonTextInputs.includes(node.type) || node.nodeName === 'TEXTAREA' ||
31
31
  /** @type {HTMLElement} */
32
32
  node.contentEditable === 'true';
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-text-field.js"],"names":["isTextField","node","nonTextInputs","type","includes","nodeName","contentEditable"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,WAAT,CAAsBC,IAAtB,EAA6B;AAC3C;AACA,QAAMC,aAAa,GAAG,CACrB,QADqB,EAErB,UAFqB,EAGrB,QAHqB,EAIrB,MAJqB,EAKrB,OALqB,EAMrB,OANqB,EAOrB,OAPqB,EAQrB,OARqB,EASrB,QATqB,EAUrB,QAVqB,CAAtB;AAYA,SACG,iCAAoBD,IAApB,KACDA,IAAI,CAACE,IADJ,IAED,CAAED,aAAa,CAACE,QAAd,CAAwBH,IAAI,CAACE,IAA7B,CAFH,IAGAF,IAAI,CAACI,QAAL,KAAkB,UAHlB;AAIA;AAA6BJ,EAAAA,IAAF,CAASK,eAAT,KAA6B,MALzD;AAOA","sourcesContent":["/**\n * Internal dependencies\n */\nimport isHTMLInputElement from './is-html-input-element';\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Check whether the given element is a text field, where text field is defined\n * by the ability to select within the input, or that it is contenteditable.\n *\n * See: https://html.spec.whatwg.org/#textFieldSelection\n *\n * @param {Node} node The HTML element.\n * @return {node is HTMLElement} True if the element is an text field, false if not.\n */\nexport default function isTextField( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\tconst nonTextInputs = [\n\t\t'button',\n\t\t'checkbox',\n\t\t'hidden',\n\t\t'file',\n\t\t'radio',\n\t\t'image',\n\t\t'range',\n\t\t'reset',\n\t\t'submit',\n\t\t'number',\n\t];\n\treturn (\n\t\t( isHTMLInputElement( node ) &&\n\t\t\tnode.type &&\n\t\t\t! nonTextInputs.includes( node.type ) ) ||\n\t\tnode.nodeName === 'TEXTAREA' ||\n\t\t/** @type {HTMLElement} */ ( node ).contentEditable === 'true'\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/dom/src/dom/is-text-field.js"],"names":["isTextField","node","nonTextInputs","type","includes","nodeName","contentEditable"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,WAAT,CAAsBC,IAAtB,EAA6B;AAC3C;AACA,QAAMC,aAAa,GAAG,CACrB,QADqB,EAErB,UAFqB,EAGrB,QAHqB,EAIrB,MAJqB,EAKrB,OALqB,EAMrB,OANqB,EAOrB,OAPqB,EAQrB,OARqB,EASrB,QATqB,EAUrB,QAVqB,EAWrB,OAXqB,EAYrB,MAZqB,CAAtB;AAcA,SACG,iCAAoBD,IAApB,KACDA,IAAI,CAACE,IADJ,IAED,CAAED,aAAa,CAACE,QAAd,CAAwBH,IAAI,CAACE,IAA7B,CAFH,IAGAF,IAAI,CAACI,QAAL,KAAkB,UAHlB;AAIA;AAA6BJ,EAAAA,IAAF,CAASK,eAAT,KAA6B,MALzD;AAOA","sourcesContent":["/**\n * Internal dependencies\n */\nimport isHTMLInputElement from './is-html-input-element';\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Check whether the given element is a text field, where text field is defined\n * by the ability to select within the input, or that it is contenteditable.\n *\n * See: https://html.spec.whatwg.org/#textFieldSelection\n *\n * @param {Node} node The HTML element.\n * @return {node is HTMLElement} True if the element is an text field, false if not.\n */\nexport default function isTextField( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\tconst nonTextInputs = [\n\t\t'button',\n\t\t'checkbox',\n\t\t'hidden',\n\t\t'file',\n\t\t'radio',\n\t\t'image',\n\t\t'range',\n\t\t'reset',\n\t\t'submit',\n\t\t'number',\n\t\t'email',\n\t\t'time',\n\t];\n\treturn (\n\t\t( isHTMLInputElement( node ) &&\n\t\t\tnode.type &&\n\t\t\t! nonTextInputs.includes( node.type ) ) ||\n\t\tnode.nodeName === 'TEXTAREA' ||\n\t\t/** @type {HTMLElement} */ ( node ).contentEditable === 'true'\n\t);\n}\n"]}
@@ -2,11 +2,11 @@
2
2
  * Internal dependencies
3
3
  */
4
4
  import isTextField from './is-text-field';
5
- import isNumberInput from './is-number-input';
5
+ import isHTMLInputElement from './is-html-input-element';
6
6
  import documentHasTextSelection from './document-has-text-selection';
7
7
  /**
8
- * Check whether the current document has a selection. This checks for both
9
- * focus in an input field and general text selection.
8
+ * Check whether the current document has a selection. This includes focus in
9
+ * input fields, textareas, and general rich-text selection.
10
10
  *
11
11
  * @param {Document} doc The document to check.
12
12
  *
@@ -14,6 +14,6 @@ import documentHasTextSelection from './document-has-text-selection';
14
14
  */
15
15
 
16
16
  export default function documentHasSelection(doc) {
17
- return !!doc.activeElement && (isTextField(doc.activeElement) || isNumberInput(doc.activeElement) || documentHasTextSelection(doc));
17
+ return !!doc.activeElement && (isHTMLInputElement(doc.activeElement) || isTextField(doc.activeElement) || documentHasTextSelection(doc));
18
18
  }
19
19
  //# sourceMappingURL=document-has-selection.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/document-has-selection.js"],"names":["isTextField","isNumberInput","documentHasTextSelection","documentHasSelection","doc","activeElement"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,WAAP,MAAwB,iBAAxB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,wBAAP,MAAqC,+BAArC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,oBAAT,CAA+BC,GAA/B,EAAqC;AACnD,SACC,CAAC,CAAEA,GAAG,CAACC,aAAP,KACEL,WAAW,CAAEI,GAAG,CAACC,aAAN,CAAX,IACDJ,aAAa,CAAEG,GAAG,CAACC,aAAN,CADZ,IAEDH,wBAAwB,CAAEE,GAAF,CAHzB,CADD;AAMA","sourcesContent":["/**\n * Internal dependencies\n */\nimport isTextField from './is-text-field';\nimport isNumberInput from './is-number-input';\nimport documentHasTextSelection from './document-has-text-selection';\n\n/**\n * Check whether the current document has a selection. This checks for both\n * focus in an input field and general text selection.\n *\n * @param {Document} doc The document to check.\n *\n * @return {boolean} True if there is selection, false if not.\n */\nexport default function documentHasSelection( doc ) {\n\treturn (\n\t\t!! doc.activeElement &&\n\t\t( isTextField( doc.activeElement ) ||\n\t\t\tisNumberInput( doc.activeElement ) ||\n\t\t\tdocumentHasTextSelection( doc ) )\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/dom/src/dom/document-has-selection.js"],"names":["isTextField","isHTMLInputElement","documentHasTextSelection","documentHasSelection","doc","activeElement"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,WAAP,MAAwB,iBAAxB;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AACA,OAAOC,wBAAP,MAAqC,+BAArC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,oBAAT,CAA+BC,GAA/B,EAAqC;AACnD,SACC,CAAC,CAAEA,GAAG,CAACC,aAAP,KACEJ,kBAAkB,CAAEG,GAAG,CAACC,aAAN,CAAlB,IACDL,WAAW,CAAEI,GAAG,CAACC,aAAN,CADV,IAEDH,wBAAwB,CAAEE,GAAF,CAHzB,CADD;AAMA","sourcesContent":["/**\n * Internal dependencies\n */\nimport isTextField from './is-text-field';\nimport isHTMLInputElement from './is-html-input-element';\nimport documentHasTextSelection from './document-has-text-selection';\n\n/**\n * Check whether the current document has a selection. This includes focus in\n * input fields, textareas, and general rich-text selection.\n *\n * @param {Document} doc The document to check.\n *\n * @return {boolean} True if there is selection, false if not.\n */\nexport default function documentHasSelection( doc ) {\n\treturn (\n\t\t!! doc.activeElement &&\n\t\t( isHTMLInputElement( doc.activeElement ) ||\n\t\t\tisTextField( doc.activeElement ) ||\n\t\t\tdocumentHasTextSelection( doc ) )\n\t);\n}\n"]}
@@ -4,13 +4,13 @@
4
4
  import documentHasTextSelection from './document-has-text-selection';
5
5
  import inputFieldHasUncollapsedSelection from './input-field-has-uncollapsed-selection';
6
6
  /**
7
- * Check whether the current document has any sort of selection. This includes
8
- * ranges of text across elements and any selection inside `<input>` and
9
- * `<textarea>` elements.
7
+ * Check whether the current document has any sort of (uncollapsed) selection.
8
+ * This includes ranges of text across elements and any selection inside
9
+ * textual `<input>` and `<textarea>` elements.
10
10
  *
11
11
  * @param {Document} doc The document to check.
12
12
  *
13
- * @return {boolean} Whether there is any sort of "selection" in the document.
13
+ * @return {boolean} Whether there is any recognizable text selection in the document.
14
14
  */
15
15
 
16
16
  export default function documentHasUncollapsedSelection(doc) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/document-has-uncollapsed-selection.js"],"names":["documentHasTextSelection","inputFieldHasUncollapsedSelection","documentHasUncollapsedSelection","doc","activeElement"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,wBAAP,MAAqC,+BAArC;AACA,OAAOC,iCAAP,MAA8C,yCAA9C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,+BAAT,CAA0CC,GAA1C,EAAgD;AAC9D,SACCH,wBAAwB,CAAEG,GAAF,CAAxB,IACE,CAAC,CAAEA,GAAG,CAACC,aAAP,IACDH,iCAAiC,CAAEE,GAAG,CAACC,aAAN,CAHnC;AAKA","sourcesContent":["/**\n * Internal dependencies\n */\nimport documentHasTextSelection from './document-has-text-selection';\nimport inputFieldHasUncollapsedSelection from './input-field-has-uncollapsed-selection';\n\n/**\n * Check whether the current document has any sort of selection. This includes\n * ranges of text across elements and any selection inside `<input>` and\n * `<textarea>` elements.\n *\n * @param {Document} doc The document to check.\n *\n * @return {boolean} Whether there is any sort of \"selection\" in the document.\n */\nexport default function documentHasUncollapsedSelection( doc ) {\n\treturn (\n\t\tdocumentHasTextSelection( doc ) ||\n\t\t( !! doc.activeElement &&\n\t\t\tinputFieldHasUncollapsedSelection( doc.activeElement ) )\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/dom/src/dom/document-has-uncollapsed-selection.js"],"names":["documentHasTextSelection","inputFieldHasUncollapsedSelection","documentHasUncollapsedSelection","doc","activeElement"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,wBAAP,MAAqC,+BAArC;AACA,OAAOC,iCAAP,MAA8C,yCAA9C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,+BAAT,CAA0CC,GAA1C,EAAgD;AAC9D,SACCH,wBAAwB,CAAEG,GAAF,CAAxB,IACE,CAAC,CAAEA,GAAG,CAACC,aAAP,IACDH,iCAAiC,CAAEE,GAAG,CAACC,aAAN,CAHnC;AAKA","sourcesContent":["/**\n * Internal dependencies\n */\nimport documentHasTextSelection from './document-has-text-selection';\nimport inputFieldHasUncollapsedSelection from './input-field-has-uncollapsed-selection';\n\n/**\n * Check whether the current document has any sort of (uncollapsed) selection.\n * This includes ranges of text across elements and any selection inside\n * textual `<input>` and `<textarea>` elements.\n *\n * @param {Document} doc The document to check.\n *\n * @return {boolean} Whether there is any recognizable text selection in the document.\n */\nexport default function documentHasUncollapsedSelection( doc ) {\n\treturn (\n\t\tdocumentHasTextSelection( doc ) ||\n\t\t( !! doc.activeElement &&\n\t\t\tinputFieldHasUncollapsedSelection( doc.activeElement ) )\n\t);\n}\n"]}
@@ -2,15 +2,19 @@
2
2
  * Internal dependencies
3
3
  */
4
4
  import isTextField from './is-text-field';
5
- import isNumberInput from './is-number-input';
5
+ import isHTMLInputElement from './is-html-input-element';
6
6
  /**
7
- * Check whether the given element, assumed an input field or textarea,
8
- * contains a (uncollapsed) selection of text.
7
+ * Check whether the given input field or textarea contains a (uncollapsed)
8
+ * selection of text.
9
9
  *
10
- * Note: this is perhaps an abuse of the term "selection", since these elements
11
- * manage selection differently and aren't covered by Selection#collapsed.
10
+ * CAVEAT: Only specific text-based HTML inputs support the selection APIs
11
+ * needed to determine whether they have a collapsed or uncollapsed selection.
12
+ * This function defaults to returning `true` when the selection cannot be
13
+ * inspected, such as with `<input type="time">`. The rationale is that this
14
+ * should cause the block editor to defer to the browser's native selection
15
+ * handling (e.g. copying and pasting), thereby reducing friction for the user.
12
16
  *
13
- * See: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects.
17
+ * See: https://html.spec.whatwg.org/multipage/input.html#do-not-apply
14
18
  *
15
19
  * @param {Element} element The HTML element.
16
20
  *
@@ -18,9 +22,12 @@ import isNumberInput from './is-number-input';
18
22
  */
19
23
 
20
24
  export default function inputFieldHasUncollapsedSelection(element) {
21
- if (!isTextField(element) && !isNumberInput(element)) {
25
+ if (!isHTMLInputElement(element) && !isTextField(element)) {
22
26
  return false;
23
- }
27
+ } // Safari throws a type error when trying to get `selectionStart` and
28
+ // `selectionEnd` on non-text <input> elements, so a try/catch construct is
29
+ // necessary.
30
+
24
31
 
25
32
  try {
26
33
  const {
@@ -29,17 +36,16 @@ export default function inputFieldHasUncollapsedSelection(element) {
29
36
  } =
30
37
  /** @type {HTMLInputElement | HTMLTextAreaElement} */
31
38
  element;
32
- return selectionStart !== null && selectionStart !== selectionEnd;
39
+ return (// `null` means the input type doesn't implement selection, thus we
40
+ // cannot determine whether the selection is collapsed, so we
41
+ // default to true.
42
+ selectionStart === null || // when not null, compare the two points
43
+ selectionStart !== selectionEnd
44
+ );
33
45
  } catch (error) {
34
- // Safari throws an exception when trying to get `selectionStart`
35
- // on non-text <input> elements (which, understandably, don't
36
- // have the text selection API). We catch this via a try/catch
37
- // block, as opposed to a more explicit check of the element's
38
- // input types, because of Safari's non-standard behavior. This
39
- // also means we don't have to worry about the list of input
40
- // types that support `selectionStart` changing as the HTML spec
41
- // evolves over time.
42
- return false;
46
+ // This is Safari's way of saying that the input type doesn't implement
47
+ // selection, so we default to true.
48
+ return true;
43
49
  }
44
50
  }
45
51
  //# sourceMappingURL=input-field-has-uncollapsed-selection.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/input-field-has-uncollapsed-selection.js"],"names":["isTextField","isNumberInput","inputFieldHasUncollapsedSelection","element","selectionStart","selectionEnd","error"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,WAAP,MAAwB,iBAAxB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,iCAAT,CAA4CC,OAA5C,EAAsD;AACpE,MAAK,CAAEH,WAAW,CAAEG,OAAF,CAAb,IAA4B,CAAEF,aAAa,CAAEE,OAAF,CAAhD,EAA8D;AAC7D,WAAO,KAAP;AACA;;AACD,MAAI;AACH,UAAM;AACLC,MAAAA,cADK;AAELC,MAAAA;AAFK;AAGF;AAAwDF,IAAAA,OAH5D;AAKA,WAAOC,cAAc,KAAK,IAAnB,IAA2BA,cAAc,KAAKC,YAArD;AACA,GAPD,CAOE,OAAQC,KAAR,EAAgB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAO,KAAP;AACA;AACD","sourcesContent":["/**\n * Internal dependencies\n */\nimport isTextField from './is-text-field';\nimport isNumberInput from './is-number-input';\n\n/**\n * Check whether the given element, assumed an input field or textarea,\n * contains a (uncollapsed) selection of text.\n *\n * Note: this is perhaps an abuse of the term \"selection\", since these elements\n * manage selection differently and aren't covered by Selection#collapsed.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects.\n *\n * @param {Element} element The HTML element.\n *\n * @return {boolean} Whether the input/textareaa element has some \"selection\".\n */\nexport default function inputFieldHasUncollapsedSelection( element ) {\n\tif ( ! isTextField( element ) && ! isNumberInput( element ) ) {\n\t\treturn false;\n\t}\n\ttry {\n\t\tconst {\n\t\t\tselectionStart,\n\t\t\tselectionEnd,\n\t\t} = /** @type {HTMLInputElement | HTMLTextAreaElement} */ ( element );\n\n\t\treturn selectionStart !== null && selectionStart !== selectionEnd;\n\t} catch ( error ) {\n\t\t// Safari throws an exception when trying to get `selectionStart`\n\t\t// on non-text <input> elements (which, understandably, don't\n\t\t// have the text selection API). We catch this via a try/catch\n\t\t// block, as opposed to a more explicit check of the element's\n\t\t// input types, because of Safari's non-standard behavior. This\n\t\t// also means we don't have to worry about the list of input\n\t\t// types that support `selectionStart` changing as the HTML spec\n\t\t// evolves over time.\n\t\treturn false;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/dom/src/dom/input-field-has-uncollapsed-selection.js"],"names":["isTextField","isHTMLInputElement","inputFieldHasUncollapsedSelection","element","selectionStart","selectionEnd","error"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,WAAP,MAAwB,iBAAxB;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,iCAAT,CAA4CC,OAA5C,EAAsD;AACpE,MAAK,CAAEF,kBAAkB,CAAEE,OAAF,CAApB,IAAmC,CAAEH,WAAW,CAAEG,OAAF,CAArD,EAAmE;AAClE,WAAO,KAAP;AACA,GAHmE,CAKpE;AACA;AACA;;;AACA,MAAI;AACH,UAAM;AACLC,MAAAA,cADK;AAELC,MAAAA;AAFK;AAGF;AAAwDF,IAAAA,OAH5D;AAIA,WACC;AACA;AACA;AACAC,MAAAA,cAAc,KAAK,IAAnB,IACA;AACAA,MAAAA,cAAc,KAAKC;AANpB;AAQA,GAbD,CAaE,OAAQC,KAAR,EAAgB;AACjB;AACA;AACA,WAAO,IAAP;AACA;AACD","sourcesContent":["/**\n * Internal dependencies\n */\nimport isTextField from './is-text-field';\nimport isHTMLInputElement from './is-html-input-element';\n\n/**\n * Check whether the given input field or textarea contains a (uncollapsed)\n * selection of text.\n *\n * CAVEAT: Only specific text-based HTML inputs support the selection APIs\n * needed to determine whether they have a collapsed or uncollapsed selection.\n * This function defaults to returning `true` when the selection cannot be\n * inspected, such as with `<input type=\"time\">`. The rationale is that this\n * should cause the block editor to defer to the browser's native selection\n * handling (e.g. copying and pasting), thereby reducing friction for the user.\n *\n * See: https://html.spec.whatwg.org/multipage/input.html#do-not-apply\n *\n * @param {Element} element The HTML element.\n *\n * @return {boolean} Whether the input/textareaa element has some \"selection\".\n */\nexport default function inputFieldHasUncollapsedSelection( element ) {\n\tif ( ! isHTMLInputElement( element ) && ! isTextField( element ) ) {\n\t\treturn false;\n\t}\n\n\t// Safari throws a type error when trying to get `selectionStart` and\n\t// `selectionEnd` on non-text <input> elements, so a try/catch construct is\n\t// necessary.\n\ttry {\n\t\tconst {\n\t\t\tselectionStart,\n\t\t\tselectionEnd,\n\t\t} = /** @type {HTMLInputElement | HTMLTextAreaElement} */ ( element );\n\t\treturn (\n\t\t\t// `null` means the input type doesn't implement selection, thus we\n\t\t\t// cannot determine whether the selection is collapsed, so we\n\t\t\t// default to true.\n\t\t\tselectionStart === null ||\n\t\t\t// when not null, compare the two points\n\t\t\tselectionStart !== selectionEnd\n\t\t);\n\t} catch ( error ) {\n\t\t// This is Safari's way of saying that the input type doesn't implement\n\t\t// selection, so we default to true.\n\t\treturn true;\n\t}\n}\n"]}
@@ -6,6 +6,6 @@
6
6
  */
7
7
  export default function isHTMLInputElement(node) {
8
8
  /* eslint-enable jsdoc/valid-types */
9
- return !!node && node.nodeName === 'INPUT';
9
+ return (node === null || node === void 0 ? void 0 : node.nodeName) === 'INPUT';
10
10
  }
11
11
  //# sourceMappingURL=is-html-input-element.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-html-input-element.js"],"names":["isHTMLInputElement","node","nodeName"],"mappings":"AAAA;;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,kBAAT,CAA6BC,IAA7B,EAAoC;AAClD;AACA,SAAO,CAAC,CAAEA,IAAH,IAAWA,IAAI,CAACC,QAAL,KAAkB,OAApC;AACA","sourcesContent":["/* eslint-disable jsdoc/valid-types */\n/**\n * @param {Node} node\n * @return {node is HTMLInputElement} Whether the node is an HTMLInputElement.\n */\nexport default function isHTMLInputElement( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\treturn !! node && node.nodeName === 'INPUT';\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/dom/src/dom/is-html-input-element.js"],"names":["isHTMLInputElement","node","nodeName"],"mappings":"AAAA;;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,kBAAT,CAA6BC,IAA7B,EAAoC;AAClD;AACA,SAAO,CAAAA,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEC,QAAN,MAAmB,OAA1B;AACA","sourcesContent":["/* eslint-disable jsdoc/valid-types */\n/**\n * @param {Node} node\n * @return {node is HTMLInputElement} Whether the node is an HTMLInputElement.\n */\nexport default function isHTMLInputElement( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\treturn node?.nodeName === 'INPUT';\n}\n"]}
@@ -1,20 +1,29 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import deprecated from '@wordpress/deprecated';
1
5
  /**
2
6
  * Internal dependencies
3
7
  */
8
+
4
9
  import isHTMLInputElement from './is-html-input-element';
5
10
  /* eslint-disable jsdoc/valid-types */
6
11
 
7
12
  /**
8
- * Check whether the given element is an input field of type number
9
- * and has a valueAsNumber
13
+ * Check whether the given element is an input field of type number.
10
14
  *
11
15
  * @param {Node} node The HTML node.
12
16
  *
13
- * @return {node is HTMLInputElement} True if the node is input and holds a number.
17
+ * @return {node is HTMLInputElement} True if the node is number input.
14
18
  */
15
19
 
16
20
  export default function isNumberInput(node) {
21
+ deprecated('wp.dom.isNumberInput', {
22
+ since: '6.1',
23
+ version: '6.5'
24
+ });
17
25
  /* eslint-enable jsdoc/valid-types */
18
- return isHTMLInputElement(node) && node.type === 'number' && !!node.valueAsNumber;
26
+
27
+ return isHTMLInputElement(node) && node.type === 'number' && !isNaN(node.valueAsNumber);
19
28
  }
20
29
  //# sourceMappingURL=is-number-input.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-number-input.js"],"names":["isHTMLInputElement","isNumberInput","node","type","valueAsNumber"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,kBAAP,MAA+B,yBAA/B;AAEA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,aAAT,CAAwBC,IAAxB,EAA+B;AAC7C;AACA,SACCF,kBAAkB,CAAEE,IAAF,CAAlB,IACAA,IAAI,CAACC,IAAL,KAAc,QADd,IAEA,CAAC,CAAED,IAAI,CAACE,aAHT;AAKA","sourcesContent":["/**\n * Internal dependencies\n */\nimport isHTMLInputElement from './is-html-input-element';\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Check whether the given element is an input field of type number\n * and has a valueAsNumber\n *\n * @param {Node} node The HTML node.\n *\n * @return {node is HTMLInputElement} True if the node is input and holds a number.\n */\nexport default function isNumberInput( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\treturn (\n\t\tisHTMLInputElement( node ) &&\n\t\tnode.type === 'number' &&\n\t\t!! node.valueAsNumber\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/dom/src/dom/is-number-input.js"],"names":["deprecated","isHTMLInputElement","isNumberInput","node","since","version","type","isNaN","valueAsNumber"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,uBAAvB;AAEA;AACA;AACA;;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AAEA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,aAAT,CAAwBC,IAAxB,EAA+B;AAC7CH,EAAAA,UAAU,CAAE,sBAAF,EAA0B;AACnCI,IAAAA,KAAK,EAAE,KAD4B;AAEnCC,IAAAA,OAAO,EAAE;AAF0B,GAA1B,CAAV;AAIA;;AACA,SACCJ,kBAAkB,CAAEE,IAAF,CAAlB,IACAA,IAAI,CAACG,IAAL,KAAc,QADd,IAEA,CAAEC,KAAK,CAAEJ,IAAI,CAACK,aAAP,CAHR;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport isHTMLInputElement from './is-html-input-element';\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Check whether the given element is an input field of type number.\n *\n * @param {Node} node The HTML node.\n *\n * @return {node is HTMLInputElement} True if the node is number input.\n */\nexport default function isNumberInput( node ) {\n\tdeprecated( 'wp.dom.isNumberInput', {\n\t\tsince: '6.1',\n\t\tversion: '6.5',\n\t} );\n\t/* eslint-enable jsdoc/valid-types */\n\treturn (\n\t\tisHTMLInputElement( node ) &&\n\t\tnode.type === 'number' &&\n\t\t! isNaN( node.valueAsNumber )\n\t);\n}\n"]}
@@ -16,7 +16,7 @@ import isHTMLInputElement from './is-html-input-element';
16
16
 
17
17
  export default function isTextField(node) {
18
18
  /* eslint-enable jsdoc/valid-types */
19
- const nonTextInputs = ['button', 'checkbox', 'hidden', 'file', 'radio', 'image', 'range', 'reset', 'submit', 'number'];
19
+ const nonTextInputs = ['button', 'checkbox', 'hidden', 'file', 'radio', 'image', 'range', 'reset', 'submit', 'number', 'email', 'time'];
20
20
  return isHTMLInputElement(node) && node.type && !nonTextInputs.includes(node.type) || node.nodeName === 'TEXTAREA' ||
21
21
  /** @type {HTMLElement} */
22
22
  node.contentEditable === 'true';
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-text-field.js"],"names":["isHTMLInputElement","isTextField","node","nonTextInputs","type","includes","nodeName","contentEditable"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,kBAAP,MAA+B,yBAA/B;AAEA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,WAAT,CAAsBC,IAAtB,EAA6B;AAC3C;AACA,QAAMC,aAAa,GAAG,CACrB,QADqB,EAErB,UAFqB,EAGrB,QAHqB,EAIrB,MAJqB,EAKrB,OALqB,EAMrB,OANqB,EAOrB,OAPqB,EAQrB,OARqB,EASrB,QATqB,EAUrB,QAVqB,CAAtB;AAYA,SACGH,kBAAkB,CAAEE,IAAF,CAAlB,IACDA,IAAI,CAACE,IADJ,IAED,CAAED,aAAa,CAACE,QAAd,CAAwBH,IAAI,CAACE,IAA7B,CAFH,IAGAF,IAAI,CAACI,QAAL,KAAkB,UAHlB;AAIA;AAA6BJ,EAAAA,IAAF,CAASK,eAAT,KAA6B,MALzD;AAOA","sourcesContent":["/**\n * Internal dependencies\n */\nimport isHTMLInputElement from './is-html-input-element';\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Check whether the given element is a text field, where text field is defined\n * by the ability to select within the input, or that it is contenteditable.\n *\n * See: https://html.spec.whatwg.org/#textFieldSelection\n *\n * @param {Node} node The HTML element.\n * @return {node is HTMLElement} True if the element is an text field, false if not.\n */\nexport default function isTextField( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\tconst nonTextInputs = [\n\t\t'button',\n\t\t'checkbox',\n\t\t'hidden',\n\t\t'file',\n\t\t'radio',\n\t\t'image',\n\t\t'range',\n\t\t'reset',\n\t\t'submit',\n\t\t'number',\n\t];\n\treturn (\n\t\t( isHTMLInputElement( node ) &&\n\t\t\tnode.type &&\n\t\t\t! nonTextInputs.includes( node.type ) ) ||\n\t\tnode.nodeName === 'TEXTAREA' ||\n\t\t/** @type {HTMLElement} */ ( node ).contentEditable === 'true'\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/dom/src/dom/is-text-field.js"],"names":["isHTMLInputElement","isTextField","node","nonTextInputs","type","includes","nodeName","contentEditable"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,kBAAP,MAA+B,yBAA/B;AAEA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,WAAT,CAAsBC,IAAtB,EAA6B;AAC3C;AACA,QAAMC,aAAa,GAAG,CACrB,QADqB,EAErB,UAFqB,EAGrB,QAHqB,EAIrB,MAJqB,EAKrB,OALqB,EAMrB,OANqB,EAOrB,OAPqB,EAQrB,OARqB,EASrB,QATqB,EAUrB,QAVqB,EAWrB,OAXqB,EAYrB,MAZqB,CAAtB;AAcA,SACGH,kBAAkB,CAAEE,IAAF,CAAlB,IACDA,IAAI,CAACE,IADJ,IAED,CAAED,aAAa,CAACE,QAAd,CAAwBH,IAAI,CAACE,IAA7B,CAFH,IAGAF,IAAI,CAACI,QAAL,KAAkB,UAHlB;AAIA;AAA6BJ,EAAAA,IAAF,CAASK,eAAT,KAA6B,MALzD;AAOA","sourcesContent":["/**\n * Internal dependencies\n */\nimport isHTMLInputElement from './is-html-input-element';\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Check whether the given element is a text field, where text field is defined\n * by the ability to select within the input, or that it is contenteditable.\n *\n * See: https://html.spec.whatwg.org/#textFieldSelection\n *\n * @param {Node} node The HTML element.\n * @return {node is HTMLElement} True if the element is an text field, false if not.\n */\nexport default function isTextField( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\tconst nonTextInputs = [\n\t\t'button',\n\t\t'checkbox',\n\t\t'hidden',\n\t\t'file',\n\t\t'radio',\n\t\t'image',\n\t\t'range',\n\t\t'reset',\n\t\t'submit',\n\t\t'number',\n\t\t'email',\n\t\t'time',\n\t];\n\treturn (\n\t\t( isHTMLInputElement( node ) &&\n\t\t\tnode.type &&\n\t\t\t! nonTextInputs.includes( node.type ) ) ||\n\t\tnode.nodeName === 'TEXTAREA' ||\n\t\t/** @type {HTMLElement} */ ( node ).contentEditable === 'true'\n\t);\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Check whether the current document has a selection. This checks for both
3
- * focus in an input field and general text selection.
2
+ * Check whether the current document has a selection. This includes focus in
3
+ * input fields, textareas, and general rich-text selection.
4
4
  *
5
5
  * @param {Document} doc The document to check.
6
6
  *
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Check whether the current document has any sort of selection. This includes
3
- * ranges of text across elements and any selection inside `<input>` and
4
- * `<textarea>` elements.
2
+ * Check whether the current document has any sort of (uncollapsed) selection.
3
+ * This includes ranges of text across elements and any selection inside
4
+ * textual `<input>` and `<textarea>` elements.
5
5
  *
6
6
  * @param {Document} doc The document to check.
7
7
  *
8
- * @return {boolean} Whether there is any sort of "selection" in the document.
8
+ * @return {boolean} Whether there is any recognizable text selection in the document.
9
9
  */
10
10
  export default function documentHasUncollapsedSelection(doc: Document): boolean;
11
11
  //# sourceMappingURL=document-has-uncollapsed-selection.d.ts.map
@@ -1,11 +1,15 @@
1
1
  /**
2
- * Check whether the given element, assumed an input field or textarea,
3
- * contains a (uncollapsed) selection of text.
2
+ * Check whether the given input field or textarea contains a (uncollapsed)
3
+ * selection of text.
4
4
  *
5
- * Note: this is perhaps an abuse of the term "selection", since these elements
6
- * manage selection differently and aren't covered by Selection#collapsed.
5
+ * CAVEAT: Only specific text-based HTML inputs support the selection APIs
6
+ * needed to determine whether they have a collapsed or uncollapsed selection.
7
+ * This function defaults to returning `true` when the selection cannot be
8
+ * inspected, such as with `<input type="time">`. The rationale is that this
9
+ * should cause the block editor to defer to the browser's native selection
10
+ * handling (e.g. copying and pasting), thereby reducing friction for the user.
7
11
  *
8
- * See: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects.
12
+ * See: https://html.spec.whatwg.org/multipage/input.html#do-not-apply
9
13
  *
10
14
  * @param {Element} element The HTML element.
11
15
  *
@@ -1 +1 @@
1
- {"version":3,"file":"input-field-has-uncollapsed-selection.d.ts","sourceRoot":"","sources":["../../src/dom/input-field-has-uncollapsed-selection.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;GAYG;AACH,mEAJW,OAAO,GAEN,OAAO,CAwBlB"}
1
+ {"version":3,"file":"input-field-has-uncollapsed-selection.d.ts","sourceRoot":"","sources":["../../src/dom/input-field-has-uncollapsed-selection.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;GAgBG;AACH,mEAJW,OAAO,GAEN,OAAO,CA4BlB"}
@@ -1,10 +1,9 @@
1
1
  /**
2
- * Check whether the given element is an input field of type number
3
- * and has a valueAsNumber
2
+ * Check whether the given element is an input field of type number.
4
3
  *
5
4
  * @param {Node} node The HTML node.
6
5
  *
7
- * @return {node is HTMLInputElement} True if the node is input and holds a number.
6
+ * @return {node is HTMLInputElement} True if the node is number input.
8
7
  */
9
8
  export default function isNumberInput(node: Node): node is HTMLInputElement;
10
9
  //# sourceMappingURL=is-number-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-number-input.d.ts","sourceRoot":"","sources":["../../src/dom/is-number-input.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,4CAJW,IAAI,4BAWd"}
1
+ {"version":3,"file":"is-number-input.d.ts","sourceRoot":"","sources":["../../src/dom/is-number-input.js"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,4CAJW,IAAI,4BAed"}
@@ -1 +1 @@
1
- {"version":3,"file":"is-text-field.d.ts","sourceRoot":"","sources":["../../src/dom/is-text-field.js"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,0CAHW,IAAI,uBAwBd"}
1
+ {"version":3,"file":"is-text-field.d.ts","sourceRoot":"","sources":["../../src/dom/is-text-field.js"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,0CAHW,IAAI,uBA0Bd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/dom",
3
- "version": "3.7.0",
3
+ "version": "3.10.0",
4
4
  "description": "DOM utilities module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -29,10 +29,11 @@
29
29
  "sideEffects": false,
30
30
  "dependencies": {
31
31
  "@babel/runtime": "^7.16.0",
32
+ "@wordpress/deprecated": "^3.8.0",
32
33
  "lodash": "^4.17.21"
33
34
  },
34
35
  "publishConfig": {
35
36
  "access": "public"
36
37
  },
37
- "gitHead": "1ba52312b56db563df2d8d4fba5b00613fb46d8c"
38
+ "gitHead": "a3e0b62091e8a8bdf5e2518e42d60d7098af48cc"
38
39
  }
@@ -2,12 +2,12 @@
2
2
  * Internal dependencies
3
3
  */
4
4
  import isTextField from './is-text-field';
5
- import isNumberInput from './is-number-input';
5
+ import isHTMLInputElement from './is-html-input-element';
6
6
  import documentHasTextSelection from './document-has-text-selection';
7
7
 
8
8
  /**
9
- * Check whether the current document has a selection. This checks for both
10
- * focus in an input field and general text selection.
9
+ * Check whether the current document has a selection. This includes focus in
10
+ * input fields, textareas, and general rich-text selection.
11
11
  *
12
12
  * @param {Document} doc The document to check.
13
13
  *
@@ -16,8 +16,8 @@ import documentHasTextSelection from './document-has-text-selection';
16
16
  export default function documentHasSelection( doc ) {
17
17
  return (
18
18
  !! doc.activeElement &&
19
- ( isTextField( doc.activeElement ) ||
20
- isNumberInput( doc.activeElement ) ||
19
+ ( isHTMLInputElement( doc.activeElement ) ||
20
+ isTextField( doc.activeElement ) ||
21
21
  documentHasTextSelection( doc ) )
22
22
  );
23
23
  }
@@ -5,13 +5,13 @@ import documentHasTextSelection from './document-has-text-selection';
5
5
  import inputFieldHasUncollapsedSelection from './input-field-has-uncollapsed-selection';
6
6
 
7
7
  /**
8
- * Check whether the current document has any sort of selection. This includes
9
- * ranges of text across elements and any selection inside `<input>` and
10
- * `<textarea>` elements.
8
+ * Check whether the current document has any sort of (uncollapsed) selection.
9
+ * This includes ranges of text across elements and any selection inside
10
+ * textual `<input>` and `<textarea>` elements.
11
11
  *
12
12
  * @param {Document} doc The document to check.
13
13
  *
14
- * @return {boolean} Whether there is any sort of "selection" in the document.
14
+ * @return {boolean} Whether there is any recognizable text selection in the document.
15
15
  */
16
16
  export default function documentHasUncollapsedSelection( doc ) {
17
17
  return (
@@ -2,41 +2,49 @@
2
2
  * Internal dependencies
3
3
  */
4
4
  import isTextField from './is-text-field';
5
- import isNumberInput from './is-number-input';
5
+ import isHTMLInputElement from './is-html-input-element';
6
6
 
7
7
  /**
8
- * Check whether the given element, assumed an input field or textarea,
9
- * contains a (uncollapsed) selection of text.
8
+ * Check whether the given input field or textarea contains a (uncollapsed)
9
+ * selection of text.
10
10
  *
11
- * Note: this is perhaps an abuse of the term "selection", since these elements
12
- * manage selection differently and aren't covered by Selection#collapsed.
11
+ * CAVEAT: Only specific text-based HTML inputs support the selection APIs
12
+ * needed to determine whether they have a collapsed or uncollapsed selection.
13
+ * This function defaults to returning `true` when the selection cannot be
14
+ * inspected, such as with `<input type="time">`. The rationale is that this
15
+ * should cause the block editor to defer to the browser's native selection
16
+ * handling (e.g. copying and pasting), thereby reducing friction for the user.
13
17
  *
14
- * See: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects.
18
+ * See: https://html.spec.whatwg.org/multipage/input.html#do-not-apply
15
19
  *
16
20
  * @param {Element} element The HTML element.
17
21
  *
18
22
  * @return {boolean} Whether the input/textareaa element has some "selection".
19
23
  */
20
24
  export default function inputFieldHasUncollapsedSelection( element ) {
21
- if ( ! isTextField( element ) && ! isNumberInput( element ) ) {
25
+ if ( ! isHTMLInputElement( element ) && ! isTextField( element ) ) {
22
26
  return false;
23
27
  }
28
+
29
+ // Safari throws a type error when trying to get `selectionStart` and
30
+ // `selectionEnd` on non-text <input> elements, so a try/catch construct is
31
+ // necessary.
24
32
  try {
25
33
  const {
26
34
  selectionStart,
27
35
  selectionEnd,
28
36
  } = /** @type {HTMLInputElement | HTMLTextAreaElement} */ ( element );
29
-
30
- return selectionStart !== null && selectionStart !== selectionEnd;
37
+ return (
38
+ // `null` means the input type doesn't implement selection, thus we
39
+ // cannot determine whether the selection is collapsed, so we
40
+ // default to true.
41
+ selectionStart === null ||
42
+ // when not null, compare the two points
43
+ selectionStart !== selectionEnd
44
+ );
31
45
  } catch ( error ) {
32
- // Safari throws an exception when trying to get `selectionStart`
33
- // on non-text <input> elements (which, understandably, don't
34
- // have the text selection API). We catch this via a try/catch
35
- // block, as opposed to a more explicit check of the element's
36
- // input types, because of Safari's non-standard behavior. This
37
- // also means we don't have to worry about the list of input
38
- // types that support `selectionStart` changing as the HTML spec
39
- // evolves over time.
40
- return false;
46
+ // This is Safari's way of saying that the input type doesn't implement
47
+ // selection, so we default to true.
48
+ return true;
41
49
  }
42
50
  }
@@ -5,5 +5,5 @@
5
5
  */
6
6
  export default function isHTMLInputElement( node ) {
7
7
  /* eslint-enable jsdoc/valid-types */
8
- return !! node && node.nodeName === 'INPUT';
8
+ return node?.nodeName === 'INPUT';
9
9
  }
@@ -1,3 +1,8 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import deprecated from '@wordpress/deprecated';
5
+
1
6
  /**
2
7
  * Internal dependencies
3
8
  */
@@ -5,18 +10,21 @@ import isHTMLInputElement from './is-html-input-element';
5
10
 
6
11
  /* eslint-disable jsdoc/valid-types */
7
12
  /**
8
- * Check whether the given element is an input field of type number
9
- * and has a valueAsNumber
13
+ * Check whether the given element is an input field of type number.
10
14
  *
11
15
  * @param {Node} node The HTML node.
12
16
  *
13
- * @return {node is HTMLInputElement} True if the node is input and holds a number.
17
+ * @return {node is HTMLInputElement} True if the node is number input.
14
18
  */
15
19
  export default function isNumberInput( node ) {
20
+ deprecated( 'wp.dom.isNumberInput', {
21
+ since: '6.1',
22
+ version: '6.5',
23
+ } );
16
24
  /* eslint-enable jsdoc/valid-types */
17
25
  return (
18
26
  isHTMLInputElement( node ) &&
19
27
  node.type === 'number' &&
20
- !! node.valueAsNumber
28
+ ! isNaN( node.valueAsNumber )
21
29
  );
22
30
  }
@@ -26,6 +26,8 @@ export default function isTextField( node ) {
26
26
  'reset',
27
27
  'submit',
28
28
  'number',
29
+ 'email',
30
+ 'time',
29
31
  ];
30
32
  return (
31
33
  ( isHTMLInputElement( node ) &&
package/src/test/dom.js CHANGED
@@ -5,7 +5,6 @@ import {
5
5
  isHorizontalEdge,
6
6
  placeCaretAtHorizontalEdge,
7
7
  isTextField,
8
- isNumberInput,
9
8
  removeInvalidHTML,
10
9
  isEmpty,
11
10
  } from '../dom';
@@ -125,6 +124,8 @@ describe( 'DOM', () => {
125
124
  'range',
126
125
  'reset',
127
126
  'submit',
127
+ 'email',
128
+ 'time',
128
129
  ];
129
130
 
130
131
  /**
@@ -132,13 +133,7 @@ describe( 'DOM', () => {
132
133
  *
133
134
  * @type {string[]}
134
135
  */
135
- const TEXT_INPUT_TYPES = [
136
- 'text',
137
- 'password',
138
- 'search',
139
- 'url',
140
- 'email',
141
- ];
136
+ const TEXT_INPUT_TYPES = [ 'text', 'password', 'search', 'url' ];
142
137
 
143
138
  it( 'should return false for non-text input elements', () => {
144
139
  NON_TEXT_INPUT_TYPES.forEach( ( type ) => {
@@ -164,21 +159,6 @@ describe( 'DOM', () => {
164
159
  );
165
160
  } );
166
161
 
167
- it( 'should return false for empty input element of type number', () => {
168
- const input = document.createElement( 'input' );
169
- input.type = 'number';
170
-
171
- expect( isNumberInput( input ) ).toBe( false );
172
- } );
173
-
174
- it( 'should return true for an input element of type number', () => {
175
- const input = document.createElement( 'input' );
176
- input.type = 'number';
177
- input.valueAsNumber = 23;
178
-
179
- expect( isNumberInput( input ) ).toBe( true );
180
- } );
181
-
182
162
  it( 'should return true for a contenteditable element', () => {
183
163
  const div = document.createElement( 'div' );
184
164
 
package/tsconfig.json CHANGED
@@ -5,7 +5,5 @@
5
5
  "declarationDir": "build-types",
6
6
  "types": [ "gutenberg-env" ]
7
7
  },
8
- "include": [
9
- "src/**/*"
10
- ]
8
+ "include": [ "src/**/*" ]
11
9
  }
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","./src/data-transfer.js","./src/focusable.js","../../node_modules/@types/lodash/common/common.d.ts","../../node_modules/@types/lodash/common/array.d.ts","../../node_modules/@types/lodash/common/collection.d.ts","../../node_modules/@types/lodash/common/date.d.ts","../../node_modules/@types/lodash/common/function.d.ts","../../node_modules/@types/lodash/common/lang.d.ts","../../node_modules/@types/lodash/common/math.d.ts","../../node_modules/@types/lodash/common/number.d.ts","../../node_modules/@types/lodash/common/object.d.ts","../../node_modules/@types/lodash/common/seq.d.ts","../../node_modules/@types/lodash/common/string.d.ts","../../node_modules/@types/lodash/common/util.d.ts","../../node_modules/@types/lodash/index.d.ts","./src/tabbable.js","./src/utils/assert-is-defined.ts","./src/dom/get-rectangle-from-range.js","./src/dom/compute-caret-rect.js","./src/dom/document-has-text-selection.js","./src/dom/is-html-input-element.js","./src/dom/is-text-field.js","./src/dom/is-number-input.js","./src/dom/input-field-has-uncollapsed-selection.js","./src/dom/document-has-uncollapsed-selection.js","./src/dom/document-has-selection.js","./src/dom/get-computed-style.js","./src/dom/get-scroll-container.js","./src/dom/get-offset-parent.js","./src/dom/is-input-or-text-area.js","./src/dom/is-entirely-selected.js","./src/dom/is-form-element.js","./src/dom/is-rtl.js","./src/dom/get-range-height.js","./src/dom/is-selection-forward.js","./src/dom/caret-range-from-point.js","./src/dom/hidden-caret-range-from-point.js","./src/dom/is-edge.js","./src/dom/is-horizontal-edge.js","./src/dom/is-vertical-edge.js","./src/dom/place-caret-at-edge.js","./src/dom/place-caret-at-horizontal-edge.js","./src/dom/place-caret-at-vertical-edge.js","./src/dom/insert-after.js","./src/dom/remove.js","./src/dom/replace.js","./src/dom/unwrap.js","./src/dom/replace-tag.js","./src/dom/wrap.js","./src/dom/safe-html.js","./src/dom/strip-html.js","./src/dom/is-empty.js","./src/phrasing-content.js","./src/dom/is-element.js","./src/dom/clean-node-list.js","./src/dom/remove-invalid-html.js","./src/dom/index.js","./src/index.js","../../typings/gutenberg-env/index.d.ts"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"80d2e2a2e1685c82cba3c320f5d077376fadff77fe1f52a4c29f995bdc40ea70","0ca9a18ed362f11af31b31312d27380b605653eb7d9b005abc7ce9af29e6c545","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","438284c7c455a29b9c0e2d1e72abc62ee93d9a163029ffe918a34c5db3b92da2","0c75b204aed9cf6ff1c7b4bed87a3ece0d9d6fc857a6350c0c95ed0c38c814e8","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","82251920b05f30981c9a4109cb5f3169dce4b477effc845c6d781044a30e7672","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","9fa6b83a35e897f340858995ca5d77e901d89fd18644cd4c9e8a4afe0b2e6363",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"05ea0a0b2298c74e7d48012e1362258edccc3c90858e7bf2e9cfa9135298a4e8","a7836408f857cb8855443e0ff79d3ed7027415dca85f312c5f9f47daa6cd355d","60c4ae06adc3b6c7e1bbde496c9e2ff9bf3ff2f811675b7a897d460d2b7b814a","99546def4f9cd760e5ee13c0cce45c83aaa3d5474d75cef79c34b1990a808022","1caa056d021a35691778948dcb48eb6f7550110ea33c0d14c03f0445daa93559","7d41e8f297df3090da557100eb1cd95013d2cff0277cef6848d389660ed607af","08129a92bea6c56eb44b6978842a1613e267a0100f6e96c36bcfc05128ce7610","2daaade587180e90e650acf824330ddbed8239f5439e84520d9f00d3fa7eeed6","4ef4710028ee537bc9a325373707d5a1ce077b6af13346764746192704363d9b","906baf292735856969c78c000c2b26d993079f4632247d0b1fc66b95a369ab0d","8c6fad120d4f0e25311b2ac81d8677fc4ceecdc92a7d03865734bf961c5d587e","dea4257186ad318062499e0aff7122433b1081b7883e95ef78d9b4121fc8e7da","e07d9c569b874918d96c737cc6265494127010a65db231160e46da999db6cd83","f5b932cd4c47954ecb9c5010d848afe821486d5785a3c1c81e670146f4245688","4d31f8f7e9d8a43d2fd3c5a378e390080706392dd4d1541fc6b6f876ed961cf4","756cc95fd142eb928ba7bd366cc2756a902d8a1219182a45a2820e86702b1f3e","df45136f01235aaaaa952d0cc2508bf2e1747157225773bd238a7e65e927fd06","4312fd698114e973469529ec29680789e8ce13ffddcf711a8660c85e522b4069","cb412dab570deef76d26e0c5759e3fbe12625947ac6a82037573c788b7a2d1a4","59fbe797b38f7f549100d38fc9a4c6cd0f4b990407700f5e1979a54c9d8e3ed6","e8be8e4d18f330bdd294cdbe7d3c4a89e8dca65585284745a25c515ecb69249f","8b692a361fc9f2d4102106f168b35cf6f30c9efc66050108001955a1a59b4fd2","59ac58f0ebf648d5e38b01df0cfd02700d475ff8367c3f4695d3632e3db3416b","6199e013116305fa2d162835ad812abfe210076e1249852851c5a80a753f4f3d","ba688a4815abd9d27b425a819def1721b61e1798acc748b471e54d50a7804bcd","c6684892ae32c0d3fe0c2bb1b7e6bb37ffc86fc91d39c0cfe557aba4816e7766","609b8944af1aa9b73959c0bd766370986176a197c16c27e365e867a0bc85eed8","2ffc9898fdf8f285b73f08ee256ca9a6f20cf3de25c57dd7aa28f7558d3af624","0fb6bab9bd95185809964d513dcfeeab6b5609d280dcc6291b5277e36998afe1","2d18411640dd8fcf1067392b839136628cafef5a648d0d49dc9da2f7d344046e","57597a1e8735ae08b671194c8b64a2c2831fd6ce2793d1bca705dbceb41bdaae","fc9b503ac41bf643bdd2c5bcf21e7e8c052881dd6b94699e3624f3a60e02b0be","665d3d55e94122f2fe1c2dd78dd61774134151557a3b8dd41d49868a642c1277","2259073e3a0fcbd5d873f90465ad8364007668a97c0291a6b6d7975d8edbe30d","02959309d4b7d9a875c4f175abae0a359a074585513d073d1fbb828b704e5663","d0472eb54f481ef265c3407b31df68485efda04e40cc8a7238c8dbdaf93fe81b","70388aac7550e4cb19e9eb5aafba7ed3333fbae173f0d377643f5fa733317ae9","5620e210666cc9ff9409e6b18b23bdfbfd3edfa21a6b12ac28f48933842396b7","0d0dd5ae0237a3571383b9ac701d40220e1d963d0bbb22473c336225b2ed44a7","1e5577dfce1e114e9dc58a7199bdb9e359b30deb86d29a9f0a0b111fc8d29943","dcc4b56e334bd6f9a8680a5dd343e417cdb03bae06bdc4786211d2cdfd7899e8","acbe60d616549a3815593f33a7a34faf0b0d063257c74f3b01bfc20dae42652e","0af026de3ab75c99339016a7aa606da158668df7cfc0c25668c1d1617323da20",{"version":"f254c1abf6bb4c92633159831f924588908da902aa5e04ae45c39bd001f62e2e","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[47,49,50,51,52,53,54,55,56,57,58,59],[47,48,50,51,52,53,54,55,56,57,58,59],[48,49,50,51,52,53,54,55,56,57,58,59],[47,48,49,51,52,53,54,55,56,57,58,59],[47,48,49,50,52,53,54,55,56,57,58,59],[47,48,49,50,51,53,54,55,56,57,58,59],[47,48,49,50,51,52,54,55,56,57,58,59],[47,48,49,50,51,52,53,55,56,57,58,59],[47,48,49,50,51,52,53,54,56,57,58,59],[47,48,49,50,51,52,53,54,55,57,58,59],[47,48,49,50,51,52,53,54,55,56,58,59],[47,48,49,50,51,52,53,54,55,56,57,59],[47,48,49,50,51,52,53,54,55,56,57,58],[59,88,89,91,96,97,98],[61,62],[64,66,67],[61],[64,68],[71],[71,80],[62,63,64,66,67,69,70,72,73,75,76,77,83,84,86,87,88,89,90,91,92,93,94,95,96,100],[66,67],[61,62,74,77,78,79,81],[61,74],[74],[82],[65],[61,74,77,81],[85],[99],[61,88,89],[89],[94],[45,46,60,97,101],[59],[46,59]],"referencedMap":[[48,1],[49,2],[47,3],[50,4],[51,5],[52,6],[53,7],[54,8],[55,9],[56,10],[57,11],[58,12],[59,13],[99,14],[63,15],[70,16],[64,17],[69,18],[71,17],[73,19],[62,17],[72,19],[81,20],[101,21],[68,22],[88,17],[82,23],[75,24],[76,25],[83,26],[67,27],[77,19],[79,17],[66,27],[84,26],[85,28],[86,29],[87,29],[100,30],[89,17],[92,17],[90,31],[94,32],[95,33],[91,17],[93,17],[102,34],[97,35],[60,36]],"exportedModulesMap":[[48,1],[49,2],[47,3],[50,4],[51,5],[52,6],[53,7],[54,8],[55,9],[56,10],[57,11],[58,12],[59,13],[99,14],[63,15],[70,16],[64,17],[69,18],[71,17],[73,19],[62,17],[72,19],[81,20],[101,21],[68,22],[88,17],[82,23],[75,24],[76,25],[83,26],[67,27],[77,19],[79,17],[66,27],[84,26],[85,28],[86,29],[87,29],[100,30],[89,17],[92,17],[90,31],[94,32],[95,33],[91,17],[93,17],[102,34],[97,35],[60,36]],"semanticDiagnosticsPerFile":[48,49,47,50,51,52,53,54,55,56,57,58,59,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,45,80,99,63,70,64,69,71,73,78,62,72,81,101,68,88,82,98,96,75,76,83,65,74,67,77,79,66,84,85,86,87,100,89,92,90,94,95,91,93,46,102,97,60,61,103]},"version":"4.4.2"}
1
+ {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","./src/data-transfer.js","./src/focusable.js","../../node_modules/@types/lodash/common/common.d.ts","../../node_modules/@types/lodash/common/array.d.ts","../../node_modules/@types/lodash/common/collection.d.ts","../../node_modules/@types/lodash/common/date.d.ts","../../node_modules/@types/lodash/common/function.d.ts","../../node_modules/@types/lodash/common/lang.d.ts","../../node_modules/@types/lodash/common/math.d.ts","../../node_modules/@types/lodash/common/number.d.ts","../../node_modules/@types/lodash/common/object.d.ts","../../node_modules/@types/lodash/common/seq.d.ts","../../node_modules/@types/lodash/common/string.d.ts","../../node_modules/@types/lodash/common/util.d.ts","../../node_modules/@types/lodash/index.d.ts","./src/tabbable.js","./src/utils/assert-is-defined.ts","./src/dom/get-rectangle-from-range.js","./src/dom/compute-caret-rect.js","./src/dom/document-has-text-selection.js","./src/dom/is-html-input-element.js","./src/dom/is-text-field.js","./src/dom/input-field-has-uncollapsed-selection.js","./src/dom/document-has-uncollapsed-selection.js","./src/dom/document-has-selection.js","./src/dom/get-computed-style.js","./src/dom/get-scroll-container.js","./src/dom/get-offset-parent.js","./src/dom/is-input-or-text-area.js","./src/dom/is-entirely-selected.js","./src/dom/is-form-element.js","./src/dom/is-rtl.js","./src/dom/get-range-height.js","./src/dom/is-selection-forward.js","./src/dom/caret-range-from-point.js","./src/dom/hidden-caret-range-from-point.js","./src/dom/is-edge.js","./src/dom/is-horizontal-edge.js","../../node_modules/utility-types/dist/aliases-and-guards.d.ts","../../node_modules/utility-types/dist/mapped-types.d.ts","../../node_modules/utility-types/dist/utility-types.d.ts","../../node_modules/utility-types/dist/functional-helpers.d.ts","../../node_modules/utility-types/dist/index.d.ts","../deprecated/build-types/index.d.ts","./src/dom/is-number-input.js","./src/dom/is-vertical-edge.js","./src/dom/place-caret-at-edge.js","./src/dom/place-caret-at-horizontal-edge.js","./src/dom/place-caret-at-vertical-edge.js","./src/dom/insert-after.js","./src/dom/remove.js","./src/dom/replace.js","./src/dom/unwrap.js","./src/dom/replace-tag.js","./src/dom/wrap.js","./src/dom/safe-html.js","./src/dom/strip-html.js","./src/dom/is-empty.js","./src/phrasing-content.js","./src/dom/is-element.js","./src/dom/clean-node-list.js","./src/dom/remove-invalid-html.js","./src/dom/index.js","./src/index.js","../../typings/gutenberg-env/index.d.ts"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"80d2e2a2e1685c82cba3c320f5d077376fadff77fe1f52a4c29f995bdc40ea70","0ca9a18ed362f11af31b31312d27380b605653eb7d9b005abc7ce9af29e6c545","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","438284c7c455a29b9c0e2d1e72abc62ee93d9a163029ffe918a34c5db3b92da2","0c75b204aed9cf6ff1c7b4bed87a3ece0d9d6fc857a6350c0c95ed0c38c814e8","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","82251920b05f30981c9a4109cb5f3169dce4b477effc845c6d781044a30e7672","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","9fa6b83a35e897f340858995ca5d77e901d89fd18644cd4c9e8a4afe0b2e6363",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"05ea0a0b2298c74e7d48012e1362258edccc3c90858e7bf2e9cfa9135298a4e8","a7836408f857cb8855443e0ff79d3ed7027415dca85f312c5f9f47daa6cd355d","60c4ae06adc3b6c7e1bbde496c9e2ff9bf3ff2f811675b7a897d460d2b7b814a","99546def4f9cd760e5ee13c0cce45c83aaa3d5474d75cef79c34b1990a808022","1caa056d021a35691778948dcb48eb6f7550110ea33c0d14c03f0445daa93559","4fcfb368b1ba498dab2fd60a1c680c137aacc6df49d8e0e802c9de00f0e047f0","c16b538f18087f31e1b99251169cd93e8d7a1ba8dde51768978f4bde67f318ac","b34200360a82e8441a7c102c9c4c73512353c8d8a43a8000a29b5c67a867a9d1","9c32c48fe5fb3b9929609bbd1d7233ed1fc13ac7aaee602b8dd27a0a90baf9cf","9816eb62d7014f570356c988308e390770fea83993d6eae79788cd79a31ea6dc","dea4257186ad318062499e0aff7122433b1081b7883e95ef78d9b4121fc8e7da","e07d9c569b874918d96c737cc6265494127010a65db231160e46da999db6cd83","f5b932cd4c47954ecb9c5010d848afe821486d5785a3c1c81e670146f4245688","4d31f8f7e9d8a43d2fd3c5a378e390080706392dd4d1541fc6b6f876ed961cf4","756cc95fd142eb928ba7bd366cc2756a902d8a1219182a45a2820e86702b1f3e","df45136f01235aaaaa952d0cc2508bf2e1747157225773bd238a7e65e927fd06","4312fd698114e973469529ec29680789e8ce13ffddcf711a8660c85e522b4069","cb412dab570deef76d26e0c5759e3fbe12625947ac6a82037573c788b7a2d1a4","59fbe797b38f7f549100d38fc9a4c6cd0f4b990407700f5e1979a54c9d8e3ed6","e8be8e4d18f330bdd294cdbe7d3c4a89e8dca65585284745a25c515ecb69249f","8b692a361fc9f2d4102106f168b35cf6f30c9efc66050108001955a1a59b4fd2","59ac58f0ebf648d5e38b01df0cfd02700d475ff8367c3f4695d3632e3db3416b","6199e013116305fa2d162835ad812abfe210076e1249852851c5a80a753f4f3d","bd0d80db12ef1aceefc4f9d3eb88517b9634fa747ae8475981da8655292feab8","55e68fb1618e3f55f7866b8c8415152159309a14b716370081ab0b7af96d876e","bf0491af2455f92282b61807be2be6e7ad7d532e47fac7b698019d3617c28ff7","5d874fb879ab8601c02549817dceb2d0a30729cb7e161625dd6f819bbff1ec0b","ee551a880882770c4f56a0964a9767c9feafe497a5be52652527d098c88d85cb","b192606574769a5566620f9bf19358a3994bc2726ecdeaad9c66f3333b2687c8","905386a2f18ce88642a62d84ddda2e1763d6180a011947f9bc57f8c78589174a","ba688a4815abd9d27b425a819def1721b61e1798acc748b471e54d50a7804bcd","c6684892ae32c0d3fe0c2bb1b7e6bb37ffc86fc91d39c0cfe557aba4816e7766","609b8944af1aa9b73959c0bd766370986176a197c16c27e365e867a0bc85eed8","2ffc9898fdf8f285b73f08ee256ca9a6f20cf3de25c57dd7aa28f7558d3af624","0fb6bab9bd95185809964d513dcfeeab6b5609d280dcc6291b5277e36998afe1","2d18411640dd8fcf1067392b839136628cafef5a648d0d49dc9da2f7d344046e","57597a1e8735ae08b671194c8b64a2c2831fd6ce2793d1bca705dbceb41bdaae","fc9b503ac41bf643bdd2c5bcf21e7e8c052881dd6b94699e3624f3a60e02b0be","665d3d55e94122f2fe1c2dd78dd61774134151557a3b8dd41d49868a642c1277","2259073e3a0fcbd5d873f90465ad8364007668a97c0291a6b6d7975d8edbe30d","02959309d4b7d9a875c4f175abae0a359a074585513d073d1fbb828b704e5663","d0472eb54f481ef265c3407b31df68485efda04e40cc8a7238c8dbdaf93fe81b","70388aac7550e4cb19e9eb5aafba7ed3333fbae173f0d377643f5fa733317ae9","5620e210666cc9ff9409e6b18b23bdfbfd3edfa21a6b12ac28f48933842396b7","0d0dd5ae0237a3571383b9ac701d40220e1d963d0bbb22473c336225b2ed44a7","1e5577dfce1e114e9dc58a7199bdb9e359b30deb86d29a9f0a0b111fc8d29943","dcc4b56e334bd6f9a8680a5dd343e417cdb03bae06bdc4786211d2cdfd7899e8","acbe60d616549a3815593f33a7a34faf0b0d063257c74f3b01bfc20dae42652e","0af026de3ab75c99339016a7aa606da158668df7cfc0c25668c1d1617323da20",{"version":"f254c1abf6bb4c92633159831f924588908da902aa5e04ae45c39bd001f62e2e","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[47,49,50,51,52,53,54,55,56,57,58,59],[47,48,50,51,52,53,54,55,56,57,58,59],[48,49,50,51,52,53,54,55,56,57,58,59],[47,48,49,51,52,53,54,55,56,57,58,59],[47,48,49,50,52,53,54,55,56,57,58,59],[47,48,49,50,51,53,54,55,56,57,58,59],[47,48,49,50,51,52,54,55,56,57,58,59],[47,48,49,50,51,52,53,55,56,57,58,59],[47,48,49,50,51,52,53,54,56,57,58,59],[47,48,49,50,51,52,53,54,55,57,58,59],[47,48,49,50,51,52,53,54,55,56,58,59],[47,48,49,50,51,52,53,54,55,56,57,59],[47,48,49,50,51,52,53,54,55,56,57,58],[83,84,85,86],[83],[84],[87],[59,94,95,97,102,103,104],[61,62],[64,65,66],[61],[64,67],[70],[70,79],[62,63,64,66,68,69,71,72,74,75,76,82,89,90,92,93,94,95,96,97,98,99,100,101,102,106],[65,66],[61,62,73,76,77,78,80],[61,73],[73],[81],[65,88],[65],[61,73,76,80],[91],[105],[61,94,95],[95],[100],[45,46,60,103,107],[59],[46,59]],"referencedMap":[[48,1],[49,2],[47,3],[50,4],[51,5],[52,6],[53,7],[54,8],[55,9],[56,10],[57,11],[58,12],[59,13],[87,14],[84,15],[85,16],[88,17],[105,18],[63,19],[69,20],[64,21],[68,22],[70,21],[72,23],[62,21],[71,23],[80,24],[107,25],[67,26],[94,21],[81,27],[74,28],[75,29],[82,30],[89,31],[76,23],[78,21],[66,32],[90,30],[91,33],[92,34],[93,34],[106,35],[95,21],[98,21],[96,36],[100,37],[101,38],[97,21],[99,21],[108,39],[103,40],[60,41]],"exportedModulesMap":[[48,1],[49,2],[47,3],[50,4],[51,5],[52,6],[53,7],[54,8],[55,9],[56,10],[57,11],[58,12],[59,13],[87,14],[84,15],[85,16],[88,17],[105,18],[63,19],[69,20],[64,21],[68,22],[70,21],[72,23],[62,21],[71,23],[80,24],[107,25],[67,26],[94,21],[81,27],[74,28],[75,29],[82,30],[89,31],[76,23],[78,21],[66,32],[90,30],[91,33],[92,34],[93,34],[106,35],[95,21],[98,21],[96,36],[100,37],[101,38],[97,21],[99,21],[108,39],[103,40],[60,41]],"semanticDiagnosticsPerFile":[48,49,47,50,51,52,53,54,55,56,57,58,59,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,83,86,87,84,85,88,45,79,105,63,69,64,68,70,72,77,62,71,80,107,67,94,81,104,102,74,75,82,65,73,89,76,78,66,90,91,92,93,106,95,98,96,100,101,97,99,46,108,103,60,61,109]},"version":"4.4.2"}