@scenetest/vite-plugin 0.11.0 → 0.12.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.
Files changed (86) hide show
  1. package/dist/index.d.ts.map +1 -1
  2. package/dist/index.js +7 -5
  3. package/dist/index.js.map +1 -1
  4. package/dist/panels/observer/audio.d.ts +81 -0
  5. package/dist/panels/observer/audio.d.ts.map +1 -0
  6. package/dist/panels/observer/audio.js +296 -0
  7. package/dist/panels/observer/audio.js.map +1 -0
  8. package/dist/panels/observer/auto.d.ts +10 -0
  9. package/dist/panels/observer/auto.d.ts.map +1 -0
  10. package/dist/panels/observer/auto.js +11 -0
  11. package/dist/panels/observer/auto.js.map +1 -0
  12. package/dist/panels/observer/fs-viewer.d.ts +20 -0
  13. package/dist/panels/observer/fs-viewer.d.ts.map +1 -0
  14. package/dist/panels/observer/fs-viewer.js +536 -0
  15. package/dist/panels/observer/fs-viewer.js.map +1 -0
  16. package/dist/panels/observer/fullscreen.d.ts +24 -0
  17. package/dist/panels/observer/fullscreen.d.ts.map +1 -0
  18. package/dist/panels/observer/fullscreen.js +701 -0
  19. package/dist/panels/observer/fullscreen.js.map +1 -0
  20. package/dist/panels/observer/history.d.ts +41 -0
  21. package/dist/panels/observer/history.d.ts.map +1 -0
  22. package/dist/panels/observer/history.js +307 -0
  23. package/dist/panels/observer/history.js.map +1 -0
  24. package/dist/panels/observer/index.d.ts +33 -0
  25. package/dist/panels/observer/index.d.ts.map +1 -0
  26. package/dist/panels/observer/index.js +128 -0
  27. package/dist/panels/observer/index.js.map +1 -0
  28. package/dist/panels/observer/panel.d.ts +12 -0
  29. package/dist/panels/observer/panel.d.ts.map +1 -0
  30. package/dist/panels/observer/panel.js +461 -0
  31. package/dist/panels/observer/panel.js.map +1 -0
  32. package/dist/panels/observer/render.d.ts +109 -0
  33. package/dist/panels/observer/render.d.ts.map +1 -0
  34. package/dist/panels/observer/render.js +760 -0
  35. package/dist/panels/observer/render.js.map +1 -0
  36. package/dist/panels/observer/state.d.ts +57 -0
  37. package/dist/panels/observer/state.d.ts.map +1 -0
  38. package/dist/panels/observer/state.js +187 -0
  39. package/dist/panels/observer/state.js.map +1 -0
  40. package/dist/panels/observer/styles.d.ts +6 -0
  41. package/dist/panels/observer/styles.d.ts.map +1 -0
  42. package/dist/panels/observer/styles.js +1706 -0
  43. package/dist/panels/observer/styles.js.map +1 -0
  44. package/dist/panels/observer/types.d.ts +102 -0
  45. package/dist/panels/observer/types.d.ts.map +1 -0
  46. package/dist/panels/observer/types.js +5 -0
  47. package/dist/panels/observer/types.js.map +1 -0
  48. package/dist/panels/observer/utils.d.ts +45 -0
  49. package/dist/panels/observer/utils.d.ts.map +1 -0
  50. package/dist/panels/observer/utils.js +101 -0
  51. package/dist/panels/observer/utils.js.map +1 -0
  52. package/dist/panels/recorder/auto.d.ts +10 -0
  53. package/dist/panels/recorder/auto.d.ts.map +1 -0
  54. package/dist/panels/recorder/auto.js +11 -0
  55. package/dist/panels/recorder/auto.js.map +1 -0
  56. package/dist/panels/recorder/capture.d.ts +18 -0
  57. package/dist/panels/recorder/capture.d.ts.map +1 -0
  58. package/dist/panels/recorder/capture.js +218 -0
  59. package/dist/panels/recorder/capture.js.map +1 -0
  60. package/dist/panels/recorder/index.d.ts +41 -0
  61. package/dist/panels/recorder/index.d.ts.map +1 -0
  62. package/dist/panels/recorder/index.js +208 -0
  63. package/dist/panels/recorder/index.js.map +1 -0
  64. package/dist/panels/recorder/panel.d.ts +55 -0
  65. package/dist/panels/recorder/panel.d.ts.map +1 -0
  66. package/dist/panels/recorder/panel.js +284 -0
  67. package/dist/panels/recorder/panel.js.map +1 -0
  68. package/dist/panels/recorder/reverse-selector.d.ts +31 -0
  69. package/dist/panels/recorder/reverse-selector.d.ts.map +1 -0
  70. package/dist/panels/recorder/reverse-selector.js +116 -0
  71. package/dist/panels/recorder/reverse-selector.js.map +1 -0
  72. package/dist/panels/recorder/styles.d.ts +5 -0
  73. package/dist/panels/recorder/styles.d.ts.map +1 -0
  74. package/dist/panels/recorder/styles.js +300 -0
  75. package/dist/panels/recorder/styles.js.map +1 -0
  76. package/dist/panels/recorder/types.d.ts +51 -0
  77. package/dist/panels/recorder/types.d.ts.map +1 -0
  78. package/dist/panels/recorder/types.js +15 -0
  79. package/dist/panels/recorder/types.js.map +1 -0
  80. package/dist/strip.d.ts.map +1 -1
  81. package/dist/strip.js +6 -3
  82. package/dist/strip.js.map +1 -1
  83. package/dist/transform.d.ts.map +1 -1
  84. package/dist/transform.js +5 -2
  85. package/dist/transform.js.map +1 -1
  86. package/package.json +12 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/panels/observer/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgZ1B,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoxC/B,CAAA"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Types for the dev panel (browser-side)
3
+ */
4
+ export interface AssertionResult {
5
+ type: 'pass' | 'fail';
6
+ description: string;
7
+ result: boolean;
8
+ timestamp: number;
9
+ stack?: string;
10
+ context?: Record<string, unknown>;
11
+ location?: {
12
+ file: string;
13
+ line: number;
14
+ column?: number;
15
+ };
16
+ _index?: number;
17
+ /** Source assertion ID for multi-context assertions (indicates server-side execution) */
18
+ assertionId?: string;
19
+ }
20
+ export interface AssertionGroup {
21
+ id: number;
22
+ timestamp: number;
23
+ items: AssertionResult[];
24
+ collapsed: boolean;
25
+ }
26
+ export interface HistoryEntry {
27
+ result: boolean;
28
+ timestamp: number;
29
+ index: number;
30
+ }
31
+ export interface HistoryStats {
32
+ priorPassed: number;
33
+ priorFailed: number;
34
+ afterPassed: number;
35
+ afterFailed: number;
36
+ total: number;
37
+ }
38
+ /**
39
+ * Flaky test statistics for a specific assertion
40
+ */
41
+ export interface FlakyStats {
42
+ totalRuns: number;
43
+ passCount: number;
44
+ failCount: number;
45
+ failureRate: number;
46
+ isFlaky: boolean;
47
+ isCurrentlyFailing: boolean;
48
+ }
49
+ /**
50
+ * Resolution statistics for failures that were later resolved
51
+ */
52
+ export interface ResolutionInfo {
53
+ duration: number;
54
+ failTimestamp: number;
55
+ passTimestamp: number;
56
+ }
57
+ export interface ResolutionStats {
58
+ resolvedFailures: ResolutionInfo[];
59
+ repeatFailures: number;
60
+ unresolvedFailures: number;
61
+ minDuration: number | null;
62
+ maxDuration: number | null;
63
+ outlierThreshold: number | null;
64
+ outliers: ResolutionInfo[];
65
+ normalRange: ResolutionInfo[];
66
+ }
67
+ export type FilterMode = 'all' | 'fails' | 'passes';
68
+ export type ViewMode = 'grouped' | 'byLocation' | 'sequence';
69
+ export type FileViewMode = 'tree' | 'graph';
70
+ export type CornerPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
71
+ /**
72
+ * Represents a unique assertion location in the code
73
+ * Used for the "by location" view
74
+ */
75
+ export interface LocationGroup {
76
+ key: string;
77
+ location: AssertionResult['location'];
78
+ description: string;
79
+ entries: LocationEntry[];
80
+ lastResult: boolean;
81
+ lastTimestamp: number;
82
+ }
83
+ /**
84
+ * A single run of an assertion at a specific location
85
+ */
86
+ export interface LocationEntry {
87
+ result: boolean;
88
+ timestamp: number;
89
+ index: number;
90
+ description: string;
91
+ context?: Record<string, unknown>;
92
+ }
93
+ declare global {
94
+ interface Window {
95
+ __scenetest_panel?: boolean;
96
+ __scenetest_openInEditor?: (loc: AssertionResult['location']) => void;
97
+ __scenetest_openFullscreenToGroup?: (groupId: number) => void;
98
+ __scenetest_showSequence?: (locationKey: string) => void;
99
+ __scenetest_setViewMode?: (mode: ViewMode) => void;
100
+ }
101
+ }
102
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/panels/observer/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,yFAAyF;IACzF,WAAW,CAAC,E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,CAAA;AAEnD,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,YAAY,GAAG,UAAU,CAAA;AAE5D,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAA;AAE3C,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,CAAA;AAEtF;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACrC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,UAAU,EAAE,OAAO,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,iBAAiB,CAAC,EAAE,OAAO,CAAA;QAG3B,wBAAwB,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,CAAC,UAAU,CAAC,KAAK,IAAI,CAAA;QACrE,iCAAiC,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;QAC7D,wBAAwB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;QACxD,uBAAuB,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;KACnD;CACF"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Types for the dev panel (browser-side)
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/panels/observer/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Utility functions for the dev panel
3
+ */
4
+ import type { AssertionResult } from './types.js';
5
+ /**
6
+ * Escape HTML special characters
7
+ */
8
+ export declare function escapeHtml(str: string): string;
9
+ /**
10
+ * Escape for use in HTML attributes (includes quote escaping)
11
+ * Use this for JSON embedded in onclick handlers, title attributes, etc.
12
+ */
13
+ export declare function escapeHtmlAttr(str: string): string;
14
+ /**
15
+ * Format context object for display
16
+ */
17
+ export declare function formatContext(ctx: Record<string, unknown> | undefined): string;
18
+ /**
19
+ * Format source location for display
20
+ */
21
+ export declare function formatLocation(loc: AssertionResult['location']): string;
22
+ /**
23
+ * Format timestamp for display
24
+ */
25
+ export declare function formatTime(ts: number): string;
26
+ /**
27
+ * Open file in editor using Vite's endpoint
28
+ */
29
+ export declare function openInEditor(loc: AssertionResult['location']): void;
30
+ /**
31
+ * Filter items based on current filter mode
32
+ */
33
+ export declare function filterItems(items: AssertionResult[]): AssertionResult[];
34
+ /**
35
+ * Compute pass/fail counts from items
36
+ */
37
+ export declare function getGroupStats(items: AssertionResult[]): {
38
+ passCount: number;
39
+ failCount: number;
40
+ };
41
+ /**
42
+ * Format a short location for the location row (just file basename + line)
43
+ */
44
+ export declare function formatLocationShort(loc: AssertionResult['location']): string;
45
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/panels/observer/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAGjD;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOlD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,MAAM,CAO9E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,MAAM,CAIvE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAG7C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,IAAI,CASnE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,eAAe,EAAE,CAKvE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAQhG;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,MAAM,CAI5E"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Utility functions for the dev panel
3
+ */
4
+ import { filter } from './state.js';
5
+ /**
6
+ * Escape HTML special characters
7
+ */
8
+ export function escapeHtml(str) {
9
+ return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
10
+ }
11
+ /**
12
+ * Escape for use in HTML attributes (includes quote escaping)
13
+ * Use this for JSON embedded in onclick handlers, title attributes, etc.
14
+ */
15
+ export function escapeHtmlAttr(str) {
16
+ return str
17
+ .replace(/&/g, '&amp;')
18
+ .replace(/</g, '&lt;')
19
+ .replace(/>/g, '&gt;')
20
+ .replace(/"/g, '&quot;')
21
+ .replace(/'/g, '&#39;');
22
+ }
23
+ /**
24
+ * Format context object for display
25
+ */
26
+ export function formatContext(ctx) {
27
+ if (!ctx)
28
+ return '';
29
+ try {
30
+ return JSON.stringify(ctx, null, 2);
31
+ }
32
+ catch {
33
+ return String(ctx);
34
+ }
35
+ }
36
+ /**
37
+ * Format source location for display
38
+ */
39
+ export function formatLocation(loc) {
40
+ if (!loc)
41
+ return '';
42
+ const file = loc.file.replace(/^.*\/src\//, 'src/');
43
+ return `${file}:${loc.line}${loc.column ? ':' + loc.column : ''}`;
44
+ }
45
+ /**
46
+ * Format timestamp for display
47
+ */
48
+ export function formatTime(ts) {
49
+ const d = new Date(ts);
50
+ return d.toLocaleTimeString('en-US', { hour12: false }) + '.' + String(d.getMilliseconds()).padStart(3, '0');
51
+ }
52
+ /**
53
+ * Open file in editor using Vite's endpoint
54
+ */
55
+ export function openInEditor(loc) {
56
+ if (!loc)
57
+ return;
58
+ fetch(`/__open-in-editor?file=${encodeURIComponent(loc.file)}&line=${loc.line}${loc.column ? '&column=' + loc.column : ''}`)
59
+ .catch(() => {
60
+ // Fallback: try vscode:// protocol
61
+ // Use encodeURI to handle special characters while preserving path separators
62
+ const encodedPath = encodeURI(loc.file);
63
+ window.open(`vscode://file${encodedPath}:${loc.line}:${loc.column || 1}`);
64
+ });
65
+ }
66
+ /**
67
+ * Filter items based on current filter mode
68
+ */
69
+ export function filterItems(items) {
70
+ if (filter === 'all')
71
+ return items;
72
+ if (filter === 'fails')
73
+ return items.filter(a => !a.result);
74
+ if (filter === 'passes')
75
+ return items.filter(a => a.result);
76
+ return items;
77
+ }
78
+ /**
79
+ * Compute pass/fail counts from items
80
+ */
81
+ export function getGroupStats(items) {
82
+ let passCount = 0;
83
+ let failCount = 0;
84
+ for (const item of items) {
85
+ if (item.result)
86
+ passCount++;
87
+ else
88
+ failCount++;
89
+ }
90
+ return { passCount, failCount };
91
+ }
92
+ /**
93
+ * Format a short location for the location row (just file basename + line)
94
+ */
95
+ export function formatLocationShort(loc) {
96
+ if (!loc)
97
+ return '';
98
+ const file = loc.file.split('/').pop() || loc.file;
99
+ return `${file}:${loc.line}`;
100
+ }
101
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceR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AC,CAAC,MAAM,CAAC,CAAA;IAC3D,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAwB;IACpD,IAAI,SAAS,GAAG,CAAC,CAAA;IACjB,IAAI,SAAS,GAAG,CAAC,CAAA;IACjB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,MAAM;YAAE,SAAS,EAAE,CAAA;;YACvB,SAAS,EAAE,CAAA;IAClB,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAgC;IAClE,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAA;IACnB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,GAAG,CAAC,IAAI,CAAA;IAClD,OAAO,GAAG,IAAI,IAAI,GAAG,CAAC,IAAI,EAAE,CAAA;AAC9B,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Auto-initializing recorder import
3
+ *
4
+ * Usage:
5
+ * import '@scenetest/vite-plugin/panels/recorder'
6
+ *
7
+ * This will automatically initialize the recorder panel when imported.
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=auto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto.d.ts","sourceRoot":"","sources":["../../../src/panels/recorder/auto.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Auto-initializing recorder import
3
+ *
4
+ * Usage:
5
+ * import '@scenetest/vite-plugin/panels/recorder'
6
+ *
7
+ * This will automatically initialize the recorder panel when imported.
8
+ */
9
+ import { initRecorder } from './index.js';
10
+ initRecorder();
11
+ //# sourceMappingURL=auto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto.js","sourceRoot":"","sources":["../../../src/panels/recorder/auto.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAEzC,YAAY,EAAE,CAAA"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Event capture system for the recorder.
3
+ *
4
+ * Intercepts user interactions (click, type, check, select, navigate)
5
+ * and translates them into DSL lines using reverse selector resolution.
6
+ */
7
+ import type { RecorderState, DslLine } from './types.js';
8
+ /** Callback for when a new DSL line is recorded */
9
+ type OnLine = (line: DslLine) => void;
10
+ /** Callback for when an element has no selector */
11
+ type OnWarning = (message: string) => void;
12
+ /**
13
+ * Set up event capture on the document.
14
+ * Returns a cleanup function to remove all listeners.
15
+ */
16
+ export declare function startCapture(state: RecorderState, onLine: OnLine, onWarning: OnWarning): () => void;
17
+ export {};
18
+ //# sourceMappingURL=capture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../src/panels/recorder/capture.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAgB,MAAM,YAAY,CAAA;AAKtE,mDAAmD;AACnD,KAAK,MAAM,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;AAErC,mDAAmD;AACnD,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;AAE1C;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,GACnB,MAAM,IAAI,CA4LZ"}
@@ -0,0 +1,218 @@
1
+ /**
2
+ * Event capture system for the recorder.
3
+ *
4
+ * Intercepts user interactions (click, type, check, select, navigate)
5
+ * and translates them into DSL lines using reverse selector resolution.
6
+ */
7
+ import { reverseSelector, nearestAddressable, explainUnaddressable } from './reverse-selector.js';
8
+ /** How long to wait after the last keystroke before finalizing a typeInto line */
9
+ const INPUT_DEBOUNCE_MS = 600;
10
+ /**
11
+ * Set up event capture on the document.
12
+ * Returns a cleanup function to remove all listeners.
13
+ */
14
+ export function startCapture(state, onLine, onWarning) {
15
+ const cleanups = [];
16
+ // --- Click capture ---
17
+ function handleClick(e) {
18
+ if (!state.recording)
19
+ return;
20
+ const target = e.target;
21
+ if (!target || isRecorderElement(target))
22
+ return;
23
+ // Flush any pending input first
24
+ flushPendingInput(state, onLine);
25
+ // Special case: if clicking an input/textarea/select, don't emit click
26
+ // (the input/change handler will handle it)
27
+ const tag = target.tagName.toLowerCase();
28
+ if (tag === 'input' || tag === 'textarea' || tag === 'select') {
29
+ return;
30
+ }
31
+ // Also skip if clicking a label (it will trigger the input focus)
32
+ if (tag === 'label')
33
+ return;
34
+ const selector = resolveTarget(target);
35
+ if (!selector) {
36
+ onWarning(explainUnaddressable(target));
37
+ return;
38
+ }
39
+ // Check if it's a checkbox or radio being clicked
40
+ const inputChild = target.querySelector('input[type="checkbox"], input[type="radio"]');
41
+ if (inputChild) {
42
+ const inputSelector = reverseSelector(inputChild) || selector;
43
+ addLine(state, `check ${inputSelector}`, onLine);
44
+ return;
45
+ }
46
+ addLine(state, `click ${selector}`, onLine);
47
+ }
48
+ // --- Input capture (for typeInto) ---
49
+ function handleInput(e) {
50
+ if (!state.recording)
51
+ return;
52
+ const target = e.target;
53
+ if (!target || isRecorderElement(target))
54
+ return;
55
+ const tag = target.tagName.toLowerCase();
56
+ if (tag !== 'input' && tag !== 'textarea')
57
+ return;
58
+ // Skip checkboxes and radios (handled by change)
59
+ const type = target.getAttribute('type')?.toLowerCase();
60
+ if (type === 'checkbox' || type === 'radio')
61
+ return;
62
+ const selector = resolveTarget(target);
63
+ if (!selector) {
64
+ onWarning(explainUnaddressable(target));
65
+ return;
66
+ }
67
+ const value = target.value;
68
+ // If there's already a pending input for the same element, update it
69
+ if (state.pendingInput && state.pendingInput.element === target) {
70
+ clearTimeout(state.pendingInput.timer);
71
+ state.pendingInput.value = value;
72
+ state.pendingInput.timer = setTimeout(() => {
73
+ flushPendingInput(state, onLine);
74
+ }, INPUT_DEBOUNCE_MS);
75
+ return;
76
+ }
77
+ // Flush any previous pending input
78
+ flushPendingInput(state, onLine);
79
+ // Start new pending input
80
+ state.pendingInput = {
81
+ element: target,
82
+ selector,
83
+ value,
84
+ timer: setTimeout(() => {
85
+ flushPendingInput(state, onLine);
86
+ }, INPUT_DEBOUNCE_MS),
87
+ };
88
+ }
89
+ // --- Change capture (for select, checkbox) ---
90
+ function handleChange(e) {
91
+ if (!state.recording)
92
+ return;
93
+ const target = e.target;
94
+ if (!target || isRecorderElement(target))
95
+ return;
96
+ const tag = target.tagName.toLowerCase();
97
+ const type = target.getAttribute('type')?.toLowerCase();
98
+ const selector = resolveTarget(target);
99
+ if (!selector) {
100
+ onWarning(explainUnaddressable(target));
101
+ return;
102
+ }
103
+ if (tag === 'select') {
104
+ flushPendingInput(state, onLine);
105
+ const value = target.value;
106
+ addLine(state, `select ${selector} ${value}`, onLine);
107
+ }
108
+ else if (tag === 'input' && (type === 'checkbox' || type === 'radio')) {
109
+ flushPendingInput(state, onLine);
110
+ addLine(state, `check ${selector}`, onLine);
111
+ }
112
+ }
113
+ // --- Navigation capture ---
114
+ // Intercept pushState and replaceState to detect SPA navigation
115
+ const originalPushState = history.pushState.bind(history);
116
+ const originalReplaceState = history.replaceState.bind(history);
117
+ let lastRecordedPath = location.pathname + location.search;
118
+ function handleNavigation() {
119
+ if (!state.recording)
120
+ return;
121
+ const newPath = location.pathname + location.search;
122
+ if (newPath !== lastRecordedPath) {
123
+ flushPendingInput(state, onLine);
124
+ lastRecordedPath = newPath;
125
+ addLine(state, `openTo ${newPath}`, onLine);
126
+ }
127
+ }
128
+ history.pushState = function (...args) {
129
+ originalPushState(...args);
130
+ handleNavigation();
131
+ };
132
+ history.replaceState = function (...args) {
133
+ originalReplaceState(...args);
134
+ handleNavigation();
135
+ };
136
+ function handlePopState() {
137
+ handleNavigation();
138
+ }
139
+ // --- Scroll capture ---
140
+ // We only capture explicit scroll-to-bottom actions, not all scrolls
141
+ // This is detected when the user scrolls to within 5px of the bottom
142
+ let scrollTimer = null;
143
+ function handleScroll(e) {
144
+ if (!state.recording)
145
+ return;
146
+ const target = e.target;
147
+ if (!target || target === document.documentElement || isRecorderElement(target))
148
+ return;
149
+ // Debounce scroll events
150
+ if (scrollTimer)
151
+ clearTimeout(scrollTimer);
152
+ scrollTimer = setTimeout(() => {
153
+ // Check if scrolled to bottom
154
+ const isAtBottom = target.scrollHeight - target.scrollTop - target.clientHeight < 5;
155
+ if (isAtBottom && target.scrollHeight > target.clientHeight + 50) {
156
+ addLine(state, 'scrollToBottom', onLine);
157
+ }
158
+ }, 300);
159
+ }
160
+ // --- Attach listeners ---
161
+ document.addEventListener('click', handleClick, true);
162
+ document.addEventListener('input', handleInput, true);
163
+ document.addEventListener('change', handleChange, true);
164
+ window.addEventListener('popstate', handlePopState);
165
+ document.addEventListener('scroll', handleScroll, true);
166
+ cleanups.push(() => document.removeEventListener('click', handleClick, true), () => document.removeEventListener('input', handleInput, true), () => document.removeEventListener('change', handleChange, true), () => window.removeEventListener('popstate', handlePopState), () => document.removeEventListener('scroll', handleScroll, true), () => {
167
+ history.pushState = originalPushState;
168
+ history.replaceState = originalReplaceState;
169
+ });
170
+ return () => {
171
+ flushPendingInput(state, onLine);
172
+ cleanups.forEach(fn => fn());
173
+ };
174
+ }
175
+ // --- Helpers ---
176
+ function addLine(state, text, onLine) {
177
+ const line = {
178
+ id: state.nextId++,
179
+ text,
180
+ timestamp: Date.now(),
181
+ played: true,
182
+ };
183
+ state.lines.push(line);
184
+ onLine(line);
185
+ }
186
+ function flushPendingInput(state, onLine) {
187
+ const pending = state.pendingInput;
188
+ if (!pending)
189
+ return;
190
+ clearTimeout(pending.timer);
191
+ state.pendingInput = null;
192
+ if (pending.value) {
193
+ addLine(state, `typeInto ${pending.selector} ${pending.value}`, onLine);
194
+ }
195
+ }
196
+ function resolveTarget(element) {
197
+ // First try the element itself
198
+ const direct = reverseSelector(element);
199
+ if (direct)
200
+ return direct;
201
+ // Try the nearest addressable ancestor
202
+ const ancestor = nearestAddressable(element);
203
+ if (ancestor) {
204
+ return reverseSelector(ancestor);
205
+ }
206
+ return null;
207
+ }
208
+ function isRecorderElement(element) {
209
+ let current = element;
210
+ while (current) {
211
+ if (current.id === 'scenetest-recorder' || current.id === 'scenetest-panel') {
212
+ return true;
213
+ }
214
+ current = current.parentElement;
215
+ }
216
+ return false;
217
+ }
218
+ //# sourceMappingURL=capture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture.js","sourceRoot":"","sources":["../../../src/panels/recorder/capture.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAGjG,kFAAkF;AAClF,MAAM,iBAAiB,GAAG,GAAG,CAAA;AAQ7B;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAoB,EACpB,MAAc,EACd,SAAoB;IAEpB,MAAM,QAAQ,GAAsB,EAAE,CAAA;IAEtC,wBAAwB;IACxB,SAAS,WAAW,CAAC,CAAa;QAChC,IAAI,CAAC,KAAK,CAAC,SAAS;YAAE,OAAM;QAE5B,MAAM,MAAM,GAAG,CAAC,CAAC,MAAiB,CAAA;QAClC,IAAI,CAAC,MAAM,IAAI,iBAAiB,CAAC,MAAM,CAAC;YAAE,OAAM;QAEhD,gCAAgC;QAChC,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QAEhC,uEAAuE;QACvE,4CAA4C;QAC5C,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAA;QACxC,IAAI,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,UAAU,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC9D,OAAM;QACR,CAAC;QAED,kEAAkE;QAClE,IAAI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el.
5
+ * Captures clicks, typing, navigation, and annotates with inline assertions.
6
+ *
7
+ * Usage:
8
+ * import { initRecorder } from '@scenetest/vite-plugin/panels/recorder'
9
+ * initRecorder()
10
+ *
11
+ * Or auto-init:
12
+ * import '@scenetest/vite-plugin/panels/recorder'
13
+ */
14
+ import type { RecorderState } from './types.js';
15
+ export type { DslLine, AssertionAnnotation, RecorderState } from './types.js';
16
+ declare global {
17
+ interface Window {
18
+ __scenetest_recorder?: boolean;
19
+ }
20
+ }
21
+ /**
22
+ * Initialize the scene recorder.
23
+ * Creates the sidebar panel, starts event capture, and hooks into assertions.
24
+ * Safe to call multiple times — subsequent calls are no-ops.
25
+ */
26
+ export declare function initRecorder(): void;
27
+ /**
28
+ * Get the current DSL lines as a string array.
29
+ * Useful for programmatic access.
30
+ */
31
+ export declare function getDslLines(): string[];
32
+ /**
33
+ * Get the full recorder state.
34
+ * Useful for testing and debugging.
35
+ */
36
+ export declare function getRecorderState(): RecorderState;
37
+ /**
38
+ * Programmatically stop the recorder and clean up.
39
+ */
40
+ export declare function destroyRecorder(): void;
41
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/panels/recorder/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAgC,MAAM,YAAY,CAAA;AAc7E,YAAY,EAAE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE7E,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,oBAAoB,CAAC,EAAE,OAAO,CAAA;KAE/B;CACF;AAyBD;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAuBnC;AAwJD;;;GAGG;AACH,wBAAgB,WAAW,IAAI,MAAM,EAAE,CAEtC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAEhD;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAatC"}