@mengine/medeo-client 2.1.1-dsl.14 → 2.1.1-dsl.15
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/{dsl-Co3RI5F1.js → dsl-Dw59o1t0.js} +36 -13
- package/dist/dsl.d.ts +2 -2
- package/dist/dsl.js +2 -2
- package/dist/{index-JWERGMrC.d.ts → index-Bt3RhxV4.d.ts} +9 -3
- package/dist/{index-DSpKN_ta.d.ts → index-CTai9I2R.d.ts} +25 -4
- package/dist/{index-DAfOkcnZ.d.ts → index-CwZ0zt-E.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/legacy.d.ts +2 -2
- package/dist/legacy.js +1 -1
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +2 -2
- package/dist/{video-draft-types-GqXnsOzA.d.ts → video-draft-types-BOdawmig.d.ts} +13 -2
- package/dist/{video-draft-types-BnbfWrBx.js → video-draft-types-DKo53mZ8.js} +38 -6
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as assertEntityPatch, A as getRootContainerByType, B as isValueOfContainerType, C as applyEncode, D as decodeNestedJsonValues, E as containerIdToContainerType, F as isArrayLike, G as tryUpdateToContainer, H as schemaToContainerType, I as isObject, J as getChildContainerSchema, K as valuesEqual, L as isObjectLike, M as hasTransform, N as inferContainerTypeFromValue, O as deepEqual, P as insertChildToMap, Q as assertEntity, R as isStateAndSchemaOfType, S as applyDecode, T as cidsEqual, U as stripUndefined, V as safeStringify, W as tryInferContainerType, X as getMapFieldSchema, Y as getChildSchema, Z as assertCaptionContent, _ as isLoroMovableListSchema, at as
|
|
1
|
+
import { $ as assertEntityPatch, A as getRootContainerByType, B as isValueOfContainerType, C as applyEncode, D as decodeNestedJsonValues, E as containerIdToContainerType, F as isArrayLike, G as tryUpdateToContainer, H as schemaToContainerType, I as isObject, J as getChildContainerSchema, K as valuesEqual, L as isObjectLike, M as hasTransform, N as inferContainerTypeFromValue, O as deepEqual, P as insertChildToMap, Q as assertEntity, R as isStateAndSchemaOfType, S as applyDecode, T as cidsEqual, U as stripUndefined, V as safeStringify, W as tryInferContainerType, X as getMapFieldSchema, Y as getChildSchema, Z as assertCaptionContent, _ as isLoroMovableListSchema, _t as resourceId, at as assertTimeAnchor, b as schemaContainsIgnoreField, c as isInvalidAtomic, ct as isRecord, d as schema, dt as relationTables, et as assertId, f as getDefaultValue, ft as validLanguage, g as isLoroMapSchema, gt as relationId, h as isLoroListSchema, ht as defaultIdFactory, it as assertScriptSegment, j as hardenCidDescriptors, k as defineCidProperty, l as phonemeCodec, lt as mergeFields, m as isListLikeSchema, mt as assertResourceIdentity, n as textStyles, nt as assertPhoneticScript, o as medeoDslLoroShape, ot as atomicFields, p as isContainerSchema, pt as assertRelationIdentity, q as CID_KEY, rt as assertRelation, s as captionContentCodec, st as entityTables, t as DEFAULT_UNIT_TIME_MS, tt as assertPhoneme, ut as patchRow, v as isLoroTreeSchema, w as applySchemaToInferOptions, x as validateSchema, y as isRootSchemaType, z as isTreeID } from "./video-draft-types-DKo53mZ8.js";
|
|
2
2
|
import { Cursor, LoroDoc, LoroList, LoroMap, LoroMovableList, LoroText, LoroTree, isContainer, isContainerId } from "loro-crdt";
|
|
3
3
|
import { Immer, setAutoFreeze } from "immer";
|
|
4
4
|
//#region ../medeo-dsl/src/text.ts
|
|
@@ -4408,7 +4408,10 @@ function applyMutations(tx, mutations) {
|
|
|
4408
4408
|
delete rows[m.table][m.id];
|
|
4409
4409
|
break;
|
|
4410
4410
|
case "insert-segment":
|
|
4411
|
-
tx.insertSegment(m.audioScriptId, m.segmentId, m.text, m.index
|
|
4411
|
+
tx.insertSegment(m.audioScriptId, m.segmentId, m.text, m.index, m.startMs === void 0 && m.endMs === void 0 ? void 0 : {
|
|
4412
|
+
startMs: m.startMs,
|
|
4413
|
+
endMs: m.endMs
|
|
4414
|
+
});
|
|
4412
4415
|
break;
|
|
4413
4416
|
case "move-segment":
|
|
4414
4417
|
tx.moveSegment(m.audioScriptId, m.segmentId, m.index);
|
|
@@ -4666,18 +4669,21 @@ function runTransaction(doc, mirror, edit, options, setReject) {
|
|
|
4666
4669
|
editCaptionText(captionId, edits, expectedBodyId) {
|
|
4667
4670
|
editBody({ captionId }, edits, expectedBodyId);
|
|
4668
4671
|
},
|
|
4669
|
-
insertSegment(audioScriptId, segmentId, text, index) {
|
|
4672
|
+
insertSegment(audioScriptId, segmentId, text, index, time) {
|
|
4670
4673
|
tracked.run(() => {
|
|
4671
4674
|
assertId(segmentId);
|
|
4672
4675
|
if (typeof text !== "string") throw new Error("Segment text is a string");
|
|
4676
|
+
const segment = {
|
|
4677
|
+
id: segmentId,
|
|
4678
|
+
text,
|
|
4679
|
+
...time
|
|
4680
|
+
};
|
|
4681
|
+
assertScriptSegment(segment);
|
|
4673
4682
|
const segments = segmentsOf(audioScriptId);
|
|
4674
4683
|
if (segments.some((segment) => segment.id === segmentId)) throw new Error(`Segment already exists: ${segmentId}`);
|
|
4675
4684
|
const at = index ?? segments.length;
|
|
4676
4685
|
if (!Number.isSafeInteger(at) || at < 0 || at > segments.length) throw new Error("Invalid segment index");
|
|
4677
|
-
segments.splice(at, 0,
|
|
4678
|
-
id: segmentId,
|
|
4679
|
-
text
|
|
4680
|
-
});
|
|
4686
|
+
segments.splice(at, 0, segment);
|
|
4681
4687
|
});
|
|
4682
4688
|
},
|
|
4683
4689
|
moveSegment(audioScriptId, segmentId, index) {
|
|
@@ -5099,13 +5105,14 @@ function toAudioScriptViews(snapshot) {
|
|
|
5099
5105
|
segments: script.segments.map((segment) => {
|
|
5100
5106
|
const rich = snapshot.richText[segment.id];
|
|
5101
5107
|
const language = rich ? markedLanguage(langsFromDelta(rich.delta)) : void 0;
|
|
5102
|
-
return
|
|
5103
|
-
id: segment.id,
|
|
5104
|
-
text: segment.text
|
|
5105
|
-
} : {
|
|
5108
|
+
return {
|
|
5106
5109
|
id: segment.id,
|
|
5107
5110
|
text: segment.text,
|
|
5108
|
-
language
|
|
5111
|
+
...language === void 0 ? {} : { language },
|
|
5112
|
+
...segment.startMs === void 0 ? {} : {
|
|
5113
|
+
startMs: segment.startMs,
|
|
5114
|
+
endMs: segment.endMs
|
|
5115
|
+
}
|
|
5109
5116
|
};
|
|
5110
5117
|
}),
|
|
5111
5118
|
sourceMediaIds: [],
|
|
@@ -5127,8 +5134,10 @@ function toAudioScriptViews(snapshot) {
|
|
|
5127
5134
|
...digest === void 0 ? {} : { digest }
|
|
5128
5135
|
});
|
|
5129
5136
|
}
|
|
5137
|
+
const layout = resolveDslLayout(snapshot);
|
|
5138
|
+
for (const view of views.values()) placeTranscript(snapshot, layout, view);
|
|
5130
5139
|
const timbres = Object.values(snapshot["voice-timbre-relations"]);
|
|
5131
|
-
for (const track of
|
|
5140
|
+
for (const track of layout.tracks) for (const { clipId } of track.clips) {
|
|
5132
5141
|
const source = snapshot["clip-entities"][clipId]?.source;
|
|
5133
5142
|
if (!source) continue;
|
|
5134
5143
|
if (snapshot["media-entities"][source]?.kind === "voiceover-recording") {
|
|
@@ -5169,6 +5178,20 @@ function toAudioScriptViews(snapshot) {
|
|
|
5169
5178
|
return [...views.values()];
|
|
5170
5179
|
}
|
|
5171
5180
|
/**
|
|
5181
|
+
* A transcript's segments on the Timeline: a segment's time is in the medium the script was read
|
|
5182
|
+
* off, so it lands where the earliest Clip playing that medium holds that moment in its window.
|
|
5183
|
+
*/
|
|
5184
|
+
function placeTranscript(snapshot, layout, view) {
|
|
5185
|
+
if (!view.sourceMediaIds.length) return;
|
|
5186
|
+
const plays = layout.tracks.flatMap((track) => track.clips).filter((clip) => view.sourceMediaIds.includes(snapshot["clip-entities"][clip.clipId]?.source ?? "")).sort((a, b) => a.startMs - b.startMs);
|
|
5187
|
+
for (const segment of view.segments) {
|
|
5188
|
+
const at = segment.startMs;
|
|
5189
|
+
if (at === void 0) continue;
|
|
5190
|
+
const clip = plays.find((c) => c.inMs <= at && at < c.outMs);
|
|
5191
|
+
if (clip) segment.timelineMs = Math.round(clip.startMs + (at - clip.inMs) / clip.rate);
|
|
5192
|
+
}
|
|
5193
|
+
}
|
|
5194
|
+
/**
|
|
5172
5195
|
* Whether a recording still matches what it was synthesized from: the digest its derived-from
|
|
5173
5196
|
* records against the source's file digest now. An AudioScript has no file, so a recording
|
|
5174
5197
|
* derived from a script directly is not judged.
|
package/dist/dsl.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as TextMutation, A as DeepReadonly, C as CaptionContent, D as Clip, E as CaptionText, F as EntityTables, G as ResourceSystem, H as RelationTable, I as EntityValues, K as RichTextSnapshot, L as FieldPatch, M as DslMutation, N as EntityMutation, O as ContainMutation, P as EntityTable, Q as TextMark, R as MedeoDslSnapshot, S as Caption, T as CaptionStyle, U as RelationTables, V as RelationMutation, W as RelationValues, X as TextDelta, Y as StoredFile, Z as TextEdit, _ as defaultIdFactory, a as VideoDraftCaptionStyle, b as tupleHash, c as VideoDraftInput, d as VideoDraftTrack, et as TextRun, f as VideoDraftTrackItem, g as EntityIdKind, h as DslIdFactory, i as VideoDraft, it as Voice, j as DslDiagnostic, k as ContainNode, l as VideoDraftPartUnion, m as OpActor, n as DEFAULT_UNIT_TIME_MS, nt as Track, o as VideoDraftContent, p as CommitOptions, r as VideoCreationSettings, rt as TrackRole, s as VideoDraftContentPartUnion, t as CaptionDisplayCue, tt as TimeAnchor, u as VideoDraftTimeline, v as relationId, w as CaptionSelection, x as AudioScript, y as resourceId, z as Media } from "./video-draft-types-
|
|
2
|
-
import { A as MedeoDslDraft, C as UnsupportedDocumentFormatError, D as captionContentCodec, E as InvalidAtomic, F as ClipSource, I as DslClipUpdate, L as MoveDslClipsInput, M as medeoDslLoroShape, N as AddDslClip, O as isInvalidAtomic, P as AddDslClipsInput, R as ReplaceDslClipsInput, S as DslTransaction, T as documentFormat, _ as VoiceoverCaptionInput, a as toAudioScriptViews, b as MedeoDsl, c as resolveDslLayout, d as DslProjectionError, f as DslTrackLayout, g as ApplyVoiceoverInput, h as UploadText, i as AudioScriptView, j as MedeoDslLoroState, k as timeAnchorCodec, l as DslClipLayout, m as DslEditor, n as ImportedVideoDraft, o as VideoDraftProjection, p as createInitialMedeoDsl, r as fromVideoDraft, s as toVideoDraft, t as FromVideoDraftOptions, u as DslLayout, v as VoiceoverResult, w as assertDslDocument, x as DslAudit, y as CreateMedeoDslOptions, z as ClipPlacement } from "./index-
|
|
1
|
+
import { $ as TextMutation, A as DeepReadonly, C as CaptionContent, D as Clip, E as CaptionText, F as EntityTables, G as ResourceSystem, H as RelationTable, I as EntityValues, K as RichTextSnapshot, L as FieldPatch, M as DslMutation, N as EntityMutation, O as ContainMutation, P as EntityTable, Q as TextMark, R as MedeoDslSnapshot, S as Caption, T as CaptionStyle, U as RelationTables, V as RelationMutation, W as RelationValues, X as TextDelta, Y as StoredFile, Z as TextEdit, _ as defaultIdFactory, a as VideoDraftCaptionStyle, b as tupleHash, c as VideoDraftInput, d as VideoDraftTrack, et as TextRun, f as VideoDraftTrackItem, g as EntityIdKind, h as DslIdFactory, i as VideoDraft, it as Voice, j as DslDiagnostic, k as ContainNode, l as VideoDraftPartUnion, m as OpActor, n as DEFAULT_UNIT_TIME_MS, nt as Track, o as VideoDraftContent, p as CommitOptions, r as VideoCreationSettings, rt as TrackRole, s as VideoDraftContentPartUnion, t as CaptionDisplayCue, tt as TimeAnchor, u as VideoDraftTimeline, v as relationId, w as CaptionSelection, x as AudioScript, y as resourceId, z as Media } from "./video-draft-types-BOdawmig.js";
|
|
2
|
+
import { A as MedeoDslDraft, C as UnsupportedDocumentFormatError, D as captionContentCodec, E as InvalidAtomic, F as ClipSource, I as DslClipUpdate, L as MoveDslClipsInput, M as medeoDslLoroShape, N as AddDslClip, O as isInvalidAtomic, P as AddDslClipsInput, R as ReplaceDslClipsInput, S as DslTransaction, T as documentFormat, _ as VoiceoverCaptionInput, a as toAudioScriptViews, b as MedeoDsl, c as resolveDslLayout, d as DslProjectionError, f as DslTrackLayout, g as ApplyVoiceoverInput, h as UploadText, i as AudioScriptView, j as MedeoDslLoroState, k as timeAnchorCodec, l as DslClipLayout, m as DslEditor, n as ImportedVideoDraft, o as VideoDraftProjection, p as createInitialMedeoDsl, r as fromVideoDraft, s as toVideoDraft, t as FromVideoDraftOptions, u as DslLayout, v as VoiceoverResult, w as assertDslDocument, x as DslAudit, y as CreateMedeoDslOptions, z as ClipPlacement } from "./index-CTai9I2R.js";
|
|
3
3
|
export { type AddDslClip, type AddDslClipsInput, type ApplyVoiceoverInput, type AudioScript, type AudioScriptView, type Caption, type CaptionContent, type CaptionDisplayCue, type CaptionSelection, type CaptionStyle, type CaptionText, type Clip, type ClipPlacement, type ClipSource, type CommitOptions, type ContainMutation, type ContainNode, type CreateMedeoDslOptions, DEFAULT_UNIT_TIME_MS, type DeepReadonly, type DslAudit, type DslClipLayout, type DslClipUpdate, type DslDiagnostic, DslEditor, type DslIdFactory, type DslLayout, type DslMutation, DslProjectionError, type DslTrackLayout, type DslTransaction, type EntityIdKind, type EntityMutation, type EntityTable, type EntityTables, type EntityValues, type FieldPatch, type FromVideoDraftOptions, type ImportedVideoDraft, type InvalidAtomic, MedeoDsl, type MedeoDslDraft, type MedeoDslLoroState, type MedeoDslSnapshot, type Media, type MoveDslClipsInput, type OpActor, type RelationMutation, type RelationTable, type RelationTables, type RelationValues, type ReplaceDslClipsInput, type ResourceSystem, type RichTextSnapshot, type StoredFile, type TextDelta, type TextEdit, type TextMark, type TextMutation, type TextRun, type TimeAnchor, type Track, type TrackRole, UnsupportedDocumentFormatError, type UploadText, type VideoCreationSettings, type VideoDraft, type VideoDraftCaptionStyle, type VideoDraftContent, type VideoDraftContentPartUnion, type VideoDraftInput, type VideoDraftPartUnion, type VideoDraftProjection, type VideoDraftTimeline, type VideoDraftTrack, type VideoDraftTrackItem, type Voice, type VoiceoverCaptionInput, type VoiceoverResult, assertDslDocument, captionContentCodec, createInitialMedeoDsl, defaultIdFactory, documentFormat, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
|
package/dist/dsl.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _t as
|
|
2
|
-
import { a as toAudioScriptViews, c as DslProjectionError, i as DslEditor, n as toVideoDraft, o as MedeoDsl, r as createInitialMedeoDsl, s as resolveDslLayout, t as fromVideoDraft } from "./dsl-
|
|
1
|
+
import { _t as resourceId, a as documentFormat, c as isInvalidAtomic, gt as relationId, ht as defaultIdFactory, i as assertDslDocument, o as medeoDslLoroShape, r as UnsupportedDocumentFormatError, s as captionContentCodec, t as DEFAULT_UNIT_TIME_MS, u as timeAnchorCodec, vt as tupleHash } from "./video-draft-types-DKo53mZ8.js";
|
|
2
|
+
import { a as toAudioScriptViews, c as DslProjectionError, i as DslEditor, n as toVideoDraft, o as MedeoDsl, r as createInitialMedeoDsl, s as resolveDslLayout, t as fromVideoDraft } from "./dsl-Dw59o1t0.js";
|
|
3
3
|
export { DEFAULT_UNIT_TIME_MS, DslEditor, DslProjectionError, MedeoDsl, UnsupportedDocumentFormatError, assertDslDocument, captionContentCodec, createInitialMedeoDsl, defaultIdFactory, documentFormat, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as ResourceSystem, R as MedeoDslSnapshot, rt as TrackRole } from "./video-draft-types-
|
|
2
|
-
import { b as MedeoDsl, h as UploadText, i as AudioScriptView, m as DslEditor, o as VideoDraftProjection } from "./index-
|
|
3
|
-
import { _ as ManualSyncTransport, a as MengineDocSessionOptions, g as ManualSyncDocOptions, n as DocumentSession, r as DocumentSessionUpdateEvent } from "./index-
|
|
1
|
+
import { G as ResourceSystem, R as MedeoDslSnapshot, rt as TrackRole } from "./video-draft-types-BOdawmig.js";
|
|
2
|
+
import { b as MedeoDsl, h as UploadText, i as AudioScriptView, m as DslEditor, o as VideoDraftProjection } from "./index-CTai9I2R.js";
|
|
3
|
+
import { _ as ManualSyncTransport, a as MengineDocSessionOptions, g as ManualSyncDocOptions, n as DocumentSession, r as DocumentSessionUpdateEvent } from "./index-CwZ0zt-E.js";
|
|
4
4
|
|
|
5
5
|
//#region src/manual-sync/manual-sync-doc.d.ts
|
|
6
6
|
/** Explicit synchronization over the same DSL/editor used by the live Session. */
|
|
@@ -69,8 +69,14 @@ declare class ManualSyncDoc extends ManualSyncTransport {
|
|
|
69
69
|
readonly segments: readonly {
|
|
70
70
|
readonly id: string;
|
|
71
71
|
readonly text: string;
|
|
72
|
+
readonly startMs?: number | undefined;
|
|
73
|
+
readonly endMs?: number | undefined;
|
|
72
74
|
}[];
|
|
73
75
|
readonly defaultLanguage?: string | undefined;
|
|
76
|
+
readonly system?: "memota" | undefined;
|
|
77
|
+
readonly key?: string | undefined;
|
|
78
|
+
readonly storageKey?: string | undefined;
|
|
79
|
+
readonly digest?: string | undefined;
|
|
74
80
|
};
|
|
75
81
|
};
|
|
76
82
|
readonly "phonetic-script-entities": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as PhonemeSelection, J as SegmentSelection, L as FieldPatch, M as DslMutation, R as MedeoDslSnapshot, T as CaptionStyle, Y as StoredFile, Z as TextEdit, c as VideoDraftInput, h as DslIdFactory, it as Voice, j as DslDiagnostic, o as VideoDraftContent, p as CommitOptions, q as SegmentRange, rt as TrackRole, tt as TimeAnchor, w as CaptionSelection, z as Media } from "./video-draft-types-
|
|
1
|
+
import { B as PhonemeSelection, J as SegmentSelection, L as FieldPatch, M as DslMutation, R as MedeoDslSnapshot, T as CaptionStyle, Y as StoredFile, Z as TextEdit, c as VideoDraftInput, h as DslIdFactory, it as Voice, j as DslDiagnostic, o as VideoDraftContent, p as CommitOptions, q as SegmentRange, rt as TrackRole, tt as TimeAnchor, w as CaptionSelection, z as Media } from "./video-draft-types-BOdawmig.js";
|
|
2
2
|
import { ContainerType, Cursor, LoroDoc, PeerID, TreeID } from "loro-crdt";
|
|
3
3
|
|
|
4
4
|
//#region src/dsl/action-context.d.ts
|
|
@@ -464,12 +464,20 @@ declare const medeoDslLoroShape: RootSchemaType<{
|
|
|
464
464
|
'audio-script-entities': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{
|
|
465
465
|
segments: /*elided*/any;
|
|
466
466
|
defaultLanguage: /*elided*/any;
|
|
467
|
+
system: /*elided*/any;
|
|
468
|
+
key: /*elided*/any;
|
|
469
|
+
storageKey: /*elided*/any;
|
|
470
|
+
digest: /*elided*/any;
|
|
467
471
|
}> & {
|
|
468
472
|
options: {};
|
|
469
473
|
} & {
|
|
470
474
|
catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<{
|
|
471
475
|
segments: /*elided*/any;
|
|
472
476
|
defaultLanguage: /*elided*/any;
|
|
477
|
+
system: /*elided*/any;
|
|
478
|
+
key: /*elided*/any;
|
|
479
|
+
storageKey: /*elided*/any;
|
|
480
|
+
digest: /*elided*/any;
|
|
473
481
|
}, C>;
|
|
474
482
|
}> & {
|
|
475
483
|
options: {};
|
|
@@ -629,8 +637,14 @@ interface DslTransaction {
|
|
|
629
637
|
/** Offsets use the preview after preceding edits. Existing Text identities are checked when supplied. */
|
|
630
638
|
editText(audioScriptId: string, segmentId: string, edits: readonly TextEdit[], expectedBodyId?: string): void;
|
|
631
639
|
editCaptionText(captionId: string, edits: readonly TextEdit[], expectedBodyId?: string): void;
|
|
632
|
-
/**
|
|
633
|
-
|
|
640
|
+
/**
|
|
641
|
+
* Adds a segment at `index` (the end by default); its id must be new to the script. A transcript's
|
|
642
|
+
* segment states where its words were spoken in the medium, as its transcription file gave them.
|
|
643
|
+
*/
|
|
644
|
+
insertSegment(audioScriptId: string, segmentId: string, text: string, index?: number, time?: {
|
|
645
|
+
startMs: number;
|
|
646
|
+
endMs: number;
|
|
647
|
+
}): void;
|
|
634
648
|
/** `index` is measured after removing the segment. */
|
|
635
649
|
moveSegment(audioScriptId: string, segmentId: string, index: number): void;
|
|
636
650
|
deleteSegment(audioScriptId: string, segmentId: string): void;
|
|
@@ -899,7 +913,14 @@ interface AudioScriptView {
|
|
|
899
913
|
segments: {
|
|
900
914
|
id: string;
|
|
901
915
|
text: string;
|
|
902
|
-
language?: string;
|
|
916
|
+
language?: string; /** A transcript's segment: where its words were spoken in the medium, as its transcription file gave them. */
|
|
917
|
+
startMs?: number;
|
|
918
|
+
endMs?: number;
|
|
919
|
+
/**
|
|
920
|
+
* Where that falls on the Timeline (D186): through the Clip playing the medium the script was
|
|
921
|
+
* read off whose window holds `startMs`. Absent when no Clip plays that moment.
|
|
922
|
+
*/
|
|
923
|
+
timelineMs?: number;
|
|
903
924
|
}[];
|
|
904
925
|
/** Media the script was read off (a transcript), through derived-from. */
|
|
905
926
|
sourceMediaIds: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as DslDiagnostic, o as VideoDraftContent, p as CommitOptions } from "./video-draft-types-
|
|
1
|
+
import { j as DslDiagnostic, o as VideoDraftContent, p as CommitOptions } from "./video-draft-types-BOdawmig.js";
|
|
2
2
|
import { LoroDoc, PeerID, VersionVector } from "loro-crdt";
|
|
3
3
|
import { DocState, LocalSaveState } from "@mengine/sync";
|
|
4
4
|
import { BaseDocStorage, Connection, DocDiff, DocPushReceipt, DocSnapshotRecord, DocStorage, DocStorageOptions, DocUpdate, DocUpdateRecord } from "@mengine/storage";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as TextMutation, A as DeepReadonly, C as CaptionContent, D as Clip, E as CaptionText, F as EntityTables, G as ResourceSystem, H as RelationTable, I as EntityValues, K as RichTextSnapshot, L as FieldPatch, M as DslMutation, N as EntityMutation, O as ContainMutation, P as EntityTable, Q as TextMark, R as MedeoDslSnapshot, S as Caption, T as CaptionStyle, U as RelationTables, V as RelationMutation, W as RelationValues, X as TextDelta, Y as StoredFile, Z as TextEdit, _ as defaultIdFactory, a as VideoDraftCaptionStyle, b as tupleHash, c as VideoDraftInput, d as VideoDraftTrack, et as TextRun, f as VideoDraftTrackItem, g as EntityIdKind, h as DslIdFactory, i as VideoDraft, it as Voice, j as DslDiagnostic, k as ContainNode, l as VideoDraftPartUnion, m as OpActor, n as DEFAULT_UNIT_TIME_MS, nt as Track, o as VideoDraftContent, p as CommitOptions, r as VideoCreationSettings, rt as TrackRole, s as VideoDraftContentPartUnion, t as CaptionDisplayCue, tt as TimeAnchor, u as VideoDraftTimeline, v as relationId, w as CaptionSelection, x as AudioScript, y as resourceId, z as Media } from "./video-draft-types-
|
|
2
|
-
import { A as MedeoDslDraft, C as UnsupportedDocumentFormatError, D as captionContentCodec, E as InvalidAtomic, F as ClipSource, I as DslClipUpdate, L as MoveDslClipsInput, M as medeoDslLoroShape, N as AddDslClip, O as isInvalidAtomic, P as AddDslClipsInput, R as ReplaceDslClipsInput, S as DslTransaction, T as documentFormat, _ as VoiceoverCaptionInput, a as toAudioScriptViews, b as MedeoDsl, c as resolveDslLayout, d as DslProjectionError, f as DslTrackLayout, g as ApplyVoiceoverInput, h as UploadText, i as AudioScriptView, j as MedeoDslLoroState, k as timeAnchorCodec, l as DslClipLayout, m as DslEditor, n as ImportedVideoDraft, o as VideoDraftProjection, p as createInitialMedeoDsl, r as fromVideoDraft, s as toVideoDraft, t as FromVideoDraftOptions, u as DslLayout, v as VoiceoverResult, w as assertDslDocument, x as DslAudit, y as CreateMedeoDslOptions, z as ClipPlacement } from "./index-
|
|
3
|
-
import { A as MenginePushRejectedError, B as MengineSyncResponse, C as PushResult, D as MengineHttpClient, E as readMengineEventStream, F as MenginePushResponse, H as base64ToBytes, I as MenginePushUpdateResponse, L as MengineRejectedResponse, M as MengineAuditResponse, N as MengineDocumentVersion, O as MengineHttpClientOptions, P as MengineDraftResponse, R as MengineSnapshotResponse, S as PullResult, T as MengineEventStreamOptions, U as bytesToBase64, V as MengineUpdateMeta, a as MengineDocSessionOptions, b as DocVersionMark, c as WaitForLocalSaveOptions, d as MengineUndoState, f as MedeoHttpDocStorage, g as ManualSyncDocOptions, h as PushOutcomeKind, i as MengineAckFailedError, j as MengineAuditEntry, k as MengineHttpRequestError, l as WaitForServerAckOptions, m as PushOutcome, o as MengineDocSyncState, p as MedeoHttpDocStorageOptions, s as MengineLocalSaveState, t as MemoryDocStorage, u as DocStorageLike, v as decodeDocVersionMark, w as PushResultKind, x as PullFailureReason, y as encodeDocVersionMark, z as MengineSseUpdateEvent } from "./index-
|
|
4
|
-
import { n as MengineDocSessionUpdateEvent, r as ManualSyncDoc, t as MengineDocSession } from "./index-
|
|
1
|
+
import { $ as TextMutation, A as DeepReadonly, C as CaptionContent, D as Clip, E as CaptionText, F as EntityTables, G as ResourceSystem, H as RelationTable, I as EntityValues, K as RichTextSnapshot, L as FieldPatch, M as DslMutation, N as EntityMutation, O as ContainMutation, P as EntityTable, Q as TextMark, R as MedeoDslSnapshot, S as Caption, T as CaptionStyle, U as RelationTables, V as RelationMutation, W as RelationValues, X as TextDelta, Y as StoredFile, Z as TextEdit, _ as defaultIdFactory, a as VideoDraftCaptionStyle, b as tupleHash, c as VideoDraftInput, d as VideoDraftTrack, et as TextRun, f as VideoDraftTrackItem, g as EntityIdKind, h as DslIdFactory, i as VideoDraft, it as Voice, j as DslDiagnostic, k as ContainNode, l as VideoDraftPartUnion, m as OpActor, n as DEFAULT_UNIT_TIME_MS, nt as Track, o as VideoDraftContent, p as CommitOptions, r as VideoCreationSettings, rt as TrackRole, s as VideoDraftContentPartUnion, t as CaptionDisplayCue, tt as TimeAnchor, u as VideoDraftTimeline, v as relationId, w as CaptionSelection, x as AudioScript, y as resourceId, z as Media } from "./video-draft-types-BOdawmig.js";
|
|
2
|
+
import { A as MedeoDslDraft, C as UnsupportedDocumentFormatError, D as captionContentCodec, E as InvalidAtomic, F as ClipSource, I as DslClipUpdate, L as MoveDslClipsInput, M as medeoDslLoroShape, N as AddDslClip, O as isInvalidAtomic, P as AddDslClipsInput, R as ReplaceDslClipsInput, S as DslTransaction, T as documentFormat, _ as VoiceoverCaptionInput, a as toAudioScriptViews, b as MedeoDsl, c as resolveDslLayout, d as DslProjectionError, f as DslTrackLayout, g as ApplyVoiceoverInput, h as UploadText, i as AudioScriptView, j as MedeoDslLoroState, k as timeAnchorCodec, l as DslClipLayout, m as DslEditor, n as ImportedVideoDraft, o as VideoDraftProjection, p as createInitialMedeoDsl, r as fromVideoDraft, s as toVideoDraft, t as FromVideoDraftOptions, u as DslLayout, v as VoiceoverResult, w as assertDslDocument, x as DslAudit, y as CreateMedeoDslOptions, z as ClipPlacement } from "./index-CTai9I2R.js";
|
|
3
|
+
import { A as MenginePushRejectedError, B as MengineSyncResponse, C as PushResult, D as MengineHttpClient, E as readMengineEventStream, F as MenginePushResponse, H as base64ToBytes, I as MenginePushUpdateResponse, L as MengineRejectedResponse, M as MengineAuditResponse, N as MengineDocumentVersion, O as MengineHttpClientOptions, P as MengineDraftResponse, R as MengineSnapshotResponse, S as PullResult, T as MengineEventStreamOptions, U as bytesToBase64, V as MengineUpdateMeta, a as MengineDocSessionOptions, b as DocVersionMark, c as WaitForLocalSaveOptions, d as MengineUndoState, f as MedeoHttpDocStorage, g as ManualSyncDocOptions, h as PushOutcomeKind, i as MengineAckFailedError, j as MengineAuditEntry, k as MengineHttpRequestError, l as WaitForServerAckOptions, m as PushOutcome, o as MengineDocSyncState, p as MedeoHttpDocStorageOptions, s as MengineLocalSaveState, t as MemoryDocStorage, u as DocStorageLike, v as decodeDocVersionMark, w as PushResultKind, x as PullFailureReason, y as encodeDocVersionMark, z as MengineSseUpdateEvent } from "./index-CwZ0zt-E.js";
|
|
4
|
+
import { n as MengineDocSessionUpdateEvent, r as ManualSyncDoc, t as MengineDocSession } from "./index-Bt3RhxV4.js";
|
|
5
5
|
export { type AddDslClip, type AddDslClipsInput, type ApplyVoiceoverInput, type AudioScript, type AudioScriptView, type Caption, type CaptionContent, type CaptionDisplayCue, type CaptionSelection, type CaptionStyle, type CaptionText, type Clip, type ClipPlacement, type ClipSource, type CommitOptions, type ContainMutation, type ContainNode, type CreateMedeoDslOptions, DEFAULT_UNIT_TIME_MS, type DeepReadonly, type DocStorageLike, type DocVersionMark, type DslAudit, type DslClipLayout, type DslClipUpdate, type DslDiagnostic, DslEditor, type DslIdFactory, type DslLayout, type DslMutation, DslProjectionError, type DslTrackLayout, type DslTransaction, type EntityIdKind, type EntityMutation, type EntityTable, type EntityTables, type EntityValues, type FieldPatch, type FromVideoDraftOptions, type ImportedVideoDraft, type InvalidAtomic, ManualSyncDoc, type ManualSyncDocOptions, MedeoDsl, type MedeoDslDraft, type MedeoDslLoroState, type MedeoDslSnapshot, MedeoHttpDocStorage, type MedeoHttpDocStorageOptions, type Media, MemoryDocStorage, MengineAckFailedError, type MengineAuditEntry, type MengineAuditResponse, MengineDocSession, type MengineDocSessionOptions, type MengineDocSessionUpdateEvent, type MengineDocSyncState, type MengineDocumentVersion, type MengineDraftResponse, type MengineEventStreamOptions, MengineHttpClient, type MengineHttpClientOptions, MengineHttpRequestError, type MengineLocalSaveState, MenginePushRejectedError, type MenginePushResponse, type MenginePushUpdateResponse, type MengineRejectedResponse, type MengineSnapshotResponse, type MengineSseUpdateEvent, type MengineSyncResponse, type MengineUndoState, type MengineUpdateMeta, type MoveDslClipsInput, type OpActor, type PullFailureReason, type PullResult, type PushOutcome, type PushOutcomeKind, type PushResult, type PushResultKind, type RelationMutation, type RelationTable, type RelationTables, type RelationValues, type ReplaceDslClipsInput, type ResourceSystem, type RichTextSnapshot, type StoredFile, type TextDelta, type TextEdit, type TextMark, type TextMutation, type TextRun, type TimeAnchor, type Track, type TrackRole, UnsupportedDocumentFormatError, type UploadText, type VideoCreationSettings, type VideoDraft, type VideoDraftCaptionStyle, type VideoDraftContent, type VideoDraftContentPartUnion, type VideoDraftInput, type VideoDraftPartUnion, type VideoDraftProjection, type VideoDraftTimeline, type VideoDraftTrack, type VideoDraftTrackItem, type Voice, type VoiceoverCaptionInput, type VoiceoverResult, type WaitForLocalSaveOptions, type WaitForServerAckOptions, assertDslDocument, base64ToBytes, bytesToBase64, captionContentCodec, createInitialMedeoDsl, decodeDocVersionMark, defaultIdFactory, documentFormat, encodeDocVersionMark, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, readMengineEventStream, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as bytesToBase64, t as base64ToBytes } from "./base64-D-jd-dr5.js";
|
|
2
2
|
import { a as covers, c as readMengineEventStream, d as MenginePushRejectedError, i as openManualDocument, l as MengineHttpClient, n as MedeoHttpDocStorage, o as decodeDocVersionMark, r as ManualSyncTransport, s as encodeDocVersionMark, t as MemoryDocStorage, u as MengineHttpRequestError } from "./storage-BW3tI_ER.js";
|
|
3
|
-
import { _t as
|
|
4
|
-
import { a as toAudioScriptViews, c as DslProjectionError, i as DslEditor, n as toVideoDraft, o as MedeoDsl, r as createInitialMedeoDsl, s as resolveDslLayout, t as fromVideoDraft } from "./dsl-
|
|
3
|
+
import { _t as resourceId, a as documentFormat, c as isInvalidAtomic, gt as relationId, ht as defaultIdFactory, i as assertDslDocument, o as medeoDslLoroShape, r as UnsupportedDocumentFormatError, s as captionContentCodec, t as DEFAULT_UNIT_TIME_MS, u as timeAnchorCodec, vt as tupleHash } from "./video-draft-types-DKo53mZ8.js";
|
|
4
|
+
import { a as toAudioScriptViews, c as DslProjectionError, i as DslEditor, n as toVideoDraft, o as MedeoDsl, r as createInitialMedeoDsl, s as resolveDslLayout, t as fromVideoDraft } from "./dsl-Dw59o1t0.js";
|
|
5
5
|
import { UndoManager, VersionVector, decodeImportBlobMeta } from "loro-crdt";
|
|
6
6
|
import { ClientServerSynchronizer, DocManager } from "@mengine/sync";
|
|
7
7
|
import { DisposableSet, EventBus } from "@mengine/utils";
|
package/dist/legacy.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as VideoDraft, l as VideoDraftPartUnion, o as VideoDraftContent, p as CommitOptions, t as CaptionDisplayCue } from "./video-draft-types-
|
|
2
|
-
import { A as MenginePushRejectedError, B as MengineSyncResponse, C as PushResult, D as MengineHttpClient, E as readMengineEventStream, F as MenginePushResponse, H as base64ToBytes, I as MenginePushUpdateResponse, L as MengineRejectedResponse, M as MengineAuditResponse, N as MengineDocumentVersion, O as MengineHttpClientOptions, P as MengineDraftResponse, R as MengineSnapshotResponse, S as PullResult, T as MengineEventStreamOptions, U as bytesToBase64, V as MengineUpdateMeta, _ as ManualSyncTransport, a as MengineDocSessionOptions, b as DocVersionMark, d as MengineUndoState, f as MedeoHttpDocStorage, g as ManualSyncDocOptions, h as PushOutcomeKind, j as MengineAuditEntry, k as MengineHttpRequestError, l as WaitForServerAckOptions, m as PushOutcome, o as MengineDocSyncState, p as MedeoHttpDocStorageOptions, t as MemoryDocStorage, u as DocStorageLike, v as decodeDocVersionMark, w as PushResultKind, x as PullFailureReason, y as encodeDocVersionMark, z as MengineSseUpdateEvent } from "./index-
|
|
1
|
+
import { i as VideoDraft, l as VideoDraftPartUnion, o as VideoDraftContent, p as CommitOptions, t as CaptionDisplayCue } from "./video-draft-types-BOdawmig.js";
|
|
2
|
+
import { A as MenginePushRejectedError, B as MengineSyncResponse, C as PushResult, D as MengineHttpClient, E as readMengineEventStream, F as MenginePushResponse, H as base64ToBytes, I as MenginePushUpdateResponse, L as MengineRejectedResponse, M as MengineAuditResponse, N as MengineDocumentVersion, O as MengineHttpClientOptions, P as MengineDraftResponse, R as MengineSnapshotResponse, S as PullResult, T as MengineEventStreamOptions, U as bytesToBase64, V as MengineUpdateMeta, _ as ManualSyncTransport, a as MengineDocSessionOptions, b as DocVersionMark, d as MengineUndoState, f as MedeoHttpDocStorage, g as ManualSyncDocOptions, h as PushOutcomeKind, j as MengineAuditEntry, k as MengineHttpRequestError, l as WaitForServerAckOptions, m as PushOutcome, o as MengineDocSyncState, p as MedeoHttpDocStorageOptions, t as MemoryDocStorage, u as DocStorageLike, v as decodeDocVersionMark, w as PushResultKind, x as PullFailureReason, y as encodeDocVersionMark, z as MengineSseUpdateEvent } from "./index-CwZ0zt-E.js";
|
|
3
3
|
import { LoroDoc, PeerID } from "loro-crdt";
|
|
4
4
|
|
|
5
5
|
//#region ../medeo-dsl/depreacted/sandbox.d.ts
|
package/dist/legacy.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as bytesToBase64, t as base64ToBytes } from "./base64-D-jd-dr5.js";
|
|
2
2
|
import { c as readMengineEventStream, d as MenginePushRejectedError, i as openManualDocument, l as MengineHttpClient, n as MedeoHttpDocStorage, o as decodeDocVersionMark, r as ManualSyncTransport, s as encodeDocVersionMark, t as MemoryDocStorage, u as MengineHttpRequestError } from "./storage-BW3tI_ER.js";
|
|
3
|
-
import { a as documentFormat, r as UnsupportedDocumentFormatError, t as DEFAULT_UNIT_TIME_MS } from "./video-draft-types-
|
|
3
|
+
import { a as documentFormat, r as UnsupportedDocumentFormatError, t as DEFAULT_UNIT_TIME_MS } from "./video-draft-types-DKo53mZ8.js";
|
|
4
4
|
import { u as volumeSchema } from "./shared-iWnU2osE.js";
|
|
5
5
|
import { sha256 } from "@noble/hashes/sha2.js";
|
|
6
6
|
import { LoroDoc, LoroMap, LoroMovableList, LoroText, UndoManager } from "loro-crdt";
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as VideoDraft } from "./video-draft-types-
|
|
2
|
-
import { b as MedeoDsl } from "./index-
|
|
1
|
+
import { i as VideoDraft } from "./video-draft-types-BOdawmig.js";
|
|
2
|
+
import { b as MedeoDsl } from "./index-CTai9I2R.js";
|
|
3
3
|
import { LoroDoc } from "loro-crdt";
|
|
4
4
|
|
|
5
5
|
//#region src/testing/in-memory-mengine-server.d.ts
|
package/dist/testing.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as bytesToBase64, t as base64ToBytes } from "./base64-D-jd-dr5.js";
|
|
2
|
-
import { a as documentFormat, i as assertDslDocument } from "./video-draft-types-
|
|
3
|
-
import { i as DslEditor, n as toVideoDraft, o as MedeoDsl, r as createInitialMedeoDsl } from "./dsl-
|
|
2
|
+
import { a as documentFormat, i as assertDslDocument } from "./video-draft-types-DKo53mZ8.js";
|
|
3
|
+
import { i as DslEditor, n as toVideoDraft, o as MedeoDsl, r as createInitialMedeoDsl } from "./dsl-Dw59o1t0.js";
|
|
4
4
|
import { t as classifyUpdate } from "./loro-relay-doc-Bi6JKqtQ.js";
|
|
5
5
|
import { LoroDoc, VersionVector, encodeFrontiers } from "loro-crdt";
|
|
6
6
|
//#region src/testing/in-memory-mengine-server.ts
|
|
@@ -57,9 +57,18 @@ type Media = MediaLocator & ({
|
|
|
57
57
|
interface AudioScriptSegment {
|
|
58
58
|
id: string;
|
|
59
59
|
text: string;
|
|
60
|
+
/**
|
|
61
|
+
* Where these words were spoken in the medium the script was read off, as the transcription
|
|
62
|
+
* file it names gave them (D186). Only a transcript's segments state it, both ends together.
|
|
63
|
+
*/
|
|
64
|
+
startMs?: number;
|
|
65
|
+
endMs?: number;
|
|
60
66
|
}
|
|
61
|
-
/**
|
|
62
|
-
|
|
67
|
+
/**
|
|
68
|
+
* A script is segmented text: its segments in order (D181). A transcript names the transcription
|
|
69
|
+
* file its words and times were read from (D186); a written script names none.
|
|
70
|
+
*/
|
|
71
|
+
interface AudioScript extends Partial<StoredFile> {
|
|
63
72
|
segments: AudioScriptSegment[];
|
|
64
73
|
defaultLanguage?: string;
|
|
65
74
|
}
|
|
@@ -218,6 +227,8 @@ type SegmentMutation = {
|
|
|
218
227
|
segmentId: string;
|
|
219
228
|
index?: number;
|
|
220
229
|
text: string;
|
|
230
|
+
startMs?: number;
|
|
231
|
+
endMs?: number;
|
|
221
232
|
} | {
|
|
222
233
|
type: 'move-segment';
|
|
223
234
|
audioScriptId: string;
|
|
@@ -151,10 +151,22 @@ function assertPhoneme(value) {
|
|
|
151
151
|
}
|
|
152
152
|
const segmentFields = {
|
|
153
153
|
id: required(id),
|
|
154
|
-
text: required(string)
|
|
154
|
+
text: required(string),
|
|
155
|
+
startMs: optional$1(nonnegative),
|
|
156
|
+
endMs: optional$1(nonnegative)
|
|
155
157
|
};
|
|
158
|
+
/** A segment's time in the medium it was read off: both ends or neither, the end not before the start. */
|
|
159
|
+
const segment = (v) => {
|
|
160
|
+
if (!object(segmentFields)(v)) return false;
|
|
161
|
+
const { startMs, endMs } = v;
|
|
162
|
+
return startMs === void 0 ? endMs === void 0 : endMs !== void 0 && endMs >= startMs;
|
|
163
|
+
};
|
|
164
|
+
/** One segment as a script stores it; a segment added on its own is checked here, not with its row. */
|
|
165
|
+
function assertScriptSegment(value) {
|
|
166
|
+
if (!segment(value)) throw new Error("A segment is { id, text } with startMs and endMs both or neither, endMs not before startMs");
|
|
167
|
+
}
|
|
156
168
|
/** A script's segments: each with its own id, unique within the script. */
|
|
157
|
-
const segments = (v) => Array.isArray(v) && v.every(
|
|
169
|
+
const segments = (v) => Array.isArray(v) && v.every(segment) && new Set(v.map((s) => s.id)).size === v.length;
|
|
158
170
|
const locator = {
|
|
159
171
|
system: required(oneOf("memota", "memota-speech")),
|
|
160
172
|
key: required(nonempty)
|
|
@@ -180,7 +192,11 @@ const entityFields = {
|
|
|
180
192
|
},
|
|
181
193
|
"audio-script-entities": {
|
|
182
194
|
segments: required(segments),
|
|
183
|
-
defaultLanguage: optional$1(validLanguage)
|
|
195
|
+
defaultLanguage: optional$1(validLanguage),
|
|
196
|
+
system: optional$1(oneOf("memota")),
|
|
197
|
+
key: optional$1(nonempty),
|
|
198
|
+
storageKey: optional$1(nonempty),
|
|
199
|
+
digest: optional$1(nonempty)
|
|
184
200
|
},
|
|
185
201
|
"phonetic-script-entities": {
|
|
186
202
|
phoneme: optional$1(segmentSelection(phonemeFields)),
|
|
@@ -241,8 +257,14 @@ function assertPhoneticScript(before, after) {
|
|
|
241
257
|
} else if (after.system === void 0 || after.key === void 0 || after.digest === void 0) throw new Error("A PhoneticScript stores its phonemeScript as a file: name it by system and key with its digest");
|
|
242
258
|
if (before !== void 0 && phonemeScriptOf(after) !== phonemeScriptOf(before) && after.digest !== void 0 && after.digest === before.digest) throw new Error("A rewritten phonemeScript is stored again: write its new file");
|
|
243
259
|
}
|
|
260
|
+
/** A transcript names the file it was read from by system and key together; its facts come with that name. */
|
|
261
|
+
function assertTranscriptFile(row) {
|
|
262
|
+
if (row.system === void 0 !== (row.key === void 0)) throw new Error("A transcript names its transcription file by system and key");
|
|
263
|
+
if (row.key === void 0 && (row.storageKey !== void 0 || row.digest !== void 0)) throw new Error("A script without a transcription file has no file facts");
|
|
264
|
+
}
|
|
244
265
|
function assertEntity(table, value) {
|
|
245
266
|
checkFields(value, entityFields[table]);
|
|
267
|
+
if (table === "audio-script-entities") assertTranscriptFile(value);
|
|
246
268
|
if (table === "media-entities") {
|
|
247
269
|
if (value.kind === "image" && value.durationMs !== void 0) throw new Error("Image has no intrinsic duration");
|
|
248
270
|
if (value.kind !== "image" && !positive(value.durationMs)) throw new Error("Finite media requires durationMs");
|
|
@@ -260,6 +282,10 @@ function assertEntityPatch(table, patch, current) {
|
|
|
260
282
|
const field = entityFields[table][key];
|
|
261
283
|
if (!field || !field.optional && next[key] === void 0 || next[key] !== void 0 && !field.check(next[key])) throw new Error(`Invalid patch field: ${key}`);
|
|
262
284
|
}
|
|
285
|
+
if (table === "audio-script-entities" && fileFields.some((field) => Object.hasOwn(patch, field))) {
|
|
286
|
+
if (current.key !== void 0 && (next.system !== current.system || next.key !== current.key)) throw new Error("A transcript's transcription file is fixed once named");
|
|
287
|
+
assertTranscriptFile(next);
|
|
288
|
+
}
|
|
263
289
|
if (table === "media-entities" || table === "voice-entities") {
|
|
264
290
|
for (const key of [
|
|
265
291
|
"system",
|
|
@@ -1404,9 +1430,15 @@ const medeoDslLoroShape = schema({
|
|
|
1404
1430
|
"audio-script-entities": schema.LoroMapRecord(schema.LoroMap({
|
|
1405
1431
|
segments: schema.LoroMovableList(schema.LoroMap({
|
|
1406
1432
|
id: schema.String(),
|
|
1407
|
-
text: schema.LoroText()
|
|
1433
|
+
text: schema.LoroText(),
|
|
1434
|
+
startMs: schema.Number(optional),
|
|
1435
|
+
endMs: schema.Number(optional)
|
|
1408
1436
|
}), (segment) => segment.id),
|
|
1409
|
-
defaultLanguage: schema.String(optional)
|
|
1437
|
+
defaultLanguage: schema.String(optional),
|
|
1438
|
+
system: schema.String(optional),
|
|
1439
|
+
key: schema.String(optional),
|
|
1440
|
+
storageKey: schema.String(optional),
|
|
1441
|
+
digest: schema.String(optional)
|
|
1410
1442
|
})),
|
|
1411
1443
|
"phonetic-script-entities": schema.LoroMapRecord(schema.LoroMap({
|
|
1412
1444
|
phoneme: atomicValue(phonemeCodec),
|
|
@@ -1483,4 +1515,4 @@ const textStyles = { language: { expand: "after" } };
|
|
|
1483
1515
|
//#region src/dsl/projection/video-draft-types.ts
|
|
1484
1516
|
const DEFAULT_UNIT_TIME_MS = 33.333;
|
|
1485
1517
|
//#endregion
|
|
1486
|
-
export { assertEntityPatch as $, getRootContainerByType as A, isValueOfContainerType as B, applyEncode as C, decodeNestedJsonValues as D, containerIdToContainerType as E, isArrayLike as F, tryUpdateToContainer as G, schemaToContainerType as H, isObject as I, getChildContainerSchema as J, valuesEqual as K, isObjectLike as L, hasTransform as M, inferContainerTypeFromValue as N, deepEqual as O, insertChildToMap as P, assertEntity as Q, isStateAndSchemaOfType as R, applyDecode as S, cidsEqual as T, stripUndefined as U, safeStringify as V, tryInferContainerType as W, getMapFieldSchema as X, getChildSchema as Y, assertCaptionContent as Z, isLoroMovableListSchema as _,
|
|
1518
|
+
export { assertEntityPatch as $, getRootContainerByType as A, isValueOfContainerType as B, applyEncode as C, decodeNestedJsonValues as D, containerIdToContainerType as E, isArrayLike as F, tryUpdateToContainer as G, schemaToContainerType as H, isObject as I, getChildContainerSchema as J, valuesEqual as K, isObjectLike as L, hasTransform as M, inferContainerTypeFromValue as N, deepEqual as O, insertChildToMap as P, assertEntity as Q, isStateAndSchemaOfType as R, applyDecode as S, cidsEqual as T, stripUndefined as U, safeStringify as V, tryInferContainerType as W, getMapFieldSchema as X, getChildSchema as Y, assertCaptionContent as Z, isLoroMovableListSchema as _, resourceId as _t, documentFormat as a, assertTimeAnchor as at, schemaContainsIgnoreField as b, isInvalidAtomic as c, isRecord as ct, schema as d, relationTables as dt, assertId as et, getDefaultValue as f, validLanguage as ft, isLoroMapSchema as g, relationId as gt, isLoroListSchema as h, defaultIdFactory as ht, assertDslDocument as i, assertScriptSegment as it, hardenCidDescriptors as j, defineCidProperty as k, phonemeCodec as l, mergeFields as lt, isListLikeSchema as m, assertResourceIdentity as mt, textStyles as n, assertPhoneticScript as nt, medeoDslLoroShape as o, atomicFields as ot, isContainerSchema as p, assertRelationIdentity as pt, CID_KEY as q, UnsupportedDocumentFormatError as r, assertRelation as rt, captionContentCodec as s, entityTables as st, DEFAULT_UNIT_TIME_MS as t, assertPhoneme as tt, timeAnchorCodec as u, patchRow as ut, isLoroTreeSchema as v, tupleHash as vt, applySchemaToInferOptions as w, validateSchema as x, isRootSchemaType as y, isTreeID as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mengine/medeo-client",
|
|
3
|
-
"version": "2.1.1-dsl.
|
|
3
|
+
"version": "2.1.1-dsl.15",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"@noble/hashes": "^2.4.0",
|
|
30
30
|
"immer": "^10.2.0",
|
|
31
31
|
"zod": "^4.4.3",
|
|
32
|
-
"@mengine/storage": "2.1.1-dsl.
|
|
33
|
-
"@mengine/utils": "2.1.1-dsl.
|
|
34
|
-
"@mengine/sync": "2.1.1-dsl.
|
|
32
|
+
"@mengine/storage": "2.1.1-dsl.15",
|
|
33
|
+
"@mengine/utils": "2.1.1-dsl.15",
|
|
34
|
+
"@mengine/sync": "2.1.1-dsl.15"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^25.9.1",
|