@wcardinal/wcardinal-ui 0.455.0 → 0.457.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.
Files changed (36) hide show
  1. package/dist/types/wcardinal/ui/shape/action/e-shape-actions.d.ts +3 -0
  2. package/dist/types/wcardinal/ui/shape/action/e-shapes.d.ts +5 -0
  3. package/dist/types/wcardinal/ui/shape/variant/e-shape-embedded.d.ts +4 -1
  4. package/dist/wcardinal/ui/d-diagram-canvas.js +29 -0
  5. package/dist/wcardinal/ui/d-diagram-canvas.js.map +1 -1
  6. package/dist/wcardinal/ui/d-diagram-layer.js +3 -0
  7. package/dist/wcardinal/ui/d-diagram-layer.js.map +1 -1
  8. package/dist/wcardinal/ui/shape/action/e-shape-actions.js +8 -0
  9. package/dist/wcardinal/ui/shape/action/e-shape-actions.js.map +1 -1
  10. package/dist/wcardinal/ui/shape/action/e-shapes.js +4 -0
  11. package/dist/wcardinal/ui/shape/action/e-shapes.js.map +1 -0
  12. package/dist/wcardinal/ui/shape/variant/e-shape-base.js +17 -2
  13. package/dist/wcardinal/ui/shape/variant/e-shape-base.js.map +1 -1
  14. package/dist/wcardinal/ui/shape/variant/e-shape-embedded-layer.js +2 -0
  15. package/dist/wcardinal/ui/shape/variant/e-shape-embedded-layer.js.map +1 -1
  16. package/dist/wcardinal/ui/shape/variant/e-shape-embedded.js +20 -13
  17. package/dist/wcardinal/ui/shape/variant/e-shape-embedded.js.map +1 -1
  18. package/dist/wcardinal/ui/shape/variant/e-shape-group.js +1 -1
  19. package/dist/wcardinal/ui/shape/variant/e-shape-group.js.map +1 -1
  20. package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
  21. package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
  22. package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
  23. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
  24. package/dist/wcardinal-ui-theme-dark.js +1 -1
  25. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  26. package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
  27. package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
  28. package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
  29. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
  30. package/dist/wcardinal-ui-theme-white.js +1 -1
  31. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  32. package/dist/wcardinal-ui.cjs.js +79 -17
  33. package/dist/wcardinal-ui.js +79 -17
  34. package/dist/wcardinal-ui.min.js +2 -2
  35. package/dist/wcardinal-ui.min.js.map +1 -1
  36. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.455.0
2
+ Winter Cardinal UI v0.457.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.455.0
2
+ Winter Cardinal UI v0.457.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.455.0
2
+ Winter Cardinal UI v0.457.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.455.0
2
+ Winter Cardinal UI v0.457.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.455.0
2
+ Winter Cardinal UI v0.457.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.455.0
2
+ Winter Cardinal UI v0.457.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.455.0
2
+ Winter Cardinal UI v0.457.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.455.0
2
+ Winter Cardinal UI v0.457.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.455.0
2
+ Winter Cardinal UI v0.457.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -4732,6 +4732,10 @@ var EShapeLockPart = {
4732
4732
  ALL: 31
4733
4733
  };
4734
4734
 
4735
+ var EShapes = {
4736
+ CURRENT: null
4737
+ };
4738
+
4735
4739
  /*
4736
4740
  * Copyright (C) 2019 Toshiba Corporation
4737
4741
  * SPDX-License-Identifier: Apache-2.0
@@ -4784,7 +4788,9 @@ var EShapeBase = /** @class */ (function (_super) {
4784
4788
  }
4785
4789
  var runtime = this.runtime;
4786
4790
  if (runtime != null) {
4791
+ EShapes.CURRENT = this;
4787
4792
  runtime.onResize(this);
4793
+ EShapes.CURRENT = null;
4788
4794
  }
4789
4795
  };
4790
4796
  EShapeBase.prototype.onTransformChange = function () {
@@ -5333,7 +5339,9 @@ var EShapeBase = /** @class */ (function (_super) {
5333
5339
  EShapeBase.prototype.onStateChange = function (newState, oldState) {
5334
5340
  var runtime = this.runtime;
5335
5341
  if (runtime != null) {
5342
+ EShapes.CURRENT = this;
5336
5343
  runtime.onStateChange(this, newState, oldState);
5344
+ EShapes.CURRENT = null;
5337
5345
  }
5338
5346
  var children = this.children;
5339
5347
  for (var i = 0, imax = children.length; i < imax; ++i) {
@@ -5392,14 +5400,20 @@ var EShapeBase = /** @class */ (function (_super) {
5392
5400
  EShapeBase.prototype.onKeyDown = function (e) {
5393
5401
  var runtime = this.runtime;
5394
5402
  if (runtime) {
5395
- return runtime.onKeyDown(this, e);
5403
+ EShapes.CURRENT = this;
5404
+ var result = runtime.onKeyDown(this, e);
5405
+ EShapes.CURRENT = null;
5406
+ return result;
5396
5407
  }
5397
5408
  return false;
5398
5409
  };
5399
5410
  EShapeBase.prototype.onKeyUp = function (e) {
5400
5411
  var runtime = this.runtime;
5401
5412
  if (runtime) {
5402
- return runtime.onKeyUp(this, e);
5413
+ EShapes.CURRENT = this;
5414
+ var result = runtime.onKeyUp(this, e);
5415
+ EShapes.CURRENT = null;
5416
+ return result;
5403
5417
  }
5404
5418
  return false;
5405
5419
  };
@@ -5407,13 +5421,17 @@ var EShapeBase = /** @class */ (function (_super) {
5407
5421
  EShapeBase.prototype.update = function (time) {
5408
5422
  var runtime = this.runtime;
5409
5423
  if (runtime) {
5424
+ EShapes.CURRENT = this;
5410
5425
  runtime.update(this, time);
5426
+ EShapes.CURRENT = null;
5411
5427
  }
5412
5428
  };
5413
5429
  EShapeBase.prototype.onRender = function (time, renderer) {
5414
5430
  var runtime = this.runtime;
5415
5431
  if (runtime) {
5432
+ EShapes.CURRENT = this;
5416
5433
  runtime.onRender(this, time, renderer);
5434
+ EShapes.CURRENT = null;
5417
5435
  }
5418
5436
  };
5419
5437
  EShapeBase.prototype.copy = function (source, part) {
@@ -12157,30 +12175,36 @@ var EShapeEmbedded = /** @class */ (function (_super) {
12157
12175
  configurable: true
12158
12176
  });
12159
12177
  EShapeEmbedded.prototype.newEdges = function () {
12178
+ var _a, _b;
12160
12179
  var result = new Map();
12161
12180
  var layers = this.children;
12162
12181
  if (layers != null) {
12163
12182
  var s = this.size;
12164
12183
  var sx = s.x;
12165
12184
  var sy = s.y;
12166
- var sxh = sx * 0.5;
12167
- var syh = sy * 0.5;
12185
+ var work1 = void 0;
12186
+ var work2 = void 0;
12168
12187
  for (var i = 0, imax = layers.length; i < imax; ++i) {
12169
12188
  var layer = layers[i];
12170
- var lp = layer.transform.position;
12171
- var lpx = lp.x + sxh;
12172
- var lpy = lp.y + syh;
12173
12189
  var children = layer.children;
12174
12190
  for (var j = 0, jmax = children.length; j < jmax; ++j) {
12175
12191
  var child = children[j];
12176
12192
  if (child instanceof EShapeEmbeddedAcceptorEdge) {
12177
- child.transform.updateLocalTransform();
12178
- var clt = child.transform.localTransform;
12193
+ child.updateTransform();
12194
+ if (work1 == null) {
12195
+ work1 = ((_a = EShapeEmbedded.WORK_NEW_EDGE1) !== null && _a !== void 0 ? _a : (EShapeEmbedded.WORK_NEW_EDGE1 = new pixi_js.Matrix()))
12196
+ .copyFrom(this.transform.internalTransform)
12197
+ .invert();
12198
+ }
12199
+ if (work2 == null) {
12200
+ work2 = (_b = EShapeEmbedded.WORK_NEW_EDGE2) !== null && _b !== void 0 ? _b : (EShapeEmbedded.WORK_NEW_EDGE2 = new pixi_js.Matrix());
12201
+ }
12202
+ work2.copyFrom(work1).append(child.transform.internalTransform);
12179
12203
  result.set(child.id, {
12180
12204
  type: child.subtype,
12181
- x: this.toEdgePosition(lpx, clt.tx, sxh, sx),
12182
- y: this.toEdgePosition(lpy, clt.ty, syh, sy),
12183
- normal: this.toEdgeNormal(-clt.c, -clt.d),
12205
+ x: this.toEdgePosition(work2.tx, sx),
12206
+ y: this.toEdgePosition(work2.ty, sy),
12207
+ normal: this.toEdgeNormal(-work2.c, -work2.d),
12184
12208
  size: {
12185
12209
  x: 0,
12186
12210
  y: 0
@@ -12193,16 +12217,16 @@ var EShapeEmbedded = /** @class */ (function (_super) {
12193
12217
  }
12194
12218
  return result;
12195
12219
  };
12196
- EShapeEmbedded.prototype.toEdgePosition = function (lp, cp, sh, s) {
12220
+ EShapeEmbedded.prototype.toEdgePosition = function (cp, s) {
12197
12221
  if (0.00001 < Math.abs(s)) {
12198
- return (lp + cp - sh) / s;
12222
+ return cp / s;
12199
12223
  }
12200
12224
  return 0;
12201
12225
  };
12202
12226
  EShapeEmbedded.prototype.toEdgeNormal = function (x, y) {
12203
12227
  var d = x * x + y * y;
12204
12228
  if (0.00001 < d) {
12205
- var f = 1 / d;
12229
+ var f = 1 / Math.sqrt(d);
12206
12230
  return {
12207
12231
  x: x * f,
12208
12232
  y: y * f
@@ -16804,6 +16828,7 @@ var EShapeEmbeddedLayer = /** @class */ (function (_super) {
16804
16828
  clone.parent = result;
16805
16829
  result.children.push(clone);
16806
16830
  }
16831
+ EShapeConnectors.move(this, result);
16807
16832
  result.onChildTransformChange();
16808
16833
  result.toDirty();
16809
16834
  var size = this.size;
@@ -25201,7 +25226,9 @@ var DDiagramLayer = /** @class */ (function (_super) {
25201
25226
  : EShapeActionValueGestureOperationType.NONE);
25202
25227
  runtime.actions.push(new EShapeActionValueGesture("", EShapeActionValueGestureType.LAYER, gestureType).toRuntime());
25203
25228
  actionables.push(shape);
25229
+ EShapes.CURRENT = shape;
25204
25230
  runtime.initialize(shape);
25231
+ EShapes.CURRENT = null;
25205
25232
  }
25206
25233
  if (isInteractive || isDraggable || isPinchable) {
25207
25234
  shape.interactive = true;
@@ -26416,12 +26443,16 @@ var DDiagramCanvas = /** @class */ (function (_super) {
26416
26443
  // Action
26417
26444
  this_1.initActions(shape, runtime, actionValueToRuntime);
26418
26445
  // Init the runtime
26446
+ EShapes.CURRENT = shape;
26419
26447
  runtime.initialize(shape);
26448
+ EShapes.CURRENT = null;
26420
26449
  // Shortcut
26421
26450
  var shortcut = shape.shortcut;
26422
26451
  if (shortcut != null) {
26423
26452
  UtilKeyboardEvent.on(shape, shortcut, function (e) {
26453
+ EShapes.CURRENT = shape;
26424
26454
  runtime.onClick(shape, e);
26455
+ EShapes.CURRENT = null;
26425
26456
  });
26426
26457
  }
26427
26458
  // Actionables
@@ -26725,7 +26756,9 @@ var DDiagramCanvas = /** @class */ (function (_super) {
26725
26756
  if (found != null) {
26726
26757
  var runtime = found.runtime;
26727
26758
  if (runtime) {
26759
+ EShapes.CURRENT = found;
26728
26760
  runtime.onMove(found, e);
26761
+ EShapes.CURRENT = null;
26729
26762
  }
26730
26763
  }
26731
26764
  }
@@ -26777,7 +26810,9 @@ var DDiagramCanvas = /** @class */ (function (_super) {
26777
26810
  while (target != null && target !== except && target instanceof EShapeBase) {
26778
26811
  var runtime = target.runtime;
26779
26812
  if (runtime) {
26813
+ EShapes.CURRENT = target;
26780
26814
  runtime.onOut(target, e);
26815
+ EShapes.CURRENT = null;
26781
26816
  }
26782
26817
  target = target.parent;
26783
26818
  }
@@ -26786,7 +26821,9 @@ var DDiagramCanvas = /** @class */ (function (_super) {
26786
26821
  while (target != null && target !== except && target instanceof EShapeBase) {
26787
26822
  var runtime = target.runtime;
26788
26823
  if (runtime) {
26824
+ EShapes.CURRENT = target;
26789
26825
  runtime.onOver(target, e);
26826
+ EShapes.CURRENT = null;
26790
26827
  }
26791
26828
  target = target.parent;
26792
26829
  }
@@ -26800,7 +26837,9 @@ var DDiagramCanvas = /** @class */ (function (_super) {
26800
26837
  while (true) {
26801
26838
  var runtime = target.runtime;
26802
26839
  if (runtime) {
26840
+ EShapes.CURRENT = target;
26803
26841
  runtime.onDown(target, e);
26842
+ EShapes.CURRENT = null;
26804
26843
  }
26805
26844
  var parent_3 = target.parent;
26806
26845
  if (parent_3 instanceof EShapeBase) {
@@ -26823,7 +26862,9 @@ var DDiagramCanvas = /** @class */ (function (_super) {
26823
26862
  while (true) {
26824
26863
  var runtime = target.runtime;
26825
26864
  if (runtime) {
26865
+ EShapes.CURRENT = target;
26826
26866
  runtime.onUp(target, e);
26867
+ EShapes.CURRENT = null;
26827
26868
  }
26828
26869
  var parent_4 = target.parent;
26829
26870
  if (parent_4 instanceof EShapeBase) {
@@ -26845,7 +26886,9 @@ var DDiagramCanvas = /** @class */ (function (_super) {
26845
26886
  while (true) {
26846
26887
  var runtime = target.runtime;
26847
26888
  if (runtime) {
26889
+ EShapes.CURRENT = target;
26848
26890
  runtime.onUpOutside(target, e);
26891
+ EShapes.CURRENT = null;
26849
26892
  }
26850
26893
  var parent_5 = target.parent;
26851
26894
  if (parent_5 instanceof EShapeBase) {
@@ -26868,7 +26911,9 @@ var DDiagramCanvas = /** @class */ (function (_super) {
26868
26911
  while (true) {
26869
26912
  var runtime = target.runtime;
26870
26913
  if (runtime) {
26914
+ EShapes.CURRENT = target;
26871
26915
  runtime.onClick(target, e);
26916
+ EShapes.CURRENT = null;
26872
26917
  }
26873
26918
  var parent_6 = target.parent;
26874
26919
  if (parent_6 instanceof EShapeBase) {
@@ -26892,7 +26937,9 @@ var DDiagramCanvas = /** @class */ (function (_super) {
26892
26937
  while (true) {
26893
26938
  var runtime = target.runtime;
26894
26939
  if (runtime) {
26940
+ EShapes.CURRENT = target;
26895
26941
  runtime.onDblClick(target, e, interactionManager);
26942
+ EShapes.CURRENT = null;
26896
26943
  }
26897
26944
  var parent_7 = target.parent;
26898
26945
  if (parent_7 instanceof EShapeBase) {
@@ -26913,7 +26960,9 @@ var DDiagramCanvas = /** @class */ (function (_super) {
26913
26960
  while (true) {
26914
26961
  var runtime = target.runtime;
26915
26962
  if (runtime) {
26963
+ EShapes.CURRENT = target;
26916
26964
  runtime.onRightClick(target, e);
26965
+ EShapes.CURRENT = null;
26917
26966
  }
26918
26967
  var parent_8 = target.parent;
26919
26968
  if (parent_8 instanceof EShapeBase) {
@@ -26936,7 +26985,9 @@ var DDiagramCanvas = /** @class */ (function (_super) {
26936
26985
  while (true) {
26937
26986
  var runtime = target.runtime;
26938
26987
  if (runtime) {
26988
+ EShapes.CURRENT = target;
26939
26989
  runtime.onRightDown(target, e);
26990
+ EShapes.CURRENT = null;
26940
26991
  }
26941
26992
  var parent_9 = target.parent;
26942
26993
  if (parent_9 instanceof EShapeBase) {
@@ -26959,7 +27010,9 @@ var DDiagramCanvas = /** @class */ (function (_super) {
26959
27010
  while (true) {
26960
27011
  var runtime = target.runtime;
26961
27012
  if (runtime) {
27013
+ EShapes.CURRENT = target;
26962
27014
  runtime.onRightUp(target, e);
27015
+ EShapes.CURRENT = null;
26963
27016
  }
26964
27017
  var parent_10 = target.parent;
26965
27018
  if (parent_10 instanceof EShapeBase) {
@@ -26981,7 +27034,9 @@ var DDiagramCanvas = /** @class */ (function (_super) {
26981
27034
  while (true) {
26982
27035
  var runtime = target.runtime;
26983
27036
  if (runtime) {
27037
+ EShapes.CURRENT = target;
26984
27038
  runtime.onRightUpOutside(target, e);
27039
+ EShapes.CURRENT = null;
26985
27040
  }
26986
27041
  var parent_11 = target.parent;
26987
27042
  if (parent_11 instanceof EShapeBase) {
@@ -27633,6 +27688,12 @@ var DDiagram = /** @class */ (function (_super) {
27633
27688
  var EShapeActions = /** @class */ (function () {
27634
27689
  function EShapeActions() {
27635
27690
  }
27691
+ EShapeActions.getShape = function () {
27692
+ return EShapes.CURRENT;
27693
+ };
27694
+ EShapeActions.getDiagram = function () {
27695
+ return EShapeActions.toDiagram(EShapes.CURRENT);
27696
+ };
27636
27697
  EShapeActions.isDiagram = function (target) {
27637
27698
  return target instanceof DDiagram;
27638
27699
  };
@@ -27735,6 +27796,7 @@ var EShapeActions = /** @class */ (function () {
27735
27796
  }
27736
27797
  }
27737
27798
  };
27799
+ EShapeActions.SHAPE = null;
27738
27800
  return EShapeActions;
27739
27801
  }());
27740
27802
 
@@ -44690,7 +44752,7 @@ var EShapeGroup = /** @class */ (function (_super) {
44690
44752
  clone.parent = result;
44691
44753
  result.children.push(clone);
44692
44754
  }
44693
- EShapeConnectors.moveAll(children, result.children, children, result.children);
44755
+ EShapeConnectors.move(this, result);
44694
44756
  result.onChildTransformChange();
44695
44757
  result.toDirty();
44696
44758
  return result;