@james-infotrack/demo-recorder 0.1.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 (74) hide show
  1. package/CHANGELOG.md +143 -0
  2. package/LICENSE +21 -0
  3. package/README.md +181 -0
  4. package/dist/components/configEditor/configEditor.component.d.ts +8 -0
  5. package/dist/components/configEditor/configEditor.component.d.ts.map +1 -0
  6. package/dist/components/configEditor/index.d.ts +5 -0
  7. package/dist/components/configEditor/index.d.ts.map +1 -0
  8. package/dist/components/configEditor/jsonEditor.component.d.ts +8 -0
  9. package/dist/components/configEditor/jsonEditor.component.d.ts.map +1 -0
  10. package/dist/components/configEditor/livePreview.component.d.ts +8 -0
  11. package/dist/components/configEditor/livePreview.component.d.ts.map +1 -0
  12. package/dist/components/demoPlayer/demoPlayer.component.d.ts +15 -0
  13. package/dist/components/demoPlayer/demoPlayer.component.d.ts.map +1 -0
  14. package/dist/components/demoPlayer/index.d.ts +9 -0
  15. package/dist/components/demoPlayer/index.d.ts.map +1 -0
  16. package/dist/components/demoPlayer/playerControls.component.d.ts +12 -0
  17. package/dist/components/demoPlayer/playerControls.component.d.ts.map +1 -0
  18. package/dist/components/demoPlayer/playerControls.styles.d.ts +6 -0
  19. package/dist/components/demoPlayer/playerControls.styles.d.ts.map +1 -0
  20. package/dist/components/demoPlayer/spotlight.component.d.ts +7 -0
  21. package/dist/components/demoPlayer/spotlight.component.d.ts.map +1 -0
  22. package/dist/components/demoPlayer/stepTooltip.component.d.ts +10 -0
  23. package/dist/components/demoPlayer/stepTooltip.component.d.ts.map +1 -0
  24. package/dist/components/demoPlayer/stepTooltip.styles.d.ts +15 -0
  25. package/dist/components/demoPlayer/stepTooltip.styles.d.ts.map +1 -0
  26. package/dist/components/demoRecorder/demoRecorder.component.d.ts +11 -0
  27. package/dist/components/demoRecorder/demoRecorder.component.d.ts.map +1 -0
  28. package/dist/components/demoRecorder/index.d.ts +3 -0
  29. package/dist/components/demoRecorder/index.d.ts.map +1 -0
  30. package/dist/components/demoRecorder/recorderUI.component.d.ts +10 -0
  31. package/dist/components/demoRecorder/recorderUI.component.d.ts.map +1 -0
  32. package/dist/components/demoRecorder/recorderUI.styles.d.ts +8 -0
  33. package/dist/components/demoRecorder/recorderUI.styles.d.ts.map +1 -0
  34. package/dist/components/index.d.ts +5 -0
  35. package/dist/components/index.d.ts.map +1 -0
  36. package/dist/core/actionExecutor.core.d.ts +18 -0
  37. package/dist/core/actionExecutor.core.d.ts.map +1 -0
  38. package/dist/core/aiProcessor.core.d.ts +10 -0
  39. package/dist/core/aiProcessor.core.d.ts.map +1 -0
  40. package/dist/core/domChangeDetector.core.d.ts +22 -0
  41. package/dist/core/domChangeDetector.core.d.ts.map +1 -0
  42. package/dist/core/eventCapture.core.d.ts +22 -0
  43. package/dist/core/eventCapture.core.d.ts.map +1 -0
  44. package/dist/core/index.d.ts +6 -0
  45. package/dist/core/index.d.ts.map +1 -0
  46. package/dist/core/networkInterceptor.core.d.ts +22 -0
  47. package/dist/core/networkInterceptor.core.d.ts.map +1 -0
  48. package/dist/demo-recorder.css +1 -0
  49. package/dist/index.cjs.js +215 -0
  50. package/dist/index.d.ts +74 -0
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.esm.js +9298 -0
  53. package/dist/models/actions.model.d.ts +2 -0
  54. package/dist/models/actions.model.d.ts.map +1 -0
  55. package/dist/models/config.model.d.ts +87 -0
  56. package/dist/models/config.model.d.ts.map +1 -0
  57. package/dist/models/events.model.d.ts +68 -0
  58. package/dist/models/events.model.d.ts.map +1 -0
  59. package/dist/models/index.d.ts +4 -0
  60. package/dist/models/index.d.ts.map +1 -0
  61. package/dist/styles.css +1 -0
  62. package/dist/utils/formInput.util.d.ts +17 -0
  63. package/dist/utils/formInput.util.d.ts.map +1 -0
  64. package/dist/utils/index.d.ts +6 -0
  65. package/dist/utils/index.d.ts.map +1 -0
  66. package/dist/utils/screenshot.util.d.ts +13 -0
  67. package/dist/utils/screenshot.util.d.ts.map +1 -0
  68. package/dist/utils/selector.util.d.ts +12 -0
  69. package/dist/utils/selector.util.d.ts.map +1 -0
  70. package/dist/utils/timing.util.d.ts +10 -0
  71. package/dist/utils/timing.util.d.ts.map +1 -0
  72. package/dist/utils/validation.util.d.ts +13 -0
  73. package/dist/utils/validation.util.d.ts.map +1 -0
  74. package/package.json +93 -0
@@ -0,0 +1,2 @@
1
+ export type { ActionConfig, APIAction, ClickAction, DOMActionConfig, FunctionAction, InputAction, NavigateAction, SelectAction, WaitAction, } from './config.model';
2
+ //# sourceMappingURL=actions.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.model.d.ts","sourceRoot":"","sources":["../../src/models/actions.model.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,SAAS,EACT,WAAW,EACX,eAAe,EACf,cAAc,EACd,WAAW,EACX,cAAc,EACd,YAAY,EACZ,UAAU,GACX,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,87 @@
1
+ export interface DemoConfig {
2
+ pluginId: string;
3
+ name: string;
4
+ apiEndpoint?: string;
5
+ authToken?: string;
6
+ baseUrl?: string;
7
+ demos: Demo[];
8
+ }
9
+ export interface Demo {
10
+ demoId: string;
11
+ title: string;
12
+ description: string;
13
+ steps: DemoStep[];
14
+ }
15
+ export interface DemoStep {
16
+ id: string;
17
+ selector: string;
18
+ fallbackSelectors?: string[];
19
+ title: string;
20
+ description: string;
21
+ screenshot?: string;
22
+ position?: 'top' | 'bottom' | 'left' | 'right' | 'auto';
23
+ action: ActionConfig;
24
+ beforeAction?: ActionConfig;
25
+ afterAction?: ActionConfig;
26
+ executionMode?: 'real' | 'simulated';
27
+ hint?: string;
28
+ waitForCondition?: WaitCondition;
29
+ expectedDuration?: number;
30
+ }
31
+ export type ActionConfig = ClickAction | InputAction | SelectAction | NavigateAction | WaitAction | APIAction | FunctionAction | DOMActionConfig;
32
+ export interface ClickAction {
33
+ type: 'click';
34
+ waitForNavigation?: boolean;
35
+ }
36
+ export interface InputAction {
37
+ type: 'input';
38
+ value: string;
39
+ clearFirst?: boolean;
40
+ triggerChange?: boolean;
41
+ }
42
+ export interface SelectAction {
43
+ type: 'select';
44
+ value: string;
45
+ }
46
+ export interface NavigateAction {
47
+ type: 'navigate';
48
+ url: string;
49
+ }
50
+ export interface WaitAction {
51
+ type: 'wait';
52
+ duration: number;
53
+ }
54
+ export interface APIAction {
55
+ type: 'api';
56
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
57
+ url: string;
58
+ headers?: Record<string, string>;
59
+ body?: any;
60
+ }
61
+ export interface FunctionAction {
62
+ type: 'function';
63
+ target: string;
64
+ args?: any[];
65
+ }
66
+ export interface DOMActionConfig {
67
+ type: 'dom';
68
+ operation: 'addClass' | 'removeClass' | 'setAttribute' | 'removeAttribute' | 'setStyle';
69
+ selector: string;
70
+ className?: string;
71
+ attribute?: string;
72
+ value?: string;
73
+ style?: Record<string, string>;
74
+ }
75
+ export interface WaitCondition {
76
+ type: 'element_visible' | 'element_hidden' | 'element_state' | 'url_match';
77
+ selector?: string;
78
+ state?: string;
79
+ url?: string;
80
+ timeout?: number;
81
+ }
82
+ export interface SelectorConfig {
83
+ primary: string;
84
+ fallbacks: string[];
85
+ xpath: string;
86
+ }
87
+ //# sourceMappingURL=config.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.model.d.ts","sourceRoot":"","sources":["../../src/models/config.model.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC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model';
2
+ export interface CapturedEvent {
3
+ id: string;
4
+ timestamp: number;
5
+ element: {
6
+ selector: SelectorConfig;
7
+ tagName: string;
8
+ textContent: string;
9
+ ariaLabel?: string;
10
+ placeholder?: string;
11
+ boundingBox: DOMRect;
12
+ };
13
+ action: {
14
+ type: 'click' | 'input' | 'select' | 'change' | 'focus' | 'blur' | 'hover';
15
+ value?: string;
16
+ };
17
+ screenshot: string;
18
+ context: {
19
+ url: string;
20
+ viewport: {
21
+ width: number;
22
+ height: number;
23
+ };
24
+ scrollPosition: {
25
+ x: number;
26
+ y: number;
27
+ };
28
+ };
29
+ captured: {
30
+ networkRequests: CapturedRequest[];
31
+ domChanges: DOMChangesSummary;
32
+ formInput?: FormInputCapture;
33
+ timeSpent: number;
34
+ };
35
+ }
36
+ export interface CapturedRequest {
37
+ url: string;
38
+ method: string;
39
+ headers: Record<string, string>;
40
+ body: any;
41
+ response: {
42
+ status: number;
43
+ statusText: string;
44
+ body: any;
45
+ };
46
+ timestamp: number;
47
+ }
48
+ export interface DOMChangesSummary {
49
+ addedElements: string[];
50
+ removedElements: string[];
51
+ changedAttributes: Array<{
52
+ selector: string;
53
+ attribute: string;
54
+ oldValue: string;
55
+ newValue: string;
56
+ }>;
57
+ hasNavigation: boolean;
58
+ }
59
+ export interface FormInputCapture {
60
+ selector: string;
61
+ fieldName: string;
62
+ fieldType: string;
63
+ value: string;
64
+ isSensitive: boolean;
65
+ placeholder?: string;
66
+ label?: string;
67
+ }
68
+ //# sourceMappingURL=events.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.model.d.ts","sourceRoot":"","sources":["../../src/models/events.model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE;QACP,QAAQ,EAAE,cAAc,CAAC;QACzB,O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CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,4 @@
1
+ export type { ActionConfig, APIAction, ClickAction, DOMActionConfig, FunctionAction, InputAction, NavigateAction, SelectAction, WaitAction, } from './actions.model';
2
+ export type { Demo, DemoConfig, DemoStep, SelectorConfig, WaitCondition, } from './config.model';
3
+ export type { CapturedEvent, CapturedRequest, DOMChangesSummary, FormInputCapture, } from './events.model';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAGA,YAAY,EACV,YAAY,EACZ,SAAS,EACT,WAAW,EACX,eAAe,EACf,cAAc,EACd,WAAW,EACX,cAAc,EACd,YAAY,EACZ,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,cAAc,EACd,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ @keyframes capturePulse{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(1.05)}}@keyframes previewPulse{0%,to{opacity:1}50%{opacity:.7}}@keyframes spotlightPulse{0%,to{box-shadow:0 0 0 3px #3b82f680}50%{box-shadow:0 0 0 6px #3b82f64d}}
@@ -0,0 +1,17 @@
1
+ import type { FormInputCapture } from '../models';
2
+ /**
3
+ * Captures form input data with automatic masking of sensitive fields.
4
+ * Supports input, textarea, and select elements.
5
+ */
6
+ export declare function captureFormInput(element: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement): FormInputCapture;
7
+ /**
8
+ * Checks if the given element contains sensitive data that should be masked.
9
+ * Detects passwords, credit cards, SSN, tokens, API keys, etc.
10
+ */
11
+ export declare function checkIfSensitive(element: HTMLElement): boolean;
12
+ /**
13
+ * Finds the associated label for a form element.
14
+ * Tries label[for="id"], parent label, then aria-label in that order.
15
+ */
16
+ export declare function findAssociatedLabel(element: HTMLElement): string | undefined;
17
+ //# sourceMappingURL=formInput.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formInput.util.d.ts","sourceRoot":"","sources":["../../src/utils/formInput.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAGlD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,gBAAgB,GAAG,mBAAmB,GAAG,iBAAiB,GAClE,gBAAgB,CAwBlB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAqB9D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAa5E"}
@@ -0,0 +1,6 @@
1
+ export { captureFormInput, checkIfSensitive, findAssociatedLabel, } from './formInput.util';
2
+ export { captureElementScreenshot, optimizeScreenshot, } from './screenshot.util';
3
+ export { generateSelector, getXPath } from './selector.util';
4
+ export { TimingCapture, wait } from './timing.util';
5
+ export { ValidationError, validateDemoConfig } from './validation.util';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Captures a screenshot of an HTML element with a highlight border
3
+ * @param element - The HTML element to capture
4
+ * @returns Base64-encoded PNG image data URL
5
+ */
6
+ export declare function captureElementScreenshot(element: HTMLElement): Promise<string>;
7
+ /**
8
+ * Optimizes a screenshot by scaling down and reducing quality
9
+ * @param dataUrl - Base64-encoded image data URL
10
+ * @returns Optimized base64-encoded JPEG image data URL
11
+ */
12
+ export declare function optimizeScreenshot(dataUrl: string): Promise<string>;
13
+ //# sourceMappingURL=screenshot.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screenshot.util.d.ts","sourceRoot":"","sources":["../../src/utils/screenshot.util.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAsCpF;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwCzE"}
@@ -0,0 +1,12 @@
1
+ import type { SelectorConfig } from '../models';
2
+ /**
3
+ * Generates an optimal selector for the given HTML element following a priority-based algorithm.
4
+ * Returns primary selector, fallback selectors, and XPath.
5
+ */
6
+ export declare function generateSelector(element: HTMLElement): SelectorConfig;
7
+ /**
8
+ * Generates an XPath expression for the given element.
9
+ * Uses ID if available, otherwise creates position-based path.
10
+ */
11
+ export declare function getXPath(element: HTMLElement): string;
12
+ //# sourceMappingURL=selector.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selector.util.d.ts","sourceRoot":"","sources":["../../src/utils/selector.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,cAAc,CAgDrE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAmBrD"}
@@ -0,0 +1,10 @@
1
+ export declare class TimingCapture {
2
+ private stepStartTime;
3
+ private stepTimings;
4
+ startStep(): void;
5
+ endStep(): number;
6
+ getAverageStepTime(): number;
7
+ getAllTimings(): number[];
8
+ }
9
+ export declare function wait(ms: number): Promise<void>;
10
+ //# sourceMappingURL=timing.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timing.util.d.ts","sourceRoot":"","sources":["../../src/utils/timing.util.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAa;IACxB,OAAO,CAAC,aAAa,CAAa;IAClC,OAAO,CAAC,WAAW,CAAgB;IAEnC,SAAS,IAAI,IAAI;IAIjB,OAAO,IAAI,MAAM;IAMjB,kBAAkB,IAAI,MAAM;IAM5B,aAAa,IAAI,MAAM,EAAE;CAG1B;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9C"}
@@ -0,0 +1,13 @@
1
+ import type { DemoConfig } from '../models/config.model';
2
+ interface ValidationErrorDetail {
3
+ path: string;
4
+ message: string;
5
+ }
6
+ export declare class ValidationError extends Error {
7
+ errors: ValidationErrorDetail[];
8
+ constructor(message: string, errors: ValidationErrorDetail[]);
9
+ format(): string;
10
+ }
11
+ export declare function validateDemoConfig(config: DemoConfig): void;
12
+ export {};
13
+ //# sourceMappingURL=validation.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.util.d.ts","sourceRoot":"","sources":["../../src/utils/validation.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEvE,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,eAAgB,SAAQ,KAAK;IACjC,MAAM,EAAE,qBAAqB,EAAE,CAAC;gBAE3B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE;IAM5D,MAAM,IAAI,MAAM;CAKjB;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAqE3D"}
package/package.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "@james-infotrack/demo-recorder",
3
+ "version": "0.1.0",
4
+ "description": "Record and replay interactive web demos with AI assistance. Capture user interactions, generate demo configurations, and replay them with visual feedback.",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs.js",
7
+ "module": "./dist/index.esm.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.esm.js",
13
+ "require": "./dist/index.cjs.js"
14
+ },
15
+ "./styles.css": "./dist/styles.css"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "README.md",
20
+ "LICENSE",
21
+ "CHANGELOG.md"
22
+ ],
23
+ "keywords": [
24
+ "demo",
25
+ "recorder",
26
+ "tutorial",
27
+ "onboarding",
28
+ "react",
29
+ "playback",
30
+ "interactive",
31
+ "ai-powered",
32
+ "demo-player",
33
+ "demo-editor",
34
+ "web-demos"
35
+ ],
36
+ "author": "InfoTrack Global",
37
+ "license": "MIT",
38
+ "homepage": "https://github.com/InfoTrackGlobal/demo-mode#readme",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/InfoTrackGlobal/demo-mode.git"
42
+ },
43
+ "bugs": {
44
+ "url": "https://github.com/InfoTrackGlobal/demo-mode/issues"
45
+ },
46
+ "scripts": {
47
+ "dev": "vite",
48
+ "build": "tsc -p tsconfig.build.json && vite build && cp dist/demo-recorder.css dist/styles.css",
49
+ "preview": "vite preview",
50
+ "test": "vitest",
51
+ "test:ui": "vitest --ui",
52
+ "test:coverage": "vitest --coverage",
53
+ "lint": "biome lint ./src",
54
+ "lint:fix": "biome lint --write ./src",
55
+ "format": "biome format ./src",
56
+ "format:fix": "biome format --write ./src",
57
+ "check": "biome check ./src",
58
+ "check:fix": "biome check --write ./src",
59
+ "typecheck": "tsc --noEmit"
60
+ },
61
+ "peerDependencies": {
62
+ "react": "^18.0.0",
63
+ "react-dom": "^18.0.0"
64
+ },
65
+ "devDependencies": {
66
+ "@biomejs/biome": "2.3.11",
67
+ "@testing-library/jest-dom": "6.9.1",
68
+ "@testing-library/react": "16.3.2",
69
+ "@testing-library/user-event": "14.6.1",
70
+ "@types/bun": "latest",
71
+ "@types/react": "19.2.9",
72
+ "@types/react-dom": "19.2.3",
73
+ "@vitejs/plugin-react": "5.1.2",
74
+ "@vitest/coverage-v8": "^4.0.17",
75
+ "@vitest/ui": "4.0.17",
76
+ "canvas": "^3.2.1",
77
+ "happy-dom": "20.3.4",
78
+ "jsdom": "27.4.0",
79
+ "typescript": "5.9.3",
80
+ "vite": "7.3.1",
81
+ "vitest": "4.0.17"
82
+ },
83
+ "dependencies": {
84
+ "@emotion/react": "11.14.0",
85
+ "@emotion/styled": "11.14.1",
86
+ "@monaco-editor/react": "4.7.0",
87
+ "html2canvas": "1.4.1",
88
+ "monaco-editor": "0.55.1",
89
+ "react": "^18.0.0",
90
+ "react-dom": "^18.0.0",
91
+ "theme-ui": "0.17.4"
92
+ }
93
+ }