Skip to content

Commit 592e84b

Browse files
committed
fix: circular dependency
1 parent 0a85dea commit 592e84b

11 files changed

Lines changed: 520 additions & 494 deletions

File tree

src/editor/js/Actions.js

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import {
1414
mxEventSource,
1515
} from "../../core/mxgraph";
1616

17-
import { Editor, FilenameDialog } from "./Editor";
18-
import { LayersWindow, OutlineWindow } from "./Dialogs";
19-
import { ChangePageSetup } from "./EditorUi";
17+
import { LayersWindow, OutlineWindow, FilenameDialog } from "./Dialogs";
18+
import { PageSetup } from "./PageSetup";
19+
import { EDITOR } from "../utils/constant";
2020

2121
export { Actions, Action };
2222

@@ -53,7 +53,7 @@ Actions.prototype.init = function () {
5353
},
5454
null,
5555
"sprite-undo",
56-
Editor.ctrlKey + "+Z"
56+
EDITOR.CTRL_KEY + "+Z"
5757
);
5858
this.addAction(
5959
"redo",
@@ -62,7 +62,7 @@ Actions.prototype.init = function () {
6262
},
6363
null,
6464
"sprite-redo",
65-
!mxClient.IS_WIN ? Editor.ctrlKey + "+Shift+Z" : Editor.ctrlKey + "+Y"
65+
!mxClient.IS_WIN ? EDITOR.CTRL_KEY + "+Shift+Z" : EDITOR.CTRL_KEY + "+Y"
6666
);
6767
this.addAction(
6868
"cut",
@@ -71,7 +71,7 @@ Actions.prototype.init = function () {
7171
},
7272
null,
7373
"sprite-cut",
74-
Editor.ctrlKey + "+X"
74+
EDITOR.CTRL_KEY + "+X"
7575
);
7676
this.addAction(
7777
"copy",
@@ -84,7 +84,7 @@ Actions.prototype.init = function () {
8484
},
8585
null,
8686
"sprite-copy",
87-
Editor.ctrlKey + "+C"
87+
EDITOR.CTRL_KEY + "+C"
8888
);
8989
this.addAction(
9090
"paste",
@@ -95,7 +95,7 @@ Actions.prototype.init = function () {
9595
},
9696
false,
9797
"sprite-paste",
98-
Editor.ctrlKey + "+V"
98+
EDITOR.CTRL_KEY + "+V"
9999
);
100100
this.addAction("pasteHere", function () {
101101
if (graph.isEnabled() && !graph.isCellLocked(graph.getDefaultParent())) {
@@ -218,7 +218,7 @@ Actions.prototype.init = function () {
218218
},
219219
null,
220220
null,
221-
Editor.ctrlKey + "+Delete"
221+
EDITOR.CTRL_KEY + "+Delete"
222222
);
223223
this.addAction(
224224
"duplicate",
@@ -231,7 +231,7 @@ Actions.prototype.init = function () {
231231
},
232232
null,
233233
null,
234-
Editor.ctrlKey + "+D"
234+
EDITOR.CTRL_KEY + "+D"
235235
);
236236
this.put(
237237
"turn",
@@ -242,7 +242,7 @@ Actions.prototype.init = function () {
242242
},
243243
null,
244244
null,
245-
Editor.ctrlKey + "+R"
245+
EDITOR.CTRL_KEY + "+R"
246246
)
247247
);
248248
this.addAction(
@@ -252,7 +252,7 @@ Actions.prototype.init = function () {
252252
},
253253
null,
254254
null,
255-
Editor.ctrlKey + "+Shift+I"
255+
EDITOR.CTRL_KEY + "+Shift+I"
256256
);
257257
this.addAction(
258258
"selectEdges",
@@ -261,7 +261,7 @@ Actions.prototype.init = function () {
261261
},
262262
null,
263263
null,
264-
Editor.ctrlKey + "+Shift+E"
264+
EDITOR.CTRL_KEY + "+Shift+E"
265265
);
266266
this.addAction(
267267
"selectAll",
@@ -270,7 +270,7 @@ Actions.prototype.init = function () {
270270
},
271271
null,
272272
null,
273-
Editor.ctrlKey + "+A"
273+
EDITOR.CTRL_KEY + "+A"
274274
);
275275
this.addAction(
276276
"selectNone",
@@ -279,7 +279,7 @@ Actions.prototype.init = function () {
279279
},
280280
null,
281281
null,
282-
Editor.ctrlKey + "+Shift+A"
282+
EDITOR.CTRL_KEY + "+Shift+A"
283283
);
284284
this.addAction(
285285
"lockUnlock",
@@ -301,7 +301,7 @@ Actions.prototype.init = function () {
301301
},
302302
null,
303303
null,
304-
Editor.ctrlKey + "+L"
304+
EDITOR.CTRL_KEY + "+L"
305305
);
306306

307307
// Navigation actions
@@ -321,7 +321,7 @@ Actions.prototype.init = function () {
321321
},
322322
null,
323323
null,
324-
Editor.ctrlKey + "+Shift+Home"
324+
EDITOR.CTRL_KEY + "+Shift+Home"
325325
);
326326
this.addAction(
327327
"enterGroup",
@@ -330,7 +330,7 @@ Actions.prototype.init = function () {
330330
},
331331
null,
332332
null,
333-
Editor.ctrlKey + "+Shift+End"
333+
EDITOR.CTRL_KEY + "+Shift+End"
334334
);
335335
this.addAction(
336336
"collapse",
@@ -339,7 +339,7 @@ Actions.prototype.init = function () {
339339
},
340340
null,
341341
null,
342-
Editor.ctrlKey + "+Home"
342+
EDITOR.CTRL_KEY + "+Home"
343343
);
344344
this.addAction(
345345
"expand",
@@ -348,7 +348,7 @@ Actions.prototype.init = function () {
348348
},
349349
null,
350350
null,
351-
Editor.ctrlKey + "+End"
351+
EDITOR.CTRL_KEY + "+End"
352352
);
353353

354354
// Arrange actions
@@ -359,7 +359,7 @@ Actions.prototype.init = function () {
359359
},
360360
null,
361361
null,
362-
Editor.ctrlKey + "+Shift+F"
362+
EDITOR.CTRL_KEY + "+Shift+F"
363363
);
364364
this.addAction(
365365
"toBack",
@@ -368,7 +368,7 @@ Actions.prototype.init = function () {
368368
},
369369
null,
370370
null,
371-
Editor.ctrlKey + "+Shift+B"
371+
EDITOR.CTRL_KEY + "+Shift+B"
372372
);
373373
this.addAction(
374374
"group",
@@ -381,7 +381,7 @@ Actions.prototype.init = function () {
381381
},
382382
null,
383383
null,
384-
Editor.ctrlKey + "+G"
384+
EDITOR.CTRL_KEY + "+G"
385385
);
386386
this.addAction(
387387
"ungroup",
@@ -397,7 +397,7 @@ Actions.prototype.init = function () {
397397
},
398398
null,
399399
null,
400-
Editor.ctrlKey + "+Shift+U"
400+
EDITOR.CTRL_KEY + "+Shift+U"
401401
);
402402
this.addAction("removeFromGroup", function () {
403403
graph.removeCellsFromParent();
@@ -459,7 +459,7 @@ Actions.prototype.init = function () {
459459
},
460460
null,
461461
null,
462-
Editor.ctrlKey + "+Shift+Y"
462+
EDITOR.CTRL_KEY + "+Shift+Y"
463463
);
464464
this.addAction("formattedText", function () {
465465
const refState = graph.getView().getState(graph.getSelectionCell());
@@ -583,7 +583,7 @@ Actions.prototype.init = function () {
583583
},
584584
null,
585585
null,
586-
Editor.ctrlKey + " + (Numpad) / Alt+Mousewheel"
586+
EDITOR.CTRL_KEY + " + (Numpad) / Alt+Mousewheel"
587587
);
588588
this.addAction(
589589
"zoomOut",
@@ -596,7 +596,7 @@ Actions.prototype.init = function () {
596596
},
597597
null,
598598
null,
599-
Editor.ctrlKey + " - (Numpad) / Alt+Mousewheel"
599+
EDITOR.CTRL_KEY + " - (Numpad) / Alt+Mousewheel"
600600
);
601601
this.addAction(
602602
"fitWindow",
@@ -625,7 +625,7 @@ Actions.prototype.init = function () {
625625
},
626626
null,
627627
null,
628-
Editor.ctrlKey + "+Shift+H"
628+
EDITOR.CTRL_KEY + "+Shift+H"
629629
);
630630
this.addAction(
631631
"fitPage",
@@ -653,7 +653,7 @@ Actions.prototype.init = function () {
653653
}),
654654
null,
655655
null,
656-
Editor.ctrlKey + "+J"
656+
EDITOR.CTRL_KEY + "+J"
657657
);
658658
this.addAction(
659659
"fitTwoPages",
@@ -684,7 +684,7 @@ Actions.prototype.init = function () {
684684
}),
685685
null,
686686
null,
687-
Editor.ctrlKey + "+Shift+J"
687+
EDITOR.CTRL_KEY + "+Shift+J"
688688
);
689689
this.addAction(
690690
"fitPageWidth",
@@ -732,7 +732,7 @@ Actions.prototype.init = function () {
732732
}),
733733
null,
734734
null,
735-
Editor.ctrlKey + "+0"
735+
EDITOR.CTRL_KEY + "+0"
736736
)
737737
);
738738
this.addAction(
@@ -746,7 +746,7 @@ Actions.prototype.init = function () {
746746
const val = parseInt(newValue);
747747

748748
if (!isNaN(val) && val > 0) {
749-
const change = new ChangePageSetup(ui, null, null, null, val / 100);
749+
const change = new PageSetup(ui, null, null, null, val / 100);
750750
change.ignoreColor = true;
751751
change.ignoreImage = true;
752752

@@ -770,7 +770,7 @@ Actions.prototype.init = function () {
770770
},
771771
null,
772772
null,
773-
Editor.ctrlKey + "+Shift+G"
773+
EDITOR.CTRL_KEY + "+Shift+G"
774774
);
775775
action.setToggleAction(true);
776776
action.setSelectedCallback(function () {
@@ -797,7 +797,7 @@ Actions.prototype.init = function () {
797797
});
798798

799799
action = this.addAction("collapseExpand", function () {
800-
const change = new ChangePageSetup(ui);
800+
const change = new PageSetup(ui);
801801
change.ignoreColor = true;
802802
change.ignoreImage = true;
803803
change.foldingEnabled = !graph.foldingEnabled;
@@ -932,23 +932,23 @@ Actions.prototype.init = function () {
932932
function () {
933933
document.execCommand("bold", false, null);
934934
},
935-
Editor.ctrlKey + "+B"
935+
EDITOR.CTRL_KEY + "+B"
936936
);
937937
toggleFontStyle(
938938
"italic",
939939
mxConstants.FONT_ITALIC,
940940
function () {
941941
document.execCommand("italic", false, null);
942942
},
943-
Editor.ctrlKey + "+I"
943+
EDITOR.CTRL_KEY + "+I"
944944
);
945945
toggleFontStyle(
946946
"underline",
947947
mxConstants.FONT_UNDERLINE,
948948
function () {
949949
document.execCommand("underline", false, null);
950950
},
951-
Editor.ctrlKey + "+U"
951+
EDITOR.CTRL_KEY + "+U"
952952
);
953953

954954
// Color actions
@@ -1157,7 +1157,7 @@ Actions.prototype.init = function () {
11571157
},
11581158
null,
11591159
null,
1160-
Editor.ctrlKey + "+Shift+D"
1160+
EDITOR.CTRL_KEY + "+Shift+D"
11611161
);
11621162
this.addAction(
11631163
"clearDefaultStyle",
@@ -1168,7 +1168,7 @@ Actions.prototype.init = function () {
11681168
},
11691169
null,
11701170
null,
1171-
Editor.ctrlKey + "+Shift+R"
1171+
EDITOR.CTRL_KEY + "+Shift+R"
11721172
);
11731173
this.addAction("addWaypoint", function () {
11741174
const cell = graph.getSelectionCell();
@@ -1250,7 +1250,7 @@ Actions.prototype.init = function () {
12501250
}),
12511251
null,
12521252
null,
1253-
Editor.ctrlKey + "+,"
1253+
EDITOR.CTRL_KEY + "+,"
12541254
);
12551255
action = this.addAction(
12561256
"superscript",
@@ -1261,7 +1261,7 @@ Actions.prototype.init = function () {
12611261
}),
12621262
null,
12631263
null,
1264-
Editor.ctrlKey + "+."
1264+
EDITOR.CTRL_KEY + "+."
12651265
);
12661266
action = this.addAction(
12671267
"indent",
@@ -1299,7 +1299,7 @@ Actions.prototype.init = function () {
12991299
}),
13001300
null,
13011301
null,
1302-
Editor.ctrlKey + "+Shift+L"
1302+
EDITOR.CTRL_KEY + "+Shift+L"
13031303
);
13041304
action.setToggleAction(true);
13051305
action.setSelectedCallback(
@@ -1314,7 +1314,7 @@ Actions.prototype.init = function () {
13141314
}),
13151315
null,
13161316
null,
1317-
Editor.ctrlKey + "+Shift+P"
1317+
EDITOR.CTRL_KEY + "+Shift+P"
13181318
);
13191319
action.setToggleAction(true);
13201320
action.setSelectedCallback(
@@ -1342,7 +1342,7 @@ Actions.prototype.init = function () {
13421342
}),
13431343
null,
13441344
null,
1345-
Editor.ctrlKey + "+Shift+O"
1345+
EDITOR.CTRL_KEY + "+Shift+O"
13461346
);
13471347

13481348
action.setToggleAction(true);

0 commit comments

Comments
 (0)