@video-editor/editor-core 0.0.1-beta.24 → 0.0.1-beta.26

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/index.d.ts CHANGED
@@ -63,6 +63,8 @@ export declare interface EditorCoreCommands {
63
63
  updateTransition: ProtocolManager['updateTransition'];
64
64
  /** Replace a track id (useful for migrations). */
65
65
  replaceTrackId: ProtocolManager['replaceTrackId'];
66
+ /** Replace a segment id (useful for migrations). */
67
+ replaceSegmentId: ProtocolManager['replaceSegmentId'];
66
68
  /** Undo the last mutation. */
67
69
  undo: ProtocolManager['undo'];
68
70
  /** Redo the last undone mutation. */
package/dist/index.js CHANGED
@@ -5,15 +5,15 @@ function y(s) {
5
5
  let a = !1;
6
6
  return {
7
7
  register: async (t, n) => {
8
- const i = t(s), { name: c } = i;
9
- if (r.has(c)) {
8
+ const c = t(s), { name: i } = c;
9
+ if (r.has(i)) {
10
10
  if (!n?.override)
11
- throw new Error(`Plugin ${c} has been registered`);
12
- await r.get(c)?.destroy?.();
13
- const u = e.findIndex((S) => S.name === c);
14
- u >= 0 && e.splice(u, 1), r.delete(c);
11
+ throw new Error(`Plugin ${i} has been registered`);
12
+ await r.get(i)?.destroy?.();
13
+ const u = e.findIndex((S) => S.name === i);
14
+ u >= 0 && e.splice(u, 1), r.delete(i);
15
15
  }
16
- e.push(i), r.set(c, i), (n?.autoInit || a) && await i.init?.();
16
+ e.push(c), r.set(i, c), (n?.autoInit || a) && await c.init?.();
17
17
  },
18
18
  init: async () => {
19
19
  for (const t of e)
@@ -23,7 +23,7 @@ function y(s) {
23
23
  get: (t) => r.get(t),
24
24
  has: (t) => r.has(t),
25
25
  remove: async (t) => {
26
- const n = e.findIndex((c) => c.name === t);
26
+ const n = e.findIndex((i) => i.name === t);
27
27
  return n === -1 ? !1 : (await e[n].destroy?.(), e.splice(n, 1), r.delete(t));
28
28
  },
29
29
  destroy: async () => {
@@ -52,7 +52,7 @@ function k(s) {
52
52
  a.endTime > e && (e = a.endTime);
53
53
  return e;
54
54
  }
55
- function I(s) {
55
+ function x(s) {
56
56
  const e = v(s.protocol, {
57
57
  idFactory: s.idFactory
58
58
  }), r = p(() => e.selectedSegment.value?.id), a = p(() => k(e.protocol.value.tracks)), o = {
@@ -80,14 +80,15 @@ function I(s) {
80
80
  removeTransition: e.removeTransition,
81
81
  updateTransition: e.updateTransition,
82
82
  replaceTrackId: e.replaceTrackId,
83
+ replaceSegmentId: e.replaceSegmentId,
83
84
  undo: e.undo,
84
85
  redo: e.redo,
85
86
  exportProtocol: e.exportProtocol
86
87
  }, g = {
87
88
  getSegment: e.getSegment,
88
- getTrackById: (n) => o.protocol.value.tracks.find((i) => i.trackId === n),
89
- getTrackBySegmentId: (n) => o.protocol.value.tracks.find((i) => i.children.some((c) => c.id === n)),
90
- getTracks: (n) => n ? o.protocol.value.tracks.filter((i) => i.trackType === n) : o.protocol.value.tracks
89
+ getTrackById: (n) => o.protocol.value.tracks.find((c) => c.trackId === n),
90
+ getTrackBySegmentId: (n) => o.protocol.value.tracks.find((c) => c.children.some((i) => i.id === n)),
91
+ getTracks: (n) => n ? o.protocol.value.tracks.filter((c) => c.trackType === n) : o.protocol.value.tracks
91
92
  }, l = {
92
93
  segments: T()
93
94
  }, m = s.services ?? {}, t = y({
@@ -110,7 +111,7 @@ function I(s) {
110
111
  };
111
112
  }
112
113
  export {
113
- I as createEditorCore,
114
+ x as createEditorCore,
114
115
  y as createPluginManager,
115
116
  T as createSegmentRegistry
116
117
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@video-editor/editor-core",
3
3
  "type": "module",
4
- "version": "0.0.1-beta.24",
4
+ "version": "0.0.1-beta.26",
5
5
  "exports": {
6
6
  ".": {
7
7
  "import": "./dist/index.js"
@@ -18,8 +18,8 @@
18
18
  "@vue/reactivity": "^3.5.26"
19
19
  },
20
20
  "dependencies": {
21
- "@video-editor/shared": "0.0.1-beta.24",
22
- "@video-editor/protocol": "0.0.1-beta.24"
21
+ "@video-editor/protocol": "0.0.1-beta.26",
22
+ "@video-editor/shared": "0.0.1-beta.26"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@vue/reactivity": "^3.5.26"