@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/browser.js CHANGED
@@ -237,24 +237,12 @@
237
237
  __decorate([
238
238
  engine.ignoreClone
239
239
  ], UIGroup.prototype, "_indexInRootCanvas", void 0);
240
- __decorate([
241
- engine.ignoreClone
242
- ], UIGroup.prototype, "_disorderedElements", void 0);
243
240
  __decorate([
244
241
  engine.ignoreClone
245
242
  ], UIGroup.prototype, "_globalAlpha", void 0);
246
243
  __decorate([
247
244
  engine.ignoreClone
248
245
  ], UIGroup.prototype, "_globalInteractive", void 0);
249
- __decorate([
250
- engine.assignmentClone
251
- ], UIGroup.prototype, "_alpha", void 0);
252
- __decorate([
253
- engine.assignmentClone
254
- ], UIGroup.prototype, "_interactive", void 0);
255
- __decorate([
256
- engine.assignmentClone
257
- ], UIGroup.prototype, "_ignoreParentGroup", void 0);
258
246
  __decorate([
259
247
  engine.ignoreClone
260
248
  ], UIGroup.prototype, "_rootCanvasListeningEntities", void 0);
@@ -640,10 +628,10 @@
640
628
  this._isParentDirty = true;
641
629
  this._updateWorldFlagWithParentRectChange(engine.TransformModifyFlags.WmWpWeWqWsWus);
642
630
  };
643
- // @ts-ignore
644
- _proto._cloneTo = function _cloneTo(target) {
645
- // @ts-ignore
646
- Transform.prototype._cloneTo.call(this, target);
631
+ /**
632
+ * @inheritdoc
633
+ */ _proto._onClone = function _onClone(target) {
634
+ Transform.prototype._onClone.call(this, target);
647
635
  var size = target._size, pivot = target._pivot;
648
636
  // @ts-ignore
649
637
  size._onValueChanged = pivot._onValueChanged = null;
@@ -1004,9 +992,6 @@
1004
992
  __decorate([
1005
993
  engine.ignoreClone
1006
994
  ], UITransform.prototype, "_pivot", void 0);
1007
- __decorate([
1008
- engine.deepClone
1009
- ], UITransform.prototype, "_rect", void 0);
1010
995
  __decorate([
1011
996
  engine.ignoreClone
1012
997
  ], UITransform.prototype, "_onPositionChanged", null);
@@ -1217,9 +1202,6 @@
1217
1202
  /** @internal */ exports.UIRenderer._tempMat = new engine.Matrix();
1218
1203
  /** @internal */ exports.UIRenderer._tempPlane = new engine.Plane();
1219
1204
  /** @internal */ exports.UIRenderer._textureProperty = engine.ShaderProperty.getByName("renderer_UITexture");
1220
- __decorate([
1221
- engine.deepClone
1222
- ], exports.UIRenderer.prototype, "raycastPadding", void 0);
1223
1205
  __decorate([
1224
1206
  engine.ignoreClone
1225
1207
  ], exports.UIRenderer.prototype, "_indexInRootCanvas", void 0);
@@ -1241,12 +1223,6 @@
1241
1223
  __decorate([
1242
1224
  engine.ignoreClone
1243
1225
  ], exports.UIRenderer.prototype, "_subChunk", void 0);
1244
- __decorate([
1245
- engine.assignmentClone
1246
- ], exports.UIRenderer.prototype, "_raycastEnabled", void 0);
1247
- __decorate([
1248
- engine.deepClone
1249
- ], exports.UIRenderer.prototype, "_color", void 0);
1250
1226
  __decorate([
1251
1227
  engine.ignoreClone
1252
1228
  ], exports.UIRenderer.prototype, "_groupListener", null);
@@ -1479,12 +1455,6 @@
1479
1455
  __decorate([
1480
1456
  engine.ignoreClone
1481
1457
  ], UIInteractive.prototype, "_globalInteractiveDirty", void 0);
1482
- __decorate([
1483
- engine.deepClone
1484
- ], UIInteractive.prototype, "_transitions", void 0);
1485
- __decorate([
1486
- engine.assignmentClone
1487
- ], UIInteractive.prototype, "_interactive", void 0);
1488
1458
  __decorate([
1489
1459
  engine.ignoreClone
1490
1460
  ], UIInteractive.prototype, "_state", void 0);
@@ -1674,8 +1644,8 @@
1674
1644
  }
1675
1645
  };
1676
1646
  /**
1677
- * @internal
1678
- */ _proto._cloneTo = function _cloneTo(target) {
1647
+ * @inheritdoc
1648
+ */ _proto._onClone = function _onClone(target) {
1679
1649
  target.renderMode = this._renderMode;
1680
1650
  };
1681
1651
  _proto._getRenderers = function _getRenderers() {
@@ -2106,36 +2076,15 @@
2106
2076
  __decorate([
2107
2077
  engine.ignoreClone
2108
2078
  ], exports.UICanvas.prototype, "_realRenderMode", void 0);
2109
- __decorate([
2110
- engine.ignoreClone
2111
- ], exports.UICanvas.prototype, "_disorderedElements", void 0);
2112
2079
  __decorate([
2113
2080
  engine.ignoreClone
2114
2081
  ], exports.UICanvas.prototype, "_renderMode", void 0);
2115
- __decorate([
2116
- engine.assignmentClone
2117
- ], exports.UICanvas.prototype, "_resolutionAdaptationMode", void 0);
2118
- __decorate([
2119
- engine.assignmentClone
2120
- ], exports.UICanvas.prototype, "_sortOrder", void 0);
2121
- __decorate([
2122
- engine.assignmentClone
2123
- ], exports.UICanvas.prototype, "_distance", void 0);
2124
- __decorate([
2125
- engine.deepClone
2126
- ], exports.UICanvas.prototype, "_referenceResolution", void 0);
2127
- __decorate([
2128
- engine.assignmentClone
2129
- ], exports.UICanvas.prototype, "_referenceResolutionPerUnit", void 0);
2130
2082
  __decorate([
2131
2083
  engine.ignoreClone
2132
2084
  ], exports.UICanvas.prototype, "_hierarchyVersion", void 0);
2133
2085
  __decorate([
2134
2086
  engine.ignoreClone
2135
2087
  ], exports.UICanvas.prototype, "_center", void 0);
2136
- __decorate([
2137
- engine.ignoreClone
2138
- ], exports.UICanvas.prototype, "_centerDirtyFlag", void 0);
2139
2088
  __decorate([
2140
2089
  engine.ignoreClone
2141
2090
  ], exports.UICanvas.prototype, "_rootCanvasListener", null);
@@ -2198,9 +2147,6 @@
2198
2147
  };
2199
2148
  return Button;
2200
2149
  }(UIInteractive);
2201
- __decorate([
2202
- engine.deepClone
2203
- ], Button.prototype, "onClick", void 0);
2204
2150
 
2205
2151
  /**
2206
2152
  * UI element that renders an image.
@@ -2229,10 +2175,9 @@
2229
2175
  }
2230
2176
  };
2231
2177
  /**
2232
- * @internal
2233
- */ _proto._cloneTo = function _cloneTo(target) {
2234
- // @ts-ignore
2235
- UIRenderer1.prototype._cloneTo.call(this, target);
2178
+ * @inheritdoc
2179
+ */ _proto._onClone = function _onClone(target) {
2180
+ UIRenderer1.prototype._onClone.call(this, target);
2236
2181
  target.sprite = this._sprite;
2237
2182
  target.drawMode = this._drawMode;
2238
2183
  };
@@ -2449,12 +2394,6 @@
2449
2394
  __decorate([
2450
2395
  engine.ignoreClone
2451
2396
  ], Image.prototype, "_assembler", void 0);
2452
- __decorate([
2453
- engine.assignmentClone
2454
- ], Image.prototype, "_tileMode", void 0);
2455
- __decorate([
2456
- engine.assignmentClone
2457
- ], Image.prototype, "_tiledAdaptiveThreshold", void 0);
2458
2397
  __decorate([
2459
2398
  engine.ignoreClone
2460
2399
  ], Image.prototype, "_onTransformChanged", null);
@@ -2490,13 +2429,6 @@
2490
2429
  this._textChunks = null;
2491
2430
  this._subFont && (this._subFont = null);
2492
2431
  };
2493
- // @ts-ignore
2494
- _proto._cloneTo = function _cloneTo(target) {
2495
- // @ts-ignore
2496
- UIRenderer1.prototype._cloneTo.call(this, target);
2497
- target.font = this._font;
2498
- target._subFont = this._subFont;
2499
- };
2500
2432
  /**
2501
2433
  * @internal
2502
2434
  */ _proto._isContainDirtyFlag = function _isContainDirtyFlag(type) {
@@ -3023,39 +2955,9 @@
3023
2955
  __decorate([
3024
2956
  engine.ignoreClone
3025
2957
  ], Text.prototype, "_subFont", void 0);
3026
- __decorate([
3027
- engine.assignmentClone
3028
- ], Text.prototype, "_text", void 0);
3029
2958
  __decorate([
3030
2959
  engine.ignoreClone
3031
2960
  ], Text.prototype, "_localBounds", void 0);
3032
- __decorate([
3033
- engine.assignmentClone
3034
- ], Text.prototype, "_font", void 0);
3035
- __decorate([
3036
- engine.assignmentClone
3037
- ], Text.prototype, "_fontSize", void 0);
3038
- __decorate([
3039
- engine.assignmentClone
3040
- ], Text.prototype, "_fontStyle", void 0);
3041
- __decorate([
3042
- engine.assignmentClone
3043
- ], Text.prototype, "_lineSpacing", void 0);
3044
- __decorate([
3045
- engine.assignmentClone
3046
- ], Text.prototype, "_characterSpacing", void 0);
3047
- __decorate([
3048
- engine.assignmentClone
3049
- ], Text.prototype, "_horizontalAlignment", void 0);
3050
- __decorate([
3051
- engine.assignmentClone
3052
- ], Text.prototype, "_verticalAlignment", void 0);
3053
- __decorate([
3054
- engine.assignmentClone
3055
- ], Text.prototype, "_enableWrapping", void 0);
3056
- __decorate([
3057
- engine.assignmentClone
3058
- ], Text.prototype, "_overflowMode", void 0);
3059
2961
  __decorate([
3060
2962
  engine.ignoreClone
3061
2963
  ], Text.prototype, "_onTransformChanged", null);
@@ -3065,19 +2967,28 @@
3065
2967
 
3066
2968
  /**
3067
2969
  * The transition behavior of UIInteractive.
3068
- */ var Transition = /*#__PURE__*/ function() {
2970
+ */ var Transition = /*#__PURE__*/ function(DataObject) {
2971
+ _inherits(Transition, DataObject);
3069
2972
  function Transition() {
3070
- this._duration = 0;
3071
- this._countDown = 0;
3072
- this._finalState = InteractiveState.Normal;
2973
+ var _this;
2974
+ _this = DataObject.apply(this, arguments) || this, _this._duration = 0, _this._countDown = 0, _this._finalState = InteractiveState.Normal;
2975
+ return _this;
3073
2976
  }
3074
2977
  var _proto = Transition.prototype;
3075
2978
  _proto.destroy = function destroy() {
3076
2979
  var _this__interactive;
3077
2980
  (_this__interactive = this._interactive) == null ? void 0 : _this__interactive.removeTransition(this);
2981
+ this._addStateValuesReferCount(-1);
2982
+ this._normal = this._pressed = this._hover = this._disabled = null;
2983
+ this._initialValue = this._currentValue = this._finalValue = null;
3078
2984
  this._target = null;
3079
2985
  };
3080
2986
  /**
2987
+ * @inheritdoc
2988
+ */ _proto._onClone = function _onClone(target) {
2989
+ target._addStateValuesReferCount(1);
2990
+ };
2991
+ /**
3081
2992
  * @internal
3082
2993
  */ _proto._setState = function _setState(state, instant) {
3083
2994
  this._finalState = state;
@@ -3116,6 +3027,17 @@
3116
3027
  this._updateCurrentValue(this._initialValue, this._finalValue, weight);
3117
3028
  ((_this__target = this._target) == null ? void 0 : _this__target.enabled) && this._applyValue(this._currentValue);
3118
3029
  };
3030
+ _proto._addStateValuesReferCount = function _addStateValuesReferCount(count) {
3031
+ var _this = this, _normal = _this._normal, _pressed = _this._pressed, _hover = _this._hover, _disabled = _this._disabled;
3032
+ // @ts-ignore
3033
+ _instanceof(_normal, engine.ReferResource) && _normal._addReferCount(count);
3034
+ // @ts-ignore
3035
+ _instanceof(_pressed, engine.ReferResource) && _pressed._addReferCount(count);
3036
+ // @ts-ignore
3037
+ _instanceof(_hover, engine.ReferResource) && _hover._addReferCount(count);
3038
+ // @ts-ignore
3039
+ _instanceof(_disabled, engine.ReferResource) && _disabled._addReferCount(count);
3040
+ };
3119
3041
  _proto._getValueByState = function _getValueByState(state) {
3120
3042
  switch(state){
3121
3043
  case InteractiveState.Normal:
@@ -3224,7 +3146,22 @@
3224
3146
  }
3225
3147
  ]);
3226
3148
  return Transition;
3227
- }();
3149
+ }(engine.DataObject);
3150
+ __decorate([
3151
+ engine.ignoreClone
3152
+ ], Transition.prototype, "_countDown", void 0);
3153
+ __decorate([
3154
+ engine.ignoreClone
3155
+ ], Transition.prototype, "_initialValue", void 0);
3156
+ __decorate([
3157
+ engine.ignoreClone
3158
+ ], Transition.prototype, "_finalValue", void 0);
3159
+ __decorate([
3160
+ engine.ignoreClone
3161
+ ], Transition.prototype, "_currentValue", void 0);
3162
+ __decorate([
3163
+ engine.ignoreClone
3164
+ ], Transition.prototype, "_finalState", void 0);
3228
3165
 
3229
3166
  /**
3230
3167
  * Color transition.
@@ -3333,33 +3270,6 @@
3333
3270
  return Transition.apply(this, arguments) || this;
3334
3271
  }
3335
3272
  var _proto = SpriteTransition.prototype;
3336
- /**
3337
- * @internal
3338
- */ _proto.destroy = function destroy() {
3339
- Transition.prototype.destroy.call(this);
3340
- if (this._normal) {
3341
- // @ts-ignore
3342
- this._normal._addReferCount(-1);
3343
- this._normal = null;
3344
- }
3345
- if (this._hover) {
3346
- // @ts-ignore
3347
- this._hover._addReferCount(-1);
3348
- this._hover = null;
3349
- }
3350
- if (this._pressed) {
3351
- // @ts-ignore
3352
- this._pressed._addReferCount(-1);
3353
- this._pressed = null;
3354
- }
3355
- if (this._disabled) {
3356
- // @ts-ignore
3357
- this._disabled._addReferCount(-1);
3358
- this._disabled = null;
3359
- }
3360
- this._initialValue = this._currentValue = this._finalValue = null;
3361
- this._target = null;
3362
- };
3363
3273
  _proto._getTargetValueCopy = function _getTargetValueCopy() {
3364
3274
  var _this__target;
3365
3275
  return (_this__target = this._target) == null ? void 0 : _this__target.sprite;