@wix/editor-react-components 1.2309.0 → 1.2311.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/AudioPlayer/component.js +3 -4
- package/dist/site/components/Breadcrumbs/component.js +1 -1
- package/dist/site/components/Button/component.js +1 -1
- package/dist/site/components/CollapsibleText/component.js +1 -1
- package/dist/site/components/DatePicker/component.js +8 -965
- package/dist/site/components/Image3/css.css +3 -1
- package/dist/site/components/Lottie/component.js +1 -1
- package/dist/site/components/Menu/component.js +1 -1
- package/dist/site/components/SiteLogo/css.css +9 -1
- package/dist/site/components/Slideshow/component.js +1 -1
- package/dist/site/components/SvgImage/css.css +6 -0
- package/dist/site/components/TextInput/component.js +2 -3
- package/dist/site/components/TextMarquee/component.js +6 -6
- package/dist/site/components/TimePicker/TimePicker.types.d.ts +31 -0
- package/dist/site/components/TimePicker/component.js +119 -17
- package/dist/site/components/TimePicker/constants.d.ts +63 -1
- package/dist/site/components/TimePicker/css.css +126 -0
- package/dist/site/components/TimePicker/hooks/useTimeConstraints.d.ts +8 -0
- package/dist/site/components/TimePicker/hooks/useTimePickerValue.d.ts +2 -1
- package/dist/site/components/TimePicker/manifest.js +142 -3
- package/dist/site/components/TimePicker/timePickerUtils.d.ts +2 -0
- package/dist/site/components/chunks/Button.js +1057 -347
- package/dist/site/components/chunks/Button2.js +351 -285
- package/dist/site/components/chunks/Group.js +160 -47
- package/dist/site/components/chunks/Input.js +14 -14
- package/dist/site/components/chunks/SvgImageTint.js +7 -5
- package/dist/site/components/chunks/{DateField.js → Tooltip.js} +1017 -52
- package/dist/site/components/chunks/VisuallyHidden.js +47 -0
- package/dist/site/components/chunks/constants2.js +62 -4
- package/dist/site/components/chunks/filterDOMProps.js +3 -3
- package/package.json +2 -2
- package/dist/site/components/chunks/useFocusable.js +0 -118
- package/dist/site/components/chunks/usePress.js +0 -825
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { e as $bbaa08b3cd72f041$export$9d1611c77c2fe928, L as $2c9edc598a03d523$export$420e68273165f4ec } from "./Group.js";
|
|
2
|
+
import React__default, { useState, useMemo } from "react";
|
|
3
|
+
const $ea3928288112382f$var$styles = {
|
|
4
|
+
border: 0,
|
|
5
|
+
clip: "rect(0 0 0 0)",
|
|
6
|
+
clipPath: "inset(50%)",
|
|
7
|
+
height: "1px",
|
|
8
|
+
margin: "-1px",
|
|
9
|
+
overflow: "hidden",
|
|
10
|
+
padding: 0,
|
|
11
|
+
position: "absolute",
|
|
12
|
+
width: "1px",
|
|
13
|
+
whiteSpace: "nowrap"
|
|
14
|
+
};
|
|
15
|
+
function $ea3928288112382f$export$a966af930f325cab(props = {}) {
|
|
16
|
+
let { style, isFocusable } = props;
|
|
17
|
+
let [isFocused, setFocused] = useState(false);
|
|
18
|
+
let { focusWithinProps } = $2c9edc598a03d523$export$420e68273165f4ec({
|
|
19
|
+
isDisabled: !isFocusable,
|
|
20
|
+
onFocusWithinChange: (val) => setFocused(val)
|
|
21
|
+
});
|
|
22
|
+
let combinedStyles = useMemo(() => {
|
|
23
|
+
if (isFocused) return style;
|
|
24
|
+
else if (style) return {
|
|
25
|
+
...$ea3928288112382f$var$styles,
|
|
26
|
+
...style
|
|
27
|
+
};
|
|
28
|
+
else return $ea3928288112382f$var$styles;
|
|
29
|
+
}, [
|
|
30
|
+
isFocused
|
|
31
|
+
]);
|
|
32
|
+
return {
|
|
33
|
+
visuallyHiddenProps: {
|
|
34
|
+
...focusWithinProps,
|
|
35
|
+
style: combinedStyles
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function $ea3928288112382f$export$439d29a4e110a164(props) {
|
|
40
|
+
let { children, elementType: Element = "div", isFocusable, style, ...otherProps } = props;
|
|
41
|
+
let { visuallyHiddenProps } = $ea3928288112382f$export$a966af930f325cab(props);
|
|
42
|
+
return /* @__PURE__ */ React__default.createElement(Element, $bbaa08b3cd72f041$export$9d1611c77c2fe928(otherProps, visuallyHiddenProps), children);
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
$ea3928288112382f$export$439d29a4e110a164 as $,
|
|
46
|
+
$ea3928288112382f$export$a966af930f325cab as a
|
|
47
|
+
};
|
|
@@ -2,36 +2,94 @@ const DisplayNames = {
|
|
|
2
2
|
root: {
|
|
3
3
|
elementDisplayName: "Time Picker",
|
|
4
4
|
data: {
|
|
5
|
-
value: "Selected time"
|
|
5
|
+
value: "Selected time",
|
|
6
|
+
granularity: {
|
|
7
|
+
displayName: "Time precision",
|
|
8
|
+
options: {
|
|
9
|
+
hour: "Hours only",
|
|
10
|
+
minute: "Hours and minutes",
|
|
11
|
+
second: "Hours, minutes and seconds"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
hourCycle: {
|
|
15
|
+
displayName: "Hour format",
|
|
16
|
+
options: {
|
|
17
|
+
auto: "Auto (locale)",
|
|
18
|
+
h12: "12-hour",
|
|
19
|
+
h24: "24-hour"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
shouldForceLeadingZeros: "Always show leading zeros",
|
|
23
|
+
tooltip: "Tooltip",
|
|
24
|
+
label: "Label",
|
|
25
|
+
placeholder: "Placeholder time (HH:MM)",
|
|
26
|
+
description: "Helper text",
|
|
27
|
+
minTime: "Earliest time (HH:MM)",
|
|
28
|
+
maxTime: "Latest time (HH:MM)",
|
|
29
|
+
required: "Required",
|
|
30
|
+
readOnly: "Read only",
|
|
31
|
+
disabled: "Disabled",
|
|
32
|
+
clearable: "Show clear button"
|
|
6
33
|
},
|
|
7
34
|
elements: {
|
|
35
|
+
label: "Label",
|
|
8
36
|
timeInput: "Time input"
|
|
37
|
+
},
|
|
38
|
+
cssCustomProperties: {
|
|
39
|
+
labelSpacing: "Label spacing",
|
|
40
|
+
segmentFocusBackgroundColor: "Focused segment background",
|
|
41
|
+
segmentFocusTextColor: "Focused segment text color"
|
|
9
42
|
}
|
|
10
43
|
}
|
|
11
44
|
};
|
|
45
|
+
const defaultValues = {
|
|
46
|
+
granularity: "minute",
|
|
47
|
+
hourCycle: "auto",
|
|
48
|
+
shouldForceLeadingZeros: false,
|
|
49
|
+
tooltip: "",
|
|
50
|
+
label: "",
|
|
51
|
+
description: "",
|
|
52
|
+
required: false,
|
|
53
|
+
readOnly: false,
|
|
54
|
+
disabled: false,
|
|
55
|
+
clearable: false
|
|
56
|
+
};
|
|
57
|
+
var HourCycleValues = /* @__PURE__ */ ((HourCycleValues2) => {
|
|
58
|
+
HourCycleValues2["Auto"] = "auto";
|
|
59
|
+
HourCycleValues2["H12"] = "12";
|
|
60
|
+
HourCycleValues2["H24"] = "24";
|
|
61
|
+
return HourCycleValues2;
|
|
62
|
+
})(HourCycleValues || {});
|
|
12
63
|
const EMPTY_VALUE = "";
|
|
13
64
|
const TRANSLATIONS_NAMESPACE = "timePicker";
|
|
14
65
|
const TranslationKeys = {
|
|
15
|
-
ariaLabel: "timePicker_aria_label"
|
|
66
|
+
ariaLabel: "timePicker_aria_label",
|
|
67
|
+
clearButton: "timePicker_clear_button"
|
|
16
68
|
};
|
|
17
69
|
const DefaultTranslations = {
|
|
18
|
-
ariaLabel: "Time picker"
|
|
70
|
+
ariaLabel: "Time picker",
|
|
71
|
+
clearButton: "Clear"
|
|
19
72
|
};
|
|
20
73
|
const TestIds = {
|
|
21
74
|
root: "timepicker-root",
|
|
22
75
|
group: "timepicker-group",
|
|
23
|
-
field: "timepicker-field"
|
|
76
|
+
field: "timepicker-field",
|
|
77
|
+
clearButton: "timepicker-clear-button",
|
|
78
|
+
tooltipButton: "timepicker-tooltip-button"
|
|
24
79
|
};
|
|
25
80
|
const selectors = {
|
|
26
81
|
root: "timePicker",
|
|
82
|
+
label: "timePicker__label",
|
|
27
83
|
group: "timePicker__group"
|
|
28
84
|
};
|
|
29
85
|
export {
|
|
30
86
|
DefaultTranslations as D,
|
|
31
87
|
EMPTY_VALUE as E,
|
|
88
|
+
HourCycleValues as H,
|
|
32
89
|
TestIds as T,
|
|
33
90
|
TRANSLATIONS_NAMESPACE as a,
|
|
34
91
|
TranslationKeys as b,
|
|
35
92
|
DisplayNames as c,
|
|
93
|
+
defaultValues as d,
|
|
36
94
|
selectors as s
|
|
37
95
|
};
|
|
@@ -474,10 +474,10 @@ export {
|
|
|
474
474
|
$64fa3d84918910a7$export$4d86445c2cf5e3 as f,
|
|
475
475
|
$65484d02dcb7eb3e$export$457c3d6518dd4c6f as g,
|
|
476
476
|
$64fa3d84918910a7$export$2881499e37b75b9a as h,
|
|
477
|
-
$
|
|
477
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as i,
|
|
478
478
|
$c7eafbbe1ea5834e$export$535bd6ca7f90a273 as j,
|
|
479
|
-
$
|
|
480
|
-
$
|
|
479
|
+
$df56164dff5785e2$export$4338b53315abf666 as k,
|
|
480
|
+
$c7eafbbe1ea5834e$export$619500959fc48b26 as l,
|
|
481
481
|
$f39a9eba43920ace$export$b5d7cc18bb8d2b59 as m,
|
|
482
482
|
$3ef42575df84b30b$export$9d1611c77c2fe928 as n,
|
|
483
483
|
$64fa3d84918910a7$export$c62b8e45d58ddad9 as o,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/editor-react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2311.0",
|
|
4
4
|
"description": "React components for the Wix Editor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -190,5 +190,5 @@
|
|
|
190
190
|
"registry": "https://registry.npmjs.org/",
|
|
191
191
|
"access": "public"
|
|
192
192
|
},
|
|
193
|
-
"falconPackageHash": "
|
|
193
|
+
"falconPackageHash": "98e07715a51f6eca5d6848f1c3835877a4aaa99e229aecda048e5367"
|
|
194
194
|
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { P as $1e74c67db218ce67$export$f8168d8dd8fd66e6, c as $bbaa08b3cd72f041$export$9d1611c77c2fe928, n as $f192c2f16961cbe0$export$80f3e147d781571c, M as $b7115c395c64f7b5$export$4debdb1a3f0fa79e } from "./Group.js";
|
|
2
|
-
import React__default, { useRef, useCallback, useMemo, useEffect, useContext } from "react";
|
|
3
|
-
function $8dba16319206abb6$export$48d1ea6320830260(handler) {
|
|
4
|
-
if (!handler) return void 0;
|
|
5
|
-
let shouldStopPropagation = true;
|
|
6
|
-
return (e) => {
|
|
7
|
-
let event = {
|
|
8
|
-
...e,
|
|
9
|
-
preventDefault() {
|
|
10
|
-
e.preventDefault();
|
|
11
|
-
},
|
|
12
|
-
isDefaultPrevented() {
|
|
13
|
-
return e.isDefaultPrevented();
|
|
14
|
-
},
|
|
15
|
-
stopPropagation() {
|
|
16
|
-
if (shouldStopPropagation && process.env.NODE_ENV !== "production") console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.");
|
|
17
|
-
else shouldStopPropagation = true;
|
|
18
|
-
},
|
|
19
|
-
continuePropagation() {
|
|
20
|
-
shouldStopPropagation = false;
|
|
21
|
-
},
|
|
22
|
-
isPropagationStopped() {
|
|
23
|
-
return shouldStopPropagation;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
handler(event);
|
|
27
|
-
if (shouldStopPropagation) e.stopPropagation();
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function $8296dad1a4c5e0dc$export$8f71654801c2f7cd(props) {
|
|
31
|
-
return {
|
|
32
|
-
keyboardProps: props.isDisabled ? {} : {
|
|
33
|
-
onKeyDown: $8dba16319206abb6$export$48d1ea6320830260(props.onKeyDown),
|
|
34
|
-
onKeyUp: $8dba16319206abb6$export$48d1ea6320830260(props.onKeyUp)
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function $03e8ab2d84d7657a$export$4338b53315abf666(ref) {
|
|
39
|
-
const objRef = useRef(null);
|
|
40
|
-
const cleanupRef = useRef(void 0);
|
|
41
|
-
const refEffect = useCallback((instance) => {
|
|
42
|
-
if (typeof ref === "function") {
|
|
43
|
-
const refCallback = ref;
|
|
44
|
-
const refCleanup = refCallback(instance);
|
|
45
|
-
return () => {
|
|
46
|
-
if (typeof refCleanup === "function") refCleanup();
|
|
47
|
-
else refCallback(null);
|
|
48
|
-
};
|
|
49
|
-
} else if (ref) {
|
|
50
|
-
ref.current = instance;
|
|
51
|
-
return () => {
|
|
52
|
-
ref.current = null;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}, [
|
|
56
|
-
ref
|
|
57
|
-
]);
|
|
58
|
-
return useMemo(() => ({
|
|
59
|
-
get current() {
|
|
60
|
-
return objRef.current;
|
|
61
|
-
},
|
|
62
|
-
set current(value) {
|
|
63
|
-
objRef.current = value;
|
|
64
|
-
if (cleanupRef.current) {
|
|
65
|
-
cleanupRef.current();
|
|
66
|
-
cleanupRef.current = void 0;
|
|
67
|
-
}
|
|
68
|
-
if (value != null) cleanupRef.current = refEffect(value);
|
|
69
|
-
}
|
|
70
|
-
}), [
|
|
71
|
-
refEffect
|
|
72
|
-
]);
|
|
73
|
-
}
|
|
74
|
-
let $d1116acdf220c2da$export$f9762fab77588ecb = /* @__PURE__ */ React__default.createContext(null);
|
|
75
|
-
function $d1116acdf220c2da$var$useFocusableContext(ref) {
|
|
76
|
-
let context = useContext($d1116acdf220c2da$export$f9762fab77588ecb) || {};
|
|
77
|
-
$b7115c395c64f7b5$export$4debdb1a3f0fa79e(context, ref);
|
|
78
|
-
let { ref: _, ...otherProps } = context;
|
|
79
|
-
return otherProps;
|
|
80
|
-
}
|
|
81
|
-
const $d1116acdf220c2da$export$13f3202a3e5ddd5 = /* @__PURE__ */ React__default.forwardRef(function FocusableProvider(props, ref) {
|
|
82
|
-
let { children, ...otherProps } = props;
|
|
83
|
-
let objRef = $03e8ab2d84d7657a$export$4338b53315abf666(ref);
|
|
84
|
-
let context = {
|
|
85
|
-
...otherProps,
|
|
86
|
-
ref: objRef
|
|
87
|
-
};
|
|
88
|
-
return /* @__PURE__ */ React__default.createElement($d1116acdf220c2da$export$f9762fab77588ecb.Provider, {
|
|
89
|
-
value: context
|
|
90
|
-
}, children);
|
|
91
|
-
});
|
|
92
|
-
function $d1116acdf220c2da$export$4c014de7c8940b4c(props, domRef) {
|
|
93
|
-
let { focusProps } = $1e74c67db218ce67$export$f8168d8dd8fd66e6(props);
|
|
94
|
-
let { keyboardProps } = $8296dad1a4c5e0dc$export$8f71654801c2f7cd(props);
|
|
95
|
-
let interactions = $bbaa08b3cd72f041$export$9d1611c77c2fe928(focusProps, keyboardProps);
|
|
96
|
-
let domProps = $d1116acdf220c2da$var$useFocusableContext(domRef);
|
|
97
|
-
let interactionProps = props.isDisabled ? {} : domProps;
|
|
98
|
-
let autoFocusRef = useRef(props.autoFocus);
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
if (autoFocusRef.current && domRef.current) $f192c2f16961cbe0$export$80f3e147d781571c(domRef.current);
|
|
101
|
-
autoFocusRef.current = false;
|
|
102
|
-
}, [
|
|
103
|
-
domRef
|
|
104
|
-
]);
|
|
105
|
-
let tabIndex = props.excludeFromTabOrder ? -1 : 0;
|
|
106
|
-
if (props.isDisabled) tabIndex = void 0;
|
|
107
|
-
return {
|
|
108
|
-
focusableProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928({
|
|
109
|
-
...interactions,
|
|
110
|
-
tabIndex
|
|
111
|
-
}, interactionProps)
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
export {
|
|
115
|
-
$d1116acdf220c2da$export$4c014de7c8940b4c as $,
|
|
116
|
-
$d1116acdf220c2da$export$13f3202a3e5ddd5 as a,
|
|
117
|
-
$8296dad1a4c5e0dc$export$8f71654801c2f7cd as b
|
|
118
|
-
};
|