Named easings are exported but not documented
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- css, typescript
- Ambito
- api, documentation
Direzione di ricerca
Ispeziona gli export del runtime di @wix/motion, la documentazione README/API pubblicata e le dichiarazioni TypeScript, quindi controlla le definizioni dei tipi delle regole preset per i campi easing. Documenta cssEasings e le sue chiavi, esponi il tipo named-easing e fai in modo che i tipi easing dei preset vi facciano riferimento; il lavoro è completato quando i consumer possono trovare e completare automaticamente i nomi supportati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Install
@wix/[email protected] - Search the published README / API docs for "cssEasings" or "named easings" — no results
- Open
node_modules/@wix/motiontype declarations — noCssEasingNameor equivalent union type is exported - Try typing
easing: '...'in a preset config — getstring, no autocomplete for valid easing names - Discover
cssEasingsonly by browsing the package's runtime exports or source
Expected behavior
cssEasingsis 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
easingfields reference that union (or at minimum document that named easing strings fromcssEasingsare 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'),
}));
- Lingua principale
- TypeScript
- Stelle
- 4
- Fork
- 3
- Merge medio
- 11h 45m
- PR unite (30g)
- 55
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di wix/interact
-
[BUG] Missing type exports of motion-presetsForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Test @wix/interact against React 18 and React 19 in CIForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di wix/interact
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
documentation easy good first issue help wanted
Difficoltà 1/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Billion-context documentation addendum: nudge is independent of window occupancy. | billion-context 文档补充:nudge 与窗口占用无关Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
ranxianglei/billion-context#5893 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
microsoft/monaco-editor#5575 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100