@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/module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityModifyFlags, ignoreClone, assignmentClone, DisorderedArray, Component, TransformModifyFlags, Transform, deepClone, Vector2, Rect, MathUtil, Vector3, Matrix, Plane, ShaderProperty, dependentComponents, DependentMode, BatchUtils, ShaderMacroCollection, Renderer, Vector4, Color, RendererUpdateFlags,
|
|
1
|
+
import { EntityModifyFlags, ignoreClone, assignmentClone, DisorderedArray, Component, TransformModifyFlags, Transform, deepClone, Vector2, Rect, MathUtil, Vector3, Matrix, Plane, ShaderProperty, dependentComponents, DependentMode, BatchUtils, ShaderMacroCollection, Renderer, Vector4, Color, RendererUpdateFlags, Script, CameraModifyFlags, Logger, Signal, SpriteDrawMode, RenderQueueFlags, SpriteModifyFlags, SpriteTileMode, TiledSpriteAssembler, SlicedSpriteAssembler, SimpleSpriteAssembler, BoundingBox, ShaderData, ShaderDataGroup, TextUtils, Engine, TextVerticalAlignment, TextHorizontalAlignment, OverflowMode, CharRenderInfo, FontStyle, ReferResource, registerPointerEventEmitter, PointerEventEmitter, CameraClearFlags, Material, BlendFactor, BlendOperation, CullMode, RenderQueueType, Entity, Loader, Shader, ShaderPass, PipelineStage } from '@galacean/engine';
|
|
2
2
|
|
|
3
3
|
function _defineProperties(target, props) {
|
|
4
4
|
for (var i = 0; i < props.length; i++) {
|
|
@@ -233,12 +233,6 @@ __decorate([
|
|
|
233
233
|
__decorate([
|
|
234
234
|
ignoreClone
|
|
235
235
|
], UIGroup.prototype, "_indexInRootCanvas", void 0);
|
|
236
|
-
__decorate([
|
|
237
|
-
ignoreClone
|
|
238
|
-
], UIGroup.prototype, "_group", void 0);
|
|
239
|
-
__decorate([
|
|
240
|
-
ignoreClone
|
|
241
|
-
], UIGroup.prototype, "_rootCanvas", void 0);
|
|
242
236
|
__decorate([
|
|
243
237
|
ignoreClone
|
|
244
238
|
], UIGroup.prototype, "_disorderedElements", void 0);
|
|
@@ -494,9 +488,9 @@ var Utils = /*#__PURE__*/ function() {
|
|
|
494
488
|
this._updateWorldFlagWithParentRectChange(TransformModifyFlags.WmWpWeWqWsWus);
|
|
495
489
|
};
|
|
496
490
|
// @ts-ignore
|
|
497
|
-
_proto._cloneTo = function _cloneTo(target
|
|
491
|
+
_proto._cloneTo = function _cloneTo(target) {
|
|
498
492
|
// @ts-ignore
|
|
499
|
-
Transform.prototype._cloneTo.call(this, target
|
|
493
|
+
Transform.prototype._cloneTo.call(this, target);
|
|
500
494
|
var size = target._size, pivot = target._pivot;
|
|
501
495
|
// @ts-ignore
|
|
502
496
|
size._onValueChanged = pivot._onValueChanged = null;
|
|
@@ -1073,9 +1067,6 @@ var UIRenderer = /*#__PURE__*/ function(Renderer) {
|
|
|
1073
1067
|
__decorate([
|
|
1074
1068
|
deepClone
|
|
1075
1069
|
], UIRenderer.prototype, "raycastPadding", void 0);
|
|
1076
|
-
__decorate([
|
|
1077
|
-
ignoreClone
|
|
1078
|
-
], UIRenderer.prototype, "_rootCanvas", void 0);
|
|
1079
1070
|
__decorate([
|
|
1080
1071
|
ignoreClone
|
|
1081
1072
|
], UIRenderer.prototype, "_indexInRootCanvas", void 0);
|
|
@@ -1085,9 +1076,6 @@ __decorate([
|
|
|
1085
1076
|
__decorate([
|
|
1086
1077
|
ignoreClone
|
|
1087
1078
|
], UIRenderer.prototype, "_rootCanvasListeningEntities", void 0);
|
|
1088
|
-
__decorate([
|
|
1089
|
-
ignoreClone
|
|
1090
|
-
], UIRenderer.prototype, "_group", void 0);
|
|
1091
1079
|
__decorate([
|
|
1092
1080
|
ignoreClone
|
|
1093
1081
|
], UIRenderer.prototype, "_indexInGroup", void 0);
|
|
@@ -1204,26 +1192,6 @@ UIRenderer = __decorate([
|
|
|
1204
1192
|
transitions[i].destroy();
|
|
1205
1193
|
}
|
|
1206
1194
|
};
|
|
1207
|
-
// @ts-ignore
|
|
1208
|
-
_proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
|
|
1209
|
-
var transitions = this._transitions;
|
|
1210
|
-
for(var i = 0, n = transitions.length; i < n; i++){
|
|
1211
|
-
var srcTransition = transitions[i];
|
|
1212
|
-
var dstTransition = new transitions[i].constructor();
|
|
1213
|
-
dstTransition.normal = srcTransition.normal;
|
|
1214
|
-
dstTransition.pressed = srcTransition.pressed;
|
|
1215
|
-
dstTransition.hover = srcTransition.hover;
|
|
1216
|
-
dstTransition.disabled = srcTransition.disabled;
|
|
1217
|
-
var transitionTarget = srcTransition.target;
|
|
1218
|
-
if (transitionTarget) {
|
|
1219
|
-
var paths = UIInteractive._targetTempPath;
|
|
1220
|
-
// @ts-ignore
|
|
1221
|
-
var success = Entity._getEntityHierarchyPath(srcRoot, transitionTarget.entity, paths);
|
|
1222
|
-
dstTransition.target = success ? Entity._getEntityByHierarchyPath(targetRoot, paths).getComponent(transitionTarget.constructor) : transitionTarget;
|
|
1223
|
-
}
|
|
1224
|
-
target.addTransition(dstTransition);
|
|
1225
|
-
}
|
|
1226
|
-
};
|
|
1227
1195
|
/**
|
|
1228
1196
|
* @internal
|
|
1229
1197
|
*/ _proto._getRootCanvas = function _getRootCanvas() {
|
|
@@ -1334,10 +1302,6 @@ UIRenderer = __decorate([
|
|
|
1334
1302
|
]);
|
|
1335
1303
|
return UIInteractive;
|
|
1336
1304
|
}(Script);
|
|
1337
|
-
UIInteractive._targetTempPath = new Array();
|
|
1338
|
-
__decorate([
|
|
1339
|
-
ignoreClone
|
|
1340
|
-
], UIInteractive.prototype, "_rootCanvas", void 0);
|
|
1341
1305
|
__decorate([
|
|
1342
1306
|
ignoreClone
|
|
1343
1307
|
], UIInteractive.prototype, "_indexInRootCanvas", void 0);
|
|
@@ -1347,9 +1311,6 @@ __decorate([
|
|
|
1347
1311
|
__decorate([
|
|
1348
1312
|
ignoreClone
|
|
1349
1313
|
], UIInteractive.prototype, "_rootCanvasListeningEntities", void 0);
|
|
1350
|
-
__decorate([
|
|
1351
|
-
ignoreClone
|
|
1352
|
-
], UIInteractive.prototype, "_group", void 0);
|
|
1353
1314
|
__decorate([
|
|
1354
1315
|
ignoreClone
|
|
1355
1316
|
], UIInteractive.prototype, "_indexInGroup", void 0);
|
|
@@ -1366,7 +1327,7 @@ __decorate([
|
|
|
1366
1327
|
ignoreClone
|
|
1367
1328
|
], UIInteractive.prototype, "_globalInteractiveDirty", void 0);
|
|
1368
1329
|
__decorate([
|
|
1369
|
-
|
|
1330
|
+
deepClone
|
|
1370
1331
|
], UIInteractive.prototype, "_transitions", void 0);
|
|
1371
1332
|
__decorate([
|
|
1372
1333
|
assignmentClone
|
|
@@ -1550,16 +1511,8 @@ var UICanvas = /*#__PURE__*/ function(Component) {
|
|
|
1550
1511
|
};
|
|
1551
1512
|
/**
|
|
1552
1513
|
* @internal
|
|
1553
|
-
*/ _proto._cloneTo = function _cloneTo(target
|
|
1514
|
+
*/ _proto._cloneTo = function _cloneTo(target) {
|
|
1554
1515
|
target.renderMode = this._renderMode;
|
|
1555
|
-
var camera = this._camera;
|
|
1556
|
-
if (camera) {
|
|
1557
|
-
var paths = UICanvas._targetTempPath;
|
|
1558
|
-
// @ts-ignore
|
|
1559
|
-
var success = Entity._getEntityHierarchyPath(srcRoot, camera.entity, paths);
|
|
1560
|
-
// @ts-ignore
|
|
1561
|
-
target.camera = success ? Entity._getEntityByHierarchyPath(targetRoot, paths).getComponent(Camera) : camera;
|
|
1562
|
-
}
|
|
1563
1516
|
};
|
|
1564
1517
|
_proto._getRenderers = function _getRenderers() {
|
|
1565
1518
|
var _this = this, renderers = _this._orderedRenderers, entity = _this.entity;
|
|
@@ -1956,16 +1909,12 @@ var UICanvas = /*#__PURE__*/ function(Component) {
|
|
|
1956
1909
|
return UICanvas;
|
|
1957
1910
|
}(Component);
|
|
1958
1911
|
/** @internal */ UICanvas._hierarchyCounter = 1;
|
|
1959
|
-
UICanvas._targetTempPath = [];
|
|
1960
1912
|
UICanvas._tempGroupAbleList = [];
|
|
1961
1913
|
UICanvas._tempVec3 = new Vector3();
|
|
1962
1914
|
UICanvas._tempMat = new Matrix();
|
|
1963
1915
|
__decorate([
|
|
1964
1916
|
ignoreClone
|
|
1965
1917
|
], UICanvas.prototype, "_canvasIndex", void 0);
|
|
1966
|
-
__decorate([
|
|
1967
|
-
ignoreClone
|
|
1968
|
-
], UICanvas.prototype, "_rootCanvas", void 0);
|
|
1969
1918
|
__decorate([
|
|
1970
1919
|
ignoreClone
|
|
1971
1920
|
], UICanvas.prototype, "_indexInRootCanvas", void 0);
|
|
@@ -1996,12 +1945,6 @@ __decorate([
|
|
|
1996
1945
|
__decorate([
|
|
1997
1946
|
ignoreClone
|
|
1998
1947
|
], UICanvas.prototype, "_renderMode", void 0);
|
|
1999
|
-
__decorate([
|
|
2000
|
-
ignoreClone
|
|
2001
|
-
], UICanvas.prototype, "_camera", void 0);
|
|
2002
|
-
__decorate([
|
|
2003
|
-
ignoreClone
|
|
2004
|
-
], UICanvas.prototype, "_cameraObserver", void 0);
|
|
2005
1948
|
__decorate([
|
|
2006
1949
|
assignmentClone
|
|
2007
1950
|
], UICanvas.prototype, "_resolutionAdaptationMode", void 0);
|
|
@@ -2062,45 +2005,35 @@ var Button = /*#__PURE__*/ function(UIInteractive) {
|
|
|
2062
2005
|
_inherits(Button, UIInteractive);
|
|
2063
2006
|
function Button() {
|
|
2064
2007
|
var _this;
|
|
2065
|
-
_this = UIInteractive.apply(this, arguments) || this, _this.
|
|
2008
|
+
_this = UIInteractive.apply(this, arguments) || this, /** Signal emitted when the button is clicked. */ _this.onClick = new Signal();
|
|
2066
2009
|
return _this;
|
|
2067
2010
|
}
|
|
2068
2011
|
var _proto = Button.prototype;
|
|
2012
|
+
_proto.onPointerClick = function onPointerClick(event) {
|
|
2013
|
+
if (!this._getGlobalInteractive()) return;
|
|
2014
|
+
this.onClick.invoke(event);
|
|
2015
|
+
};
|
|
2016
|
+
_proto.onDestroy = function onDestroy() {
|
|
2017
|
+
UIInteractive.prototype.onDestroy.call(this);
|
|
2018
|
+
this.onClick.removeAll();
|
|
2019
|
+
};
|
|
2069
2020
|
/**
|
|
2070
2021
|
* Add a listening function for click.
|
|
2071
|
-
* @
|
|
2022
|
+
* @deprecated Use `onClick.on(listener, context)` instead.
|
|
2072
2023
|
*/ _proto.addClicked = function addClicked(listener) {
|
|
2073
|
-
this.
|
|
2074
|
-
fn: listener
|
|
2075
|
-
});
|
|
2024
|
+
this.onClick.on(listener);
|
|
2076
2025
|
};
|
|
2077
2026
|
/**
|
|
2078
2027
|
* Remove a listening function of click.
|
|
2079
|
-
* @
|
|
2028
|
+
* @deprecated Use `onClick.off(listener, context)` instead.
|
|
2080
2029
|
*/ _proto.removeClicked = function removeClicked(listener) {
|
|
2081
|
-
this.
|
|
2082
|
-
return value.fn === listener ? value.destroyed = true : false;
|
|
2083
|
-
});
|
|
2084
|
-
};
|
|
2085
|
-
_proto.onPointerClick = function onPointerClick(event) {
|
|
2086
|
-
if (!this._getGlobalInteractive()) return;
|
|
2087
|
-
var listeners = this._listeners.getLoopArray();
|
|
2088
|
-
for(var i = 0, n = listeners.length; i < n; i++){
|
|
2089
|
-
var listener = listeners[i];
|
|
2090
|
-
!listener.destroyed && listener.fn(event);
|
|
2091
|
-
}
|
|
2092
|
-
};
|
|
2093
|
-
_proto.onDestroy = function onDestroy() {
|
|
2094
|
-
UIInteractive.prototype.onDestroy.call(this);
|
|
2095
|
-
this._listeners.findAndRemove(function(value) {
|
|
2096
|
-
return value.destroyed = true;
|
|
2097
|
-
});
|
|
2030
|
+
this.onClick.off(listener);
|
|
2098
2031
|
};
|
|
2099
2032
|
return Button;
|
|
2100
2033
|
}(UIInteractive);
|
|
2101
2034
|
__decorate([
|
|
2102
|
-
|
|
2103
|
-
], Button.prototype, "
|
|
2035
|
+
deepClone
|
|
2036
|
+
], Button.prototype, "onClick", void 0);
|
|
2104
2037
|
|
|
2105
2038
|
/**
|
|
2106
2039
|
* UI element that renders an image.
|
|
@@ -2130,9 +2063,9 @@ __decorate([
|
|
|
2130
2063
|
};
|
|
2131
2064
|
/**
|
|
2132
2065
|
* @internal
|
|
2133
|
-
*/ _proto._cloneTo = function _cloneTo(target
|
|
2066
|
+
*/ _proto._cloneTo = function _cloneTo(target) {
|
|
2134
2067
|
// @ts-ignore
|
|
2135
|
-
UIRenderer1.prototype._cloneTo.call(this, target
|
|
2068
|
+
UIRenderer1.prototype._cloneTo.call(this, target);
|
|
2136
2069
|
target.sprite = this._sprite;
|
|
2137
2070
|
target.drawMode = this._drawMode;
|
|
2138
2071
|
};
|
|
@@ -2393,9 +2326,9 @@ __decorate([
|
|
|
2393
2326
|
this._subFont && (this._subFont = null);
|
|
2394
2327
|
};
|
|
2395
2328
|
// @ts-ignore
|
|
2396
|
-
_proto._cloneTo = function _cloneTo(target
|
|
2329
|
+
_proto._cloneTo = function _cloneTo(target) {
|
|
2397
2330
|
// @ts-ignore
|
|
2398
|
-
UIRenderer1.prototype._cloneTo.call(this, target
|
|
2331
|
+
UIRenderer1.prototype._cloneTo.call(this, target);
|
|
2399
2332
|
target.font = this._font;
|
|
2400
2333
|
target._subFont = this._subFont;
|
|
2401
2334
|
};
|