@energy8platform/game-engine 0.14.2 → 0.14.3
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/index.cjs.js +17 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +17 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/react.cjs.js +30 -10
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.esm.js +30 -10
- package/dist/react.esm.js.map +1 -1
- package/dist/ui.cjs.js +17 -3
- package/dist/ui.cjs.js.map +1 -1
- package/dist/ui.d.ts +4 -0
- package/dist/ui.esm.js +17 -3
- package/dist/ui.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/react/applyProps.ts +1 -1
- package/src/react/reconciler.ts +19 -7
- package/src/ui/FlexContainer.ts +7 -3
- package/src/ui/Panel.ts +10 -0
package/dist/index.d.ts
CHANGED
|
@@ -1693,6 +1693,10 @@ declare class Panel extends Container {
|
|
|
1693
1693
|
constructor(config?: PanelConfig);
|
|
1694
1694
|
/** Access the content flex container — add children here for layout */
|
|
1695
1695
|
get content(): FlexContainer;
|
|
1696
|
+
/** Suspend content layout recalculation. Call resumeLayout() to flush. */
|
|
1697
|
+
suspendLayout(): void;
|
|
1698
|
+
/** Resume content layout and flush if dirty. */
|
|
1699
|
+
resumeLayout(): void;
|
|
1696
1700
|
/** Convenience: add a child to the content layout */
|
|
1697
1701
|
addContent(child: Container): this;
|
|
1698
1702
|
/** Resize the panel */
|
package/dist/index.esm.js
CHANGED
|
@@ -3257,7 +3257,8 @@ class FlexContainer extends Container {
|
|
|
3257
3257
|
this._explicitWidth = width;
|
|
3258
3258
|
this._explicitHeight = height;
|
|
3259
3259
|
this._layoutDirty = true;
|
|
3260
|
-
this.
|
|
3260
|
+
if (!this._layoutSuspended)
|
|
3261
|
+
this.updateLayout();
|
|
3261
3262
|
}
|
|
3262
3263
|
/** Update layout direction */
|
|
3263
3264
|
setDirection(direction) {
|
|
@@ -3290,6 +3291,10 @@ class FlexContainer extends Container {
|
|
|
3290
3291
|
* adding/removing children without resize.
|
|
3291
3292
|
*/
|
|
3292
3293
|
updateLayout() {
|
|
3294
|
+
if (this._layoutSuspended) {
|
|
3295
|
+
this._layoutDirty = true;
|
|
3296
|
+
return;
|
|
3297
|
+
}
|
|
3293
3298
|
this._layoutDirty = false;
|
|
3294
3299
|
const { direction, justifyContent, alignItems, gap, flexWrap, alignContent } = this._config;
|
|
3295
3300
|
const [pt, pr, pb, pl] = this._padding;
|
|
@@ -3498,11 +3503,12 @@ class FlexContainer extends Container {
|
|
|
3498
3503
|
this._explicitWidth = typeof w === 'number' ? w : 0;
|
|
3499
3504
|
this._explicitHeight = typeof h === 'number' ? h : 0;
|
|
3500
3505
|
this._layoutDirty = true;
|
|
3501
|
-
this.
|
|
3506
|
+
if (!this._layoutSuspended)
|
|
3507
|
+
this.updateLayout();
|
|
3502
3508
|
}
|
|
3503
3509
|
return;
|
|
3504
3510
|
}
|
|
3505
|
-
if (this._layoutDirty)
|
|
3511
|
+
if (this._layoutDirty && !this._layoutSuspended)
|
|
3506
3512
|
this.updateLayout();
|
|
3507
3513
|
}
|
|
3508
3514
|
destroy(options) {
|
|
@@ -4085,6 +4091,14 @@ class Panel extends Container {
|
|
|
4085
4091
|
get content() {
|
|
4086
4092
|
return this._content;
|
|
4087
4093
|
}
|
|
4094
|
+
/** Suspend content layout recalculation. Call resumeLayout() to flush. */
|
|
4095
|
+
suspendLayout() {
|
|
4096
|
+
this._content.suspendLayout();
|
|
4097
|
+
}
|
|
4098
|
+
/** Resume content layout and flush if dirty. */
|
|
4099
|
+
resumeLayout() {
|
|
4100
|
+
this._content.resumeLayout();
|
|
4101
|
+
}
|
|
4088
4102
|
/** Convenience: add a child to the content layout */
|
|
4089
4103
|
addContent(child) {
|
|
4090
4104
|
this._content.addFlexChild(child);
|