@galacean/effects-core 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/fallback/migration.d.ts +1 -0
- package/dist/index.js +41 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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.7.
|
|
6
|
+
* Version: v2.7.1
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -25317,7 +25317,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
25317
25317
|
};
|
|
25318
25318
|
_proto.fromData = function fromData(data) {
|
|
25319
25319
|
EffectsObject.prototype.fromData.call(this, data);
|
|
25320
|
-
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;
|
|
25320
|
+
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;
|
|
25321
25321
|
this.props = data;
|
|
25322
25322
|
this.type = data.type;
|
|
25323
25323
|
this.id = id.toString(); // TODO 老数据 id 是 number,需要转换
|
|
@@ -25355,6 +25355,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
25355
25355
|
if (VFXItem.isComposition(this)) {
|
|
25356
25356
|
this.instantiatePreComposition();
|
|
25357
25357
|
}
|
|
25358
|
+
this.setVisible(visible);
|
|
25358
25359
|
};
|
|
25359
25360
|
_proto.toData = function toData() {
|
|
25360
25361
|
var _this_parent;
|
|
@@ -29229,7 +29230,8 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
29229
29230
|
_proto.getLineCount = function getLineCount(text, init) {
|
|
29230
29231
|
var context = this.context;
|
|
29231
29232
|
var _this_textLayout = this.textLayout, letterSpace = _this_textLayout.letterSpace, overflow = _this_textLayout.overflow;
|
|
29232
|
-
|
|
29233
|
+
// const fontScale = init ? this.textStyle.fontSize / 10 : 1 / this.textStyle.fontScale;
|
|
29234
|
+
this.maxLineWidth = 0;
|
|
29233
29235
|
var width = this.textLayout.width + this.textStyle.fontOffset;
|
|
29234
29236
|
var lineCount = 1;
|
|
29235
29237
|
var x = 0;
|
|
@@ -29241,7 +29243,7 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
29241
29243
|
var _context_measureText;
|
|
29242
29244
|
var str = text[i];
|
|
29243
29245
|
var _context_measureText_width;
|
|
29244
|
-
var textMetrics = (
|
|
29246
|
+
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;
|
|
29245
29247
|
// 和浏览器行为保持一致
|
|
29246
29248
|
x += letterSpace;
|
|
29247
29249
|
// 处理文本结束行为
|
|
@@ -30649,42 +30651,41 @@ function version34Migration(json) {
|
|
|
30649
30651
|
}
|
|
30650
30652
|
}
|
|
30651
30653
|
}
|
|
30652
|
-
// 处理富文本lineGap兼容性
|
|
30653
|
-
processRichTextLineGapCompatibility(json);
|
|
30654
30654
|
//@ts-expect-error
|
|
30655
30655
|
json.version = "3.5";
|
|
30656
30656
|
return json;
|
|
30657
30657
|
}
|
|
30658
|
-
|
|
30659
|
-
|
|
30660
|
-
|
|
30661
|
-
|
|
30662
|
-
|
|
30663
|
-
|
|
30664
|
-
|
|
30665
|
-
|
|
30666
|
-
|
|
30667
|
-
|
|
30668
|
-
|
|
30669
|
-
|
|
30658
|
+
function version35Migration(json) {
|
|
30659
|
+
// 处理富文本 lineGap 兼容性
|
|
30660
|
+
if (json.components) {
|
|
30661
|
+
// 遍历所有组件,处理富文本组件
|
|
30662
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(json.components), _step; !(_step = _iterator()).done;){
|
|
30663
|
+
var component = _step.value;
|
|
30664
|
+
// 识别富文本组件并处理 lineGap 兼容性
|
|
30665
|
+
if (component.dataType === DataType.RichTextComponent) {
|
|
30666
|
+
var richTextComponent = component;
|
|
30667
|
+
if (richTextComponent.options) {
|
|
30668
|
+
// 检查是否已经处理过
|
|
30669
|
+
//@ts-expect-error
|
|
30670
|
+
if (richTextComponent.options.useLegacyRichText === undefined) {
|
|
30671
|
+
// 根据是否存在 lineGap 字段来判断版本
|
|
30672
|
+
if (richTextComponent.options.lineGap === undefined) {
|
|
30673
|
+
// 旧版本(没有 lineGap 字段)
|
|
30674
|
+
//@ts-expect-error
|
|
30675
|
+
richTextComponent.options.useLegacyRichText = true;
|
|
30676
|
+
} else {
|
|
30677
|
+
// 新版本(有 lineGap 字段)
|
|
30678
|
+
//@ts-expect-error
|
|
30679
|
+
richTextComponent.options.useLegacyRichText = false;
|
|
30680
|
+
}
|
|
30681
|
+
}
|
|
30682
|
+
}
|
|
30683
|
+
}
|
|
30670
30684
|
}
|
|
30671
30685
|
}
|
|
30672
|
-
|
|
30673
|
-
|
|
30674
|
-
|
|
30675
|
-
*/ function ensureRichTextLineGap(options) {
|
|
30676
|
-
// 检查是否已经处理过
|
|
30677
|
-
if (!options || options.useLegacyRichText !== undefined) {
|
|
30678
|
-
return;
|
|
30679
|
-
}
|
|
30680
|
-
// 根据是否存在 lineGap 字段来判断版本
|
|
30681
|
-
if (options.lineGap === undefined) {
|
|
30682
|
-
// 旧版本(没有 lineGap 字段)
|
|
30683
|
-
options.useLegacyRichText = true;
|
|
30684
|
-
} else {
|
|
30685
|
-
// 新版本(有 lineGap 字段)
|
|
30686
|
-
options.useLegacyRichText = false;
|
|
30687
|
-
}
|
|
30686
|
+
//@ts-expect-error
|
|
30687
|
+
json.version = "3.6";
|
|
30688
|
+
return json;
|
|
30688
30689
|
}
|
|
30689
30690
|
/**
|
|
30690
30691
|
* 根据形状获取形状几何体数据
|
|
@@ -31608,7 +31609,7 @@ function getStandardSpriteContent(sprite, transform) {
|
|
|
31608
31609
|
return ret;
|
|
31609
31610
|
}
|
|
31610
31611
|
|
|
31611
|
-
var version$1 = "2.7.
|
|
31612
|
+
var version$1 = "2.7.1";
|
|
31612
31613
|
var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
|
|
31613
31614
|
var standardVersion = /^(\d+)\.(\d+)$/;
|
|
31614
31615
|
var reverseParticle = false;
|
|
@@ -31626,7 +31627,7 @@ function getStandardJSON(json) {
|
|
|
31626
31627
|
if (v0.test(json.version)) {
|
|
31627
31628
|
var _exec;
|
|
31628
31629
|
reverseParticle = ((_exec = /^(\d+)/.exec(json.version)) == null ? void 0 : _exec[0]) === "0";
|
|
31629
|
-
return version34Migration(version33Migration(version32Migration(version31Migration(version30Migration(version21Migration(getStandardJSONFromV0(json)))))));
|
|
31630
|
+
return version35Migration(version34Migration(version33Migration(version32Migration(version31Migration(version30Migration(version21Migration(getStandardJSONFromV0(json))))))));
|
|
31630
31631
|
}
|
|
31631
31632
|
reverseParticle = false;
|
|
31632
31633
|
var vs = standardVersion.exec(json.version) || [];
|
|
@@ -31657,6 +31658,9 @@ function getStandardJSON(json) {
|
|
|
31657
31658
|
if (minorVersion < 5) {
|
|
31658
31659
|
json = version34Migration(json);
|
|
31659
31660
|
}
|
|
31661
|
+
if (minorVersion < 6) {
|
|
31662
|
+
json = version35Migration(json);
|
|
31663
|
+
}
|
|
31660
31664
|
}
|
|
31661
31665
|
return json;
|
|
31662
31666
|
}
|
|
@@ -34881,7 +34885,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem);
|
|
|
34881
34885
|
registerPlugin("particle", ParticleLoader, VFXItem);
|
|
34882
34886
|
registerPlugin("cal", CalculateLoader, VFXItem);
|
|
34883
34887
|
registerPlugin("interact", InteractLoader, VFXItem);
|
|
34884
|
-
var version = "2.7.
|
|
34888
|
+
var version = "2.7.1";
|
|
34885
34889
|
logger.info("Core version: " + version + ".");
|
|
34886
34890
|
|
|
34887
34891
|
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, 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, TangentMode, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TexturePaintScaleMode, TextureSourceType, TextureStoreAction, 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, sortByOrder, index$1 as spec, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
|