@ash-qw/dsh-theme-prts 0.1.101 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.en.md +4 -3
- package/README.md +4 -3
- package/lib/client.js +35 -30
- package/package.json +2 -2
- package/src/client/assistant-glass-adapter.js +3 -2
- package/src/client/operations-shell-v2.js +5 -2
- package/src/client/sidebar-control-adapter.js +6 -1
- package/src/client/theme-controller-v2.js +20 -24
- package/src/styles/prts.css +19 -11
- package/src/styles/refinement.css +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ash-qw/dsh-theme-prts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Unofficial Arknights P.R.T.S.-inspired UI theme for DeepSeek Harness Web",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
70
70
|
"node": ">=18",
|
|
71
|
-
"dsh": "
|
|
71
|
+
"dsh": "0.1.7-rc.2"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@playwright/test": "1.55.1",
|
|
@@ -175,7 +175,8 @@ export function createAssistantGlassAdapter({ document, window, avatarImage = ''
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
function processStep(step) {
|
|
178
|
-
if (!step?.isConnected || !step.matches?.(STEP_SELECTOR)
|
|
178
|
+
if (!step?.isConnected || !step.matches?.(STEP_SELECTOR)
|
|
179
|
+
|| step.getAttribute('data-chat-group-part') === 'reasoning') {
|
|
179
180
|
releaseStep(step)
|
|
180
181
|
return
|
|
181
182
|
}
|
|
@@ -263,7 +264,7 @@ export function createAssistantGlassAdapter({ document, window, avatarImage = ''
|
|
|
263
264
|
subtree: true,
|
|
264
265
|
childList: true,
|
|
265
266
|
attributes: true,
|
|
266
|
-
attributeFilter: ['class', 'data-chat-flow-kind', 'data-markdown', 'data-slot'],
|
|
267
|
+
attributeFilter: ['class', 'data-chat-flow-kind', 'data-chat-group-part', 'data-markdown', 'data-slot'],
|
|
267
268
|
})
|
|
268
269
|
},
|
|
269
270
|
dispose() {
|
|
@@ -227,10 +227,12 @@ export function createOperationsShell({
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
function toggleScheme(event) {
|
|
230
|
-
if (suppressSchemeClick) {
|
|
230
|
+
if (suppressSchemeClick && Number(event?.detail) > 0) {
|
|
231
231
|
event?.preventDefault?.()
|
|
232
|
+
clearSchemeClickSuppression()
|
|
232
233
|
return
|
|
233
234
|
}
|
|
235
|
+
clearSchemeClickSuppression()
|
|
234
236
|
const next = schemeTarget()
|
|
235
237
|
schemeIntent = next
|
|
236
238
|
playSchemePress()
|
|
@@ -258,7 +260,7 @@ export function createOperationsShell({
|
|
|
258
260
|
suppressSchemeClickTimer = window.setTimeout(() => {
|
|
259
261
|
suppressSchemeClickTimer = undefined
|
|
260
262
|
suppressSchemeClick = false
|
|
261
|
-
},
|
|
263
|
+
}, 1000)
|
|
262
264
|
}
|
|
263
265
|
|
|
264
266
|
function settleSchemePointer({ commit = false } = {}) {
|
|
@@ -277,6 +279,7 @@ export function createOperationsShell({
|
|
|
277
279
|
|
|
278
280
|
function onSchemePointerDown(event) {
|
|
279
281
|
if ((event.button ?? 0) !== 0 || schemePointer) return
|
|
282
|
+
clearSchemeClickSuppression()
|
|
280
283
|
const pointerId = event.pointerId ?? 1
|
|
281
284
|
schemePointer = {
|
|
282
285
|
pointerId,
|
|
@@ -13,6 +13,7 @@ const OWNED_ATTRIBUTES = [
|
|
|
13
13
|
'data-prts-workspace-create',
|
|
14
14
|
'data-prts-session-row',
|
|
15
15
|
'data-prts-session-actions',
|
|
16
|
+
'data-prts-session-quick-actions',
|
|
16
17
|
'data-prts-session-menu-anchor',
|
|
17
18
|
'data-prts-session-menu',
|
|
18
19
|
'data-prts-session-time',
|
|
@@ -90,7 +91,10 @@ function resolveRowControls(row, kind) {
|
|
|
90
91
|
const create = kind === 'workspace'
|
|
91
92
|
? actions.querySelector(':scope > button[type="button"]')
|
|
92
93
|
: undefined
|
|
93
|
-
|
|
94
|
+
const quickActions = kind === 'session'
|
|
95
|
+
? Array.from(actions.children).filter(child => child !== anchor && child.querySelector('button'))
|
|
96
|
+
: []
|
|
97
|
+
return { actions, anchor, create, menu, quickActions }
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
function resolveRowTitle(row, kind, actions) {
|
|
@@ -418,6 +422,7 @@ export function createSidebarControlAdapter({ document, window, sessions, worksp
|
|
|
418
422
|
row.toggleAttribute('data-prts-row-menu-open', controls.menu?.getAttribute('aria-expanded') === 'true'
|
|
419
423
|
|| row.classList.contains('menuOpen'))
|
|
420
424
|
markSidebarNode(controls.actions, 'data-prts-session-actions', next)
|
|
425
|
+
for (const action of controls.quickActions ?? []) markSidebarNode(action, 'data-prts-session-quick-actions', next)
|
|
421
426
|
markSidebarNode(controls.anchor, 'data-prts-session-menu-anchor', next)
|
|
422
427
|
markSidebarNode(controls.menu, 'data-prts-session-menu', next)
|
|
423
428
|
registerVector(controls.menu, { kind: 'button' }, next, nextVectorOwners)
|
|
@@ -475,7 +475,6 @@ export function createThemeController({ document, window, cssText, service, onTr
|
|
|
475
475
|
session.restorePromise = Promise.resolve(session.hostRequest).then(async accepted => {
|
|
476
476
|
if (accepted && !(await requestHostScheme(session.source))) return false
|
|
477
477
|
applyScheme(session.source)
|
|
478
|
-
session.hostAccepted = false
|
|
479
478
|
return true
|
|
480
479
|
})
|
|
481
480
|
return session.restorePromise
|
|
@@ -503,7 +502,7 @@ export function createThemeController({ document, window, cssText, service, onTr
|
|
|
503
502
|
const initialProgress = interactive ? revealProgress(options.progress) : 0
|
|
504
503
|
const duration = revealDuration(geometry.width)
|
|
505
504
|
const token = ++transitionRevision
|
|
506
|
-
let
|
|
505
|
+
let resolveUpdateReady
|
|
507
506
|
const session = {
|
|
508
507
|
token,
|
|
509
508
|
target,
|
|
@@ -515,8 +514,7 @@ export function createThemeController({ document, window, cssText, service, onTr
|
|
|
515
514
|
duration,
|
|
516
515
|
settled: false,
|
|
517
516
|
committed: false,
|
|
518
|
-
|
|
519
|
-
hostReady: new Promise(resolve => { resolveHostReady = resolve }),
|
|
517
|
+
updateReady: new Promise(resolve => { resolveUpdateReady = resolve }),
|
|
520
518
|
}
|
|
521
519
|
root.style.setProperty('--prts-scheme-origin-x', `${geometry.x}px`)
|
|
522
520
|
root.style.setProperty('--prts-scheme-origin-y', `${geometry.y}px`)
|
|
@@ -540,26 +538,19 @@ export function createThemeController({ document, window, cssText, service, onTr
|
|
|
540
538
|
|
|
541
539
|
let viewTransition
|
|
542
540
|
try {
|
|
543
|
-
viewTransition = document.startViewTransition(
|
|
544
|
-
session.hostRequest = requestHostScheme(target)
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
return
|
|
551
|
-
}
|
|
552
|
-
if (session.settled || session.restoreRequested) {
|
|
553
|
-
await restoreRevealSource(session)
|
|
554
|
-
resolveHostReady(false)
|
|
555
|
-
return
|
|
556
|
-
}
|
|
541
|
+
viewTransition = document.startViewTransition(() => {
|
|
542
|
+
session.hostRequest = requestHostScheme(target).then(accepted => {
|
|
543
|
+
if (!accepted && activeTransition?.token === token && !session.settled) {
|
|
544
|
+
finishRevealSession(session, { commit: false })
|
|
545
|
+
}
|
|
546
|
+
return accepted
|
|
547
|
+
})
|
|
557
548
|
applyScheme(target)
|
|
558
549
|
mountRevealHud(session)
|
|
559
|
-
|
|
550
|
+
resolveUpdateReady(true)
|
|
560
551
|
})
|
|
561
552
|
} catch {
|
|
562
|
-
|
|
553
|
+
resolveUpdateReady(false)
|
|
563
554
|
if (activeTransition?.token === token) activeTransition = undefined
|
|
564
555
|
removeRevealHud(session)
|
|
565
556
|
clearTransitionState()
|
|
@@ -570,9 +561,9 @@ export function createThemeController({ document, window, cssText, service, onTr
|
|
|
570
561
|
session.viewTransition = viewTransition
|
|
571
562
|
session.ready = Promise.all([
|
|
572
563
|
Promise.resolve(viewTransition?.ready).then(() => true, () => false),
|
|
573
|
-
session.
|
|
574
|
-
]).then(([viewReady,
|
|
575
|
-
const ready = viewReady &&
|
|
564
|
+
session.updateReady,
|
|
565
|
+
]).then(([viewReady, updateReady]) => {
|
|
566
|
+
const ready = viewReady && updateReady
|
|
576
567
|
if (ready && activeTransition?.token === token && !session.settled) {
|
|
577
568
|
createInteractiveScrub(session)
|
|
578
569
|
}
|
|
@@ -591,6 +582,11 @@ export function createThemeController({ document, window, cssText, service, onTr
|
|
|
591
582
|
}
|
|
592
583
|
if (activeTransition?.token !== session.token || session.settled) return root.dataset.prtsScheme
|
|
593
584
|
await animateRevealTo(session, 1, session.duration, 'cubic-bezier(.4, 0, .2, 1)')
|
|
585
|
+
if (!(await session.hostRequest)) {
|
|
586
|
+
if (!session.settled) finishRevealSession(session, { commit: false })
|
|
587
|
+
return session.source
|
|
588
|
+
}
|
|
589
|
+
if (activeTransition?.token !== session.token || session.settled) return root.dataset.prtsScheme
|
|
594
590
|
await releaseRevealHud(session)
|
|
595
591
|
if (activeTransition?.token === session.token && !session.settled) finishRevealSession(session, { commit: true })
|
|
596
592
|
return target
|
|
@@ -652,7 +648,7 @@ export function createThemeController({ document, window, cssText, service, onTr
|
|
|
652
648
|
}
|
|
653
649
|
|
|
654
650
|
finishPromise = visual.then(async () => {
|
|
655
|
-
if (!session.
|
|
651
|
+
if (!(await session.hostRequest)) {
|
|
656
652
|
if (!session.settled) finishRevealSession(session, { commit: false })
|
|
657
653
|
refresh()
|
|
658
654
|
return root.dataset.prtsScheme
|
package/src/styles/prts.css
CHANGED
|
@@ -1010,7 +1010,15 @@ html[data-dsh-prts] [data-prts-workspace-actions] {
|
|
|
1010
1010
|
}
|
|
1011
1011
|
|
|
1012
1012
|
html[data-dsh-prts] [data-prts-session-actions] {
|
|
1013
|
-
|
|
1013
|
+
position: relative;
|
|
1014
|
+
inset: auto;
|
|
1015
|
+
width: auto;
|
|
1016
|
+
flex: 0 0 auto;
|
|
1017
|
+
margin-left: auto !important;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
html[data-dsh-prts] [data-prts-session-quick-actions] {
|
|
1021
|
+
display: none !important;
|
|
1014
1022
|
}
|
|
1015
1023
|
|
|
1016
1024
|
html[data-dsh-prts] [data-prts-workspace-actions] > *,
|
|
@@ -1145,7 +1153,7 @@ html[data-dsh-prts][data-prts-conversation-style="native"] [data-chat-flow-kind=
|
|
|
1145
1153
|
|
|
1146
1154
|
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] :is(
|
|
1147
1155
|
[data-chat-flow-kind="user"],
|
|
1148
|
-
[data-chat-flow-kind="assistant-step"]
|
|
1156
|
+
[data-chat-flow-kind="assistant-step"]:not([data-chat-group-part="reasoning"])
|
|
1149
1157
|
) {
|
|
1150
1158
|
position: relative;
|
|
1151
1159
|
box-sizing: border-box;
|
|
@@ -1157,13 +1165,13 @@ html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-ki
|
|
|
1157
1165
|
color: var(--prts-ink);
|
|
1158
1166
|
}
|
|
1159
1167
|
|
|
1160
|
-
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"] {
|
|
1168
|
+
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"]:not([data-chat-group-part="reasoning"]) {
|
|
1161
1169
|
--prts-chat-link-x: 22px;
|
|
1162
1170
|
padding-inline-start: 56px;
|
|
1163
1171
|
color: var(--prts-ink);
|
|
1164
1172
|
}
|
|
1165
1173
|
|
|
1166
|
-
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"]::after,
|
|
1174
|
+
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"]:not([data-chat-group-part="reasoning"])::after,
|
|
1167
1175
|
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-message-role="assistant"]::after {
|
|
1168
1176
|
content: "";
|
|
1169
1177
|
position: absolute;
|
|
@@ -1180,7 +1188,7 @@ html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-message-role
|
|
|
1180
1188
|
pointer-events: none;
|
|
1181
1189
|
}
|
|
1182
1190
|
|
|
1183
|
-
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"]::before,
|
|
1191
|
+
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"]:not([data-chat-group-part="reasoning"])::before,
|
|
1184
1192
|
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="user"]::after,
|
|
1185
1193
|
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-message-role="assistant"]::before,
|
|
1186
1194
|
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-message-role="user"]::after {
|
|
@@ -1201,7 +1209,7 @@ html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-message-role
|
|
|
1201
1209
|
pointer-events: none;
|
|
1202
1210
|
}
|
|
1203
1211
|
|
|
1204
|
-
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"]::before,
|
|
1212
|
+
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"]:not([data-chat-group-part="reasoning"])::before,
|
|
1205
1213
|
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-message-role="assistant"]::before {
|
|
1206
1214
|
content: "";
|
|
1207
1215
|
left: 0;
|
|
@@ -1280,7 +1288,7 @@ html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-message-role
|
|
|
1280
1288
|
left: -56px;
|
|
1281
1289
|
}
|
|
1282
1290
|
|
|
1283
|
-
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"] [class$="_body"]:has(:is([data-markdown], [data-slot*="markdown" i], .markdown-body)),
|
|
1291
|
+
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"]:not([data-chat-group-part="reasoning"]) [class$="_body"]:has(:is([data-markdown], [data-slot*="markdown" i], .markdown-body)),
|
|
1284
1292
|
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-prts-ai-surface] {
|
|
1285
1293
|
box-sizing: border-box;
|
|
1286
1294
|
width: fit-content;
|
|
@@ -1770,12 +1778,12 @@ html[data-dsh-prts-settings] .prts-plugin-settings button[role='switch']:disable
|
|
|
1770
1778
|
padding-inline: 8px 50px;
|
|
1771
1779
|
}
|
|
1772
1780
|
|
|
1773
|
-
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"] {
|
|
1781
|
+
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"]:not([data-chat-group-part="reasoning"]) {
|
|
1774
1782
|
padding-inline: 0 8px;
|
|
1775
1783
|
padding-inline-start: 50px;
|
|
1776
1784
|
}
|
|
1777
1785
|
|
|
1778
|
-
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"]::before,
|
|
1786
|
+
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"]:not([data-chat-group-part="reasoning"])::before,
|
|
1779
1787
|
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-message-role="assistant"]::before {
|
|
1780
1788
|
left: 8px;
|
|
1781
1789
|
width: 34px;
|
|
@@ -1798,7 +1806,7 @@ html[data-dsh-prts-settings] .prts-plugin-settings button[role='switch']:disable
|
|
|
1798
1806
|
border-radius: 16px 5px 16px 16px !important;
|
|
1799
1807
|
}
|
|
1800
1808
|
|
|
1801
|
-
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"] [class$="_body"]:has(:is([data-markdown], [data-slot*="markdown" i], .markdown-body)),
|
|
1809
|
+
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"]:not([data-chat-group-part="reasoning"]) [class$="_body"]:has(:is([data-markdown], [data-slot*="markdown" i], .markdown-body)),
|
|
1802
1810
|
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-prts-ai-surface],
|
|
1803
1811
|
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-message-role="assistant"] {
|
|
1804
1812
|
padding: 13px 16px !important;
|
|
@@ -1823,7 +1831,7 @@ html[data-dsh-prts-settings] .prts-plugin-settings button[role='switch']:disable
|
|
|
1823
1831
|
left: -42px;
|
|
1824
1832
|
}
|
|
1825
1833
|
|
|
1826
|
-
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"]::after,
|
|
1834
|
+
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-chat-flow-kind="assistant-step"]:not([data-chat-group-part="reasoning"])::after,
|
|
1827
1835
|
html[data-dsh-prts][data-prts-conversation-style="deck-chat"] [data-message-role="assistant"]::after {
|
|
1828
1836
|
display: none;
|
|
1829
1837
|
}
|