@5even7/dlc-ui 0.2.8 → 0.2.10
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 +9 -0
- package/README.md +1 -1
- package/dist/vue2.cjs +17 -0
- package/dist/vue2.mjs +3 -1
- package/dist/vue3.cjs +17 -0
- package/dist/vue3.mjs +3 -1
- package/package.json +2 -2
- package/styles/base.css +5 -4
- package/types/vue3.d.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
> **发版规则**:默认每次发布只递增补丁号(0.x.y → 0.x.(y+1),即 +0.01);除非手动明确指定新版本号,否则不升次版本。
|
|
4
4
|
|
|
5
|
+
## 0.2.10 - 2026-08-09
|
|
6
|
+
|
|
7
|
+
- 修复:Vue wrapper 的插槽中转容器(`.hj-vue-slot-text` / `.hj-vue-slot-color`)此前带 `height: 100%`,插槽内容被搬进文字区/颜色区后,空壳仍会以宿主高度各撑出一个空块,把 Capsule / Progress 组件根整体往下推约 2×组件高度;改为 `display: none`,彻底脱离布局(对插槽搬运无影响)。
|
|
8
|
+
|
|
9
|
+
## 0.2.9 - 2026-08-09
|
|
10
|
+
|
|
11
|
+
- 修复:`/vue2`、`/vue3` 的 CJS 构建丢失默认导出(`require(...).default` 为 undefined,webpack/CommonJS 下 `import X from` 会拿到命名空间对象而不是组件);legacy 入口现在转发默认导出,并带 `__esModule` 标记。
|
|
12
|
+
- 对称补齐 Vue 组件实例方法:胶囊新增 `setMouseColor()`,进度条新增 `setShowValue()`(此前只有 Color 暴露了同类方法)。
|
|
13
|
+
|
|
5
14
|
## 0.2.8 - 2026-08-09
|
|
6
15
|
|
|
7
16
|
- 最终命名确认:官方组件导出为 `DlcCapsule / DlcProgress / DlcColor`(无中划线),模板中仍可直接写 `<dlc-capsule>` 等 kebab 写法(Vue 自动映射);移除字符串形式的导出名,兼容 Vite/esbuild。
|
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
|
|
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,3 +3445,4 @@ exports.DlcCapsule = DlcCapsule;
|
|
|
3429
3445
|
exports.DlcColor = DlcColor;
|
|
3430
3446
|
exports.DlcProgress = DlcProgress;
|
|
3431
3447
|
exports.ProgressCapsule = ProgressCapsule;
|
|
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
|
}
|
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,3 +3447,4 @@ exports.DlcCapsule = DlcCapsule;
|
|
|
3431
3447
|
exports.DlcColor = DlcColor;
|
|
3432
3448
|
exports.DlcProgress = DlcProgress;
|
|
3433
3449
|
exports.ProgressCapsule = ProgressCapsule;
|
|
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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@5even7/dlc-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
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",
|
|
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/styles/base.css
CHANGED
|
@@ -47,10 +47,11 @@
|
|
|
47
47
|
pointer-events: none;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
/* Vue wrapper
|
|
50
|
+
/* Vue wrapper 的插槽中转容器:内容会在挂载时被搬进文字区/颜色区,
|
|
51
|
+
搬完后只是空壳。绝不能参与布局——height:100% 会让它们以宿主高度各撑出
|
|
52
|
+
一个空块,把组件根往下推(Capsule 推 2×组件高、Progress 推 2×组件高)。
|
|
53
|
+
display:none 让它们彻底脱离布局,搬运前的瞬间内容也不会闪现。 */
|
|
51
54
|
.hj-vue-slot-text,
|
|
52
55
|
.hj-vue-slot-color {
|
|
53
|
-
display:
|
|
54
|
-
width: 100%;
|
|
55
|
-
height: 100%;
|
|
56
|
+
display: none;
|
|
56
57
|
}
|
package/types/vue3.d.ts
CHANGED
|
@@ -19,8 +19,9 @@ 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
|
|
|
@@ -47,6 +48,7 @@ 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
|
};
|