@mengine/medeo-client 2.0.1-alpha.5 → 2.0.1-alpha.6

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.
@@ -3844,6 +3844,10 @@ var LoroEntityDocument = class LoroEntityDocument {
3844
3844
  if (id === void 0) return [];
3845
3845
  return this.snapshot().rows.relations.filter((row) => row.endpoint0EntityId === id || row.endpoint1EntityId === id);
3846
3846
  }
3847
+ /** Resolve a queued edit target through its native identity without changing history. */
3848
+ resolveCurrentEntityId(id) {
3849
+ return currentId(this.doc, id);
3850
+ }
3847
3851
  getVersion(id) {
3848
3852
  const entity = section(this.doc, "entities").get(id);
3849
3853
  if (!isJsonObject(entity)) return void 0;
@@ -3917,12 +3921,12 @@ var LoroEntityDocument = class LoroEntityDocument {
3917
3921
  return this.historyEdit(() => this.undoManager.redo());
3918
3922
  }
3919
3923
  historyEdit(run) {
3920
- const before = this.snapshot();
3924
+ const before = new Map(this.snapshot().rows.entities.map((row) => [family(this.doc, row.entityId), row]));
3921
3925
  if (!run()) return false;
3922
3926
  const after = this.snapshot();
3923
3927
  for (const row of after.rows.entities) {
3924
3928
  const id = family(this.doc, row.entityId);
3925
- const previous = before.rows.entities.find((item) => family(this.doc, item.entityId) === id);
3929
+ const previous = before.get(id);
3926
3930
  if (previous && !equalJson(owned(previous.payload), owned(row.payload))) workspace(this.doc, id).ensureMergeableMap("changes").set(globalThis.crypto.randomUUID(), true);
3927
3931
  }
3928
3932
  materialize(this.doc);
package/dist/index.d.ts CHANGED
@@ -789,6 +789,8 @@ declare class LoroEntityDocument {
789
789
  static create(rows: EntityRelationRows, project?: Readonly<Record<string, string>>, peerId?: PeerID): LoroEntityDocument;
790
790
  snapshot(): EntityDocumentState;
791
791
  relationsOf(entityId: string): readonly RelationRow[];
792
+ /** Resolve a queued edit target through its native identity without changing history. */
793
+ resolveCurrentEntityId(id: string): string;
792
794
  getVersion(id: string): EntityRow | undefined;
793
795
  /** The callback and every domain validation execute on a causally complete fork first. */
794
796
  transact(edit: (draft: LoroEntityDraft) => void): Uint8Array;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as ensureLaneTrack, A as assembleEntityContent, B as hasSequence, C as projectEntityTimeline, Ct as base64ToBytes, D as decodeEntityRelationRows, E as EntityTimelineProjectionError, F as updateEntityFields, G as fromVideoDocument, H as buildInitialVideoDocument, I as variantBaseEntityIds, J as assertValidVideoDocument, K as toVideoDocument, L as isJsonObject, M as assembleScriptText, N as findComposedAudioScript, O as ScriptCompositionError, P as selectAudioScriptSegment, Q as LANE_KINDS_IN_STACK_ORDER, R as createEntityId, S as resolveFieldPath, St as videoDocumentMirrorSchema, T as resolveEntityTimelineLayout, U as buildSpeechHostMap, V as isMediaAssetVariantKind, W as derivePositionFromAbs, X as partUnionSchema, Y as validateVideoDocument, Z as videoDocumentSchema, _ as audioScriptAssetHash, _t as VIDEO_DOCUMENT_SCHEMA_VERSION, a as applyEntityTimelineProjection, at as fillMainTrackTimeGaps, b as applyFieldChanges, bt as partUnionToDraft, c as writeVideoDocumentToDraft, ct as resolveAllSpeechOverlaps, d as LoroEntityDocument, dt as TIMELINE_SKELETON_DURATION_MS, et as findLaneTrack, f as LoroEntityDraft, ft as isEmptyVideoClip, g as audioScriptAssetFields, gt as ENTITY_TIMELINE_PROJECTION_SCHEMA_VERSION, h as audioScriptAssetContent, ht as DEFAULT_UNIT_TIME_MS, i as MirrorVideoDocumentAdapter, it as arrangeMainTrackSeamlessly, j as assemblePhoneticScriptContent, k as assembleCaptionContent, l as readVideoDocumentFromDraft, lt as resolveSpeechOverlapByShiftingVideos, m as entityOrderGroups, mt as safeDurationMs, n as createPlainMemoryAdapter, nt as solveVideoDocument, o as createMirrorVideoDocument, ot as reassignSpeechesToVideoClipsByTime, p as readEntityDocument, pt as partDurationMs, q as VideoDocumentValidationError, r as generatePartId, rt as cascadeAfterVideoClipChanges, s as createMirrorVideoDocumentAdapter, st as recalculateTimelineDuration, t as PlainMemoryAdapter, tt as laneTrackId, u as LORO_ENTITY_SCHEMA, ut as syncAggregatedClipsTimePosition, v as hasAudioScriptAsset, vt as effectiveVideoClipDurationMs, w as EntityProjectionGraph, wt as bytesToBase64, x as assertFieldChanges, xt as recordEntries, y as equalJson, yt as speedOf, z as createRelationId } from "./document-Bzzcn3g7.js";
1
+ import { $ as ensureLaneTrack, A as assembleEntityContent, B as hasSequence, C as projectEntityTimeline, Ct as base64ToBytes, D as decodeEntityRelationRows, E as EntityTimelineProjectionError, F as updateEntityFields, G as fromVideoDocument, H as buildInitialVideoDocument, I as variantBaseEntityIds, J as assertValidVideoDocument, K as toVideoDocument, L as isJsonObject, M as assembleScriptText, N as findComposedAudioScript, O as ScriptCompositionError, P as selectAudioScriptSegment, Q as LANE_KINDS_IN_STACK_ORDER, R as createEntityId, S as resolveFieldPath, St as videoDocumentMirrorSchema, T as resolveEntityTimelineLayout, U as buildSpeechHostMap, V as isMediaAssetVariantKind, W as derivePositionFromAbs, X as partUnionSchema, Y as validateVideoDocument, Z as videoDocumentSchema, _ as audioScriptAssetHash, _t as VIDEO_DOCUMENT_SCHEMA_VERSION, a as applyEntityTimelineProjection, at as fillMainTrackTimeGaps, b as applyFieldChanges, bt as partUnionToDraft, c as writeVideoDocumentToDraft, ct as resolveAllSpeechOverlaps, d as LoroEntityDocument, dt as TIMELINE_SKELETON_DURATION_MS, et as findLaneTrack, f as LoroEntityDraft, ft as isEmptyVideoClip, g as audioScriptAssetFields, gt as ENTITY_TIMELINE_PROJECTION_SCHEMA_VERSION, h as audioScriptAssetContent, ht as DEFAULT_UNIT_TIME_MS, i as MirrorVideoDocumentAdapter, it as arrangeMainTrackSeamlessly, j as assemblePhoneticScriptContent, k as assembleCaptionContent, l as readVideoDocumentFromDraft, lt as resolveSpeechOverlapByShiftingVideos, m as entityOrderGroups, mt as safeDurationMs, n as createPlainMemoryAdapter, nt as solveVideoDocument, o as createMirrorVideoDocument, ot as reassignSpeechesToVideoClipsByTime, p as readEntityDocument, pt as partDurationMs, q as VideoDocumentValidationError, r as generatePartId, rt as cascadeAfterVideoClipChanges, s as createMirrorVideoDocumentAdapter, st as recalculateTimelineDuration, t as PlainMemoryAdapter, tt as laneTrackId, u as LORO_ENTITY_SCHEMA, ut as syncAggregatedClipsTimePosition, v as hasAudioScriptAsset, vt as effectiveVideoClipDurationMs, w as EntityProjectionGraph, wt as bytesToBase64, x as assertFieldChanges, xt as recordEntries, y as equalJson, yt as speedOf, z as createRelationId } from "./document-N-8GwtOX.js";
2
2
  import { addSpeechesInputSchema, addVideoClipsInputSchema, adjustBgmVolumeInputSchema, adjustSpeechVolumeInputSchema, adjustVideoClipDurationInputSchema, adjustVideoClipVolumeInputSchema, changeSpeechScriptInputSchema, changeSpeechVoiceInputSchema, deleteBgmInputSchema, deleteSpeechesInputSchema, deleteVideoClipsInputSchema, moveSpeechesInputSchema, moveVideoClipsByAnchorInputSchema, moveVideoClipsInputSchema, replaceVideoClipContentInputSchema, replaceVideoClipSequenceInputSchema, setBgmInputSchema, setCaptionStyleInputSchema, setCaptionVisibilityInputSchema, setVideoClipSpeedShiftInputSchema, t as schemas_exports } from "./schemas.js";
3
3
  import { LoroDoc, VersionVector } from "loro-crdt";
4
4
  import { ClientServerSynchronizer, DocManager } from "@mengine/sync";
package/dist/testing.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Ct as base64ToBytes, _t as VIDEO_DOCUMENT_SCHEMA_VERSION, s as createMirrorVideoDocumentAdapter, wt as bytesToBase64 } from "./document-Bzzcn3g7.js";
1
+ import { Ct as base64ToBytes, _t as VIDEO_DOCUMENT_SCHEMA_VERSION, s as createMirrorVideoDocumentAdapter, wt as bytesToBase64 } from "./document-N-8GwtOX.js";
2
2
  import { t as classifyUpdate } from "./loro-relay-doc-ssdYpuef.js";
3
3
  import { LoroDoc, VersionVector, encodeFrontiers } from "loro-crdt";
4
4
  //#region src/testing/in-memory-mengine-server.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mengine/medeo-client",
3
- "version": "2.0.1-alpha.5",
3
+ "version": "2.0.1-alpha.6",
4
4
  "license": "UNLICENSED",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,9 +28,9 @@
28
28
  "immer": "^10.2.0",
29
29
  "loro-mirror": "^2.2.0",
30
30
  "zod": "^4.4.3",
31
- "@mengine/sync": "2.0.1-alpha.5",
32
- "@mengine/storage": "2.0.1-alpha.5",
33
- "@mengine/utils": "2.0.1-alpha.5"
31
+ "@mengine/sync": "2.0.1-alpha.6",
32
+ "@mengine/storage": "2.0.1-alpha.6",
33
+ "@mengine/utils": "2.0.1-alpha.6"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^25.9.1",
@@ -40,8 +40,8 @@
40
40
  "typescript": "^6.0.3",
41
41
  "vite-plugin-wasm": "^3.6.0",
42
42
  "vite-plus": "^0.1.23",
43
- "@mengine/medeo-dsl": "0.0.0",
44
- "@mengine/idl-codegen": "0.0.0"
43
+ "@mengine/idl-codegen": "0.0.0",
44
+ "@mengine/medeo-dsl": "0.0.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "loro-crdt": "^1.13.6"