@brett_lamy/ui 5.1.0 → 5.2.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/dist/components/adaptive-pane.d.ts +12 -1
- package/dist/components/adaptive-pane.d.ts.map +1 -1
- package/dist/components/adaptive-pane.js +122 -19
- package/dist/components/avatar.d.ts +47 -5
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +101 -14
- package/dist/components/breadcrumb.d.ts +87 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +312 -0
- package/dist/components/color-picker.js +15 -15
- package/dist/components/command-menu.js +13 -13
- package/dist/components/credenza.d.ts +5 -2
- package/dist/components/credenza.d.ts.map +1 -1
- package/dist/components/credenza.js +62 -60
- package/dist/components/date-picker.js +9 -9
- package/dist/components/edge-drawer.d.ts +7 -2
- package/dist/components/edge-drawer.d.ts.map +1 -1
- package/dist/components/edge-drawer.js +7 -4
- package/dist/components/filmstrip.d.ts +19 -0
- package/dist/components/filmstrip.d.ts.map +1 -0
- package/dist/components/filmstrip.js +59 -0
- package/dist/components/filter-input.js +4 -4
- package/dist/components/filter.js +62 -62
- package/dist/components/font-picker.d.ts +67 -0
- package/dist/components/font-picker.d.ts.map +1 -0
- package/dist/components/font-picker.js +373 -0
- package/dist/components/markdown-editor.d.ts +11 -0
- package/dist/components/markdown-editor.d.ts.map +1 -1
- package/dist/components/markdown-editor.js +72 -65
- package/dist/components/navigation-stack.d.ts.map +1 -1
- package/dist/components/navigation-stack.js +75 -65
- package/dist/components/number-morph.d.ts.map +1 -1
- package/dist/components/number-morph.js +5 -5
- package/dist/components/replay-preview.d.ts +2 -2
- package/dist/components/replay-preview.d.ts.map +1 -1
- package/dist/components/replay-preview.js +3 -3
- package/dist/components/result-table.js +10 -10
- package/dist/components/schema-tree.d.ts.map +1 -1
- package/dist/components/schema-tree.js +62 -131
- package/dist/components/segmented.d.ts +1 -1
- package/dist/components/segmented.d.ts.map +1 -1
- package/dist/components/segmented.js +1 -1
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar.js +8 -4
- package/dist/components/split-view.d.ts +3 -1
- package/dist/components/split-view.d.ts.map +1 -1
- package/dist/components/split-view.js +211 -211
- package/dist/components/spreadsheet.d.ts +58 -0
- package/dist/components/spreadsheet.d.ts.map +1 -0
- package/dist/components/spreadsheet.js +804 -0
- package/dist/components/sql-console.d.ts.map +1 -1
- package/dist/components/sql-console.js +2 -1
- package/dist/components/sql-editor.js +8 -8
- package/dist/components/stl-viewer.d.ts +3 -0
- package/dist/components/stl-viewer.d.ts.map +1 -0
- package/dist/components/stl-viewer.js +2 -0
- package/dist/components/strudel-player.d.ts +3 -0
- package/dist/components/strudel-player.d.ts.map +1 -0
- package/dist/components/strudel-player.js +2 -0
- package/dist/components/strudel-rack.d.ts +3 -0
- package/dist/components/strudel-rack.d.ts.map +1 -0
- package/dist/components/strudel-rack.js +2 -0
- package/dist/components/strudel-syntax.d.ts +3 -0
- package/dist/components/strudel-syntax.d.ts.map +1 -0
- package/dist/components/strudel-syntax.js +2 -0
- package/dist/components/tabs.js +3 -3
- package/dist/components/tailscale-menu.d.ts +69 -0
- package/dist/components/tailscale-menu.d.ts.map +1 -0
- package/dist/components/tailscale-menu.js +202 -0
- package/dist/components/toggle-group.js +3 -3
- package/dist/components/tree.d.ts +82 -0
- package/dist/components/tree.d.ts.map +1 -0
- package/dist/components/tree.js +494 -0
- package/dist/components/video-preview.d.ts +46 -0
- package/dist/components/video-preview.d.ts.map +1 -0
- package/dist/components/video-preview.js +197 -0
- package/dist/components/video-timeline.d.ts +64 -0
- package/dist/components/video-timeline.d.ts.map +1 -0
- package/dist/components/video-timeline.js +479 -0
- package/dist/components/waveform.d.ts +23 -0
- package/dist/components/waveform.d.ts.map +1 -0
- package/dist/components/waveform.js +56 -0
- package/dist/ffmpeg-worker.js +118 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +48 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +145 -121
- package/dist/lib/csv.d.ts +28 -0
- package/dist/lib/csv.d.ts.map +1 -0
- package/dist/lib/csv.js +90 -0
- package/dist/lib/drawer-swipe.d.ts +31 -0
- package/dist/lib/drawer-swipe.d.ts.map +1 -0
- package/dist/lib/drawer-swipe.js +68 -0
- package/dist/lib/ffmpeg/index.d.ts +117 -0
- package/dist/lib/ffmpeg/index.d.ts.map +1 -0
- package/dist/lib/ffmpeg/index.js +204 -0
- package/dist/lib/ffmpeg/media.d.ts +39 -0
- package/dist/lib/ffmpeg/media.d.ts.map +1 -0
- package/dist/lib/ffmpeg/media.js +100 -0
- package/dist/lib/ffmpeg/react.d.ts +51 -0
- package/dist/lib/ffmpeg/react.d.ts.map +1 -0
- package/dist/lib/ffmpeg/react.js +113 -0
- package/dist/lib/google-fonts.d.ts +47 -0
- package/dist/lib/google-fonts.d.ts.map +1 -0
- package/dist/lib/google-fonts.generated.d.ts +2 -0
- package/dist/lib/google-fonts.generated.d.ts.map +1 -0
- package/dist/lib/google-fonts.generated.js +1925 -0
- package/dist/lib/google-fonts.js +112 -0
- package/dist/lib/icon.d.ts +6 -1
- package/dist/lib/icon.d.ts.map +1 -1
- package/dist/lib/icon.js +2 -0
- package/dist/lib/playback.d.ts +34 -0
- package/dist/lib/playback.d.ts.map +1 -0
- package/dist/lib/playback.js +79 -0
- package/dist/lib/spreadsheet-gpu.d.ts +9 -0
- package/dist/lib/spreadsheet-gpu.d.ts.map +1 -0
- package/dist/lib/spreadsheet-gpu.js +237 -0
- package/dist/lib/spreadsheet.d.ts +82 -0
- package/dist/lib/spreadsheet.d.ts.map +1 -0
- package/dist/lib/spreadsheet.js +162 -0
- package/dist/lib/syntax.d.ts +2 -6
- package/dist/lib/syntax.d.ts.map +1 -1
- package/dist/lib/syntax.js +53 -75
- package/dist/lib/tailscale-connect.d.ts +33 -0
- package/dist/lib/tailscale-connect.d.ts.map +1 -1
- package/dist/lib/tailscale-connect.js +221 -42
- package/dist/lib/tailscale-exit.d.ts +19 -0
- package/dist/lib/tailscale-exit.d.ts.map +1 -0
- package/dist/lib/tailscale-exit.js +14 -0
- package/dist/lib/tailscale-fake.d.ts +8 -0
- package/dist/lib/tailscale-fake.d.ts.map +1 -1
- package/dist/lib/tailscale-fake.js +51 -26
- package/dist/lib/tailscale-roots.d.ts +3 -0
- package/dist/lib/tailscale-roots.d.ts.map +1 -0
- package/dist/lib/tailscale-roots.js +4 -0
- package/dist/lib/tailscale.d.ts +23 -0
- package/dist/lib/tailscale.d.ts.map +1 -1
- package/dist/lib/tailscale.js +156 -94
- package/dist/lib/title-flight.d.ts +4 -0
- package/dist/lib/title-flight.d.ts.map +1 -1
- package/dist/lib/title-flight.js +15 -12
- package/dist/lib/tokens.generated.d.ts +2 -2
- package/dist/lib/tokens.generated.d.ts.map +1 -1
- package/dist/lib/tokens.generated.js +2 -2
- package/dist/lib/video-render.d.ts +38 -0
- package/dist/lib/video-render.d.ts.map +1 -0
- package/dist/lib/video-render.js +147 -0
- package/dist/lib/video-timeline.d.ts +154 -0
- package/dist/lib/video-timeline.d.ts.map +1 -0
- package/dist/lib/video-timeline.js +265 -0
- package/dist/lib/webgpu.d.ts +26 -0
- package/dist/lib/webgpu.d.ts.map +1 -0
- package/dist/lib/webgpu.js +28 -0
- package/dist/theme.css +3 -0
- package/package.json +8 -3
package/dist/lib/tailscale.js
CHANGED
|
@@ -12,7 +12,8 @@ function n(e) {
|
|
|
12
12
|
return {
|
|
13
13
|
v: 1,
|
|
14
14
|
hostname: t.hostname,
|
|
15
|
-
state: n
|
|
15
|
+
state: n,
|
|
16
|
+
...typeof t.exitNodeId == "string" ? { exitNodeId: t.exitNodeId } : {}
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
function r() {
|
|
@@ -79,6 +80,7 @@ var c = Object.freeze({
|
|
|
79
80
|
tailnet: null,
|
|
80
81
|
addresses: [],
|
|
81
82
|
peers: [],
|
|
83
|
+
exitNodeId: null,
|
|
82
84
|
hasSession: !1
|
|
83
85
|
});
|
|
84
86
|
function l(e) {
|
|
@@ -99,56 +101,57 @@ function d(e) {
|
|
|
99
101
|
return t.length > 2 ? t.slice(1).join(".") : null;
|
|
100
102
|
}
|
|
101
103
|
function f(n = {}) {
|
|
102
|
-
let i = t(n.policy), a = n.auth ?? { mode: "interactive" }, s = n.persistence ?? r(), f = n.lockName === !1 ? null : `bl-tailscale:${n.lockName ?? "default"}`, p = /* @__PURE__ */ new Set(), m = c, h = null, g = null, _ = 0, v = "NoState", y = !1, b = null, x =
|
|
104
|
+
let i = t(n.policy), a = n.auth ?? { mode: "interactive" }, s = n.persistence ?? r(), f = n.lockName === !1 ? null : `bl-tailscale:${n.lockName ?? "default"}`, p = /* @__PURE__ */ new Set(), m = c, h = null, g = null, _ = 0, v = "NoState", y = !1, b = null, x = !1, S = [], C = 0, w = null, T = null, E = null, D = null, O = null, k = null, A = null, j = null, M = 0, N = null, P = () => ({
|
|
103
105
|
open: n.env?.open === void 0 ? typeof window < "u" ? (e, t, n) => window.open(e, t, n) : null : n.env.open,
|
|
104
106
|
locks: n.env?.locks === void 0 ? typeof navigator < "u" && navigator.locks ? navigator.locks : null : n.env.locks
|
|
105
107
|
});
|
|
106
|
-
function
|
|
108
|
+
function F(e) {
|
|
107
109
|
let t = {
|
|
108
110
|
...m,
|
|
109
111
|
...e
|
|
110
112
|
};
|
|
111
113
|
Object.keys(e).every((e) => Object.is(t[e], m[e])) || (m = t, p.forEach((e) => e()));
|
|
112
114
|
}
|
|
113
|
-
function
|
|
114
|
-
|
|
115
|
+
function I(e) {
|
|
116
|
+
V(), q(), y = !1, F({
|
|
115
117
|
status: "error",
|
|
116
118
|
error: e,
|
|
117
119
|
loginUrl: null
|
|
118
120
|
});
|
|
119
121
|
}
|
|
120
|
-
function
|
|
121
|
-
return
|
|
122
|
-
|
|
122
|
+
function L() {
|
|
123
|
+
return E ||= s.load().then((e) => {
|
|
124
|
+
T = e, F({ hasSession: e !== null });
|
|
123
125
|
}, (e) => {
|
|
124
|
-
throw
|
|
125
|
-
}),
|
|
126
|
+
throw E = null, new o("storage", "Could not read the saved Tailscale session.", { cause: e });
|
|
127
|
+
}), E;
|
|
126
128
|
}
|
|
127
|
-
function
|
|
128
|
-
|
|
129
|
+
function R(e, t) {
|
|
130
|
+
O = e, !D && (D = setTimeout(() => void z(t), 250));
|
|
129
131
|
}
|
|
130
|
-
async function
|
|
131
|
-
|
|
132
|
-
let t =
|
|
133
|
-
if (
|
|
134
|
-
|
|
132
|
+
async function z(e) {
|
|
133
|
+
D && clearTimeout(D), D = null;
|
|
134
|
+
let t = O;
|
|
135
|
+
if (O = null, t) {
|
|
136
|
+
T = {
|
|
135
137
|
v: 1,
|
|
136
138
|
hostname: e,
|
|
137
|
-
state: t
|
|
139
|
+
state: t,
|
|
140
|
+
...T?.exitNodeId ? { exitNodeId: T.exitNodeId } : {}
|
|
138
141
|
};
|
|
139
142
|
try {
|
|
140
|
-
await s.save(
|
|
143
|
+
await s.save(T), F({
|
|
141
144
|
hasSession: !0,
|
|
142
145
|
warning: null
|
|
143
146
|
});
|
|
144
147
|
} catch {
|
|
145
|
-
|
|
148
|
+
F({ warning: "The Tailscale session couldn't be saved; you will be asked to sign in again next time." });
|
|
146
149
|
}
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
|
-
function
|
|
152
|
+
function B() {
|
|
150
153
|
if (n.popup === !1) return;
|
|
151
|
-
let e =
|
|
154
|
+
let e = P().open;
|
|
152
155
|
if (!(!e || b && !b.closed)) {
|
|
153
156
|
try {
|
|
154
157
|
b = e("", "bl-tailscale-login", "popup,width=520,height=720");
|
|
@@ -161,27 +164,27 @@ function f(n = {}) {
|
|
|
161
164
|
} catch {}
|
|
162
165
|
}
|
|
163
166
|
}
|
|
164
|
-
function
|
|
165
|
-
let e = b;
|
|
166
|
-
b = null
|
|
167
|
-
try {
|
|
167
|
+
function V() {
|
|
168
|
+
let e = b, t = x;
|
|
169
|
+
if (b = null, x = !1, !t) try {
|
|
168
170
|
e && !e.closed && e.close();
|
|
169
171
|
} catch {}
|
|
170
172
|
}
|
|
171
|
-
function
|
|
172
|
-
if (e === null) return
|
|
173
|
-
if (!l(e)) return
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
173
|
+
function H(e) {
|
|
174
|
+
if (e === null) return F({ loginUrl: null });
|
|
175
|
+
if (!l(e)) return I(new o("login-url", `Refused to open the sign-in URL ${JSON.stringify(e.slice(0, 80))}.`));
|
|
176
|
+
let t = m.loginUrl === e;
|
|
177
|
+
F({ loginUrl: e });
|
|
178
|
+
let r = b;
|
|
179
|
+
if (r && !x && !r.closed) try {
|
|
180
|
+
r.opener = null, r.location.replace(e), x = !0;
|
|
178
181
|
return;
|
|
179
182
|
} catch {
|
|
180
183
|
b = null;
|
|
181
184
|
}
|
|
182
|
-
n.onLoginUrl?.(e);
|
|
185
|
+
x && t || n.onLoginUrl?.(e);
|
|
183
186
|
}
|
|
184
|
-
function
|
|
187
|
+
function U() {
|
|
185
188
|
switch (v) {
|
|
186
189
|
case "Running": return "connected";
|
|
187
190
|
case "Starting": return y ? "signing-in" : "starting";
|
|
@@ -192,46 +195,82 @@ function f(n = {}) {
|
|
|
192
195
|
default: return "error";
|
|
193
196
|
}
|
|
194
197
|
}
|
|
195
|
-
function
|
|
198
|
+
function W(e, t) {
|
|
196
199
|
if (e === _) {
|
|
197
200
|
if (t.error) {
|
|
198
|
-
|
|
201
|
+
let e = v === "Running";
|
|
202
|
+
X(!1).then(() => {
|
|
203
|
+
F({ exitNodeId: null }), e && T && Date.now() - C > 6e4 ? (C = Date.now(), F({
|
|
204
|
+
status: "loading",
|
|
205
|
+
warning: "Tailscale stopped unexpectedly and is reconnecting."
|
|
206
|
+
}), Y().catch((e) => I(e instanceof o ? e : new o("client", t.error)))) : I(new o("client", t.error));
|
|
207
|
+
});
|
|
199
208
|
return;
|
|
200
209
|
}
|
|
201
210
|
if (t.netMap !== void 0) {
|
|
202
211
|
let e = t.netMap;
|
|
203
212
|
if (e?.lockedOut) {
|
|
204
|
-
|
|
213
|
+
I(new o("locked-out", "Tailnet lock: this device is not signed."));
|
|
205
214
|
return;
|
|
206
215
|
}
|
|
207
216
|
let n = e?.self.name.replace(/\.$/, "") || null;
|
|
208
|
-
|
|
217
|
+
F({
|
|
209
218
|
selfName: n,
|
|
210
219
|
tailnet: d(n),
|
|
211
220
|
addresses: e?.self.addresses ?? [],
|
|
212
221
|
peers: (e?.peers ?? []).map((e) => ({
|
|
213
222
|
name: e.name.replace(/\.$/, ""),
|
|
214
223
|
addresses: e.addresses,
|
|
215
|
-
online: e.online === !0
|
|
216
|
-
|
|
224
|
+
online: e.online === !0,
|
|
225
|
+
id: e.id ?? null,
|
|
226
|
+
exitNode: e.exitNodeOption === !0
|
|
227
|
+
})),
|
|
228
|
+
...e?.selectedExitNodeId === void 0 ? e === null ? { exitNodeId: null } : {} : { exitNodeId: e.selectedExitNodeId }
|
|
217
229
|
});
|
|
218
230
|
}
|
|
219
|
-
if (t.loginUrl !== void 0 &&
|
|
220
|
-
if (v = t.state, v
|
|
221
|
-
|
|
231
|
+
if (t.loginUrl !== void 0 && H(t.loginUrl), t.state) {
|
|
232
|
+
if (v = t.state, v !== "NoState" && v !== "Starting") {
|
|
233
|
+
let e = S;
|
|
234
|
+
S = [], e.forEach((e) => e(v));
|
|
235
|
+
}
|
|
236
|
+
if (v === "InUseOtherUser") return I(new o("in-use", "The session belongs to a different user."));
|
|
237
|
+
v === "Running" && (y = !1, q(), V(), F({ loginUrl: null }), G(e));
|
|
222
238
|
}
|
|
223
|
-
(m.status !== "error" || t.state === "Running") &&
|
|
224
|
-
status:
|
|
239
|
+
(m.status !== "error" || t.state === "Running") && F({
|
|
240
|
+
status: U(),
|
|
225
241
|
...t.state === "Running" ? { error: null } : {}
|
|
226
242
|
});
|
|
227
243
|
}
|
|
228
244
|
}
|
|
229
|
-
function
|
|
230
|
-
|
|
245
|
+
function G(e) {
|
|
246
|
+
let t = T?.exitNodeId;
|
|
247
|
+
if (!t || m.exitNodeId === t || !h?.setExitNode) return;
|
|
248
|
+
let n = h;
|
|
249
|
+
setTimeout(() => {
|
|
250
|
+
e === _ && h === n && m.exitNodeId !== t && m.peers.some((e) => e.id === t && e.exitNode) && Promise.resolve(n.setExitNode(t)).then(() => {
|
|
251
|
+
e === _ && F({
|
|
252
|
+
exitNodeId: t,
|
|
253
|
+
warning: null
|
|
254
|
+
});
|
|
255
|
+
}, () => {});
|
|
256
|
+
}, 250);
|
|
257
|
+
}
|
|
258
|
+
function K(e) {
|
|
259
|
+
return v !== "NoState" && v !== "Starting" ? Promise.resolve(v) : new Promise((t) => {
|
|
260
|
+
let n = setTimeout(() => {
|
|
261
|
+
S = S.filter((e) => e !== r), t(null);
|
|
262
|
+
}, e), r = (e) => {
|
|
263
|
+
clearTimeout(n), t(e);
|
|
264
|
+
};
|
|
265
|
+
S.push(r);
|
|
266
|
+
});
|
|
231
267
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
268
|
+
function q() {
|
|
269
|
+
j && clearTimeout(j), j = null;
|
|
270
|
+
}
|
|
271
|
+
async function J() {
|
|
272
|
+
if (!f || k) return !0;
|
|
273
|
+
let e = P().locks;
|
|
235
274
|
return !e || new Promise((t) => {
|
|
236
275
|
e.request(f, { ifAvailable: !0 }, (e) => {
|
|
237
276
|
if (!e) {
|
|
@@ -239,21 +278,21 @@ function f(n = {}) {
|
|
|
239
278
|
return;
|
|
240
279
|
}
|
|
241
280
|
return t(!0), new Promise((e) => {
|
|
242
|
-
|
|
281
|
+
k = e;
|
|
243
282
|
});
|
|
244
283
|
}).catch(() => t(!0));
|
|
245
284
|
});
|
|
246
285
|
}
|
|
247
|
-
async function
|
|
286
|
+
async function Y(e) {
|
|
248
287
|
if (h) return h;
|
|
249
288
|
if (g) return g;
|
|
250
289
|
let t = ++_;
|
|
251
290
|
g = (async () => {
|
|
252
|
-
if (
|
|
291
|
+
if (F({
|
|
253
292
|
status: "loading",
|
|
254
293
|
error: null
|
|
255
|
-
}), !await
|
|
256
|
-
await
|
|
294
|
+
}), !await J()) throw new o("other-tab", "Tailscale is running in another tab.");
|
|
295
|
+
await L();
|
|
257
296
|
let r = n.client;
|
|
258
297
|
if (!r) throw new o("no-client", "No Tailscale client: pass `client` to createTailscale (for example createTailscaleConnectClient).");
|
|
259
298
|
let i;
|
|
@@ -263,46 +302,52 @@ function f(n = {}) {
|
|
|
263
302
|
throw new o("client", `The Tailscale client failed to load: ${e instanceof Error ? e.message : String(e)}`, { cause: e });
|
|
264
303
|
}
|
|
265
304
|
if (t !== _) throw i.dispose(), new o("client", "Stopped while starting.");
|
|
266
|
-
let a =
|
|
267
|
-
v = "NoState";
|
|
305
|
+
let a = T?.hostname ?? n.hostname ?? u();
|
|
306
|
+
w = a, v = "NoState";
|
|
268
307
|
try {
|
|
269
308
|
await i.start({
|
|
270
309
|
hostname: a,
|
|
271
310
|
controlUrl: n.controlUrl,
|
|
272
311
|
authKey: e,
|
|
273
|
-
state:
|
|
312
|
+
state: T?.state ?? null,
|
|
313
|
+
exitNodeId: T?.exitNodeId ?? null,
|
|
274
314
|
onState: (e) => {
|
|
275
|
-
t === _ &&
|
|
315
|
+
t === _ && R(e, a);
|
|
276
316
|
},
|
|
277
|
-
onEvent: (e) =>
|
|
317
|
+
onEvent: (e) => W(t, e)
|
|
278
318
|
});
|
|
279
319
|
} catch (e) {
|
|
280
320
|
throw i.dispose(), new o("client", `The Tailscale client failed to start: ${e instanceof Error ? e.message : String(e)}`, { cause: e });
|
|
281
321
|
}
|
|
282
322
|
if (t !== _) throw i.dispose(), new o("client", "Stopped while starting.");
|
|
283
|
-
return h = i,
|
|
323
|
+
return h = i, F({ status: U() }), i;
|
|
284
324
|
})();
|
|
285
325
|
try {
|
|
286
326
|
return await g;
|
|
287
327
|
} catch (e) {
|
|
288
|
-
throw t === _ && (
|
|
328
|
+
throw t === _ && (k?.(), k = null), e;
|
|
289
329
|
} finally {
|
|
290
330
|
t === _ && (g = null);
|
|
291
331
|
}
|
|
292
332
|
}
|
|
293
|
-
async function
|
|
294
|
-
_++,
|
|
333
|
+
async function X(e) {
|
|
334
|
+
_++, q(), A?.abort(), A = null;
|
|
295
335
|
let t = h;
|
|
296
|
-
h = null, g = null, v = "NoState", y = !1
|
|
336
|
+
h = null, g = null, v = "NoState", y = !1;
|
|
337
|
+
let n = S;
|
|
338
|
+
S = [], n.forEach((e) => e("Stopped"));
|
|
339
|
+
let r = T?.hostname ?? w;
|
|
340
|
+
O && r && await z(r), e || (k?.(), k = null), t && await t.dispose();
|
|
297
341
|
}
|
|
298
|
-
let
|
|
342
|
+
let Z = () => F({
|
|
299
343
|
status: "idle",
|
|
300
344
|
loginUrl: null,
|
|
301
345
|
selfName: null,
|
|
302
346
|
tailnet: null,
|
|
303
347
|
addresses: [],
|
|
304
|
-
peers: []
|
|
305
|
-
|
|
348
|
+
peers: [],
|
|
349
|
+
exitNodeId: null
|
|
350
|
+
}), Q = {
|
|
306
351
|
policy: i,
|
|
307
352
|
getSnapshot: () => m,
|
|
308
353
|
getServerSnapshot: () => c,
|
|
@@ -310,28 +355,28 @@ function f(n = {}) {
|
|
|
310
355
|
return p.add(e), () => p.delete(e);
|
|
311
356
|
},
|
|
312
357
|
activate() {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}, (e) =>
|
|
358
|
+
M++, N && clearTimeout(N), N = null, L().then(() => {
|
|
359
|
+
M > 0 && T && n.autoConnect !== !1 && m.status === "idle" && Q.connect();
|
|
360
|
+
}, (e) => F({ warning: e instanceof Error ? e.message : String(e) }));
|
|
316
361
|
let e = !1;
|
|
317
362
|
return () => {
|
|
318
|
-
e || (e = !0,
|
|
319
|
-
|
|
363
|
+
e || (e = !0, M--, M === 0 && (N = setTimeout(() => {
|
|
364
|
+
N = null, M === 0 && Q.dispose();
|
|
320
365
|
}, 0)));
|
|
321
366
|
};
|
|
322
367
|
},
|
|
323
368
|
async connect() {
|
|
324
369
|
if (!(h || g)) try {
|
|
325
|
-
if (await
|
|
326
|
-
await
|
|
370
|
+
if (await L(), !T) return;
|
|
371
|
+
await Y();
|
|
327
372
|
} catch (e) {
|
|
328
|
-
|
|
373
|
+
I(e instanceof o ? e : new o("client", String(e)));
|
|
329
374
|
}
|
|
330
375
|
},
|
|
331
376
|
async signIn() {
|
|
332
377
|
if (m.status === "connected") return;
|
|
333
378
|
let e = a.mode === "interactive";
|
|
334
|
-
e &&
|
|
379
|
+
e && B(), y = !0, F({
|
|
335
380
|
status: "signing-in",
|
|
336
381
|
error: null,
|
|
337
382
|
loginUrl: null
|
|
@@ -339,48 +384,51 @@ function f(n = {}) {
|
|
|
339
384
|
try {
|
|
340
385
|
let t;
|
|
341
386
|
if (a.mode === "auth-key") {
|
|
342
|
-
h && await
|
|
387
|
+
h && await X(!0), A = new AbortController();
|
|
343
388
|
try {
|
|
344
|
-
t = typeof a.authKey == "function" ? await a.authKey(
|
|
389
|
+
t = typeof a.authKey == "function" ? await a.authKey(A.signal) : a.authKey;
|
|
345
390
|
} catch (e) {
|
|
346
391
|
throw new o("auth-key", `Could not get an auth key: ${e instanceof Error ? e.message : String(e)}`, { cause: e });
|
|
347
392
|
}
|
|
348
393
|
if (!t) throw new o("auth-key", "The auth key is empty.");
|
|
349
394
|
let e = _;
|
|
350
|
-
|
|
351
|
-
e <= _ && m.status !== "connected" && y && (
|
|
395
|
+
q(), j = setTimeout(() => {
|
|
396
|
+
e <= _ && m.status !== "connected" && y && (X(!1), I(new o("auth-key", "Signing in with the auth key did not finish in time.")));
|
|
352
397
|
}, n.authKeyTimeoutMs ?? 3e4);
|
|
353
398
|
}
|
|
354
399
|
y = !0;
|
|
355
|
-
|
|
356
|
-
|
|
400
|
+
try {
|
|
401
|
+
await L();
|
|
402
|
+
} catch {}
|
|
403
|
+
let r = !!T && !h && !g, i = await Y(t);
|
|
404
|
+
F({ status: U() }), e && r && await K(n.restoreTimeoutMs ?? 2e4), e && v !== "Running" && y && await i.login();
|
|
357
405
|
} catch (e) {
|
|
358
406
|
if (!y && !(e instanceof o)) return;
|
|
359
|
-
|
|
407
|
+
I(e instanceof o ? e : new o("client", e instanceof Error ? e.message : String(e), { cause: e }));
|
|
360
408
|
}
|
|
361
409
|
},
|
|
362
410
|
cancel() {
|
|
363
|
-
(m.status === "signing-in" || m.status === "loading") && (y = !1,
|
|
411
|
+
(m.status === "signing-in" || m.status === "loading") && (y = !1, q(), A?.abort(), V(), F({
|
|
364
412
|
loginUrl: null,
|
|
365
|
-
status: h ?
|
|
413
|
+
status: h ? U() : "idle"
|
|
366
414
|
}));
|
|
367
415
|
},
|
|
368
416
|
async disconnect() {
|
|
369
|
-
|
|
417
|
+
V(), await X(!1), Z(), F({ error: null });
|
|
370
418
|
},
|
|
371
419
|
async signOut() {
|
|
372
|
-
|
|
420
|
+
V();
|
|
373
421
|
let e = h;
|
|
374
422
|
try {
|
|
375
423
|
e && await e.logout();
|
|
376
424
|
} catch {}
|
|
377
|
-
|
|
425
|
+
O = null, await X(!1), T = null;
|
|
378
426
|
try {
|
|
379
427
|
await s.clear();
|
|
380
428
|
} catch {
|
|
381
|
-
|
|
429
|
+
F({ warning: "The saved session couldn't be deleted." });
|
|
382
430
|
}
|
|
383
|
-
|
|
431
|
+
Z(), F({
|
|
384
432
|
hasSession: !1,
|
|
385
433
|
error: null
|
|
386
434
|
});
|
|
@@ -389,14 +437,28 @@ function f(n = {}) {
|
|
|
389
437
|
if (!h || v !== "Running") throw new o("not-connected", "Not connected to Tailscale.");
|
|
390
438
|
return h.fetch(e);
|
|
391
439
|
},
|
|
440
|
+
async setExitNode(e) {
|
|
441
|
+
if (!h || v !== "Running") throw new o("not-connected", "Not connected to Tailscale.");
|
|
442
|
+
if (!h.setExitNode) throw new o("client", "This Tailscale client cannot use an exit node.");
|
|
443
|
+
if (e !== null && !m.peers.some((t) => t.id === e && t.exitNode)) throw new o("client", "That device is not an exit node on this tailnet.");
|
|
444
|
+
if (await h.setExitNode(e), F({ exitNodeId: e }), O && w && await z(w), T) {
|
|
445
|
+
T = {
|
|
446
|
+
...T,
|
|
447
|
+
exitNodeId: e
|
|
448
|
+
};
|
|
449
|
+
try {
|
|
450
|
+
await s.save(T);
|
|
451
|
+
} catch {}
|
|
452
|
+
}
|
|
453
|
+
},
|
|
392
454
|
matches(t, n = "GET") {
|
|
393
455
|
return e(t, n, i, typeof location < "u" ? location.origin : void 0).route;
|
|
394
456
|
},
|
|
395
457
|
async dispose() {
|
|
396
|
-
|
|
458
|
+
V(), await X(!1), Z();
|
|
397
459
|
}
|
|
398
460
|
};
|
|
399
|
-
return
|
|
461
|
+
return Q;
|
|
400
462
|
}
|
|
401
463
|
async function p(e, t) {
|
|
402
464
|
let n = new Request(e, t), r = [];
|
|
@@ -19,6 +19,10 @@ export interface ActiveFlight {
|
|
|
19
19
|
}
|
|
20
20
|
/** The title a screen is showing right now: its large title until it scrolls under the bar, else the inline one. */
|
|
21
21
|
export declare function shownTitle(r: TitleParts | undefined): HTMLElement | null;
|
|
22
|
+
/** The title that flies out on a push. A large title that has scrolled under the bar leaves nothing to fly from (its
|
|
23
|
+
* inline stand-in sits at the bar's centre, an odd place for the back label to appear from), so the new screen
|
|
24
|
+
* just slides in with its own back button. A screen without a large title flies its inline one as usual. */
|
|
25
|
+
export declare function pushedTitle(r: TitleParts | undefined): HTMLElement | null;
|
|
22
26
|
/** A screen's back label, when it shows the previous title (not "Back", not nothing). */
|
|
23
27
|
export declare function backLabel(r: TitleParts | undefined): HTMLElement | null;
|
|
24
28
|
/** Owns the stack's one flight at a time: starting another (or unmounting) ends the one in progress, so a push or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"title-flight.d.ts","sourceRoot":"","sources":["../../src/lib/title-flight.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAW,KAAK,yBAAyB,EAAE,MAAM,eAAe,CAAC;AASxE,yDAAyD;AACzD,MAAM,WAAW,UAAU;IACz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G,SAAS,KAAG,CAAC,IAAI,YAAY;EAqC1E"}
|
package/dist/lib/title-flight.js
CHANGED
|
@@ -8,24 +8,27 @@ function s(e) {
|
|
|
8
8
|
return e ? e.large && !e.el?.hasAttribute("data-scrolled") ? e.large : e.inline && parseFloat(getComputedStyle(e.inline).opacity) > .5 ? e.inline : null : null;
|
|
9
9
|
}
|
|
10
10
|
function c(e) {
|
|
11
|
-
return e?.
|
|
11
|
+
return e?.large && e.el?.hasAttribute("data-scrolled") ? null : s(e);
|
|
12
12
|
}
|
|
13
13
|
function l(e) {
|
|
14
|
+
return e?.back && e.back.dataset.mode === "title" ? e.back : null;
|
|
15
|
+
}
|
|
16
|
+
function u(e) {
|
|
14
17
|
if (!e.dataset.mode) return null;
|
|
15
18
|
let t = e.previousElementSibling;
|
|
16
19
|
return t instanceof HTMLElement || t instanceof SVGElement ? t : null;
|
|
17
20
|
}
|
|
18
|
-
function
|
|
21
|
+
function d(e, t, n, r) {
|
|
19
22
|
let o = e.getBoundingClientRect(), s = t.getBoundingClientRect(), c = n.getBoundingClientRect();
|
|
20
23
|
if (!s.width || !c.width) return null;
|
|
21
|
-
let
|
|
24
|
+
let l = r ? r.getBoundingClientRect() : o, d = {
|
|
22
25
|
x: s.left - o.left,
|
|
23
26
|
y: s.top - o.top,
|
|
24
27
|
w: s.width,
|
|
25
28
|
h: s.height
|
|
26
29
|
}, f = {
|
|
27
|
-
x: c.left -
|
|
28
|
-
y: c.top -
|
|
30
|
+
x: c.left - l.left,
|
|
31
|
+
y: c.top - l.top,
|
|
29
32
|
w: c.width,
|
|
30
33
|
h: c.height
|
|
31
34
|
}, p = getComputedStyle(t), m = getComputedStyle(n), h = (parseFloat(m.fontSize) || 17) / (parseFloat(p.fontSize) || 17), g = document.createElement("div");
|
|
@@ -58,13 +61,13 @@ function u(e, t, n, r) {
|
|
|
58
61
|
}), g.appendChild(r), r;
|
|
59
62
|
}, v = _(t, p, d), y = _(n, m, f);
|
|
60
63
|
e.appendChild(g), t.style.visibility = "hidden", n.style.visibility = "hidden";
|
|
61
|
-
let b = Math.abs(h - 1) < .05, x =
|
|
64
|
+
let b = Math.abs(h - 1) < .05, x = u(n), S = null;
|
|
62
65
|
if (x) {
|
|
63
66
|
let e = x.getBoundingClientRect();
|
|
64
67
|
S = x.cloneNode(!0), Object.assign(S.style, {
|
|
65
68
|
position: "absolute",
|
|
66
|
-
left: e.left -
|
|
67
|
-
top: e.top -
|
|
69
|
+
left: e.left - l.left + "px",
|
|
70
|
+
top: e.top - l.top + "px",
|
|
68
71
|
margin: "0",
|
|
69
72
|
opacity: "0",
|
|
70
73
|
width: e.width + "px",
|
|
@@ -82,7 +85,7 @@ function u(e, t, n, r) {
|
|
|
82
85
|
}
|
|
83
86
|
};
|
|
84
87
|
}
|
|
85
|
-
function
|
|
88
|
+
function f(i) {
|
|
86
89
|
let a = r(null), s = () => {
|
|
87
90
|
let e = a.current;
|
|
88
91
|
a.current = null, e && (e.run?.stop(), e.f.done());
|
|
@@ -100,7 +103,7 @@ function d(i) {
|
|
|
100
103
|
s(), !o() && requestAnimationFrame(() => {
|
|
101
104
|
let [n, r, o] = t();
|
|
102
105
|
if (!n || !r || !i.current) return;
|
|
103
|
-
let s =
|
|
106
|
+
let s = d(i.current, n, r, o);
|
|
104
107
|
if (!s) return;
|
|
105
108
|
s.set(0);
|
|
106
109
|
let c = { f: s };
|
|
@@ -109,7 +112,7 @@ function d(i) {
|
|
|
109
112
|
},
|
|
110
113
|
scrub: (e, t, n) => {
|
|
111
114
|
s();
|
|
112
|
-
let r = !o() && e && t && i.current ?
|
|
115
|
+
let r = !o() && e && t && i.current ? d(i.current, e, t, n) : null;
|
|
113
116
|
return r ? (r.set(0), a.current = { f: r }, a.current) : null;
|
|
114
117
|
},
|
|
115
118
|
release: (t, n, r) => {
|
|
@@ -120,4 +123,4 @@ function d(i) {
|
|
|
120
123
|
};
|
|
121
124
|
}
|
|
122
125
|
//#endregion
|
|
123
|
-
export {
|
|
126
|
+
export { l as backLabel, c as pushedTitle, s as shownTitle, f as useTitleFlight };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Color utilities (bg-*, text-*, border-*…) by name: `--color-<name>`. */
|
|
2
|
-
export declare const COLOR_TOKENS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring", "success", "warning", "tertiary-foreground", "secondary-strong", "overlay", "bar", "sticky", "handle", "link", "code", "code-foreground"];
|
|
2
|
+
export declare const COLOR_TOKENS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring", "success", "warning", "tertiary-foreground", "secondary-strong", "segment", "overlay", "bar", "sticky", "handle", "link", "code", "code-foreground"];
|
|
3
3
|
/** Font-size utilities (text-*): `--text-<name>`. Size only — no line-height. */
|
|
4
4
|
export declare const TEXT_TOKENS: readonly ["caption2", "caption", "footnote", "detail", "subhead", "callout", "body", "title"];
|
|
5
5
|
/** Radius utilities (rounded-*): `--radius-<name>`, all derived from the `--radius` variable. */
|
|
@@ -11,6 +11,6 @@ export declare const SPACING_TOKENS: readonly ["toolbar", "row"];
|
|
|
11
11
|
/** Font-family utilities (font-*): `--font-<name>`. */
|
|
12
12
|
export declare const FONT_TOKENS: readonly ["sans", "mono"];
|
|
13
13
|
/** The CSS variables a theme (or a `ThemeScope`'s `vars`) sets, without the leading `--`. */
|
|
14
|
-
export declare const THEME_VARS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring", "success", "warning", "tertiary-foreground", "secondary-strong", "overlay", "bar", "sticky", "handle", "link", "code", "code-foreground", "radius", "font-sans", "font-mono"];
|
|
14
|
+
export declare const THEME_VARS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring", "success", "warning", "tertiary-foreground", "secondary-strong", "segment", "overlay", "bar", "sticky", "handle", "link", "code", "code-foreground", "radius", "font-sans", "font-mono"];
|
|
15
15
|
export type ThemeVar = (typeof THEME_VARS)[number];
|
|
16
16
|
//# sourceMappingURL=tokens.generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.generated.d.ts","sourceRoot":"","sources":["../../src/lib/tokens.generated.ts"],"names":[],"mappings":"AAGA,2EAA2E;AAC3E,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"tokens.generated.d.ts","sourceRoot":"","sources":["../../src/lib/tokens.generated.ts"],"names":[],"mappings":"AAGA,2EAA2E;AAC3E,eAAO,MAAM,YAAY,8nBA4Cf,CAAC;AAEX,iFAAiF;AACjF,eAAO,MAAM,WAAW,+FASd,CAAC;AAEX,iGAAiG;AACjG,eAAO,MAAM,aAAa,4CAKhB,CAAC;AAEX,sDAAsD;AACtD,eAAO,MAAM,aAAa,mDAIhB,CAAC;AAEX,oFAAoF;AACpF,eAAO,MAAM,cAAc,6BAGjB,CAAC;AAEX,uDAAuD;AACvD,eAAO,MAAM,WAAW,2BAGd,CAAC;AAEX,6FAA6F;AAC7F,eAAO,MAAM,UAAU,kqBA+Cb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/lib/tokens.generated.ts
|
|
2
|
-
var e = /* @__PURE__ */ "background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.secondary.secondary-foreground.muted.muted-foreground.accent.accent-foreground.destructive.border.input.ring.chart-1.chart-2.chart-3.chart-4.chart-5.sidebar.sidebar-foreground.sidebar-primary.sidebar-primary-foreground.sidebar-accent.sidebar-accent-foreground.sidebar-border.sidebar-ring.success.warning.tertiary-foreground.secondary-strong.overlay.bar.sticky.handle.link.code.code-foreground".split("."), t = [
|
|
2
|
+
var e = /* @__PURE__ */ "background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.secondary.secondary-foreground.muted.muted-foreground.accent.accent-foreground.destructive.border.input.ring.chart-1.chart-2.chart-3.chart-4.chart-5.sidebar.sidebar-foreground.sidebar-primary.sidebar-primary-foreground.sidebar-accent.sidebar-accent-foreground.sidebar-border.sidebar-ring.success.warning.tertiary-foreground.secondary-strong.segment.overlay.bar.sticky.handle.link.code.code-foreground".split("."), t = [
|
|
3
3
|
"caption2",
|
|
4
4
|
"caption",
|
|
5
5
|
"footnote",
|
|
@@ -17,6 +17,6 @@ var e = /* @__PURE__ */ "background.foreground.card.card-foreground.popover.popo
|
|
|
17
17
|
"hairline",
|
|
18
18
|
"hairline-t",
|
|
19
19
|
"hairline-b"
|
|
20
|
-
], i = ["toolbar", "row"], a = ["sans", "mono"], o = /* @__PURE__ */ "background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.secondary.secondary-foreground.muted.muted-foreground.accent.accent-foreground.destructive.border.input.ring.chart-1.chart-2.chart-3.chart-4.chart-5.sidebar.sidebar-foreground.sidebar-primary.sidebar-primary-foreground.sidebar-accent.sidebar-accent-foreground.sidebar-border.sidebar-ring.success.warning.tertiary-foreground.secondary-strong.overlay.bar.sticky.handle.link.code.code-foreground.radius.font-sans.font-mono".split(".");
|
|
20
|
+
], i = ["toolbar", "row"], a = ["sans", "mono"], o = /* @__PURE__ */ "background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.secondary.secondary-foreground.muted.muted-foreground.accent.accent-foreground.destructive.border.input.ring.chart-1.chart-2.chart-3.chart-4.chart-5.sidebar.sidebar-foreground.sidebar-primary.sidebar-primary-foreground.sidebar-accent.sidebar-accent-foreground.sidebar-border.sidebar-ring.success.warning.tertiary-foreground.secondary-strong.segment.overlay.bar.sticky.handle.link.code.code-foreground.radius.font-sans.font-mono".split(".");
|
|
21
21
|
//#endregion
|
|
22
22
|
export { e as COLOR_TOKENS, a as FONT_TOKENS, n as RADIUS_TOKENS, r as SHADOW_TOKENS, i as SPACING_TOKENS, t as TEXT_TOKENS, o as THEME_VARS };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Ffmpeg, FfmpegProgress } from './ffmpeg';
|
|
2
|
+
import { Timeline, TimelineFormat } from './video-timeline';
|
|
3
|
+
export interface RenderMedia {
|
|
4
|
+
file: Blob;
|
|
5
|
+
kind: 'video' | 'audio' | 'image';
|
|
6
|
+
/** It has an audio stream. */
|
|
7
|
+
hasAudio: boolean;
|
|
8
|
+
}
|
|
9
|
+
export type RenderContainer = 'mp4' | 'webm' | 'gif' | 'mp3' | 'wav';
|
|
10
|
+
export type RenderQuality = 'low' | 'medium' | 'high';
|
|
11
|
+
export interface RenderOptions {
|
|
12
|
+
/** Default `mp4`. */
|
|
13
|
+
container?: RenderContainer;
|
|
14
|
+
/** Default `medium`. */
|
|
15
|
+
quality?: RenderQuality;
|
|
16
|
+
/** What shows behind and between clips, as an FFmpeg colour (`black`, `#202020`). Default black. */
|
|
17
|
+
background?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface RenderPlan {
|
|
20
|
+
args: string[];
|
|
21
|
+
inputs: Record<string, Blob>;
|
|
22
|
+
/** The file the command writes. */
|
|
23
|
+
output: string;
|
|
24
|
+
mime: string;
|
|
25
|
+
/** Seconds. */
|
|
26
|
+
duration: number;
|
|
27
|
+
}
|
|
28
|
+
export declare const renderMime: Record<RenderContainer, string>;
|
|
29
|
+
/** The FFmpeg command that renders `timeline` at `format`. Throws when there's nothing to render. */
|
|
30
|
+
export declare function buildRender(timeline: Timeline, media: Record<string, RenderMedia>, format: TimelineFormat, options?: RenderOptions): RenderPlan;
|
|
31
|
+
export interface RenderTimelineOptions extends RenderOptions {
|
|
32
|
+
onProgress?: (progress: FfmpegProgress) => void;
|
|
33
|
+
onLog?: (line: string) => void;
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
}
|
|
36
|
+
/** Renders a timeline to a file. */
|
|
37
|
+
export declare function renderTimeline(ffmpeg: Ffmpeg, timeline: Timeline, media: Record<string, RenderMedia>, format: TimelineFormat, options?: RenderTimelineOptions): Promise<Blob>;
|
|
38
|
+
//# sourceMappingURL=video-render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-render.d.ts","sourceRoot":"","sources":["../../src/lib/video-render.ts"],"names":[],"mappings":"AAUA,OAAO,EAAiB,KAAK,MAAM,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAA8C,KAAK,QAAQ,EAAqB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEzI,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IAClC,8BAA8B;IAC9B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,eAAe,GAAG,KAAK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