@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.mjs 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
  /******************************************************************************
@@ -6572,7 +6572,7 @@ function generateGUID$1() {
6572
6572
  * Name: @galacean/effects-specification
6573
6573
  * Description: Galacean Effects JSON Specification
6574
6574
  * Author: Ant Group CO., Ltd.
6575
- * Version: v2.0.0-alpha.2
6575
+ * Version: v2.0.0-alpha.3
6576
6576
  */
6577
6577
 
6578
6578
  typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
@@ -21106,7 +21106,7 @@ function getPluginUsageInfo(name) {
21106
21106
  * Name: @galacean/effects-specification
21107
21107
  * Description: Galacean Effects JSON Specification
21108
21108
  * Author: Ant Group CO., Ltd.
21109
- * Version: v2.0.0-alpha.2
21109
+ * Version: v2.0.0-alpha.3
21110
21110
  */
21111
21111
 
21112
21112
  const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
@@ -22641,7 +22641,7 @@ function version22Migration(json) {
22641
22641
  */
22642
22642
  function version30Migration(json) {
22643
22643
  var e_1, _a;
22644
- var _b, _c, _d, _e;
22644
+ var _b, _c, _d, _e, _f, _g, _h, _j;
22645
22645
  var result = Object.assign({}, json, {
22646
22646
  items: [],
22647
22647
  components: [],
@@ -22669,15 +22669,15 @@ function version30Migration(json) {
22669
22669
  }
22670
22670
  }
22671
22671
  var _loop_1 = function (composition) {
22672
- var e_2, _h, e_3, _j;
22672
+ var e_2, _m, e_3, _o;
22673
22673
  // composition 的 endbehaviour 兼容
22674
22674
  if (composition.endBehavior === END_BEHAVIOR_PAUSE_AND_DESTROY || composition.endBehavior === END_BEHAVIOR_PAUSE) {
22675
22675
  composition.endBehavior = END_BEHAVIOR_FREEZE;
22676
22676
  }
22677
22677
  var itemGuidMap = {};
22678
22678
  try {
22679
- for (var _k = (e_2 = void 0, __values(composition.items)), _l = _k.next(); !_l.done; _l = _k.next()) {
22680
- var item = _l.value;
22679
+ for (var _p = (e_2 = void 0, __values(composition.items)), _q = _p.next(); !_q.done; _q = _p.next()) {
22680
+ var item = _q.value;
22681
22681
  itemGuidMap[item.id] = generateGUID();
22682
22682
  // TODO: 编辑器测试用,上线后删除
22683
22683
  //@ts-expect-error
@@ -22688,7 +22688,7 @@ function version30Migration(json) {
22688
22688
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
22689
22689
  finally {
22690
22690
  try {
22691
- if (_l && !_l.done && (_h = _k.return)) _h.call(_k);
22691
+ if (_q && !_q.done && (_m = _p.return)) _m.call(_p);
22692
22692
  }
22693
22693
  finally { if (e_2) throw e_2.error; }
22694
22694
  }
@@ -22709,8 +22709,8 @@ function version30Migration(json) {
22709
22709
  composition.items[index] = { id: item.id };
22710
22710
  });
22711
22711
  try {
22712
- for (var _m = (e_3 = void 0, __values(result.items)), _o = _m.next(); !_o.done; _o = _m.next()) {
22713
- var item = _o.value;
22712
+ for (var _r = (e_3 = void 0, __values(result.items)), _s = _r.next(); !_s.done; _s = _r.next()) {
22713
+ var item = _s.value;
22714
22714
  // 原 texture 索引转为统一 guid 索引
22715
22715
  if (item.content) {
22716
22716
  if (item.content.renderer) {
@@ -22759,13 +22759,10 @@ function version30Migration(json) {
22759
22759
  var startSize = item.transform.size;
22760
22760
  // 兼容旧JSON(anchor和particleOrigin可能同时存在)
22761
22761
  if (!renderer.anchor && renderer.particleOrigin !== undefined) {
22762
- //@ts-expect-error
22763
- item.transform.position.x += -realAnchor[0] * startSize.x;
22764
- //@ts-expect-error
22765
- item.transform.position.y += -realAnchor[1] * startSize.y;
22762
+ item.transform.position.x += -realAnchor[0] * ((_f = startSize === null || startSize === void 0 ? void 0 : startSize.x) !== null && _f !== void 0 ? _f : 1);
22763
+ item.transform.position.y += -realAnchor[1] * ((_g = startSize === null || startSize === void 0 ? void 0 : startSize.y) !== null && _g !== void 0 ? _g : 1);
22766
22764
  }
22767
- //@ts-expect-error
22768
- item.transform.anchor = { x: realAnchor[0] * startSize.x, y: realAnchor[1] * startSize.y };
22765
+ 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) };
22769
22766
  }
22770
22767
  }
22771
22768
  if (item.type === ItemType.particle) {
@@ -22917,22 +22914,22 @@ function version30Migration(json) {
22917
22914
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
22918
22915
  finally {
22919
22916
  try {
22920
- if (_o && !_o.done && (_j = _m.return)) _j.call(_m);
22917
+ if (_s && !_s.done && (_o = _r.return)) _o.call(_r);
22921
22918
  }
22922
22919
  finally { if (e_3) throw e_3.error; }
22923
22920
  }
22924
22921
  };
22925
22922
  try {
22926
22923
  // 更正Composition.endBehavior
22927
- for (var _f = __values(json.compositions), _g = _f.next(); !_g.done; _g = _f.next()) {
22928
- var composition = _g.value;
22924
+ for (var _k = __values(json.compositions), _l = _k.next(); !_l.done; _l = _k.next()) {
22925
+ var composition = _l.value;
22929
22926
  _loop_1(composition);
22930
22927
  }
22931
22928
  }
22932
22929
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
22933
22930
  finally {
22934
22931
  try {
22935
- if (_g && !_g.done && (_a = _f.return)) _a.call(_f);
22932
+ if (_l && !_l.done && (_a = _k.return)) _a.call(_k);
22936
22933
  }
22937
22934
  finally { if (e_1) throw e_1.error; }
22938
22935
  }