@wix/interact 1.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +258 -0
- package/dist/cjs/WixInteractElement.js +103 -0
- package/dist/cjs/WixInteractElement.js.map +1 -0
- package/dist/cjs/__tests__/interact.spec.js +944 -0
- package/dist/cjs/__tests__/interact.spec.js.map +1 -0
- package/dist/cjs/external-types.d.js +2 -0
- package/dist/cjs/external-types.d.js.map +1 -0
- package/dist/cjs/handlers/animationEnd.js +33 -0
- package/dist/cjs/handlers/animationEnd.js.map +1 -0
- package/dist/cjs/handlers/click.js +82 -0
- package/dist/cjs/handlers/click.js.map +1 -0
- package/dist/cjs/handlers/hover.js +103 -0
- package/dist/cjs/handlers/hover.js.map +1 -0
- package/dist/cjs/handlers/index.js +21 -0
- package/dist/cjs/handlers/index.js.map +1 -0
- package/dist/cjs/handlers/pointerMove.js +40 -0
- package/dist/cjs/handlers/pointerMove.js.map +1 -0
- package/dist/cjs/handlers/utilities.js +51 -0
- package/dist/cjs/handlers/utilities.js.map +1 -0
- package/dist/cjs/handlers/viewEnter.js +69 -0
- package/dist/cjs/handlers/viewEnter.js.map +1 -0
- package/dist/cjs/handlers/viewProgress.js +56 -0
- package/dist/cjs/handlers/viewProgress.js.map +1 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/interact.js +310 -0
- package/dist/cjs/interact.js.map +1 -0
- package/dist/cjs/test-types.d.js +2 -0
- package/dist/cjs/test-types.d.js.map +1 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/utils.js +66 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/esm/WixInteractElement.js +97 -0
- package/dist/esm/WixInteractElement.js.map +1 -0
- package/dist/esm/__tests__/interact.spec.js +952 -0
- package/dist/esm/__tests__/interact.spec.js.map +1 -0
- package/dist/esm/external-types.d.js +2 -0
- package/dist/esm/external-types.d.js.map +1 -0
- package/dist/esm/handlers/animationEnd.js +29 -0
- package/dist/esm/handlers/animationEnd.js.map +1 -0
- package/dist/esm/handlers/click.js +82 -0
- package/dist/esm/handlers/click.js.map +1 -0
- package/dist/esm/handlers/hover.js +103 -0
- package/dist/esm/handlers/hover.js.map +1 -0
- package/dist/esm/handlers/index.js +16 -0
- package/dist/esm/handlers/index.js.map +1 -0
- package/dist/esm/handlers/pointerMove.js +39 -0
- package/dist/esm/handlers/pointerMove.js.map +1 -0
- package/dist/esm/handlers/utilities.js +45 -0
- package/dist/esm/handlers/utilities.js.map +1 -0
- package/dist/esm/handlers/viewEnter.js +69 -0
- package/dist/esm/handlers/viewEnter.js.map +1 -0
- package/dist/esm/handlers/viewProgress.js +52 -0
- package/dist/esm/handlers/viewProgress.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/interact.js +303 -0
- package/dist/esm/interact.js.map +1 -0
- package/dist/esm/test-types.d.js +2 -0
- package/dist/esm/test-types.d.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils.js +61 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/types/WixInteractElement.d.ts +324 -0
- package/dist/types/__tests__/interact.spec.d.ts +1 -0
- package/dist/types/handlers/animationEnd.d.ts +8 -0
- package/dist/types/handlers/click.d.ts +8 -0
- package/dist/types/handlers/hover.d.ts +8 -0
- package/dist/types/handlers/index.d.ts +3 -0
- package/dist/types/handlers/pointerMove.d.ts +8 -0
- package/dist/types/handlers/utilities.d.ts +4 -0
- package/dist/types/handlers/viewEnter.d.ts +8 -0
- package/dist/types/handlers/viewProgress.d.ts +8 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/interact.d.ts +25 -0
- package/dist/types/types.d.ts +173 -0
- package/dist/types/utils.d.ts +4 -0
- package/package.json +71 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import type { StateParams } from './types';
|
|
2
|
+
export declare const WIX_INTERACT_EFFECT_DATA_ATTR = "wixInteractEffect";
|
|
3
|
+
export declare function getWixInteractElement(): {
|
|
4
|
+
new (): {
|
|
5
|
+
_internals: (ElementInternals & {
|
|
6
|
+
states: Set<string>;
|
|
7
|
+
}) | null;
|
|
8
|
+
connected: boolean;
|
|
9
|
+
sheet: CSSStyleSheet | null;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
disconnectedCallback(): void;
|
|
12
|
+
connect(path?: string): void;
|
|
13
|
+
renderStyle(cssText: string): void;
|
|
14
|
+
toggleEffect(effectId: string, method: StateParams['method']): void;
|
|
15
|
+
accessKey: string;
|
|
16
|
+
readonly accessKeyLabel: string;
|
|
17
|
+
autocapitalize: string;
|
|
18
|
+
dir: string;
|
|
19
|
+
draggable: boolean;
|
|
20
|
+
hidden: boolean;
|
|
21
|
+
inert: boolean;
|
|
22
|
+
innerText: string;
|
|
23
|
+
lang: string;
|
|
24
|
+
readonly offsetHeight: number;
|
|
25
|
+
readonly offsetLeft: number;
|
|
26
|
+
readonly offsetParent: Element | null;
|
|
27
|
+
readonly offsetTop: number;
|
|
28
|
+
readonly offsetWidth: number;
|
|
29
|
+
outerText: string;
|
|
30
|
+
spellcheck: boolean;
|
|
31
|
+
title: string;
|
|
32
|
+
translate: boolean;
|
|
33
|
+
attachInternals(): ElementInternals;
|
|
34
|
+
click(): void;
|
|
35
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
36
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
37
|
+
removeEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
|
|
38
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
|
|
39
|
+
readonly attributes: NamedNodeMap;
|
|
40
|
+
readonly classList: DOMTokenList;
|
|
41
|
+
className: string;
|
|
42
|
+
readonly clientHeight: number;
|
|
43
|
+
readonly clientLeft: number;
|
|
44
|
+
readonly clientTop: number;
|
|
45
|
+
readonly clientWidth: number;
|
|
46
|
+
id: string;
|
|
47
|
+
readonly localName: string;
|
|
48
|
+
readonly namespaceURI: string | null;
|
|
49
|
+
onfullscreenchange: ((this: Element, ev: Event) => any) | null;
|
|
50
|
+
onfullscreenerror: ((this: Element, ev: Event) => any) | null;
|
|
51
|
+
outerHTML: string;
|
|
52
|
+
readonly ownerDocument: Document;
|
|
53
|
+
readonly part: DOMTokenList;
|
|
54
|
+
readonly prefix: string | null;
|
|
55
|
+
readonly scrollHeight: number;
|
|
56
|
+
scrollLeft: number;
|
|
57
|
+
scrollTop: number;
|
|
58
|
+
readonly scrollWidth: number;
|
|
59
|
+
readonly shadowRoot: ShadowRoot | null;
|
|
60
|
+
slot: string;
|
|
61
|
+
readonly tagName: string;
|
|
62
|
+
attachShadow(init: ShadowRootInit): ShadowRoot;
|
|
63
|
+
closest<K_2 extends keyof HTMLElementTagNameMap>(selector: K_2): HTMLElementTagNameMap[K_2] | null;
|
|
64
|
+
closest<K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3] | null;
|
|
65
|
+
closest<E extends Element = Element>(selectors: string): E | null;
|
|
66
|
+
getAttribute(qualifiedName: string): string | null;
|
|
67
|
+
getAttributeNS(namespace: string | null, localName: string): string | null;
|
|
68
|
+
getAttributeNames(): string[];
|
|
69
|
+
getAttributeNode(qualifiedName: string): Attr | null;
|
|
70
|
+
getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
|
|
71
|
+
getBoundingClientRect(): DOMRect;
|
|
72
|
+
getClientRects(): DOMRectList;
|
|
73
|
+
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
|
|
74
|
+
getElementsByTagName<K_4 extends keyof HTMLElementTagNameMap>(qualifiedName: K_4): HTMLCollectionOf<HTMLElementTagNameMap[K_4]>;
|
|
75
|
+
getElementsByTagName<K_5 extends keyof SVGElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<SVGElementTagNameMap[K_5]>;
|
|
76
|
+
getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
|
|
77
|
+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
|
|
78
|
+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
|
|
79
|
+
getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
|
|
80
|
+
hasAttribute(qualifiedName: string): boolean;
|
|
81
|
+
hasAttributeNS(namespace: string | null, localName: string): boolean;
|
|
82
|
+
hasAttributes(): boolean;
|
|
83
|
+
hasPointerCapture(pointerId: number): boolean;
|
|
84
|
+
insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
|
|
85
|
+
insertAdjacentHTML(position: InsertPosition, text: string): void;
|
|
86
|
+
insertAdjacentText(where: InsertPosition, data: string): void;
|
|
87
|
+
matches(selectors: string): boolean;
|
|
88
|
+
releasePointerCapture(pointerId: number): void;
|
|
89
|
+
removeAttribute(qualifiedName: string): void;
|
|
90
|
+
removeAttributeNS(namespace: string | null, localName: string): void;
|
|
91
|
+
removeAttributeNode(attr: Attr): Attr;
|
|
92
|
+
requestFullscreen(options?: FullscreenOptions | undefined): Promise<void>;
|
|
93
|
+
requestPointerLock(): void;
|
|
94
|
+
scroll(options?: ScrollToOptions | undefined): void;
|
|
95
|
+
scroll(x: number, y: number): void;
|
|
96
|
+
scrollBy(options?: ScrollToOptions | undefined): void;
|
|
97
|
+
scrollBy(x: number, y: number): void;
|
|
98
|
+
scrollIntoView(arg?: boolean | ScrollIntoViewOptions | undefined): void;
|
|
99
|
+
scrollTo(options?: ScrollToOptions | undefined): void;
|
|
100
|
+
scrollTo(x: number, y: number): void;
|
|
101
|
+
setAttribute(qualifiedName: string, value: string): void;
|
|
102
|
+
setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
|
|
103
|
+
setAttributeNode(attr: Attr): Attr | null;
|
|
104
|
+
setAttributeNodeNS(attr: Attr): Attr | null;
|
|
105
|
+
setPointerCapture(pointerId: number): void;
|
|
106
|
+
toggleAttribute(qualifiedName: string, force?: boolean | undefined): boolean;
|
|
107
|
+
webkitMatchesSelector(selectors: string): boolean;
|
|
108
|
+
readonly baseURI: string;
|
|
109
|
+
readonly childNodes: NodeListOf<ChildNode>;
|
|
110
|
+
readonly firstChild: ChildNode | null;
|
|
111
|
+
readonly isConnected: boolean;
|
|
112
|
+
readonly lastChild: ChildNode | null;
|
|
113
|
+
readonly nextSibling: ChildNode | null;
|
|
114
|
+
readonly nodeName: string;
|
|
115
|
+
readonly nodeType: number;
|
|
116
|
+
nodeValue: string | null;
|
|
117
|
+
readonly parentElement: HTMLElement | null;
|
|
118
|
+
readonly parentNode: ParentNode | null;
|
|
119
|
+
readonly previousSibling: ChildNode | null;
|
|
120
|
+
textContent: string | null;
|
|
121
|
+
appendChild<T extends Node>(node: T): T;
|
|
122
|
+
cloneNode(deep?: boolean | undefined): Node;
|
|
123
|
+
compareDocumentPosition(other: Node): number;
|
|
124
|
+
contains(other: Node | null): boolean;
|
|
125
|
+
getRootNode(options?: GetRootNodeOptions | undefined): Node;
|
|
126
|
+
hasChildNodes(): boolean;
|
|
127
|
+
insertBefore<T_1 extends Node>(node: T_1, child: Node | null): T_1;
|
|
128
|
+
isDefaultNamespace(namespace: string | null): boolean;
|
|
129
|
+
isEqualNode(otherNode: Node | null): boolean;
|
|
130
|
+
isSameNode(otherNode: Node | null): boolean;
|
|
131
|
+
lookupNamespaceURI(prefix: string | null): string | null;
|
|
132
|
+
lookupPrefix(namespace: string | null): string | null;
|
|
133
|
+
normalize(): void;
|
|
134
|
+
removeChild<T_2 extends Node>(child: T_2): T_2;
|
|
135
|
+
replaceChild<T_3 extends Node>(node: Node, child: T_3): T_3;
|
|
136
|
+
readonly ATTRIBUTE_NODE: number;
|
|
137
|
+
readonly CDATA_SECTION_NODE: number;
|
|
138
|
+
readonly COMMENT_NODE: number;
|
|
139
|
+
readonly DOCUMENT_FRAGMENT_NODE: number;
|
|
140
|
+
readonly DOCUMENT_NODE: number;
|
|
141
|
+
readonly DOCUMENT_POSITION_CONTAINED_BY: number;
|
|
142
|
+
readonly DOCUMENT_POSITION_CONTAINS: number;
|
|
143
|
+
readonly DOCUMENT_POSITION_DISCONNECTED: number;
|
|
144
|
+
readonly DOCUMENT_POSITION_FOLLOWING: number;
|
|
145
|
+
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
|
|
146
|
+
readonly DOCUMENT_POSITION_PRECEDING: number;
|
|
147
|
+
readonly DOCUMENT_TYPE_NODE: number;
|
|
148
|
+
readonly ELEMENT_NODE: number;
|
|
149
|
+
readonly ENTITY_NODE: number;
|
|
150
|
+
readonly ENTITY_REFERENCE_NODE: number;
|
|
151
|
+
readonly NOTATION_NODE: number;
|
|
152
|
+
readonly PROCESSING_INSTRUCTION_NODE: number;
|
|
153
|
+
readonly TEXT_NODE: number;
|
|
154
|
+
dispatchEvent(event: Event): boolean;
|
|
155
|
+
ariaAtomic: string | null;
|
|
156
|
+
ariaAutoComplete: string | null;
|
|
157
|
+
ariaBusy: string | null;
|
|
158
|
+
ariaChecked: string | null;
|
|
159
|
+
ariaColCount: string | null;
|
|
160
|
+
ariaColIndex: string | null;
|
|
161
|
+
ariaColIndexText: string | null;
|
|
162
|
+
ariaColSpan: string | null;
|
|
163
|
+
ariaCurrent: string | null;
|
|
164
|
+
ariaDisabled: string | null;
|
|
165
|
+
ariaExpanded: string | null;
|
|
166
|
+
ariaHasPopup: string | null;
|
|
167
|
+
ariaHidden: string | null;
|
|
168
|
+
ariaInvalid: string | null;
|
|
169
|
+
ariaKeyShortcuts: string | null;
|
|
170
|
+
ariaLabel: string | null;
|
|
171
|
+
ariaLevel: string | null;
|
|
172
|
+
ariaLive: string | null;
|
|
173
|
+
ariaModal: string | null;
|
|
174
|
+
ariaMultiLine: string | null;
|
|
175
|
+
ariaMultiSelectable: string | null;
|
|
176
|
+
ariaOrientation: string | null;
|
|
177
|
+
ariaPlaceholder: string | null;
|
|
178
|
+
ariaPosInSet: string | null;
|
|
179
|
+
ariaPressed: string | null;
|
|
180
|
+
ariaReadOnly: string | null;
|
|
181
|
+
ariaRequired: string | null;
|
|
182
|
+
ariaRoleDescription: string | null;
|
|
183
|
+
ariaRowCount: string | null;
|
|
184
|
+
ariaRowIndex: string | null;
|
|
185
|
+
ariaRowIndexText: string | null;
|
|
186
|
+
ariaRowSpan: string | null;
|
|
187
|
+
ariaSelected: string | null;
|
|
188
|
+
ariaSetSize: string | null;
|
|
189
|
+
ariaSort: string | null;
|
|
190
|
+
ariaValueMax: string | null;
|
|
191
|
+
ariaValueMin: string | null;
|
|
192
|
+
ariaValueNow: string | null;
|
|
193
|
+
ariaValueText: string | null;
|
|
194
|
+
role: string | null;
|
|
195
|
+
animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions | undefined): Animation;
|
|
196
|
+
getAnimations(options?: GetAnimationsOptions | undefined): Animation[];
|
|
197
|
+
after(...nodes: (string | Node)[]): void;
|
|
198
|
+
before(...nodes: (string | Node)[]): void;
|
|
199
|
+
remove(): void;
|
|
200
|
+
replaceWith(...nodes: (string | Node)[]): void;
|
|
201
|
+
innerHTML: string;
|
|
202
|
+
readonly nextElementSibling: Element | null;
|
|
203
|
+
readonly previousElementSibling: Element | null;
|
|
204
|
+
readonly childElementCount: number;
|
|
205
|
+
readonly children: HTMLCollection;
|
|
206
|
+
readonly firstElementChild: Element | null;
|
|
207
|
+
readonly lastElementChild: Element | null;
|
|
208
|
+
append(...nodes: (string | Node)[]): void;
|
|
209
|
+
prepend(...nodes: (string | Node)[]): void;
|
|
210
|
+
querySelector<K_6 extends keyof HTMLElementTagNameMap>(selectors: K_6): HTMLElementTagNameMap[K_6] | null;
|
|
211
|
+
querySelector<K_7 extends keyof SVGElementTagNameMap>(selectors: K_7): SVGElementTagNameMap[K_7] | null;
|
|
212
|
+
querySelector<E_1 extends Element = Element>(selectors: string): E_1 | null;
|
|
213
|
+
querySelectorAll<K_8 extends keyof HTMLElementTagNameMap>(selectors: K_8): NodeListOf<HTMLElementTagNameMap[K_8]>;
|
|
214
|
+
querySelectorAll<K_9 extends keyof SVGElementTagNameMap>(selectors: K_9): NodeListOf<SVGElementTagNameMap[K_9]>;
|
|
215
|
+
querySelectorAll<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
|
|
216
|
+
replaceChildren(...nodes: (string | Node)[]): void;
|
|
217
|
+
readonly assignedSlot: HTMLSlotElement | null;
|
|
218
|
+
oncopy: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
219
|
+
oncut: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
220
|
+
onpaste: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
221
|
+
readonly style: CSSStyleDeclaration;
|
|
222
|
+
contentEditable: string;
|
|
223
|
+
enterKeyHint: string;
|
|
224
|
+
inputMode: string;
|
|
225
|
+
readonly isContentEditable: boolean;
|
|
226
|
+
onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
|
|
227
|
+
onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
228
|
+
onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
229
|
+
onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
230
|
+
onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
231
|
+
onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
232
|
+
onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
|
|
233
|
+
onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
|
|
234
|
+
oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
235
|
+
oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
236
|
+
oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
237
|
+
onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
238
|
+
onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
239
|
+
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
240
|
+
oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
241
|
+
oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
242
|
+
ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
243
|
+
ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
244
|
+
ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
245
|
+
ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
246
|
+
ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
247
|
+
ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
248
|
+
ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
249
|
+
ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
250
|
+
ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
251
|
+
onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
252
|
+
onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
253
|
+
onerror: OnErrorEventHandler;
|
|
254
|
+
onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
|
|
255
|
+
onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
|
|
256
|
+
ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
257
|
+
oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
258
|
+
oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
259
|
+
onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
260
|
+
onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
261
|
+
onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
262
|
+
onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
263
|
+
onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
264
|
+
onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
265
|
+
onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
266
|
+
onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
267
|
+
onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
268
|
+
onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
269
|
+
onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
270
|
+
onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
271
|
+
onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
272
|
+
onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
273
|
+
onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
274
|
+
onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
275
|
+
onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
276
|
+
onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
277
|
+
onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
278
|
+
onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
279
|
+
onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
280
|
+
onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
281
|
+
onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
282
|
+
onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
283
|
+
onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
284
|
+
onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
285
|
+
onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any) | null;
|
|
286
|
+
onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
287
|
+
onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
288
|
+
onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
|
|
289
|
+
onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
290
|
+
onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
|
|
291
|
+
onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
292
|
+
onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
293
|
+
onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
294
|
+
onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
295
|
+
onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
296
|
+
onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
297
|
+
onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
298
|
+
onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
|
|
299
|
+
onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
300
|
+
ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
301
|
+
ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
302
|
+
ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
303
|
+
ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
304
|
+
ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
305
|
+
ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
306
|
+
ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
307
|
+
ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
308
|
+
ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
309
|
+
ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
310
|
+
onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
311
|
+
onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
312
|
+
onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
313
|
+
onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
314
|
+
onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
315
|
+
onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
316
|
+
onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
|
|
317
|
+
autofocus: boolean;
|
|
318
|
+
readonly dataset: DOMStringMap;
|
|
319
|
+
nonce?: string | undefined;
|
|
320
|
+
tabIndex: number;
|
|
321
|
+
blur(): void;
|
|
322
|
+
focus(options?: FocusOptions | undefined): void;
|
|
323
|
+
};
|
|
324
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AnimationEndParams, TimeEffect } from '../types';
|
|
2
|
+
declare function addAnimationEndHandler(source: HTMLElement, target: HTMLElement, effect: TimeEffect, __: AnimationEndParams): void;
|
|
3
|
+
declare function removeAnimationEndHandler(element: HTMLElement): void;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
add: typeof addAnimationEndHandler;
|
|
6
|
+
remove: typeof removeAnimationEndHandler;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TimeEffect, TransitionEffect, StateParams, PointerTriggerParams } from '../types';
|
|
2
|
+
declare function addClickHandler(source: HTMLElement, target: HTMLElement, effect: TimeEffect | TransitionEffect, options?: StateParams | PointerTriggerParams): void;
|
|
3
|
+
declare function removeClickHandler(element: HTMLElement): void;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
add: typeof addClickHandler;
|
|
6
|
+
remove: typeof removeClickHandler;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TimeEffect, TransitionEffect, StateParams, PointerTriggerParams } from '../types';
|
|
2
|
+
declare function addHoverHandler(source: HTMLElement, target: HTMLElement, effect: TransitionEffect | TimeEffect, options?: StateParams | PointerTriggerParams): void;
|
|
3
|
+
declare function removeHoverHandler(element: HTMLElement): void;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
add: typeof addHoverHandler;
|
|
6
|
+
remove: typeof removeHoverHandler;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PointerMoveParams, ScrubEffect } from '../types';
|
|
2
|
+
declare function addPointerMoveHandler(source: HTMLElement, target: HTMLElement, effect: ScrubEffect, options?: PointerMoveParams): void;
|
|
3
|
+
declare function removePointerMoveHandler(element: HTMLElement): void;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
add: typeof addPointerMoveHandler;
|
|
6
|
+
remove: typeof removePointerMoveHandler;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TimeEffect, ScrubEffect, HandlerObject, HandlerObjectMap, AnimationOptions } from '../types';
|
|
2
|
+
export declare function effectToAnimationOptions(effect: TimeEffect | ScrubEffect): AnimationOptions<"time"> | AnimationOptions<"scrub">;
|
|
3
|
+
export declare function addHandlerToMap(handlersMap: HandlerObjectMap, element: HTMLElement, handlerObj: HandlerObject): void;
|
|
4
|
+
export declare function removeElementFromHandlerMap(handlerMap: HandlerObjectMap, element: HTMLElement): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TimeEffect, ViewEnterParams } from '../types';
|
|
2
|
+
declare function addViewEnterHandler(source: HTMLElement, target: HTMLElement, effect: TimeEffect, options?: ViewEnterParams): void;
|
|
3
|
+
declare function removeViewEnterHandler(element: HTMLElement): void;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
add: typeof addViewEnterHandler;
|
|
6
|
+
remove: typeof removeViewEnterHandler;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ViewEnterParams, ScrubEffect } from '../types';
|
|
2
|
+
declare function addViewProgressHandler(source: HTMLElement, target: HTMLElement, effect: ScrubEffect, __: ViewEnterParams): void;
|
|
3
|
+
declare function removeViewProgressHandler(element: HTMLElement): void;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
add: typeof addViewProgressHandler;
|
|
6
|
+
remove: typeof removeViewProgressHandler;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { InteractConfig, InteractCache, IWixInteractElement } from './types';
|
|
2
|
+
export declare class Interact {
|
|
3
|
+
dataCache: InteractCache;
|
|
4
|
+
addedInteractions: {
|
|
5
|
+
[interactionId: string]: boolean;
|
|
6
|
+
};
|
|
7
|
+
static instances: Interact[];
|
|
8
|
+
static elementCache: Map<string, IWixInteractElement>;
|
|
9
|
+
constructor();
|
|
10
|
+
init(config: InteractConfig): void;
|
|
11
|
+
has(path: string): boolean;
|
|
12
|
+
clearInteractionStateForPath(path: string): void;
|
|
13
|
+
static create(config: InteractConfig): Interact;
|
|
14
|
+
static getInstance(path: string): Interact | undefined;
|
|
15
|
+
static getElement(path: string): IWixInteractElement | undefined;
|
|
16
|
+
static setElement(path: string, element: IWixInteractElement): void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Adds all events and effects to an element based on config
|
|
20
|
+
*/
|
|
21
|
+
export declare function add(element: IWixInteractElement, path: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Removes all events and effects from an element based on config
|
|
24
|
+
*/
|
|
25
|
+
export declare function remove(path: string): void;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { NamedEffect, MotionKeyframeEffect, CustomEffect, RangeOffset, ScrubTransitionEasing, MotionAnimationOptions } from '@wix/motion';
|
|
3
|
+
declare global {
|
|
4
|
+
namespace JSX {
|
|
5
|
+
interface IntrinsicElements {
|
|
6
|
+
'wix-interact-element': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
|
|
7
|
+
'data-wix-path'?: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export type TriggerType = 'hover' | 'click' | 'viewEnter' | 'pageVisible' | 'animationEnd' | 'viewProgress' | 'pointerMove';
|
|
13
|
+
export type ViewEnterType = 'once' | 'repeat' | 'alternate';
|
|
14
|
+
export type TransitionMethod = 'add' | 'remove' | 'toggle' | 'clear';
|
|
15
|
+
export type StateParams = {
|
|
16
|
+
method: TransitionMethod;
|
|
17
|
+
};
|
|
18
|
+
export type PointerTriggerParams = {
|
|
19
|
+
type?: ViewEnterType | 'state';
|
|
20
|
+
};
|
|
21
|
+
export type ViewEnterParams = {
|
|
22
|
+
type?: ViewEnterType;
|
|
23
|
+
threshold?: number;
|
|
24
|
+
inset?: string;
|
|
25
|
+
};
|
|
26
|
+
export type PointerMoveParams = {
|
|
27
|
+
hitArea?: 'root' | 'self';
|
|
28
|
+
};
|
|
29
|
+
export type AnimationEndParams = {
|
|
30
|
+
effectId: string;
|
|
31
|
+
};
|
|
32
|
+
export type TriggerParams = StateParams | PointerTriggerParams | ViewEnterParams | PointerMoveParams | AnimationEndParams;
|
|
33
|
+
type Fill = 'none' | 'forwards' | 'backwards' | 'both';
|
|
34
|
+
type EffectEffectProperty = {
|
|
35
|
+
keyframeEffect: MotionKeyframeEffect;
|
|
36
|
+
} | {
|
|
37
|
+
namedEffect: NamedEffect;
|
|
38
|
+
} | {
|
|
39
|
+
customEffect: CustomEffect;
|
|
40
|
+
};
|
|
41
|
+
export type TimeEffect = {
|
|
42
|
+
target?: string;
|
|
43
|
+
duration: number;
|
|
44
|
+
easing?: string;
|
|
45
|
+
iterations?: number;
|
|
46
|
+
alternate?: boolean;
|
|
47
|
+
fill?: Fill;
|
|
48
|
+
reversed?: boolean;
|
|
49
|
+
delay?: number;
|
|
50
|
+
effectId?: string;
|
|
51
|
+
} & EffectEffectProperty;
|
|
52
|
+
export type ScrubEffect = {
|
|
53
|
+
target?: string;
|
|
54
|
+
easing?: string;
|
|
55
|
+
iterations?: number;
|
|
56
|
+
alternate?: boolean;
|
|
57
|
+
fill?: Fill;
|
|
58
|
+
reversed?: boolean;
|
|
59
|
+
rangeStart?: RangeOffset;
|
|
60
|
+
rangeEnd?: RangeOffset;
|
|
61
|
+
centeredToTarget?: boolean;
|
|
62
|
+
transitionDuration?: number;
|
|
63
|
+
transitionDelay?: number;
|
|
64
|
+
transitionEasing?: ScrubTransitionEasing;
|
|
65
|
+
} & EffectEffectProperty;
|
|
66
|
+
export type TransitionOptions = {
|
|
67
|
+
duration?: number;
|
|
68
|
+
delay?: number;
|
|
69
|
+
easing?: string;
|
|
70
|
+
};
|
|
71
|
+
export type StyleProperty = {
|
|
72
|
+
name: string;
|
|
73
|
+
value: string;
|
|
74
|
+
};
|
|
75
|
+
export type TransitionProperty = StyleProperty & TransitionOptions;
|
|
76
|
+
export type TransitionEffect = {
|
|
77
|
+
target?: string;
|
|
78
|
+
effectId?: string;
|
|
79
|
+
} & {
|
|
80
|
+
transition?: TransitionOptions & {
|
|
81
|
+
styleProperties: StyleProperty[];
|
|
82
|
+
};
|
|
83
|
+
transitionProperties?: TransitionProperty[];
|
|
84
|
+
};
|
|
85
|
+
export type EffectRef = {
|
|
86
|
+
target?: string;
|
|
87
|
+
effectId: string;
|
|
88
|
+
conditions?: string[];
|
|
89
|
+
};
|
|
90
|
+
export type Effect = (TimeEffect | ScrubEffect | TransitionEffect) & {
|
|
91
|
+
conditions?: string[];
|
|
92
|
+
};
|
|
93
|
+
export type Condition = {
|
|
94
|
+
type: 'media' | 'container';
|
|
95
|
+
predicate?: string;
|
|
96
|
+
};
|
|
97
|
+
type InteractionTrigger = {
|
|
98
|
+
source: string;
|
|
99
|
+
trigger: TriggerType;
|
|
100
|
+
params?: TriggerParams;
|
|
101
|
+
conditions?: string[];
|
|
102
|
+
};
|
|
103
|
+
export type Interaction = InteractionTrigger & {
|
|
104
|
+
effects: ((Effect | EffectRef) & {
|
|
105
|
+
interactionId?: string;
|
|
106
|
+
})[];
|
|
107
|
+
};
|
|
108
|
+
export type InteractConfig = {
|
|
109
|
+
effects: Record<string, Effect>;
|
|
110
|
+
conditions?: Record<string, Condition>;
|
|
111
|
+
interactions: Interaction[];
|
|
112
|
+
};
|
|
113
|
+
export type AnimationOptions<T extends 'time' | 'scrub'> = MotionAnimationOptions<T> & EffectEffectProperty;
|
|
114
|
+
export interface IWixInteractElement extends HTMLElement {
|
|
115
|
+
_internals: (ElementInternals & {
|
|
116
|
+
states: Set<string>;
|
|
117
|
+
}) | null;
|
|
118
|
+
connected: boolean;
|
|
119
|
+
sheet: CSSStyleSheet | null;
|
|
120
|
+
connectedCallback(): void;
|
|
121
|
+
disconnectedCallback(): void;
|
|
122
|
+
connect(path?: string): void;
|
|
123
|
+
renderStyle(cssText: string): void;
|
|
124
|
+
toggleEffect(effectId: string, method: StateParams['method']): void;
|
|
125
|
+
}
|
|
126
|
+
export type InteractionParamsTypes = {
|
|
127
|
+
hover: StateParams | PointerTriggerParams;
|
|
128
|
+
click: StateParams | PointerTriggerParams;
|
|
129
|
+
viewEnter: ViewEnterParams;
|
|
130
|
+
pageVisible: ViewEnterParams;
|
|
131
|
+
animationEnd: AnimationEndParams;
|
|
132
|
+
viewProgress: ViewEnterParams;
|
|
133
|
+
pointerMove: PointerMoveParams;
|
|
134
|
+
};
|
|
135
|
+
export type InteractionHandlerModule<T extends TriggerType> = {
|
|
136
|
+
add: (source: HTMLElement, target: HTMLElement, effect: Effect, options: InteractionParamsTypes[T]) => void;
|
|
137
|
+
remove: (element: HTMLElement) => void;
|
|
138
|
+
};
|
|
139
|
+
export type TriggerHandlerMap<T extends TriggerType> = {
|
|
140
|
+
[K in T]: InteractionHandlerModule<K>;
|
|
141
|
+
};
|
|
142
|
+
export type HandlerObject = {
|
|
143
|
+
source: HTMLElement;
|
|
144
|
+
target: HTMLElement;
|
|
145
|
+
cleanup: () => void;
|
|
146
|
+
handler?: () => void;
|
|
147
|
+
};
|
|
148
|
+
export type HandlerObjectMap = WeakMap<HTMLElement, Set<HandlerObject>>;
|
|
149
|
+
export type InteractCache = {
|
|
150
|
+
effects: {
|
|
151
|
+
[effectId: string]: Effect;
|
|
152
|
+
};
|
|
153
|
+
conditions: {
|
|
154
|
+
[conditionId: string]: Condition;
|
|
155
|
+
};
|
|
156
|
+
interactions: {
|
|
157
|
+
[path: string]: {
|
|
158
|
+
triggers: Interaction[];
|
|
159
|
+
effects: Record<string, (InteractionTrigger & {
|
|
160
|
+
effect: Effect | EffectRef;
|
|
161
|
+
})[]>;
|
|
162
|
+
interactionIds: Set<string>;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
export type CreateTransitionCSSParams = {
|
|
167
|
+
path: string;
|
|
168
|
+
effectId: string;
|
|
169
|
+
transition?: TransitionEffect['transition'];
|
|
170
|
+
properties?: TransitionProperty[];
|
|
171
|
+
childSelector?: string;
|
|
172
|
+
};
|
|
173
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Condition, CreateTransitionCSSParams } from './types';
|
|
2
|
+
export declare function generateId(): string;
|
|
3
|
+
export declare function createTransitionCSS({ path, effectId, transition, properties, childSelector, }: CreateTransitionCSSParams): string;
|
|
4
|
+
export declare function getMediaQuery(conditionNames: string[] | undefined, conditions: Record<string, Condition>): MediaQueryList | undefined;
|