@hyperframes/core 0.9.95 → 0.9.97
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/audibleVideo.d.ts +10 -0
- package/dist/audibleVideo.js +37 -0
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/hyperframe.runtime.iife.js +67 -67
- package/dist/index.d.ts +1 -1
- package/dist/runtime/adapters/seek-dispatch.d.ts +40 -0
- package/dist/runtime/adapters/seek-dispatch.js +164 -0
- package/dist/runtime/assetUrl.d.ts +6 -0
- package/dist/runtime/assetUrl.js +8 -0
- package/dist/runtime/audioFx.d.ts +77 -0
- package/dist/runtime/audioFx.js +277 -0
- package/dist/runtime/bridge.d.ts +6 -0
- package/dist/runtime/bridge.js +20 -0
- package/dist/runtime/decodesFirst.d.ts +4 -0
- package/dist/runtime/decodesFirst.js +14 -0
- package/dist/runtime/editing/gsapSnapshot.js +12 -3
- package/dist/runtime/editing/gsapSnapshotLimits.d.ts +5 -3
- package/dist/runtime/editing/gsapSnapshotLimits.js +5 -3
- package/dist/runtime/editing/textCaret.d.ts +14 -0
- package/dist/runtime/editing/textCaret.js +98 -0
- package/dist/runtime/editing/textEdit.d.ts +8 -0
- package/dist/runtime/editing/textEdit.js +67 -10
- package/dist/runtime/editingPort.d.ts +3 -2
- package/dist/runtime/editingPort.js +2 -1
- package/dist/runtime/media.d.ts +113 -0
- package/dist/runtime/media.js +820 -0
- package/dist/runtime/mediaLoadFailure.d.ts +8 -0
- package/dist/runtime/mediaLoadFailure.js +58 -0
- package/dist/runtime/mediaProxy.d.ts +91 -0
- package/dist/runtime/mediaProxy.js +803 -0
- package/dist/runtime/playbackHealth.d.ts +31 -0
- package/dist/runtime/playbackHealth.js +137 -0
- package/dist/runtime/preloadMedia.d.ts +16 -0
- package/dist/runtime/preloadMedia.js +266 -0
- package/dist/runtime/previewCopies.d.ts +13 -0
- package/dist/runtime/previewCopies.js +80 -0
- package/dist/runtime/proxyWait.d.ts +3 -0
- package/dist/runtime/proxyWait.js +51 -0
- package/dist/runtime/runtimeLoad.d.ts +3 -0
- package/dist/runtime/runtimeLoad.js +13 -0
- package/dist/runtime/state.d.ts +7 -0
- package/dist/runtime/state.js +3 -0
- package/dist/runtime/timedClipHide.d.ts +12 -0
- package/dist/runtime/timedClipHide.js +94 -0
- package/dist/runtime/types.d.ts +29 -18
- package/dist/runtime/webAudioTransport.d.ts +243 -0
- package/dist/runtime/webAudioTransport.js +1176 -0
- package/dist/safePath.js +20 -11
- package/dist/terminalText.d.ts +1 -0
- package/dist/terminalText.js +17 -0
- package/package.json +12 -4
package/dist/safePath.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolve, sep, join, dirname, basename, relative, isAbsolute, parse } from "node:path";
|
|
2
2
|
import { lstatSync, mkdirSync, readdirSync, readFileSync, realpath as realpathWalk, realpathSync, statSync, } from "node:fs";
|
|
3
|
-
import { mkdir, realpath as realpathNative } from "node:fs/promises";
|
|
3
|
+
import { mkdir, realpath as realpathNative, stat as statAsync } from "node:fs/promises";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
5
|
import { isWithinProjectRoot } from "@hyperframes/parsers/asset-resolution";
|
|
6
6
|
import { projectPathSegments } from "@hyperframes/parsers/private-path";
|
|
@@ -260,6 +260,15 @@ export function folderGone(dir) {
|
|
|
260
260
|
return false;
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
+
async function folderGoneAsync(dir) {
|
|
264
|
+
try {
|
|
265
|
+
await statAsync(dir);
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
catch (error) {
|
|
269
|
+
return isMissing(error);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
263
272
|
/** The project folder's real path; ProjectRootMissingError when it is gone. */
|
|
264
273
|
export function realProjectRoot(root) {
|
|
265
274
|
try {
|
|
@@ -276,7 +285,7 @@ export function realProjectRoot(root) {
|
|
|
276
285
|
* A `dir` outside `root` is created recursively, but only while `root` exists.
|
|
277
286
|
*/
|
|
278
287
|
export function mkdirWithinProject(root, dir) {
|
|
279
|
-
const folders = foldersToMake(root, dir);
|
|
288
|
+
const folders = foldersToMake(root, dir, folderGone(root));
|
|
280
289
|
if (folders === null) {
|
|
281
290
|
mkdirSync(dir, { recursive: true });
|
|
282
291
|
return;
|
|
@@ -286,13 +295,13 @@ export function mkdirWithinProject(root, dir) {
|
|
|
286
295
|
mkdirSync(path);
|
|
287
296
|
}
|
|
288
297
|
catch (error) {
|
|
289
|
-
madeOrThrow(root, error);
|
|
298
|
+
madeOrThrow(root, error, isMissing(error) && folderGone(root));
|
|
290
299
|
}
|
|
291
300
|
}
|
|
292
301
|
}
|
|
293
302
|
/** {@link mkdirWithinProject} on fs/promises: a write the drive never answers holds a pool thread, not the caller's. */
|
|
294
303
|
export async function mkdirWithinProjectAsync(root, dir) {
|
|
295
|
-
const folders = foldersToMake(root, dir);
|
|
304
|
+
const folders = foldersToMake(root, dir, await folderGoneAsync(root));
|
|
296
305
|
if (folders === null) {
|
|
297
306
|
await mkdir(dir, { recursive: true });
|
|
298
307
|
return;
|
|
@@ -302,13 +311,13 @@ export async function mkdirWithinProjectAsync(root, dir) {
|
|
|
302
311
|
await mkdir(path);
|
|
303
312
|
}
|
|
304
313
|
catch (error) {
|
|
305
|
-
madeOrThrow(root, error);
|
|
314
|
+
madeOrThrow(root, error, isMissing(error) && (await folderGoneAsync(root)));
|
|
306
315
|
}
|
|
307
316
|
}
|
|
308
317
|
}
|
|
309
318
|
/** Each folder from below `root` down to `dir`, or null when `dir` is outside `root`. */
|
|
310
|
-
function foldersToMake(root, dir) {
|
|
311
|
-
if (
|
|
319
|
+
function foldersToMake(root, dir, rootGone) {
|
|
320
|
+
if (rootGone)
|
|
312
321
|
throw new ProjectRootMissingError(root);
|
|
313
322
|
const inside = relative(resolve(root), resolve(dir));
|
|
314
323
|
if (inside === ".." || inside.startsWith(`..${sep}`) || isAbsolute(inside))
|
|
@@ -319,13 +328,13 @@ function foldersToMake(root, dir) {
|
|
|
319
328
|
.filter(Boolean)
|
|
320
329
|
.map((part) => (path = join(path, part)));
|
|
321
330
|
}
|
|
322
|
-
function madeOrThrow(root, error) {
|
|
323
|
-
|
|
324
|
-
if (code === "ENOENT" && folderGone(root))
|
|
331
|
+
function madeOrThrow(root, error, rootGone) {
|
|
332
|
+
if (rootGone)
|
|
325
333
|
throw new ProjectRootMissingError(root);
|
|
326
|
-
if (code !== "EEXIST")
|
|
334
|
+
if (error.code !== "EEXIST")
|
|
327
335
|
throw error;
|
|
328
336
|
}
|
|
337
|
+
const isMissing = (error) => error.code === "ENOENT";
|
|
329
338
|
/** The real path; for a path not there (yet, or any more), the nearest existing folder's real path plus the rest. */
|
|
330
339
|
export function realFilePath(filePath) {
|
|
331
340
|
try {
|
package/dist/terminalText.d.ts
CHANGED
package/dist/terminalText.js
CHANGED
|
@@ -13,6 +13,23 @@ export function terminalText(text) {
|
|
|
13
13
|
}
|
|
14
14
|
return shown;
|
|
15
15
|
}
|
|
16
|
+
export function quotedFilePath(path) {
|
|
17
|
+
let result = "";
|
|
18
|
+
for (const ch of JSON.stringify(path)) {
|
|
19
|
+
const code = ch.charCodeAt(0);
|
|
20
|
+
const escape = isControlCode(code) ||
|
|
21
|
+
reordersOrBreaksTextOnScreen(code) ||
|
|
22
|
+
/\p{Default_Ignorable_Code_Point}/u.test(ch) ||
|
|
23
|
+
ch.normalize("NFKC") !== ch;
|
|
24
|
+
if (escape) {
|
|
25
|
+
for (let index = 0; index < ch.length; index++)
|
|
26
|
+
result += `\\u${ch.charCodeAt(index).toString(16).padStart(4, "0")}`;
|
|
27
|
+
}
|
|
28
|
+
else
|
|
29
|
+
result += ch;
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
16
33
|
export function terminalLines(text) {
|
|
17
34
|
return text.split("\n").map(terminalText).join("\n");
|
|
18
35
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.97",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -369,6 +369,14 @@
|
|
|
369
369
|
"import": "./dist/runtime/mediaSteer.js",
|
|
370
370
|
"types": "./dist/runtime/mediaSteer.d.ts"
|
|
371
371
|
},
|
|
372
|
+
"./runtime/web-audio-transport": {
|
|
373
|
+
"import": "./dist/runtime/webAudioTransport.js",
|
|
374
|
+
"types": "./dist/runtime/webAudioTransport.d.ts"
|
|
375
|
+
},
|
|
376
|
+
"./runtime/decodes-first": {
|
|
377
|
+
"import": "./dist/runtime/decodesFirst.js",
|
|
378
|
+
"types": "./dist/runtime/decodesFirst.d.ts"
|
|
379
|
+
},
|
|
372
380
|
"./runtime/clip-reveal": {
|
|
373
381
|
"import": "./dist/runtime/clipReveal.js",
|
|
374
382
|
"types": "./dist/runtime/clipReveal.d.ts"
|
|
@@ -517,9 +525,9 @@
|
|
|
517
525
|
"linkedom": "^0.18.12",
|
|
518
526
|
"postcss": "^8.5.8",
|
|
519
527
|
"wawoff2": "^2.0.1",
|
|
520
|
-
"@hyperframes/
|
|
521
|
-
"@hyperframes/
|
|
522
|
-
"@hyperframes/studio-server": "0.9.
|
|
528
|
+
"@hyperframes/lint": "0.9.97",
|
|
529
|
+
"@hyperframes/parsers": "0.9.97",
|
|
530
|
+
"@hyperframes/studio-server": "0.9.97"
|
|
523
531
|
},
|
|
524
532
|
"devDependencies": {
|
|
525
533
|
"@fontsource/archivo-black": "^5.2.8",
|