@triniwiz/nativescript-masonkit 1.0.0-beta.87 → 1.0.0-beta.88
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/DOCS.md +16 -4
- package/angular/README.md +204 -0
- package/angular/fesm2022/triniwiz-nativescript-masonkit-angular.mjs +496 -0
- package/angular/fesm2022/triniwiz-nativescript-masonkit-angular.mjs.map +1 -0
- package/angular/package.json +19 -0
- package/angular/types/triniwiz-nativescript-masonkit-angular.d.ts +181 -0
- package/button/index.android.d.ts +2 -1
- package/button/index.ios.d.ts +2 -1
- package/button/index.windows.d.ts +2 -1
- package/common.d.ts +102 -1
- package/common.js +93 -2
- package/common.js.map +1 -1
- package/img/index.android.d.ts +2 -1
- package/img/index.ios.d.ts +2 -1
- package/img/index.windows.d.ts +2 -1
- package/index.d.ts +21 -10
- package/input/index.android.d.ts +5 -1
- package/input/index.ios.d.ts +7 -1
- package/input/index.windows.d.ts +6 -1
- package/package.json +3 -1
- package/platforms/android/masonkit-release.aar +0 -0
- package/platforms/ios/Mason.xcframework/Info.plist +2 -36
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +26 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +27 -2
- 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 +2630 -979
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +37 -1
- 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 +37 -1
- 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 +8457 -8378
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +52 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +27 -2
- 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 +2630 -979
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +37 -1
- 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 +37 -1
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +2630 -979
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +37 -1
- 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 +37 -1
- 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 +8452 -8373
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +8090 -8017
- package/platforms/windows/arm64/NativeScript.Mason.dll +0 -0
- package/platforms/windows/arm64/NativeScript.Mason.winmd +0 -0
- package/platforms/windows/x64/NativeScript.Mason.dll +0 -0
- package/platforms/windows/x64/NativeScript.Mason.winmd +0 -0
- package/properties.d.ts +4 -0
- package/properties.js +58 -15
- package/properties.js.map +1 -1
- package/style.d.ts +37 -37
- package/style.js +299 -110
- package/style.js.map +1 -1
- package/text/index.android.d.ts +3 -1
- package/text/index.ios.d.ts +3 -1
- package/text/index.windows.d.ts +2 -1
- package/textarea/index.android.d.ts +6 -2
- package/textarea/index.ios.d.ts +6 -2
- package/textarea/index.windows.d.ts +6 -2
- package/utils/index.android.d.ts +15 -6
- package/utils/index.android.js +83 -2
- package/utils/index.android.js.map +1 -1
- package/utils/index.ios.d.ts +15 -6
- package/utils/index.ios.js +83 -2
- package/utils/index.ios.js.map +1 -1
- package/utils/index.windows.d.ts +11 -2
- package/utils/index.windows.js +9 -0
- package/utils/index.windows.js.map +1 -1
- package/view/index.ios.js +14 -1
- package/view/index.ios.js.map +1 -1
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/Mason-Swift.h +0 -1982
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/Mason.h +0 -25
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/mason_native.h +0 -499
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Info.plist +0 -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 +0 -98937
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.private.swiftinterface +0 -3475
- 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 +0 -3475
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/module.modulemap +0 -10
- package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Info.plist +0 -20
- 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 +0 -2134
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/Mason-Swift.h +0 -1982
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/Mason.h +0 -25
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/mason_native.h +0 -499
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Info.plist +0 -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 +0 -98937
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.private.swiftinterface +0 -3475
- 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 +0 -3475
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/module.modulemap +0 -10
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/_CodeSignature/CodeResources +0 -212
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Info.plist +0 -20
- 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 +0 -2134
package/style.js
CHANGED
|
@@ -256,7 +256,7 @@ function windowsSetGrid(nativeView, field, value) {
|
|
|
256
256
|
}
|
|
257
257
|
catch (_) { }
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function parseDimension(type, value) {
|
|
260
260
|
switch (type) {
|
|
261
261
|
case 0:
|
|
262
262
|
return 'auto';
|
|
@@ -264,8 +264,79 @@ function parseLengthPercentageAuto(type, value) {
|
|
|
264
264
|
return { value, unit: 'px' };
|
|
265
265
|
case 2:
|
|
266
266
|
return { value, unit: '%' };
|
|
267
|
+
case 3:
|
|
268
|
+
return 'min-content';
|
|
269
|
+
case 4:
|
|
270
|
+
return 'max-content';
|
|
271
|
+
case 5:
|
|
272
|
+
return 'fit-content';
|
|
273
|
+
case 6:
|
|
274
|
+
return `fit-content(${value}px)`;
|
|
275
|
+
case 7:
|
|
276
|
+
return `fit-content(${value}%)`;
|
|
277
|
+
case 8:
|
|
278
|
+
return 'stretch';
|
|
279
|
+
case 9:
|
|
280
|
+
return 'content';
|
|
267
281
|
}
|
|
268
282
|
}
|
|
283
|
+
function parseLengthPercentageAuto(type, value) {
|
|
284
|
+
return parseDimension(type, value);
|
|
285
|
+
}
|
|
286
|
+
function dimensionFromString(value) {
|
|
287
|
+
const t = value.trim();
|
|
288
|
+
if (t === '' || t === 'auto') {
|
|
289
|
+
return { type: 0, value: 0 };
|
|
290
|
+
}
|
|
291
|
+
switch (t) {
|
|
292
|
+
case 'min-content':
|
|
293
|
+
return { type: 3, value: 0 };
|
|
294
|
+
case 'max-content':
|
|
295
|
+
return { type: 4, value: 0 };
|
|
296
|
+
case 'fit-content':
|
|
297
|
+
return { type: 5, value: 0 };
|
|
298
|
+
case 'stretch':
|
|
299
|
+
return { type: 8, value: 0 };
|
|
300
|
+
case 'content':
|
|
301
|
+
return { type: 9, value: 0 };
|
|
302
|
+
}
|
|
303
|
+
if (t.startsWith('fit-content(') && t.endsWith(')')) {
|
|
304
|
+
const limit = t.slice('fit-content('.length, -1).trim();
|
|
305
|
+
if (limit.endsWith('%')) {
|
|
306
|
+
// taffy percentages are a [0.0, 1.0] fraction, not [0.0, 100.0]
|
|
307
|
+
return { type: 7, value: (parseFloat(limit) || 0) / 100 };
|
|
308
|
+
}
|
|
309
|
+
const n = parseFloat(limit) || 0;
|
|
310
|
+
return { type: 6, value: limit.endsWith('px') ? n : layout.toDevicePixels(n) };
|
|
311
|
+
}
|
|
312
|
+
if (t.endsWith('%')) {
|
|
313
|
+
// percentages are stored as a [0.0, 1.0] fraction, not percentage points
|
|
314
|
+
return { type: 2, value: (parseFloat(t) || 0) / 100 };
|
|
315
|
+
}
|
|
316
|
+
const n = parseFloat(t) || 0;
|
|
317
|
+
return { type: 1, value: t.endsWith('px') ? n : layout.toDevicePixels(n) };
|
|
318
|
+
}
|
|
319
|
+
// Shared parser for LengthPercentageAuto props (min/max width/height, margin, inset)
|
|
320
|
+
function lengthPercentageAutoFromString(value) {
|
|
321
|
+
const t = value.trim();
|
|
322
|
+
if (t === '' || t === 'auto') {
|
|
323
|
+
return { type: 0, value: 0 };
|
|
324
|
+
}
|
|
325
|
+
if (t.endsWith('%')) {
|
|
326
|
+
return { type: 2, value: (parseFloat(t) || 0) / 100 };
|
|
327
|
+
}
|
|
328
|
+
const n = parseFloat(t) || 0;
|
|
329
|
+
return { type: 1, value: t.endsWith('px') ? n : layout.toDevicePixels(n) };
|
|
330
|
+
}
|
|
331
|
+
// Same as lengthPercentageAutoFromString but for padding (no "auto", type 0/1 swapped)
|
|
332
|
+
function lengthPercentageFromString(value) {
|
|
333
|
+
const t = value.trim();
|
|
334
|
+
if (t.endsWith('%')) {
|
|
335
|
+
return { type: 1, value: (parseFloat(t) || 0) / 100 };
|
|
336
|
+
}
|
|
337
|
+
const n = parseFloat(t) || 0;
|
|
338
|
+
return { type: 0, value: t.endsWith('px') ? n : layout.toDevicePixels(n) };
|
|
339
|
+
}
|
|
269
340
|
function parseLengthPercentage(type, value) {
|
|
270
341
|
switch (type) {
|
|
271
342
|
case 0:
|
|
@@ -403,6 +474,25 @@ const splitBigIntToInt64Parts = (value) => {
|
|
|
403
474
|
}
|
|
404
475
|
return [lowSigned.toString(), HIGH.toString()];
|
|
405
476
|
};
|
|
477
|
+
// Android-only fast path for syncStyle(): splits the 128-bit dirty mask into
|
|
478
|
+
// four signed 32-bit words instead of two 64-bit decimal strings. Plain JS
|
|
479
|
+
// `number` <-> Java `int` marshalling is a completely standard, unambiguous
|
|
480
|
+
// {N} bridge path; encoding as decimal strings instead forced the receiving
|
|
481
|
+
// side (Element.syncStyle(String,String)) through Long.parseUnsignedLong with
|
|
482
|
+
// a BigInteger fallback on every single style write. Recombined bit-exactly
|
|
483
|
+
// on the Kotlin side via (high32 << 32) | (low32 & 0xffffffff) - see
|
|
484
|
+
// Element.syncStyleParts.
|
|
485
|
+
const splitBigIntToInt32Parts = (value) => {
|
|
486
|
+
const MASK64 = (1n << 64n) - 1n;
|
|
487
|
+
const MASK32 = 0xffffffffn;
|
|
488
|
+
const LOW = value & MASK64;
|
|
489
|
+
const HIGH = (value >> 64n) & MASK64;
|
|
490
|
+
const lowLow32 = Number(BigInt.asIntN(32, LOW & MASK32));
|
|
491
|
+
const lowHigh32 = Number(BigInt.asIntN(32, (LOW >> 32n) & MASK32));
|
|
492
|
+
const highLow32 = Number(BigInt.asIntN(32, HIGH & MASK32));
|
|
493
|
+
const highHigh32 = Number(BigInt.asIntN(32, (HIGH >> 32n) & MASK32));
|
|
494
|
+
return [lowLow32, lowHigh32, highLow32, highHigh32];
|
|
495
|
+
};
|
|
406
496
|
const getInt16 = (view, offset) => {
|
|
407
497
|
return view.getInt16(offset, true);
|
|
408
498
|
};
|
|
@@ -690,19 +780,20 @@ function borderStyleToEnum(value) {
|
|
|
690
780
|
function borderStyleFromEnum(value) {
|
|
691
781
|
return BORDER_STYLE_VALUES[value] ?? 'none';
|
|
692
782
|
}
|
|
783
|
+
// hoisted so it's not rebuilt on every parseObjectPosition call
|
|
784
|
+
const OBJECT_POSITION_KEYWORDS = {
|
|
785
|
+
left: { type: 1, val: 0 },
|
|
786
|
+
center: { type: 1, val: 50 },
|
|
787
|
+
right: { type: 1, val: 100 },
|
|
788
|
+
top: { type: 1, val: 0 },
|
|
789
|
+
bottom: { type: 1, val: 100 },
|
|
790
|
+
};
|
|
693
791
|
function parseObjectPosition(value) {
|
|
694
|
-
const keywords = {
|
|
695
|
-
left: { type: 1, val: 0 },
|
|
696
|
-
center: { type: 1, val: 50 },
|
|
697
|
-
right: { type: 1, val: 100 },
|
|
698
|
-
top: { type: 1, val: 0 },
|
|
699
|
-
bottom: { type: 1, val: 100 },
|
|
700
|
-
};
|
|
701
792
|
const parts = value.trim().split(/\s+/);
|
|
702
793
|
if (parts.length === 0)
|
|
703
794
|
return null;
|
|
704
795
|
function parseComponent(s) {
|
|
705
|
-
const kw =
|
|
796
|
+
const kw = OBJECT_POSITION_KEYWORDS[s];
|
|
706
797
|
if (kw)
|
|
707
798
|
return kw;
|
|
708
799
|
if (s.endsWith('%'))
|
|
@@ -745,11 +836,12 @@ function fontStretchToValue(value) {
|
|
|
745
836
|
}
|
|
746
837
|
return -1;
|
|
747
838
|
}
|
|
839
|
+
// built once instead of scanning FONT_STRETCH_KEYWORDS on every getter read
|
|
840
|
+
const FONT_STRETCH_REVERSE = new Map(Object.entries(FONT_STRETCH_KEYWORDS).map(([kw, val]) => [val, kw]));
|
|
748
841
|
function fontStretchFromValue(v) {
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
}
|
|
842
|
+
const kw = FONT_STRETCH_REVERSE.get(v);
|
|
843
|
+
if (kw !== undefined)
|
|
844
|
+
return kw;
|
|
753
845
|
return `${v / 100}%`;
|
|
754
846
|
}
|
|
755
847
|
export class Style {
|
|
@@ -1050,19 +1142,22 @@ export class Style {
|
|
|
1050
1142
|
this.isDirty = -1n;
|
|
1051
1143
|
}
|
|
1052
1144
|
syncStyle() {
|
|
1053
|
-
const [low, high] = splitBigIntToInt64Parts(this.isDirty);
|
|
1054
1145
|
if (__ANDROID__) {
|
|
1146
|
+
const [lowLow, lowHigh, highLow, highHigh] = splitBigIntToInt32Parts(this.isDirty);
|
|
1055
1147
|
//@ts-ignore
|
|
1056
1148
|
const view = this.view?.android ?? this.view._view;
|
|
1057
|
-
|
|
1149
|
+
// @ts-ignore - syncStyleParts is a newer native method; typings regenerate from the AAR separately.
|
|
1150
|
+
view.syncStyleParts(lowLow, lowHigh, highLow, highHigh);
|
|
1058
1151
|
}
|
|
1059
1152
|
else if (__APPLE__) {
|
|
1153
|
+
const [low, high] = splitBigIntToInt64Parts(this.isDirty);
|
|
1060
1154
|
//@ts-ignore
|
|
1061
1155
|
const view = this.view?.ios ?? this.view._view;
|
|
1062
1156
|
// @ts-ignore
|
|
1063
1157
|
view.mason_syncStyle(low, high);
|
|
1064
1158
|
}
|
|
1065
1159
|
else if (__WINDOWS__) {
|
|
1160
|
+
const [low, high] = splitBigIntToInt64Parts(this.isDirty);
|
|
1066
1161
|
// @ts-ignore
|
|
1067
1162
|
const view = this.view?.windows ?? this.view._view;
|
|
1068
1163
|
view.SyncStyle(low, high);
|
|
@@ -1470,7 +1565,8 @@ export class Style {
|
|
|
1470
1565
|
else {
|
|
1471
1566
|
this.isDirty = this.isDirty | StateKeys.DISPLAY_MODE.bits;
|
|
1472
1567
|
}
|
|
1473
|
-
|
|
1568
|
+
// DISPLAY/DISPLAY_MODE are disjoint bits; use .or(), not .and()
|
|
1569
|
+
this.commitState(StateKeys.DISPLAY.or(StateKeys.DISPLAY_MODE));
|
|
1474
1570
|
}
|
|
1475
1571
|
}
|
|
1476
1572
|
get position() {
|
|
@@ -1539,6 +1635,10 @@ export class Style {
|
|
|
1539
1635
|
return 'wrap';
|
|
1540
1636
|
case 2:
|
|
1541
1637
|
return 'wrap-reverse';
|
|
1638
|
+
case 3:
|
|
1639
|
+
return 'balance';
|
|
1640
|
+
case 4:
|
|
1641
|
+
return 'balance-reverse';
|
|
1542
1642
|
}
|
|
1543
1643
|
}
|
|
1544
1644
|
set flexWrap(value) {
|
|
@@ -1553,6 +1653,12 @@ export class Style {
|
|
|
1553
1653
|
case 'wrap-reverse':
|
|
1554
1654
|
wrap = 2;
|
|
1555
1655
|
break;
|
|
1656
|
+
case 'balance':
|
|
1657
|
+
wrap = 3;
|
|
1658
|
+
break;
|
|
1659
|
+
case 'balance-reverse':
|
|
1660
|
+
wrap = 4;
|
|
1661
|
+
break;
|
|
1556
1662
|
}
|
|
1557
1663
|
if (wrap != -1) {
|
|
1558
1664
|
this.prepareMut();
|
|
@@ -1571,10 +1677,13 @@ export class Style {
|
|
|
1571
1677
|
}
|
|
1572
1678
|
set minWidth(value) {
|
|
1573
1679
|
switch (typeof value) {
|
|
1574
|
-
case 'string':
|
|
1680
|
+
case 'string': {
|
|
1575
1681
|
this.prepareMut();
|
|
1576
|
-
|
|
1682
|
+
const dim = lengthPercentageAutoFromString(value);
|
|
1683
|
+
setInt8(this.style_view, StyleKeys.MIN_WIDTH_TYPE, dim.type);
|
|
1684
|
+
setFloat32(this.style_view, StyleKeys.MIN_WIDTH_VALUE, dim.value);
|
|
1577
1685
|
break;
|
|
1686
|
+
}
|
|
1578
1687
|
case 'number':
|
|
1579
1688
|
this.prepareMut();
|
|
1580
1689
|
setInt8(this.style_view, StyleKeys.MIN_WIDTH_TYPE, 1);
|
|
@@ -1609,10 +1718,13 @@ export class Style {
|
|
|
1609
1718
|
}
|
|
1610
1719
|
set minHeight(value) {
|
|
1611
1720
|
switch (typeof value) {
|
|
1612
|
-
case 'string':
|
|
1721
|
+
case 'string': {
|
|
1613
1722
|
this.prepareMut();
|
|
1614
|
-
|
|
1723
|
+
const dim = lengthPercentageAutoFromString(value);
|
|
1724
|
+
setInt8(this.style_view, StyleKeys.MIN_HEIGHT_TYPE, dim.type);
|
|
1725
|
+
setFloat32(this.style_view, StyleKeys.MIN_HEIGHT_VALUE, dim.value);
|
|
1615
1726
|
break;
|
|
1727
|
+
}
|
|
1616
1728
|
case 'number':
|
|
1617
1729
|
this.prepareMut();
|
|
1618
1730
|
setInt8(this.style_view, StyleKeys.MIN_HEIGHT_TYPE, 1);
|
|
@@ -1643,29 +1755,15 @@ export class Style {
|
|
|
1643
1755
|
get width() {
|
|
1644
1756
|
const type = getInt8(this.style_view, StyleKeys.WIDTH_TYPE);
|
|
1645
1757
|
const value = getFloat32(this.style_view, StyleKeys.WIDTH_VALUE);
|
|
1646
|
-
return
|
|
1758
|
+
return parseDimension(type, value);
|
|
1647
1759
|
}
|
|
1648
1760
|
set width(value) {
|
|
1649
1761
|
switch (typeof value) {
|
|
1650
1762
|
case 'string': {
|
|
1651
|
-
// Parse the string instead of forcing `auto`. Reactively-applied sizes arrive as strings
|
|
1652
|
-
// ("48", "48px", "50%") — the old stub dropped them to auto (0), so dynamically-added boxes
|
|
1653
|
-
// rendered 0x0. unitless/dip → device pixels; px → as-is; % → percent.
|
|
1654
1763
|
this.prepareMut();
|
|
1655
|
-
const
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
setFloat32(this.style_view, StyleKeys.WIDTH_VALUE, 0);
|
|
1659
|
-
}
|
|
1660
|
-
else if (t.endsWith('%')) {
|
|
1661
|
-
setInt8(this.style_view, StyleKeys.WIDTH_TYPE, 2);
|
|
1662
|
-
setFloat32(this.style_view, StyleKeys.WIDTH_VALUE, parseFloat(t) || 0);
|
|
1663
|
-
}
|
|
1664
|
-
else {
|
|
1665
|
-
const n = parseFloat(t) || 0;
|
|
1666
|
-
setInt8(this.style_view, StyleKeys.WIDTH_TYPE, 1);
|
|
1667
|
-
setFloat32(this.style_view, StyleKeys.WIDTH_VALUE, t.endsWith('px') ? n : layout.toDevicePixels(n));
|
|
1668
|
-
}
|
|
1764
|
+
const dim = dimensionFromString(value);
|
|
1765
|
+
setInt8(this.style_view, StyleKeys.WIDTH_TYPE, dim.type);
|
|
1766
|
+
setFloat32(this.style_view, StyleKeys.WIDTH_VALUE, dim.value);
|
|
1669
1767
|
break;
|
|
1670
1768
|
}
|
|
1671
1769
|
case 'number':
|
|
@@ -1698,27 +1796,15 @@ export class Style {
|
|
|
1698
1796
|
get height() {
|
|
1699
1797
|
const type = getInt8(this.style_view, StyleKeys.HEIGHT_TYPE);
|
|
1700
1798
|
const value = getFloat32(this.style_view, StyleKeys.HEIGHT_VALUE);
|
|
1701
|
-
return
|
|
1799
|
+
return parseDimension(type, value);
|
|
1702
1800
|
}
|
|
1703
1801
|
set height(value) {
|
|
1704
1802
|
switch (typeof value) {
|
|
1705
1803
|
case 'string': {
|
|
1706
|
-
// Parse the string (see width setter) — the old stub forced auto/0, breaking string sizes.
|
|
1707
1804
|
this.prepareMut();
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
setFloat32(this.style_view, StyleKeys.HEIGHT_VALUE, 0);
|
|
1712
|
-
}
|
|
1713
|
-
else if (t.endsWith('%')) {
|
|
1714
|
-
setInt8(this.style_view, StyleKeys.HEIGHT_TYPE, 2);
|
|
1715
|
-
setFloat32(this.style_view, StyleKeys.HEIGHT_VALUE, parseFloat(t) || 0);
|
|
1716
|
-
}
|
|
1717
|
-
else {
|
|
1718
|
-
const n = parseFloat(t) || 0;
|
|
1719
|
-
setInt8(this.style_view, StyleKeys.HEIGHT_TYPE, 1);
|
|
1720
|
-
setFloat32(this.style_view, StyleKeys.HEIGHT_VALUE, t.endsWith('px') ? n : layout.toDevicePixels(n));
|
|
1721
|
-
}
|
|
1805
|
+
const dim = dimensionFromString(value);
|
|
1806
|
+
setInt8(this.style_view, StyleKeys.HEIGHT_TYPE, dim.type);
|
|
1807
|
+
setFloat32(this.style_view, StyleKeys.HEIGHT_VALUE, dim.value);
|
|
1722
1808
|
break;
|
|
1723
1809
|
}
|
|
1724
1810
|
case 'number':
|
|
@@ -1755,10 +1841,13 @@ export class Style {
|
|
|
1755
1841
|
}
|
|
1756
1842
|
set maxWidth(value) {
|
|
1757
1843
|
switch (typeof value) {
|
|
1758
|
-
case 'string':
|
|
1844
|
+
case 'string': {
|
|
1759
1845
|
this.prepareMut();
|
|
1760
|
-
|
|
1846
|
+
const dim = lengthPercentageAutoFromString(value);
|
|
1847
|
+
setInt8(this.style_view, StyleKeys.MAX_WIDTH_TYPE, dim.type);
|
|
1848
|
+
setFloat32(this.style_view, StyleKeys.MAX_WIDTH_VALUE, dim.value);
|
|
1761
1849
|
break;
|
|
1850
|
+
}
|
|
1762
1851
|
case 'number':
|
|
1763
1852
|
this.prepareMut();
|
|
1764
1853
|
setInt8(this.style_view, StyleKeys.MAX_WIDTH_TYPE, 1);
|
|
@@ -1793,10 +1882,13 @@ export class Style {
|
|
|
1793
1882
|
}
|
|
1794
1883
|
set maxHeight(value) {
|
|
1795
1884
|
switch (typeof value) {
|
|
1796
|
-
case 'string':
|
|
1885
|
+
case 'string': {
|
|
1797
1886
|
this.prepareMut();
|
|
1798
|
-
|
|
1887
|
+
const dim = lengthPercentageAutoFromString(value);
|
|
1888
|
+
setInt8(this.style_view, StyleKeys.MAX_HEIGHT_TYPE, dim.type);
|
|
1889
|
+
setFloat32(this.style_view, StyleKeys.MAX_HEIGHT_VALUE, dim.value);
|
|
1799
1890
|
break;
|
|
1891
|
+
}
|
|
1800
1892
|
case 'number':
|
|
1801
1893
|
this.prepareMut();
|
|
1802
1894
|
setInt8(this.style_view, StyleKeys.MAX_HEIGHT_TYPE, 1);
|
|
@@ -1964,10 +2056,12 @@ export class Style {
|
|
|
1964
2056
|
var type;
|
|
1965
2057
|
var insetValue;
|
|
1966
2058
|
switch (typeof value) {
|
|
1967
|
-
case 'string':
|
|
1968
|
-
|
|
1969
|
-
|
|
2059
|
+
case 'string': {
|
|
2060
|
+
const dim = lengthPercentageAutoFromString(value);
|
|
2061
|
+
type = dim.type;
|
|
2062
|
+
insetValue = dim.value;
|
|
1970
2063
|
break;
|
|
2064
|
+
}
|
|
1971
2065
|
case 'number':
|
|
1972
2066
|
type = 1;
|
|
1973
2067
|
insetValue = layout.toDevicePixels(value);
|
|
@@ -2004,13 +2098,14 @@ export class Style {
|
|
|
2004
2098
|
return parseLengthPercentageAuto(type, value);
|
|
2005
2099
|
}
|
|
2006
2100
|
set left(value) {
|
|
2007
|
-
if (value === 'auto') {
|
|
2008
|
-
this.prepareMut();
|
|
2009
|
-
setInt8(this.style_view, StyleKeys.INSET_LEFT_TYPE, 0);
|
|
2010
|
-
setFloat32(this.style_view, StyleKeys.INSET_LEFT_VALUE, 0);
|
|
2011
|
-
return;
|
|
2012
|
-
}
|
|
2013
2101
|
switch (typeof value) {
|
|
2102
|
+
case 'string': {
|
|
2103
|
+
this.prepareMut();
|
|
2104
|
+
const dim = lengthPercentageAutoFromString(value);
|
|
2105
|
+
setInt8(this.style_view, StyleKeys.INSET_LEFT_TYPE, dim.type);
|
|
2106
|
+
setFloat32(this.style_view, StyleKeys.INSET_LEFT_VALUE, dim.value);
|
|
2107
|
+
break;
|
|
2108
|
+
}
|
|
2014
2109
|
case 'number':
|
|
2015
2110
|
this.prepareMut();
|
|
2016
2111
|
setInt8(this.style_view, StyleKeys.INSET_LEFT_TYPE, 1);
|
|
@@ -2044,13 +2139,14 @@ export class Style {
|
|
|
2044
2139
|
return parseLengthPercentageAuto(type, value);
|
|
2045
2140
|
}
|
|
2046
2141
|
set right(value) {
|
|
2047
|
-
if (value === 'auto') {
|
|
2048
|
-
this.prepareMut();
|
|
2049
|
-
setInt8(this.style_view, StyleKeys.INSET_RIGHT_TYPE, 0);
|
|
2050
|
-
setFloat32(this.style_view, StyleKeys.INSET_RIGHT_VALUE, 0);
|
|
2051
|
-
return;
|
|
2052
|
-
}
|
|
2053
2142
|
switch (typeof value) {
|
|
2143
|
+
case 'string': {
|
|
2144
|
+
this.prepareMut();
|
|
2145
|
+
const dim = lengthPercentageAutoFromString(value);
|
|
2146
|
+
setInt8(this.style_view, StyleKeys.INSET_RIGHT_TYPE, dim.type);
|
|
2147
|
+
setFloat32(this.style_view, StyleKeys.INSET_RIGHT_VALUE, dim.value);
|
|
2148
|
+
break;
|
|
2149
|
+
}
|
|
2054
2150
|
case 'number':
|
|
2055
2151
|
this.prepareMut();
|
|
2056
2152
|
setInt8(this.style_view, StyleKeys.INSET_RIGHT_TYPE, 1);
|
|
@@ -2084,13 +2180,14 @@ export class Style {
|
|
|
2084
2180
|
return parseLengthPercentageAuto(type, value);
|
|
2085
2181
|
}
|
|
2086
2182
|
set top(value) {
|
|
2087
|
-
if (value === 'auto') {
|
|
2088
|
-
this.prepareMut();
|
|
2089
|
-
setInt8(this.style_view, StyleKeys.INSET_TOP_TYPE, 0);
|
|
2090
|
-
setFloat32(this.style_view, StyleKeys.INSET_TOP_VALUE, 0);
|
|
2091
|
-
return;
|
|
2092
|
-
}
|
|
2093
2183
|
switch (typeof value) {
|
|
2184
|
+
case 'string': {
|
|
2185
|
+
this.prepareMut();
|
|
2186
|
+
const dim = lengthPercentageAutoFromString(value);
|
|
2187
|
+
setInt8(this.style_view, StyleKeys.INSET_TOP_TYPE, dim.type);
|
|
2188
|
+
setFloat32(this.style_view, StyleKeys.INSET_TOP_VALUE, dim.value);
|
|
2189
|
+
break;
|
|
2190
|
+
}
|
|
2094
2191
|
case 'number':
|
|
2095
2192
|
this.prepareMut();
|
|
2096
2193
|
setInt8(this.style_view, StyleKeys.INSET_TOP_TYPE, 1);
|
|
@@ -2124,13 +2221,14 @@ export class Style {
|
|
|
2124
2221
|
return parseLengthPercentageAuto(type, value);
|
|
2125
2222
|
}
|
|
2126
2223
|
set bottom(value) {
|
|
2127
|
-
if (value === 'auto') {
|
|
2128
|
-
this.prepareMut();
|
|
2129
|
-
setInt8(this.style_view, StyleKeys.INSET_BOTTOM_TYPE, 0);
|
|
2130
|
-
setFloat32(this.style_view, StyleKeys.INSET_BOTTOM_VALUE, 0);
|
|
2131
|
-
return;
|
|
2132
|
-
}
|
|
2133
2224
|
switch (typeof value) {
|
|
2225
|
+
case 'string': {
|
|
2226
|
+
this.prepareMut();
|
|
2227
|
+
const dim = lengthPercentageAutoFromString(value);
|
|
2228
|
+
setInt8(this.style_view, StyleKeys.INSET_BOTTOM_TYPE, dim.type);
|
|
2229
|
+
setFloat32(this.style_view, StyleKeys.INSET_BOTTOM_VALUE, dim.value);
|
|
2230
|
+
break;
|
|
2231
|
+
}
|
|
2134
2232
|
case 'number':
|
|
2135
2233
|
this.prepareMut();
|
|
2136
2234
|
setInt8(this.style_view, StyleKeys.INSET_BOTTOM_TYPE, 1);
|
|
@@ -2162,10 +2260,12 @@ export class Style {
|
|
|
2162
2260
|
var type;
|
|
2163
2261
|
var marginValue;
|
|
2164
2262
|
switch (typeof value) {
|
|
2165
|
-
case 'string':
|
|
2166
|
-
|
|
2167
|
-
|
|
2263
|
+
case 'string': {
|
|
2264
|
+
const dim = lengthPercentageAutoFromString(value);
|
|
2265
|
+
type = dim.type;
|
|
2266
|
+
marginValue = dim.value;
|
|
2168
2267
|
break;
|
|
2268
|
+
}
|
|
2169
2269
|
case 'number':
|
|
2170
2270
|
type = 1;
|
|
2171
2271
|
marginValue = layout.toDevicePixels(value);
|
|
@@ -2203,10 +2303,13 @@ export class Style {
|
|
|
2203
2303
|
}
|
|
2204
2304
|
set marginLeft(value) {
|
|
2205
2305
|
switch (typeof value) {
|
|
2206
|
-
case 'string':
|
|
2306
|
+
case 'string': {
|
|
2207
2307
|
this.prepareMut();
|
|
2208
|
-
|
|
2308
|
+
const dim = lengthPercentageAutoFromString(value);
|
|
2309
|
+
setInt8(this.style_view, StyleKeys.MARGIN_LEFT_TYPE, dim.type);
|
|
2310
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_LEFT_VALUE, dim.value);
|
|
2209
2311
|
break;
|
|
2312
|
+
}
|
|
2210
2313
|
case 'number':
|
|
2211
2314
|
this.prepareMut();
|
|
2212
2315
|
setInt8(this.style_view, StyleKeys.MARGIN_LEFT_TYPE, 1);
|
|
@@ -2241,10 +2344,13 @@ export class Style {
|
|
|
2241
2344
|
}
|
|
2242
2345
|
set marginRight(value) {
|
|
2243
2346
|
switch (typeof value) {
|
|
2244
|
-
case 'string':
|
|
2347
|
+
case 'string': {
|
|
2245
2348
|
this.prepareMut();
|
|
2246
|
-
|
|
2349
|
+
const dim = lengthPercentageAutoFromString(value);
|
|
2350
|
+
setInt8(this.style_view, StyleKeys.MARGIN_RIGHT_TYPE, dim.type);
|
|
2351
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_RIGHT_VALUE, dim.value);
|
|
2247
2352
|
break;
|
|
2353
|
+
}
|
|
2248
2354
|
case 'number':
|
|
2249
2355
|
this.prepareMut();
|
|
2250
2356
|
setInt8(this.style_view, StyleKeys.MARGIN_RIGHT_TYPE, 1);
|
|
@@ -2279,10 +2385,13 @@ export class Style {
|
|
|
2279
2385
|
}
|
|
2280
2386
|
set marginTop(value) {
|
|
2281
2387
|
switch (typeof value) {
|
|
2282
|
-
case 'string':
|
|
2388
|
+
case 'string': {
|
|
2283
2389
|
this.prepareMut();
|
|
2284
|
-
|
|
2390
|
+
const dim = lengthPercentageAutoFromString(value);
|
|
2391
|
+
setInt8(this.style_view, StyleKeys.MARGIN_TOP_TYPE, dim.type);
|
|
2392
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_TOP_VALUE, dim.value);
|
|
2285
2393
|
break;
|
|
2394
|
+
}
|
|
2286
2395
|
case 'number':
|
|
2287
2396
|
this.prepareMut();
|
|
2288
2397
|
setInt8(this.style_view, StyleKeys.MARGIN_TOP_TYPE, 1);
|
|
@@ -2317,10 +2426,13 @@ export class Style {
|
|
|
2317
2426
|
}
|
|
2318
2427
|
set marginBottom(value) {
|
|
2319
2428
|
switch (typeof value) {
|
|
2320
|
-
case 'string':
|
|
2429
|
+
case 'string': {
|
|
2321
2430
|
this.prepareMut();
|
|
2322
|
-
|
|
2431
|
+
const dim = lengthPercentageAutoFromString(value);
|
|
2432
|
+
setInt8(this.style_view, StyleKeys.MARGIN_BOTTOM_TYPE, dim.type);
|
|
2433
|
+
setFloat32(this.style_view, StyleKeys.MARGIN_BOTTOM_VALUE, dim.value);
|
|
2323
2434
|
break;
|
|
2435
|
+
}
|
|
2324
2436
|
case 'number':
|
|
2325
2437
|
this.prepareMut();
|
|
2326
2438
|
setInt8(this.style_view, StyleKeys.MARGIN_BOTTOM_TYPE, 1);
|
|
@@ -2361,6 +2473,13 @@ export class Style {
|
|
|
2361
2473
|
}
|
|
2362
2474
|
set paddingLeft(value) {
|
|
2363
2475
|
switch (typeof value) {
|
|
2476
|
+
case 'string': {
|
|
2477
|
+
this.prepareMut();
|
|
2478
|
+
const dim = lengthPercentageFromString(value);
|
|
2479
|
+
setInt8(this.style_view, StyleKeys.PADDING_LEFT_TYPE, dim.type);
|
|
2480
|
+
setFloat32(this.style_view, StyleKeys.PADDING_LEFT_VALUE, dim.value);
|
|
2481
|
+
break;
|
|
2482
|
+
}
|
|
2364
2483
|
case 'number':
|
|
2365
2484
|
this.prepareMut();
|
|
2366
2485
|
setInt8(this.style_view, StyleKeys.PADDING_LEFT_TYPE, 0);
|
|
@@ -2395,6 +2514,13 @@ export class Style {
|
|
|
2395
2514
|
}
|
|
2396
2515
|
set paddingRight(value) {
|
|
2397
2516
|
switch (typeof value) {
|
|
2517
|
+
case 'string': {
|
|
2518
|
+
this.prepareMut();
|
|
2519
|
+
const dim = lengthPercentageFromString(value);
|
|
2520
|
+
setInt8(this.style_view, StyleKeys.PADDING_RIGHT_TYPE, dim.type);
|
|
2521
|
+
setFloat32(this.style_view, StyleKeys.PADDING_RIGHT_VALUE, dim.value);
|
|
2522
|
+
break;
|
|
2523
|
+
}
|
|
2398
2524
|
case 'number':
|
|
2399
2525
|
this.prepareMut();
|
|
2400
2526
|
setInt8(this.style_view, StyleKeys.PADDING_RIGHT_TYPE, 0);
|
|
@@ -2429,6 +2555,13 @@ export class Style {
|
|
|
2429
2555
|
}
|
|
2430
2556
|
set paddingTop(value) {
|
|
2431
2557
|
switch (typeof value) {
|
|
2558
|
+
case 'string': {
|
|
2559
|
+
this.prepareMut();
|
|
2560
|
+
const dim = lengthPercentageFromString(value);
|
|
2561
|
+
setInt8(this.style_view, StyleKeys.PADDING_TOP_TYPE, dim.type);
|
|
2562
|
+
setFloat32(this.style_view, StyleKeys.PADDING_TOP_VALUE, dim.value);
|
|
2563
|
+
break;
|
|
2564
|
+
}
|
|
2432
2565
|
case 'number':
|
|
2433
2566
|
this.prepareMut();
|
|
2434
2567
|
setInt8(this.style_view, StyleKeys.PADDING_TOP_TYPE, 0);
|
|
@@ -2463,6 +2596,13 @@ export class Style {
|
|
|
2463
2596
|
}
|
|
2464
2597
|
set paddingBottom(value) {
|
|
2465
2598
|
switch (typeof value) {
|
|
2599
|
+
case 'string': {
|
|
2600
|
+
this.prepareMut();
|
|
2601
|
+
const dim = lengthPercentageFromString(value);
|
|
2602
|
+
setInt8(this.style_view, StyleKeys.PADDING_BOTTOM_TYPE, dim.type);
|
|
2603
|
+
setFloat32(this.style_view, StyleKeys.PADDING_BOTTOM_VALUE, dim.value);
|
|
2604
|
+
break;
|
|
2605
|
+
}
|
|
2466
2606
|
case 'number':
|
|
2467
2607
|
this.prepareMut();
|
|
2468
2608
|
setInt8(this.style_view, StyleKeys.PADDING_BOTTOM_TYPE, 0);
|
|
@@ -2594,6 +2734,8 @@ export class Style {
|
|
|
2594
2734
|
return getFloat32(this.style_view, StyleKeys.ASPECT_RATIO);
|
|
2595
2735
|
}
|
|
2596
2736
|
set aspectRatio(value) {
|
|
2737
|
+
if (getFloat32(this.style_view, StyleKeys.ASPECT_RATIO) === value)
|
|
2738
|
+
return;
|
|
2597
2739
|
this.prepareMut();
|
|
2598
2740
|
setFloat32(this.style_view, StyleKeys.ASPECT_RATIO, value);
|
|
2599
2741
|
this.commitState(StateKeys.ASPECT_RATIO);
|
|
@@ -2601,14 +2743,17 @@ export class Style {
|
|
|
2601
2743
|
get flexBasis() {
|
|
2602
2744
|
const type = getInt8(this.style_view, StyleKeys.FLEX_BASIS_TYPE);
|
|
2603
2745
|
const value = getFloat32(this.style_view, StyleKeys.FLEX_BASIS_VALUE);
|
|
2604
|
-
return
|
|
2746
|
+
return parseDimension(type, value);
|
|
2605
2747
|
}
|
|
2606
2748
|
set flexBasis(value) {
|
|
2607
2749
|
switch (typeof value) {
|
|
2608
|
-
case 'string':
|
|
2750
|
+
case 'string': {
|
|
2609
2751
|
this.prepareMut();
|
|
2610
|
-
|
|
2752
|
+
const dim = dimensionFromString(value);
|
|
2753
|
+
setInt8(this.style_view, StyleKeys.FLEX_BASIS_TYPE, dim.type);
|
|
2754
|
+
setFloat32(this.style_view, StyleKeys.FLEX_BASIS_VALUE, dim.value);
|
|
2611
2755
|
break;
|
|
2756
|
+
}
|
|
2612
2757
|
case 'number':
|
|
2613
2758
|
this.prepareMut();
|
|
2614
2759
|
setInt8(this.style_view, StyleKeys.FLEX_BASIS_TYPE, 1);
|
|
@@ -2762,8 +2907,13 @@ export class Style {
|
|
|
2762
2907
|
return 'start';
|
|
2763
2908
|
case 3 /* AlignContent.Stretch */:
|
|
2764
2909
|
return 'stretch';
|
|
2910
|
+
case 7 /* AlignContent.FlexStart */:
|
|
2911
|
+
return 'flex-start';
|
|
2912
|
+
case 8 /* AlignContent.FlexEnd */:
|
|
2913
|
+
return 'flex-end';
|
|
2765
2914
|
}
|
|
2766
2915
|
}
|
|
2916
|
+
// 'flex-start'/'flex-end' were missing from this switch entirely
|
|
2767
2917
|
set alignContent(value) {
|
|
2768
2918
|
let align = -1;
|
|
2769
2919
|
switch (value) {
|
|
@@ -2791,6 +2941,12 @@ export class Style {
|
|
|
2791
2941
|
case 'stretch':
|
|
2792
2942
|
align = 3 /* AlignContent.Stretch */;
|
|
2793
2943
|
break;
|
|
2944
|
+
case 'flex-start':
|
|
2945
|
+
align = 7 /* AlignContent.FlexStart */;
|
|
2946
|
+
break;
|
|
2947
|
+
case 'flex-end':
|
|
2948
|
+
align = 8 /* AlignContent.FlexEnd */;
|
|
2949
|
+
break;
|
|
2794
2950
|
}
|
|
2795
2951
|
if (align !== -1) {
|
|
2796
2952
|
this.prepareMut();
|
|
@@ -2957,6 +3113,12 @@ export class Style {
|
|
|
2957
3113
|
case 'stretch':
|
|
2958
3114
|
v = 3 /* JustifyContent.Stretch */;
|
|
2959
3115
|
break;
|
|
3116
|
+
case 'flex-start':
|
|
3117
|
+
v = 7 /* JustifyContent.FlexStart */;
|
|
3118
|
+
break;
|
|
3119
|
+
case 'flex-end':
|
|
3120
|
+
v = 8 /* JustifyContent.FlexEnd */;
|
|
3121
|
+
break;
|
|
2960
3122
|
}
|
|
2961
3123
|
if (v !== -1) {
|
|
2962
3124
|
this.prepareMut();
|
|
@@ -2980,6 +3142,8 @@ export class Style {
|
|
|
2980
3142
|
if (!this.nativeView) {
|
|
2981
3143
|
return;
|
|
2982
3144
|
}
|
|
3145
|
+
// A bare number can't marshal over JNI into the native String setter.
|
|
3146
|
+
value = value == null ? '' : String(value);
|
|
2983
3147
|
if (__ANDROID__) {
|
|
2984
3148
|
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridAutoRows(this.nativeView, value);
|
|
2985
3149
|
}
|
|
@@ -3006,6 +3170,8 @@ export class Style {
|
|
|
3006
3170
|
if (!this.nativeView) {
|
|
3007
3171
|
return;
|
|
3008
3172
|
}
|
|
3173
|
+
// See gridAutoRows above.
|
|
3174
|
+
value = value == null ? '' : String(value);
|
|
3009
3175
|
if (__ANDROID__) {
|
|
3010
3176
|
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridAutoColumns(this.nativeView, value);
|
|
3011
3177
|
}
|
|
@@ -3052,6 +3218,8 @@ export class Style {
|
|
|
3052
3218
|
if (!this.nativeView) {
|
|
3053
3219
|
return;
|
|
3054
3220
|
}
|
|
3221
|
+
// See gridAutoRows above.
|
|
3222
|
+
value = value == null ? '' : String(value);
|
|
3055
3223
|
if (__ANDROID__) {
|
|
3056
3224
|
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridColumn(this.nativeView, value);
|
|
3057
3225
|
}
|
|
@@ -3090,6 +3258,8 @@ export class Style {
|
|
|
3090
3258
|
if (!this.nativeView) {
|
|
3091
3259
|
return;
|
|
3092
3260
|
}
|
|
3261
|
+
// See gridAutoRows above.
|
|
3262
|
+
value = value == null ? '' : String(value);
|
|
3093
3263
|
if (__ANDROID__) {
|
|
3094
3264
|
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridColumnStart(this.nativeView, value);
|
|
3095
3265
|
}
|
|
@@ -3116,6 +3286,8 @@ export class Style {
|
|
|
3116
3286
|
if (!this.nativeView) {
|
|
3117
3287
|
return;
|
|
3118
3288
|
}
|
|
3289
|
+
// See gridAutoRows above.
|
|
3290
|
+
value = value == null ? '' : String(value);
|
|
3119
3291
|
if (__ANDROID__) {
|
|
3120
3292
|
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridColumnEnd(this.nativeView, value);
|
|
3121
3293
|
}
|
|
@@ -3130,6 +3302,8 @@ export class Style {
|
|
|
3130
3302
|
if (!this.nativeView) {
|
|
3131
3303
|
return;
|
|
3132
3304
|
}
|
|
3305
|
+
// See gridAutoRows above.
|
|
3306
|
+
value = value == null ? '' : String(value);
|
|
3133
3307
|
if (__ANDROID__) {
|
|
3134
3308
|
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridRow(this.nativeView, value);
|
|
3135
3309
|
}
|
|
@@ -3168,6 +3342,8 @@ export class Style {
|
|
|
3168
3342
|
if (!this.nativeView) {
|
|
3169
3343
|
return;
|
|
3170
3344
|
}
|
|
3345
|
+
// See gridAutoRows above.
|
|
3346
|
+
value = value == null ? '' : String(value);
|
|
3171
3347
|
if (__ANDROID__) {
|
|
3172
3348
|
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridRowStart(this.nativeView, value);
|
|
3173
3349
|
}
|
|
@@ -3194,6 +3370,8 @@ export class Style {
|
|
|
3194
3370
|
if (!this.nativeView) {
|
|
3195
3371
|
return;
|
|
3196
3372
|
}
|
|
3373
|
+
// See gridAutoRows above.
|
|
3374
|
+
value = value == null ? '' : String(value);
|
|
3197
3375
|
if (__ANDROID__) {
|
|
3198
3376
|
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridRowEnd(this.nativeView, value);
|
|
3199
3377
|
}
|
|
@@ -3208,6 +3386,8 @@ export class Style {
|
|
|
3208
3386
|
if (!this.nativeView) {
|
|
3209
3387
|
return;
|
|
3210
3388
|
}
|
|
3389
|
+
// See gridAutoRows above.
|
|
3390
|
+
value = value == null ? '' : String(value);
|
|
3211
3391
|
if (__ANDROID__) {
|
|
3212
3392
|
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridArea(this.nativeView, value);
|
|
3213
3393
|
}
|
|
@@ -3234,9 +3414,8 @@ export class Style {
|
|
|
3234
3414
|
if (!this.nativeView) {
|
|
3235
3415
|
return;
|
|
3236
3416
|
}
|
|
3237
|
-
//
|
|
3238
|
-
|
|
3239
|
-
value = value ?? '';
|
|
3417
|
+
// null clears the template; also guards against a bare number (see gridAutoRows above).
|
|
3418
|
+
value = value == null ? '' : String(value);
|
|
3240
3419
|
if (__ANDROID__) {
|
|
3241
3420
|
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridTemplateRows(this.nativeView, value);
|
|
3242
3421
|
}
|
|
@@ -3275,9 +3454,8 @@ export class Style {
|
|
|
3275
3454
|
if (!this.nativeView) {
|
|
3276
3455
|
return;
|
|
3277
3456
|
}
|
|
3278
|
-
//
|
|
3279
|
-
|
|
3280
|
-
value = value ?? '';
|
|
3457
|
+
// null clears the template; also guards against a bare number (see gridAutoRows above).
|
|
3458
|
+
value = value == null ? '' : String(value);
|
|
3281
3459
|
if (__ANDROID__) {
|
|
3282
3460
|
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridTemplateColumns(this.nativeView, value);
|
|
3283
3461
|
}
|
|
@@ -3304,8 +3482,8 @@ export class Style {
|
|
|
3304
3482
|
if (!this.nativeView) {
|
|
3305
3483
|
return;
|
|
3306
3484
|
}
|
|
3307
|
-
//
|
|
3308
|
-
value = value
|
|
3485
|
+
// null clears it; also guards against a bare number (see gridAutoRows above).
|
|
3486
|
+
value = value == null ? '' : String(value);
|
|
3309
3487
|
if (__ANDROID__) {
|
|
3310
3488
|
org.nativescript.mason.masonkit.NodeHelper.getShared().setGridTemplateAreas(this.nativeView, value);
|
|
3311
3489
|
}
|
|
@@ -3395,6 +3573,9 @@ export class Style {
|
|
|
3395
3573
|
return getFloat32(this.style_view, StyleKeys.FLEX_GROW);
|
|
3396
3574
|
}
|
|
3397
3575
|
set flexGrow(value) {
|
|
3576
|
+
// skip invalidation on a no-op re-apply of the same value
|
|
3577
|
+
if (getFloat32(this.style_view, StyleKeys.FLEX_GROW) === value)
|
|
3578
|
+
return;
|
|
3398
3579
|
this.prepareMut();
|
|
3399
3580
|
setFloat32(this.style_view, StyleKeys.FLEX_GROW, value);
|
|
3400
3581
|
this.commitState(StateKeys.FLEX_GROW);
|
|
@@ -3403,6 +3584,8 @@ export class Style {
|
|
|
3403
3584
|
return getFloat32(this.style_view, StyleKeys.FLEX_SHRINK);
|
|
3404
3585
|
}
|
|
3405
3586
|
set flexShrink(value) {
|
|
3587
|
+
if (getFloat32(this.style_view, StyleKeys.FLEX_SHRINK) === value)
|
|
3588
|
+
return;
|
|
3406
3589
|
this.prepareMut();
|
|
3407
3590
|
setFloat32(this.style_view, StyleKeys.FLEX_SHRINK, value);
|
|
3408
3591
|
this.commitState(StateKeys.FLEX_SHRINK);
|
|
@@ -3767,7 +3950,9 @@ export class Style {
|
|
|
3767
3950
|
return '';
|
|
3768
3951
|
}
|
|
3769
3952
|
set paddingCss(value) {
|
|
3770
|
-
|
|
3953
|
+
// a bare number is dip, matching other numeric setters; Android's
|
|
3954
|
+
// native parser treats "px" as unscaled device pixels, "dip" as scaled
|
|
3955
|
+
const strValue = typeof value === 'number' ? `${value}dip` : value;
|
|
3771
3956
|
this.setPseudoCssStringValue('padding', strValue, () => org.nativescript.mason.masonkit.NodeHelper.getShared().setPaddingCss(this.nativeView, strValue), () => (this.nativeView.style.paddingCss = strValue));
|
|
3772
3957
|
}
|
|
3773
3958
|
get marginCss() {
|
|
@@ -3782,7 +3967,8 @@ export class Style {
|
|
|
3782
3967
|
return '';
|
|
3783
3968
|
}
|
|
3784
3969
|
set marginCss(value) {
|
|
3785
|
-
|
|
3970
|
+
// See the comment on `paddingCss` above — same dip-vs-px mislabeling fix.
|
|
3971
|
+
const strValue = typeof value === 'number' ? `${value}dip` : value;
|
|
3786
3972
|
this.setPseudoCssStringValue('margin', strValue, () => org.nativescript.mason.masonkit.NodeHelper.getShared().setMarginCss(this.nativeView, strValue), () => (this.nativeView.style.marginCss = strValue));
|
|
3787
3973
|
}
|
|
3788
3974
|
get insetCss() {
|
|
@@ -3797,7 +3983,8 @@ export class Style {
|
|
|
3797
3983
|
return '';
|
|
3798
3984
|
}
|
|
3799
3985
|
set insetCss(value) {
|
|
3800
|
-
|
|
3986
|
+
// See the comment on `paddingCss` above — same dip-vs-px mislabeling fix.
|
|
3987
|
+
const strValue = typeof value === 'number' ? `${value}dip` : value;
|
|
3801
3988
|
this.setPseudoCssStringValue('inset', strValue, () => org.nativescript.mason.masonkit.NodeHelper.getShared().setInsetCss(this.nativeView, strValue), () => (this.nativeView.style.insetCss = strValue));
|
|
3802
3989
|
}
|
|
3803
3990
|
get borderLeft() {
|
|
@@ -4042,6 +4229,8 @@ export class Style {
|
|
|
4042
4229
|
return getInt32(this.style_view, StyleKeys.Z_INDEX);
|
|
4043
4230
|
}
|
|
4044
4231
|
set zIndex(value) {
|
|
4232
|
+
if (getInt32(this.style_view, StyleKeys.Z_INDEX) === value)
|
|
4233
|
+
return;
|
|
4045
4234
|
this.prepareMut();
|
|
4046
4235
|
setInt32(this.style_view, StyleKeys.Z_INDEX, value);
|
|
4047
4236
|
this.commitState(StateKeys.Z_INDEX);
|