@galacean/effects-threejs 2.7.0-beta.0 → 2.7.1
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 +42 -38
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +42 -38
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime threejs plugin for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.7.
|
|
6
|
+
* Version: v2.7.1
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -25343,7 +25343,7 @@ exports.VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
25343
25343
|
};
|
|
25344
25344
|
_proto.fromData = function fromData(data) {
|
|
25345
25345
|
EffectsObject.prototype.fromData.call(this, data);
|
|
25346
|
-
var id = data.id, name = data.name, parentId = data.parentId, endBehavior = data.endBehavior, transform = data.transform, _data_duration = data.duration, duration = _data_duration === void 0 ? 0 : _data_duration;
|
|
25346
|
+
var id = data.id, name = data.name, parentId = data.parentId, endBehavior = data.endBehavior, transform = data.transform, _data_duration = data.duration, duration = _data_duration === void 0 ? 0 : _data_duration, _data_visible = data.visible, visible = _data_visible === void 0 ? true : _data_visible;
|
|
25347
25347
|
this.props = data;
|
|
25348
25348
|
this.type = data.type;
|
|
25349
25349
|
this.id = id.toString(); // TODO 老数据 id 是 number,需要转换
|
|
@@ -25381,6 +25381,7 @@ exports.VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
25381
25381
|
if (VFXItem.isComposition(this)) {
|
|
25382
25382
|
this.instantiatePreComposition();
|
|
25383
25383
|
}
|
|
25384
|
+
this.setVisible(visible);
|
|
25384
25385
|
};
|
|
25385
25386
|
_proto.toData = function toData() {
|
|
25386
25387
|
var _this_parent;
|
|
@@ -29255,7 +29256,8 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
29255
29256
|
_proto.getLineCount = function getLineCount(text, init) {
|
|
29256
29257
|
var context = this.context;
|
|
29257
29258
|
var _this_textLayout = this.textLayout, letterSpace = _this_textLayout.letterSpace, overflow = _this_textLayout.overflow;
|
|
29258
|
-
|
|
29259
|
+
// const fontScale = init ? this.textStyle.fontSize / 10 : 1 / this.textStyle.fontScale;
|
|
29260
|
+
this.maxLineWidth = 0;
|
|
29259
29261
|
var width = this.textLayout.width + this.textStyle.fontOffset;
|
|
29260
29262
|
var lineCount = 1;
|
|
29261
29263
|
var x = 0;
|
|
@@ -29267,7 +29269,7 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
29267
29269
|
var _context_measureText;
|
|
29268
29270
|
var str = text[i];
|
|
29269
29271
|
var _context_measureText_width;
|
|
29270
|
-
var textMetrics = (
|
|
29272
|
+
var textMetrics = (_context_measureText_width = context == null ? void 0 : (_context_measureText = context.measureText(str)) == null ? void 0 : _context_measureText.width) != null ? _context_measureText_width : 0;
|
|
29271
29273
|
// 和浏览器行为保持一致
|
|
29272
29274
|
x += letterSpace;
|
|
29273
29275
|
// 处理文本结束行为
|
|
@@ -30675,42 +30677,41 @@ function version34Migration(json) {
|
|
|
30675
30677
|
}
|
|
30676
30678
|
}
|
|
30677
30679
|
}
|
|
30678
|
-
// 处理富文本lineGap兼容性
|
|
30679
|
-
processRichTextLineGapCompatibility(json);
|
|
30680
30680
|
//@ts-expect-error
|
|
30681
30681
|
json.version = "3.5";
|
|
30682
30682
|
return json;
|
|
30683
30683
|
}
|
|
30684
|
-
|
|
30685
|
-
|
|
30686
|
-
|
|
30687
|
-
|
|
30688
|
-
|
|
30689
|
-
|
|
30690
|
-
|
|
30691
|
-
|
|
30692
|
-
|
|
30693
|
-
|
|
30694
|
-
|
|
30695
|
-
|
|
30684
|
+
function version35Migration(json) {
|
|
30685
|
+
// 处理富文本 lineGap 兼容性
|
|
30686
|
+
if (json.components) {
|
|
30687
|
+
// 遍历所有组件,处理富文本组件
|
|
30688
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(json.components), _step; !(_step = _iterator()).done;){
|
|
30689
|
+
var component = _step.value;
|
|
30690
|
+
// 识别富文本组件并处理 lineGap 兼容性
|
|
30691
|
+
if (component.dataType === DataType.RichTextComponent) {
|
|
30692
|
+
var richTextComponent = component;
|
|
30693
|
+
if (richTextComponent.options) {
|
|
30694
|
+
// 检查是否已经处理过
|
|
30695
|
+
//@ts-expect-error
|
|
30696
|
+
if (richTextComponent.options.useLegacyRichText === undefined) {
|
|
30697
|
+
// 根据是否存在 lineGap 字段来判断版本
|
|
30698
|
+
if (richTextComponent.options.lineGap === undefined) {
|
|
30699
|
+
// 旧版本(没有 lineGap 字段)
|
|
30700
|
+
//@ts-expect-error
|
|
30701
|
+
richTextComponent.options.useLegacyRichText = true;
|
|
30702
|
+
} else {
|
|
30703
|
+
// 新版本(有 lineGap 字段)
|
|
30704
|
+
//@ts-expect-error
|
|
30705
|
+
richTextComponent.options.useLegacyRichText = false;
|
|
30706
|
+
}
|
|
30707
|
+
}
|
|
30708
|
+
}
|
|
30709
|
+
}
|
|
30696
30710
|
}
|
|
30697
30711
|
}
|
|
30698
|
-
|
|
30699
|
-
|
|
30700
|
-
|
|
30701
|
-
*/ function ensureRichTextLineGap(options) {
|
|
30702
|
-
// 检查是否已经处理过
|
|
30703
|
-
if (!options || options.useLegacyRichText !== undefined) {
|
|
30704
|
-
return;
|
|
30705
|
-
}
|
|
30706
|
-
// 根据是否存在 lineGap 字段来判断版本
|
|
30707
|
-
if (options.lineGap === undefined) {
|
|
30708
|
-
// 旧版本(没有 lineGap 字段)
|
|
30709
|
-
options.useLegacyRichText = true;
|
|
30710
|
-
} else {
|
|
30711
|
-
// 新版本(有 lineGap 字段)
|
|
30712
|
-
options.useLegacyRichText = false;
|
|
30713
|
-
}
|
|
30712
|
+
//@ts-expect-error
|
|
30713
|
+
json.version = "3.6";
|
|
30714
|
+
return json;
|
|
30714
30715
|
}
|
|
30715
30716
|
/**
|
|
30716
30717
|
* 根据形状获取形状几何体数据
|
|
@@ -31634,7 +31635,7 @@ function getStandardSpriteContent(sprite, transform) {
|
|
|
31634
31635
|
return ret;
|
|
31635
31636
|
}
|
|
31636
31637
|
|
|
31637
|
-
var version$2 = "2.7.
|
|
31638
|
+
var version$2 = "2.7.1";
|
|
31638
31639
|
var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
|
|
31639
31640
|
var standardVersion = /^(\d+)\.(\d+)$/;
|
|
31640
31641
|
var reverseParticle = false;
|
|
@@ -31652,7 +31653,7 @@ function getStandardJSON(json) {
|
|
|
31652
31653
|
if (v0.test(json.version)) {
|
|
31653
31654
|
var _exec;
|
|
31654
31655
|
reverseParticle = ((_exec = /^(\d+)/.exec(json.version)) == null ? void 0 : _exec[0]) === "0";
|
|
31655
|
-
return version34Migration(version33Migration(version32Migration(version31Migration(version30Migration(version21Migration(getStandardJSONFromV0(json)))))));
|
|
31656
|
+
return version35Migration(version34Migration(version33Migration(version32Migration(version31Migration(version30Migration(version21Migration(getStandardJSONFromV0(json))))))));
|
|
31656
31657
|
}
|
|
31657
31658
|
reverseParticle = false;
|
|
31658
31659
|
var vs = standardVersion.exec(json.version) || [];
|
|
@@ -31683,6 +31684,9 @@ function getStandardJSON(json) {
|
|
|
31683
31684
|
if (minorVersion < 5) {
|
|
31684
31685
|
json = version34Migration(json);
|
|
31685
31686
|
}
|
|
31687
|
+
if (minorVersion < 6) {
|
|
31688
|
+
json = version35Migration(json);
|
|
31689
|
+
}
|
|
31686
31690
|
}
|
|
31687
31691
|
return json;
|
|
31688
31692
|
}
|
|
@@ -34907,7 +34911,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
|
|
|
34907
34911
|
registerPlugin("particle", ParticleLoader, exports.VFXItem);
|
|
34908
34912
|
registerPlugin("cal", CalculateLoader, exports.VFXItem);
|
|
34909
34913
|
registerPlugin("interact", InteractLoader, exports.VFXItem);
|
|
34910
|
-
var version$1 = "2.7.
|
|
34914
|
+
var version$1 = "2.7.1";
|
|
34911
34915
|
logger.info("Core version: " + version$1 + ".");
|
|
34912
34916
|
|
|
34913
34917
|
var _obj;
|
|
@@ -36488,7 +36492,7 @@ setMaxSpriteMeshItemCount(8);
|
|
|
36488
36492
|
*/ Mesh.create = function(engine, props) {
|
|
36489
36493
|
return new ThreeMesh(engine, props);
|
|
36490
36494
|
};
|
|
36491
|
-
var version = "2.7.
|
|
36495
|
+
var version = "2.7.1";
|
|
36492
36496
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
36493
36497
|
|
|
36494
36498
|
exports.AbstractPlugin = AbstractPlugin;
|