@galacean/effects-plugin-alipay-downgrade 2.0.0-alpha.13 → 2.0.0-alpha.15
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 +1 -1
- package/dist/alipay.mjs +1 -1
- package/dist/index.js +2 -2
- package/dist/index.min.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
package/dist/alipay.js
CHANGED
|
@@ -565,7 +565,7 @@ function nativeLogger(type, msg) {
|
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
|
|
568
|
-
var version = "2.0.0-alpha.
|
|
568
|
+
var version = "2.0.0-alpha.15";
|
|
569
569
|
effects.registerPlugin("alipay-downgrade", AlipayDowngradePlugin, DowngradeVFXItem, true);
|
|
570
570
|
effects.logger.info("plugin downgrade version: " + version);
|
|
571
571
|
if (version !== effects.version) {
|
package/dist/alipay.mjs
CHANGED
|
@@ -561,7 +561,7 @@ function nativeLogger(type, msg) {
|
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
563
|
|
|
564
|
-
var version = "2.0.0-alpha.
|
|
564
|
+
var version = "2.0.0-alpha.15";
|
|
565
565
|
registerPlugin("alipay-downgrade", AlipayDowngradePlugin, DowngradeVFXItem, true);
|
|
566
566
|
logger.info("plugin downgrade version: " + version);
|
|
567
567
|
if (version !== version$1) {
|
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.
|
|
6
|
+
* Version: v2.0.0-alpha.15
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -572,7 +572,7 @@ function nativeLogger(type, msg) {
|
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
|
|
575
|
-
var version = "2.0.0-alpha.
|
|
575
|
+
var version = "2.0.0-alpha.15";
|
|
576
576
|
effects.registerPlugin("alipay-downgrade", AlipayDowngradePlugin, DowngradeVFXItem, true);
|
|
577
577
|
effects.logger.info("plugin downgrade version: " + version);
|
|
578
578
|
if (version !== effects.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.
|
|
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";function r(e,n){return(r=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function t(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&&r(e,n)}var o=function(e){function n(){return e.apply(this,arguments)}return t(n,e),n}(n.VFXItem);function i(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 a(e){return function(){var n=this,r=arguments;return new Promise(function(t,o){var a=e.apply(n,r);function s(e){i(a,t,o,s,l,"next",e)}function l(e){i(a,t,o,s,l,"throw",e)}s(void 0)})}}function s(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 l="mock-fail",u="high",c="medium",d=!1;function f(){return(f=a(function(e,r){var t,o;return s(this,function(i){var a;return(void 0===r&&(r={}),d||(a=r.autoPause,window.addEventListener("unload",function(){n.getActivePlayers().forEach(function(e){return e.dispose()})}),a&&(document.addEventListener("pause",m),document.addEventListener("resume",L)),d=!0),e===l||"mock-pass"===e)?[2,Promise.resolve({mock:{downgrade:e===l}})]:(t=n.isAlipayMiniApp()?my:window.AlipayJSBridge)?(o=performance.now(),[2,(function(){return v.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 v(){return(v=a(function(){return s(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 p=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===u?n.spec.RenderLevel.S:this.deviceLevel===c?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 h(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=c:this.deviceLevel=u}},r.getDeviceInfo=function(){return{isIOS:this.isIOS,model:this.model,system:this.system,deviceLevel:this.deviceLevel}},e}());function g(e){if(e.mock){var r=e.mock,t=r.downgrade,o=r.deviceLevel,i=void 0===o?u:o;return p.deviceLevel=i,{downgrade:t,reason:"mock"}}return e.noAlipayEnv?{downgrade:!1,reason:"no AP env"}:e.systemInfo?e.downgradeResult?(p.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;h(s)&&(p.deviceLevel=s)}}p.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()&&S()?{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 y(e){return e?/[ABS]/.test(e)?e:n.spec.RenderLevel.S:p.getRenderLevel()}function h(e){return e===u||e===c||"low"===e}var w=Symbol("@@_inter_pause");function m(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[w]=!0)}))}function L(e){e.target===document&&(n.logger.info("auto resume all players"),n.getActivePlayers().forEach(function(e){e[w]&&(e.resume(),e[w]=!1)}))}var b=["12,8","13,1","13,2","13,3","13,4"];function S(){if(p.isIOS&&b.find(function(e){return e===p.model})){var e=p.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 t(n,e),n.processRawJSON=function(e,n){return void 0===n&&(n={}),a(function(){var e,r,t;return s(this,function(o){if(r=null==(e=n.pluginData)?void 0:e.downgrade){if((t=g(r)).downgrade)throw Error("downgraded, reason: "+t.reason)}else console.warn("No downgrade result in pluginData of SceneLoadOptions");return n.renderLevel||(n.renderLevel=y(n.renderLevel)),[2]})})()},n}(n.AbstractPlugin),P=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==P||P.call("localLog",a)}catch(e){console.error(e)}});var R="2.0.0-alpha.
|
|
6
|
+
* Version: v2.0.0-alpha.15
|
|
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";function r(e,n){return(r=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function t(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&&r(e,n)}var o=function(e){function n(){return e.apply(this,arguments)}return t(n,e),n}(n.VFXItem);function i(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 a(e){return function(){var n=this,r=arguments;return new Promise(function(t,o){var a=e.apply(n,r);function s(e){i(a,t,o,s,l,"next",e)}function l(e){i(a,t,o,s,l,"throw",e)}s(void 0)})}}function s(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 l="mock-fail",u="high",c="medium",d=!1;function f(){return(f=a(function(e,r){var t,o;return s(this,function(i){var a;return(void 0===r&&(r={}),d||(a=r.autoPause,window.addEventListener("unload",function(){n.getActivePlayers().forEach(function(e){return e.dispose()})}),a&&(document.addEventListener("pause",m),document.addEventListener("resume",L)),d=!0),e===l||"mock-pass"===e)?[2,Promise.resolve({mock:{downgrade:e===l}})]:(t=n.isAlipayMiniApp()?my:window.AlipayJSBridge)?(o=performance.now(),[2,(function(){return v.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 v(){return(v=a(function(){return s(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 p=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===u?n.spec.RenderLevel.S:this.deviceLevel===c?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 h(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=c:this.deviceLevel=u}},r.getDeviceInfo=function(){return{isIOS:this.isIOS,model:this.model,system:this.system,deviceLevel:this.deviceLevel}},e}());function g(e){if(e.mock){var r=e.mock,t=r.downgrade,o=r.deviceLevel,i=void 0===o?u:o;return p.deviceLevel=i,{downgrade:t,reason:"mock"}}return e.noAlipayEnv?{downgrade:!1,reason:"no AP env"}:e.systemInfo?e.downgradeResult?(p.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;h(s)&&(p.deviceLevel=s)}}p.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()&&S()?{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 y(e){return e?/[ABS]/.test(e)?e:n.spec.RenderLevel.S:p.getRenderLevel()}function h(e){return e===u||e===c||"low"===e}var w=Symbol("@@_inter_pause");function m(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[w]=!0)}))}function L(e){e.target===document&&(n.logger.info("auto resume all players"),n.getActivePlayers().forEach(function(e){e[w]&&(e.resume(),e[w]=!1)}))}var b=["12,8","13,1","13,2","13,3","13,4"];function S(){if(p.isIOS&&b.find(function(e){return e===p.model})){var e=p.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 t(n,e),n.processRawJSON=function(e,n){return void 0===n&&(n={}),a(function(){var e,r,t;return s(this,function(o){if(r=null==(e=n.pluginData)?void 0:e.downgrade){if((t=g(r)).downgrade)throw Error("downgraded, reason: "+t.reason)}else console.warn("No downgrade result in pluginData of SceneLoadOptions");return n.renderLevel||(n.renderLevel=y(n.renderLevel)),[2]})})()},n}(n.AbstractPlugin),P=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==P||P.call("localLog",a)}catch(e){console.error(e)}});var R="2.0.0-alpha.15";n.registerPlugin("alipay-downgrade",A,o,!0),n.logger.info("plugin downgrade version: "+R),R!==n.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=g,e.downgradeForMiniprogram=S,e.getDowngradeResult=function(e){return f.apply(this,arguments)},e.getRenderLevelByDevice=y,e.version=R,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.
|
|
6
|
+
* Version: v2.0.0-alpha.15
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { VFXItem, isString, isAlipayMiniApp, spec, getActivePlayers, logger, AbstractPlugin, isAndroid, registerPlugin, version as version$1 } from '@galacean/effects';
|
|
@@ -568,7 +568,7 @@ function nativeLogger(type, msg) {
|
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
570
|
|
|
571
|
-
var version = "2.0.0-alpha.
|
|
571
|
+
var version = "2.0.0-alpha.15";
|
|
572
572
|
registerPlugin("alipay-downgrade", AlipayDowngradePlugin, DowngradeVFXItem, true);
|
|
573
573
|
logger.info("plugin downgrade version: " + version);
|
|
574
574
|
if (version !== version$1) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/effects-plugin-alipay-downgrade",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.15",
|
|
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.
|
|
42
|
+
"@galacean/effects": "2.0.0-alpha.15"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"dev": "vite",
|