@galacean/engine-ui 2.0.0-alpha.39 → 2.0.0-alpha.40

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/module.js CHANGED
@@ -1,4 +1,4 @@
1
- import { EntityModifyFlags, ignoreClone, assignmentClone, DisorderedArray, Component, Matrix, BoundingBox, Utils as Utils$1, TransformModifyFlags, Transform, deepClone, Vector2, Rect, MathUtil, Vector3, Plane, ShaderProperty, dependentComponents, DependentMode, VertexMergeBatcher, ShaderMacroCollection, Renderer, Vector4, Color, RendererUpdateFlags, Script, CameraModifyFlags, Logger, Signal, SpriteDrawMode, SpriteModifyFlags, SpriteTileMode, TiledSpriteAssembler, SlicedSpriteAssembler, SimpleSpriteAssembler, ShaderData, ShaderDataGroup, TextUtils, Engine, TextVerticalAlignment, TextHorizontalAlignment, OverflowMode, CharRenderInfo, FontStyle, ReferResource, registerPointerEventEmitter, PointerEventEmitter, CameraClearFlags, Material, Entity, Loader, Shader } from '@galacean/engine';
1
+ import { EntityModifyFlags, ignoreClone, DisorderedArray, Component, Matrix, BoundingBox, Utils as Utils$1, TransformModifyFlags, Transform, Vector2, Rect, MathUtil, Vector3, Plane, ShaderProperty, dependentComponents, DependentMode, VertexMergeBatcher, ShaderMacroCollection, Renderer, Vector4, Color, RendererUpdateFlags, Script, CameraModifyFlags, Logger, Signal, SpriteDrawMode, SpriteModifyFlags, SpriteTileMode, TiledSpriteAssembler, SlicedSpriteAssembler, SimpleSpriteAssembler, ShaderData, ShaderDataGroup, TextUtils, Engine, TextVerticalAlignment, TextHorizontalAlignment, OverflowMode, CharRenderInfo, FontStyle, ReferResource, DataObject, registerPointerEventEmitter, PointerEventEmitter, CameraClearFlags, Material, Entity, Loader, Shader } from '@galacean/engine';
2
2
 
3
3
  function _defineProperties(target, props) {
4
4
  for (var i = 0; i < props.length; i++) {
@@ -233,24 +233,12 @@ __decorate([
233
233
  __decorate([
234
234
  ignoreClone
235
235
  ], UIGroup.prototype, "_indexInRootCanvas", void 0);
236
- __decorate([
237
- ignoreClone
238
- ], UIGroup.prototype, "_disorderedElements", void 0);
239
236
  __decorate([
240
237
  ignoreClone
241
238
  ], UIGroup.prototype, "_globalAlpha", void 0);
242
239
  __decorate([
243
240
  ignoreClone
244
241
  ], UIGroup.prototype, "_globalInteractive", void 0);
245
- __decorate([
246
- assignmentClone
247
- ], UIGroup.prototype, "_alpha", void 0);
248
- __decorate([
249
- assignmentClone
250
- ], UIGroup.prototype, "_interactive", void 0);
251
- __decorate([
252
- assignmentClone
253
- ], UIGroup.prototype, "_ignoreParentGroup", void 0);
254
242
  __decorate([
255
243
  ignoreClone
256
244
  ], UIGroup.prototype, "_rootCanvasListeningEntities", void 0);
@@ -636,10 +624,10 @@ var SortEntry = function SortEntry() {
636
624
  this._isParentDirty = true;
637
625
  this._updateWorldFlagWithParentRectChange(TransformModifyFlags.WmWpWeWqWsWus);
638
626
  };
639
- // @ts-ignore
640
- _proto._cloneTo = function _cloneTo(target) {
641
- // @ts-ignore
642
- Transform.prototype._cloneTo.call(this, target);
627
+ /**
628
+ * @inheritdoc
629
+ */ _proto._onClone = function _onClone(target) {
630
+ Transform.prototype._onClone.call(this, target);
643
631
  var size = target._size, pivot = target._pivot;
644
632
  // @ts-ignore
645
633
  size._onValueChanged = pivot._onValueChanged = null;
@@ -1000,9 +988,6 @@ __decorate([
1000
988
  __decorate([
1001
989
  ignoreClone
1002
990
  ], UITransform.prototype, "_pivot", void 0);
1003
- __decorate([
1004
- deepClone
1005
- ], UITransform.prototype, "_rect", void 0);
1006
991
  __decorate([
1007
992
  ignoreClone
1008
993
  ], UITransform.prototype, "_onPositionChanged", null);
@@ -1213,9 +1198,6 @@ var UIRenderer = /*#__PURE__*/ function(Renderer) {
1213
1198
  /** @internal */ UIRenderer._tempMat = new Matrix();
1214
1199
  /** @internal */ UIRenderer._tempPlane = new Plane();
1215
1200
  /** @internal */ UIRenderer._textureProperty = ShaderProperty.getByName("renderer_UITexture");
1216
- __decorate([
1217
- deepClone
1218
- ], UIRenderer.prototype, "raycastPadding", void 0);
1219
1201
  __decorate([
1220
1202
  ignoreClone
1221
1203
  ], UIRenderer.prototype, "_indexInRootCanvas", void 0);
@@ -1237,12 +1219,6 @@ __decorate([
1237
1219
  __decorate([
1238
1220
  ignoreClone
1239
1221
  ], UIRenderer.prototype, "_subChunk", void 0);
1240
- __decorate([
1241
- assignmentClone
1242
- ], UIRenderer.prototype, "_raycastEnabled", void 0);
1243
- __decorate([
1244
- deepClone
1245
- ], UIRenderer.prototype, "_color", void 0);
1246
1222
  __decorate([
1247
1223
  ignoreClone
1248
1224
  ], UIRenderer.prototype, "_groupListener", null);
@@ -1475,12 +1451,6 @@ __decorate([
1475
1451
  __decorate([
1476
1452
  ignoreClone
1477
1453
  ], UIInteractive.prototype, "_globalInteractiveDirty", void 0);
1478
- __decorate([
1479
- deepClone
1480
- ], UIInteractive.prototype, "_transitions", void 0);
1481
- __decorate([
1482
- assignmentClone
1483
- ], UIInteractive.prototype, "_interactive", void 0);
1484
1454
  __decorate([
1485
1455
  ignoreClone
1486
1456
  ], UIInteractive.prototype, "_state", void 0);
@@ -1670,8 +1640,8 @@ var UICanvas = /*#__PURE__*/ function(Component) {
1670
1640
  }
1671
1641
  };
1672
1642
  /**
1673
- * @internal
1674
- */ _proto._cloneTo = function _cloneTo(target) {
1643
+ * @inheritdoc
1644
+ */ _proto._onClone = function _onClone(target) {
1675
1645
  target.renderMode = this._renderMode;
1676
1646
  };
1677
1647
  _proto._getRenderers = function _getRenderers() {
@@ -2102,36 +2072,15 @@ __decorate([
2102
2072
  __decorate([
2103
2073
  ignoreClone
2104
2074
  ], UICanvas.prototype, "_realRenderMode", void 0);
2105
- __decorate([
2106
- ignoreClone
2107
- ], UICanvas.prototype, "_disorderedElements", void 0);
2108
2075
  __decorate([
2109
2076
  ignoreClone
2110
2077
  ], UICanvas.prototype, "_renderMode", void 0);
2111
- __decorate([
2112
- assignmentClone
2113
- ], UICanvas.prototype, "_resolutionAdaptationMode", void 0);
2114
- __decorate([
2115
- assignmentClone
2116
- ], UICanvas.prototype, "_sortOrder", void 0);
2117
- __decorate([
2118
- assignmentClone
2119
- ], UICanvas.prototype, "_distance", void 0);
2120
- __decorate([
2121
- deepClone
2122
- ], UICanvas.prototype, "_referenceResolution", void 0);
2123
- __decorate([
2124
- assignmentClone
2125
- ], UICanvas.prototype, "_referenceResolutionPerUnit", void 0);
2126
2078
  __decorate([
2127
2079
  ignoreClone
2128
2080
  ], UICanvas.prototype, "_hierarchyVersion", void 0);
2129
2081
  __decorate([
2130
2082
  ignoreClone
2131
2083
  ], UICanvas.prototype, "_center", void 0);
2132
- __decorate([
2133
- ignoreClone
2134
- ], UICanvas.prototype, "_centerDirtyFlag", void 0);
2135
2084
  __decorate([
2136
2085
  ignoreClone
2137
2086
  ], UICanvas.prototype, "_rootCanvasListener", null);
@@ -2194,9 +2143,6 @@ var Button = /*#__PURE__*/ function(UIInteractive) {
2194
2143
  };
2195
2144
  return Button;
2196
2145
  }(UIInteractive);
2197
- __decorate([
2198
- deepClone
2199
- ], Button.prototype, "onClick", void 0);
2200
2146
 
2201
2147
  /**
2202
2148
  * UI element that renders an image.
@@ -2225,10 +2171,9 @@ __decorate([
2225
2171
  }
2226
2172
  };
2227
2173
  /**
2228
- * @internal
2229
- */ _proto._cloneTo = function _cloneTo(target) {
2230
- // @ts-ignore
2231
- UIRenderer1.prototype._cloneTo.call(this, target);
2174
+ * @inheritdoc
2175
+ */ _proto._onClone = function _onClone(target) {
2176
+ UIRenderer1.prototype._onClone.call(this, target);
2232
2177
  target.sprite = this._sprite;
2233
2178
  target.drawMode = this._drawMode;
2234
2179
  };
@@ -2445,12 +2390,6 @@ __decorate([
2445
2390
  __decorate([
2446
2391
  ignoreClone
2447
2392
  ], Image.prototype, "_assembler", void 0);
2448
- __decorate([
2449
- assignmentClone
2450
- ], Image.prototype, "_tileMode", void 0);
2451
- __decorate([
2452
- assignmentClone
2453
- ], Image.prototype, "_tiledAdaptiveThreshold", void 0);
2454
2393
  __decorate([
2455
2394
  ignoreClone
2456
2395
  ], Image.prototype, "_onTransformChanged", null);
@@ -2486,13 +2425,6 @@ __decorate([
2486
2425
  this._textChunks = null;
2487
2426
  this._subFont && (this._subFont = null);
2488
2427
  };
2489
- // @ts-ignore
2490
- _proto._cloneTo = function _cloneTo(target) {
2491
- // @ts-ignore
2492
- UIRenderer1.prototype._cloneTo.call(this, target);
2493
- target.font = this._font;
2494
- target._subFont = this._subFont;
2495
- };
2496
2428
  /**
2497
2429
  * @internal
2498
2430
  */ _proto._isContainDirtyFlag = function _isContainDirtyFlag(type) {
@@ -3019,39 +2951,9 @@ __decorate([
3019
2951
  __decorate([
3020
2952
  ignoreClone
3021
2953
  ], Text.prototype, "_subFont", void 0);
3022
- __decorate([
3023
- assignmentClone
3024
- ], Text.prototype, "_text", void 0);
3025
2954
  __decorate([
3026
2955
  ignoreClone
3027
2956
  ], Text.prototype, "_localBounds", void 0);
3028
- __decorate([
3029
- assignmentClone
3030
- ], Text.prototype, "_font", void 0);
3031
- __decorate([
3032
- assignmentClone
3033
- ], Text.prototype, "_fontSize", void 0);
3034
- __decorate([
3035
- assignmentClone
3036
- ], Text.prototype, "_fontStyle", void 0);
3037
- __decorate([
3038
- assignmentClone
3039
- ], Text.prototype, "_lineSpacing", void 0);
3040
- __decorate([
3041
- assignmentClone
3042
- ], Text.prototype, "_characterSpacing", void 0);
3043
- __decorate([
3044
- assignmentClone
3045
- ], Text.prototype, "_horizontalAlignment", void 0);
3046
- __decorate([
3047
- assignmentClone
3048
- ], Text.prototype, "_verticalAlignment", void 0);
3049
- __decorate([
3050
- assignmentClone
3051
- ], Text.prototype, "_enableWrapping", void 0);
3052
- __decorate([
3053
- assignmentClone
3054
- ], Text.prototype, "_overflowMode", void 0);
3055
2957
  __decorate([
3056
2958
  ignoreClone
3057
2959
  ], Text.prototype, "_onTransformChanged", null);
@@ -3061,19 +2963,28 @@ var TextChunk = function TextChunk() {
3061
2963
 
3062
2964
  /**
3063
2965
  * The transition behavior of UIInteractive.
3064
- */ var Transition = /*#__PURE__*/ function() {
2966
+ */ var Transition = /*#__PURE__*/ function(DataObject) {
2967
+ _inherits(Transition, DataObject);
3065
2968
  function Transition() {
3066
- this._duration = 0;
3067
- this._countDown = 0;
3068
- this._finalState = InteractiveState.Normal;
2969
+ var _this;
2970
+ _this = DataObject.apply(this, arguments) || this, _this._duration = 0, _this._countDown = 0, _this._finalState = InteractiveState.Normal;
2971
+ return _this;
3069
2972
  }
3070
2973
  var _proto = Transition.prototype;
3071
2974
  _proto.destroy = function destroy() {
3072
2975
  var _this__interactive;
3073
2976
  (_this__interactive = this._interactive) == null ? void 0 : _this__interactive.removeTransition(this);
2977
+ this._addStateValuesReferCount(-1);
2978
+ this._normal = this._pressed = this._hover = this._disabled = null;
2979
+ this._initialValue = this._currentValue = this._finalValue = null;
3074
2980
  this._target = null;
3075
2981
  };
3076
2982
  /**
2983
+ * @inheritdoc
2984
+ */ _proto._onClone = function _onClone(target) {
2985
+ target._addStateValuesReferCount(1);
2986
+ };
2987
+ /**
3077
2988
  * @internal
3078
2989
  */ _proto._setState = function _setState(state, instant) {
3079
2990
  this._finalState = state;
@@ -3112,6 +3023,17 @@ var TextChunk = function TextChunk() {
3112
3023
  this._updateCurrentValue(this._initialValue, this._finalValue, weight);
3113
3024
  ((_this__target = this._target) == null ? void 0 : _this__target.enabled) && this._applyValue(this._currentValue);
3114
3025
  };
3026
+ _proto._addStateValuesReferCount = function _addStateValuesReferCount(count) {
3027
+ var _this = this, _normal = _this._normal, _pressed = _this._pressed, _hover = _this._hover, _disabled = _this._disabled;
3028
+ // @ts-ignore
3029
+ _instanceof(_normal, ReferResource) && _normal._addReferCount(count);
3030
+ // @ts-ignore
3031
+ _instanceof(_pressed, ReferResource) && _pressed._addReferCount(count);
3032
+ // @ts-ignore
3033
+ _instanceof(_hover, ReferResource) && _hover._addReferCount(count);
3034
+ // @ts-ignore
3035
+ _instanceof(_disabled, ReferResource) && _disabled._addReferCount(count);
3036
+ };
3115
3037
  _proto._getValueByState = function _getValueByState(state) {
3116
3038
  switch(state){
3117
3039
  case InteractiveState.Normal:
@@ -3220,7 +3142,22 @@ var TextChunk = function TextChunk() {
3220
3142
  }
3221
3143
  ]);
3222
3144
  return Transition;
3223
- }();
3145
+ }(DataObject);
3146
+ __decorate([
3147
+ ignoreClone
3148
+ ], Transition.prototype, "_countDown", void 0);
3149
+ __decorate([
3150
+ ignoreClone
3151
+ ], Transition.prototype, "_initialValue", void 0);
3152
+ __decorate([
3153
+ ignoreClone
3154
+ ], Transition.prototype, "_finalValue", void 0);
3155
+ __decorate([
3156
+ ignoreClone
3157
+ ], Transition.prototype, "_currentValue", void 0);
3158
+ __decorate([
3159
+ ignoreClone
3160
+ ], Transition.prototype, "_finalState", void 0);
3224
3161
 
3225
3162
  /**
3226
3163
  * Color transition.
@@ -3329,33 +3266,6 @@ var TextChunk = function TextChunk() {
3329
3266
  return Transition.apply(this, arguments) || this;
3330
3267
  }
3331
3268
  var _proto = SpriteTransition.prototype;
3332
- /**
3333
- * @internal
3334
- */ _proto.destroy = function destroy() {
3335
- Transition.prototype.destroy.call(this);
3336
- if (this._normal) {
3337
- // @ts-ignore
3338
- this._normal._addReferCount(-1);
3339
- this._normal = null;
3340
- }
3341
- if (this._hover) {
3342
- // @ts-ignore
3343
- this._hover._addReferCount(-1);
3344
- this._hover = null;
3345
- }
3346
- if (this._pressed) {
3347
- // @ts-ignore
3348
- this._pressed._addReferCount(-1);
3349
- this._pressed = null;
3350
- }
3351
- if (this._disabled) {
3352
- // @ts-ignore
3353
- this._disabled._addReferCount(-1);
3354
- this._disabled = null;
3355
- }
3356
- this._initialValue = this._currentValue = this._finalValue = null;
3357
- this._target = null;
3358
- };
3359
3269
  _proto._getTargetValueCopy = function _getTargetValueCopy() {
3360
3270
  var _this__target;
3361
3271
  return (_this__target = this._target) == null ? void 0 : _this__target.sprite;