dsh-figmark 1.2.2 → 1.2.4

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/lib/index.js CHANGED
@@ -885,9 +885,14 @@ ${readFileSync(createRequire(import.meta.url).resolve("modern-screenshot/dist/in
885
885
  ? [rect.left + scroll[0], rect.top + scroll[1], width, height]
886
886
  : [0, 0, width, height]
887
887
  var target = surface || root
888
+ // The deck's ancestor may scale a 1920px slide into a 548px viewport. Layout
889
+ // at the original size, then map the bitmap into imageRect. Feeding rect.width
890
+ // back as CSS width reflows/clips the slide while its children stay full-size.
891
+ var layoutWidth = surface ? surface.offsetWidth || width : width
892
+ var layoutHeight = surface ? surface.offsetHeight || height : height
888
893
  // The parent composes at no more than 1.5x, so a larger source only costs a DOM
889
894
  // clone and PNG encode without adding pixels the delivered picture keeps.
890
- var scale = Math.min(1.5, 1800 / Math.max(width, height))
895
+ var scale = Math.min(1.5, 1800 / Math.max(layoutWidth, layoutHeight))
891
896
  var screenshot = window.modernScreenshot
892
897
  if (!screenshot || typeof screenshot.domToDataUrl !== 'function') {
893
898
  send({
@@ -900,8 +905,9 @@ ${readFileSync(createRequire(import.meta.url).resolve("modern-screenshot/dist/in
900
905
  return
901
906
  }
902
907
  screenshot.domToDataUrl(target, {
903
- width: width,
904
- height: height,
908
+ width: layoutWidth,
909
+ height: layoutHeight,
910
+ style: surface ? { transform: 'none', zoom: '1' } : null,
905
911
  scale: scale,
906
912
  backgroundColor: '#ffffff',
907
913
  maximumCanvasSize: 4096,
@@ -1555,7 +1561,7 @@ function probe(candidate) {
1555
1561
  const finishResponse = () => {
1556
1562
  /* v8 ignore next -- Node populates statusCode before emitting `response`. */
1557
1563
  const status = res.statusCode ?? 0;
1558
- if (status < 200 || status >= 500) {
1564
+ if (status < 200 || status >= 400) {
1559
1565
  finish(void 0);
1560
1566
  return;
1561
1567
  }
@@ -1630,7 +1636,16 @@ async function discoverServices(request, sessionCwd) {
1630
1636
  workspace: 1,
1631
1637
  common: 2
1632
1638
  };
1633
- return services.sort((left, right) => rank[left.source] - rank[right.source] || new URL(left.url).port.localeCompare(new URL(right.url).port, void 0, { numeric: true }));
1639
+ const sorted = services.sort((left, right) => rank[left.source] - rank[right.source] || new URL(left.url).port.localeCompare(new URL(right.url).port, void 0, { numeric: true }));
1640
+ const pages = /* @__PURE__ */ new Set();
1641
+ return sorted.filter((service) => {
1642
+ const url = new URL(service.url);
1643
+ const path = service.title === void 0 ? url.pathname : url.pathname.replace(/\/index\.html?$/iu, "/");
1644
+ const key = `${url.origin}${path}${url.search}${url.hash}\n${service.title ?? ""}`;
1645
+ if (pages.has(key)) return false;
1646
+ pages.add(key);
1647
+ return true;
1648
+ });
1634
1649
  }
1635
1650
  //#endregion
1636
1651
  //#region src/host/store-schema.ts
package/market/index.json CHANGED
@@ -101,8 +101,8 @@
101
101
  },
102
102
  "versions": [
103
103
  {
104
- "version": "1.2.2",
105
- "publishTimestamp": 1793526077,
104
+ "version": "1.2.4",
105
+ "publishTimestamp": 1793932197,
106
106
  "source": {
107
107
  "type": "npm",
108
108
  "registry": "https://registry.npmjs.org"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-figmark",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "private": false,
5
5
  "description": "DSH 插件:在右侧栏预览里对科研配图、SVG、PDF 与本机网页直接圈画批注,标注写进侧车文件并可一键交给智能体改图源",
6
6
  "license": "MIT",