uicore-ts 1.1.310 → 1.1.312
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/compiledScripts/UILayoutDebugger.d.ts +393 -0
- package/compiledScripts/UILayoutDebugger.js +2535 -0
- package/compiledScripts/UILayoutDebugger.js.map +7 -0
- package/compiledScripts/UIView.d.ts +32 -0
- package/compiledScripts/UIView.js +33 -8
- package/compiledScripts/UIView.js.map +2 -2
- package/compiledScripts/UIViewController.js +8 -2
- package/compiledScripts/UIViewController.js.map +2 -2
- package/package.json +1 -1
- package/scripts/UILayoutDebugger.ts +3252 -0
- package/scripts/UIView.ts +75 -1
- package/scripts/UIViewController.ts +9 -2
|
@@ -1121,7 +1121,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1121
1121
|
});
|
|
1122
1122
|
}
|
|
1123
1123
|
static layoutViewsIfNeeded() {
|
|
1124
|
-
var _a, _b, _c, _d;
|
|
1124
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
1125
1125
|
if (!_UIView._isLayoutViewsIfNeededScheduled) {
|
|
1126
1126
|
_UIView.scheduleLayoutViewsIfNeeded();
|
|
1127
1127
|
}
|
|
@@ -1129,11 +1129,13 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1129
1129
|
return;
|
|
1130
1130
|
}
|
|
1131
1131
|
(_a = window.UILayoutCycleTracer) == null ? void 0 : _a.willBeginLayoutPass();
|
|
1132
|
+
(_b = window.UILayoutDebugger) == null ? void 0 : _b.willBeginLayoutPass(_UIView._viewsToLayout);
|
|
1132
1133
|
const maxIterations = 10;
|
|
1133
1134
|
let iteration = 0;
|
|
1134
1135
|
const layoutCounts = /* @__PURE__ */ new Map();
|
|
1135
1136
|
while (_UIView._viewsToLayout.length > 0 && iteration < maxIterations) {
|
|
1136
|
-
(
|
|
1137
|
+
(_c = window.UILayoutCycleTracer) == null ? void 0 : _c.willBeginIteration(iteration);
|
|
1138
|
+
(_d = window.UILayoutDebugger) == null ? void 0 : _d.willBeginIteration(iteration);
|
|
1137
1139
|
const viewsToProcess = _UIView._viewsToLayout;
|
|
1138
1140
|
_UIView._viewsToLayout = [];
|
|
1139
1141
|
const viewDepthMap = /* @__PURE__ */ new Map();
|
|
@@ -1154,16 +1156,22 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1154
1156
|
});
|
|
1155
1157
|
for (let i = 0; i < sortedViews.length; i++) {
|
|
1156
1158
|
const view = sortedViews[i];
|
|
1159
|
+
(_e = window.UILayoutDebugger) == null ? void 0 : _e.willLayoutView(view);
|
|
1160
|
+
if ((_f = window.UILayoutDebugger) == null ? void 0 : _f._shouldHitBreakpoint(view)) {
|
|
1161
|
+
const breakpointOnThisLine = "Add a breakpoint on this line to step through layout.";
|
|
1162
|
+
}
|
|
1157
1163
|
view.layoutIfNeeded();
|
|
1158
1164
|
layoutCounts.set(view, (layoutCounts.get(view) || 0) + 1);
|
|
1159
|
-
(
|
|
1165
|
+
(_g = window.UILayoutCycleTracer) == null ? void 0 : _g.didLayoutView(view);
|
|
1166
|
+
(_h = window.UILayoutDebugger) == null ? void 0 : _h.didLayoutView(view);
|
|
1160
1167
|
}
|
|
1161
1168
|
iteration++;
|
|
1162
1169
|
}
|
|
1163
|
-
(
|
|
1170
|
+
(_i = window.UILayoutCycleTracer) == null ? void 0 : _i.didFinishLayoutPass(iteration);
|
|
1171
|
+
(_j = window.UILayoutDebugger) == null ? void 0 : _j.didFinishLayoutPass(iteration);
|
|
1164
1172
|
}
|
|
1165
1173
|
setNeedsLayout() {
|
|
1166
|
-
var _a;
|
|
1174
|
+
var _a, _b;
|
|
1167
1175
|
if (this._shouldLayout && _UIView._viewsToLayout.contains(this)) {
|
|
1168
1176
|
return;
|
|
1169
1177
|
}
|
|
@@ -1171,6 +1179,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1171
1179
|
_UIView._viewsToLayout.push(this);
|
|
1172
1180
|
this.clearIntrinsicSizeCache();
|
|
1173
1181
|
(_a = window.UILayoutCycleTracer) == null ? void 0 : _a.viewDidCallSetNeedsLayout(this);
|
|
1182
|
+
(_b = window.UILayoutDebugger) == null ? void 0 : _b.viewDidCallSetNeedsLayout(this);
|
|
1174
1183
|
if (!_UIView._isLayoutViewsIfNeededScheduled) {
|
|
1175
1184
|
_UIView.scheduleLayoutViewsIfNeeded();
|
|
1176
1185
|
}
|
|
@@ -1186,7 +1195,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1186
1195
|
this._shouldLayout = import_UIObject.NO;
|
|
1187
1196
|
}
|
|
1188
1197
|
try {
|
|
1189
|
-
if (this.bounds.width < 0) {
|
|
1198
|
+
if (this.bounds.width < 0 || !this.isVirtualLayouting && !this.isMemberOfViewTree) {
|
|
1190
1199
|
return;
|
|
1191
1200
|
}
|
|
1192
1201
|
this.layoutSubviews();
|
|
@@ -1195,7 +1204,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1195
1204
|
}
|
|
1196
1205
|
}
|
|
1197
1206
|
layoutSubviews() {
|
|
1198
|
-
var _a, _b, _c, _d;
|
|
1207
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1199
1208
|
this.willLayoutSubviews();
|
|
1200
1209
|
if (!this.isVirtualLayouting) {
|
|
1201
1210
|
this._shouldLayout = import_UIObject.NO;
|
|
@@ -1206,10 +1215,12 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1206
1215
|
(_b = this._updateLayoutFunction) == null ? void 0 : _b.call(this);
|
|
1207
1216
|
(_c = this.viewController) == null ? void 0 : _c.layoutViewSubviews();
|
|
1208
1217
|
this.applyClassesAndStyles();
|
|
1209
|
-
|
|
1218
|
+
(_d = window.UILayoutDebugger) == null ? void 0 : _d.willSetSubviewFrames(this);
|
|
1219
|
+
for (let i = 0; i < ((_e = this.subviews) == null ? void 0 : _e.length); i++) {
|
|
1210
1220
|
const subview = this.subviews[i];
|
|
1211
1221
|
subview.calculateAndSetViewFrame();
|
|
1212
1222
|
}
|
|
1223
|
+
(_f = window.UILayoutDebugger) == null ? void 0 : _f.didSetSubviewFrames(this);
|
|
1213
1224
|
this.didLayoutSubviews();
|
|
1214
1225
|
if (this._overlayView) {
|
|
1215
1226
|
this._overlayView.weakFrame = this.bounds;
|
|
@@ -2571,6 +2582,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
2571
2582
|
return this._intrinsicSizesCache[cacheKey];
|
|
2572
2583
|
}
|
|
2573
2584
|
_setCachedIntrinsicSize(cacheKey, size) {
|
|
2585
|
+
var _a, _b;
|
|
2574
2586
|
if (this.sharedIntrinsicSizeCacheIdentifier) {
|
|
2575
2587
|
let bucket = _UIView._sharedIntrinsicSizeCaches.get(
|
|
2576
2588
|
this.sharedIntrinsicSizeCacheIdentifier
|
|
@@ -2580,9 +2592,11 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
2580
2592
|
_UIView._sharedIntrinsicSizeCaches.set(this.sharedIntrinsicSizeCacheIdentifier, bucket);
|
|
2581
2593
|
}
|
|
2582
2594
|
bucket[cacheKey] = size.copy();
|
|
2595
|
+
(_a = window.UILayoutDebugger) == null ? void 0 : _a.didSetCachedIntrinsicSize(this, cacheKey, size);
|
|
2583
2596
|
return;
|
|
2584
2597
|
}
|
|
2585
2598
|
this._intrinsicSizesCache[cacheKey] = size.copy();
|
|
2599
|
+
(_b = window.UILayoutDebugger) == null ? void 0 : _b.didSetCachedIntrinsicSize(this, cacheKey, size);
|
|
2586
2600
|
}
|
|
2587
2601
|
clearIntrinsicSizeCache() {
|
|
2588
2602
|
var _a;
|
|
@@ -2749,6 +2763,17 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
2749
2763
|
}
|
|
2750
2764
|
return import_UIObject.nil;
|
|
2751
2765
|
}
|
|
2766
|
+
performForcedSubtreeLayout() {
|
|
2767
|
+
import_UITextMeasurement.UITextMeasurement.clearCaches();
|
|
2768
|
+
_UIView.invalidateAllSharedIntrinsicSizeCaches();
|
|
2769
|
+
this.forEachViewInSubtree((view) => {
|
|
2770
|
+
view._intrinsicSizesCache = {};
|
|
2771
|
+
view._frameCache = void 0;
|
|
2772
|
+
view._frameCacheForVirtualLayouting = void 0;
|
|
2773
|
+
view.setNeedsLayout();
|
|
2774
|
+
});
|
|
2775
|
+
_UIView.layoutViewsIfNeeded();
|
|
2776
|
+
}
|
|
2752
2777
|
};
|
|
2753
2778
|
let UIView = _UIView;
|
|
2754
2779
|
UIView._UIViewIndex = -1;
|