@galacean/effects-plugin-orientation-transformer 1.4.4 → 1.5.0-alpha.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alipay.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ declare global {
3
3
  ge: any;
4
4
  }
5
5
  }
6
- export { getAdapter, closeDeviceMotion, openDeviceMotion } from './orientation-plugin-loader';
6
+ export { getAdapter, closeDeviceMotion, openDeviceMotion, OrientationPluginLoader } from './orientation-plugin-loader';
7
7
  export { OrientationAdapterAcceler } from './orientation-adapter-acceler';
8
+ export { TransformVFXItem } from './transform-vfx-item';
8
9
  export declare const version: string;
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player orientation transformer plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,意绮
6
- * Version: v1.4.4
6
+ * Version: v1.5.0-alpha.0
7
7
  */
8
8
 
9
9
  'use strict';
@@ -163,7 +163,6 @@ var CompositionTransformerAcceler = /** @class */ (function () {
163
163
  initRotation[1] + mapRange(br, target.vMin, target.vMax),
164
164
  initRotation[2],
165
165
  ];
166
- // console.log(y, initY, y - initY);
167
166
  (_b = layer.transform).setPosition.apply(_b, __spreadArray([], __read(position), false));
168
167
  (_c = layer.transform).setRotation.apply(_c, __spreadArray([], __read(rotation), false));
169
168
  this.currentPos[name] = position.slice();
@@ -274,6 +273,17 @@ function isIOS() {
274
273
  var ver = str.match(/cpu (iphone )?os (.*?) like mac os/);
275
274
  return ver ? parseInt(ver[2], 10) : 0;
276
275
  }
276
+ function isMiniProgram() {
277
+ return isAlipayMiniApp() || isWechatMiniApp();
278
+ }
279
+ function isAlipayMiniApp() {
280
+ //@ts-expect-error
281
+ return typeof my !== 'undefined' && (my === null || my === void 0 ? void 0 : my.renderTarget) === 'web';
282
+ }
283
+ function isWechatMiniApp() {
284
+ //@ts-expect-error
285
+ return window.__wxjs_environment === 'miniprogram';
286
+ }
277
287
 
278
288
  /**
279
289
  * 稳定区间
@@ -523,7 +533,7 @@ var DeviceOrientation = /** @class */ (function () {
523
533
  };
524
534
  document.addEventListener('motion.gyro', this.watchListener, false);
525
535
  }
526
- else if (useJSBridge) {
536
+ else if (useJSBridge && !isMiniProgram()) {
527
537
  switchIOSEvent(true, this.options.interval / 1000);
528
538
  this.watchListener = function (e) {
529
539
  if (e && 'data' in e) {
@@ -814,10 +824,12 @@ var TransformVFXItem = /** @class */ (function (_super) {
814
824
  }(effects.VFXItem));
815
825
 
816
826
  effects.registerPlugin('orientation-transformer', OrientationPluginLoader, TransformVFXItem);
817
- var version = "1.4.4";
827
+ var version = "1.5.0-alpha.0";
818
828
  effects.logger.info('plugin orientation transformer version: ' + version);
819
829
 
820
830
  exports.OrientationAdapterAcceler = OrientationAdapterAcceler;
831
+ exports.OrientationPluginLoader = OrientationPluginLoader;
832
+ exports.TransformVFXItem = TransformVFXItem;
821
833
  exports.closeDeviceMotion = closeDeviceMotion;
822
834
  exports.getAdapter = getAdapter;
823
835
  exports.openDeviceMotion = openDeviceMotion;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.min.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player orientation transformer plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,意绮
6
- * Version: v1.4.4
6
+ * Version: v1.5.0-alpha.0
7
7
  */
8
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@galacean/effects")):"function"==typeof define&&define.amd?define(["exports","@galacean/effects"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).ge=t.ge||{},t.ge.orientationTransformerPlugin={}),t.ge)}(this,(function(t,e){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var a=function(){return a=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var a in e=arguments[n])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t},a.apply(this,arguments)};function r(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,a,r=n.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(t){a={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return i}function i(t,e,n){if(n||2===arguments.length)for(var o,a=0,r=e.length;a<r;a++)!o&&a in e||(o||(o=Array.prototype.slice.call(e,0,a)),o[a]=e[a]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var s=function(){function t(t){this.composition=t,this.targets={},this.records={},this.currentPos={},this.currentRot={},this.gammaRange=[-89,89],this.betaRange=[-89,89]}return t.prototype.update=function(t){var e=t.x,n=t.y,o=t.beta,a=t.gamma;this.currentEvent={x:e,y:n,beta:o,gamma:a}},t.prototype.updateOrientation=function(){var t=this,e=this.currentEvent;e&&Object.getOwnPropertyNames(this.targets).forEach((function(n){t.moveLayer(n,e)}))},t.prototype.initComposition=function(){for(var t=this.composition.items,e=0;e<t.length;e++){var n=t[e];if(this.targets[n.name]){var o=n.transform.position.toArray(),a=n.transform.rotation.toArray(),r=this.currentPos[n.name],i=this.currentRot[n.name];this.records[n.name]={item:n,position:o,rotation:a},r&&n.transform.setPosition(r[0],r[1],r[2]),i&&n.transform.setRotation(i[0],i[1],i[2])}}},t.prototype.addTarget=function(t){this.targets[t.name]=t},t.prototype.removeTarget=function(t){delete this.targets[t],delete this.records[t]},t.prototype.moveLayer=function(t,e){var n,o,a,s=e.x,h=e.y,p=e.beta,f=e.gamma,m=null===(a=this.records[t])||void 0===a?void 0:a.item;if(m){var d=this.records[t].position,v=this.records[t].rotation,g=this.targets[t],y=c(s,this.betaRange),b=c(h,this.gammaRange);if(g){var w=[d[0]+1.2*l(u(y,this.gammaRange[0],this.gammaRange[1]),g.xMin,g.xMax),d[1]+1.2*l(u(b,this.betaRange[0],this.betaRange[1]),g.yMin,g.yMax),d[2]],M=u(c(.8*f,this.gammaRange),this.gammaRange[0],this.gammaRange[1]),x=u(c(.8*p,this.betaRange),this.betaRange[0],this.betaRange[1]),R=[v[0]+l(x,g.hMin,g.hMax),v[1]+l(M,g.vMin,g.vMax),v[2]];(n=m.transform).setPosition.apply(n,i([],r(w),!1)),(o=m.transform).setRotation.apply(o,i([],r(R),!1)),this.currentPos[t]=w.slice(),this.currentRot[t]=R.slice()}}},t}();function c(t,e){return t<e[0]?e[0]:t>e[1]?e[1]:t}function l(t,e,n){return e+(n-e)*t}function u(t,e,n){return(t-e)/(n-e)}function h(t){return Object.prototype.toString.call(t)}function p(t,e){var n=!0,o=!0,a=!0;if("[object Array]"===h(e.alpha)&&e.alpha.length>=2){var r=t.alpha+e.alpha[0],i=t.alpha+e.alpha[1];n=(r=r<0?r+360:r)<(i=i>360?i-360:i)?t.alpha>r&&t.alpha<i:t.alpha>r||t.alpha<i}return"[object Array]"===h(e.beta)&&e.beta.length>=2&&(o=t.beta>=e.beta[0]&&t.beta<=e.beta[1]),"[object Array]"===h(e.gamma)&&e.gamma.length>=2&&(a=t.gamma>=e.gamma[0]&&t.gamma<=e.gamma[1]),n&&o&&a}function f(t,n){if(!e.isObject(t)&&!e.isArray(t))return t;for(var o=e.isArray(t)?i([],r(t),!1):a({},t),s=arguments.length,c=1;c<s;c++){var l=arguments[c]||{};if(e.isObject(l)){var u=void 0;for(u in l)l.hasOwnProperty(u)&&(e.isObject(o[u])&&e.isObject(l[u])?o[u]=f(o[u],l[u]):e.isObject(l[u])||e.isArray(l[u])?o[u]=f(l[u]):o[u]=l[u]);for(u in o)e.isObject(o[u])&&o.hasOwnProperty(u)&&!l.hasOwnProperty(u)&&(o[u]=f(o[u]))}}if(1===s)for(var u in o)e.isObject(o[u])&&o.hasOwnProperty(u)&&(o[u]=f(o[u]));return o}var m=function(){function t(t){void 0===t&&(t={}),this.options=t,this.lastValue=0,this.valuePool=[]}return t.prototype.stableFix=function(t){var e=this.options.stableRange||3;return Math.abs(t)<e?0:t>e?t-e:t+e},t.prototype.changeLimit=function(t){var e=this.lastValue,n=t;return Math.abs(t-e)>5&&(n=e<t?e+5:e-5),Math.abs(t-e)<1&&(n=e),this.lastValue=n,n},t.prototype.linearRegressionMedian=function(t){var e,n,o;return this.valuePool.push(t),this.valuePool.length>=5?(n=this.valuePool,o=function(t){var e=[],n=[];t.forEach((function(t,o){e.push(o),n.push(t)}));var o=function(t,e){for(var n={},o=e.length,a=0,r=0,i=0,s=0,c=0,l=0;l<e.length;l++)a+=t[l],r+=e[l],i+=t[l]*e[l],s+=t[l]*t[l],c+=e[l]*e[l];var u=a/o,h=r/o;return n.a=(i-o*u*h)/(s-o*u*u),n.b=h-n.a*u,n.miss=Math.pow((o*i-a*r)/Math.sqrt((o*s-a*a)*(o*c-r*r)),2),n}(e,n);return function(t){return o.a*t+o.b}}(n),n=n.map((function(t,e){return o(e)})),e=o(n.length/2),this.valuePool.shift()):e=this.lastValue,e},t}();var d,v=((d=navigator.userAgent.toLowerCase().match(/cpu (iphone )?os (.*?) like mac os/))?parseInt(d[2],10):0)&&void 0!==window.AlipayJSBridge,g=void 0!==window.WindVane,y={X:!0,Y:!0,interval:Math.floor(1e3/30),useRequestAnimationFrame:!0,relativeBeta:!1,relativeGamma:!1,validRange:{alpha:[-60,60],beta:[-60,180],gamma:[-89,89]},stableRange:3},b=function(){function t(t){void 0===t&&(t={}),this.lastX=0,this.lastY=0,this.prevAcceler={x:0,y:0,z:0},this.stoped=!1,this.options=f(y,t);var e=this.options.stableRange;this.filterX=new m({stableRange:e}),this.filterY=new m({stableRange:e})}return t.prototype.watch=function(t){var e=this;if("function"==typeof t&&!this.watchListener){var n,o,a,r,i,s,c=0,l=0,u=NaN,h=NaN,f=function(c){e.stoped||(n=c.alpha,o=c.beta,a=c.gamma,r=p.call(e,{alpha:n,beta:o,gamma:a},e.options.validRange),isNaN(u)&&(u=a,e.filterX.lastValue=a),isNaN(h)&&(h=o,e.filterY.lastValue=o),r&&(e.options.X?(i=e.options.relativeGamma?a-u:a,i=e.filterX.stableFix(i),i=e.filterX.changeLimit(i),i=e.filterX.linearRegressionMedian(+i)):i=0,e.options.Y?(s=e.options.relativeBeta?o-h:o,s=e.filterY.stableFix(s),s=e.filterY.changeLimit(s),s=e.filterY.linearRegressionMedian(+s)):s=0,e.isValid(i,s)&&(e.options.useRequestAnimationFrame?window.requestAnimationFrame((function(){t(i,s,{alpha:n,beta:s-h,gamma:i-u})})):t(i,s,{alpha:n,beta:s-h,gamma:i-u}),e.lastX=i,e.lastY=s)))};this.stoped=!1,g?(M(!0,this.options.interval),this.watchListener=function(t){if("param"in t){var n=t.param,o=n.x,a=n.y,r=n.z;if(o===e.prevAcceler.x&&a===e.prevAcceler.y&&r===e.prevAcceler.z)return;e.prevAcceler={x:o,y:a,z:r},f({alpha:180*+r,beta:-90*+a,gamma:90*+o})}},document.addEventListener("motion.gyro",this.watchListener,!1)):v?(w(!0,this.options.interval/1e3),this.watchListener=function(t){if(t&&"data"in t){var e=t.data,n=e.x,o=e.y,a=e.z;f({alpha:180*a,beta:-90*o,gamma:90*n})}},document.addEventListener("accelerometerChange",this.watchListener,!1)):(this.watchListener=function(t){(l=(new Date).getTime())-c>=e.options.interval&&(c=l,f(t))},window.addEventListener("deviceorientation",this.watchListener,!1))}},t.prototype.unWatch=function(){e.assertExist(this.watchListener),g?(M(!1),document.removeEventListener("motion.gyro",this.watchListener)):v?(w(!1),document.removeEventListener("accelerometerChange",this.watchListener)):window.removeEventListener("deviceorientation",this.watchListener),this.stoped=!0,this.watchListener=void 0},t.prototype.pause=function(){this.stoped=!0,v&&w(!1)},t.prototype.continue=function(){this.stoped=!1,v&&w(!0,this.options.interval/1e3)},t.prototype.isValid=function(t,e){return this.lastX!==t||this.lastY!==e},t}();function w(t,e){window.AlipayJSBridge.call("watchShake",{monitorGyroscope:!1,monitorAccelerometer:!!t,interval:t?parseFloat(e.toFixed(3)):10},(function(){}))}function M(t,e){var n={on:t,frequency:e};window.WindVane.call("WVMotion","listenGyro",n,(function(t){console.info("call WVMotion success")}),(function(t){console.error("call WVMotion failed:"+JSON.stringify(t))}))}var x,R=function(){function t(){this.transformers=[],this.connected=!1,this.accelerMotion=null,this.validRange={alpha:[-60,60],beta:[-80,80],gamma:[-89,89]}}return t.prototype.connect=function(){var t=this;this.connected||(this.accelerMotion=new b({X:!0,Y:!0,interval:Math.floor(1e3/60),useRequestAnimationFrame:!0,relativeBeta:!1,relativeGamma:!1,validRange:this.validRange,stableRange:3}),this.accelerMotion.watch((function(e,n,o){var a={x:e,y:n,beta:o.beta,gamma:o.gamma};t.dispatchMotion(a)}))),this.connected=!0},t.prototype.disconnect=function(){this.accelerMotion&&this.accelerMotion.unWatch(),this.connected=!1},t.prototype.dispatchMotion=function(t){this.transformers.forEach((function(e){return e.update(t)}))},t.prototype.addTransformer=function(t){this.transformers.includes(t)||this.transformers.push(t)},t.prototype.removeTransformer=function(t){var e=this.transformers.indexOf(t);return e>-1&&this.transformers.splice(e,1),0===this.transformers.length},t}();var A=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.order=90,e.adapter=null,e.handleConnect=function(){var t;L||null===(t=e.adapter)||void 0===t||t.connect()},e.handleDisconnect=function(){var t;null===(t=e.adapter)||void 0===t||t.disconnect()},e}return o(e,t),e.prototype.onCompositionConstructed=function(){var t;this.adapter=O(),null===(t=this.adapter)||void 0===t||t.connect(),this.bindAccelerDocumentEvent()},e.prototype.onCompositionReset=function(t){var e,n=t.loaderData.deviceTransformer=new s(t);null===(e=this.adapter)||void 0===e||e.addTransformer(n)},e.prototype.onCompositionUpdate=function(t){var e=t.loaderData.deviceTransformer;e&&e.updateOrientation()},e.prototype.onCompositionDestroyed=function(t){var e,n;(null===(e=this.adapter)||void 0===e?void 0:e.removeTransformer(t.loaderData.deviceTransformer))&&(null===(n=this.adapter)||void 0===n||n.disconnect())},e.prototype.bindAccelerDocumentEvent=function(){this.unbindAccelerDocumentEvent(),document.addEventListener("resume",this.handleConnect,!1),document.addEventListener("pause",this.handleDisconnect,!1),document.addEventListener("back",this.handleDisconnect,!1)},e.prototype.unbindAccelerDocumentEvent=function(){document.removeEventListener("resume",this.handleConnect),document.removeEventListener("pause",this.handleDisconnect),document.removeEventListener("back",this.handleDisconnect)},e.prototype.dispose=function(){O().disconnect(),this.unbindAccelerDocumentEvent()},e}(e.AbstractPlugin),L=!1;function O(){return x||(x=new R),x}var E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"orientation-transformer"},enumerable:!1,configurable:!0}),e.prototype.onConstructed=function(t){var e=t.content.options.targets;e&&(this.targets=e.map((function(t){return{name:t.name,xMin:+t.xMin||0,yMin:+t.yMin||0,xMax:+t.xMax||0,yMax:+t.yMax||0,vMin:+t.vMin||0,hMin:+t.hMin||0,vMax:+t.vMax||0,hMax:+t.hMax||0}})))},e.prototype.onItemRemoved=function(t){var e;null===(e=this.targets)||void 0===e||e.forEach((function(e){var n;return null===(n=t.loaderData.deviceTransformer)||void 0===n?void 0:n.removeTarget(e.name)}))},e.prototype.doCreateContent=function(t){var e,n=t.loaderData.deviceTransformer;return n&&(null===(e=this.targets)||void 0===e||e.forEach((function(t){return n.addTarget(t)})),n.initComposition()),{}},e}(e.VFXItem);e.registerPlugin("orientation-transformer",A,E);var P="1.4.4";e.logger.info("plugin orientation transformer version: "+P),t.OrientationAdapterAcceler=R,t.closeDeviceMotion=function(){L=!0,O().disconnect()},t.getAdapter=O,t.openDeviceMotion=function(){L=!1,O().connect()},t.version=P,Object.defineProperty(t,"__esModule",{value:!0})}));
8
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@galacean/effects")):"function"==typeof define&&define.amd?define(["exports","@galacean/effects"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).ge=t.ge||{},t.ge.orientationTransformerPlugin={}),t.ge)}(this,(function(t,e){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},r.apply(this,arguments)};function a(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,a=n.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function i(t,e,n){if(n||2===arguments.length)for(var o,r=0,a=e.length;r<a;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var s=function(){function t(t){this.composition=t,this.targets={},this.records={},this.currentPos={},this.currentRot={},this.gammaRange=[-89,89],this.betaRange=[-89,89]}return t.prototype.update=function(t){var e=t.x,n=t.y,o=t.beta,r=t.gamma;this.currentEvent={x:e,y:n,beta:o,gamma:r}},t.prototype.updateOrientation=function(){var t=this,e=this.currentEvent;e&&Object.getOwnPropertyNames(this.targets).forEach((function(n){t.moveLayer(n,e)}))},t.prototype.initComposition=function(){for(var t=this.composition.items,e=0;e<t.length;e++){var n=t[e];if(this.targets[n.name]){var o=n.transform.position.toArray(),r=n.transform.rotation.toArray(),a=this.currentPos[n.name],i=this.currentRot[n.name];this.records[n.name]={item:n,position:o,rotation:r},a&&n.transform.setPosition(a[0],a[1],a[2]),i&&n.transform.setRotation(i[0],i[1],i[2])}}},t.prototype.addTarget=function(t){this.targets[t.name]=t},t.prototype.removeTarget=function(t){delete this.targets[t],delete this.records[t]},t.prototype.moveLayer=function(t,e){var n,o,r,s=e.x,h=e.y,p=e.beta,f=e.gamma,m=null===(r=this.records[t])||void 0===r?void 0:r.item;if(m){var d=this.records[t].position,v=this.records[t].rotation,g=this.targets[t],y=c(s,this.betaRange),b=c(h,this.gammaRange);if(g){var w=[d[0]+1.2*l(u(y,this.gammaRange[0],this.gammaRange[1]),g.xMin,g.xMax),d[1]+1.2*l(u(b,this.betaRange[0],this.betaRange[1]),g.yMin,g.yMax),d[2]],M=u(c(.8*f,this.gammaRange),this.gammaRange[0],this.gammaRange[1]),x=u(c(.8*p,this.betaRange),this.betaRange[0],this.betaRange[1]),R=[v[0]+l(x,g.hMin,g.hMax),v[1]+l(M,g.vMin,g.vMax),v[2]];(n=m.transform).setPosition.apply(n,i([],a(w),!1)),(o=m.transform).setRotation.apply(o,i([],a(R),!1)),this.currentPos[t]=w.slice(),this.currentRot[t]=R.slice()}}},t}();function c(t,e){return t<e[0]?e[0]:t>e[1]?e[1]:t}function l(t,e,n){return e+(n-e)*t}function u(t,e,n){return(t-e)/(n-e)}function h(t){return Object.prototype.toString.call(t)}function p(t,e){var n=!0,o=!0,r=!0;if("[object Array]"===h(e.alpha)&&e.alpha.length>=2){var a=t.alpha+e.alpha[0],i=t.alpha+e.alpha[1];n=(a=a<0?a+360:a)<(i=i>360?i-360:i)?t.alpha>a&&t.alpha<i:t.alpha>a||t.alpha<i}return"[object Array]"===h(e.beta)&&e.beta.length>=2&&(o=t.beta>=e.beta[0]&&t.beta<=e.beta[1]),"[object Array]"===h(e.gamma)&&e.gamma.length>=2&&(r=t.gamma>=e.gamma[0]&&t.gamma<=e.gamma[1]),n&&o&&r}function f(t,n){if(!e.isObject(t)&&!e.isArray(t))return t;for(var o=e.isArray(t)?i([],a(t),!1):r({},t),s=arguments.length,c=1;c<s;c++){var l=arguments[c]||{};if(e.isObject(l)){var u=void 0;for(u in l)l.hasOwnProperty(u)&&(e.isObject(o[u])&&e.isObject(l[u])?o[u]=f(o[u],l[u]):e.isObject(l[u])||e.isArray(l[u])?o[u]=f(l[u]):o[u]=l[u]);for(u in o)e.isObject(o[u])&&o.hasOwnProperty(u)&&!l.hasOwnProperty(u)&&(o[u]=f(o[u]))}}if(1===s)for(var u in o)e.isObject(o[u])&&o.hasOwnProperty(u)&&(o[u]=f(o[u]));return o}function m(){return"undefined"!=typeof my&&"web"===(null===my||void 0===my?void 0:my.renderTarget)||"miniprogram"===window.__wxjs_environment}var d=function(){function t(t){void 0===t&&(t={}),this.options=t,this.lastValue=0,this.valuePool=[]}return t.prototype.stableFix=function(t){var e=this.options.stableRange||3;return Math.abs(t)<e?0:t>e?t-e:t+e},t.prototype.changeLimit=function(t){var e=this.lastValue,n=t;return Math.abs(t-e)>5&&(n=e<t?e+5:e-5),Math.abs(t-e)<1&&(n=e),this.lastValue=n,n},t.prototype.linearRegressionMedian=function(t){var e,n,o;return this.valuePool.push(t),this.valuePool.length>=5?(n=this.valuePool,o=function(t){var e=[],n=[];t.forEach((function(t,o){e.push(o),n.push(t)}));var o=function(t,e){for(var n={},o=e.length,r=0,a=0,i=0,s=0,c=0,l=0;l<e.length;l++)r+=t[l],a+=e[l],i+=t[l]*e[l],s+=t[l]*t[l],c+=e[l]*e[l];var u=r/o,h=a/o;return n.a=(i-o*u*h)/(s-o*u*u),n.b=h-n.a*u,n.miss=Math.pow((o*i-r*a)/Math.sqrt((o*s-r*r)*(o*c-a*a)),2),n}(e,n);return function(t){return o.a*t+o.b}}(n),n=n.map((function(t,e){return o(e)})),e=o(n.length/2),this.valuePool.shift()):e=this.lastValue,e},t}();var v,g=((v=navigator.userAgent.toLowerCase().match(/cpu (iphone )?os (.*?) like mac os/))?parseInt(v[2],10):0)&&void 0!==window.AlipayJSBridge,y=void 0!==window.WindVane,b={X:!0,Y:!0,interval:Math.floor(1e3/30),useRequestAnimationFrame:!0,relativeBeta:!1,relativeGamma:!1,validRange:{alpha:[-60,60],beta:[-60,180],gamma:[-89,89]},stableRange:3},w=function(){function t(t){void 0===t&&(t={}),this.lastX=0,this.lastY=0,this.prevAcceler={x:0,y:0,z:0},this.stoped=!1,this.options=f(b,t);var e=this.options.stableRange;this.filterX=new d({stableRange:e}),this.filterY=new d({stableRange:e})}return t.prototype.watch=function(t){var e=this;if("function"==typeof t&&!this.watchListener){var n,o,r,a,i,s,c=0,l=0,u=NaN,h=NaN,f=function(c){e.stoped||(n=c.alpha,o=c.beta,r=c.gamma,a=p.call(e,{alpha:n,beta:o,gamma:r},e.options.validRange),isNaN(u)&&(u=r,e.filterX.lastValue=r),isNaN(h)&&(h=o,e.filterY.lastValue=o),a&&(e.options.X?(i=e.options.relativeGamma?r-u:r,i=e.filterX.stableFix(i),i=e.filterX.changeLimit(i),i=e.filterX.linearRegressionMedian(+i)):i=0,e.options.Y?(s=e.options.relativeBeta?o-h:o,s=e.filterY.stableFix(s),s=e.filterY.changeLimit(s),s=e.filterY.linearRegressionMedian(+s)):s=0,e.isValid(i,s)&&(e.options.useRequestAnimationFrame?window.requestAnimationFrame((function(){t(i,s,{alpha:n,beta:s-h,gamma:i-u})})):t(i,s,{alpha:n,beta:s-h,gamma:i-u}),e.lastX=i,e.lastY=s)))};this.stoped=!1,y?(x(!0,this.options.interval),this.watchListener=function(t){if("param"in t){var n=t.param,o=n.x,r=n.y,a=n.z;if(o===e.prevAcceler.x&&r===e.prevAcceler.y&&a===e.prevAcceler.z)return;e.prevAcceler={x:o,y:r,z:a},f({alpha:180*+a,beta:-90*+r,gamma:90*+o})}},document.addEventListener("motion.gyro",this.watchListener,!1)):g&&!m()?(M(!0,this.options.interval/1e3),this.watchListener=function(t){if(t&&"data"in t){var e=t.data,n=e.x,o=e.y,r=e.z;f({alpha:180*r,beta:-90*o,gamma:90*n})}},document.addEventListener("accelerometerChange",this.watchListener,!1)):(this.watchListener=function(t){(l=(new Date).getTime())-c>=e.options.interval&&(c=l,f(t))},window.addEventListener("deviceorientation",this.watchListener,!1))}},t.prototype.unWatch=function(){e.assertExist(this.watchListener),y?(x(!1),document.removeEventListener("motion.gyro",this.watchListener)):g?(M(!1),document.removeEventListener("accelerometerChange",this.watchListener)):window.removeEventListener("deviceorientation",this.watchListener),this.stoped=!0,this.watchListener=void 0},t.prototype.pause=function(){this.stoped=!0,g&&M(!1)},t.prototype.continue=function(){this.stoped=!1,g&&M(!0,this.options.interval/1e3)},t.prototype.isValid=function(t,e){return this.lastX!==t||this.lastY!==e},t}();function M(t,e){window.AlipayJSBridge.call("watchShake",{monitorGyroscope:!1,monitorAccelerometer:!!t,interval:t?parseFloat(e.toFixed(3)):10},(function(){}))}function x(t,e){var n={on:t,frequency:e};window.WindVane.call("WVMotion","listenGyro",n,(function(t){console.info("call WVMotion success")}),(function(t){console.error("call WVMotion failed:"+JSON.stringify(t))}))}var R,A=function(){function t(){this.transformers=[],this.connected=!1,this.accelerMotion=null,this.validRange={alpha:[-60,60],beta:[-80,80],gamma:[-89,89]}}return t.prototype.connect=function(){var t=this;this.connected||(this.accelerMotion=new w({X:!0,Y:!0,interval:Math.floor(1e3/60),useRequestAnimationFrame:!0,relativeBeta:!1,relativeGamma:!1,validRange:this.validRange,stableRange:3}),this.accelerMotion.watch((function(e,n,o){var r={x:e,y:n,beta:o.beta,gamma:o.gamma};t.dispatchMotion(r)}))),this.connected=!0},t.prototype.disconnect=function(){this.accelerMotion&&this.accelerMotion.unWatch(),this.connected=!1},t.prototype.dispatchMotion=function(t){this.transformers.forEach((function(e){return e.update(t)}))},t.prototype.addTransformer=function(t){this.transformers.includes(t)||this.transformers.push(t)},t.prototype.removeTransformer=function(t){var e=this.transformers.indexOf(t);return e>-1&&this.transformers.splice(e,1),0===this.transformers.length},t}();var L=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.order=90,e.adapter=null,e.handleConnect=function(){var t;O||null===(t=e.adapter)||void 0===t||t.connect()},e.handleDisconnect=function(){var t;null===(t=e.adapter)||void 0===t||t.disconnect()},e}return o(e,t),e.prototype.onCompositionConstructed=function(){var t;this.adapter=E(),null===(t=this.adapter)||void 0===t||t.connect(),this.bindAccelerDocumentEvent()},e.prototype.onCompositionReset=function(t){var e,n=t.loaderData.deviceTransformer=new s(t);null===(e=this.adapter)||void 0===e||e.addTransformer(n)},e.prototype.onCompositionUpdate=function(t){var e=t.loaderData.deviceTransformer;e&&e.updateOrientation()},e.prototype.onCompositionDestroyed=function(t){var e,n;(null===(e=this.adapter)||void 0===e?void 0:e.removeTransformer(t.loaderData.deviceTransformer))&&(null===(n=this.adapter)||void 0===n||n.disconnect())},e.prototype.bindAccelerDocumentEvent=function(){this.unbindAccelerDocumentEvent(),document.addEventListener("resume",this.handleConnect,!1),document.addEventListener("pause",this.handleDisconnect,!1),document.addEventListener("back",this.handleDisconnect,!1)},e.prototype.unbindAccelerDocumentEvent=function(){document.removeEventListener("resume",this.handleConnect),document.removeEventListener("pause",this.handleDisconnect),document.removeEventListener("back",this.handleDisconnect)},e.prototype.dispose=function(){E().disconnect(),this.unbindAccelerDocumentEvent()},e}(e.AbstractPlugin),O=!1;function E(){return R||(R=new A),R}var P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"orientation-transformer"},enumerable:!1,configurable:!0}),e.prototype.onConstructed=function(t){var e=t.content.options.targets;e&&(this.targets=e.map((function(t){return{name:t.name,xMin:+t.xMin||0,yMin:+t.yMin||0,xMax:+t.xMax||0,yMax:+t.yMax||0,vMin:+t.vMin||0,hMin:+t.hMin||0,vMax:+t.vMax||0,hMax:+t.hMax||0}})))},e.prototype.onItemRemoved=function(t){var e;null===(e=this.targets)||void 0===e||e.forEach((function(e){var n;return null===(n=t.loaderData.deviceTransformer)||void 0===n?void 0:n.removeTarget(e.name)}))},e.prototype.doCreateContent=function(t){var e,n=t.loaderData.deviceTransformer;return n&&(null===(e=this.targets)||void 0===e||e.forEach((function(t){return n.addTarget(t)})),n.initComposition()),{}},e}(e.VFXItem);e.registerPlugin("orientation-transformer",L,P);var j="1.5.0-alpha.0";e.logger.info("plugin orientation transformer version: "+j),t.OrientationAdapterAcceler=A,t.OrientationPluginLoader=L,t.TransformVFXItem=P,t.closeDeviceMotion=function(){O=!0,E().disconnect()},t.getAdapter=E,t.openDeviceMotion=function(){O=!1,E().connect()},t.version=j,Object.defineProperty(t,"__esModule",{value:!0})}));
9
9
  //# sourceMappingURL=index.min.js.map
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player orientation transformer plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,意绮
6
- * Version: v1.4.4
6
+ * Version: v1.5.0-alpha.0
7
7
  */
8
8
 
9
9
  import { isObject, isArray, assertExist, AbstractPlugin, VFXItem, registerPlugin, logger } from '@galacean/effects';
@@ -159,7 +159,6 @@ var CompositionTransformerAcceler = /** @class */ (function () {
159
159
  initRotation[1] + mapRange(br, target.vMin, target.vMax),
160
160
  initRotation[2],
161
161
  ];
162
- // console.log(y, initY, y - initY);
163
162
  (_b = layer.transform).setPosition.apply(_b, __spreadArray([], __read(position), false));
164
163
  (_c = layer.transform).setRotation.apply(_c, __spreadArray([], __read(rotation), false));
165
164
  this.currentPos[name] = position.slice();
@@ -270,6 +269,17 @@ function isIOS() {
270
269
  var ver = str.match(/cpu (iphone )?os (.*?) like mac os/);
271
270
  return ver ? parseInt(ver[2], 10) : 0;
272
271
  }
272
+ function isMiniProgram() {
273
+ return isAlipayMiniApp() || isWechatMiniApp();
274
+ }
275
+ function isAlipayMiniApp() {
276
+ //@ts-expect-error
277
+ return typeof my !== 'undefined' && (my === null || my === void 0 ? void 0 : my.renderTarget) === 'web';
278
+ }
279
+ function isWechatMiniApp() {
280
+ //@ts-expect-error
281
+ return window.__wxjs_environment === 'miniprogram';
282
+ }
273
283
 
274
284
  /**
275
285
  * 稳定区间
@@ -519,7 +529,7 @@ var DeviceOrientation = /** @class */ (function () {
519
529
  };
520
530
  document.addEventListener('motion.gyro', this.watchListener, false);
521
531
  }
522
- else if (useJSBridge) {
532
+ else if (useJSBridge && !isMiniProgram()) {
523
533
  switchIOSEvent(true, this.options.interval / 1000);
524
534
  this.watchListener = function (e) {
525
535
  if (e && 'data' in e) {
@@ -810,8 +820,8 @@ var TransformVFXItem = /** @class */ (function (_super) {
810
820
  }(VFXItem));
811
821
 
812
822
  registerPlugin('orientation-transformer', OrientationPluginLoader, TransformVFXItem);
813
- var version = "1.4.4";
823
+ var version = "1.5.0-alpha.0";
814
824
  logger.info('plugin orientation transformer version: ' + version);
815
825
 
816
- export { OrientationAdapterAcceler, closeDeviceMotion, getAdapter, openDeviceMotion, version };
826
+ export { OrientationAdapterAcceler, OrientationPluginLoader, TransformVFXItem, closeDeviceMotion, getAdapter, openDeviceMotion, version };
817
827
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1,4 @@
1
1
  export declare function isIOS(): number;
2
+ export declare function isMiniProgram(): boolean;
3
+ export declare function isAlipayMiniApp(): boolean;
4
+ export declare function isWechatMiniApp(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-plugin-orientation-transformer",
3
- "version": "1.4.4",
3
+ "version": "1.5.0-alpha.0",
4
4
  "description": "Galacean Effects player orientation transformer plugin",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -14,6 +14,18 @@
14
14
  "import": "./dist/index.mjs",
15
15
  "require": "./dist/index.js",
16
16
  "types": "./dist/index.d.ts"
17
+ },
18
+ "./alipay": {
19
+ "import": "./dist/alipay.mjs",
20
+ "require": "./dist/alipay.js",
21
+ "types": "./dist/index.d.ts"
22
+ }
23
+ },
24
+ "typesVersions": {
25
+ "*": {
26
+ "alipay": [
27
+ "./dist/index.d.ts"
28
+ ]
17
29
  }
18
30
  },
19
31
  "contributors": [
@@ -31,7 +43,7 @@
31
43
  "registry": "https://registry.npmjs.org"
32
44
  },
33
45
  "devDependencies": {
34
- "@galacean/effects": "1.4.4"
46
+ "@galacean/effects": "1.5.0-alpha.0"
35
47
  },
36
48
  "scripts": {
37
49
  "dev": "vite",