@dineug/erd-editor 3.9.1 → 3.9.2

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.
@@ -1,8 +1,8 @@
1
- import { $i as e, $n as t, Bn as n, E as r, G as i, H as a, Hi as o, I as s, In as c, Jn as l, Jr as u, L as d, Li as ee, M as f, Qi as p, Qt as m, Rn as h, Sa as te, Si as g, Tn as _, Vi as v, Zi as y, _n as b, aa as x, b as S, da as C, ea as w, fa as T, g as E, ga as D, gn as O, ha as k, ia as A, in as j, jt as ne, la as re, li as ie, ma as ae, oa as M, on as N, pa as P, pn as F, rn as I, ta as L, tt as R, un as z, v as B, w as V, wi as H, xn as U, ya as W, zn as G, zt as K } from "../store-hooks-DuNN9ZKu.js";
2
- import { c as q, d as J, f as oe, l as se, n as ce, t as le } from "../shared-store-CtJL8B4I.js";
1
+ import { $i as e, At as t, Bi as n, C as r, Ci as i, F as a, Fn as o, I as s, Ii as c, Ln as l, Qi as u, Qn as d, Rn as f, Rt as p, T as m, V as h, Vi as g, W as _, Xi as v, Zi as y, Zt as b, _ as x, aa as S, an as C, bn as w, ca as T, ci as E, da as D, ea as O, et as ee, fa as k, fn as A, gn as te, h as j, ha as ne, hn as re, ia as ie, j as ae, ln as M, ma as N, nn as P, pa as F, qn as I, qr as L, ra as R, rn as z, ua as B, va as V, wn as H, xa as U, xi as W, y as G, zn as K } from "../store-hooks-DuzDVhPy.js";
2
+ import { c as q, d as J, f as oe, l as se, n as ce, t as le } from "../shared-store-BqPSXAEf.js";
3
3
  import { isEmpty as ue } from "es-toolkit/compat";
4
4
  //#region src/engine/presence.ts
5
- var de = U / 3, fe = (e) => {
5
+ var de = w / 3, fe = (e) => {
6
6
  e?.unref?.();
7
7
  }, pe = [
8
8
  "sharedMouseTrackerMap",
@@ -17,16 +17,16 @@ function me(e) {
17
17
  }
18
18
  }
19
19
  function he(e) {
20
- let t = "", r = (n) => {
20
+ let t = "", n = (n) => {
21
21
  let r = q(e.state.editor.focusTable), i = se(r);
22
- i === t && !n || (t = i, e.dispatch(l({ focus: r })));
23
- }, i = e.subscribe((e) => {
24
- r(e.some((e) => e.type === n.type));
25
- }), a = setInterval(() => {
26
- t && r(!0);
22
+ i === t && !n || (t = i, e.dispatch(I({ focus: r })));
23
+ }, r = e.subscribe((e) => {
24
+ n(e.some((e) => e.type === K.type));
25
+ }), i = setInterval(() => {
26
+ t && n(!0);
27
27
  }, de);
28
- return fe(a), Object.freeze({ destroy: () => {
29
- i(), clearInterval(a);
28
+ return fe(i), Object.freeze({ destroy: () => {
29
+ r(), clearInterval(i);
30
30
  } });
31
31
  }
32
32
  //#endregion
@@ -46,9 +46,9 @@ var _e = 2, Y = 10, X = (e) => Math.round(e.length * Y) + _e, Z = {
46
46
  destroyed: "this document session was closed; open the document again"
47
47
  }, Q = class extends Error {
48
48
  constructor(e, t) {
49
- super(ve[e]), B(this, "code", void 0), B(this, "operation", void 0), this.name = "PeerStoreError", this.code = e, this.operation = t;
49
+ super(ve[e]), x(this, "code", void 0), x(this, "operation", void 0), this.name = "PeerStoreError", this.code = e, this.operation = t;
50
50
  }
51
- }, $ = y(S), ye = y(r), be = y([
51
+ }, $ = v(G), ye = v(m), be = v([
52
52
  "table.add",
53
53
  "column.add",
54
54
  "memo.add",
@@ -86,10 +86,10 @@ function xe(e) {
86
86
  function Se(e) {
87
87
  if (!e) return [];
88
88
  let { tableId: t, columnId: n, focusType: r } = e;
89
- return n === void 0 ? [h({
89
+ return n === void 0 ? [l({
90
90
  tableId: t,
91
91
  focusType: r
92
- })] : [c({
92
+ })] : [o({
93
93
  tableId: t,
94
94
  columnId: n,
95
95
  focusType: r,
@@ -97,50 +97,50 @@ function Se(e) {
97
97
  shiftKey: !1
98
98
  })];
99
99
  }
100
- function Ce({ nickname: e, toWidth: t = X, presence: r = !0, readonly: i = !1 }) {
101
- let a = null, o = J(E({ toWidth: t }), {
100
+ function Ce({ nickname: e, toWidth: t = X, presence: n = !0, readonly: r = !1 }) {
101
+ let i = null, a = J(j({ toWidth: t }), {
102
102
  manualStreamFlush: !0,
103
103
  observable: !1,
104
- getHistory: (e) => (a = xe(oe(e)), a.history)
105
- }), s = () => a?.getPushes() ?? 0, c = () => a?.getLimit() ?? 0, l = le(o, { getNickname: () => e }, { manualStreamFlush: !0 }), u = ge(o, l), d = /* @__PURE__ */ new Set(), f = o.state.editor.id, p = i, m = !1, h = null, g = !1, v = 0, y = [], b = [], x = null;
106
- o.dispatchSync(_({
104
+ getHistory: (e) => (i = xe(oe(e)), i.history)
105
+ }), o = () => i?.getPushes() ?? 0, s = () => i?.getLimit() ?? 0, l = le(a, { getNickname: () => e }, { manualStreamFlush: !0 }), u = ge(a, l), d = /* @__PURE__ */ new Set(), p = a.state.editor.id, m = r, h = !1, g = null, _ = !1, v = 0, y = [], b = [], x = null;
106
+ a.dispatchSync(H({
107
107
  width: 0,
108
108
  height: 0
109
109
  }));
110
- let S = r ? he(o) : null, C = () => {
111
- h ||= l.subscribe((e) => {
110
+ let S = n ? he(a) : null, C = () => {
111
+ g ||= l.subscribe((e) => {
112
112
  e.some((e) => $(e.type)) && v++;
113
- for (let t of Array.from(d)) I(t, e);
113
+ for (let t of Array.from(d)) P(t, e);
114
114
  });
115
115
  }, w = (e) => {
116
- if (m) throw new Q(Z.destroyed, e);
116
+ if (h) throw new Q(Z.destroyed, e);
117
117
  }, T = (e) => {
118
118
  if (x) throw Error(`${e} cannot run inside a group`);
119
- }, D = (e) => {
120
- if (w(e), p) throw new Q(Z.readonly, e);
121
- }, O = () => {
122
- let e = c();
119
+ }, E = (e) => {
120
+ if (w(e), m) throw new Q(Z.readonly, e);
121
+ }, D = () => {
122
+ let e = s();
123
123
  if (!e) return;
124
124
  let t = y.reduce((e, { historyEntries: t }) => e + t, 0);
125
125
  for (; t > e;) t -= y.shift().historyEntries;
126
126
  for (; y.length > e;) y.splice(y.findIndex(({ historyEntries: e }) => !e), 1);
127
- }, k = (e, t = {}) => {
128
- D("dispatch"), C();
129
- let n = v, r = s(), i = te(o.state, o.context, [...Se(t.focus), ...e]);
130
- o.dispatchSync(i), i.some((e) => ye(e.type)) && u.flush();
131
- let a = {
127
+ }, O = (e, t = {}) => {
128
+ E("dispatch"), C();
129
+ let n = v, r = o(), i = U(a.state, a.context, [...Se(t.focus), ...e]);
130
+ a.dispatchSync(i), i.some((e) => ye(e.type)) && u.flush();
131
+ let s = {
132
132
  label: t.label ?? null,
133
133
  actions: i.filter((e) => $(e.type)),
134
134
  createdIds: i.filter((e) => be(e.type)).map((e) => e.payload.id),
135
135
  batches: v - n,
136
- historyEntries: s() - r
136
+ historyEntries: o() - r
137
137
  };
138
- return x ? (x.unit.historyEntries += a.historyEntries, x.dispatched = !0) : y.push({
139
- label: a.label,
140
- historyEntries: a.historyEntries
141
- }), a.historyEntries && (b = []), x || O(), a;
142
- }, A = (e, t) => {
143
- if (D("group"), x) return t();
138
+ return x ? (x.unit.historyEntries += s.historyEntries, x.dispatched = !0) : y.push({
139
+ label: s.label,
140
+ historyEntries: s.historyEntries
141
+ }), s.historyEntries && (b = []), x || D(), s;
142
+ }, k = (e, t) => {
143
+ if (E("group"), x) return t();
144
144
  let n = {
145
145
  unit: {
146
146
  label: e,
@@ -152,47 +152,47 @@ function Ce({ nickname: e, toWidth: t = X, presence: r = !0, readonly: i = !1 })
152
152
  try {
153
153
  return t();
154
154
  } finally {
155
- x = null, n.dispatched && (y.push(n.unit), O());
155
+ x = null, n.dispatched && (y.push(n.unit), D());
156
156
  }
157
- }, j = (e, t) => {
157
+ }, A = (e, t) => {
158
158
  for (let n = 0; n < e.historyEntries; n++) t();
159
159
  u.flush();
160
160
  };
161
161
  return Object.freeze({
162
- editorId: f,
162
+ editorId: p,
163
163
  get value() {
164
- return W(o.state);
164
+ return V(a.state);
165
165
  },
166
166
  get state() {
167
- return o.state;
167
+ return a.state;
168
168
  },
169
169
  get isReadonly() {
170
- return p;
170
+ return m;
171
171
  },
172
172
  get isDestroyed() {
173
- return m;
173
+ return h;
174
174
  },
175
175
  setReadonly: (e) => {
176
- p = e;
176
+ m = e;
177
177
  },
178
178
  setInitialValue: (e) => {
179
179
  w("setInitialValue"), T("setInitialValue");
180
- let t = ee(e);
181
- o.dispatchSync(G(), R(ue(t) ? "{}" : t)), o.resetHistory(), y = [], b = [];
180
+ let t = c(e);
181
+ a.dispatchSync(f(), ee(ue(t) ? "{}" : t)), a.resetHistory(), y = [], b = [];
182
182
  },
183
183
  mergeClock: (e) => {
184
- o.context.clock.merge(e);
184
+ a.context.clock.merge(e);
185
185
  },
186
- dispatch: k,
186
+ dispatch: O,
187
187
  receive: (e) => {
188
- m || l.dispatchSync(e);
188
+ h || l.dispatchSync(e);
189
189
  },
190
- group: A,
190
+ group: k,
191
191
  undo: () => {
192
- D("undo"), T("undo"), C();
192
+ E("undo"), T("undo"), C();
193
193
  let e = [], t = y.pop();
194
194
  for (; t && !t.historyEntries;) t.label !== null && e.push(t.label), t = y.pop();
195
- return t ? (j(t, o.undo), b.push(t), {
195
+ return t ? (A(t, a.undo), b.push(t), {
196
196
  label: t.label,
197
197
  entries: t.historyEntries,
198
198
  skipped: e
@@ -203,9 +203,9 @@ function Ce({ nickname: e, toWidth: t = X, presence: r = !0, readonly: i = !1 })
203
203
  };
204
204
  },
205
205
  redo: () => {
206
- D("redo"), T("redo"), C();
206
+ E("redo"), T("redo"), C();
207
207
  let e = b.pop();
208
- return e ? (j(e, o.redo), y.push(e), {
208
+ return e ? (A(e, a.redo), y.push(e), {
209
209
  label: e.label,
210
210
  entries: e.historyEntries,
211
211
  skipped: []
@@ -215,16 +215,16 @@ function Ce({ nickname: e, toWidth: t = X, presence: r = !0, readonly: i = !1 })
215
215
  skipped: []
216
216
  };
217
217
  },
218
- subscribe: (e) => (w("subscribe"), d.add(e), g || (g = !0, h ? o.dispatchSync(n()) : C()), () => {
218
+ subscribe: (e) => (w("subscribe"), d.add(e), _ || (_ = !0, g ? a.dispatchSync(K()) : C()), () => {
219
219
  d.delete(e);
220
220
  }),
221
221
  flushStreamBuffers: () => {
222
- m || u.flush();
222
+ h || u.flush();
223
223
  },
224
224
  destroy: () => {
225
- m || (m = !0, S?.destroy(), h?.(), h = null, d.clear(), l.destroy(), o.destroy(), me(o.state.editor), y = [], b = []);
225
+ h || (h = !0, S?.destroy(), g?.(), g = null, d.clear(), l.destroy(), a.destroy(), me(a.state.editor), y = [], b = []);
226
226
  }
227
227
  });
228
228
  }
229
229
  //#endregion
230
- export { L as BracketType, p as COLUMN_MIN_WIDTH, A as CanvasType, S as ChangeActionTypes, x as ColumnOption, M as ColumnType, re as Database, v as DatabaseVendorList, o as DatabaseVendorToDatabase, g as FocusType, C as Language, e as MEMO_MIN_HEIGHT, w as MEMO_MIN_WIDTH, T as NameCase, P as OrderType, Q as PeerStoreError, Z as PeerStoreErrorCode, ae as RelationshipType, k as SaveSettingType, H as SelectType, V as SharedFollowingActionTypes, D as Show, r as StreamActionTypes, ie as bHas, E as createEngineContext, Ce as createPeerStore, ce as createSchemaSQL, X as defaultToWidth, i as editorActions$, b as indexActions, a as indexActions$, O as indexColumnActions, d as indexColumnActions$, u as measureTableSize, F as memoActions, m as memoActions$, z as relationshipActions, s as relationshipActions$, t as settingsActions, f as settingsActions$, N as tableActions, K as tableActions$, j as tableColumnActions, ne as tableColumnActions$ };
230
+ export { O as BracketType, y as COLUMN_MIN_WIDTH, R as CanvasType, G as ChangeActionTypes, ie as ColumnOption, S as ColumnType, T as Database, n as DatabaseVendorList, g as DatabaseVendorToDatabase, W as FocusType, B as Language, u as MEMO_MIN_HEIGHT, e as MEMO_MIN_WIDTH, D as NameCase, k as OrderType, Q as PeerStoreError, Z as PeerStoreErrorCode, F as RelationshipType, N as SaveSettingType, i as SelectType, r as SharedFollowingActionTypes, ne as Show, m as StreamActionTypes, E as bHas, j as createEngineContext, Ce as createPeerStore, ce as createSchemaSQL, X as defaultToWidth, _ as editorActions$, te as indexActions, h as indexActions$, re as indexColumnActions, s as indexColumnActions$, L as measureTableSize, A as memoActions, b as memoActions$, M as relationshipActions, a as relationshipActions$, d as settingsActions, ae as settingsActions$, C as tableActions, p as tableActions$, z as tableColumnActions, t as tableColumnActions$ };
@@ -1,14 +1,14 @@
1
- import { Zi as e, ba as t, xa as n } from "./store-hooks-DuNN9ZKu.js";
1
+ import { Xi as e, ba as t, ya as n } from "./store-hooks-DuzDVhPy.js";
2
2
  import { DateTime as r } from "luxon";
3
3
  //#region src/services/schema-gc/procGC.ts
4
- function i({ collections: e }, { tableIds: n, tableColumnIds: r, relationshipIds: i, indexIds: a, indexColumnIds: o, memoIds: s }) {
5
- t(e).collection("tableEntities").removeMany(n), t(e).collection("tableColumnEntities").removeMany(r), t(e).collection("relationshipEntities").removeMany(i), t(e).collection("indexEntities").removeMany(a), t(e).collection("indexColumnEntities").removeMany(o), t(e).collection("memoEntities").removeMany(s);
4
+ function i({ collections: e }, { tableIds: t, tableColumnIds: r, relationshipIds: i, indexIds: a, indexColumnIds: o, memoIds: s }) {
5
+ n(e).collection("tableEntities").removeMany(t), n(e).collection("tableColumnEntities").removeMany(r), n(e).collection("relationshipEntities").removeMany(i), n(e).collection("indexEntities").removeMany(a), n(e).collection("indexColumnEntities").removeMany(o), n(e).collection("memoEntities").removeMany(s);
6
6
  }
7
7
  //#endregion
8
8
  //#region src/services/schema-gc/schemaGCService.ts
9
9
  var a = 3, o = class {
10
10
  async run(a) {
11
- let o = JSON.parse(a), c = n(o), { doc: { tableIds: l, memoIds: u, indexIds: d, relationshipIds: f }, collections: p } = c, m = e(l), h = e(u), g = e(d), _ = e(f), v = s(r.now()), y = t(p).collection("tableEntities"), b = t(p).collection("tableColumnEntities"), x = t(p).collection("indexEntities"), S = t(p).collection("indexColumnEntities"), C = t(p).collection("relationshipEntities"), w = t(p).collection("memoEntities"), T = new Set(y.selectAll().filter(v(m)).map(({ id: e }) => e)), E = /* @__PURE__ */ new Set(), D = new Set(C.selectAll().filter(v(_)).map(({ id: e }) => e)), O = new Set(x.selectAll().filter(v(g)).map(({ id: e }) => e)), k = /* @__PURE__ */ new Set(), A = new Set(w.selectAll().filter(v(h)).map(({ id: e }) => e));
11
+ let o = JSON.parse(a), c = t(o), { doc: { tableIds: l, memoIds: u, indexIds: d, relationshipIds: f }, collections: p } = c, m = e(l), h = e(u), g = e(d), _ = e(f), v = s(r.now()), y = n(p).collection("tableEntities"), b = n(p).collection("tableColumnEntities"), x = n(p).collection("indexEntities"), S = n(p).collection("indexColumnEntities"), C = n(p).collection("relationshipEntities"), w = n(p).collection("memoEntities"), T = new Set(y.selectAll().filter(v(m)).map(({ id: e }) => e)), E = /* @__PURE__ */ new Set(), D = new Set(C.selectAll().filter(v(_)).map(({ id: e }) => e)), O = new Set(x.selectAll().filter(v(g)).map(({ id: e }) => e)), k = /* @__PURE__ */ new Set(), A = new Set(w.selectAll().filter(v(h)).map(({ id: e }) => e));
12
12
  b.selectAll().filter(({ tableId: e }) => T.has(e)).forEach(({ id: e }) => E.add(e)), C.selectAll().filter(({ id: e, start: t, end: n }) => !D.has(e) && (T.has(t.tableId) || T.has(n.tableId))).forEach(({ id: e }) => D.add(e)), x.selectAll().filter(({ id: e, tableId: t }) => !O.has(e) && T.has(t)).forEach(({ id: e }) => O.add(e)), S.selectAll().filter(({ indexId: e }) => O.has(e)).forEach(({ id: e }) => k.add(e)), i(c, {
13
13
  tableIds: [...T],
14
14
  tableColumnIds: [...E],