@mengine/medeo-client 2.0.1-alpha.23 → 2.0.1-alpha.24
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-7Vi1AeQc.js → document-Ct11SMBS.js} +315 -482
- package/dist/{index-mGObzOh4.d.ts → index-CcIoMxs1.d.ts} +88 -376
- package/dist/index.d.ts +39 -77
- package/dist/index.js +241 -557
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as index_d_exports } from "./index-CMa6ZCtX.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as derivePositionFromAbs, A as assertValidVideoDocument, At as VideoDraftContent, B as EntityRow, Bt as Track$1, C as isImplementedSemanticOpKind, Ct as TrackItem, D as PartIdFactory, Dt as VideoDocumentValidationIssue, E as ValidationError, Et as VideoDocument, F as ResolvedEntityTrack, Ft as CaptionPart$1, G as VoiceDescriptor, H as CaptionSegmentSelection, I as resolveEntityTimelineLayout, It as CaptionStyle, J as EntityId, K as JsonObject, L as projectEntityTimeline, Lt as PartAggregation, M as EntityTimelineTrackRole, Mt as effectiveVideoClipDurationMs, N as ResolvedEntityClipPlacement, Nt as speedOf, O as generatePartId, Ot as VideoDocumentValidationIssueCode, P as ResolvedEntityTimelineLayout, Pt as Attachment, Q as buildSpeechHostMap, R as EntityTimelineProjectionError, Rt as SpeedShift, S as SemanticOpKind, St as Track, T as SnapshotReadable, Tt as VideoClipPart, U as CaptionStyleFields, V as RelationRow, Vt as TrackItem$1, W as ScriptTextSegment, X as DerivedItemPosition, Y as buildInitialVideoDocument, Z as SpeechHostMap, _ as SemanticOpName, _t as DEFAULT_UNIT_TIME_MS, a as PlainMemoryAdapter, at as ensureLaneTrack, b as ImplementedSemanticOpKind, bt as SpeechPart, c as MirrorVideoDocumentAdapter, ct as solveVideoDocument, d as createMirrorVideoDocumentAdapter, dt as VideoDocumentDraft, et as fromVideoDocument, f as CommitOptions, ft as VideoDocumentMirrorSchema, g as SemanticOpInput, gt as CaptionPart, h as SemanticEditor, ht as CaptionDisplayCue, i as JournalEntry, it as SolvedVideoDocument, j as validateVideoDocument, jt as VideoDraftPartUnion, k as VideoDocumentValidationError, kt as VideoDraft, l as MirrorVideoDocumentOptions, lt as TrackDraft, m as SemanticDocumentAdapter, mt as BgmPart, n as videoDocumentSchema, nt as LANE_KINDS_IN_STACK_ORDER, o as PlainMemoryAdapterOptions, ot as findLaneTrack, p as OpActor, pt as videoDocumentMirrorSchema, q as JsonValue, r as readVideoDocumentFromDraft, rt as LaneKind, s as createPlainMemoryAdapter, st as laneTrackId, t as partUnionSchema, tt as toVideoDocument, u as createMirrorVideoDocument, ut as TrackItemDraft, v as TransactAudit, vt as PartKind, w as SchemaValidator, wt as TrackItemTimePosition, x as PlannedSemanticOpKind, xt as Timeline, y as IMPLEMENTED_SEMANTIC_OP_KINDS, yt as PartUnion, z as EntityRelationRows, zt as Timeline$1 } from "./index-CcIoMxs1.js";
|
|
3
3
|
import { LoroDoc, PeerID } from "loro-crdt";
|
|
4
4
|
import { DocState } from "@mengine/sync";
|
|
5
5
|
import { BaseDocStorage, Connection, DocDiff, DocPushReceipt, DocSnapshotRecord, DocStorage, DocStorageOptions, DocUpdate, DocUpdateRecord } from "@mengine/storage";
|
|
@@ -291,7 +291,7 @@ interface AudioMediaAssetFact {
|
|
|
291
291
|
interface VoiceoverMediaAssetFact {
|
|
292
292
|
/** Stable external speech result id, independent of the placed Clip id. */
|
|
293
293
|
readonly assetId: string;
|
|
294
|
-
readonly kind: 'voiceover';
|
|
294
|
+
readonly kind: 'voiceover-recording';
|
|
295
295
|
readonly durationMs: number;
|
|
296
296
|
readonly storageKey: string;
|
|
297
297
|
/**
|
|
@@ -305,22 +305,23 @@ interface VoiceoverMediaAssetFact {
|
|
|
305
305
|
}
|
|
306
306
|
/** Facts resolved from media storage. A trim window never substitutes for intrinsic duration. */
|
|
307
307
|
type MediaAssetFact = ImageMediaAssetFact | VideoMediaAssetFact | AudioMediaAssetFact | VoiceoverMediaAssetFact;
|
|
308
|
+
/** Where a Clip starts: in flow by order, or at a stated start on its Track or inside its host. */
|
|
308
309
|
type ClipPlacement = {
|
|
309
310
|
readonly kind: 'sequential';
|
|
310
311
|
readonly order: number;
|
|
311
312
|
} | {
|
|
312
313
|
readonly kind: 'absolute';
|
|
313
|
-
readonly
|
|
314
|
+
readonly startMs: number;
|
|
314
315
|
} | {
|
|
315
316
|
readonly kind: 'anchored';
|
|
316
317
|
readonly hostClipEntityId: string;
|
|
317
|
-
readonly
|
|
318
|
+
readonly startMs: number;
|
|
318
319
|
};
|
|
319
320
|
interface InsertPlacedClipInput {
|
|
320
321
|
readonly trackEntityId: string;
|
|
321
322
|
readonly contentEntityId: string;
|
|
322
|
-
readonly
|
|
323
|
-
readonly
|
|
323
|
+
readonly inMs: number;
|
|
324
|
+
readonly outMs: number;
|
|
324
325
|
readonly placement: ClipPlacement;
|
|
325
326
|
readonly clipPayload?: JsonObject;
|
|
326
327
|
/** Stable caller-owned placement identity, when one already exists outside the graph. */
|
|
@@ -374,31 +375,34 @@ type VoiceoverTakeInput = {
|
|
|
374
375
|
} & ({
|
|
375
376
|
readonly placement: ClipPlacement;
|
|
376
377
|
readonly hostClipEntityId?: never;
|
|
377
|
-
readonly
|
|
378
|
+
readonly startMs?: never;
|
|
378
379
|
} | {
|
|
379
380
|
readonly placement?: never;
|
|
380
381
|
readonly hostClipEntityId: string;
|
|
381
|
-
readonly
|
|
382
|
+
readonly startMs: number;
|
|
382
383
|
});
|
|
383
384
|
type VisualMediaAssetFact = ImageMediaAssetFact | VideoMediaAssetFact;
|
|
384
385
|
interface InsertMediaClipInput {
|
|
385
386
|
readonly timelineEntityId: string;
|
|
386
387
|
readonly clipEntityId?: string;
|
|
387
388
|
readonly media: VisualMediaAssetFact;
|
|
388
|
-
/**
|
|
389
|
-
readonly
|
|
389
|
+
/** Window on the source, whole milliseconds. An Image uses it as its finite display span. */
|
|
390
|
+
readonly inMs: number;
|
|
391
|
+
readonly outMs: number;
|
|
390
392
|
readonly placement: ClipPlacement;
|
|
391
393
|
readonly volume?: number;
|
|
392
394
|
}
|
|
393
395
|
interface ReplaceMediaClipInput {
|
|
394
396
|
readonly clipEntityId: string;
|
|
395
397
|
readonly media: VisualMediaAssetFact;
|
|
396
|
-
readonly
|
|
398
|
+
readonly inMs: number;
|
|
399
|
+
readonly outMs: number;
|
|
397
400
|
}
|
|
398
401
|
interface ReplacementMediaClipInput {
|
|
399
402
|
readonly clipEntityId?: string;
|
|
400
403
|
readonly media: VisualMediaAssetFact;
|
|
401
|
-
readonly
|
|
404
|
+
readonly inMs: number;
|
|
405
|
+
readonly outMs: number;
|
|
402
406
|
readonly volume?: number;
|
|
403
407
|
}
|
|
404
408
|
type MediaClipInsertion = {
|
|
@@ -435,11 +439,13 @@ interface LinearClipSpeed {
|
|
|
435
439
|
}
|
|
436
440
|
interface SetClipSpeedInput {
|
|
437
441
|
readonly clipEntityId: string;
|
|
438
|
-
|
|
442
|
+
/** Linear speed; null restores the source's own pace. */
|
|
443
|
+
readonly rate: number | null;
|
|
439
444
|
}
|
|
440
445
|
interface TrimClipInput {
|
|
441
446
|
readonly clipEntityId: string;
|
|
442
|
-
readonly
|
|
447
|
+
readonly inMs: number;
|
|
448
|
+
readonly outMs: number;
|
|
443
449
|
}
|
|
444
450
|
interface VoiceoverTakeResult {
|
|
445
451
|
readonly voiceoverClipEntityId: string;
|
|
@@ -497,19 +503,21 @@ interface InsertClipInput {
|
|
|
497
503
|
readonly trackEntityId: string;
|
|
498
504
|
/** Existing Sequence media Entity id. Asset ids and URLs are not content ids. */
|
|
499
505
|
readonly contentEntityId: string;
|
|
500
|
-
readonly
|
|
501
|
-
readonly
|
|
502
|
-
readonly
|
|
506
|
+
readonly inMs: number;
|
|
507
|
+
readonly outMs: number;
|
|
508
|
+
readonly startMs?: number;
|
|
509
|
+
/** Where among its Track's Clips it lands; appended when omitted. */
|
|
510
|
+
readonly order?: number;
|
|
503
511
|
readonly clipPayload?: JsonObject;
|
|
504
512
|
}
|
|
505
513
|
interface UpdateClipMarkerInput {
|
|
506
514
|
readonly clipEntityId: string;
|
|
507
|
-
readonly
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
readonly
|
|
511
|
-
/** Passing `undefined` explicitly removes the optional
|
|
512
|
-
readonly
|
|
515
|
+
readonly inMs?: number;
|
|
516
|
+
readonly outMs?: number;
|
|
517
|
+
/** Passing `undefined` explicitly removes the optional start. */
|
|
518
|
+
readonly startMs?: number | undefined;
|
|
519
|
+
/** Passing `undefined` explicitly removes the optional rate. */
|
|
520
|
+
readonly rate?: number | undefined;
|
|
513
521
|
}
|
|
514
522
|
interface MoveClipInput {
|
|
515
523
|
readonly clipEntityId: string;
|
|
@@ -519,10 +527,10 @@ interface ReplaceClipContentInput {
|
|
|
519
527
|
readonly clipEntityId: string;
|
|
520
528
|
/** Existing Sequence media Entity id. Asset ids and URLs are not content ids. */
|
|
521
529
|
readonly contentEntityId: string;
|
|
522
|
-
readonly
|
|
523
|
-
readonly
|
|
524
|
-
readonly
|
|
525
|
-
readonly
|
|
530
|
+
readonly inMs: number;
|
|
531
|
+
readonly outMs: number;
|
|
532
|
+
readonly startMs?: number;
|
|
533
|
+
readonly rate?: number;
|
|
526
534
|
}
|
|
527
535
|
interface DeleteClipInput {
|
|
528
536
|
readonly clipEntityId: string;
|
|
@@ -583,10 +591,11 @@ declare class EntityTimelineEditor {
|
|
|
583
591
|
private ensureRoleTrack;
|
|
584
592
|
/** The existing pronunciation variant a voiceover consumes; composition is required. */
|
|
585
593
|
private requireComposedPhoneticScript;
|
|
586
|
-
/** Preserve the factual synthesis input
|
|
594
|
+
/** Preserve the factual synthesis input, regardless of persisted endpoint positions. */
|
|
587
595
|
private ensurePhoneticRender;
|
|
588
596
|
private reconcileVoiceoverCaptions;
|
|
589
597
|
private ensureRoleTrackForClip;
|
|
598
|
+
private replaceCaptionAlignment;
|
|
590
599
|
/**
|
|
591
600
|
* Remove one placed Caption use. The composed AudioScript outlives the
|
|
592
601
|
* caption: it may anchor further captions and remains the text owner.
|
|
@@ -607,35 +616,6 @@ declare class EntityTimelineEditor {
|
|
|
607
616
|
private mintRelationId;
|
|
608
617
|
}
|
|
609
618
|
//#endregion
|
|
610
|
-
//#region src/entity-editor/revise-audio-script.d.ts
|
|
611
|
-
interface ReviseAudioScriptInput {
|
|
612
|
-
readonly editId: string;
|
|
613
|
-
readonly sourceAudioScriptEntityId: string;
|
|
614
|
-
readonly edits: readonly {
|
|
615
|
-
readonly segmentId: string;
|
|
616
|
-
readonly text: string;
|
|
617
|
-
}[];
|
|
618
|
-
readonly captionUsages?: readonly {
|
|
619
|
-
readonly clipEntityId: string;
|
|
620
|
-
readonly captionEntityId: string;
|
|
621
|
-
readonly markerEntityId: string;
|
|
622
|
-
readonly selection?: CaptionSegmentSelection;
|
|
623
|
-
}[];
|
|
624
|
-
}
|
|
625
|
-
interface ReviseAudioScriptResult {
|
|
626
|
-
readonly rows: EntityRelationRows;
|
|
627
|
-
readonly audioScriptEntityId: string;
|
|
628
|
-
readonly captionUsages: readonly {
|
|
629
|
-
readonly clipEntityId: string;
|
|
630
|
-
readonly previousCaptionEntityId: string;
|
|
631
|
-
readonly captionEntityId: string;
|
|
632
|
-
readonly markerEntityId: string;
|
|
633
|
-
}[];
|
|
634
|
-
readonly changed: boolean;
|
|
635
|
-
}
|
|
636
|
-
/** Revise text as an independent authored document, never as a version-family mutation. */
|
|
637
|
-
declare function reviseAudioScript(rows: EntityRelationRows, input: ReviseAudioScriptInput): ReviseAudioScriptResult;
|
|
638
|
-
//#endregion
|
|
639
619
|
//#region src/entity-editor/editor-resources.d.ts
|
|
640
620
|
declare const roleOrder: {
|
|
641
621
|
readonly caption: 0;
|
|
@@ -774,12 +754,6 @@ interface EntityDocumentState {
|
|
|
774
754
|
readonly rows: EntityRelationRows;
|
|
775
755
|
readonly project: Readonly<Record<string, string>>;
|
|
776
756
|
}
|
|
777
|
-
/** One stable native relation root, including records tombstoned from the active projection. */
|
|
778
|
-
interface EntityRelationRecord extends RelationRow {
|
|
779
|
-
readonly deleted: boolean;
|
|
780
|
-
}
|
|
781
|
-
/** Read persisted relation roots before current entity versions are projected. */
|
|
782
|
-
declare function readEntityRelationRecords(doc: LoroDoc): readonly EntityRelationRecord[];
|
|
783
757
|
type Command = {
|
|
784
758
|
type: 'create';
|
|
785
759
|
row: EntityRow;
|
|
@@ -884,19 +858,7 @@ declare class LoroEntityDraft {
|
|
|
884
858
|
delete(entityId: string): void;
|
|
885
859
|
attach(slot: string, entityId: string): void;
|
|
886
860
|
link(row: RelationRow): void;
|
|
887
|
-
|
|
888
|
-
relationId: RelationRow['relationId'];
|
|
889
|
-
outputEntityId: RelationRow['endpoint0EntityId'];
|
|
890
|
-
inputEntityId: RelationRow['endpoint1EntityId'];
|
|
891
|
-
trace?: JsonObject;
|
|
892
|
-
}): void;
|
|
893
|
-
linkClipAnchor(input: {
|
|
894
|
-
relationId: RelationRow['relationId'];
|
|
895
|
-
childClipEntityId: RelationRow['endpoint0EntityId'];
|
|
896
|
-
hostClipEntityId: RelationRow['endpoint1EntityId'];
|
|
897
|
-
trace?: JsonObject;
|
|
898
|
-
}): void;
|
|
899
|
-
patchRelationTrace(relationId: string, trace: JsonObject): void;
|
|
861
|
+
patchRelation(relationId: string, metadata: JsonObject, trace: JsonObject): void;
|
|
900
862
|
unlink(relationId: string): void;
|
|
901
863
|
private relationRoot;
|
|
902
864
|
update(entityId: string, fields: JsonObject): void;
|
|
@@ -1818,4 +1780,4 @@ declare function phoneticScriptAssetHash(rows: EntityRelationRows, entityId: str
|
|
|
1818
1780
|
/** The Asset a PhoneticScript was written out to, read from the graph. */
|
|
1819
1781
|
declare function phoneticScriptAssetOf(rows: EntityRelationRows, entityId: string): EntityRow | undefined;
|
|
1820
1782
|
//#endregion
|
|
1821
|
-
export { type Aggregation, type AssembledCaptionContent, type AssembledPhoneticScriptContent, type Attachment, type AudioMediaAssetFact, type BgmPart, type CaptionContentInput, type CaptionDisplayCue, type CaptionPart, type CaptionSegmentSelection, type CaptionStyle, type ClipEntityId, type ClipPlacement, type CommitOptions, DEFAULT_UNIT_TIME_MS, type DeleteBgmInput, type DeleteClipInput, type DeleteClipTreeInput, type DeleteVoiceoverInput, type DerivedItemPosition, type DocStorageLike, type DocVersionMark, type DocumentAudioScript, type DocumentAudioScriptState, type EditorFoundation, EntityDocumentState, type EntityGraphCommitOptions, EntityGraphHttpClient, type EntityGraphState,
|
|
1783
|
+
export { type Aggregation, type AssembledCaptionContent, type AssembledPhoneticScriptContent, type Attachment, type AudioMediaAssetFact, type BgmPart, type CaptionContentInput, type CaptionDisplayCue, type CaptionPart, type CaptionSegmentSelection, type CaptionStyle, type ClipEntityId, type ClipPlacement, type CommitOptions, DEFAULT_UNIT_TIME_MS, type DeleteBgmInput, type DeleteClipInput, type DeleteClipTreeInput, type DeleteVoiceoverInput, type DerivedItemPosition, type DocStorageLike, type DocVersionMark, type DocumentAudioScript, type DocumentAudioScriptState, type EditorFoundation, EntityDocumentState, type EntityGraphCommitOptions, EntityGraphHttpClient, type EntityGraphState, EntityTimelineEditor, type EntityTimelineIdFactory, EntityTimelineProjectionError, type EntityTimelineTrackRole, type FieldChange, type FieldPath, IMPLEMENTED_SEMANTIC_OP_KINDS, type ImageMediaAssetFact, type ImplementedSemanticOpKind, type ImportedMediaAsset, type InsertCaptionClipInput, type InsertClipInput, type InsertMediaClipInput, type InsertMediaClipsInput, type InsertPlacedClipInput, type JournalEntry, LANE_KINDS_IN_STACK_ORDER, LORO_ENTITY_SCHEMA, type LaneKind, type LinearClipSpeed, LoroEntityDocument, LoroEntityDraft, type MainClipRange, type MakeEmptyPart, ManualSyncDoc, type ManualSyncDocOptions, MedeoHttpDocStorage, type MedeoHttpDocStorageOptions, type MediaAssetFact, type MediaClipInsertion, MemoryDocStorage, MengineAckFailedError, type MengineAuditEntry, type MengineAuditResponse, MengineDocSession, type MengineDocSessionOptions, type MengineDocSessionUpdateEvent, type MengineDocSyncState, type MengineDocumentVersion, type MengineEventStreamOptions, MengineHttpClient, type MengineHttpClientOptions, MengineHttpRequestError, MenginePushRejectedError, type MenginePushResponse, type MenginePushUpdateResponse, type MengineRejectedResponse, type MengineSnapshotResponse, type MengineSseUpdateEvent, type MengineSyncResponse, type MengineUndoState, type MengineUpdateMeta, MirrorVideoDocumentAdapter, type MirrorVideoDocumentOptions, type MoveClipInput, type MoveClipsToStartsInput, type MoveSequentialClipsInput, type MoveVoiceoverInput, type OpActor, type PartAggregation, type PartIdFactory, type PartKind, type PartUnion, type PatchCaptionStyleInput, PlainMemoryAdapter, type PlainMemoryAdapterOptions, type PlannedSemanticOpKind, type PullFailureReason, type PullResult, type PushOutcome, type PushOutcomeKind, type PushResult, type PushResultKind, type ReplaceClipContentInput, type ReplaceMediaClipInput, type ReplaceSequentialClipsInput, type ReplacementMediaClipInput, type ResolvedEntityClipPlacement, type ResolvedEntityTimelineLayout, type ResolvedEntityTrack, SchemaValidator, ScriptCompositionError, type SemanticDocumentAdapter, SemanticEditor, type SemanticOpInput, type SemanticOpKind, type SemanticOpName, type SequentialClipAnchor, type SetBgmInput, type SetCaptionVisibilityInput, type SetClipPlacementInput, type SetClipSpeedInput, type SetClipVolumeInput, type SnapshotReadable, type SolvedVideoDocument, type SpeechHostMap, type SpeechPart, type SpeedShift, TIMELINE_SKELETON_DURATION_MS, type Timeline, type TimelineDoc, type TimelineItem, type Track, type TrackDraft, type TrackItem, type TrackItemDraft, type TrackItemTimePosition, type TransactAudit, type TrimClipInput, type UpdateClipInput, type UpdateClipMarkerInput, ValidationError, type VideoClipPart, type VideoDocument, type VideoDocumentDraft, type VideoDocumentMirrorSchema, VideoDocumentValidationError, type VideoDocumentValidationIssue, type VideoDocumentValidationIssueCode, type VideoDraft, type CaptionPart$1 as VideoDraftCaptionPart, type VideoDraftContent, type VideoDraftPartUnion, type Timeline$1 as VideoDraftTimeline, type Track$1 as VideoDraftTrack, type TrackItem$1 as VideoDraftTrackItem, type VideoMediaAssetFact, type VisualMediaAssetFact, type VoiceoverCaptionFact, type VoiceoverMediaAssetFact, type VoiceoverTakeInput, type VoiceoverTakeResult, type WaitForServerAckOptions, applyEntityRows, applyFieldChanges, arrangeMainTrackSeamlessly, assembleCaptionContent, assembleEntityContent, assemblePhoneticScriptContent, assembleScriptText, assertCanonicalEditorResources, assertEntityProjectionPreservesLegacy, assertFieldChanges, assertMediaAssetWritePolicy, assertValidVideoDocument, audioScriptAssetContent, audioScriptAssetFields, audioScriptAssetHash, audioScriptAssetOf, base64ToBytes, buildInitialVideoDocument, buildSpeechHostMap, bytesToBase64, cascadeAfterVideoClipChanges, compileEntityRows, createEditSandbox, createMirrorVideoDocument, createMirrorVideoDocumentAdapter, createPlainMemoryAdapter, decodeDocVersionMark, derivePositionFromAbs, effectiveVideoClipDurationMs, encodeDocVersionMark, ensureEditorFoundation, ensureLaneTrack, fillMainTrackTimeGaps, findComposedAudioScript, findLaneTrack, fromVideoDocument, generatePartId, getAt, hostForAbsMs, importMediaAsset, isEmptyVideoClip, isImplementedSemanticOpKind, isMap, laneTrackId, mainTrackRanges, migrateLegacyTimelineToEntities, partDurationMs, partUnionSchema, phoneticScriptAssetContent, phoneticScriptAssetHash, phoneticScriptAssetOf, prepareCaptionContent, projectEntityTimeline, readDocumentAudioScript, readEntityDocument, readMainTrackItems, readMengineEventStream, readPart, readPartDurationMs, readVideoDocumentFromDraft, reassignSpeechesToVideoClipsByTime, recalculateTimelineDuration, relativePositionForAbs, replayJournal, resolveAllSpeechOverlaps, resolveEntityTimelineLayout, resolveFieldPath, resolveSpeechOverlapByShiftingVideos, safeDurationMs, index_d_exports as schemas, scriptSourceAssetOf, selectAudioScriptSegment, snapshotToPlain, solveVideoDocument, speedOf, syncAggregatedClipsTimePosition, toVideoDocument, validateVideoDocument, videoDocumentMirrorSchema, videoDocumentSchema };
|