Named easings are exported but not documented

Abierto
#183 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Documentación
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
css, typescript

Línea de trabajo

Inspecciona las exportaciones de runtime de @wix/motion, la documentación README/API publicada y las declaraciones de TypeScript; después, comprueba las definiciones de tipos de las reglas preset en busca de campos de easing. Documenta cssEasings y sus claves, expón el tipo named-easing y haz que los tipos de easing de los presets hagan referencia a él; la tarea estará terminada cuando los consumidores puedan encontrar y autocompletar los nombres compatibles.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

Describe the bug

@wix/motion exports a cssEasings object (a map of ~30 named easings to their cubic-bezier(…) values), but it is not documented, its keys are not exposed as a TypeScript type, and preset rule types use easing?: string rather than referencing a named-easing union. Consumers can only discover it by guessing the import exists.

// This works at runtime but is undocumented and untyped:
import { cssEasings } from '@wix/motion';

console.log(cssEasings);
// { linear: '...', ease: '...', easeInQuad: '...', easeOutCubic: '...', … }

// No exported type for the key set — have to derive it ourselves:
type CssEasingName = keyof typeof cssEasings;

// Preset easing fields accept these names but are typed as `string`:
const timing: EffectTiming = { easing: 'easeInQuad' }; // no autocomplete, no validation

To Reproduce

  1. Install @wix/[email protected]
  2. Search the published README / API docs for "cssEasings" or "named easings" — no results
  3. Open node_modules/@wix/motion type declarations — no CssEasingName or equivalent union type is exported
  4. Try typing easing: '...' in a preset config — get string, no autocomplete for valid easing names
  5. Discover cssEasings only by browsing the package's runtime exports or source

Expected behavior

  • cssEasings is documented as a public export with its keys listed
  • A union type (e.g. CssEasingName) is exported so consumers can type easing parameters against the known set
  • Preset rule types for easing fields reference that union (or at minimum document that named easing strings from cssEasings are accepted)

Screenshots

N/A — this is a docs/types gap, not a visual bug.

Desktop

  • OS: macOS 15.4
  • @wix/motion: 2.1.3
  • @wix/motion-presets: 1.0.0
  • TypeScript: 5.x

Additional context

Any tool that builds an easing picker (dropdown, autocomplete, curve preview) needs the canonical set of named easings. Currently this requires guessing the undocumented export exists, then deriving the key set at runtime. There is no compile-time safety when passing easing names to preset configs. A workaround:

import { cssEasings } from '@wix/motion';

const NAMED_EASINGS = Object.keys(cssEasings).map(name => ({
  value: name,
  label: name.replace(/([a-z])([A-Z])/g, '$1 $2'),
}));
Lenguaje dominante
TypeScript
Estrellas
4
Forks
3
Merge medio
11 h 45 min
PR fusionados (30 d)
55

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de wix/interact

Todos los issues de wix/interact

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.