@galacean/effects-plugin-alipay-downgrade 2.0.0-alpha.21 → 2.0.0-alpha.22

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/alipay.js CHANGED
@@ -582,7 +582,7 @@ function nativeLogger(type, msg) {
582
582
  }
583
583
  }
584
584
 
585
- var version = "2.0.0-alpha.21";
585
+ var version = "2.0.0-alpha.22";
586
586
  EFFECTS.registerPlugin("alipay-downgrade", AlipayDowngradePlugin, DowngradeVFXItem, true);
587
587
  EFFECTS.logger.info("Plugin downgrade version: " + version + ".");
588
588
  if (version !== EFFECTS__namespace.version) {
package/dist/alipay.mjs CHANGED
@@ -559,7 +559,7 @@ function nativeLogger(type, msg) {
559
559
  }
560
560
  }
561
561
 
562
- var version = "2.0.0-alpha.21";
562
+ var version = "2.0.0-alpha.22";
563
563
  registerPlugin("alipay-downgrade", AlipayDowngradePlugin, DowngradeVFXItem, true);
564
564
  logger.info("Plugin downgrade version: " + version + ".");
565
565
  if (version !== EFFECTS.version) {
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player downgrade plugin for Alipay
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,意绮,飂兮
6
- * Version: v2.0.0-alpha.21
6
+ * Version: v2.0.0-alpha.22
7
7
  */
8
8
 
9
9
  'use strict';
@@ -589,7 +589,7 @@ function nativeLogger(type, msg) {
589
589
  }
590
590
  }
591
591
 
592
- var version = "2.0.0-alpha.21";
592
+ var version = "2.0.0-alpha.22";
593
593
  EFFECTS.registerPlugin("alipay-downgrade", AlipayDowngradePlugin, DowngradeVFXItem, true);
594
594
  EFFECTS.logger.info("Plugin downgrade version: " + version + ".");
595
595
  if (version !== EFFECTS__namespace.version) {
package/dist/index.min.js CHANGED
@@ -3,6 +3,6 @@
3
3
  * Description: Galacean Effects player downgrade plugin for Alipay
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,意绮,飂兮
6
- * Version: v2.0.0-alpha.21
7
- */function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@galacean/effects")):"function"==typeof define&&define.amd?define(["exports","@galacean/effects"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).ge=e.ge||{},e.ge.alipayDowngradePlugin={}),e.ge)}(this,function(e,n){"use strict";var r=function(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,t.get?t:{enumerable:!0,get:function(){return e[r]}})}}),n.default=e,Object.freeze(n)}(n);function t(e,n){return(t=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function o(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&t(e,n)}var i=function(e){function n(){return e.apply(this,arguments)}return o(n,e),n}(n.VFXItem);function a(e,n,r,t,o,i,a){try{var s=e[i](a),l=s.value}catch(e){r(e);return}s.done?n(l):Promise.resolve(l).then(t,o)}function s(e){return function(){var n=this,r=arguments;return new Promise(function(t,o){var i=e.apply(n,r);function s(e){a(i,t,o,s,l,"next",e)}function l(e){a(i,t,o,s,l,"throw",e)}s(void 0)})}}function l(e,n){var r,t,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,t&&(o=2&s[0]?t.return:s[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,s[1])).done)return o;switch(t=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,t=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=n.call(e,a)}catch(e){s=[6,e],t=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}"function"==typeof SuppressedError&&SuppressedError;var u="mock-fail",c="high",d="medium",f=!1;function v(){return(v=s(function(e,r){var t,o;return l(this,function(i){var a;return(void 0===r&&(r={}),f||(a=r.autoPause,window.addEventListener("unload",function(){n.getActivePlayers().forEach(function(e){return e.dispose()})}),a&&(document.addEventListener("pause",b),document.addEventListener("resume",L)),f=!0),e===u||"mock-pass"===e)?[2,Promise.resolve({mock:{downgrade:e===u}})]:(t=n.isAlipayMiniApp()?my:window.AlipayJSBridge)?(o=performance.now(),[2,(function(){return p.apply(this,arguments)})().then(function(n){return new Promise(function(i){var a,s=["mars"],l=r.techPoint;l&&s.push.apply(s,[].concat(l)),(null!=(a=r.callBridge)?a:t.call)("getDowngradeResult",{bizId:e,scene:0,ext:{techPoint:s}},function(r){var t=performance.now()-o;console.info("Downgrade time: "+t+"ms."),i({bizId:e,systemInfo:n,downgradeResult:r,totalTime:t})})})})]):[2,Promise.resolve({noAlipayEnv:!0})]})})).apply(this,arguments)}function p(){return(p=s(function(){return l(this,function(e){return[2,new Promise(function(e,r){var t=n.isAlipayMiniApp()?my:window.AlipayJSBridge;t?t.call("getSystemInfo",function(n){n.error?r(n):e(n)}):r("no ap")})]})})).apply(this,arguments)}var g=new(function(){function e(){this.isIOS=!1,this.model="DESKTOP_DEBUG",this.system="Unknown",this.deviceLevel="none",this.isDowngrade=!1}var r=e.prototype;return r.getRenderLevel=function(){return this.deviceLevel===c?n.spec.RenderLevel.S:this.deviceLevel===d?n.spec.RenderLevel.A:"low"===this.deviceLevel?n.spec.RenderLevel.B:this.isIOS?n.spec.RenderLevel.S:n.spec.RenderLevel.B},r.hasDeviceLevel=function(){return w(this.deviceLevel)},r.setBySystemInfo=function(e){var n=e.performance,r=e.platform,t=e.model,o=e.system;this.isIOS="iOS"===r,this.model=void 0===t?"UNKNOWN_DEVICE":t,this.system=void 0===o?"Unknown":o,n&&!this.hasDeviceLevel()&&(this.deviceLevel=n)},r.updateDeviceLevel=function(){if(!this.hasDeviceLevel()&&/iPhone(\d+),/.test(this.model)){var e=+RegExp.$1;e<=9?this.deviceLevel="low":e<10?this.deviceLevel=d:this.deviceLevel=c}},r.getDeviceInfo=function(){return{isIOS:this.isIOS,model:this.model,system:this.system,deviceLevel:this.deviceLevel}},e}());function y(e){if(e.mock){var r=e.mock,t=r.downgrade,o=r.deviceLevel,i=void 0===o?c:o;return g.deviceLevel=i,{downgrade:t,reason:"mock"}}return e.noAlipayEnv?{downgrade:!1,reason:"no AP env"}:e.systemInfo?e.downgradeResult?(g.setBySystemInfo(e.systemInfo),function(e){var r,t=void 0,o=void 0;if(e.error)return{downgrade:4!==e.error,reason:"api error: "+e.error};try{var i=n.isString(e)?JSON.parse(e):e;if("downgradeResultType"in i?t=i.downgradeResultType:"resultType"in i&&(t=i.resultType,o=i.resultReason),e.context){var a=e.context.deviceInfo;if(a){var s=a.deviceLevel;w(s)&&(g.deviceLevel=s)}}g.updateDeviceLevel()}catch(e){console.error(e)}return void 0===t?{downgrade:!0,reason:"call downgrade fail"}:1===t?{downgrade:!0,reason:-1===(r=o)?""+r+"-no config":0===r?""+r+"-none":1===r?""+r+"-downgrade by memory":2===r?""+r+"-downgrade by crash":3===r?""+r+"-downgrade by device":4===r?""+r+"-downgrade by force":""+r}:n.isAlipayMiniApp()&&P()?{downgrade:!0,reason:"Force downgrade by downgrade plugin"}:{downgrade:!1,reason:t}}(e.downgradeResult)):{downgrade:!1,reason:"downgradeResult is required"}:{downgrade:!1,reason:"systemInfo is required"}}function h(e){return e?/[ABS]/.test(e)?e:n.spec.RenderLevel.S:g.getRenderLevel()}function w(e){return e===c||e===d||"low"===e}var m=Symbol("@@_inter_pause");function b(e){e.target===document&&(n.logger.info("Auto pause all players with data offloaded."),n.getActivePlayers().forEach(function(e){e.paused||(e.pause({offloadTexture:!0}),e[m]=!0)}))}function L(e){e.target===document&&(n.logger.info("Auto resume all players."),n.getActivePlayers().forEach(function(e){e[m]&&(e.resume(),e[m]=!1)}))}var S=["12,8","13,1","13,2","13,3","13,4"];function P(){if(g.isIOS&&S.find(function(e){return e===g.model})){var e=g.system.split(".");if(e.length>0&&"16"===e[0])return!0}return!1}var A=function(e){function n(){return e.apply(this,arguments)}return o(n,e),n.processRawJSON=function(e,n){return void 0===n&&(n={}),s(function(){var e,r,t;return l(this,function(o){if(r=null==(e=n.pluginData)?void 0:e.downgrade){if((t=y(r)).downgrade)throw Error("Downgraded, reason: "+t.reason+".")}else console.warn("No downgrade result in pluginData of SceneLoadOptions.");return n.renderLevel||(n.renderLevel=h(n.renderLevel)),[2]})})()},n}(n.AbstractPlugin),D=n.isAlipayMiniApp()?my:window.AlipayJSBridge;n.logger.register(function(e,r){for(var t=arguments.length,o=Array(t>2?t-2:0),i=2;i<t;i++)o[i-2]=arguments[i];var a={message:"[Galacean Effects] "+r+" "+o.join(""),level:e};n.isAndroid()&&(a.anr_info="mars");try{null==D||D.call("localLog",a)}catch(e){console.error(e)}});var O="2.0.0-alpha.21";n.registerPlugin("alipay-downgrade",A,i,!0),n.logger.info("Plugin downgrade version: "+O+"."),O!==r.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),e.checkDowngradeResult=y,e.downgradeForMiniprogram=P,e.getDowngradeResult=function(e){return v.apply(this,arguments)},e.getRenderLevelByDevice=h,e.version=O,Object.defineProperty(e,"__esModule",{value:!0})});
6
+ * Version: v2.0.0-alpha.22
7
+ */function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@galacean/effects")):"function"==typeof define&&define.amd?define(["exports","@galacean/effects"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).ge=e.ge||{},e.ge.alipayDowngradePlugin={}),e.ge)}(this,function(e,n){"use strict";var r=function(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,t.get?t:{enumerable:!0,get:function(){return e[r]}})}}),n.default=e,Object.freeze(n)}(n);function t(e,n){return(t=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function o(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&t(e,n)}var i=function(e){function n(){return e.apply(this,arguments)}return o(n,e),n}(n.VFXItem);function a(e,n,r,t,o,i,a){try{var s=e[i](a),l=s.value}catch(e){r(e);return}s.done?n(l):Promise.resolve(l).then(t,o)}function s(e){return function(){var n=this,r=arguments;return new Promise(function(t,o){var i=e.apply(n,r);function s(e){a(i,t,o,s,l,"next",e)}function l(e){a(i,t,o,s,l,"throw",e)}s(void 0)})}}function l(e,n){var r,t,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,t&&(o=2&s[0]?t.return:s[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,s[1])).done)return o;switch(t=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,t=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=n.call(e,a)}catch(e){s=[6,e],t=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}"function"==typeof SuppressedError&&SuppressedError;var u="mock-fail",c="high",d="medium",f=!1;function v(){return(v=s(function(e,r){var t,o;return l(this,function(i){var a;return(void 0===r&&(r={}),f||(a=r.autoPause,window.addEventListener("unload",function(){n.getActivePlayers().forEach(function(e){return e.dispose()})}),a&&(document.addEventListener("pause",b),document.addEventListener("resume",L)),f=!0),e===u||"mock-pass"===e)?[2,Promise.resolve({mock:{downgrade:e===u}})]:(t=n.isAlipayMiniApp()?my:window.AlipayJSBridge)?(o=performance.now(),[2,(function(){return p.apply(this,arguments)})().then(function(n){return new Promise(function(i){var a,s=["mars"],l=r.techPoint;l&&s.push.apply(s,[].concat(l)),(null!=(a=r.callBridge)?a:t.call)("getDowngradeResult",{bizId:e,scene:0,ext:{techPoint:s}},function(r){var t=performance.now()-o;console.info("Downgrade time: "+t+"ms."),i({bizId:e,systemInfo:n,downgradeResult:r,totalTime:t})})})})]):[2,Promise.resolve({noAlipayEnv:!0})]})})).apply(this,arguments)}function p(){return(p=s(function(){return l(this,function(e){return[2,new Promise(function(e,r){var t=n.isAlipayMiniApp()?my:window.AlipayJSBridge;t?t.call("getSystemInfo",function(n){n.error?r(n):e(n)}):r("no ap")})]})})).apply(this,arguments)}var g=new(function(){function e(){this.isIOS=!1,this.model="DESKTOP_DEBUG",this.system="Unknown",this.deviceLevel="none",this.isDowngrade=!1}var r=e.prototype;return r.getRenderLevel=function(){return this.deviceLevel===c?n.spec.RenderLevel.S:this.deviceLevel===d?n.spec.RenderLevel.A:"low"===this.deviceLevel?n.spec.RenderLevel.B:this.isIOS?n.spec.RenderLevel.S:n.spec.RenderLevel.B},r.hasDeviceLevel=function(){return w(this.deviceLevel)},r.setBySystemInfo=function(e){var n=e.performance,r=e.platform,t=e.model,o=e.system;this.isIOS="iOS"===r,this.model=void 0===t?"UNKNOWN_DEVICE":t,this.system=void 0===o?"Unknown":o,n&&!this.hasDeviceLevel()&&(this.deviceLevel=n)},r.updateDeviceLevel=function(){if(!this.hasDeviceLevel()&&/iPhone(\d+),/.test(this.model)){var e=+RegExp.$1;e<=9?this.deviceLevel="low":e<10?this.deviceLevel=d:this.deviceLevel=c}},r.getDeviceInfo=function(){return{isIOS:this.isIOS,model:this.model,system:this.system,deviceLevel:this.deviceLevel}},e}());function y(e){if(e.mock){var r=e.mock,t=r.downgrade,o=r.deviceLevel,i=void 0===o?c:o;return g.deviceLevel=i,{downgrade:t,reason:"mock"}}return e.noAlipayEnv?{downgrade:!1,reason:"no AP env"}:e.systemInfo?e.downgradeResult?(g.setBySystemInfo(e.systemInfo),function(e){var r,t=void 0,o=void 0;if(e.error)return{downgrade:4!==e.error,reason:"api error: "+e.error};try{var i=n.isString(e)?JSON.parse(e):e;if("downgradeResultType"in i?t=i.downgradeResultType:"resultType"in i&&(t=i.resultType,o=i.resultReason),e.context){var a=e.context.deviceInfo;if(a){var s=a.deviceLevel;w(s)&&(g.deviceLevel=s)}}g.updateDeviceLevel()}catch(e){console.error(e)}return void 0===t?{downgrade:!0,reason:"call downgrade fail"}:1===t?{downgrade:!0,reason:-1===(r=o)?""+r+"-no config":0===r?""+r+"-none":1===r?""+r+"-downgrade by memory":2===r?""+r+"-downgrade by crash":3===r?""+r+"-downgrade by device":4===r?""+r+"-downgrade by force":""+r}:n.isAlipayMiniApp()&&P()?{downgrade:!0,reason:"Force downgrade by downgrade plugin"}:{downgrade:!1,reason:t}}(e.downgradeResult)):{downgrade:!1,reason:"downgradeResult is required"}:{downgrade:!1,reason:"systemInfo is required"}}function h(e){return e?/[ABS]/.test(e)?e:n.spec.RenderLevel.S:g.getRenderLevel()}function w(e){return e===c||e===d||"low"===e}var m=Symbol("@@_inter_pause");function b(e){e.target===document&&(n.logger.info("Auto pause all players with data offloaded."),n.getActivePlayers().forEach(function(e){e.paused||(e.pause({offloadTexture:!0}),e[m]=!0)}))}function L(e){e.target===document&&(n.logger.info("Auto resume all players."),n.getActivePlayers().forEach(function(e){e[m]&&(e.resume(),e[m]=!1)}))}var S=["12,8","13,1","13,2","13,3","13,4"];function P(){if(g.isIOS&&S.find(function(e){return e===g.model})){var e=g.system.split(".");if(e.length>0&&"16"===e[0])return!0}return!1}var A=function(e){function n(){return e.apply(this,arguments)}return o(n,e),n.processRawJSON=function(e,n){return void 0===n&&(n={}),s(function(){var e,r,t;return l(this,function(o){if(r=null==(e=n.pluginData)?void 0:e.downgrade){if((t=y(r)).downgrade)throw Error("Downgraded, reason: "+t.reason+".")}else console.warn("No downgrade result in pluginData of SceneLoadOptions.");return n.renderLevel||(n.renderLevel=h(n.renderLevel)),[2]})})()},n}(n.AbstractPlugin),D=n.isAlipayMiniApp()?my:window.AlipayJSBridge;n.logger.register(function(e,r){for(var t=arguments.length,o=Array(t>2?t-2:0),i=2;i<t;i++)o[i-2]=arguments[i];var a={message:"[Galacean Effects] "+r+" "+o.join(""),level:e};n.isAndroid()&&(a.anr_info="mars");try{null==D||D.call("localLog",a)}catch(e){console.error(e)}});var O="2.0.0-alpha.22";n.registerPlugin("alipay-downgrade",A,i,!0),n.logger.info("Plugin downgrade version: "+O+"."),O!==r.version&&console.error("注意:请统一 Downgrade 插件与 Player 版本,不统一的版本混用会有不可预知的后果!","\nAttention: Please ensure the Downgrade plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!"),e.checkDowngradeResult=y,e.downgradeForMiniprogram=P,e.getDowngradeResult=function(e){return v.apply(this,arguments)},e.getRenderLevelByDevice=h,e.version=O,Object.defineProperty(e,"__esModule",{value:!0})});
8
8
  //# sourceMappingURL=index.min.js.map
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player downgrade plugin for Alipay
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,意绮,飂兮
6
- * Version: v2.0.0-alpha.21
6
+ * Version: v2.0.0-alpha.22
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
@@ -566,7 +566,7 @@ function nativeLogger(type, msg) {
566
566
  }
567
567
  }
568
568
 
569
- var version = "2.0.0-alpha.21";
569
+ var version = "2.0.0-alpha.22";
570
570
  registerPlugin("alipay-downgrade", AlipayDowngradePlugin, DowngradeVFXItem, true);
571
571
  logger.info("Plugin downgrade version: " + version + ".");
572
572
  if (version !== EFFECTS.version) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-plugin-alipay-downgrade",
3
- "version": "2.0.0-alpha.21",
3
+ "version": "2.0.0-alpha.22",
4
4
  "description": "Galacean Effects player downgrade plugin for Alipay",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -39,7 +39,7 @@
39
39
  "registry": "https://registry.npmjs.org"
40
40
  },
41
41
  "devDependencies": {
42
- "@galacean/effects": "2.0.0-alpha.21"
42
+ "@galacean/effects": "2.0.0-alpha.22"
43
43
  },
44
44
  "scripts": {
45
45
  "dev": "vite",