@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
 
@@ -4729,6 +4729,10 @@
4729
4729
  ALL: 31
4730
4730
  };
4731
4731
 
4732
+ var EShapes = {
4733
+ CURRENT: null
4734
+ };
4735
+
4732
4736
  /*
4733
4737
  * Copyright (C) 2019 Toshiba Corporation
4734
4738
  * SPDX-License-Identifier: Apache-2.0
@@ -4781,7 +4785,9 @@
4781
4785
  }
4782
4786
  var runtime = this.runtime;
4783
4787
  if (runtime != null) {
4788
+ EShapes.CURRENT = this;
4784
4789
  runtime.onResize(this);
4790
+ EShapes.CURRENT = null;
4785
4791
  }
4786
4792
  };
4787
4793
  EShapeBase.prototype.onTransformChange = function () {
@@ -5330,7 +5336,9 @@
5330
5336
  EShapeBase.prototype.onStateChange = function (newState, oldState) {
5331
5337
  var runtime = this.runtime;
5332
5338
  if (runtime != null) {
5339
+ EShapes.CURRENT = this;
5333
5340
  runtime.onStateChange(this, newState, oldState);
5341
+ EShapes.CURRENT = null;
5334
5342
  }
5335
5343
  var children = this.children;
5336
5344
  for (var i = 0, imax = children.length; i < imax; ++i) {
@@ -5389,14 +5397,20 @@
5389
5397
  EShapeBase.prototype.onKeyDown = function (e) {
5390
5398
  var runtime = this.runtime;
5391
5399
  if (runtime) {
5392
- return runtime.onKeyDown(this, e);
5400
+ EShapes.CURRENT = this;
5401
+ var result = runtime.onKeyDown(this, e);
5402
+ EShapes.CURRENT = null;
5403
+ return result;
5393
5404
  }
5394
5405
  return false;
5395
5406
  };
5396
5407
  EShapeBase.prototype.onKeyUp = function (e) {
5397
5408
  var runtime = this.runtime;
5398
5409
  if (runtime) {
5399
- return runtime.onKeyUp(this, e);
5410
+ EShapes.CURRENT = this;
5411
+ var result = runtime.onKeyUp(this, e);
5412
+ EShapes.CURRENT = null;
5413
+ return result;
5400
5414
  }
5401
5415
  return false;
5402
5416
  };
@@ -5404,13 +5418,17 @@
5404
5418
  EShapeBase.prototype.update = function (time) {
5405
5419
  var runtime = this.runtime;
5406
5420
  if (runtime) {
5421
+ EShapes.CURRENT = this;
5407
5422
  runtime.update(this, time);
5423
+ EShapes.CURRENT = null;
5408
5424
  }
5409
5425
  };
5410
5426
  EShapeBase.prototype.onRender = function (time, renderer) {
5411
5427
  var runtime = this.runtime;
5412
5428
  if (runtime) {
5429
+ EShapes.CURRENT = this;
5413
5430
  runtime.onRender(this, time, renderer);
5431
+ EShapes.CURRENT = null;
5414
5432
  }
5415
5433
  };
5416
5434
  EShapeBase.prototype.copy = function (source, part) {
@@ -12154,30 +12172,36 @@
12154
12172
  configurable: true
12155
12173
  });
12156
12174
  EShapeEmbedded.prototype.newEdges = function () {
12175
+ var _a, _b;
12157
12176
  var result = new Map();
12158
12177
  var layers = this.children;
12159
12178
  if (layers != null) {
12160
12179
  var s = this.size;
12161
12180
  var sx = s.x;
12162
12181
  var sy = s.y;
12163
- var sxh = sx * 0.5;
12164
- var syh = sy * 0.5;
12182
+ var work1 = void 0;
12183
+ var work2 = void 0;
12165
12184
  for (var i = 0, imax = layers.length; i < imax; ++i) {
12166
12185
  var layer = layers[i];
12167
- var lp = layer.transform.position;
12168
- var lpx = lp.x + sxh;
12169
- var lpy = lp.y + syh;
12170
12186
  var children = layer.children;
12171
12187
  for (var j = 0, jmax = children.length; j < jmax; ++j) {
12172
12188
  var child = children[j];
12173
12189
  if (child instanceof EShapeEmbeddedAcceptorEdge) {
12174
- child.transform.updateLocalTransform();
12175
- var clt = child.transform.localTransform;
12190
+ child.updateTransform();
12191
+ if (work1 == null) {
12192
+ work1 = ((_a = EShapeEmbedded.WORK_NEW_EDGE1) !== null && _a !== void 0 ? _a : (EShapeEmbedded.WORK_NEW_EDGE1 = new pixi_js.Matrix()))
12193
+ .copyFrom(this.transform.internalTransform)
12194
+ .invert();
12195
+ }
12196
+ if (work2 == null) {
12197
+ work2 = (_b = EShapeEmbedded.WORK_NEW_EDGE2) !== null && _b !== void 0 ? _b : (EShapeEmbedded.WORK_NEW_EDGE2 = new pixi_js.Matrix());
12198
+ }
12199
+ work2.copyFrom(work1).append(child.transform.internalTransform);
12176
12200
  result.set(child.id, {
12177
12201
  type: child.subtype,
12178
- x: this.toEdgePosition(lpx, clt.tx, sxh, sx),
12179
- y: this.toEdgePosition(lpy, clt.ty, syh, sy),
12180
- normal: this.toEdgeNormal(-clt.c, -clt.d),
12202
+ x: this.toEdgePosition(work2.tx, sx),
12203
+ y: this.toEdgePosition(work2.ty, sy),
12204
+ normal: this.toEdgeNormal(-work2.c, -work2.d),
12181
12205
  size: {
12182
12206
  x: 0,
12183
12207
  y: 0
@@ -12190,16 +12214,16 @@
12190
12214
  }
12191
12215
  return result;
12192
12216
  };
12193
- EShapeEmbedded.prototype.toEdgePosition = function (lp, cp, sh, s) {
12217
+ EShapeEmbedded.prototype.toEdgePosition = function (cp, s) {
12194
12218
  if (0.00001 < Math.abs(s)) {
12195
- return (lp + cp - sh) / s;
12219
+ return cp / s;
12196
12220
  }
12197
12221
  return 0;
12198
12222
  };
12199
12223
  EShapeEmbedded.prototype.toEdgeNormal = function (x, y) {
12200
12224
  var d = x * x + y * y;
12201
12225
  if (0.00001 < d) {
12202
- var f = 1 / d;
12226
+ var f = 1 / Math.sqrt(d);
12203
12227
  return {
12204
12228
  x: x * f,
12205
12229
  y: y * f
@@ -16801,6 +16825,7 @@
16801
16825
  clone.parent = result;
16802
16826
  result.children.push(clone);
16803
16827
  }
16828
+ EShapeConnectors.move(this, result);
16804
16829
  result.onChildTransformChange();
16805
16830
  result.toDirty();
16806
16831
  var size = this.size;
@@ -25198,7 +25223,9 @@
25198
25223
  : EShapeActionValueGestureOperationType.NONE);
25199
25224
  runtime.actions.push(new EShapeActionValueGesture("", EShapeActionValueGestureType.LAYER, gestureType).toRuntime());
25200
25225
  actionables.push(shape);
25226
+ EShapes.CURRENT = shape;
25201
25227
  runtime.initialize(shape);
25228
+ EShapes.CURRENT = null;
25202
25229
  }
25203
25230
  if (isInteractive || isDraggable || isPinchable) {
25204
25231
  shape.interactive = true;
@@ -26413,12 +26440,16 @@
26413
26440
  // Action
26414
26441
  this_1.initActions(shape, runtime, actionValueToRuntime);
26415
26442
  // Init the runtime
26443
+ EShapes.CURRENT = shape;
26416
26444
  runtime.initialize(shape);
26445
+ EShapes.CURRENT = null;
26417
26446
  // Shortcut
26418
26447
  var shortcut = shape.shortcut;
26419
26448
  if (shortcut != null) {
26420
26449
  UtilKeyboardEvent.on(shape, shortcut, function (e) {
26450
+ EShapes.CURRENT = shape;
26421
26451
  runtime.onClick(shape, e);
26452
+ EShapes.CURRENT = null;
26422
26453
  });
26423
26454
  }
26424
26455
  // Actionables
@@ -26722,7 +26753,9 @@
26722
26753
  if (found != null) {
26723
26754
  var runtime = found.runtime;
26724
26755
  if (runtime) {
26756
+ EShapes.CURRENT = found;
26725
26757
  runtime.onMove(found, e);
26758
+ EShapes.CURRENT = null;
26726
26759
  }
26727
26760
  }
26728
26761
  }
@@ -26774,7 +26807,9 @@
26774
26807
  while (target != null && target !== except && target instanceof EShapeBase) {
26775
26808
  var runtime = target.runtime;
26776
26809
  if (runtime) {
26810
+ EShapes.CURRENT = target;
26777
26811
  runtime.onOut(target, e);
26812
+ EShapes.CURRENT = null;
26778
26813
  }
26779
26814
  target = target.parent;
26780
26815
  }
@@ -26783,7 +26818,9 @@
26783
26818
  while (target != null && target !== except && target instanceof EShapeBase) {
26784
26819
  var runtime = target.runtime;
26785
26820
  if (runtime) {
26821
+ EShapes.CURRENT = target;
26786
26822
  runtime.onOver(target, e);
26823
+ EShapes.CURRENT = null;
26787
26824
  }
26788
26825
  target = target.parent;
26789
26826
  }
@@ -26797,7 +26834,9 @@
26797
26834
  while (true) {
26798
26835
  var runtime = target.runtime;
26799
26836
  if (runtime) {
26837
+ EShapes.CURRENT = target;
26800
26838
  runtime.onDown(target, e);
26839
+ EShapes.CURRENT = null;
26801
26840
  }
26802
26841
  var parent_3 = target.parent;
26803
26842
  if (parent_3 instanceof EShapeBase) {
@@ -26820,7 +26859,9 @@
26820
26859
  while (true) {
26821
26860
  var runtime = target.runtime;
26822
26861
  if (runtime) {
26862
+ EShapes.CURRENT = target;
26823
26863
  runtime.onUp(target, e);
26864
+ EShapes.CURRENT = null;
26824
26865
  }
26825
26866
  var parent_4 = target.parent;
26826
26867
  if (parent_4 instanceof EShapeBase) {
@@ -26842,7 +26883,9 @@
26842
26883
  while (true) {
26843
26884
  var runtime = target.runtime;
26844
26885
  if (runtime) {
26886
+ EShapes.CURRENT = target;
26845
26887
  runtime.onUpOutside(target, e);
26888
+ EShapes.CURRENT = null;
26846
26889
  }
26847
26890
  var parent_5 = target.parent;
26848
26891
  if (parent_5 instanceof EShapeBase) {
@@ -26865,7 +26908,9 @@
26865
26908
  while (true) {
26866
26909
  var runtime = target.runtime;
26867
26910
  if (runtime) {
26911
+ EShapes.CURRENT = target;
26868
26912
  runtime.onClick(target, e);
26913
+ EShapes.CURRENT = null;
26869
26914
  }
26870
26915
  var parent_6 = target.parent;
26871
26916
  if (parent_6 instanceof EShapeBase) {
@@ -26889,7 +26934,9 @@
26889
26934
  while (true) {
26890
26935
  var runtime = target.runtime;
26891
26936
  if (runtime) {
26937
+ EShapes.CURRENT = target;
26892
26938
  runtime.onDblClick(target, e, interactionManager);
26939
+ EShapes.CURRENT = null;
26893
26940
  }
26894
26941
  var parent_7 = target.parent;
26895
26942
  if (parent_7 instanceof EShapeBase) {
@@ -26910,7 +26957,9 @@
26910
26957
  while (true) {
26911
26958
  var runtime = target.runtime;
26912
26959
  if (runtime) {
26960
+ EShapes.CURRENT = target;
26913
26961
  runtime.onRightClick(target, e);
26962
+ EShapes.CURRENT = null;
26914
26963
  }
26915
26964
  var parent_8 = target.parent;
26916
26965
  if (parent_8 instanceof EShapeBase) {
@@ -26933,7 +26982,9 @@
26933
26982
  while (true) {
26934
26983
  var runtime = target.runtime;
26935
26984
  if (runtime) {
26985
+ EShapes.CURRENT = target;
26936
26986
  runtime.onRightDown(target, e);
26987
+ EShapes.CURRENT = null;
26937
26988
  }
26938
26989
  var parent_9 = target.parent;
26939
26990
  if (parent_9 instanceof EShapeBase) {
@@ -26956,7 +27007,9 @@
26956
27007
  while (true) {
26957
27008
  var runtime = target.runtime;
26958
27009
  if (runtime) {
27010
+ EShapes.CURRENT = target;
26959
27011
  runtime.onRightUp(target, e);
27012
+ EShapes.CURRENT = null;
26960
27013
  }
26961
27014
  var parent_10 = target.parent;
26962
27015
  if (parent_10 instanceof EShapeBase) {
@@ -26978,7 +27031,9 @@
26978
27031
  while (true) {
26979
27032
  var runtime = target.runtime;
26980
27033
  if (runtime) {
27034
+ EShapes.CURRENT = target;
26981
27035
  runtime.onRightUpOutside(target, e);
27036
+ EShapes.CURRENT = null;
26982
27037
  }
26983
27038
  var parent_11 = target.parent;
26984
27039
  if (parent_11 instanceof EShapeBase) {
@@ -27630,6 +27685,12 @@
27630
27685
  var EShapeActions = /** @class */ (function () {
27631
27686
  function EShapeActions() {
27632
27687
  }
27688
+ EShapeActions.getShape = function () {
27689
+ return EShapes.CURRENT;
27690
+ };
27691
+ EShapeActions.getDiagram = function () {
27692
+ return EShapeActions.toDiagram(EShapes.CURRENT);
27693
+ };
27633
27694
  EShapeActions.isDiagram = function (target) {
27634
27695
  return target instanceof DDiagram;
27635
27696
  };
@@ -27732,6 +27793,7 @@
27732
27793
  }
27733
27794
  }
27734
27795
  };
27796
+ EShapeActions.SHAPE = null;
27735
27797
  return EShapeActions;
27736
27798
  }());
27737
27799
 
@@ -44687,7 +44749,7 @@
44687
44749
  clone.parent = result;
44688
44750
  result.children.push(clone);
44689
44751
  }
44690
- EShapeConnectors.moveAll(children, result.children, children, result.children);
44752
+ EShapeConnectors.move(this, result);
44691
44753
  result.onChildTransformChange();
44692
44754
  result.toDirty();
44693
44755
  return result;