@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.mjs
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
|
import * as THREE from 'three';
|
|
@@ -25319,7 +25319,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
25319
25319
|
};
|
|
25320
25320
|
_proto.fromData = function fromData(data) {
|
|
25321
25321
|
EffectsObject.prototype.fromData.call(this, data);
|
|
25322
|
-
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;
|
|
25322
|
+
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;
|
|
25323
25323
|
this.props = data;
|
|
25324
25324
|
this.type = data.type;
|
|
25325
25325
|
this.id = id.toString(); // TODO 老数据 id 是 number,需要转换
|
|
@@ -25357,6 +25357,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
25357
25357
|
if (VFXItem.isComposition(this)) {
|
|
25358
25358
|
this.instantiatePreComposition();
|
|
25359
25359
|
}
|
|
25360
|
+
this.setVisible(visible);
|
|
25360
25361
|
};
|
|
25361
25362
|
_proto.toData = function toData() {
|
|
25362
25363
|
var _this_parent;
|
|
@@ -29231,7 +29232,8 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
29231
29232
|
_proto.getLineCount = function getLineCount(text, init) {
|
|
29232
29233
|
var context = this.context;
|
|
29233
29234
|
var _this_textLayout = this.textLayout, letterSpace = _this_textLayout.letterSpace, overflow = _this_textLayout.overflow;
|
|
29234
|
-
|
|
29235
|
+
// const fontScale = init ? this.textStyle.fontSize / 10 : 1 / this.textStyle.fontScale;
|
|
29236
|
+
this.maxLineWidth = 0;
|
|
29235
29237
|
var width = this.textLayout.width + this.textStyle.fontOffset;
|
|
29236
29238
|
var lineCount = 1;
|
|
29237
29239
|
var x = 0;
|
|
@@ -29243,7 +29245,7 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
29243
29245
|
var _context_measureText;
|
|
29244
29246
|
var str = text[i];
|
|
29245
29247
|
var _context_measureText_width;
|
|
29246
|
-
var textMetrics = (
|
|
29248
|
+
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;
|
|
29247
29249
|
// 和浏览器行为保持一致
|
|
29248
29250
|
x += letterSpace;
|
|
29249
29251
|
// 处理文本结束行为
|
|
@@ -30651,42 +30653,41 @@ function version34Migration(json) {
|
|
|
30651
30653
|
}
|
|
30652
30654
|
}
|
|
30653
30655
|
}
|
|
30654
|
-
// 处理富文本lineGap兼容性
|
|
30655
|
-
processRichTextLineGapCompatibility(json);
|
|
30656
30656
|
//@ts-expect-error
|
|
30657
30657
|
json.version = "3.5";
|
|
30658
30658
|
return json;
|
|
30659
30659
|
}
|
|
30660
|
-
|
|
30661
|
-
|
|
30662
|
-
|
|
30663
|
-
|
|
30664
|
-
|
|
30665
|
-
|
|
30666
|
-
|
|
30667
|
-
|
|
30668
|
-
|
|
30669
|
-
|
|
30670
|
-
|
|
30671
|
-
|
|
30660
|
+
function version35Migration(json) {
|
|
30661
|
+
// 处理富文本 lineGap 兼容性
|
|
30662
|
+
if (json.components) {
|
|
30663
|
+
// 遍历所有组件,处理富文本组件
|
|
30664
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(json.components), _step; !(_step = _iterator()).done;){
|
|
30665
|
+
var component = _step.value;
|
|
30666
|
+
// 识别富文本组件并处理 lineGap 兼容性
|
|
30667
|
+
if (component.dataType === DataType.RichTextComponent) {
|
|
30668
|
+
var richTextComponent = component;
|
|
30669
|
+
if (richTextComponent.options) {
|
|
30670
|
+
// 检查是否已经处理过
|
|
30671
|
+
//@ts-expect-error
|
|
30672
|
+
if (richTextComponent.options.useLegacyRichText === undefined) {
|
|
30673
|
+
// 根据是否存在 lineGap 字段来判断版本
|
|
30674
|
+
if (richTextComponent.options.lineGap === undefined) {
|
|
30675
|
+
// 旧版本(没有 lineGap 字段)
|
|
30676
|
+
//@ts-expect-error
|
|
30677
|
+
richTextComponent.options.useLegacyRichText = true;
|
|
30678
|
+
} else {
|
|
30679
|
+
// 新版本(有 lineGap 字段)
|
|
30680
|
+
//@ts-expect-error
|
|
30681
|
+
richTextComponent.options.useLegacyRichText = false;
|
|
30682
|
+
}
|
|
30683
|
+
}
|
|
30684
|
+
}
|
|
30685
|
+
}
|
|
30672
30686
|
}
|
|
30673
30687
|
}
|
|
30674
|
-
|
|
30675
|
-
|
|
30676
|
-
|
|
30677
|
-
*/ function ensureRichTextLineGap(options) {
|
|
30678
|
-
// 检查是否已经处理过
|
|
30679
|
-
if (!options || options.useLegacyRichText !== undefined) {
|
|
30680
|
-
return;
|
|
30681
|
-
}
|
|
30682
|
-
// 根据是否存在 lineGap 字段来判断版本
|
|
30683
|
-
if (options.lineGap === undefined) {
|
|
30684
|
-
// 旧版本(没有 lineGap 字段)
|
|
30685
|
-
options.useLegacyRichText = true;
|
|
30686
|
-
} else {
|
|
30687
|
-
// 新版本(有 lineGap 字段)
|
|
30688
|
-
options.useLegacyRichText = false;
|
|
30689
|
-
}
|
|
30688
|
+
//@ts-expect-error
|
|
30689
|
+
json.version = "3.6";
|
|
30690
|
+
return json;
|
|
30690
30691
|
}
|
|
30691
30692
|
/**
|
|
30692
30693
|
* 根据形状获取形状几何体数据
|
|
@@ -31610,7 +31611,7 @@ function getStandardSpriteContent(sprite, transform) {
|
|
|
31610
31611
|
return ret;
|
|
31611
31612
|
}
|
|
31612
31613
|
|
|
31613
|
-
var version$2 = "2.7.
|
|
31614
|
+
var version$2 = "2.7.1";
|
|
31614
31615
|
var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
|
|
31615
31616
|
var standardVersion = /^(\d+)\.(\d+)$/;
|
|
31616
31617
|
var reverseParticle = false;
|
|
@@ -31628,7 +31629,7 @@ function getStandardJSON(json) {
|
|
|
31628
31629
|
if (v0.test(json.version)) {
|
|
31629
31630
|
var _exec;
|
|
31630
31631
|
reverseParticle = ((_exec = /^(\d+)/.exec(json.version)) == null ? void 0 : _exec[0]) === "0";
|
|
31631
|
-
return version34Migration(version33Migration(version32Migration(version31Migration(version30Migration(version21Migration(getStandardJSONFromV0(json)))))));
|
|
31632
|
+
return version35Migration(version34Migration(version33Migration(version32Migration(version31Migration(version30Migration(version21Migration(getStandardJSONFromV0(json))))))));
|
|
31632
31633
|
}
|
|
31633
31634
|
reverseParticle = false;
|
|
31634
31635
|
var vs = standardVersion.exec(json.version) || [];
|
|
@@ -31659,6 +31660,9 @@ function getStandardJSON(json) {
|
|
|
31659
31660
|
if (minorVersion < 5) {
|
|
31660
31661
|
json = version34Migration(json);
|
|
31661
31662
|
}
|
|
31663
|
+
if (minorVersion < 6) {
|
|
31664
|
+
json = version35Migration(json);
|
|
31665
|
+
}
|
|
31662
31666
|
}
|
|
31663
31667
|
return json;
|
|
31664
31668
|
}
|
|
@@ -34883,7 +34887,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem);
|
|
|
34883
34887
|
registerPlugin("particle", ParticleLoader, VFXItem);
|
|
34884
34888
|
registerPlugin("cal", CalculateLoader, VFXItem);
|
|
34885
34889
|
registerPlugin("interact", InteractLoader, VFXItem);
|
|
34886
|
-
var version$1 = "2.7.
|
|
34890
|
+
var version$1 = "2.7.1";
|
|
34887
34891
|
logger.info("Core version: " + version$1 + ".");
|
|
34888
34892
|
|
|
34889
34893
|
var _obj;
|
|
@@ -36464,7 +36468,7 @@ setMaxSpriteMeshItemCount(8);
|
|
|
36464
36468
|
*/ Mesh.create = function(engine, props) {
|
|
36465
36469
|
return new ThreeMesh(engine, props);
|
|
36466
36470
|
};
|
|
36467
|
-
var version = "2.7.
|
|
36471
|
+
var version = "2.7.1";
|
|
36468
36472
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
36469
36473
|
|
|
36470
36474
|
export { AbstractPlugin, ActivationMixerPlayable, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AndNode, AndNodeData, Animatable, AnimationClip, AnimationClipNode, AnimationClipNodeData, AnimationGraphAsset, Animator, ApplyAdditiveNode, ApplyAdditiveNodeData, Asset, AssetLoader, AssetManager, AssetService, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, BlendNode, BlendNodeData, BoolValueNode, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPlayable, ColorPropertyMixerPlayable, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, ComponentTimePlayable, ComponentTimePlayableAsset, ComponentTimeTrack, Composition, CompositionComponent, ConstBoolNode, ConstBoolNodeData, ConstFloatNode, ConstFloatNodeData, ControlParameterBoolNode, ControlParameterBoolNodeData, ControlParameterFloatNode, ControlParameterFloatNodeData, ControlParameterTriggerNode, ControlParameterTriggerNodeData, DEFAULT_FONTS, DEFAULT_FPS, Database, Deferred, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectComponentTimeTrack, EffectsObject, EffectsPackage, Ellipse, Engine, EqualNodeData, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatComparisonNode, FloatComparisonNodeData, FloatPropertyMixerPlayable, FloatPropertyPlayableAsset, FloatPropertyTrack, FloatValueNode, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, GraphInstance, GraphNode, GraphNodeData, GraphicsPath, GreaterNodeData, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, InvalidIndex, Item, KTXTexture, LayerBlendNode, LayerBlendNodeData, LessNodeData, LineSegments, LinearValue, MaskMode, MaskProcessor, MaskableGraphic, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, NodeTransform, NotNode, NotNodeData, ObjectBindingTrack, OrNode, OrNodeData, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleMixerPlayable, ParticleSystem, ParticleSystemRenderer, ParticleTrack, PassTextureCache, PathSegments, PlayState, Playable, PlayableAsset, PlayableOutput, PluginSystem, PolyStar, Polygon, Pose, PoseNode, PostProcessVolume, PropertyClipPlayable, PropertyTrack, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, Scene, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, ShapePath, SourceType, SpriteColorMixerPlayable, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteComponentTimeTrack, SpriteLoader, StarType, StateMachineNode, StateMachineNodeData, StateNode, StateNodeData, StaticValue, SubCompositionClipPlayable, SubCompositionMixerPlayable, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TangentMode, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TexturePaintScaleMode, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelineInstance, TrackAsset, TrackMixerPlayable, TrackType, Transform, TransformMixerPlayable, TransformPlayable, TransformPlayableAsset, TransformTrack, TransitionNode, TransitionNodeData, TransitionState, VFXItem, ValueGetter, ValueNode, Vector2Curve, Vector2PropertyMixerPlayable, Vector2PropertyPlayableAsset, Vector2PropertyTrack, Vector3Curve, Vector3PropertyMixerPlayable, Vector3PropertyTrack, Vector3ropertyPlayableAsset, Vector4Curve, Vector4PropertyMixerPlayable, Vector4PropertyPlayableAsset, Vector4PropertyTrack, WeightedMode, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, buildLine, calculateTranslation, canUseBOM, canvasPool, closePointEps, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, curveEps, decimalEqual, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getClass, getColorFromGradientStops, getConfig, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getNodeDataClass, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isOpenHarmony, isPlainObject, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, nodeDataClass, noop, normalizeColor, numberToFix, oldBezierKeyFramesToNew, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, passRenderLevel, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, setUniformValue, sortByOrder, index$1 as spec, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
|