@immense/vue-pom-generator 1.0.52 → 1.0.54
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/README.md +71 -27
- package/RELEASE_NOTES.md +38 -27
- package/class-generation/base-page.ts +18 -6
- package/class-generation/callout.ts +229 -679
- package/class-generation/floating-ui-callout.ts +857 -0
- package/class-generation/index.ts +24 -15
- package/class-generation/pointer.ts +152 -109
- package/dist/class-generation/base-page.d.ts +11 -5
- package/dist/class-generation/base-page.d.ts.map +1 -1
- package/dist/class-generation/callout.d.ts +44 -1
- package/dist/class-generation/callout.d.ts.map +1 -1
- package/dist/class-generation/floating-ui-callout.d.ts +4 -0
- package/dist/class-generation/floating-ui-callout.d.ts.map +1 -0
- package/dist/class-generation/index.d.ts +3 -2
- package/dist/class-generation/index.d.ts.map +1 -1
- package/dist/class-generation/pointer.d.ts +24 -5
- package/dist/class-generation/pointer.d.ts.map +1 -1
- package/dist/index.cjs +783 -231
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +783 -231
- package/dist/index.mjs.map +1 -1
- package/dist/plugin/create-vue-pom-generator-plugins.d.ts +2 -2
- package/dist/plugin/create-vue-pom-generator-plugins.d.ts.map +1 -1
- package/dist/plugin/nuxt-discovery.d.ts +47 -0
- package/dist/plugin/nuxt-discovery.d.ts.map +1 -0
- package/dist/plugin/path-utils.d.ts +4 -5
- package/dist/plugin/path-utils.d.ts.map +1 -1
- package/dist/plugin/support/build-plugin.d.ts +6 -3
- package/dist/plugin/support/build-plugin.d.ts.map +1 -1
- package/dist/plugin/support/dev-plugin.d.ts +6 -3
- package/dist/plugin/support/dev-plugin.d.ts.map +1 -1
- package/dist/plugin/support/virtual-modules.d.ts +2 -2
- package/dist/plugin/support/virtual-modules.d.ts.map +1 -1
- package/dist/plugin/support-plugins.d.ts +5 -2
- package/dist/plugin/support-plugins.d.ts.map +1 -1
- package/dist/plugin/types.d.ts +35 -19
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/plugin/vue-plugin.d.ts +1 -1
- package/dist/plugin/vue-plugin.d.ts.map +1 -1
- package/dist/router-introspection.d.ts +4 -2
- package/dist/router-introspection.d.ts.map +1 -1
- package/dist/tests/nuxt-discovery.test.d.ts +2 -0
- package/dist/tests/nuxt-discovery.test.d.ts.map +1 -0
- package/dist/vite.config.d.ts.map +1 -1
- package/package.json +9 -13
- package/dist/plugin/support/generation-metrics.d.ts +0 -10
- package/dist/plugin/support/generation-metrics.d.ts.map +0 -1
- package/dist/tests/generation-metrics.test.d.ts +0 -2
- package/dist/tests/generation-metrics.test.d.ts.map +0 -1
|
@@ -336,23 +336,29 @@ async function getRouteMetaByComponent(
|
|
|
336
336
|
routerEntry?: string,
|
|
337
337
|
routerType?: "vue-router" | "nuxt",
|
|
338
338
|
options: {
|
|
339
|
-
|
|
340
|
-
|
|
339
|
+
pageDirs?: string[];
|
|
340
|
+
componentDirs?: string[];
|
|
341
|
+
layoutDirs?: string[];
|
|
341
342
|
} = {},
|
|
342
343
|
): Promise<Record<string, RouteMeta>> {
|
|
343
344
|
const root = projectRoot ?? process.cwd();
|
|
344
|
-
const
|
|
345
|
-
const
|
|
346
|
-
const
|
|
345
|
+
const pageDirs = options.pageDirs?.length ? options.pageDirs : ["src/views"];
|
|
346
|
+
const pageDirsAbs = pageDirs.map(dir => path.isAbsolute(dir) ? dir : path.resolve(root, dir));
|
|
347
|
+
const primaryPageDirAbs = pageDirsAbs[0] ?? path.resolve(root, "src/views");
|
|
348
|
+
const sourceDirs = [
|
|
349
|
+
...pageDirs,
|
|
350
|
+
...(options.componentDirs?.length ? options.componentDirs : ["src/components"]),
|
|
351
|
+
...(options.layoutDirs?.length ? options.layoutDirs : ["src/layouts"]),
|
|
352
|
+
];
|
|
347
353
|
const extraRoots = process.cwd() !== root ? [process.cwd()] : [];
|
|
348
354
|
|
|
349
355
|
const { routeMetaEntries } = routerType === "nuxt"
|
|
350
|
-
? await introspectNuxtPages(root)
|
|
356
|
+
? await introspectNuxtPages(root, { pageDirs: pageDirsAbs })
|
|
351
357
|
: await parseRouterFileFromCwd(resolveRouterEntry(root, routerEntry), {
|
|
352
358
|
componentNaming: {
|
|
353
359
|
projectRoot: root,
|
|
354
|
-
viewsDirAbs,
|
|
355
|
-
|
|
360
|
+
viewsDirAbs: primaryPageDirAbs,
|
|
361
|
+
sourceDirs,
|
|
356
362
|
extraRoots,
|
|
357
363
|
},
|
|
358
364
|
});
|
|
@@ -687,8 +693,9 @@ export interface GenerateFilesOptions {
|
|
|
687
693
|
/** The type of router introspection to perform. */
|
|
688
694
|
routerType?: "vue-router" | "nuxt";
|
|
689
695
|
|
|
690
|
-
|
|
691
|
-
|
|
696
|
+
pageDirs?: string[];
|
|
697
|
+
componentDirs?: string[];
|
|
698
|
+
layoutDirs?: string[];
|
|
692
699
|
|
|
693
700
|
routeMetaByComponent?: Record<string, RouteMeta>;
|
|
694
701
|
}
|
|
@@ -749,8 +756,9 @@ export async function generateFiles(
|
|
|
749
756
|
vueRouterFluentChaining,
|
|
750
757
|
routerEntry,
|
|
751
758
|
routerType,
|
|
752
|
-
|
|
753
|
-
|
|
759
|
+
pageDirs,
|
|
760
|
+
componentDirs,
|
|
761
|
+
layoutDirs,
|
|
754
762
|
routeMetaByComponent: routeMetaByComponentOverride,
|
|
755
763
|
} = options;
|
|
756
764
|
|
|
@@ -763,8 +771,9 @@ export async function generateFiles(
|
|
|
763
771
|
const routeMetaByComponent = routeMetaByComponentOverride
|
|
764
772
|
?? (vueRouterFluentChaining
|
|
765
773
|
? await getRouteMetaByComponent(projectRoot, routerEntry, routerType, {
|
|
766
|
-
|
|
767
|
-
|
|
774
|
+
pageDirs,
|
|
775
|
+
componentDirs,
|
|
776
|
+
layoutDirs,
|
|
768
777
|
})
|
|
769
778
|
: undefined);
|
|
770
779
|
const generatedFilePaths: string[] = [];
|
|
@@ -1202,7 +1211,7 @@ function generateAggregatedCSharpFiles(
|
|
|
1202
1211
|
" }",
|
|
1203
1212
|
"",
|
|
1204
1213
|
" // Minimal vue-select helper mirroring the TS BasePage.selectVSelectByTestId behavior.",
|
|
1205
|
-
" // Note: annotationText is currently a no-op in C# output (we don't render a
|
|
1214
|
+
" // Note: annotationText is currently a no-op in C# output (we don't render a pointer overlay).",
|
|
1206
1215
|
" protected async Task SelectVSelectByTestIdAsync(string testId, string value, int timeOut = 500)",
|
|
1207
1216
|
" {",
|
|
1208
1217
|
" var root = LocatorByTestId(testId);",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Callout, type ElementTarget } from "./callout";
|
|
1
|
+
import { Callout, type CalloutOptions, type ElementTarget } from "./callout";
|
|
2
2
|
import type { PwLocator, PwPage } from "./playwright-types";
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const __PW_POINTER_ID__ = "__pw_pointer__";
|
|
5
5
|
const __PW_EDITABLE_DESCENDANT_SELECTOR__
|
|
6
6
|
= "input, textarea, select, [contenteditable=''], [contenteditable='true'], [contenteditable]:not([contenteditable='false'])";
|
|
7
7
|
|
|
8
|
-
// A minimal 16×24 arrow
|
|
9
|
-
const
|
|
8
|
+
// A minimal 16×24 arrow pointer encoded as a base64 PNG.
|
|
9
|
+
const __PW_POINTER_PNG__ =
|
|
10
10
|
"data:image/png;base64,"
|
|
11
11
|
+ "iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAQAAACGG/bgAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAA"
|
|
12
12
|
+ "HsYAAB7GAZEt8iwAAAAHdElNRQfgAwgMIwdxU/i7AAABZklEQVQ4y43TsU4UURSH8W+XmYwkS2I0"
|
|
@@ -18,41 +18,35 @@ const __PW_CURSOR_PNG__ =
|
|
|
18
18
|
+ "ONcpr3PrXy9VfS473M/D7H+TLmrqsXtOGctvxvMv2oVNP+Av0uHbzbxyJaywyUjx8TlnPY2YxqkD"
|
|
19
19
|
+ "dAAAAABJRU5ErkJggg==";
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const __pw_pointer_positions__ = new WeakMap<object, { x: number; y: number }>();
|
|
22
22
|
|
|
23
|
-
function
|
|
24
|
-
return
|
|
23
|
+
function __pw_get_pointer_pos__(page: PwPage): { x: number; y: number } {
|
|
24
|
+
return __pw_pointer_positions__.get(page as object) ?? { x: 0, y: 0 };
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
function
|
|
28
|
-
|
|
27
|
+
function __pw_set_pointer_pos__(page: PwPage, x: number, y: number): void {
|
|
28
|
+
__pw_pointer_positions__.set(page as object, { x, y });
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
id: __PW_CURSOR_ID__,
|
|
53
|
-
src: __PW_CURSOR_PNG__,
|
|
54
|
-
},
|
|
55
|
-
);
|
|
31
|
+
export interface PointerMoveRequest {
|
|
32
|
+
animate: boolean;
|
|
33
|
+
durationMilliseconds: number;
|
|
34
|
+
endX: number;
|
|
35
|
+
endY: number;
|
|
36
|
+
startX: number;
|
|
37
|
+
startY: number;
|
|
38
|
+
transitionStyle: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface PointerPressRequest {
|
|
42
|
+
durationMilliseconds: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface PointerRenderer {
|
|
46
|
+
readonly overlayIds?: string[];
|
|
47
|
+
ensure: (page: PwPage) => Promise<void>;
|
|
48
|
+
move: (page: PwPage, request: PointerMoveRequest) => Promise<void>;
|
|
49
|
+
press: (page: PwPage, request: PointerPressRequest) => Promise<void>;
|
|
56
50
|
}
|
|
57
51
|
|
|
58
52
|
// ---------------------------------------------------------------------------
|
|
@@ -72,17 +66,17 @@ export interface PlaywrightAnimationOptions {
|
|
|
72
66
|
*/
|
|
73
67
|
extraDelayMs?: number;
|
|
74
68
|
|
|
75
|
-
/** Visual
|
|
69
|
+
/** Visual pointer-movement configuration. */
|
|
76
70
|
pointer?: {
|
|
77
71
|
/**
|
|
78
|
-
* Duration of the CSS-transition
|
|
79
|
-
* Set to 0 to teleport the
|
|
72
|
+
* Duration of the CSS-transition pointer glide in ms.
|
|
73
|
+
* Set to 0 to teleport the pointer without animation.
|
|
80
74
|
* Default: 250
|
|
81
75
|
*/
|
|
82
76
|
durationMilliseconds?: number;
|
|
83
77
|
|
|
84
78
|
/**
|
|
85
|
-
* CSS transition timing function for the
|
|
79
|
+
* CSS transition timing function for the pointer glide.
|
|
86
80
|
* Default: "ease-in-out"
|
|
87
81
|
*/
|
|
88
82
|
transitionStyle?: "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out";
|
|
@@ -139,6 +133,102 @@ export interface AfterPointerClickInfo {
|
|
|
139
133
|
|
|
140
134
|
export type AfterPointerClick = (info: AfterPointerClickInfo) => void | Promise<void>;
|
|
141
135
|
|
|
136
|
+
const __pw_default_pointer_renderer__: PointerRenderer = {
|
|
137
|
+
overlayIds: [__PW_POINTER_ID__],
|
|
138
|
+
async ensure(page) {
|
|
139
|
+
const exists = await page.evaluate(
|
|
140
|
+
({ pointerId }: { pointerId: string }) => document.getElementById(pointerId) != null,
|
|
141
|
+
{ pointerId: __PW_POINTER_ID__ },
|
|
142
|
+
);
|
|
143
|
+
if (exists) return;
|
|
144
|
+
|
|
145
|
+
__pw_set_pointer_pos__(page, 0, 0);
|
|
146
|
+
|
|
147
|
+
await page.evaluate(
|
|
148
|
+
({ id, src }: { id: string; src: string }) => {
|
|
149
|
+
const img = document.createElement("img");
|
|
150
|
+
img.setAttribute("src", src);
|
|
151
|
+
img.setAttribute("id", id);
|
|
152
|
+
img.setAttribute(
|
|
153
|
+
"style",
|
|
154
|
+
"position:fixed;z-index:2147483647;pointer-events:none;left:0;top:0;transform-origin:0 0;",
|
|
155
|
+
);
|
|
156
|
+
document.body.appendChild(img);
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: __PW_POINTER_ID__,
|
|
160
|
+
src: __PW_POINTER_PNG__,
|
|
161
|
+
},
|
|
162
|
+
);
|
|
163
|
+
},
|
|
164
|
+
async move(page, request) {
|
|
165
|
+
await page.evaluate(
|
|
166
|
+
({
|
|
167
|
+
animate,
|
|
168
|
+
dur,
|
|
169
|
+
ex,
|
|
170
|
+
ey,
|
|
171
|
+
id,
|
|
172
|
+
style,
|
|
173
|
+
sx,
|
|
174
|
+
sy,
|
|
175
|
+
}: {
|
|
176
|
+
animate: boolean;
|
|
177
|
+
dur: number;
|
|
178
|
+
ex: number;
|
|
179
|
+
ey: number;
|
|
180
|
+
id: string;
|
|
181
|
+
style: string;
|
|
182
|
+
sx: number;
|
|
183
|
+
sy: number;
|
|
184
|
+
}) => {
|
|
185
|
+
const el = document.getElementById(id);
|
|
186
|
+
if (!el) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
el.style.transition = "";
|
|
191
|
+
el.style.willChange = "left, top";
|
|
192
|
+
el.style.left = `${animate ? sx : ex}px`;
|
|
193
|
+
el.style.top = `${animate ? sy : ey}px`;
|
|
194
|
+
|
|
195
|
+
if (animate) {
|
|
196
|
+
void el.offsetWidth;
|
|
197
|
+
el.style.transition = `left ${dur}ms ${style}, top ${dur}ms ${style}`;
|
|
198
|
+
el.style.left = `${ex}px`;
|
|
199
|
+
el.style.top = `${ey}px`;
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
animate: request.animate,
|
|
204
|
+
dur: request.durationMilliseconds,
|
|
205
|
+
ex: request.endX,
|
|
206
|
+
ey: request.endY,
|
|
207
|
+
id: __PW_POINTER_ID__,
|
|
208
|
+
style: request.transitionStyle,
|
|
209
|
+
sx: request.startX,
|
|
210
|
+
sy: request.startY,
|
|
211
|
+
},
|
|
212
|
+
);
|
|
213
|
+
},
|
|
214
|
+
async press(page, request) {
|
|
215
|
+
await page.evaluate(
|
|
216
|
+
({ id, dur }: { id: string; dur: number }) => {
|
|
217
|
+
const el = document.getElementById(id);
|
|
218
|
+
if (el) {
|
|
219
|
+
el.style.transition = `transform ${dur}ms`;
|
|
220
|
+
el.style.transform = "scale(0.6)";
|
|
221
|
+
setTimeout(() => {
|
|
222
|
+
el.style.transition = `transform ${dur}ms`;
|
|
223
|
+
el.style.transform = "scale(1)";
|
|
224
|
+
}, dur);
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
{ id: __PW_POINTER_ID__, dur: request.durationMilliseconds },
|
|
228
|
+
);
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
|
|
142
232
|
// ---------------------------------------------------------------------------
|
|
143
233
|
// Pointer class
|
|
144
234
|
// ---------------------------------------------------------------------------
|
|
@@ -147,11 +237,16 @@ export class Pointer {
|
|
|
147
237
|
private readonly page: PwPage;
|
|
148
238
|
private readonly testIdAttribute: string;
|
|
149
239
|
private readonly callout: Callout;
|
|
240
|
+
private readonly renderer: PointerRenderer;
|
|
150
241
|
|
|
151
|
-
public constructor(page: PwPage, testIdAttribute: string, callout?: Callout) {
|
|
242
|
+
public constructor(page: PwPage, testIdAttribute: string, callout?: Callout, renderer?: PointerRenderer) {
|
|
152
243
|
this.page = page;
|
|
153
244
|
this.testIdAttribute = (testIdAttribute ?? "data-testid").trim() || "data-testid";
|
|
154
|
-
this.
|
|
245
|
+
this.renderer = renderer ?? __pw_default_pointer_renderer__;
|
|
246
|
+
const calloutOptions: CalloutOptions = {
|
|
247
|
+
extraOverlayIds: this.renderer.overlayIds,
|
|
248
|
+
};
|
|
249
|
+
this.callout = callout ?? new Callout(page, calloutOptions);
|
|
155
250
|
}
|
|
156
251
|
|
|
157
252
|
private toLocator(target: ElementTarget): PwLocator {
|
|
@@ -254,66 +349,27 @@ export class Pointer {
|
|
|
254
349
|
const extraDelayMs = Math.max(0, opts.extraDelayMs ?? 0);
|
|
255
350
|
const actionDelayMs = Math.max(0, delayMs);
|
|
256
351
|
|
|
257
|
-
// Inject the visual
|
|
258
|
-
await
|
|
352
|
+
// Inject the visual pointer if it doesn't exist yet.
|
|
353
|
+
await this.renderer.ensure(this.page);
|
|
259
354
|
|
|
260
|
-
// Move the
|
|
355
|
+
// Move the pointer to the target element.
|
|
261
356
|
const box = await locator.first().boundingBox();
|
|
262
357
|
if (box) {
|
|
263
358
|
const endX = box.x + box.width / 2;
|
|
264
359
|
const endY = box.y + box.height / 2;
|
|
265
|
-
const { x: startX, y: startY } =
|
|
360
|
+
const { x: startX, y: startY } = __pw_get_pointer_pos__(this.page);
|
|
266
361
|
const distance = Math.sqrt((endX - startX) ** 2 + (endY - startY) ** 2);
|
|
267
362
|
|
|
268
363
|
const shouldAnimate = moveDurationMs > 0 && distance > 0;
|
|
269
|
-
await this.
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
animate,
|
|
279
|
-
}: {
|
|
280
|
-
dur: number;
|
|
281
|
-
ex: number;
|
|
282
|
-
ey: number;
|
|
283
|
-
id: string;
|
|
284
|
-
style: string;
|
|
285
|
-
sx: number;
|
|
286
|
-
sy: number;
|
|
287
|
-
animate: boolean;
|
|
288
|
-
}) => {
|
|
289
|
-
const el = document.getElementById(id);
|
|
290
|
-
if (!el) {
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
el.style.transition = "";
|
|
295
|
-
el.style.willChange = "left, top";
|
|
296
|
-
el.style.left = `${animate ? sx : ex}px`;
|
|
297
|
-
el.style.top = `${animate ? sy : ey}px`;
|
|
298
|
-
|
|
299
|
-
if (animate) {
|
|
300
|
-
void el.offsetWidth;
|
|
301
|
-
el.style.transition = `left ${dur}ms ${style}, top ${dur}ms ${style}`;
|
|
302
|
-
el.style.left = `${ex}px`;
|
|
303
|
-
el.style.top = `${ey}px`;
|
|
304
|
-
}
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
dur: moveDurationMs,
|
|
308
|
-
ex: endX,
|
|
309
|
-
ey: endY,
|
|
310
|
-
id: __PW_CURSOR_ID__,
|
|
311
|
-
style: transitionStyle,
|
|
312
|
-
sx: startX,
|
|
313
|
-
sy: startY,
|
|
314
|
-
animate: shouldAnimate,
|
|
315
|
-
},
|
|
316
|
-
);
|
|
364
|
+
await this.renderer.move(this.page, {
|
|
365
|
+
animate: shouldAnimate,
|
|
366
|
+
durationMilliseconds: moveDurationMs,
|
|
367
|
+
endX,
|
|
368
|
+
endY,
|
|
369
|
+
startX,
|
|
370
|
+
startY,
|
|
371
|
+
transitionStyle,
|
|
372
|
+
});
|
|
317
373
|
|
|
318
374
|
if (trimmedAnnotationText) {
|
|
319
375
|
await this.callout.showForElement(locator, trimmedAnnotationText, {
|
|
@@ -330,7 +386,7 @@ export class Pointer {
|
|
|
330
386
|
await this.page.waitForTimeout(moveDurationMs + 25);
|
|
331
387
|
}
|
|
332
388
|
|
|
333
|
-
|
|
389
|
+
__pw_set_pointer_pos__(this.page, endX, endY);
|
|
334
390
|
}
|
|
335
391
|
else {
|
|
336
392
|
await this.callout.hide();
|
|
@@ -342,23 +398,10 @@ export class Pointer {
|
|
|
342
398
|
|
|
343
399
|
let clickedTestId: string | undefined;
|
|
344
400
|
if (executeClick) {
|
|
345
|
-
// Brief scale-down "press" animation on the
|
|
401
|
+
// Brief scale-down "press" animation on the pointer image.
|
|
346
402
|
if (moveDurationMs > 0) {
|
|
347
403
|
const pressDur = Math.max(80, Math.round(moveDurationMs / 3));
|
|
348
|
-
await this.
|
|
349
|
-
({ id, dur }: { id: string; dur: number }) => {
|
|
350
|
-
const el = document.getElementById(id);
|
|
351
|
-
if (el) {
|
|
352
|
-
el.style.transition = `transform ${dur}ms`;
|
|
353
|
-
el.style.transform = "scale(0.6)";
|
|
354
|
-
setTimeout(() => {
|
|
355
|
-
el.style.transition = `transform ${dur}ms`;
|
|
356
|
-
el.style.transform = "scale(1)";
|
|
357
|
-
}, dur);
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
{ id: __PW_CURSOR_ID__, dur: pressDur },
|
|
361
|
-
);
|
|
404
|
+
await this.renderer.press(this.page, { durationMilliseconds: pressDur });
|
|
362
405
|
}
|
|
363
406
|
|
|
364
407
|
try { clickedTestId = await this.getTestId(locator); } catch { /* noop */ }
|
|
@@ -380,7 +423,7 @@ export class Pointer {
|
|
|
380
423
|
afterClick?: AfterPointerClick;
|
|
381
424
|
},
|
|
382
425
|
): Promise<void> {
|
|
383
|
-
// Animate
|
|
426
|
+
// Animate the pointer + click first.
|
|
384
427
|
await this.animateCursorToElement(target, executeClick, delayMs, annotationText, options);
|
|
385
428
|
|
|
386
429
|
const locator = this.toLocator(target);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PwLocator, PwPage } from "./playwright-types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { CalloutRenderer } from "./callout";
|
|
3
|
+
import { type AfterPointerClick, type PointerRenderer } from "./pointer";
|
|
3
4
|
/**
|
|
4
5
|
* A chainable, thenable wrapper around a page object.
|
|
5
6
|
*
|
|
@@ -21,6 +22,13 @@ type DeepValueFluent<T> = {
|
|
|
21
22
|
};
|
|
22
23
|
export type Fluent<T extends object> = DeepFluent<T, T> & PromiseLike<T>;
|
|
23
24
|
export type ValueFluent<T> = DeepValueFluent<T> & PromiseLike<T>;
|
|
25
|
+
export interface BasePageOptions {
|
|
26
|
+
renderers?: {
|
|
27
|
+
callout?: CalloutRenderer;
|
|
28
|
+
pointer?: PointerRenderer;
|
|
29
|
+
};
|
|
30
|
+
testIdAttribute?: string;
|
|
31
|
+
}
|
|
24
32
|
export declare class ObjectId {
|
|
25
33
|
private readonly raw;
|
|
26
34
|
constructor(raw: string);
|
|
@@ -40,9 +48,7 @@ export declare class BasePage {
|
|
|
40
48
|
/**
|
|
41
49
|
* @param {Page} page - Playwright page object
|
|
42
50
|
*/
|
|
43
|
-
constructor(page: PwPage, options?:
|
|
44
|
-
testIdAttribute?: string;
|
|
45
|
-
});
|
|
51
|
+
constructor(page: PwPage, options?: BasePageOptions);
|
|
46
52
|
private waitForTestIdClickEventAfter;
|
|
47
53
|
protected selectorForTestId(testId: string): string;
|
|
48
54
|
protected locatorByTestId(testId: string): PwLocator;
|
|
@@ -50,7 +56,7 @@ export declare class BasePage {
|
|
|
50
56
|
exact?: boolean;
|
|
51
57
|
}): PwLocator;
|
|
52
58
|
/**
|
|
53
|
-
* Animates the
|
|
59
|
+
* Animates the pointer to an element.
|
|
54
60
|
*/
|
|
55
61
|
protected animateCursorToElement(target: string | PwLocator, executeClick?: boolean, delayMs?: number, annotationText?: string, options?: {
|
|
56
62
|
afterClick?: AfterPointerClick;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-page.d.ts","sourceRoot":"","sources":["../../class-generation/base-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"base-page.d.ts","sourceRoot":"","sources":["../../class-generation/base-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAI5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAW,KAAK,iBAAiB,EAA8B,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAe9G;;;;;;;;GAQG;AACH;;;GAGG;AACH,KAAK,UAAU,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,IAAI;KACxC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAA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C,IAAI,CAAC;IAoB1H,kBAAkB,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,GAAE,MAAW,GAAG,OAAO,CAAC,IAAI,CAAC;cAS7F,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,GAAE,MAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAS/F;;;;OAIG;cACa,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzE;;;;OAIG;cACa,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAInE;;;;OAIG;cACa,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIvE;;;;;;OAMG;cACa,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5F;;;OAGG;cACa,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5D;;;;OAIG;cACa,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7E"}
|
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
import type { PwLocator, PwPage } from "./playwright-types";
|
|
2
|
+
export declare const POINTER_CALLOUT_IDS: {
|
|
3
|
+
readonly annotation: "__pw_pointer_callout__";
|
|
4
|
+
readonly arrow: "__pw_pointer_callout_arrow__";
|
|
5
|
+
readonly content: "__pw_pointer_callout_content__";
|
|
6
|
+
};
|
|
7
|
+
export declare const POINTER_CALLOUT_THEME: {
|
|
8
|
+
readonly arrowPadding: 10;
|
|
9
|
+
readonly arrowSize: 14;
|
|
10
|
+
readonly avoidPadding: 12;
|
|
11
|
+
readonly background: "#dc2626";
|
|
12
|
+
readonly border: "0px solid transparent";
|
|
13
|
+
readonly borderRadius: 0;
|
|
14
|
+
readonly boxShadow: "0 20px 44px rgba(127, 29, 29, 0.32)";
|
|
15
|
+
readonly charsPerLine: 28;
|
|
16
|
+
readonly gap: 18;
|
|
17
|
+
readonly margin: 18;
|
|
18
|
+
readonly maxWidth: 320;
|
|
19
|
+
readonly minHeight: 52;
|
|
20
|
+
readonly minWidth: 180;
|
|
21
|
+
readonly textColor: "#f8fafc";
|
|
22
|
+
};
|
|
2
23
|
export type ElementTarget = string | PwLocator;
|
|
3
24
|
export interface CalloutTargetBox {
|
|
4
25
|
x: number;
|
|
@@ -10,9 +31,31 @@ export interface ShowCalloutOptions {
|
|
|
10
31
|
skipScroll?: boolean;
|
|
11
32
|
targetBox?: CalloutTargetBox;
|
|
12
33
|
}
|
|
34
|
+
export interface CalloutRenderRequest {
|
|
35
|
+
overlayIds: string[];
|
|
36
|
+
target: ElementTarget;
|
|
37
|
+
targetBox: CalloutTargetBox;
|
|
38
|
+
text: string;
|
|
39
|
+
}
|
|
40
|
+
export interface CalloutRenderer {
|
|
41
|
+
readonly overlayIds?: string[];
|
|
42
|
+
hide: (page: PwPage) => Promise<void>;
|
|
43
|
+
show: (page: PwPage, request: CalloutRenderRequest) => Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
export interface CalloutOptions {
|
|
46
|
+
extraOverlayIds?: string[];
|
|
47
|
+
renderer?: CalloutRenderer;
|
|
48
|
+
}
|
|
49
|
+
export declare function measureCalloutBubble(text: string): {
|
|
50
|
+
bubbleHeight: number;
|
|
51
|
+
bubbleWidth: number;
|
|
52
|
+
};
|
|
53
|
+
export declare const simpleCalloutRenderer: CalloutRenderer;
|
|
13
54
|
export declare class Callout {
|
|
14
55
|
private readonly page;
|
|
15
|
-
|
|
56
|
+
private readonly extraOverlayIds;
|
|
57
|
+
private readonly renderer;
|
|
58
|
+
constructor(page: PwPage, options?: CalloutOptions);
|
|
16
59
|
private toLocator;
|
|
17
60
|
hide(): Promise<void>;
|
|
18
61
|
showForElement(target: ElementTarget, annotationText: string, options?: ShowCalloutOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../class-generation/callout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../class-generation/callout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5D,eAAO,MAAM,mBAAmB;;;;CAItB,CAAC;AAEX,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;CAexB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACpC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrE;AAED,MAAM,WAAW,cAAc;IAC9B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAchG;AAiPD,eAAO,MAAM,qBAAqB,iBAAkC,CAAC;AAErE,qBAAa,OAAO;IACnB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAW;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;gBAExB,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc;IAMzD,OAAO,CAAC,SAAS;IAIJ,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,cAAc,CAC1B,MAAM,EAAE,aAAa,EACrB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC;CAuChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floating-ui-callout.d.ts","sourceRoot":"","sources":["../../class-generation/floating-ui-callout.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,KAAK,eAAe,EAGpB,MAAM,WAAW,CAAC;AAsjBnB,eAAO,MAAM,yBAAyB,EAAE,eAuRvC,CAAC;AAEF,wBAAgB,+BAA+B,IAAI,eAAe,CAEjE"}
|
|
@@ -91,8 +91,9 @@ export interface GenerateFilesOptions {
|
|
|
91
91
|
routerEntry?: string;
|
|
92
92
|
/** The type of router introspection to perform. */
|
|
93
93
|
routerType?: "vue-router" | "nuxt";
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
pageDirs?: string[];
|
|
95
|
+
componentDirs?: string[];
|
|
96
|
+
layoutDirs?: string[];
|
|
96
97
|
routeMetaByComponent?: Record<string, RouteMeta>;
|
|
97
98
|
}
|
|
98
99
|
export declare function generateFiles(componentHierarchyMap: Map<string, IComponentDependencies>, vueFilesPathMap: Map<string, string>, basePageClassPath: string, options?: GenerateFilesOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../class-generation/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkC,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAsB5G,OAAO,EACL,sBAAsB,EAMvB,MAAM,UAAU,CAAC;AAQlB,OAAO,EAAE,oCAAoC,EAAE,CAAC;AAqKhD,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AASD,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,GAAG,YAAY,GAAG,MAAM,GAAG,oBAAoB,CAAC;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AASD,MAAM,MAAM,yBAAyB,GAAG,YAAY,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../class-generation/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkC,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAsB5G,OAAO,EACL,sBAAsB,EAMvB,MAAM,UAAU,CAAC;AAQlB,OAAO,EAAE,oCAAoC,EAAE,CAAC;AAqKhD,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AASD,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,GAAG,YAAY,GAAG,MAAM,GAAG,oBAAoB,CAAC;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AASD,MAAM,MAAM,yBAAyB,GAAG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BAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,EAC1D,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,iBAAiB,EAAE,MAAM,EACzB,OAAO,GAAE,oBAAyB,iBAiGnC"}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { Callout, type ElementTarget } from "./callout";
|
|
2
2
|
import type { PwPage } from "./playwright-types";
|
|
3
|
+
export interface PointerMoveRequest {
|
|
4
|
+
animate: boolean;
|
|
5
|
+
durationMilliseconds: number;
|
|
6
|
+
endX: number;
|
|
7
|
+
endY: number;
|
|
8
|
+
startX: number;
|
|
9
|
+
startY: number;
|
|
10
|
+
transitionStyle: string;
|
|
11
|
+
}
|
|
12
|
+
export interface PointerPressRequest {
|
|
13
|
+
durationMilliseconds: number;
|
|
14
|
+
}
|
|
15
|
+
export interface PointerRenderer {
|
|
16
|
+
readonly overlayIds?: string[];
|
|
17
|
+
ensure: (page: PwPage) => Promise<void>;
|
|
18
|
+
move: (page: PwPage, request: PointerMoveRequest) => Promise<void>;
|
|
19
|
+
press: (page: PwPage, request: PointerPressRequest) => Promise<void>;
|
|
20
|
+
}
|
|
3
21
|
export interface PlaywrightAnimationOptions {
|
|
4
22
|
/**
|
|
5
23
|
* Set to false to disable all animations and delays. Clicks/fills still happen.
|
|
@@ -11,16 +29,16 @@ export interface PlaywrightAnimationOptions {
|
|
|
11
29
|
* Default: 0
|
|
12
30
|
*/
|
|
13
31
|
extraDelayMs?: number;
|
|
14
|
-
/** Visual
|
|
32
|
+
/** Visual pointer-movement configuration. */
|
|
15
33
|
pointer?: {
|
|
16
34
|
/**
|
|
17
|
-
* Duration of the CSS-transition
|
|
18
|
-
* Set to 0 to teleport the
|
|
35
|
+
* Duration of the CSS-transition pointer glide in ms.
|
|
36
|
+
* Set to 0 to teleport the pointer without animation.
|
|
19
37
|
* Default: 250
|
|
20
38
|
*/
|
|
21
39
|
durationMilliseconds?: number;
|
|
22
40
|
/**
|
|
23
|
-
* CSS transition timing function for the
|
|
41
|
+
* CSS transition timing function for the pointer glide.
|
|
24
42
|
* Default: "ease-in-out"
|
|
25
43
|
*/
|
|
26
44
|
transitionStyle?: "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out";
|
|
@@ -54,7 +72,8 @@ export declare class Pointer {
|
|
|
54
72
|
private readonly page;
|
|
55
73
|
private readonly testIdAttribute;
|
|
56
74
|
private readonly callout;
|
|
57
|
-
|
|
75
|
+
private readonly renderer;
|
|
76
|
+
constructor(page: PwPage, testIdAttribute: string, callout?: Callout, renderer?: PointerRenderer);
|
|
58
77
|
private toLocator;
|
|
59
78
|
private getTestId;
|
|
60
79
|
private isEditableElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointer.d.ts","sourceRoot":"","sources":["../../class-generation/pointer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"pointer.d.ts","sourceRoot":"","sources":["../../class-generation/pointer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,KAAK,EAAa,MAAM,EAAE,MAAM,oBAAoB,CAAC;AA6B5D,MAAM,WAAW,kBAAkB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IACnC,oBAAoB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,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