dsh-workbench-danmaku 0.2.9 → 0.2.12
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/lib/client.js +28 -4
- package/lib/index.js +5 -1
- package/package.json +3 -3
package/lib/client.js
CHANGED
|
@@ -39,6 +39,25 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
39
39
|
};
|
|
40
40
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
41
41
|
|
|
42
|
+
// packages/addons/lib/icon-label.cjs
|
|
43
|
+
var require_icon_label = __commonJS({
|
|
44
|
+
"packages/addons/lib/icon-label.cjs"(exports2, module2) {
|
|
45
|
+
"use strict";
|
|
46
|
+
var VISUALLY_HIDDEN = "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap";
|
|
47
|
+
module2.exports = function iconLabel(h, Icon2, text, options) {
|
|
48
|
+
var opts = options || {};
|
|
49
|
+
var cls = "wb-icon-label" + (opts.short ? " wb-icon-label-short" : "") + (Icon2 ? "" : " wb-icon-label-fallback");
|
|
50
|
+
return h(
|
|
51
|
+
"span",
|
|
52
|
+
{ className: cls, title: typeof text === "string" ? text : void 0 },
|
|
53
|
+
Icon2 ? h(Icon2, { size: 14, strokeWidth: 2, "aria-hidden": true, focusable: false }) : null,
|
|
54
|
+
h("span", { className: "wb-icon-label-text" }, text)
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
module2.exports.styles = ".wb-icon-label{display:inline-flex;align-items:center;gap:5px;max-width:100%;vertical-align:middle;text-align:start}.wb-icon-label>svg{flex:none}.wb-icon-label>span{min-width:0;overflow-wrap:anywhere}button .wb-icon-label:not(.wb-icon-label-fallback) .wb-icon-label-text{" + VISUALLY_HIDDEN + "}button .wb-icon-label.wb-icon-label-short .wb-icon-label-text{position:static;width:auto;height:auto;margin:0;overflow:visible;clip-path:none;white-space:normal}";
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
42
61
|
// packages/addons/lib/icons.cjs
|
|
43
62
|
var require_icons = __commonJS({
|
|
44
63
|
"packages/addons/lib/icons.cjs"(exports2, module2) {
|
|
@@ -62,6 +81,11 @@ var require_icons = __commonJS({
|
|
|
62
81
|
return h(C, attrs);
|
|
63
82
|
}
|
|
64
83
|
var set = { ICONS, Icon: Icon2 };
|
|
84
|
+
set.label = function(name, text, options2) {
|
|
85
|
+
return require_icon_label()(h, function NamedIcon(props) {
|
|
86
|
+
return h(Icon2, Object.assign({ name }, props));
|
|
87
|
+
}, text, options2);
|
|
88
|
+
};
|
|
65
89
|
if (opts.tabIcon) {
|
|
66
90
|
set.tabIcon = function(name) {
|
|
67
91
|
return function TabIcon() {
|
|
@@ -799,7 +823,7 @@ var require_icons2 = __commonJS({
|
|
|
799
823
|
"trash-2": (init_trash_2(), __toCommonJS(trash_2_exports)).default,
|
|
800
824
|
"x": (init_x(), __toCommonJS(x_exports)).default
|
|
801
825
|
});
|
|
802
|
-
module2.exports = { ICONS: set.ICONS, Icon: set.Icon };
|
|
826
|
+
module2.exports = { ICONS: set.ICONS, Icon: set.Icon, label: set.label };
|
|
803
827
|
}
|
|
804
828
|
});
|
|
805
829
|
|
|
@@ -845,7 +869,7 @@ var require_client_base_styles = __commonJS({
|
|
|
845
869
|
s + "-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px}",
|
|
846
870
|
// 窄屏:页面容器不再自带左右内边距(宿主的 .wb-immersive-main 已经给过),
|
|
847
871
|
// 卡片与栅格收紧,把宽度尽量留给内容——窄屏下两侧留白比桌面更影响可读性。
|
|
848
|
-
"@media(max-width:760px){" + s + "-wrap{padding:0 0 8px;gap:10px}" + s + "-card{padding:12px;border-radius:10px}" + s + "-grid{grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px}" + s + "-form{grid-template-columns:minmax(0,1fr)}" + s + "-title{font-size:15px}" + s + "-table-wrap{overflow-x:auto;max-width:100%}" + s + "-table{width:max-content;min-width:100%}}@media(max-width:420px){" + s + "-wrap{padding:0 0 6px}" + s + "-card{padding:10px}" + s + "-grid{grid-template-columns:repeat(auto-fit,minmax(120px,1fr))}}"
|
|
872
|
+
"@media(max-width:760px){" + s + "-wrap{padding:0 0 8px;gap:10px}" + s + "-card{padding:12px;border-radius:10px}" + s + "-grid{grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px}" + s + "-form{grid-template-columns:minmax(0,1fr)}" + s + "-title{font-size:15px}" + s + "-btn." + s + "-icon-text ." + s + "-btn-label{display:none}" + s + "-btn." + s + "-icon-text{padding-left:8px;padding-right:8px}" + s + "-table-wrap{overflow-x:auto;max-width:100%}" + s + "-table{width:max-content;min-width:100%}}button .wb-icon-label:not(.wb-icon-label-fallback) .wb-icon-label-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}button .wb-icon-label.wb-icon-label-short .wb-icon-label-text{position:static;width:auto;height:auto;margin:0;overflow:visible;clip-path:none;white-space:normal}@media(max-width:420px){" + s + "-wrap{padding:0 0 6px}" + s + "-card{padding:10px}" + s + "-grid{grid-template-columns:repeat(auto-fit,minmax(120px,1fr))}}"
|
|
849
873
|
]);
|
|
850
874
|
};
|
|
851
875
|
module2.exports.secretFieldStyles = SECRET_FIELD;
|
|
@@ -857,7 +881,7 @@ var require_switch = __commonJS({
|
|
|
857
881
|
"packages/addons/lib/switch.cjs"(exports2, module2) {
|
|
858
882
|
"use strict";
|
|
859
883
|
var SWITCH_STYLES = [
|
|
860
|
-
".wbctl-switch{display:inline-flex;align-items:center;gap:7px;min-height:24px;padding:2px;border:0;background:transparent;font:inherit;font-size:12px;color:var(--wb-muted,#6b7280);cursor:pointer;user-select:none;border-radius:999px}",
|
|
884
|
+
".wbctl-switch{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;min-height:24px;padding:2px;border:0;background:transparent;font:inherit;font-size:12px;color:var(--wb-muted,#6b7280);cursor:pointer;user-select:none;border-radius:999px}",
|
|
861
885
|
".wbctl-switch-track{position:relative;display:inline-flex;align-items:center;box-sizing:border-box;width:34px;height:20px;padding:2px;border-radius:999px;background:color-mix(in oklab,currentColor 22%,transparent);transition:background .16s ease;flex:none}",
|
|
862
886
|
".wbctl-switch-knob{display:block;width:16px;height:16px;border-radius:50%;background:var(--wb-card,#fff);box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .16s ease}",
|
|
863
887
|
".wbctl-switch[aria-checked=true]{color:var(--wb-accent,#2563eb)}",
|
|
@@ -5154,7 +5178,7 @@ function definition(host) {
|
|
|
5154
5178
|
var tab = makeTab(host.react);
|
|
5155
5179
|
return {
|
|
5156
5180
|
id: ADDON_ID,
|
|
5157
|
-
version: "0.2.
|
|
5181
|
+
version: "0.2.12",
|
|
5158
5182
|
icon: tab("megaphone"),
|
|
5159
5183
|
views: [
|
|
5160
5184
|
{
|
package/lib/index.js
CHANGED
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { bindClock, ensureSchema } from "./db/db.js";
|
|
15
|
+
import { createRequire } from "node:module";
|
|
16
|
+
|
|
17
|
+
// 版本号只认 package.json:首页插件卡读的就是这里注册的 version。
|
|
18
|
+
const ADDON_VERSION = createRequire(import.meta.url)("../package.json").version;
|
|
15
19
|
import { DOMAIN, loadConfig } from "./config.js";
|
|
16
20
|
import { createPlayer } from "./player.js";
|
|
17
21
|
import { createSupervisor } from "./desktop/supervisor.js";
|
|
@@ -110,7 +114,7 @@ export function apply(ctx) {
|
|
|
110
114
|
title: "弹幕",
|
|
111
115
|
description:
|
|
112
116
|
"把自建弹幕轮播在整个 DSH 界面,并可叠加到整个桌面;单一宿主调度、SSE 与 Electron helper 双投递,含弹幕库/配置/数据/Action 四个视图",
|
|
113
|
-
version:
|
|
117
|
+
version: ADDON_VERSION,
|
|
114
118
|
category: "comm",
|
|
115
119
|
tables: TABLES,
|
|
116
120
|
sync: { tables: [] },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-workbench-danmaku",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "个人工作台弹幕插件:把自建弹幕轮播在整个 DSH 界面,并可叠加到整个桌面",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"id": "wb-addon-danmaku",
|
|
18
18
|
"title": "弹幕",
|
|
19
19
|
"description": "在整个 DSH 界面(含工作台业务页与宿主弹窗之外的所有区域)与桌面透明层轮播自建弹幕;含弹幕库、配置、数据与 Action 四个视图",
|
|
20
|
-
"version": "0.2.
|
|
20
|
+
"version": "0.2.12",
|
|
21
21
|
"minShell": "0.8.0",
|
|
22
22
|
"tables": [
|
|
23
23
|
"danmaku"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"./package.json": "./package.json"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"dsh-workbench-host": "^0.10.
|
|
56
|
+
"dsh-workbench-host": "^0.10.4"
|
|
57
57
|
},
|
|
58
58
|
"dsh": {
|
|
59
59
|
"bundle": {
|