@galacean/effects-core 2.0.0-alpha.4 → 2.0.0-alpha.5

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.0.0-alpha.4
6
+ * Version: v2.0.0-alpha.5
7
7
  */
8
8
 
9
9
  'use strict';
@@ -6576,7 +6576,7 @@ function generateGUID$1() {
6576
6576
  * Name: @galacean/effects-specification
6577
6577
  * Description: Galacean Effects JSON Specification
6578
6578
  * Author: Ant Group CO., Ltd.
6579
- * Version: v2.0.0-alpha.2
6579
+ * Version: v2.0.0-alpha.3
6580
6580
  */
6581
6581
 
6582
6582
  typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
@@ -21110,7 +21110,7 @@ function getPluginUsageInfo(name) {
21110
21110
  * Name: @galacean/effects-specification
21111
21111
  * Description: Galacean Effects JSON Specification
21112
21112
  * Author: Ant Group CO., Ltd.
21113
- * Version: v2.0.0-alpha.2
21113
+ * Version: v2.0.0-alpha.3
21114
21114
  */
21115
21115
 
21116
21116
  const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
@@ -22645,7 +22645,7 @@ function version22Migration(json) {
22645
22645
  */
22646
22646
  function version30Migration(json) {
22647
22647
  var e_1, _a;
22648
- var _b, _c, _d, _e;
22648
+ var _b, _c, _d, _e, _f, _g, _h, _j;
22649
22649
  var result = Object.assign({}, json, {
22650
22650
  items: [],
22651
22651
  components: [],
@@ -22673,15 +22673,15 @@ function version30Migration(json) {
22673
22673
  }
22674
22674
  }
22675
22675
  var _loop_1 = function (composition) {
22676
- var e_2, _h, e_3, _j;
22676
+ var e_2, _m, e_3, _o;
22677
22677
  // composition 的 endbehaviour 兼容
22678
22678
  if (composition.endBehavior === END_BEHAVIOR_PAUSE_AND_DESTROY || composition.endBehavior === END_BEHAVIOR_PAUSE) {
22679
22679
  composition.endBehavior = END_BEHAVIOR_FREEZE;
22680
22680
  }
22681
22681
  var itemGuidMap = {};
22682
22682
  try {
22683
- for (var _k = (e_2 = void 0, __values(composition.items)), _l = _k.next(); !_l.done; _l = _k.next()) {
22684
- var item = _l.value;
22683
+ for (var _p = (e_2 = void 0, __values(composition.items)), _q = _p.next(); !_q.done; _q = _p.next()) {
22684
+ var item = _q.value;
22685
22685
  itemGuidMap[item.id] = generateGUID();
22686
22686
  // TODO: 编辑器测试用,上线后删除
22687
22687
  //@ts-expect-error
@@ -22692,7 +22692,7 @@ function version30Migration(json) {
22692
22692
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
22693
22693
  finally {
22694
22694
  try {
22695
- if (_l && !_l.done && (_h = _k.return)) _h.call(_k);
22695
+ if (_q && !_q.done && (_m = _p.return)) _m.call(_p);
22696
22696
  }
22697
22697
  finally { if (e_2) throw e_2.error; }
22698
22698
  }
@@ -22713,8 +22713,8 @@ function version30Migration(json) {
22713
22713
  composition.items[index] = { id: item.id };
22714
22714
  });
22715
22715
  try {
22716
- for (var _m = (e_3 = void 0, __values(result.items)), _o = _m.next(); !_o.done; _o = _m.next()) {
22717
- var item = _o.value;
22716
+ for (var _r = (e_3 = void 0, __values(result.items)), _s = _r.next(); !_s.done; _s = _r.next()) {
22717
+ var item = _s.value;
22718
22718
  // 原 texture 索引转为统一 guid 索引
22719
22719
  if (item.content) {
22720
22720
  if (item.content.renderer) {
@@ -22763,13 +22763,10 @@ function version30Migration(json) {
22763
22763
  var startSize = item.transform.size;
22764
22764
  // 兼容旧JSON(anchor和particleOrigin可能同时存在)
22765
22765
  if (!renderer.anchor && renderer.particleOrigin !== undefined) {
22766
- //@ts-expect-error
22767
- item.transform.position.x += -realAnchor[0] * startSize.x;
22768
- //@ts-expect-error
22769
- item.transform.position.y += -realAnchor[1] * startSize.y;
22766
+ item.transform.position.x += -realAnchor[0] * ((_f = startSize === null || startSize === void 0 ? void 0 : startSize.x) !== null && _f !== void 0 ? _f : 1);
22767
+ item.transform.position.y += -realAnchor[1] * ((_g = startSize === null || startSize === void 0 ? void 0 : startSize.y) !== null && _g !== void 0 ? _g : 1);
22770
22768
  }
22771
- //@ts-expect-error
22772
- item.transform.anchor = { x: realAnchor[0] * startSize.x, y: realAnchor[1] * startSize.y };
22769
+ item.transform.anchor = { x: realAnchor[0] * ((_h = startSize === null || startSize === void 0 ? void 0 : startSize.x) !== null && _h !== void 0 ? _h : 1), y: realAnchor[1] * ((_j = startSize === null || startSize === void 0 ? void 0 : startSize.y) !== null && _j !== void 0 ? _j : 1) };
22773
22770
  }
22774
22771
  }
22775
22772
  if (item.type === ItemType.particle) {
@@ -22921,22 +22918,22 @@ function version30Migration(json) {
22921
22918
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
22922
22919
  finally {
22923
22920
  try {
22924
- if (_o && !_o.done && (_j = _m.return)) _j.call(_m);
22921
+ if (_s && !_s.done && (_o = _r.return)) _o.call(_r);
22925
22922
  }
22926
22923
  finally { if (e_3) throw e_3.error; }
22927
22924
  }
22928
22925
  };
22929
22926
  try {
22930
22927
  // 更正Composition.endBehavior
22931
- for (var _f = __values(json.compositions), _g = _f.next(); !_g.done; _g = _f.next()) {
22932
- var composition = _g.value;
22928
+ for (var _k = __values(json.compositions), _l = _k.next(); !_l.done; _l = _k.next()) {
22929
+ var composition = _l.value;
22933
22930
  _loop_1(composition);
22934
22931
  }
22935
22932
  }
22936
22933
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
22937
22934
  finally {
22938
22935
  try {
22939
- if (_g && !_g.done && (_a = _f.return)) _a.call(_f);
22936
+ if (_l && !_l.done && (_a = _k.return)) _a.call(_k);
22940
22937
  }
22941
22938
  finally { if (e_1) throw e_1.error; }
22942
22939
  }