dsh-openup-lewis 1.2.6 → 1.2.7
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/README.md +7 -4
- package/THIRD_PARTY_NOTICES.md +12 -0
- package/assets/author/author.jpg +0 -0
- package/assets/deepsea-notices/ADAPTATION.md +16 -0
- package/assets/deepsea-notices/LICENSE +24 -0
- package/assets/deepsea-notices/LICENSE-ARTWORK.md +15 -0
- package/assets/deepsea-notices/NOTICE-ARTWORK.md +52 -0
- package/assets/deepseek-whale-girl-intro.mp4 +0 -0
- package/lib/build-info.json +1 -1
- package/lib/client.js +454 -149
- package/lib/index.js +16 -7
- package/package.json +3 -1
package/lib/client.js
CHANGED
|
@@ -40,26 +40,26 @@ __export(client_exports, {
|
|
|
40
40
|
openSettings: () => openSettings
|
|
41
41
|
});
|
|
42
42
|
module.exports = __toCommonJS(client_exports);
|
|
43
|
-
var
|
|
43
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
44
44
|
|
|
45
45
|
// src/styles.js
|
|
46
46
|
var CSS = `
|
|
47
|
-
.bs-studio{--bs-bg:#10161b;--bs-card:#182127;--bs-line:#2b363e;--bs-text:#e6eee9;--bs-muted:#8e9d9c;--bs-accent
|
|
47
|
+
.bs-studio{--bs-bg:#10161b;--bs-card:#182127;--bs-line:#2b363e;--bs-text:#e6eee9;--bs-muted:#8e9d9c;--bs-accent:var(--lewis-accent,#b7eccd);box-sizing:border-box;color:var(--bs-text);background:var(--bs-bg);padding:36px 38px 28px;width:100%;max-width:1120px;margin:auto;border-radius:16px;font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',sans-serif;font-size:14px;line-height:1.55;color-scheme:dark}
|
|
48
48
|
.bs-studio *,.bs-player *,.bs-modal *{box-sizing:border-box}
|
|
49
49
|
.bs-studio button,.bs-player button,.bs-modal button,.bs-studio input,.bs-studio select{font:inherit}
|
|
50
50
|
.bs-studio button,.bs-player button{cursor:pointer;transition:background .18s,border-color .18s,transform .18s}
|
|
51
|
-
.bs-studio button:disabled{opacity:.48;cursor:default}.bs-studio button:focus-visible,.bs-player button:focus-visible,.bs-studio input:focus-visible,.bs-studio select:focus-visible,.bs-modal-close:focus-visible{outline:2px solid
|
|
52
|
-
.bs-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.bs-eyebrow{font-size:10px;letter-spacing:2.2px;color
|
|
53
|
-
.bs-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:27px 0 0;padding:17px 0;border-top:1px solid var(--bs-line);border-bottom:1px solid var(--bs-line)}.bs-status{display:flex;align-items:center;gap:8px;font-size:12px;color:#abbdb5}.bs-status i{width:6px;height:6px;border-radius:50%;background
|
|
54
|
-
.bs-notice{min-height:31px;padding-top:8px;color
|
|
55
|
-
.bs-section-title{display:flex;align-items:baseline;justify-content:space-between;gap:14px;margin:12px 0 14px}.bs-section-title h2{font-size:14px;font-weight:600;margin:0}.bs-section-title>span{font-size:11px;color:#80918b}.bs-library{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:30px}.bs-clip{min-width:0;border:1px solid var(--bs-line);background:var(--bs-card);border-radius:10px;overflow:hidden;position:relative}.bs-clip.is-selected{border-color
|
|
51
|
+
.bs-studio button:disabled{opacity:.48;cursor:default}.bs-studio button:focus-visible,.bs-player button:focus-visible,.bs-studio input:focus-visible,.bs-studio select:focus-visible,.bs-modal-close:focus-visible{outline:2px solid var(--lewis-accent,#b7eccd);outline-offset:4px}
|
|
52
|
+
.bs-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.bs-eyebrow{font-size:10px;letter-spacing:2.2px;color:var(--lewis-accent-soft,#a5d7bc);margin-bottom:9px}.bs-heading h1{font-size:29px;letter-spacing:-.8px;font-weight:650;margin:0 0 9px;line-height:1.35}.bs-heading h1 span{font-weight:350;color:#8e9d9c;margin-left:11px}.bs-heading p{margin:0;color:var(--bs-muted);font-size:13px}.bs-version{font-size:10px;color:#a2b2ac;border:1px solid var(--bs-line);border-radius:5px;padding:4px 8px;letter-spacing:1px;margin-top:4px}
|
|
53
|
+
.bs-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:27px 0 0;padding:17px 0;border-top:1px solid var(--bs-line);border-bottom:1px solid var(--bs-line)}.bs-status{display:flex;align-items:center;gap:8px;font-size:12px;color:#abbdb5}.bs-status i{width:6px;height:6px;border-radius:50%;background:var(--lewis-accent,#b7eccd);box-shadow:0 0 9px var(--lewis-accent-a44,#b7eccd44)}.bs-primary{border:1px solid var(--lewis-accent,#b7eccd);background:var(--lewis-accent,#b7eccd);color:var(--lewis-accent-text,#122b20);border-radius:7px;padding:9px 15px;font-weight:600!important;font-size:12px!important}.bs-primary:hover{background:var(--lewis-accent-hover,#d3f5e0)}
|
|
54
|
+
.bs-notice{min-height:31px;padding-top:8px;color:var(--lewis-accent,#b7eccd);font-size:12px}.bs-alert{background:#392726;border:1px solid #764b46;color:#ffd9d0;padding:12px;border-radius:8px;margin-top:14px}.bs-alert button{background:transparent;border:1px solid #94635a;color:inherit;margin-left:10px;border-radius:4px}
|
|
55
|
+
.bs-section-title{display:flex;align-items:baseline;justify-content:space-between;gap:14px;margin:12px 0 14px}.bs-section-title h2{font-size:14px;font-weight:600;margin:0}.bs-section-title>span{font-size:11px;color:#80918b}.bs-library{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:30px}.bs-clip{min-width:0;border:1px solid var(--bs-line);background:var(--bs-card);border-radius:10px;overflow:hidden;position:relative}.bs-clip.is-selected{border-color:var(--lewis-accent,#b7eccd);box-shadow:0 0 0 1px var(--lewis-accent-a22,#b7eccd22)}.bs-thumbnail{width:100%;aspect-ratio:16/9;display:block;border:0;position:relative;overflow:hidden;text-align:left;background:radial-gradient(ellipse at 70% 20%,#2c4d60,#101c27 70%);padding:0;color:white}.bs-tone-1{background:radial-gradient(ellipse at 75% 15%,#5c2e67,#1b122b 70%)}.bs-tone-2{background:radial-gradient(ellipse at 70% 20%,#3e526b,#171f34 70%)}.bs-tone-3{background:radial-gradient(ellipse at 40% 40%,#2b5d50,#0f211c 70%)}.bs-thumbnail video{position:absolute;width:100%;height:100%;object-fit:cover;opacity:.88;pointer-events:none}.bs-thumbnail-shade{position:absolute;inset:0;background:linear-gradient(0deg,#050b12aa,transparent 65%)}.bs-play-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);border:1px solid #ffffff66;background:#0a172a66;backdrop-filter:blur(5px);width:34px;height:34px;border-radius:50%;text-align:center;line-height:32px;font-size:12px;padding-left:2px}.bs-thumbnail:hover .bs-play-icon{background:var(--lewis-accent,#b7eccd);color:var(--lewis-accent-text,#142b21);border-color:var(--lewis-accent,#b7eccd)}.bs-clip-number{position:absolute;bottom:10px;left:12px;font-size:11px;letter-spacing:1px;opacity:.8}.bs-badge{position:absolute;top:9px;right:9px;border:1px solid #ffffff22;background:#0b111c88;border-radius:4px;font-size:9px;padding:2px 6px}.bs-clip-info{padding:12px 12px 9px;display:flex;align-items:center;gap:8px;justify-content:space-between}.bs-clip-info h3{font-size:12px;font-weight:500;margin:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bs-clip-info>span{font-size:10px;color:#8b9d96;white-space:nowrap}.bs-clip-actions{display:flex;gap:7px;padding:0 12px 12px}.bs-clip-actions button{flex:1;border:1px solid #3c4b49;background:#202d30;color:#c1cfc8;border-radius:5px;font-size:11px;padding:5px}.bs-clip-actions button:hover{border-color:var(--lewis-accent,#b7eccd)}.bs-clip-actions .bs-selected{color:var(--lewis-accent,#b7eccd);background:var(--lewis-accent-a0d,#b7eccd0d);border-color:var(--lewis-accent-border,#536d60);opacity:1}.bs-clip-actions .bs-delete{flex:0;color:#b5a29c;border:0;background:transparent;white-space:nowrap}.bs-delete-confirm{position:absolute;bottom:0;left:0;right:0;background:#342724;border-top:1px solid #80544b;padding:10px;font-size:11px}.bs-delete-confirm button{margin:4px;color:#ffe2d5;border:1px solid #865a50;border-radius:4px;background:#49342e;font-size:10px}
|
|
56
56
|
.bs-studio{container-type:inline-size;padding:clamp(20px,3.5%,36px) clamp(18px,3.5%,38px) 28px}
|
|
57
57
|
.bs-thumbnail video{inset:0;display:block}
|
|
58
|
-
.bs-upload{display:flex;flex-direction:column;align-items:center;justify-content:center;border:1px dashed #43584e;border-radius:10px;background:#14201c66;min-height:190px;color:#abc5b7;gap:6px;padding:15px}.bs-upload:hover{background
|
|
59
|
-
.bs-preferences{border:1px solid var(--bs-line);border-radius:10px;overflow:hidden;background:#151e23}.bs-toggle-row,.bs-field{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 18px;position:relative;margin:0}.bs-preferences>*+*{border-top:1px solid var(--bs-line)}.bs-toggle-row{cursor:pointer}.bs-toggle-row>span:first-child{flex:1}.bs-toggle-row strong,.bs-field>span,.bs-field>label{font-weight:500;font-size:12px}.bs-toggle-row small,.bs-field small{display:block;color:#7d9188;font-size:11px;font-weight:400;margin-top:4px}.bs-toggle-row input{position:absolute;right:18px;width:34px;height:20px;opacity:0;z-index:1;cursor:pointer}.bs-switch{width:34px;height:19px;flex:none;background:#3b4845;border-radius:20px;position:relative;transition:background .15s}.bs-switch:after{content:'';width:13px;height:13px;background:#a7b9b1;border-radius:50%;position:absolute;left:3px;top:3px;transition:transform .15s}.bs-toggle-row input:checked+.bs-switch{background
|
|
60
|
-
.bs-field select{color:#d6e6dd;background:#202c2e;border:1px solid #3e5148;border-radius:5px;padding:7px 9px;font-size:12px}.bs-field select{max-width:150px}.bs-field input[type=range]{accent-color
|
|
58
|
+
.bs-upload{display:flex;flex-direction:column;align-items:center;justify-content:center;border:1px dashed #43584e;border-radius:10px;background:#14201c66;min-height:190px;color:#abc5b7;gap:6px;padding:15px}.bs-upload:hover{background:var(--lewis-accent-surface,#20392e);border-color:var(--lewis-accent,#b7eccd)}.bs-upload>span{font-size:27px;color:var(--lewis-accent,#b7eccd);font-weight:200;line-height:1.2;margin-bottom:5px}.bs-upload strong{font-size:12px;font-weight:500}.bs-upload small{font-size:10px;color:#7f9e8f}
|
|
59
|
+
.bs-preferences{border:1px solid var(--bs-line);border-radius:10px;overflow:hidden;background:#151e23}.bs-toggle-row,.bs-field{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 18px;position:relative;margin:0}.bs-preferences>*+*{border-top:1px solid var(--bs-line)}.bs-toggle-row{cursor:pointer}.bs-toggle-row>span:first-child{flex:1}.bs-toggle-row strong,.bs-field>span,.bs-field>label{font-weight:500;font-size:12px}.bs-toggle-row small,.bs-field small{display:block;color:#7d9188;font-size:11px;font-weight:400;margin-top:4px}.bs-toggle-row input{position:absolute;right:18px;width:34px;height:20px;opacity:0;z-index:1;cursor:pointer}.bs-switch{width:34px;height:19px;flex:none;background:#3b4845;border-radius:20px;position:relative;transition:background .15s}.bs-switch:after{content:'';width:13px;height:13px;background:#a7b9b1;border-radius:50%;position:absolute;left:3px;top:3px;transition:transform .15s}.bs-toggle-row input:checked+.bs-switch{background:var(--lewis-accent,#b7eccd)}.bs-toggle-row input:checked+.bs-switch:after{background:var(--lewis-accent-text,#173926);transform:translateX(15px)}.bs-toggle-row input:focus-visible+.bs-switch{outline:2px solid var(--lewis-accent,#b7eccd);outline-offset:4px}.bs-toggle-row input:disabled+.bs-switch{opacity:.45}
|
|
60
|
+
.bs-field select{color:#d6e6dd;background:#202c2e;border:1px solid #3e5148;border-radius:5px;padding:7px 9px;font-size:12px}.bs-field select{max-width:150px}.bs-field input[type=range]{accent-color:var(--lewis-accent,#b7eccd);width:160px;max-width:36%}.bs-field output{font-size:12px;width:34px;text-align:right}.bs-field input[type=range]+output{margin-left:-10px}.bs-field:has(input[type=range])>span{flex:1}
|
|
61
61
|
.bs-help{padding:22px 0 0;color:#8fa69a;font-size:11px}.bs-help strong{font-size:12px;font-weight:500;color:#c4dbcc}.bs-help p{margin:7px 0 13px;line-height:1.8}.bs-help>span{font-size:9px;color:#61786b}.bs-loading{text-align:center;color:#8e9d9c;padding:45px}
|
|
62
|
-
.bs-player{position:fixed;inset:0;z-index:2147483500;background:#05090e;outline:0;cursor:pointer;color:#f4f8f8;font:13px/1.5 Inter,'Segoe UI','Microsoft YaHei',sans-serif;animation:bs-reveal .3s ease-out}.bs-player video{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.bs-player-top{position:absolute;top:0;left:0;right:0;padding:24px 30px;display:flex;align-items:center;justify-content:space-between;gap:16px;background:linear-gradient(#0008,transparent)}.bs-player-top>span{font-size:10px;letter-spacing:2px;text-shadow:0 2px 7px black}.bs-player-top b{font-weight:400;opacity:.6;margin-left:10px}.bs-player button{border:1px solid #ffffff44;color:#fff;background:#101c2c88;backdrop-filter:blur(12px);border-radius:7px;padding:9px 14px;font-size:12px}.bs-player button:hover{background:#213348bb}.bs-player kbd{font:10px/1.3 monospace;margin-left:10px;color:#b3c5ce;border:1px solid #ffffff33;padding:2px 4px;border-radius:3px}.bs-player-bottom{position:absolute;bottom:0;left:0;right:0;display:flex;justify-content:space-between;gap:15px;padding:24px 30px;background:linear-gradient(transparent,#0009);font-size:11px;letter-spacing:.3px;text-shadow:0 1px 5px black}.bs-player-bottom>span:last-child{opacity:.72}.bs-sound{position:absolute;right:30px;bottom:75px}.bs-play-manual{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:18px 30px!important}.bs-timeline{height:2px;position:absolute;bottom:0;left:0;right:0;background:#ffffff18}.bs-timeline i{display:block;height:100%;background
|
|
62
|
+
.bs-player{position:fixed;inset:0;z-index:2147483500;background:#05090e;outline:0;cursor:pointer;color:#f4f8f8;font:13px/1.5 Inter,'Segoe UI','Microsoft YaHei',sans-serif;animation:bs-reveal .3s ease-out}.bs-player video{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.bs-player-top{position:absolute;top:0;left:0;right:0;padding:24px 30px;display:flex;align-items:center;justify-content:space-between;gap:16px;background:linear-gradient(#0008,transparent)}.bs-player-top>span{font-size:10px;letter-spacing:2px;text-shadow:0 2px 7px black}.bs-player-top b{font-weight:400;opacity:.6;margin-left:10px}.bs-player button{border:1px solid #ffffff44;color:#fff;background:#101c2c88;backdrop-filter:blur(12px);border-radius:7px;padding:9px 14px;font-size:12px}.bs-player button:hover{background:#213348bb}.bs-player kbd{font:10px/1.3 monospace;margin-left:10px;color:#b3c5ce;border:1px solid #ffffff33;padding:2px 4px;border-radius:3px}.bs-player-bottom{position:absolute;bottom:0;left:0;right:0;display:flex;justify-content:space-between;gap:15px;padding:24px 30px;background:linear-gradient(transparent,#0009);font-size:11px;letter-spacing:.3px;text-shadow:0 1px 5px black}.bs-player-bottom>span:last-child{opacity:.72}.bs-sound{position:absolute;right:30px;bottom:75px}.bs-play-manual{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:18px 30px!important}.bs-timeline{height:2px;position:absolute;bottom:0;left:0;right:0;background:#ffffff18}.bs-timeline i{display:block;height:100%;background:var(--lewis-accent,#b7eccd);transition:width .08s linear}
|
|
63
63
|
.bs-player{width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;border:0;padding:0;overflow:hidden}.bs-player::backdrop{background:#05090e}
|
|
64
64
|
.bs-modal{position:fixed;inset:0;z-index:2147483400;background:#0009;backdrop-filter:blur(10px);padding:28px;overflow:auto}.bs-modal-body{position:relative;max-width:1120px;margin:auto;box-shadow:0 25px 100px #0006;border-radius:16px}.bs-modal-close{position:absolute;right:30px;top:25px;z-index:2;background:#26382f;border:1px solid #496552;border-radius:5px;color:#d9efe0;padding:6px 10px;cursor:pointer}.bs-modal-body .bs-version{display:none}.bs-toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);padding:13px 18px;color:#e9f7ed;background:#273a30;border:1px solid #6a8f76;border-radius:8px;z-index:2147483600;font:12px/1.5 'Segoe UI','Microsoft YaHei',sans-serif;max-width:90vw;box-shadow:0 8px 40px #0006}
|
|
65
65
|
.bs-intro-prompt{position:absolute;bottom:5%;left:0;right:0;margin:0;text-align:center;font-size:12px;letter-spacing:.22em;color:#ffffffa6;text-shadow:0 2px 12px #000;pointer-events:none}
|
|
@@ -76,13 +76,13 @@ var CSS = `
|
|
|
76
76
|
.bs-end-title[data-logo=silver] .bs-enter-prompt{color:#405164;text-shadow:0 1px 6px #fff9;background:radial-gradient(ellipse at center,#ffffff44,transparent 65%)}
|
|
77
77
|
.bs-end-silver{background:radial-gradient(ellipse at 50% 45%,#f6f8fa,#dbe1e7);color:#435264}.bs-end-silver .bs-enter-prompt{color:#435264;text-shadow:none}
|
|
78
78
|
.bs-end-gold{background:radial-gradient(ellipse at 50% 40%,#211e17,#080908);color:#d7c99f}.bs-end-ice{background:radial-gradient(ellipse at 50% 40%,#163344,#060e18);color:#c0e8f4}
|
|
79
|
-
.bs-ending-settings{margin-bottom:29px}.bs-text-button{border:0;background:transparent;color
|
|
80
|
-
.bs-update-area{margin-top:25px;padding-top:8px;border-top:1px solid var(--bs-line)}.bs-update-card{display:flex;justify-content:space-between;align-items:center;gap:16px;background:#151e23;border:1px solid var(--bs-line);border-radius:9px;padding:17px}.bs-update-card strong{font-size:12px;font-weight:500}.bs-update-card p{font-size:11px;color:#8b9e92;margin:6px 0 0}.bs-update-card small{display:block;font-size:10px;color:#82978a;margin-top:6px}.bs-update-actions{display:flex;gap:8px;flex-wrap:wrap;flex:none}.bs-update-actions button{border:1px solid
|
|
81
|
-
.bs-logo-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:16px}.bs-logo-options>button{min-width:0;padding:0;overflow:hidden;background:#111b1b;border:1px solid #3a4b44;border-radius:6px;color:#b8cbbf}.bs-logo-options>button.is-selected{border-color
|
|
79
|
+
.bs-ending-settings{margin-bottom:29px}.bs-text-button{border:0;background:transparent;color:var(--lewis-accent,#b7eccd);font-size:11px!important;padding:0}
|
|
80
|
+
.bs-update-area{margin-top:25px;padding-top:8px;border-top:1px solid var(--bs-line)}.bs-update-card{display:flex;justify-content:space-between;align-items:center;gap:16px;background:#151e23;border:1px solid var(--bs-line);border-radius:9px;padding:17px}.bs-update-card strong{font-size:12px;font-weight:500}.bs-update-card p{font-size:11px;color:#8b9e92;margin:6px 0 0}.bs-update-card small{display:block;font-size:10px;color:#82978a;margin-top:6px}.bs-update-actions{display:flex;gap:8px;flex-wrap:wrap;flex:none}.bs-update-actions button{border:1px solid var(--lewis-accent-border,#4a6254);background:var(--lewis-accent-surface,#25382e);color:var(--lewis-accent,#b7eccd);border-radius:5px;font-size:11px;padding:7px 10px}.bs-update-message,.bs-update-error{font-size:11px;margin:10px 0 0;line-height:1.7;color:#a9cfb6}.bs-update-error{color:#ffc6b6}.bs-release-link{display:inline-block;margin-top:8px;color:var(--lewis-accent,#b7eccd);font-size:11px;text-decoration:none}
|
|
81
|
+
.bs-logo-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:16px}.bs-logo-options>button{min-width:0;padding:0;overflow:hidden;background:#111b1b;border:1px solid #3a4b44;border-radius:6px;color:#b8cbbf}.bs-logo-options>button.is-selected{border-color:var(--lewis-accent,#b7eccd);color:var(--lewis-accent,#b7eccd)}.bs-logo-options img{display:block;width:100%;aspect-ratio:16/9;object-fit:cover}.bs-logo-options span{display:block;font-size:11px;line-height:1.4;padding:7px 4px;text-align:center}
|
|
82
82
|
.bs-ending-preview{display:flex;gap:19px;padding:18px;align-items:center}.bs-ending-mini{position:relative;width:46%;max-width:245px;aspect-ratio:16/9;overflow:hidden;flex:none;border-radius:6px;border:1px solid #3b4b4c}
|
|
83
83
|
.bs-ending-mini .bs-end-brand{transform:translateY(-2px);width:90%}.bs-ending-mini .bs-end-halo{width:85px}.bs-ending-mini .bs-end-whale{width:42px;margin-bottom:8px;filter:none}.bs-ending-mini .bs-end-brand h1{font-size:14px;letter-spacing:.2em;text-indent:.2em}.bs-ending-mini .bs-end-brand>p{font-size:5px;letter-spacing:.6em;margin-top:5px}.bs-ending-mini .bs-end-rule{width:17px;margin-top:8px}.bs-ending-mini .bs-enter-prompt{font-size:6px;bottom:8%;animation:none}
|
|
84
84
|
.bs-ending-preview>div:last-child{min-width:0;flex:1}.bs-ending-preview strong{font-size:12px;font-weight:500}.bs-ending-preview p{font-size:11px;color:#7d9188;margin:7px 0 12px}.bs-ending-preview small{display:block;font-size:10px;color:#72877b;margin-top:8px}
|
|
85
|
-
.bs-end-library{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px;padding:15px}.bs-end-card{border:1px solid #354840;border-radius:7px;overflow:hidden;background:#111b1b;min-width:0}.bs-end-card.is-selected{border-color
|
|
85
|
+
.bs-end-library{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px;padding:15px}.bs-end-card{border:1px solid #354840;border-radius:7px;overflow:hidden;background:#111b1b;min-width:0}.bs-end-card.is-selected{border-color:var(--lewis-accent,#b7eccd)}.bs-end-card>button:first-child{display:block;width:100%;border:0;padding:0;background:transparent;color:#cadace}.bs-end-card img{width:100%;height:83px;object-fit:cover;display:block}.bs-end-card>button>span{display:block;padding:6px 8px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bs-end-card .bs-delete,.bs-end-card>span>button{border:0;background:transparent;color:#94aa9b;font-size:10px;padding:3px 8px 7px;cursor:pointer}
|
|
86
86
|
.bs-sequence-thumb{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#eeeae1;color:#31383b}.bs-sequence-thumb svg{width:40px;height:40px;fill:currentColor;margin-bottom:6px}.bs-sequence-thumb>span{font-size:13px;letter-spacing:.15em}.bs-sequence-thumb small{font-size:6px;letter-spacing:.12em;opacity:.5}.bs-sequence-thumb~.bs-play-icon{opacity:0;transition:opacity .2s}.bs-thumbnail:hover .bs-sequence-thumb~.bs-play-icon{opacity:1}
|
|
87
87
|
@keyframes bs-prompt-breathe{0%,100%{opacity:.48}50%{opacity:.92}}
|
|
88
88
|
@container(max-width:650px){.bs-library{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.bs-heading h1{font-size:25px}.bs-upload{min-height:170px}.bs-section-title>span{font-size:10px}.bs-clip-info h3{font-size:11px}.bs-toggle-row,.bs-field{padding:14px}.bs-toggle-row input{right:14px}.bs-ending-preview{padding:14px;gap:13px}.bs-ending-preview .bs-primary{padding:7px 10px;font-size:11px!important}}
|
|
@@ -99,32 +99,32 @@ html[data-lewis-player="true"] [data-windows-menu]{visibility:hidden!important;p
|
|
|
99
99
|
.bs-reset-area p{font-size:11px;line-height:1.8;color:#8e9d9c;margin:5px 0 0;max-width:640px}
|
|
100
100
|
.bs-reset-open{flex:none;color:#eab9b8;background:#e5a5a50b;border:1px solid #b77e7e55;border-radius:12px;padding:10px 17px;font-size:12px!important}
|
|
101
101
|
.bs-reset-open:hover:not(:disabled){background:#e5a5a51c;border-color:#ca949477}
|
|
102
|
-
.bs-startup-update{--bs-update-radius:30px;--bs-update-blur:30px;box-sizing:border-box;width:min(448px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 40px);margin:auto;padding:0;border:0;overflow:auto;background:transparent;color:#eaf3ef;outline:none;font:13px/1.6 Inter,-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',sans-serif;color-scheme:dark}
|
|
102
|
+
.bs-startup-update{--bs-update-radius:var(--lewis-radius,30px);--bs-update-blur:var(--lewis-blur,30px);box-sizing:border-box;width:min(448px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 40px);margin:auto;padding:0;border:0;overflow:auto;background:transparent;color:#eaf3ef;outline:none;font:13px/1.6 Inter,-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',sans-serif;color-scheme:dark}
|
|
103
103
|
.bs-startup-update::backdrop{background:#030d1270;backdrop-filter:blur(calc(var(--bs-update-blur) * .23));-webkit-backdrop-filter:blur(calc(var(--bs-update-blur) * .23))}
|
|
104
104
|
.bs-startup-update *{box-sizing:border-box}
|
|
105
|
-
.bs-startup-update-card{position:relative;width:100%;padding:31px;border:1px solid #ddffff30;border-radius:var(--bs-update-radius);background:linear-gradient(135deg,#b6f7ef13,transparent 62%),#162b31c9;backdrop-filter:blur(var(--bs-update-blur)) saturate(125%);-webkit-backdrop-filter:blur(var(--bs-update-blur)) saturate(125%);box-shadow:0 32px 90px #0006,inset 0 1px 0 #ffffff15;overflow:hidden}
|
|
105
|
+
.bs-startup-update-card{position:relative;width:100%;padding:31px;border:1px solid #ddffff30;border-radius:var(--bs-update-radius);background:linear-gradient(135deg,var(--lewis-accent-a13,#b6f7ef13),transparent 62%),#162b31c9;backdrop-filter:blur(var(--bs-update-blur)) saturate(125%);-webkit-backdrop-filter:blur(var(--bs-update-blur)) saturate(125%);box-shadow:0 32px 90px #0006,inset 0 1px 0 #ffffff15;overflow:hidden}
|
|
106
106
|
.bs-startup-update button{font:inherit;cursor:pointer;transition:background .18s,filter .18s}
|
|
107
|
-
.bs-startup-update button:focus-visible{outline:2px solid
|
|
107
|
+
.bs-startup-update button:focus-visible{outline:2px solid var(--lewis-accent,#b6eddd);outline-offset:3px}
|
|
108
108
|
.bs-startup-update button:disabled{cursor:default;opacity:.6}
|
|
109
109
|
.bs-startup-update-close{position:absolute;right:17px;top:17px;border:0;border-radius:50%;background:#ffffff0c;color:#9aafb0;width:31px;height:31px;display:grid;place-items:center;font-size:20px!important;line-height:1}
|
|
110
|
-
.bs-startup-update-glyph{width:55px;height:55px;border-radius:18px;display:grid;place-items:center;font-size:30px;line-height:1;color
|
|
111
|
-
.bs-startup-update-brand{font-size:9px;letter-spacing:.17em;margin:0 0 10px;color
|
|
110
|
+
.bs-startup-update-glyph{width:55px;height:55px;border-radius:18px;display:grid;place-items:center;font-size:30px;line-height:1;color:var(--lewis-accent,#b6eddd);background:linear-gradient(145deg,var(--lewis-accent-a1f,#8adcc51f),var(--lewis-accent-a0b,#89c4d10b));border:1px solid var(--lewis-accent-a21,#c2f9e721);margin-bottom:25px}
|
|
111
|
+
.bs-startup-update-brand{font-size:9px;letter-spacing:.17em;margin:0 0 10px;color:var(--lewis-accent,#b6eddd);overflow-wrap:anywhere}
|
|
112
112
|
.bs-startup-update-brand span{display:block;letter-spacing:0;margin-top:7px;color:#9aafb0;font-size:11px}
|
|
113
113
|
.bs-startup-update h2{font-size:25px;line-height:1.35;font-weight:500;letter-spacing:-.02em;margin:0 0 12px;color:#eaf3ef}
|
|
114
114
|
.bs-startup-update-copy{font-size:12px;color:#9aafb0;line-height:1.85;margin:0}
|
|
115
115
|
.bs-startup-update-versions{display:flex;align-items:center;gap:12px;font-size:12px;margin:21px 0 19px;color:#9aafb0;flex-wrap:wrap}
|
|
116
|
-
.bs-startup-update-versions strong{font-weight:500;color
|
|
117
|
-
.bs-startup-update-summary{padding:16px 17px;border-radius:15px;border:1px solid
|
|
116
|
+
.bs-startup-update-versions strong{font-weight:500;color:var(--lewis-accent,#b6eddd);background:var(--lewis-accent-a12,#b2e8da12);border-radius:8px;padding:6px 10px}
|
|
117
|
+
.bs-startup-update-summary{padding:16px 17px;border-radius:15px;border:1px solid var(--lewis-accent-a1a,#cbf1e51a);background:#051b202e;margin-bottom:18px}
|
|
118
118
|
.bs-startup-update-summary p{font-size:12px;line-height:1.7;margin:0;color:#eaf3ef;display:flex;gap:10px}
|
|
119
|
-
.bs-startup-update-summary p:before{content:'\u2713';color
|
|
119
|
+
.bs-startup-update-summary p:before{content:'\u2713';color:var(--lewis-accent,#b6eddd);flex:none}
|
|
120
120
|
.bs-startup-update-summary p+p{margin-top:8px}
|
|
121
121
|
.bs-startup-update-retain{font-size:11px;line-height:1.6;color:#9aafb0;margin:0 0 23px}
|
|
122
|
-
.bs-startup-update-retain:before{content:'\u25C7';margin-right:7px;color
|
|
123
|
-
.bs-startup-update-status{font-size:12px;line-height:1.8;color
|
|
122
|
+
.bs-startup-update-retain:before{content:'\u25C7';margin-right:7px;color:var(--lewis-accent,#b6eddd)}
|
|
123
|
+
.bs-startup-update-status{font-size:12px;line-height:1.8;color:var(--lewis-accent,#b6eddd);margin:0 0 19px}
|
|
124
124
|
.bs-startup-update-error{font-size:12px;line-height:1.8;color:#ffd4c9;margin:0 0 19px;overflow-wrap:anywhere}
|
|
125
125
|
.bs-startup-update-actions{display:flex;gap:10px}
|
|
126
|
-
.bs-startup-update-actions button{min-width:0;min-height:43px;font-size:12px;line-height:1.5;border-radius:13px;padding:10px 16px;border:1px solid
|
|
127
|
-
.bs-startup-update-actions .bs-startup-update-primary{flex:1.55;border-color:transparent;color
|
|
126
|
+
.bs-startup-update-actions button{min-width:0;min-height:43px;font-size:12px;line-height:1.5;border-radius:13px;padding:10px 16px;border:1px solid var(--lewis-accent-a1a,#cbf1e51a);background:#ffffff07;color:#9aafb0;flex:1}
|
|
127
|
+
.bs-startup-update-actions .bs-startup-update-primary{flex:1.55;border-color:transparent;color:var(--lewis-accent-text,#142c2c);background:var(--lewis-accent,#b6eddd);box-shadow:0 5px 16px var(--lewis-accent-a10,#95e3cd10)}
|
|
128
128
|
.bs-startup-update-actions button:hover:not(:disabled){filter:brightness(1.08)}
|
|
129
129
|
.bs-reset-glyph{color:#edc1be;background:linear-gradient(145deg,#d88f8f1f,#e4c5bd0a);border-color:#edc1be27}
|
|
130
130
|
.bs-reset-summary{margin-top:20px}
|
|
@@ -134,6 +134,36 @@ html[data-lewis-player="true"] [data-windows-menu]{visibility:hidden!important;p
|
|
|
134
134
|
@media(max-width:520px){.bs-reset-area{align-items:flex-start;flex-direction:column;gap:13px}.bs-reset-open{align-self:flex-start}}
|
|
135
135
|
@media(max-width:450px){.bs-startup-update-card{padding:27px 23px}.bs-startup-update h2{font-size:23px}.bs-startup-update-actions button{padding:10px 12px}.bs-startup-update-versions{gap:9px}}
|
|
136
136
|
@media(prefers-reduced-motion:reduce){.bs-startup-update *{transition:none!important;animation:none!important}}
|
|
137
|
+
.bs-ending-preview strong{display:block;margin-bottom:12px}
|
|
138
|
+
.bs-author-entry{display:flex;align-items:center;justify-content:flex-end;gap:9px;padding-top:17px;color:#849991;font-size:10px;line-height:1.6}
|
|
139
|
+
.bs-author-entry button{display:inline-flex;align-items:center;gap:5px;min-height:28px;padding:3px 8px;border:1px solid var(--lewis-accent-a25,#b6eddd25);border-radius:8px;background:var(--lewis-accent-a06,#b6eddd06);color:var(--lewis-accent-soft,#a9c9bc);font-size:10px!important;cursor:pointer}
|
|
140
|
+
.bs-author-entry button:hover{border-color:var(--lewis-accent-a55,#b6eddd55);background:var(--lewis-accent-a10,#b6eddd10);color:var(--lewis-accent-hover,#d4eee2)}
|
|
141
|
+
.bs-author-entry button:focus-visible{outline:2px solid var(--lewis-accent,#b6eddd);outline-offset:3px}
|
|
142
|
+
.bs-author-dialog{width:min(448px,calc(100vw - 32px))}
|
|
143
|
+
.bs-author-card{padding:25px 22px 22px}
|
|
144
|
+
.bs-author-dialog .bs-startup-update-brand{padding-right:32px;margin-bottom:7px}
|
|
145
|
+
.bs-author-dialog h2{font-size:21px;margin-bottom:19px}
|
|
146
|
+
.bs-author-image{display:block;width:100%;height:auto;max-height:calc(100dvh - 174px);object-fit:contain;background:transparent;border-radius:12px}
|
|
147
|
+
@media(max-width:450px){.bs-author-card{padding:24px 17px 17px}.bs-author-dialog h2{font-size:20px}.bs-author-entry{justify-content:center}}
|
|
148
|
+
|
|
149
|
+
/* Optional series-controller theme. With no controller these fallbacks keep the
|
|
150
|
+
shipped colours and material intact; artwork and player surfaces are excluded. */
|
|
151
|
+
@supports(color:color-mix(in srgb,white,transparent)){
|
|
152
|
+
:is(.bs-studio,.bs-startup-update)[data-lewis-themed="true"]{--lewis-accent-a06:color-mix(in srgb,var(--lewis-accent,#b7eccd) 2.352941176%,transparent);--lewis-accent-a0b:color-mix(in srgb,var(--lewis-accent,#b7eccd) 4.313725490%,transparent);--lewis-accent-a0d:color-mix(in srgb,var(--lewis-accent,#b7eccd) 5.098039216%,transparent);--lewis-accent-a10:color-mix(in srgb,var(--lewis-accent,#b7eccd) 6.274509804%,transparent);--lewis-accent-a12:color-mix(in srgb,var(--lewis-accent,#b7eccd) 7.058823529%,transparent);--lewis-accent-a13:color-mix(in srgb,var(--lewis-accent,#b7eccd) 7.450980392%,transparent);--lewis-accent-a1a:color-mix(in srgb,var(--lewis-accent,#b7eccd) 10.196078431%,transparent);--lewis-accent-a1f:color-mix(in srgb,var(--lewis-accent,#b7eccd) 12.156862745%,transparent);--lewis-accent-a21:color-mix(in srgb,var(--lewis-accent,#b7eccd) 12.941176471%,transparent);--lewis-accent-a22:color-mix(in srgb,var(--lewis-accent,#b7eccd) 13.333333333%,transparent);--lewis-accent-a25:color-mix(in srgb,var(--lewis-accent,#b7eccd) 14.509803922%,transparent);--lewis-accent-a44:color-mix(in srgb,var(--lewis-accent,#b7eccd) 26.666666667%,transparent);--lewis-accent-a55:color-mix(in srgb,var(--lewis-accent,#b7eccd) 33.333333333%,transparent);--lewis-accent-soft:color-mix(in srgb,var(--lewis-accent,#b7eccd) 85%,#8e9d9c);--lewis-accent-hover:color-mix(in srgb,var(--lewis-accent,#b7eccd) 60%,white);--lewis-accent-border:color-mix(in srgb,var(--lewis-accent,#b7eccd) 35%,#243338);--lewis-accent-surface:color-mix(in srgb,var(--lewis-accent,#b7eccd) 12%,#142229)}
|
|
153
|
+
}
|
|
154
|
+
/* Web-rendered liquid glass: shared CSS works in desktop Chromium on macOS and
|
|
155
|
+
Windows. This is not a request for native OS window translucency. */
|
|
156
|
+
.bs-studio[data-lewis-effect="liquid-glass"]{--bs-line:#d9f7ff2d;background:var(--lewis-surface,#16272f);border:1px solid #e4faff42;border-radius:var(--lewis-radius,30px);box-shadow:0 24px 80px #0004,inset 0 1px 0 #ffffff38,inset 0 -1px 0 #b2eaff12}
|
|
157
|
+
.bs-studio[data-lewis-effect="liquid-glass"] :is(.bs-preferences,.bs-clip,.bs-update-card){background:var(--lewis-surface,#16272f);border-color:#d9f7ff2d;box-shadow:inset 0 1px 0 #ffffff15}
|
|
158
|
+
.bs-startup-update[data-lewis-effect="liquid-glass"] .bs-startup-update-card{background:var(--lewis-surface,#16272f);border-color:#e4faff55;box-shadow:0 32px 100px #0005,inset 0 1px 0 #ffffff55,inset 1px 0 0 #ffffff1a,inset 0 -1px 0 #b2eaff1a}
|
|
159
|
+
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
|
|
160
|
+
.bs-studio[data-lewis-effect="liquid-glass"]{background:linear-gradient(135deg,#ffffff20,#ffffff05 35%,#b5ebff0a 75%,#ffffff12),var(--lewis-surface,#11232d8c);backdrop-filter:blur(var(--lewis-blur,30px)) saturate(155%);-webkit-backdrop-filter:blur(var(--lewis-blur,30px)) saturate(155%)}
|
|
161
|
+
.bs-studio[data-lewis-effect="liquid-glass"] :is(.bs-preferences,.bs-clip,.bs-update-card){background:linear-gradient(145deg,#ffffff0d,#ffffff03),#11232d55;backdrop-filter:blur(calc(var(--lewis-blur,30px) * .55)) saturate(135%);-webkit-backdrop-filter:blur(calc(var(--lewis-blur,30px) * .55)) saturate(135%)}
|
|
162
|
+
.bs-startup-update[data-lewis-effect="liquid-glass"]::backdrop{background:#07131a42;backdrop-filter:blur(calc(var(--lewis-blur,30px) * .3));-webkit-backdrop-filter:blur(calc(var(--lewis-blur,30px) * .3))}
|
|
163
|
+
.bs-startup-update[data-lewis-effect="liquid-glass"] .bs-startup-update-card{background:linear-gradient(130deg,#ffffff24,transparent 40%,#b5ebff0a 75%,#ffffff0d),var(--lewis-surface,#11232da1);backdrop-filter:blur(var(--lewis-blur,30px)) saturate(170%);-webkit-backdrop-filter:blur(var(--lewis-blur,30px)) saturate(170%)}
|
|
164
|
+
}
|
|
165
|
+
@media(prefers-reduced-transparency:reduce){.bs-studio[data-lewis-effect="liquid-glass"],.bs-studio[data-lewis-effect="liquid-glass"] :is(.bs-preferences,.bs-clip,.bs-update-card),.bs-startup-update[data-lewis-effect="liquid-glass"] .bs-startup-update-card{background:#16272f;backdrop-filter:none;-webkit-backdrop-filter:none}.bs-startup-update[data-lewis-effect="liquid-glass"]::backdrop{background:#07131abf;backdrop-filter:none;-webkit-backdrop-filter:none}}
|
|
166
|
+
@media(forced-colors:active){.bs-studio[data-lewis-effect="liquid-glass"],.bs-studio[data-lewis-effect="liquid-glass"] :is(.bs-preferences,.bs-clip,.bs-update-card),.bs-startup-update[data-lewis-effect="liquid-glass"] .bs-startup-update-card{background:Canvas;color:CanvasText;border-color:CanvasText;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none}}
|
|
137
167
|
`;
|
|
138
168
|
|
|
139
169
|
// src/logo-path.js
|
|
@@ -3015,21 +3045,278 @@ function UpdatePanel({ request, standalone = false }) {
|
|
|
3015
3045
|
}
|
|
3016
3046
|
|
|
3017
3047
|
// src/update-prompt.jsx
|
|
3018
|
-
var
|
|
3048
|
+
var import_react4 = __toESM(require("react"), 1);
|
|
3049
|
+
|
|
3050
|
+
// src/enchant-theme.jsx
|
|
3051
|
+
var import_react3 = require("react");
|
|
3052
|
+
|
|
3053
|
+
// src/enchant-bridge.js
|
|
3054
|
+
var ENCHANT_REGISTRY_KEY = Symbol.for("dsh.lewis.enchant.v1");
|
|
3055
|
+
var DEFAULT_ENCHANT_THEME = Object.freeze({ effect: "frosted", accent: null, surface: null, blur: 30, radius: 30 });
|
|
3056
|
+
var ID = /^[a-z0-9][a-z0-9._-]{0,127}$/;
|
|
3057
|
+
var COLOR = /^#[a-f0-9]{6}$/i;
|
|
3058
|
+
var THEME_KEYS = /* @__PURE__ */ new Set(["effect", "accent", "surface", "blur", "radius"]);
|
|
3059
|
+
function plain(value) {
|
|
3060
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
3061
|
+
const prototype = Object.getPrototypeOf(value);
|
|
3062
|
+
return prototype === null || prototype === Object.prototype;
|
|
3063
|
+
}
|
|
3064
|
+
function identifier(value) {
|
|
3065
|
+
if (typeof value !== "string" || !ID.test(value)) throw new TypeError("\u9644\u9B54\u53F0\u9700\u8981\u7A33\u5B9A\u7684\u63D2\u4EF6\u6216\u8BBE\u7F6E\u5165\u53E3 ID\u3002");
|
|
3066
|
+
return value;
|
|
3067
|
+
}
|
|
3068
|
+
function themeValue(patch, base = DEFAULT_ENCHANT_THEME) {
|
|
3069
|
+
if (!plain(patch)) throw new TypeError("\u9644\u9B54\u53F0\u4E3B\u9898\u5FC5\u987B\u662F\u5BF9\u8C61\u3002");
|
|
3070
|
+
const result = { ...base };
|
|
3071
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
3072
|
+
if (!THEME_KEYS.has(key)) throw new TypeError("\u4E0D\u652F\u6301\u7684\u9644\u9B54\u53F0\u4E3B\u9898\u5C5E\u6027\u3002");
|
|
3073
|
+
if (key === "effect" && !["frosted", "liquid-glass"].includes(value)) throw new TypeError("\u4E0D\u652F\u6301\u7684\u9644\u9B54\u53F0\u6750\u8D28\u3002");
|
|
3074
|
+
if (["accent", "surface"].includes(key) && value !== null && (typeof value !== "string" || !COLOR.test(value))) throw new TypeError("\u4E3B\u9898\u989C\u8272\u987B\u4E3A\u516D\u4F4D\u5341\u516D\u8FDB\u5236\u989C\u8272\u3002");
|
|
3075
|
+
if (key === "blur" && !(Number.isInteger(value) && value >= 0 && value <= 48)) throw new TypeError("\u4E3B\u9898\u78E8\u7802\u5EA6\u987B\u4E3A 0 \u5230 48 \u7684\u6574\u6570\u3002");
|
|
3076
|
+
if (key === "radius" && !(Number.isInteger(value) && value >= 12 && value <= 40)) throw new TypeError("\u4E3B\u9898\u5706\u89D2\u987B\u4E3A 12 \u5230 40 \u7684\u6574\u6570\u3002");
|
|
3077
|
+
result[key] = typeof value === "string" && key !== "effect" ? value.toLowerCase() : value;
|
|
3078
|
+
}
|
|
3079
|
+
return Object.freeze(result);
|
|
3080
|
+
}
|
|
3081
|
+
function themeAttributes(theme = DEFAULT_ENCHANT_THEME) {
|
|
3082
|
+
const value = themeValue(theme);
|
|
3083
|
+
const style = { "--lewis-blur": `${value.blur}px`, "--lewis-radius": `${value.radius}px` };
|
|
3084
|
+
if (value.accent) {
|
|
3085
|
+
style["--lewis-accent"] = value.accent;
|
|
3086
|
+
const rgb = [1, 3, 5].map((offset) => parseInt(value.accent.slice(offset, offset + 2), 16));
|
|
3087
|
+
const brightness = rgb.reduce((sum, channel, index) => sum + channel * [0.299, 0.587, 0.114][index], 0);
|
|
3088
|
+
style["--lewis-accent-text"] = brightness >= 155 ? "#142c2c" : "#f4fbf8";
|
|
3089
|
+
}
|
|
3090
|
+
if (value.surface) style["--lewis-surface"] = value.surface;
|
|
3091
|
+
return { "data-lewis-effect": value.effect, "data-lewis-themed": value.accent ? "true" : void 0, style };
|
|
3092
|
+
}
|
|
3093
|
+
function createRegistry() {
|
|
3094
|
+
const plugins = /* @__PURE__ */ new Map();
|
|
3095
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
3096
|
+
let controller = null;
|
|
3097
|
+
let revision = 0;
|
|
3098
|
+
let snapshot = Object.freeze({ version: 1, revision, theme: DEFAULT_ENCHANT_THEME, controller: null, plugins: Object.freeze([]) });
|
|
3099
|
+
function entryReady(candidate = controller) {
|
|
3100
|
+
if (!candidate) return false;
|
|
3101
|
+
try {
|
|
3102
|
+
return candidate.isEntryReady() === true;
|
|
3103
|
+
} catch {
|
|
3104
|
+
return false;
|
|
3105
|
+
}
|
|
3106
|
+
}
|
|
3107
|
+
function publish2() {
|
|
3108
|
+
const ready = entryReady();
|
|
3109
|
+
snapshot = Object.freeze({
|
|
3110
|
+
version: 1,
|
|
3111
|
+
revision: ++revision,
|
|
3112
|
+
theme: controller && ready ? controller.theme : DEFAULT_ENCHANT_THEME,
|
|
3113
|
+
controller: controller ? Object.freeze({ id: controller.id, sectionId: controller.sectionId, ready }) : null,
|
|
3114
|
+
plugins: Object.freeze([...plugins.values()].map((owners) => [...owners.values()].at(-1)))
|
|
3115
|
+
});
|
|
3116
|
+
for (const listener of [...listeners]) {
|
|
3117
|
+
try {
|
|
3118
|
+
listener();
|
|
3119
|
+
} catch {
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
}
|
|
3123
|
+
function refresh() {
|
|
3124
|
+
const ready = entryReady();
|
|
3125
|
+
if (Boolean(snapshot.controller?.ready) !== ready) publish2();
|
|
3126
|
+
}
|
|
3127
|
+
function shouldGroupSettings(pluginId) {
|
|
3128
|
+
return plugins.has(pluginId) && entryReady() && ![...plugins.get(pluginId).values()].some((plugin) => plugin.sectionId === controller.sectionId);
|
|
3129
|
+
}
|
|
3130
|
+
return Object.freeze({
|
|
3131
|
+
version: 1,
|
|
3132
|
+
getSnapshot: () => snapshot,
|
|
3133
|
+
subscribe(listener) {
|
|
3134
|
+
if (typeof listener !== "function") throw new TypeError("\u9644\u9B54\u53F0\u76D1\u542C\u5668\u5FC5\u987B\u662F\u51FD\u6570\u3002");
|
|
3135
|
+
listeners.add(listener);
|
|
3136
|
+
let active = true;
|
|
3137
|
+
return () => {
|
|
3138
|
+
if (active) {
|
|
3139
|
+
active = false;
|
|
3140
|
+
listeners.delete(listener);
|
|
3141
|
+
}
|
|
3142
|
+
};
|
|
3143
|
+
},
|
|
3144
|
+
refresh,
|
|
3145
|
+
registerPlugin(descriptor) {
|
|
3146
|
+
if (!plain(descriptor)) throw new TypeError("\u9644\u9B54\u53F0\u63D2\u4EF6\u4FE1\u606F\u5FC5\u987B\u662F\u5BF9\u8C61\u3002");
|
|
3147
|
+
const { id, name, sectionId, renderSettings, openSettings: openSettings2 } = descriptor;
|
|
3148
|
+
identifier(id);
|
|
3149
|
+
identifier(sectionId);
|
|
3150
|
+
if (typeof name !== "string" || !name.trim() || name.length > 80 || /[\x00-\x1f\x7f]/.test(name)) throw new TypeError("\u9644\u9B54\u53F0\u63D2\u4EF6\u540D\u79F0\u65E0\u6548\u3002");
|
|
3151
|
+
if (typeof renderSettings !== "function" || typeof openSettings2 !== "function") throw new TypeError("\u9644\u9B54\u53F0\u63D2\u4EF6\u9700\u8981\u53EF\u7528\u7684\u8BBE\u7F6E\u7EC4\u4EF6\u4E0E\u6253\u5F00\u65B9\u6CD5\u3002");
|
|
3152
|
+
const owners = plugins.get(id) || /* @__PURE__ */ new Map();
|
|
3153
|
+
const existing = [...owners.values()][0];
|
|
3154
|
+
if (existing && (existing.name !== name || existing.sectionId !== sectionId)) throw new Error("\u9644\u9B54\u53F0\u63D2\u4EF6 ID \u5DF2\u88AB\u53E6\u4E00\u9879\u5360\u7528\u3002");
|
|
3155
|
+
const token = Symbol(id);
|
|
3156
|
+
owners.set(token, Object.freeze({ id, name, sectionId, renderSettings, openSettings: openSettings2 }));
|
|
3157
|
+
plugins.set(id, owners);
|
|
3158
|
+
publish2();
|
|
3159
|
+
let active = true;
|
|
3160
|
+
return () => {
|
|
3161
|
+
if (!active) return;
|
|
3162
|
+
active = false;
|
|
3163
|
+
owners.delete(token);
|
|
3164
|
+
if (!owners.size) plugins.delete(id);
|
|
3165
|
+
publish2();
|
|
3166
|
+
};
|
|
3167
|
+
},
|
|
3168
|
+
acquireController(descriptor) {
|
|
3169
|
+
if (controller) throw new Error("\u9644\u9B54\u53F0\u5DF2\u7ECF\u6709\u4E00\u4E2A\u6D3B\u52A8\u7684\u63A7\u5236\u5668\u3002");
|
|
3170
|
+
if (!plain(descriptor)) throw new TypeError("\u9644\u9B54\u53F0\u63A7\u5236\u5668\u4FE1\u606F\u5FC5\u987B\u662F\u5BF9\u8C61\u3002");
|
|
3171
|
+
const { id, sectionId, openSettings: openSettings2, isEntryReady } = descriptor;
|
|
3172
|
+
identifier(id);
|
|
3173
|
+
identifier(sectionId);
|
|
3174
|
+
if (typeof openSettings2 !== "function" || typeof isEntryReady !== "function") throw new TypeError("\u63A7\u5236\u5668\u9700\u8981\u53EF\u7528\u4E14\u53EF\u9A8C\u8BC1\u7684\u8BBE\u7F6E\u5165\u53E3\u3002");
|
|
3175
|
+
if ([...plugins.values()].some((owners) => [...owners.values()].some((plugin) => plugin.sectionId === sectionId))) throw new Error("\u63A7\u5236\u5668\u5FC5\u987B\u4F7F\u7528\u72EC\u7ACB\u7684\u8BBE\u7F6E\u5165\u53E3\u3002");
|
|
3176
|
+
const token = Symbol(id);
|
|
3177
|
+
const candidate = { id, sectionId, openSettings: openSettings2, isEntryReady, token, theme: themeValue(descriptor.theme === void 0 ? {} : descriptor.theme) };
|
|
3178
|
+
controller = candidate;
|
|
3179
|
+
publish2();
|
|
3180
|
+
let active = true;
|
|
3181
|
+
const assertActive = () => {
|
|
3182
|
+
if (!active || controller?.token !== token) throw new Error("\u9644\u9B54\u53F0\u63A7\u5236\u5668\u5DF2\u7ECF\u91CA\u653E\u3002");
|
|
3183
|
+
};
|
|
3184
|
+
return Object.freeze({
|
|
3185
|
+
setTheme(patch) {
|
|
3186
|
+
assertActive();
|
|
3187
|
+
const next = themeValue(patch, controller.theme);
|
|
3188
|
+
controller.theme = next;
|
|
3189
|
+
publish2();
|
|
3190
|
+
},
|
|
3191
|
+
refresh() {
|
|
3192
|
+
assertActive();
|
|
3193
|
+
refresh();
|
|
3194
|
+
},
|
|
3195
|
+
release() {
|
|
3196
|
+
if (!active) return;
|
|
3197
|
+
active = false;
|
|
3198
|
+
if (controller?.token !== token) return;
|
|
3199
|
+
controller = null;
|
|
3200
|
+
publish2();
|
|
3201
|
+
}
|
|
3202
|
+
});
|
|
3203
|
+
},
|
|
3204
|
+
shouldGroupSettings,
|
|
3205
|
+
openControllerSettings(pluginId) {
|
|
3206
|
+
if (!shouldGroupSettings(pluginId)) return false;
|
|
3207
|
+
try {
|
|
3208
|
+
return controller.openSettings(pluginId) !== false;
|
|
3209
|
+
} catch {
|
|
3210
|
+
return false;
|
|
3211
|
+
}
|
|
3212
|
+
}
|
|
3213
|
+
});
|
|
3214
|
+
}
|
|
3215
|
+
function getEnchantRegistry(scope = globalThis) {
|
|
3216
|
+
if ((!scope || typeof scope !== "object") && typeof scope !== "function") throw new TypeError("\u9644\u9B54\u53F0\u9700\u8981\u5171\u4EAB\u7A97\u53E3\u4F5C\u7528\u57DF\u3002");
|
|
3217
|
+
let registry = scope[ENCHANT_REGISTRY_KEY];
|
|
3218
|
+
if (!registry) {
|
|
3219
|
+
registry = createRegistry();
|
|
3220
|
+
Object.defineProperty(scope, ENCHANT_REGISTRY_KEY, { value: registry, enumerable: false });
|
|
3221
|
+
}
|
|
3222
|
+
if (registry.version !== 1 || !["getSnapshot", "subscribe", "registerPlugin", "acquireController", "shouldGroupSettings", "refresh"].every((name) => typeof registry[name] === "function")) throw new Error("\u9644\u9B54\u53F0\u5171\u4EAB\u534F\u8BAE\u4E0D\u517C\u5BB9\u3002");
|
|
3223
|
+
return registry;
|
|
3224
|
+
}
|
|
3225
|
+
function bindSettingsEntry({ slots, registry = getEnchantRegistry(), pluginId, register }) {
|
|
3226
|
+
identifier(pluginId);
|
|
3227
|
+
if (typeof register !== "function") throw new TypeError("\u9644\u9B54\u53F0\u9700\u8981\u8BBE\u7F6E\u5165\u53E3\u6CE8\u518C\u65B9\u6CD5\u3002");
|
|
3228
|
+
if (typeof slots?.entries !== "function" || typeof slots?.subscribe !== "function") {
|
|
3229
|
+
const dispose = register();
|
|
3230
|
+
let active2 = true;
|
|
3231
|
+
return () => {
|
|
3232
|
+
if (!active2) return;
|
|
3233
|
+
active2 = false;
|
|
3234
|
+
if (typeof dispose === "function") dispose();
|
|
3235
|
+
};
|
|
3236
|
+
}
|
|
3237
|
+
let active = true, slot = null, syncing = false;
|
|
3238
|
+
function shouldGroup() {
|
|
3239
|
+
if (!registry.shouldGroupSettings(pluginId)) return false;
|
|
3240
|
+
const owner = registry.getSnapshot().controller;
|
|
3241
|
+
try {
|
|
3242
|
+
return slots.entries("settings.section").some((entry) => entry.options?.id === owner?.sectionId);
|
|
3243
|
+
} catch {
|
|
3244
|
+
return false;
|
|
3245
|
+
}
|
|
3246
|
+
}
|
|
3247
|
+
function sync() {
|
|
3248
|
+
if (!active || syncing) return;
|
|
3249
|
+
syncing = true;
|
|
3250
|
+
try {
|
|
3251
|
+
registry.refresh();
|
|
3252
|
+
if (shouldGroup()) {
|
|
3253
|
+
if (slot) {
|
|
3254
|
+
const dispose = slot;
|
|
3255
|
+
slot = null;
|
|
3256
|
+
dispose();
|
|
3257
|
+
}
|
|
3258
|
+
} else if (!slot) {
|
|
3259
|
+
slot = () => {
|
|
3260
|
+
};
|
|
3261
|
+
const dispose = register();
|
|
3262
|
+
if (typeof dispose !== "function") throw new TypeError("Harness \u8BBE\u7F6E\u5165\u53E3\u6CA1\u6709\u8FD4\u56DE\u6E05\u7406\u65B9\u6CD5\u3002");
|
|
3263
|
+
slot = dispose;
|
|
3264
|
+
}
|
|
3265
|
+
} finally {
|
|
3266
|
+
syncing = false;
|
|
3267
|
+
}
|
|
3268
|
+
}
|
|
3269
|
+
const offRegistry = registry.subscribe(sync);
|
|
3270
|
+
const offLedger = slots.subscribe("settings.section", sync);
|
|
3271
|
+
try {
|
|
3272
|
+
sync();
|
|
3273
|
+
} catch (error) {
|
|
3274
|
+
active = false;
|
|
3275
|
+
offRegistry();
|
|
3276
|
+
offLedger();
|
|
3277
|
+
slot?.();
|
|
3278
|
+
throw error;
|
|
3279
|
+
}
|
|
3280
|
+
return () => {
|
|
3281
|
+
if (!active) return;
|
|
3282
|
+
active = false;
|
|
3283
|
+
offRegistry();
|
|
3284
|
+
offLedger();
|
|
3285
|
+
const dispose = slot;
|
|
3286
|
+
slot = null;
|
|
3287
|
+
dispose?.();
|
|
3288
|
+
};
|
|
3289
|
+
}
|
|
3290
|
+
|
|
3291
|
+
// src/enchant-theme.jsx
|
|
3292
|
+
function useEnchantAppearance() {
|
|
3293
|
+
const registry = getEnchantRegistry();
|
|
3294
|
+
const [snapshot, setSnapshot] = (0, import_react3.useState)(() => registry.getSnapshot());
|
|
3295
|
+
(0, import_react3.useEffect)(() => {
|
|
3296
|
+
const refresh = () => setSnapshot(registry.getSnapshot());
|
|
3297
|
+
const dispose = registry.subscribe(refresh);
|
|
3298
|
+
refresh();
|
|
3299
|
+
return dispose;
|
|
3300
|
+
}, [registry]);
|
|
3301
|
+
return themeAttributes(snapshot.theme);
|
|
3302
|
+
}
|
|
3303
|
+
|
|
3304
|
+
// src/update-prompt.jsx
|
|
3019
3305
|
function UpdatePrompt({ request, status = {}, settings = {}, onDismiss, onUpdated, preview: preview2 = false }) {
|
|
3020
|
-
const
|
|
3021
|
-
const
|
|
3022
|
-
const
|
|
3023
|
-
const
|
|
3024
|
-
const [
|
|
3025
|
-
const [
|
|
3026
|
-
const [
|
|
3027
|
-
const
|
|
3306
|
+
const appearance = useEnchantAppearance();
|
|
3307
|
+
const dialog = (0, import_react4.useRef)(null);
|
|
3308
|
+
const mounted = (0, import_react4.useRef)(true);
|
|
3309
|
+
const lock = (0, import_react4.useRef)(false);
|
|
3310
|
+
const [busy, setBusy] = (0, import_react4.useState)(false);
|
|
3311
|
+
const [phase, setPhase] = (0, import_react4.useState)("prepare");
|
|
3312
|
+
const [error, setError] = (0, import_react4.useState)("");
|
|
3313
|
+
const [completed, setCompleted] = (0, import_react4.useState)(() => appliedUpdate(status));
|
|
3314
|
+
const close = (0, import_react4.useCallback)(() => {
|
|
3028
3315
|
if (lock.current) return;
|
|
3029
3316
|
if (completed && !preview2) onUpdated?.(completed.version, completed.result);
|
|
3030
3317
|
onDismiss?.();
|
|
3031
3318
|
}, [completed, onDismiss, onUpdated, preview2]);
|
|
3032
|
-
(0,
|
|
3319
|
+
(0, import_react4.useEffect)(() => {
|
|
3033
3320
|
mounted.current = true;
|
|
3034
3321
|
const element = dialog.current;
|
|
3035
3322
|
const previous = document.activeElement;
|
|
@@ -3059,18 +3346,16 @@ function UpdatePrompt({ request, status = {}, settings = {}, onDismiss, onUpdate
|
|
|
3059
3346
|
if (mounted.current) setBusy(false);
|
|
3060
3347
|
}
|
|
3061
3348
|
}
|
|
3062
|
-
|
|
3063
|
-
const blur = Number.isFinite(settings.updatePromptBlur) ? Math.min(48, Math.max(0, settings.updatePromptBlur)) : 30;
|
|
3064
|
-
return /* @__PURE__ */ import_react3.default.createElement("dialog", { ref: dialog, className: "bs-startup-update", "data-testid": "startup-update", "data-preview": preview2 || void 0, style: { "--bs-update-radius": `${radius}px`, "--bs-update-blur": `${blur}px` }, "aria-labelledby": "bs-startup-update-title", "aria-describedby": "bs-startup-update-description", onCancel: (event) => {
|
|
3349
|
+
return /* @__PURE__ */ import_react4.default.createElement("dialog", { ref: dialog, className: "bs-startup-update", "data-testid": "startup-update", "data-preview": preview2 || void 0, ...appearance, "aria-labelledby": "bs-startup-update-title", "aria-describedby": "bs-startup-update-description", onCancel: (event) => {
|
|
3065
3350
|
event.preventDefault();
|
|
3066
3351
|
close();
|
|
3067
|
-
} }, /* @__PURE__ */
|
|
3352
|
+
} }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "bs-startup-update-card" }, /* @__PURE__ */ import_react4.default.createElement("button", { className: "bs-startup-update-close", type: "button", "aria-label": completed ? "\u5173\u95ED\u66F4\u65B0\u63D0\u793A" : "\u7A0D\u540E\u518D\u8BF4", disabled: busy, onClick: close }, "\xD7"), /* @__PURE__ */ import_react4.default.createElement("div", { className: "bs-startup-update-glyph", "aria-hidden": "true" }, "\u2727"), /* @__PURE__ */ import_react4.default.createElement("p", { className: "bs-startup-update-brand" }, "DSH LEWIS ENCHANT", preview2 && /* @__PURE__ */ import_react4.default.createElement("span", null, " \xB7 \u66F4\u65B0\u63D0\u9192\u5916\u89C2\u9884\u89C8")), /* @__PURE__ */ import_react4.default.createElement("h2", { id: "bs-startup-update-title" }, completed ? "\u65B0\u7684\u5F00\u573A\uFF0C\u5DF2\u51C6\u5907\u5C31\u7EEA\u3002" : "\u65B0\u7684\u5F00\u573A\uFF0C\u51C6\u5907\u597D\u4E86\u3002"), /* @__PURE__ */ import_react4.default.createElement("p", { id: "bs-startup-update-description", className: "bs-startup-update-copy" }, preview2 ? "\u8FD9\u91CC\u53EA\u9884\u89C8\u5F39\u7A97\u5916\u89C2\uFF0C\u4E0D\u4F1A\u4E0B\u8F7D\u6216\u5B89\u88C5\u66F4\u65B0\u3002" : completed ? "\u91CD\u65B0\u6253\u5F00 Harness\uFF0C\u5373\u53EF\u4F7F\u7528\u65B0\u7248\u672C\u3002" : "\u53D1\u73B0\u5F00\u673A\u52A8\u753B\u65B0\u7248\u672C\uFF0C\u4E3A\u4E0B\u4E00\u6B21\u542F\u52A8\u6DFB\u4E00\u70B9\u65B0\u610F\u3002"), /* @__PURE__ */ import_react4.default.createElement("div", { className: "bs-startup-update-versions" }, /* @__PURE__ */ import_react4.default.createElement("span", null, "v", status?.currentVersion || "1.2.7"), /* @__PURE__ */ import_react4.default.createElement("span", { "aria-hidden": "true" }, "\u2192"), /* @__PURE__ */ import_react4.default.createElement("strong", null, preview2 ? "\u540E\u7EED\u7248\u672C" : `v${status.latestVersion}`)), !busy && !completed && /* @__PURE__ */ import_react4.default.createElement("div", { className: "bs-startup-update-summary" }, /* @__PURE__ */ import_react4.default.createElement("p", null, "\u5B8C\u6574\u5B89\u88C5\u5305\u6821\u9A8C\u540E\u66F4\u65B0"), /* @__PURE__ */ import_react4.default.createElement("p", null, "\u4FDD\u7559\u4E2A\u4EBA\u89C6\u9891\u4E0E\u5C01\u9762"), /* @__PURE__ */ import_react4.default.createElement("p", null, "\u91CD\u65B0\u6253\u5F00\u540E\u4F7F\u7528\u65B0\u7248\u672C")), /* @__PURE__ */ import_react4.default.createElement("p", { className: "bs-startup-update-retain" }, "\u4F60\u7684\u89C6\u9891\u3001\u56FE\u7247\u548C\u8BBE\u7F6E\u90FD\u4F1A\u4FDD\u7559"), busy && /* @__PURE__ */ import_react4.default.createElement("p", { className: "bs-startup-update-status", role: "status", "aria-live": "polite" }, phase === "install" ? "\u6821\u9A8C\u901A\u8FC7\uFF0C\u6B63\u5728\u901A\u8FC7 Harness \u5E94\u7528\u66F4\u65B0\u2026" : "\u6B63\u5728\u4E0B\u8F7D\u5E76\u6821\u9A8C\u66F4\u65B0\u5305\u2026"), error && /* @__PURE__ */ import_react4.default.createElement("p", { className: "bs-startup-update-error", role: "alert" }, error), completed && /* @__PURE__ */ import_react4.default.createElement("p", { className: "bs-startup-update-status", role: "status" }, completed.result.application === "restart-required" ? "\u66F4\u65B0\u5B8C\u6210\u3002\u8BF7\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u65B0\u6253\u5F00 Harness\u3002" : "\u65B0\u7248\u672C\u5DF2\u5E94\u7528\u3002\u5EFA\u8BAE\u91CD\u65B0\u6253\u5F00 Harness\uFF0C\u8BA9\u6240\u6709\u7A97\u53E3\u4F7F\u7528\u65B0\u7248\u672C\u3002"), /* @__PURE__ */ import_react4.default.createElement("div", { className: "bs-startup-update-actions" }, preview2 ? /* @__PURE__ */ import_react4.default.createElement("button", { className: "bs-startup-update-primary", type: "button", onClick: close }, "\u5173\u95ED\u9884\u89C8") : completed ? /* @__PURE__ */ import_react4.default.createElement("button", { className: "bs-startup-update-primary", type: "button", onClick: close }, "\u77E5\u9053\u4E86") : /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement("button", { type: "button", disabled: busy, onClick: close }, "\u7A0D\u540E\u518D\u8BF4"), /* @__PURE__ */ import_react4.default.createElement("button", { className: "bs-startup-update-primary", type: "button", disabled: busy, onClick: accept }, busy ? "\u6B63\u5728\u66F4\u65B0\u2026" : error ? "\u91CD\u8BD5\u66F4\u65B0" : `\u66F4\u65B0\u5230 ${status.latestVersion}`)))));
|
|
3068
3353
|
}
|
|
3069
3354
|
|
|
3070
3355
|
// src/shortcut-registry.js
|
|
3071
3356
|
var SHORTCUT_LIMIT = 17;
|
|
3072
3357
|
var SHORTCUT_REGISTRY_KEY = Symbol.for("dsh.lewis.enchant.shortcuts.v1");
|
|
3073
|
-
function
|
|
3358
|
+
function createRegistry2() {
|
|
3074
3359
|
const entries = /* @__PURE__ */ new Map();
|
|
3075
3360
|
const listeners = /* @__PURE__ */ new Set();
|
|
3076
3361
|
let snapshot = Object.freeze({ limit: SHORTCUT_LIMIT, count: 0, visibleIds: Object.freeze([]), waitingIds: Object.freeze([]) });
|
|
@@ -3131,7 +3416,7 @@ function getShortcutRegistry(scope = globalThis) {
|
|
|
3131
3416
|
if ((!scope || typeof scope !== "object") && typeof scope !== "function") throw new TypeError("\u5FEB\u6377\u5165\u53E3\u9700\u8981\u5171\u4EAB\u7A97\u53E3\u4F5C\u7528\u57DF\u3002");
|
|
3132
3417
|
let registry = scope[SHORTCUT_REGISTRY_KEY];
|
|
3133
3418
|
if (!registry) {
|
|
3134
|
-
registry =
|
|
3419
|
+
registry = createRegistry2();
|
|
3135
3420
|
Object.defineProperty(scope, SHORTCUT_REGISTRY_KEY, { value: registry, enumerable: false });
|
|
3136
3421
|
}
|
|
3137
3422
|
if (registry.version !== 1 || registry.limit !== SHORTCUT_LIMIT || !["acquire", "subscribe", "isVisible", "getSnapshot"].every((key) => typeof registry[key] === "function")) throw new Error("\u9644\u9B54\u53F0\u5FEB\u6377\u5165\u53E3\u5171\u4EAB\u534F\u8BAE\u4E0D\u517C\u5BB9\u3002");
|
|
@@ -3139,15 +3424,16 @@ function getShortcutRegistry(scope = globalThis) {
|
|
|
3139
3424
|
}
|
|
3140
3425
|
|
|
3141
3426
|
// src/reset-dialog.jsx
|
|
3142
|
-
var
|
|
3427
|
+
var import_react5 = __toESM(require("react"), 1);
|
|
3143
3428
|
function ResetDialog({ settings = {}, onCancel, onConfirm }) {
|
|
3144
|
-
const
|
|
3145
|
-
const
|
|
3146
|
-
const
|
|
3147
|
-
const
|
|
3148
|
-
const
|
|
3149
|
-
const [
|
|
3150
|
-
(0,
|
|
3429
|
+
const appearance = useEnchantAppearance();
|
|
3430
|
+
const dialog = (0, import_react5.useRef)(null);
|
|
3431
|
+
const cancelButton = (0, import_react5.useRef)(null);
|
|
3432
|
+
const mounted = (0, import_react5.useRef)(true);
|
|
3433
|
+
const lock = (0, import_react5.useRef)(false);
|
|
3434
|
+
const [busy, setBusy] = (0, import_react5.useState)(false);
|
|
3435
|
+
const [error, setError] = (0, import_react5.useState)("");
|
|
3436
|
+
(0, import_react5.useEffect)(() => {
|
|
3151
3437
|
mounted.current = true;
|
|
3152
3438
|
const element = dialog.current;
|
|
3153
3439
|
const previous = document.activeElement;
|
|
@@ -3181,12 +3467,40 @@ function ResetDialog({ settings = {}, onCancel, onConfirm }) {
|
|
|
3181
3467
|
}
|
|
3182
3468
|
if (mounted.current) onCancel?.();
|
|
3183
3469
|
}
|
|
3184
|
-
|
|
3185
|
-
const blur = Number.isFinite(settings.updatePromptBlur) ? Math.min(48, Math.max(0, settings.updatePromptBlur)) : 30;
|
|
3186
|
-
return /* @__PURE__ */ import_react4.default.createElement("dialog", { ref: dialog, className: "bs-startup-update bs-reset-dialog", "data-testid": "reset-dialog", style: { "--bs-update-radius": `${radius}px`, "--bs-update-blur": `${blur}px` }, "aria-labelledby": "bs-reset-title", "aria-describedby": "bs-reset-description bs-reset-warning", "aria-busy": busy, onCancel: (event) => {
|
|
3470
|
+
return /* @__PURE__ */ import_react5.default.createElement("dialog", { ref: dialog, className: "bs-startup-update bs-reset-dialog", "data-testid": "reset-dialog", ...appearance, "aria-labelledby": "bs-reset-title", "aria-describedby": "bs-reset-description bs-reset-warning", "aria-busy": busy, onCancel: (event) => {
|
|
3187
3471
|
event.preventDefault();
|
|
3188
3472
|
cancel();
|
|
3189
|
-
} }, /* @__PURE__ */
|
|
3473
|
+
} }, /* @__PURE__ */ import_react5.default.createElement("div", { className: "bs-startup-update-card bs-reset-card" }, /* @__PURE__ */ import_react5.default.createElement("button", { className: "bs-startup-update-close", type: "button", "aria-label": "\u53D6\u6D88\u6062\u590D\u9ED8\u8BA4", disabled: busy, onClick: cancel }, "\xD7"), /* @__PURE__ */ import_react5.default.createElement("div", { className: "bs-startup-update-glyph bs-reset-glyph", "aria-hidden": "true" }, "\u21BA"), /* @__PURE__ */ import_react5.default.createElement("p", { className: "bs-startup-update-brand" }, "DSH LEWIS ENCHANT"), /* @__PURE__ */ import_react5.default.createElement("h2", { id: "bs-reset-title" }, "\u56DE\u5230\u6700\u521D\u7684\u5F00\u573A\uFF1F"), /* @__PURE__ */ import_react5.default.createElement("p", { id: "bs-reset-description", className: "bs-startup-update-copy" }, "\u6062\u590D\u9ED8\u8BA4\u540E\uFF0C\u5F00\u673A\u52A8\u753B\u5C06\u56DE\u5230\u5B89\u88C5\u65F6\u7684\u72B6\u6001\u3002"), /* @__PURE__ */ import_react5.default.createElement("div", { className: "bs-startup-update-summary bs-reset-summary" }, /* @__PURE__ */ import_react5.default.createElement("p", null, "\u5220\u9664\u5168\u90E8\u4E0A\u4F20\u7684\u89C6\u9891\u548C\u56FE\u7247"), /* @__PURE__ */ import_react5.default.createElement("p", null, "\u91CD\u7F6E\u64AD\u653E\u3001\u58F0\u97F3\u53CA\u7ED3\u675F\u753B\u9762\u7B49\u504F\u597D"), /* @__PURE__ */ import_react5.default.createElement("p", null, "\u91CD\u7F6E\u4FA7\u680F\u5FEB\u6377\u5165\u53E3")), /* @__PURE__ */ import_react5.default.createElement("p", { className: "bs-startup-update-retain bs-reset-retain" }, "\u5B89\u88C5\u5305\u81EA\u5E26\u7684\u52A8\u753B\u548C\u5C01\u9762\u4F1A\u4FDD\u7559\u3002"), /* @__PURE__ */ import_react5.default.createElement("p", { id: "bs-reset-warning", className: "bs-reset-warning" }, "\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\uFF0C\u8BF7\u5148\u5907\u4EFD\u9700\u8981\u4FDD\u7559\u7684\u7D20\u6750\u3002"), busy && /* @__PURE__ */ import_react5.default.createElement("p", { className: "bs-startup-update-status", role: "status", "aria-live": "polite" }, "\u6B63\u5728\u79FB\u9664\u81EA\u5B9A\u4E49\u7D20\u6750\u5E76\u6062\u590D\u9ED8\u8BA4\u2026"), error && /* @__PURE__ */ import_react5.default.createElement("p", { className: "bs-startup-update-error", role: "alert" }, error), /* @__PURE__ */ import_react5.default.createElement("div", { className: "bs-startup-update-actions bs-reset-actions" }, /* @__PURE__ */ import_react5.default.createElement("button", { ref: cancelButton, type: "button", autoFocus: true, disabled: busy, onClick: cancel }, "\u53D6\u6D88"), /* @__PURE__ */ import_react5.default.createElement("button", { className: "bs-reset-confirm", type: "button", disabled: busy, onClick: confirm }, busy ? "\u6B63\u5728\u6062\u590D\u2026" : "\u786E\u8BA4\u6062\u590D\u9ED8\u8BA4"))));
|
|
3474
|
+
}
|
|
3475
|
+
|
|
3476
|
+
// src/author-dialog.jsx
|
|
3477
|
+
var import_react6 = __toESM(require("react"), 1);
|
|
3478
|
+
function AuthorDialog({ settings = {}, onClose }) {
|
|
3479
|
+
const appearance = useEnchantAppearance();
|
|
3480
|
+
const dialog = (0, import_react6.useRef)(null);
|
|
3481
|
+
const closeButton = (0, import_react6.useRef)(null);
|
|
3482
|
+
const [imageFailed, setImageFailed] = (0, import_react6.useState)(false);
|
|
3483
|
+
(0, import_react6.useEffect)(() => {
|
|
3484
|
+
const element = dialog.current;
|
|
3485
|
+
const previous = document.activeElement;
|
|
3486
|
+
if (typeof element.showModal === "function") {
|
|
3487
|
+
if (!element.open) element.showModal();
|
|
3488
|
+
} else element.setAttribute("open", "");
|
|
3489
|
+
closeButton.current?.focus();
|
|
3490
|
+
return () => {
|
|
3491
|
+
if (element.open && typeof element.close === "function") element.close();
|
|
3492
|
+
if (previous?.isConnected) previous.focus?.();
|
|
3493
|
+
};
|
|
3494
|
+
}, []);
|
|
3495
|
+
function backdropClick(event) {
|
|
3496
|
+
if (event.target !== event.currentTarget) return;
|
|
3497
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
3498
|
+
if (event.clientX < rect.left || event.clientX > rect.right || event.clientY < rect.top || event.clientY > rect.bottom) onClose();
|
|
3499
|
+
}
|
|
3500
|
+
return /* @__PURE__ */ import_react6.default.createElement("dialog", { ref: dialog, className: "bs-startup-update bs-author-dialog", "data-testid": "author-dialog", ...appearance, "aria-labelledby": "bs-author-title", onCancel: (event) => {
|
|
3501
|
+
event.preventDefault();
|
|
3502
|
+
onClose();
|
|
3503
|
+
}, onClick: backdropClick }, /* @__PURE__ */ import_react6.default.createElement("div", { className: "bs-startup-update-card bs-author-card" }, /* @__PURE__ */ import_react6.default.createElement("button", { ref: closeButton, className: "bs-startup-update-close", type: "button", "aria-label": "\u5173\u95ED\u4F5C\u8005\u4FE1\u606F", onClick: onClose }, "\xD7"), /* @__PURE__ */ import_react6.default.createElement("p", { className: "bs-startup-update-brand" }, "DSH LEWIS ENCHANT"), /* @__PURE__ */ import_react6.default.createElement("h2", { id: "bs-author-title" }, "\u4F5C\u8005\u4FE1\u606F"), imageFailed ? /* @__PURE__ */ import_react6.default.createElement("p", { className: "bs-startup-update-error", role: "alert" }, "\u56FE\u7247\u6682\u65F6\u65E0\u6CD5\u663E\u793A\uFF0C\u8BF7\u5173\u95ED\u540E\u91CD\u8BD5\u3002") : /* @__PURE__ */ import_react6.default.createElement("img", { className: "bs-author-image", src: "/dsh-boot-studio/author-image", alt: "\u4F5C\u8005\u63D0\u4F9B\u7684\u5FAE\u4FE1\u6536\u6B3E\u7801", onError: () => setImageFailed(true) })));
|
|
3190
3504
|
}
|
|
3191
3505
|
|
|
3192
3506
|
// src/client.jsx
|
|
@@ -3199,7 +3513,7 @@ var launchDecisionSettled = false;
|
|
|
3199
3513
|
var latestState = null;
|
|
3200
3514
|
var subscribers = /* @__PURE__ */ new Set();
|
|
3201
3515
|
var playerWindows = /* @__PURE__ */ new WeakMap();
|
|
3202
|
-
var VERSION2 = true ? "1.2.
|
|
3516
|
+
var VERSION2 = true ? "1.2.7" : "1.2.7";
|
|
3203
3517
|
function acquirePlayerWindow(doc) {
|
|
3204
3518
|
const root = doc.documentElement;
|
|
3205
3519
|
let state = playerWindows.get(doc);
|
|
@@ -3242,13 +3556,14 @@ function publish(value) {
|
|
|
3242
3556
|
return value;
|
|
3243
3557
|
}
|
|
3244
3558
|
function openSettings() {
|
|
3559
|
+
if (getEnchantRegistry().openControllerSettings("dsh-openup-lewis")) return;
|
|
3245
3560
|
window.dispatchEvent(new Event(OPEN));
|
|
3246
3561
|
}
|
|
3247
3562
|
function preview(clip, settings, endOnly = false) {
|
|
3248
3563
|
window.dispatchEvent(new CustomEvent(PLAY, { detail: { clip, settings, endOnly } }));
|
|
3249
3564
|
}
|
|
3250
3565
|
function useStyles() {
|
|
3251
|
-
(0,
|
|
3566
|
+
(0, import_react7.useEffect)(() => {
|
|
3252
3567
|
let el = document.getElementById("dsh-boot-studio-style");
|
|
3253
3568
|
if (!el) {
|
|
3254
3569
|
el = document.createElement("style");
|
|
@@ -3259,25 +3574,25 @@ function useStyles() {
|
|
|
3259
3574
|
}, []);
|
|
3260
3575
|
}
|
|
3261
3576
|
function EndTitle({ settings }) {
|
|
3262
|
-
const [imageFailed, setImageFailed] = (0,
|
|
3263
|
-
(0,
|
|
3577
|
+
const [imageFailed, setImageFailed] = (0, import_react7.useState)(false);
|
|
3578
|
+
(0, import_react7.useEffect)(() => setImageFailed(false), [settings.endImageId, settings.logoVariant, settings.endScreen]);
|
|
3264
3579
|
const variant = settings.logoVariant || "silver";
|
|
3265
3580
|
const userImage = settings.endScreen === "image" && settings.endImageId && !imageFailed;
|
|
3266
3581
|
const builtinImage = settings.endScreen !== "image" && ["silver", "gold", "ice"].includes(variant) && !imageFailed;
|
|
3267
3582
|
const imageURL = userImage ? `${BASE}/end-image/${encodeURIComponent(settings.endImageId)}` : builtinImage ? `${BASE}/logo/${variant}` : null;
|
|
3268
|
-
return /* @__PURE__ */
|
|
3583
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", { className: `bs-end-title bs-end-${userImage ? "custom" : variant}`, "data-testid": "end-screen", "data-logo": builtinImage ? variant : void 0 }, imageURL ? /* @__PURE__ */ import_react7.default.createElement("img", { className: "bs-end-image", "data-testid": userImage ? "end-image" : "end-logo-image", src: imageURL, alt: userImage ? "\u81EA\u5B9A\u4E49\u7ED3\u675F\u753B\u9762" : "DeepSeek \u5185\u7F6E\u7ED3\u675F\u753B\u9762", style: { objectFit: userImage ? settings.endFit || "contain" : "cover" }, onError: () => setImageFailed(true) }) : /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-end-brand" }, /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-end-halo" }), /* @__PURE__ */ import_react7.default.createElement("svg", { className: "bs-end-whale", viewBox: "0 0 50 50", "aria-label": "DeepSeek \u6807\u5FD7", role: "img" }, /* @__PURE__ */ import_react7.default.createElement("path", { d: WHALE_PATH })), /* @__PURE__ */ import_react7.default.createElement("h1", null, "DEEPSEEK"), /* @__PURE__ */ import_react7.default.createElement("p", null, "HARNESS"), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-end-rule" })), /* @__PURE__ */ import_react7.default.createElement("p", { className: "bs-enter-prompt" }, "\u6309\u4EFB\u610F\u952E\u8FDB\u5165"));
|
|
3269
3584
|
}
|
|
3270
3585
|
function Player({ clip, settings, onClose, endOnly = false }) {
|
|
3271
3586
|
useStyles();
|
|
3272
|
-
const video = (0,
|
|
3273
|
-
const dialog = (0,
|
|
3274
|
-
const closed = (0,
|
|
3275
|
-
const [phase, setPhase] = (0,
|
|
3276
|
-
const phaseRef = (0,
|
|
3277
|
-
const lastInput = (0,
|
|
3278
|
-
const [blocked, setBlocked] = (0,
|
|
3279
|
-
const [mutedFallback, setMutedFallback] = (0,
|
|
3280
|
-
const stopMedia = (0,
|
|
3587
|
+
const video = (0, import_react7.useRef)(null);
|
|
3588
|
+
const dialog = (0, import_react7.useRef)(null);
|
|
3589
|
+
const closed = (0, import_react7.useRef)(false);
|
|
3590
|
+
const [phase, setPhase] = (0, import_react7.useState)(endOnly ? "end" : "intro");
|
|
3591
|
+
const phaseRef = (0, import_react7.useRef)(endOnly ? "end" : "intro");
|
|
3592
|
+
const lastInput = (0, import_react7.useRef)(-1e3);
|
|
3593
|
+
const [blocked, setBlocked] = (0, import_react7.useState)(false);
|
|
3594
|
+
const [mutedFallback, setMutedFallback] = (0, import_react7.useState)(false);
|
|
3595
|
+
const stopMedia = (0, import_react7.useCallback)(() => {
|
|
3281
3596
|
const el = video.current;
|
|
3282
3597
|
if (el) {
|
|
3283
3598
|
el.pause();
|
|
@@ -3285,26 +3600,26 @@ function Player({ clip, settings, onClose, endOnly = false }) {
|
|
|
3285
3600
|
el.load();
|
|
3286
3601
|
}
|
|
3287
3602
|
}, []);
|
|
3288
|
-
const close = (0,
|
|
3603
|
+
const close = (0, import_react7.useCallback)((reason) => {
|
|
3289
3604
|
if (closed.current) return;
|
|
3290
3605
|
closed.current = true;
|
|
3291
3606
|
stopMedia();
|
|
3292
3607
|
onClose(reason);
|
|
3293
3608
|
}, [onClose, stopMedia]);
|
|
3294
|
-
const showEnd = (0,
|
|
3609
|
+
const showEnd = (0, import_react7.useCallback)(() => {
|
|
3295
3610
|
if (closed.current || phaseRef.current === "end") return;
|
|
3296
3611
|
phaseRef.current = "end";
|
|
3297
3612
|
stopMedia();
|
|
3298
3613
|
setPhase("end");
|
|
3299
3614
|
}, [stopMedia]);
|
|
3300
|
-
const advance = (0,
|
|
3615
|
+
const advance = (0, import_react7.useCallback)(() => {
|
|
3301
3616
|
const now = performance.now();
|
|
3302
3617
|
if (now - lastInput.current < 250) return;
|
|
3303
3618
|
lastInput.current = now;
|
|
3304
3619
|
if (phaseRef.current === "intro") showEnd();
|
|
3305
3620
|
else close("enter");
|
|
3306
3621
|
}, [showEnd, close]);
|
|
3307
|
-
(0,
|
|
3622
|
+
(0, import_react7.useEffect)(() => {
|
|
3308
3623
|
closed.current = false;
|
|
3309
3624
|
const playerDialog = dialog.current;
|
|
3310
3625
|
const previous = document.activeElement;
|
|
@@ -3326,7 +3641,7 @@ function Player({ clip, settings, onClose, endOnly = false }) {
|
|
|
3326
3641
|
if (previous?.isConnected) previous.focus?.();
|
|
3327
3642
|
};
|
|
3328
3643
|
}, [advance]);
|
|
3329
|
-
(0,
|
|
3644
|
+
(0, import_react7.useEffect)(() => {
|
|
3330
3645
|
if (phase !== "intro") return;
|
|
3331
3646
|
if (clip.kind === "sequence") {
|
|
3332
3647
|
const timeout = setTimeout(showEnd, 12e4);
|
|
@@ -3350,7 +3665,7 @@ function Player({ clip, settings, onClose, endOnly = false }) {
|
|
|
3350
3665
|
playerVideo.load();
|
|
3351
3666
|
};
|
|
3352
3667
|
}, [phase, clip.kind, showEnd]);
|
|
3353
|
-
(0,
|
|
3668
|
+
(0, import_react7.useEffect)(() => {
|
|
3354
3669
|
if (phase !== "intro" || clip.kind === "sequence") return;
|
|
3355
3670
|
const el = video.current;
|
|
3356
3671
|
let alive = true;
|
|
@@ -3401,7 +3716,7 @@ function Player({ clip, settings, onClose, endOnly = false }) {
|
|
|
3401
3716
|
showEnd();
|
|
3402
3717
|
}
|
|
3403
3718
|
};
|
|
3404
|
-
return /* @__PURE__ */
|
|
3719
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
3405
3720
|
"dialog",
|
|
3406
3721
|
{
|
|
3407
3722
|
ref: dialog,
|
|
@@ -3418,7 +3733,7 @@ function Player({ clip, settings, onClose, endOnly = false }) {
|
|
|
3418
3733
|
if (!e.target.closest("[data-bs-control]")) advance();
|
|
3419
3734
|
}
|
|
3420
3735
|
},
|
|
3421
|
-
phase === "end" ? /* @__PURE__ */
|
|
3736
|
+
phase === "end" ? /* @__PURE__ */ import_react7.default.createElement(EndTitle, { settings }) : /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, clip.kind === "sequence" ? /* @__PURE__ */ import_react7.default.createElement(StartupSequence, { sound: settings.sound, volume: settings.volume, onEnded: showEnd }) : /* @__PURE__ */ import_react7.default.createElement(
|
|
3422
3737
|
"video",
|
|
3423
3738
|
{
|
|
3424
3739
|
"data-testid": "boot-video",
|
|
@@ -3432,39 +3747,32 @@ function Player({ clip, settings, onClose, endOnly = false }) {
|
|
|
3432
3747
|
onEnded: showEnd,
|
|
3433
3748
|
onError: showEnd
|
|
3434
3749
|
}
|
|
3435
|
-
), blocked && /* @__PURE__ */
|
|
3750
|
+
), blocked && /* @__PURE__ */ import_react7.default.createElement("button", { "data-bs-control": true, type: "button", className: "bs-play-manual", onClick: playManually }, "\u25B6 \u70B9\u51FB\u64AD\u653E"), mutedFallback && /* @__PURE__ */ import_react7.default.createElement("button", { "data-bs-control": true, type: "button", className: "bs-sound", onClick: enableSound }, "\u266A \u5F00\u542F\u58F0\u97F3"), /* @__PURE__ */ import_react7.default.createElement("p", { className: "bs-intro-prompt" }, "\u6309\u4EFB\u610F\u952E\u8DF3\u8FC7\u52A8\u753B"))
|
|
3436
3751
|
);
|
|
3437
3752
|
}
|
|
3438
3753
|
function Toggle({ label, description, checked, onChange, disabled }) {
|
|
3439
|
-
return /* @__PURE__ */
|
|
3754
|
+
return /* @__PURE__ */ import_react7.default.createElement("label", { className: "bs-toggle-row" }, /* @__PURE__ */ import_react7.default.createElement("span", null, /* @__PURE__ */ import_react7.default.createElement("strong", null, label), description && /* @__PURE__ */ import_react7.default.createElement("small", null, description)), /* @__PURE__ */ import_react7.default.createElement("input", { type: "checkbox", role: "switch", checked, onChange: (e) => onChange(e.target.checked), disabled }), /* @__PURE__ */ import_react7.default.createElement("span", { className: "bs-switch", "aria-hidden": "true" }));
|
|
3440
3755
|
}
|
|
3441
3756
|
function SettingsPanel({ standalone = false }) {
|
|
3442
3757
|
useStyles();
|
|
3443
|
-
const
|
|
3444
|
-
const [
|
|
3445
|
-
const [
|
|
3446
|
-
const [
|
|
3447
|
-
const [
|
|
3448
|
-
const [
|
|
3449
|
-
const [
|
|
3450
|
-
const [
|
|
3451
|
-
const [
|
|
3452
|
-
const [
|
|
3453
|
-
const
|
|
3454
|
-
const
|
|
3455
|
-
const
|
|
3456
|
-
const
|
|
3457
|
-
const
|
|
3458
|
-
|
|
3459
|
-
const probeCancel = (0, import_react5.useRef)(null);
|
|
3460
|
-
(0, import_react5.useEffect)(() => {
|
|
3758
|
+
const appearance = useEnchantAppearance();
|
|
3759
|
+
const [state, setState] = (0, import_react7.useState)(latestState);
|
|
3760
|
+
const [error, setError] = (0, import_react7.useState)("");
|
|
3761
|
+
const [notice, setNotice] = (0, import_react7.useState)("");
|
|
3762
|
+
const [busy, setBusy] = (0, import_react7.useState)(false);
|
|
3763
|
+
const [uploadPercent, setUploadPercent] = (0, import_react7.useState)(null);
|
|
3764
|
+
const [pendingDelete, setPendingDelete] = (0, import_react7.useState)(null);
|
|
3765
|
+
const [pendingImageDelete, setPendingImageDelete] = (0, import_react7.useState)(null);
|
|
3766
|
+
const [resetOpened, setResetOpened] = (0, import_react7.useState)(false);
|
|
3767
|
+
const [authorOpened, setAuthorOpened] = (0, import_react7.useState)(false);
|
|
3768
|
+
const input = (0, import_react7.useRef)(null);
|
|
3769
|
+
const imageInput = (0, import_react7.useRef)(null);
|
|
3770
|
+
const active = (0, import_react7.useRef)(true);
|
|
3771
|
+
const uploadRequest = (0, import_react7.useRef)(null);
|
|
3772
|
+
const probeCancel = (0, import_react7.useRef)(null);
|
|
3773
|
+
(0, import_react7.useEffect)(() => {
|
|
3461
3774
|
active.current = true;
|
|
3462
|
-
const update = (v) =>
|
|
3463
|
-
setState(v);
|
|
3464
|
-
setDraftVolume(Math.round(v.settings.volume * 100));
|
|
3465
|
-
setDraftBlur(v.settings.updatePromptBlur ?? 30);
|
|
3466
|
-
setDraftRadius(v.settings.updatePromptRadius ?? 30);
|
|
3467
|
-
};
|
|
3775
|
+
const update = (v) => setState(v);
|
|
3468
3776
|
subscribers.add(update);
|
|
3469
3777
|
api("/state").then(publish).catch((e) => setError(`\u8FDE\u63A5\u5931\u8D25\uFF1A${e.message}\u3002\u8BF7\u91CD\u542F Harness \u540E\u91CD\u8BD5\u3002`));
|
|
3470
3778
|
return () => {
|
|
@@ -3484,11 +3792,6 @@ function SettingsPanel({ standalone = false }) {
|
|
|
3484
3792
|
setNotice("\u8BBE\u7F6E\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u6B21\u542F\u52A8\u751F\u6548");
|
|
3485
3793
|
} catch (e) {
|
|
3486
3794
|
setError(e.message);
|
|
3487
|
-
if (state) {
|
|
3488
|
-
setDraftVolume(Math.round(state.settings.volume * 100));
|
|
3489
|
-
setDraftBlur(state.settings.updatePromptBlur ?? 30);
|
|
3490
|
-
setDraftRadius(state.settings.updatePromptRadius ?? 30);
|
|
3491
|
-
}
|
|
3492
3795
|
} finally {
|
|
3493
3796
|
if (active.current) setBusy(false);
|
|
3494
3797
|
}
|
|
@@ -3714,43 +4017,37 @@ function SettingsPanel({ standalone = false }) {
|
|
|
3714
4017
|
}
|
|
3715
4018
|
const settings = state?.settings;
|
|
3716
4019
|
const selected = state?.clips.find((c) => c.id === settings.selectedId) || state?.clips[0];
|
|
3717
|
-
return /* @__PURE__ */
|
|
4020
|
+
return /* @__PURE__ */ import_react7.default.createElement("section", { className: "bs-studio", "data-testid": "settings", ...appearance }, /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-heading" }, /* @__PURE__ */ import_react7.default.createElement("div", null, /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-eyebrow" }, "DSH LEWIS ENCHANT"), /* @__PURE__ */ import_react7.default.createElement("h1", null, "\u9644\u9B54\u53F0", /* @__PURE__ */ import_react7.default.createElement("span", null, "\u5F00\u673A\u52A8\u753B")), /* @__PURE__ */ import_react7.default.createElement("p", null, "\u81EA\u5B9A\u4E49\u4F60\u7684\u5F00\u573A\uFF0C\u5C01\u9762\u4E0E\u58F0\u97F3\u3002")), /* @__PURE__ */ import_react7.default.createElement("span", { className: "bs-version" }, "V", VERSION2)), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-toolbar" }, /* @__PURE__ */ import_react7.default.createElement("span", { className: "bs-status" }, /* @__PURE__ */ import_react7.default.createElement("i", null), settings ? settings.enabled ? "\u542F\u52A8\u65F6\u81EA\u52A8\u64AD\u653E" : "\u81EA\u52A8\u64AD\u653E\u5DF2\u5173\u95ED" : "\u6B63\u5728\u8FDE\u63A5\u2026"), /* @__PURE__ */ import_react7.default.createElement("button", { className: "bs-primary", type: "button", disabled: !selected || busy, onClick: () => preview(selected, settings) }, "\u25B6 \u9884\u89C8\u5F53\u524D\u52A8\u753B")), error && /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-alert", role: "alert" }, error, /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", onClick: () => {
|
|
3718
4021
|
setError("");
|
|
3719
4022
|
api("/state").then(publish).catch((e) => setError(e.message));
|
|
3720
|
-
} }, "\u91CD\u8BD5")), /* @__PURE__ */
|
|
4023
|
+
} }, "\u91CD\u8BD5")), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-notice", role: "status", "aria-live": "polite" }, busy ? uploadPercent !== null ? `\u6B63\u5728\u4E0A\u4F20 ${uploadPercent}%` : notice || "\u6B63\u5728\u4FDD\u5B58\u2026" : notice), settings && /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-section-title" }, /* @__PURE__ */ import_react7.default.createElement("h2", null, "\u52A8\u753B\u7247\u5E93")), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-library" }, state.clips.map((clip, index) => /* @__PURE__ */ import_react7.default.createElement("article", { key: clip.id, className: `bs-clip ${clip.id === settings.selectedId ? "is-selected" : ""}` }, /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", className: `bs-thumbnail bs-tone-${index % 4}`, "aria-label": `\u9884\u89C8 ${clip.name}`, onClick: () => preview(clip, settings), disabled: busy }, clip.kind === "sequence" ? /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-sequence-thumb" }, /* @__PURE__ */ import_react7.default.createElement("svg", { viewBox: "0 0 50 50", "aria-hidden": "true" }, /* @__PURE__ */ import_react7.default.createElement("path", { d: WHALE_PATH })), /* @__PURE__ */ import_react7.default.createElement("span", null, "DEEPSEEK"), /* @__PURE__ */ import_react7.default.createElement("small", null, "TECHNICAL DOSSIER")) : /* @__PURE__ */ import_react7.default.createElement("video", { src: clip.url + "#t=0.4", muted: true, playsInline: true, preload: "metadata", tabIndex: -1 }), /* @__PURE__ */ import_react7.default.createElement("span", { className: "bs-thumbnail-shade" }), /* @__PURE__ */ import_react7.default.createElement("span", { className: "bs-play-icon" }, "\u25B6"), /* @__PURE__ */ import_react7.default.createElement("span", { className: "bs-clip-number" }, String(index + 1).padStart(2, "0")), /* @__PURE__ */ import_react7.default.createElement("span", { className: "bs-badge" }, clip.kind === "sequence" ? "\u7A0B\u5E8F\u52A8\u753B" : clip.source === "builtin" ? "\u5185\u7F6E" : "\u6211\u7684\u89C6\u9891")), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-clip-info" }, /* @__PURE__ */ import_react7.default.createElement("h3", null, clip.name), /* @__PURE__ */ import_react7.default.createElement("span", null, clip.kind === "sequence" ? "\u539F\u7248\u89C6\u89C9\u5E8F\u5217" : (clip.bytes / 1048576).toFixed(1) + " MB")), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-clip-actions" }, /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", className: clip.id === settings.selectedId ? "bs-selected" : "", onClick: () => save({ selectedId: clip.id }), disabled: busy || clip.id === settings.selectedId }, clip.id === settings.selectedId ? "\u2713 \u5F53\u524D\u52A8\u753B" : "\u4F7F\u7528\u6B64\u52A8\u753B"), clip.source === "upload" && /* @__PURE__ */ import_react7.default.createElement("button", { className: "bs-delete", "aria-label": `\u5220\u9664 ${clip.name}`, disabled: busy, onClick: () => setPendingDelete(clip) }, "\u79FB\u9664")), pendingDelete?.id === clip.id && /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-delete-confirm" }, "\u79FB\u9664\u6B64\u89C6\u9891\uFF1F", /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", disabled: busy, onClick: () => remove(clip) }, "\u786E\u8BA4\u79FB\u9664"), /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", onClick: () => setPendingDelete(null) }, "\u53D6\u6D88")))), /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", className: "bs-upload", disabled: busy, onClick: () => input.current?.click(), onDragOver: (e) => e.preventDefault(), onDrop: (e) => {
|
|
3721
4024
|
e.preventDefault();
|
|
3722
4025
|
upload(e.dataTransfer.files?.[0]);
|
|
3723
|
-
} }, /* @__PURE__ */
|
|
4026
|
+
} }, /* @__PURE__ */ import_react7.default.createElement("span", null, "\uFF0B"), /* @__PURE__ */ import_react7.default.createElement("strong", null, "\u4E0A\u4F20\u6211\u7684\u89C6\u9891"), /* @__PURE__ */ import_react7.default.createElement("small", null, "\u70B9\u51FB\u9009\u62E9\uFF0C\u6216\u5C06\u89C6\u9891\u62D6\u5230\u8FD9\u91CC"), /* @__PURE__ */ import_react7.default.createElement("small", null, "MP4 / WebM / M4V \xB7 \u2264 200 MB"))), /* @__PURE__ */ import_react7.default.createElement("input", { ref: input, type: "file", accept: ".mp4,.m4v,.webm,video/mp4,video/webm", "aria-label": "\u4E0A\u4F20\u5F00\u673A\u89C6\u9891", hidden: true, onChange: (e) => {
|
|
3724
4027
|
upload(e.target.files?.[0]);
|
|
3725
4028
|
e.target.value = "";
|
|
3726
|
-
} }), /* @__PURE__ */
|
|
4029
|
+
} }), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-section-title" }, /* @__PURE__ */ import_react7.default.createElement("h2", null, "\u7ED3\u675F\u505C\u7559\u753B\u9762")), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-preferences bs-ending-settings" }, /* @__PURE__ */ import_react7.default.createElement("label", { className: "bs-field" }, /* @__PURE__ */ import_react7.default.createElement("span", null, "\u64AD\u653E\u7ED3\u675F\u540E"), /* @__PURE__ */ import_react7.default.createElement("select", { "aria-label": "\u7ED3\u675F\u753B\u9762\u7C7B\u578B", disabled: busy, value: settings.endScreen || "logo", onChange: (e) => {
|
|
3727
4030
|
if (e.target.value === "image" && !settings.endImageId) {
|
|
3728
4031
|
imageInput.current?.click();
|
|
3729
4032
|
return;
|
|
3730
4033
|
}
|
|
3731
4034
|
save({ endScreen: e.target.value });
|
|
3732
|
-
} }, /* @__PURE__ */
|
|
4035
|
+
} }, /* @__PURE__ */ import_react7.default.createElement("option", { value: "logo" }, "DeepSeek \u6807\u5FD7"), /* @__PURE__ */ import_react7.default.createElement("option", { value: "image" }, "\u6211\u7684\u56FE\u7247"))), !!state.logos?.length && /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-logo-options" }, state.logos.map((logo) => /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", key: logo.id, disabled: busy, className: settings.endScreen === "logo" && settings.logoVariant === logo.id ? "is-selected" : "", "aria-label": `\u4F7F\u7528\u5185\u7F6E\u7ED3\u675F\u753B\u9762 ${logo.name}`, onClick: () => save({ endScreen: "logo", logoVariant: logo.id }) }, /* @__PURE__ */ import_react7.default.createElement("img", { src: logo.url, alt: "" }), /* @__PURE__ */ import_react7.default.createElement("span", null, logo.name, settings.endScreen === "logo" && settings.logoVariant === logo.id ? " \u2713" : "")))), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-ending-preview" }, /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-ending-mini" }, /* @__PURE__ */ import_react7.default.createElement(EndTitle, { settings })), /* @__PURE__ */ import_react7.default.createElement("div", null, /* @__PURE__ */ import_react7.default.createElement("strong", null, settings.endScreen === "image" ? "\u6211\u7684\u56FE\u7247" : state.logos?.find((logo) => logo.id === settings.logoVariant)?.name || "DeepSeek \u6807\u5FD7"), /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", className: "bs-primary", disabled: busy, onClick: () => imageInput.current?.click() }, "\u4E0A\u4F20\u7ED3\u675F\u56FE\u7247"), /* @__PURE__ */ import_react7.default.createElement("small", null, "PNG / JPEG / WebP \xB7 \u2264 20 MB"))), settings.endScreen === "image" && /* @__PURE__ */ import_react7.default.createElement("label", { className: "bs-field" }, /* @__PURE__ */ import_react7.default.createElement("span", null, "\u7ED3\u675F\u56FE\u7247\u663E\u793A"), /* @__PURE__ */ import_react7.default.createElement("select", { "aria-label": "\u7ED3\u675F\u56FE\u7247\u663E\u793A", value: settings.endFit || "contain", disabled: busy, onChange: (e) => save({ endFit: e.target.value }) }, /* @__PURE__ */ import_react7.default.createElement("option", { value: "contain" }, "\u5B8C\u6574\u663E\u793A"), /* @__PURE__ */ import_react7.default.createElement("option", { value: "cover" }, "\u94FA\u6EE1\u7A97\u53E3"))), !!state.endImages?.length && /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-end-library" }, state.endImages.map((image) => /* @__PURE__ */ import_react7.default.createElement("div", { className: `bs-end-card ${settings.endScreen === "image" && settings.endImageId === image.id ? "is-selected" : ""}`, key: image.id }, /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", disabled: busy, "aria-label": `\u4F7F\u7528\u7ED3\u675F\u56FE\u7247 ${image.name}`, onClick: () => save({ endImageId: image.id, endScreen: "image" }) }, /* @__PURE__ */ import_react7.default.createElement("img", { src: image.url, alt: "" }), /* @__PURE__ */ import_react7.default.createElement("span", null, image.name)), pendingImageDelete === image.id ? /* @__PURE__ */ import_react7.default.createElement("span", null, /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", disabled: busy, onClick: () => removeEndImage(image) }, "\u786E\u8BA4\u79FB\u9664"), /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", onClick: () => setPendingImageDelete(null) }, "\u53D6\u6D88")) : /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", disabled: busy, className: "bs-delete", "aria-label": `\u79FB\u9664\u7ED3\u675F\u56FE\u7247 ${image.name}`, onClick: () => setPendingImageDelete(image.id) }, "\u79FB\u9664"))))), /* @__PURE__ */ import_react7.default.createElement("input", { ref: imageInput, type: "file", accept: ".png,.jpg,.jpeg,.webp,image/png,image/jpeg,image/webp", "aria-label": "\u4E0A\u4F20\u7ED3\u675F\u56FE\u7247", hidden: true, onChange: (e) => {
|
|
3733
4036
|
uploadEndImage(e.target.files?.[0]);
|
|
3734
4037
|
e.target.value = "";
|
|
3735
|
-
} }), /* @__PURE__ */
|
|
3736
|
-
if (["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) save({ volume: draftVolume / 100 });
|
|
3737
|
-
} }), /* @__PURE__ */ import_react5.default.createElement("output", null, draftVolume, "%")), /* @__PURE__ */ import_react5.default.createElement(Toggle, { label: "\u968F\u673A\u5F00\u573A", description: "\u6BCF\u6B21\u542F\u52A8\u4ECE\u7247\u5E93\u968F\u673A\u9009\u62E9\uFF1B\u5173\u95ED\u540E\u4F7F\u7528\u5F53\u524D\u52A8\u753B", checked: settings.shuffle, disabled: busy, onChange: (shuffle) => save({ shuffle }) })), /* @__PURE__ */ import_react5.default.createElement("div", { className: "bs-help" }, /* @__PURE__ */ import_react5.default.createElement("strong", null, "\u50CF\u6E38\u620F\u4E00\u6837\u5F00\u542F\u3002"), /* @__PURE__ */ import_react5.default.createElement("p", null, "\u52A8\u753B\u4E2D\u6309\u4EFB\u610F\u952E\u8DF3\u5230\u6807\u9898\u9875\uFF0C\u518D\u6309\u4EFB\u610F\u952E\u8FDB\u5165\u3002\u4E5F\u652F\u6301\u9F20\u6807\u70B9\u51FB\u4E0E\u89E6\u5C4F\uFF1B\u957F\u6309\u4E0D\u4F1A\u8FDE\u8DF3\u3002\u89C6\u9891\u548C\u7ED3\u675F\u56FE\u7247\u90FD\u4FDD\u5B58\u5728\u672C\u673A\u3002"), /* @__PURE__ */ import_react5.default.createElement("span", null, "\u89C6\u9891\uFF1Adsh-boot-animation \xB7 BSD-3-Clause\u3000\u6280\u672F\u6863\u6848\uFF1Adsh-startup-screen \xB7 MIT")), /* @__PURE__ */ import_react5.default.createElement(UpdatePanel, { request: api, standalone }), /* @__PURE__ */ import_react5.default.createElement("div", { className: "bs-section-title" }, /* @__PURE__ */ import_react5.default.createElement("h2", null, "\u66F4\u65B0\u63D0\u9192\u5916\u89C2"), /* @__PURE__ */ import_react5.default.createElement("button", { className: "bs-text-button", type: "button", onClick: () => setAppearancePreview(true) }, "\u9884\u89C8\u66F4\u65B0\u63D0\u9192")), /* @__PURE__ */ import_react5.default.createElement("div", { className: "bs-preferences" }, /* @__PURE__ */ import_react5.default.createElement("label", { className: "bs-field" }, /* @__PURE__ */ import_react5.default.createElement("span", null, "\u78E8\u7802\u5EA6", /* @__PURE__ */ import_react5.default.createElement("small", null, "\u8C03\u6574\u66F4\u65B0\u5F39\u7A97\u7684\u80CC\u666F\u6A21\u7CCA\u7A0B\u5EA6")), /* @__PURE__ */ import_react5.default.createElement("input", { "aria-label": "\u66F4\u65B0\u5F39\u7A97\u78E8\u7802\u5EA6", type: "range", min: "0", max: "48", step: "1", value: draftBlur, disabled: busy, onChange: (e) => setDraftBlur(Number(e.target.value)), onPointerUp: (e) => save({ updatePromptBlur: Number(e.currentTarget.value) }), onKeyUp: (e) => {
|
|
3738
|
-
if (["ArrowLeft", "ArrowRight", "Home", "End", "PageUp", "PageDown"].includes(e.key)) save({ updatePromptBlur: Number(e.currentTarget.value) });
|
|
3739
|
-
} }), /* @__PURE__ */ import_react5.default.createElement("output", null, draftBlur, "px")), /* @__PURE__ */ import_react5.default.createElement("label", { className: "bs-field" }, /* @__PURE__ */ import_react5.default.createElement("span", null, "\u5F39\u7A97\u5706\u89D2", /* @__PURE__ */ import_react5.default.createElement("small", null, "\u8C03\u6574\u66F4\u65B0\u5F39\u7A97\u8FB9\u89D2\u7684\u5706\u6DA6\u7A0B\u5EA6")), /* @__PURE__ */ import_react5.default.createElement("input", { "aria-label": "\u66F4\u65B0\u5F39\u7A97\u5706\u89D2", type: "range", min: "12", max: "40", step: "1", value: draftRadius, disabled: busy, onChange: (e) => setDraftRadius(Number(e.target.value)), onPointerUp: (e) => save({ updatePromptRadius: Number(e.currentTarget.value) }), onKeyUp: (e) => {
|
|
3740
|
-
if (["ArrowLeft", "ArrowRight", "Home", "End", "PageUp", "PageDown"].includes(e.key)) save({ updatePromptRadius: Number(e.currentTarget.value) });
|
|
3741
|
-
} }), /* @__PURE__ */ import_react5.default.createElement("output", null, draftRadius, "px"))), /* @__PURE__ */ import_react5.default.createElement("div", { className: "bs-section-title bs-entry-title" }, /* @__PURE__ */ import_react5.default.createElement("h2", null, "\u8FDB\u5165\u65B9\u5F0F")), /* @__PURE__ */ import_react5.default.createElement("div", { className: "bs-preferences" }, /* @__PURE__ */ import_react5.default.createElement(Toggle, { label: "\u663E\u793A\u4FA7\u680F\u5FEB\u6377\u5165\u53E3", description: "\u5728\u5934\u50CF\u4E0A\u65B9\u663E\u793A\u201C\u5F00\u673A\u52A8\u753B\u201D\uFF1B\u5173\u95ED\u540E\u4ECD\u53EF\u4ECE\u8BBE\u7F6E\u8FDB\u5165\u3002\u9644\u9B54\u53F0\u7CFB\u5217\u6700\u591A\u663E\u793A17\u4E2A\u5FEB\u6377\u5165\u53E3\u3002", checked: settings.showShortcut ?? false, disabled: busy, onChange: (showShortcut) => save({ showShortcut }) })), appearancePreview && /* @__PURE__ */ import_react5.default.createElement(UpdatePrompt, { request: api, status: { currentVersion: VERSION2 }, settings: { ...settings, updatePromptBlur: draftBlur, updatePromptRadius: draftRadius }, preview: true, onDismiss: () => setAppearancePreview(false) }), /* @__PURE__ */ import_react5.default.createElement("div", { className: "bs-reset-area" }, /* @__PURE__ */ import_react5.default.createElement("div", null, /* @__PURE__ */ import_react5.default.createElement("strong", null, "\u6062\u590D\u9ED8\u8BA4"), /* @__PURE__ */ import_react5.default.createElement("p", null, "\u91CD\u7F6E\u6240\u6709\u8BBE\u7F6E\uFF0C\u6C38\u4E45\u5220\u9664\u5168\u90E8\u4E0A\u4F20\u7684\u89C6\u9891\u548C\u56FE\u7247\uFF0C\u4EC5\u4FDD\u7559\u5185\u7F6E\u7D20\u6750\u3002")), /* @__PURE__ */ import_react5.default.createElement("button", { className: "bs-reset-open", type: "button", disabled: busy, onClick: () => setResetOpened(true) }, "\u6062\u590D\u9ED8\u8BA4")), resetOpened && /* @__PURE__ */ import_react5.default.createElement(ResetDialog, { settings, onCancel: () => setResetOpened(false), onConfirm: restoreDefaults })), !state && !error && /* @__PURE__ */ import_react5.default.createElement("div", { className: "bs-loading" }, "\u6B63\u5728\u52A0\u8F7D\u7247\u5E93\u2026"));
|
|
4038
|
+
} }), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-section-title" }, /* @__PURE__ */ import_react7.default.createElement("h2", null, "\u64AD\u653E\u504F\u597D")), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-preferences" }, /* @__PURE__ */ import_react7.default.createElement(Toggle, { label: "\u542F\u52A8\u65F6\u64AD\u653E", checked: settings.enabled, disabled: busy, onChange: (enabled) => save({ enabled }) }), /* @__PURE__ */ import_react7.default.createElement(Toggle, { label: "\u64AD\u653E\u58F0\u97F3", checked: settings.sound, disabled: busy, onChange: (sound) => save({ sound }) }), /* @__PURE__ */ import_react7.default.createElement(Toggle, { label: "\u968F\u673A\u5F00\u573A", checked: settings.shuffle, disabled: busy, onChange: (shuffle) => save({ shuffle }) })), /* @__PURE__ */ import_react7.default.createElement(UpdatePanel, { request: api, standalone }), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-section-title bs-entry-title" }, /* @__PURE__ */ import_react7.default.createElement("h2", null, "\u8FDB\u5165\u65B9\u5F0F")), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-preferences" }, /* @__PURE__ */ import_react7.default.createElement(Toggle, { label: "\u663E\u793A\u4FA7\u680F\u5FEB\u6377\u5165\u53E3", description: "\u5728\u5934\u50CF\u4E0A\u65B9\u663E\u793A\u201C\u5F00\u673A\u52A8\u753B\u201D\uFF1B\u5173\u95ED\u540E\u4ECD\u53EF\u4ECE\u8BBE\u7F6E\u8FDB\u5165\u3002\u9644\u9B54\u53F0\u7CFB\u5217\u6700\u591A\u663E\u793A17\u4E2A\u5FEB\u6377\u5165\u53E3\u3002", checked: settings.showShortcut ?? false, disabled: busy, onChange: (showShortcut) => save({ showShortcut }) })), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-reset-area" }, /* @__PURE__ */ import_react7.default.createElement("div", null, /* @__PURE__ */ import_react7.default.createElement("strong", null, "\u6062\u590D\u9ED8\u8BA4"), /* @__PURE__ */ import_react7.default.createElement("p", null, "\u91CD\u7F6E\u6240\u6709\u8BBE\u7F6E\uFF0C\u6C38\u4E45\u5220\u9664\u5168\u90E8\u4E0A\u4F20\u7684\u89C6\u9891\u548C\u56FE\u7247\uFF0C\u4EC5\u4FDD\u7559\u5185\u7F6E\u7D20\u6750\u3002")), /* @__PURE__ */ import_react7.default.createElement("button", { className: "bs-reset-open", type: "button", disabled: busy, onClick: () => setResetOpened(true) }, "\u6062\u590D\u9ED8\u8BA4")), resetOpened && /* @__PURE__ */ import_react7.default.createElement(ResetDialog, { settings, onCancel: () => setResetOpened(false), onConfirm: restoreDefaults }), /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-author-entry" }, /* @__PURE__ */ import_react7.default.createElement("span", null, "\u70B9\u51FB\u4E86\u89E3\u66F4\u591A\u4F5C\u8005\u4FE1\u606F"), /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", "aria-label": "\u67E5\u770B\u4F5C\u8005\u4FE1\u606F", onClick: () => setAuthorOpened(true) }, "\u67E5\u770B", /* @__PURE__ */ import_react7.default.createElement("span", { "aria-hidden": "true" }, "\u2197"))), authorOpened && /* @__PURE__ */ import_react7.default.createElement(AuthorDialog, { settings, onClose: () => setAuthorOpened(false) })), !state && !error && /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-loading" }, "\u6B63\u5728\u52A0\u8F7D\u7247\u5E93\u2026"));
|
|
3742
4039
|
}
|
|
3743
4040
|
function BootRoot() {
|
|
3744
4041
|
useStyles();
|
|
3745
|
-
const [play, setPlay] = (0,
|
|
3746
|
-
const [opened, setOpened] = (0,
|
|
3747
|
-
const [message, setMessage] = (0,
|
|
3748
|
-
const [launchSettled, setLaunchSettled] = (0,
|
|
3749
|
-
const [launchState, setLaunchState] = (0,
|
|
3750
|
-
const [updateSnapshot, setUpdateSnapshot] = (0,
|
|
3751
|
-
const [offerUpdate, setOfferUpdate] = (0,
|
|
3752
|
-
const trigger = (0,
|
|
3753
|
-
(0,
|
|
4042
|
+
const [play, setPlay] = (0, import_react7.useState)(null);
|
|
4043
|
+
const [opened, setOpened] = (0, import_react7.useState)(false);
|
|
4044
|
+
const [message, setMessage] = (0, import_react7.useState)("");
|
|
4045
|
+
const [launchSettled, setLaunchSettled] = (0, import_react7.useState)(launchDecisionSettled);
|
|
4046
|
+
const [launchState, setLaunchState] = (0, import_react7.useState)(latestState);
|
|
4047
|
+
const [updateSnapshot, setUpdateSnapshot] = (0, import_react7.useState)(() => startupUpdateSession.getSnapshot());
|
|
4048
|
+
const [offerUpdate, setOfferUpdate] = (0, import_react7.useState)(false);
|
|
4049
|
+
const trigger = (0, import_react7.useCallback)((value) => setPlay({ ...value, key: Date.now() }), []);
|
|
4050
|
+
(0, import_react7.useEffect)(() => {
|
|
3754
4051
|
const playEvent = (e) => trigger(e.detail);
|
|
3755
4052
|
const open = () => setOpened(true);
|
|
3756
4053
|
window.addEventListener(PLAY, playEvent);
|
|
@@ -3760,7 +4057,7 @@ function BootRoot() {
|
|
|
3760
4057
|
window.removeEventListener(OPEN, open);
|
|
3761
4058
|
};
|
|
3762
4059
|
}, [trigger]);
|
|
3763
|
-
(0,
|
|
4060
|
+
(0, import_react7.useEffect)(() => {
|
|
3764
4061
|
const stateChanged = (value) => setLaunchState(value);
|
|
3765
4062
|
subscribers.add(stateChanged);
|
|
3766
4063
|
const unsubscribe = startupUpdateSession.subscribe(setUpdateSnapshot);
|
|
@@ -3771,7 +4068,7 @@ function BootRoot() {
|
|
|
3771
4068
|
unsubscribe();
|
|
3772
4069
|
};
|
|
3773
4070
|
}, []);
|
|
3774
|
-
(0,
|
|
4071
|
+
(0, import_react7.useEffect)(() => {
|
|
3775
4072
|
if (bootClaimed) {
|
|
3776
4073
|
setLaunchSettled(true);
|
|
3777
4074
|
return;
|
|
@@ -3799,7 +4096,7 @@ function BootRoot() {
|
|
|
3799
4096
|
alive = false;
|
|
3800
4097
|
};
|
|
3801
4098
|
}, [trigger]);
|
|
3802
|
-
(0,
|
|
4099
|
+
(0, import_react7.useEffect)(() => {
|
|
3803
4100
|
setOfferUpdate(false);
|
|
3804
4101
|
if (!launchSettled || play || opened || updateSnapshot.dismissed || !isAvailableUpdate(updateSnapshot.status)) return;
|
|
3805
4102
|
let timer = null;
|
|
@@ -3831,14 +4128,14 @@ function BootRoot() {
|
|
|
3831
4128
|
observer?.disconnect();
|
|
3832
4129
|
};
|
|
3833
4130
|
}, [launchSettled, play, opened, updateSnapshot]);
|
|
3834
|
-
const onClose = (0,
|
|
4131
|
+
const onClose = (0, import_react7.useCallback)((reason) => {
|
|
3835
4132
|
setPlay(null);
|
|
3836
4133
|
if (["media-error", "load-error", "play-error", "timeout"].includes(reason)) {
|
|
3837
4134
|
setMessage("\u52A8\u753B\u672A\u80FD\u64AD\u653E\uFF0C\u5DF2\u4E3A\u4F60\u8FDB\u5165 Harness\u3002\u53EF\u5728\u8BBE\u7F6E\u4E2D\u66F4\u6362\u89C6\u9891\u3002");
|
|
3838
4135
|
setTimeout(() => setMessage(""), 6500);
|
|
3839
4136
|
}
|
|
3840
4137
|
}, []);
|
|
3841
|
-
(0,
|
|
4138
|
+
(0, import_react7.useEffect)(() => {
|
|
3842
4139
|
if (!opened) return;
|
|
3843
4140
|
const key = (e) => {
|
|
3844
4141
|
if (e.key === "Escape" && !play && !document.querySelector("dialog[open]")) setOpened(false);
|
|
@@ -3846,16 +4143,16 @@ function BootRoot() {
|
|
|
3846
4143
|
window.addEventListener("keydown", key);
|
|
3847
4144
|
return () => window.removeEventListener("keydown", key);
|
|
3848
4145
|
}, [opened, play]);
|
|
3849
|
-
return /* @__PURE__ */
|
|
4146
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, opened && /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-modal", onClick: (e) => {
|
|
3850
4147
|
if (e.target === e.currentTarget) setOpened(false);
|
|
3851
|
-
} }, /* @__PURE__ */
|
|
4148
|
+
} }, /* @__PURE__ */ import_react7.default.createElement("div", { role: "dialog", "aria-modal": "true", "aria-label": "\u5F00\u673A\u52A8\u753B\u8BBE\u7F6E", className: "bs-modal-body" }, /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", className: "bs-modal-close", onClick: () => setOpened(false) }, "\u5173\u95ED \xD7"), /* @__PURE__ */ import_react7.default.createElement(SettingsPanel, null))), play && /* @__PURE__ */ import_react7.default.createElement(Player, { key: play.key, clip: play.clip, settings: play.settings, endOnly: play.endOnly, onClose }), offerUpdate && !play && !opened && !updateSnapshot.dismissed && isAvailableUpdate(updateSnapshot.status) && /* @__PURE__ */ import_react7.default.createElement(UpdatePrompt, { request: api, status: updateSnapshot.status, settings: launchState?.settings, onDismiss: () => startupUpdateSession.dismiss(), onUpdated: (version) => startupUpdateSession.updated(version) }), message && /* @__PURE__ */ import_react7.default.createElement("div", { className: "bs-toast", role: "status" }, message));
|
|
3852
4149
|
}
|
|
3853
4150
|
function ShortcutAction() {
|
|
3854
|
-
const [state, setState] = (0,
|
|
4151
|
+
const [state, setState] = (0, import_react7.useState)(latestState);
|
|
3855
4152
|
const registry = getShortcutRegistry();
|
|
3856
|
-
const [budget, setBudget] = (0,
|
|
4153
|
+
const [budget, setBudget] = (0, import_react7.useState)(() => registry.getSnapshot());
|
|
3857
4154
|
const enabled = state?.settings.showShortcut === true;
|
|
3858
|
-
(0,
|
|
4155
|
+
(0, import_react7.useEffect)(() => {
|
|
3859
4156
|
const changed = (value) => setState(value);
|
|
3860
4157
|
subscribers.add(changed);
|
|
3861
4158
|
if (latestState) setState(latestState);
|
|
@@ -3863,25 +4160,33 @@ function ShortcutAction() {
|
|
|
3863
4160
|
});
|
|
3864
4161
|
return () => subscribers.delete(changed);
|
|
3865
4162
|
}, []);
|
|
3866
|
-
(0,
|
|
3867
|
-
(0,
|
|
4163
|
+
(0, import_react7.useEffect)(() => registry.subscribe(() => setBudget(registry.getSnapshot())), [registry]);
|
|
4164
|
+
(0, import_react7.useEffect)(() => {
|
|
3868
4165
|
if (!enabled) return;
|
|
3869
4166
|
return registry.acquire("dsh-openup-lewis");
|
|
3870
4167
|
}, [enabled, registry]);
|
|
3871
4168
|
if (!enabled || !budget.visibleIds.includes("dsh-openup-lewis")) return null;
|
|
3872
|
-
return /* @__PURE__ */
|
|
4169
|
+
return /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", title: "\u5F00\u673A\u52A8\u753B", "aria-label": "\u5F00\u673A\u52A8\u753B", onClick: openSettings, style: { border: 0, background: "transparent", color: "inherit", cursor: "pointer", padding: 8 } }, "\u25B7");
|
|
3873
4170
|
}
|
|
3874
4171
|
function apply(ctx) {
|
|
3875
4172
|
const wire = (ready) => {
|
|
3876
4173
|
const register = () => {
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
4174
|
+
const registry = getEnchantRegistry();
|
|
4175
|
+
const unregister = registry.registerPlugin({ id: "dsh-openup-lewis", name: "\u5F00\u673A\u52A8\u753B", sectionId: "dsh-boot-studio-settings", renderSettings: () => import_react7.default.createElement(SettingsPanel), openSettings: () => window.dispatchEvent(new Event(OPEN)) });
|
|
4176
|
+
try {
|
|
4177
|
+
ready.slots.inject("shell.overlay", () => ready.slots.register({ name: "shell.overlay", id: "dsh-boot-studio-overlay", order: 950 }, () => import_react7.default.createElement(BootRoot)));
|
|
4178
|
+
ready.slots.inject("settings.section", () => bindSettingsEntry({ slots: ready.slots, registry, pluginId: "dsh-openup-lewis", register: () => ready.slots.register({ name: "settings.section", id: "dsh-boot-studio-settings", order: 80, label: () => "\u5F00\u673A\u52A8\u753B" }, () => import_react7.default.createElement(SettingsPanel)) }));
|
|
4179
|
+
ready.slots.inject("sidebar.footer.action", () => ready.slots.register({ name: "sidebar.footer.action", id: "dsh-boot-studio-shortcut", order: 42, label: () => "\u5F00\u673A\u52A8\u753B" }, () => import_react7.default.createElement(ShortcutAction)));
|
|
4180
|
+
return unregister;
|
|
4181
|
+
} catch (error) {
|
|
4182
|
+
unregister();
|
|
4183
|
+
throw error;
|
|
4184
|
+
}
|
|
3880
4185
|
};
|
|
3881
|
-
if (typeof ready.effect === "function") ready.effect(register, "dsh-boot-studio: slots");
|
|
3882
|
-
else register();
|
|
4186
|
+
if (typeof ready.effect === "function") return ready.effect(register, "dsh-boot-studio: slots");
|
|
4187
|
+
else return register();
|
|
3883
4188
|
};
|
|
3884
|
-
if (typeof ctx.inject === "function") ctx.inject(["slots"], wire);
|
|
3885
|
-
else if (ctx.slots) wire(ctx);
|
|
4189
|
+
if (typeof ctx.inject === "function") return ctx.inject(["slots"], wire);
|
|
4190
|
+
else if (ctx.slots) return wire(ctx);
|
|
3886
4191
|
}
|
|
3887
4192
|
return module.exports; } });
|