@wcardinal/wcardinal-ui 0.437.0 → 0.439.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 (44) hide show
  1. package/dist/types/wcardinal/ui/d-diagram-serialized.d.ts +2 -2
  2. package/dist/types/wcardinal/ui/shape/action/e-shape-action-expression-with-parameter.d.ts +1 -1
  3. package/dist/types/wcardinal/ui/shape/action/e-shape-action-expression.d.ts +1 -1
  4. package/dist/types/wcardinal/ui/shape/action/e-shape-action-misc-extension.d.ts +7 -2
  5. package/dist/types/wcardinal/ui/shape/action/e-shape-action-open-dialog-extension.d.ts +6 -1
  6. package/dist/types/wcardinal/ui/shape/action/e-shape-action-open-dialog-opener.d.ts +2 -1
  7. package/dist/types/wcardinal/ui/shape/action/e-shape-action-open-extension.d.ts +6 -1
  8. package/dist/types/wcardinal/ui/shape/action/e-shape-action-runtime-misc-extension.d.ts +1 -1
  9. package/dist/types/wcardinal/ui/shape/action/e-shape-action-value-misc-extension.d.ts +2 -2
  10. package/dist/types/wcardinal/ui/shape/action/e-shape-action-value-misc-type.d.ts +1 -1
  11. package/dist/types/wcardinal/ui/util/util-extract.d.ts +13 -0
  12. package/dist/wcardinal/ui/d-diagram-serialized.js.map +1 -1
  13. package/dist/wcardinal/ui/shape/action/e-shape-action-expression-with-parameter.js.map +1 -1
  14. package/dist/wcardinal/ui/shape/action/e-shape-action-expression.js.map +1 -1
  15. package/dist/wcardinal/ui/shape/action/e-shape-action-misc-extension.js.map +1 -1
  16. package/dist/wcardinal/ui/shape/action/e-shape-action-open-dialog-extension.js.map +1 -1
  17. package/dist/wcardinal/ui/shape/action/e-shape-action-open-dialog-opener.js.map +1 -1
  18. package/dist/wcardinal/ui/shape/action/e-shape-action-open-extension.js.map +1 -1
  19. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-extension.js +2 -2
  20. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-extension.js.map +1 -1
  21. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-open-dialog-extension.js +8 -4
  22. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-open-dialog-extension.js.map +1 -1
  23. package/dist/wcardinal/ui/shape/action/e-shape-action-value-misc-extension.js +6 -6
  24. package/dist/wcardinal/ui/shape/action/e-shape-action-value-misc-extension.js.map +1 -1
  25. package/dist/wcardinal/ui/shape/action/e-shape-action-value-misc-type.js.map +1 -1
  26. package/dist/wcardinal/ui/util/util-extract.js +61 -6
  27. package/dist/wcardinal/ui/util/util-extract.js.map +1 -1
  28. package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
  29. package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
  30. package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
  31. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
  32. package/dist/wcardinal-ui-theme-dark.js +1 -1
  33. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  34. package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
  35. package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
  36. package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
  37. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
  38. package/dist/wcardinal-ui-theme-white.js +1 -1
  39. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  40. package/dist/wcardinal-ui.cjs.js +76 -19
  41. package/dist/wcardinal-ui.js +76 -19
  42. package/dist/wcardinal-ui.min.js +2 -2
  43. package/dist/wcardinal-ui.min.js.map +1 -1
  44. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.437.0
2
+ Winter Cardinal UI v0.439.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.437.0
2
+ Winter Cardinal UI v0.439.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.437.0
2
+ Winter Cardinal UI v0.439.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.437.0
2
+ Winter Cardinal UI v0.439.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.437.0
2
+ Winter Cardinal UI v0.439.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.437.0
2
+ Winter Cardinal UI v0.439.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.437.0
2
+ Winter Cardinal UI v0.439.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -23797,17 +23797,61 @@ var UtilExtract = /** @class */ (function () {
23797
23797
  var skipUpdateTransform = (_a = options.transform) === null || _a === void 0 ? void 0 : _a.update;
23798
23798
  return UtilExtractor.toTexture(target, resolution, options.clear, skipUpdateTransform);
23799
23799
  };
23800
+ /**
23801
+ * Extracts pixels from the target.
23802
+ * This method internally creates one render texture and use that to extract pixels from the target.
23803
+ * To free the allocated render texture, please call {@link destroy()}.
23804
+ *
23805
+ * @param options an extraction options
23806
+ * @returns extracted pixels
23807
+ */
23800
23808
  UtilExtract.pixels = function (options) {
23809
+ var _a;
23801
23810
  var renderer = toRenderer(options);
23802
- var texture = this.texture(options);
23803
- try {
23804
- return UtilExtractor.toPixels(texture, renderer);
23811
+ // Create a render texture
23812
+ var target = options.target;
23813
+ var scale = target.transform.scale;
23814
+ var width = Math.floor(target.width * scale.x);
23815
+ var height = Math.floor(target.height * scale.y);
23816
+ var resolution = toResolution(options);
23817
+ var renderTexture = UtilExtract.WORK_RENDER_TEXTURE;
23818
+ if (renderTexture == null) {
23819
+ renderTexture = pixi_js.RenderTexture.create({
23820
+ width: width,
23821
+ height: height,
23822
+ scaleMode: pixi_js.SCALE_MODES.LINEAR,
23823
+ resolution: resolution
23824
+ });
23825
+ UtilExtract.WORK_RENDER_TEXTURE = renderTexture;
23805
23826
  }
23806
- finally {
23807
- if (texture) {
23808
- texture.destroy();
23827
+ else {
23828
+ var baseTexture = renderTexture.baseTexture;
23829
+ var baseTextureWidth = baseTexture.width;
23830
+ var baseTextureHeight = baseTexture.height;
23831
+ var isWidthDirty = baseTextureWidth < width;
23832
+ var isHeightDirty = baseTextureHeight < height;
23833
+ var isResolutionDirty = renderTexture.resolution !== resolution;
23834
+ if (isResolutionDirty || isWidthDirty || isHeightDirty) {
23835
+ if (isResolutionDirty) {
23836
+ baseTexture.resolution = resolution;
23837
+ }
23838
+ renderTexture.resize(Math.max(width, baseTextureWidth), Math.max(height, baseTextureHeight), true);
23809
23839
  }
23810
23840
  }
23841
+ // Render to the render texture
23842
+ var frame = renderTexture.frame;
23843
+ if (frame.x !== 0 || frame.y !== 0 || frame.width !== width || frame.height !== height) {
23844
+ frame.x = 0;
23845
+ frame.y = 0;
23846
+ frame.width = width;
23847
+ frame.height = height;
23848
+ renderTexture.frame = frame;
23849
+ }
23850
+ var targetPosition = target.position;
23851
+ var matrix = new pixi_js.Matrix(1, 0, 0, 1, -targetPosition.x, -targetPosition.y);
23852
+ renderer.render(target, renderTexture, options.clear, matrix, (_a = options.transform) === null || _a === void 0 ? void 0 : _a.update);
23853
+ // Extract pixels
23854
+ return UtilExtractor.toPixels(renderTexture, renderer);
23811
23855
  };
23812
23856
  UtilExtract.canvas = function (options) {
23813
23857
  var _a, _b;
@@ -23830,6 +23874,16 @@ var UtilExtract = /** @class */ (function () {
23830
23874
  UtilExtract.file = function (options) {
23831
23875
  UtilFileDownloader.downloadUrl(options.filename, this.base64(options));
23832
23876
  };
23877
+ /**
23878
+ * Clears all the memories.
23879
+ */
23880
+ UtilExtract.destroy = function () {
23881
+ var texture = this.WORK_RENDER_TEXTURE;
23882
+ if (texture != null) {
23883
+ this.WORK_RENDER_TEXTURE = undefined;
23884
+ texture.destroy(true);
23885
+ }
23886
+ };
23833
23887
  return UtilExtract;
23834
23888
  }());
23835
23889
 
@@ -29616,7 +29670,7 @@ var EShapeActionRuntimeMiscExtension = /** @class */ (function (_super) {
29616
29670
  __extends(EShapeActionRuntimeMiscExtension, _super);
29617
29671
  function EShapeActionRuntimeMiscExtension(value) {
29618
29672
  var _this = _super.call(this, value, EShapeRuntimeReset.NONE) || this;
29619
- _this.parameter = EShapeActionExpressions.ofUnknown(value.parameter);
29673
+ _this.argument = EShapeActionExpressions.ofUnknown(value.argument);
29620
29674
  _this.extension = EShapeActionMiscExtensions.get(value.subtype);
29621
29675
  return _this;
29622
29676
  }
@@ -29625,7 +29679,7 @@ var EShapeActionRuntimeMiscExtension = /** @class */ (function (_super) {
29625
29679
  if (extension != null && this.condition(shape, time, EShapeActionEnvironment)) {
29626
29680
  var diagram = EShapeActions.toDiagram(shape);
29627
29681
  if (diagram != null) {
29628
- extension.executor(this.parameter(shape, time, EShapeActionEnvironment), shape, diagram);
29682
+ extension.executor(this.argument(shape, time, EShapeActionEnvironment), shape, diagram);
29629
29683
  }
29630
29684
  }
29631
29685
  };
@@ -29638,9 +29692,9 @@ var EShapeActionRuntimeMiscExtension = /** @class */ (function (_super) {
29638
29692
  */
29639
29693
  var EShapeActionValueMiscExtension = /** @class */ (function (_super) {
29640
29694
  __extends(EShapeActionValueMiscExtension, _super);
29641
- function EShapeActionValueMiscExtension(subtype, condition, parameter) {
29695
+ function EShapeActionValueMiscExtension(subtype, condition, argument) {
29642
29696
  var _this = _super.call(this, EShapeActionValueType.MISC, condition, subtype) || this;
29643
- _this.parameter = parameter;
29697
+ _this.argument = argument;
29644
29698
  return _this;
29645
29699
  }
29646
29700
  EShapeActionValueMiscExtension.prototype.toRuntime = function () {
@@ -29648,14 +29702,14 @@ var EShapeActionValueMiscExtension = /** @class */ (function (_super) {
29648
29702
  };
29649
29703
  EShapeActionValueMiscExtension.prototype.serialize = function (manager) {
29650
29704
  var conditionId = manager.addResource(this.condition);
29651
- var parameterId = manager.addResource(this.parameter);
29652
- return manager.addResource("[".concat(this.type, ",").concat(conditionId, ",").concat(this.subtype, ",").concat(parameterId, "]"));
29705
+ var argumentId = manager.addResource(this.argument);
29706
+ return manager.addResource("[".concat(this.type, ",").concat(conditionId, ",").concat(this.subtype, ",").concat(argumentId, "]"));
29653
29707
  };
29654
29708
  EShapeActionValueMiscExtension.deserialize = function (serialized, manager) {
29655
29709
  var resources = manager.resources;
29656
29710
  var condition = EShapeActionValues.toResource(1, serialized, resources);
29657
- var parameter = EShapeActionValues.toResource(3, serialized, resources);
29658
- return new EShapeActionValueMiscExtension(serialized[2], condition, parameter);
29711
+ var argument = EShapeActionValues.toResource(3, serialized, resources);
29712
+ return new EShapeActionValueMiscExtension(serialized[2], condition, argument);
29659
29713
  };
29660
29714
  return EShapeActionValueMiscExtension;
29661
29715
  }(EShapeActionValueSubtyped));
@@ -37937,10 +37991,13 @@ var EShapeActionRuntimeOpenDialogExtension = /** @class */ (function (_super) {
37937
37991
  if (this.condition(shape, time, EShapeActionEnvironment)) {
37938
37992
  var target_1 = this.target(shape, time, EShapeActionEnvironment);
37939
37993
  if (target_1 != null) {
37940
- var argument_1 = this.argument(shape, time, EShapeActionEnvironment);
37941
- setTimeout(function () {
37942
- opener(target_1, argument_1, shape);
37943
- }, 0);
37994
+ var diagram_1 = EShapeActions.toDiagram(shape);
37995
+ if (diagram_1 != null) {
37996
+ var argument_1 = this.argument(shape, time, EShapeActionEnvironment);
37997
+ setTimeout(function () {
37998
+ opener(target_1, argument_1, shape, diagram_1);
37999
+ }, 0);
38000
+ }
37944
38001
  }
37945
38002
  }
37946
38003
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.437.0
2
+ Winter Cardinal UI v0.439.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -23794,17 +23794,61 @@
23794
23794
  var skipUpdateTransform = (_a = options.transform) === null || _a === void 0 ? void 0 : _a.update;
23795
23795
  return UtilExtractor.toTexture(target, resolution, options.clear, skipUpdateTransform);
23796
23796
  };
23797
+ /**
23798
+ * Extracts pixels from the target.
23799
+ * This method internally creates one render texture and use that to extract pixels from the target.
23800
+ * To free the allocated render texture, please call {@link destroy()}.
23801
+ *
23802
+ * @param options an extraction options
23803
+ * @returns extracted pixels
23804
+ */
23797
23805
  UtilExtract.pixels = function (options) {
23806
+ var _a;
23798
23807
  var renderer = toRenderer(options);
23799
- var texture = this.texture(options);
23800
- try {
23801
- return UtilExtractor.toPixels(texture, renderer);
23808
+ // Create a render texture
23809
+ var target = options.target;
23810
+ var scale = target.transform.scale;
23811
+ var width = Math.floor(target.width * scale.x);
23812
+ var height = Math.floor(target.height * scale.y);
23813
+ var resolution = toResolution(options);
23814
+ var renderTexture = UtilExtract.WORK_RENDER_TEXTURE;
23815
+ if (renderTexture == null) {
23816
+ renderTexture = pixi_js.RenderTexture.create({
23817
+ width: width,
23818
+ height: height,
23819
+ scaleMode: pixi_js.SCALE_MODES.LINEAR,
23820
+ resolution: resolution
23821
+ });
23822
+ UtilExtract.WORK_RENDER_TEXTURE = renderTexture;
23802
23823
  }
23803
- finally {
23804
- if (texture) {
23805
- texture.destroy();
23824
+ else {
23825
+ var baseTexture = renderTexture.baseTexture;
23826
+ var baseTextureWidth = baseTexture.width;
23827
+ var baseTextureHeight = baseTexture.height;
23828
+ var isWidthDirty = baseTextureWidth < width;
23829
+ var isHeightDirty = baseTextureHeight < height;
23830
+ var isResolutionDirty = renderTexture.resolution !== resolution;
23831
+ if (isResolutionDirty || isWidthDirty || isHeightDirty) {
23832
+ if (isResolutionDirty) {
23833
+ baseTexture.resolution = resolution;
23834
+ }
23835
+ renderTexture.resize(Math.max(width, baseTextureWidth), Math.max(height, baseTextureHeight), true);
23806
23836
  }
23807
23837
  }
23838
+ // Render to the render texture
23839
+ var frame = renderTexture.frame;
23840
+ if (frame.x !== 0 || frame.y !== 0 || frame.width !== width || frame.height !== height) {
23841
+ frame.x = 0;
23842
+ frame.y = 0;
23843
+ frame.width = width;
23844
+ frame.height = height;
23845
+ renderTexture.frame = frame;
23846
+ }
23847
+ var targetPosition = target.position;
23848
+ var matrix = new pixi_js.Matrix(1, 0, 0, 1, -targetPosition.x, -targetPosition.y);
23849
+ renderer.render(target, renderTexture, options.clear, matrix, (_a = options.transform) === null || _a === void 0 ? void 0 : _a.update);
23850
+ // Extract pixels
23851
+ return UtilExtractor.toPixels(renderTexture, renderer);
23808
23852
  };
23809
23853
  UtilExtract.canvas = function (options) {
23810
23854
  var _a, _b;
@@ -23827,6 +23871,16 @@
23827
23871
  UtilExtract.file = function (options) {
23828
23872
  UtilFileDownloader.downloadUrl(options.filename, this.base64(options));
23829
23873
  };
23874
+ /**
23875
+ * Clears all the memories.
23876
+ */
23877
+ UtilExtract.destroy = function () {
23878
+ var texture = this.WORK_RENDER_TEXTURE;
23879
+ if (texture != null) {
23880
+ this.WORK_RENDER_TEXTURE = undefined;
23881
+ texture.destroy(true);
23882
+ }
23883
+ };
23830
23884
  return UtilExtract;
23831
23885
  }());
23832
23886
 
@@ -29613,7 +29667,7 @@
29613
29667
  __extends(EShapeActionRuntimeMiscExtension, _super);
29614
29668
  function EShapeActionRuntimeMiscExtension(value) {
29615
29669
  var _this = _super.call(this, value, EShapeRuntimeReset.NONE) || this;
29616
- _this.parameter = EShapeActionExpressions.ofUnknown(value.parameter);
29670
+ _this.argument = EShapeActionExpressions.ofUnknown(value.argument);
29617
29671
  _this.extension = EShapeActionMiscExtensions.get(value.subtype);
29618
29672
  return _this;
29619
29673
  }
@@ -29622,7 +29676,7 @@
29622
29676
  if (extension != null && this.condition(shape, time, EShapeActionEnvironment)) {
29623
29677
  var diagram = EShapeActions.toDiagram(shape);
29624
29678
  if (diagram != null) {
29625
- extension.executor(this.parameter(shape, time, EShapeActionEnvironment), shape, diagram);
29679
+ extension.executor(this.argument(shape, time, EShapeActionEnvironment), shape, diagram);
29626
29680
  }
29627
29681
  }
29628
29682
  };
@@ -29635,9 +29689,9 @@
29635
29689
  */
29636
29690
  var EShapeActionValueMiscExtension = /** @class */ (function (_super) {
29637
29691
  __extends(EShapeActionValueMiscExtension, _super);
29638
- function EShapeActionValueMiscExtension(subtype, condition, parameter) {
29692
+ function EShapeActionValueMiscExtension(subtype, condition, argument) {
29639
29693
  var _this = _super.call(this, EShapeActionValueType.MISC, condition, subtype) || this;
29640
- _this.parameter = parameter;
29694
+ _this.argument = argument;
29641
29695
  return _this;
29642
29696
  }
29643
29697
  EShapeActionValueMiscExtension.prototype.toRuntime = function () {
@@ -29645,14 +29699,14 @@
29645
29699
  };
29646
29700
  EShapeActionValueMiscExtension.prototype.serialize = function (manager) {
29647
29701
  var conditionId = manager.addResource(this.condition);
29648
- var parameterId = manager.addResource(this.parameter);
29649
- return manager.addResource("[".concat(this.type, ",").concat(conditionId, ",").concat(this.subtype, ",").concat(parameterId, "]"));
29702
+ var argumentId = manager.addResource(this.argument);
29703
+ return manager.addResource("[".concat(this.type, ",").concat(conditionId, ",").concat(this.subtype, ",").concat(argumentId, "]"));
29650
29704
  };
29651
29705
  EShapeActionValueMiscExtension.deserialize = function (serialized, manager) {
29652
29706
  var resources = manager.resources;
29653
29707
  var condition = EShapeActionValues.toResource(1, serialized, resources);
29654
- var parameter = EShapeActionValues.toResource(3, serialized, resources);
29655
- return new EShapeActionValueMiscExtension(serialized[2], condition, parameter);
29708
+ var argument = EShapeActionValues.toResource(3, serialized, resources);
29709
+ return new EShapeActionValueMiscExtension(serialized[2], condition, argument);
29656
29710
  };
29657
29711
  return EShapeActionValueMiscExtension;
29658
29712
  }(EShapeActionValueSubtyped));
@@ -37934,10 +37988,13 @@
37934
37988
  if (this.condition(shape, time, EShapeActionEnvironment)) {
37935
37989
  var target_1 = this.target(shape, time, EShapeActionEnvironment);
37936
37990
  if (target_1 != null) {
37937
- var argument_1 = this.argument(shape, time, EShapeActionEnvironment);
37938
- setTimeout(function () {
37939
- opener(target_1, argument_1, shape);
37940
- }, 0);
37991
+ var diagram_1 = EShapeActions.toDiagram(shape);
37992
+ if (diagram_1 != null) {
37993
+ var argument_1 = this.argument(shape, time, EShapeActionEnvironment);
37994
+ setTimeout(function () {
37995
+ opener(target_1, argument_1, shape, diagram_1);
37996
+ }, 0);
37997
+ }
37941
37998
  }
37942
37999
  }
37943
38000
  }