use-scroll-animate 7.7.0 → 7.9.0

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/bin/usa-codemod-8.mjs +74 -0
  3. package/dist/components/angular.d.cts +4 -0
  4. package/dist/components/angular.d.ts +4 -0
  5. package/dist/components/fx-ai.cjs +130 -0
  6. package/dist/components/fx-ai.cjs.map +1 -0
  7. package/dist/components/fx-ai.d.cts +66 -0
  8. package/dist/components/fx-ai.d.ts +66 -0
  9. package/dist/components/fx-ai.js +126 -0
  10. package/dist/components/fx-ai.js.map +1 -0
  11. package/dist/components/fx2.cjs +6 -0
  12. package/dist/components/fx2.cjs.map +1 -1
  13. package/dist/components/fx2.d.cts +23 -1
  14. package/dist/components/fx2.d.ts +23 -1
  15. package/dist/components/fx2.js +5 -1
  16. package/dist/components/fx2.js.map +1 -1
  17. package/dist/components/lite.cjs +1 -0
  18. package/dist/components/lite.cjs.map +1 -1
  19. package/dist/components/lite.js +1 -0
  20. package/dist/components/lite.js.map +1 -1
  21. package/dist/components/solid.d.cts +4 -0
  22. package/dist/components/solid.d.ts +4 -0
  23. package/dist/components/svelte.d.cts +4 -0
  24. package/dist/components/svelte.d.ts +4 -0
  25. package/dist/components/ui.cjs +1 -0
  26. package/dist/components/ui.cjs.map +1 -1
  27. package/dist/components/ui.d.cts +4 -0
  28. package/dist/components/ui.d.ts +4 -0
  29. package/dist/components/ui.js +2 -1
  30. package/dist/components/ui.js.map +1 -1
  31. package/dist/components/vue.d.cts +4 -0
  32. package/dist/components/vue.d.ts +4 -0
  33. package/dist/components/widgets.cjs +733 -128
  34. package/dist/components/widgets.cjs.map +1 -1
  35. package/dist/components/widgets.d.cts +118 -3
  36. package/dist/components/widgets.d.ts +118 -3
  37. package/dist/components/widgets.js +724 -129
  38. package/dist/components/widgets.js.map +1 -1
  39. package/dist/components.d.cts +4 -0
  40. package/dist/components.d.ts +4 -0
  41. package/dist/components.umd.js +2 -2
  42. package/dist/components.umd.js.map +1 -1
  43. package/dist/widgets.umd.js +1 -1
  44. package/dist/widgets.umd.js.map +1 -1
  45. package/docs/ROADMAP.md +2 -2
  46. package/docs/components.md +42 -0
  47. package/docs/deprecations.md +4 -0
  48. package/docs/upgrading-8.md +34 -0
  49. package/package.json +23 -2
package/docs/ROADMAP.md CHANGED
@@ -9,6 +9,6 @@
9
9
  - ✅ **v7.5** — 游戏化:成就解锁、经验条、宝箱开启、幸运转盘;新组件 排行榜、徽章墙、抽奖机。
10
10
  - ✅ **v7.6** — 地图与地理:路线绘制、旋转地球、标记脉冲、飞线;新组件 3D 地球、位置卡片。
11
11
  - ✅ **v7.7** — 表单动效:抖动校验、浮动标签、密码强度、成功勾选;新组件 动效输入框、验证码(OTP)输入、上传进度。
12
- - **v7.8** — AI 界面:流式文字、思考光晕、语音波形、生成骨架;新组件 对话输入框、建议标签(Chips)、语音按钮。
13
- - **v7.9** — 8.0 预备:8.0 弃用警告、`upgrading-8.md` 与 `usa-codemod-8`;新组件 命令面板(⌘K)、快捷键提示。
12
+ - ✅ **v7.8** — AI 界面:流式文字、思考光晕、语音波形、生成骨架;新组件 对话输入框、建议标签(Chips)、语音按钮。
13
+ - ✅ **v7.9** — 8.0 预备:8.0 弃用警告、`upgrading-8.md` 与 `usa-codemod-8`;新组件 命令面板(⌘K)、快捷键提示。
14
14
  - **v8.0** — 统一时间线引擎(所有组件与特效共享一个时钟)、SSR 水合动画、移除 7.9 弃用项;npm `latest`。
@@ -895,6 +895,48 @@ row.value = 75; row.status = 'done';
895
895
  - `<usa-upload-progress name size value status message>`: `value`, `status`; `usa:done`, `usa:error`, `usa:retry`; `formatBytes(n)`.
896
896
  - Form: `field-shake` (`distance`, `color`) · `field-success` (`color`) · `label-float` (`stagger`) · `form-cascade` (`stagger`, `distance`); `shakeFrames(distance, steps)`.
897
897
 
898
+ ### v7.8 Widgets: chat composer, suggestion chips, voice button (`components/widgets`) + AI UI motion (`motionary/fx/ai`)
899
+
900
+ ```html
901
+ <usa-chat-composer placeholder="Ask anything…"></usa-chat-composer>
902
+ <usa-suggestion-chips items="Summarise|Translate|Explain like I'm 5" dismiss></usa-suggestion-chips>
903
+ <usa-voice-button label="Talk to the assistant"></usa-voice-button>
904
+
905
+ <usa-fx effect="stream-text" trigger="enter"><p>Here is a streamed answer…</p></usa-fx>
906
+ <usa-fx effect="thinking-glow" trigger="loop"><div class="bubble">Thinking…</div></usa-fx>
907
+ ```
908
+ ```js
909
+ import { defineWidgets } from 'motionary/components/widgets';
910
+ import { registerAiPack } from 'motionary/fx/ai';
911
+ defineWidgets(); registerAiPack();
912
+ composer.addEventListener('usa:send', async (e) => { composer.busy = true; await ask(e.detail.text); composer.busy = false; });
913
+ chips.addEventListener('usa:pick', (e) => composer.value = e.detail.text);
914
+ vb.level = analyserLevel; // 0–1
915
+ ```
916
+ - `<usa-chat-composer placeholder label rows busy value>`: `value`, `busy`, `send()`, `clear()`; `usa:send` { text } (cancelable), `usa:stop`.
917
+ - `<usa-suggestion-chips items label dismiss>`: `items`, `setItems(list)`; `usa:pick` { text, index }; `parseChips(s)`.
918
+ - `<usa-voice-button label bars listening>`: `listening`, `level`, `toggle(force?)`; `usa:start`, `usa:stop`; `waveBars(level, n, phase)`.
919
+ - AI: `stream-text` (`speed`) · `thinking-glow` (`colors`) · `voice-wave` (`cycles`) · `gen-skeleton` (`hold`); `splitWords(text)`.
920
+
921
+ ### v7.9 Widgets: command palette, shortcut hints (`components/widgets`)
922
+
923
+ ```html
924
+ <usa-command-palette placeholder="Type a command…">
925
+ <option value="new" data-group="File" data-keys="mod+n">New file</option>
926
+ <option value="theme" data-group="View" data-keys="mod+shift+l">Toggle dark theme</option>
927
+ </usa-command-palette>
928
+ <usa-shortcut keys="mod+k" label="Search"></usa-shortcut>
929
+ ```
930
+ ```js
931
+ import { defineWidgets, fuzzyMatch, keyLabels } from 'motionary/components/widgets';
932
+ defineWidgets();
933
+ palette.addEventListener('usa:run', (e) => commands[e.detail.id]());
934
+ palette.setCommands([{ id: 'zen', label: 'Zen mode', group: 'View', keys: 'mod+.' }]);
935
+ ```
936
+ - `<usa-command-palette hotkey placeholder label>`: `commands`, `setCommands(list)`, `show()`, `close()`, `toggle()`, `opened`; `usa:run` { id, label }, `usa:open`, `usa:close`; `fuzzyMatch(query, text)`, `keyLabels(keys)`, `matchesKeys(event, keys)`.
937
+ - `<usa-shortcut keys label for listen>`: `labels`, `press()`; `usa:trigger` { keys }.
938
+ - Deprecated in 7.9 (removed in 8.0): `<usa-rating>` → `<usa-star-rating>` — see [upgrading-8.md](./upgrading-8.md) and `npx usa-codemod-8`.
939
+
898
940
  ## Frameworks
899
941
 
900
942
  Custom elements work in every framework. Register once (e.g. in your entry file), then use the tags.
@@ -1,5 +1,9 @@
1
1
  # Deprecations
2
2
 
3
+ ## Deprecated in 7.9, removed in 8.0
4
+
5
+ See [upgrading-8.md](./upgrading-8.md) — `<usa-rating>` / `defineRating()` (use `<usa-star-rating>` / `defineStarRating()`; same `value`, `max`, `readonly`, `label`, `name`; `icon="♥"` → `icon="heart"`). Run `npx usa-codemod-8 --write src`.
6
+
3
7
  ## Deprecated in 6.9, removed in 7.0
4
8
 
5
9
  See [upgrading-7.md](./upgrading-7.md) — `registerFx2()` / `FX2_PACKS` (use `registerEffectPacks()` / `EFFECT_PACKS`), the 6.x pack registrars `registerGpuEffects`, `registerTextEffects3`, `registerLightEffects`, `register3dEffects`, `registerMorphEffects2`, `registerTransitionEffects2`, `registerWeatherEffects`, `registerPhysicsEffects2` (use the `register*Pack()` names), `<usa-tooltip>` (use `<usa-tip>`) and `<usa-toggle>` (use `<usa-switch>`). Run `npx usa-codemod-7 --write src`.
@@ -0,0 +1,34 @@
1
+ # Upgrading to 8.0
2
+
3
+ 8.0 is the next major release. 7.9 **warns once in the console** for everything that 8.0 removes, and a codemod rewrites it:
4
+
5
+ ```sh
6
+ npx usa-codemod-8 src # dry run: lists every change (and what needs a manual edit)
7
+ npx usa-codemod-8 --write src # apply
8
+ ```
9
+
10
+ ## Removed in 8.0 (deprecated in 7.9)
11
+
12
+ | 7.x | 8.0 | Codemod |
13
+ |---|---|---|
14
+ | `<usa-rating value max readonly label name>` | `<usa-star-rating …>` (6.4 — pointer-following fill, half stars, sparkle pop; form-associated since 7.9) | ✅ tags |
15
+ | `<usa-rating icon="♥">` / `icon="★"` | `<usa-star-rating icon="heart">` / `icon="star"` | ✅ |
16
+ | `--usa-rating-on` | `--usa-star-on` | ✅ |
17
+ | `<usa-rating variant="…">` | (no variants — style with `--usa-star-on`, `--usa-star-off`, `--usa-star-size`) | ✅ dropped |
18
+ | `defineRating()` | `defineStarRating()` from `motionary/components/widgets` | ⚠️ manual |
19
+
20
+ `document.createElement('usa-rating')` and CSS selectors on `usa-rating` / `.usa-rating-star` are reported for a manual edit.
21
+
22
+ ## Coming in 8.0
23
+
24
+ - **Unified timeline engine** — every component, effect and scroll animation is driven by one shared clock, so they can be paused, slowed down, scrubbed and sequenced together.
25
+ - **SSR hydration animations** — server-rendered markup animates in on hydration without a flash of the final state.
26
+ - `motionary` and the `use-scroll-animate` alias are both published with the npm `latest` tag.
27
+
28
+ Nothing else changes: the 5.0 browser baseline, the `<usa-player>` JSON format (`use-scroll-animate/animation` v1) and every other 7.x widget / effect API stay the same.
29
+
30
+ ## New in 7.9 (before the break)
31
+
32
+ - `<usa-command-palette>` (⌘K) and `<usa-shortcut>` keyboard hints; `<usa-star-rating>` is form-associated (`name`) and fires a native `change`.
33
+
34
+ See the [CHANGELOG](../CHANGELOG.md) for the full list.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-scroll-animate",
3
- "version": "7.7.0",
3
+ "version": "7.9.0",
4
4
  "description": "Compatibility alias of motionary (same build). The project was renamed to Motionary — install `motionary` instead. Motionary (formerly use-scroll-animate): dependency-free scroll animations + 94 animated Web Components — 214 scroll-reveal presets, card/click/button morphs, physics, page transitions, generative & sound-reactive backgrounds, cursor/gesture effects, themes, micro-interactions, <usa-player>, WebGL. React, Vue, Svelte, Solid, Angular or plain HTML.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -268,6 +268,16 @@
268
268
  "default": "./dist/components/fx-form.cjs"
269
269
  }
270
270
  },
271
+ "./fx/ai": {
272
+ "import": {
273
+ "types": "./dist/components/fx-ai.d.ts",
274
+ "default": "./dist/components/fx-ai.js"
275
+ },
276
+ "require": {
277
+ "types": "./dist/components/fx-ai.d.cts",
278
+ "default": "./dist/components/fx-ai.cjs"
279
+ }
280
+ },
271
281
  "./components/reveal": {
272
282
  "import": {
273
283
  "types": "./dist/components/reveal.d.ts",
@@ -768,6 +778,16 @@
768
778
  "default": "./dist/components/fx-form.cjs"
769
779
  }
770
780
  },
781
+ "./components/fx-ai": {
782
+ "import": {
783
+ "types": "./dist/components/fx-ai.d.ts",
784
+ "default": "./dist/components/fx-ai.js"
785
+ },
786
+ "require": {
787
+ "types": "./dist/components/fx-ai.d.cts",
788
+ "default": "./dist/components/fx-ai.cjs"
789
+ }
790
+ },
771
791
  "./components/lite": {
772
792
  "import": {
773
793
  "types": "./dist/components/lite.d.ts",
@@ -900,6 +920,7 @@
900
920
  "bin": {
901
921
  "usa-codemod-5": "./bin/usa-codemod-5.mjs",
902
922
  "usa-codemod-6": "./bin/usa-codemod-6.mjs",
903
- "usa-codemod-7": "./bin/usa-codemod-7.mjs"
923
+ "usa-codemod-7": "./bin/usa-codemod-7.mjs",
924
+ "usa-codemod-8": "./bin/usa-codemod-8.mjs"
904
925
  }
905
926
  }