@wix/editor-react-components 1.2289.0 → 1.2290.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/site/components/AccordionComponent/component.js +1 -1
- package/dist/site/components/AccordionComponent/manifest.js +1 -1
- package/dist/site/components/AnimatedIcon/manifest.js +1 -1
- package/dist/site/components/AudioPlayer/component.js +12 -10
- package/dist/site/components/AudioPlayer/manifest.js +1 -1
- package/dist/site/components/BoxContainer/component.js +1 -1
- package/dist/site/components/BoxContainer/manifest.js +1 -1
- package/dist/site/components/Breadcrumbs/component.js +2 -2
- package/dist/site/components/Breadcrumbs/manifest.js +1 -1
- package/dist/site/components/Button/manifest.js +1 -1
- package/dist/site/components/CollapsibleText/component.js +1 -1
- package/dist/site/components/CollapsibleText/manifest.js +1 -1
- package/dist/site/components/DatePicker/component.js +3290 -9827
- package/dist/site/components/DatePicker/manifest.js +1 -1
- package/dist/site/components/Dropdown/component.js +1 -1
- package/dist/site/components/Dropdown/manifest.js +1 -1
- package/dist/site/components/HTMLComponent/component.js +1 -1
- package/dist/site/components/HipaaIcon/component.js +1 -1
- package/dist/site/components/HipaaIcon/manifest.js +1 -1
- package/dist/site/components/LinkBar/component.js +1 -1
- package/dist/site/components/LinkBar/manifest.js +1 -1
- package/dist/site/components/Logo/component.js +1 -1
- package/dist/site/components/Logo/manifest.js +1 -1
- package/dist/site/components/Logo/sdk.js +1 -1
- package/dist/site/components/Lottie/component.js +1 -1
- package/dist/site/components/Lottie/manifest.js +1 -1
- package/dist/site/components/Menu/component.js +1 -1
- package/dist/site/components/Menu/manifest.js +1 -1
- package/dist/site/components/MultiStateBox/component.js +1 -1
- package/dist/site/components/MultiStateBox/manifest.js +1 -1
- package/dist/site/components/ProgressBar/component.js +1 -1
- package/dist/site/components/ProgressBar/manifest.js +1 -1
- package/dist/site/components/ProgressBar/sdk.js +1 -1
- package/dist/site/components/Repeater/component.js +1 -1
- package/dist/site/components/Repeater/manifest.js +1 -1
- package/dist/site/components/ShareButtons/component.js +1 -1
- package/dist/site/components/ShareButtons/manifest.js +1 -1
- package/dist/site/components/Tabs/component.js +1 -1
- package/dist/site/components/Tabs/manifest.js +1 -1
- package/dist/site/components/TextBox/component.js +1 -1
- package/dist/site/components/TextBox/manifest.js +1 -1
- package/dist/site/components/TextEffects3d/component.js +1 -1
- package/dist/site/components/TextEffects3d/manifest.js +1 -1
- package/dist/site/components/TextEffectsBauhaus/component.js +1 -1
- package/dist/site/components/TextEffectsBauhaus/manifest.js +1 -1
- package/dist/site/components/TextEffectsGlass/component.js +1 -1
- package/dist/site/components/TextEffectsGlass/manifest.js +1 -1
- package/dist/site/components/TextEffectsGlitch/component.js +1 -1
- package/dist/site/components/TextEffectsGlitch/manifest.js +1 -1
- package/dist/site/components/TextEffectsLetterPress/component.js +1 -1
- package/dist/site/components/TextEffectsLetterPress/manifest.js +1 -1
- package/dist/site/components/TextEffectsMatrix/component.js +1 -1
- package/dist/site/components/TextEffectsMatrix/manifest.js +1 -1
- package/dist/site/components/TextEffectsNeonSign/component.js +1 -1
- package/dist/site/components/TextEffectsNeonSign/manifest.js +1 -1
- package/dist/site/components/TextEffectsNoisy/component.js +1 -1
- package/dist/site/components/TextEffectsNoisy/manifest.js +1 -1
- package/dist/site/components/TextEffectsOutlineOut/component.js +2 -2
- package/dist/site/components/TextEffectsOutlineOut/manifest.js +1 -1
- package/dist/site/components/TextEffectsRetro/component.js +1 -1
- package/dist/site/components/TextEffectsRetro/manifest.js +1 -1
- package/dist/site/components/TextEffectsShook/component.js +1 -1
- package/dist/site/components/TextEffectsShook/manifest.js +1 -1
- package/dist/site/components/TextEffectsSticker/component.js +1 -1
- package/dist/site/components/TextEffectsSticker/manifest.js +2 -2
- package/dist/site/components/TextEffectsStriped/component.js +1 -1
- package/dist/site/components/TextEffectsStriped/manifest.js +1 -1
- package/dist/site/components/TextInput/component.js +171 -170
- package/dist/site/components/TextInput/manifest.js +1 -1
- package/dist/site/components/TimePicker/TimePicker.d.ts +3 -0
- package/dist/site/components/TimePicker/TimePicker.types.d.ts +29 -0
- package/dist/site/components/TimePicker/component.d.ts +2 -0
- package/dist/site/components/TimePicker/component.js +146 -0
- package/dist/site/components/TimePicker/component.preview.d.ts +2 -0
- package/dist/site/components/TimePicker/components/TimePickerField.d.ts +4 -0
- package/dist/site/components/TimePicker/constants.d.ts +32 -0
- package/dist/site/components/TimePicker/css.css +64 -0
- package/dist/site/components/TimePicker/hooks/useTimePickerValue.d.ts +10 -0
- package/dist/site/components/TimePicker/index.d.ts +2 -0
- package/dist/site/components/TimePicker/index.js +6 -0
- package/dist/site/components/TimePicker/manifest.d.ts +5 -0
- package/dist/site/components/TimePicker/manifest.js +113 -0
- package/dist/site/components/TimePicker/timePickerUtils.d.ts +15 -0
- package/dist/site/components/chunks/AnimatedIcon.js +1 -1
- package/dist/site/components/chunks/Button.js +1 -1
- package/dist/site/components/chunks/Button2.js +10 -829
- package/dist/site/components/chunks/DateField.js +6763 -0
- package/dist/site/components/chunks/Group.js +42 -155
- package/dist/site/components/chunks/I18nProvider.js +3 -3
- package/dist/site/components/chunks/Input.js +5 -5
- package/dist/site/components/chunks/Patterns.js +1 -1
- package/dist/site/components/chunks/TextEffectsShared.js +1 -1
- package/dist/site/components/chunks/constants10.js +14 -12
- package/dist/site/components/chunks/constants11.js +9 -9
- package/dist/site/components/chunks/constants12.js +10 -8
- package/dist/site/components/chunks/constants13.js +9 -13
- package/dist/site/components/chunks/constants14.js +14 -17
- package/dist/site/components/chunks/constants15.js +17 -12
- package/dist/site/components/chunks/constants16.js +11 -13
- package/dist/site/components/chunks/constants17.js +20 -66
- package/dist/site/components/chunks/constants18.js +67 -17
- package/dist/site/components/chunks/constants19.js +15 -50
- package/dist/site/components/chunks/constants2.js +30 -50
- package/dist/site/components/chunks/constants20.js +43 -45
- package/dist/site/components/chunks/constants21.js +48 -297
- package/dist/site/components/chunks/constants22.js +299 -41
- package/dist/site/components/chunks/constants23.js +44 -29
- package/dist/site/components/chunks/constants24.js +32 -17
- package/dist/site/components/chunks/constants25.js +16 -402
- package/dist/site/components/chunks/constants26.js +393 -73
- package/dist/site/components/chunks/constants27.js +80 -15
- package/dist/site/components/chunks/constants28.js +11 -42
- package/dist/site/components/chunks/constants29.js +44 -23
- package/dist/site/components/chunks/constants3.js +49 -14
- package/dist/site/components/chunks/constants30.js +28 -10
- package/dist/site/components/chunks/constants31.js +10 -132
- package/dist/site/components/chunks/constants32.js +112 -147
- package/dist/site/components/chunks/constants33.js +152 -49
- package/dist/site/components/chunks/constants34.js +53 -71
- package/dist/site/components/chunks/constants35.js +73 -77
- package/dist/site/components/chunks/constants36.js +76 -57
- package/dist/site/components/chunks/constants37.js +72 -0
- package/dist/site/components/chunks/constants4.js +10 -19
- package/dist/site/components/chunks/constants5.js +14 -14
- package/dist/site/components/chunks/constants6.js +11 -10
- package/dist/site/components/chunks/constants7.js +14 -14
- package/dist/site/components/chunks/constants8.js +22 -65
- package/dist/site/components/chunks/constants9.js +65 -20
- package/dist/site/components/chunks/filterDOMProps.js +7 -7
- package/dist/site/components/chunks/manifestBase.js +1 -1
- package/dist/site/components/chunks/useFocusable.js +118 -0
- package/dist/site/components/chunks/useLocalizedStringFormatter.js +1 -1
- package/dist/site/components/chunks/usePress.js +825 -0
- package/dist/site/components/chunks/utils.js +1 -1
- package/dist/site/components/extensions.js +9 -4
- package/package.json +3 -3
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
4
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
5
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
6
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
7
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
8
|
-
var _shouldStopPropagation;
|
|
9
|
-
import { A as $2add3ce32c6007eb$export$fedb369cb70207f1, r as $d447af545b77c9f1$export$b204af158042fbac, M as $081cb5757e08788e$export$24490316f764c430, v as $d447af545b77c9f1$export$f21a1ffae260145a, D as $48a7d519b337145d$export$4eaf04e54aa8eed6, i as $fe16bffc7a557bf0$export$7f54fc3180508a52, N as $a92dc41f639950be$export$c2b7abe5d61ec696, O as $a92dc41f639950be$export$525bc4921d56d4a, p as $23f2114a1b82827e$export$4282f70798064fe0, d as $23f2114a1b82827e$export$e58f029f0fbfdb29, P as $b5c62b033c25b96d$export$29bf1b5f2c56cf63, Q as $a92dc41f639950be$export$cabe61c495ee3649, B as $1969ac565cfec8d0$export$de79e2c695e052f3, R as $b5c62b033c25b96d$export$60278871457622de, c as $bbaa08b3cd72f041$export$9d1611c77c2fe928, S as $b7115c395c64f7b5$export$4debdb1a3f0fa79e, T as $caaf0dd3060ed57c$export$95185d699e05d4d7, H as $a4e76a5424781910$export$e08e3b67e392101e, G as $2add3ce32c6007eb$export$9ac100e40613ea10, a as $d1116acdf220c2da$export$4c014de7c8940b4c, E as $2c9edc598a03d523$export$420e68273165f4ec, n as $0c4a58759813079a$export$4e328f61c538687f, m as $e969f22b6713ca4a$export$ae780daf29e6d456, F as $390e54f620492c70$export$f680877a34711e37 } from "./Group.js";
|
|
10
|
-
import React__default, { useState, useRef, useCallback, useMemo, useEffect, useContext, createContext } from "react";
|
|
1
|
+
import { c as $bbaa08b3cd72f041$export$9d1611c77c2fe928, w as $2c9edc598a03d523$export$420e68273165f4ec, A as $0c4a58759813079a$export$4e328f61c538687f, B as $e969f22b6713ca4a$export$ae780daf29e6d456, x as $390e54f620492c70$export$f680877a34711e37 } from "./Group.js";
|
|
2
|
+
import React__default, { useState, useMemo, createContext, useRef, useEffect } from "react";
|
|
11
3
|
import { $ as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f, a as $f39a9eba43920ace$export$86427a43e3e48ebb, b as $64fa3d84918910a7$export$29f1550f4b0d4415, f as $64fa3d84918910a7$export$4d86445c2cf5e3, g as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps.js";
|
|
12
|
-
import {
|
|
4
|
+
import { $ as $d1116acdf220c2da$export$4c014de7c8940b4c } from "./useFocusable.js";
|
|
5
|
+
import { a as $d27d541f9569d26d$export$45712eceda6fad21 } from "./usePress.js";
|
|
13
6
|
const $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY = 7e3;
|
|
14
7
|
let $319e236875307eab$var$liveAnnouncer = null;
|
|
15
8
|
function $319e236875307eab$export$a9b970dcc4ae71a9(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
|
|
@@ -84,812 +77,6 @@ class $319e236875307eab$var$LiveAnnouncer {
|
|
|
84
77
|
}
|
|
85
78
|
}
|
|
86
79
|
}
|
|
87
|
-
let $1dfb119a85e764e5$var$formatterCache = /* @__PURE__ */ new Map();
|
|
88
|
-
let $1dfb119a85e764e5$var$supportsSignDisplay = false;
|
|
89
|
-
try {
|
|
90
|
-
$1dfb119a85e764e5$var$supportsSignDisplay = new Intl.NumberFormat("de-DE", {
|
|
91
|
-
signDisplay: "exceptZero"
|
|
92
|
-
}).resolvedOptions().signDisplay === "exceptZero";
|
|
93
|
-
} catch {
|
|
94
|
-
}
|
|
95
|
-
let $1dfb119a85e764e5$var$supportsUnit = false;
|
|
96
|
-
try {
|
|
97
|
-
$1dfb119a85e764e5$var$supportsUnit = new Intl.NumberFormat("de-DE", {
|
|
98
|
-
style: "unit",
|
|
99
|
-
unit: "degree"
|
|
100
|
-
}).resolvedOptions().style === "unit";
|
|
101
|
-
} catch {
|
|
102
|
-
}
|
|
103
|
-
const $1dfb119a85e764e5$var$UNITS = {
|
|
104
|
-
degree: {
|
|
105
|
-
narrow: {
|
|
106
|
-
default: "°",
|
|
107
|
-
"ja-JP": " 度",
|
|
108
|
-
"zh-TW": "度",
|
|
109
|
-
"sl-SI": " °"
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
class $1dfb119a85e764e5$export$cc77c4ff7e8673c5 {
|
|
114
|
-
constructor(locale, options = {}) {
|
|
115
|
-
this.numberFormatter = $1dfb119a85e764e5$var$getCachedNumberFormatter(locale, options);
|
|
116
|
-
this.options = options;
|
|
117
|
-
}
|
|
118
|
-
/** Formats a number value as a string, according to the locale and options provided to the constructor. */
|
|
119
|
-
format(value) {
|
|
120
|
-
var _a;
|
|
121
|
-
let res = "";
|
|
122
|
-
if (!$1dfb119a85e764e5$var$supportsSignDisplay && this.options.signDisplay != null) res = $1dfb119a85e764e5$export$711b50b3c525e0f2(this.numberFormatter, this.options.signDisplay, value);
|
|
123
|
-
else res = this.numberFormatter.format(value);
|
|
124
|
-
if (this.options.style === "unit" && !$1dfb119a85e764e5$var$supportsUnit) {
|
|
125
|
-
let { unit, unitDisplay = "short", locale } = this.resolvedOptions();
|
|
126
|
-
if (!unit) return res;
|
|
127
|
-
let values = (_a = $1dfb119a85e764e5$var$UNITS[unit]) == null ? void 0 : _a[unitDisplay];
|
|
128
|
-
res += values[locale] || values.default;
|
|
129
|
-
}
|
|
130
|
-
return res;
|
|
131
|
-
}
|
|
132
|
-
/** Formats a number to an array of parts such as separators, digits, punctuation, and more. */
|
|
133
|
-
formatToParts(value) {
|
|
134
|
-
return this.numberFormatter.formatToParts(value);
|
|
135
|
-
}
|
|
136
|
-
/** Formats a number range as a string. */
|
|
137
|
-
formatRange(start, end) {
|
|
138
|
-
if (typeof this.numberFormatter.formatRange === "function") return this.numberFormatter.formatRange(start, end);
|
|
139
|
-
if (end < start) throw new RangeError("End date must be >= start date");
|
|
140
|
-
return `${this.format(start)} – ${this.format(end)}`;
|
|
141
|
-
}
|
|
142
|
-
/** Formats a number range as an array of parts. */
|
|
143
|
-
formatRangeToParts(start, end) {
|
|
144
|
-
if (typeof this.numberFormatter.formatRangeToParts === "function") return this.numberFormatter.formatRangeToParts(start, end);
|
|
145
|
-
if (end < start) throw new RangeError("End date must be >= start date");
|
|
146
|
-
let startParts = this.numberFormatter.formatToParts(start);
|
|
147
|
-
let endParts = this.numberFormatter.formatToParts(end);
|
|
148
|
-
return [
|
|
149
|
-
...startParts.map((p) => ({
|
|
150
|
-
...p,
|
|
151
|
-
source: "startRange"
|
|
152
|
-
})),
|
|
153
|
-
{
|
|
154
|
-
type: "literal",
|
|
155
|
-
value: " – ",
|
|
156
|
-
source: "shared"
|
|
157
|
-
},
|
|
158
|
-
...endParts.map((p) => ({
|
|
159
|
-
...p,
|
|
160
|
-
source: "endRange"
|
|
161
|
-
}))
|
|
162
|
-
];
|
|
163
|
-
}
|
|
164
|
-
/** Returns the resolved formatting options based on the values passed to the constructor. */
|
|
165
|
-
resolvedOptions() {
|
|
166
|
-
let options = this.numberFormatter.resolvedOptions();
|
|
167
|
-
if (!$1dfb119a85e764e5$var$supportsSignDisplay && this.options.signDisplay != null) options = {
|
|
168
|
-
...options,
|
|
169
|
-
signDisplay: this.options.signDisplay
|
|
170
|
-
};
|
|
171
|
-
if (!$1dfb119a85e764e5$var$supportsUnit && this.options.style === "unit") options = {
|
|
172
|
-
...options,
|
|
173
|
-
style: "unit",
|
|
174
|
-
unit: this.options.unit,
|
|
175
|
-
unitDisplay: this.options.unitDisplay
|
|
176
|
-
};
|
|
177
|
-
return options;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
function $1dfb119a85e764e5$var$getCachedNumberFormatter(locale, options = {}) {
|
|
181
|
-
var _a;
|
|
182
|
-
let { numberingSystem } = options;
|
|
183
|
-
if (numberingSystem && locale.includes("-nu-")) {
|
|
184
|
-
if (!locale.includes("-u-")) locale += "-u-";
|
|
185
|
-
locale += `-nu-${numberingSystem}`;
|
|
186
|
-
}
|
|
187
|
-
if (options.style === "unit" && !$1dfb119a85e764e5$var$supportsUnit) {
|
|
188
|
-
let { unit, unitDisplay = "short" } = options;
|
|
189
|
-
if (!unit) throw new Error('unit option must be provided with style: "unit"');
|
|
190
|
-
if (!((_a = $1dfb119a85e764e5$var$UNITS[unit]) == null ? void 0 : _a[unitDisplay])) throw new Error(`Unsupported unit ${unit} with unitDisplay = ${unitDisplay}`);
|
|
191
|
-
options = {
|
|
192
|
-
...options,
|
|
193
|
-
style: "decimal"
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
|
|
197
|
-
if ($1dfb119a85e764e5$var$formatterCache.has(cacheKey)) return $1dfb119a85e764e5$var$formatterCache.get(cacheKey);
|
|
198
|
-
let numberFormatter = new Intl.NumberFormat(locale, options);
|
|
199
|
-
$1dfb119a85e764e5$var$formatterCache.set(cacheKey, numberFormatter);
|
|
200
|
-
return numberFormatter;
|
|
201
|
-
}
|
|
202
|
-
function $1dfb119a85e764e5$export$711b50b3c525e0f2(numberFormat, signDisplay, num) {
|
|
203
|
-
if (signDisplay === "auto") return numberFormat.format(num);
|
|
204
|
-
else if (signDisplay === "never") return numberFormat.format(Math.abs(num));
|
|
205
|
-
else {
|
|
206
|
-
let needsPositiveSign = false;
|
|
207
|
-
if (signDisplay === "always") needsPositiveSign = num > 0 || Object.is(num, 0);
|
|
208
|
-
else if (signDisplay === "exceptZero") {
|
|
209
|
-
if (Object.is(num, -0) || Object.is(num, 0)) num = Math.abs(num);
|
|
210
|
-
else needsPositiveSign = num > 0;
|
|
211
|
-
}
|
|
212
|
-
if (needsPositiveSign) {
|
|
213
|
-
let negative = numberFormat.format(-num);
|
|
214
|
-
let noSign = numberFormat.format(num);
|
|
215
|
-
let minus = negative.replace(noSign, "").replace(/\u200e|\u061C/, "");
|
|
216
|
-
if ([
|
|
217
|
-
...minus
|
|
218
|
-
].length !== 1) console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case");
|
|
219
|
-
let positive = negative.replace(noSign, "!!!").replace(minus, "+").replace("!!!", noSign);
|
|
220
|
-
return positive;
|
|
221
|
-
} else return numberFormat.format(num);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
let $cbf007e418543821$var$state = "default";
|
|
225
|
-
let $cbf007e418543821$var$savedUserSelect = "";
|
|
226
|
-
let $cbf007e418543821$var$modifiedElementMap = /* @__PURE__ */ new WeakMap();
|
|
227
|
-
function $cbf007e418543821$export$16a4697467175487(target) {
|
|
228
|
-
if ($2add3ce32c6007eb$export$fedb369cb70207f1()) {
|
|
229
|
-
if ($cbf007e418543821$var$state === "default") {
|
|
230
|
-
const documentObject = $d447af545b77c9f1$export$b204af158042fbac(target);
|
|
231
|
-
$cbf007e418543821$var$savedUserSelect = documentObject.documentElement.style.webkitUserSelect;
|
|
232
|
-
documentObject.documentElement.style.webkitUserSelect = "none";
|
|
233
|
-
}
|
|
234
|
-
$cbf007e418543821$var$state = "disabled";
|
|
235
|
-
} else if (target instanceof HTMLElement || target instanceof SVGElement) {
|
|
236
|
-
let property = "userSelect" in target.style ? "userSelect" : "webkitUserSelect";
|
|
237
|
-
$cbf007e418543821$var$modifiedElementMap.set(target, target.style[property]);
|
|
238
|
-
target.style[property] = "none";
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
function $cbf007e418543821$export$b0d6fa1ab32e3295(target) {
|
|
242
|
-
if ($2add3ce32c6007eb$export$fedb369cb70207f1()) {
|
|
243
|
-
if ($cbf007e418543821$var$state !== "disabled") return;
|
|
244
|
-
$cbf007e418543821$var$state = "restoring";
|
|
245
|
-
setTimeout(() => {
|
|
246
|
-
$081cb5757e08788e$export$24490316f764c430(() => {
|
|
247
|
-
if ($cbf007e418543821$var$state === "restoring") {
|
|
248
|
-
const documentObject = $d447af545b77c9f1$export$b204af158042fbac(target);
|
|
249
|
-
if (documentObject.documentElement.style.webkitUserSelect === "none") documentObject.documentElement.style.webkitUserSelect = $cbf007e418543821$var$savedUserSelect || "";
|
|
250
|
-
$cbf007e418543821$var$savedUserSelect = "";
|
|
251
|
-
$cbf007e418543821$var$state = "default";
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
}, 300);
|
|
255
|
-
} else if (target instanceof HTMLElement || target instanceof SVGElement) {
|
|
256
|
-
if (target && $cbf007e418543821$var$modifiedElementMap.has(target)) {
|
|
257
|
-
let targetOldUserSelect = $cbf007e418543821$var$modifiedElementMap.get(target);
|
|
258
|
-
let property = "userSelect" in target.style ? "userSelect" : "webkitUserSelect";
|
|
259
|
-
if (target.style[property] === "none") target.style[property] = targetOldUserSelect;
|
|
260
|
-
if (target.getAttribute("style") === "") target.removeAttribute("style");
|
|
261
|
-
$cbf007e418543821$var$modifiedElementMap.delete(target);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
function $2b2d34ff061957fb$var$getWebpackNonce(doc) {
|
|
266
|
-
let ownerWindow = doc == null ? void 0 : doc.defaultView;
|
|
267
|
-
return (ownerWindow == null ? void 0 : ownerWindow.__webpack_nonce__) || globalThis["__webpack_nonce__"] || void 0;
|
|
268
|
-
}
|
|
269
|
-
let $2b2d34ff061957fb$var$nonceCache = /* @__PURE__ */ new WeakMap();
|
|
270
|
-
function $2b2d34ff061957fb$export$2b85b721e524d74b(doc) {
|
|
271
|
-
let d = doc ?? (typeof document !== "undefined" ? document : void 0);
|
|
272
|
-
if (!d) return $2b2d34ff061957fb$var$getWebpackNonce(d);
|
|
273
|
-
if ($2b2d34ff061957fb$var$nonceCache.has(d)) return $2b2d34ff061957fb$var$nonceCache.get(d);
|
|
274
|
-
let meta = d.querySelector('meta[property="csp-nonce"]');
|
|
275
|
-
let nonce = meta && meta instanceof $d447af545b77c9f1$export$f21a1ffae260145a(meta).HTMLMetaElement && (meta.nonce || meta.content) || $2b2d34ff061957fb$var$getWebpackNonce(d) || void 0;
|
|
276
|
-
if (nonce !== void 0) $2b2d34ff061957fb$var$nonceCache.set(d, nonce);
|
|
277
|
-
return nonce;
|
|
278
|
-
}
|
|
279
|
-
const $24f9a20f226ad820$export$5165eccb35aaadb5 = React__default.createContext({
|
|
280
|
-
register: () => {
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
$24f9a20f226ad820$export$5165eccb35aaadb5.displayName = "PressResponderContext";
|
|
284
|
-
function $d27d541f9569d26d$var$usePressResponderContext(props) {
|
|
285
|
-
let context = useContext($24f9a20f226ad820$export$5165eccb35aaadb5);
|
|
286
|
-
if (context) {
|
|
287
|
-
let { register, ref, ...contextProps } = context;
|
|
288
|
-
props = $bbaa08b3cd72f041$export$9d1611c77c2fe928(contextProps, props);
|
|
289
|
-
register();
|
|
290
|
-
}
|
|
291
|
-
$b7115c395c64f7b5$export$4debdb1a3f0fa79e(context, props.ref);
|
|
292
|
-
return props;
|
|
293
|
-
}
|
|
294
|
-
class $d27d541f9569d26d$var$PressEvent {
|
|
295
|
-
constructor(type, pointerType, originalEvent, state) {
|
|
296
|
-
__privateAdd(this, _shouldStopPropagation);
|
|
297
|
-
__privateSet(this, _shouldStopPropagation, true);
|
|
298
|
-
let currentTarget = (state == null ? void 0 : state.target) ?? originalEvent.currentTarget;
|
|
299
|
-
const rect = currentTarget == null ? void 0 : currentTarget.getBoundingClientRect();
|
|
300
|
-
let x, y = 0;
|
|
301
|
-
let clientX, clientY = null;
|
|
302
|
-
if (originalEvent.clientX != null && originalEvent.clientY != null) {
|
|
303
|
-
clientX = originalEvent.clientX;
|
|
304
|
-
clientY = originalEvent.clientY;
|
|
305
|
-
}
|
|
306
|
-
if (rect) {
|
|
307
|
-
if (clientX != null && clientY != null) {
|
|
308
|
-
x = clientX - rect.left;
|
|
309
|
-
y = clientY - rect.top;
|
|
310
|
-
} else {
|
|
311
|
-
x = rect.width / 2;
|
|
312
|
-
y = rect.height / 2;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
this.type = type;
|
|
316
|
-
this.pointerType = pointerType;
|
|
317
|
-
this.target = originalEvent.currentTarget;
|
|
318
|
-
this.shiftKey = originalEvent.shiftKey;
|
|
319
|
-
this.metaKey = originalEvent.metaKey;
|
|
320
|
-
this.ctrlKey = originalEvent.ctrlKey;
|
|
321
|
-
this.altKey = originalEvent.altKey;
|
|
322
|
-
this.x = x;
|
|
323
|
-
this.y = y;
|
|
324
|
-
this.key = originalEvent.key;
|
|
325
|
-
}
|
|
326
|
-
continuePropagation() {
|
|
327
|
-
__privateSet(this, _shouldStopPropagation, false);
|
|
328
|
-
}
|
|
329
|
-
get shouldStopPropagation() {
|
|
330
|
-
return __privateGet(this, _shouldStopPropagation);
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
_shouldStopPropagation = new WeakMap();
|
|
334
|
-
const $d27d541f9569d26d$var$LINK_CLICKED = Symbol("linkClicked");
|
|
335
|
-
const $d27d541f9569d26d$var$STYLE_ID = "react-aria-pressable-style";
|
|
336
|
-
const $d27d541f9569d26d$var$PRESSABLE_ATTRIBUTE = "data-react-aria-pressable";
|
|
337
|
-
function $d27d541f9569d26d$export$45712eceda6fad21(props) {
|
|
338
|
-
let { onPress, onPressChange, onPressStart, onPressEnd, onPressUp, onClick, isDisabled, isPressed: isPressedProp, preventFocusOnPress, shouldCancelOnPointerExit, allowTextSelectionOnPress, ref: domRef, ...domProps } = $d27d541f9569d26d$var$usePressResponderContext(props);
|
|
339
|
-
let [isPressed, setPressed] = useState(false);
|
|
340
|
-
let ref = useRef({
|
|
341
|
-
isPressed: false,
|
|
342
|
-
ignoreEmulatedMouseEvents: false,
|
|
343
|
-
didFirePressStart: false,
|
|
344
|
-
isTriggeringEvent: false,
|
|
345
|
-
activePointerId: null,
|
|
346
|
-
target: null,
|
|
347
|
-
isOverTarget: false,
|
|
348
|
-
pointerType: null,
|
|
349
|
-
disposables: []
|
|
350
|
-
});
|
|
351
|
-
let { addGlobalListener, removeAllGlobalListeners } = $48a7d519b337145d$export$4eaf04e54aa8eed6();
|
|
352
|
-
let triggerPressStart = useCallback((originalEvent, pointerType) => {
|
|
353
|
-
let state = ref.current;
|
|
354
|
-
if (isDisabled || state.didFirePressStart) return false;
|
|
355
|
-
let shouldStopPropagation = true;
|
|
356
|
-
state.isTriggeringEvent = true;
|
|
357
|
-
if (onPressStart) {
|
|
358
|
-
let event = new $d27d541f9569d26d$var$PressEvent("pressstart", pointerType, originalEvent);
|
|
359
|
-
onPressStart(event);
|
|
360
|
-
shouldStopPropagation = event.shouldStopPropagation;
|
|
361
|
-
}
|
|
362
|
-
if (onPressChange) onPressChange(true);
|
|
363
|
-
state.isTriggeringEvent = false;
|
|
364
|
-
state.didFirePressStart = true;
|
|
365
|
-
setPressed(true);
|
|
366
|
-
return shouldStopPropagation;
|
|
367
|
-
}, [
|
|
368
|
-
isDisabled,
|
|
369
|
-
onPressStart,
|
|
370
|
-
onPressChange
|
|
371
|
-
]);
|
|
372
|
-
let triggerPressEnd = useCallback((originalEvent, pointerType, wasPressed = true) => {
|
|
373
|
-
let state = ref.current;
|
|
374
|
-
if (!state.didFirePressStart) return false;
|
|
375
|
-
state.didFirePressStart = false;
|
|
376
|
-
state.isTriggeringEvent = true;
|
|
377
|
-
let shouldStopPropagation = true;
|
|
378
|
-
if (onPressEnd) {
|
|
379
|
-
let event = new $d27d541f9569d26d$var$PressEvent("pressend", pointerType, originalEvent);
|
|
380
|
-
onPressEnd(event);
|
|
381
|
-
shouldStopPropagation = event.shouldStopPropagation;
|
|
382
|
-
}
|
|
383
|
-
if (onPressChange) onPressChange(false);
|
|
384
|
-
setPressed(false);
|
|
385
|
-
if (onPress && wasPressed && !isDisabled) {
|
|
386
|
-
let event = new $d27d541f9569d26d$var$PressEvent("press", pointerType, originalEvent);
|
|
387
|
-
onPress(event);
|
|
388
|
-
shouldStopPropagation && (shouldStopPropagation = event.shouldStopPropagation);
|
|
389
|
-
}
|
|
390
|
-
state.isTriggeringEvent = false;
|
|
391
|
-
return shouldStopPropagation;
|
|
392
|
-
}, [
|
|
393
|
-
isDisabled,
|
|
394
|
-
onPressEnd,
|
|
395
|
-
onPressChange,
|
|
396
|
-
onPress
|
|
397
|
-
]);
|
|
398
|
-
let triggerPressEndEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(triggerPressEnd);
|
|
399
|
-
let triggerPressUp = useCallback((originalEvent, pointerType) => {
|
|
400
|
-
let state = ref.current;
|
|
401
|
-
if (isDisabled) return false;
|
|
402
|
-
if (onPressUp) {
|
|
403
|
-
state.isTriggeringEvent = true;
|
|
404
|
-
let event = new $d27d541f9569d26d$var$PressEvent("pressup", pointerType, originalEvent);
|
|
405
|
-
onPressUp(event);
|
|
406
|
-
state.isTriggeringEvent = false;
|
|
407
|
-
return event.shouldStopPropagation;
|
|
408
|
-
}
|
|
409
|
-
return true;
|
|
410
|
-
}, [
|
|
411
|
-
isDisabled,
|
|
412
|
-
onPressUp
|
|
413
|
-
]);
|
|
414
|
-
let triggerPressUpEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(triggerPressUp);
|
|
415
|
-
let cancel = useCallback((e) => {
|
|
416
|
-
let state = ref.current;
|
|
417
|
-
if (state.isPressed && state.target) {
|
|
418
|
-
if (state.didFirePressStart && state.pointerType != null) triggerPressEnd($d27d541f9569d26d$var$createEvent(state.target, e), state.pointerType, false);
|
|
419
|
-
state.isPressed = false;
|
|
420
|
-
state.isOverTarget = false;
|
|
421
|
-
state.activePointerId = null;
|
|
422
|
-
state.pointerType = null;
|
|
423
|
-
removeAllGlobalListeners();
|
|
424
|
-
if (!allowTextSelectionOnPress) $cbf007e418543821$export$b0d6fa1ab32e3295(state.target);
|
|
425
|
-
for (let dispose of state.disposables) dispose();
|
|
426
|
-
state.disposables = [];
|
|
427
|
-
}
|
|
428
|
-
}, [
|
|
429
|
-
allowTextSelectionOnPress,
|
|
430
|
-
removeAllGlobalListeners,
|
|
431
|
-
triggerPressEnd
|
|
432
|
-
]);
|
|
433
|
-
let cancelEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(cancel);
|
|
434
|
-
let cancelOnPointerExit = useCallback((e) => {
|
|
435
|
-
if (shouldCancelOnPointerExit) cancel(e);
|
|
436
|
-
}, [
|
|
437
|
-
shouldCancelOnPointerExit,
|
|
438
|
-
cancel
|
|
439
|
-
]);
|
|
440
|
-
let triggerClick = useCallback((e) => {
|
|
441
|
-
if (isDisabled) return;
|
|
442
|
-
onClick == null ? void 0 : onClick(e);
|
|
443
|
-
}, [
|
|
444
|
-
isDisabled,
|
|
445
|
-
onClick
|
|
446
|
-
]);
|
|
447
|
-
let triggerSyntheticClick = useCallback((e, target) => {
|
|
448
|
-
if (isDisabled) return;
|
|
449
|
-
if (onClick) {
|
|
450
|
-
let event = new MouseEvent("click", e);
|
|
451
|
-
$a92dc41f639950be$export$c2b7abe5d61ec696(event, target);
|
|
452
|
-
onClick($a92dc41f639950be$export$525bc4921d56d4a(event));
|
|
453
|
-
}
|
|
454
|
-
}, [
|
|
455
|
-
isDisabled,
|
|
456
|
-
onClick
|
|
457
|
-
]);
|
|
458
|
-
let pressProps = useMemo(() => {
|
|
459
|
-
let state = ref.current;
|
|
460
|
-
let pressProps2 = {
|
|
461
|
-
onKeyDown(e) {
|
|
462
|
-
var _a;
|
|
463
|
-
if ($d27d541f9569d26d$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && $23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) {
|
|
464
|
-
if ($d27d541f9569d26d$var$shouldPreventDefaultKeyboard($23f2114a1b82827e$export$e58f029f0fbfdb29(e), e.key)) e.preventDefault();
|
|
465
|
-
let shouldStopPropagation = true;
|
|
466
|
-
if (!state.isPressed && !e.repeat) {
|
|
467
|
-
state.target = e.currentTarget;
|
|
468
|
-
state.isPressed = true;
|
|
469
|
-
state.pointerType = "keyboard";
|
|
470
|
-
shouldStopPropagation = triggerPressStart(e, "keyboard");
|
|
471
|
-
}
|
|
472
|
-
let originalTarget = e.currentTarget;
|
|
473
|
-
let pressUp = (e2) => {
|
|
474
|
-
if ($d27d541f9569d26d$var$isValidKeyboardEvent(e2, originalTarget) && !e2.repeat && $23f2114a1b82827e$export$4282f70798064fe0(originalTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e2)) && state.target)
|
|
475
|
-
triggerPressUpEvent($d27d541f9569d26d$var$createEvent(state.target, e2), "keyboard");
|
|
476
|
-
};
|
|
477
|
-
addGlobalListener($d447af545b77c9f1$export$b204af158042fbac(e.currentTarget), "keyup", $a4e76a5424781910$export$e08e3b67e392101e(pressUp, onKeyUp), true);
|
|
478
|
-
if (shouldStopPropagation) e.stopPropagation();
|
|
479
|
-
if (e.metaKey && $2add3ce32c6007eb$export$9ac100e40613ea10()) (_a = state.metaKeyEvents) == null ? void 0 : _a.set(e.key, e.nativeEvent);
|
|
480
|
-
} else if (e.key === "Meta") state.metaKeyEvents = /* @__PURE__ */ new Map();
|
|
481
|
-
},
|
|
482
|
-
onClick(e) {
|
|
483
|
-
if (e && !$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
484
|
-
if (e && e.button === 0 && !state.isTriggeringEvent && !$caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening) {
|
|
485
|
-
let shouldStopPropagation = true;
|
|
486
|
-
if (isDisabled) e.preventDefault();
|
|
487
|
-
if (!state.ignoreEmulatedMouseEvents && !state.isPressed && (state.pointerType === "virtual" || $b5c62b033c25b96d$export$60278871457622de(e.nativeEvent))) {
|
|
488
|
-
let stopPressStart = triggerPressStart(e, "virtual");
|
|
489
|
-
let stopPressUp = triggerPressUpEvent(e, "virtual");
|
|
490
|
-
let stopPressEnd = triggerPressEndEvent(e, "virtual");
|
|
491
|
-
triggerClick(e);
|
|
492
|
-
shouldStopPropagation = stopPressStart && stopPressUp && stopPressEnd;
|
|
493
|
-
} else if (state.isPressed && state.pointerType !== "keyboard") {
|
|
494
|
-
let pointerType = state.pointerType || e.nativeEvent.pointerType || "virtual";
|
|
495
|
-
let stopPressUp = triggerPressUpEvent($d27d541f9569d26d$var$createEvent(e.currentTarget, e), pointerType);
|
|
496
|
-
let stopPressEnd = triggerPressEndEvent($d27d541f9569d26d$var$createEvent(e.currentTarget, e), pointerType, true);
|
|
497
|
-
shouldStopPropagation = stopPressUp && stopPressEnd;
|
|
498
|
-
state.isOverTarget = false;
|
|
499
|
-
triggerClick(e);
|
|
500
|
-
cancelEvent(e);
|
|
501
|
-
}
|
|
502
|
-
state.ignoreEmulatedMouseEvents = false;
|
|
503
|
-
if (shouldStopPropagation) e.stopPropagation();
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
};
|
|
507
|
-
let onKeyUp = (e) => {
|
|
508
|
-
var _a, _b, _c;
|
|
509
|
-
if (state.isPressed && state.target && $d27d541f9569d26d$var$isValidKeyboardEvent(e, state.target)) {
|
|
510
|
-
if ($d27d541f9569d26d$var$shouldPreventDefaultKeyboard($23f2114a1b82827e$export$e58f029f0fbfdb29(e), e.key)) e.preventDefault();
|
|
511
|
-
let target = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
|
|
512
|
-
let wasPressed = $23f2114a1b82827e$export$4282f70798064fe0(state.target, target);
|
|
513
|
-
triggerPressEndEvent($d27d541f9569d26d$var$createEvent(state.target, e), "keyboard", wasPressed);
|
|
514
|
-
if (wasPressed) triggerSyntheticClick(e, state.target);
|
|
515
|
-
removeAllGlobalListeners();
|
|
516
|
-
if (e.key !== "Enter" && $d27d541f9569d26d$var$isHTMLAnchorLink(state.target) && $23f2114a1b82827e$export$4282f70798064fe0(state.target, target) && !e[$d27d541f9569d26d$var$LINK_CLICKED]) {
|
|
517
|
-
e[$d27d541f9569d26d$var$LINK_CLICKED] = true;
|
|
518
|
-
$caaf0dd3060ed57c$export$95185d699e05d4d7(state.target, e, false);
|
|
519
|
-
}
|
|
520
|
-
state.isPressed = false;
|
|
521
|
-
(_a = state.metaKeyEvents) == null ? void 0 : _a.delete(e.key);
|
|
522
|
-
} else if (e.key === "Meta" && ((_b = state.metaKeyEvents) == null ? void 0 : _b.size)) {
|
|
523
|
-
let events = state.metaKeyEvents;
|
|
524
|
-
state.metaKeyEvents = void 0;
|
|
525
|
-
for (let event of events.values()) (_c = state.target) == null ? void 0 : _c.dispatchEvent(new KeyboardEvent("keyup", event));
|
|
526
|
-
}
|
|
527
|
-
};
|
|
528
|
-
if (typeof PointerEvent !== "undefined") {
|
|
529
|
-
pressProps2.onPointerDown = (e) => {
|
|
530
|
-
if (e.button !== 0 || !$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
531
|
-
if ($b5c62b033c25b96d$export$29bf1b5f2c56cf63(e.nativeEvent)) {
|
|
532
|
-
state.pointerType = "virtual";
|
|
533
|
-
return;
|
|
534
|
-
}
|
|
535
|
-
state.pointerType = e.pointerType;
|
|
536
|
-
let shouldStopPropagation = true;
|
|
537
|
-
if (!state.isPressed) {
|
|
538
|
-
state.isPressed = true;
|
|
539
|
-
state.isOverTarget = true;
|
|
540
|
-
state.activePointerId = e.pointerId;
|
|
541
|
-
state.target = e.currentTarget;
|
|
542
|
-
if (!allowTextSelectionOnPress) $cbf007e418543821$export$16a4697467175487(state.target);
|
|
543
|
-
shouldStopPropagation = triggerPressStart(e, state.pointerType);
|
|
544
|
-
let target = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
|
|
545
|
-
if ("releasePointerCapture" in target) {
|
|
546
|
-
if ("hasPointerCapture" in target) {
|
|
547
|
-
if (target.hasPointerCapture(e.pointerId)) target.releasePointerCapture(e.pointerId);
|
|
548
|
-
} else target.releasePointerCapture(e.pointerId);
|
|
549
|
-
}
|
|
550
|
-
addGlobalListener($d447af545b77c9f1$export$b204af158042fbac(e.currentTarget), "pointerup", onPointerUp, false);
|
|
551
|
-
addGlobalListener($d447af545b77c9f1$export$b204af158042fbac(e.currentTarget), "pointercancel", onPointerCancel, false);
|
|
552
|
-
}
|
|
553
|
-
if (shouldStopPropagation) e.stopPropagation();
|
|
554
|
-
};
|
|
555
|
-
pressProps2.onMouseDown = (e) => {
|
|
556
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
557
|
-
if (e.button === 0) {
|
|
558
|
-
if (preventFocusOnPress) {
|
|
559
|
-
let dispose = $a92dc41f639950be$export$cabe61c495ee3649(e.target);
|
|
560
|
-
if (dispose) state.disposables.push(dispose);
|
|
561
|
-
}
|
|
562
|
-
e.stopPropagation();
|
|
563
|
-
}
|
|
564
|
-
};
|
|
565
|
-
pressProps2.onPointerUp = (e) => {
|
|
566
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e)) || state.pointerType === "virtual") return;
|
|
567
|
-
if (e.button === 0 && !state.isPressed)
|
|
568
|
-
triggerPressUpEvent(e, state.pointerType || e.pointerType);
|
|
569
|
-
};
|
|
570
|
-
pressProps2.onPointerEnter = (e) => {
|
|
571
|
-
if (e.pointerId === state.activePointerId && state.target && !state.isOverTarget && state.pointerType != null) {
|
|
572
|
-
state.isOverTarget = true;
|
|
573
|
-
triggerPressStart($d27d541f9569d26d$var$createEvent(state.target, e), state.pointerType);
|
|
574
|
-
}
|
|
575
|
-
};
|
|
576
|
-
pressProps2.onPointerLeave = (e) => {
|
|
577
|
-
if (e.pointerId === state.activePointerId && state.target && state.isOverTarget && state.pointerType != null) {
|
|
578
|
-
state.isOverTarget = false;
|
|
579
|
-
triggerPressEndEvent($d27d541f9569d26d$var$createEvent(state.target, e), state.pointerType, false);
|
|
580
|
-
cancelOnPointerExit(e);
|
|
581
|
-
}
|
|
582
|
-
};
|
|
583
|
-
let onPointerUp = (e) => {
|
|
584
|
-
if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) {
|
|
585
|
-
if ($23f2114a1b82827e$export$4282f70798064fe0(state.target, $23f2114a1b82827e$export$e58f029f0fbfdb29(e)) && state.pointerType != null) {
|
|
586
|
-
let clicked = false;
|
|
587
|
-
let timeout = setTimeout(() => {
|
|
588
|
-
if (state.isPressed && state.target instanceof HTMLElement) {
|
|
589
|
-
if (clicked)
|
|
590
|
-
cancelEvent(e);
|
|
591
|
-
else {
|
|
592
|
-
$1969ac565cfec8d0$export$de79e2c695e052f3(state.target);
|
|
593
|
-
state.target.click();
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
}, 80);
|
|
597
|
-
addGlobalListener(e.currentTarget, "click", () => clicked = true, true);
|
|
598
|
-
state.disposables.push(() => clearTimeout(timeout));
|
|
599
|
-
} else
|
|
600
|
-
cancelEvent(e);
|
|
601
|
-
state.isOverTarget = false;
|
|
602
|
-
}
|
|
603
|
-
};
|
|
604
|
-
let onPointerCancel = (e) => {
|
|
605
|
-
cancelEvent(e);
|
|
606
|
-
};
|
|
607
|
-
pressProps2.onDragStart = (e) => {
|
|
608
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
609
|
-
cancelEvent(e);
|
|
610
|
-
};
|
|
611
|
-
} else if (process.env.NODE_ENV === "test") {
|
|
612
|
-
pressProps2.onMouseDown = (e) => {
|
|
613
|
-
if (e.button !== 0 || !$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
614
|
-
if (state.ignoreEmulatedMouseEvents) {
|
|
615
|
-
e.stopPropagation();
|
|
616
|
-
return;
|
|
617
|
-
}
|
|
618
|
-
state.isPressed = true;
|
|
619
|
-
state.isOverTarget = true;
|
|
620
|
-
state.target = e.currentTarget;
|
|
621
|
-
state.pointerType = $b5c62b033c25b96d$export$60278871457622de(e.nativeEvent) ? "virtual" : "mouse";
|
|
622
|
-
let shouldStopPropagation = flushSync(() => triggerPressStart(e, state.pointerType));
|
|
623
|
-
if (shouldStopPropagation) e.stopPropagation();
|
|
624
|
-
if (preventFocusOnPress) {
|
|
625
|
-
let dispose = $a92dc41f639950be$export$cabe61c495ee3649(e.target);
|
|
626
|
-
if (dispose) state.disposables.push(dispose);
|
|
627
|
-
}
|
|
628
|
-
addGlobalListener($d447af545b77c9f1$export$b204af158042fbac(e.currentTarget), "mouseup", onMouseUp, false);
|
|
629
|
-
};
|
|
630
|
-
pressProps2.onMouseEnter = (e) => {
|
|
631
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
632
|
-
let shouldStopPropagation = true;
|
|
633
|
-
if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
|
|
634
|
-
state.isOverTarget = true;
|
|
635
|
-
shouldStopPropagation = triggerPressStart(e, state.pointerType);
|
|
636
|
-
}
|
|
637
|
-
if (shouldStopPropagation) e.stopPropagation();
|
|
638
|
-
};
|
|
639
|
-
pressProps2.onMouseLeave = (e) => {
|
|
640
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
641
|
-
let shouldStopPropagation = true;
|
|
642
|
-
if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
|
|
643
|
-
state.isOverTarget = false;
|
|
644
|
-
shouldStopPropagation = triggerPressEndEvent(e, state.pointerType, false);
|
|
645
|
-
cancelOnPointerExit(e);
|
|
646
|
-
}
|
|
647
|
-
if (shouldStopPropagation) e.stopPropagation();
|
|
648
|
-
};
|
|
649
|
-
pressProps2.onMouseUp = (e) => {
|
|
650
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
651
|
-
if (!state.ignoreEmulatedMouseEvents && e.button === 0 && !state.isPressed)
|
|
652
|
-
triggerPressUpEvent(e, state.pointerType || "mouse");
|
|
653
|
-
};
|
|
654
|
-
let onMouseUp = (e) => {
|
|
655
|
-
if (e.button !== 0) return;
|
|
656
|
-
if (state.ignoreEmulatedMouseEvents) {
|
|
657
|
-
state.ignoreEmulatedMouseEvents = false;
|
|
658
|
-
return;
|
|
659
|
-
}
|
|
660
|
-
if (state.target && $23f2114a1b82827e$export$4282f70798064fe0(state.target, $23f2114a1b82827e$export$e58f029f0fbfdb29(e)) && state.pointerType != null) ;
|
|
661
|
-
else
|
|
662
|
-
cancelEvent(e);
|
|
663
|
-
state.isOverTarget = false;
|
|
664
|
-
};
|
|
665
|
-
pressProps2.onTouchStart = (e) => {
|
|
666
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
667
|
-
let touch = $d27d541f9569d26d$var$getTouchFromEvent(e.nativeEvent);
|
|
668
|
-
if (!touch) return;
|
|
669
|
-
state.activePointerId = touch.identifier;
|
|
670
|
-
state.ignoreEmulatedMouseEvents = true;
|
|
671
|
-
state.isOverTarget = true;
|
|
672
|
-
state.isPressed = true;
|
|
673
|
-
state.target = e.currentTarget;
|
|
674
|
-
state.pointerType = "touch";
|
|
675
|
-
if (!allowTextSelectionOnPress) $cbf007e418543821$export$16a4697467175487(state.target);
|
|
676
|
-
let shouldStopPropagation = triggerPressStart($d27d541f9569d26d$var$createTouchEvent(state.target, e), state.pointerType);
|
|
677
|
-
if (shouldStopPropagation) e.stopPropagation();
|
|
678
|
-
addGlobalListener($d447af545b77c9f1$export$f21a1ffae260145a(e.currentTarget), "scroll", onScroll, true);
|
|
679
|
-
};
|
|
680
|
-
pressProps2.onTouchMove = (e) => {
|
|
681
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
682
|
-
if (!state.isPressed) {
|
|
683
|
-
e.stopPropagation();
|
|
684
|
-
return;
|
|
685
|
-
}
|
|
686
|
-
let touch = $d27d541f9569d26d$var$getTouchById(e.nativeEvent, state.activePointerId);
|
|
687
|
-
let shouldStopPropagation = true;
|
|
688
|
-
if (touch && $d27d541f9569d26d$var$isOverTarget(touch, e.currentTarget)) {
|
|
689
|
-
if (!state.isOverTarget && state.pointerType != null) {
|
|
690
|
-
state.isOverTarget = true;
|
|
691
|
-
shouldStopPropagation = triggerPressStart($d27d541f9569d26d$var$createTouchEvent(state.target, e), state.pointerType);
|
|
692
|
-
}
|
|
693
|
-
} else if (state.isOverTarget && state.pointerType != null) {
|
|
694
|
-
state.isOverTarget = false;
|
|
695
|
-
shouldStopPropagation = triggerPressEndEvent($d27d541f9569d26d$var$createTouchEvent(state.target, e), state.pointerType, false);
|
|
696
|
-
cancelOnPointerExit($d27d541f9569d26d$var$createTouchEvent(state.target, e));
|
|
697
|
-
}
|
|
698
|
-
if (shouldStopPropagation) e.stopPropagation();
|
|
699
|
-
};
|
|
700
|
-
pressProps2.onTouchEnd = (e) => {
|
|
701
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
702
|
-
if (!state.isPressed) {
|
|
703
|
-
e.stopPropagation();
|
|
704
|
-
return;
|
|
705
|
-
}
|
|
706
|
-
let touch = $d27d541f9569d26d$var$getTouchById(e.nativeEvent, state.activePointerId);
|
|
707
|
-
let shouldStopPropagation = true;
|
|
708
|
-
if (touch && $d27d541f9569d26d$var$isOverTarget(touch, e.currentTarget) && state.pointerType != null) {
|
|
709
|
-
triggerPressUpEvent($d27d541f9569d26d$var$createTouchEvent(state.target, e), state.pointerType);
|
|
710
|
-
shouldStopPropagation = triggerPressEndEvent($d27d541f9569d26d$var$createTouchEvent(state.target, e), state.pointerType);
|
|
711
|
-
triggerSyntheticClick(e.nativeEvent, state.target);
|
|
712
|
-
} else if (state.isOverTarget && state.pointerType != null)
|
|
713
|
-
shouldStopPropagation = triggerPressEndEvent($d27d541f9569d26d$var$createTouchEvent(state.target, e), state.pointerType, false);
|
|
714
|
-
if (shouldStopPropagation) e.stopPropagation();
|
|
715
|
-
state.isPressed = false;
|
|
716
|
-
state.activePointerId = null;
|
|
717
|
-
state.isOverTarget = false;
|
|
718
|
-
state.ignoreEmulatedMouseEvents = true;
|
|
719
|
-
if (state.target && !allowTextSelectionOnPress) $cbf007e418543821$export$b0d6fa1ab32e3295(state.target);
|
|
720
|
-
removeAllGlobalListeners();
|
|
721
|
-
};
|
|
722
|
-
pressProps2.onTouchCancel = (e) => {
|
|
723
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
724
|
-
e.stopPropagation();
|
|
725
|
-
if (state.isPressed)
|
|
726
|
-
cancelEvent($d27d541f9569d26d$var$createTouchEvent(state.target, e));
|
|
727
|
-
};
|
|
728
|
-
let onScroll = (e) => {
|
|
729
|
-
if (state.isPressed && $23f2114a1b82827e$export$4282f70798064fe0($23f2114a1b82827e$export$e58f029f0fbfdb29(e), state.target))
|
|
730
|
-
cancelEvent({
|
|
731
|
-
currentTarget: state.target,
|
|
732
|
-
shiftKey: false,
|
|
733
|
-
ctrlKey: false,
|
|
734
|
-
metaKey: false,
|
|
735
|
-
altKey: false
|
|
736
|
-
});
|
|
737
|
-
};
|
|
738
|
-
pressProps2.onDragStart = (e) => {
|
|
739
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
740
|
-
cancelEvent(e);
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
return pressProps2;
|
|
744
|
-
}, [
|
|
745
|
-
addGlobalListener,
|
|
746
|
-
isDisabled,
|
|
747
|
-
preventFocusOnPress,
|
|
748
|
-
removeAllGlobalListeners,
|
|
749
|
-
allowTextSelectionOnPress,
|
|
750
|
-
cancelOnPointerExit,
|
|
751
|
-
triggerPressStart,
|
|
752
|
-
triggerClick,
|
|
753
|
-
triggerSyntheticClick
|
|
754
|
-
]);
|
|
755
|
-
useEffect(() => {
|
|
756
|
-
if (!domRef || process.env.NODE_ENV === "test") return;
|
|
757
|
-
const ownerDocument = $d447af545b77c9f1$export$b204af158042fbac(domRef.current);
|
|
758
|
-
if (!ownerDocument || !ownerDocument.head || ownerDocument.getElementById($d27d541f9569d26d$var$STYLE_ID)) return;
|
|
759
|
-
const style = ownerDocument.createElement("style");
|
|
760
|
-
style.id = $d27d541f9569d26d$var$STYLE_ID;
|
|
761
|
-
let nonce = $2b2d34ff061957fb$export$2b85b721e524d74b(ownerDocument);
|
|
762
|
-
if (nonce) style.nonce = nonce;
|
|
763
|
-
style.textContent = `
|
|
764
|
-
@layer {
|
|
765
|
-
[${$d27d541f9569d26d$var$PRESSABLE_ATTRIBUTE}] {
|
|
766
|
-
touch-action: pan-x pan-y pinch-zoom;
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
`.trim();
|
|
770
|
-
ownerDocument.head.prepend(style);
|
|
771
|
-
}, [
|
|
772
|
-
domRef
|
|
773
|
-
]);
|
|
774
|
-
useEffect(() => {
|
|
775
|
-
let state = ref.current;
|
|
776
|
-
return () => {
|
|
777
|
-
if (!allowTextSelectionOnPress) $cbf007e418543821$export$b0d6fa1ab32e3295(state.target ?? void 0);
|
|
778
|
-
for (let dispose of state.disposables) dispose();
|
|
779
|
-
state.disposables = [];
|
|
780
|
-
};
|
|
781
|
-
}, [
|
|
782
|
-
allowTextSelectionOnPress
|
|
783
|
-
]);
|
|
784
|
-
return {
|
|
785
|
-
isPressed: isPressedProp || isPressed,
|
|
786
|
-
pressProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(domProps, pressProps, {
|
|
787
|
-
[$d27d541f9569d26d$var$PRESSABLE_ATTRIBUTE]: true
|
|
788
|
-
})
|
|
789
|
-
};
|
|
790
|
-
}
|
|
791
|
-
function $d27d541f9569d26d$var$isHTMLAnchorLink(target) {
|
|
792
|
-
return target.tagName === "A" && target.hasAttribute("href");
|
|
793
|
-
}
|
|
794
|
-
function $d27d541f9569d26d$var$isValidKeyboardEvent(event, currentTarget) {
|
|
795
|
-
const { key, code } = event;
|
|
796
|
-
const element = currentTarget;
|
|
797
|
-
const role = element.getAttribute("role");
|
|
798
|
-
return (key === "Enter" || key === " " || key === "Spacebar" || code === "Space") && !(element instanceof $d447af545b77c9f1$export$f21a1ffae260145a(element).HTMLInputElement && !$d27d541f9569d26d$var$isValidInputKey(element, key) || element instanceof $d447af545b77c9f1$export$f21a1ffae260145a(element).HTMLTextAreaElement || element.isContentEditable) && // Links should only trigger with Enter key
|
|
799
|
-
!((role === "link" || !role && $d27d541f9569d26d$var$isHTMLAnchorLink(element)) && key !== "Enter");
|
|
800
|
-
}
|
|
801
|
-
function $d27d541f9569d26d$var$getTouchFromEvent(event) {
|
|
802
|
-
const { targetTouches } = event;
|
|
803
|
-
if (targetTouches.length > 0) return targetTouches[0];
|
|
804
|
-
return null;
|
|
805
|
-
}
|
|
806
|
-
function $d27d541f9569d26d$var$getTouchById(event, pointerId) {
|
|
807
|
-
const changedTouches = event.changedTouches;
|
|
808
|
-
for (let i = 0; i < changedTouches.length; i++) {
|
|
809
|
-
const touch = changedTouches[i];
|
|
810
|
-
if (touch.identifier === pointerId) return touch;
|
|
811
|
-
}
|
|
812
|
-
return null;
|
|
813
|
-
}
|
|
814
|
-
function $d27d541f9569d26d$var$createTouchEvent(target, e) {
|
|
815
|
-
let clientX = 0;
|
|
816
|
-
let clientY = 0;
|
|
817
|
-
if (e.targetTouches && e.targetTouches.length === 1) {
|
|
818
|
-
clientX = e.targetTouches[0].clientX;
|
|
819
|
-
clientY = e.targetTouches[0].clientY;
|
|
820
|
-
}
|
|
821
|
-
return {
|
|
822
|
-
currentTarget: target,
|
|
823
|
-
shiftKey: e.shiftKey,
|
|
824
|
-
ctrlKey: e.ctrlKey,
|
|
825
|
-
metaKey: e.metaKey,
|
|
826
|
-
altKey: e.altKey,
|
|
827
|
-
clientX,
|
|
828
|
-
clientY
|
|
829
|
-
};
|
|
830
|
-
}
|
|
831
|
-
function $d27d541f9569d26d$var$createEvent(target, e) {
|
|
832
|
-
let clientX = e.clientX;
|
|
833
|
-
let clientY = e.clientY;
|
|
834
|
-
return {
|
|
835
|
-
currentTarget: target,
|
|
836
|
-
shiftKey: e.shiftKey,
|
|
837
|
-
ctrlKey: e.ctrlKey,
|
|
838
|
-
metaKey: e.metaKey,
|
|
839
|
-
altKey: e.altKey,
|
|
840
|
-
clientX,
|
|
841
|
-
clientY,
|
|
842
|
-
key: e.key
|
|
843
|
-
};
|
|
844
|
-
}
|
|
845
|
-
function $d27d541f9569d26d$var$getPointClientRect(point) {
|
|
846
|
-
let offsetX = 0;
|
|
847
|
-
let offsetY = 0;
|
|
848
|
-
if (point.width !== void 0) offsetX = point.width / 2;
|
|
849
|
-
else if (point.radiusX !== void 0) offsetX = point.radiusX;
|
|
850
|
-
if (point.height !== void 0) offsetY = point.height / 2;
|
|
851
|
-
else if (point.radiusY !== void 0) offsetY = point.radiusY;
|
|
852
|
-
return {
|
|
853
|
-
top: point.clientY - offsetY,
|
|
854
|
-
right: point.clientX + offsetX,
|
|
855
|
-
bottom: point.clientY + offsetY,
|
|
856
|
-
left: point.clientX - offsetX
|
|
857
|
-
};
|
|
858
|
-
}
|
|
859
|
-
function $d27d541f9569d26d$var$areRectanglesOverlapping(a, b) {
|
|
860
|
-
if (a.left > b.right || b.left > a.right) return false;
|
|
861
|
-
if (a.top > b.bottom || b.top > a.bottom) return false;
|
|
862
|
-
return true;
|
|
863
|
-
}
|
|
864
|
-
function $d27d541f9569d26d$var$isOverTarget(point, target) {
|
|
865
|
-
let rect = target.getBoundingClientRect();
|
|
866
|
-
let pointRect = $d27d541f9569d26d$var$getPointClientRect(point);
|
|
867
|
-
return $d27d541f9569d26d$var$areRectanglesOverlapping(rect, pointRect);
|
|
868
|
-
}
|
|
869
|
-
function $d27d541f9569d26d$var$shouldPreventDefaultUp(target) {
|
|
870
|
-
if (target instanceof HTMLInputElement) return false;
|
|
871
|
-
if (target instanceof HTMLButtonElement) return target.type !== "submit" && target.type !== "reset";
|
|
872
|
-
if ($d27d541f9569d26d$var$isHTMLAnchorLink(target)) return false;
|
|
873
|
-
return true;
|
|
874
|
-
}
|
|
875
|
-
function $d27d541f9569d26d$var$shouldPreventDefaultKeyboard(target, key) {
|
|
876
|
-
if (target instanceof HTMLInputElement) return !$d27d541f9569d26d$var$isValidInputKey(target, key);
|
|
877
|
-
return $d27d541f9569d26d$var$shouldPreventDefaultUp(target);
|
|
878
|
-
}
|
|
879
|
-
const $d27d541f9569d26d$var$nonTextInputTypes = /* @__PURE__ */ new Set([
|
|
880
|
-
"checkbox",
|
|
881
|
-
"radio",
|
|
882
|
-
"range",
|
|
883
|
-
"color",
|
|
884
|
-
"file",
|
|
885
|
-
"image",
|
|
886
|
-
"button",
|
|
887
|
-
"submit",
|
|
888
|
-
"reset"
|
|
889
|
-
]);
|
|
890
|
-
function $d27d541f9569d26d$var$isValidInputKey(target, key) {
|
|
891
|
-
return target.type === "checkbox" || target.type === "radio" ? key === " " : $d27d541f9569d26d$var$nonTextInputTypes.has(target.type);
|
|
892
|
-
}
|
|
893
80
|
function $ac4318a9c075bb9f$export$ea18c227d4417cc3(props, ref) {
|
|
894
81
|
let { elementType = "button", isDisabled, onPress, onPressStart, onPressEnd, onPressUp, onPressChange, preventFocusOnPress, allowFocusWhenDisabled, onClick, href, target, rel, type = "button" } = props;
|
|
895
82
|
let additionalProps;
|
|
@@ -1103,16 +290,10 @@ function $d2b4bc8c273e7be6$var$disablePendingProps(props) {
|
|
|
1103
290
|
return props;
|
|
1104
291
|
}
|
|
1105
292
|
export {
|
|
1106
|
-
$
|
|
1107
|
-
$
|
|
1108
|
-
$
|
|
1109
|
-
$ea3928288112382f$export$
|
|
1110
|
-
$
|
|
1111
|
-
$240e9101ba2842f5$export$
|
|
1112
|
-
$d2b4bc8c273e7be6$export$24d547caef80ccd1 as f,
|
|
1113
|
-
$ea3928288112382f$export$a966af930f325cab as g,
|
|
1114
|
-
$d2b4bc8c273e7be6$export$353f5b6fc5456de1 as h,
|
|
1115
|
-
$cbf007e418543821$export$b0d6fa1ab32e3295 as i,
|
|
1116
|
-
$cbf007e418543821$export$16a4697467175487 as j,
|
|
1117
|
-
$240e9101ba2842f5$export$cb6e0bb50bc19463 as k
|
|
293
|
+
$ea3928288112382f$export$439d29a4e110a164 as $,
|
|
294
|
+
$240e9101ba2842f5$export$7d15b64cf5a3a4c4 as a,
|
|
295
|
+
$d2b4bc8c273e7be6$export$24d547caef80ccd1 as b,
|
|
296
|
+
$ea3928288112382f$export$a966af930f325cab as c,
|
|
297
|
+
$d2b4bc8c273e7be6$export$353f5b6fc5456de1 as d,
|
|
298
|
+
$240e9101ba2842f5$export$cb6e0bb50bc19463 as e
|
|
1118
299
|
};
|