@triniwiz/nativescript-masonkit 1.0.0-beta.121 → 1.0.0-beta.123

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.
Files changed (86) hide show
  1. package/button/index.ios.js +5 -73
  2. package/button/index.ios.js.map +1 -1
  3. package/common.d.ts +3 -1
  4. package/common.js +55 -17
  5. package/common.js.map +1 -1
  6. package/css-shorthands.d.ts +0 -2
  7. package/css-shorthands.js +0 -4
  8. package/css-shorthands.js.map +1 -1
  9. package/foreign-layout.d.ts +3 -1
  10. package/foreign-layout.js +33 -1
  11. package/foreign-layout.js.map +1 -1
  12. package/img/index.android.js +1 -1
  13. package/img/index.android.js.map +1 -1
  14. package/img/index.ios.js +5 -43
  15. package/img/index.ios.js.map +1 -1
  16. package/img/index.windows.js +3 -8
  17. package/img/index.windows.js.map +1 -1
  18. package/index.d.ts +12 -0
  19. package/input/index.ios.js +4 -44
  20. package/input/index.ios.js.map +1 -1
  21. package/li/index.ios.js +6 -52
  22. package/li/index.ios.js.map +1 -1
  23. package/list/index.ios.js +3 -41
  24. package/list/index.ios.js.map +1 -1
  25. package/logical-boxes.d.ts +8 -0
  26. package/logical-boxes.js +131 -0
  27. package/logical-boxes.js.map +1 -0
  28. package/package.json +1 -1
  29. package/platforms/android/masonkit-release.aar +0 -0
  30. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +5 -0
  31. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +9 -0
  32. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
  33. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  34. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +33461 -30006
  35. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +274 -221
  36. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  37. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +274 -221
  38. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  39. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +10099 -9730
  40. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +10 -0
  41. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +9 -0
  42. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
  43. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  44. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  45. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +33461 -30006
  46. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +274 -221
  47. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  48. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +274 -221
  49. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +33461 -30006
  50. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +274 -221
  51. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  52. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +274 -221
  53. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +28 -28
  54. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +2 -2
  55. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +10093 -9724
  56. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +9652 -9281
  57. package/platforms/windows/arm64/NativeScript.Mason.dll +0 -0
  58. package/platforms/windows/arm64/NativeScript.Mason.winmd +0 -0
  59. package/platforms/windows/x64/NativeScript.Mason.dll +0 -0
  60. package/platforms/windows/x64/NativeScript.Mason.winmd +0 -0
  61. package/properties.d.ts +37 -0
  62. package/properties.js +167 -41
  63. package/properties.js.map +1 -1
  64. package/scroll/index.ios.js +5 -62
  65. package/scroll/index.ios.js.map +1 -1
  66. package/style.d.ts +323 -0
  67. package/style.js +322 -6
  68. package/style.js.map +1 -1
  69. package/symbols.d.ts +3 -0
  70. package/symbols.js +4 -0
  71. package/symbols.js.map +1 -1
  72. package/text/index.ios.js +3 -79
  73. package/text/index.ios.js.map +1 -1
  74. package/text/index.windows.js +5 -4
  75. package/text/index.windows.js.map +1 -1
  76. package/textarea/index.ios.js +4 -62
  77. package/textarea/index.ios.js.map +1 -1
  78. package/typings/objc!Mason.d.ts +2 -0
  79. package/typings/objc!ObjectiveC.d.ts +2 -0
  80. package/view/index.ios.js +8 -56
  81. package/view/index.ios.js.map +1 -1
  82. package/vue/src/mason-meta.d.ts.map +1 -1
  83. package/vue/src/mason-meta.js +8 -7
  84. package/vue/src/mason-meta.js.map +1 -1
  85. package/web.js +6 -6
  86. package/web.js.map +1 -1
package/properties.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { CssProperty, CssAnimationProperty, InheritedCssProperty, Style, ShorthandProperty, Property } from '@nativescript/core';
2
2
  import { Display, Overflow, Length, Gap, LengthAuto, Position, BoxSizing, GridAutoFlow, AlignContent, VerticalAlign, Float, Clear } from '.';
3
3
  import type { ViewBase } from './common';
4
+ import type { LogicalGroupName, Style as MasonStyle } from './style';
4
5
  import type { LonghandValue } from './css-shorthands';
5
6
  type ShorthandLonghand = CssProperty<Style, any> | CssAnimationProperty<Style, any>;
6
7
  export interface MasonShorthand {
@@ -10,6 +11,11 @@ export interface MasonShorthand {
10
11
  }
11
12
  export declare function shorthandConverter({ longhands, split }: MasonShorthand): (value: unknown) => [ShorthandLonghand, unknown][];
12
13
  export declare const textProperty: Property<ViewBase, string>;
14
+ /**
15
+ * Writes `display`; unsetting it restores the element's own display (inline for an img or a
16
+ * span), kept from before the first write.
17
+ */
18
+ export declare function applyDisplay(style: MasonStyle, value: Display | undefined): void;
13
19
  export declare const displayProperty: CssProperty<Style, Display>;
14
20
  export declare const filterProperty: CssProperty<Style, string>;
15
21
  export declare const borderColorProperty: CssProperty<Style, string>;
@@ -138,6 +144,9 @@ export declare const maskBorderModeProperty: CssProperty<Style, string>;
138
144
  export declare const maskProperty: ShorthandProperty<Style, any>;
139
145
  export declare const maskBorderProperty: ShorthandProperty<Style, any>;
140
146
  export declare const writingModeProperty: CssProperty<Style, string>;
147
+ export declare const textOrientationProperty: CssProperty<Style, string>;
148
+ export declare const textCombineUprightProperty: CssProperty<Style, string>;
149
+ export declare const textSpacingTrimProperty: CssProperty<Style, string>;
141
150
  export declare const unicodeBidiProperty: CssProperty<Style, string>;
142
151
  export declare const caretColorProperty: CssProperty<Style, string>;
143
152
  export declare const listStyleTypeProperty: InheritedCssProperty<Style, string>;
@@ -150,5 +159,33 @@ export declare const borderTopProperty: ShorthandProperty<Style, any>;
150
159
  export declare const borderRightProperty: ShorthandProperty<Style, any>;
151
160
  export declare const borderBottomProperty: ShorthandProperty<Style, any>;
152
161
  export declare const borderLeftProperty: ShorthandProperty<Style, any>;
162
+ type Sides = readonly [top: ShorthandLonghand, right: ShorthandLonghand, bottom: ShorthandLonghand, left: ShorthandLonghand];
163
+ export interface LogicalLonghand {
164
+ property: CssProperty<Style, unknown>;
165
+ group: LogicalGroupName;
166
+ slot: number;
167
+ }
168
+ /** Logical longhands; Mason views write them in setNative (common.ts), once the native view exists. */
169
+ export declare const logicalLonghands: LogicalLonghand[];
170
+ export declare const marginLogicalLonghands: Sides;
171
+ export declare const paddingLogicalLonghands: Sides;
172
+ export declare const insetLogicalLonghands: Sides;
173
+ export declare const logicalSizeLonghands: CssProperty<Style, unknown>[];
174
+ /**
175
+ * Logical longhands a Mason view writes to physical sides: `physical` are the group's physical
176
+ * longhands (sides top, right, bottom, left; corners top-left, top-right, bottom-right,
177
+ * bottom-left; axes x, y), `logical` its logical ones in the positions of the physical ones
178
+ * they map to in horizontal left-to-right text.
179
+ */
180
+ export interface LogicalBoxGroup {
181
+ kind: 'sides' | 'corners' | 'axes';
182
+ physical: CssProperty<Style, unknown>[];
183
+ logical: CssProperty<Style, unknown>[];
184
+ /** A side's value when neither kind of declaration sets it. */
185
+ initial: unknown;
186
+ }
187
+ export declare const logicalBoxGroups: LogicalBoxGroup[];
188
+ export declare const radiusLogicalLonghands: CssProperty<Style, unknown>[];
189
+ export declare const overflowLogicalLonghands: CssProperty<Style, unknown>[];
153
190
  export declare const masonShorthands: MasonShorthand[];
154
191
  export {};
package/properties.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CssProperty, CssAnimationProperty, InheritedCssProperty, backgroundColorProperty, Style, ShorthandProperty, Length as CoreLength, fontSizeProperty, textAlignmentProperty, textDecorationProperty, textTransformProperty, PercentLength as CorePercentLength, Trace, CoreTypes, unsetValue, verticalAlignmentProperty, textShadowProperty, Font, Property, makeParser, makeValidator, marginTopProperty, marginRightProperty, marginBottomProperty, marginLeftProperty, paddingTopProperty, paddingRightProperty, paddingBottomProperty, paddingLeftProperty, borderTopWidthProperty, borderRightWidthProperty, borderBottomWidthProperty, borderLeftWidthProperty, minWidthProperty, minHeightProperty, widthProperty, heightProperty, lineHeightProperty, letterSpacingProperty, } from '@nativescript/core';
2
- import { isMasonView_, touchAction_ } from './symbols';
2
+ import { elementDisplay_, isMasonView_, remapLogicalBoxes_, touchAction_ } from './symbols';
3
3
  /** Marks a Style whose size accessors already resolve Mason's units. */
4
4
  const MASON_SIZE_UNITS = Symbol('mason:size-units');
5
5
  import { beginStyleWrite, cssLengthToDip, endStyleWrite, isSizingKeyword, parseAspectRatio } from './style';
@@ -8,7 +8,7 @@ import { alignItemsProperty, alignSelfProperty, flexDirectionProperty, flexGrowP
8
8
  import { parseCSSShadow } from '@nativescript/core/ui/styling/css-shadow';
9
9
  import { installKeyframes, interpolatePositionList, interpolateSizeList, registerKeyframeProperty } from './css-keyframes';
10
10
  import { borderTopLeftRadiusProperty, borderTopRightRadiusProperty, borderBottomRightRadiusProperty, borderBottomLeftRadiusProperty, borderTopColorProperty, borderRightColorProperty, borderBottomColorProperty, borderLeftColorProperty } from '@nativescript/core/ui/styling/style-properties';
11
- import { BORDER_WIDTH_KEYWORDS, passThrough, splitBorder, splitBorderSide, splitBorderStyle, splitBorderStyleStartEnd, splitBorderWidthStartEnd, splitBorderColorStartEnd, splitInsetStartEnd, splitMarginStartEnd, splitPaddingStartEnd, splitBackground, splitMask, splitMaskBorder, splitWebkitMask, webkitMaskBox, webkitMaskComposite, splitBorderColor, splitBorderRadius, splitBorderWidth, splitFlex, splitFlexFlow, splitGap, splitMargin, splitOverflow, splitPadding } from './css-shorthands';
11
+ import { BORDER_WIDTH_KEYWORDS, splitBorder, splitBorderSide, splitBorderStyle, splitBorderStyleStartEnd, splitBorderWidthStartEnd, splitBorderColorStartEnd, splitInsetStartEnd, splitMarginStartEnd, splitPaddingStartEnd, splitBackground, splitMask, splitMaskBorder, splitWebkitMask, webkitMaskBox, webkitMaskComposite, splitBorderColor, splitBorderRadius, splitBorderWidth, splitFlex, splitFlexFlow, splitGap, splitMargin, splitOverflow, splitPadding } from './css-shorthands';
12
12
  import { cssLength, isCssLength, toCamelCase } from './css-shorthands';
13
13
  import { splitListStyle, splitPlace } from './css-shorthands';
14
14
  function getViewStyle(view) {
@@ -70,17 +70,32 @@ function masonShorthandProperty(entry, getter = () => undefined) {
70
70
  export const textProperty = new Property({
71
71
  name: 'text',
72
72
  });
73
+ /**
74
+ * Writes `display`; unsetting it restores the element's own display (inline for an img or a
75
+ * span), kept from before the first write.
76
+ */
77
+ export function applyDisplay(style, value) {
78
+ const owner = style;
79
+ if (value) {
80
+ if (owner[elementDisplay_] === undefined)
81
+ owner[elementDisplay_] = style.display;
82
+ style.display = value;
83
+ }
84
+ else if (owner[elementDisplay_] !== undefined) {
85
+ style.display = owner[elementDisplay_];
86
+ }
87
+ }
88
+ // No defaultValue: core skips a value equal to the default, and `display: block` must still
89
+ // reach an element that is inline on its own.
73
90
  export const displayProperty = new CssProperty({
74
91
  name: 'display',
75
92
  cssName: 'display',
76
- defaultValue: 'block',
77
93
  valueChanged: (target, oldValue, newValue) => {
78
94
  if (appliedInSetNative(target, displayProperty))
79
95
  return;
80
96
  const view = getViewStyle(target.viewRef);
81
- if (view && newValue) {
82
- view.display = newValue;
83
- }
97
+ if (view)
98
+ applyDisplay(view, newValue);
84
99
  },
85
100
  valueConverter: function (value) {
86
101
  if (typeof value === 'number') {
@@ -262,11 +277,14 @@ export const paddingProperty = new CssProperty({
262
277
  export const whiteSpaceProperty = new CssProperty({
263
278
  name: 'whiteSpace',
264
279
  cssName: 'white-space',
265
- defaultValue: 'normal',
280
+ // No default: it inherits, so the initial value is a real change under another value.
266
281
  valueChanged(target, oldValue, newValue) {
267
282
  const view = getViewStyle(target.viewRef);
268
283
  if (view) {
269
- view.whiteSpace = newValue;
284
+ if (newValue == null)
285
+ view.unsetInheritedText('whiteSpace');
286
+ else
287
+ view.whiteSpace = newValue;
270
288
  }
271
289
  },
272
290
  });
@@ -1804,11 +1822,14 @@ export const borderImageProperty = new CssProperty({
1804
1822
  export const fontStretchProperty = new CssProperty({
1805
1823
  name: 'fontStretch',
1806
1824
  cssName: 'font-stretch',
1807
- defaultValue: 'normal',
1825
+ // No default: it inherits, so the initial value is a real change under another value.
1808
1826
  valueChanged(target, oldValue, newValue) {
1809
1827
  const view = getViewStyle(target.viewRef);
1810
1828
  if (view) {
1811
- view.fontStretch = newValue;
1829
+ if (newValue == null)
1830
+ view.unsetInheritedText('fontStretch');
1831
+ else
1832
+ view.fontStretch = newValue;
1812
1833
  }
1813
1834
  },
1814
1835
  });
@@ -1826,22 +1847,28 @@ export const fontFeatureSettingsProperty = new CssProperty({
1826
1847
  export const wordSpacingProperty = new CssProperty({
1827
1848
  name: 'wordSpacing',
1828
1849
  cssName: 'word-spacing',
1829
- defaultValue: 'normal',
1850
+ // No default: it inherits, so the initial value is a real change under another value.
1830
1851
  valueChanged(target, oldValue, newValue) {
1831
1852
  const view = getViewStyle(target.viewRef);
1832
1853
  if (view) {
1833
- view.wordSpacing = newValue;
1854
+ if (newValue == null)
1855
+ view.unsetInheritedText('wordSpacing');
1856
+ else
1857
+ view.wordSpacing = newValue;
1834
1858
  }
1835
1859
  },
1836
1860
  });
1837
1861
  export const hyphensProperty = new CssProperty({
1838
1862
  name: 'hyphens',
1839
1863
  cssName: 'hyphens',
1840
- defaultValue: 'manual',
1864
+ // No default: it inherits, so the initial value is a real change under another value.
1841
1865
  valueChanged(target, oldValue, newValue) {
1842
1866
  const view = getViewStyle(target.viewRef);
1843
1867
  if (view) {
1844
- view.hyphens = newValue;
1868
+ if (newValue == null)
1869
+ view.unsetInheritedText('hyphens');
1870
+ else
1871
+ view.hyphens = newValue;
1845
1872
  }
1846
1873
  },
1847
1874
  });
@@ -2169,11 +2196,58 @@ const webkitMaskBoxImageProperty = masonShorthandProperty(webkitMaskBoxImageShor
2169
2196
  export const writingModeProperty = new CssProperty({
2170
2197
  name: 'writingMode',
2171
2198
  cssName: 'writing-mode',
2172
- defaultValue: 'horizontal-tb',
2199
+ // No default: it inherits, so the initial value is a real change under another value.
2173
2200
  valueChanged(target, oldValue, newValue) {
2174
2201
  const view = getViewStyle(target.viewRef);
2175
2202
  if (view) {
2176
- view.writingMode = newValue;
2203
+ if (newValue == null)
2204
+ view.unsetInheritedText('writingMode');
2205
+ else
2206
+ view.writingMode = newValue;
2207
+ const ref = target.viewRef;
2208
+ (__ANDROID__ ? ref?.get() : ref?.deref())?.[remapLogicalBoxes_]?.();
2209
+ }
2210
+ },
2211
+ });
2212
+ export const textOrientationProperty = new CssProperty({
2213
+ name: 'textOrientation',
2214
+ cssName: 'text-orientation',
2215
+ // No default: it inherits, so the initial value is a real change under another value.
2216
+ valueChanged(target, oldValue, newValue) {
2217
+ const view = getViewStyle(target.viewRef);
2218
+ if (view) {
2219
+ if (newValue == null)
2220
+ view.unsetInheritedText('textOrientation');
2221
+ else
2222
+ view.textOrientation = newValue;
2223
+ }
2224
+ },
2225
+ });
2226
+ export const textCombineUprightProperty = new CssProperty({
2227
+ name: 'textCombineUpright',
2228
+ cssName: 'text-combine-upright',
2229
+ // No default: it inherits, so the initial value is a real change under another value.
2230
+ valueChanged(target, oldValue, newValue) {
2231
+ const view = getViewStyle(target.viewRef);
2232
+ if (view) {
2233
+ if (newValue == null)
2234
+ view.unsetInheritedText('textCombineUpright');
2235
+ else
2236
+ view.textCombineUpright = newValue;
2237
+ }
2238
+ },
2239
+ });
2240
+ export const textSpacingTrimProperty = new CssProperty({
2241
+ name: 'textSpacingTrim',
2242
+ cssName: 'text-spacing-trim',
2243
+ // No default: it inherits, so the initial value is a real change under another value.
2244
+ valueChanged(target, oldValue, newValue) {
2245
+ const view = getViewStyle(target.viewRef);
2246
+ if (view) {
2247
+ if (newValue == null)
2248
+ view.unsetInheritedText('textSpacingTrim');
2249
+ else
2250
+ view.textSpacingTrim = newValue;
2177
2251
  }
2178
2252
  },
2179
2253
  });
@@ -2247,6 +2321,9 @@ maskClipProperty.register(Style);
2247
2321
  maskModeProperty.register(Style);
2248
2322
  maskCompositeProperty.register(Style);
2249
2323
  writingModeProperty.register(Style);
2324
+ textOrientationProperty.register(Style);
2325
+ textCombineUprightProperty.register(Style);
2326
+ textSpacingTrimProperty.register(Style);
2250
2327
  unicodeBidiProperty.register(Style);
2251
2328
  caretColorProperty.register(Style);
2252
2329
  registerAlongsideCore(backgroundImageProperty);
@@ -2411,38 +2488,87 @@ const LOGICAL_SIDES = [
2411
2488
  ['block-end', 2],
2412
2489
  ['inline-start', 3],
2413
2490
  ];
2414
- /** `<prefix>-inline<suffix>`, `<prefix>-block<suffix>` and the four `-start`/`-end` sides. */
2491
+ /** `<prefix>-inline<suffix>` and `<prefix>-block<suffix>`, over a group's logical sides. */
2415
2492
  function logicalSides(prefix, suffix, sides, splitAxis) {
2416
- const inline = { cssName: `${prefix}-inline${suffix}`, longhands: [sides[3], sides[1]], split: splitAxis };
2417
- const block = { cssName: `${prefix}-block${suffix}`, longhands: [sides[0], sides[2]], split: splitAxis };
2418
- const perSide = LOGICAL_SIDES.map(([side, i]) => ({ cssName: `${prefix}-${side}${suffix}`, longhands: [sides[i]], split: passThrough }));
2419
- return [inline, block, ...perSide];
2493
+ return [
2494
+ { cssName: `${prefix}-inline${suffix}`, longhands: [sides[3], sides[1]], split: splitAxis },
2495
+ { cssName: `${prefix}-block${suffix}`, longhands: [sides[0], sides[2]], split: splitAxis },
2496
+ ];
2497
+ }
2498
+ /** Logical longhands; Mason views write them in setNative (common.ts), once the native view exists. */
2499
+ export const logicalLonghands = [];
2500
+ function logicalLonghand(cssName, group, slot, physical) {
2501
+ const property = new CssProperty({
2502
+ name: toCamelCase(cssName),
2503
+ cssName,
2504
+ valueChanged(target, oldValue, newValue) {
2505
+ const ref = target?.viewRef;
2506
+ const view = ref ? (__ANDROID__ ? ref.get() : ref.deref()) : undefined;
2507
+ if (!view || view[isMasonView_])
2508
+ return;
2509
+ // cssName is the cascade's css-tier key ('css:margin-left').
2510
+ target[physical.cssName] = (newValue ?? unsetValue);
2511
+ },
2512
+ });
2513
+ property.register(Style);
2514
+ logicalLonghands.push({ property, group, slot });
2515
+ return property;
2516
+ }
2517
+ /** A group's four logical sides, in the positions of the physical sides they map to in horizontal left-to-right text. */
2518
+ function logicalSideLonghands(prefix, group, physical) {
2519
+ return LOGICAL_SIDES.map(([side, i]) => logicalLonghand(`${prefix}-${side}`, group, i, physical[i]));
2520
+ }
2521
+ export const marginLogicalLonghands = logicalSideLonghands('margin', 'margin', marginLonghands);
2522
+ export const paddingLogicalLonghands = logicalSideLonghands('padding', 'padding', paddingLonghands);
2523
+ export const insetLogicalLonghands = logicalSideLonghands('inset', 'inset', [topProperty, rightProperty, bottomProperty, leftProperty]);
2524
+ export const logicalSizeLonghands = [
2525
+ ['inline-size', widthProperty],
2526
+ ['block-size', heightProperty],
2527
+ ['min-inline-size', minWidthProperty],
2528
+ ['min-block-size', minHeightProperty],
2529
+ ['max-inline-size', maxWidthProperty],
2530
+ ['max-block-size', maxHeightProperty],
2531
+ ].map(([cssName, physical], slot) => logicalLonghand(cssName, 'size', slot, physical));
2532
+ export const logicalBoxGroups = [];
2533
+ function logicalBoxGroup(kind, physical, cssNames, initial) {
2534
+ const group = { kind, physical: physical, logical: [], initial };
2535
+ group.logical = cssNames.map((cssName, slot) => {
2536
+ const property = new CssProperty({
2537
+ name: toCamelCase(cssName),
2538
+ cssName,
2539
+ valueChanged(target, oldValue, newValue) {
2540
+ const ref = target?.viewRef;
2541
+ const view = ref ? (__ANDROID__ ? ref.get() : ref.deref()) : undefined;
2542
+ if (!view || view[isMasonView_])
2543
+ return;
2544
+ target[group.physical[slot].cssName] = (newValue ?? unsetValue);
2545
+ },
2546
+ });
2547
+ property.register(Style);
2548
+ return property;
2549
+ });
2550
+ logicalBoxGroups.push(group);
2551
+ return group.logical;
2420
2552
  }
2421
- const borderSideLonghands = (i) => [borderWidthLonghands[i], borderStyleLonghands[i], borderColorLonghands[i]];
2553
+ const sideNames = (prefix, suffix) => LOGICAL_SIDES.map(([side]) => `${prefix}-${side}${suffix}`);
2554
+ const borderWidthLogicalLonghands = logicalBoxGroup('sides', borderWidthLonghands, sideNames('border', '-width'), 0);
2555
+ const borderStyleLogicalLonghands = logicalBoxGroup('sides', borderStyleLonghands, sideNames('border', '-style'), 'none');
2556
+ const borderColorLogicalLonghands = logicalBoxGroup('sides', borderColorLonghands, sideNames('border', '-color'), 'black');
2557
+ // Corners are <block>-<inline>: start-start is top-left.
2558
+ export const radiusLogicalLonghands = logicalBoxGroup('corners', radiusLonghands, ['border-start-start-radius', 'border-start-end-radius', 'border-end-end-radius', 'border-end-start-radius'], 0);
2559
+ export const overflowLogicalLonghands = logicalBoxGroup('axes', [overflowXProperty, overflowYProperty], ['overflow-inline', 'overflow-block'], 'visible');
2560
+ const borderSideLonghands = (i) => [borderWidthLogicalLonghands[i], borderStyleLogicalLonghands[i], borderColorLogicalLonghands[i]];
2422
2561
  const logicalShorthands = [
2423
- ...logicalSides('margin', '', marginLonghands, splitMarginStartEnd),
2424
- ...logicalSides('padding', '', paddingLonghands, splitPaddingStartEnd),
2425
- ...logicalSides('inset', '', [topProperty, rightProperty, bottomProperty, leftProperty], splitInsetStartEnd),
2426
- ...logicalSides('border', '-width', borderWidthLonghands, splitBorderWidthStartEnd),
2427
- ...logicalSides('border', '-style', borderStyleLonghands, splitBorderStyleStartEnd),
2428
- ...logicalSides('border', '-color', borderColorLonghands, splitBorderColorStartEnd),
2562
+ ...logicalSides('margin', '', marginLogicalLonghands, splitMarginStartEnd),
2563
+ ...logicalSides('padding', '', paddingLogicalLonghands, splitPaddingStartEnd),
2564
+ ...logicalSides('inset', '', insetLogicalLonghands, splitInsetStartEnd),
2565
+ ...logicalSides('border', '-width', borderWidthLogicalLonghands, splitBorderWidthStartEnd),
2566
+ ...logicalSides('border', '-style', borderStyleLogicalLonghands, splitBorderStyleStartEnd),
2567
+ ...logicalSides('border', '-color', borderColorLogicalLonghands, splitBorderColorStartEnd),
2429
2568
  // `border-inline: 1px solid` gives both sides the same border.
2430
2569
  { cssName: 'border-inline', longhands: [...borderSideLonghands(3), ...borderSideLonghands(1)], split: (value) => [...splitBorderSide(value), ...splitBorderSide(value)] },
2431
2570
  { cssName: 'border-block', longhands: [...borderSideLonghands(0), ...borderSideLonghands(2)], split: (value) => [...splitBorderSide(value), ...splitBorderSide(value)] },
2432
2571
  ...LOGICAL_SIDES.map(([side, i]) => ({ cssName: `border-${side}`, longhands: borderSideLonghands(i), split: splitBorderSide })),
2433
- // Corners are <block>-<inline>: start-start is top-left.
2434
- { cssName: 'border-start-start-radius', longhands: [borderTopLeftRadiusProperty], split: passThrough },
2435
- { cssName: 'border-start-end-radius', longhands: [borderTopRightRadiusProperty], split: passThrough },
2436
- { cssName: 'border-end-end-radius', longhands: [borderBottomRightRadiusProperty], split: passThrough },
2437
- { cssName: 'border-end-start-radius', longhands: [borderBottomLeftRadiusProperty], split: passThrough },
2438
- { cssName: 'inline-size', longhands: [widthProperty], split: passThrough },
2439
- { cssName: 'block-size', longhands: [heightProperty], split: passThrough },
2440
- { cssName: 'min-inline-size', longhands: [minWidthProperty], split: passThrough },
2441
- { cssName: 'min-block-size', longhands: [minHeightProperty], split: passThrough },
2442
- { cssName: 'max-inline-size', longhands: [maxWidthProperty], split: passThrough },
2443
- { cssName: 'max-block-size', longhands: [maxHeightProperty], split: passThrough },
2444
- { cssName: 'overflow-inline', longhands: [overflowXProperty], split: passThrough },
2445
- { cssName: 'overflow-block', longhands: [overflowYProperty], split: passThrough },
2446
2572
  ];
2447
2573
  for (const entry of logicalShorthands) {
2448
2574
  masonShorthandProperty(entry, function () {