@wix/interact 1.93.0 → 2.0.0-rc.2

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.
Files changed (179) hide show
  1. package/dist/cjs/index.js +2 -23
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/react.js +15 -0
  4. package/dist/cjs/react.js.map +1 -0
  5. package/dist/cjs/web.js +2 -0
  6. package/dist/cjs/web.js.map +1 -0
  7. package/dist/es/index.js +8 -0
  8. package/dist/es/index.js.map +1 -0
  9. package/dist/es/react.js +650 -0
  10. package/dist/es/react.js.map +1 -0
  11. package/dist/es/web.js +56 -0
  12. package/dist/es/web.js.map +1 -0
  13. package/dist/index-C8QxOkui.mjs +7940 -0
  14. package/dist/index-C8QxOkui.mjs.map +1 -0
  15. package/dist/index-DEPRHaUt.js +18 -0
  16. package/dist/index-DEPRHaUt.js.map +1 -0
  17. package/dist/tsconfig.build.tsbuildinfo +1 -0
  18. package/dist/types/core/Interact.d.ts +17 -7
  19. package/dist/types/core/Interact.d.ts.map +1 -0
  20. package/dist/types/core/InteractionController.d.ts +19 -0
  21. package/dist/types/core/InteractionController.d.ts.map +1 -0
  22. package/dist/types/core/add.d.ts +4 -3
  23. package/dist/types/core/add.d.ts.map +1 -0
  24. package/dist/types/core/css.d.ts +3 -0
  25. package/dist/types/core/css.d.ts.map +1 -0
  26. package/dist/types/core/remove.d.ts +3 -1
  27. package/dist/types/core/remove.d.ts.map +1 -0
  28. package/dist/types/core/utilities.d.ts +1 -0
  29. package/dist/types/core/utilities.d.ts.map +1 -0
  30. package/dist/types/dom/api.d.ts +3 -0
  31. package/dist/types/dom/api.d.ts.map +1 -0
  32. package/dist/types/handlers/animationEnd.d.ts +3 -2
  33. package/dist/types/handlers/animationEnd.d.ts.map +1 -0
  34. package/dist/types/handlers/click.d.ts +3 -2
  35. package/dist/types/handlers/click.d.ts.map +1 -0
  36. package/dist/types/handlers/hover.d.ts +3 -2
  37. package/dist/types/handlers/hover.d.ts.map +1 -0
  38. package/dist/types/handlers/index.d.ts +1 -0
  39. package/dist/types/handlers/index.d.ts.map +1 -0
  40. package/dist/types/handlers/pointerMove.d.ts +3 -2
  41. package/dist/types/handlers/pointerMove.d.ts.map +1 -0
  42. package/dist/types/handlers/utilities.d.ts +1 -0
  43. package/dist/types/handlers/utilities.d.ts.map +1 -0
  44. package/dist/types/handlers/viewEnter.d.ts +3 -2
  45. package/dist/types/handlers/viewEnter.d.ts.map +1 -0
  46. package/dist/types/handlers/viewProgress.d.ts +4 -3
  47. package/dist/types/handlers/viewProgress.d.ts.map +1 -0
  48. package/dist/types/index.d.ts +3 -2
  49. package/dist/types/index.d.ts.map +1 -0
  50. package/dist/types/react/Interaction.d.ts +10 -0
  51. package/dist/types/react/Interaction.d.ts.map +1 -0
  52. package/dist/types/react/index.d.ts +8 -0
  53. package/dist/types/react/index.d.ts.map +1 -0
  54. package/dist/types/react/interactRef.d.ts +3 -0
  55. package/dist/types/react/interactRef.d.ts.map +1 -0
  56. package/dist/types/types.d.ts +23 -10
  57. package/dist/types/types.d.ts.map +1 -0
  58. package/dist/types/utils.d.ts +2 -1
  59. package/dist/types/utils.d.ts.map +1 -0
  60. package/dist/types/{InteractElement.d.ts → web/InteractElement.d.ts} +115 -77
  61. package/dist/types/web/InteractElement.d.ts.map +1 -0
  62. package/dist/types/web/defineInteractElement.d.ts +2 -0
  63. package/dist/types/web/defineInteractElement.d.ts.map +1 -0
  64. package/dist/types/web/index.d.ts +6 -0
  65. package/dist/types/web/index.d.ts.map +1 -0
  66. package/docs/README.md +211 -0
  67. package/docs/advanced/README.md +164 -0
  68. package/docs/api/README.md +157 -0
  69. package/docs/api/element-selection.md +607 -0
  70. package/docs/api/functions.md +638 -0
  71. package/docs/api/interact-class.md +663 -0
  72. package/docs/api/interact-element.md +565 -0
  73. package/docs/api/interaction-controller.md +450 -0
  74. package/docs/api/types.md +957 -0
  75. package/docs/examples/README.md +212 -0
  76. package/docs/examples/click-interactions.md +977 -0
  77. package/docs/examples/entrance-animations.md +935 -0
  78. package/docs/examples/hover-effects.md +930 -0
  79. package/docs/examples/list-patterns.md +737 -0
  80. package/docs/guides/README.md +49 -0
  81. package/docs/guides/conditions-and-media-queries.md +1068 -0
  82. package/docs/guides/configuration-structure.md +726 -0
  83. package/docs/guides/custom-elements.md +327 -0
  84. package/docs/guides/effects-and-animations.md +634 -0
  85. package/docs/guides/getting-started.md +379 -0
  86. package/docs/guides/lists-and-dynamic-content.md +713 -0
  87. package/docs/guides/state-management.md +747 -0
  88. package/docs/guides/understanding-triggers.md +690 -0
  89. package/docs/integration/README.md +264 -0
  90. package/docs/integration/react.md +605 -0
  91. package/package.json +73 -56
  92. package/rules/Integration.md +255 -0
  93. package/rules/click-rules.md +533 -0
  94. package/rules/full-lean.md +346 -0
  95. package/rules/hover-rules.md +593 -0
  96. package/rules/pointermove-rules.md +1341 -0
  97. package/rules/scroll-list-rules.md +900 -0
  98. package/rules/viewenter-rules.md +1015 -0
  99. package/rules/viewprogress-rules.md +1044 -0
  100. package/dist/cjs/InteractElement.js +0 -163
  101. package/dist/cjs/InteractElement.js.map +0 -1
  102. package/dist/cjs/__tests__/interact.spec.js +0 -2094
  103. package/dist/cjs/__tests__/interact.spec.js.map +0 -1
  104. package/dist/cjs/__tests__/viewEnter.spec.js +0 -207
  105. package/dist/cjs/__tests__/viewEnter.spec.js.map +0 -1
  106. package/dist/cjs/core/Interact.js +0 -257
  107. package/dist/cjs/core/Interact.js.map +0 -1
  108. package/dist/cjs/core/add.js +0 -250
  109. package/dist/cjs/core/add.js.map +0 -1
  110. package/dist/cjs/core/remove.js +0 -35
  111. package/dist/cjs/core/remove.js.map +0 -1
  112. package/dist/cjs/core/utilities.js +0 -16
  113. package/dist/cjs/core/utilities.js.map +0 -1
  114. package/dist/cjs/external-types.d.js +0 -2
  115. package/dist/cjs/external-types.d.js.map +0 -1
  116. package/dist/cjs/handlers/animationEnd.js +0 -37
  117. package/dist/cjs/handlers/animationEnd.js.map +0 -1
  118. package/dist/cjs/handlers/click.js +0 -122
  119. package/dist/cjs/handlers/click.js.map +0 -1
  120. package/dist/cjs/handlers/hover.js +0 -147
  121. package/dist/cjs/handlers/hover.js.map +0 -1
  122. package/dist/cjs/handlers/index.js +0 -32
  123. package/dist/cjs/handlers/index.js.map +0 -1
  124. package/dist/cjs/handlers/pointerMove.js +0 -49
  125. package/dist/cjs/handlers/pointerMove.js.map +0 -1
  126. package/dist/cjs/handlers/utilities.js +0 -49
  127. package/dist/cjs/handlers/utilities.js.map +0 -1
  128. package/dist/cjs/handlers/viewEnter.js +0 -131
  129. package/dist/cjs/handlers/viewEnter.js.map +0 -1
  130. package/dist/cjs/handlers/viewProgress.js +0 -79
  131. package/dist/cjs/handlers/viewProgress.js.map +0 -1
  132. package/dist/cjs/test-types.d.js +0 -2
  133. package/dist/cjs/test-types.d.js.map +0 -1
  134. package/dist/cjs/types.js +0 -2
  135. package/dist/cjs/types.js.map +0 -1
  136. package/dist/cjs/utils.js +0 -98
  137. package/dist/cjs/utils.js.map +0 -1
  138. package/dist/esm/InteractElement.js +0 -157
  139. package/dist/esm/InteractElement.js.map +0 -1
  140. package/dist/esm/__tests__/interact.spec.js +0 -2102
  141. package/dist/esm/__tests__/interact.spec.js.map +0 -1
  142. package/dist/esm/__tests__/viewEnter.spec.js +0 -210
  143. package/dist/esm/__tests__/viewEnter.spec.js.map +0 -1
  144. package/dist/esm/core/Interact.js +0 -251
  145. package/dist/esm/core/Interact.js.map +0 -1
  146. package/dist/esm/core/add.js +0 -245
  147. package/dist/esm/core/add.js.map +0 -1
  148. package/dist/esm/core/remove.js +0 -30
  149. package/dist/esm/core/remove.js.map +0 -1
  150. package/dist/esm/core/utilities.js +0 -14
  151. package/dist/esm/core/utilities.js.map +0 -1
  152. package/dist/esm/external-types.d.js +0 -2
  153. package/dist/esm/external-types.d.js.map +0 -1
  154. package/dist/esm/handlers/animationEnd.js +0 -33
  155. package/dist/esm/handlers/animationEnd.js.map +0 -1
  156. package/dist/esm/handlers/click.js +0 -122
  157. package/dist/esm/handlers/click.js.map +0 -1
  158. package/dist/esm/handlers/hover.js +0 -147
  159. package/dist/esm/handlers/hover.js.map +0 -1
  160. package/dist/esm/handlers/index.js +0 -27
  161. package/dist/esm/handlers/index.js.map +0 -1
  162. package/dist/esm/handlers/pointerMove.js +0 -48
  163. package/dist/esm/handlers/pointerMove.js.map +0 -1
  164. package/dist/esm/handlers/utilities.js +0 -43
  165. package/dist/esm/handlers/utilities.js.map +0 -1
  166. package/dist/esm/handlers/viewEnter.js +0 -133
  167. package/dist/esm/handlers/viewEnter.js.map +0 -1
  168. package/dist/esm/handlers/viewProgress.js +0 -75
  169. package/dist/esm/handlers/viewProgress.js.map +0 -1
  170. package/dist/esm/index.js +0 -5
  171. package/dist/esm/index.js.map +0 -1
  172. package/dist/esm/test-types.d.js +0 -2
  173. package/dist/esm/test-types.d.js.map +0 -1
  174. package/dist/esm/types.js +0 -2
  175. package/dist/esm/types.js.map +0 -1
  176. package/dist/esm/utils.js +0 -92
  177. package/dist/esm/utils.js.map +0 -1
  178. package/dist/types/__tests__/interact.spec.d.ts +0 -1
  179. package/dist/types/__tests__/viewEnter.spec.d.ts +0 -0
@@ -0,0 +1,264 @@
1
+ # Integration Guides
2
+
3
+ Framework-specific integration guides and migration documentation for `@wix/interact`.
4
+
5
+ ## Package Entry Points
6
+
7
+ `@wix/interact` provides three entry points optimized for different use cases:
8
+
9
+ | Entry Point | Use Case | Key Exports |
10
+ |-------------|----------|-------------|
11
+ | `@wix/interact/react` | React applications | `Interact`, `Interaction` |
12
+ | `@wix/interact/web` | Web Components | `Interact` |
13
+ | `@wix/interact` | Vanilla JS | `Interact`, `add`, `remove` |
14
+
15
+ ## Framework Integration
16
+
17
+ ### React
18
+ - [**React Integration**](react.md) - Complete React setup guide
19
+ - [Interaction Component](react.md#the-interaction-component) - React component for interactive elements
20
+ - [createInteractRef](react.md#the-createinteractref-function) - Ref callback for manual control
21
+ - [Configuration Patterns](react.md#configuration-patterns) - useEffect and custom hooks
22
+ - [TypeScript Support](react.md#typescript-support) - Full type inference
23
+ - [SSR Compatibility](react.md#server-side-rendering-ssr) - Next.js and other SSR frameworks
24
+
25
+ ### Vanilla JavaScript
26
+ - [**Vanilla JS Integration**](vanilla-js.md) - Direct DOM usage
27
+ - [Basic Setup](vanilla-js.md#setup) - No framework required
28
+ - [Dynamic Content](vanilla-js.md#dynamic) - Adding interactions to dynamic content
29
+ - [Event Management](vanilla-js.md#events) - Manual event handling
30
+ - [Module Systems](vanilla-js.md#modules) - ES6, CommonJS, UMD usage
31
+
32
+ ### Other Frameworks
33
+ - [**Vue.js Integration**](other-frameworks.md#vue) - Vue-specific patterns
34
+ - [**Angular Integration**](other-frameworks.md#angular) - Angular service approach
35
+ - [**Svelte Integration**](other-frameworks.md#svelte) - Svelte action usage
36
+ - [**Web Components**](other-frameworks.md#web-components) - Framework-agnostic usage
37
+
38
+ ## Migration Guides
39
+
40
+ ### From Other Libraries
41
+ - [**From GSAP**](migration.md#gsap) - Migrating GSAP animations
42
+ - [**From Framer Motion**](migration.md#framer) - React animation migration
43
+ - [**From Animate.css**](migration.md#animate-css) - CSS animation migration
44
+ - [**From AOS**](migration.md#aos) - Scroll animation migration
45
+ - [**From Lottie**](migration.md#lottie) - Complex animation migration
46
+
47
+ ### Version Migration
48
+ - [**Upgrading from v0.x**](migration.md#version-upgrade) - Breaking changes and migration path
49
+
50
+ ## Build Tools & Bundlers
51
+
52
+ ### Webpack
53
+ - [**Webpack Setup**](build-tools.md#webpack) - Configuration and optimization
54
+ - [**Code Splitting**](build-tools.md#code-splitting) - Lazy loading interactions
55
+ - [**Bundle Analysis**](build-tools.md#analysis) - Size optimization
56
+
57
+ ### Vite
58
+ - [**Vite Configuration**](build-tools.md#vite) - Modern build setup
59
+ - [**Development Mode**](build-tools.md#dev-mode) - Fast development experience
60
+ - [**Production Optimization**](build-tools.md#production) - Build optimization
61
+
62
+ ### Other Bundlers
63
+ - [**Rollup**](build-tools.md#rollup) - Library bundling
64
+ - [**Parcel**](build-tools.md#parcel) - Zero-config setup
65
+ - [**esbuild**](build-tools.md#esbuild) - Fast builds
66
+
67
+ ## Development Environment
68
+
69
+ ### Testing
70
+ - [**Testing Interactions**](testing.md) - Comprehensive testing guide
71
+ - [Unit Testing](testing.md#unit) - Testing individual interactions
72
+ - [Integration Testing](testing.md#integration) - Testing interaction flows
73
+ - [Visual Testing](testing.md#visual) - Animation regression testing
74
+ - [Performance Testing](testing.md#performance) - Animation performance
75
+ - [Accessibility Testing](testing.md#accessibility) - Inclusive testing
76
+
77
+ ### Debugging
78
+ - [**Debugging Guide**](debugging.md) - Development tools and techniques
79
+ - [Browser DevTools](debugging.md#devtools) - Inspection and debugging
80
+ - [Animation Inspector](debugging.md#inspector) - Animation debugging
81
+ - [Performance Profiling](debugging.md#profiling) - Performance analysis
82
+ - [Common Issues](debugging.md#issues) - Troubleshooting guide
83
+
84
+ ### Development Tools
85
+ - [**Development Workflow**](development-tools.md) - Tools and extensions
86
+ - [**Browser Extensions**](development-tools.md#extensions) - Helpful browser tools
87
+ - [**VS Code Setup**](development-tools.md#vscode) - Editor configuration
88
+ - [**Linting and Formatting**](development-tools.md#linting) - Code quality tools
89
+
90
+ ## Server-Side Rendering
91
+
92
+ ### Next.js
93
+ - [**Next.js Integration**](ssr.md#nextjs) - SSR and SSG support
94
+ - [**Hydration Issues**](ssr.md#hydration) - Avoiding hydration mismatches
95
+ - [**Performance Optimization**](ssr.md#performance) - SSR performance
96
+
97
+ ### Nuxt.js
98
+ - [**Nuxt.js Setup**](ssr.md#nuxtjs) - Vue SSR integration
99
+ - [**Plugin Configuration**](ssr.md#plugins) - Nuxt plugin setup
100
+
101
+ ### Universal Considerations
102
+ - [**SSR Best Practices**](ssr.md#best-practices) - General SSR guidelines
103
+ - [**Client-Side Hydration**](ssr.md#hydration-strategies) - Hydration strategies
104
+
105
+ ## Progressive Enhancement
106
+
107
+ ### Core Principles
108
+ - [**Progressive Enhancement**](progressive-enhancement.md) - Graceful degradation
109
+ - [**Fallback Strategies**](progressive-enhancement.md#fallbacks) - No-JS experience
110
+ - [**Feature Detection**](progressive-enhancement.md#detection) - Browser capability detection
111
+
112
+ ### Implementation
113
+ - [**CSS Fallbacks**](progressive-enhancement.md#css) - CSS-only alternatives
114
+ - [**Reduced Motion**](progressive-enhancement.md#reduced-motion) - Accessibility preferences
115
+ - [**Network Awareness**](progressive-enhancement.md#network) - Adaptive loading
116
+
117
+ ## Browser Support
118
+
119
+ ### Compatibility
120
+ - [**Browser Support Matrix**](browser-support.md) - Supported browsers
121
+ - [**Polyfills**](browser-support.md#polyfills) - Required polyfills for older browsers
122
+ - [**Feature Detection**](browser-support.md#detection) - Runtime capability detection
123
+
124
+ ### Legacy Support
125
+ - [**Internet Explorer**](browser-support.md#ie) - IE11 support (with polyfills)
126
+ - [**Mobile Browsers**](browser-support.md#mobile) - iOS Safari, Chrome Mobile
127
+ - [**Progressive Enhancement**](browser-support.md#enhancement) - Graceful fallbacks
128
+
129
+ ## Performance Optimization
130
+
131
+ ### Bundle Optimization
132
+ - [**Tree Shaking**](performance.md#tree-shaking) - Eliminating unused code
133
+ - [**Dynamic Imports**](performance.md#dynamic-imports) - Lazy loading
134
+ - [**Bundle Analysis**](performance.md#analysis) - Size optimization
135
+
136
+ ### Runtime Performance
137
+ - [**Animation Performance**](performance.md#animation) - Smooth animations
138
+ - [**Memory Management**](performance.md#memory) - Avoiding memory leaks
139
+ - [**Event Optimization**](performance.md#events) - Efficient event handling
140
+
141
+ ## Deployment
142
+
143
+ ### CDN Usage
144
+ - [**CDN Integration**](deployment.md#cdn) - Using with CDNs
145
+ - [**Caching Strategies**](deployment.md#caching) - Optimal caching
146
+
147
+ ### Production Checklist
148
+ - [**Pre-deployment Checklist**](deployment.md#checklist) - Production readiness
149
+ - [**Monitoring**](deployment.md#monitoring) - Performance monitoring
150
+ - [**Error Tracking**](deployment.md#errors) - Error handling in production
151
+
152
+ ## Quick Reference
153
+
154
+ ### Installation Commands
155
+ ```bash
156
+ # npm
157
+ npm install @wix/interact @wix/motion
158
+
159
+ # yarn
160
+ yarn add @wix/interact @wix/motion
161
+
162
+ # pnpm
163
+ pnpm add @wix/interact @wix/motion
164
+ ```
165
+
166
+ ### Entry Point Imports
167
+
168
+ ```typescript
169
+ // React applications (recommended for React)
170
+ import { Interact, Interaction, createInteractRef, InteractRef } from '@wix/interact/react';
171
+
172
+ // Web Components
173
+ import { Interact, add, remove } from '@wix/interact/web';
174
+
175
+ // Vanilla JavaScript
176
+ import { Interact, add, remove } from '@wix/interact';
177
+ ```
178
+
179
+ ### Basic Integration
180
+
181
+ **React:**
182
+ ```tsx
183
+ import { useEffect } from 'react';
184
+ import { Interact, Interaction } from '@wix/interact/react';
185
+
186
+ const config = { /* your config */ };
187
+
188
+ function App() {
189
+ useEffect(() => {
190
+ const instance = Interact.create(config);
191
+ return () => instance.destroy();
192
+ }, []);
193
+
194
+ return (
195
+ <Interaction tagName="div" interactKey="my-element">
196
+ Interactive content
197
+ </Interaction>
198
+ );
199
+ }
200
+ ```
201
+
202
+ **Vanilla JavaScript:**
203
+ ```typescript
204
+ import { Interact } from '@wix/interact/web';
205
+
206
+ const config = { /* your config */ };
207
+
208
+ // Initialize
209
+ Interact.create(config);
210
+
211
+ // HTML
212
+ // <interact-element data-interact-key="my-element">
213
+ // <div>Interactive content</div>
214
+ // </interact-element>
215
+ ```
216
+
217
+ **Vue:**
218
+ ```vue
219
+ <template>
220
+ <interact-element data-interact-key="my-element">
221
+ <div>Interactive content</div>
222
+ </interact-element>
223
+ </template>
224
+
225
+ <script setup>
226
+ import { onMounted, onUnmounted } from 'vue';
227
+ import { Interact } from '@wix/interact/web';
228
+
229
+ const config = { /* your config */ };
230
+
231
+ onMounted(() => {
232
+ Interact.create(config);
233
+ });
234
+
235
+ onUnmounted(() => {
236
+ Interact.destroy();
237
+ });
238
+ </script>
239
+ ```
240
+
241
+ **Angular:**
242
+ ```typescript
243
+ import { Component, OnInit, OnDestroy } from '@angular/core';
244
+ import { Interact } from '@wix/interact/web';
245
+
246
+ @Component({
247
+ template: `
248
+ <interact-element data-interact-key="my-element">
249
+ <div>Interactive content</div>
250
+ </interact-element>
251
+ `
252
+ })
253
+ export class MyComponent implements OnInit, OnDestroy {
254
+ ngOnInit() {
255
+ Interact.create(config);
256
+ }
257
+
258
+ ngOnDestroy() {
259
+ Interact.destroy();
260
+ }
261
+ }
262
+ ```
263
+
264
+ For detailed examples and step-by-step instructions, explore the specific integration guides above.