@mengine/medeo-client 2.0.1-alpha.16 → 2.0.1-alpha.18
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/{document-ecRldQY4.js → document-yPiwEmkJ.js} +36 -24
- package/dist/{index-BZtSciyB.d.ts → index-C0uUWqkz.d.ts} +1 -1
- package/dist/index.d.ts +175 -394
- package/dist/index.js +69 -1422
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +4 -4
|
@@ -1460,9 +1460,9 @@ function emptyLaneTracks() {
|
|
|
1460
1460
|
* `Caption` declares `Sequence` on purpose: it owns the display timing of the
|
|
1461
1461
|
* one AudioScript segment it shows, which is what admits it into a Clip.
|
|
1462
1462
|
* `Voice` declares no `Sequence` — it is a timbre identity, not playable
|
|
1463
|
-
* content;
|
|
1463
|
+
* content; rendered speech is a `voiceover` entity.
|
|
1464
1464
|
*
|
|
1465
|
-
* `
|
|
1465
|
+
* `MediaFile` says only that an entity of that kind may be bound to stored bytes,
|
|
1466
1466
|
* and asks nothing of its payload. Which bytes, and which way the content
|
|
1467
1467
|
* flowed, is the `from-asset` / `to-asset` Relation's answer alone.
|
|
1468
1468
|
*/
|
|
@@ -1481,27 +1481,32 @@ const ENTITY_KINDS = Object.freeze({
|
|
|
1481
1481
|
"Sequence",
|
|
1482
1482
|
"Visual",
|
|
1483
1483
|
"Audible",
|
|
1484
|
-
"
|
|
1484
|
+
"MediaFile"
|
|
1485
1485
|
]),
|
|
1486
1486
|
audio: Object.freeze([
|
|
1487
1487
|
"Sequence",
|
|
1488
1488
|
"Audible",
|
|
1489
|
-
"
|
|
1489
|
+
"MediaFile"
|
|
1490
|
+
]),
|
|
1491
|
+
voiceover: Object.freeze([
|
|
1492
|
+
"Sequence",
|
|
1493
|
+
"Audible",
|
|
1494
|
+
"MediaFile"
|
|
1490
1495
|
]),
|
|
1491
1496
|
image: Object.freeze([
|
|
1492
1497
|
"Sequence",
|
|
1493
1498
|
"Visual",
|
|
1494
|
-
"
|
|
1499
|
+
"MediaFile"
|
|
1495
1500
|
]),
|
|
1496
1501
|
voice: Object.freeze(["Container", "IPBound"]),
|
|
1497
1502
|
"sequence-marker": Object.freeze([]),
|
|
1498
1503
|
viewport: Object.freeze([]),
|
|
1499
|
-
"audio-script": Object.freeze(["SegmentText", "
|
|
1500
|
-
"phonetic-script": Object.freeze(["SegmentText", "
|
|
1504
|
+
"audio-script": Object.freeze(["SegmentText", "MediaFile"]),
|
|
1505
|
+
"phonetic-script": Object.freeze(["SegmentText", "MediaFile"]),
|
|
1501
1506
|
caption: Object.freeze([
|
|
1502
1507
|
"SegmentText",
|
|
1503
1508
|
"Sequence",
|
|
1504
|
-
"
|
|
1509
|
+
"MediaFile"
|
|
1505
1510
|
])
|
|
1506
1511
|
});
|
|
1507
1512
|
/** What a known kind declares; extension kinds declare nothing through this table. */
|
|
@@ -1528,7 +1533,7 @@ function isSequenceFields(value) {
|
|
|
1528
1533
|
return duration === null || typeof duration === "number" && Number.isSafeInteger(duration) && duration > 0;
|
|
1529
1534
|
}
|
|
1530
1535
|
function isMediaAssetVariantKind(kind) {
|
|
1531
|
-
return kind === "video" || kind === "image" || kind === "audio";
|
|
1536
|
+
return kind === "video" || kind === "image" || kind === "audio" || kind === "voiceover";
|
|
1532
1537
|
}
|
|
1533
1538
|
function isKnownEntityKind(kind) {
|
|
1534
1539
|
return Object.hasOwn(ENTITY_KINDS, kind);
|
|
@@ -2463,7 +2468,7 @@ const markerContentRelationSpec = Object.freeze({
|
|
|
2463
2468
|
/**
|
|
2464
2469
|
* `from-asset(entity, asset)` — the entity was made from that stored resource.
|
|
2465
2470
|
*
|
|
2466
|
-
* Eligibility is declared: the non-Asset endpoint must carry the `
|
|
2471
|
+
* Eligibility is declared: the non-Asset endpoint must carry the `MediaFile` kind,
|
|
2467
2472
|
* which says an entity of that kind can be bound to stored bytes and asks
|
|
2468
2473
|
* nothing of its payload. The bytes stay named in exactly one place, so no
|
|
2469
2474
|
* entity copies the locator into its own row and one Asset can back several
|
|
@@ -2502,7 +2507,7 @@ const generatedRelationSpec = Object.freeze({
|
|
|
2502
2507
|
});
|
|
2503
2508
|
const captionAlignmentRelationSpec = Object.freeze({
|
|
2504
2509
|
kind: "caption-alignment",
|
|
2505
|
-
validateEndpoints: (endpoints) => hasKinds(endpoints, new Set(["caption"]), new Set(["
|
|
2510
|
+
validateEndpoints: (endpoints) => hasKinds(endpoints, new Set(["caption"]), new Set(["voiceover"])),
|
|
2506
2511
|
validateMetadata: isCaptionAlignmentMetadata
|
|
2507
2512
|
});
|
|
2508
2513
|
/** `clip-anchor(child, host)` means endpoint 0 follows endpoint 1. */
|
|
@@ -2512,28 +2517,36 @@ const clipAnchorRelationSpec = Object.freeze({
|
|
|
2512
2517
|
validateMetadata: isEmptyMetadata
|
|
2513
2518
|
});
|
|
2514
2519
|
/**
|
|
2515
|
-
* The
|
|
2516
|
-
*
|
|
2520
|
+
* The Voiceover and the PhoneticScript it was spoken from; kinds determine
|
|
2521
|
+
* roles regardless of endpoint positions.
|
|
2522
|
+
*
|
|
2523
|
+
* Every Voiceover must carry one: which words were said, and how, is the only
|
|
2524
|
+
* thing that makes speech reproducible, and a Voiceover that cannot answer it
|
|
2525
|
+
* is refused when its plan is built.
|
|
2517
2526
|
*/
|
|
2518
2527
|
const phoneticScriptRenderRelationSpec = Object.freeze({
|
|
2519
2528
|
kind: "phonetic-script-render",
|
|
2520
|
-
validateEndpoints: (endpoints) => hasKinds(endpoints, new Set(["
|
|
2529
|
+
validateEndpoints: (endpoints) => hasKinds(endpoints, new Set(["voiceover"]), new Set(["phonetic-script"])),
|
|
2521
2530
|
validateMetadata: isEmptyMetadata
|
|
2522
2531
|
});
|
|
2523
2532
|
/**
|
|
2524
|
-
* The timbre identity a
|
|
2525
|
-
*
|
|
2526
|
-
*
|
|
2533
|
+
* The timbre identity a Voiceover was synthesized with. Voice stays an
|
|
2534
|
+
* identity: it never carries the audio itself, so the link between the two is a
|
|
2535
|
+
* Relation rather than one shared entity, and several takes can name one voice.
|
|
2527
2536
|
*/
|
|
2528
2537
|
const voiceTimbreRelationSpec = Object.freeze({
|
|
2529
2538
|
kind: "voice-timbre",
|
|
2530
|
-
validateEndpoints: (endpoints) => hasKinds(endpoints, new Set(["
|
|
2539
|
+
validateEndpoints: (endpoints) => hasKinds(endpoints, new Set(["voiceover"]), new Set(["voice"])),
|
|
2531
2540
|
validateMetadata: isEmptyMetadata
|
|
2532
2541
|
});
|
|
2533
2542
|
/** AudioScript was transcribed from Audio, Video, or recorded Voice; kinds determine roles. */
|
|
2534
2543
|
const audioScriptSourceRelationSpec = Object.freeze({
|
|
2535
2544
|
kind: "audio-script-source",
|
|
2536
|
-
validateEndpoints: (endpoints) => hasKinds(endpoints, new Set(["audio-script"]), new Set([
|
|
2545
|
+
validateEndpoints: (endpoints) => hasKinds(endpoints, new Set(["audio-script"]), new Set([
|
|
2546
|
+
"audio",
|
|
2547
|
+
"voiceover",
|
|
2548
|
+
"video"
|
|
2549
|
+
])),
|
|
2537
2550
|
validateMetadata: isEmptyMetadata
|
|
2538
2551
|
});
|
|
2539
2552
|
/**
|
|
@@ -2590,10 +2603,10 @@ function hasExactlyOneAsset(endpoints) {
|
|
|
2590
2603
|
const kinds = endpoints.map((endpoint) => endpoint.current().entityKind);
|
|
2591
2604
|
const assets = kinds.map((kind) => kind === "asset");
|
|
2592
2605
|
if (assets[0] === assets[1]) return false;
|
|
2593
|
-
return declaresKind(assets[0] ? kinds[1] : kinds[0], "
|
|
2606
|
+
return declaresKind(assets[0] ? kinds[1] : kinds[0], "MediaFile");
|
|
2594
2607
|
}
|
|
2595
2608
|
function isGeneratedMedia(entity) {
|
|
2596
|
-
return entity.entityKind === "video" || entity.entityKind === "image" || entity.entityKind === "audio";
|
|
2609
|
+
return entity.entityKind === "video" || entity.entityKind === "image" || entity.entityKind === "audio" || entity.entityKind === "voiceover";
|
|
2597
2610
|
}
|
|
2598
2611
|
function isEmptyMetadata(value) {
|
|
2599
2612
|
return isJsonObject(value) && Object.keys(value).length === 0;
|
|
@@ -2782,7 +2795,6 @@ var InvalidEntityRelationRowsError = class extends Error {
|
|
|
2782
2795
|
this.name = "InvalidEntityRelationRowsError";
|
|
2783
2796
|
}
|
|
2784
2797
|
};
|
|
2785
|
-
/** Decodes database rows into flat entities and validates the complete relation set. */
|
|
2786
2798
|
function decodeEntityRelationRows(rows, options) {
|
|
2787
2799
|
const issues = [];
|
|
2788
2800
|
const entitiesById = /* @__PURE__ */ new Map();
|
|
@@ -3023,7 +3035,7 @@ function resolveGraphLayout(graph) {
|
|
|
3023
3035
|
if (clip.entityKind !== "clip" || graph.adjacent(clip.entityId, "track-clip").length !== 1) fail(`Clip ${clip.entityId} must belong to exactly one Track`);
|
|
3024
3036
|
const marker = graph.one(clip.entityId, "clip-marker", "sequence-marker");
|
|
3025
3037
|
const content = graph.one(marker.entityId, "marker-content");
|
|
3026
|
-
if (!(typedRole === "video_clip" ? ["image", "video"] : typedRole === "speech" ? ["
|
|
3038
|
+
if (!(typedRole === "video_clip" ? ["image", "video"] : typedRole === "speech" ? ["voiceover"] : typedRole === "caption" ? ["caption"] : ["audio"]).includes(content.entityKind)) fail(`unsupported compatibility content kind ${content.entityKind} on ${typedRole} Track`);
|
|
3027
3039
|
const source = range(marker.payload.sourceRange, "sourceRange");
|
|
3028
3040
|
const durationFact = marker.payload.duration;
|
|
3029
3041
|
if (!object(durationFact)) fail(`Marker ${marker.entityId} requires duration`);
|
|
@@ -4715,4 +4727,4 @@ function createPlainMemoryAdapter(document, options) {
|
|
|
4715
4727
|
return new PlainMemoryAdapter(document, options);
|
|
4716
4728
|
}
|
|
4717
4729
|
//#endregion
|
|
4718
|
-
export {
|
|
4730
|
+
export { partUnionSchema as $, decodeEntityRelationRows as A, isJsonObject as B, applyFieldChanges as C, recordEntries as Ct, EntityProjectionGraph as D, projectEntityTimeline as E, bytesToBase64 as Et, assembleScriptText as F, buildInitialVideoDocument as G, createRelationId as H, findComposedAudioScript as I, fromVideoDocument as J, buildSpeechHostMap as K, selectAudioScriptSegment as L, assembleCaptionContent as M, assembleEntityContent as N, resolveEntityTimelineLayout as O, assemblePhoneticScriptContent as P, validateVideoDocument as Q, updateEntityFields as R, equalJson as S, partUnionToDraft as St, resolveFieldPath as T, base64ToBytes as Tt, hasSequence as U, createEntityId as V, isMediaAssetVariantKind as W, VideoDocumentValidationError as X, toVideoDocument as Y, assertValidVideoDocument as Z, audioScriptAssetOf as _, partDurationMs as _t, createMirrorVideoDocument as a, laneTrackId as at, phoneticScriptAssetOf as b, effectiveVideoClipDurationMs as bt, DocumentMutationGuard as c, arrangeMainTrackSeamlessly as ct, LoroEntityDraft as d, recalculateTimelineDuration as dt, videoDocumentSchema as et, readEntityDocument as f, resolveAllSpeechOverlaps as ft, audioScriptAssetHash as g, isEmptyVideoClip as gt, audioScriptAssetFields as h, TIMELINE_SKELETON_DURATION_MS as ht, MirrorVideoDocumentAdapter as i, hasResolvedPlacement as it, ScriptCompositionError as j, EntityTimelineProjectionError as k, LORO_ENTITY_SCHEMA as l, fillMainTrackTimeGaps as lt, audioScriptAssetContent as m, syncAggregatedClipsTimePosition as mt, createPlainMemoryAdapter as n, ensureLaneTrack as nt, createMirrorVideoDocumentAdapter as o, solveVideoDocument as ot, entityOrderGroups as p, resolveSpeechOverlapByShiftingVideos as pt, derivePositionFromAbs as q, generatePartId as r, findLaneTrack as rt, readVideoDocumentFromDraft as s, cascadeAfterVideoClipChanges as st, PlainMemoryAdapter as t, LANE_KINDS_IN_STACK_ORDER as tt, LoroEntityDocument as u, reassignSpeechesToVideoClipsByTime as ut, phoneticScriptAssetContent as v, safeDurationMs as vt, assertFieldChanges as w, videoDocumentMirrorSchema as wt, scriptSourceAssetOf as x, speedOf as xt, phoneticScriptAssetHash as y, DEFAULT_UNIT_TIME_MS as yt, variantBaseEntityIds as z };
|
|
@@ -1037,7 +1037,7 @@ type JsonObject = {
|
|
|
1037
1037
|
};
|
|
1038
1038
|
//#endregion
|
|
1039
1039
|
//#region ../medeo-dsl/src/entities.d.ts
|
|
1040
|
-
type KnownEntityKind = 'axvideo' | 'timeline' | 'track' | 'clip' | 'asset' | 'video' | 'audio' | 'voice' | 'image' | 'sequence-marker' | 'viewport' | 'audio-script' | 'phonetic-script' | 'caption';
|
|
1040
|
+
type KnownEntityKind = 'axvideo' | 'timeline' | 'track' | 'clip' | 'asset' | 'video' | 'audio' | 'voiceover' | 'voice' | 'image' | 'sequence-marker' | 'viewport' | 'audio-script' | 'phonetic-script' | 'caption';
|
|
1041
1041
|
declare const extensionEntityKindBrand: unique symbol;
|
|
1042
1042
|
type ExtensionEntityKind = string & {
|
|
1043
1043
|
readonly [extensionEntityKindBrand]: 'ExtensionEntityKind';
|