@5even7/dlc-ui 0.2.16 → 0.2.17

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/CHANGELOG.md CHANGED
@@ -2,8 +2,11 @@
2
2
 
3
3
  > **发版规则**:默认每次发布只递增补丁号(0.x.y → 0.x.(y+1),即 +0.01);除非手动明确指定新版本号,否则不升次版本。
4
4
 
5
+ ## 0.2.17 - 2026-08-15
6
+ - Miao表情包优化展示,表情包拆分模块变更部分颜色属性
7
+
5
8
  ## 0.2.16 - 2026-08-15
6
- - 表情包新增非等比填充模式,文档解释补充完善
9
+ - Miao表情包新增非等比填充模式,文档解释补充完善
7
10
 
8
11
  ## 0.2.15 - 2026-08-14
9
12
  - 首个表情家族为 `type="miao"`,内置 23 个完整 Lottie 动作;素材生成阶段仍会校验并排除没有图层的空动画。
package/README.md CHANGED
@@ -68,8 +68,11 @@ const emo = createEmo(document.querySelector('#emo-host'), {
68
68
  name: 'smile',
69
69
  width: 240,
70
70
  height: 160,
71
- color: '#fff8dc',
72
- accentColor: '#ffd24a',
71
+ partColors: {
72
+ leftEye: '#fff8dc',
73
+ rightEye: '#fff8dc',
74
+ mouth: '#fff8dc'
75
+ },
73
76
  speed: 1.5,
74
77
  fit: 'contain',
75
78
  renderer: 'svg'
@@ -79,7 +82,7 @@ emo.setName('laugh').setSegment([0, 80]);
79
82
  // 宿主销毁时:emo.dispose();
80
83
  ```
81
84
 
82
- 当前素材未提供稳定的左眼、右眼等语义图层,无法保证器官级换色。因此 `color` 只替换白色主通道,`accentColor` 统一替换其余填充/描边;部分动作没有辅助通道,不传 `accentColor` 时保留素材原色。
85
+ `partColors` 按部位替换颜色(`leftEye` / `rightEye` / `mouth` / `mouthFill` 等,每个部位在素材里有稳定的 `paint.*` 命名通道)。值为任意 CSS 颜色(`#fff` / `#rrggbb` / 命名色 / `rgb()` / `rgba()`,alpha 忽略);未传或为 `null` 的部位保留素材默认色,当前动作不支持的部位会被忽略。外框背景单独用 `background` 控制。
83
86
 
84
87
  工厂调用用 `text` / `colorContent` 选项填插槽;Vue 组件直接用默认插槽和 `#color` 插槽(见下)。
85
88
 
@@ -192,7 +195,7 @@ export default {
192
195
 
193
196
  dlc-color 背景层(`createColorBackground(host, options)`):`preset`、`colors`、`seed`、`speed`、`quality`、`renderer`、`mouseColor`、`respectReducedMotion`、`opacity`(0~1)、`fallbackColor`(预置底色 / 十六进制色 / false)。控制器支持 `setPreset / setColors / setSeed / setSpeed / setQuality / setOpacity / setFallbackColor / setMouseColor / randomize / pause / resume / dispose` 和 `ready / presetchange / error` 事件。Vue 里可用官方组件 `dlc-color`(从 `@5even7/dlc-ui/vue2` 或 `/vue3` 导入),它的默认插槽内容会显示在背景层上方。
194
197
 
195
- dlc-emo:`type`、`name`、`width`、`height`、`color`、`accentColor`、`speed`(0.1~4,常用 0.5/1/1.5/2)、`loop`、`autoplay`、`direction`(forward/reverse 或 1/-1)、`paused`、`segment`(帧区间)、`opacity`、`fit`(contain/cover)、`renderer`(svg/canvas)、`background`、`label`、`instanceName`、`respectReducedMotion`。控制器提供 `play / pause / stop / setPaused / setSpeed / setDirection / setSegment / setName / setType / setColors / setOpacity / setBackground / setSize / setFit / setRenderer / setLoop / setAutoplay / setLabel / dispose`。
198
+ dlc-emo:`type`、`name`、`width`、`height`、`partColors`(部位改色,见上文)、`speed`(0.1~4,常用 0.5/1/1.5/2)、`loop`、`autoplay`、`direction`(forward/reverse 或 1/-1)、`paused`、`segment`(帧区间)、`opacity`、`fit`(contain/cover/fill)、`renderer`(svg/canvas)、`background`、`label`、`instanceName`、`respectReducedMotion`。控制器提供 `play / pause / stop / setPaused / setSpeed / setDirection / setSegment / setName / setType / setPartColors / setOpacity / setBackground / setSize / setFit / setRenderer / setLoop / setAutoplay / setLabel / dispose`。
196
199
 
197
200
  胶囊控制器额外支持 `setSeed(seed)` / `setSpeed(speed)` / `setMouseColor(value)` / `setText(content)` / `setColorContent(content)` / `setTextRatio(ratio)` / `setCssVars(vars)` / `setLabel(label)` 热更新;进度控制器额外支持 `setEdgeStyle('flow' | 'tide')` / `setValueSuffix(suffix)` / `setShowValue(show)` 和同样的插槽热更新方法。`setPreset` 只接受文学名称字符串(如 `'汐潮'`)。Vue 组件实例也暴露 `setText` / `setColorContent` / `setTextRatio` / `setCssVars` / `setLabel`(胶囊另有 `setMouseColor`,进度另有 `setValueSuffix` / `setShowValue`),与 H5 控制器对称。
198
201