@segnavia/capture 0.47.0 → 0.49.0
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/dist/geometry.d.ts +3 -7
- package/dist/index.d.ts +3 -9
- package/dist/shot.js +2 -1
- package/package.json +4 -4
package/dist/geometry.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Annotation, Box, TextDirection } from "@segnavia/format";
|
|
1
|
+
import { Annotation, Box, PixelSize, TextDirection } from "@segnavia/format";
|
|
2
2
|
//#region src/geometry.d.ts
|
|
3
3
|
export declare const SIDES: readonly ["left", "right", "top", "bottom"];
|
|
4
4
|
export type Side = (typeof SIDES)[number];
|
|
@@ -8,10 +8,6 @@ export interface AnnotationSpec {
|
|
|
8
8
|
label?: string;
|
|
9
9
|
highlight?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
height: number;
|
|
14
|
-
}
|
|
15
|
-
export declare function chooseArrowSide(box: Box, viewport: Viewport, preferred?: Side | 'auto', direction?: TextDirection): Side;
|
|
16
|
-
export declare function layoutAnnotation(box: Box, spec: AnnotationSpec, viewport: Viewport, direction?: TextDirection): Annotation;
|
|
11
|
+
export declare function chooseArrowSide(box: Box, viewport: PixelSize, preferred?: Side | 'auto', direction?: TextDirection): Side;
|
|
12
|
+
export declare function layoutAnnotation(box: Box, spec: AnnotationSpec, viewport: PixelSize, direction?: TextDirection): Annotation;
|
|
17
13
|
//#endregion
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { chooseArrowSide, layoutAnnotation } from "./geometry.js";
|
|
2
2
|
import { ImageOutput, ShotSpec, Target } from "./shot.js";
|
|
3
3
|
import { FlowIdentity, Host, HostSession } from "./host.js";
|
|
4
|
-
import { Manifest, Shot } from "@segnavia/format";
|
|
4
|
+
import { Manifest, PixelSize, Shot } from "@segnavia/format";
|
|
5
5
|
import { BrowserContextOptions, Page } from "playwright-core";
|
|
6
6
|
//#region src/index.d.ts
|
|
7
7
|
export interface FlowContext<Extras> {
|
|
@@ -16,10 +16,7 @@ export interface FlowContext<Extras> {
|
|
|
16
16
|
arg?: unknown;
|
|
17
17
|
timeout?: number;
|
|
18
18
|
}): Promise<void>;
|
|
19
|
-
viewport(size?:
|
|
20
|
-
width: number;
|
|
21
|
-
height: number;
|
|
22
|
-
}): Promise<void>;
|
|
19
|
+
viewport(size?: PixelSize): Promise<void>;
|
|
23
20
|
setLocalStorage(entries: Record<string, string | number | boolean>): Promise<void>;
|
|
24
21
|
shot(spec: ShotSpec): Promise<Shot>;
|
|
25
22
|
}
|
|
@@ -31,10 +28,7 @@ export interface CaptureConfig {
|
|
|
31
28
|
outputDirectory: string;
|
|
32
29
|
executablePath: string;
|
|
33
30
|
launchArgs?: string[];
|
|
34
|
-
viewport?:
|
|
35
|
-
width: number;
|
|
36
|
-
height: number;
|
|
37
|
-
};
|
|
31
|
+
viewport?: PixelSize;
|
|
38
32
|
scale?: number;
|
|
39
33
|
context?: BrowserContextOptions;
|
|
40
34
|
output?: ImageOutput;
|
package/dist/shot.js
CHANGED
|
@@ -78,7 +78,8 @@ async function takeShot(page, spec, options) {
|
|
|
78
78
|
const encode = () => captureImage(page, {
|
|
79
79
|
format: options.output.format,
|
|
80
80
|
quality: options.output.quality,
|
|
81
|
-
limits: {
|
|
81
|
+
limits: { bytes: options.output.maxBytes },
|
|
82
|
+
limitSetting: "output.maxBytes"
|
|
82
83
|
}, false);
|
|
83
84
|
const file = `${spec.key}.${extension}`;
|
|
84
85
|
writeFileSync(path.join(options.directory, file), await encode());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segnavia/capture",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@segnavia/format": "0.
|
|
30
|
+
"@segnavia/format": "0.49.0",
|
|
31
31
|
"playwright-core": "1.55.1",
|
|
32
|
-
"@segnavia/frame": "0.
|
|
33
|
-
"@segnavia/render": "0.
|
|
32
|
+
"@segnavia/frame": "0.49.0",
|
|
33
|
+
"@segnavia/render": "0.49.0"
|
|
34
34
|
}
|
|
35
35
|
}
|