@galacean/engine-ui 2.0.0-alpha.14 → 2.0.0-alpha.16
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 +23 -90
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/main.js +23 -90
- package/dist/main.js.map +1 -1
- package/dist/module.js +24 -91
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/component/UICanvas.d.ts +0 -1
- package/types/component/UITransform.d.ts +2 -2
- package/types/component/advanced/Button.d.ts +7 -10
- package/types/component/advanced/Text.d.ts +1 -1
- package/types/component/interactive/UIInteractive.d.ts +1 -3
package/dist/browser.js
CHANGED
|
@@ -237,12 +237,6 @@
|
|
|
237
237
|
__decorate([
|
|
238
238
|
engine.ignoreClone
|
|
239
239
|
], UIGroup.prototype, "_indexInRootCanvas", void 0);
|
|
240
|
-
__decorate([
|
|
241
|
-
engine.ignoreClone
|
|
242
|
-
], UIGroup.prototype, "_group", void 0);
|
|
243
|
-
__decorate([
|
|
244
|
-
engine.ignoreClone
|
|
245
|
-
], UIGroup.prototype, "_rootCanvas", void 0);
|
|
246
240
|
__decorate([
|
|
247
241
|
engine.ignoreClone
|
|
248
242
|
], UIGroup.prototype, "_disorderedElements", void 0);
|
|
@@ -498,9 +492,9 @@
|
|
|
498
492
|
this._updateWorldFlagWithParentRectChange(engine.TransformModifyFlags.WmWpWeWqWsWus);
|
|
499
493
|
};
|
|
500
494
|
// @ts-ignore
|
|
501
|
-
_proto._cloneTo = function _cloneTo(target
|
|
495
|
+
_proto._cloneTo = function _cloneTo(target) {
|
|
502
496
|
// @ts-ignore
|
|
503
|
-
Transform.prototype._cloneTo.call(this, target
|
|
497
|
+
Transform.prototype._cloneTo.call(this, target);
|
|
504
498
|
var size = target._size, pivot = target._pivot;
|
|
505
499
|
// @ts-ignore
|
|
506
500
|
size._onValueChanged = pivot._onValueChanged = null;
|
|
@@ -1077,9 +1071,6 @@
|
|
|
1077
1071
|
__decorate([
|
|
1078
1072
|
engine.deepClone
|
|
1079
1073
|
], exports.UIRenderer.prototype, "raycastPadding", void 0);
|
|
1080
|
-
__decorate([
|
|
1081
|
-
engine.ignoreClone
|
|
1082
|
-
], exports.UIRenderer.prototype, "_rootCanvas", void 0);
|
|
1083
1074
|
__decorate([
|
|
1084
1075
|
engine.ignoreClone
|
|
1085
1076
|
], exports.UIRenderer.prototype, "_indexInRootCanvas", void 0);
|
|
@@ -1089,9 +1080,6 @@
|
|
|
1089
1080
|
__decorate([
|
|
1090
1081
|
engine.ignoreClone
|
|
1091
1082
|
], exports.UIRenderer.prototype, "_rootCanvasListeningEntities", void 0);
|
|
1092
|
-
__decorate([
|
|
1093
|
-
engine.ignoreClone
|
|
1094
|
-
], exports.UIRenderer.prototype, "_group", void 0);
|
|
1095
1083
|
__decorate([
|
|
1096
1084
|
engine.ignoreClone
|
|
1097
1085
|
], exports.UIRenderer.prototype, "_indexInGroup", void 0);
|
|
@@ -1208,26 +1196,6 @@
|
|
|
1208
1196
|
transitions[i].destroy();
|
|
1209
1197
|
}
|
|
1210
1198
|
};
|
|
1211
|
-
// @ts-ignore
|
|
1212
|
-
_proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
|
|
1213
|
-
var transitions = this._transitions;
|
|
1214
|
-
for(var i = 0, n = transitions.length; i < n; i++){
|
|
1215
|
-
var srcTransition = transitions[i];
|
|
1216
|
-
var dstTransition = new transitions[i].constructor();
|
|
1217
|
-
dstTransition.normal = srcTransition.normal;
|
|
1218
|
-
dstTransition.pressed = srcTransition.pressed;
|
|
1219
|
-
dstTransition.hover = srcTransition.hover;
|
|
1220
|
-
dstTransition.disabled = srcTransition.disabled;
|
|
1221
|
-
var transitionTarget = srcTransition.target;
|
|
1222
|
-
if (transitionTarget) {
|
|
1223
|
-
var paths = UIInteractive._targetTempPath;
|
|
1224
|
-
// @ts-ignore
|
|
1225
|
-
var success = engine.Entity._getEntityHierarchyPath(srcRoot, transitionTarget.entity, paths);
|
|
1226
|
-
dstTransition.target = success ? engine.Entity._getEntityByHierarchyPath(targetRoot, paths).getComponent(transitionTarget.constructor) : transitionTarget;
|
|
1227
|
-
}
|
|
1228
|
-
target.addTransition(dstTransition);
|
|
1229
|
-
}
|
|
1230
|
-
};
|
|
1231
1199
|
/**
|
|
1232
1200
|
* @internal
|
|
1233
1201
|
*/ _proto._getRootCanvas = function _getRootCanvas() {
|
|
@@ -1338,10 +1306,6 @@
|
|
|
1338
1306
|
]);
|
|
1339
1307
|
return UIInteractive;
|
|
1340
1308
|
}(engine.Script);
|
|
1341
|
-
UIInteractive._targetTempPath = new Array();
|
|
1342
|
-
__decorate([
|
|
1343
|
-
engine.ignoreClone
|
|
1344
|
-
], UIInteractive.prototype, "_rootCanvas", void 0);
|
|
1345
1309
|
__decorate([
|
|
1346
1310
|
engine.ignoreClone
|
|
1347
1311
|
], UIInteractive.prototype, "_indexInRootCanvas", void 0);
|
|
@@ -1351,9 +1315,6 @@
|
|
|
1351
1315
|
__decorate([
|
|
1352
1316
|
engine.ignoreClone
|
|
1353
1317
|
], UIInteractive.prototype, "_rootCanvasListeningEntities", void 0);
|
|
1354
|
-
__decorate([
|
|
1355
|
-
engine.ignoreClone
|
|
1356
|
-
], UIInteractive.prototype, "_group", void 0);
|
|
1357
1318
|
__decorate([
|
|
1358
1319
|
engine.ignoreClone
|
|
1359
1320
|
], UIInteractive.prototype, "_indexInGroup", void 0);
|
|
@@ -1370,7 +1331,7 @@
|
|
|
1370
1331
|
engine.ignoreClone
|
|
1371
1332
|
], UIInteractive.prototype, "_globalInteractiveDirty", void 0);
|
|
1372
1333
|
__decorate([
|
|
1373
|
-
engine.
|
|
1334
|
+
engine.deepClone
|
|
1374
1335
|
], UIInteractive.prototype, "_transitions", void 0);
|
|
1375
1336
|
__decorate([
|
|
1376
1337
|
engine.assignmentClone
|
|
@@ -1554,16 +1515,8 @@
|
|
|
1554
1515
|
};
|
|
1555
1516
|
/**
|
|
1556
1517
|
* @internal
|
|
1557
|
-
*/ _proto._cloneTo = function _cloneTo(target
|
|
1518
|
+
*/ _proto._cloneTo = function _cloneTo(target) {
|
|
1558
1519
|
target.renderMode = this._renderMode;
|
|
1559
|
-
var camera = this._camera;
|
|
1560
|
-
if (camera) {
|
|
1561
|
-
var paths = UICanvas._targetTempPath;
|
|
1562
|
-
// @ts-ignore
|
|
1563
|
-
var success = engine.Entity._getEntityHierarchyPath(srcRoot, camera.entity, paths);
|
|
1564
|
-
// @ts-ignore
|
|
1565
|
-
target.camera = success ? engine.Entity._getEntityByHierarchyPath(targetRoot, paths).getComponent(engine.Camera) : camera;
|
|
1566
|
-
}
|
|
1567
1520
|
};
|
|
1568
1521
|
_proto._getRenderers = function _getRenderers() {
|
|
1569
1522
|
var _this = this, renderers = _this._orderedRenderers, entity = _this.entity;
|
|
@@ -1960,16 +1913,12 @@
|
|
|
1960
1913
|
return UICanvas;
|
|
1961
1914
|
}(engine.Component);
|
|
1962
1915
|
/** @internal */ exports.UICanvas._hierarchyCounter = 1;
|
|
1963
|
-
exports.UICanvas._targetTempPath = [];
|
|
1964
1916
|
exports.UICanvas._tempGroupAbleList = [];
|
|
1965
1917
|
exports.UICanvas._tempVec3 = new engine.Vector3();
|
|
1966
1918
|
exports.UICanvas._tempMat = new engine.Matrix();
|
|
1967
1919
|
__decorate([
|
|
1968
1920
|
engine.ignoreClone
|
|
1969
1921
|
], exports.UICanvas.prototype, "_canvasIndex", void 0);
|
|
1970
|
-
__decorate([
|
|
1971
|
-
engine.ignoreClone
|
|
1972
|
-
], exports.UICanvas.prototype, "_rootCanvas", void 0);
|
|
1973
1922
|
__decorate([
|
|
1974
1923
|
engine.ignoreClone
|
|
1975
1924
|
], exports.UICanvas.prototype, "_indexInRootCanvas", void 0);
|
|
@@ -2000,12 +1949,6 @@
|
|
|
2000
1949
|
__decorate([
|
|
2001
1950
|
engine.ignoreClone
|
|
2002
1951
|
], exports.UICanvas.prototype, "_renderMode", void 0);
|
|
2003
|
-
__decorate([
|
|
2004
|
-
engine.ignoreClone
|
|
2005
|
-
], exports.UICanvas.prototype, "_camera", void 0);
|
|
2006
|
-
__decorate([
|
|
2007
|
-
engine.ignoreClone
|
|
2008
|
-
], exports.UICanvas.prototype, "_cameraObserver", void 0);
|
|
2009
1952
|
__decorate([
|
|
2010
1953
|
engine.assignmentClone
|
|
2011
1954
|
], exports.UICanvas.prototype, "_resolutionAdaptationMode", void 0);
|
|
@@ -2066,45 +2009,35 @@
|
|
|
2066
2009
|
_inherits(Button, UIInteractive);
|
|
2067
2010
|
function Button() {
|
|
2068
2011
|
var _this;
|
|
2069
|
-
_this = UIInteractive.apply(this, arguments) || this, _this.
|
|
2012
|
+
_this = UIInteractive.apply(this, arguments) || this, /** Signal emitted when the button is clicked. */ _this.onClick = new engine.Signal();
|
|
2070
2013
|
return _this;
|
|
2071
2014
|
}
|
|
2072
2015
|
var _proto = Button.prototype;
|
|
2016
|
+
_proto.onPointerClick = function onPointerClick(event) {
|
|
2017
|
+
if (!this._getGlobalInteractive()) return;
|
|
2018
|
+
this.onClick.invoke(event);
|
|
2019
|
+
};
|
|
2020
|
+
_proto.onDestroy = function onDestroy() {
|
|
2021
|
+
UIInteractive.prototype.onDestroy.call(this);
|
|
2022
|
+
this.onClick.removeAll();
|
|
2023
|
+
};
|
|
2073
2024
|
/**
|
|
2074
2025
|
* Add a listening function for click.
|
|
2075
|
-
* @
|
|
2026
|
+
* @deprecated Use `onClick.on(listener, context)` instead.
|
|
2076
2027
|
*/ _proto.addClicked = function addClicked(listener) {
|
|
2077
|
-
this.
|
|
2078
|
-
fn: listener
|
|
2079
|
-
});
|
|
2028
|
+
this.onClick.on(listener);
|
|
2080
2029
|
};
|
|
2081
2030
|
/**
|
|
2082
2031
|
* Remove a listening function of click.
|
|
2083
|
-
* @
|
|
2032
|
+
* @deprecated Use `onClick.off(listener, context)` instead.
|
|
2084
2033
|
*/ _proto.removeClicked = function removeClicked(listener) {
|
|
2085
|
-
this.
|
|
2086
|
-
return value.fn === listener ? value.destroyed = true : false;
|
|
2087
|
-
});
|
|
2088
|
-
};
|
|
2089
|
-
_proto.onPointerClick = function onPointerClick(event) {
|
|
2090
|
-
if (!this._getGlobalInteractive()) return;
|
|
2091
|
-
var listeners = this._listeners.getLoopArray();
|
|
2092
|
-
for(var i = 0, n = listeners.length; i < n; i++){
|
|
2093
|
-
var listener = listeners[i];
|
|
2094
|
-
!listener.destroyed && listener.fn(event);
|
|
2095
|
-
}
|
|
2096
|
-
};
|
|
2097
|
-
_proto.onDestroy = function onDestroy() {
|
|
2098
|
-
UIInteractive.prototype.onDestroy.call(this);
|
|
2099
|
-
this._listeners.findAndRemove(function(value) {
|
|
2100
|
-
return value.destroyed = true;
|
|
2101
|
-
});
|
|
2034
|
+
this.onClick.off(listener);
|
|
2102
2035
|
};
|
|
2103
2036
|
return Button;
|
|
2104
2037
|
}(UIInteractive);
|
|
2105
2038
|
__decorate([
|
|
2106
|
-
engine.
|
|
2107
|
-
], Button.prototype, "
|
|
2039
|
+
engine.deepClone
|
|
2040
|
+
], Button.prototype, "onClick", void 0);
|
|
2108
2041
|
|
|
2109
2042
|
/**
|
|
2110
2043
|
* UI element that renders an image.
|
|
@@ -2134,9 +2067,9 @@
|
|
|
2134
2067
|
};
|
|
2135
2068
|
/**
|
|
2136
2069
|
* @internal
|
|
2137
|
-
*/ _proto._cloneTo = function _cloneTo(target
|
|
2070
|
+
*/ _proto._cloneTo = function _cloneTo(target) {
|
|
2138
2071
|
// @ts-ignore
|
|
2139
|
-
UIRenderer1.prototype._cloneTo.call(this, target
|
|
2072
|
+
UIRenderer1.prototype._cloneTo.call(this, target);
|
|
2140
2073
|
target.sprite = this._sprite;
|
|
2141
2074
|
target.drawMode = this._drawMode;
|
|
2142
2075
|
};
|
|
@@ -2397,9 +2330,9 @@
|
|
|
2397
2330
|
this._subFont && (this._subFont = null);
|
|
2398
2331
|
};
|
|
2399
2332
|
// @ts-ignore
|
|
2400
|
-
_proto._cloneTo = function _cloneTo(target
|
|
2333
|
+
_proto._cloneTo = function _cloneTo(target) {
|
|
2401
2334
|
// @ts-ignore
|
|
2402
|
-
UIRenderer1.prototype._cloneTo.call(this, target
|
|
2335
|
+
UIRenderer1.prototype._cloneTo.call(this, target);
|
|
2403
2336
|
target.font = this._font;
|
|
2404
2337
|
target._subFont = this._subFont;
|
|
2405
2338
|
};
|