@wcardinal/wcardinal-ui 0.278.0 → 0.279.0

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.
@@ -7,7 +7,7 @@ import { utils } from "pixi.js";
7
7
  import { DCommandClear } from "./d-command-clear";
8
8
  import { DCommandFlag } from "./d-command-flag";
9
9
  var isCommandStorable = function (command) {
10
- return !(command.getFlag() & DCommandFlag.UNSTORABLE) && !command.isMerged();
10
+ return !(command.getFlag() & DCommandFlag.UNSTORABLE);
11
11
  };
12
12
  var isCommandClear = function (command) {
13
13
  return !!(command.getFlag() & DCommandFlag.CLEAR);
@@ -39,17 +39,10 @@ var DControllerCommandImpl = /** @class */ (function (_super) {
39
39
  };
40
40
  DControllerCommandImpl.prototype.merge = function (command) {
41
41
  var done = this._done;
42
- var doneLength = done.length;
43
- if (0 < doneLength) {
44
- command.merge(done[doneLength - 1]);
45
- }
46
- };
47
- DControllerCommandImpl.prototype.execute = function (command) {
48
- this.emit("executing", command, this);
49
42
  var isClear = isCommandClear(command);
50
43
  var isStorable = isCommandStorable(command);
51
44
  if (isClear || isStorable) {
52
- var size = isClear ? this._done.length : this._position;
45
+ var size = isClear ? done.length : this._position;
53
46
  if (0 < size) {
54
47
  this.remove(size);
55
48
  this._position = 0;
@@ -57,8 +50,14 @@ var DControllerCommandImpl = /** @class */ (function (_super) {
57
50
  }
58
51
  this.cleanup();
59
52
  }
60
- var result = command.execute();
61
- if (result === true) {
53
+ var doneLength = done.length;
54
+ if (0 < doneLength) {
55
+ command.merge(done[doneLength - 1]);
56
+ }
57
+ };
58
+ DControllerCommandImpl.prototype.execute = function (command) {
59
+ this.emit("executing", command, this);
60
+ if (command.execute()) {
62
61
  return this.onSuccess(command);
63
62
  }
64
63
  else {
@@ -66,18 +65,8 @@ var DControllerCommandImpl = /** @class */ (function (_super) {
66
65
  }
67
66
  };
68
67
  DControllerCommandImpl.prototype.onSuccess = function (command) {
69
- if (isCommandStorable(command)) {
70
- var done = this._done;
71
- var doneLength = done.length;
72
- if (0 < doneLength) {
73
- var last = done[doneLength - 1];
74
- if (!last.merge(command)) {
75
- done.push(command);
76
- }
77
- }
78
- else {
79
- done.push(command);
80
- }
68
+ if (isCommandStorable(command) && !command.isMerged()) {
69
+ this._done.push(command);
81
70
  if (!isCommandClean(command)) {
82
71
  this.emit("dirty", this);
83
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"d-controller-command-impl.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-controller-command-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,IAAM,iBAAiB,GAAG,UAAC,OAAiB;IAC3C,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC9E,CAAC,CAAC;AAEF,IAAM,cAAc,GAAG,UAAC,OAAiB;IACxC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF,IAAM,cAAc,GAAG,UAAC,OAAiB;IACxC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF;IAA4C,0CAAkB;IAI7D;QAAA,YACC,iBAAO,SAGP;QAFA,KAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,KAAI,CAAC,KAAK,GAAG,EAAE,CAAC;;IACjB,CAAC;IAED,qCAAI,GAAJ;QACC,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAM,UAAU,GAAG,I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I,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;YACvD,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC;YACpB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;YACpC,IAAM,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;YAC9B,IAAI,MAAM,KAAK,IAAI,EAAE;gBACpB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;aAC5B;iBAAM;gBACN,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;aACzB;SACD;IACF,CAAC;IAES,8CAAa,GAAvB,UAAwB,MAAgB;QACvC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;YAC5B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;SACzB;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IAES,2CAAU,GAApB,UAAqB,OAAiB;QACrC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,2CAAU,GAAV;QACC,OAAO,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC3C,CAAC;IACF,6BAAC;AAAD,CAAC,AA9LD,CAA4C,KAAK,CAAC,YAAY,GA8L7D","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { utils } from \"pixi.js\";\nimport { DCommand } from \"./d-command\";\nimport { DCommandClear } from \"./d-command-clear\";\nimport { DCommandFlag } from \"./d-command-flag\";\nimport { DControllerCommand } from \"./d-controller-command\";\n\nconst isCommandStorable = (command: DCommand): boolean => {\n\treturn !(command.getFlag() & DCommandFlag.UNSTORABLE) && !command.isMerged();\n};\n\nconst isCommandClear = (command: DCommand): boolean => {\n\treturn !!(command.getFlag() & DCommandFlag.CLEAR);\n};\n\nconst isCommandClean = (command: DCommand): boolean => {\n\treturn !!(command.getFlag() & DCommandFlag.CLEAN);\n};\n\nexport class DControllerCommandImpl extends utils.EventEmitter implements DControllerCommand {\n\tprotected _position: number;\n\tprotected _done: DCommand[];\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._position = 0;\n\t\tthis._done = [];\n\t}\n\n\tlast(): DCommand | null {\n\t\tconst done = this._done;\n\t\tconst doneLength = done.length;\n\t\tif (0 < doneLength) {\n\t\t\treturn done[doneLength - 1];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpush(command: DCommand): void {\n\t\tthis.merge(command);\n\t\tthis.execute(command);\n\t}\n\n\tprotected merge(command: DCommand): void {\n\t\tconst done = this._done;\n\t\tconst doneLength = done.length;\n\t\tif (0 < doneLength) {\n\t\t\tcommand.merge(done[doneLength - 1]);\n\t\t}\n\t}\n\n\tprotected execute(command: DCommand): void {\n\t\tthis.emit(\"executing\", command, this);\n\t\tconst isClear = isCommandClear(command);\n\t\tconst isStorable = isCommandStorable(command);\n\t\tif (isClear || isStorable) {\n\t\t\tconst size = isClear ? this._done.length : this._position;\n\t\t\tif (0 < size) {\n\t\t\t\tthis.remove(size);\n\t\t\t\tthis._position = 0;\n\t\t\t\tthis.emit(\"change\", this);\n\t\t\t}\n\t\t\tthis.cleanup();\n\t\t}\n\t\tconst result = command.execute();\n\t\tif (result === true) {\n\t\t\treturn this.onSuccess(command);\n\t\t} else {\n\t\t\treturn this.onFail(command);\n\t\t}\n\t}\n\n\tprotected onSuccess(command: DCommand): void {\n\t\tif (isCommandStorable(command)) {\n\t\t\tconst done = this._done;\n\t\t\tconst doneLength = done.length;\n\t\t\tif (0 < doneLength) {\n\t\t\t\tconst last = done[doneLength - 1];\n\t\t\t\tif (!last.merge(command)) {\n\t\t\t\t\tdone.push(command);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdone.push(command);\n\t\t\t}\n\t\t\tif (!isCommandClean(command)) {\n\t\t\t\tthis.emit(\"dirty\", this);\n\t\t\t}\n\t\t}\n\t\tthis.emit(\"change\", this);\n\t\tthis.emit(\"executed\", command, this);\n\t}\n\n\tprotected onFail(command: DCommand): void {\n\t\tcommand.destroy();\n\t\tthis.emit(\"change\", this);\n\t}\n\n\tprotected cleanup(): void {\n\t\tconst done = this._done;\n\t\tconst size = done.length - 100;\n\t\tif (0 < size) {\n\t\t\tfor (let i = 0; i < size; ++i) {\n\t\t\t\tdone[i].destroy();\n\t\t\t\tdone.shift();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected remove(size: number): boolean {\n\t\tconst done = this._done;\n\t\tif (0 < size) {\n\t\t\tconst ifrom = Math.max(0, done.length - size);\n\t\t\tsize = done.length - ifrom;\n\t\t\tif (0 < size) {\n\t\t\t\tfor (let i = ifrom, imax = done.length; i < imax; ++i) {\n\t\t\t\t\tdone[i].destroy();\n\t\t\t\t}\n\n\t\t\t\tdone.splice(ifrom, done.length - ifrom);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tsize(): number {\n\t\treturn this._done.length;\n\t}\n\n\tclear(): void {\n\t\tthis.push(new DCommandClear());\n\t}\n\n\tredo(): void {\n\t\tif (this.isRedoable()) {\n\t\t\tthis.doRedo();\n\t\t}\n\t}\n\n\tprotected doRedo(): void {\n\t\tconst done = this._done;\n\t\tif (0 < this._position) {\n\t\t\tconst current = done[done.length - this._position];\n\t\t\tthis._position -= 1;\n\t\t\tthis.emit(\"change\", this);\n\t\t\tthis.emit(\"redoing\", current, this);\n\t\t\tconst result = current.redo();\n\t\t\tif (result === true) {\n\t\t\t\tthis.onRedoSuccess(current);\n\t\t\t} else {\n\t\t\t\tthis.onRedoFail(current);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onRedoSuccess(redoed: DCommand): void {\n\t\tif (!isCommandClean(redoed)) {\n\t\t\tthis.emit(\"dirty\", this);\n\t\t}\n\t\tthis.emit(\"change\", this);\n\t\tthis.emit(\"redoed\", redoed, this);\n\t}\n\n\tprotected onRedoFail(command: DCommand): void {\n\t\tthis.emit(\"change\", this);\n\t}\n\n\tisRedoable(): boolean {\n\t\treturn 0 < this._position;\n\t}\n\n\tundo(): void {\n\t\tif (this.isUndoable()) {\n\t\t\tthis.doUndo();\n\t\t}\n\t}\n\n\tprotected doUndo(): void {\n\t\tconst done = this._done;\n\t\tif (this._position < done.length) {\n\t\t\tconst current = done[done.length - 1 - this._position];\n\t\t\tthis._position += 1;\n\t\t\tthis.emit(\"change\", this);\n\t\t\tthis.emit(\"undoing\", current, this);\n\t\t\tconst result = current.undo();\n\t\t\tif (result === true) {\n\t\t\t\tthis.onUndoSuccess(current);\n\t\t\t} else {\n\t\t\t\tthis.onUndoFail(current);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onUndoSuccess(undoed: DCommand): void {\n\t\tif (!isCommandClean(undoed)) {\n\t\t\tthis.emit(\"dirty\", this);\n\t\t}\n\t\tthis.emit(\"change\", this);\n\t\tthis.emit(\"undoed\", undoed, this);\n\t}\n\n\tprotected onUndoFail(command: DCommand): void {\n\t\tthis.emit(\"change\", this);\n\t}\n\n\tisUndoable(): boolean {\n\t\treturn this._position < this._done.length;\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-controller-command-impl.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-controller-command-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,IAAM,iBAAiB,GA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AAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC3C,CAAC;IACF,6BAAC;AAAD,CAAC,AApLD,CAA4C,KAAK,CAAC,YAAY,GAoL7D","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { utils } from \"pixi.js\";\nimport { DCommand } from \"./d-command\";\nimport { DCommandClear } from \"./d-command-clear\";\nimport { DCommandFlag } from \"./d-command-flag\";\nimport { DControllerCommand } from \"./d-controller-command\";\n\nconst isCommandStorable = (command: DCommand): boolean => {\n\treturn !(command.getFlag() & DCommandFlag.UNSTORABLE);\n};\n\nconst isCommandClear = (command: DCommand): boolean => {\n\treturn !!(command.getFlag() & DCommandFlag.CLEAR);\n};\n\nconst isCommandClean = (command: DCommand): boolean => {\n\treturn !!(command.getFlag() & DCommandFlag.CLEAN);\n};\n\nexport class DControllerCommandImpl extends utils.EventEmitter implements DControllerCommand {\n\tprotected _position: number;\n\tprotected _done: DCommand[];\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._position = 0;\n\t\tthis._done = [];\n\t}\n\n\tlast(): DCommand | null {\n\t\tconst done = this._done;\n\t\tconst doneLength = done.length;\n\t\tif (0 < doneLength) {\n\t\t\treturn done[doneLength - 1];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpush(command: DCommand): void {\n\t\tthis.merge(command);\n\t\tthis.execute(command);\n\t}\n\n\tprotected merge(command: DCommand): void {\n\t\tconst done = this._done;\n\t\tconst isClear = isCommandClear(command);\n\t\tconst isStorable = isCommandStorable(command);\n\t\tif (isClear || isStorable) {\n\t\t\tconst size = isClear ? done.length : this._position;\n\t\t\tif (0 < size) {\n\t\t\t\tthis.remove(size);\n\t\t\t\tthis._position = 0;\n\t\t\t\tthis.emit(\"change\", this);\n\t\t\t}\n\t\t\tthis.cleanup();\n\t\t}\n\t\tconst doneLength = done.length;\n\t\tif (0 < doneLength) {\n\t\t\tcommand.merge(done[doneLength - 1]);\n\t\t}\n\t}\n\n\tprotected execute(command: DCommand): void {\n\t\tthis.emit(\"executing\", command, this);\n\t\tif (command.execute()) {\n\t\t\treturn this.onSuccess(command);\n\t\t} else {\n\t\t\treturn this.onFail(command);\n\t\t}\n\t}\n\n\tprotected onSuccess(command: DCommand): void {\n\t\tif (isCommandStorable(command) && !command.isMerged()) {\n\t\t\tthis._done.push(command);\n\t\t\tif (!isCommandClean(command)) {\n\t\t\t\tthis.emit(\"dirty\", this);\n\t\t\t}\n\t\t}\n\t\tthis.emit(\"change\", this);\n\t\tthis.emit(\"executed\", command, this);\n\t}\n\n\tprotected onFail(command: DCommand): void {\n\t\tcommand.destroy();\n\t\tthis.emit(\"change\", this);\n\t}\n\n\tprotected cleanup(): void {\n\t\tconst done = this._done;\n\t\tconst size = done.length - 100;\n\t\tif (0 < size) {\n\t\t\tfor (let i = 0; i < size; ++i) {\n\t\t\t\tdone[i].destroy();\n\t\t\t\tdone.shift();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected remove(size: number): boolean {\n\t\tconst done = this._done;\n\t\tif (0 < size) {\n\t\t\tconst ifrom = Math.max(0, done.length - size);\n\t\t\tsize = done.length - ifrom;\n\t\t\tif (0 < size) {\n\t\t\t\tfor (let i = ifrom, imax = done.length; i < imax; ++i) {\n\t\t\t\t\tdone[i].destroy();\n\t\t\t\t}\n\n\t\t\t\tdone.splice(ifrom, done.length - ifrom);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tsize(): number {\n\t\treturn this._done.length;\n\t}\n\n\tclear(): void {\n\t\tthis.push(new DCommandClear());\n\t}\n\n\tredo(): void {\n\t\tif (this.isRedoable()) {\n\t\t\tthis.doRedo();\n\t\t}\n\t}\n\n\tprotected doRedo(): void {\n\t\tconst done = this._done;\n\t\tif (0 < this._position) {\n\t\t\tconst current = done[done.length - this._position];\n\t\t\tthis._position -= 1;\n\t\t\tthis.emit(\"change\", this);\n\t\t\tthis.emit(\"redoing\", current, this);\n\t\t\tconst result = current.redo();\n\t\t\tif (result === true) {\n\t\t\t\tthis.onRedoSuccess(current);\n\t\t\t} else {\n\t\t\t\tthis.onRedoFail(current);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onRedoSuccess(redoed: DCommand): void {\n\t\tif (!isCommandClean(redoed)) {\n\t\t\tthis.emit(\"dirty\", this);\n\t\t}\n\t\tthis.emit(\"change\", this);\n\t\tthis.emit(\"redoed\", redoed, this);\n\t}\n\n\tprotected onRedoFail(command: DCommand): void {\n\t\tthis.emit(\"change\", this);\n\t}\n\n\tisRedoable(): boolean {\n\t\treturn 0 < this._position;\n\t}\n\n\tundo(): void {\n\t\tif (this.isUndoable()) {\n\t\t\tthis.doUndo();\n\t\t}\n\t}\n\n\tprotected doUndo(): void {\n\t\tconst done = this._done;\n\t\tif (this._position < done.length) {\n\t\t\tconst current = done[done.length - 1 - this._position];\n\t\t\tthis._position += 1;\n\t\t\tthis.emit(\"change\", this);\n\t\t\tthis.emit(\"undoing\", current, this);\n\t\t\tconst result = current.undo();\n\t\t\tif (result === true) {\n\t\t\t\tthis.onUndoSuccess(current);\n\t\t\t} else {\n\t\t\t\tthis.onUndoFail(current);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onUndoSuccess(undoed: DCommand): void {\n\t\tif (!isCommandClean(undoed)) {\n\t\t\tthis.emit(\"dirty\", this);\n\t\t}\n\t\tthis.emit(\"change\", this);\n\t\tthis.emit(\"undoed\", undoed, this);\n\t}\n\n\tprotected onUndoFail(command: DCommand): void {\n\t\tthis.emit(\"change\", this);\n\t}\n\n\tisUndoable(): boolean {\n\t\treturn this._position < this._done.length;\n\t}\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.278.0
2
+ Winter Cardinal UI v0.279.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.278.0
2
+ Winter Cardinal UI v0.279.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.278.0
2
+ Winter Cardinal UI v0.279.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.278.0
2
+ Winter Cardinal UI v0.279.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.278.0
2
+ Winter Cardinal UI v0.279.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -66082,7 +66082,7 @@ var DCommandClear = /** @class */ (function (_super) {
66082
66082
  * SPDX-License-Identifier: Apache-2.0
66083
66083
  */
66084
66084
  var isCommandStorable = function (command) {
66085
- return !(command.getFlag() & DCommandFlag.UNSTORABLE) && !command.isMerged();
66085
+ return !(command.getFlag() & DCommandFlag.UNSTORABLE);
66086
66086
  };
66087
66087
  var isCommandClear = function (command) {
66088
66088
  return !!(command.getFlag() & DCommandFlag.CLEAR);
@@ -66114,17 +66114,10 @@ var DControllerCommandImpl = /** @class */ (function (_super) {
66114
66114
  };
66115
66115
  DControllerCommandImpl.prototype.merge = function (command) {
66116
66116
  var done = this._done;
66117
- var doneLength = done.length;
66118
- if (0 < doneLength) {
66119
- command.merge(done[doneLength - 1]);
66120
- }
66121
- };
66122
- DControllerCommandImpl.prototype.execute = function (command) {
66123
- this.emit("executing", command, this);
66124
66117
  var isClear = isCommandClear(command);
66125
66118
  var isStorable = isCommandStorable(command);
66126
66119
  if (isClear || isStorable) {
66127
- var size = isClear ? this._done.length : this._position;
66120
+ var size = isClear ? done.length : this._position;
66128
66121
  if (0 < size) {
66129
66122
  this.remove(size);
66130
66123
  this._position = 0;
@@ -66132,8 +66125,14 @@ var DControllerCommandImpl = /** @class */ (function (_super) {
66132
66125
  }
66133
66126
  this.cleanup();
66134
66127
  }
66135
- var result = command.execute();
66136
- if (result === true) {
66128
+ var doneLength = done.length;
66129
+ if (0 < doneLength) {
66130
+ command.merge(done[doneLength - 1]);
66131
+ }
66132
+ };
66133
+ DControllerCommandImpl.prototype.execute = function (command) {
66134
+ this.emit("executing", command, this);
66135
+ if (command.execute()) {
66137
66136
  return this.onSuccess(command);
66138
66137
  }
66139
66138
  else {
@@ -66141,18 +66140,8 @@ var DControllerCommandImpl = /** @class */ (function (_super) {
66141
66140
  }
66142
66141
  };
66143
66142
  DControllerCommandImpl.prototype.onSuccess = function (command) {
66144
- if (isCommandStorable(command)) {
66145
- var done = this._done;
66146
- var doneLength = done.length;
66147
- if (0 < doneLength) {
66148
- var last = done[doneLength - 1];
66149
- if (!last.merge(command)) {
66150
- done.push(command);
66151
- }
66152
- }
66153
- else {
66154
- done.push(command);
66155
- }
66143
+ if (isCommandStorable(command) && !command.isMerged()) {
66144
+ this._done.push(command);
66156
66145
  if (!isCommandClean(command)) {
66157
66146
  this.emit("dirty", this);
66158
66147
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.278.0
2
+ Winter Cardinal UI v0.279.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -47399,7 +47399,7 @@
47399
47399
  * SPDX-License-Identifier: Apache-2.0
47400
47400
  */
47401
47401
  var isCommandStorable = function (command) {
47402
- return !(command.getFlag() & DCommandFlag.UNSTORABLE) && !command.isMerged();
47402
+ return !(command.getFlag() & DCommandFlag.UNSTORABLE);
47403
47403
  };
47404
47404
  var isCommandClear = function (command) {
47405
47405
  return !!(command.getFlag() & DCommandFlag.CLEAR);
@@ -47431,17 +47431,10 @@
47431
47431
  };
47432
47432
  DControllerCommandImpl.prototype.merge = function (command) {
47433
47433
  var done = this._done;
47434
- var doneLength = done.length;
47435
- if (0 < doneLength) {
47436
- command.merge(done[doneLength - 1]);
47437
- }
47438
- };
47439
- DControllerCommandImpl.prototype.execute = function (command) {
47440
- this.emit("executing", command, this);
47441
47434
  var isClear = isCommandClear(command);
47442
47435
  var isStorable = isCommandStorable(command);
47443
47436
  if (isClear || isStorable) {
47444
- var size = isClear ? this._done.length : this._position;
47437
+ var size = isClear ? done.length : this._position;
47445
47438
  if (0 < size) {
47446
47439
  this.remove(size);
47447
47440
  this._position = 0;
@@ -47449,8 +47442,14 @@
47449
47442
  }
47450
47443
  this.cleanup();
47451
47444
  }
47452
- var result = command.execute();
47453
- if (result === true) {
47445
+ var doneLength = done.length;
47446
+ if (0 < doneLength) {
47447
+ command.merge(done[doneLength - 1]);
47448
+ }
47449
+ };
47450
+ DControllerCommandImpl.prototype.execute = function (command) {
47451
+ this.emit("executing", command, this);
47452
+ if (command.execute()) {
47454
47453
  return this.onSuccess(command);
47455
47454
  }
47456
47455
  else {
@@ -47458,18 +47457,8 @@
47458
47457
  }
47459
47458
  };
47460
47459
  DControllerCommandImpl.prototype.onSuccess = function (command) {
47461
- if (isCommandStorable(command)) {
47462
- var done = this._done;
47463
- var doneLength = done.length;
47464
- if (0 < doneLength) {
47465
- var last = done[doneLength - 1];
47466
- if (!last.merge(command)) {
47467
- done.push(command);
47468
- }
47469
- }
47470
- else {
47471
- done.push(command);
47472
- }
47460
+ if (isCommandStorable(command) && !command.isMerged()) {
47461
+ this._done.push(command);
47473
47462
  if (!isCommandClean(command)) {
47474
47463
  this.emit("dirty", this);
47475
47464
  }