dsh-figmark 1.2.3 → 1.2.5
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 +35 -0
- package/lib/client.js +523 -337
- package/lib/index.js +20 -5
- package/market/index.json +2 -2
- package/package.json +1 -1
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(
|
|
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:
|
|
904
|
-
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 >=
|
|
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
|
-
|
|
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