@ottttto/dsh-scheduled-send 0.3.2 → 0.3.3
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/dsh.plugin.json +1 -1
- package/lib/client.js +26 -12
- package/package.json +2 -2
- package/src/client-view.js +26 -12
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "@ottttto/dsh-scheduled-send",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"description": "定时发送:到点以你的身份把消息作为正常用户气泡发进当前会话,无人值守、会话隔离、断电补发。Scheduled send for DSH — fires as a normal user bubble into the bound conversation, unattended, per-session isolated, restart-safe.",
|
|
6
6
|
"engines": {
|
package/lib/client.js
CHANGED
|
@@ -524,14 +524,29 @@ function createClientPluginBody(React) {
|
|
|
524
524
|
const overflow = Math.max(0, all.length - annotated.length);
|
|
525
525
|
|
|
526
526
|
const isDark = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
527
|
+
// mirrors usage-stats' footer trigger: same metrics + theme variables as
|
|
528
|
+
// the system sidebar rows (hover comes from the injected var-only rule)
|
|
529
|
+
const layerStyle = {
|
|
530
|
+
flex: "none", alignItems: "center", width: "100%", height: 49,
|
|
531
|
+
margin: "8px 0 0", display: "flex", position: "relative",
|
|
532
|
+
...(mobile ? { height: 44 } : {}),
|
|
533
|
+
};
|
|
527
534
|
const entryBtn = {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
fontSize:
|
|
532
|
-
|
|
535
|
+
width: "100%", height: mobile ? 44 : 49, color: "var(--dsw-alias-label-primary)",
|
|
536
|
+
cursor: "pointer", background: "0 0", border: "none", borderRadius: 12,
|
|
537
|
+
alignItems: "center", gap: 8, padding: "0 8px 0 6px", fontFamily: "inherit",
|
|
538
|
+
fontSize: 14, display: "inline-flex", overflow: "hidden",
|
|
539
|
+
};
|
|
540
|
+
const iconBox = { display: "inline-flex", width: mobile ? 18 : 16, justifyContent: "center", flexShrink: 0 };
|
|
541
|
+
const labelStyle = { textOverflow: "ellipsis", whiteSpace: "nowrap", minWidth: 0, overflow: "hidden" };
|
|
542
|
+
const amountStyle = {
|
|
543
|
+
color: "var(--dsw-alias-label-secondary)", fontVariantNumeric: "tabular-nums",
|
|
544
|
+
flex: "none", fontSize: 12, fontWeight: 600, lineHeight: "16px",
|
|
545
|
+
};
|
|
546
|
+
const countStyle = {
|
|
547
|
+
color: "var(--dsw-alias-label-tertiary)", fontVariantNumeric: "tabular-nums",
|
|
548
|
+
flex: "none", marginLeft: "auto", fontSize: 12, lineHeight: "16px",
|
|
533
549
|
};
|
|
534
|
-
const iconBox = { display: "inline-flex", width: 16, justifyContent: "center", flexShrink: 0 };
|
|
535
550
|
const badge = (n) => h("span", {
|
|
536
551
|
key: "b", "data-badge": n,
|
|
537
552
|
style: {
|
|
@@ -626,18 +641,17 @@ function createClientPluginBody(React) {
|
|
|
626
641
|
])
|
|
627
642
|
: null;
|
|
628
643
|
|
|
629
|
-
return h("div", { "data-plugin": "dsh-scheduled-send-sidebar", style:
|
|
630
|
-
|
|
644
|
+
return h("div", { "data-plugin": "dsh-scheduled-send-sidebar", style: layerStyle }, [
|
|
645
|
+
h("style", { key: "css" }, '.ssb_badge:hover{background:var(--dsw-alias-interactive-bg-hover-solid)}'),
|
|
631
646
|
h("button", {
|
|
632
647
|
key: "btn", type: "button",
|
|
633
|
-
|
|
634
|
-
onMouseLeave: () => setHover(false),
|
|
648
|
+
className: "ssb_badge",
|
|
635
649
|
onClick: () => { setOpen(!open); setTick((n) => n + 1); },
|
|
636
650
|
title: "定时任务", "aria-label": "定时任务", style: entryBtn,
|
|
637
651
|
}, [
|
|
638
652
|
h("span", { key: "i", style: iconBox }, "⏰"),
|
|
639
|
-
h("span", { key: "l" }, "定时任务"),
|
|
640
|
-
all.length ? h("span", { key: "bs", style:
|
|
653
|
+
h("span", { key: "l", style: labelStyle }, "定时任务"),
|
|
654
|
+
all.length ? h("span", { key: "bs", style: countStyle }, String(all.length)) : null,
|
|
641
655
|
]),
|
|
642
656
|
footer,
|
|
643
657
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ottttto/dsh-scheduled-send",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "DSH plugin: scheduled sending (⏰ composer button, dock list of pending tasks, sidebar 定时任务 panel with cross-session cancel, due-time delivery as a normal user bubble)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -52,4 +52,4 @@
|
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=18"
|
|
54
54
|
}
|
|
55
|
-
}
|
|
55
|
+
}
|
package/src/client-view.js
CHANGED
|
@@ -260,14 +260,29 @@ function createClientPluginBody(React) {
|
|
|
260
260
|
const overflow = Math.max(0, all.length - annotated.length);
|
|
261
261
|
|
|
262
262
|
const isDark = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
263
|
+
// mirrors usage-stats' footer trigger: same metrics + theme variables as
|
|
264
|
+
// the system sidebar rows (hover comes from the injected var-only rule)
|
|
265
|
+
const layerStyle = {
|
|
266
|
+
flex: "none", alignItems: "center", width: "100%", height: 49,
|
|
267
|
+
margin: "8px 0 0", display: "flex", position: "relative",
|
|
268
|
+
...(mobile ? { height: 44 } : {}),
|
|
269
|
+
};
|
|
263
270
|
const entryBtn = {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
fontSize:
|
|
268
|
-
|
|
271
|
+
width: "100%", height: mobile ? 44 : 49, color: "var(--dsw-alias-label-primary)",
|
|
272
|
+
cursor: "pointer", background: "0 0", border: "none", borderRadius: 12,
|
|
273
|
+
alignItems: "center", gap: 8, padding: "0 8px 0 6px", fontFamily: "inherit",
|
|
274
|
+
fontSize: 14, display: "inline-flex", overflow: "hidden",
|
|
275
|
+
};
|
|
276
|
+
const iconBox = { display: "inline-flex", width: mobile ? 18 : 16, justifyContent: "center", flexShrink: 0 };
|
|
277
|
+
const labelStyle = { textOverflow: "ellipsis", whiteSpace: "nowrap", minWidth: 0, overflow: "hidden" };
|
|
278
|
+
const amountStyle = {
|
|
279
|
+
color: "var(--dsw-alias-label-secondary)", fontVariantNumeric: "tabular-nums",
|
|
280
|
+
flex: "none", fontSize: 12, fontWeight: 600, lineHeight: "16px",
|
|
281
|
+
};
|
|
282
|
+
const countStyle = {
|
|
283
|
+
color: "var(--dsw-alias-label-tertiary)", fontVariantNumeric: "tabular-nums",
|
|
284
|
+
flex: "none", marginLeft: "auto", fontSize: 12, lineHeight: "16px",
|
|
269
285
|
};
|
|
270
|
-
const iconBox = { display: "inline-flex", width: 16, justifyContent: "center", flexShrink: 0 };
|
|
271
286
|
const badge = (n) => h("span", {
|
|
272
287
|
key: "b", "data-badge": n,
|
|
273
288
|
style: {
|
|
@@ -362,18 +377,17 @@ function createClientPluginBody(React) {
|
|
|
362
377
|
])
|
|
363
378
|
: null;
|
|
364
379
|
|
|
365
|
-
return h("div", { "data-plugin": "dsh-scheduled-send-sidebar", style:
|
|
366
|
-
|
|
380
|
+
return h("div", { "data-plugin": "dsh-scheduled-send-sidebar", style: layerStyle }, [
|
|
381
|
+
h("style", { key: "css" }, '.ssb_badge:hover{background:var(--dsw-alias-interactive-bg-hover-solid)}'),
|
|
367
382
|
h("button", {
|
|
368
383
|
key: "btn", type: "button",
|
|
369
|
-
|
|
370
|
-
onMouseLeave: () => setHover(false),
|
|
384
|
+
className: "ssb_badge",
|
|
371
385
|
onClick: () => { setOpen(!open); setTick((n) => n + 1); },
|
|
372
386
|
title: "定时任务", "aria-label": "定时任务", style: entryBtn,
|
|
373
387
|
}, [
|
|
374
388
|
h("span", { key: "i", style: iconBox }, "⏰"),
|
|
375
|
-
h("span", { key: "l" }, "定时任务"),
|
|
376
|
-
all.length ? h("span", { key: "bs", style:
|
|
389
|
+
h("span", { key: "l", style: labelStyle }, "定时任务"),
|
|
390
|
+
all.length ? h("span", { key: "bs", style: countStyle }, String(all.length)) : null,
|
|
377
391
|
]),
|
|
378
392
|
footer,
|
|
379
393
|
]);
|