@triniwiz/nativescript-masonkit 1.0.0-beta.106 → 1.0.0-beta.108
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/common.d.ts +22 -2
- package/common.js +143 -21
- package/common.js.map +1 -1
- package/css-shorthands.js +11 -1
- package/css-shorthands.js.map +1 -1
- package/img/index.ios.js +1 -1
- package/img/index.ios.js.map +1 -1
- package/input/index.ios.js +1 -1
- package/input/index.ios.js.map +1 -1
- package/li/index.ios.js +1 -1
- package/li/index.ios.js.map +1 -1
- package/list/index.ios.js +2 -2
- package/list/index.ios.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/masonkit-release.aar +0 -0
- package/platforms/ios/Mason.xcframework/Info.plist +11 -11
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +7 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +33 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +1779 -1631
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +5 -4
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +5 -4
- package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8713 -8674
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +14 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +33 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +1779 -1631
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +5 -4
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +5 -4
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +1779 -1631
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +5 -4
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +5 -4
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +28 -28
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8708 -8668
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +8310 -8286
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/Mason-Swift.h +7 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/mason_native.h +33 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-xros.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.abi.json +1779 -1631
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.private.swiftinterface +5 -4
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.swiftinterface +5 -4
- package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8204 -8166
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/Mason-Swift.h +7 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/mason_native.h +33 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-xros-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.abi.json +1779 -1631
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.private.swiftinterface +5 -4
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.swiftinterface +5 -4
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/_CodeSignature/CodeResources +16 -16
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8204 -8166
- package/properties.js +86 -0
- package/properties.js.map +1 -1
- package/scroll/index.android.js +3 -1
- package/scroll/index.android.js.map +1 -1
- package/scroll/index.ios.js +5 -2
- package/scroll/index.ios.js.map +1 -1
- package/style.d.ts +29 -6
- package/style.js +257 -216
- package/style.js.map +1 -1
- package/text/index.android.js +9 -2
- package/text/index.android.js.map +1 -1
- package/text/index.ios.js +12 -3
- package/text/index.ios.js.map +1 -1
- package/textarea/index.ios.js +1 -1
- package/textarea/index.ios.js.map +1 -1
- package/view/index.ios.js +1 -0
- package/view/index.ios.js.map +1 -1
package/common.d.ts
CHANGED
|
@@ -229,8 +229,19 @@ export declare class ViewBase extends CustomLayoutView implements AddChildFromBu
|
|
|
229
229
|
_unregisterNativeEvent(arg: string, callback: any, thisArg?: any): void;
|
|
230
230
|
initNativeView(): void;
|
|
231
231
|
_setNativeViewFrame(nativeView: any, frame: CGRect): void;
|
|
232
|
+
/**
|
|
233
|
+
* iOS: the views in this subtree a root's layout pass must visit (non-Mason children, which core
|
|
234
|
+
* lays out, and Mason views listening to layoutChanged). The pass skips subtrees where it's 0.
|
|
235
|
+
*/
|
|
236
|
+
_masonLayoutWork: number;
|
|
237
|
+
private _masonAddLayoutWork;
|
|
238
|
+
private _masonListensToLayout;
|
|
239
|
+
_addViewCore(view: any, atIndex?: number): void;
|
|
240
|
+
_removeViewCore(view: any): void;
|
|
232
241
|
addEventListener(arg: string, callback: any, thisArg?: any): void;
|
|
233
242
|
removeEventListener(arg: string, callback: any, thisArg?: any): void;
|
|
243
|
+
private _addEventListener;
|
|
244
|
+
private _removeEventListener;
|
|
234
245
|
private _applyPseudoClassStyles;
|
|
235
246
|
_hoverHandler(subscribe: boolean): void;
|
|
236
247
|
_handler(subscribe: boolean): void;
|
|
@@ -241,6 +252,7 @@ export declare class ViewBase extends CustomLayoutView implements AddChildFromBu
|
|
|
241
252
|
get _viewChildren(): NSView[];
|
|
242
253
|
eachLayoutChild(callback: (child: NSView, isLast: boolean) => void): void;
|
|
243
254
|
eachChild(callback: (child: NSViewBase) => boolean): void;
|
|
255
|
+
private _eachViewChild;
|
|
244
256
|
/** True for a Mason view whose frame the Mason tree sets natively (iOS). */
|
|
245
257
|
get _masonPlacedNatively(): boolean;
|
|
246
258
|
/** Size a non-Mason child with core's measure: its native view rarely implements sizeThatFits. */
|
|
@@ -251,9 +263,17 @@ export declare class ViewBase extends CustomLayoutView implements AddChildFromBu
|
|
|
251
263
|
* it when its native sizing can't express one. `false` when core should handle it.
|
|
252
264
|
*/
|
|
253
265
|
_setChildPercentSize(child: any, horizontal: boolean, fraction: number | null): boolean;
|
|
266
|
+
/**
|
|
267
|
+
* A native removal relays out natively but runs no core layout pass, so `layoutChanged`
|
|
268
|
+
* and non-Mason descendants miss it. Ask for one; a subtree being torn down is unloaded.
|
|
269
|
+
*/
|
|
270
|
+
_masonRequestLayoutAfterRemoval(): void;
|
|
254
271
|
/** Lay out the non-Mason views in this root's subtree from the frames Mason set. */
|
|
255
272
|
_masonLayoutForeignDescendants(): void;
|
|
273
|
+
private _masonClimbRoot;
|
|
274
|
+
private _masonClimbTurn;
|
|
256
275
|
requestLayout(): void;
|
|
276
|
+
_parentChanged(oldParent: any): void;
|
|
257
277
|
getMeasuredWidth(): number;
|
|
258
278
|
getMeasuredHeight(): number;
|
|
259
279
|
eachChildView(callback: (child: NSView) => boolean): void;
|
|
@@ -401,8 +421,8 @@ export declare class ViewBase extends CustomLayoutView implements AddChildFromBu
|
|
|
401
421
|
get flexFlowProperty(): "row nowrap" | "row wrap" | "row wrap-reverse" | "row-reverse nowrap" | "row-reverse wrap" | "row-reverse wrap-reverse" | "column nowrap" | "column wrap" | "column wrap-reverse" | "column-reverse nowrap" | "column-reverse wrap" | "column-reverse wrap-reverse";
|
|
402
422
|
set inset(value: LengthAuto);
|
|
403
423
|
get inset(): LengthAuto;
|
|
404
|
-
set textOverFlow(value:
|
|
405
|
-
get textOverFlow():
|
|
424
|
+
set textOverFlow(value: CoreTypes.TextOverflowType);
|
|
425
|
+
get textOverFlow(): CoreTypes.TextOverflowType;
|
|
406
426
|
}
|
|
407
427
|
export declare class TextBase extends ViewBase {
|
|
408
428
|
[fontInternalProperty.setNative]: (value: any) => void;
|
package/common.js
CHANGED
|
@@ -212,6 +212,19 @@ function clearWindowsActive(view) {
|
|
|
212
212
|
const TEARDOWN_SLICE_MS = 8;
|
|
213
213
|
// Reading the clock costs more than a teardown on some devices.
|
|
214
214
|
const TEARDOWNS_PER_CLOCK_READ = 16;
|
|
215
|
+
// Mason roots whose requestLayout already climbed to the page in this turn.
|
|
216
|
+
let climbedRoots = null;
|
|
217
|
+
function markClimbed(root) {
|
|
218
|
+
if (!climbedRoots) {
|
|
219
|
+
climbedRoots = new Set();
|
|
220
|
+
queueMicrotask(() => (climbedRoots = null));
|
|
221
|
+
}
|
|
222
|
+
climbedRoots.add(root);
|
|
223
|
+
}
|
|
224
|
+
// A layout in between clears core's flag, so the next request climbs again.
|
|
225
|
+
function climbedThisTurn(root) {
|
|
226
|
+
return !!climbedRoots?.has(root) && !!root.isLayoutRequested;
|
|
227
|
+
}
|
|
215
228
|
export class ViewBase extends CustomLayoutView {
|
|
216
229
|
_tearDownUI(force) {
|
|
217
230
|
if ((__ANDROID__ || __APPLE__ || __WINDOWS__) && !force && !this.reusable && this._context && this.nativeViewProtected) {
|
|
@@ -314,6 +327,12 @@ export class ViewBase extends CustomLayoutView {
|
|
|
314
327
|
this[_c] = false;
|
|
315
328
|
this[_d] = {};
|
|
316
329
|
this._pendingEventsRegistration = [];
|
|
330
|
+
/**
|
|
331
|
+
* iOS: the views in this subtree a root's layout pass must visit (non-Mason children, which core
|
|
332
|
+
* lays out, and Mason views listening to layoutChanged). The pass skips subtrees where it's 0.
|
|
333
|
+
*/
|
|
334
|
+
this._masonLayoutWork = 0;
|
|
335
|
+
this._masonClimbTurn = null;
|
|
317
336
|
// `width`/`height` are core CssAnimationProperties whose stylesheet accessor
|
|
318
337
|
// is non-configurable, so units Mason understands but core does not (`vh`,
|
|
319
338
|
// `rem`, `pt`, …) have to be resolved on this view's own Style object.
|
|
@@ -382,7 +401,13 @@ export class ViewBase extends CustomLayoutView {
|
|
|
382
401
|
}
|
|
383
402
|
if (!nativeHit)
|
|
384
403
|
return null;
|
|
385
|
-
|
|
404
|
+
const known = nativeOwnerFor(nativeHit);
|
|
405
|
+
if (known)
|
|
406
|
+
return known;
|
|
407
|
+
// Owners are remembered on first hit rather than for every view at init.
|
|
408
|
+
const found = findOwnerForNativeView(this, nativeHit);
|
|
409
|
+
found?._rememberNativeOwner?.(nativeHit);
|
|
410
|
+
return found;
|
|
386
411
|
}
|
|
387
412
|
_registerNativeEvent(arg, callback, thisArg) {
|
|
388
413
|
if (!this[native_]) {
|
|
@@ -519,7 +544,6 @@ export class ViewBase extends CustomLayoutView {
|
|
|
519
544
|
}
|
|
520
545
|
initNativeView() {
|
|
521
546
|
super.initNativeView();
|
|
522
|
-
this._rememberNativeOwner();
|
|
523
547
|
if (this._pendingEventsRegistration.length > 0) {
|
|
524
548
|
const pending = this._pendingEventsRegistration.splice(0);
|
|
525
549
|
for (const registration of pending) {
|
|
@@ -530,7 +554,50 @@ export class ViewBase extends CustomLayoutView {
|
|
|
530
554
|
_setNativeViewFrame(nativeView, frame) {
|
|
531
555
|
// nativeView.frame = frame;
|
|
532
556
|
}
|
|
557
|
+
_masonAddLayoutWork(delta) {
|
|
558
|
+
// Up to the root: a non-Mason parent is laid out by core and its Mason roots keep their own count.
|
|
559
|
+
let view = this;
|
|
560
|
+
while (view?.[isMasonView_]) {
|
|
561
|
+
view._masonLayoutWork += delta;
|
|
562
|
+
view = view.parent;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
_masonListensToLayout() {
|
|
566
|
+
return this.hasListeners(NSView.layoutChangedEvent);
|
|
567
|
+
}
|
|
568
|
+
_addViewCore(view, atIndex) {
|
|
569
|
+
// Before setup: listeners the child gains while loading add themselves through `parent`.
|
|
570
|
+
if (__APPLE__) {
|
|
571
|
+
const work = view?.[isMasonView_] ? view._masonLayoutWork : 1;
|
|
572
|
+
if (work)
|
|
573
|
+
this._masonAddLayoutWork(work);
|
|
574
|
+
}
|
|
575
|
+
// @ts-ignore
|
|
576
|
+
super._addViewCore(view, atIndex);
|
|
577
|
+
}
|
|
578
|
+
_removeViewCore(view) {
|
|
579
|
+
// @ts-ignore
|
|
580
|
+
super._removeViewCore(view);
|
|
581
|
+
// After teardown: listeners removed while unloading already subtracted themselves.
|
|
582
|
+
if (__APPLE__) {
|
|
583
|
+
const work = view?.[isMasonView_] ? view._masonLayoutWork : 1;
|
|
584
|
+
if (work)
|
|
585
|
+
this._masonAddLayoutWork(-work);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
533
588
|
addEventListener(arg, callback, thisArg) {
|
|
589
|
+
const listened = __APPLE__ && this._masonListensToLayout();
|
|
590
|
+
this._addEventListener(arg, callback, thisArg);
|
|
591
|
+
if (__APPLE__ && !listened && this._masonListensToLayout())
|
|
592
|
+
this._masonAddLayoutWork(1);
|
|
593
|
+
}
|
|
594
|
+
removeEventListener(arg, callback, thisArg) {
|
|
595
|
+
const listened = __APPLE__ && this._masonListensToLayout();
|
|
596
|
+
this._removeEventListener(arg, callback, thisArg);
|
|
597
|
+
if (__APPLE__ && listened && !this._masonListensToLayout())
|
|
598
|
+
this._masonAddLayoutWork(-1);
|
|
599
|
+
}
|
|
600
|
+
_addEventListener(arg, callback, thisArg) {
|
|
534
601
|
if (typeof thisArg === 'boolean') {
|
|
535
602
|
thisArg = {
|
|
536
603
|
capture: thisArg,
|
|
@@ -548,7 +615,7 @@ export class ViewBase extends CustomLayoutView {
|
|
|
548
615
|
}
|
|
549
616
|
super.addEventListener(arg, callback, thisArg);
|
|
550
617
|
}
|
|
551
|
-
|
|
618
|
+
_removeEventListener(arg, callback, thisArg) {
|
|
552
619
|
if (typeof thisArg === 'boolean') {
|
|
553
620
|
thisArg = {
|
|
554
621
|
capture: thisArg,
|
|
@@ -644,8 +711,16 @@ export class ViewBase extends CustomLayoutView {
|
|
|
644
711
|
}
|
|
645
712
|
}
|
|
646
713
|
eachChild(callback) {
|
|
647
|
-
|
|
648
|
-
|
|
714
|
+
this._eachViewChild(callback);
|
|
715
|
+
}
|
|
716
|
+
// Live and allocation-free, like core's LayoutBase.eachChildView (walks run per view).
|
|
717
|
+
_eachViewChild(callback) {
|
|
718
|
+
const children = this._children;
|
|
719
|
+
for (let i = 0, length = children.length; i < length; i++) {
|
|
720
|
+
const child = children[i];
|
|
721
|
+
if (child && !child[isPlaceholder_] && child instanceof NSView) {
|
|
722
|
+
callback(child);
|
|
723
|
+
}
|
|
649
724
|
}
|
|
650
725
|
}
|
|
651
726
|
// Core's iOS requestLayout climbs to the Page and re-measures the whole tree in JS.
|
|
@@ -714,6 +789,14 @@ export class ViewBase extends CustomLayoutView {
|
|
|
714
789
|
}
|
|
715
790
|
return true;
|
|
716
791
|
}
|
|
792
|
+
/**
|
|
793
|
+
* A native removal relays out natively but runs no core layout pass, so `layoutChanged`
|
|
794
|
+
* and non-Mason descendants miss it. Ask for one; a subtree being torn down is unloaded.
|
|
795
|
+
*/
|
|
796
|
+
_masonRequestLayoutAfterRemoval() {
|
|
797
|
+
if (__APPLE__ && this.isLoaded)
|
|
798
|
+
this.requestLayout();
|
|
799
|
+
}
|
|
717
800
|
/** Lay out the non-Mason views in this root's subtree from the frames Mason set. */
|
|
718
801
|
_masonLayoutForeignDescendants() {
|
|
719
802
|
if (!__APPLE__)
|
|
@@ -721,6 +804,8 @@ export class ViewBase extends CustomLayoutView {
|
|
|
721
804
|
const visit = (view) => {
|
|
722
805
|
view.eachChildView((child) => {
|
|
723
806
|
if (child[isMasonView_]) {
|
|
807
|
+
if (!(child._masonLayoutWork > 0))
|
|
808
|
+
return true;
|
|
724
809
|
// Keep `layoutChanged` working for the few views that listen to it.
|
|
725
810
|
if (child.hasListeners?.(NSView.layoutChangedEvent)) {
|
|
726
811
|
const b = child._getCurrentLayoutBounds();
|
|
@@ -746,13 +831,29 @@ export class ViewBase extends CustomLayoutView {
|
|
|
746
831
|
// A natively placed view only needs its Mason root re-measured: skip the
|
|
747
832
|
// per-ancestor hops (each a JS call plus a native setNeedsLayout).
|
|
748
833
|
if (this._masonPlacedNatively) {
|
|
834
|
+
// CSS asks once per layout property; reuse this turn's root while it is still flagged.
|
|
835
|
+
if (climbedRoots && this._masonClimbTurn === climbedRoots && climbedThisTurn(this._masonClimbRoot))
|
|
836
|
+
return;
|
|
749
837
|
let root = this.parent;
|
|
750
838
|
while (root?.parent?.[isMasonView_])
|
|
751
839
|
root = root.parent;
|
|
752
|
-
root
|
|
840
|
+
if (root && !climbedThisTurn(root))
|
|
841
|
+
root.requestLayout();
|
|
842
|
+
this._masonClimbRoot = root;
|
|
843
|
+
this._masonClimbTurn = climbedRoots;
|
|
753
844
|
return;
|
|
754
845
|
}
|
|
846
|
+
// Core climbs on every call, once per changed property; once per turn is enough.
|
|
847
|
+
if (__APPLE__ && climbedThisTurn(this))
|
|
848
|
+
return;
|
|
755
849
|
super.requestLayout();
|
|
850
|
+
if (__APPLE__)
|
|
851
|
+
markClimbed(this);
|
|
852
|
+
}
|
|
853
|
+
_parentChanged(oldParent) {
|
|
854
|
+
climbedRoots?.delete(this);
|
|
855
|
+
this._masonClimbTurn = null;
|
|
856
|
+
super._parentChanged(oldParent);
|
|
756
857
|
}
|
|
757
858
|
getMeasuredWidth() {
|
|
758
859
|
if (this._masonPlacedNatively && this.nativeViewProtected) {
|
|
@@ -767,24 +868,37 @@ export class ViewBase extends CustomLayoutView {
|
|
|
767
868
|
return super.getMeasuredHeight();
|
|
768
869
|
}
|
|
769
870
|
eachChildView(callback) {
|
|
770
|
-
|
|
771
|
-
callback(view);
|
|
772
|
-
}
|
|
871
|
+
this._eachViewChild(callback);
|
|
773
872
|
}
|
|
774
873
|
_addChildFromBuilder(name, value) {
|
|
775
874
|
this.addChild(value);
|
|
776
875
|
}
|
|
777
876
|
getChildrenCount() {
|
|
778
|
-
|
|
877
|
+
let count = 0;
|
|
878
|
+
this._eachViewChild(() => count++);
|
|
879
|
+
return count;
|
|
779
880
|
}
|
|
780
881
|
get _childrenCount() {
|
|
781
|
-
return this.
|
|
882
|
+
return this.getChildrenCount();
|
|
782
883
|
}
|
|
783
884
|
getChildAt(index) {
|
|
784
|
-
|
|
885
|
+
let found;
|
|
886
|
+
let i = 0;
|
|
887
|
+
this._eachViewChild((child) => {
|
|
888
|
+
if (i++ === index)
|
|
889
|
+
found = child;
|
|
890
|
+
});
|
|
891
|
+
return found;
|
|
785
892
|
}
|
|
786
893
|
getChildIndex(child) {
|
|
787
|
-
|
|
894
|
+
let index = -1;
|
|
895
|
+
let i = 0;
|
|
896
|
+
this._eachViewChild((c) => {
|
|
897
|
+
if (c === child && index === -1)
|
|
898
|
+
index = i;
|
|
899
|
+
i++;
|
|
900
|
+
});
|
|
901
|
+
return index;
|
|
788
902
|
}
|
|
789
903
|
getChildById(id) {
|
|
790
904
|
return getViewById(this, id);
|
|
@@ -1582,7 +1696,7 @@ export class ViewBase extends CustomLayoutView {
|
|
|
1582
1696
|
_nativeBorderRadiusCorners() {
|
|
1583
1697
|
// @ts-ignore
|
|
1584
1698
|
const style = this._styleHelper;
|
|
1585
|
-
if (__ANDROID__ && style && !style.hasBorderRadius()) {
|
|
1699
|
+
if ((__ANDROID__ || __APPLE__) && style && !style.hasBorderRadius()) {
|
|
1586
1700
|
return borderRadiusCorners('0');
|
|
1587
1701
|
}
|
|
1588
1702
|
const native = String(style?.borderRadius ?? '').trim();
|
|
@@ -1606,13 +1720,18 @@ export class ViewBase extends CustomLayoutView {
|
|
|
1606
1720
|
const css = lengthToCssString(masonLength(value));
|
|
1607
1721
|
const radius = (corners[corner] = /\s/.test(css) ? parseCornerRadius(css) : [css, css]);
|
|
1608
1722
|
const shorthand = composeBorderRadius(corners);
|
|
1609
|
-
if (__ANDROID__ && style._writeCornerRadius(corner, radius, shorthand)) {
|
|
1723
|
+
if ((__ANDROID__ || __APPLE__) && style._writeCornerRadius(corner, radius, shorthand)) {
|
|
1610
1724
|
return;
|
|
1611
1725
|
}
|
|
1612
1726
|
// @ts-ignore
|
|
1613
1727
|
style.borderRadius = shorthand;
|
|
1614
1728
|
}
|
|
1615
1729
|
_nativeCornerRadius(corner) {
|
|
1730
|
+
// @ts-ignore
|
|
1731
|
+
const style = this._styleHelper;
|
|
1732
|
+
if ((__ANDROID__ || __APPLE__) && style && !style.hasBorderRadius()) {
|
|
1733
|
+
return '0';
|
|
1734
|
+
}
|
|
1616
1735
|
const [h, v] = this._nativeBorderRadiusCorners()[corner];
|
|
1617
1736
|
return h === v ? h : `${h} ${v}`;
|
|
1618
1737
|
}
|
|
@@ -1641,7 +1760,7 @@ export class ViewBase extends CustomLayoutView {
|
|
|
1641
1760
|
this._borderRadiusCorner(3, value);
|
|
1642
1761
|
}
|
|
1643
1762
|
_borderSideColor(side, value) {
|
|
1644
|
-
if (__ANDROID__) {
|
|
1763
|
+
if (__ANDROID__ || __APPLE__) {
|
|
1645
1764
|
const s = this._styleHelper;
|
|
1646
1765
|
if (s) {
|
|
1647
1766
|
s.setBorderSideColor(side === 't' ? 'top' : side === 'r' ? 'right' : side === 'b' ? 'bottom' : 'left', value);
|
|
@@ -1854,8 +1973,12 @@ export class ViewBase extends CustomLayoutView {
|
|
|
1854
1973
|
nodeHelper().setBorderColor(this.nativeView, String(value));
|
|
1855
1974
|
}
|
|
1856
1975
|
else if (__APPLE__) {
|
|
1976
|
+
const s = this._styleHelper;
|
|
1977
|
+
if (s)
|
|
1978
|
+
s.setBorderColor(String(value));
|
|
1857
1979
|
// @ts-ignore
|
|
1858
|
-
|
|
1980
|
+
else
|
|
1981
|
+
this.nativeView.style.setBorderColor(String(value));
|
|
1859
1982
|
}
|
|
1860
1983
|
else if (__WINDOWS__) {
|
|
1861
1984
|
// @ts-ignore
|
|
@@ -2564,17 +2687,16 @@ export class ViewBase extends CustomLayoutView {
|
|
|
2564
2687
|
return this.style.inset;
|
|
2565
2688
|
}
|
|
2566
2689
|
set textOverFlow(value) {
|
|
2567
|
-
this.style.
|
|
2690
|
+
this.style.textOverflow = value;
|
|
2568
2691
|
}
|
|
2569
2692
|
get textOverFlow() {
|
|
2570
|
-
return this.style.
|
|
2693
|
+
return this.style.textOverflow;
|
|
2571
2694
|
}
|
|
2572
2695
|
[textOverFlowProperty.setNative](value) {
|
|
2573
2696
|
// @ts-ignore
|
|
2574
2697
|
const style = this._styleHelper;
|
|
2575
2698
|
if (style) {
|
|
2576
|
-
|
|
2577
|
-
style.textOverFlow = value;
|
|
2699
|
+
style.textOverflow = value;
|
|
2578
2700
|
}
|
|
2579
2701
|
}
|
|
2580
2702
|
[clearProperty.setNative](value) {
|