@wcardinal/wcardinal-ui 0.321.0 → 0.322.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 (39) hide show
  1. package/dist/types/wcardinal/ui/shape/e-shape-acceptor-edge-normal.d.ts +4 -0
  2. package/dist/types/wcardinal/ui/shape/e-shape-acceptor-edge-side.d.ts +9 -0
  3. package/dist/types/wcardinal/ui/shape/e-shape-acceptor-edge-size.d.ts +4 -0
  4. package/dist/types/wcardinal/ui/shape/e-shape-acceptor-edge.d.ts +12 -0
  5. package/dist/types/wcardinal/ui/shape/e-shape-acceptor-impl.d.ts +5 -1
  6. package/dist/types/wcardinal/ui/shape/e-shape-acceptor.d.ts +1 -16
  7. package/dist/types/wcardinal/ui/shape/e-shape-connector-edge-impl.d.ts +5 -1
  8. package/dist/types/wcardinal/ui/shape/e-shape-connector-edge.d.ts +5 -2
  9. package/dist/types/wcardinal/ui/shape/index.d.ts +4 -0
  10. package/dist/types/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-filler.d.ts +7 -5
  11. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge-normal.js +6 -0
  12. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge-normal.js.map +1 -0
  13. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge-side.js +13 -0
  14. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge-side.js.map +1 -0
  15. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge-size.js +6 -0
  16. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge-size.js.map +1 -0
  17. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge.js +6 -0
  18. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge.js.map +1 -0
  19. package/dist/wcardinal/ui/shape/e-shape-acceptor-impl.js +4 -2
  20. package/dist/wcardinal/ui/shape/e-shape-acceptor-impl.js.map +1 -1
  21. package/dist/wcardinal/ui/shape/e-shape-acceptor.js.map +1 -1
  22. package/dist/wcardinal/ui/shape/e-shape-connector-edge-impl.js +24 -3
  23. package/dist/wcardinal/ui/shape/e-shape-connector-edge-impl.js.map +1 -1
  24. package/dist/wcardinal/ui/shape/e-shape-connector-edge.js.map +1 -1
  25. package/dist/wcardinal/ui/shape/index.js +4 -0
  26. package/dist/wcardinal/ui/shape/index.js.map +1 -1
  27. package/dist/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-filler.js +68 -76
  28. package/dist/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-filler.js.map +1 -1
  29. package/dist/wcardinal/ui/shape/variant/e-shape-connector-elbow.js +6 -4
  30. package/dist/wcardinal/ui/shape/variant/e-shape-connector-elbow.js.map +1 -1
  31. package/dist/wcardinal-ui-theme-dark.js +1 -1
  32. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  33. package/dist/wcardinal-ui-theme-white.js +1 -1
  34. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  35. package/dist/wcardinal-ui.cjs.js +118 -90
  36. package/dist/wcardinal-ui.js +118 -90
  37. package/dist/wcardinal-ui.min.js +2 -2
  38. package/dist/wcardinal-ui.min.js.map +1 -1
  39. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.321.0
2
+ Winter Cardinal UI v0.322.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -17614,6 +17614,19 @@ var EShapeEmbeddedDatum = /** @class */ (function () {
17614
17614
  return EShapeEmbeddedDatum;
17615
17615
  }());
17616
17616
 
17617
+ /*
17618
+ * Copyright (C) 2019 Toshiba Corporation
17619
+ * SPDX-License-Identifier: Apache-2.0
17620
+ */
17621
+ var EShapeAcceptorEdgeSide = {
17622
+ NONE: 0,
17623
+ TOP: 1,
17624
+ RIGHT: 2,
17625
+ BOTTOM: 4,
17626
+ LEFT: 8,
17627
+ ALL: 15
17628
+ };
17629
+
17617
17630
  /*
17618
17631
  * Copyright (C) 2019 Toshiba Corporation
17619
17632
  * SPDX-License-Identifier: Apache-2.0
@@ -17622,7 +17635,7 @@ var EShapeAcceptorImpl = /** @class */ (function () {
17622
17635
  function EShapeAcceptorImpl() {
17623
17636
  this._edges = new Map();
17624
17637
  }
17625
- EShapeAcceptorImpl.prototype.add = function (id, type, x, y, nx, ny, sx, sy) {
17638
+ EShapeAcceptorImpl.prototype.add = function (id, type, x, y, nx, ny, sx, sy, side) {
17626
17639
  this._edges.set(id, {
17627
17640
  type: type,
17628
17641
  x: x,
@@ -17631,7 +17644,8 @@ var EShapeAcceptorImpl = /** @class */ (function () {
17631
17644
  size: {
17632
17645
  x: sx !== null && sx !== void 0 ? sx : 0,
17633
17646
  y: sy !== null && sy !== void 0 ? sy : 0
17634
- }
17647
+ },
17648
+ side: side !== null && side !== void 0 ? side : EShapeAcceptorEdgeSide.TOP
17635
17649
  });
17636
17650
  return true;
17637
17651
  };
@@ -17847,6 +17861,7 @@ var EShapeConnectorEdgeImpl = /** @class */ (function () {
17847
17861
  }, undefined);
17848
17862
  this._normalIdRequired = 0;
17849
17863
  this._normalId = 0;
17864
+ this._side = EShapeAcceptorEdgeSide.TOP;
17850
17865
  this._margin = 0;
17851
17866
  this._lockCount = 0;
17852
17867
  this._isAcceptorChanged = false;
@@ -17938,6 +17953,19 @@ var EShapeConnectorEdgeImpl = /** @class */ (function () {
17938
17953
  enumerable: false,
17939
17954
  configurable: true
17940
17955
  });
17956
+ Object.defineProperty(EShapeConnectorEdgeImpl.prototype, "side", {
17957
+ get: function () {
17958
+ return this._side;
17959
+ },
17960
+ set: function (side) {
17961
+ if (this._side !== side) {
17962
+ this._side = side;
17963
+ this.onOtherChange();
17964
+ }
17965
+ },
17966
+ enumerable: false,
17967
+ configurable: true
17968
+ });
17941
17969
  Object.defineProperty(EShapeConnectorEdgeImpl.prototype, "margin", {
17942
17970
  get: function () {
17943
17971
  return this._margin;
@@ -17951,7 +17979,7 @@ var EShapeConnectorEdgeImpl = /** @class */ (function () {
17951
17979
  enumerable: false,
17952
17980
  configurable: true
17953
17981
  });
17954
- EShapeConnectorEdgeImpl.prototype.set = function (acceptorShape, acceptorEdge, acceptorX, acceptorY, margin, x, y, nx, ny) {
17982
+ EShapeConnectorEdgeImpl.prototype.set = function (acceptorShape, acceptorEdge, acceptorX, acceptorY, margin, x, y, nx, ny, side) {
17955
17983
  this.lock();
17956
17984
  this._acceptor.set(acceptorShape, acceptorEdge, acceptorX, acceptorY);
17957
17985
  var local = this._local;
@@ -17974,6 +18002,9 @@ var EShapeConnectorEdgeImpl = /** @class */ (function () {
17974
18002
  else if (ny != null) {
17975
18003
  normal.y = ny;
17976
18004
  }
18005
+ if (side != null) {
18006
+ this.side = side;
18007
+ }
17977
18008
  if (margin != null) {
17978
18009
  this.margin = margin;
17979
18010
  }
@@ -17985,6 +18016,7 @@ var EShapeConnectorEdgeImpl = /** @class */ (function () {
17985
18016
  this._acceptor.copy(source.acceptor);
17986
18017
  this._local.copyFrom(source.local);
17987
18018
  this._normal.copyFrom(source.normal);
18019
+ this.side = source.side;
17988
18020
  this.margin = source.margin;
17989
18021
  this.unlock();
17990
18022
  return this;
@@ -17997,10 +18029,11 @@ var EShapeConnectorEdgeImpl = /** @class */ (function () {
17997
18029
  var edgeId = edge != null ? manager.addResource(edge) : -1;
17998
18030
  var local = this._local;
17999
18031
  var normal = this._normal;
18000
- return manager.addResource("[".concat(shapeUuid, ",").concat(edgeId, ",").concat(local.x, ",").concat(local.y, ",").concat(this._margin, ",").concat(normal.x, ",").concat(normal.y, ",").concat(acceptor.x, ",").concat(acceptor.y, "]"));
18032
+ var side = this._side;
18033
+ return manager.addResource("[".concat(shapeUuid, ",").concat(edgeId, ",").concat(local.x, ",").concat(local.y, ",").concat(this._margin, ",").concat(normal.x, ",").concat(normal.y, ",").concat(acceptor.x, ",").concat(acceptor.y, ",").concat(side, "]"));
18001
18034
  };
18002
18035
  EShapeConnectorEdgeImpl.prototype.deserialize = function (resourceId, mapping, manager) {
18003
- var _a, _b;
18036
+ var _a, _b, _c;
18004
18037
  var resources = manager.resources;
18005
18038
  if (0 <= resourceId && resourceId < resources.length) {
18006
18039
  var parsed = manager.getExtension(resourceId);
@@ -18030,6 +18063,7 @@ var EShapeConnectorEdgeImpl = /** @class */ (function () {
18030
18063
  else {
18031
18064
  normal.set(1, 0);
18032
18065
  }
18066
+ this.side = (_c = parsed[9]) !== null && _c !== void 0 ? _c : EShapeAcceptorEdgeSide.TOP;
18033
18067
  this.margin = parsed[4] || 0;
18034
18068
  this.unlock();
18035
18069
  if (shape) {
@@ -37790,103 +37824,94 @@ var EShapeConnectorElbowPointsFiller = /** @class */ (function () {
37790
37824
  enumerable: false,
37791
37825
  configurable: true
37792
37826
  });
37793
- EShapeConnectorElbowPointsFiller.prototype.toAxis = function (dx, dy, nx, ny) {
37827
+ EShapeConnectorElbowPointsFiller.prototype.toSide = function (x, y) {
37828
+ // y = +x => 0 = x - y
37829
+ // y = -x => 0 = x + y
37830
+ if (0 <= x - y) {
37831
+ if (0 <= x + y) {
37832
+ return EShapeAcceptorEdgeSide.RIGHT;
37833
+ }
37834
+ else {
37835
+ return EShapeAcceptorEdgeSide.BOTTOM;
37836
+ }
37837
+ }
37838
+ else {
37839
+ if (0 <= x + y) {
37840
+ return EShapeAcceptorEdgeSide.TOP;
37841
+ }
37842
+ else {
37843
+ return EShapeAcceptorEdgeSide.LEFT;
37844
+ }
37845
+ }
37846
+ };
37847
+ EShapeConnectorElbowPointsFiller.prototype.toAxis = function (dx, dy, nx, ny, side) {
37848
+ // When (nx, ny) === (0, 0), treat as if side === EShapeAcceptorEdgeSide.ALL.
37794
37849
  var anx = Math.abs(nx);
37795
37850
  var any = Math.abs(ny);
37796
37851
  var threshold = this._threshold;
37797
37852
  if (anx < threshold && any < threshold) {
37798
37853
  if (Math.abs(dx) < Math.abs(dy)) {
37799
37854
  if (0 <= dy) {
37800
- return 2;
37855
+ return 2; // Bottom
37801
37856
  }
37802
37857
  else {
37803
- return 0;
37858
+ return 0; // Top
37804
37859
  }
37805
37860
  }
37806
37861
  else {
37807
37862
  if (0 <= dx) {
37808
- return 1;
37809
- }
37810
- else {
37811
- return 3;
37812
- }
37813
- }
37814
- }
37815
- var s = 0.2;
37816
- if (0 <= nx) {
37817
- if (0 <= ny) {
37818
- if (s < anx && s < any) {
37819
- if (dx < dy) {
37820
- return 2;
37821
- }
37822
- else {
37823
- return 1;
37824
- }
37825
- }
37826
- else if (s < anx) {
37827
- return 1;
37828
- }
37829
- else {
37830
- return 2;
37831
- }
37832
- }
37833
- else {
37834
- if (s < anx && s < any) {
37835
- if (dx < -dy) {
37836
- return 0;
37837
- }
37838
- else {
37839
- return 1;
37840
- }
37841
- }
37842
- else if (s < anx) {
37843
- return 1;
37863
+ return 1; // Right
37844
37864
  }
37845
37865
  else {
37846
- return 0;
37866
+ return 3; // Left
37847
37867
  }
37848
37868
  }
37849
37869
  }
37850
- else {
37851
- if (0 <= ny) {
37852
- if (s < anx && s < any) {
37853
- if (-dx < dy) {
37854
- return 2;
37855
- }
37856
- else {
37857
- return 3;
37858
- }
37859
- }
37860
- else if (s < anx) {
37861
- return 3;
37862
- }
37863
- else {
37864
- return 2;
37865
- }
37866
- }
37867
- else {
37868
- if (s < anx && s < any) {
37869
- if (dy < dx) {
37870
- return 0;
37871
- }
37872
- else {
37873
- return 3;
37874
- }
37875
- }
37876
- else if (s < anx) {
37877
- return 3;
37878
- }
37879
- else {
37880
- return 0;
37881
- }
37870
+ var d = null;
37871
+ var result = 0;
37872
+ // 0 := (0, -1)
37873
+ // | ny, nx | 0 |
37874
+ // | nx, -ny | -1 |
37875
+ if (side & this.toSide(-nx, ny)) {
37876
+ if (d == null || d < -dy) {
37877
+ d = -dy;
37878
+ result = 0;
37879
+ }
37880
+ }
37881
+ // 1 := (1, 0)
37882
+ // | ny, nx | 1 |
37883
+ // | nx, -ny | 0 |
37884
+ if (side & this.toSide(ny, nx)) {
37885
+ if (d == null || d < dx) {
37886
+ d = dx;
37887
+ result = 1;
37888
+ }
37889
+ }
37890
+ // 2 := (0, 1)
37891
+ // | ny, nx | 0 |
37892
+ // | nx, -ny | 1 |
37893
+ if (side & this.toSide(nx, -ny)) {
37894
+ if (d == null || d < dy) {
37895
+ d = dy;
37896
+ result = 2;
37897
+ }
37898
+ }
37899
+ // 3 := (-1, 0)
37900
+ // | ny, nx | -1 |
37901
+ // | nx, -ny | 0 |
37902
+ if (side & this.toSide(-ny, -nx)) {
37903
+ if (d == null || d < -dx) {
37904
+ d = -dx;
37905
+ result = 3;
37882
37906
  }
37883
37907
  }
37908
+ return result;
37884
37909
  };
37885
- EShapeConnectorElbowPointsFiller.prototype.toTailAxis = function (x, y, nx, ny) {
37886
- return this.toAxis(x - this.x, y - this.y, nx, ny);
37910
+ EShapeConnectorElbowPointsFiller.prototype.toTailAxis = function (x, y, nx, ny, side) {
37911
+ return this.toAxis(x - this.x, y - this.y, nx, ny, side);
37887
37912
  };
37888
- EShapeConnectorElbowPointsFiller.prototype.tail = function (x, y, nx, ny, sxh, syh, margin) {
37889
- switch (this.toTailAxis(x, y, nx, ny)) {
37913
+ EShapeConnectorElbowPointsFiller.prototype.tail = function (x, y, nx, ny, sxh, syh, margin, side) {
37914
+ switch (this.toTailAxis(x, y, nx, ny, side)) {
37890
37915
  case 0:
37891
37916
  if (this.y - margin <= y) {
37892
37917
  this.y -= Math.max(margin, syh);
@@ -37935,11 +37960,11 @@ var EShapeConnectorElbowPointsFiller = /** @class */ (function () {
37935
37960
  this.x = x;
37936
37961
  }
37937
37962
  };
37938
- EShapeConnectorElbowPointsFiller.prototype.toHeadAxis = function (x, y, nx, ny) {
37939
- return this.toAxis(this.x - x, this.y - y, nx, ny);
37963
+ EShapeConnectorElbowPointsFiller.prototype.toHeadAxis = function (x, y, nx, ny, side) {
37964
+ return this.toAxis(this.x - x, this.y - y, nx, ny, side);
37940
37965
  };
37941
- EShapeConnectorElbowPointsFiller.prototype.head = function (x, y, nx, ny, sxh, syh, margin) {
37942
- switch (this.toHeadAxis(x, y, nx, ny)) {
37966
+ EShapeConnectorElbowPointsFiller.prototype.head = function (x, y, nx, ny, sxh, syh, margin, side) {
37967
+ switch (this.toHeadAxis(x, y, nx, ny, side)) {
37943
37968
  case 0:
37944
37969
  if (y - margin <= this.y) {
37945
37970
  this.y = y - Math.max(margin, syh);
@@ -38036,6 +38061,7 @@ var EShapeConnectorElbow = /** @class */ (function (_super) {
38036
38061
  var tailNormal = tail.normal;
38037
38062
  var tailNormalX = tailNormal.x;
38038
38063
  var tailNormalY = tailNormal.y;
38064
+ var tailSide = tail.side;
38039
38065
  // Head
38040
38066
  var headLocal = head.local;
38041
38067
  var headLocalX = headLocal.x;
@@ -38043,6 +38069,7 @@ var EShapeConnectorElbow = /** @class */ (function (_super) {
38043
38069
  var headNormal = head.normal;
38044
38070
  var headNormalX = headNormal.x;
38045
38071
  var headNormalY = headNormal.y;
38072
+ var headSide = head.side;
38046
38073
  // Body
38047
38074
  var bodyValues = body.values;
38048
38075
  var bodyValuesLength = bodyValues.length;
@@ -38076,7 +38103,7 @@ var EShapeConnectorElbow = /** @class */ (function (_super) {
38076
38103
  var y3 = bodyValues[1];
38077
38104
  var x4 = cx + c * x3 - s * y3;
38078
38105
  var y4 = cy + c * y3 + s * x3;
38079
- filler.tail(x4, y4, tailNormalX, tailNormalY, sxh, syh, tailMargin);
38106
+ filler.tail(x4, y4, tailNormalX, tailNormalY, sxh, syh, tailMargin, tailSide);
38080
38107
  for (var i = 2; i < bodyValuesLength; i += 2) {
38081
38108
  var x = bodyValues[i + 0];
38082
38109
  var y = bodyValues[i + 1];
@@ -38084,11 +38111,11 @@ var EShapeConnectorElbow = /** @class */ (function (_super) {
38084
38111
  var y5 = cy + c * y + s * x;
38085
38112
  filler.middle(x5, y5);
38086
38113
  }
38087
- filler.head(x1, y1, headNormalX, headNormalY, sxh, syh, headMargin);
38114
+ filler.head(x1, y1, headNormalX, headNormalY, sxh, syh, headMargin, headSide);
38088
38115
  }
38089
38116
  else {
38090
- filler.tail(cx, cy, tailNormalX, tailNormalY, sxh, syh, tailMargin);
38091
- filler.head(x1, y1, headNormalX, headNormalY, sxh, syh, headMargin);
38117
+ filler.tail(cx, cy, tailNormalX, tailNormalY, sxh, syh, tailMargin, tailSide);
38118
+ filler.head(x1, y1, headNormalX, headNormalY, sxh, syh, headMargin, headSide);
38092
38119
  }
38093
38120
  filler.margin(tailMargin, headMargin);
38094
38121
  }
@@ -93745,6 +93772,7 @@ exports.DynamicFontAtlases = DynamicFontAtlases;
93745
93772
  exports.DynamicSDFFontAtlas = DynamicSDFFontAtlas;
93746
93773
  exports.DynamicSDFFontAtlases = DynamicSDFFontAtlases;
93747
93774
  exports.DynamicSDFFontGenerator = DynamicSDFFontGenerator;
93775
+ exports.EShapeAcceptorEdgeSide = EShapeAcceptorEdgeSide;
93748
93776
  exports.EShapeAcceptorImpl = EShapeAcceptorImpl;
93749
93777
  exports.EShapeAcceptorType = EShapeAcceptorType;
93750
93778
  exports.EShapeAcceptors = EShapeAcceptors;