@5even7/dlc-ui 0.2.7 → 0.2.9

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,10 +2,19 @@
2
2
 
3
3
  > **发版规则**:默认每次发布只递增补丁号(0.x.y → 0.x.(y+1),即 +0.01);除非手动明确指定新版本号,否则不升次版本。
4
4
 
5
+ ## 0.2.9 - 2026-08-09
6
+
7
+ - 修复:`/vue2`、`/vue3` 的 CJS 构建丢失默认导出(`require(...).default` 为 undefined,webpack/CommonJS 下 `import X from` 会拿到命名空间对象而不是组件);legacy 入口现在转发默认导出,并带 `__esModule` 标记。
8
+ - 对称补齐 Vue 组件实例方法:胶囊新增 `setMouseColor()`,进度条新增 `setShowValue()`(此前只有 Color 暴露了同类方法)。
9
+
10
+ ## 0.2.8 - 2026-08-09
11
+
12
+ - 最终命名确认:官方组件导出为 `DlcCapsule / DlcProgress / DlcColor`(无中划线),模板中仍可直接写 `<dlc-capsule>` 等 kebab 写法(Vue 自动映射);移除字符串形式的导出名,兼容 Vite/esbuild。
13
+
5
14
  ## 0.2.7 - 2026-08-09
6
15
 
7
16
  - 修复:0.2.6 发布包未包含 mouseColor / showValue 热切换(watch 仍走重建),本轮真正启用 `setMouseColor()` / `setShowValue()`,开关不再重建组件、不丢插槽内容。
8
- - 组件更名:`CosmicCapsule → dlc-capsule`、`ProgressCapsule → dlc-progress`、`ColorBackground → dlc-color`(旧名保留为兼容别名,标记 deprecated)。
17
+ - 组件更名:`CosmicCapsule → DlcCapsule`、`ProgressCapsule → DlcProgress`、`ColorBackground → DlcColor`(旧名保留为兼容别名,标记 deprecated;模板里也可写 `<dlc-capsule>` 等)。
9
18
 
10
19
  ## 0.2.6 - 2026-08-09
11
20
 
package/README.md CHANGED
@@ -163,7 +163,7 @@ export default {
163
163
 
164
164
  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` 导入),它的默认插槽内容会显示在背景层上方。
165
165
 
166
- 胶囊控制器额外支持 `setSeed(seed)` / `setSpeed(speed)` / `setText(content)` / `setColorContent(content)` / `setTextRatio(ratio)` / `setCssVars(vars)` / `setLabel(label)` 热更新;进度控制器额外支持 `setEdgeStyle('flow' | 'tide')` / `setValueSuffix(suffix)` 和同样的插槽热更新方法。`setPreset` 只接受文学名称字符串(如 `'汐潮'`)。Vue 组件实例也暴露 `setText` / `setColorContent` / `setTextRatio` / `setCssVars` / `setLabel`(进度另有 `setValueSuffix`),与 H5 控制器对称。
166
+ 胶囊控制器额外支持 `setSeed(seed)` / `setSpeed(speed)` / `setText(content)` / `setColorContent(content)` / `setTextRatio(ratio)` / `setCssVars(vars)` / `setLabel(label)` 热更新;进度控制器额外支持 `setEdgeStyle('flow' | 'tide')` / `setValueSuffix(suffix)` 和同样的插槽热更新方法。`setPreset` 只接受文学名称字符串(如 `'汐潮'`)。Vue 组件实例也暴露 `setText` / `setColorContent` / `setTextRatio` / `setCssVars` / `setLabel`(胶囊另有 `setMouseColor`,进度另有 `setValueSuffix` / `setShowValue`),与 H5 控制器对称。
167
167
 
168
168
  > 进度条是完全受控组件:组件自身不再自动增长,`value` 由使用方驱动。要自动步进,自己写定时器加值即可:
169
169
  >
package/dist/vue2.cjs CHANGED
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  function _arrayLikeToArray(r, a) {
4
6
  (null == a || a > r.length) && (a = r.length);
5
7
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
@@ -3208,6 +3210,9 @@ function makeCapsuleWrapper(createCapsule, render) {
3208
3210
  setLabel: function setLabel(label) {
3209
3211
  return this.controller && this.controller.setLabel(label);
3210
3212
  },
3213
+ setMouseColor: function setMouseColor(value) {
3214
+ return this.controller && this.controller.setMouseColor(value);
3215
+ },
3211
3216
  setQuality: function setQuality(quality) {
3212
3217
  return this.controller && this.controller.setQuality(quality);
3213
3218
  },
@@ -3311,6 +3316,9 @@ function makeProgressWrapper(createProgressCapsule, render) {
3311
3316
  setValueSuffix: function setValueSuffix(suffix) {
3312
3317
  return this.controller && this.controller.setValueSuffix(suffix);
3313
3318
  },
3319
+ setShowValue: function setShowValue(show) {
3320
+ return this.controller && this.controller.setShowValue(show);
3321
+ },
3314
3322
  setQuality: function setQuality(quality) {
3315
3323
  return this.controller && this.controller.setQuality(quality);
3316
3324
  },
@@ -3422,6 +3430,14 @@ var DlcColor = makeColorWrapper(createColorBackground, renderColor);
3422
3430
  var CosmicCapsule = DlcCapsule;
3423
3431
  var ProgressCapsule = DlcProgress;
3424
3432
  var ColorBackground = DlcColor;
3433
+ var vue2 = {
3434
+ DlcCapsule: DlcCapsule,
3435
+ DlcProgress: DlcProgress,
3436
+ DlcColor: DlcColor,
3437
+ CosmicCapsule: CosmicCapsule,
3438
+ ProgressCapsule: ProgressCapsule,
3439
+ ColorBackground: ColorBackground
3440
+ };
3425
3441
 
3426
3442
  exports.ColorBackground = ColorBackground;
3427
3443
  exports.CosmicCapsule = CosmicCapsule;
@@ -3429,6 +3445,4 @@ exports.DlcCapsule = DlcCapsule;
3429
3445
  exports.DlcColor = DlcColor;
3430
3446
  exports.DlcProgress = DlcProgress;
3431
3447
  exports.ProgressCapsule = ProgressCapsule;
3432
- exports["dlc-capsule"] = DlcCapsule;
3433
- exports["dlc-color"] = DlcColor;
3434
- exports["dlc-progress"] = DlcProgress;
3448
+ exports.default = vue2;
package/dist/vue2.mjs CHANGED
@@ -3082,6 +3082,7 @@ function makeCapsuleWrapper(createCapsule, render) {
3082
3082
  setTextRatio(ratio) { return this.controller && this.controller.setTextRatio(ratio); },
3083
3083
  setCssVars(vars) { return this.controller && this.controller.setCssVars(vars); },
3084
3084
  setLabel(label) { return this.controller && this.controller.setLabel(label); },
3085
+ setMouseColor(value) { return this.controller && this.controller.setMouseColor(value); },
3085
3086
  setQuality(quality) { return this.controller && this.controller.setQuality(quality); },
3086
3087
  getController() { return this.controller; }
3087
3088
  }
@@ -3156,8 +3157,9 @@ function makeProgressWrapper(createProgressCapsule, render) {
3156
3157
  setCssVars(vars) { return this.controller && this.controller.setCssVars(vars); },
3157
3158
  setLabel(label) { return this.controller && this.controller.setLabel(label); },
3158
3159
  setValueSuffix(suffix) { return this.controller && this.controller.setValueSuffix(suffix); },
3160
+ setShowValue(show) { return this.controller && this.controller.setShowValue(show); },
3159
3161
  setQuality(quality) { return this.controller && this.controller.setQuality(quality); },
3160
- getController() { return this.controller; }
3162
+ getController() { return this.controller; }
3161
3163
  }
3162
3164
  });
3163
3165
  }
@@ -3239,12 +3241,12 @@ const ProgressCapsule = DlcProgress;
3239
3241
  const ColorBackground = DlcColor;
3240
3242
 
3241
3243
  var vue2 = {
3242
- 'dlc-capsule': DlcCapsule,
3243
- 'dlc-progress': DlcProgress,
3244
- 'dlc-color': DlcColor,
3244
+ DlcCapsule,
3245
+ DlcProgress,
3246
+ DlcColor,
3245
3247
  CosmicCapsule,
3246
3248
  ProgressCapsule,
3247
3249
  ColorBackground
3248
3250
  };
3249
3251
 
3250
- export { ColorBackground, CosmicCapsule, DlcCapsule, DlcColor, DlcProgress, ProgressCapsule, vue2 as default, DlcCapsule as "dlc-capsule", DlcColor as "dlc-color", DlcProgress as "dlc-progress" };
3252
+ export { ColorBackground, CosmicCapsule, DlcCapsule, DlcColor, DlcProgress, ProgressCapsule, vue2 as default };
package/dist/vue3.cjs CHANGED
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var vue = require('vue');
4
6
 
5
7
  function _arrayLikeToArray(r, a) {
@@ -3210,6 +3212,9 @@ function makeCapsuleWrapper(createCapsule, render) {
3210
3212
  setLabel: function setLabel(label) {
3211
3213
  return this.controller && this.controller.setLabel(label);
3212
3214
  },
3215
+ setMouseColor: function setMouseColor(value) {
3216
+ return this.controller && this.controller.setMouseColor(value);
3217
+ },
3213
3218
  setQuality: function setQuality(quality) {
3214
3219
  return this.controller && this.controller.setQuality(quality);
3215
3220
  },
@@ -3313,6 +3318,9 @@ function makeProgressWrapper(createProgressCapsule, render) {
3313
3318
  setValueSuffix: function setValueSuffix(suffix) {
3314
3319
  return this.controller && this.controller.setValueSuffix(suffix);
3315
3320
  },
3321
+ setShowValue: function setShowValue(show) {
3322
+ return this.controller && this.controller.setShowValue(show);
3323
+ },
3316
3324
  setQuality: function setQuality(quality) {
3317
3325
  return this.controller && this.controller.setQuality(quality);
3318
3326
  },
@@ -3424,6 +3432,14 @@ var DlcColor = makeColorWrapper(createColorBackground, renderColor);
3424
3432
  var CosmicCapsule = DlcCapsule;
3425
3433
  var ProgressCapsule = DlcProgress;
3426
3434
  var ColorBackground = DlcColor;
3435
+ var vue3 = {
3436
+ DlcCapsule: DlcCapsule,
3437
+ DlcProgress: DlcProgress,
3438
+ DlcColor: DlcColor,
3439
+ CosmicCapsule: CosmicCapsule,
3440
+ ProgressCapsule: ProgressCapsule,
3441
+ ColorBackground: ColorBackground
3442
+ };
3427
3443
 
3428
3444
  exports.ColorBackground = ColorBackground;
3429
3445
  exports.CosmicCapsule = CosmicCapsule;
@@ -3431,6 +3447,4 @@ exports.DlcCapsule = DlcCapsule;
3431
3447
  exports.DlcColor = DlcColor;
3432
3448
  exports.DlcProgress = DlcProgress;
3433
3449
  exports.ProgressCapsule = ProgressCapsule;
3434
- exports["dlc-capsule"] = DlcCapsule;
3435
- exports["dlc-color"] = DlcColor;
3436
- exports["dlc-progress"] = DlcProgress;
3450
+ exports.default = vue3;
package/dist/vue3.mjs CHANGED
@@ -3084,6 +3084,7 @@ function makeCapsuleWrapper(createCapsule, render) {
3084
3084
  setTextRatio(ratio) { return this.controller && this.controller.setTextRatio(ratio); },
3085
3085
  setCssVars(vars) { return this.controller && this.controller.setCssVars(vars); },
3086
3086
  setLabel(label) { return this.controller && this.controller.setLabel(label); },
3087
+ setMouseColor(value) { return this.controller && this.controller.setMouseColor(value); },
3087
3088
  setQuality(quality) { return this.controller && this.controller.setQuality(quality); },
3088
3089
  getController() { return this.controller; }
3089
3090
  }
@@ -3158,8 +3159,9 @@ function makeProgressWrapper(createProgressCapsule, render) {
3158
3159
  setCssVars(vars) { return this.controller && this.controller.setCssVars(vars); },
3159
3160
  setLabel(label) { return this.controller && this.controller.setLabel(label); },
3160
3161
  setValueSuffix(suffix) { return this.controller && this.controller.setValueSuffix(suffix); },
3162
+ setShowValue(show) { return this.controller && this.controller.setShowValue(show); },
3161
3163
  setQuality(quality) { return this.controller && this.controller.setQuality(quality); },
3162
- getController() { return this.controller; }
3164
+ getController() { return this.controller; }
3163
3165
  }
3164
3166
  });
3165
3167
  }
@@ -3241,12 +3243,12 @@ const ProgressCapsule = DlcProgress;
3241
3243
  const ColorBackground = DlcColor;
3242
3244
 
3243
3245
  var vue3 = {
3244
- 'dlc-capsule': DlcCapsule,
3245
- 'dlc-progress': DlcProgress,
3246
- 'dlc-color': DlcColor,
3246
+ DlcCapsule,
3247
+ DlcProgress,
3248
+ DlcColor,
3247
3249
  CosmicCapsule,
3248
3250
  ProgressCapsule,
3249
3251
  ColorBackground
3250
3252
  };
3251
3253
 
3252
- export { ColorBackground, CosmicCapsule, DlcCapsule, DlcColor, DlcProgress, ProgressCapsule, vue3 as default, DlcCapsule as "dlc-capsule", DlcColor as "dlc-color", DlcProgress as "dlc-progress" };
3254
+ export { ColorBackground, CosmicCapsule, DlcCapsule, DlcColor, DlcProgress, ProgressCapsule, vue3 as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5even7/dlc-ui",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -79,7 +79,7 @@
79
79
  ],
80
80
  "scripts": {
81
81
  "build": "rollup -c && node scripts/copy-css.mjs",
82
- "test": "node --test tests/",
82
+ "test": "node --test",
83
83
  "serve": "node scripts/serve.mjs",
84
84
  "demo:h5": "node scripts/serve.mjs",
85
85
  "demo:vue3": "npm --prefix examples/vue3 run dev",
package/types/vue2.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export {
2
- DlcCapsule as 'dlc-capsule',
3
- DlcProgress as 'dlc-progress',
4
- DlcColor as 'dlc-color',
2
+ DlcCapsule,
3
+ DlcProgress,
4
+ DlcColor,
5
5
  CosmicCapsule,
6
6
  ProgressCapsule,
7
7
  ColorBackground,
package/types/vue3.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { CapsuleOptions, ProgressOptions } from './index.js';
2
2
 
3
- export interface CosmicCapsuleComponent {
4
- name: 'CosmicCapsule';
3
+ export interface CosmicCapsuleComponent {
4
+ name: 'dlc-capsule';
5
5
  props: (keyof CapsuleOptions)[];
6
6
  emits: string[];
7
7
  mounted: () => void;
@@ -19,13 +19,14 @@ export interface CosmicCapsuleComponent {
19
19
  setTextRatio(ratio: number): any;
20
20
  setCssVars(vars: Record<string, string>): any;
21
21
  setLabel(label: string): any;
22
+ setMouseColor(value: boolean): any;
22
23
  setQuality(quality: CapsuleOptions['quality']): any;
23
- getController(): any;
24
+ getController(): any;
24
25
  };
25
26
  }
26
27
 
27
- export interface ProgressCapsuleComponent {
28
- name: 'ProgressCapsule';
28
+ export interface ProgressCapsuleComponent {
29
+ name: 'dlc-progress';
29
30
  props: (keyof ProgressOptions)[];
30
31
  emits: string[];
31
32
  mounted: () => void;
@@ -47,13 +48,14 @@ export interface ProgressCapsuleComponent {
47
48
  setCssVars(vars: Record<string, string>): any;
48
49
  setLabel(label: string): any;
49
50
  setValueSuffix(suffix: string): any;
51
+ setShowValue(show: boolean): any;
50
52
  setQuality(quality: ProgressOptions['quality']): any;
51
53
  getController(): any;
52
54
  };
53
55
  }
54
56
 
55
57
  export interface ColorBackgroundComponent {
56
- name: 'ColorBackground';
58
+ name: 'dlc-color';
57
59
  props: (keyof import('./index').ColorBackgroundOptions)[];
58
60
  emits: string[];
59
61
  mounted: () => void;
@@ -78,16 +80,15 @@ export interface ColorBackgroundComponent {
78
80
  export declare const DlcCapsule: CosmicCapsuleComponent;
79
81
  export declare const DlcProgress: ProgressCapsuleComponent;
80
82
  export declare const DlcColor: ColorBackgroundComponent;
81
- export { DlcCapsule as 'dlc-capsule', DlcProgress as 'dlc-progress', DlcColor as 'dlc-color' };
82
83
 
83
84
  // 旧名兼容别名(deprecated)
84
85
  export declare const CosmicCapsule: CosmicCapsuleComponent;
85
86
  export declare const ProgressCapsule: ProgressCapsuleComponent;
86
87
  export declare const ColorBackground: ColorBackgroundComponent;
87
88
  declare const _default: {
88
- 'dlc-capsule': CosmicCapsuleComponent;
89
- 'dlc-progress': ProgressCapsuleComponent;
90
- 'dlc-color': ColorBackgroundComponent;
89
+ DlcCapsule: CosmicCapsuleComponent;
90
+ DlcProgress: ProgressCapsuleComponent;
91
+ DlcColor: ColorBackgroundComponent;
91
92
  CosmicCapsule: CosmicCapsuleComponent;
92
93
  ProgressCapsule: ProgressCapsuleComponent;
93
94
  ColorBackground: ColorBackgroundComponent;