@galacean/effects-core 2.5.5 → 2.5.6

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.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime core for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.5.5
6
+ * Version: v2.5.6
7
7
  */
8
8
 
9
9
  'use strict';
@@ -466,6 +466,8 @@ function getPixelRatio() {
466
466
  }
467
467
  return 1;
468
468
  }
469
+ // window 对象不存在时需要判断
470
+ var canUseBOM = typeof window !== "undefined";
469
471
  function isIOS() {
470
472
  // real ios device not in simulator
471
473
  return !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
@@ -5916,6 +5918,8 @@ function gpuTimer(gl) {
5916
5918
 
5917
5919
  var initErrors = [];
5918
5920
  var glContext = {};
5921
+ var IOS16_LOCKDOWN_MODE = "iOS16 lockdown mode, WebGL Constants not in global";
5922
+ var WEBGL_CONSTANTS_NOT_IN_GLOBAL = "WebGL Constants not in global, please check your environment";
5919
5923
  if (!initErrors.length) {
5920
5924
  initGLContext();
5921
5925
  }
@@ -5927,8 +5931,12 @@ function initGLContext() {
5927
5931
  copy(WebGLRenderingContext);
5928
5932
  copy(WebGLRenderingContext.prototype);
5929
5933
  } else {
5930
- initErrors.push(isIOS() ? // iOS 16 lockdown mode
5931
- "iOS16 lockdown mode, WebGL Constants not in global" : "WebGL Constants not in global, please check your environment");
5934
+ if (canUseBOM) {
5935
+ initErrors.push(// iOS 16 lockdown mode
5936
+ isIOS() ? IOS16_LOCKDOWN_MODE : WEBGL_CONSTANTS_NOT_IN_GLOBAL);
5937
+ } else {
5938
+ initErrors.push(WEBGL_CONSTANTS_NOT_IN_GLOBAL);
5939
+ }
5932
5940
  }
5933
5941
  if (!initErrors.length && !("HALF_FLOAT" in glContext)) {
5934
5942
  // @ts-expect-error set default value
@@ -13481,6 +13489,7 @@ var EventSystem = /*#__PURE__*/ function() {
13481
13489
  var touchstart = "mousedown";
13482
13490
  var touchmove = "mousemove";
13483
13491
  var touchend = "mouseup";
13492
+ var touchcancel = "mouseleave";
13484
13493
  var getTouchEventValue = function(event, x, y, dx, dy) {
13485
13494
  if (dx === void 0) dx = 0;
13486
13495
  if (dy === void 0) dy = 0;
@@ -13534,6 +13543,7 @@ var EventSystem = /*#__PURE__*/ function() {
13534
13543
  touchstart = "touchstart";
13535
13544
  touchmove = "touchmove";
13536
13545
  touchend = "touchend";
13546
+ touchcancel = "touchcancel";
13537
13547
  }
13538
13548
  var _obj;
13539
13549
  this.nativeHandlers = (_obj = {}, _obj[touchstart] = function(event) {
@@ -13576,6 +13586,7 @@ var EventSystem = /*#__PURE__*/ function() {
13576
13586
  }
13577
13587
  currentTouch = 0;
13578
13588
  }, _obj);
13589
+ this.nativeHandlers[touchcancel] = this.nativeHandlers[touchend];
13579
13590
  Object.keys(this.nativeHandlers).forEach(function(name) {
13580
13591
  var _this_target;
13581
13592
  (_this_target = _this.target) == null ? void 0 : _this_target.addEventListener(String(name), _this.nativeHandlers[name]);
@@ -28578,7 +28589,7 @@ function getStandardSpriteContent(sprite, transform) {
28578
28589
  return ret;
28579
28590
  }
28580
28591
 
28581
- var version$1 = "2.5.5";
28592
+ var version$1 = "2.5.6";
28582
28593
  var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
28583
28594
  var standardVersion = /^(\d+)\.(\d+)$/;
28584
28595
  var reverseParticle = false;
@@ -31828,7 +31839,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
31828
31839
  registerPlugin("particle", ParticleLoader, exports.VFXItem);
31829
31840
  registerPlugin("cal", CalculateLoader, exports.VFXItem);
31830
31841
  registerPlugin("interact", InteractLoader, exports.VFXItem);
31831
- var version = "2.5.5";
31842
+ var version = "2.5.6";
31832
31843
  logger.info("Core version: " + version + ".");
31833
31844
 
31834
31845
  exports.AbstractPlugin = AbstractPlugin;
@@ -31955,6 +31966,7 @@ exports.base64ToFile = base64ToFile;
31955
31966
  exports.blend = blend;
31956
31967
  exports.buildLine = buildLine;
31957
31968
  exports.calculateTranslation = calculateTranslation;
31969
+ exports.canUseBOM = canUseBOM;
31958
31970
  exports.canvasPool = canvasPool;
31959
31971
  exports.closePointEps = closePointEps;
31960
31972
  exports.colorGradingFrag = colorGradingFrag;