shadok-ai 0.20.47 → 0.20.48
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 +2 -1
- package/package.json +1 -1
- package/public/index.html +35 -16
- package/public/line-icons.js +3 -0
package/README.md
CHANGED
|
@@ -447,7 +447,8 @@ Enter to skip; you can add it later from the web UI).
|
|
|
447
447
|
leaves what you set alone. Go back to
|
|
448
448
|
**Board group** and every such conversation is closed at once.
|
|
449
449
|
- **Link to a message** — every message (yours and the agent's, and a **room**'s
|
|
450
|
-
too) has a
|
|
450
|
+
too) has a link icon beside the copy icon — both bare icons, their words in a
|
|
451
|
+
tooltip on hover; a click turns the icon into a ✓. It copies a URL like
|
|
451
452
|
`…/a/<session>#msg=<id>` for an agent, `…/#room=<room>&msg=<id>` for a
|
|
452
453
|
room; whoever opens it — someone who already has access to this cockpit, after
|
|
453
454
|
the usual sign-in — lands on that conversation, scrolled to that message,
|
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -1450,15 +1450,27 @@
|
|
|
1450
1450
|
background: color-mix(in srgb, var(--amber) 45%, transparent);
|
|
1451
1451
|
}
|
|
1452
1452
|
/* Copy: always visible, never on hover — a phone has no hover, and a button
|
|
1453
|
-
you cannot reveal does not exist.
|
|
1453
|
+
you cannot reveal does not exist. Only its WORDS wait for the hover: the
|
|
1454
|
+
button is a bare icon and says what it does in a tooltip (`data-tip`). */
|
|
1454
1455
|
.turn .copy {
|
|
1455
|
-
|
|
1456
|
-
|
|
1456
|
+
position: relative; display: inline-grid; place-items: center;
|
|
1457
|
+
align-self: flex-end; margin-top: 2px; padding: 4px 6px;
|
|
1458
|
+
font-size: 11px; line-height: 1; cursor: pointer;
|
|
1457
1459
|
background: var(--bg-inset); border: 1px solid var(--line); border-radius: 6px;
|
|
1458
1460
|
color: var(--text-dim); opacity: 0.9; transition: color 0.12s, border-color 0.12s;
|
|
1459
1461
|
}
|
|
1460
1462
|
.turn .copy:hover, .turn .copy:focus-visible { opacity: 1; color: var(--amber); border-color: var(--amber); }
|
|
1461
1463
|
.turn .copy.done { opacity: 1; color: var(--ok, #7ac77a); border-color: currentColor; }
|
|
1464
|
+
.turn .copy .ico { margin: 0; vertical-align: 0; }
|
|
1465
|
+
.turn .copy.failed { opacity: 1; color: var(--err); border-color: currentColor; }
|
|
1466
|
+
.turn .copy[data-tip]::after {
|
|
1467
|
+
content: attr(data-tip); position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5;
|
|
1468
|
+
padding: 4px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none;
|
|
1469
|
+
font-size: 11px; line-height: 1.3; color: var(--text); background: var(--menu-bg);
|
|
1470
|
+
border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
|
|
1471
|
+
opacity: 0; transform: translateY(2px); transition: opacity .12s, transform .12s;
|
|
1472
|
+
}
|
|
1473
|
+
.turn .copy:is(:hover, :focus-visible, .done, .failed)[data-tip]::after { opacity: 1; transform: none; }
|
|
1462
1474
|
/* The link button sits beside copy, same look. */
|
|
1463
1475
|
.turn .msg-tools { align-self: flex-end; display: flex; gap: 6px; }
|
|
1464
1476
|
.turn .msg-tools .copy { align-self: auto; }
|
|
@@ -9398,21 +9410,29 @@
|
|
|
9398
9410
|
|
|
9399
9411
|
/** A message's "copy" button. The copied text is the SOURCE (raw markdown),
|
|
9400
9412
|
* not the rendering: that is what you want to paste elsewhere. */
|
|
9413
|
+
/**
|
|
9414
|
+
* Paint a message tool (copy, link) as a bare icon whose words live in the
|
|
9415
|
+
* hover tooltip. `state` is the outcome of a click — "done" / "failed" swap
|
|
9416
|
+
* the icon and keep the tooltip up for a moment, so the click is answered on
|
|
9417
|
+
* a phone too, where there is no hover.
|
|
9418
|
+
*/
|
|
9419
|
+
function paintMsgTool(b, icon, tip, state = null) {
|
|
9420
|
+
b.replaceChildren(LineIcons.el(state === "done" ? "check" : state === "failed" ? "alert" : icon, 14));
|
|
9421
|
+
b.dataset.tip = tip;
|
|
9422
|
+
b.setAttribute("aria-label", tip);
|
|
9423
|
+
b.classList.toggle("done", state === "done");
|
|
9424
|
+
b.classList.toggle("failed", state === "failed");
|
|
9425
|
+
}
|
|
9401
9426
|
function addCopyButton(turn, text) {
|
|
9402
9427
|
const b = document.createElement("button");
|
|
9403
9428
|
b.type = "button";
|
|
9404
9429
|
b.className = "copy";
|
|
9405
|
-
b
|
|
9406
|
-
b.title = "Copy this message";
|
|
9430
|
+
paintMsgTool(b, "copy", "Copy this message");
|
|
9407
9431
|
b.addEventListener("click", async (e) => {
|
|
9408
9432
|
e.stopPropagation();
|
|
9409
9433
|
const ok = await copyText(text);
|
|
9410
|
-
b
|
|
9411
|
-
b
|
|
9412
|
-
setTimeout(() => {
|
|
9413
|
-
b.textContent = "⧉ copy";
|
|
9414
|
-
b.classList.remove("done");
|
|
9415
|
-
}, 1500);
|
|
9434
|
+
paintMsgTool(b, "copy", ok ? "Copied" : "Copy failed", ok ? "done" : "failed");
|
|
9435
|
+
setTimeout(() => paintMsgTool(b, "copy", "Copy this message"), 1500);
|
|
9416
9436
|
});
|
|
9417
9437
|
turn.appendChild(b);
|
|
9418
9438
|
}
|
|
@@ -9432,8 +9452,8 @@
|
|
|
9432
9452
|
const b = document.createElement("button");
|
|
9433
9453
|
b.type = "button";
|
|
9434
9454
|
b.className = "copy link";
|
|
9435
|
-
|
|
9436
|
-
b
|
|
9455
|
+
const tip = "Copy a link to this message";
|
|
9456
|
+
paintMsgTool(b, "link", tip);
|
|
9437
9457
|
b.addEventListener("click", async (e) => {
|
|
9438
9458
|
e.stopPropagation();
|
|
9439
9459
|
const base = location.origin + location.pathname;
|
|
@@ -9441,9 +9461,8 @@
|
|
|
9441
9461
|
? window.buildRoomMessageLink(base, tab.roomId, ids[0])
|
|
9442
9462
|
: window.buildMessageLink(base, tab.sessionId, ids[0]);
|
|
9443
9463
|
const ok = !!url && (await copyText(url));
|
|
9444
|
-
b
|
|
9445
|
-
b
|
|
9446
|
-
setTimeout(() => { labelWithIcon(b, "link", "link", 11); b.classList.remove("done"); }, 1500);
|
|
9464
|
+
paintMsgTool(b, "link", ok ? "Link copied" : "Copy failed", ok ? "done" : "failed");
|
|
9465
|
+
setTimeout(() => paintMsgTool(b, "link", tip), 1500);
|
|
9447
9466
|
});
|
|
9448
9467
|
if (copy) {
|
|
9449
9468
|
const row = document.createElement("div");
|
package/public/line-icons.js
CHANGED
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
stats: '<path d="M6 19v-6M12 19V6M18 19v-9"/>',
|
|
41
41
|
trend: '<path d="M3.5 17l6-6 4 4 7-7.5"/><path d="M15 7.5h5.5V13"/>',
|
|
42
42
|
link: '<path d="M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 0 0-5.66-5.66l-1 1"/><path d="M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 0 0 5.66 5.66l1-1"/>',
|
|
43
|
+
copy: '<rect x="8.5" y="8.5" width="11.5" height="11.5" rx="2"/><path d="M15.5 8.5V5.5A1.5 1.5 0 0 0 14 4H5.5A1.5 1.5 0 0 0 4 5.5V14a1.5 1.5 0 0 0 1.5 1.5h3"/>',
|
|
44
|
+
check: '<path d="M5 12.5l4.5 4.5L19 7.5"/>',
|
|
45
|
+
alert: '<path d="M12 4l9 16H3z"/><path d="M12 10v4.5M12 17.4v.1"/>',
|
|
43
46
|
rename: '<path d="M4 20h4L18.5 9.5a2.1 2.1 0 0 0-3-3L5 17v3z"/><path d="M13.5 8.5l3 3"/>',
|
|
44
47
|
reload: '<path d="M19.5 12a7.5 7.5 0 1 1-2.2-5.3"/><path d="M19.5 4.5v4h-4"/>',
|
|
45
48
|
close: '<path d="M6.5 6.5l11 11M17.5 6.5l-11 11"/>',
|