@enhance-eng/sdk 0.1.158 → 0.1.161
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/browser/kernel.iife.js +117 -35
- package/dist/{capture-client.client--zU5zvd3.d.mts → capture-client.client-B5R1OWuh.d.mts} +1 -1
- package/dist/{capture-client.client-YvUy2nGh.mjs → capture-client.client-BM_NxOqy.mjs} +1 -1
- package/dist/{capture-context.lib-BivWcwWc.mjs → capture-context.lib-LXUORfkL.mjs} +1 -1
- package/dist/client.d.mts +1 -1
- package/dist/client.mjs +1 -1
- package/dist/{environment.config-Dx5WHap5.d.mts → environment.config-30cIR7iz.d.mts} +1 -1
- package/dist/{environment.config-B2WQJWaS.mjs → environment.config-BlBA4N5X.mjs} +3 -3
- package/dist/{index-7uzK6oto.d.mts → index-CDKItTQW.d.mts} +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/{package-VWmCi21a.mjs → package-BFIjCgBc.mjs} +1 -1
- package/dist/playwright/index.d.mts +1 -1
- package/dist/playwright/index.mjs +3 -3
- package/dist/playwright/reporter.d.mts +3 -3
- package/dist/playwright/reporter.mjs +3 -3
- package/dist/{stall-watch.lib-C6VmIsz-.mjs → stall-watch.lib-DgIzqC3b.mjs} +91 -25
- package/package.json +3 -3
|
@@ -16,7 +16,8 @@ var __enhance_capture_kernel__ = (function(exports) {
|
|
|
16
16
|
v10: 10,
|
|
17
17
|
v11: 11,
|
|
18
18
|
v12: 12,
|
|
19
|
-
v13: 13
|
|
19
|
+
v13: 13,
|
|
20
|
+
v14: 14
|
|
20
21
|
};
|
|
21
22
|
const LEGACY_CANVAS_ADAPTATIONS = {
|
|
22
23
|
[LEGACY_CANVAS_FORMATS.v1]: "layout",
|
|
@@ -31,7 +32,8 @@ var __enhance_capture_kernel__ = (function(exports) {
|
|
|
31
32
|
[LEGACY_CANVAS_FORMATS.v10]: "geometry",
|
|
32
33
|
[LEGACY_CANVAS_FORMATS.v11]: "css",
|
|
33
34
|
[LEGACY_CANVAS_FORMATS.v12]: "text-shadow-blend",
|
|
34
|
-
[LEGACY_CANVAS_FORMATS.v13]: "format-number"
|
|
35
|
+
[LEGACY_CANVAS_FORMATS.v13]: "format-number",
|
|
36
|
+
[LEGACY_CANVAS_FORMATS.v14]: "format-number"
|
|
35
37
|
};
|
|
36
38
|
//#endregion
|
|
37
39
|
//#region ../canvas-format/src/canvas-edit-support.lib.ts
|
|
@@ -289,7 +291,7 @@ var __enhance_capture_kernel__ = (function(exports) {
|
|
|
289
291
|
};
|
|
290
292
|
//#endregion
|
|
291
293
|
//#region ../canvas-format/src/canvas-format.lib.ts
|
|
292
|
-
const READABLE_FORMATS = /* @__PURE__ */ new Set([...Object.values(LEGACY_CANVAS_FORMATS),
|
|
294
|
+
const READABLE_FORMATS = /* @__PURE__ */ new Set([...Object.values(LEGACY_CANVAS_FORMATS), 15]);
|
|
293
295
|
const isReadableCanvasFormat = (version) => READABLE_FORMATS.has(version);
|
|
294
296
|
/** Formats whose adaptation rewrites the stored document in place, keeping its geometry. */
|
|
295
297
|
const ADAPTED_IN_PLACE = /* @__PURE__ */ new Set([
|
|
@@ -313,20 +315,20 @@ var __enhance_capture_kernel__ = (function(exports) {
|
|
|
313
315
|
const adaptLegacyFormat = (document) => {
|
|
314
316
|
const version = document["version"];
|
|
315
317
|
if (!isReadableCanvasFormat(version)) return null;
|
|
316
|
-
if (version ===
|
|
318
|
+
if (version === 15 || !isRecord$2(document["nodes"])) return document;
|
|
317
319
|
const adaptation = Object.entries(LEGACY_CANVAS_ADAPTATIONS).find(([format]) => Number(format) === version)?.[1];
|
|
318
320
|
if (ADAPTED_IN_PLACE.has(adaptation)) return {
|
|
319
321
|
...document,
|
|
320
|
-
version:
|
|
322
|
+
version: 15
|
|
321
323
|
};
|
|
322
324
|
if (Object.values(document["nodes"]).some((node) => isRecord$2(node) && node["geometry"] !== void 0)) return null;
|
|
323
325
|
if (adaptation === "typography") return {
|
|
324
326
|
...document,
|
|
325
|
-
version:
|
|
327
|
+
version: 15
|
|
326
328
|
};
|
|
327
329
|
return {
|
|
328
330
|
...document,
|
|
329
|
-
version:
|
|
331
|
+
version: 15,
|
|
330
332
|
nodes: Object.fromEntries(Object.entries(document["nodes"]).map(([id, node]) => [id, isRecord$2(node) && node["layout"] !== void 0 ? {
|
|
331
333
|
...node,
|
|
332
334
|
layout: legacyLayout(node["layout"])
|
|
@@ -334,15 +336,15 @@ var __enhance_capture_kernel__ = (function(exports) {
|
|
|
334
336
|
};
|
|
335
337
|
};
|
|
336
338
|
/**
|
|
337
|
-
* Adapt known formats in memory, retaining malformed content for each boundary's validator.
|
|
338
|
-
* 13
|
|
339
|
-
*
|
|
339
|
+
* Adapt known formats in memory, retaining malformed content for each boundary's validator. Formats
|
|
340
|
+
* 13 and 14 differ from the current format only in the optional facts their layers cannot hold, so
|
|
341
|
+
* they take only the new format number. Format 12 already has the CSS model, so it takes only the
|
|
340
342
|
* text shadow step that every older format takes after the CSS adaptation.
|
|
341
343
|
*/
|
|
342
344
|
const adaptCanvasDocumentFormat = (document) => {
|
|
343
345
|
const adapted = adaptLegacyFormat(document);
|
|
344
346
|
if (adapted === null || adapted === document) return adapted;
|
|
345
|
-
if (document["version"] === LEGACY_CANVAS_FORMATS.v13) return adapted;
|
|
347
|
+
if (document["version"] === LEGACY_CANVAS_FORMATS.v13 || document["version"] === LEGACY_CANVAS_FORMATS.v14) return adapted;
|
|
346
348
|
return withoutTextShadowBlends(document["version"] === LEGACY_CANVAS_FORMATS.v12 ? adapted : adaptCanvasCss(adapted));
|
|
347
349
|
};
|
|
348
350
|
//#endregion
|
|
@@ -5433,6 +5435,22 @@ progression: object$1({
|
|
|
5433
5435
|
overflowClip: literal$1(true).optional(),
|
|
5434
5436
|
lineAboveBorderBottom: canvasNumberSchema.optional()
|
|
5435
5437
|
}).strict();
|
|
5438
|
+
/** The room a scroll container keeps for its scrollbars, per side, as conversion measured it. */
|
|
5439
|
+
const canvasScrollbarGutterSchema = object$1({
|
|
5440
|
+
top: nonNegativeCanvasNumberSchema.optional(),
|
|
5441
|
+
right: nonNegativeCanvasNumberSchema.optional(),
|
|
5442
|
+
bottom: nonNegativeCanvasNumberSchema.optional(),
|
|
5443
|
+
left: nonNegativeCanvasNumberSchema.optional()
|
|
5444
|
+
}).strict();
|
|
5445
|
+
/** A percentage of the containing block plus pixels; unlike a size limit, either may be negative. */
|
|
5446
|
+
const canvasParentRelativeCoordinateSchema = object$1({
|
|
5447
|
+
ratio: canvasNumberSchema,
|
|
5448
|
+
offset: canvasNumberSchema.optional()
|
|
5449
|
+
}).strict();
|
|
5450
|
+
const canvasPositionParentSchema = object$1({
|
|
5451
|
+
x: canvasParentRelativeCoordinateSchema.optional(),
|
|
5452
|
+
y: canvasParentRelativeCoordinateSchema.optional()
|
|
5453
|
+
}).strict();
|
|
5436
5454
|
const canvasNodeLayoutSchema = object$1({
|
|
5437
5455
|
rotation: canvasNumberSchema.optional(),
|
|
5438
5456
|
flipHorizontal: boolean$1().optional(),
|
|
@@ -5469,10 +5487,12 @@ progression: object$1({
|
|
|
5469
5487
|
canvasParentSizeBoundSchema
|
|
5470
5488
|
]).optional(),
|
|
5471
5489
|
flowOffset: canvasFlowOffsetSchema.optional(),
|
|
5490
|
+
positionParent: canvasPositionParentSchema.optional(),
|
|
5472
5491
|
order: canvasNumberSchema.int().optional(),
|
|
5473
5492
|
margin: canvasFlexMarginSchema.partial().optional(),
|
|
5474
5493
|
clipContent: boolean$1().optional(),
|
|
5475
5494
|
baselineSource: canvasBaselineSourceSchema.optional(),
|
|
5495
|
+
scrollbarGutter: canvasScrollbarGutterSchema.optional(),
|
|
5476
5496
|
container: canvasFlexLayoutSchema.partial().extend({ padding: canvasFlexPaddingSchema.partial().optional() }).optional()
|
|
5477
5497
|
}).strict();
|
|
5478
5498
|
//#endregion
|
|
@@ -6102,7 +6122,7 @@ progression: object$1({
|
|
|
6102
6122
|
//#endregion
|
|
6103
6123
|
//#region ../contract/src/canvas/canvas-scene.schema.ts
|
|
6104
6124
|
const CANVAS_COMPOSITING_RETIRED = "Update Enhance: compositing is no longer supported. Use the isolation style or a mask group.";
|
|
6105
|
-
const canvasDocumentFormatSchema = literal$1(
|
|
6125
|
+
const canvasDocumentFormatSchema = literal$1(15, { error: "This editor uses an unsupported document format. Update the editor before changing this canvas." });
|
|
6106
6126
|
object$1({
|
|
6107
6127
|
signature: string$1().regex(/^[a-f0-9]{16}$/u),
|
|
6108
6128
|
/** The captured picture of the page's text, inline as written or as its canvas image store path. */
|
|
@@ -6153,7 +6173,7 @@ progression: object$1({
|
|
|
6153
6173
|
box: canvasSceneBoxSchema.optional()
|
|
6154
6174
|
});
|
|
6155
6175
|
const canvasSceneDocumentSchema = object$1({
|
|
6156
|
-
version: literal$1(
|
|
6176
|
+
version: literal$1(15),
|
|
6157
6177
|
nodes: record(string$1(), canvasSceneNodeSchema),
|
|
6158
6178
|
relationships: record(string$1(), object$1({
|
|
6159
6179
|
parentId: string$1().min(1),
|
|
@@ -6169,7 +6189,7 @@ progression: object$1({
|
|
|
6169
6189
|
return adaptCanvasDocumentFormat(blob);
|
|
6170
6190
|
}, canvasSceneDocumentSchema);
|
|
6171
6191
|
const emptyCanvasSceneDocument = () => ({
|
|
6172
|
-
version:
|
|
6192
|
+
version: 15,
|
|
6173
6193
|
nodes: { root: {
|
|
6174
6194
|
id: "root",
|
|
6175
6195
|
label: "Canvas",
|
|
@@ -6261,14 +6281,25 @@ progression: object$1({
|
|
|
6261
6281
|
nodeCount: draft.nodes.length
|
|
6262
6282
|
}
|
|
6263
6283
|
}));
|
|
6264
|
-
|
|
6284
|
+
/** A capture that lands as a new editable frame on a page, with no screen layer. */
|
|
6285
|
+
const editableFrameCaptureSchema = object$1({
|
|
6286
|
+
screenId: string$1().min(1),
|
|
6287
|
+
pageId: string$1().min(1)
|
|
6288
|
+
});
|
|
6289
|
+
const editableFrameInputBase = {
|
|
6265
6290
|
canvasId: uuid$1(),
|
|
6266
6291
|
documentFormatVersion: canvasDocumentFormatSchema,
|
|
6267
6292
|
mutationId: uuid$1(),
|
|
6268
6293
|
baseVersion: number$2().int().positive(),
|
|
6269
|
-
screenNodeId: string$1().min(1),
|
|
6270
6294
|
draft: canvasSubtreeDraftSchema
|
|
6271
|
-
}
|
|
6295
|
+
};
|
|
6296
|
+
union$1([strictObject({
|
|
6297
|
+
...editableFrameInputBase,
|
|
6298
|
+
screenNodeId: string$1().min(1).describe("The screen layer to convert beside itself.")
|
|
6299
|
+
}), strictObject({
|
|
6300
|
+
...editableFrameInputBase,
|
|
6301
|
+
capture: editableFrameCaptureSchema.describe("The stored page a new capture lands from, and the page its frame goes on.")
|
|
6302
|
+
})]);
|
|
6272
6303
|
const createEditableFrameResultSchema = object$1({
|
|
6273
6304
|
canvasId: uuid$1(),
|
|
6274
6305
|
mutationId: uuid$1(),
|
|
@@ -6373,7 +6404,10 @@ progression: object$1({
|
|
|
6373
6404
|
recordingId: uuid$1(),
|
|
6374
6405
|
atMs: number$2().int().nonnegative(),
|
|
6375
6406
|
screenId: uuid$1(),
|
|
6376
|
-
|
|
6407
|
+
/** Null when the snapshot asked for a place only, so no screen layer was added. */
|
|
6408
|
+
screenNodeId: string$1().min(1).nullable(),
|
|
6409
|
+
/** The page the place is on. */
|
|
6410
|
+
pageId: string$1().min(1).optional(),
|
|
6377
6411
|
viewport: object$1({
|
|
6378
6412
|
width: number$2().int().positive(),
|
|
6379
6413
|
height: number$2().int().positive()
|
|
@@ -6537,7 +6571,11 @@ progression: object$1({
|
|
|
6537
6571
|
pageId: string$1().min(1).optional(),
|
|
6538
6572
|
nodeIds: array$1(string$1().min(1))
|
|
6539
6573
|
}),
|
|
6540
|
-
|
|
6574
|
+
/**
|
|
6575
|
+
* Below the walkthrough: as a screen layer, which installed CLIs ask for, or as a place only,
|
|
6576
|
+
* where the agent's CLI lands an editable frame.
|
|
6577
|
+
*/
|
|
6578
|
+
placement: strictObject({ kind: _enum$1(["below-source", "editable-below-source"]) })
|
|
6541
6579
|
});
|
|
6542
6580
|
object$1({
|
|
6543
6581
|
canvasId: uuid$1(),
|
|
@@ -6803,6 +6841,21 @@ progression: object$1({
|
|
|
6803
6841
|
"text-align": textStyleValues["text-align"].optional(),
|
|
6804
6842
|
"white-space": textStyleValues["white-space"].optional()
|
|
6805
6843
|
});
|
|
6844
|
+
/** Every alignment a browser computes, which conversion stores and Undo must be able to put back. */
|
|
6845
|
+
const storedTextAlignSchema = _enum$1([
|
|
6846
|
+
"start",
|
|
6847
|
+
"end",
|
|
6848
|
+
"left",
|
|
6849
|
+
"right",
|
|
6850
|
+
"center",
|
|
6851
|
+
"justify",
|
|
6852
|
+
"justify-all",
|
|
6853
|
+
"match-parent",
|
|
6854
|
+
"-webkit-left",
|
|
6855
|
+
"-webkit-right",
|
|
6856
|
+
"-webkit-center"
|
|
6857
|
+
]);
|
|
6858
|
+
const storedFontStyleSchema = union$1([textStyleValues["font-style"], string$1().regex(/^oblique -?(?:\d+(?:\.\d+)?|\.\d+)deg$/u)]);
|
|
6806
6859
|
const restorableTextStyleValue = union$1([canvasAdditionalStyleSchema.shape.value, canvasNumberSchema]).nullable().optional();
|
|
6807
6860
|
const canvasTextStylePatchSchema = strictObject({
|
|
6808
6861
|
"text-decoration": restorableTextStyleValue,
|
|
@@ -6825,7 +6878,7 @@ progression: object$1({
|
|
|
6825
6878
|
"text-box": canvasAdditionalStyleSchema.shape.value.nullable().optional(),
|
|
6826
6879
|
"text-box-trim": canvasAdditionalStyleSchema.shape.value.nullable().optional(),
|
|
6827
6880
|
"text-box-edge": canvasAdditionalStyleSchema.shape.value.nullable().optional(),
|
|
6828
|
-
"font-style":
|
|
6881
|
+
"font-style": storedFontStyleSchema.nullable().optional(),
|
|
6829
6882
|
"font-stretch": union$1([_enum$1([
|
|
6830
6883
|
"normal",
|
|
6831
6884
|
"ultra-condensed",
|
|
@@ -6843,14 +6896,22 @@ progression: object$1({
|
|
|
6843
6896
|
literal$1("normal")
|
|
6844
6897
|
]).nullable().optional(),
|
|
6845
6898
|
"line-height": textStyleValues["line-height"].nullable().optional(),
|
|
6846
|
-
"text-align":
|
|
6899
|
+
"text-align": storedTextAlignSchema.nullable().optional(),
|
|
6847
6900
|
"text-indent": union$1([canvasNumberSchema, signedPixelLengthSchema]).nullable().optional(),
|
|
6848
6901
|
"white-space": textStyleValues["white-space"].nullable().optional(),
|
|
6849
6902
|
"word-spacing": union$1([
|
|
6850
6903
|
canvasNumberSchema,
|
|
6851
6904
|
signedPixelLengthSchema,
|
|
6852
6905
|
literal$1("normal")
|
|
6853
|
-
]).nullable().optional()
|
|
6906
|
+
]).nullable().optional(),
|
|
6907
|
+
direction: restorableTextStyleValue,
|
|
6908
|
+
"unicode-bidi": restorableTextStyleValue,
|
|
6909
|
+
"hanging-punctuation": restorableTextStyleValue,
|
|
6910
|
+
"text-transform": restorableTextStyleValue,
|
|
6911
|
+
"-webkit-text-stroke": restorableTextStyleValue,
|
|
6912
|
+
"-webkit-text-stroke-width": restorableTextStyleValue,
|
|
6913
|
+
"-webkit-text-stroke-color": restorableTextStyleValue,
|
|
6914
|
+
"paint-order": restorableTextStyleValue
|
|
6854
6915
|
});
|
|
6855
6916
|
const overflowStyleValue = canvasAdditionalStyleSchema.shape.value;
|
|
6856
6917
|
const dimensionalStyleValue = union$1([string$1(), canvasNumberSchema]);
|
|
@@ -7404,7 +7465,7 @@ progression: object$1({
|
|
|
7404
7465
|
kind: string$1().min(1).max(100),
|
|
7405
7466
|
parentId: string$1().min(1).nullable(),
|
|
7406
7467
|
childCount: number$2().int().min(0),
|
|
7407
|
-
box:
|
|
7468
|
+
box: canvasSceneBoxSchema.nullable(),
|
|
7408
7469
|
propertySections: array$1(canvasPropertySectionSchema)
|
|
7409
7470
|
});
|
|
7410
7471
|
object$1({ canvasId: uuid$1() });
|
|
@@ -7415,7 +7476,7 @@ progression: object$1({
|
|
|
7415
7476
|
version: number$2().int().positive(),
|
|
7416
7477
|
nodeCount: number$2().int().min(0),
|
|
7417
7478
|
rootChildCount: number$2().int().min(0),
|
|
7418
|
-
bounds:
|
|
7479
|
+
bounds: canvasSceneBoxSchema.nullable(),
|
|
7419
7480
|
kinds: record(string$1(), number$2().int().min(0)),
|
|
7420
7481
|
next: array$1(string$1().min(1))
|
|
7421
7482
|
});
|
|
@@ -10842,6 +10903,10 @@ progression: object$1({
|
|
|
10842
10903
|
};
|
|
10843
10904
|
};
|
|
10844
10905
|
//#endregion
|
|
10906
|
+
//#region ../contract/src/recording/captured-color-scheme.lib.ts
|
|
10907
|
+
const CAPTURED_COLOR_SCHEME_ATTRIBUTE = "data-enhance-captured-color-scheme";
|
|
10908
|
+
const capturedColorSchemeIn = (value) => value === "light" || value === "dark" ? value : null;
|
|
10909
|
+
//#endregion
|
|
10845
10910
|
//#region ../contract/src/recording/captured-font-evidence.lib.ts
|
|
10846
10911
|
const CAPTURED_LOADED_FONTS_ATTRIBUTE = "data-enhance-loaded-captured-fonts";
|
|
10847
10912
|
const CAPTURED_UNAVAILABLE_FONTS_ATTRIBUTE = "data-enhance-unavailable-captured-fonts";
|
|
@@ -12071,6 +12136,8 @@ unreadableCount: number$2().int().min(0) });
|
|
|
12071
12136
|
});
|
|
12072
12137
|
object$1({
|
|
12073
12138
|
screenId: uuid$1(),
|
|
12139
|
+
/** Where the screen's files are stored; a capture names its stored copies by it. */
|
|
12140
|
+
assetBundleId: uuid$1().nullable(),
|
|
12074
12141
|
/** Re-issued on every call, because the usual reason for a retry is an expired presign. */
|
|
12075
12142
|
upload: signedUploadSchema,
|
|
12076
12143
|
alreadyExists: boolean$1(),
|
|
@@ -12369,6 +12436,7 @@ unreadableCount: number$2().int().min(0) });
|
|
|
12369
12436
|
"clipboard-image-pending",
|
|
12370
12437
|
"clipboard-image-unavailable",
|
|
12371
12438
|
"edit-target-unsupported",
|
|
12439
|
+
"edit-result-invalid",
|
|
12372
12440
|
"react-hook-order",
|
|
12373
12441
|
"menu-rows-unsupported"
|
|
12374
12442
|
]),
|
|
@@ -12684,7 +12752,8 @@ unreadableCount: number$2().int().min(0) });
|
|
|
12684
12752
|
"delivered",
|
|
12685
12753
|
"failed",
|
|
12686
12754
|
"disabled",
|
|
12687
|
-
"no-identity"
|
|
12755
|
+
"no-identity",
|
|
12756
|
+
"expired"
|
|
12688
12757
|
]).optional()
|
|
12689
12758
|
});
|
|
12690
12759
|
discriminatedUnion$1("type", [object$1({ type: literal$1("enhance3:extension-probe") }).strict(), object$1({ type: literal$1("enhance3:extension-present") }).strict()]);
|
|
@@ -17771,6 +17840,24 @@ unreadableCount: number$2().int().min(0) });
|
|
|
17771
17840
|
style: `${typeof style === "string" ? style : ""};${rootStyle}`
|
|
17772
17841
|
};
|
|
17773
17842
|
};
|
|
17843
|
+
/**
|
|
17844
|
+
* The scheme the page showed. A replay's `matchMedia` answers for its viewer, so a capture from one
|
|
17845
|
+
* keeps the replay's fact. A document with no media queries to ask records no scheme, and its
|
|
17846
|
+
* screen behaves as a screen captured before schemes were recorded: it follows its viewer.
|
|
17847
|
+
*/
|
|
17848
|
+
const captureColorScheme = (document) => {
|
|
17849
|
+
const recorded = capturedColorSchemeIn(document.documentElement.getAttribute(CAPTURED_COLOR_SCHEME_ATTRIBUTE));
|
|
17850
|
+
if (recorded !== null) return recorded;
|
|
17851
|
+
const view = document.defaultView;
|
|
17852
|
+
const matchMedia = view === null ? void 0 : Reflect.get(view, "matchMedia");
|
|
17853
|
+
if (view === null || typeof matchMedia !== "function") return void 0;
|
|
17854
|
+
const query = Reflect.apply(matchMedia, view, ["(prefers-color-scheme: dark)"]);
|
|
17855
|
+
return typeof query === "object" && query !== null && Reflect.get(query, "matches") === true ? "dark" : "light";
|
|
17856
|
+
};
|
|
17857
|
+
const withColorScheme = (attributes, colorScheme) => colorScheme === void 0 ? attributes : {
|
|
17858
|
+
...attributes,
|
|
17859
|
+
[CAPTURED_COLOR_SCHEME_ATTRIBUTE]: colorScheme
|
|
17860
|
+
};
|
|
17774
17861
|
//#endregion
|
|
17775
17862
|
//#region ../capture-browser/src/shadow-adopted-stylesheets.lib.ts
|
|
17776
17863
|
/** @justified clarification This must follow rrweb's host traversal order. */
|
|
@@ -17798,7 +17885,6 @@ unreadableCount: number$2().int().min(0) });
|
|
|
17798
17885
|
}));
|
|
17799
17886
|
//#endregion
|
|
17800
17887
|
//#region ../capture-browser/src/stylesheet-snapshot-hint.lib.ts
|
|
17801
|
-
const COLOR_SCHEME_MEDIA = /\bprefers-color-scheme\s*:/iu;
|
|
17802
17888
|
const stylesheetSnapshotKey = (url) => {
|
|
17803
17889
|
const location = Reflect.get(globalThis, "location");
|
|
17804
17890
|
const href = typeof location === "object" && location !== null ? Reflect.get(location, "href") : void 0;
|
|
@@ -17807,12 +17893,6 @@ unreadableCount: number$2().int().min(0) });
|
|
|
17807
17893
|
const leaf = parsed.pathname.slice(parsed.pathname.lastIndexOf("/") + 1);
|
|
17808
17894
|
return `${parsed.origin}/${leaf}${parsed.search}`;
|
|
17809
17895
|
};
|
|
17810
|
-
const freezeColorSchemeMedia = (rules, isMatching) => [...rules].map((rule) => {
|
|
17811
|
-
const condition = rule.conditionText;
|
|
17812
|
-
if (typeof condition !== "string" || !COLOR_SCHEME_MEDIA.test(condition) || rule.cssRules === void 0) return rule.cssText;
|
|
17813
|
-
if (!isMatching(condition)) return "";
|
|
17814
|
-
return freezeColorSchemeMedia(rule.cssRules, isMatching);
|
|
17815
|
-
}).join("\n");
|
|
17816
17896
|
const EMPTY_SERIALIZED_DECLARATION = /[{;]\s*[-\w]+\s*:\s*;/u;
|
|
17817
17897
|
const canRoundTripSerializedCss = (cssText) => !EMPTY_SERIALIZED_DECLARATION.test(cssText);
|
|
17818
17898
|
/** @justified clarification Chromium can erase a valid custom-property shorthand. */
|
|
@@ -17820,7 +17900,7 @@ unreadableCount: number$2().int().min(0) });
|
|
|
17820
17900
|
if (!canRoundTripSerializedCss(rule.cssText)) return false;
|
|
17821
17901
|
return rule.cssRules === void 0 || canRoundTripCssRules(rule.cssRules);
|
|
17822
17902
|
});
|
|
17823
|
-
const serializedCssText = (rules, baseHref) => rewriteCssAssetUrls(
|
|
17903
|
+
const serializedCssText = (rules, baseHref) => rewriteCssAssetUrls([...rules].map((rule) => rule.cssText).join("\n"), /* @__PURE__ */ new Map(), baseHref);
|
|
17824
17904
|
const linkedStylesheetCssText = (sheet, baseHref) => {
|
|
17825
17905
|
try {
|
|
17826
17906
|
const rules = sheet?.cssRules;
|
|
@@ -17889,12 +17969,14 @@ unreadableCount: number$2().int().min(0) });
|
|
|
17889
17969
|
};
|
|
17890
17970
|
const captureSnapshotHints = (document = globalThis.document) => {
|
|
17891
17971
|
const stylesheets = capturedStylesheets(document);
|
|
17972
|
+
const colorScheme = captureColorScheme(document);
|
|
17892
17973
|
return {
|
|
17893
17974
|
adoptedStyleSheets: capturedAdoptedStyleSheets(document, document.baseURI),
|
|
17894
17975
|
inlinedStylesheets: stylesheets.inlined,
|
|
17895
17976
|
shadowAdoptedStyleSheets: captureShadowAdoptedStyleSheets(document, capturedAdoptedStyleSheets),
|
|
17896
17977
|
stylesheets: stylesheets.byKey,
|
|
17897
|
-
rootStyle: captureRootStyle(document)
|
|
17978
|
+
rootStyle: captureRootStyle(document),
|
|
17979
|
+
...colorScheme !== void 0 && { colorScheme }
|
|
17898
17980
|
};
|
|
17899
17981
|
};
|
|
17900
17982
|
//#endregion
|
|
@@ -17931,7 +18013,7 @@ unreadableCount: number$2().int().min(0) });
|
|
|
17931
18013
|
};
|
|
17932
18014
|
const hintAttributes = (node, attributes, context) => {
|
|
17933
18015
|
if (attributes === null) return null;
|
|
17934
|
-
const hinted = node["tagName"] === "link" ? hintLinkAttributes(attributes, context.hints, context.stylesheetUses, context.inlinedStylesheets.take) : node["tagName"] === "html" ? withRootStyle(attributes, context.hints.rootStyle) : attributes;
|
|
18016
|
+
const hinted = node["tagName"] === "link" ? hintLinkAttributes(attributes, context.hints, context.stylesheetUses, context.inlinedStylesheets.take) : node["tagName"] === "html" ? withColorScheme(withRootStyle(attributes, context.hints.rootStyle), context.hints.colorScheme) : attributes;
|
|
17935
18017
|
const id = node["id"];
|
|
17936
18018
|
const corrected = typeof id === "number" ? withPresentationStyle(hinted, context.cssomStyleCorrections.get(id)) : hinted;
|
|
17937
18019
|
const presented = typeof id === "number" ? withPresentationStyle(corrected, context.presentationStyles.get(id)) : corrected;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as CaptureArtifact, f as CaptureReceipt, h as beginCaptureRunInputSchema, l as CaptureBlob, m as CaptureVerdict, n as captureReferenceSchema, p as CaptureRunDescriptor, r as updateCaptureReferenceInputSchema, s as BeginCaptureRunInput, t as CaptureReview, v as getCaptureRunOutputSchema } from "./index-
|
|
1
|
+
import { c as CaptureArtifact, f as CaptureReceipt, h as beginCaptureRunInputSchema, l as CaptureBlob, m as CaptureVerdict, n as captureReferenceSchema, p as CaptureRunDescriptor, r as updateCaptureReferenceInputSchema, s as BeginCaptureRunInput, t as CaptureReview, v as getCaptureRunOutputSchema } from "./index-CDKItTQW.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/core/not-uploaded.types.d.ts
|
|
4
4
|
/** A file the SDK gave up uploading, named by its address or by the capture it belongs to. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as captureSelection, C as isCaptureError, E as updateCaptureReferenceInputSchema, H as captureRunDescriptorSchema, L as beginCaptureRunInputSchema, R as beginCaptureRunOutputSchema, S as captureError, T as captureReviewSchema, U as getCaptureRunOutputSchema, W as reserveCaptureBlobsOutputSchema, _ as writeCapturePayload, a as requestOutcomeOf, d as captureDiagnostics, g as writeCaptureJson, h as writeCaptureBlob, j as mergeCaptureManifests, k as captureBlobs, m as verifiedCaptureBlobPath, n as retrying, o as retryAfterMsOf, p as readCaptureManifest, t as startStallWatch, w as captureReferenceSchema, x as captureManifestDigest } from "./stall-watch.lib-
|
|
1
|
+
import { A as captureSelection, C as isCaptureError, E as updateCaptureReferenceInputSchema, H as captureRunDescriptorSchema, L as beginCaptureRunInputSchema, R as beginCaptureRunOutputSchema, S as captureError, T as captureReviewSchema, U as getCaptureRunOutputSchema, W as reserveCaptureBlobsOutputSchema, _ as writeCapturePayload, a as requestOutcomeOf, d as captureDiagnostics, g as writeCaptureJson, h as writeCaptureBlob, j as mergeCaptureManifests, k as captureBlobs, m as verifiedCaptureBlobPath, n as retrying, o as retryAfterMsOf, p as readCaptureManifest, t as startStallWatch, w as captureReferenceSchema, x as captureManifestDigest } from "./stall-watch.lib-DgIzqC3b.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { mkdir } from "node:fs/promises";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as captureRunDescriptorSchema, S as captureError } from "./stall-watch.lib-
|
|
1
|
+
import { H as captureRunDescriptorSchema, S as captureError } from "./stall-watch.lib-DgIzqC3b.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import nodePath from "node:path";
|
package/dist/client.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createEnhance, i as PublishManifestOptions, n as CaptureRun, o as CapturePublication, r as EnhanceClient, s as CaptureClientOptions, t as BeginCaptureRun } from "./capture-client.client
|
|
1
|
+
import { a as createEnhance, i as PublishManifestOptions, n as CaptureRun, o as CapturePublication, r as EnhanceClient, s as CaptureClientOptions, t as BeginCaptureRun } from "./capture-client.client-B5R1OWuh.mjs";
|
|
2
2
|
export { BeginCaptureRun, type CaptureClientOptions, type CapturePublication, CaptureRun, EnhanceClient, PublishManifestOptions, createEnhance };
|
package/dist/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createEnhance } from "./capture-client.client-
|
|
1
|
+
import { t as createEnhance } from "./capture-client.client-BM_NxOqy.mjs";
|
|
2
2
|
export { createEnhance };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as EnhanceClient, s as CaptureClientOptions$1 } from "./capture-client.client
|
|
1
|
+
import { r as EnhanceClient, s as CaptureClientOptions$1 } from "./capture-client.client-B5R1OWuh.mjs";
|
|
2
2
|
//#region src/node/environment.config.d.ts
|
|
3
3
|
type CaptureEnvironment = 'local' | 'development' | 'production';
|
|
4
4
|
interface CaptureConnectionOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as captureError } from "./stall-watch.lib-
|
|
2
|
-
import { t as version } from "./package-
|
|
3
|
-
import { t as createEnhance$1 } from "./capture-client.client-
|
|
1
|
+
import { S as captureError } from "./stall-watch.lib-DgIzqC3b.mjs";
|
|
2
|
+
import { t as version } from "./package-BFIjCgBc.mjs";
|
|
3
|
+
import { t as createEnhance$1 } from "./capture-client.client-BM_NxOqy.mjs";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
//#region src/node/environment.config.ts
|
|
6
6
|
const endpoints = {
|
|
@@ -166,8 +166,8 @@ declare const captureManifestSchema: z.ZodObject<{
|
|
|
166
166
|
status: z.ZodEnum<{
|
|
167
167
|
passed: "passed";
|
|
168
168
|
failed: "failed";
|
|
169
|
-
skipped: "skipped";
|
|
170
169
|
interrupted: "interrupted";
|
|
170
|
+
skipped: "skipped";
|
|
171
171
|
timedOut: "timedOut";
|
|
172
172
|
}>;
|
|
173
173
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -247,8 +247,8 @@ declare const captureManifestSchema: z.ZodObject<{
|
|
|
247
247
|
status: z.ZodEnum<{
|
|
248
248
|
passed: "passed";
|
|
249
249
|
failed: "failed";
|
|
250
|
-
skipped: "skipped";
|
|
251
250
|
interrupted: "interrupted";
|
|
251
|
+
skipped: "skipped";
|
|
252
252
|
timedOut: "timedOut";
|
|
253
253
|
}>;
|
|
254
254
|
title: z.ZodOptional<z.ZodString>;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as captureManifestSchema, a as mergeCaptureManifests, c as CaptureArtifact, d as CaptureManifest, f as CaptureReceipt, g as captureArtifactSchema, i as captureSelection, m as CaptureVerdict, o as selectedCaptures, p as CaptureRunDescriptor, t as CaptureReview, u as CaptureLeftOut } from "./index-
|
|
2
|
-
import { c as CapturePayload, l as NotUploadedFile, n as CaptureRun, r as EnhanceClient, t as BeginCaptureRun } from "./capture-client.client
|
|
3
|
-
import { i as createEnhance, r as CaptureEnvironment, t as CaptureClientOptions } from "./environment.config-
|
|
1
|
+
import { _ as captureManifestSchema, a as mergeCaptureManifests, c as CaptureArtifact, d as CaptureManifest, f as CaptureReceipt, g as captureArtifactSchema, i as captureSelection, m as CaptureVerdict, o as selectedCaptures, p as CaptureRunDescriptor, t as CaptureReview, u as CaptureLeftOut } from "./index-CDKItTQW.mjs";
|
|
2
|
+
import { c as CapturePayload, l as NotUploadedFile, n as CaptureRun, r as EnhanceClient, t as BeginCaptureRun } from "./capture-client.client-B5R1OWuh.mjs";
|
|
3
|
+
import { i as createEnhance, r as CaptureEnvironment, t as CaptureClientOptions } from "./environment.config-30cIR7iz.mjs";
|
|
4
4
|
//#region src/core/capture-error.error.d.ts
|
|
5
5
|
type CaptureErrorCode = 'configuration' | 'capture' | 'artifact' | 'authorization' | 'conversion' | 'conflict' | 'pending' | 'transport';
|
|
6
6
|
interface CaptureError extends Error {
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as captureSelection, M as selectedCaptures, V as captureManifestSchema, j as mergeCaptureManifests, z as captureArtifactSchema } from "./stall-watch.lib-
|
|
2
|
-
import { t as createEnhance } from "./environment.config-
|
|
1
|
+
import { A as captureSelection, M as selectedCaptures, V as captureManifestSchema, j as mergeCaptureManifests, z as captureArtifactSchema } from "./stall-watch.lib-DgIzqC3b.mjs";
|
|
2
|
+
import { t as createEnhance } from "./environment.config-BlBA4N5X.mjs";
|
|
3
3
|
export { captureArtifactSchema, captureManifestSchema, captureSelection, createEnhance, mergeCaptureManifests, selectedCaptures };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as fitCaptureNames, F as filesNotCopiedIssue, I as pageNotSettledIssue, N as canonicalCaptureJson, O as leftOutCapture, P as CAPTURE_LEFT_OUT_REASONS, S as captureError, _ as writeCapturePayload, a as requestOutcomeOf, b as captureFileDigest, c as isReplayAssetContentType, d as captureDiagnostics, f as placeCaptureFile, h as writeCaptureBlob, i as requestFailureOfTransfer, l as inlineDataAssetReference, n as retrying, r as requestFailureOfReply, s as collectCssAssetUrls, t as startStallWatch, u as captureBlobPath, v as writeCaptureStream, y as captureBlobDigest, z as captureArtifactSchema } from "../stall-watch.lib-
|
|
2
|
-
import { t as version } from "../package-
|
|
3
|
-
import { n as awaitCaptureRun, r as captureContextDirectory, t as LEFT_OUT_ATTACHMENT } from "../capture-context.lib-
|
|
1
|
+
import { D as fitCaptureNames, F as filesNotCopiedIssue, I as pageNotSettledIssue, N as canonicalCaptureJson, O as leftOutCapture, P as CAPTURE_LEFT_OUT_REASONS, S as captureError, _ as writeCapturePayload, a as requestOutcomeOf, b as captureFileDigest, c as isReplayAssetContentType, d as captureDiagnostics, f as placeCaptureFile, h as writeCaptureBlob, i as requestFailureOfTransfer, l as inlineDataAssetReference, n as retrying, r as requestFailureOfReply, s as collectCssAssetUrls, t as startStallWatch, u as captureBlobPath, v as writeCaptureStream, y as captureBlobDigest, z as captureArtifactSchema } from "../stall-watch.lib-DgIzqC3b.mjs";
|
|
2
|
+
import { t as version } from "../package-BFIjCgBc.mjs";
|
|
3
|
+
import { n as awaitCaptureRun, r as captureContextDirectory, t as LEFT_OUT_ATTACHMENT } from "../capture-context.lib-LXUORfkL.mjs";
|
|
4
4
|
import { mkdir, mkdtemp, readFile, rm, stat, writeFile } from "node:fs/promises";
|
|
5
5
|
import nodePath from "node:path";
|
|
6
6
|
import { openAsBlob } from "node:fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { p as CaptureRunDescriptor } from "../index-
|
|
2
|
-
import { t as BeginCaptureRun } from "../capture-client.client
|
|
3
|
-
import { n as CaptureConnectionOptions } from "../environment.config-
|
|
1
|
+
import { p as CaptureRunDescriptor } from "../index-CDKItTQW.mjs";
|
|
2
|
+
import { t as BeginCaptureRun } from "../capture-client.client-B5R1OWuh.mjs";
|
|
3
|
+
import { n as CaptureConnectionOptions } from "../environment.config-30cIR7iz.mjs";
|
|
4
4
|
import { Reporter } from "@playwright/test/reporter";
|
|
5
5
|
//#region src/playwright/capture-reporter.lib.d.ts
|
|
6
6
|
interface EnhanceReporterOptions extends CaptureConnectionOptions, Omit<BeginCaptureRun, 'runKey'> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as captureLeftOutSchema, C as isCaptureError, D as fitCaptureNames, O as leftOutCapture, P as CAPTURE_LEFT_OUT_REASONS, d as captureDiagnostics, g as writeCaptureJson, z as captureArtifactSchema } from "../stall-watch.lib-
|
|
2
|
-
import { t as createEnhance } from "../environment.config-
|
|
3
|
-
import { i as setCaptureDirectory } from "../capture-context.lib-
|
|
1
|
+
import { B as captureLeftOutSchema, C as isCaptureError, D as fitCaptureNames, O as leftOutCapture, P as CAPTURE_LEFT_OUT_REASONS, d as captureDiagnostics, g as writeCaptureJson, z as captureArtifactSchema } from "../stall-watch.lib-DgIzqC3b.mjs";
|
|
2
|
+
import { t as createEnhance } from "../environment.config-BlBA4N5X.mjs";
|
|
3
|
+
import { i as setCaptureDirectory } from "../capture-context.lib-LXUORfkL.mjs";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import { mkdir, readFile } from "node:fs/promises";
|
|
6
6
|
import nodePath from "node:path";
|
|
@@ -842,7 +842,8 @@ const LEGACY_CANVAS_FORMATS = {
|
|
|
842
842
|
v10: 10,
|
|
843
843
|
v11: 11,
|
|
844
844
|
v12: 12,
|
|
845
|
-
v13: 13
|
|
845
|
+
v13: 13,
|
|
846
|
+
v14: 14
|
|
846
847
|
};
|
|
847
848
|
const LEGACY_CANVAS_ADAPTATIONS = {
|
|
848
849
|
[LEGACY_CANVAS_FORMATS.v1]: "layout",
|
|
@@ -857,7 +858,8 @@ const LEGACY_CANVAS_ADAPTATIONS = {
|
|
|
857
858
|
[LEGACY_CANVAS_FORMATS.v10]: "geometry",
|
|
858
859
|
[LEGACY_CANVAS_FORMATS.v11]: "css",
|
|
859
860
|
[LEGACY_CANVAS_FORMATS.v12]: "text-shadow-blend",
|
|
860
|
-
[LEGACY_CANVAS_FORMATS.v13]: "format-number"
|
|
861
|
+
[LEGACY_CANVAS_FORMATS.v13]: "format-number",
|
|
862
|
+
[LEGACY_CANVAS_FORMATS.v14]: "format-number"
|
|
861
863
|
};
|
|
862
864
|
//#endregion
|
|
863
865
|
//#region ../canvas-format/src/canvas-edit-support.lib.ts
|
|
@@ -1115,7 +1117,7 @@ const withoutTextShadowBlends = (document) => {
|
|
|
1115
1117
|
};
|
|
1116
1118
|
//#endregion
|
|
1117
1119
|
//#region ../canvas-format/src/canvas-format.lib.ts
|
|
1118
|
-
const READABLE_FORMATS = /* @__PURE__ */ new Set([...Object.values(LEGACY_CANVAS_FORMATS),
|
|
1120
|
+
const READABLE_FORMATS = /* @__PURE__ */ new Set([...Object.values(LEGACY_CANVAS_FORMATS), 15]);
|
|
1119
1121
|
const isReadableCanvasFormat = (version) => READABLE_FORMATS.has(version);
|
|
1120
1122
|
/** Formats whose adaptation rewrites the stored document in place, keeping its geometry. */
|
|
1121
1123
|
const ADAPTED_IN_PLACE = /* @__PURE__ */ new Set([
|
|
@@ -1139,20 +1141,20 @@ const legacyLayout = (layout) => {
|
|
|
1139
1141
|
const adaptLegacyFormat = (document) => {
|
|
1140
1142
|
const version = document["version"];
|
|
1141
1143
|
if (!isReadableCanvasFormat(version)) return null;
|
|
1142
|
-
if (version ===
|
|
1144
|
+
if (version === 15 || !isRecord(document["nodes"])) return document;
|
|
1143
1145
|
const adaptation = Object.entries(LEGACY_CANVAS_ADAPTATIONS).find(([format]) => Number(format) === version)?.[1];
|
|
1144
1146
|
if (ADAPTED_IN_PLACE.has(adaptation)) return {
|
|
1145
1147
|
...document,
|
|
1146
|
-
version:
|
|
1148
|
+
version: 15
|
|
1147
1149
|
};
|
|
1148
1150
|
if (Object.values(document["nodes"]).some((node) => isRecord(node) && node["geometry"] !== void 0)) return null;
|
|
1149
1151
|
if (adaptation === "typography") return {
|
|
1150
1152
|
...document,
|
|
1151
|
-
version:
|
|
1153
|
+
version: 15
|
|
1152
1154
|
};
|
|
1153
1155
|
return {
|
|
1154
1156
|
...document,
|
|
1155
|
-
version:
|
|
1157
|
+
version: 15,
|
|
1156
1158
|
nodes: Object.fromEntries(Object.entries(document["nodes"]).map(([id, node]) => [id, isRecord(node) && node["layout"] !== void 0 ? {
|
|
1157
1159
|
...node,
|
|
1158
1160
|
layout: legacyLayout(node["layout"])
|
|
@@ -1160,15 +1162,15 @@ const adaptLegacyFormat = (document) => {
|
|
|
1160
1162
|
};
|
|
1161
1163
|
};
|
|
1162
1164
|
/**
|
|
1163
|
-
* Adapt known formats in memory, retaining malformed content for each boundary's validator.
|
|
1164
|
-
* 13
|
|
1165
|
-
*
|
|
1165
|
+
* Adapt known formats in memory, retaining malformed content for each boundary's validator. Formats
|
|
1166
|
+
* 13 and 14 differ from the current format only in the optional facts their layers cannot hold, so
|
|
1167
|
+
* they take only the new format number. Format 12 already has the CSS model, so it takes only the
|
|
1166
1168
|
* text shadow step that every older format takes after the CSS adaptation.
|
|
1167
1169
|
*/
|
|
1168
1170
|
const adaptCanvasDocumentFormat = (document) => {
|
|
1169
1171
|
const adapted = adaptLegacyFormat(document);
|
|
1170
1172
|
if (adapted === null || adapted === document) return adapted;
|
|
1171
|
-
if (document["version"] === LEGACY_CANVAS_FORMATS.v13) return adapted;
|
|
1173
|
+
if (document["version"] === LEGACY_CANVAS_FORMATS.v13 || document["version"] === LEGACY_CANVAS_FORMATS.v14) return adapted;
|
|
1172
1174
|
return withoutTextShadowBlends(document["version"] === LEGACY_CANVAS_FORMATS.v12 ? adapted : adaptCanvasCss(adapted));
|
|
1173
1175
|
};
|
|
1174
1176
|
z.strictObject({});
|
|
@@ -1691,6 +1693,22 @@ const canvasBaselineSourceSchema = z.object({
|
|
|
1691
1693
|
overflowClip: z.literal(true).optional(),
|
|
1692
1694
|
lineAboveBorderBottom: canvasNumberSchema.optional()
|
|
1693
1695
|
}).strict();
|
|
1696
|
+
/** The room a scroll container keeps for its scrollbars, per side, as conversion measured it. */
|
|
1697
|
+
const canvasScrollbarGutterSchema = z.object({
|
|
1698
|
+
top: nonNegativeCanvasNumberSchema.optional(),
|
|
1699
|
+
right: nonNegativeCanvasNumberSchema.optional(),
|
|
1700
|
+
bottom: nonNegativeCanvasNumberSchema.optional(),
|
|
1701
|
+
left: nonNegativeCanvasNumberSchema.optional()
|
|
1702
|
+
}).strict();
|
|
1703
|
+
/** A percentage of the containing block plus pixels; unlike a size limit, either may be negative. */
|
|
1704
|
+
const canvasParentRelativeCoordinateSchema = z.object({
|
|
1705
|
+
ratio: canvasNumberSchema,
|
|
1706
|
+
offset: canvasNumberSchema.optional()
|
|
1707
|
+
}).strict();
|
|
1708
|
+
const canvasPositionParentSchema = z.object({
|
|
1709
|
+
x: canvasParentRelativeCoordinateSchema.optional(),
|
|
1710
|
+
y: canvasParentRelativeCoordinateSchema.optional()
|
|
1711
|
+
}).strict();
|
|
1694
1712
|
const canvasNodeLayoutSchema = z.object({
|
|
1695
1713
|
rotation: canvasNumberSchema.optional(),
|
|
1696
1714
|
flipHorizontal: z.boolean().optional(),
|
|
@@ -1727,10 +1745,12 @@ const canvasNodeLayoutSchema = z.object({
|
|
|
1727
1745
|
canvasParentSizeBoundSchema
|
|
1728
1746
|
]).optional(),
|
|
1729
1747
|
flowOffset: canvasFlowOffsetSchema.optional(),
|
|
1748
|
+
positionParent: canvasPositionParentSchema.optional(),
|
|
1730
1749
|
order: canvasNumberSchema.int().optional(),
|
|
1731
1750
|
margin: canvasFlexMarginSchema.partial().optional(),
|
|
1732
1751
|
clipContent: z.boolean().optional(),
|
|
1733
1752
|
baselineSource: canvasBaselineSourceSchema.optional(),
|
|
1753
|
+
scrollbarGutter: canvasScrollbarGutterSchema.optional(),
|
|
1734
1754
|
container: canvasFlexLayoutSchema.partial().extend({ padding: canvasFlexPaddingSchema.partial().optional() }).optional()
|
|
1735
1755
|
}).strict();
|
|
1736
1756
|
//#endregion
|
|
@@ -2363,7 +2383,7 @@ const canvasGeometrySchema = z.discriminatedUnion("kind", [
|
|
|
2363
2383
|
//#endregion
|
|
2364
2384
|
//#region ../contract/src/canvas/canvas-scene.schema.ts
|
|
2365
2385
|
const CANVAS_COMPOSITING_RETIRED = "Update Enhance: compositing is no longer supported. Use the isolation style or a mask group.";
|
|
2366
|
-
const canvasDocumentFormatSchema = z.literal(
|
|
2386
|
+
const canvasDocumentFormatSchema = z.literal(15, { error: "This editor uses an unsupported document format. Update the editor before changing this canvas." });
|
|
2367
2387
|
z.object({
|
|
2368
2388
|
signature: z.string().regex(/^[a-f0-9]{16}$/u),
|
|
2369
2389
|
/** The captured picture of the page's text, inline as written or as its canvas image store path. */
|
|
@@ -2414,7 +2434,7 @@ const canvasSceneNodeSchema = z.looseObject({
|
|
|
2414
2434
|
box: canvasSceneBoxSchema.optional()
|
|
2415
2435
|
});
|
|
2416
2436
|
const canvasSceneDocumentSchema = z.object({
|
|
2417
|
-
version: z.literal(
|
|
2437
|
+
version: z.literal(15),
|
|
2418
2438
|
nodes: z.record(z.string(), canvasSceneNodeSchema),
|
|
2419
2439
|
relationships: z.record(z.string(), z.object({
|
|
2420
2440
|
parentId: z.string().min(1),
|
|
@@ -2430,7 +2450,7 @@ z.preprocess((value) => {
|
|
|
2430
2450
|
return adaptCanvasDocumentFormat(blob);
|
|
2431
2451
|
}, canvasSceneDocumentSchema);
|
|
2432
2452
|
const emptyCanvasSceneDocument = () => ({
|
|
2433
|
-
version:
|
|
2453
|
+
version: 15,
|
|
2434
2454
|
nodes: { root: {
|
|
2435
2455
|
id: "root",
|
|
2436
2456
|
label: "Canvas",
|
|
@@ -2522,14 +2542,25 @@ const canvasSubtreeDraftSchema = z.object({
|
|
|
2522
2542
|
nodeCount: draft.nodes.length
|
|
2523
2543
|
}
|
|
2524
2544
|
}));
|
|
2525
|
-
|
|
2545
|
+
/** A capture that lands as a new editable frame on a page, with no screen layer. */
|
|
2546
|
+
const editableFrameCaptureSchema = z.object({
|
|
2547
|
+
screenId: z.string().min(1),
|
|
2548
|
+
pageId: z.string().min(1)
|
|
2549
|
+
});
|
|
2550
|
+
const editableFrameInputBase = {
|
|
2526
2551
|
canvasId: z.uuid(),
|
|
2527
2552
|
documentFormatVersion: canvasDocumentFormatSchema,
|
|
2528
2553
|
mutationId: z.uuid(),
|
|
2529
2554
|
baseVersion: z.number().int().positive(),
|
|
2530
|
-
screenNodeId: z.string().min(1),
|
|
2531
2555
|
draft: canvasSubtreeDraftSchema
|
|
2532
|
-
}
|
|
2556
|
+
};
|
|
2557
|
+
z.union([z.strictObject({
|
|
2558
|
+
...editableFrameInputBase,
|
|
2559
|
+
screenNodeId: z.string().min(1).describe("The screen layer to convert beside itself.")
|
|
2560
|
+
}), z.strictObject({
|
|
2561
|
+
...editableFrameInputBase,
|
|
2562
|
+
capture: editableFrameCaptureSchema.describe("The stored page a new capture lands from, and the page its frame goes on.")
|
|
2563
|
+
})]);
|
|
2533
2564
|
const createEditableFrameResultSchema = z.object({
|
|
2534
2565
|
canvasId: z.uuid(),
|
|
2535
2566
|
mutationId: z.uuid(),
|
|
@@ -2634,7 +2665,10 @@ const canvasRenderSnapshotResultSchema = z.object({
|
|
|
2634
2665
|
recordingId: z.uuid(),
|
|
2635
2666
|
atMs: z.number().int().nonnegative(),
|
|
2636
2667
|
screenId: z.uuid(),
|
|
2637
|
-
|
|
2668
|
+
/** Null when the snapshot asked for a place only, so no screen layer was added. */
|
|
2669
|
+
screenNodeId: z.string().min(1).nullable(),
|
|
2670
|
+
/** The page the place is on. */
|
|
2671
|
+
pageId: z.string().min(1).optional(),
|
|
2638
2672
|
viewport: z.object({
|
|
2639
2673
|
width: z.number().int().positive(),
|
|
2640
2674
|
height: z.number().int().positive()
|
|
@@ -2799,7 +2833,11 @@ const canvasSnapshotRequestSchema = z.strictObject({
|
|
|
2799
2833
|
pageId: z.string().min(1).optional(),
|
|
2800
2834
|
nodeIds: z.array(z.string().min(1))
|
|
2801
2835
|
}),
|
|
2802
|
-
|
|
2836
|
+
/**
|
|
2837
|
+
* Below the walkthrough: as a screen layer, which installed CLIs ask for, or as a place only,
|
|
2838
|
+
* where the agent's CLI lands an editable frame.
|
|
2839
|
+
*/
|
|
2840
|
+
placement: z.strictObject({ kind: z.enum(["below-source", "editable-below-source"]) })
|
|
2803
2841
|
});
|
|
2804
2842
|
z.object({
|
|
2805
2843
|
canvasId: z.uuid(),
|
|
@@ -3066,6 +3104,21 @@ const canvasTextStylesSchema = z.strictObject({
|
|
|
3066
3104
|
"text-align": textStyleValues["text-align"].optional(),
|
|
3067
3105
|
"white-space": textStyleValues["white-space"].optional()
|
|
3068
3106
|
});
|
|
3107
|
+
/** Every alignment a browser computes, which conversion stores and Undo must be able to put back. */
|
|
3108
|
+
const storedTextAlignSchema = z.enum([
|
|
3109
|
+
"start",
|
|
3110
|
+
"end",
|
|
3111
|
+
"left",
|
|
3112
|
+
"right",
|
|
3113
|
+
"center",
|
|
3114
|
+
"justify",
|
|
3115
|
+
"justify-all",
|
|
3116
|
+
"match-parent",
|
|
3117
|
+
"-webkit-left",
|
|
3118
|
+
"-webkit-right",
|
|
3119
|
+
"-webkit-center"
|
|
3120
|
+
]);
|
|
3121
|
+
const storedFontStyleSchema = z.union([textStyleValues["font-style"], z.string().regex(/^oblique -?(?:\d+(?:\.\d+)?|\.\d+)deg$/u)]);
|
|
3069
3122
|
const restorableTextStyleValue = z.union([canvasAdditionalStyleSchema.shape.value, canvasNumberSchema]).nullable().optional();
|
|
3070
3123
|
const canvasTextStylePatchSchema = z.strictObject({
|
|
3071
3124
|
"text-decoration": restorableTextStyleValue,
|
|
@@ -3088,7 +3141,7 @@ const canvasTextStylePatchSchema = z.strictObject({
|
|
|
3088
3141
|
"text-box": canvasAdditionalStyleSchema.shape.value.nullable().optional(),
|
|
3089
3142
|
"text-box-trim": canvasAdditionalStyleSchema.shape.value.nullable().optional(),
|
|
3090
3143
|
"text-box-edge": canvasAdditionalStyleSchema.shape.value.nullable().optional(),
|
|
3091
|
-
"font-style":
|
|
3144
|
+
"font-style": storedFontStyleSchema.nullable().optional(),
|
|
3092
3145
|
"font-stretch": z.union([z.enum([
|
|
3093
3146
|
"normal",
|
|
3094
3147
|
"ultra-condensed",
|
|
@@ -3106,14 +3159,22 @@ const canvasTextStylePatchSchema = z.strictObject({
|
|
|
3106
3159
|
z.literal("normal")
|
|
3107
3160
|
]).nullable().optional(),
|
|
3108
3161
|
"line-height": textStyleValues["line-height"].nullable().optional(),
|
|
3109
|
-
"text-align":
|
|
3162
|
+
"text-align": storedTextAlignSchema.nullable().optional(),
|
|
3110
3163
|
"text-indent": z.union([canvasNumberSchema, signedPixelLengthSchema]).nullable().optional(),
|
|
3111
3164
|
"white-space": textStyleValues["white-space"].nullable().optional(),
|
|
3112
3165
|
"word-spacing": z.union([
|
|
3113
3166
|
canvasNumberSchema,
|
|
3114
3167
|
signedPixelLengthSchema,
|
|
3115
3168
|
z.literal("normal")
|
|
3116
|
-
]).nullable().optional()
|
|
3169
|
+
]).nullable().optional(),
|
|
3170
|
+
direction: restorableTextStyleValue,
|
|
3171
|
+
"unicode-bidi": restorableTextStyleValue,
|
|
3172
|
+
"hanging-punctuation": restorableTextStyleValue,
|
|
3173
|
+
"text-transform": restorableTextStyleValue,
|
|
3174
|
+
"-webkit-text-stroke": restorableTextStyleValue,
|
|
3175
|
+
"-webkit-text-stroke-width": restorableTextStyleValue,
|
|
3176
|
+
"-webkit-text-stroke-color": restorableTextStyleValue,
|
|
3177
|
+
"paint-order": restorableTextStyleValue
|
|
3117
3178
|
});
|
|
3118
3179
|
const overflowStyleValue = canvasAdditionalStyleSchema.shape.value;
|
|
3119
3180
|
const dimensionalStyleValue = z.union([z.string(), canvasNumberSchema]);
|
|
@@ -3670,7 +3731,7 @@ const canvasInspectNodeSummarySchema = z.object({
|
|
|
3670
3731
|
kind: z.string().min(1).max(100),
|
|
3671
3732
|
parentId: z.string().min(1).nullable(),
|
|
3672
3733
|
childCount: z.number().int().min(0),
|
|
3673
|
-
box:
|
|
3734
|
+
box: canvasSceneBoxSchema.nullable(),
|
|
3674
3735
|
propertySections: z.array(canvasPropertySectionSchema)
|
|
3675
3736
|
});
|
|
3676
3737
|
z.object({ canvasId: z.uuid() });
|
|
@@ -3681,7 +3742,7 @@ z.object({
|
|
|
3681
3742
|
version: z.number().int().positive(),
|
|
3682
3743
|
nodeCount: z.number().int().min(0),
|
|
3683
3744
|
rootChildCount: z.number().int().min(0),
|
|
3684
|
-
bounds:
|
|
3745
|
+
bounds: canvasSceneBoxSchema.nullable(),
|
|
3685
3746
|
kinds: z.record(z.string(), z.number().int().min(0)),
|
|
3686
3747
|
next: z.array(z.string().min(1))
|
|
3687
3748
|
});
|
|
@@ -6641,6 +6702,7 @@ z$1.extend(prototypeBridgeConnectRequestSchema, {
|
|
|
6641
6702
|
capabilities: z$1.array(z$1.string()),
|
|
6642
6703
|
release: z$1.string().check(z$1.minLength(1))
|
|
6643
6704
|
});
|
|
6705
|
+
z$1.extend(prototypeBridgeConnectRequestSchema, { type: z$1.literal("enhance.prototype.capture-blocked") });
|
|
6644
6706
|
z$1.object({
|
|
6645
6707
|
protocol: z$1.literal(1),
|
|
6646
6708
|
type: z$1.literal("enhance.prototype.unloading"),
|
|
@@ -7297,6 +7359,8 @@ z.object({
|
|
|
7297
7359
|
});
|
|
7298
7360
|
z.object({
|
|
7299
7361
|
screenId: z.uuid(),
|
|
7362
|
+
/** Where the screen's files are stored; a capture names its stored copies by it. */
|
|
7363
|
+
assetBundleId: z.uuid().nullable(),
|
|
7300
7364
|
/** Re-issued on every call, because the usual reason for a retry is an expired presign. */
|
|
7301
7365
|
upload: signedUploadSchema,
|
|
7302
7366
|
alreadyExists: z.boolean(),
|
|
@@ -7584,6 +7648,7 @@ const clientRenderFailureDetailsSchema = z.strictObject({
|
|
|
7584
7648
|
"clipboard-image-pending",
|
|
7585
7649
|
"clipboard-image-unavailable",
|
|
7586
7650
|
"edit-target-unsupported",
|
|
7651
|
+
"edit-result-invalid",
|
|
7587
7652
|
"react-hook-order",
|
|
7588
7653
|
"menu-rows-unsupported"
|
|
7589
7654
|
]),
|
|
@@ -7899,7 +7964,8 @@ z.object({
|
|
|
7899
7964
|
"delivered",
|
|
7900
7965
|
"failed",
|
|
7901
7966
|
"disabled",
|
|
7902
|
-
"no-identity"
|
|
7967
|
+
"no-identity",
|
|
7968
|
+
"expired"
|
|
7903
7969
|
]).optional()
|
|
7904
7970
|
});
|
|
7905
7971
|
z.discriminatedUnion("type", [z.object({ type: z.literal("enhance3:extension-probe") }).strict(), z.object({ type: z.literal("enhance3:extension-present") }).strict()]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enhance-eng/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.161",
|
|
4
4
|
"description": "Capture editable customer journeys in Enhance from your tests.",
|
|
5
5
|
"homepage": "https://enhancelabs.ai",
|
|
6
6
|
"repository": {
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"tsdown": "^0.22.14",
|
|
50
50
|
"typescript": "^5.9.3",
|
|
51
51
|
"vitest": "^4.1.10",
|
|
52
|
-
"@enhance3/contract": "0.0.0",
|
|
53
52
|
"@enhance3/capture-browser": "0.0.0",
|
|
53
|
+
"@enhance3/eslint-config": "0.0.0",
|
|
54
54
|
"@enhance3/tsconfig": "0.0.0",
|
|
55
|
-
"@enhance3/
|
|
55
|
+
"@enhance3/contract": "0.0.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@playwright/test": ">=1.62.0 <2"
|