@inspecto-dev/core 0.2.0-alpha.3 → 0.3.0-alpha.1
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 +14 -5
- package/dist/chunk-JPRRZPBL.js +46 -0
- package/dist/component-HSGKWEXV.js +6312 -0
- package/dist/component-HSGKWEXV.js.map +1 -0
- package/dist/index.cjs +6372 -864
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +88 -14
- package/dist/index.d.ts +88 -14
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/chunk-C4KO2HLL.js +0 -25
- package/dist/component-4WPU23TV.js +0 -1097
- package/dist/component-4WPU23TV.js.map +0 -1
- /package/dist/{chunk-C4KO2HLL.js.map → chunk-JPRRZPBL.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { InspectorOptions } from '@inspecto-dev/types';
|
|
2
2
|
export { InspectorOptions } from '@inspecto-dev/types';
|
|
3
3
|
|
|
4
|
+
type InspectorMode = 'inspect' | 'annotate';
|
|
5
|
+
type InspectoOptions = InspectorOptions & {
|
|
6
|
+
mode?: InspectorMode;
|
|
7
|
+
};
|
|
4
8
|
declare const BaseElement: {
|
|
5
9
|
new (): HTMLElement;
|
|
6
10
|
prototype: HTMLElement;
|
|
@@ -10,40 +14,110 @@ declare class InspectoElement extends BaseElement {
|
|
|
10
14
|
private serverHotKeys;
|
|
11
15
|
private active;
|
|
12
16
|
private disabled;
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
private dragStartY;
|
|
17
|
-
private badgeInitialRight;
|
|
18
|
-
private badgeInitialBottom;
|
|
17
|
+
private prePauseState;
|
|
18
|
+
private mode;
|
|
19
|
+
private launcherPanelOpen;
|
|
19
20
|
private shadowRootEl;
|
|
20
21
|
private overlay;
|
|
22
|
+
private annotateOverlay;
|
|
21
23
|
private cleanupMenu;
|
|
24
|
+
private annotateSession;
|
|
25
|
+
private annotateCapturePaused;
|
|
26
|
+
private annotateQuickCaptureEnabled;
|
|
27
|
+
private annotateSidebar;
|
|
28
|
+
private annotateElements;
|
|
29
|
+
private annotateDrafts;
|
|
30
|
+
private annotateEditingRecord;
|
|
22
31
|
private badge;
|
|
32
|
+
private configLoadPromise;
|
|
33
|
+
private annotationResponseMode;
|
|
34
|
+
private annotateInstructionDraft;
|
|
35
|
+
private annotateErrorMessage;
|
|
36
|
+
private annotateRuntimeContextEnabled;
|
|
37
|
+
private annotateScreenshotContextEnabled;
|
|
38
|
+
private annotateCssContextEnabled;
|
|
39
|
+
private annotateSendState;
|
|
40
|
+
private annotateSuccessScope;
|
|
41
|
+
private annotateSuccessTimeout;
|
|
42
|
+
private pendingAnnotateViewportFrame;
|
|
43
|
+
private runtimeContextCollector;
|
|
44
|
+
private cleanupRuntimeContextCapture;
|
|
45
|
+
private lastPointerX;
|
|
46
|
+
private lastPointerY;
|
|
47
|
+
private readonly onFocusChange;
|
|
23
48
|
connectedCallback(): void;
|
|
24
49
|
disconnectedCallback(): void;
|
|
25
|
-
configure(options:
|
|
50
|
+
configure(options: InspectoOptions): void;
|
|
51
|
+
setMode(mode: InspectorMode): void;
|
|
52
|
+
getMode(): InspectorMode;
|
|
26
53
|
private createBadge;
|
|
27
|
-
private
|
|
28
|
-
private readonly onDragMove;
|
|
29
|
-
private readonly onDragEnd;
|
|
30
|
-
private toggleDisabled;
|
|
54
|
+
private setPaused;
|
|
31
55
|
private dismiss;
|
|
32
|
-
private
|
|
56
|
+
private getHotKeyLabel;
|
|
33
57
|
private getEffectiveHotKeys;
|
|
58
|
+
private getAnnotationResponseMode;
|
|
34
59
|
private updateBadgeContent;
|
|
35
60
|
private setActive;
|
|
36
61
|
private readonly onMouseMove;
|
|
37
62
|
private readonly onClick;
|
|
38
63
|
private readonly onContextMenu;
|
|
39
64
|
private handleTrigger;
|
|
65
|
+
private shouldQuickJumpOnTrigger;
|
|
66
|
+
private shouldInvertLauncherEye;
|
|
67
|
+
private updateLauncherEye;
|
|
40
68
|
private readonly onKeyDown;
|
|
69
|
+
private readonly onViewportChange;
|
|
70
|
+
private openInspectMenu;
|
|
71
|
+
private syncRuntimeContextCapture;
|
|
72
|
+
private canAttachRuntimeContext;
|
|
73
|
+
private canAttachScreenshotContext;
|
|
74
|
+
private canAttachCssContext;
|
|
75
|
+
private captureCssContextPromptForElement;
|
|
76
|
+
private isCssContextEnabledForTarget;
|
|
77
|
+
private isCssContextEnabledForTransportTarget;
|
|
78
|
+
private getAnnotateCssContextPrompt;
|
|
79
|
+
private getRuntimeContextLimits;
|
|
80
|
+
private getAnnotateRuntimeContext;
|
|
81
|
+
private formatRuntimeContextSummary;
|
|
82
|
+
private getCollectedRuntimeErrorCount;
|
|
83
|
+
private resolveAnnotateScreenshotElement;
|
|
84
|
+
private captureAnnotateScreenshotContext;
|
|
85
|
+
private addTargetToCurrentAnnotation;
|
|
86
|
+
private markTargetInAnnotateSession;
|
|
87
|
+
private getAnnotationTargetKey;
|
|
88
|
+
private persistCurrentDraft;
|
|
89
|
+
private clearDraftForTarget;
|
|
90
|
+
private restoreEditingRecord;
|
|
91
|
+
private beginEditingRecord;
|
|
92
|
+
private findElementForAnnotationTarget;
|
|
93
|
+
private findElementForLocation;
|
|
94
|
+
private rebindCurrentAnnotationElements;
|
|
95
|
+
private createAnnotationTarget;
|
|
96
|
+
private describeElement;
|
|
97
|
+
private createSelector;
|
|
98
|
+
private hasCurrentRecord;
|
|
99
|
+
private getNextRecordDisplayOrder;
|
|
100
|
+
private clearAnnotateError;
|
|
101
|
+
private clearAnnotateSuccess;
|
|
102
|
+
private showAnnotateSuccess;
|
|
103
|
+
private toAnnotateErrorMessage;
|
|
104
|
+
private toAnnotationTransportFromRecord;
|
|
105
|
+
private sendAnnotationBatch;
|
|
106
|
+
private syncModeUi;
|
|
107
|
+
private mountAnnotateSidebar;
|
|
108
|
+
private updateAnnotateSidebar;
|
|
109
|
+
private getAnnotateSidebarOptions;
|
|
110
|
+
private composeAnnotateInstruction;
|
|
111
|
+
private renderAnnotateSelectionOverlay;
|
|
41
112
|
private isInspectorActive;
|
|
42
113
|
private setupListeners;
|
|
43
114
|
private teardownListeners;
|
|
44
115
|
}
|
|
45
116
|
|
|
46
|
-
|
|
117
|
+
type MountInspectorOptions = InspectorOptions & {
|
|
118
|
+
mode?: InspectorMode;
|
|
119
|
+
};
|
|
120
|
+
declare function mountInspector(options?: MountInspectorOptions): Promise<any>;
|
|
47
121
|
declare function unmountInspector(): void;
|
|
48
122
|
|
|
49
|
-
export { InspectoElement, mountInspector, unmountInspector };
|
|
123
|
+
export { InspectoElement, type InspectorMode, mountInspector, unmountInspector };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { InspectorOptions } from '@inspecto-dev/types';
|
|
2
2
|
export { InspectorOptions } from '@inspecto-dev/types';
|
|
3
3
|
|
|
4
|
+
type InspectorMode = 'inspect' | 'annotate';
|
|
5
|
+
type InspectoOptions = InspectorOptions & {
|
|
6
|
+
mode?: InspectorMode;
|
|
7
|
+
};
|
|
4
8
|
declare const BaseElement: {
|
|
5
9
|
new (): HTMLElement;
|
|
6
10
|
prototype: HTMLElement;
|
|
@@ -10,40 +14,110 @@ declare class InspectoElement extends BaseElement {
|
|
|
10
14
|
private serverHotKeys;
|
|
11
15
|
private active;
|
|
12
16
|
private disabled;
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
private dragStartY;
|
|
17
|
-
private badgeInitialRight;
|
|
18
|
-
private badgeInitialBottom;
|
|
17
|
+
private prePauseState;
|
|
18
|
+
private mode;
|
|
19
|
+
private launcherPanelOpen;
|
|
19
20
|
private shadowRootEl;
|
|
20
21
|
private overlay;
|
|
22
|
+
private annotateOverlay;
|
|
21
23
|
private cleanupMenu;
|
|
24
|
+
private annotateSession;
|
|
25
|
+
private annotateCapturePaused;
|
|
26
|
+
private annotateQuickCaptureEnabled;
|
|
27
|
+
private annotateSidebar;
|
|
28
|
+
private annotateElements;
|
|
29
|
+
private annotateDrafts;
|
|
30
|
+
private annotateEditingRecord;
|
|
22
31
|
private badge;
|
|
32
|
+
private configLoadPromise;
|
|
33
|
+
private annotationResponseMode;
|
|
34
|
+
private annotateInstructionDraft;
|
|
35
|
+
private annotateErrorMessage;
|
|
36
|
+
private annotateRuntimeContextEnabled;
|
|
37
|
+
private annotateScreenshotContextEnabled;
|
|
38
|
+
private annotateCssContextEnabled;
|
|
39
|
+
private annotateSendState;
|
|
40
|
+
private annotateSuccessScope;
|
|
41
|
+
private annotateSuccessTimeout;
|
|
42
|
+
private pendingAnnotateViewportFrame;
|
|
43
|
+
private runtimeContextCollector;
|
|
44
|
+
private cleanupRuntimeContextCapture;
|
|
45
|
+
private lastPointerX;
|
|
46
|
+
private lastPointerY;
|
|
47
|
+
private readonly onFocusChange;
|
|
23
48
|
connectedCallback(): void;
|
|
24
49
|
disconnectedCallback(): void;
|
|
25
|
-
configure(options:
|
|
50
|
+
configure(options: InspectoOptions): void;
|
|
51
|
+
setMode(mode: InspectorMode): void;
|
|
52
|
+
getMode(): InspectorMode;
|
|
26
53
|
private createBadge;
|
|
27
|
-
private
|
|
28
|
-
private readonly onDragMove;
|
|
29
|
-
private readonly onDragEnd;
|
|
30
|
-
private toggleDisabled;
|
|
54
|
+
private setPaused;
|
|
31
55
|
private dismiss;
|
|
32
|
-
private
|
|
56
|
+
private getHotKeyLabel;
|
|
33
57
|
private getEffectiveHotKeys;
|
|
58
|
+
private getAnnotationResponseMode;
|
|
34
59
|
private updateBadgeContent;
|
|
35
60
|
private setActive;
|
|
36
61
|
private readonly onMouseMove;
|
|
37
62
|
private readonly onClick;
|
|
38
63
|
private readonly onContextMenu;
|
|
39
64
|
private handleTrigger;
|
|
65
|
+
private shouldQuickJumpOnTrigger;
|
|
66
|
+
private shouldInvertLauncherEye;
|
|
67
|
+
private updateLauncherEye;
|
|
40
68
|
private readonly onKeyDown;
|
|
69
|
+
private readonly onViewportChange;
|
|
70
|
+
private openInspectMenu;
|
|
71
|
+
private syncRuntimeContextCapture;
|
|
72
|
+
private canAttachRuntimeContext;
|
|
73
|
+
private canAttachScreenshotContext;
|
|
74
|
+
private canAttachCssContext;
|
|
75
|
+
private captureCssContextPromptForElement;
|
|
76
|
+
private isCssContextEnabledForTarget;
|
|
77
|
+
private isCssContextEnabledForTransportTarget;
|
|
78
|
+
private getAnnotateCssContextPrompt;
|
|
79
|
+
private getRuntimeContextLimits;
|
|
80
|
+
private getAnnotateRuntimeContext;
|
|
81
|
+
private formatRuntimeContextSummary;
|
|
82
|
+
private getCollectedRuntimeErrorCount;
|
|
83
|
+
private resolveAnnotateScreenshotElement;
|
|
84
|
+
private captureAnnotateScreenshotContext;
|
|
85
|
+
private addTargetToCurrentAnnotation;
|
|
86
|
+
private markTargetInAnnotateSession;
|
|
87
|
+
private getAnnotationTargetKey;
|
|
88
|
+
private persistCurrentDraft;
|
|
89
|
+
private clearDraftForTarget;
|
|
90
|
+
private restoreEditingRecord;
|
|
91
|
+
private beginEditingRecord;
|
|
92
|
+
private findElementForAnnotationTarget;
|
|
93
|
+
private findElementForLocation;
|
|
94
|
+
private rebindCurrentAnnotationElements;
|
|
95
|
+
private createAnnotationTarget;
|
|
96
|
+
private describeElement;
|
|
97
|
+
private createSelector;
|
|
98
|
+
private hasCurrentRecord;
|
|
99
|
+
private getNextRecordDisplayOrder;
|
|
100
|
+
private clearAnnotateError;
|
|
101
|
+
private clearAnnotateSuccess;
|
|
102
|
+
private showAnnotateSuccess;
|
|
103
|
+
private toAnnotateErrorMessage;
|
|
104
|
+
private toAnnotationTransportFromRecord;
|
|
105
|
+
private sendAnnotationBatch;
|
|
106
|
+
private syncModeUi;
|
|
107
|
+
private mountAnnotateSidebar;
|
|
108
|
+
private updateAnnotateSidebar;
|
|
109
|
+
private getAnnotateSidebarOptions;
|
|
110
|
+
private composeAnnotateInstruction;
|
|
111
|
+
private renderAnnotateSelectionOverlay;
|
|
41
112
|
private isInspectorActive;
|
|
42
113
|
private setupListeners;
|
|
43
114
|
private teardownListeners;
|
|
44
115
|
}
|
|
45
116
|
|
|
46
|
-
|
|
117
|
+
type MountInspectorOptions = InspectorOptions & {
|
|
118
|
+
mode?: InspectorMode;
|
|
119
|
+
};
|
|
120
|
+
declare function mountInspector(options?: MountInspectorOptions): Promise<any>;
|
|
47
121
|
declare function unmountInspector(): void;
|
|
48
122
|
|
|
49
|
-
export { InspectoElement, mountInspector, unmountInspector };
|
|
123
|
+
export { InspectoElement, type InspectorMode, mountInspector, unmountInspector };
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__async
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JPRRZPBL.js";
|
|
4
4
|
|
|
5
5
|
// src/index.ts
|
|
6
6
|
var TAG_NAME = "inspecto-overlay";
|
|
7
7
|
function mountInspector() {
|
|
8
8
|
return __async(this, arguments, function* (options = {}) {
|
|
9
9
|
if (typeof document === "undefined") return null;
|
|
10
|
-
const { InspectoElement } = yield import("./component-
|
|
10
|
+
const { InspectoElement } = yield import("./component-HSGKWEXV.js");
|
|
11
11
|
const existing = document.querySelector(TAG_NAME);
|
|
12
12
|
if (existing) {
|
|
13
13
|
;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { InspectorOptions } from '@inspecto-dev/types'\n\n// Export types only, avoid top-level imports of DOM-dependent code\nexport type { InspectorOptions }\nexport type { InspectoElement } from './component.js'\n\nconst TAG_NAME = 'inspecto-overlay'\n\nexport async function mountInspector(options:
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { InspectorOptions } from '@inspecto-dev/types'\nimport type { InspectorMode } from './component.js'\n\n// Export types only, avoid top-level imports of DOM-dependent code\nexport type { InspectorOptions }\nexport type { InspectoElement } from './component.js'\nexport type { InspectorMode } from './component.js'\n\ntype MountInspectorOptions = InspectorOptions & { mode?: InspectorMode }\n\nconst TAG_NAME = 'inspecto-overlay'\n\nexport async function mountInspector(options: MountInspectorOptions = {}): Promise<any> {\n if (typeof document === 'undefined') return null\n\n // Lazy import the component so that module evaluation does not happen during SSR\n const { InspectoElement } = await import('./component.js')\n\n const existing = document.querySelector(TAG_NAME)\n if (existing) {\n ;(existing as typeof InspectoElement.prototype).configure(options)\n return existing\n }\n\n const el = document.createElement(TAG_NAME)\n ;(el as typeof InspectoElement.prototype).configure(options)\n document.body.appendChild(el)\n return el\n}\n\nexport function unmountInspector(): void {\n if (typeof document === 'undefined') return\n const existing = document.querySelector(TAG_NAME)\n if (existing) {\n existing.remove()\n }\n}\n\n// Expose to global window for Webpack/Rspack EntryPlugin injection fallback\nif (typeof window !== 'undefined') {\n window.InspectoClient = {\n mountInspector,\n unmountInspector,\n }\n}\n"],"mappings":";;;;;AAUA,IAAM,WAAW;AAEjB,SAAsB,iBAAkE;AAAA,6CAAnD,UAAiC,CAAC,GAAiB;AACtF,QAAI,OAAO,aAAa,YAAa,QAAO;AAG5C,UAAM,EAAE,gBAAgB,IAAI,MAAM,OAAO,yBAAgB;AAEzD,UAAM,WAAW,SAAS,cAAc,QAAQ;AAChD,QAAI,UAAU;AACZ;AAAC,MAAC,SAA8C,UAAU,OAAO;AACjE,aAAO;AAAA,IACT;AAEA,UAAM,KAAK,SAAS,cAAc,QAAQ;AACzC,IAAC,GAAwC,UAAU,OAAO;AAC3D,aAAS,KAAK,YAAY,EAAE;AAC5B,WAAO;AAAA,EACT;AAAA;AAEO,SAAS,mBAAyB;AACvC,MAAI,OAAO,aAAa,YAAa;AACrC,QAAM,WAAW,SAAS,cAAc,QAAQ;AAChD,MAAI,UAAU;AACZ,aAAS,OAAO;AAAA,EAClB;AACF;AAGA,IAAI,OAAO,WAAW,aAAa;AACjC,SAAO,iBAAiB;AAAA,IACtB;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inspecto-dev/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-alpha.1",
|
|
4
4
|
"description": "Core browser runtime and server logic for Inspecto",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -37,9 +37,10 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
+
"html2canvas": "^1.4.1",
|
|
40
41
|
"launch-ide": "^1.0.0",
|
|
41
42
|
"portfinder": "^1.0.32",
|
|
42
|
-
"@inspecto-dev/types": "0.
|
|
43
|
+
"@inspecto-dev/types": "0.3.0-alpha.1"
|
|
43
44
|
},
|
|
44
45
|
"scripts": {
|
|
45
46
|
"build": "tsup",
|
package/dist/chunk-C4KO2HLL.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
var __async = (__this, __arguments, generator) => {
|
|
2
|
-
return new Promise((resolve, reject) => {
|
|
3
|
-
var fulfilled = (value) => {
|
|
4
|
-
try {
|
|
5
|
-
step(generator.next(value));
|
|
6
|
-
} catch (e) {
|
|
7
|
-
reject(e);
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
var rejected = (value) => {
|
|
11
|
-
try {
|
|
12
|
-
step(generator.throw(value));
|
|
13
|
-
} catch (e) {
|
|
14
|
-
reject(e);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export {
|
|
23
|
-
__async
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=chunk-C4KO2HLL.js.map
|