dsh-browser-cdp 0.17.16 → 0.17.17

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 CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://dsh.community/schemas/dsh-plugin-0.15.json",
3
3
  "id": "dsh-browser-cdp",
4
4
  "name": "dsh-browser-cdp",
5
- "version": "0.17.16",
5
+ "version": "0.17.17",
6
6
  "manifestVersion": "0.15",
7
7
  "facets": {
8
8
  "host": {
package/lib/client.js CHANGED
@@ -4311,6 +4311,13 @@ var TAB_CSS = `
4311
4311
  * {"cdpEndpoint":..., "targetId":..., "pageUrl":..., "elements":[{n,backendNodeId,tag,id,name,focusable,describe}]}
4312
4312
  * [/CDP-PICKS]
4313
4313
  */
4314
+ function injectPickCardStyles() {
4315
+ if (document.getElementById("dsh-cdp-picks-styles") !== null) return;
4316
+ var style = document.createElement("style");
4317
+ style.id = "dsh-cdp-picks-styles";
4318
+ style.textContent = "[data-dsh-cdp-picks-card] {\n box-sizing: border-box; flex: none;\n display: grid; gap: 4px; padding: 8px 10px;\n font: inherit; font-size: 12px;\n color: #1d1d1f; background: #f7f7f9;\n border: 1px solid rgba(0, 0, 0, 0.16); border-radius: 12px;\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);\n /* input-traffic 同款限宽:卡宽被限制在内容列(拖动范围)内,两侧留出\n clearance,永不顶满整窗 */\n width: min(\n calc(100% - var(--dsh-composer-side-clearance, 16px) - var(--dsh-composer-side-clearance, 16px) - var(--dsh-composer-dock-inset, 8px) - var(--dsh-composer-dock-inset, 8px)),\n calc(var(--dsh-chat-content-width, 100%) - var(--dsh-composer-dock-inset, 8px) - var(--dsh-composer-dock-inset, 8px))\n );\n overflow-y: auto; max-height: 40vh;\n}\n@media (prefers-color-scheme: dark) {\n [data-dsh-cdp-picks-card] { color: #f2f2f7; background: #1c1c1e; border-color: rgba(255, 255, 255, 0.18); }\n}\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-sub { font-size: 11px; color: rgba(60, 60, 67, 0.62); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-chip { display: flex; align-items: baseline; gap: 6px; padding: 3px 8px; background: rgba(120, 120, 128, 0.12); border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 8px; min-width: 0; }\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-num { font-weight: 700; flex: none; color: rgba(60, 60, 67, 0.62); }\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-tag { font-weight: 600; flex: none; }\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-close { margin-left: auto; flex: none; font: inherit; font-size: 12px; cursor: pointer; border: none; background: none; color: rgba(60, 60, 67, 0.62); padding: 0 2px; border-radius: 6px; }\n[data-dsh-cdp-picks-card] .dsh-cdp-picks-close:hover { background: rgba(120, 120, 128, 0.18); }\n@media (prefers-color-scheme: dark) {\n [data-dsh-cdp-picks-card] .dsh-cdp-picks-sub { color: rgba(235, 235, 245, 0.62); }\n [data-dsh-cdp-picks-card] .dsh-cdp-picks-chip { background: rgba(120, 120, 128, 0.24); border-color: rgba(255, 255, 255, 0.12); }\n [data-dsh-cdp-picks-card] .dsh-cdp-picks-num { color: rgba(235, 235, 245, 0.62); }\n [data-dsh-cdp-picks-card] .dsh-cdp-picks-close { color: rgba(235, 235, 245, 0.62); }\n [data-dsh-cdp-picks-card] .dsh-cdp-picks-close:hover { background: rgba(120, 120, 128, 0.3); }\n}";
4319
+ document.head.appendChild(style);
4320
+ }
4314
4321
  function CdpPicksDockCard(props) {
4315
4322
  var input = props.input;
4316
4323
  var h = React.createElement;
@@ -4374,68 +4381,6 @@ function CdpPicksDockCard(props) {
4374
4381
  next = next.replace(/^\s*\n+/, "").replace(/\n+\s*$/, "");
4375
4382
  input.setDraft(next);
4376
4383
  }
4377
- var cardStyle = {
4378
- display: "grid",
4379
- gap: "4px",
4380
- padding: "8px 10px",
4381
- font: "inherit",
4382
- fontSize: "12px",
4383
- color: "var(--dsw-alias-label-primary, inherit)",
4384
- background: "var(--dsw-alias-bg-surface, rgba(127,127,127,.14))",
4385
- border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.35))",
4386
- borderRadius: "12px",
4387
- boxSizing: "border-box"
4388
- };
4389
- var headStyle = {
4390
- display: "flex",
4391
- alignItems: "center",
4392
- gap: "6px",
4393
- flexWrap: "wrap"
4394
- };
4395
- var subStyle = {
4396
- fontSize: "11px",
4397
- color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.75))",
4398
- overflow: "hidden",
4399
- textOverflow: "ellipsis",
4400
- whiteSpace: "nowrap",
4401
- minWidth: 0
4402
- };
4403
- var chipStyle = {
4404
- display: "flex",
4405
- alignItems: "baseline",
4406
- gap: "6px",
4407
- padding: "3px 8px",
4408
- background: "var(--dsw-alias-bg-module-platform, rgba(127,127,127,.1))",
4409
- border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.22))",
4410
- borderRadius: "8px",
4411
- minWidth: 0
4412
- };
4413
- var numStyle = {
4414
- fontWeight: 700,
4415
- flex: "0 0 auto",
4416
- color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.75))"
4417
- };
4418
- var tagStyle = {
4419
- fontWeight: 600,
4420
- flex: "0 0 auto"
4421
- };
4422
- var descStyle = {
4423
- overflow: "hidden",
4424
- textOverflow: "ellipsis",
4425
- whiteSpace: "nowrap",
4426
- minWidth: 0
4427
- };
4428
- var closeStyle = {
4429
- marginLeft: "auto",
4430
- flex: "0 0 auto",
4431
- font: "inherit",
4432
- fontSize: "12px",
4433
- cursor: "pointer",
4434
- border: "none",
4435
- background: "none",
4436
- color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.75))",
4437
- padding: "0 2px"
4438
- };
4439
4384
  return h("div", { style: {
4440
4385
  display: "grid",
4441
4386
  gap: "6px"
@@ -4446,10 +4391,10 @@ function CdpPicksDockCard(props) {
4446
4391
  var obj = JSON.parse(content);
4447
4392
  elements = obj && obj.elements || [];
4448
4393
  } catch (e) {}
4449
- var head = h("div", { style: headStyle }, h("span", { style: { fontWeight: 700 } }, "🌐 " + wt("pickCardTitle")), h("span", { style: subStyle }, (r.endpoint || "") + " · " + (r.title || "")), h("span", { style: subStyle }, wt("pickCardElements", { n: r.count })), h("button", {
4394
+ var head = h("div", { className: "dsh-cdp-picks-head" }, h("span", { style: { fontWeight: 700 } }, "🌐 " + wt("pickCardTitle")), h("span", { className: "dsh-cdp-picks-sub" }, (r.endpoint || "") + " · " + (r.title || "")), h("span", { className: "dsh-cdp-picks-sub" }, wt("pickCardElements", { n: r.count })), h("button", {
4450
4395
  type: "button",
4451
4396
  title: wt("pickCardRemove"),
4452
- style: closeStyle,
4397
+ className: "dsh-cdp-picks-close",
4453
4398
  onClick: function() {
4454
4399
  removeRef(r.line);
4455
4400
  }
@@ -4457,26 +4402,27 @@ function CdpPicksDockCard(props) {
4457
4402
  var chips = [];
4458
4403
  if (typeof content !== "string") chips.push(h("div", {
4459
4404
  key: "loading",
4460
- style: subStyle
4405
+ className: "dsh-cdp-picks-sub"
4461
4406
  }, "…"));
4462
4407
  for (var i = 0; i < elements.length && i < 6; i++) {
4463
4408
  var el = elements[i] || {};
4464
4409
  chips.push(h("div", {
4465
4410
  key: el.n || i,
4466
- style: chipStyle
4467
- }, h("span", { style: numStyle }, "#" + (el.n || i + 1)), h("span", { style: tagStyle }, el.tag || "?"), h("span", { style: descStyle }, el.describe || el.name || "")));
4411
+ className: "dsh-cdp-picks-chip"
4412
+ }, h("span", { className: "dsh-cdp-picks-num" }, "#" + (el.n || i + 1)), h("span", { className: "dsh-cdp-picks-tag" }, el.tag || "?"), h("span", { className: "dsh-cdp-picks-desc" }, el.describe || el.name || "")));
4468
4413
  }
4469
4414
  if (elements.length > 6) chips.push(h("div", {
4470
4415
  key: "more",
4471
- style: subStyle
4416
+ className: "dsh-cdp-picks-sub"
4472
4417
  }, "… +" + (elements.length - 6)));
4473
4418
  return h("div", {
4474
4419
  key: r.file,
4475
- style: cardStyle
4420
+ "data-dsh-cdp-picks-card": ""
4476
4421
  }, head, chips);
4477
4422
  }));
4478
4423
  }
4479
4424
  function mountPicksDockCard(ctx) {
4425
+ injectPickCardStyles();
4480
4426
  try {
4481
4427
  window.__dshBrowserCdpDeco = Object.assign({}, window.__dshBrowserCdpDeco, { stage: "registered" });
4482
4428
  } catch (e) {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-browser-cdp",
3
- "version": "0.17.16",
3
+ "version": "0.17.17",
4
4
  "description": "dsh-browser-cdp: DSH browser plugin — attach to a running Chrome/Edge over CDP (no bundled browser needed); structured browser-automation tools (30+ bcdp_*) that drive the vendored ego runtime through ctx.subprocess, plus a realtime watch panel (live SSE screencast + direct mouse interaction + download capture + human-verification notice). Web shell: floating watch panel without dsh-better-sidebar, sidebar tab with it. Headless/TUI hosts: tools-only. [DSH 0.1.7+ line: declarative settings via Config .volatile() fields; for DSH 0.1.2-rc.1 ~ 0.1.6 use the 0.16.x line]",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",