@wix/editor-react-components 1.2762.0 → 1.2763.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 +1 -1
- package/dist/site/components/AudioPlayer/manifest.js +1 -1
- package/dist/site/components/BoxContainer/component.js +3 -3
- package/dist/site/components/BoxContainer/manifest.js +1 -1
- package/dist/site/components/Breadcrumbs/component.js +3 -3
- package/dist/site/components/Breadcrumbs/manifest.js +1 -1
- package/dist/site/components/Button/manifest.js +1 -1
- package/dist/site/components/Checkbox/component.js +1 -1
- package/dist/site/components/Checkbox/manifest.js +1 -1
- package/dist/site/components/CheckboxGroup/component.js +1 -1
- package/dist/site/components/CheckboxGroup/manifest.js +1 -1
- package/dist/site/components/CollapsibleText/component.js +2 -2
- package/dist/site/components/CollapsibleText/manifest.js +1 -1
- package/dist/site/components/DatePicker/component.js +2 -2
- package/dist/site/components/DatePicker/manifest.js +1 -1
- package/dist/site/components/Dropdown/component.js +2 -2
- package/dist/site/components/Dropdown/manifest.js +1 -1
- package/dist/site/components/GoogleMap/component.js +3 -3
- package/dist/site/components/HTMLComponent/component.js +2 -2
- package/dist/site/components/HeadingTextBlock/component.js +1 -1
- package/dist/site/components/HeadingTextBlock/manifest.js +1 -1
- package/dist/site/components/HipaaIcon/component.js +2 -2
- package/dist/site/components/HipaaIcon/manifest.js +1 -1
- package/dist/site/components/Image3/component.js +2 -2
- package/dist/site/components/ImageReveal/component.js +2 -2
- package/dist/site/components/ImageReveal/manifest.js +1 -1
- package/dist/site/components/Line/component.js +1 -1
- package/dist/site/components/LinkBar/component.js +2 -2
- 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 +3 -3
- package/dist/site/components/Lottie/manifest.js +1 -1
- package/dist/site/components/MarkdownBlock/component.js +2 -2
- package/dist/site/components/MarkdownBlock/manifest.js +1 -1
- package/dist/site/components/Menu/component.js +3 -3
- 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/RadioButtons/component.js +1 -1
- package/dist/site/components/RadioButtons/manifest.js +1 -1
- package/dist/site/components/Repeater/component.js +2 -2
- package/dist/site/components/Repeater/manifest.js +1 -1
- package/dist/site/components/ShareButtons/component.js +2 -2
- package/dist/site/components/ShareButtons/manifest.js +1 -1
- package/dist/site/components/Slideshow/component.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 +2 -2
- package/dist/site/components/TextInput/manifest.js +1 -1
- package/dist/site/components/TextMarquee/component.js +1 -1
- package/dist/site/components/TimePicker/component.js +2 -2
- package/dist/site/components/TimePicker/manifest.js +1 -1
- package/dist/site/components/TransparentVideo/component.js +2 -2
- package/dist/site/components/VideoScrub/VideoScrub.types.d.ts +28 -0
- package/dist/site/components/VideoScrub/component.js +295 -29
- package/dist/site/components/VideoScrub/constants.d.ts +5 -0
- package/dist/site/components/VideoScrub/css.css +21 -1
- package/dist/site/components/VideoScrub/hooks/useTimeframes.d.ts +23 -0
- package/dist/site/components/VideoScrub/manifest.js +102 -6
- package/dist/site/components/VideoScrub/timeframes/index.d.ts +1 -1
- package/dist/site/components/VideoScrub/timeframes/types.d.ts +1 -1
- package/dist/site/components/VideoScrub/timeframes/useActiveTimeframeIndex.d.ts +2 -0
- package/dist/site/components/chunks/AnimatedIcon.js +1 -1
- package/dist/site/components/chunks/Button.js +2 -2
- package/dist/site/components/chunks/Image.js +1 -1
- package/dist/site/components/chunks/Link.js +1 -1
- package/dist/site/components/chunks/Patterns.js +1 -1
- package/dist/site/components/chunks/ResponsiveBox.js +1 -1
- package/dist/site/components/chunks/TextEffectsShared.js +2 -2
- package/dist/site/components/chunks/a11y.js +4 -4
- package/dist/site/components/chunks/constants10.js +20 -65
- package/dist/site/components/chunks/constants11.js +12 -14
- package/dist/site/components/chunks/constants12.js +9 -9
- package/dist/site/components/chunks/constants13.js +8 -10
- package/dist/site/components/chunks/constants14.js +13 -9
- package/dist/site/components/chunks/constants15.js +17 -14
- package/dist/site/components/chunks/constants16.js +12 -17
- package/dist/site/components/chunks/constants17.js +13 -11
- package/dist/site/components/chunks/constants18.js +96 -21
- package/dist/site/components/chunks/constants19.js +50 -92
- package/dist/site/components/chunks/constants2.js +128 -34
- package/dist/site/components/chunks/constants20.js +50 -54
- package/dist/site/components/chunks/constants21.js +52 -49
- package/dist/site/components/chunks/constants22.js +310 -43
- package/dist/site/components/chunks/constants23.js +65 -310
- package/dist/site/components/chunks/constants24.js +99 -70
- package/dist/site/components/chunks/constants25.js +30 -101
- package/dist/site/components/chunks/constants26.js +17 -35
- package/dist/site/components/chunks/constants27.js +447 -16
- package/dist/site/components/chunks/constants28.js +29 -441
- package/dist/site/components/chunks/constants29.js +78 -26
- package/dist/site/components/chunks/constants3.js +84 -118
- package/dist/site/components/chunks/constants30.js +15 -85
- package/dist/site/components/chunks/constants31.js +42 -11
- package/dist/site/components/chunks/constants32.js +45 -41
- package/dist/site/components/chunks/constants33.js +24 -49
- package/dist/site/components/chunks/constants34.js +56 -25
- package/dist/site/components/chunks/constants35.js +13 -58
- package/dist/site/components/chunks/constants36.js +206 -14
- package/dist/site/components/chunks/constants37.js +153 -182
- package/dist/site/components/chunks/constants38.js +49 -162
- package/dist/site/components/chunks/constants39.js +102 -51
- package/dist/site/components/chunks/constants4.js +13 -88
- package/dist/site/components/chunks/constants40.js +39 -69
- package/dist/site/components/chunks/constants41.js +79 -72
- package/dist/site/components/chunks/constants42.js +77 -83
- package/dist/site/components/chunks/constants43.js +56 -75
- package/dist/site/components/chunks/constants5.js +19 -10
- package/dist/site/components/chunks/constants6.js +14 -14
- package/dist/site/components/chunks/constants7.js +10 -11
- package/dist/site/components/chunks/constants8.js +14 -14
- package/dist/site/components/chunks/constants9.js +65 -22
- package/dist/site/components/chunks/customElementInit.js +1 -1
- package/dist/site/components/chunks/index4.js +3 -2133
- package/dist/site/components/chunks/index5.js +2080 -1414
- package/dist/site/components/chunks/index6.js +1467 -3
- package/dist/site/components/chunks/manifestBase.js +1 -1
- package/dist/site/components/chunks/parseHtml.js +1 -1
- package/dist/site/components/chunks/parseSvg.js +1 -1
- package/dist/site/components/chunks/types.js +61 -0
- package/dist/site/components/chunks/useConsentPolicyProps.js +2 -2
- package/dist/site/components/chunks/utils2.js +1 -1
- package/dist/site/components/extensions.js +1 -1
- package/package.json +2 -2
- package/dist/site/components/chunks/constants44.js +0 -72
|
@@ -1,111 +1,40 @@
|
|
|
1
|
+
const FULL_PROGRESS = 100;
|
|
2
|
+
const NO_PROGRESS = 0;
|
|
1
3
|
const DisplayNames = {
|
|
2
4
|
root: {
|
|
3
|
-
|
|
4
|
-
data: {
|
|
5
|
-
options: "Options",
|
|
6
|
-
optionLabel: "Label",
|
|
7
|
-
optionValue: "Value",
|
|
8
|
-
optionDisabled: "Disabled",
|
|
9
|
-
value: "Selected value",
|
|
10
|
-
firstSelectedByDefault: "Default selection",
|
|
11
|
-
firstSelectedByDefaultNone: "None",
|
|
12
|
-
firstSelectedByDefaultFirst: "First Item",
|
|
13
|
-
label: "Label",
|
|
14
|
-
tooltip: "Tooltip",
|
|
15
|
-
required: "Required",
|
|
16
|
-
readOnly: "Read only",
|
|
17
|
-
disabled: "Disabled"
|
|
18
|
-
},
|
|
19
|
-
cssCustomProperties: {
|
|
20
|
-
orientation: "Orientation",
|
|
21
|
-
radiosSpacing: "Space between radio buttons",
|
|
22
|
-
labelSpacing: "Space between field and field title",
|
|
23
|
-
radioTextSpacing: "Space between radio button and text",
|
|
24
|
-
alignment: "Alignment",
|
|
25
|
-
labelAlignment: "Label alignment"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
radio: {
|
|
29
|
-
elementDisplayName: "Radio button",
|
|
30
|
-
cssCustomProperties: {
|
|
31
|
-
unselectedBackgroundColor: "Unselected background color",
|
|
32
|
-
unselectedBorderColor: "Unselected border color",
|
|
33
|
-
selectedBackgroundColor: "Selected background color",
|
|
34
|
-
selectedBorderColor: "Selected border color",
|
|
35
|
-
dotColor: "Dot color",
|
|
36
|
-
size: "Radio button size"
|
|
37
|
-
}
|
|
5
|
+
displayName: "Progress Bar"
|
|
38
6
|
},
|
|
39
|
-
|
|
40
|
-
|
|
7
|
+
label: {
|
|
8
|
+
displayName: "Label"
|
|
41
9
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
disabled: {
|
|
51
|
-
displayName: "Disabled",
|
|
52
|
-
className: "radio-buttons__radio--disabled"
|
|
10
|
+
bar: {
|
|
11
|
+
displayName: "ProgressBar",
|
|
12
|
+
cssCustomProperties: {
|
|
13
|
+
barBackgroundColor: "Background color",
|
|
14
|
+
barForegroundColor: "Bar color"
|
|
15
|
+
},
|
|
16
|
+
cssProperties: {
|
|
17
|
+
barHeight: "Bar width"
|
|
53
18
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
className: "radio-buttons__radio--invalid"
|
|
19
|
+
displayGroups: {
|
|
20
|
+
cornersGroup: "Corner radius"
|
|
57
21
|
}
|
|
22
|
+
},
|
|
23
|
+
data: {
|
|
24
|
+
targetValue: "Max value",
|
|
25
|
+
label: "Label"
|
|
58
26
|
}
|
|
59
27
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
];
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
tooltip: "",
|
|
68
|
-
firstSelectedByDefault: "none",
|
|
69
|
-
required: false,
|
|
70
|
-
readOnly: false,
|
|
71
|
-
disabled: false
|
|
72
|
-
};
|
|
73
|
-
const VALUE_MISSING_MESSAGE = "This field is required";
|
|
74
|
-
const TestIds = {
|
|
75
|
-
root: "radio-buttons-root",
|
|
76
|
-
group: "radio-buttons-group",
|
|
77
|
-
legend: "radio-buttons-legend",
|
|
78
|
-
requiredIndicator: "radio-buttons-required-indicator",
|
|
79
|
-
tooltipButton: "radio-buttons-tooltip-button",
|
|
80
|
-
option: "radio-buttons-option",
|
|
81
|
-
control: "radio-buttons-control",
|
|
82
|
-
indicator: "radio-buttons-indicator",
|
|
83
|
-
optionLabel: "radio-buttons-option-label",
|
|
84
|
-
errorMessage: "radio-buttons-error-message"
|
|
85
|
-
};
|
|
86
|
-
const selectors = {
|
|
87
|
-
root: "radio-buttons",
|
|
88
|
-
radio: "radio-buttons__radio",
|
|
89
|
-
indicator: "radio-buttons__indicator",
|
|
90
|
-
label: "radio-buttons__label",
|
|
91
|
-
groupLabel: "radio-buttons__group-label"
|
|
92
|
-
};
|
|
93
|
-
const semanticClassNames = {
|
|
94
|
-
groupLabel: "radio-buttons__group-label",
|
|
95
|
-
requiredIndicator: "radio-buttons__required-indicator",
|
|
96
|
-
option: "radio-buttons__option",
|
|
97
|
-
radio: "radio-buttons__radio",
|
|
98
|
-
indicator: "radio-buttons__indicator",
|
|
99
|
-
label: "radio-buttons__label",
|
|
100
|
-
errorMessage: "radio-buttons__error-message"
|
|
101
|
-
};
|
|
28
|
+
var TestIDs = /* @__PURE__ */ ((TestIDs2) => {
|
|
29
|
+
TestIDs2["container"] = "progressbar-container";
|
|
30
|
+
TestIDs2["background"] = "progressbar-background";
|
|
31
|
+
TestIDs2["foreground"] = "progressbar-foreground";
|
|
32
|
+
TestIDs2["label"] = "progressbar-label";
|
|
33
|
+
return TestIDs2;
|
|
34
|
+
})(TestIDs || {});
|
|
102
35
|
export {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
semanticClassNames as b,
|
|
108
|
-
DisplayNames as c,
|
|
109
|
-
defaultValues as d,
|
|
110
|
-
selectors as s
|
|
36
|
+
DisplayNames as D,
|
|
37
|
+
FULL_PROGRESS as F,
|
|
38
|
+
NO_PROGRESS as N,
|
|
39
|
+
TestIDs as T
|
|
111
40
|
};
|
|
@@ -1,40 +1,22 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
barForegroundColor: "Bar color"
|
|
15
|
-
},
|
|
16
|
-
cssProperties: {
|
|
17
|
-
barHeight: "Bar width"
|
|
18
|
-
},
|
|
19
|
-
displayGroups: {
|
|
20
|
-
cornersGroup: "Corner radius"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
1
|
+
const selectors = {
|
|
2
|
+
root: "multi-state-box",
|
|
3
|
+
stateContainer: "state-container"
|
|
4
|
+
};
|
|
5
|
+
const DISPLAY_NAMES = {
|
|
6
|
+
component: "Multi-State Box",
|
|
7
|
+
data: {
|
|
8
|
+
states: "State",
|
|
9
|
+
activeStateName: "Active state",
|
|
10
|
+
stateName: "State name"
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const DESCRIPTIONS = {
|
|
23
14
|
data: {
|
|
24
|
-
|
|
25
|
-
label: "Label"
|
|
15
|
+
activeStateName: "To trigger states from CMS or code, use the connect icon to bind this property"
|
|
26
16
|
}
|
|
27
17
|
};
|
|
28
|
-
var TestIDs = /* @__PURE__ */ ((TestIDs2) => {
|
|
29
|
-
TestIDs2["container"] = "progressbar-container";
|
|
30
|
-
TestIDs2["background"] = "progressbar-background";
|
|
31
|
-
TestIDs2["foreground"] = "progressbar-foreground";
|
|
32
|
-
TestIDs2["label"] = "progressbar-label";
|
|
33
|
-
return TestIDs2;
|
|
34
|
-
})(TestIDs || {});
|
|
35
18
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
TestIDs as T
|
|
19
|
+
DESCRIPTIONS as D,
|
|
20
|
+
DISPLAY_NAMES as a,
|
|
21
|
+
selectors as s
|
|
40
22
|
};
|
|
@@ -1,22 +1,453 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { useRef, useState, useEffect } from "react";
|
|
2
|
+
const DISABLED_ANIMATION_NAME = "none";
|
|
3
|
+
const AnimationPhase = {
|
|
4
|
+
Enter: "enter",
|
|
5
|
+
EnterActive: "enterActive",
|
|
6
|
+
EnterDone: "enterDone",
|
|
7
|
+
Exit: "exit",
|
|
8
|
+
ExitActive: "exitActive",
|
|
9
|
+
ExitDone: "exitDone"
|
|
10
|
+
};
|
|
11
|
+
const useAnimationState = (animationConfigMap, initialAnimationState) => {
|
|
12
|
+
const afterAnimationInitRef = useRef(null);
|
|
13
|
+
const afterAnimationActiveRef = useRef(null);
|
|
14
|
+
const [animationState, setAnimationState] = useState(initialAnimationState);
|
|
15
|
+
const abortAnimationCallbacks = () => {
|
|
16
|
+
afterAnimationInitRef.current = null;
|
|
17
|
+
afterAnimationActiveRef.current = null;
|
|
18
|
+
};
|
|
19
|
+
const initEnterAnimation = (animationName, onAnimationDone) => {
|
|
20
|
+
abortAnimationCallbacks();
|
|
21
|
+
if (animationName === DISABLED_ANIMATION_NAME) {
|
|
22
|
+
return onAnimationDone == null ? void 0 : onAnimationDone();
|
|
23
|
+
}
|
|
24
|
+
setAnimationState({
|
|
25
|
+
name: animationName,
|
|
26
|
+
phase: AnimationPhase.Enter
|
|
27
|
+
});
|
|
28
|
+
afterAnimationInitRef.current = () => {
|
|
29
|
+
setAnimationState({
|
|
30
|
+
name: animationName,
|
|
31
|
+
phase: AnimationPhase.EnterActive
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
afterAnimationActiveRef.current = () => {
|
|
35
|
+
setAnimationState({
|
|
36
|
+
name: animationName,
|
|
37
|
+
phase: AnimationPhase.EnterDone
|
|
38
|
+
});
|
|
39
|
+
onAnimationDone == null ? void 0 : onAnimationDone();
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const skipToEnterDone = (animationName) => {
|
|
43
|
+
abortAnimationCallbacks();
|
|
44
|
+
if (animationName === DISABLED_ANIMATION_NAME) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
setAnimationState({
|
|
48
|
+
name: animationName,
|
|
49
|
+
phase: AnimationPhase.EnterDone
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const skipToExitDone = (animationName) => {
|
|
53
|
+
abortAnimationCallbacks();
|
|
54
|
+
if (animationName === DISABLED_ANIMATION_NAME) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
setAnimationState({
|
|
58
|
+
name: animationName,
|
|
59
|
+
phase: AnimationPhase.ExitDone
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
const initExitAnimation = (animationName, onAnimationDone) => {
|
|
63
|
+
abortAnimationCallbacks();
|
|
64
|
+
if (animationName === DISABLED_ANIMATION_NAME) {
|
|
65
|
+
return onAnimationDone == null ? void 0 : onAnimationDone();
|
|
66
|
+
}
|
|
67
|
+
setAnimationState({
|
|
68
|
+
name: animationName,
|
|
69
|
+
phase: AnimationPhase.Exit
|
|
70
|
+
});
|
|
71
|
+
afterAnimationInitRef.current = () => {
|
|
72
|
+
setAnimationState({
|
|
73
|
+
name: animationName,
|
|
74
|
+
phase: AnimationPhase.ExitActive
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
afterAnimationActiveRef.current = () => {
|
|
78
|
+
setAnimationState({
|
|
79
|
+
name: animationName,
|
|
80
|
+
phase: AnimationPhase.ExitDone
|
|
81
|
+
});
|
|
82
|
+
onAnimationDone == null ? void 0 : onAnimationDone();
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
const { name } = animationState;
|
|
87
|
+
const { duration: animationDuration } = animationConfigMap[name];
|
|
88
|
+
const isInitPhase = animationState.phase === AnimationPhase.Enter || animationState.phase === AnimationPhase.Exit;
|
|
89
|
+
const isActivePhase = animationState.phase === AnimationPhase.EnterActive || animationState.phase === AnimationPhase.ExitActive;
|
|
90
|
+
if (isInitPhase) {
|
|
91
|
+
const frameId = window.requestAnimationFrame(() => {
|
|
92
|
+
var _a;
|
|
93
|
+
(_a = afterAnimationInitRef.current) == null ? void 0 : _a.call(afterAnimationInitRef);
|
|
94
|
+
afterAnimationInitRef.current = null;
|
|
95
|
+
});
|
|
96
|
+
return () => window.cancelAnimationFrame(frameId);
|
|
97
|
+
}
|
|
98
|
+
if (isActivePhase) {
|
|
99
|
+
const timeoutId = setTimeout(() => {
|
|
100
|
+
var _a;
|
|
101
|
+
(_a = afterAnimationActiveRef.current) == null ? void 0 : _a.call(afterAnimationActiveRef);
|
|
102
|
+
afterAnimationActiveRef.current = null;
|
|
103
|
+
}, animationDuration);
|
|
104
|
+
return () => clearTimeout(timeoutId);
|
|
105
|
+
}
|
|
106
|
+
}, [animationState.phase]);
|
|
107
|
+
return {
|
|
108
|
+
animationState,
|
|
109
|
+
initEnterAnimation,
|
|
110
|
+
initExitAnimation,
|
|
111
|
+
skipToEnterDone,
|
|
112
|
+
skipToExitDone
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
const MenuOrientation = {
|
|
116
|
+
Horizontal: "horizontal",
|
|
117
|
+
Vertical: "vertical"
|
|
118
|
+
};
|
|
119
|
+
const VerticalDropdownDisplay = {
|
|
120
|
+
AlwaysOpen: "alwaysOpen"
|
|
121
|
+
};
|
|
122
|
+
const MenuAnimationName = {
|
|
123
|
+
None: DISABLED_ANIMATION_NAME,
|
|
124
|
+
Calm: "calm",
|
|
125
|
+
Underline: "underline",
|
|
126
|
+
Wash: "wash",
|
|
127
|
+
Bullet: "bullet",
|
|
128
|
+
Wave: "wave",
|
|
129
|
+
Bounce: "bounce",
|
|
130
|
+
Tint: "tint",
|
|
131
|
+
TextWash: "textWash",
|
|
132
|
+
Wobble: "wobble",
|
|
133
|
+
Brackets: "brackets",
|
|
134
|
+
Float: "float",
|
|
135
|
+
Shape: "shape",
|
|
136
|
+
Expand: "expand",
|
|
137
|
+
Circle: "circle",
|
|
138
|
+
Shadow: "shadow",
|
|
139
|
+
LineRise: "lineRise",
|
|
140
|
+
Overline: "overline",
|
|
141
|
+
CenterLine: "centerLine",
|
|
142
|
+
Skew: "skew",
|
|
143
|
+
Point: "point",
|
|
144
|
+
Blur: "blur"
|
|
145
|
+
};
|
|
146
|
+
const DropdownAnimationName = {
|
|
147
|
+
None: DISABLED_ANIMATION_NAME,
|
|
148
|
+
RevealFromTop: "revealFromTop",
|
|
149
|
+
FadeIn: "fadeIn"
|
|
150
|
+
};
|
|
151
|
+
const HamburgerMenuAnimationName = {
|
|
152
|
+
None: DISABLED_ANIMATION_NAME,
|
|
153
|
+
RevealFromRight: "revealFromRight",
|
|
154
|
+
FadeIn: "fadeIn"
|
|
155
|
+
};
|
|
156
|
+
const DisplayNames = {
|
|
157
|
+
root: {
|
|
158
|
+
elementDisplayName: "Menu",
|
|
159
|
+
actions: {
|
|
160
|
+
manageMenu: "Manage Menu",
|
|
161
|
+
design: "Design",
|
|
162
|
+
settings: "Settings"
|
|
163
|
+
},
|
|
164
|
+
customActions: {
|
|
165
|
+
format: {
|
|
166
|
+
displayName: "Change layout"
|
|
167
|
+
},
|
|
168
|
+
animatedIcon: {
|
|
169
|
+
displayName: "Customize Icon"
|
|
170
|
+
},
|
|
171
|
+
hamburgerAnimatedIcon: {
|
|
172
|
+
displayName: "Customize Menu Icon"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
presets: {
|
|
176
|
+
horizontalScrollNavbar: "Horizontal Scroll Navigation Bar",
|
|
177
|
+
horizontalHugNavbar: "Horizontal Hug Navigation Bar",
|
|
178
|
+
verticalNavbar: "Vertical Navigation Bar",
|
|
179
|
+
hamburgerMenu: "Hamburger menu"
|
|
180
|
+
},
|
|
181
|
+
states: {
|
|
182
|
+
hamburgerDialog: "Hamburger menu",
|
|
183
|
+
dropdown: "Dropdown"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
navbar: {
|
|
187
|
+
elementDisplayName: "Menu bar",
|
|
188
|
+
displayGroups: {
|
|
189
|
+
dividerBorderGroup: "Dividers"
|
|
190
|
+
},
|
|
191
|
+
cssCustomProperties: {
|
|
192
|
+
"vertical-dropdown-display": "Items display",
|
|
193
|
+
"items-width": "Item width",
|
|
194
|
+
"container-align": "Item alignment",
|
|
195
|
+
"menu-items-row-gap": "Space between menu items",
|
|
196
|
+
"menu-items-column-gap": "Space between menu items"
|
|
197
|
+
},
|
|
198
|
+
actions: {
|
|
199
|
+
manageMenu: "Manage Menu"
|
|
200
|
+
},
|
|
201
|
+
options: {
|
|
202
|
+
alwaysOpen: "Open",
|
|
203
|
+
expandCollapse: "Closed",
|
|
204
|
+
fitToText: "Fit to text",
|
|
205
|
+
fillMenu: "Fill menu"
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
item: {
|
|
209
|
+
elementDisplayName: "Menu items",
|
|
210
|
+
cssProperties: {
|
|
211
|
+
justifyContent: "Text alignment",
|
|
212
|
+
background: "Background",
|
|
213
|
+
columnGap: "Space between items and chevrons"
|
|
214
|
+
},
|
|
215
|
+
cssCustomProperties: {
|
|
216
|
+
"item-icon-size": "Size",
|
|
217
|
+
"item-icon-gap": "Space between items and icons"
|
|
218
|
+
},
|
|
219
|
+
displayGroups: {
|
|
220
|
+
iconGroup: "Icons"
|
|
221
|
+
},
|
|
222
|
+
states: {
|
|
223
|
+
hover: "Hover",
|
|
224
|
+
selected: "Selected"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
itemLabel: {
|
|
228
|
+
elementDisplayName: "Item's text"
|
|
229
|
+
},
|
|
230
|
+
itemIcon: {
|
|
231
|
+
elementDisplayName: "Item's icon"
|
|
232
|
+
},
|
|
233
|
+
dropdown: {
|
|
234
|
+
elementDisplayName: "Dropdowns",
|
|
235
|
+
cssCustomProperties: {
|
|
236
|
+
anchor: "Dropdown width",
|
|
237
|
+
align: "Dropdown position",
|
|
238
|
+
"items-width": "Item width",
|
|
239
|
+
"columns-number": "Number of columns",
|
|
240
|
+
"space-above": "Space above dropdowns",
|
|
241
|
+
"horizontal-margin": "Dropdown margin",
|
|
242
|
+
"item-position": "Dropdown box position"
|
|
243
|
+
},
|
|
244
|
+
options: {
|
|
245
|
+
menuItem: "Fit to items",
|
|
246
|
+
menuStretched: "Fit to menu",
|
|
247
|
+
screen: "Stretch to page",
|
|
248
|
+
start: "Start",
|
|
249
|
+
center: "Middle",
|
|
250
|
+
end: "End",
|
|
251
|
+
fitToText: "Fit to text",
|
|
252
|
+
fillDropdown: "Fill dropdowns",
|
|
253
|
+
afterItems: "After items",
|
|
254
|
+
beforeItems: "Before items",
|
|
255
|
+
aboveItems: "Above items",
|
|
256
|
+
belowItems: "Below items"
|
|
257
|
+
},
|
|
258
|
+
displayGroups: {
|
|
259
|
+
gapGroup: "Space between items",
|
|
260
|
+
cornersGroup: "Corner radius"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
dropdownItem: {
|
|
264
|
+
elementDisplayName: "Dropdown items"
|
|
265
|
+
},
|
|
266
|
+
dropdownSubItem: {
|
|
267
|
+
elementDisplayName: "Dropdown sub-items"
|
|
268
|
+
},
|
|
269
|
+
scrollButton: {
|
|
270
|
+
elementDisplayName: "Scroll button",
|
|
271
|
+
cssProperties: {
|
|
272
|
+
background: "Background"
|
|
273
|
+
},
|
|
274
|
+
cssCustomProperties: {
|
|
275
|
+
"scroll-button-icon-size": "Size"
|
|
276
|
+
},
|
|
277
|
+
displayGroups: {
|
|
278
|
+
scrollButtonGroup: "Icon"
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
hamburgerMenu: {
|
|
282
|
+
elementDisplayName: "Hamburger menu",
|
|
283
|
+
displayGroups: {
|
|
284
|
+
cornersGroup: "Corner radius"
|
|
285
|
+
},
|
|
286
|
+
cssCustomProperties: {
|
|
287
|
+
"hamburger-wrapper-width": "Width",
|
|
288
|
+
"wrapper-position": "Position",
|
|
289
|
+
"menu-position": "Menu Position",
|
|
290
|
+
"close-button-position": "Close button position",
|
|
291
|
+
"overlay-background": "Overlay Background"
|
|
292
|
+
},
|
|
293
|
+
options: {
|
|
294
|
+
third: "Third of page",
|
|
295
|
+
twoThirds: "Two thirds of page",
|
|
296
|
+
half: "Half page",
|
|
297
|
+
full: "Full page",
|
|
298
|
+
start: "Start",
|
|
299
|
+
middle: "Middle",
|
|
300
|
+
end: "End",
|
|
301
|
+
top: "Top",
|
|
302
|
+
bottom: "Bottom"
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
hamburgerOpenButton: {
|
|
306
|
+
elementDisplayName: "Hamburger button"
|
|
307
|
+
},
|
|
308
|
+
hamburgerCloseButton: {
|
|
309
|
+
elementDisplayName: "Close Button"
|
|
11
310
|
}
|
|
12
311
|
};
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
312
|
+
const menuBuiltInActions = {
|
|
313
|
+
elements: "elements"
|
|
314
|
+
};
|
|
315
|
+
const MENU_ANIMATED_ICON_SPEC = "sp.erc.menuAnimatedIcon";
|
|
316
|
+
const selectors = {
|
|
317
|
+
menu: "menu",
|
|
318
|
+
navbar: "navbar",
|
|
319
|
+
item: "item",
|
|
320
|
+
dropdown: "dropdown",
|
|
321
|
+
dropdownItem: "dropdown-item",
|
|
322
|
+
dropdownSubItem: "dropdown-sub-item",
|
|
323
|
+
scrollButton: "scroll-button",
|
|
324
|
+
animatedIcon: "animated-icon",
|
|
325
|
+
itemIcon: "item-icon",
|
|
326
|
+
itemLabel: "item-label",
|
|
327
|
+
hamburgerMenu: "hamburger-menu",
|
|
328
|
+
hamburgerMenuContent: "hamburger-menu-content",
|
|
329
|
+
hamburgerMenuHeaderContent: "hamburger-menu-header-content",
|
|
330
|
+
hamburgerMenuOpenButton: "hamburger-open-button",
|
|
331
|
+
hamburgerMenuCloseButton: "hamburger-close-button"
|
|
332
|
+
};
|
|
333
|
+
const elementKeys = {
|
|
334
|
+
navbar: "navbar",
|
|
335
|
+
hamburgerMenu: "hamburgerMenu",
|
|
336
|
+
hamburgerOpenButton: "hamburgerOpenButton",
|
|
337
|
+
hamburgerCloseButton: "hamburgerCloseButton",
|
|
338
|
+
item: "item",
|
|
339
|
+
subItem: "subItem",
|
|
340
|
+
scrollButton: "scrollButton",
|
|
341
|
+
dropdown: "dropdown",
|
|
342
|
+
animatedIcon: "animatedIcon",
|
|
343
|
+
itemLabel: "itemLabel"
|
|
344
|
+
};
|
|
345
|
+
const presets = {
|
|
346
|
+
horizontalScrollNavbar: "horizontalScrollNavbar",
|
|
347
|
+
horizontalHugNavbar: "horizontalHugNavbar",
|
|
348
|
+
verticalNavbar: "verticalNavbar",
|
|
349
|
+
hamburgerMenu: "hamburgerMenu"
|
|
350
|
+
};
|
|
351
|
+
const states = {
|
|
352
|
+
dropdown: "dropdown",
|
|
353
|
+
hamburgerDialog: "hamburgerDialog",
|
|
354
|
+
hamburgerDialogDropdown: "hamburgerDialogDropdown"
|
|
355
|
+
};
|
|
356
|
+
const DesignStates = {
|
|
357
|
+
item: {
|
|
358
|
+
hover: {
|
|
359
|
+
displayName: DisplayNames.item.states.hover,
|
|
360
|
+
className: "menu__item--hover"
|
|
361
|
+
},
|
|
362
|
+
selected: {
|
|
363
|
+
displayName: DisplayNames.item.states.selected,
|
|
364
|
+
className: "menu__item--selected"
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
dropdownItem: {
|
|
368
|
+
hover: {
|
|
369
|
+
displayName: "Hover",
|
|
370
|
+
className: "menu__dropdown-item--hover"
|
|
371
|
+
},
|
|
372
|
+
selected: {
|
|
373
|
+
displayName: "Selected",
|
|
374
|
+
className: "menu__dropdown-item--selected"
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
dropdownSubItem: {
|
|
378
|
+
hover: {
|
|
379
|
+
displayName: "Hover",
|
|
380
|
+
className: "menu__dropdown-sub-item--hover"
|
|
381
|
+
},
|
|
382
|
+
selected: {
|
|
383
|
+
displayName: "Selected",
|
|
384
|
+
className: "menu__dropdown-sub-item--selected"
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
scrollButton: {
|
|
388
|
+
hover: {
|
|
389
|
+
displayName: "Hover",
|
|
390
|
+
className: "menu__scroll-button--hover"
|
|
391
|
+
}
|
|
16
392
|
}
|
|
17
393
|
};
|
|
394
|
+
const DropdownAppliedStyleProperties = {
|
|
395
|
+
anchor: "--wix-menu-dropdown-anchor"
|
|
396
|
+
};
|
|
397
|
+
const DropdownAnchorPositions = {
|
|
398
|
+
menuItem: "0",
|
|
399
|
+
menuStretched: "1",
|
|
400
|
+
screen: "2"
|
|
401
|
+
};
|
|
402
|
+
const ARIA_LABEL_NAMESPACE = "ariaLabels";
|
|
403
|
+
const translationsKeys = {
|
|
404
|
+
menuNavAriaLabel: "dropDownMenu_AriaLabel_TopLevel_SiteNavigation",
|
|
405
|
+
dropdownButtonAriaLabel: "menu_dropdown_chevron_button_aria_label",
|
|
406
|
+
hamburgerOpenButtonAriaLabel: "menu_hamburger_open_button_aria_label",
|
|
407
|
+
hamburgerCloseButtonAriaLabel: "menu_hamburger_close_button_aria_label"
|
|
408
|
+
};
|
|
409
|
+
const defaultTranslations = {
|
|
410
|
+
menuNavAriaLabel: "Site",
|
|
411
|
+
dropdownButtonAriaLabel: "More pages",
|
|
412
|
+
hamburgerOpenButtonAriaLabel: "Menu",
|
|
413
|
+
hamburgerCloseButtonAriaLabel: "Close Menu"
|
|
414
|
+
};
|
|
415
|
+
const MenuParts = {
|
|
416
|
+
Navbar: "navbar",
|
|
417
|
+
DropdownContainer: "dropdown-container",
|
|
418
|
+
DropdownButton: "dropdown-button",
|
|
419
|
+
DropdownIcon: "dropdown-icon",
|
|
420
|
+
Label: "label",
|
|
421
|
+
DropdownItem: "dropdown-item",
|
|
422
|
+
DropdownItemLabel: "dropdown-item-label",
|
|
423
|
+
DropdownSubItem: "dropdown-subitem",
|
|
424
|
+
DropdownSubItemLabel: "dropdown-subitem-label",
|
|
425
|
+
MenuItem: "menu-item",
|
|
426
|
+
MenuItemContent: "menu-item-content",
|
|
427
|
+
MenuItemLink: "menu-item-link",
|
|
428
|
+
ScrollBackwardButton: "scroll-backward-button",
|
|
429
|
+
ScrollForwardButton: "scroll-forward-button"
|
|
430
|
+
};
|
|
18
431
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
432
|
+
AnimationPhase as A,
|
|
433
|
+
DropdownAnimationName as D,
|
|
434
|
+
HamburgerMenuAnimationName as H,
|
|
435
|
+
MenuAnimationName as M,
|
|
436
|
+
VerticalDropdownDisplay as V,
|
|
437
|
+
MenuOrientation as a,
|
|
438
|
+
MenuParts as b,
|
|
439
|
+
DesignStates as c,
|
|
440
|
+
defaultTranslations as d,
|
|
441
|
+
ARIA_LABEL_NAMESPACE as e,
|
|
442
|
+
DisplayNames as f,
|
|
443
|
+
DropdownAnchorPositions as g,
|
|
444
|
+
DropdownAppliedStyleProperties as h,
|
|
445
|
+
elementKeys as i,
|
|
446
|
+
MENU_ANIMATED_ICON_SPEC as j,
|
|
447
|
+
states as k,
|
|
448
|
+
menuBuiltInActions as m,
|
|
449
|
+
presets as p,
|
|
450
|
+
selectors as s,
|
|
451
|
+
translationsKeys as t,
|
|
452
|
+
useAnimationState as u
|
|
22
453
|
};
|