@meursyphus/flitter 1.0.0 → 1.0.1
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/index.cjs +188 -246
- package/index.d.cts +73 -61
- package/index.d.ts +73 -61
- package/index.global.js +188 -246
- package/index.js +188 -246
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -79,7 +79,7 @@ var Calculable = class extends data_default {
|
|
|
79
79
|
var calculable_default = Calculable;
|
|
80
80
|
|
|
81
81
|
// src/type/_types/_offset.ts
|
|
82
|
-
var
|
|
82
|
+
var _Offset = class _Offset extends calculable_default {
|
|
83
83
|
constructor({ x, y }) {
|
|
84
84
|
super();
|
|
85
85
|
__publicField(this, "x");
|
|
@@ -106,6 +106,10 @@ var Offset = class _Offset extends calculable_default {
|
|
|
106
106
|
return super.minus(other);
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
|
+
__publicField(_Offset, "Constants", {
|
|
110
|
+
zero: Object.freeze(_Offset.raw({ x: 0, y: 0 }))
|
|
111
|
+
});
|
|
112
|
+
var Offset = _Offset;
|
|
109
113
|
var offset_default = Offset;
|
|
110
114
|
|
|
111
115
|
// src/type/_types/_rect.ts
|
|
@@ -501,29 +505,26 @@ var Constraints = class _Constraints extends data_default {
|
|
|
501
505
|
this.maxHeight = maxHeight;
|
|
502
506
|
}
|
|
503
507
|
static lerp(a, b, t) {
|
|
504
|
-
|
|
505
|
-
Number.isFinite(a.minWidth) && Number.isFinite(b.minWidth) || a.minWidth === Infinity && b.minWidth === Infinity,
|
|
506
|
-
"Cannot interpolate between finite constraints and unbounded constraints."
|
|
507
|
-
);
|
|
508
|
-
assert(
|
|
509
|
-
Number.isFinite(a.maxWidth) && Number.isFinite(b.maxWidth) || a.maxWidth === Infinity && b.maxWidth === Infinity,
|
|
510
|
-
"Cannot interpolate between finite constraints and unbounded constraints."
|
|
511
|
-
);
|
|
512
|
-
assert(
|
|
513
|
-
Number.isFinite(a.minHeight) && Number.isFinite(b.minHeight) || a.minHeight === Infinity && b.minHeight === Infinity,
|
|
514
|
-
"Cannot interpolate between finite constraints and unbounded constraints."
|
|
515
|
-
);
|
|
516
|
-
assert(
|
|
517
|
-
Number.isFinite(a.minHeight) && Number.isFinite(b.minHeight) || a.minHeight === Infinity && b.minHeight === Infinity,
|
|
518
|
-
"Cannot interpolate between finite constraints and unbounded constraints."
|
|
519
|
-
);
|
|
508
|
+
_Constraints.validateInterpolation(a, b);
|
|
520
509
|
return new _Constraints({
|
|
521
|
-
minWidth:
|
|
522
|
-
maxWidth:
|
|
523
|
-
minHeight:
|
|
524
|
-
maxHeight:
|
|
510
|
+
minWidth: _Constraints.interpolateDimension(a.minWidth, b.minWidth, t),
|
|
511
|
+
maxWidth: _Constraints.interpolateDimension(a.maxWidth, b.maxWidth, t),
|
|
512
|
+
minHeight: _Constraints.interpolateDimension(a.minHeight, b.minHeight, t),
|
|
513
|
+
maxHeight: _Constraints.interpolateDimension(a.maxHeight, b.maxHeight, t)
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
static validateInterpolation(a, b) {
|
|
517
|
+
const dimensions = ["minWidth", "maxWidth", "minHeight", "maxHeight"];
|
|
518
|
+
dimensions.forEach((dimension) => {
|
|
519
|
+
assert(
|
|
520
|
+
Number.isFinite(a[dimension]) && Number.isFinite(b[dimension]) || a[dimension] === Infinity && b[dimension] === Infinity,
|
|
521
|
+
"Cannot interpolate between finite constraints and unbounded constraints."
|
|
522
|
+
);
|
|
525
523
|
});
|
|
526
524
|
}
|
|
525
|
+
static interpolateDimension(aValue, bValue, t) {
|
|
526
|
+
return Number.isFinite(aValue) ? Utils.lerp(aValue, bValue, t) : Infinity;
|
|
527
|
+
}
|
|
527
528
|
static expand({
|
|
528
529
|
width = Infinity,
|
|
529
530
|
height = Infinity
|
|
@@ -552,12 +553,7 @@ var Constraints = class _Constraints extends data_default {
|
|
|
552
553
|
});
|
|
553
554
|
}
|
|
554
555
|
static tight({ width, height }) {
|
|
555
|
-
return
|
|
556
|
-
maxHeight: height,
|
|
557
|
-
minHeight: height,
|
|
558
|
-
maxWidth: width,
|
|
559
|
-
minWidth: width
|
|
560
|
-
});
|
|
556
|
+
return _Constraints.tightFor({ width, height });
|
|
561
557
|
}
|
|
562
558
|
static tightFor({ width, height }) {
|
|
563
559
|
return new _Constraints({
|
|
@@ -568,11 +564,18 @@ var Constraints = class _Constraints extends data_default {
|
|
|
568
564
|
});
|
|
569
565
|
}
|
|
570
566
|
enforce(parent) {
|
|
567
|
+
const minWidth = parent.constrainWidth(this.minWidth);
|
|
568
|
+
const maxWidth = parent.constrainWidth(this.maxWidth);
|
|
569
|
+
const minHeight = parent.constrainHeight(this.minHeight);
|
|
570
|
+
const maxHeight = parent.constrainHeight(this.maxHeight);
|
|
571
|
+
if (minWidth === maxWidth && minHeight === maxHeight && this.maxWidth === maxWidth && this.maxHeight === maxHeight) {
|
|
572
|
+
return this;
|
|
573
|
+
}
|
|
571
574
|
return new _Constraints({
|
|
572
|
-
minWidth
|
|
573
|
-
maxWidth
|
|
574
|
-
minHeight
|
|
575
|
-
maxHeight
|
|
575
|
+
minWidth,
|
|
576
|
+
maxWidth,
|
|
577
|
+
minHeight,
|
|
578
|
+
maxHeight
|
|
576
579
|
});
|
|
577
580
|
}
|
|
578
581
|
loosen() {
|
|
@@ -588,10 +591,15 @@ var Constraints = class _Constraints extends data_default {
|
|
|
588
591
|
});
|
|
589
592
|
}
|
|
590
593
|
normalize() {
|
|
591
|
-
|
|
594
|
+
if (this.minWidth <= this.maxWidth && this.minHeight <= this.maxHeight) {
|
|
595
|
+
return this;
|
|
596
|
+
}
|
|
597
|
+
return new _Constraints({
|
|
598
|
+
maxHeight: Math.max(this.maxHeight, this.minHeight),
|
|
592
599
|
minHeight: Math.min(this.minHeight, this.maxHeight),
|
|
600
|
+
maxWidth: Math.max(this.maxWidth, this.minWidth),
|
|
593
601
|
minWidth: Math.min(this.minWidth, this.maxWidth)
|
|
594
|
-
})
|
|
602
|
+
});
|
|
595
603
|
}
|
|
596
604
|
getMax(key) {
|
|
597
605
|
return key === "width" ? this.maxWidth : this.maxHeight;
|
|
@@ -1276,42 +1284,42 @@ var r_rect_default = RRect;
|
|
|
1276
1284
|
|
|
1277
1285
|
// src/type/_types/text-direction.ts
|
|
1278
1286
|
var TextDirection = /* @__PURE__ */ ((TextDirection2) => {
|
|
1279
|
-
TextDirection2["rtl"] = "rtl";
|
|
1280
|
-
TextDirection2["ltr"] = "ltr";
|
|
1287
|
+
TextDirection2[TextDirection2["rtl"] = 1] = "rtl";
|
|
1288
|
+
TextDirection2[TextDirection2["ltr"] = 2] = "ltr";
|
|
1281
1289
|
return TextDirection2;
|
|
1282
1290
|
})(TextDirection || {});
|
|
1283
1291
|
var text_direction_default = TextDirection;
|
|
1284
1292
|
|
|
1285
1293
|
// src/type/_types/_etc.ts
|
|
1286
1294
|
var MainAxisSize = /* @__PURE__ */ ((MainAxisSize2) => {
|
|
1287
|
-
MainAxisSize2["min"] = "min";
|
|
1288
|
-
MainAxisSize2["max"] = "max";
|
|
1295
|
+
MainAxisSize2[MainAxisSize2["min"] = 1] = "min";
|
|
1296
|
+
MainAxisSize2[MainAxisSize2["max"] = 2] = "max";
|
|
1289
1297
|
return MainAxisSize2;
|
|
1290
1298
|
})(MainAxisSize || {});
|
|
1291
1299
|
var VerticalDirection = /* @__PURE__ */ ((VerticalDirection2) => {
|
|
1292
|
-
VerticalDirection2["up"] = "up";
|
|
1293
|
-
VerticalDirection2["down"] = "down";
|
|
1300
|
+
VerticalDirection2[VerticalDirection2["up"] = 1] = "up";
|
|
1301
|
+
VerticalDirection2[VerticalDirection2["down"] = 2] = "down";
|
|
1294
1302
|
return VerticalDirection2;
|
|
1295
1303
|
})(VerticalDirection || {});
|
|
1296
1304
|
var MainAxisAlignment = /* @__PURE__ */ ((MainAxisAlignment2) => {
|
|
1297
|
-
MainAxisAlignment2["start"] = "start";
|
|
1298
|
-
MainAxisAlignment2["end"] = "end";
|
|
1299
|
-
MainAxisAlignment2["center"] = "center";
|
|
1300
|
-
MainAxisAlignment2["spaceBetween"] = "spaceBetween";
|
|
1301
|
-
MainAxisAlignment2["spaceAround"] = "spaceAround";
|
|
1302
|
-
MainAxisAlignment2["spaceEvenly"] = "spaceEvenly";
|
|
1305
|
+
MainAxisAlignment2[MainAxisAlignment2["start"] = 1] = "start";
|
|
1306
|
+
MainAxisAlignment2[MainAxisAlignment2["end"] = 2] = "end";
|
|
1307
|
+
MainAxisAlignment2[MainAxisAlignment2["center"] = 3] = "center";
|
|
1308
|
+
MainAxisAlignment2[MainAxisAlignment2["spaceBetween"] = 4] = "spaceBetween";
|
|
1309
|
+
MainAxisAlignment2[MainAxisAlignment2["spaceAround"] = 5] = "spaceAround";
|
|
1310
|
+
MainAxisAlignment2[MainAxisAlignment2["spaceEvenly"] = 6] = "spaceEvenly";
|
|
1303
1311
|
return MainAxisAlignment2;
|
|
1304
1312
|
})(MainAxisAlignment || {});
|
|
1305
1313
|
var CrossAxisAlignment = /* @__PURE__ */ ((CrossAxisAlignment2) => {
|
|
1306
|
-
CrossAxisAlignment2["start"] = "start";
|
|
1307
|
-
CrossAxisAlignment2["end"] = "end";
|
|
1308
|
-
CrossAxisAlignment2["center"] = "center";
|
|
1309
|
-
CrossAxisAlignment2["stretch"] = "stretch";
|
|
1314
|
+
CrossAxisAlignment2[CrossAxisAlignment2["start"] = 1] = "start";
|
|
1315
|
+
CrossAxisAlignment2[CrossAxisAlignment2["end"] = 2] = "end";
|
|
1316
|
+
CrossAxisAlignment2[CrossAxisAlignment2["center"] = 3] = "center";
|
|
1317
|
+
CrossAxisAlignment2[CrossAxisAlignment2["stretch"] = 4] = "stretch";
|
|
1310
1318
|
return CrossAxisAlignment2;
|
|
1311
1319
|
})(CrossAxisAlignment || {});
|
|
1312
1320
|
var Axis = /* @__PURE__ */ ((Axis2) => {
|
|
1313
|
-
Axis2["horizontal"] = "horizontal";
|
|
1314
|
-
Axis2["vertical"] = "vertical";
|
|
1321
|
+
Axis2[Axis2["horizontal"] = 1] = "horizontal";
|
|
1322
|
+
Axis2[Axis2["vertical"] = 2] = "vertical";
|
|
1315
1323
|
return Axis2;
|
|
1316
1324
|
})(Axis || {});
|
|
1317
1325
|
|
|
@@ -9313,7 +9321,7 @@ var Vector3 = class _Vector3 {
|
|
|
9313
9321
|
var vector3_default = Vector3;
|
|
9314
9322
|
|
|
9315
9323
|
// src/type/_types/_matrix4.ts
|
|
9316
|
-
var
|
|
9324
|
+
var _Matrix4 = class _Matrix4 extends calculable_default {
|
|
9317
9325
|
constructor(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) {
|
|
9318
9326
|
super();
|
|
9319
9327
|
// 4 x 4 matrix
|
|
@@ -9850,6 +9858,9 @@ var Matrix4 = class _Matrix4 extends calculable_default {
|
|
|
9850
9858
|
return this;
|
|
9851
9859
|
}
|
|
9852
9860
|
translated(x, y, z) {
|
|
9861
|
+
if ((y == null || y === 0) && (z == null || z === 0) && x === 0) {
|
|
9862
|
+
return this;
|
|
9863
|
+
}
|
|
9853
9864
|
return this.clone().translate(x, y, z);
|
|
9854
9865
|
}
|
|
9855
9866
|
/**
|
|
@@ -10720,42 +10731,6 @@ var Matrix4 = class _Matrix4 extends calculable_default {
|
|
|
10720
10731
|
this._m4storage[11] = m30 * argStorage[2] + m31 * argStorage[6] + m32 * argStorage[10] + m33 * argStorage[14];
|
|
10721
10732
|
this._m4storage[15] = m30 * argStorage[3] + m31 * argStorage[7] + m32 * argStorage[11] + m33 * argStorage[15];
|
|
10722
10733
|
}
|
|
10723
|
-
// /// Decomposes this into [translation], [rotation] and [scale] components.
|
|
10724
|
-
// void decompose(Vector3 translation, Quaternion rotation, Vector3 scale) {
|
|
10725
|
-
// final v = _decomposeV ??= Vector3.zero();
|
|
10726
|
-
// var sx = (v..setValues(_m4storage[0], _m4storage[1], _m4storage[2])).length;
|
|
10727
|
-
// final sy =
|
|
10728
|
-
// (v..setValues(_m4storage[4], _m4storage[5], _m4storage[6])).length;
|
|
10729
|
-
// final sz =
|
|
10730
|
-
// (v..setValues(_m4storage[8], _m4storage[9], _m4storage[10])).length;
|
|
10731
|
-
// if (determinant() < 0) {
|
|
10732
|
-
// sx = -sx;
|
|
10733
|
-
// }
|
|
10734
|
-
// translation._v3storage[0] = _m4storage[12];
|
|
10735
|
-
// translation._v3storage[1] = _m4storage[13];
|
|
10736
|
-
// translation._v3storage[2] = _m4storage[14];
|
|
10737
|
-
// final invSX = 1.0 / sx;
|
|
10738
|
-
// final invSY = 1.0 / sy;
|
|
10739
|
-
// final invSZ = 1.0 / sz;
|
|
10740
|
-
// final m = _decomposeM ??= Matrix4.zero();
|
|
10741
|
-
// m.setFrom(this);
|
|
10742
|
-
// m._m4storage[0] *= invSX;
|
|
10743
|
-
// m._m4storage[1] *= invSX;
|
|
10744
|
-
// m._m4storage[2] *= invSX;
|
|
10745
|
-
// m._m4storage[4] *= invSY;
|
|
10746
|
-
// m._m4storage[5] *= invSY;
|
|
10747
|
-
// m._m4storage[6] *= invSY;
|
|
10748
|
-
// m._m4storage[8] *= invSZ;
|
|
10749
|
-
// m._m4storage[9] *= invSZ;
|
|
10750
|
-
// m._m4storage[10] *= invSZ;
|
|
10751
|
-
// final r = _decomposeR ??= Matrix3.zero();
|
|
10752
|
-
// m.copyRotation(r);
|
|
10753
|
-
// rotation.setFromRotation(r);
|
|
10754
|
-
// scale._v3storage[0] = sx;
|
|
10755
|
-
// scale._v3storage[1] = sy;
|
|
10756
|
-
// scale._v3storage[2] = sz;
|
|
10757
|
-
// }
|
|
10758
|
-
/// Rotate [arg] of type [Vector3] using the rotation defined by this.
|
|
10759
10734
|
rotate3(arg) {
|
|
10760
10735
|
const argStorage = arg._v3storage;
|
|
10761
10736
|
const x = this._m4storage[0] * argStorage[0] + this._m4storage[4] * argStorage[1] + this._m4storage[8] * argStorage[2];
|
|
@@ -10870,13 +10845,17 @@ var Matrix4 = class _Matrix4 extends calculable_default {
|
|
|
10870
10845
|
this._m4storage[13] == 0 && this._m4storage[14] == 0 && this._m4storage[15] == 0;
|
|
10871
10846
|
}
|
|
10872
10847
|
};
|
|
10848
|
+
__publicField(_Matrix4, "Constants", {
|
|
10849
|
+
identity: Object.freeze(_Matrix4.identity())
|
|
10850
|
+
});
|
|
10851
|
+
var Matrix4 = _Matrix4;
|
|
10873
10852
|
var matrix4_default = Matrix4;
|
|
10874
10853
|
|
|
10875
10854
|
// src/type/_types/stack-fit.ts
|
|
10876
10855
|
var StackFit = /* @__PURE__ */ ((StackFit2) => {
|
|
10877
|
-
StackFit2["loose"] = "loose";
|
|
10878
|
-
StackFit2["expand"] = "expand";
|
|
10879
|
-
StackFit2["passthrough"] = "passthrough";
|
|
10856
|
+
StackFit2[StackFit2["loose"] = 1] = "loose";
|
|
10857
|
+
StackFit2[StackFit2["expand"] = 2] = "expand";
|
|
10858
|
+
StackFit2[StackFit2["passthrough"] = 3] = "passthrough";
|
|
10880
10859
|
return StackFit2;
|
|
10881
10860
|
})(StackFit || {});
|
|
10882
10861
|
var stack_fit_default = StackFit;
|
|
@@ -10973,7 +10952,7 @@ var BorderRadius = _BorderRadius;
|
|
|
10973
10952
|
|
|
10974
10953
|
// src/type/_types/border-style.ts
|
|
10975
10954
|
var BorderStyle = /* @__PURE__ */ ((BorderStyle2) => {
|
|
10976
|
-
BorderStyle2["normal"] = "normal";
|
|
10955
|
+
BorderStyle2[BorderStyle2["normal"] = 1] = "normal";
|
|
10977
10956
|
return BorderStyle2;
|
|
10978
10957
|
})(BorderStyle || {});
|
|
10979
10958
|
var border_style_default = BorderStyle;
|
|
@@ -11525,12 +11504,6 @@ var BoxShadow = class _BoxShadow extends calculable_default {
|
|
|
11525
11504
|
return true;
|
|
11526
11505
|
return this.color === other.color && this.offset.equals(other.offset) && this.blurRadius === other.blurRadius;
|
|
11527
11506
|
}
|
|
11528
|
-
/**
|
|
11529
|
-
* @deprecated The method should not be used
|
|
11530
|
-
*/
|
|
11531
|
-
eqaul(other) {
|
|
11532
|
-
return this.equals(other);
|
|
11533
|
-
}
|
|
11534
11507
|
};
|
|
11535
11508
|
var box_shadow_default = BoxShadow;
|
|
11536
11509
|
|
|
@@ -11694,36 +11667,36 @@ var BoxDecorationPainter = class {
|
|
|
11694
11667
|
|
|
11695
11668
|
// src/type/_types/text-align.ts
|
|
11696
11669
|
var TextAlign = /* @__PURE__ */ ((TextAlign2) => {
|
|
11697
|
-
TextAlign2["left"] = "left";
|
|
11698
|
-
TextAlign2["right"] = "right";
|
|
11699
|
-
TextAlign2["center"] = "center";
|
|
11700
|
-
TextAlign2["start"] = "start";
|
|
11701
|
-
TextAlign2["end"] = "end";
|
|
11670
|
+
TextAlign2[TextAlign2["left"] = 1] = "left";
|
|
11671
|
+
TextAlign2[TextAlign2["right"] = 2] = "right";
|
|
11672
|
+
TextAlign2[TextAlign2["center"] = 3] = "center";
|
|
11673
|
+
TextAlign2[TextAlign2["start"] = 4] = "start";
|
|
11674
|
+
TextAlign2[TextAlign2["end"] = 5] = "end";
|
|
11702
11675
|
return TextAlign2;
|
|
11703
11676
|
})(TextAlign || {});
|
|
11704
11677
|
var text_align_default = TextAlign;
|
|
11705
11678
|
|
|
11706
11679
|
// src/type/_types/text-overflow.ts
|
|
11707
11680
|
var TextOverflow = /* @__PURE__ */ ((TextOverflow2) => {
|
|
11708
|
-
TextOverflow2["clip"] = "clip";
|
|
11709
|
-
TextOverflow2["visible"] = "visible";
|
|
11710
|
-
TextOverflow2["ellipsis"] = "ellipsis";
|
|
11681
|
+
TextOverflow2[TextOverflow2["clip"] = 1] = "clip";
|
|
11682
|
+
TextOverflow2[TextOverflow2["visible"] = 2] = "visible";
|
|
11683
|
+
TextOverflow2[TextOverflow2["ellipsis"] = 3] = "ellipsis";
|
|
11711
11684
|
return TextOverflow2;
|
|
11712
11685
|
})(TextOverflow || {});
|
|
11713
11686
|
var text_overflow_default = TextOverflow;
|
|
11714
11687
|
|
|
11715
11688
|
// src/type/_types/text-width-basis.ts
|
|
11716
11689
|
var TextWidthBasis = /* @__PURE__ */ ((TextWidthBasis2) => {
|
|
11717
|
-
TextWidthBasis2["parent"] = "parent";
|
|
11718
|
-
TextWidthBasis2["longestLine"] = "longestLine";
|
|
11690
|
+
TextWidthBasis2[TextWidthBasis2["parent"] = 1] = "parent";
|
|
11691
|
+
TextWidthBasis2[TextWidthBasis2["longestLine"] = 2] = "longestLine";
|
|
11719
11692
|
return TextWidthBasis2;
|
|
11720
11693
|
})(TextWidthBasis || {});
|
|
11721
11694
|
var text_width_basis_default = TextWidthBasis;
|
|
11722
11695
|
|
|
11723
11696
|
// src/type/_types/text-baseline.ts
|
|
11724
11697
|
var TextBaseline = /* @__PURE__ */ ((TextBaseline2) => {
|
|
11725
|
-
TextBaseline2["alphabetic"] = "alphabetic";
|
|
11726
|
-
TextBaseline2["ideographic"] = "ideographic";
|
|
11698
|
+
TextBaseline2[TextBaseline2["alphabetic"] = 1] = "alphabetic";
|
|
11699
|
+
TextBaseline2[TextBaseline2["ideographic"] = 2] = "ideographic";
|
|
11727
11700
|
return TextBaseline2;
|
|
11728
11701
|
})(TextBaseline || {});
|
|
11729
11702
|
var text_baseline_default = TextBaseline;
|
|
@@ -11865,9 +11838,9 @@ var InlineSpan = class {
|
|
|
11865
11838
|
static equals(targets, values) {
|
|
11866
11839
|
if (targets.length !== values.length)
|
|
11867
11840
|
return false;
|
|
11868
|
-
return targets.every((value, i) => values[i].
|
|
11841
|
+
return targets.every((value, i) => values[i].equals(value));
|
|
11869
11842
|
}
|
|
11870
|
-
|
|
11843
|
+
equals(other) {
|
|
11871
11844
|
if (this.style != null || other.style != null) {
|
|
11872
11845
|
return this.style.equals(other.style);
|
|
11873
11846
|
}
|
|
@@ -11903,7 +11876,7 @@ var TextSpan = class extends Inline_span_default {
|
|
|
11903
11876
|
this.children = children;
|
|
11904
11877
|
this.text = text;
|
|
11905
11878
|
}
|
|
11906
|
-
|
|
11879
|
+
equals(other) {
|
|
11907
11880
|
if (other === this)
|
|
11908
11881
|
return true;
|
|
11909
11882
|
return this.text === other.text && Inline_span_default.equals(this.children, other.children);
|
|
@@ -11968,8 +11941,8 @@ var RenderObject = class {
|
|
|
11968
11941
|
__publicField(this, "needsPaint", true);
|
|
11969
11942
|
__publicField(this, "needsLayout", true);
|
|
11970
11943
|
__publicField(this, "clipId");
|
|
11971
|
-
__publicField(this, "matrix", matrix4_default.identity
|
|
11972
|
-
__publicField(this, "opacity",
|
|
11944
|
+
__publicField(this, "matrix", matrix4_default.Constants.identity);
|
|
11945
|
+
__publicField(this, "opacity", 1);
|
|
11973
11946
|
__publicField(this, "depth", 0);
|
|
11974
11947
|
__privateAdd(this, _domNode, void 0);
|
|
11975
11948
|
/**
|
|
@@ -12036,9 +12009,12 @@ var RenderObject = class {
|
|
|
12036
12009
|
this.needsLayout = false;
|
|
12037
12010
|
this.markNeedsPaint();
|
|
12038
12011
|
}
|
|
12039
|
-
paint(context, clipId, matrix4 = matrix4_default.identity
|
|
12012
|
+
paint(context, clipId, matrix4 = matrix4_default.Constants.identity, opacity = 1) {
|
|
12040
12013
|
const translatedMatrix4 = matrix4.translated(this.offset.x, this.offset.y);
|
|
12041
|
-
|
|
12014
|
+
const clipIdChanged = this.clipId !== clipId;
|
|
12015
|
+
const opacityChanged = this.opacity !== opacity;
|
|
12016
|
+
const matrixChanged = !this.matrix.equals(translatedMatrix4);
|
|
12017
|
+
if (!clipIdChanged && !opacityChanged && !matrixChanged && !this.needsPaint) {
|
|
12042
12018
|
return;
|
|
12043
12019
|
}
|
|
12044
12020
|
this.matrix = translatedMatrix4;
|
|
@@ -12046,14 +12022,17 @@ var RenderObject = class {
|
|
|
12046
12022
|
this.opacity = opacity;
|
|
12047
12023
|
if (this.isPainter) {
|
|
12048
12024
|
const { svgEls, container } = this.resolveSvgEl();
|
|
12049
|
-
if (clipId) {
|
|
12025
|
+
if (clipId && clipIdChanged) {
|
|
12050
12026
|
container.setAttribute("clip-path", `url(#${clipId})`);
|
|
12051
12027
|
}
|
|
12052
|
-
|
|
12053
|
-
|
|
12054
|
-
|
|
12055
|
-
|
|
12056
|
-
|
|
12028
|
+
if (opacityChanged) {
|
|
12029
|
+
container.setAttribute("opacity", `${opacity}`);
|
|
12030
|
+
}
|
|
12031
|
+
if (matrixChanged) {
|
|
12032
|
+
Object.values(svgEls).forEach(
|
|
12033
|
+
(el) => this.setSvgTransform(el, this.matrix)
|
|
12034
|
+
);
|
|
12035
|
+
}
|
|
12057
12036
|
if (this.needsPaint) {
|
|
12058
12037
|
this.performPaint(svgEls, context);
|
|
12059
12038
|
}
|
|
@@ -12109,16 +12088,17 @@ var RenderObject = class {
|
|
|
12109
12088
|
mountSvgEl(context) {
|
|
12110
12089
|
const { appendSvgEl } = context;
|
|
12111
12090
|
const svgEls = this.createDefaultSvgEl(context);
|
|
12112
|
-
Object.entries(svgEls)
|
|
12091
|
+
const entries = Object.entries(svgEls);
|
|
12092
|
+
entries.forEach(([name, value]) => {
|
|
12113
12093
|
value.setAttribute("data-render-name", name);
|
|
12114
12094
|
});
|
|
12115
|
-
const values = Object.values(svgEls);
|
|
12116
12095
|
const svgG = context.createSvgEl("g");
|
|
12117
12096
|
appendSvgEl(svgG);
|
|
12118
12097
|
svgG.setAttribute("data-render-type", this.type);
|
|
12119
|
-
|
|
12098
|
+
entries.forEach(([_, value]) => {
|
|
12120
12099
|
svgG.appendChild(value);
|
|
12121
12100
|
});
|
|
12101
|
+
svgG.setAttribute("pointer-events", "none");
|
|
12122
12102
|
__privateSet(this, _domNode, svgG);
|
|
12123
12103
|
}
|
|
12124
12104
|
resolveSvgEl() {
|
|
@@ -12142,12 +12122,11 @@ var RenderObject = class {
|
|
|
12142
12122
|
}
|
|
12143
12123
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12144
12124
|
createDefaultSvgEl(paintContext) {
|
|
12145
|
-
throw
|
|
12125
|
+
throw new NotImplementedError("createDefaultSvgEl");
|
|
12146
12126
|
}
|
|
12147
12127
|
/*
|
|
12148
12128
|
* Do not call this method directly. instead call layout
|
|
12149
12129
|
*/
|
|
12150
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12151
12130
|
preformLayout() {
|
|
12152
12131
|
throw new NotImplementedError("performLayout");
|
|
12153
12132
|
}
|
|
@@ -12186,16 +12165,14 @@ var RenderObject = class {
|
|
|
12186
12165
|
didChangeDomOrder() {
|
|
12187
12166
|
this.renderOwner.didDomOrderChange();
|
|
12188
12167
|
}
|
|
12189
|
-
localToGlobal(additionalOffset = offset_default.zero
|
|
12168
|
+
localToGlobal(additionalOffset = offset_default.Constants.zero) {
|
|
12190
12169
|
return new offset_default({
|
|
12191
12170
|
x: this.matrix.storage[12] + additionalOffset.x,
|
|
12192
12171
|
y: this.matrix.storage[13] + additionalOffset.y
|
|
12193
12172
|
});
|
|
12194
12173
|
}
|
|
12195
12174
|
visitChildren(callback) {
|
|
12196
|
-
this.children.forEach(
|
|
12197
|
-
callback(child);
|
|
12198
|
-
});
|
|
12175
|
+
this.children.forEach(callback);
|
|
12199
12176
|
}
|
|
12200
12177
|
/**
|
|
12201
12178
|
* It is currently only used on ZIndexRenderObject
|
|
@@ -12206,13 +12183,11 @@ var RenderObject = class {
|
|
|
12206
12183
|
hitTest({ globalPoint }) {
|
|
12207
12184
|
const viewPort = this.renderOwner.renderContext.viewPort;
|
|
12208
12185
|
const { translation, scale } = viewPort;
|
|
12209
|
-
const
|
|
12210
|
-
|
|
12211
|
-
|
|
12212
|
-
|
|
12213
|
-
|
|
12214
|
-
};
|
|
12215
|
-
return globalPoint.x >= bounds.left && globalPoint.x <= bounds.right && globalPoint.y >= bounds.top && globalPoint.y <= bounds.bottom;
|
|
12186
|
+
const left = (this.matrix.storage[12] + translation.x) * scale;
|
|
12187
|
+
const top = (this.matrix.storage[13] + translation.y) * scale;
|
|
12188
|
+
const right = left + this.size.width * scale;
|
|
12189
|
+
const bottom = top + this.size.height * scale;
|
|
12190
|
+
return globalPoint.x >= left && globalPoint.x <= right && globalPoint.y >= top && globalPoint.y <= bottom;
|
|
12216
12191
|
}
|
|
12217
12192
|
};
|
|
12218
12193
|
_domNode = new WeakMap();
|
|
@@ -12280,7 +12255,7 @@ var Element = class {
|
|
|
12280
12255
|
__publicField(this, "parent");
|
|
12281
12256
|
__publicField(this, "dirty", true);
|
|
12282
12257
|
__publicField(this, "depth", 0);
|
|
12283
|
-
__publicField(this, "type",
|
|
12258
|
+
__publicField(this, "type", 0 /* none */);
|
|
12284
12259
|
this.widget = widget;
|
|
12285
12260
|
}
|
|
12286
12261
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -12290,7 +12265,9 @@ var Element = class {
|
|
|
12290
12265
|
get renderObject() {
|
|
12291
12266
|
let result = null;
|
|
12292
12267
|
this.visitChildren((child) => {
|
|
12293
|
-
result
|
|
12268
|
+
if (result == null) {
|
|
12269
|
+
result = child.renderObject;
|
|
12270
|
+
}
|
|
12294
12271
|
});
|
|
12295
12272
|
if (result == null)
|
|
12296
12273
|
throw { message: "can not find render object" };
|
|
@@ -12368,7 +12345,7 @@ var RenderObjectElement = class extends Element_default {
|
|
|
12368
12345
|
super(widget);
|
|
12369
12346
|
__publicField(this, "children");
|
|
12370
12347
|
__publicField(this, "_renderObject");
|
|
12371
|
-
__publicField(this, "type",
|
|
12348
|
+
__publicField(this, "type", 2 /* render */);
|
|
12372
12349
|
__publicField(this, "ancestorRenderObjectElement");
|
|
12373
12350
|
}
|
|
12374
12351
|
createRenderObject() {
|
|
@@ -12439,7 +12416,7 @@ var RenderObjectElement = class extends Element_default {
|
|
|
12439
12416
|
}
|
|
12440
12417
|
findAncestorRenderObjectElement() {
|
|
12441
12418
|
let ancestor = this.parent;
|
|
12442
|
-
while (ancestor != null && ancestor.type !==
|
|
12419
|
+
while (ancestor != null && ancestor.type !== 2 /* render */) {
|
|
12443
12420
|
ancestor = ancestor.parent;
|
|
12444
12421
|
}
|
|
12445
12422
|
return ancestor;
|
|
@@ -13129,7 +13106,7 @@ var ComponentElement = class extends Element_default {
|
|
|
13129
13106
|
this.rebuild({ force: true });
|
|
13130
13107
|
}
|
|
13131
13108
|
initState() {
|
|
13132
|
-
throw new Error("not implemented initState on
|
|
13109
|
+
throw new Error("not implemented initState on component element");
|
|
13133
13110
|
}
|
|
13134
13111
|
build() {
|
|
13135
13112
|
throw new Error("not implemented build on component element");
|
|
@@ -13225,7 +13202,7 @@ var Provider = class extends Widget_default {
|
|
|
13225
13202
|
while (parent != null) {
|
|
13226
13203
|
const current = parent;
|
|
13227
13204
|
parent = current.parent;
|
|
13228
|
-
if (!(current.type ===
|
|
13205
|
+
if (!(current.type === 1 /* provider */))
|
|
13229
13206
|
continue;
|
|
13230
13207
|
if (current.providerKey !== key)
|
|
13231
13208
|
continue;
|
|
@@ -13237,11 +13214,11 @@ var Provider = class extends Widget_default {
|
|
|
13237
13214
|
return new ProviderElement(this);
|
|
13238
13215
|
}
|
|
13239
13216
|
};
|
|
13240
|
-
var
|
|
13217
|
+
var ProviderElement = class extends Element_default {
|
|
13241
13218
|
constructor(widget) {
|
|
13242
13219
|
super(widget);
|
|
13243
13220
|
__publicField(this, "child");
|
|
13244
|
-
__publicField(this, "type",
|
|
13221
|
+
__publicField(this, "type", 1 /* provider */);
|
|
13245
13222
|
this.widget = widget;
|
|
13246
13223
|
}
|
|
13247
13224
|
get providerKey() {
|
|
@@ -13265,8 +13242,6 @@ var _ProviderElement = class _ProviderElement extends Element_default {
|
|
|
13265
13242
|
this.child = this.updateChild(this.child, this.child.widget);
|
|
13266
13243
|
}
|
|
13267
13244
|
};
|
|
13268
|
-
__publicField(_ProviderElement, "type", "provider");
|
|
13269
|
-
var ProviderElement = _ProviderElement;
|
|
13270
13245
|
function ProviderFn(props) {
|
|
13271
13246
|
return new Provider(props);
|
|
13272
13247
|
}
|
|
@@ -14052,10 +14027,10 @@ var Flex = class extends MultiChildRenderObjectWidget_default {
|
|
|
14052
14027
|
constructor({
|
|
14053
14028
|
children,
|
|
14054
14029
|
direction,
|
|
14055
|
-
mainAxisAlignment =
|
|
14056
|
-
crossAxisAlignment =
|
|
14057
|
-
verticalDirection =
|
|
14058
|
-
mainAxisSize =
|
|
14030
|
+
mainAxisAlignment = 1 /* start */,
|
|
14031
|
+
crossAxisAlignment = 3 /* center */,
|
|
14032
|
+
verticalDirection = 2 /* down */,
|
|
14033
|
+
mainAxisSize = 2 /* max */,
|
|
14059
14034
|
key
|
|
14060
14035
|
}) {
|
|
14061
14036
|
super({ children, key });
|
|
@@ -14152,27 +14127,27 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14152
14127
|
this.markNeedsLayout();
|
|
14153
14128
|
}
|
|
14154
14129
|
get mainAxisSizeName() {
|
|
14155
|
-
return this.direction ===
|
|
14130
|
+
return this.direction === 1 /* horizontal */ ? "width" : "height";
|
|
14156
14131
|
}
|
|
14157
14132
|
get crossAxisSizeName() {
|
|
14158
|
-
return this.direction ===
|
|
14133
|
+
return this.direction === 1 /* horizontal */ ? "height" : "width";
|
|
14159
14134
|
}
|
|
14160
14135
|
get minMainAxisSizeName() {
|
|
14161
|
-
return this.direction ===
|
|
14136
|
+
return this.direction === 1 /* horizontal */ ? "minWidth" : "minHeight";
|
|
14162
14137
|
}
|
|
14163
14138
|
get maxMainAxisSizeName() {
|
|
14164
|
-
return this.direction ===
|
|
14139
|
+
return this.direction === 1 /* horizontal */ ? "maxWidth" : "maxHeight";
|
|
14165
14140
|
}
|
|
14166
14141
|
get minCrossAxisSizeName() {
|
|
14167
|
-
return this.direction ===
|
|
14142
|
+
return this.direction === 1 /* horizontal */ ? "minHeight" : "minWidth";
|
|
14168
14143
|
}
|
|
14169
14144
|
get maxCrossAxisSizeName() {
|
|
14170
|
-
return this.direction ===
|
|
14145
|
+
return this.direction === 1 /* horizontal */ ? "maxHeight" : "maxWidth";
|
|
14171
14146
|
}
|
|
14172
14147
|
preformLayout() {
|
|
14173
14148
|
let totalFlex = 0;
|
|
14174
14149
|
let [childIntrinsicMainAxisValue, crossAxisValue] = [0, 0];
|
|
14175
|
-
const sortedChildren = this.verticalDirection ===
|
|
14150
|
+
const sortedChildren = this.verticalDirection === 2 /* down */ ? this.children : [...this.children].reverse();
|
|
14176
14151
|
sortedChildren.forEach((child) => {
|
|
14177
14152
|
child.layout(this.constraints.loosen());
|
|
14178
14153
|
const flex = (child == null ? void 0 : child.isRenderFlexible) ? child.flex : 0;
|
|
@@ -14180,7 +14155,7 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14180
14155
|
if (flex === 0) {
|
|
14181
14156
|
childIntrinsicMainAxisValue += child.size[this.mainAxisSizeName];
|
|
14182
14157
|
}
|
|
14183
|
-
crossAxisValue = this.crossAxisAlignment ===
|
|
14158
|
+
crossAxisValue = this.crossAxisAlignment === 4 /* stretch */ ? this.constraints.getMax(this.crossAxisSizeName) : Math.max(crossAxisValue, child.size[this.crossAxisSizeName]);
|
|
14184
14159
|
});
|
|
14185
14160
|
const flexUnitSize = (this.constraints.getMax(this.mainAxisSizeName) - childIntrinsicMainAxisValue) / totalFlex;
|
|
14186
14161
|
sortedChildren.forEach((child) => {
|
|
@@ -14200,7 +14175,7 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14200
14175
|
});
|
|
14201
14176
|
this.size = this.constraints.constrain(
|
|
14202
14177
|
new size_default({
|
|
14203
|
-
[this.mainAxisSizeName]: this.mainAxisSize ===
|
|
14178
|
+
[this.mainAxisSizeName]: this.mainAxisSize === 2 /* max */ ? this.constraints.getMax(this.mainAxisSizeName) : sortedChildren.map((child) => child.size[this.mainAxisSizeName]).reduce((acc, childMainAxisSize) => acc + childMainAxisSize, 0),
|
|
14204
14179
|
[this.crossAxisSizeName]: crossAxisValue
|
|
14205
14180
|
})
|
|
14206
14181
|
);
|
|
@@ -14208,7 +14183,7 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14208
14183
|
sortedChildren.map(({ size }) => size[this.mainAxisSizeName])
|
|
14209
14184
|
);
|
|
14210
14185
|
sortedChildren.forEach((child, i) => {
|
|
14211
|
-
const [mainAxisOffset, crossAxisOffset] = this.direction ===
|
|
14186
|
+
const [mainAxisOffset, crossAxisOffset] = this.direction === 1 /* horizontal */ ? ["x", "y"] : ["y", "x"];
|
|
14212
14187
|
child.offset = new offset_default({
|
|
14213
14188
|
[mainAxisOffset]: mainAxisOffsets[i],
|
|
14214
14189
|
[crossAxisOffset]: this.getChildOffsetOnCrossAxis(
|
|
@@ -14218,7 +14193,7 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14218
14193
|
});
|
|
14219
14194
|
}
|
|
14220
14195
|
getNonFlexItemConstraint(crossAxisValue) {
|
|
14221
|
-
if (this.crossAxisAlignment ===
|
|
14196
|
+
if (this.crossAxisAlignment === 4 /* stretch */) {
|
|
14222
14197
|
return constraints_default.tightFor({
|
|
14223
14198
|
[this.crossAxisSizeName]: crossAxisValue
|
|
14224
14199
|
});
|
|
@@ -14227,7 +14202,7 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14227
14202
|
}
|
|
14228
14203
|
getFlexItemConstraint(childExtent, fit) {
|
|
14229
14204
|
return new constraints_default({
|
|
14230
|
-
[this.minCrossAxisSizeName]: this.crossAxisAlignment ===
|
|
14205
|
+
[this.minCrossAxisSizeName]: this.crossAxisAlignment === 4 /* stretch */ ? this.constraints[this.maxCrossAxisSizeName] : 0,
|
|
14231
14206
|
[this.maxCrossAxisSizeName]: this.constraints[this.maxCrossAxisSizeName],
|
|
14232
14207
|
[this.maxMainAxisSizeName]: childExtent,
|
|
14233
14208
|
[this.minMainAxisSizeName]: fit === "tight" ? childExtent : 0
|
|
@@ -14238,21 +14213,21 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14238
14213
|
const sum = (acc, value) => acc + value;
|
|
14239
14214
|
const restSpaceSize = this.size[this.mainAxisSizeName] - childMainAxisValues.reduce(sum, 0);
|
|
14240
14215
|
switch (this.mainAxisAlignment) {
|
|
14241
|
-
case
|
|
14216
|
+
case 1 /* start */:
|
|
14242
14217
|
offsetsOnMainAxis = this._getChildOffsetsOnMainAxis({
|
|
14243
14218
|
startOffset: 0,
|
|
14244
14219
|
additionalSpace: 0,
|
|
14245
14220
|
childMainAxisValues
|
|
14246
14221
|
});
|
|
14247
14222
|
break;
|
|
14248
|
-
case
|
|
14223
|
+
case 2 /* end */:
|
|
14249
14224
|
offsetsOnMainAxis = this._getChildOffsetsOnMainAxis({
|
|
14250
14225
|
startOffset: restSpaceSize,
|
|
14251
14226
|
additionalSpace: 0,
|
|
14252
14227
|
childMainAxisValues
|
|
14253
14228
|
});
|
|
14254
14229
|
break;
|
|
14255
|
-
case
|
|
14230
|
+
case 5 /* spaceAround */:
|
|
14256
14231
|
const aroundSpace = restSpaceSize / childMainAxisValues.length;
|
|
14257
14232
|
offsetsOnMainAxis = this._getChildOffsetsOnMainAxis({
|
|
14258
14233
|
startOffset: aroundSpace / 2,
|
|
@@ -14260,14 +14235,14 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14260
14235
|
childMainAxisValues
|
|
14261
14236
|
});
|
|
14262
14237
|
break;
|
|
14263
|
-
case
|
|
14238
|
+
case 4 /* spaceBetween */:
|
|
14264
14239
|
offsetsOnMainAxis = this._getChildOffsetsOnMainAxis({
|
|
14265
14240
|
startOffset: 0,
|
|
14266
14241
|
additionalSpace: restSpaceSize / (childMainAxisValues.length - 1),
|
|
14267
14242
|
childMainAxisValues
|
|
14268
14243
|
});
|
|
14269
14244
|
break;
|
|
14270
|
-
case
|
|
14245
|
+
case 6 /* spaceEvenly */:
|
|
14271
14246
|
const evenSpace = restSpaceSize / (childMainAxisValues.length + 1);
|
|
14272
14247
|
offsetsOnMainAxis = this._getChildOffsetsOnMainAxis({
|
|
14273
14248
|
startOffset: evenSpace,
|
|
@@ -14275,7 +14250,7 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14275
14250
|
childMainAxisValues
|
|
14276
14251
|
});
|
|
14277
14252
|
break;
|
|
14278
|
-
case
|
|
14253
|
+
case 3 /* center */:
|
|
14279
14254
|
offsetsOnMainAxis = this._getChildOffsetsOnMainAxis({
|
|
14280
14255
|
startOffset: restSpaceSize / 2,
|
|
14281
14256
|
additionalSpace: 0,
|
|
@@ -14284,7 +14259,7 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14284
14259
|
break;
|
|
14285
14260
|
default:
|
|
14286
14261
|
throw new Error(
|
|
14287
|
-
`this
|
|
14262
|
+
`this mainAxisAlignment(${this.mainAxisAlignment}) is not supported yet`
|
|
14288
14263
|
);
|
|
14289
14264
|
}
|
|
14290
14265
|
return offsetsOnMainAxis;
|
|
@@ -14306,16 +14281,16 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14306
14281
|
const parentCrossAxisValue = this.size[this.crossAxisSizeName];
|
|
14307
14282
|
let offsetOnCrossAxis;
|
|
14308
14283
|
switch (this.crossAxisAlignment) {
|
|
14309
|
-
case
|
|
14284
|
+
case 3 /* center */:
|
|
14310
14285
|
offsetOnCrossAxis = (parentCrossAxisValue - childCrossAxisValue) / 2;
|
|
14311
14286
|
break;
|
|
14312
|
-
case
|
|
14287
|
+
case 1 /* start */:
|
|
14313
14288
|
offsetOnCrossAxis = 0;
|
|
14314
14289
|
break;
|
|
14315
|
-
case
|
|
14290
|
+
case 2 /* end */:
|
|
14316
14291
|
offsetOnCrossAxis = parentCrossAxisValue - childCrossAxisValue;
|
|
14317
14292
|
break;
|
|
14318
|
-
case
|
|
14293
|
+
case 4 /* stretch */:
|
|
14319
14294
|
offsetOnCrossAxis = 0;
|
|
14320
14295
|
break;
|
|
14321
14296
|
}
|
|
@@ -14327,7 +14302,7 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14327
14302
|
const childIntrinsicHeights = this.children.map(
|
|
14328
14303
|
(child) => child.getIntrinsicHeight(width)
|
|
14329
14304
|
);
|
|
14330
|
-
return this.direction ===
|
|
14305
|
+
return this.direction === 1 /* horizontal */ ? childIntrinsicHeights.reduce(max, 0) : childIntrinsicHeights.reduce(sum, 0);
|
|
14331
14306
|
}
|
|
14332
14307
|
getIntrinsicWidth(height) {
|
|
14333
14308
|
const sum = (acc, value) => acc + value;
|
|
@@ -14335,7 +14310,7 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14335
14310
|
const childIntrinsicWidths = this.children.map(
|
|
14336
14311
|
(child) => child.getIntrinsicWidth(height)
|
|
14337
14312
|
);
|
|
14338
|
-
return this.direction ===
|
|
14313
|
+
return this.direction === 2 /* vertical */ ? childIntrinsicWidths.reduce(max, 0) : childIntrinsicWidths.reduce(sum, 0);
|
|
14339
14314
|
}
|
|
14340
14315
|
};
|
|
14341
14316
|
var BaseFlex_default = Flex;
|
|
@@ -14384,7 +14359,7 @@ function Column({
|
|
|
14384
14359
|
return Flex2({
|
|
14385
14360
|
key,
|
|
14386
14361
|
children,
|
|
14387
|
-
direction:
|
|
14362
|
+
direction: 2 /* vertical */,
|
|
14388
14363
|
mainAxisAlignment,
|
|
14389
14364
|
crossAxisAlignment,
|
|
14390
14365
|
verticalDirection,
|
|
@@ -14403,7 +14378,7 @@ function Row({
|
|
|
14403
14378
|
}) {
|
|
14404
14379
|
return Flex2({
|
|
14405
14380
|
children,
|
|
14406
|
-
direction:
|
|
14381
|
+
direction: 1 /* horizontal */,
|
|
14407
14382
|
mainAxisAlignment,
|
|
14408
14383
|
crossAxisAlignment,
|
|
14409
14384
|
verticalDirection,
|
|
@@ -14654,10 +14629,10 @@ var Paragraph = class {
|
|
|
14654
14629
|
}
|
|
14655
14630
|
get resolvedTextAlign() {
|
|
14656
14631
|
if (this.textAlign === text_align_default.start) {
|
|
14657
|
-
return this.textDirection === text_direction_default.ltr ?
|
|
14632
|
+
return this.textDirection === text_direction_default.ltr ? text_align_default.left : text_align_default.right;
|
|
14658
14633
|
}
|
|
14659
14634
|
if (this.textAlign === text_align_default.end) {
|
|
14660
|
-
return this.textDirection === text_direction_default.ltr ?
|
|
14635
|
+
return this.textDirection === text_direction_default.ltr ? text_align_default.right : text_align_default.left;
|
|
14661
14636
|
}
|
|
14662
14637
|
return this.textAlign;
|
|
14663
14638
|
}
|
|
@@ -14667,7 +14642,7 @@ var Paragraph = class {
|
|
|
14667
14642
|
fontWeight = defaultTextStyle.fontWeight,
|
|
14668
14643
|
content = "",
|
|
14669
14644
|
height = 1.2,
|
|
14670
|
-
fontStyle =
|
|
14645
|
+
fontStyle = 1 /* normal */,
|
|
14671
14646
|
color = defaultTextStyle.fontColor
|
|
14672
14647
|
}) {
|
|
14673
14648
|
this.source.push({
|
|
@@ -14730,13 +14705,13 @@ var ParagraphLine = class {
|
|
|
14730
14705
|
spanBox.offset.y = offsetY - spanBox.size.height + this.height;
|
|
14731
14706
|
});
|
|
14732
14707
|
switch (textAlign) {
|
|
14733
|
-
case
|
|
14708
|
+
case text_align_default.left:
|
|
14734
14709
|
this.alignHorizontally(0);
|
|
14735
14710
|
break;
|
|
14736
|
-
case
|
|
14711
|
+
case text_align_default.right:
|
|
14737
14712
|
this.alignHorizontally(paragraphWidth - this.width);
|
|
14738
14713
|
break;
|
|
14739
|
-
case
|
|
14714
|
+
case text_align_default.center:
|
|
14740
14715
|
this.alignHorizontally((paragraphWidth - this.width) / 2);
|
|
14741
14716
|
break;
|
|
14742
14717
|
}
|
|
@@ -14859,7 +14834,7 @@ var RenderParagraph = class extends RenderObject_default {
|
|
|
14859
14834
|
return this.textPainter.text;
|
|
14860
14835
|
}
|
|
14861
14836
|
set text(value) {
|
|
14862
|
-
if (this.textPainter.text.
|
|
14837
|
+
if (this.textPainter.text.equals(value))
|
|
14863
14838
|
return;
|
|
14864
14839
|
this.textPainter.text = value;
|
|
14865
14840
|
this.markNeedsLayout();
|
|
@@ -15296,20 +15271,16 @@ var RenderAlign = class extends RenderAligningShiftedBox_default {
|
|
|
15296
15271
|
const shrinkWrapHeight = this.heightFactor != null || constraints.maxHeight == Infinity;
|
|
15297
15272
|
if (this.child != null) {
|
|
15298
15273
|
this.child.layout(constraints.loosen());
|
|
15299
|
-
this.size = constraints.constrain(
|
|
15300
|
-
|
|
15301
|
-
|
|
15302
|
-
|
|
15303
|
-
})
|
|
15304
|
-
);
|
|
15274
|
+
this.size = constraints.constrain({
|
|
15275
|
+
width: shrinkWrapWidth ? this.child.size.width * ((_a = this.widthFactor) != null ? _a : 1) : Infinity,
|
|
15276
|
+
height: shrinkWrapHeight ? this.child.size.height * ((_b = this.heightFactor) != null ? _b : 1) : Infinity
|
|
15277
|
+
});
|
|
15305
15278
|
this.alignChild();
|
|
15306
15279
|
} else {
|
|
15307
|
-
this.size = constraints.constrain(
|
|
15308
|
-
|
|
15309
|
-
|
|
15310
|
-
|
|
15311
|
-
})
|
|
15312
|
-
);
|
|
15280
|
+
this.size = constraints.constrain({
|
|
15281
|
+
width: shrinkWrapWidth ? 0 : Infinity,
|
|
15282
|
+
height: shrinkWrapHeight ? 0 : Infinity
|
|
15283
|
+
});
|
|
15313
15284
|
}
|
|
15314
15285
|
}
|
|
15315
15286
|
};
|
|
@@ -15781,7 +15752,7 @@ Transform2.translate = BaseTransform_default.translate;
|
|
|
15781
15752
|
var Transform_default = Transform2;
|
|
15782
15753
|
|
|
15783
15754
|
// src/component/Container.ts
|
|
15784
|
-
var
|
|
15755
|
+
var Container = class extends StatelessWidget_default {
|
|
15785
15756
|
constructor({
|
|
15786
15757
|
key,
|
|
15787
15758
|
padding,
|
|
@@ -15922,7 +15893,7 @@ var _Container = class extends StatelessWidget_default {
|
|
|
15922
15893
|
return current;
|
|
15923
15894
|
}
|
|
15924
15895
|
};
|
|
15925
|
-
var Container_default = classToFunction_default(
|
|
15896
|
+
var Container_default = classToFunction_default(Container);
|
|
15926
15897
|
|
|
15927
15898
|
// src/component/Builder.ts
|
|
15928
15899
|
function Builder(...props) {
|
|
@@ -16324,13 +16295,13 @@ var RenderStack = class _RenderStack extends MultiChildRenderObject_default {
|
|
|
16324
16295
|
let [width, height] = [constraints.minWidth, constraints.minHeight];
|
|
16325
16296
|
let nonPositionedConstraints;
|
|
16326
16297
|
switch (this.fit) {
|
|
16327
|
-
case
|
|
16298
|
+
case stack_fit_default.loose:
|
|
16328
16299
|
nonPositionedConstraints = constraints.loosen();
|
|
16329
16300
|
break;
|
|
16330
|
-
case
|
|
16301
|
+
case stack_fit_default.expand:
|
|
16331
16302
|
nonPositionedConstraints = constraints_default.tight(constraints.biggest);
|
|
16332
16303
|
break;
|
|
16333
|
-
case
|
|
16304
|
+
case stack_fit_default.passthrough:
|
|
16334
16305
|
nonPositionedConstraints = constraints;
|
|
16335
16306
|
break;
|
|
16336
16307
|
}
|
|
@@ -17241,7 +17212,7 @@ var BaseAspectRatio_default = AspectRatio;
|
|
|
17241
17212
|
var AspectRatio_default = classToFunction_default(BaseAspectRatio_default);
|
|
17242
17213
|
|
|
17243
17214
|
// src/component/base/BaseIndexedStack.ts
|
|
17244
|
-
var IndexedStack = class extends
|
|
17215
|
+
var IndexedStack = class extends StatelessWidget_default {
|
|
17245
17216
|
constructor({
|
|
17246
17217
|
children,
|
|
17247
17218
|
index = 0,
|
|
@@ -17249,52 +17220,23 @@ var IndexedStack = class extends BaseStack {
|
|
|
17249
17220
|
alignment,
|
|
17250
17221
|
key
|
|
17251
17222
|
}) {
|
|
17252
|
-
super(
|
|
17223
|
+
super(key);
|
|
17253
17224
|
__publicField(this, "index");
|
|
17225
|
+
__publicField(this, "fit");
|
|
17226
|
+
__publicField(this, "alignment");
|
|
17227
|
+
__publicField(this, "children");
|
|
17254
17228
|
this.index = index;
|
|
17229
|
+
this.fit = sizing;
|
|
17230
|
+
this.alignment = alignment;
|
|
17231
|
+
this.children = children;
|
|
17255
17232
|
}
|
|
17256
|
-
|
|
17257
|
-
return new
|
|
17258
|
-
|
|
17259
|
-
|
|
17260
|
-
|
|
17233
|
+
build() {
|
|
17234
|
+
return new BaseStack({
|
|
17235
|
+
children: this.children.slice(this.index, this.index + 1),
|
|
17236
|
+
alignment: this.alignment,
|
|
17237
|
+
fit: this.fit
|
|
17261
17238
|
});
|
|
17262
17239
|
}
|
|
17263
|
-
updateRenderObject(renderObject) {
|
|
17264
|
-
renderObject.index = this.index;
|
|
17265
|
-
renderObject.fit = this.fit;
|
|
17266
|
-
renderObject.alignment = this.alignment;
|
|
17267
|
-
}
|
|
17268
|
-
};
|
|
17269
|
-
var RenderIndexedStack = class extends RenderStack {
|
|
17270
|
-
constructor({
|
|
17271
|
-
index,
|
|
17272
|
-
fit,
|
|
17273
|
-
alignment
|
|
17274
|
-
}) {
|
|
17275
|
-
super({ alignment, fit });
|
|
17276
|
-
__publicField(this, "_index");
|
|
17277
|
-
this._index = index;
|
|
17278
|
-
}
|
|
17279
|
-
get index() {
|
|
17280
|
-
return this._index;
|
|
17281
|
-
}
|
|
17282
|
-
set index(value) {
|
|
17283
|
-
if (this._index === value)
|
|
17284
|
-
return;
|
|
17285
|
-
this._index = value;
|
|
17286
|
-
this.markNeedsPaint();
|
|
17287
|
-
}
|
|
17288
|
-
paintChildren(context, {
|
|
17289
|
-
clipId,
|
|
17290
|
-
matrix4,
|
|
17291
|
-
opacity
|
|
17292
|
-
}) {
|
|
17293
|
-
this.children.forEach((child2) => child2.dispose(context));
|
|
17294
|
-
const child = this.children[this.index];
|
|
17295
|
-
assert(child != null);
|
|
17296
|
-
child.paint(context, clipId, matrix4, opacity);
|
|
17297
|
-
}
|
|
17298
17240
|
};
|
|
17299
17241
|
var BaseIndexedStack_default = IndexedStack;
|
|
17300
17242
|
|