@vibedev-si/dsh-media-viewer 0.1.0 → 0.1.1
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/client.js +11 -4
- package/package.json +2 -2
package/client.js
CHANGED
|
@@ -81,13 +81,20 @@ window.__ModuleLoader__.load({
|
|
|
81
81
|
|
|
82
82
|
// ── styling helpers ─────────────────────────────────────────────────────
|
|
83
83
|
|
|
84
|
+
// Colours: ONLY variables the host really defines (--dsw-alias-bg-base, -bg-layer-1/2, -bg-overlay, -border-l1/l2,
|
|
85
|
+
// -brand-primary, -label-primary/secondary, -state-*). An earlier version used three names it had guessed
|
|
86
|
+
// (a "bg-primary", a "surface-primary" and a "link-normal"): the host has none of them, so the fallback (#fff)
|
|
87
|
+
// was always used and the gallery lightbox came out white, with light text on it, in the dark theme.
|
|
88
|
+
// test/tokens.test.mjs now rejects any --dsw-* name that is not on the real list.
|
|
84
89
|
var C = {
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
bg: "var(--dsw-alias-bg-base, #fff)",
|
|
91
|
+
fg: "var(--dsw-alias-label-primary, #1b1d24)",
|
|
92
|
+
muted: "var(--dsw-alias-label-secondary, #6c7080)",
|
|
93
|
+
link: "var(--dsw-alias-brand-primary, #2f6fe0)",
|
|
87
94
|
line: "rgba(127,127,127,.28)",
|
|
88
95
|
soft: "rgba(127,127,127,.10)",
|
|
89
96
|
softer: "rgba(127,127,127,.06)",
|
|
90
|
-
accent: "#
|
|
97
|
+
accent: "#7254f5", // a white label on it is 4.88:1 (the old #7c5cff gave 4.35:1)
|
|
91
98
|
};
|
|
92
99
|
|
|
93
100
|
var btnBase = {
|
|
@@ -469,7 +476,7 @@ window.__ModuleLoader__.load({
|
|
|
469
476
|
|
|
470
477
|
var nav = { position: "absolute", top: "50%", transform: "translateY(-50%)", width: "30px", height: "56px", border: "none", borderRadius: "6px", background: "rgba(127,127,127,.35)", color: "inherit", cursor: "pointer", fontSize: "18px", zIndex: 2 };
|
|
471
478
|
return h("div", {
|
|
472
|
-
style: { position: "absolute", inset: 0, zIndex: 20, display: "flex", flexDirection: "column", background:
|
|
479
|
+
style: { position: "absolute", inset: 0, zIndex: 20, display: "flex", flexDirection: "column", background: C.bg, color: C.fg },
|
|
473
480
|
}, [
|
|
474
481
|
h("div", { key: "top", style: { display: "flex", alignItems: "center", gap: "8px", padding: "8px 10px", borderBottom: "1px solid " + C.line, fontSize: "12px", flex: "none" } }, [
|
|
475
482
|
h(Btn, { key: "x", title: "返回画廊 (Esc)", onClick: p.onClose }, "← 返回"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibedev-si/dsh-media-viewer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "右侧栏媒体预览:直接预览视频、音频和 HTML(大文件可拖进度条,HTML 默认允许脚本),并提供文件夹媒体画廊,需配合 dsh-better-sidebar · Inline video, audio and HTML preview plus a folder media gallery in the dsh-better-sidebar right column — range-streamed large files, sandboxed HTML with working relative assets",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"registry": "https://registry.npmjs.org/"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
|
-
"test": "node test/route.test.mjs"
|
|
56
|
+
"test": "node test/route.test.mjs && node test/tokens.test.mjs"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"dsh-better-sidebar": ">=0.24.0"
|