@galacean/effects-specification 2.0.0-alpha.6 → 2.0.0-alpha.7

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.
@@ -1,4 +1,4 @@
1
- import type { BaseItem, Composition, CompressedImage, Image, JSONScene, ParticleItem, RenderLevel, SpriteItem, TemplateImage, FilterItem } from '../src';
1
+ import type { BaseItem, Composition, CompressedImage, Image, JSONScene, ParticleItem, RenderLevel, SpriteItem, TemplateImage } from '../src';
2
2
  export * from './utils';
3
3
  export declare function getStandardJSON(json: any): JSONScene;
4
4
  export declare function getStandardImage(image: any, index: number, imageTags: RenderLevel[]): TemplateImage | Image | CompressedImage;
@@ -9,4 +9,4 @@ export declare function getStandardComposition(composition: any, opt?: {
9
9
  export declare function getStandardItem(item: any, opt?: {
10
10
  plugins?: string[];
11
11
  requires?: string[];
12
- }): SpriteItem | ParticleItem | BaseItem | FilterItem;
12
+ }): SpriteItem | ParticleItem | BaseItem;
package/dist/fallback.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Name: @galacean/effects-specification
3
3
  * Description: Galacean Effects JSON Specification
4
4
  * Author: Ant Group CO., Ltd.
5
- * Version: v2.0.0-alpha.6
5
+ * Version: v2.0.0-alpha.7
6
6
  */
7
7
 
8
8
  'use strict';
@@ -378,10 +378,6 @@ var ItemType;
378
378
  * 预合成元素
379
379
  */
380
380
  ItemType["composition"] = "7";
381
- /**
382
- * 滤镜图层
383
- */
384
- ItemType["filter"] = "8";
385
381
  /**
386
382
  * Spine 元素
387
383
  */
@@ -530,7 +526,7 @@ var CompositionEndBehavior;
530
526
 
531
527
  /**
532
528
  * 动态换图类型
533
- * @since 1.3.0
529
+ * @since 1.1.0
534
530
  */
535
531
  var BackgroundType;
536
532
  (function (BackgroundType) {
@@ -1222,14 +1218,6 @@ function getStandardParticleContent(particle) {
1222
1218
  ret.options.startRotationX = ensureNumberExpression(options.startRotationX);
1223
1219
  ret.options.startRotationY = ensureNumberExpression(options.startRotationY);
1224
1220
  }
1225
- if (particle.filter) {
1226
- var filter_1 = {};
1227
- forEach(particle.filter, function (val, key) {
1228
- // @ts-expect-error
1229
- filter_1[key] = ensureValueGetter(val);
1230
- });
1231
- ret.filter = filter_1;
1232
- }
1233
1221
  if (transform && transform.path) {
1234
1222
  ret.emitterTransform = {
1235
1223
  path: ensureFixedVec3(transform.path),
@@ -1513,36 +1501,6 @@ function getStandardCameraContent(model) {
1513
1501
  return ret;
1514
1502
  }
1515
1503
 
1516
- var convertParams = [
1517
- 'strength',
1518
- 'bloomAddon',
1519
- 'colorAddon',
1520
- 'period',
1521
- 'waveMovement',
1522
- 'colorThreshold',
1523
- 'xOpacity',
1524
- 'yOpacity',
1525
- 'feather',
1526
- ];
1527
- var pathParams = [
1528
- 'path', 'position',
1529
- ];
1530
- function getStandardFilterContent(filter) {
1531
- var ret = {};
1532
- forEach(filter, function (val, key) {
1533
- if (convertParams.includes(key)) {
1534
- ret[key] = ensureFixedNumber(val);
1535
- }
1536
- else if (pathParams.includes(key)) {
1537
- ret[key] = ensureFixedVec3(val);
1538
- }
1539
- else {
1540
- ret[key] = val;
1541
- }
1542
- });
1543
- return ret;
1544
- }
1545
-
1546
1504
  /**
1547
1505
  * 2.1 以下版本数据适配(mars-player@2.4.0 及以上版本支持 2.1 以下数据的适配)
1548
1506
  */
@@ -1607,14 +1565,28 @@ function version30Migration(json) {
1607
1565
  if (composition.endBehavior === END_BEHAVIOR_PAUSE_AND_DESTROY || composition.endBehavior === END_BEHAVIOR_PAUSE) {
1608
1566
  composition.endBehavior = END_BEHAVIOR_FREEZE;
1609
1567
  }
1568
+ // 过滤掉滤镜元素
1569
+ composition.items = composition.items.filter(function (item) { return item.type !== '8'; });
1570
+ // 过滤掉粒子滤镜(扭曲)
1571
+ composition.items.forEach(function (item) {
1572
+ if (item.type === ItemType.particle) {
1573
+ // @ts-expect-error
1574
+ var filterData = item.content['filter'];
1575
+ if (filterData) {
1576
+ // @ts-expect-error
1577
+ delete item.content['filter'];
1578
+ }
1579
+ }
1580
+ });
1581
+ var itemGuidMap_1 = {};
1610
1582
  try {
1611
1583
  for (var _r = (e_3 = void 0, __values(composition.items)), _s = _r.next(); !_s.done; _s = _r.next()) {
1612
1584
  var item = _s.value;
1613
- itemGuidMap[item.id] = generateGUID();
1585
+ itemGuidMap_1[item.id] = generateGUID();
1614
1586
  // TODO: 编辑器测试用,上线后删除
1615
1587
  //@ts-expect-error
1616
1588
  item.oldId = item.id;
1617
- item.id = itemGuidMap[item.id];
1589
+ item.id = itemGuidMap_1[item.id];
1618
1590
  }
1619
1591
  }
1620
1592
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
@@ -1629,10 +1601,10 @@ function version30Migration(json) {
1629
1601
  if (item.parentId.includes('^')) {
1630
1602
  var parentId = (item.parentId).split('^')[0];
1631
1603
  var nodeId = (item.parentId).split('^')[1];
1632
- item.parentId = itemGuidMap[parentId] + '^' + nodeId;
1604
+ item.parentId = itemGuidMap_1[parentId] + '^' + nodeId;
1633
1605
  }
1634
1606
  else {
1635
- item.parentId = itemGuidMap[item.parentId];
1607
+ item.parentId = itemGuidMap_1[item.parentId];
1636
1608
  }
1637
1609
  }
1638
1610
  // @ts-expect-error fix item type
@@ -1969,14 +1941,6 @@ function getStandardItem(item, opt) {
1969
1941
  duration = item.duration;
1970
1942
  }
1971
1943
  transform = item.transform || getTransform(originContent.transform);
1972
- if (type === ItemType.filter) {
1973
- if (currentVersion < '1.1') {
1974
- currentVersion = '1.1';
1975
- }
1976
- content = getStandardSpriteContent(originContent, transform);
1977
- // @ts-expect-error
1978
- content.filter = getStandardFilterContent(originContent.filter);
1979
- }
1980
1944
  }
1981
1945
  else if (item.particle) {
1982
1946
  type = ItemType.particle;