@wix/interact 2.0.0-rc.5 → 2.0.0-rc.7
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 +37 -25
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/react.js +5 -5
- package/dist/cjs/react.js.map +1 -1
- package/dist/cjs/web.js +1 -1
- package/dist/cjs/web.js.map +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/react.js +126 -122
- package/dist/es/react.js.map +1 -1
- package/dist/es/web.js +2 -2
- package/dist/es/web.js.map +1 -1
- package/dist/index-BDNsOpKs.js +18 -0
- package/dist/index-BDNsOpKs.js.map +1 -0
- package/dist/index-DdSF9eaW.mjs +2302 -0
- package/dist/index-DdSF9eaW.mjs.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/core/Interact.d.ts +2 -0
- package/dist/types/core/Interact.d.ts.map +1 -1
- package/dist/types/core/InteractionController.d.ts.map +1 -1
- package/dist/types/core/add.d.ts.map +1 -1
- package/dist/types/core/css.d.ts +1 -1
- package/dist/types/core/css.d.ts.map +1 -1
- package/dist/types/core/remove.d.ts.map +1 -1
- package/dist/types/core/utilities.d.ts.map +1 -1
- package/dist/types/handlers/animationEnd.d.ts.map +1 -1
- package/dist/types/handlers/click.d.ts.map +1 -1
- package/dist/types/handlers/hover.d.ts.map +1 -1
- package/dist/types/handlers/index.d.ts.map +1 -1
- package/dist/types/handlers/pointerMove.d.ts.map +1 -1
- package/dist/types/handlers/utilities.d.ts.map +1 -1
- package/dist/types/handlers/viewEnter.d.ts.map +1 -1
- package/dist/types/handlers/viewProgress.d.ts.map +1 -1
- package/dist/types/react/Interaction.d.ts +2 -1
- package/dist/types/react/Interaction.d.ts.map +1 -1
- package/dist/types/types.d.ts +2 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts +6 -0
- package/dist/types/utils.d.ts.map +1 -1
- package/dist/types/web/InteractElement.d.ts.map +1 -1
- package/docs/README.md +56 -39
- package/docs/advanced/README.md +15 -105
- package/docs/api/README.md +31 -19
- package/docs/api/element-selection.md +161 -77
- package/docs/api/functions.md +96 -377
- package/docs/api/interact-class.md +142 -405
- package/docs/api/interact-element.md +60 -253
- package/docs/api/interaction-controller.md +51 -20
- package/docs/api/types.md +118 -95
- package/docs/examples/README.md +53 -30
- package/docs/examples/click-interactions.md +276 -269
- package/docs/examples/entrance-animations.md +376 -327
- package/docs/examples/hover-effects.md +252 -250
- package/docs/examples/list-patterns.md +519 -450
- package/docs/guides/README.md +11 -3
- package/docs/guides/conditions-and-media-queries.md +757 -782
- package/docs/guides/configuration-structure.md +436 -440
- package/docs/guides/custom-elements.md +91 -69
- package/docs/guides/effects-and-animations.md +34 -33
- package/docs/guides/getting-started.md +105 -61
- package/docs/guides/lists-and-dynamic-content.md +298 -263
- package/docs/guides/state-management.md +301 -306
- package/docs/guides/understanding-triggers.md +178 -135
- package/docs/integration/README.md +71 -18
- package/docs/integration/react.md +120 -113
- package/package.json +4 -4
- package/rules/Integration.md +87 -51
- package/rules/click.md +32 -2
- package/rules/full-lean.md +41 -27
- package/rules/hover.md +38 -4
- package/rules/pointermove.md +290 -42
- package/rules/scroll-list.md +55 -9
- package/rules/viewenter.md +210 -162
- package/rules/viewprogress.md +70 -15
- package/dist/index-CKecAdEz.mjs +0 -7348
- package/dist/index-CKecAdEz.mjs.map +0 -1
- package/dist/index-DlTJdKHL.js +0 -18
- package/dist/index-DlTJdKHL.js.map +0 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ A powerful, declarative interaction library for creating engaging web animations
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- 🎯 **Declarative Configuration** - Define complex interactions through simple JSON configuration
|
|
8
|
-
- 🎨 **Rich Animation Support** - Integration with `@wix/motion` for high-performance animations
|
|
8
|
+
- 🎨 **Rich Animation Support** - Integration with `@wix/motion` for high-performance animations
|
|
9
9
|
- 🖱️ **Multiple Trigger Types** - Support for hover, click, scroll, viewport, and custom triggers
|
|
10
10
|
- 📱 **Responsive Conditions** - Media query and container-based conditional interactions
|
|
11
11
|
- 🔧 **Custom Elements** - Web Components API for easy framework integration
|
|
@@ -23,6 +23,7 @@ npm install @wix/interact
|
|
|
23
23
|
### Using Custom Elements
|
|
24
24
|
|
|
25
25
|
#### 1. Basic Setup
|
|
26
|
+
|
|
26
27
|
```typescript
|
|
27
28
|
import { Interact } from '@wix/interact/web';
|
|
28
29
|
|
|
@@ -35,19 +36,19 @@ const config = {
|
|
|
35
36
|
effects: [
|
|
36
37
|
{
|
|
37
38
|
effectId: 'fade-in',
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
}
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
41
42
|
],
|
|
42
43
|
effects: {
|
|
43
44
|
'fade-in': {
|
|
44
45
|
duration: 1000,
|
|
45
46
|
keyframeEffect: {
|
|
46
47
|
name: 'fade',
|
|
47
|
-
keyframes: {opacity: [0, 1]}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
48
|
+
keyframes: { opacity: [0, 1] },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
// Initialize the interact instance
|
|
@@ -66,6 +67,7 @@ const interact = Interact.create(config);
|
|
|
66
67
|
### Using React
|
|
67
68
|
|
|
68
69
|
#### 1. Basic Setup
|
|
70
|
+
|
|
69
71
|
```typescript
|
|
70
72
|
import { Interact } from '@wix/interact/react';
|
|
71
73
|
|
|
@@ -78,19 +80,19 @@ const config = {
|
|
|
78
80
|
effects: [
|
|
79
81
|
{
|
|
80
82
|
effectId: 'fade-in',
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
}
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
84
86
|
],
|
|
85
87
|
effects: {
|
|
86
88
|
'fade-in': {
|
|
87
89
|
duration: 1000,
|
|
88
90
|
keyframeEffect: {
|
|
89
91
|
name: 'fade',
|
|
90
|
-
keyframes: {opacity: [0, 1]}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
92
|
+
keyframes: { opacity: [0, 1] },
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
94
96
|
};
|
|
95
97
|
|
|
96
98
|
// Initialize the interact instance
|
|
@@ -114,6 +116,7 @@ function MyComponent() {
|
|
|
114
116
|
### Vanilla usage
|
|
115
117
|
|
|
116
118
|
#### 1. Basic Setup
|
|
119
|
+
|
|
117
120
|
```typescript
|
|
118
121
|
import { Interact, add } from '@wix/interact';
|
|
119
122
|
|
|
@@ -126,19 +129,19 @@ const config = {
|
|
|
126
129
|
effects: [
|
|
127
130
|
{
|
|
128
131
|
effectId: 'fade-in',
|
|
129
|
-
}
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
132
135
|
],
|
|
133
136
|
effects: {
|
|
134
137
|
'fade-in': {
|
|
135
138
|
duration: 1000,
|
|
136
139
|
keyframeEffect: {
|
|
137
140
|
name: 'fade',
|
|
138
|
-
keyframes: {opacity: [0, 1]}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
141
|
+
keyframes: { opacity: [0, 1] },
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
142
145
|
};
|
|
143
146
|
|
|
144
147
|
// add element
|
|
@@ -151,15 +154,15 @@ const interact = Interact.create(config);
|
|
|
151
154
|
#### 2. HTML Setup
|
|
152
155
|
|
|
153
156
|
```html
|
|
154
|
-
<div data-interact-key="my-element" class="animated-content">
|
|
155
|
-
Hello, animated world!
|
|
156
|
-
</div>
|
|
157
|
+
<div data-interact-key="my-element" class="animated-content">Hello, animated world!</div>
|
|
157
158
|
```
|
|
158
159
|
|
|
159
160
|
## Core Concepts
|
|
160
161
|
|
|
161
162
|
### Triggers
|
|
163
|
+
|
|
162
164
|
Define when interactions should occur:
|
|
165
|
+
|
|
163
166
|
- `viewEnter` - When element enters viewport
|
|
164
167
|
- `click` - On element click
|
|
165
168
|
- `hover` - On element hover
|
|
@@ -168,7 +171,9 @@ Define when interactions should occur:
|
|
|
168
171
|
- `animationEnd` - When another animation completes
|
|
169
172
|
|
|
170
173
|
### Effects
|
|
174
|
+
|
|
171
175
|
Define what should happen:
|
|
176
|
+
|
|
172
177
|
- **Time-based animations** - Duration-based effects with easing
|
|
173
178
|
- **Scroll-driven animations** - Progress-based effects tied to scroll
|
|
174
179
|
- **Pointer-driven animations** - Progress-based effects linked to pointer position
|
|
@@ -176,6 +181,7 @@ Define what should happen:
|
|
|
176
181
|
- **Custom effects** - Integration with `@wix/motion`
|
|
177
182
|
|
|
178
183
|
### Configuration Structure
|
|
184
|
+
|
|
179
185
|
```typescript
|
|
180
186
|
{
|
|
181
187
|
interactions: [ // Define trigger → effect relationships
|
|
@@ -208,12 +214,14 @@ Define what should happen:
|
|
|
208
214
|
### Interact Class
|
|
209
215
|
|
|
210
216
|
#### Static Methods
|
|
217
|
+
|
|
211
218
|
```typescript
|
|
212
219
|
// Create a new instance with configuration
|
|
213
220
|
Interact.create(config: InteractConfig): Interact
|
|
214
221
|
```
|
|
215
222
|
|
|
216
223
|
### Standalone Functions
|
|
224
|
+
|
|
217
225
|
```typescript
|
|
218
226
|
// Add interactions to an element
|
|
219
227
|
add(element: IInteractElement, key: string): boolean
|
|
@@ -225,6 +233,7 @@ remove(key: string): void
|
|
|
225
233
|
## Examples
|
|
226
234
|
|
|
227
235
|
### Entrance Animation
|
|
236
|
+
|
|
228
237
|
```typescript
|
|
229
238
|
{
|
|
230
239
|
interactions: [{
|
|
@@ -249,6 +258,7 @@ remove(key: string): void
|
|
|
249
258
|
```
|
|
250
259
|
|
|
251
260
|
### Click Interaction
|
|
261
|
+
|
|
252
262
|
```typescript
|
|
253
263
|
{
|
|
254
264
|
interactions: [{
|
|
@@ -268,6 +278,7 @@ remove(key: string): void
|
|
|
268
278
|
```
|
|
269
279
|
|
|
270
280
|
### Scroll-driven Animation
|
|
281
|
+
|
|
271
282
|
```typescript
|
|
272
283
|
{
|
|
273
284
|
interactions: [{
|
|
@@ -294,6 +305,7 @@ remove(key: string): void
|
|
|
294
305
|
```
|
|
295
306
|
|
|
296
307
|
### Responsive Interactions
|
|
308
|
+
|
|
297
309
|
```typescript
|
|
298
310
|
{
|
|
299
311
|
interactions: [{
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-BDNsOpKs.js");exports.Interact=e.Interact;exports.add=e.add;exports.generate=e.generate;exports.remove=e.remove;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/react.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("react"),P=require("../index-BDNsOpKs.js");var q={exports:{}},$={};var Se;function dr(){if(Se)return $;Se=1;var h=Y,y=Symbol.for("react.element"),w=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,j=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x={key:!0,ref:!0,__self:!0,__source:!0};function R(_,f,T){var c,b={},E=null,L=null;T!==void 0&&(E=""+T),f.key!==void 0&&(E=""+f.key),f.ref!==void 0&&(L=f.ref);for(c in f)m.call(f,c)&&!x.hasOwnProperty(c)&&(b[c]=f[c]);if(_&&_.defaultProps)for(c in f=_.defaultProps,f)b[c]===void 0&&(b[c]=f[c]);return{$$typeof:y,type:_,key:E,ref:L,props:b,_owner:j.current}}return $.Fragment=w,$.jsx=R,$.jsxs=R,$}var W={};var Ce;function vr(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&(function(){var h=Y,y=Symbol.for("react.element"),w=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),_=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),L=Symbol.for("react.offscreen"),Q=Symbol.iterator,je="@@iterator";function xe(e){if(e===null||typeof e!="object")return null;var r=Q&&e[Q]||e[je];return typeof r=="function"?r:null}var k=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function d(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];ke("error",e,t)}}function ke(e,r,t){{var n=k.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var u=t.map(function(i){return String(i)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var De=!1,Fe=!1,Ae=!1,Ie=!1,$e=!1,ee;ee=Symbol.for("react.module.reference");function We(e){return!!(typeof e=="string"||typeof e=="function"||e===m||e===x||$e||e===j||e===T||e===c||Ie||e===L||De||Fe||Ae||typeof e=="object"&&e!==null&&(e.$$typeof===E||e.$$typeof===b||e.$$typeof===R||e.$$typeof===_||e.$$typeof===f||e.$$typeof===ee||e.getModuleId!==void 0))}function Ye(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function re(e){return e.displayName||"Context"}function O(e){if(e==null)return null;if(typeof e.tag=="number"&&d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case m:return"Fragment";case w:return"Portal";case x:return"Profiler";case j:return"StrictMode";case T:return"Suspense";case c:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _:var r=e;return re(r)+".Consumer";case R:var t=e;return re(t._context)+".Provider";case f:return Ye(e,e.render,"ForwardRef");case b:var n=e.displayName||null;return n!==null?n:O(e.type)||"Memo";case E:{var o=e,u=o._payload,i=o._init;try{return O(i(u))}catch{return null}}}return null}var S=Object.assign,A=0,te,ne,ae,ie,oe,ue,se;function le(){}le.__reactDisabledLog=!0;function Le(){{if(A===0){te=console.log,ne=console.info,ae=console.warn,ie=console.error,oe=console.group,ue=console.groupCollapsed,se=console.groupEnd;var e={configurable:!0,enumerable:!0,value:le,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}A++}}function Me(){{if(A--,A===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:S({},e,{value:te}),info:S({},e,{value:ne}),warn:S({},e,{value:ae}),error:S({},e,{value:ie}),group:S({},e,{value:oe}),groupCollapsed:S({},e,{value:ue}),groupEnd:S({},e,{value:se})})}A<0&&d("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=k.ReactCurrentDispatcher,B;function M(e,r,t){{if(B===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);B=n&&n[1]||""}return`
|
|
2
2
|
`+B+e}}var G=!1,V;{var Ve=typeof WeakMap=="function"?WeakMap:Map;V=new Ve}function fe(e,r){if(!e||G)return"";{var t=V.get(e);if(t!==void 0)return t}var n;G=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=J.current,J.current=null,Le();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(p){n=p}Reflect.construct(e,[],i)}else{try{i.call()}catch(p){n=p}e.call(i.prototype)}}else{try{throw Error()}catch(p){n=p}e()}}catch(p){if(p&&n&&typeof p.stack=="string"){for(var a=p.stack.split(`
|
|
3
3
|
`),v=n.stack.split(`
|
|
4
|
-
`),s=a.length-1,l=v.length-1;s>=1&&l>=0&&a[s]!==v[l];)l--;for(;s>=1&&l>=0;s--,l--)if(a[s]!==v[l]){if(s!==1||l!==1)do if(s--,l--,l<0||a[s]!==v[l]){var
|
|
5
|
-
`+a[s].replace(" at new "," at ");return e.displayName&&
|
|
4
|
+
`),s=a.length-1,l=v.length-1;s>=1&&l>=0&&a[s]!==v[l];)l--;for(;s>=1&&l>=0;s--,l--)if(a[s]!==v[l]){if(s!==1||l!==1)do if(s--,l--,l<0||a[s]!==v[l]){var g=`
|
|
5
|
+
`+a[s].replace(" at new "," at ");return e.displayName&&g.includes("<anonymous>")&&(g=g.replace("<anonymous>",e.displayName)),typeof e=="function"&&V.set(e,g),g}while(s>=1&&l>=0);break}}}finally{G=!1,J.current=u,Me(),Error.prepareStackTrace=o}var F=e?e.displayName||e.name:"",C=F?M(F):"";return typeof e=="function"&&V.set(e,C),C}function Ue(e,r,t){return fe(e,!1)}function Ne(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function U(e,r,t){if(e==null)return"";if(typeof e=="function")return fe(e,Ne(e));if(typeof e=="string")return M(e);switch(e){case T:return M("Suspense");case c:return M("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Ue(e.render);case b:return U(e.type,r,t);case E:{var n=e,o=n._payload,u=n._init;try{return U(u(o),r,t)}catch{}}}return""}var I=Object.prototype.hasOwnProperty,ce={},de=k.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);de.setExtraStackFrame(t)}else de.setExtraStackFrame(null)}function qe(e,r,t,n,o){{var u=Function.call.bind(I);for(var i in e)if(u(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var v=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw v.name="Invariant Violation",v}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(N(o),d("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),N(null)),a instanceof Error&&!(a.message in ce)&&(ce[a.message]=!0,N(o),d("Failed %s type: %s",t,a.message),N(null))}}}var Je=Array.isArray;function z(e){return Je(e)}function Be(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Ge(e){try{return ve(e),!1}catch{return!0}}function ve(e){return""+e}function pe(e){if(Ge(e))return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Be(e)),ve(e)}var ge=k.ReactCurrentOwner,ze={key:!0,ref:!0,__self:!0,__source:!0},Re,be;function Ke(e){if(I.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Xe(e){if(I.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function He(e,r){typeof e.ref=="string"&&ge.current}function Ze(e,r){{var t=function(){Re||(Re=!0,d("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Qe(e,r){{var t=function(){be||(be=!0,d("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var er=function(e,r,t,n,o,u,i){var a={$$typeof:y,type:e,key:r,ref:t,props:i,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function rr(e,r,t,n,o){{var u,i={},a=null,v=null;t!==void 0&&(pe(t),a=""+t),Xe(r)&&(pe(r.key),a=""+r.key),Ke(r)&&(v=r.ref,He(r,o));for(u in r)I.call(r,u)&&!ze.hasOwnProperty(u)&&(i[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)i[u]===void 0&&(i[u]=s[u])}if(a||v){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&Ze(i,l),v&&Qe(i,l)}return er(e,a,v,o,n,ge.current,i)}}var K=k.ReactCurrentOwner,ye=k.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}var X;X=!1;function H(e){return typeof e=="object"&&e!==null&&e.$$typeof===y}function Ee(){{if(K.current){var e=O(K.current.type);if(e)return`
|
|
6
6
|
|
|
7
7
|
Check the render method of \``+e+"`."}return""}}function tr(e){return""}var _e={};function nr(e){{var r=Ee();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
8
8
|
|
|
9
|
-
Check the top-level render call using <`+t+">.")}return r}}function he(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=nr(r);if(_e[t])return;_e[t]=!0;var n="";e&&e._owner&&e._owner!==K.current&&(n=" It was passed a child from "+
|
|
9
|
+
Check the top-level render call using <`+t+">.")}return r}}function he(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=nr(r);if(_e[t])return;_e[t]=!0;var n="";e&&e._owner&&e._owner!==K.current&&(n=" It was passed a child from "+O(e._owner.type)+"."),D(e),d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),D(null)}}function me(e,r){{if(typeof e!="object")return;if(z(e))for(var t=0;t<e.length;t++){var n=e[t];H(n)&&he(n,r)}else if(H(e))e._store&&(e._store.validated=!0);else if(e){var o=xe(e);if(typeof o=="function"&&o!==e.entries)for(var u=o.call(e),i;!(i=u.next()).done;)H(i.value)&&he(i.value,r)}}}function ar(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===b))t=r.propTypes;else return;if(t){var n=O(r);qe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!X){X=!0;var o=O(r);d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ir(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){D(e),d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),D(null);break}}e.ref!==null&&(D(e),d("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}var Te={};function Oe(e,r,t,n,o,u){{var i=We(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var v=tr();v?a+=v:a+=Ee();var s;e===null?s="null":z(e)?s="array":e!==void 0&&e.$$typeof===y?(s="<"+(O(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var l=rr(e,r,t,o,u);if(l==null)return l;if(i){var g=r.children;if(g!==void 0)if(n)if(z(g)){for(var F=0;F<g.length;F++)me(g[F],e);Object.freeze&&Object.freeze(g)}else d("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else me(g,e)}if(I.call(r,"key")){var C=O(e),p=Object.keys(r).filter(function(cr){return cr!=="key"}),Z=p.length>0?"{key: someKey, "+p.join(": ..., ")+": ...}":"{key: someKey}";if(!Te[C+Z]){var fr=p.length>0?"{"+p.join(": ..., ")+": ...}":"{}";d(`A props object containing a "key" prop is being spread into JSX:
|
|
10
10
|
let props = %s;
|
|
11
11
|
<%s {...props} />
|
|
12
12
|
React keys must be passed directly to JSX without using spread:
|
|
13
13
|
let props = %s;
|
|
14
|
-
<%s key={someKey} {...props} />`,Z,
|
|
14
|
+
<%s key={someKey} {...props} />`,Z,C,fr,C),Te[C+Z]=!0}}return e===m?ir(l):ar(l),l}}function or(e,r,t){return Oe(e,r,t,!0)}function ur(e,r,t){return Oe(e,r,t,!1)}var sr=ur,lr=or;W.Fragment=m,W.jsx=sr,W.jsxs=lr})()),W}var Pe;function pr(){return Pe||(Pe=1,process.env.NODE_ENV==="production"?q.exports=dr():q.exports=vr()),q.exports}var gr=pr();function we(h){return function(y){return y?P.add(y,h):P.remove(h),()=>{P.remove(h)}}}const Rr=Y.forwardRef(function({tagName:y,interactKey:w,initial:m,children:j,...x},R){const _=y,f=Y.useRef(null);f.current==null&&(f.current=we(w));const T=Y.useCallback(c=>{const b=f.current?.(c);let E;return R&&(typeof R=="function"?E=R(c):R.current=c),()=>{b?.(),E?.()}},[R]);return gr.jsx(_,{"data-interact-key":w,"data-interact-initial":m?"true":void 0,...x,ref:T,children:j})});exports.Interact=P.Interact;exports.add=P.add;exports.generate=P.generate;exports.remove=P.remove;exports.Interaction=Rr;exports.createInteractRef=we;
|
|
15
15
|
//# sourceMappingURL=react.js.map
|