@codefilm/recorder 3.0.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.
- package/README.md +1553 -0
- package/dist/code-film.css +1 -0
- package/dist/core/FilmRecorder.d.ts +192 -0
- package/dist/core/FilmRecorder.d.ts.map +1 -0
- package/dist/core/FilmRecorder.js +1504 -0
- package/dist/core/agent.d.ts +27 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +258 -0
- package/dist/core/app-script.d.ts +232 -0
- package/dist/core/app-script.d.ts.map +1 -0
- package/dist/core/app-script.js +916 -0
- package/dist/core/iframe-bridge.d.ts +34 -0
- package/dist/core/iframe-bridge.d.ts.map +1 -0
- package/dist/core/iframe-bridge.js +97 -0
- package/dist/core/recording-overlays.d.ts +12 -0
- package/dist/core/recording-overlays.d.ts.map +1 -0
- package/dist/core/recording-overlays.js +237 -0
- package/dist/core/types.d.ts +256 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.umd.cjs +156 -0
- package/dist/react/RegionRecorder.d.ts +7 -0
- package/dist/react/RegionRecorder.d.ts.map +1 -0
- package/dist/react/RegionRecorder.js +190 -0
- package/dist/react/useFilmRecorder.d.ts +11 -0
- package/dist/react/useFilmRecorder.d.ts.map +1 -0
- package/dist/react/useFilmRecorder.js +61 -0
- package/dist/vanilla/RegionRecorderUI.d.ts +21 -0
- package/dist/vanilla/RegionRecorderUI.d.ts.map +1 -0
- package/dist/vanilla/RegionRecorderUI.js +128 -0
- package/package.json +70 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FilmRecorder } from './FilmRecorder';
|
|
2
|
+
export type RecorderIframeCommand = "toggle-recording" | "start-recording" | "stop-recording" | "focus-mouse" | "reset-full" | "toggle-mouse-pause";
|
|
3
|
+
export interface RecorderIframeMessage {
|
|
4
|
+
source: "code-film";
|
|
5
|
+
channel: "recorder-iframe";
|
|
6
|
+
type: "command";
|
|
7
|
+
command: RecorderIframeCommand;
|
|
8
|
+
}
|
|
9
|
+
export interface RecorderIframeHostOptions {
|
|
10
|
+
allowedOrigins?: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface RecorderIframeHostBridge {
|
|
13
|
+
start(): RecorderIframeHostBridge;
|
|
14
|
+
stop(): void;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
execute(command: RecorderIframeCommand): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export interface RecorderIframeClientOptions {
|
|
19
|
+
targetOrigin: string;
|
|
20
|
+
targetWindow?: Window;
|
|
21
|
+
shortcuts?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface RecorderIframeClientBridge {
|
|
24
|
+
start(): RecorderIframeClientBridge;
|
|
25
|
+
stop(): void;
|
|
26
|
+
destroy(): void;
|
|
27
|
+
sendCommand(command: RecorderIframeCommand): void;
|
|
28
|
+
}
|
|
29
|
+
export declare function createRecorderIframeHost(recorder: FilmRecorder, options?: RecorderIframeHostOptions): RecorderIframeHostBridge;
|
|
30
|
+
export declare function createRecorderIframeClient(options: RecorderIframeClientOptions): RecorderIframeClientBridge;
|
|
31
|
+
export declare function createRecorderIframeMessage(command: RecorderIframeCommand): RecorderIframeMessage;
|
|
32
|
+
export declare function isRecorderIframeMessage(value: unknown): value is RecorderIframeMessage;
|
|
33
|
+
export declare function getRecorderIframeShortcutCommand(event: Pick<KeyboardEvent, "ctrlKey" | "metaKey" | "key">): RecorderIframeCommand | null;
|
|
34
|
+
//# sourceMappingURL=iframe-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iframe-bridge.d.ts","sourceRoot":"","sources":["../../src/core/iframe-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,qBAAqB,GAC7B,kBAAkB,GAClB,iBAAiB,G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B,GAAG,IAAI,CAW9B"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
function l(e, t = {}) {
|
|
2
|
+
let r = !1;
|
|
3
|
+
const s = (n) => {
|
|
4
|
+
m(n.origin, t.allowedOrigins) && a(n.data) && c(e, n.data.command);
|
|
5
|
+
}, o = {
|
|
6
|
+
start() {
|
|
7
|
+
return r || typeof window > "u" || (window.addEventListener("message", s), r = !0), o;
|
|
8
|
+
},
|
|
9
|
+
stop() {
|
|
10
|
+
!r || typeof window > "u" || (window.removeEventListener("message", s), r = !1);
|
|
11
|
+
},
|
|
12
|
+
destroy() {
|
|
13
|
+
o.stop();
|
|
14
|
+
},
|
|
15
|
+
execute(n) {
|
|
16
|
+
return c(e, n);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
return o;
|
|
20
|
+
}
|
|
21
|
+
function w(e) {
|
|
22
|
+
let t = !1;
|
|
23
|
+
const r = e.shortcuts ?? !0, s = (i) => {
|
|
24
|
+
const u = e.targetWindow ?? (typeof window < "u" ? window.parent : void 0);
|
|
25
|
+
u && u.postMessage(d(i), e.targetOrigin);
|
|
26
|
+
}, o = (i) => {
|
|
27
|
+
const u = f(i);
|
|
28
|
+
u && (i.preventDefault(), s(u));
|
|
29
|
+
}, n = {
|
|
30
|
+
start() {
|
|
31
|
+
return t || !r || typeof window > "u" || (window.addEventListener("keydown", o), t = !0), n;
|
|
32
|
+
},
|
|
33
|
+
stop() {
|
|
34
|
+
!t || typeof window > "u" || (window.removeEventListener("keydown", o), t = !1);
|
|
35
|
+
},
|
|
36
|
+
destroy() {
|
|
37
|
+
n.stop();
|
|
38
|
+
},
|
|
39
|
+
sendCommand: s
|
|
40
|
+
};
|
|
41
|
+
return n;
|
|
42
|
+
}
|
|
43
|
+
function d(e) {
|
|
44
|
+
return {
|
|
45
|
+
source: "code-film",
|
|
46
|
+
channel: "recorder-iframe",
|
|
47
|
+
type: "command",
|
|
48
|
+
command: e
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function a(e) {
|
|
52
|
+
if (!e || typeof e != "object") return !1;
|
|
53
|
+
const t = e;
|
|
54
|
+
return t.source === "code-film" && t.channel === "recorder-iframe" && t.type === "command" && g(t.command);
|
|
55
|
+
}
|
|
56
|
+
function f(e) {
|
|
57
|
+
if (!(e.ctrlKey || e.metaKey)) return null;
|
|
58
|
+
const r = e.key.toLowerCase();
|
|
59
|
+
return r === "j" ? "toggle-recording" : r === "l" ? "toggle-mouse-pause" : e.key === "ArrowUp" ? "reset-full" : e.key === "ArrowDown" ? "focus-mouse" : null;
|
|
60
|
+
}
|
|
61
|
+
async function c(e, t) {
|
|
62
|
+
switch (t) {
|
|
63
|
+
case "toggle-recording":
|
|
64
|
+
e.getState().recording ? e.stopRecording() : await e.startRecording();
|
|
65
|
+
return;
|
|
66
|
+
case "start-recording":
|
|
67
|
+
await e.startRecording();
|
|
68
|
+
return;
|
|
69
|
+
case "stop-recording":
|
|
70
|
+
e.stopRecording();
|
|
71
|
+
return;
|
|
72
|
+
case "focus-mouse":
|
|
73
|
+
e.zoomToMouse();
|
|
74
|
+
return;
|
|
75
|
+
case "reset-full":
|
|
76
|
+
e.setElementSelector(null), e.resetFullScreen();
|
|
77
|
+
return;
|
|
78
|
+
case "toggle-mouse-pause": {
|
|
79
|
+
const r = e.getState();
|
|
80
|
+
e.setMousePaused(!r.mousePaused);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function m(e, t) {
|
|
86
|
+
return !t || t.length === 0 ? !0 : t.includes("*") || t.includes(e);
|
|
87
|
+
}
|
|
88
|
+
function g(e) {
|
|
89
|
+
return e === "toggle-recording" || e === "start-recording" || e === "stop-recording" || e === "focus-mouse" || e === "reset-full" || e === "toggle-mouse-pause";
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
w as createRecorderIframeClient,
|
|
93
|
+
l as createRecorderIframeHost,
|
|
94
|
+
d as createRecorderIframeMessage,
|
|
95
|
+
f as getRecorderIframeShortcutCommand,
|
|
96
|
+
a as isRecorderIframeMessage
|
|
97
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CameraRecordingOverlayDefinition, CameraRecordingOverlayOptions, CustomRecordingOverlayOptions, RecordingOverlayEvent, RecordingOverlayHandle } from './types';
|
|
2
|
+
type OverlayEventHandler = (event: RecordingOverlayEvent) => void;
|
|
3
|
+
interface DrawableRecordingOverlay extends RecordingOverlayHandle {
|
|
4
|
+
includeInCapture: boolean;
|
|
5
|
+
draw(ctx: CanvasRenderingContext2D, width: number, height: number): void;
|
|
6
|
+
}
|
|
7
|
+
export type RecordingOverlayRuntime = DrawableRecordingOverlay;
|
|
8
|
+
export declare function cameraOverlay(options: CameraRecordingOverlayOptions): CameraRecordingOverlayDefinition;
|
|
9
|
+
export declare function createCameraRecordingOverlay(options: CameraRecordingOverlayOptions, onEvent?: OverlayEventHandler): RecordingOverlayRuntime;
|
|
10
|
+
export declare function createCustomRecordingOverlay(options: CustomRecordingOverlayOptions, onEvent?: OverlayEventHandler): RecordingOverlayRuntime;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=recording-overlays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recording-overlays.d.ts","sourceRoot":"","sources":["../../src/core/recording-overlays.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EAChC,6BAA6B,EAC7B,6BAA6B,EAC7B,qBAAqB,EACrB,sBAAsB,EAGvB,MAAM,SAAS,CAAC;AAOjB,KAAK,mBAAmB,GAAG,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;AAElE,UAAU,wBAAyB,SAAQ,sBAAsB;IAC/D,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,CAAC,GAAG,EAAE,wBAAwB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1E;AAED,MAAM,MAAM,uBAAuB,GAAG,wBAAwB,CAAC;AAE/D,wBAAgB,aAAa,CAC3B,OAAO,EAAE,6BAA6B,GACrC,gCAAgC,CAKlC;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,6BAA6B,EACtC,OAAO,CAAC,EAAE,mBAAmB,GAC5B,uBAAuB,CAEzB;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,6BAA6B,EACtC,OAAO,CAAC,EAAE,mBAAmB,GAC5B,uBAAuB,CAEzB"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
function v(t) {
|
|
2
|
+
return {
|
|
3
|
+
type: "camera",
|
|
4
|
+
...t
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
function E(t, e) {
|
|
8
|
+
return new m(t, e);
|
|
9
|
+
}
|
|
10
|
+
function y(t, e) {
|
|
11
|
+
return new c(t, e);
|
|
12
|
+
}
|
|
13
|
+
class m {
|
|
14
|
+
id;
|
|
15
|
+
element;
|
|
16
|
+
includeInCapture = !0;
|
|
17
|
+
videoEl;
|
|
18
|
+
fallbackEl;
|
|
19
|
+
resizeHandle;
|
|
20
|
+
stream = null;
|
|
21
|
+
visible = !1;
|
|
22
|
+
position;
|
|
23
|
+
size;
|
|
24
|
+
minSize;
|
|
25
|
+
maxSize;
|
|
26
|
+
shape;
|
|
27
|
+
draggable;
|
|
28
|
+
resizable;
|
|
29
|
+
mirror;
|
|
30
|
+
requestOnShow;
|
|
31
|
+
onEvent;
|
|
32
|
+
constructor(e, s) {
|
|
33
|
+
this.id = e.id, this.position = e.position ?? "top-left", this.size = e.size ?? 168, this.minSize = e.minSize ?? 96, this.maxSize = e.maxSize ?? 360, this.shape = e.shape ?? "circle", this.draggable = e.draggable ?? !0, this.resizable = e.resizable ?? !0, this.mirror = e.mirror ?? !0, this.requestOnShow = e.requestOnShow ?? !0, this.onEvent = s, this.element = document.createElement("div"), this.element.className = ["cfr-recording-overlay", "cfr-camera-overlay", e.className].filter(Boolean).join(" "), this.element.dataset.codeFilmOverlay = this.id, this.videoEl = document.createElement("video"), this.videoEl.muted = !0, this.videoEl.playsInline = !0, this.videoEl.autoplay = !0, this.fallbackEl = document.createElement("div"), this.fallbackEl.className = "cfr-camera-overlay-fallback", this.fallbackEl.textContent = "Camera unavailable", this.resizeHandle = document.createElement("div"), this.resizeHandle.className = "cfr-recording-overlay-resize", this.element.append(this.videoEl, this.fallbackEl, this.resizeHandle), this.applyElementStyle(), this.installPointerHandlers(), (e.enabled ?? !1) && this.show();
|
|
34
|
+
}
|
|
35
|
+
async requestPermission() {
|
|
36
|
+
if (this.stream) return !0;
|
|
37
|
+
try {
|
|
38
|
+
if (!navigator.mediaDevices?.getUserMedia)
|
|
39
|
+
throw new Error("Camera capture is not available in this browser.");
|
|
40
|
+
return this.stream = await navigator.mediaDevices.getUserMedia({
|
|
41
|
+
video: !0,
|
|
42
|
+
audio: !1
|
|
43
|
+
}), this.videoEl.srcObject = this.stream, this.fallbackEl.style.display = "none", await this.videoEl.play().catch(() => {
|
|
44
|
+
}), !0;
|
|
45
|
+
} catch (e) {
|
|
46
|
+
return this.stopTracks(), this.fallbackEl.style.display = "flex", this.emit("error", {
|
|
47
|
+
message: e instanceof Error ? e.message : String(e)
|
|
48
|
+
}), !1;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async show() {
|
|
52
|
+
this.mount(), this.visible = !0, this.element.style.display = "block", this.requestOnShow && await this.requestPermission(), this.emit("shown", this.snapshot());
|
|
53
|
+
}
|
|
54
|
+
hide() {
|
|
55
|
+
this.visible = !1, this.element.style.display = "none", this.stopTracks(), this.emit("hidden", this.snapshot());
|
|
56
|
+
}
|
|
57
|
+
moveTo(e) {
|
|
58
|
+
this.position = e, this.applyElementStyle(), this.emit("moved", this.snapshot());
|
|
59
|
+
}
|
|
60
|
+
setSize(e) {
|
|
61
|
+
this.size = o(e, this.minSize, this.maxSize), this.applyElementStyle(), this.emit("resized", this.snapshot());
|
|
62
|
+
}
|
|
63
|
+
destroy() {
|
|
64
|
+
this.hide(), this.element.remove();
|
|
65
|
+
}
|
|
66
|
+
draw(e, s, n) {
|
|
67
|
+
if (!this.visible) return;
|
|
68
|
+
const i = l(this.position, this.size, s, n);
|
|
69
|
+
p(e, i.x, i.y, i.size, this.shape, () => {
|
|
70
|
+
this.stream && this.videoEl.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA ? this.mirror ? (e.save(), e.translate(i.x + i.size, i.y), e.scale(-1, 1), e.drawImage(this.videoEl, 0, 0, i.size, i.size), e.restore()) : e.drawImage(this.videoEl, i.x, i.y, i.size, i.size) : u(e, i.x, i.y, i.size);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
mount() {
|
|
74
|
+
typeof document > "u" || this.element.isConnected || document.body.appendChild(this.element);
|
|
75
|
+
}
|
|
76
|
+
applyElementStyle() {
|
|
77
|
+
const e = l(
|
|
78
|
+
this.position,
|
|
79
|
+
this.size,
|
|
80
|
+
typeof window > "u" ? 1280 : window.innerWidth,
|
|
81
|
+
typeof window > "u" ? 720 : window.innerHeight
|
|
82
|
+
);
|
|
83
|
+
Object.assign(this.element.style, {
|
|
84
|
+
display: this.visible ? "block" : "none",
|
|
85
|
+
position: "fixed",
|
|
86
|
+
left: `${e.x}px`,
|
|
87
|
+
top: `${e.y}px`,
|
|
88
|
+
width: `${e.size}px`,
|
|
89
|
+
height: `${e.size}px`,
|
|
90
|
+
borderRadius: this.shape === "circle" ? "9999px" : this.shape === "rounded" ? "24px" : "0",
|
|
91
|
+
overflow: "hidden",
|
|
92
|
+
zIndex: "2147483646",
|
|
93
|
+
background: "#111827",
|
|
94
|
+
boxShadow: "0 18px 55px rgba(0,0,0,0.32), 0 0 0 1px rgba(255,255,255,0.2)",
|
|
95
|
+
touchAction: "none",
|
|
96
|
+
cursor: this.draggable ? "grab" : "default"
|
|
97
|
+
}), Object.assign(this.videoEl.style, {
|
|
98
|
+
width: "100%",
|
|
99
|
+
height: "100%",
|
|
100
|
+
objectFit: "cover",
|
|
101
|
+
transform: this.mirror ? "scaleX(-1)" : "none"
|
|
102
|
+
}), this.resizeHandle.style.display = this.resizable ? "block" : "none";
|
|
103
|
+
}
|
|
104
|
+
installPointerHandlers() {
|
|
105
|
+
let e = null;
|
|
106
|
+
const s = (a) => {
|
|
107
|
+
const r = a.target === this.resizeHandle;
|
|
108
|
+
!this.draggable && !r || !this.resizable && r || (a.preventDefault(), this.element.setPointerCapture(a.pointerId), e = {
|
|
109
|
+
type: r ? "resize" : "move",
|
|
110
|
+
pointerId: a.pointerId,
|
|
111
|
+
startX: a.clientX,
|
|
112
|
+
startY: a.clientY,
|
|
113
|
+
startPosition: this.position,
|
|
114
|
+
startSize: this.size
|
|
115
|
+
});
|
|
116
|
+
}, n = (a) => {
|
|
117
|
+
if (!e || e.pointerId !== a.pointerId) return;
|
|
118
|
+
const r = a.clientX - e.startX, h = a.clientY - e.startY;
|
|
119
|
+
if (e.type === "resize")
|
|
120
|
+
this.setSize(e.startSize + Math.max(r, h));
|
|
121
|
+
else {
|
|
122
|
+
const d = l(
|
|
123
|
+
e.startPosition,
|
|
124
|
+
e.startSize,
|
|
125
|
+
window.innerWidth,
|
|
126
|
+
window.innerHeight
|
|
127
|
+
);
|
|
128
|
+
this.moveTo({ x: d.x + r, y: d.y + h });
|
|
129
|
+
}
|
|
130
|
+
}, i = (a) => {
|
|
131
|
+
!e || e.pointerId !== a.pointerId || (this.element.releasePointerCapture(a.pointerId), e = null);
|
|
132
|
+
};
|
|
133
|
+
this.element.addEventListener("pointerdown", s), this.element.addEventListener("pointermove", n), this.element.addEventListener("pointerup", i), this.element.addEventListener("pointercancel", i);
|
|
134
|
+
}
|
|
135
|
+
stopTracks() {
|
|
136
|
+
this.stream?.getTracks().forEach((e) => e.stop()), this.stream = null, this.videoEl.srcObject = null;
|
|
137
|
+
}
|
|
138
|
+
emit(e, s) {
|
|
139
|
+
this.onEvent?.({ id: this.id, type: e, data: s });
|
|
140
|
+
}
|
|
141
|
+
snapshot() {
|
|
142
|
+
return {
|
|
143
|
+
position: this.position,
|
|
144
|
+
size: this.size,
|
|
145
|
+
shape: this.shape
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
class c {
|
|
150
|
+
id;
|
|
151
|
+
element;
|
|
152
|
+
includeInCapture;
|
|
153
|
+
visible;
|
|
154
|
+
position;
|
|
155
|
+
size;
|
|
156
|
+
trackTimeline;
|
|
157
|
+
onEvent;
|
|
158
|
+
constructor(e, s) {
|
|
159
|
+
this.id = e.id, this.element = e.element, this.includeInCapture = e.includeInCapture ?? !0, this.trackTimeline = e.trackTimeline ?? !0, this.visible = e.enabled ?? !0, this.position = e.position ?? "top-left", this.size = e.size ?? 168, this.onEvent = s, e.optOutOfSdkStyles || (this.element.classList.add("cfr-recording-overlay"), e.className && this.element.classList.add(...e.className.split(/\s+/)), this.element.dataset.codeFilmOverlay = this.id), this.applyElementStyle();
|
|
160
|
+
}
|
|
161
|
+
show() {
|
|
162
|
+
this.visible = !0, this.element.style.display = "", this.emit("shown", this.snapshot());
|
|
163
|
+
}
|
|
164
|
+
hide() {
|
|
165
|
+
this.visible = !1, this.element.style.display = "none", this.emit("hidden", this.snapshot());
|
|
166
|
+
}
|
|
167
|
+
moveTo(e) {
|
|
168
|
+
this.position = e, this.applyElementStyle(), this.emit("moved", this.snapshot());
|
|
169
|
+
}
|
|
170
|
+
setSize(e) {
|
|
171
|
+
this.size = Math.max(1, e), this.applyElementStyle(), this.emit("resized", this.snapshot());
|
|
172
|
+
}
|
|
173
|
+
destroy() {
|
|
174
|
+
this.hide();
|
|
175
|
+
}
|
|
176
|
+
draw(e, s, n) {
|
|
177
|
+
if (!this.visible || !this.includeInCapture) return;
|
|
178
|
+
const i = l(this.position, this.size, s, n);
|
|
179
|
+
this.element instanceof HTMLCanvasElement ? e.drawImage(this.element, i.x, i.y, i.size, i.size) : (this.element instanceof HTMLImageElement || this.element instanceof HTMLVideoElement) && e.drawImage(this.element, i.x, i.y, i.size, i.size);
|
|
180
|
+
}
|
|
181
|
+
applyElementStyle() {
|
|
182
|
+
const e = l(
|
|
183
|
+
this.position,
|
|
184
|
+
this.size,
|
|
185
|
+
typeof window > "u" ? 1280 : window.innerWidth,
|
|
186
|
+
typeof window > "u" ? 720 : window.innerHeight
|
|
187
|
+
);
|
|
188
|
+
Object.assign(this.element.style, {
|
|
189
|
+
position: "fixed",
|
|
190
|
+
left: `${e.x}px`,
|
|
191
|
+
top: `${e.y}px`,
|
|
192
|
+
width: `${e.size}px`,
|
|
193
|
+
height: `${e.size}px`,
|
|
194
|
+
zIndex: "2147483646"
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
emit(e, s) {
|
|
198
|
+
this.trackTimeline && this.onEvent?.({ id: this.id, type: e, data: s });
|
|
199
|
+
}
|
|
200
|
+
snapshot() {
|
|
201
|
+
return {
|
|
202
|
+
position: this.position,
|
|
203
|
+
size: this.size
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function l(t, e, s, n) {
|
|
208
|
+
if (typeof t == "object")
|
|
209
|
+
return {
|
|
210
|
+
x: o(t.x, 0, Math.max(0, s - e)),
|
|
211
|
+
y: o(t.y, 0, Math.max(0, n - e)),
|
|
212
|
+
size: e
|
|
213
|
+
};
|
|
214
|
+
const i = s - e - 24, a = n - e - 24;
|
|
215
|
+
return {
|
|
216
|
+
x: t.endsWith("right") ? i : 24,
|
|
217
|
+
y: t.startsWith("bottom") ? a : 24,
|
|
218
|
+
size: e
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function p(t, e, s, n, i, a) {
|
|
222
|
+
t.save(), i === "circle" ? (t.beginPath(), t.arc(e + n / 2, s + n / 2, n / 2, 0, Math.PI * 2), t.clip()) : i === "rounded" && (f(t, e, s, n, n, Math.min(24, n / 5)), t.clip()), a(), t.restore();
|
|
223
|
+
}
|
|
224
|
+
function u(t, e, s, n) {
|
|
225
|
+
t.save(), t.fillStyle = "#111827", t.fillRect(e, s, n, n), t.fillStyle = "#e5e7eb", t.font = `${Math.max(12, Math.round(n / 12))}px system-ui, sans-serif`, t.textAlign = "center", t.textBaseline = "middle", t.fillText("Camera unavailable", e + n / 2, s + n / 2, n - 20), t.restore();
|
|
226
|
+
}
|
|
227
|
+
function f(t, e, s, n, i, a) {
|
|
228
|
+
t.beginPath(), t.moveTo(e + a, s), t.lineTo(e + n - a, s), t.quadraticCurveTo(e + n, s, e + n, s + a), t.lineTo(e + n, s + i - a), t.quadraticCurveTo(e + n, s + i, e + n - a, s + i), t.lineTo(e + a, s + i), t.quadraticCurveTo(e, s + i, e, s + i - a), t.lineTo(e, s + a), t.quadraticCurveTo(e, s, e + a, s), t.closePath();
|
|
229
|
+
}
|
|
230
|
+
function o(t, e, s) {
|
|
231
|
+
return Math.min(s, Math.max(e, t));
|
|
232
|
+
}
|
|
233
|
+
export {
|
|
234
|
+
v as cameraOverlay,
|
|
235
|
+
E as createCameraRecordingOverlay,
|
|
236
|
+
y as createCustomRecordingOverlay
|
|
237
|
+
};
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { FilmRecorder } from './FilmRecorder';
|
|
2
|
+
export type Awaitable<T> = T | PromiseLike<T>;
|
|
3
|
+
export interface Rect {
|
|
4
|
+
col: number;
|
|
5
|
+
row: number;
|
|
6
|
+
w: number;
|
|
7
|
+
h: number;
|
|
8
|
+
}
|
|
9
|
+
export interface Resolution {
|
|
10
|
+
label: string;
|
|
11
|
+
w: number;
|
|
12
|
+
h: number;
|
|
13
|
+
}
|
|
14
|
+
export interface Point {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}
|
|
18
|
+
export type ZoomPosition = "top" | "center" | "bottom";
|
|
19
|
+
export interface TypingOptions {
|
|
20
|
+
cps?: number;
|
|
21
|
+
jitter?: number;
|
|
22
|
+
punctuationPauseMs?: number;
|
|
23
|
+
mistakeRate?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface FilmScriptCommand {
|
|
26
|
+
type: "camera" | "zoom" | "type" | "click" | "pointer" | "move" | "wait";
|
|
27
|
+
selector?: string | null;
|
|
28
|
+
to?: ZoomPosition;
|
|
29
|
+
padding?: number;
|
|
30
|
+
text?: string;
|
|
31
|
+
cps?: number;
|
|
32
|
+
jitter?: number;
|
|
33
|
+
punctuationPauseMs?: number;
|
|
34
|
+
mistakeRate?: number;
|
|
35
|
+
durationMs?: number;
|
|
36
|
+
sourceLine?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface FilmScriptScene {
|
|
39
|
+
name: string;
|
|
40
|
+
startTime: number;
|
|
41
|
+
endTime: number;
|
|
42
|
+
commands: FilmScriptCommand[];
|
|
43
|
+
}
|
|
44
|
+
export interface RecorderState {
|
|
45
|
+
recording: boolean;
|
|
46
|
+
showGrid: boolean;
|
|
47
|
+
autoZoom: boolean;
|
|
48
|
+
pauseDuringScroll: boolean;
|
|
49
|
+
resolution: Resolution;
|
|
50
|
+
mousePaused: boolean;
|
|
51
|
+
viewport: {
|
|
52
|
+
w: number;
|
|
53
|
+
h: number;
|
|
54
|
+
};
|
|
55
|
+
displayRect: Rect;
|
|
56
|
+
showOutline: boolean;
|
|
57
|
+
elementSelector: string | null;
|
|
58
|
+
elementPadding: number;
|
|
59
|
+
fixedRecordingRegion: FixedRecordingRegion | null;
|
|
60
|
+
movePointerToSelector: string | null;
|
|
61
|
+
pointerClassName: string;
|
|
62
|
+
pointerFillColor: string;
|
|
63
|
+
pointerBorderColor: string;
|
|
64
|
+
pointerRippleColor: string;
|
|
65
|
+
disableRipple: boolean;
|
|
66
|
+
ignoreSelector: string | null;
|
|
67
|
+
tourState: "idle" | "running" | "stopped" | "error";
|
|
68
|
+
executionState: "idle" | "executing" | "waiting" | "finalizing" | "finished" | "error";
|
|
69
|
+
currentScene: string | null;
|
|
70
|
+
}
|
|
71
|
+
export type FixedRecordingRegion = "smallest-16:9";
|
|
72
|
+
export interface RecordingArtifact {
|
|
73
|
+
blob: Blob;
|
|
74
|
+
url: string;
|
|
75
|
+
mimeType: string;
|
|
76
|
+
filename: string;
|
|
77
|
+
durationMs: number;
|
|
78
|
+
startedAt: number;
|
|
79
|
+
stoppedAt: number;
|
|
80
|
+
timeline?: RecordingTimelineMetadata;
|
|
81
|
+
webm?: RecordingWebMContainerMetadata;
|
|
82
|
+
}
|
|
83
|
+
export interface RecordingTimelineMetadata {
|
|
84
|
+
schema: "code-film.timeline.v1";
|
|
85
|
+
title: string | null;
|
|
86
|
+
fps: number;
|
|
87
|
+
width: number;
|
|
88
|
+
height: number;
|
|
89
|
+
scenes: RecordingTimelineScene[];
|
|
90
|
+
actions: RecordingTimelineAction[];
|
|
91
|
+
markers: RecordingTimelineMarker[];
|
|
92
|
+
}
|
|
93
|
+
export interface RecordingTimelineScene {
|
|
94
|
+
id: string;
|
|
95
|
+
name: string;
|
|
96
|
+
declaredStartMs: number;
|
|
97
|
+
declaredEndMs: number;
|
|
98
|
+
actualStartMs: number | null;
|
|
99
|
+
actualEndMs: number | null;
|
|
100
|
+
}
|
|
101
|
+
export interface RecordingTimelineAction {
|
|
102
|
+
type: FilmScriptCommand["type"];
|
|
103
|
+
startMs: number;
|
|
104
|
+
endMs: number | null;
|
|
105
|
+
commandIndex: number;
|
|
106
|
+
scene?: string;
|
|
107
|
+
selector?: string | null;
|
|
108
|
+
to?: ZoomPosition;
|
|
109
|
+
padding?: number;
|
|
110
|
+
text?: string;
|
|
111
|
+
durationMs?: number;
|
|
112
|
+
}
|
|
113
|
+
export interface RecordingTimelineMarker {
|
|
114
|
+
name: string;
|
|
115
|
+
timeMs: number;
|
|
116
|
+
scene?: string;
|
|
117
|
+
commandIndex?: number;
|
|
118
|
+
data?: unknown;
|
|
119
|
+
}
|
|
120
|
+
export interface RecordingWebMContainerMetadata {
|
|
121
|
+
seekable: boolean;
|
|
122
|
+
hasDurationMetadata: boolean;
|
|
123
|
+
durationMs?: number;
|
|
124
|
+
sizeBytes: number;
|
|
125
|
+
}
|
|
126
|
+
export interface FilmScriptLifecycleContext {
|
|
127
|
+
recorder: FilmRecorder;
|
|
128
|
+
signal: AbortSignal;
|
|
129
|
+
scenes: FilmScriptScene[];
|
|
130
|
+
}
|
|
131
|
+
export interface FilmScriptActionContext extends FilmScriptLifecycleContext {
|
|
132
|
+
scene: FilmScriptScene;
|
|
133
|
+
command: FilmScriptCommand;
|
|
134
|
+
commandIndex: number;
|
|
135
|
+
elapsedMs: number;
|
|
136
|
+
waitUntil: (promise: PromiseLike<unknown>) => void;
|
|
137
|
+
}
|
|
138
|
+
export interface FilmScriptDiagnostic {
|
|
139
|
+
line: number;
|
|
140
|
+
scene: string | null;
|
|
141
|
+
commandIndex: number | null;
|
|
142
|
+
message: string;
|
|
143
|
+
}
|
|
144
|
+
export interface FilmScriptValidationResult {
|
|
145
|
+
valid: boolean;
|
|
146
|
+
scenes: FilmScriptScene[];
|
|
147
|
+
diagnostics: FilmScriptDiagnostic[];
|
|
148
|
+
}
|
|
149
|
+
export type FilmScriptReadyCallback = (context: FilmScriptLifecycleContext) => Awaitable<void>;
|
|
150
|
+
export interface FilmScriptExecutionOptions {
|
|
151
|
+
signal?: AbortSignal;
|
|
152
|
+
selectorTimeoutMs?: number;
|
|
153
|
+
typingDefaults?: TypingOptions;
|
|
154
|
+
typingSeed?: string | number;
|
|
155
|
+
onSceneStart?: (scene: FilmScriptScene) => Awaitable<void>;
|
|
156
|
+
onSceneEnd?: (scene: FilmScriptScene) => Awaitable<void>;
|
|
157
|
+
onActionStart?: (context: FilmScriptActionContext) => Awaitable<void>;
|
|
158
|
+
onActionEnd?: (context: FilmScriptActionContext) => Awaitable<void>;
|
|
159
|
+
onReadyToEnd?: FilmScriptReadyCallback;
|
|
160
|
+
}
|
|
161
|
+
export interface FilmScriptRunOptions extends FilmScriptExecutionOptions {
|
|
162
|
+
waitForCompletion?: (context: FilmScriptLifecycleContext) => Awaitable<void>;
|
|
163
|
+
completionTimeoutMs?: number;
|
|
164
|
+
}
|
|
165
|
+
export interface FilmRecorderOptions {
|
|
166
|
+
fps?: number;
|
|
167
|
+
resolutions?: Resolution[];
|
|
168
|
+
defaultResolutionIndex?: number;
|
|
169
|
+
autoZoom?: boolean;
|
|
170
|
+
pauseDuringScroll?: boolean;
|
|
171
|
+
showGrid?: boolean;
|
|
172
|
+
showOutline?: boolean;
|
|
173
|
+
enableShortcuts?: boolean;
|
|
174
|
+
elementSelector?: string | null;
|
|
175
|
+
elementPadding?: number;
|
|
176
|
+
fixedRecordingRegion?: FixedRecordingRegion | null;
|
|
177
|
+
movePointerToSelector?: string | null;
|
|
178
|
+
pointerClassName?: string;
|
|
179
|
+
pointerFillColor?: string;
|
|
180
|
+
pointerBorderColor?: string;
|
|
181
|
+
pointerRippleColor?: string;
|
|
182
|
+
disableRipple?: boolean;
|
|
183
|
+
ignoreSelector?: string | null;
|
|
184
|
+
overlays?: RecordingOverlayDefinition[];
|
|
185
|
+
autoDownload?: boolean;
|
|
186
|
+
includeTimelineMetadata?: boolean;
|
|
187
|
+
selectorTimeoutMs?: number;
|
|
188
|
+
typingDefaults?: TypingOptions;
|
|
189
|
+
typingSeed?: string | number;
|
|
190
|
+
onRecordingStart?: () => void;
|
|
191
|
+
onRecordingStop?: (artifact: RecordingArtifact) => void;
|
|
192
|
+
onRecordingError?: (err: Error) => void;
|
|
193
|
+
onTourStart?: () => Awaitable<void>;
|
|
194
|
+
onTourStop?: () => Awaitable<void>;
|
|
195
|
+
onReadyToEnd?: FilmScriptReadyCallback;
|
|
196
|
+
onTourError?: (err: Error) => Awaitable<void>;
|
|
197
|
+
onSceneStart?: (scene: FilmScriptScene) => Awaitable<void>;
|
|
198
|
+
onSceneEnd?: (scene: FilmScriptScene) => Awaitable<void>;
|
|
199
|
+
onActionStart?: (context: FilmScriptActionContext) => Awaitable<void>;
|
|
200
|
+
onActionEnd?: (context: FilmScriptActionContext) => Awaitable<void>;
|
|
201
|
+
}
|
|
202
|
+
export interface FinishRecordingOptions {
|
|
203
|
+
force?: boolean;
|
|
204
|
+
onReadyToEnd?: FilmScriptReadyCallback;
|
|
205
|
+
}
|
|
206
|
+
export type StateChangeListener = (state: RecorderState) => void;
|
|
207
|
+
export type RecordingOverlayPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right" | {
|
|
208
|
+
x: number;
|
|
209
|
+
y: number;
|
|
210
|
+
};
|
|
211
|
+
export type RecordingOverlayShape = "circle" | "rounded" | "square";
|
|
212
|
+
export interface CameraRecordingOverlayOptions {
|
|
213
|
+
id: string;
|
|
214
|
+
enabled?: boolean;
|
|
215
|
+
position?: RecordingOverlayPosition;
|
|
216
|
+
size?: number;
|
|
217
|
+
minSize?: number;
|
|
218
|
+
maxSize?: number;
|
|
219
|
+
shape?: RecordingOverlayShape;
|
|
220
|
+
draggable?: boolean;
|
|
221
|
+
resizable?: boolean;
|
|
222
|
+
mirror?: boolean;
|
|
223
|
+
requestOnShow?: boolean;
|
|
224
|
+
className?: string;
|
|
225
|
+
}
|
|
226
|
+
export interface CameraRecordingOverlayDefinition extends CameraRecordingOverlayOptions {
|
|
227
|
+
type: "camera";
|
|
228
|
+
}
|
|
229
|
+
export interface CustomRecordingOverlayOptions {
|
|
230
|
+
id: string;
|
|
231
|
+
element: HTMLElement | HTMLCanvasElement | HTMLImageElement | HTMLVideoElement;
|
|
232
|
+
enabled?: boolean;
|
|
233
|
+
includeInCapture?: boolean;
|
|
234
|
+
trackTimeline?: boolean;
|
|
235
|
+
position?: RecordingOverlayPosition;
|
|
236
|
+
size?: number;
|
|
237
|
+
className?: string;
|
|
238
|
+
optOutOfSdkStyles?: boolean;
|
|
239
|
+
}
|
|
240
|
+
export type RecordingOverlayDefinition = CameraRecordingOverlayDefinition;
|
|
241
|
+
export interface RecordingOverlayEvent {
|
|
242
|
+
type: "shown" | "hidden" | "moved" | "resized" | "error";
|
|
243
|
+
id: string;
|
|
244
|
+
data?: Record<string, unknown>;
|
|
245
|
+
}
|
|
246
|
+
export interface RecordingOverlayHandle {
|
|
247
|
+
id: string;
|
|
248
|
+
element: HTMLElement;
|
|
249
|
+
show(): Promise<void> | void;
|
|
250
|
+
hide(): void;
|
|
251
|
+
moveTo(position: RecordingOverlayPosition): void;
|
|
252
|
+
setSize(size: number): void;
|
|
253
|
+
destroy(): void;
|
|
254
|
+
requestPermission?(): Promise<boolean>;
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAE9C,MAAM,WAAW,IAAI;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IACzE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI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YPING_PRESET, } from './core/FilmRecorder';
|
|
2
|
+
export { RegionRecorderUI } from './vanilla/RegionRecorderUI';
|
|
3
|
+
export { useFilmRecorder } from './react/useFilmRecorder';
|
|
4
|
+
export { RegionRecorder } from './react/RegionRecorder';
|
|
5
|
+
export { createWebAssistantAgent, createRecorderAgentRunner } from './core/agent';
|
|
6
|
+
export { AppFilmGenerationError, generateAppFilmScript, repairAppFilmScript, parseAppFilmSetup, prepareAppFilmScript, stripAppFilmSetup, serializeAppFilmSetup, validateAppFilmScript, } from './core/app-script';
|
|
7
|
+
export { createRecorderIframeHost, createRecorderIframeClient, createRecorderIframeMessage, getRecorderIframeShortcutCommand, isRecorderIframeMessage, } from './core/iframe-bridge';
|
|
8
|
+
export { cameraOverlay } from './core/recording-overlays';
|
|
9
|
+
export * from './core/types';
|
|
10
|
+
export type { AppFilmComplete, AppFilmCompleteRequest, AppFilmCompleteResult, AppFilmAttachmentType, AppFilmExample, AppFilmGenerationDefaults, AppFilmGenerationTrace, AppFilmGenerationTraceCall, AppFilmGenerationTracePhase, AppFilmIntentMode, AppFilmIntentRecipe, AppFilmPage, AppFilmProfile, PreparedAppFilmScript, PrepareAppFilmScriptOptions, AppFilmPromptTool, AppFilmResolvedAttachment, AppFilmResolvedIntent, AppFilmResolvedPromptTool, AppFilmScriptResult, AppFilmSelector, AppFilmSetup, AppFilmSetupCapability, AppFilmSetupEntry, AppFilmToolDefinition, AppFilmTraceOptions, CreateFilmScriptToolResult, GenerateAppFilmScriptOptions, RepairAppFilmScriptOptions, ResolveFilmIntentToolResult, } from './core/app-script';
|
|
11
|
+
export type { RecorderIframeClientBridge, RecorderIframeClientOptions, RecorderIframeCommand, RecorderIframeHostBridge, RecorderIframeHostOptions, RecorderIframeMessage, } from './core/iframe-bridge';
|
|
12
|
+
export type { RegionRecorderProps } from './react/RegionRecorder';
|
|
13
|
+
export type { Rect, Resolution, Point, RecorderState, RecordingArtifact, FixedRecordingRegion, FilmRecorderOptions, CameraRecordingOverlayDefinition, CameraRecordingOverlayOptions, CustomRecordingOverlayOptions, RecordingOverlayDefinition, RecordingOverlayEvent, RecordingOverlayHandle, RecordingOverlayPosition, RecordingOverlayShape, } from './core/types';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|