@wordpress/dom 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/data-transfer.cjs +20 -38
- package/build/data-transfer.cjs.map +1 -7
- package/build/dom/caret-range-from-point.cjs +31 -38
- package/build/dom/caret-range-from-point.cjs.map +1 -7
- package/build/dom/clean-node-list.cjs +87 -132
- package/build/dom/clean-node-list.cjs.map +1 -7
- package/build/dom/compute-caret-rect.cjs +35 -35
- package/build/dom/compute-caret-rect.cjs.map +1 -7
- package/build/dom/document-has-selection.cjs +35 -30
- package/build/dom/document-has-selection.cjs.map +1 -7
- package/build/dom/document-has-text-selection.cjs +24 -30
- package/build/dom/document-has-text-selection.cjs.map +1 -7
- package/build/dom/document-has-uncollapsed-selection.cjs +34 -29
- package/build/dom/document-has-uncollapsed-selection.cjs.map +1 -7
- package/build/dom/get-computed-style.cjs +14 -30
- package/build/dom/get-computed-style.cjs.map +1 -7
- package/build/dom/get-offset-parent.cjs +40 -39
- package/build/dom/get-offset-parent.cjs.map +1 -7
- package/build/dom/get-range-height.cjs +18 -31
- package/build/dom/get-range-height.cjs.map +1 -7
- package/build/dom/get-rectangle-from-range.cjs +82 -128
- package/build/dom/get-rectangle-from-range.cjs.map +1 -7
- package/build/dom/get-scroll-container.cjs +46 -50
- package/build/dom/get-scroll-container.cjs.map +1 -7
- package/build/dom/hidden-caret-range-from-point.cjs +48 -42
- package/build/dom/hidden-caret-range-from-point.cjs.map +1 -7
- package/build/dom/index.cjs +233 -110
- package/build/dom/input-field-has-uncollapsed-selection.cjs +48 -43
- package/build/dom/input-field-has-uncollapsed-selection.cjs.map +1 -7
- package/build/dom/insert-after.cjs +17 -27
- package/build/dom/insert-after.cjs.map +1 -7
- package/build/dom/is-edge.cjs +82 -97
- package/build/dom/is-edge.cjs.map +1 -7
- package/build/dom/is-element.cjs +12 -25
- package/build/dom/is-element.cjs.map +1 -7
- package/build/dom/is-empty.cjs +23 -37
- package/build/dom/is-empty.cjs.map +1 -7
- package/build/dom/is-entirely-selected.cjs +70 -67
- package/build/dom/is-entirely-selected.cjs.map +1 -7
- package/build/dom/is-form-element.cjs +33 -33
- package/build/dom/is-form-element.cjs.map +1 -7
- package/build/dom/is-horizontal-edge.cjs +31 -28
- package/build/dom/is-horizontal-edge.cjs.map +1 -7
- package/build/dom/is-html-input-element.cjs +12 -25
- package/build/dom/is-html-input-element.cjs.map +1 -7
- package/build/dom/is-input-or-text-area.cjs +12 -25
- package/build/dom/is-input-or-text-area.cjs.map +1 -7
- package/build/dom/is-number-input.cjs +36 -33
- package/build/dom/is-number-input.cjs.map +1 -7
- package/build/dom/is-rtl.cjs +30 -28
- package/build/dom/is-rtl.cjs.map +1 -7
- package/build/dom/is-selection-forward.cjs +26 -39
- package/build/dom/is-selection-forward.cjs.map +1 -7
- package/build/dom/is-text-field.cjs +45 -42
- package/build/dom/is-text-field.cjs.map +1 -7
- package/build/dom/is-vertical-edge.cjs +31 -28
- package/build/dom/is-vertical-edge.cjs.map +1 -7
- package/build/dom/place-caret-at-edge.cjs +75 -78
- package/build/dom/place-caret-at-edge.cjs.map +1 -7
- package/build/dom/place-caret-at-horizontal-edge.cjs +29 -28
- package/build/dom/place-caret-at-horizontal-edge.cjs.map +1 -7
- package/build/dom/place-caret-at-vertical-edge.cjs +30 -28
- package/build/dom/place-caret-at-vertical-edge.cjs.map +1 -7
- package/build/dom/remove-invalid-html.cjs +35 -31
- package/build/dom/remove-invalid-html.cjs.map +1 -7
- package/build/dom/remove.cjs +15 -27
- package/build/dom/remove.cjs.map +1 -7
- package/build/dom/replace-tag.cjs +21 -32
- package/build/dom/replace-tag.cjs.map +1 -7
- package/build/dom/replace.cjs +34 -32
- package/build/dom/replace.cjs.map +1 -7
- package/build/dom/safe-html.cjs +45 -46
- package/build/dom/safe-html.cjs.map +1 -7
- package/build/dom/scroll-if-no-range.cjs +24 -37
- package/build/dom/scroll-if-no-range.cjs.map +1 -7
- package/build/dom/strip-html.cjs +33 -31
- package/build/dom/strip-html.cjs.map +1 -7
- package/build/dom/types.cjs +4 -18
- package/build/dom/unwrap.cjs +17 -31
- package/build/dom/unwrap.cjs.map +1 -7
- package/build/dom/wrap.cjs +17 -28
- package/build/dom/wrap.cjs.map +1 -7
- package/build/focusable.cjs +99 -76
- package/build/focusable.cjs.map +1 -7
- package/build/index.cjs +57 -38
- package/build/index.cjs.map +1 -7
- package/build/phrasing-content.cjs +163 -159
- package/build/phrasing-content.cjs.map +1 -7
- package/build/tabbable.cjs +123 -78
- package/build/tabbable.cjs.map +1 -7
- package/build/types.cjs +4 -18
- package/build/utils/assert-is-defined.cjs +8 -33
- package/build/utils/assert-is-defined.cjs.map +1 -7
- package/build-module/data-transfer.mjs +16 -14
- package/build-module/data-transfer.mjs.map +1 -7
- package/build-module/dom/caret-range-from-point.mjs +27 -18
- package/build-module/dom/caret-range-from-point.mjs.map +1 -7
- package/build-module/dom/clean-node-list.mjs +60 -105
- package/build-module/dom/clean-node-list.mjs.map +1 -7
- package/build-module/dom/compute-caret-rect.mjs +16 -12
- package/build-module/dom/compute-caret-rect.mjs.map +1 -7
- package/build-module/dom/document-has-selection.mjs +13 -6
- package/build-module/dom/document-has-selection.mjs.map +1 -7
- package/build-module/dom/document-has-text-selection.mjs +20 -10
- package/build-module/dom/document-has-text-selection.mjs.map +1 -7
- package/build-module/dom/document-has-uncollapsed-selection.mjs +14 -6
- package/build-module/dom/document-has-uncollapsed-selection.mjs.map +1 -7
- package/build-module/dom/get-computed-style.mjs +10 -10
- package/build-module/dom/get-computed-style.mjs.map +1 -7
- package/build-module/dom/get-offset-parent.mjs +20 -16
- package/build-module/dom/get-offset-parent.mjs.map +1 -7
- package/build-module/dom/get-range-height.mjs +14 -11
- package/build-module/dom/get-range-height.mjs.map +1 -7
- package/build-module/dom/get-rectangle-from-range.mjs +78 -108
- package/build-module/dom/get-rectangle-from-range.mjs.map +1 -7
- package/build-module/dom/get-scroll-container.mjs +28 -28
- package/build-module/dom/get-scroll-container.mjs.map +1 -7
- package/build-module/dom/hidden-caret-range-from-point.mjs +28 -19
- package/build-module/dom/hidden-caret-range-from-point.mjs.map +1 -7
- package/build-module/dom/index.mjs +28 -58
- package/build-module/dom/input-field-has-uncollapsed-selection.mjs +28 -20
- package/build-module/dom/input-field-has-uncollapsed-selection.mjs.map +1 -7
- package/build-module/dom/insert-after.mjs +13 -7
- package/build-module/dom/insert-after.mjs.map +1 -7
- package/build-module/dom/is-edge.mjs +53 -69
- package/build-module/dom/is-edge.mjs.map +1 -7
- package/build-module/dom/is-element.mjs +8 -5
- package/build-module/dom/is-element.mjs.map +1 -7
- package/build-module/dom/is-empty.mjs +19 -17
- package/build-module/dom/is-empty.mjs.map +1 -7
- package/build-module/dom/is-entirely-selected.mjs +51 -44
- package/build-module/dom/is-entirely-selected.mjs.map +1 -7
- package/build-module/dom/is-form-element.mjs +15 -11
- package/build-module/dom/is-form-element.mjs.map +1 -7
- package/build-module/dom/is-horizontal-edge.mjs +13 -6
- package/build-module/dom/is-horizontal-edge.mjs.map +1 -7
- package/build-module/dom/is-html-input-element.mjs +8 -5
- package/build-module/dom/is-html-input-element.mjs.map +1 -7
- package/build-module/dom/is-input-or-text-area.mjs +8 -5
- package/build-module/dom/is-input-or-text-area.mjs.map +1 -7
- package/build-module/dom/is-number-input.mjs +16 -10
- package/build-module/dom/is-number-input.mjs.map +1 -7
- package/build-module/dom/is-rtl.mjs +12 -6
- package/build-module/dom/is-rtl.mjs.map +1 -7
- package/build-module/dom/is-selection-forward.mjs +22 -19
- package/build-module/dom/is-selection-forward.mjs.map +1 -7
- package/build-module/dom/is-text-field.mjs +27 -20
- package/build-module/dom/is-text-field.mjs.map +1 -7
- package/build-module/dom/is-vertical-edge.mjs +13 -6
- package/build-module/dom/is-vertical-edge.mjs.map +1 -7
- package/build-module/dom/place-caret-at-edge.mjs +51 -52
- package/build-module/dom/place-caret-at-edge.mjs.map +1 -7
- package/build-module/dom/place-caret-at-horizontal-edge.mjs +11 -6
- package/build-module/dom/place-caret-at-horizontal-edge.mjs.map +1 -7
- package/build-module/dom/place-caret-at-vertical-edge.mjs +12 -6
- package/build-module/dom/place-caret-at-vertical-edge.mjs.map +1 -7
- package/build-module/dom/remove-invalid-html.mjs +17 -9
- package/build-module/dom/remove-invalid-html.mjs.map +1 -7
- package/build-module/dom/remove.mjs +11 -7
- package/build-module/dom/remove.mjs.map +1 -7
- package/build-module/dom/replace-tag.mjs +17 -12
- package/build-module/dom/replace-tag.mjs.map +1 -7
- package/build-module/dom/replace.mjs +13 -8
- package/build-module/dom/replace.mjs.map +1 -7
- package/build-module/dom/safe-html.mjs +27 -24
- package/build-module/dom/safe-html.mjs.map +1 -7
- package/build-module/dom/scroll-if-no-range.mjs +20 -13
- package/build-module/dom/scroll-if-no-range.mjs.map +1 -7
- package/build-module/dom/strip-html.mjs +15 -9
- package/build-module/dom/strip-html.mjs.map +1 -7
- package/build-module/dom/types.mjs +0 -1
- package/build-module/dom/unwrap.mjs +13 -11
- package/build-module/dom/unwrap.mjs.map +1 -7
- package/build-module/dom/wrap.mjs +13 -8
- package/build-module/dom/wrap.mjs.map +1 -7
- package/build-module/focusable.mjs +95 -52
- package/build-module/focusable.mjs.map +1 -7
- package/build-module/index.mjs +11 -5
- package/build-module/index.mjs.map +1 -7
- package/build-module/phrasing-content.mjs +157 -133
- package/build-module/phrasing-content.mjs.map +1 -7
- package/build-module/tabbable.mjs +116 -51
- package/build-module/tabbable.mjs.map +1 -7
- package/build-module/types.mjs +0 -1
- package/build-module/utils/assert-is-defined.mjs +4 -9
- package/build-module/utils/assert-is-defined.mjs.map +1 -7
- package/build-types/dom/clean-node-list.d.ts +2 -2
- package/build-types/dom/clean-node-list.d.ts.map +1 -1
- package/build-types/dom/is-edge.d.ts.map +1 -1
- package/build-types/dom/remove-invalid-html.d.ts +4 -4
- package/build-types/dom/remove-invalid-html.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/dom/clean-node-list.ts +2 -2
- package/src/dom/is-edge.ts +35 -43
- package/src/dom/remove-invalid-html.ts +4 -4
- package/src/dom/test/{get-rectangle-from-range.browser.test.js → get-rectangle-from-range.browser.test.ts} +25 -25
- package/src/test/{dom.jsdom.test.js → dom.jsdom.test.ts} +9 -6
- package/src/test/{focusable.browser.test.js → focusable.browser.test.ts} +14 -13
- package/src/test/{tabbable.browser.test.js → tabbable.browser.test.ts} +3 -2
- package/build/dom/index.cjs.map +0 -7
- package/build/dom/types.cjs.map +0 -7
- package/build/types.cjs.map +0 -7
- package/build-module/dom/index.mjs.map +0 -7
- package/build-module/dom/types.mjs.map +0 -7
- package/build-module/types.mjs.map +0 -7
- /package/src/dom/test/{safe-html.jsdom.test.js → safe-html.jsdom.test.ts} +0 -0
- /package/src/dom/test/{strip-html.jsdom.test.js → strip-html.jsdom.test.ts} +0 -0
- /package/src/test/{focusable-area.jsdom.test.js → focusable-area.jsdom.test.ts} +0 -0
- /package/src/test/{utils.js → utils.ts} +0 -0
package/build/dom/index.cjs
CHANGED
|
@@ -1,119 +1,242 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
|
+
});
|
|
6
|
+
// \0rolldown/runtime.js
|
|
2
7
|
var __create = Object.create;
|
|
3
8
|
var __defProp = Object.defineProperty;
|
|
4
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
10
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
11
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
12
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
13
|
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
+
key = keys[i];
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
19
22
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
let __compute_caret_rect_ts = require("./compute-caret-rect.cjs");
|
|
28
|
+
__compute_caret_rect_ts = __toESM(__compute_caret_rect_ts);
|
|
29
|
+
let __document_has_text_selection_ts = require("./document-has-text-selection.cjs");
|
|
30
|
+
__document_has_text_selection_ts = __toESM(__document_has_text_selection_ts);
|
|
31
|
+
let __document_has_uncollapsed_selection_ts = require("./document-has-uncollapsed-selection.cjs");
|
|
32
|
+
__document_has_uncollapsed_selection_ts = __toESM(__document_has_uncollapsed_selection_ts);
|
|
33
|
+
let __document_has_selection_ts = require("./document-has-selection.cjs");
|
|
34
|
+
__document_has_selection_ts = __toESM(__document_has_selection_ts);
|
|
35
|
+
let __get_rectangle_from_range_ts = require("./get-rectangle-from-range.cjs");
|
|
36
|
+
__get_rectangle_from_range_ts = __toESM(__get_rectangle_from_range_ts);
|
|
37
|
+
let __get_scroll_container_ts = require("./get-scroll-container.cjs");
|
|
38
|
+
__get_scroll_container_ts = __toESM(__get_scroll_container_ts);
|
|
39
|
+
let __get_offset_parent_ts = require("./get-offset-parent.cjs");
|
|
40
|
+
__get_offset_parent_ts = __toESM(__get_offset_parent_ts);
|
|
41
|
+
let __is_entirely_selected_ts = require("./is-entirely-selected.cjs");
|
|
42
|
+
__is_entirely_selected_ts = __toESM(__is_entirely_selected_ts);
|
|
43
|
+
let __is_form_element_ts = require("./is-form-element.cjs");
|
|
44
|
+
__is_form_element_ts = __toESM(__is_form_element_ts);
|
|
45
|
+
let __is_horizontal_edge_ts = require("./is-horizontal-edge.cjs");
|
|
46
|
+
__is_horizontal_edge_ts = __toESM(__is_horizontal_edge_ts);
|
|
47
|
+
let __is_number_input_ts = require("./is-number-input.cjs");
|
|
48
|
+
__is_number_input_ts = __toESM(__is_number_input_ts);
|
|
49
|
+
let __is_text_field_ts = require("./is-text-field.cjs");
|
|
50
|
+
__is_text_field_ts = __toESM(__is_text_field_ts);
|
|
51
|
+
let __is_vertical_edge_ts = require("./is-vertical-edge.cjs");
|
|
52
|
+
__is_vertical_edge_ts = __toESM(__is_vertical_edge_ts);
|
|
53
|
+
let __place_caret_at_horizontal_edge_ts = require("./place-caret-at-horizontal-edge.cjs");
|
|
54
|
+
__place_caret_at_horizontal_edge_ts = __toESM(__place_caret_at_horizontal_edge_ts);
|
|
55
|
+
let __place_caret_at_vertical_edge_ts = require("./place-caret-at-vertical-edge.cjs");
|
|
56
|
+
__place_caret_at_vertical_edge_ts = __toESM(__place_caret_at_vertical_edge_ts);
|
|
57
|
+
let __replace_ts = require("./replace.cjs");
|
|
58
|
+
__replace_ts = __toESM(__replace_ts);
|
|
59
|
+
let __remove_ts = require("./remove.cjs");
|
|
60
|
+
__remove_ts = __toESM(__remove_ts);
|
|
61
|
+
let __insert_after_ts = require("./insert-after.cjs");
|
|
62
|
+
__insert_after_ts = __toESM(__insert_after_ts);
|
|
63
|
+
let __unwrap_ts = require("./unwrap.cjs");
|
|
64
|
+
__unwrap_ts = __toESM(__unwrap_ts);
|
|
65
|
+
let __replace_tag_ts = require("./replace-tag.cjs");
|
|
66
|
+
__replace_tag_ts = __toESM(__replace_tag_ts);
|
|
67
|
+
let __wrap_ts = require("./wrap.cjs");
|
|
68
|
+
__wrap_ts = __toESM(__wrap_ts);
|
|
69
|
+
let __strip_html_ts = require("./strip-html.cjs");
|
|
70
|
+
__strip_html_ts = __toESM(__strip_html_ts);
|
|
71
|
+
let __is_empty_ts = require("./is-empty.cjs");
|
|
72
|
+
__is_empty_ts = __toESM(__is_empty_ts);
|
|
73
|
+
let __remove_invalid_html_ts = require("./remove-invalid-html.cjs");
|
|
74
|
+
__remove_invalid_html_ts = __toESM(__remove_invalid_html_ts);
|
|
75
|
+
let __is_rtl_ts = require("./is-rtl.cjs");
|
|
76
|
+
__is_rtl_ts = __toESM(__is_rtl_ts);
|
|
77
|
+
let __safe_html_ts = require("./safe-html.cjs");
|
|
78
|
+
__safe_html_ts = __toESM(__safe_html_ts);
|
|
79
|
+
let __is_selection_forward_ts = require("./is-selection-forward.cjs");
|
|
80
|
+
__is_selection_forward_ts = __toESM(__is_selection_forward_ts);
|
|
81
|
+
Object.defineProperty(exports, "__unstableStripHTML", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function() {
|
|
84
|
+
return __strip_html_ts.default;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
Object.defineProperty(exports, "computeCaretRect", {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function() {
|
|
90
|
+
return __compute_caret_rect_ts.default;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(exports, "documentHasSelection", {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
get: function() {
|
|
96
|
+
return __document_has_selection_ts.default;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
Object.defineProperty(exports, "documentHasTextSelection", {
|
|
100
|
+
enumerable: true,
|
|
101
|
+
get: function() {
|
|
102
|
+
return __document_has_text_selection_ts.default;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
Object.defineProperty(exports, "documentHasUncollapsedSelection", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: function() {
|
|
108
|
+
return __document_has_uncollapsed_selection_ts.default;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
Object.defineProperty(exports, "getOffsetParent", {
|
|
112
|
+
enumerable: true,
|
|
113
|
+
get: function() {
|
|
114
|
+
return __get_offset_parent_ts.default;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
Object.defineProperty(exports, "getRectangleFromRange", {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
get: function() {
|
|
120
|
+
return __get_rectangle_from_range_ts.default;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(exports, "getScrollContainer", {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
get: function() {
|
|
126
|
+
return __get_scroll_container_ts.default;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
Object.defineProperty(exports, "insertAfter", {
|
|
130
|
+
enumerable: true,
|
|
131
|
+
get: function() {
|
|
132
|
+
return __insert_after_ts.default;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
Object.defineProperty(exports, "isEmpty", {
|
|
136
|
+
enumerable: true,
|
|
137
|
+
get: function() {
|
|
138
|
+
return __is_empty_ts.default;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
Object.defineProperty(exports, "isEntirelySelected", {
|
|
142
|
+
enumerable: true,
|
|
143
|
+
get: function() {
|
|
144
|
+
return __is_entirely_selected_ts.default;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
Object.defineProperty(exports, "isFormElement", {
|
|
148
|
+
enumerable: true,
|
|
149
|
+
get: function() {
|
|
150
|
+
return __is_form_element_ts.default;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
Object.defineProperty(exports, "isHorizontalEdge", {
|
|
154
|
+
enumerable: true,
|
|
155
|
+
get: function() {
|
|
156
|
+
return __is_horizontal_edge_ts.default;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
Object.defineProperty(exports, "isNumberInput", {
|
|
160
|
+
enumerable: true,
|
|
161
|
+
get: function() {
|
|
162
|
+
return __is_number_input_ts.default;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
Object.defineProperty(exports, "isRTL", {
|
|
166
|
+
enumerable: true,
|
|
167
|
+
get: function() {
|
|
168
|
+
return __is_rtl_ts.default;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
Object.defineProperty(exports, "isSelectionForward", {
|
|
172
|
+
enumerable: true,
|
|
173
|
+
get: function() {
|
|
174
|
+
return __is_selection_forward_ts.default;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
Object.defineProperty(exports, "isTextField", {
|
|
178
|
+
enumerable: true,
|
|
179
|
+
get: function() {
|
|
180
|
+
return __is_text_field_ts.default;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
Object.defineProperty(exports, "isVerticalEdge", {
|
|
184
|
+
enumerable: true,
|
|
185
|
+
get: function() {
|
|
186
|
+
return __is_vertical_edge_ts.default;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
Object.defineProperty(exports, "placeCaretAtHorizontalEdge", {
|
|
190
|
+
enumerable: true,
|
|
191
|
+
get: function() {
|
|
192
|
+
return __place_caret_at_horizontal_edge_ts.default;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
Object.defineProperty(exports, "placeCaretAtVerticalEdge", {
|
|
196
|
+
enumerable: true,
|
|
197
|
+
get: function() {
|
|
198
|
+
return __place_caret_at_vertical_edge_ts.default;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
Object.defineProperty(exports, "remove", {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
get: function() {
|
|
204
|
+
return __remove_ts.default;
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
Object.defineProperty(exports, "removeInvalidHTML", {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function() {
|
|
210
|
+
return __remove_invalid_html_ts.default;
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
Object.defineProperty(exports, "replace", {
|
|
214
|
+
enumerable: true,
|
|
215
|
+
get: function() {
|
|
216
|
+
return __replace_ts.default;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
Object.defineProperty(exports, "replaceTag", {
|
|
220
|
+
enumerable: true,
|
|
221
|
+
get: function() {
|
|
222
|
+
return __replace_tag_ts.default;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
Object.defineProperty(exports, "safeHTML", {
|
|
226
|
+
enumerable: true,
|
|
227
|
+
get: function() {
|
|
228
|
+
return __safe_html_ts.default;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
Object.defineProperty(exports, "unwrap", {
|
|
232
|
+
enumerable: true,
|
|
233
|
+
get: function() {
|
|
234
|
+
return __unwrap_ts.default;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
Object.defineProperty(exports, "wrap", {
|
|
238
|
+
enumerable: true,
|
|
239
|
+
get: function() {
|
|
240
|
+
return __wrap_ts.default;
|
|
241
|
+
}
|
|
242
|
+
});
|
|
@@ -1,55 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
5
|
+
});
|
|
6
|
+
// \0rolldown/runtime.js
|
|
2
7
|
var __create = Object.create;
|
|
3
8
|
var __defProp = Object.defineProperty;
|
|
4
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
10
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
11
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
12
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
13
|
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
+
key = keys[i];
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
19
22
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
let __is_text_field_ts = require("./is-text-field.cjs");
|
|
28
|
+
__is_text_field_ts = __toESM(__is_text_field_ts);
|
|
29
|
+
let __is_html_input_element_ts = require("./is-html-input-element.cjs");
|
|
30
|
+
__is_html_input_element_ts = __toESM(__is_html_input_element_ts);
|
|
30
31
|
// packages/dom/src/dom/input-field-has-uncollapsed-selection.ts
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Check whether the given input field or textarea contains a (uncollapsed)
|
|
34
|
+
* selection of text.
|
|
35
|
+
*
|
|
36
|
+
* CAVEAT: Only specific text-based HTML inputs support the selection APIs
|
|
37
|
+
* needed to determine whether they have a collapsed or uncollapsed selection.
|
|
38
|
+
* This function defaults to returning `true` when the selection cannot be
|
|
39
|
+
* inspected, such as with `<input type="time">`. The rationale is that this
|
|
40
|
+
* should cause the block editor to defer to the browser's native selection
|
|
41
|
+
* handling (e.g. copying and pasting), thereby reducing friction for the user.
|
|
42
|
+
*
|
|
43
|
+
* See: https://html.spec.whatwg.org/multipage/input.html#do-not-apply
|
|
44
|
+
*
|
|
45
|
+
* @param element The HTML element.
|
|
46
|
+
*
|
|
47
|
+
* @return Whether the input/textarea element has some "selection".
|
|
48
|
+
*/
|
|
38
49
|
function inputFieldHasUncollapsedSelection(element) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// cannot determine whether the selection is collapsed, so we
|
|
47
|
-
// default to true.
|
|
48
|
-
selectionStart === null || // when not null, compare the two points
|
|
49
|
-
selectionStart !== selectionEnd
|
|
50
|
-
);
|
|
51
|
-
} catch {
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
50
|
+
if (!(0, __is_html_input_element_ts.default)(element) && !(0, __is_text_field_ts.default)(element)) return false;
|
|
51
|
+
try {
|
|
52
|
+
const { selectionStart, selectionEnd } = element;
|
|
53
|
+
return selectionStart === null || selectionStart !== selectionEnd;
|
|
54
|
+
} catch {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
54
57
|
}
|
|
55
|
-
|
|
58
|
+
exports.default = inputFieldHasUncollapsedSelection;
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=input-field-has-uncollapsed-selection.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/dom/input-field-has-uncollapsed-selection.ts"],
|
|
4
|
-
"sourcesContent": ["import 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 The HTML element.\n *\n * @return Whether the input/textarea element has some \"selection\".\n */\nexport default function inputFieldHasUncollapsedSelection(\n\telement: Element\n): boolean {\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 { selectionStart, selectionEnd } = element as\n\t\t\tHTMLInputElement | HTMLTextAreaElement;\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 {\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"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAwB;AACxB,mCAA+B;AAmBhB,SAAR,kCACN,SACU;AACV,MAAK,KAAE,6BAAAA,SAAoB,OAAQ,KAAK,KAAE,qBAAAC,SAAa,OAAQ,GAAI;AAClE,WAAO;AAAA,EACR;AAKA,MAAI;AACH,UAAM,EAAE,gBAAgB,aAAa,IAAI;AAEzC;AAAA;AAAA;AAAA;AAAA,MAIC,mBAAmB;AAAA,MAEnB,mBAAmB;AAAA;AAAA,EAErB,QAAQ;AAGP,WAAO;AAAA,EACR;AACD;",
|
|
6
|
-
"names": ["isHTMLInputElement", "isTextField"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"input-field-has-uncollapsed-selection.cjs","names":["isHTMLInputElement","isTextField"],"sources":["../../src/dom/input-field-has-uncollapsed-selection.ts"],"sourcesContent":["import 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 The HTML element.\n *\n * @return Whether the input/textarea element has some \"selection\".\n */\nexport default function inputFieldHasUncollapsedSelection(\n\telement: Element\n): boolean {\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 { selectionStart, selectionEnd } = element as\n\t\t\tHTMLInputElement | HTMLTextAreaElement;\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 {\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAAwB,kCACvB,SACU;CACV,IAAK,EAAA,GAAEA,2BAAAA,QAAAA,CAAoB,OAAQ,KAAK,EAAA,GAAEC,mBAAAA,QAAAA,CAAa,OAAQ,GAC9D,OAAO;CAMR,IAAI;EACH,MAAM,EAAE,gBAAgB,iBAAiB;EAEzC,OAIC,mBAAmB,QAEnB,mBAAmB;CAErB,QAAQ;EAGP,OAAO;CACR;AACD"}
|
|
@@ -1,31 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/dom/src/dom/insert-after.ts
|
|
21
|
-
var insert_after_exports = {};
|
|
22
|
-
__export(insert_after_exports, {
|
|
23
|
-
default: () => insertAfter
|
|
2
|
+
Object.defineProperties(exports, {
|
|
3
|
+
__esModule: { value: true },
|
|
4
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
24
5
|
});
|
|
25
|
-
|
|
26
|
-
|
|
6
|
+
let ___utils_assert_is_defined_ts = require("../utils/assert-is-defined.cjs");
|
|
7
|
+
// packages/dom/src/dom/insert-after.ts
|
|
8
|
+
/**
|
|
9
|
+
* Given two DOM nodes, inserts the former in the DOM as the next sibling of
|
|
10
|
+
* the latter.
|
|
11
|
+
*
|
|
12
|
+
* @param newNode Node to be inserted.
|
|
13
|
+
* @param referenceNode Node after which to perform the insertion.
|
|
14
|
+
*/
|
|
27
15
|
function insertAfter(newNode, referenceNode) {
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
(0, ___utils_assert_is_defined_ts.assertIsDefined)(referenceNode.parentNode, "referenceNode.parentNode");
|
|
17
|
+
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
|
30
18
|
}
|
|
31
|
-
|
|
19
|
+
exports.default = insertAfter;
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=insert-after.cjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/dom/insert-after.ts"],
|
|
4
|
-
"sourcesContent": ["import { assertIsDefined } from '../utils/assert-is-defined';\n\n/**\n * Given two DOM nodes, inserts the former in the DOM as the next sibling of\n * the latter.\n *\n * @param newNode Node to be inserted.\n * @param referenceNode Node after which to perform the insertion.\n */\nexport default function insertAfter(\n\tnewNode: Node,\n\treferenceNode: Node\n): void {\n\tassertIsDefined( referenceNode.parentNode, 'referenceNode.parentNode' );\n\treferenceNode.parentNode.insertBefore( newNode, referenceNode.nextSibling );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAgC;AASjB,SAAR,YACN,SACA,eACO;AACP,gDAAiB,cAAc,YAAY,0BAA2B;AACtE,gBAAc,WAAW,aAAc,SAAS,cAAc,WAAY;AAC3E;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"insert-after.cjs","names":[],"sources":["../../src/dom/insert-after.ts"],"sourcesContent":["import { assertIsDefined } from '../utils/assert-is-defined';\n\n/**\n * Given two DOM nodes, inserts the former in the DOM as the next sibling of\n * the latter.\n *\n * @param newNode Node to be inserted.\n * @param referenceNode Node after which to perform the insertion.\n */\nexport default function insertAfter(\n\tnewNode: Node,\n\treferenceNode: Node\n): void {\n\tassertIsDefined( referenceNode.parentNode, 'referenceNode.parentNode' );\n\treferenceNode.parentNode.insertBefore( newNode, referenceNode.nextSibling );\n}\n"],"mappings":";;;;;;;;;;;;;;AASA,SAAwB,YACvB,SACA,eACO;CACP,CAAA,GAAA,8BAAA,gBAAA,CAAiB,cAAc,YAAY,0BAA2B;CACtE,cAAc,WAAW,aAAc,SAAS,cAAc,WAAY;AAC3E"}
|