@wix/interact 2.5.6 → 2.5.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/rules/validate.md CHANGED
@@ -56,7 +56,7 @@ if (!result.valid) {
56
56
  - `valid` is `true` when no remaining issue has severity `'error'`. **Warnings alone do not make `valid: false`.**
57
57
  - `errors` holds **all** surfaced issues — both `'error'` and `'warning'` severities. Filter on `severity` to separate them.
58
58
  - Issues are sorted lexicographically by `path`.
59
- - Validation runs in two layers: a **structural** zod parse first (produces `SCHEMA_*` and numeric/threshold codes); if that succeeds, **referential + semantic** checks run (dangling references, unused definitions, duplicate keyframe names, media-query syntax, and the rule-derived semantic warnings — same-element re-trigger, hit-area shift, scroll-preset `range`, `animationEnd` graph cycles, element-selection coherence, `fill`/`inset` nudges, CSS property names that are neither camelCase nor kebab-case). If the structural parse fails, the semantic layer is skipped.
59
+ - Validation runs in two layers: a **structural** zod parse first (produces `SCHEMA_*` and numeric/threshold codes); if that succeeds, **referential + semantic** checks run (dangling references, unused definitions, duplicate keyframe names, media-query syntax, and the rule-derived semantic warnings — same-element re-trigger, hit-area shift, scroll-preset `range`, `animationEnd` graph cycles, element-selection coherence, `fill`/`inset` nudges, CSS property names that are neither camelCase nor kebab-case, sequence easings that cannot be compiled to CSS). If the structural parse fails, the semantic layer is skipped.
60
60
 
61
61
  ### assertValidInteractConfig
62
62
 
@@ -142,6 +142,7 @@ Severity is one of `'error' | 'warning'`. There are exactly two levers:
142
142
  | `POINTER_AXIS` | `POINTER_AXIS_IGNORED` | warning |
143
143
  | `CSS_PROPERTY_NAME` | `INVALID_CSS_PROPERTY_NAME` | warning |
144
144
  | `VIEW_INSET` | `INVALID_INSET` | warning |
145
+ | `OFFSET_EASING` | `FUNCTION_OFFSET_EASING` | warning |
145
146
 
146
147
  For each category, set `'off'` to drop those issues entirely, `'warning'` / `'error'` to set their severity:
147
148
 
@@ -237,6 +238,7 @@ Statically-detectable authoring pitfalls lifted from the trigger rule files. Eac
237
238
  | `POINTER_AXIS_IGNORED` | `pointerMove` `params.axis` set on a `namedEffect`/`customEffect` (axis only applies to `keyframeEffect`). | `POINTER_AXIS` |
238
239
  | `INVALID_CSS_PROPERTY_NAME` | A keyframe or state-effect property name is neither camelCase nor kebab-case (both casings are accepted; this one cannot be normalized). | `CSS_PROPERTY_NAME` |
239
240
  | `INVALID_INSET` | `viewEnter` `params.inset` is not 1–4 whitespace-separated CSS lengths/percentages. | `VIEW_INSET` |
241
+ | `FUNCTION_OFFSET_EASING` | A sequence's `offsetEasing` is a function, so `generate()` omits that sequence from the generated CSS. | `OFFSET_EASING` |
240
242
 
241
243
  ---
242
244
 
@@ -277,7 +279,7 @@ const ExperienceSchema = z.object({
277
279
 
278
280
  - `InteractConfigSchema` is `.strict()` — unrecognized top-level keys produce `SCHEMA_UNRECOGNIZED_KEYS`.
279
281
  - `InteractConfigSchema` carries a `.transform()`, so a successful `.parse()` returns the config augmented with an internal `warnings` array; `validateInteractConfig` consumes that for you.
280
- - `customEffect` and function-valued `offsetEasing` are accepted as opaque functions (`z.custom<Function>`) — they are not deep-validated, so JS-authored configs with function fields validate correctly.
282
+ - `customEffect` and function-valued `offsetEasing` are accepted as opaque functions (`z.custom<Function>`) — they are not deep-validated, so JS-authored configs with function fields validate correctly. A function `offsetEasing` is still structurally valid, but raises the `FUNCTION_OFFSET_EASING` warning because `generate()` cannot compile it to CSS.
281
283
  - Interactions and effects accept `$`-prefixed plugin fields (e.g. `$splitText`) — config routed to plugins registered via `Interact.use()`. Interaction/effect schemas use `.catchall(z.unknown())` + a key check instead of `.strict()`: `$`-prefixed fields are accepted with opaque values (validate has no knowledge of any plugin's shape), while any non-prefixed unknown key is still reported as `SCHEMA_UNRECOGNIZED_KEYS` (typo detection preserved). The top-level `InteractConfigSchema` stays `.strict()`.
282
284
 
283
285
  ---
@@ -60,9 +60,9 @@ For static sites, pre-render CSS via `generate()` at build time — see
60
60
  - `'cover'` — full visibility span from first pixel entering to last pixel leaving.
61
61
  - `'entry'` — the phase while the element is entering the viewport.
62
62
  - `'exit'` — the phase while the element is exiting the viewport.
63
- - `'contain'` — while the element is fully contained in the viewport. Typically used with a `position: sticky` container.
64
- - `'entry-crossing'` — from the element's leading edge entering to its leading edge reaching the opposite side.
65
- - `'exit-crossing'` — from the element's trailing edge reaching the start to its trailing edge leaving.
63
+ - `'contain'` — while the element is fully contained by the viewport, or — for an element taller than the viewport — while it fully covers it. This is the phase a `position: sticky` child stays pinned, which is why it pairs with a sticky container.
64
+ - `'entry-crossing'` — from the element's leading edge entering to its trailing edge entering.
65
+ - `'exit-crossing'` — from the element's leading edge exiting to its trailing edge exiting.
66
66
  - `[START_PERCENTAGE]` — 0–100, starting point within the named range.
67
67
  - `[END_PERCENTAGE]` — 0–100, end point within the named range.
68
68
  - `[EASING_FUNCTION]` - CSS easing string or named easing from `@wix/motion`. Typically `'linear'` for scrolling effects.