80 /******/ // __webpack_public_path__ |
80 /******/ // __webpack_public_path__ |
81 /******/ __webpack_require__.p = ""; |
81 /******/ __webpack_require__.p = ""; |
82 /******/ |
82 /******/ |
83 /******/ |
83 /******/ |
84 /******/ // Load entry module and return exports |
84 /******/ // Load entry module and return exports |
85 /******/ return __webpack_require__(__webpack_require__.s = 379); |
85 /******/ return __webpack_require__(__webpack_require__.s = 462); |
86 /******/ }) |
86 /******/ }) |
87 /************************************************************************/ |
87 /************************************************************************/ |
88 /******/ ({ |
88 /******/ ({ |
89 |
89 |
90 /***/ 17: |
|
91 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
92 |
|
93 "use strict"; |
|
94 |
|
95 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js |
|
96 function _arrayWithoutHoles(arr) { |
|
97 if (Array.isArray(arr)) { |
|
98 for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { |
|
99 arr2[i] = arr[i]; |
|
100 } |
|
101 |
|
102 return arr2; |
|
103 } |
|
104 } |
|
105 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js |
|
106 var iterableToArray = __webpack_require__(34); |
|
107 |
|
108 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js |
|
109 function _nonIterableSpread() { |
|
110 throw new TypeError("Invalid attempt to spread non-iterable instance"); |
|
111 } |
|
112 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js |
|
113 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; }); |
|
114 |
|
115 |
|
116 |
|
117 function _toConsumableArray(arr) { |
|
118 return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || _nonIterableSpread(); |
|
119 } |
|
120 |
|
121 /***/ }), |
|
122 |
|
123 /***/ 2: |
90 /***/ 2: |
124 /***/ (function(module, exports) { |
91 /***/ (function(module, exports) { |
125 |
92 |
126 (function() { module.exports = this["lodash"]; }()); |
93 (function() { module.exports = this["lodash"]; }()); |
127 |
94 |
128 /***/ }), |
95 /***/ }), |
129 |
96 |
130 /***/ 34: |
97 /***/ 462: |
131 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
98 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
132 |
99 |
133 "use strict"; |
100 "use strict"; |
134 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; }); |
101 // ESM COMPAT FLAG |
135 function _iterableToArray(iter) { |
|
136 if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); |
|
137 } |
|
138 |
|
139 /***/ }), |
|
140 |
|
141 /***/ 379: |
|
142 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
143 |
|
144 "use strict"; |
|
145 __webpack_require__.r(__webpack_exports__); |
102 __webpack_require__.r(__webpack_exports__); |
|
103 |
|
104 // EXPORTS |
|
105 __webpack_require__.d(__webpack_exports__, "focus", function() { return /* binding */ build_module_focus; }); |
|
106 __webpack_require__.d(__webpack_exports__, "isHorizontalEdge", function() { return /* reexport */ isHorizontalEdge; }); |
|
107 __webpack_require__.d(__webpack_exports__, "isVerticalEdge", function() { return /* reexport */ isVerticalEdge; }); |
|
108 __webpack_require__.d(__webpack_exports__, "getRectangleFromRange", function() { return /* reexport */ getRectangleFromRange; }); |
|
109 __webpack_require__.d(__webpack_exports__, "computeCaretRect", function() { return /* reexport */ computeCaretRect; }); |
|
110 __webpack_require__.d(__webpack_exports__, "placeCaretAtHorizontalEdge", function() { return /* reexport */ placeCaretAtHorizontalEdge; }); |
|
111 __webpack_require__.d(__webpack_exports__, "placeCaretAtVerticalEdge", function() { return /* reexport */ placeCaretAtVerticalEdge; }); |
|
112 __webpack_require__.d(__webpack_exports__, "isTextField", function() { return /* reexport */ isTextField; }); |
|
113 __webpack_require__.d(__webpack_exports__, "isNumberInput", function() { return /* reexport */ isNumberInput; }); |
|
114 __webpack_require__.d(__webpack_exports__, "documentHasTextSelection", function() { return /* reexport */ documentHasTextSelection; }); |
|
115 __webpack_require__.d(__webpack_exports__, "documentHasUncollapsedSelection", function() { return /* reexport */ documentHasUncollapsedSelection; }); |
|
116 __webpack_require__.d(__webpack_exports__, "documentHasSelection", function() { return /* reexport */ documentHasSelection; }); |
|
117 __webpack_require__.d(__webpack_exports__, "isEntirelySelected", function() { return /* reexport */ isEntirelySelected; }); |
|
118 __webpack_require__.d(__webpack_exports__, "getScrollContainer", function() { return /* reexport */ getScrollContainer; }); |
|
119 __webpack_require__.d(__webpack_exports__, "getOffsetParent", function() { return /* reexport */ getOffsetParent; }); |
|
120 __webpack_require__.d(__webpack_exports__, "replace", function() { return /* reexport */ replace; }); |
|
121 __webpack_require__.d(__webpack_exports__, "remove", function() { return /* reexport */ remove; }); |
|
122 __webpack_require__.d(__webpack_exports__, "insertAfter", function() { return /* reexport */ insertAfter; }); |
|
123 __webpack_require__.d(__webpack_exports__, "unwrap", function() { return /* reexport */ unwrap; }); |
|
124 __webpack_require__.d(__webpack_exports__, "replaceTag", function() { return /* reexport */ replaceTag; }); |
|
125 __webpack_require__.d(__webpack_exports__, "wrap", function() { return /* reexport */ wrap; }); |
|
126 __webpack_require__.d(__webpack_exports__, "__unstableStripHTML", function() { return /* reexport */ __unstableStripHTML; }); |
|
127 |
|
128 // NAMESPACE OBJECT: ./node_modules/@wordpress/dom/build-module/focusable.js |
146 var focusable_namespaceObject = {}; |
129 var focusable_namespaceObject = {}; |
147 __webpack_require__.r(focusable_namespaceObject); |
130 __webpack_require__.r(focusable_namespaceObject); |
148 __webpack_require__.d(focusable_namespaceObject, "find", function() { return find; }); |
131 __webpack_require__.d(focusable_namespaceObject, "find", function() { return find; }); |
|
132 |
|
133 // NAMESPACE OBJECT: ./node_modules/@wordpress/dom/build-module/tabbable.js |
149 var tabbable_namespaceObject = {}; |
134 var tabbable_namespaceObject = {}; |
150 __webpack_require__.r(tabbable_namespaceObject); |
135 __webpack_require__.r(tabbable_namespaceObject); |
151 __webpack_require__.d(tabbable_namespaceObject, "isTabbableIndex", function() { return isTabbableIndex; }); |
136 __webpack_require__.d(tabbable_namespaceObject, "isTabbableIndex", function() { return isTabbableIndex; }); |
152 __webpack_require__.d(tabbable_namespaceObject, "find", function() { return tabbable_find; }); |
137 __webpack_require__.d(tabbable_namespaceObject, "find", function() { return tabbable_find; }); |
153 |
138 __webpack_require__.d(tabbable_namespaceObject, "findPrevious", function() { return findPrevious; }); |
154 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules |
139 __webpack_require__.d(tabbable_namespaceObject, "findNext", function() { return findNext; }); |
155 var toConsumableArray = __webpack_require__(17); |
|
156 |
140 |
157 // CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/focusable.js |
141 // CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/focusable.js |
158 |
|
159 |
|
160 /** |
142 /** |
161 * References: |
143 * References: |
162 * |
144 * |
163 * Focusable: |
145 * Focusable: |
164 * - https://www.w3.org/TR/html5/editing.html#focus-management |
146 * - https://www.w3.org/TR/html5/editing.html#focus-management |
370 return a.index - b.index; |
365 return a.index - b.index; |
371 } |
366 } |
372 |
367 |
373 return aTabIndex - bTabIndex; |
368 return aTabIndex - bTabIndex; |
374 } |
369 } |
|
370 /** |
|
371 * Givin focusable elements, filters out tabbable element. |
|
372 * |
|
373 * @param {Array} focusables Focusable elements to filter. |
|
374 * |
|
375 * @return {Array} Tabbable elements. |
|
376 */ |
|
377 |
|
378 |
|
379 function filterTabbable(focusables) { |
|
380 return focusables.filter(isTabbableIndex).map(mapElementToObjectTabbable).sort(compareObjectTabbables).map(mapObjectTabbableToElement).reduce(createStatefulCollapseRadioGroup(), []); |
|
381 } |
375 |
382 |
376 function tabbable_find(context) { |
383 function tabbable_find(context) { |
377 return find(context).filter(isTabbableIndex).map(mapElementToObjectTabbable).sort(compareObjectTabbables).map(mapObjectTabbableToElement).reduce(createStatefulCollapseRadioGroup(), []); |
384 return filterTabbable(find(context)); |
|
385 } |
|
386 /** |
|
387 * Given a focusable element, find the preceding tabbable element. |
|
388 * |
|
389 * @param {Element} element The focusable element before which to look. Defaults |
|
390 * to the active element. |
|
391 */ |
|
392 |
|
393 function findPrevious() { |
|
394 var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.activeElement; |
|
395 var focusables = find(document.body); |
|
396 var index = focusables.indexOf(element); // Remove all focusables after and including `element`. |
|
397 |
|
398 focusables.length = index; |
|
399 return Object(external_this_lodash_["last"])(filterTabbable(focusables)); |
|
400 } |
|
401 /** |
|
402 * Given a focusable element, find the next tabbable element. |
|
403 * |
|
404 * @param {Element} element The focusable element after which to look. Defaults |
|
405 * to the active element. |
|
406 */ |
|
407 |
|
408 function findNext() { |
|
409 var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.activeElement; |
|
410 var focusables = find(document.body); |
|
411 var index = focusables.indexOf(element); // Remove all focusables before and inside `element`. |
|
412 |
|
413 var remaining = focusables.slice(index + 1).filter(function (node) { |
|
414 return !element.contains(node); |
|
415 }); |
|
416 return Object(external_this_lodash_["first"])(filterTabbable(remaining)); |
378 } |
417 } |
379 |
418 |
380 // CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom.js |
419 // CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom.js |
381 /** |
420 /** |
382 * External dependencies |
421 * External dependencies |
804 * |
832 * |
805 * @return {boolean} True if the element is an text field, false if not. |
833 * @return {boolean} True if the element is an text field, false if not. |
806 */ |
834 */ |
807 |
835 |
808 function isTextField(element) { |
836 function isTextField(element) { |
|
837 var nodeName = element.nodeName, |
|
838 contentEditable = element.contentEditable; |
|
839 var nonTextInputs = ['button', 'checkbox', 'hidden', 'file', 'radio', 'image', 'range', 'reset', 'submit', 'number']; |
|
840 return nodeName === 'INPUT' && !nonTextInputs.includes(element.type) || nodeName === 'TEXTAREA' || contentEditable === 'true'; |
|
841 } |
|
842 /** |
|
843 * Check whether the given element is an input field of type number |
|
844 * and has a valueAsNumber |
|
845 * |
|
846 * @param {HTMLElement} element The HTML element. |
|
847 * |
|
848 * @return {boolean} True if the element is input and holds a number. |
|
849 */ |
|
850 |
|
851 function isNumberInput(element) { |
|
852 var nodeName = element.nodeName, |
|
853 type = element.type, |
|
854 valueAsNumber = element.valueAsNumber; |
|
855 return nodeName === 'INPUT' && type === 'number' && !!valueAsNumber; |
|
856 } |
|
857 /** |
|
858 * Check whether the current document has selected text. This applies to ranges |
|
859 * of text in the document, and not selection inside <input> and <textarea> |
|
860 * elements. |
|
861 * |
|
862 * See: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects. |
|
863 * |
|
864 * @return {boolean} True if there is selection, false if not. |
|
865 */ |
|
866 |
|
867 function documentHasTextSelection() { |
|
868 var selection = window.getSelection(); |
|
869 var range = selection.rangeCount ? selection.getRangeAt(0) : null; |
|
870 return range && !range.collapsed; |
|
871 } |
|
872 /** |
|
873 * Check whether the given element, assumed an input field or textarea, |
|
874 * contains a (uncollapsed) selection of text. |
|
875 * |
|
876 * Note: this is perhaps an abuse of the term "selection", since these elements |
|
877 * manage selection differently and aren't covered by Selection#collapsed. |
|
878 * |
|
879 * See: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects. |
|
880 * |
|
881 * @param {HTMLElement} element The HTML element. |
|
882 * |
|
883 * @return {boolean} Whether the input/textareaa element has some "selection". |
|
884 */ |
|
885 |
|
886 function inputFieldHasUncollapsedSelection(element) { |
|
887 if (!isTextField(element) && !isNumberInput(element)) { |
|
888 return false; |
|
889 } |
|
890 |
809 try { |
891 try { |
810 var nodeName = element.nodeName, |
892 var selectionStart = element.selectionStart, |
811 selectionStart = element.selectionStart, |
893 selectionEnd = element.selectionEnd; |
812 contentEditable = element.contentEditable; |
894 return selectionStart !== null && selectionStart !== selectionEnd; |
813 return nodeName === 'INPUT' && selectionStart !== null || nodeName === 'TEXTAREA' || contentEditable === 'true'; |
|
814 } catch (error) { |
895 } catch (error) { |
815 // Safari throws an exception when trying to get `selectionStart` |
896 // Safari throws an exception when trying to get `selectionStart` |
816 // on non-text <input> elements (which, understandably, don't |
897 // on non-text <input> elements (which, understandably, don't |
817 // have the text selection API). We catch this via a try/catch |
898 // have the text selection API). We catch this via a try/catch |
818 // block, as opposed to a more explicit check of the element's |
899 // block, as opposed to a more explicit check of the element's |
822 // evolves over time. |
903 // evolves over time. |
823 return false; |
904 return false; |
824 } |
905 } |
825 } |
906 } |
826 /** |
907 /** |
827 * Check wether the current document has a selection. |
908 * Check whether the current document has any sort of selection. This includes |
828 * This checks both for focus in an input field and general text selection. |
909 * ranges of text across elements and any selection inside <input> and |
|
910 * <textarea> elements. |
|
911 * |
|
912 * @return {boolean} Whether there is any sort of "selection" in the document. |
|
913 */ |
|
914 |
|
915 |
|
916 function documentHasUncollapsedSelection() { |
|
917 return documentHasTextSelection() || inputFieldHasUncollapsedSelection(document.activeElement); |
|
918 } |
|
919 /** |
|
920 * Check whether the current document has a selection. This checks for both |
|
921 * focus in an input field and general text selection. |
829 * |
922 * |
830 * @return {boolean} True if there is selection, false if not. |
923 * @return {boolean} True if there is selection, false if not. |
831 */ |
924 */ |
832 |
925 |
833 function documentHasSelection() { |
926 function documentHasSelection() { |
834 if (isTextField(document.activeElement)) { |
927 return isTextField(document.activeElement) || isNumberInput(document.activeElement) || documentHasTextSelection(); |
835 return true; |
|
836 } |
|
837 |
|
838 var selection = window.getSelection(); |
|
839 var range = selection.rangeCount ? selection.getRangeAt(0) : null; |
|
840 return range && !range.collapsed; |
|
841 } |
928 } |
842 /** |
929 /** |
843 * Check whether the contents of the element have been entirely selected. |
930 * Check whether the contents of the element have been entirely selected. |
844 * Returns true if there is no possibility of selection. |
931 * Returns true if there is no possibility of selection. |
845 * |
932 * |
1018 |
1105 |
1019 function wrap(newNode, referenceNode) { |
1106 function wrap(newNode, referenceNode) { |
1020 referenceNode.parentNode.insertBefore(newNode, referenceNode); |
1107 referenceNode.parentNode.insertBefore(newNode, referenceNode); |
1021 newNode.appendChild(referenceNode); |
1108 newNode.appendChild(referenceNode); |
1022 } |
1109 } |
|
1110 /** |
|
1111 * Removes any HTML tags from the provided string. |
|
1112 * |
|
1113 * @param {string} html The string containing html. |
|
1114 * |
|
1115 * @return {string} The text content with any html removed. |
|
1116 */ |
|
1117 |
|
1118 function __unstableStripHTML(html) { |
|
1119 var document = new DOMParser().parseFromString(html, 'text/html'); |
|
1120 return document.body.textContent || ''; |
|
1121 } |
1023 |
1122 |
1024 // CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/index.js |
1123 // CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/index.js |
1025 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "focus", function() { return build_module_focus; }); |
|
1026 /* concated harmony reexport isHorizontalEdge */__webpack_require__.d(__webpack_exports__, "isHorizontalEdge", function() { return isHorizontalEdge; }); |
|
1027 /* concated harmony reexport isVerticalEdge */__webpack_require__.d(__webpack_exports__, "isVerticalEdge", function() { return isVerticalEdge; }); |
|
1028 /* concated harmony reexport getRectangleFromRange */__webpack_require__.d(__webpack_exports__, "getRectangleFromRange", function() { return getRectangleFromRange; }); |
|
1029 /* concated harmony reexport computeCaretRect */__webpack_require__.d(__webpack_exports__, "computeCaretRect", function() { return computeCaretRect; }); |
|
1030 /* concated harmony reexport placeCaretAtHorizontalEdge */__webpack_require__.d(__webpack_exports__, "placeCaretAtHorizontalEdge", function() { return placeCaretAtHorizontalEdge; }); |
|
1031 /* concated harmony reexport placeCaretAtVerticalEdge */__webpack_require__.d(__webpack_exports__, "placeCaretAtVerticalEdge", function() { return placeCaretAtVerticalEdge; }); |
|
1032 /* concated harmony reexport isTextField */__webpack_require__.d(__webpack_exports__, "isTextField", function() { return isTextField; }); |
|
1033 /* concated harmony reexport documentHasSelection */__webpack_require__.d(__webpack_exports__, "documentHasSelection", function() { return documentHasSelection; }); |
|
1034 /* concated harmony reexport isEntirelySelected */__webpack_require__.d(__webpack_exports__, "isEntirelySelected", function() { return isEntirelySelected; }); |
|
1035 /* concated harmony reexport getScrollContainer */__webpack_require__.d(__webpack_exports__, "getScrollContainer", function() { return getScrollContainer; }); |
|
1036 /* concated harmony reexport getOffsetParent */__webpack_require__.d(__webpack_exports__, "getOffsetParent", function() { return getOffsetParent; }); |
|
1037 /* concated harmony reexport replace */__webpack_require__.d(__webpack_exports__, "replace", function() { return replace; }); |
|
1038 /* concated harmony reexport remove */__webpack_require__.d(__webpack_exports__, "remove", function() { return remove; }); |
|
1039 /* concated harmony reexport insertAfter */__webpack_require__.d(__webpack_exports__, "insertAfter", function() { return insertAfter; }); |
|
1040 /* concated harmony reexport unwrap */__webpack_require__.d(__webpack_exports__, "unwrap", function() { return unwrap; }); |
|
1041 /* concated harmony reexport replaceTag */__webpack_require__.d(__webpack_exports__, "replaceTag", function() { return replaceTag; }); |
|
1042 /* concated harmony reexport wrap */__webpack_require__.d(__webpack_exports__, "wrap", function() { return wrap; }); |
|
1043 /** |
1124 /** |
1044 * Internal dependencies |
1125 * Internal dependencies |
1045 */ |
1126 */ |
1046 |
1127 |
1047 |
1128 |