Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/interact/docs/api/interact-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Interact.setup({
}),
});

// Enable accessibility for click and hover triggers
// Enable accessibility for all click and hover triggers
Interact.setup({
allowA11yTriggers: true,
});
Expand Down
20 changes: 10 additions & 10 deletions packages/interact/docs/guides/custom-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ interact-element.--hover-active .my-element {
}
```

### State Toggle Methods
### State Toggle Actions

The element provides methods to manage states:
The element provides actions to manage states:

1. `add`: adds a state named by `effectId`
2. `remove`: removes a state named by `effectId`
Expand Down Expand Up @@ -164,16 +164,16 @@ export default {
```javascript
// Create element programmatically
function createInteractiveElement(id, content) {
const wixElement = document.createElement('interact-element');
wixElement.dataset.wixPath = id;
const interactElement = document.createElement('interact-element');
interactElement.dataset.interactKey = id;

const childElement = document.createElement('div');
childElement.id = id;
childElement.innerHTML = content;

wixElement.appendChild(childElement);
interactElement.appendChild(childElement);

return wixElement;
return interactElement;
}

// Usage
Expand Down Expand Up @@ -218,12 +218,12 @@ You can change the key dynamically:
const element = document.querySelector('interact-element');

// Remove old interactions
if (element.dataset.wixPath) {
remove(element.dataset.wixPath);
if (element.dataset.interactKey) {
remove(element.dataset.interactKey);
}

// Update key
element.dataset.wixPath = 'new-target';
element.dataset.interactKey = 'new-target';

// Reconnect with new key
element.connect('new-target');
Expand Down Expand Up @@ -303,7 +303,7 @@ console.log('interact-element registered:', customElements.get('interact-element
```javascript
const element = document.querySelector('interact-element');
console.log('Connected:', element.connected);
console.log('Key:', element.dataset.wixPath);
console.log('Key:', element.dataset.interactKey);
console.log('Has child:', element.firstElementChild !== null);
```

Expand Down
32 changes: 17 additions & 15 deletions packages/interact/docs/integration/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ const config: InteractConfig = {
key: 'accordion',
trigger: 'click',
selector: '.accordion-header',
effects: [{ effectId: 'expanded', method: 'toggle' }],
effects: [{ effectId: 'expanded', stateAction: 'toggle' }],
},
],
};
Expand Down Expand Up @@ -461,22 +461,24 @@ import { Interact, Interaction, InteractConfig } from '@wix/interact/react';
const config: InteractConfig = {
interactions: [
{
key: 'product-list',
key: 'product-list', // single triggering parent
trigger: 'viewEnter',
listContainer: '.products',
effects: [
{
keyframeEffect: {
name: 'slide-up',
keyframes: [
{ opacity: 0, transform: 'translateY(30px)' },
{ opacity: 1, transform: 'translateY(0)' },
],
sequences: [{
offset: 100, // Stagger animation for list items
effects: [
{
listContainer: '.products', //multiple target elements
keyframeEffect: {
name: 'slide-up',
keyframes: [
{ opacity: 0, transform: 'translateY(30px)' },
{ opacity: 1, transform: 'translateY(0)' },
],
},
duration: 400,
},
duration: 400,
stagger: 100, // Stagger animation for list items
},
],
],
}],
},
],
};
Expand Down
2 changes: 1 addition & 1 deletion packages/interact/rules/full-lean.md
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ The target element is what the effect animates. Resolved in priority order:
| `Interact.registerEffects(presets)` | Register named effect presets. MUST be called before `create`. |
| `Interact.destroy()` | Tear down all instances. Call on unmount or route change to prevent memory leaks. |
| `Interact.forceReducedMotion` | `boolean` (default: `false`) — force reduced-motion behavior regardless of OS setting. |
| `Interact.allowA11yTriggers` | `boolean` (default: `false`) — enable accessibility trigger variants (`interest`, `activate`). |
| `Interact.allowA11yTriggers` | `boolean` (default: `true`) — enable accessibility trigger variants (`interest`, `activate`). |
| `Interact.setup(options)` | Configure global options for scroll, pointer, and viewEnter systems. Call before `create`. See options below. |

**`Interact.setup(options)`** — optional configuration object:
Expand Down
Binary file added skills/interactor.skill
Binary file not shown.
Loading
Loading