@dineug/erd-editor 3.2.4 → 3.2.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.
@@ -2,6 +2,8 @@ import { FC } from '@dineug/r-html';
2
2
 
3
3
  export type ColumnKeyProps = {
4
4
  keys: number;
5
+ onMouseenter?: (event: MouseEvent) => void;
6
+ onMouseleave?: (event: MouseEvent) => void;
5
7
  };
6
8
  declare const ColumnKey: FC<ColumnKeyProps>;
7
9
  export default ColumnKey;
@@ -10,6 +10,8 @@ export type IconProps = {
10
10
  title?: string;
11
11
  rotate?: number;
12
12
  onClick?: (event: MouseEvent) => void;
13
+ onMouseenter?: (event: MouseEvent) => void;
14
+ onMouseleave?: (event: MouseEvent) => void;
13
15
  };
14
16
  declare const Icon: FC<IconProps>;
15
17
  export default Icon;
@@ -26,6 +26,7 @@ export declare const ActionType: {
26
26
  readonly drawEndRelationship: "editor.drawEndRelationship";
27
27
  readonly drawRelationship: "editor.drawRelationship";
28
28
  readonly hoverColumnMap: "editor.hoverColumnMap";
29
+ readonly hoverRelationshipMap: "editor.hoverRelationshipMap";
29
30
  readonly changeOpenMap: "editor.changeOpenMap";
30
31
  readonly dragstartColumn: "editor.dragstartColumn";
31
32
  readonly dragendColumn: "editor.dragendColumn";
@@ -86,6 +87,9 @@ export type ActionMap = {
86
87
  [ActionType.hoverColumnMap]: {
87
88
  columnIds: string[];
88
89
  };
90
+ [ActionType.hoverRelationshipMap]: {
91
+ relationshipIds: string[];
92
+ };
89
93
  [ActionType.changeOpenMap]: Record<string, boolean>;
90
94
  [ActionType.dragstartColumn]: {
91
95
  tableId: string;
@@ -168,6 +168,15 @@ export declare const hoverColumnMapAction: {
168
168
  toString(): string;
169
169
  type: string;
170
170
  };
171
+ export declare const hoverRelationshipMapAction: {
172
+ (payload: {
173
+ relationshipIds: string[];
174
+ }): import('@dineug/r-html').AnyAction<{
175
+ relationshipIds: string[];
176
+ }>;
177
+ toString(): string;
178
+ type: string;
179
+ };
171
180
  export declare const changeOpenMapAction: {
172
181
  (payload: Record<string, boolean>): import('@dineug/r-html').AnyAction<Record<string, boolean>>;
173
182
  toString(): string;
@@ -227,6 +236,7 @@ export declare const editorReducers: {
227
236
  "editor.drawEndRelationship": ReducerType<"editor.drawEndRelationship">;
228
237
  "editor.drawRelationship": ReducerType<"editor.drawRelationship">;
229
238
  "editor.hoverColumnMap": ReducerType<"editor.hoverColumnMap">;
239
+ "editor.hoverRelationshipMap": ReducerType<"editor.hoverRelationshipMap">;
230
240
  "editor.changeOpenMap": ReducerType<"editor.changeOpenMap">;
231
241
  "editor.dragstartColumn": ReducerType<"editor.dragstartColumn">;
232
242
  "editor.dragendColumn": ReducerType<"editor.dragendColumn">;
@@ -401,6 +411,15 @@ export declare const actions: {
401
411
  toString(): string;
402
412
  type: string;
403
413
  };
414
+ hoverRelationshipMapAction: {
415
+ (payload: {
416
+ relationshipIds: string[];
417
+ }): import('@dineug/r-html').AnyAction<{
418
+ relationshipIds: string[];
419
+ }>;
420
+ toString(): string;
421
+ type: string;
422
+ };
404
423
  changeOpenMapAction: {
405
424
  (payload: Record<string, boolean>): import('@dineug/r-html').AnyAction<Record<string, boolean>>;
406
425
  toString(): string;
@@ -15,6 +15,8 @@ export declare const changeColorAllAction$: (color: string) => GeneratorAction;
15
15
  export declare const loadSchemaSQLAction$: (value: string) => GeneratorAction;
16
16
  export declare const dragstartColumnAction$: ($mod: boolean) => GeneratorAction;
17
17
  export declare const dragoverColumnAction$: (targetId: string, targetTableId: string) => GeneratorAction;
18
+ export declare const columnKeyHoverStartAction$: (columnId: string) => GeneratorAction;
19
+ export declare const columnKeyHoverEndAction$: () => GeneratorAction;
18
20
  export declare const actions$: {
19
21
  loadJsonAction$: (value: string) => GeneratorAction;
20
22
  initialLoadJsonAction$: (value: string) => GeneratorAction;
@@ -29,4 +31,6 @@ export declare const actions$: {
29
31
  loadSchemaSQLAction$: (value: string) => GeneratorAction;
30
32
  dragstartColumnAction$: ($mod: boolean) => GeneratorAction;
31
33
  dragoverColumnAction$: (targetId: string, targetTableId: string) => GeneratorAction;
34
+ columnKeyHoverStartAction$: (columnId: string) => GeneratorAction;
35
+ columnKeyHoverEndAction$: () => GeneratorAction;
32
36
  };
@@ -9,6 +9,7 @@ export type Editor = {
9
9
  focusTable: FocusTable | null;
10
10
  drawRelationship: DrawRelationship | null;
11
11
  hoverColumnMap: Record<string, boolean>;
12
+ hoverRelationshipMap: Record<string, boolean>;
12
13
  openMap: Record<string, boolean>;
13
14
  draggableColumn: DraggableColumn | null;
14
15
  draggingColumnMap: Record<string, boolean>;
@@ -0,0 +1,8 @@
1
+ import { RootState } from '../../../state';
2
+
3
+ type TargetSource = {
4
+ columnId: string;
5
+ relationshipIds: string[];
6
+ };
7
+ export declare function findRelationshipColumn(stack: TargetSource[], state: RootState, result?: TargetSource[]): TargetSource[];
8
+ export {};
@@ -2,7 +2,7 @@ import { Unsubscribe, ValuesType } from '../internal-types';
2
2
  import { EngineContext } from './context';
3
3
  import { AnyAction } from '@dineug/r-html';
4
4
 
5
- type ReducerRecord = {
5
+ type ListenerRecord = {
6
6
  [P in keyof InternalActionMap]: (payload: InternalActionMap[P]) => void;
7
7
  };
8
8
  declare const InternalActionType: {
@@ -14,7 +14,7 @@ type InternalActionMap = {
14
14
  };
15
15
  export type ReplicationStore = {
16
16
  readonly value: string;
17
- on: (reducers: Partial<ReducerRecord>) => Unsubscribe;
17
+ on: (listeners: Partial<ListenerRecord>) => Unsubscribe;
18
18
  setInitialValue: (value: string) => void;
19
19
  dispatch: (actions: Array<AnyAction> | AnyAction) => void;
20
20
  dispatchSync: (actions: Array<AnyAction> | AnyAction) => void;
package/dist/engine.js CHANGED
@@ -1,44 +1,44 @@
1
- import { D as A, E as w, u as x, O as E, G as d, K as G, p as I, bt as l, J as p, Y as O, d2 as T, bs as V, aB as $, d7 as j, d8 as k, V as J, d9 as R, cW as z } from "./schemaGCService-B0HS3Am6.js";
1
+ import { D as C, E as w, w as A, O as x, G as d, K as E, s as G, bv as h, J as l, Y as I, d4 as O, bu as T, aB as V, d9 as $, da as j, V as k, db as J, cY as R } from "./schemaGCService-0Skkcmc5.js";
2
2
  /*!
3
3
  * @dineug/erd-editor
4
- * @version 3.2.4 | Sat Sep 28 2024
4
+ * @version 3.2.6 | Sat Nov 09 2024
5
5
  * @author SeungHwan-Lee <dineug2@gmail.com>
6
6
  * @license MIT
7
7
  */
8
- const b = {
8
+ const Y = {
9
9
  change: "change"
10
10
  };
11
- function D(u) {
12
- const o = /* @__PURE__ */ new Set(), t = A(u, !1), m = w(t), c = new x(), S = new E((e) => t.subscribe((a) => e.next(a))).pipe(d(p), G(200)), n = /* @__PURE__ */ new Set(), f = new z(), g = (e) => (n.has(e) || n.add(e), () => {
11
+ function B(p) {
12
+ const o = /* @__PURE__ */ new Set(), t = C(p, !1), b = w(t), c = new A(), u = new x((e) => t.subscribe((a) => e.next(a))).pipe(d(l), E(200)), n = /* @__PURE__ */ new Set(), m = new R(), S = (e) => (n.has(e) || n.add(e), () => {
13
13
  n.delete(e);
14
- }), i = (e, a) => {
14
+ }), f = (e, a) => {
15
15
  n.forEach((s) => {
16
- const h = Reflect.get(s, e);
17
- O(h, a);
16
+ const r = Reflect.get(s, e);
17
+ I(r, a);
18
18
  });
19
- }, y = (e) => {
20
- const a = T(e);
21
- t.dispatchSync(V($(a) ? "{}" : a)), f.run(l(t.state)).then((s) => {
22
- (s.tableIds.length || s.tableColumnIds.length || s.relationshipIds.length || s.indexIds.length || s.indexColumnIds.length || s.memoIds.length) && (j(t.state, s), t.dispatchSync(k()), i(b.change, void 0));
19
+ }, g = (e) => {
20
+ const a = O(e);
21
+ t.dispatchSync(T(V(a) ? "{}" : a)), m.run(h(t.state)).then((s) => {
22
+ (s.tableIds.length || s.tableColumnIds.length || s.relationshipIds.length || s.indexIds.length || s.indexColumnIds.length || s.memoIds.length) && ($(t.state, s), t.dispatchSync(j()));
23
23
  });
24
- }, r = (e) => {
24
+ }, i = (e) => {
25
25
  c.next([e].flat());
26
- }, v = (e) => {
27
- J(() => r(e));
28
- }, C = () => {
29
- Array.from(o).forEach((e) => e.unsubscribe()), o.clear(), n.clear(), t.destroy(), m.destroy();
26
+ }, y = (e) => {
27
+ k(() => i(e));
28
+ }, v = () => {
29
+ Array.from(o).forEach((e) => e.unsubscribe()), o.clear(), n.clear(), t.destroy(), b.destroy();
30
30
  };
31
- return o.add(S.subscribe(() => i(b.change, void 0))).add(c.pipe(d(p), I((e) => e.map((a) => R(a, "tags")))).subscribe(t.dispatchSync)), Object.freeze({
31
+ return o.add(u.subscribe(() => f(Y.change, void 0))).add(c.pipe(d(l), G((e) => e.map((a) => J(a, "tags")))).subscribe(t.dispatchSync)), Object.freeze({
32
32
  get value() {
33
- return l(t.state);
33
+ return h(t.state);
34
34
  },
35
- on: g,
36
- setInitialValue: y,
37
- dispatch: v,
38
- dispatchSync: r,
39
- destroy: C
35
+ on: S,
36
+ setInitialValue: g,
37
+ dispatch: y,
38
+ dispatchSync: i,
39
+ destroy: v
40
40
  });
41
41
  }
42
42
  export {
43
- D as createReplicationStore
43
+ B as createReplicationStore
44
44
  };