@triniwiz/nativescript-masonkit 1.0.0-beta.92 → 1.0.0-beta.94
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/button/index.ios.js +6 -1
- package/button/index.ios.js.map +1 -1
- package/common.d.ts +16 -3
- package/common.js +145 -12
- package/common.js.map +1 -1
- package/img/index.ios.js +6 -1
- package/img/index.ios.js.map +1 -1
- package/input/index.ios.js +6 -1
- package/input/index.ios.js.map +1 -1
- package/li/index.ios.js +7 -2
- package/li/index.ios.js.map +1 -1
- package/list/index.ios.js +6 -1
- 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 +11 -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 +321 -183
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +4 -0
- 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 +4 -0
- 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 +8548 -8520
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +22 -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 +321 -183
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +4 -0
- 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 +4 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +321 -183
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +4 -0
- 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 +4 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +26 -26
- 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 +8543 -8515
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +8182 -8155
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/Mason-Swift.h +11 -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 +321 -183
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.private.swiftinterface +4 -0
- 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 +4 -0
- 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 +8041 -8015
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/Mason-Swift.h +11 -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 +321 -183
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.private.swiftinterface +4 -0
- 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 +4 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/_CodeSignature/CodeResources +14 -14
- 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 +8041 -8015
- package/properties.d.ts +6 -0
- package/properties.js +83 -4
- package/properties.js.map +1 -1
- package/scroll/index.ios.js +6 -1
- package/scroll/index.ios.js.map +1 -1
- package/style.d.ts +21 -1
- package/style.js +78 -2
- package/style.js.map +1 -1
- package/symbols.d.ts +4 -0
- package/symbols.js +14 -0
- package/symbols.js.map +1 -1
- package/text/index.ios.js +6 -1
- package/text/index.ios.js.map +1 -1
- package/textarea/index.ios.js +6 -1
- package/textarea/index.ios.js.map +1 -1
- package/view/index.ios.js +15 -7
- package/view/index.ios.js.map +1 -1
- package/web.d.ts +8 -0
- package/web.js +16 -0
- package/web.js.map +1 -1
package/button/index.ios.js
CHANGED
|
@@ -69,10 +69,15 @@ let Button = class Button extends ButtonBase {
|
|
|
69
69
|
const heightMode = Utils.layout.getMeasureSpecMode(heightMeasureSpec);
|
|
70
70
|
if (!this[isMasonView_]) {
|
|
71
71
|
const unconstrained = widthMode === Utils.layout.UNSPECIFIED || heightMode === Utils.layout.UNSPECIFIED || (widthMode === Utils.layout.AT_MOST && specWidth === 0) || (heightMode === Utils.layout.AT_MOST && specHeight === 0);
|
|
72
|
-
|
|
72
|
+
// Compute against the parent's bounds whenever the spec gives any; see
|
|
73
|
+
// view/index.ios.ts for why auto/auto doesn't matter here.
|
|
74
|
+
if (!unconstrained) {
|
|
73
75
|
// todo
|
|
74
76
|
// @ts-ignore
|
|
75
77
|
this.ios.mason_computeWithSize(specWidth, specHeight);
|
|
78
|
+
// Claim this root for the host's spec; see view/index.ios.ts.
|
|
79
|
+
// @ts-ignore
|
|
80
|
+
this.ios.mason_markRootComputeAppliedWithSize(specWidth, specHeight);
|
|
76
81
|
//this.ios.computeWithMaxContent();
|
|
77
82
|
// todo
|
|
78
83
|
// @ts-ignore
|
package/button/index.ios.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../../../packages/nativescript-masonkit/button/index.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAY,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG3E,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU;IAGpC;QACE,KAAK,EAAE,CAAC;QAFV,aAAQ,GAAG,KAAK,CAAC;QAGf,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IAC5B,CAAC;IAED,IAAI,KAAK;QACP,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC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mB,EAAE,KAAK,CAAC,CAAC;YACvD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED,+BAA+B,CAAC,IAAc;QAC5C,IAAI,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC;QAC3B,KAAK,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,mBAAmB,CAAC,UAAe,EAAE,KAAa;QAChD,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC;IAC3B,CAAC;CACF,CAAA;AAvLY,MAAM;IADlB,OAAO,CAAC,QAAQ,CAAC;;GACL,MAAM,CAuLlB"}
|
package/common.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AddChildFromBuilder, CustomLayoutView, View as NSView, ViewBase as NSViewBase, Property, widthProperty, heightProperty, CoreTypes, marginLeftProperty, marginRightProperty, marginTopProperty, marginBottomProperty, minWidthProperty, minHeightProperty, fontSizeProperty, fontWeightProperty, fontStyleProperty, colorProperty, lineHeightProperty, letterSpacingProperty, textAlignmentProperty, textDecorationProperty, borderLeftWidthProperty, borderTopWidthProperty, borderRightWidthProperty, borderBottomWidthProperty, backgroundColorProperty, paddingLeftProperty, paddingRightProperty, paddingTopProperty, paddingBottomProperty, zIndexProperty } from '@nativescript/core';
|
|
2
2
|
import { Display, Gap, GridAutoFlow, JustifyItems, JustifySelf, Length, LengthAuto, Overflow, Position, BoxSizing, VerticalAlign, FlexDirection, Float, Clear } from '.';
|
|
3
3
|
import { alignItemsProperty, alignSelfProperty, flexDirectionProperty, flexGrowProperty, flexShrinkProperty, flexWrapProperty, justifyContentProperty } from '@nativescript/core/ui/layouts/flexbox-layout';
|
|
4
|
-
import { fontInternalProperty } from '@nativescript/core/ui/styling/style-properties';
|
|
4
|
+
import { fontInternalProperty, borderTopLeftRadiusProperty, borderTopRightRadiusProperty, borderBottomRightRadiusProperty, borderBottomLeftRadiusProperty, borderTopColorProperty, borderRightColorProperty, borderBottomColorProperty, borderLeftColorProperty } from '@nativescript/core/ui/styling/style-properties';
|
|
5
5
|
import { Style } from './style';
|
|
6
6
|
import { alignContentProperty, aspectRatioProperty, backgroundProperty, borderProperty, borderLeftProperty, borderTopProperty, borderRightProperty, borderBottomProperty, borderRadiusProperty, bottomProperty, boxSizingProperty, clearProperty, columnGapProperty, cornerShapeProperty, displayProperty, filterProperty, flexBasisProperty, floatProperty, gridAreaProperty, gridAutoColumnsProperty, gridAutoFlowProperty, gridAutoRowsProperty, gridColumnEndProperty, gridColumnProperty, gridColumnStartProperty, gridRowEndProperty, gridRowProperty, gridRowStartProperty, gridTemplateAreasProperty, gridTemplateColumnsProperty, gridTemplateRowsProperty, justifyItemsProperty, justifySelfProperty, leftProperty, marginProperty, maxHeightProperty, maxWidthProperty, overflowXProperty, overflowYProperty, paddingProperty, positionProperty, rightProperty, rowGapProperty, scrollBarWidthProperty, textOverFlowProperty, textProperty, textWrapProperty, topProperty, verticalAlignProperty, boxShadowProperty, transformProperty, borderColorProperty, borderStyleProperty, backgroundImageProperty, listStyleTypeProperty, listStylePositionProperty } from './properties';
|
|
7
|
-
import { isMasonView_, isTextChild_, isText_, native_, pseudoStyles_ } from './symbols';
|
|
7
|
+
import { isMasonView_, isTextChild_, isText_, native_, pseudoStyles_, eventType_ } from './symbols';
|
|
8
8
|
import { TextNode } from './text-node';
|
|
9
9
|
export interface MasonChild extends ViewBase {
|
|
10
10
|
}
|
|
@@ -69,6 +69,14 @@ export declare class ViewBase extends CustomLayoutView implements AddChildFromBu
|
|
|
69
69
|
[textProperty.setNative]: (value: string) => void;
|
|
70
70
|
[filterProperty.setNative]: (value: any) => void;
|
|
71
71
|
[borderRadiusProperty.setNative]: (value: any) => void;
|
|
72
|
+
[borderTopLeftRadiusProperty.setNative]: (value: CoreTypes.LengthType) => void;
|
|
73
|
+
[borderTopRightRadiusProperty.setNative]: (value: CoreTypes.LengthType) => void;
|
|
74
|
+
[borderBottomRightRadiusProperty.setNative]: (value: CoreTypes.LengthType) => void;
|
|
75
|
+
[borderBottomLeftRadiusProperty.setNative]: (value: CoreTypes.LengthType) => void;
|
|
76
|
+
[borderTopColorProperty.setNative]: (value: any) => void;
|
|
77
|
+
[borderRightColorProperty.setNative]: (value: any) => void;
|
|
78
|
+
[borderBottomColorProperty.setNative]: (value: any) => void;
|
|
79
|
+
[borderLeftColorProperty.setNative]: (value: any) => void;
|
|
72
80
|
[borderProperty.setNative]: (value: any) => void;
|
|
73
81
|
[borderLeftProperty.setNative]: (value: any) => void;
|
|
74
82
|
[borderTopProperty.setNative]: (value: any) => void;
|
|
@@ -266,6 +274,8 @@ export declare class ViewBase extends CustomLayoutView implements AddChildFromBu
|
|
|
266
274
|
set filter(value: string);
|
|
267
275
|
set borderRadius(value: string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit);
|
|
268
276
|
get borderRadius(): string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;
|
|
277
|
+
private _borderRadiusCorner;
|
|
278
|
+
private _borderSideColor;
|
|
269
279
|
set border(value: string);
|
|
270
280
|
get border(): string;
|
|
271
281
|
set background(value: string);
|
|
@@ -356,6 +366,7 @@ export declare class ImageBase extends ViewBase {
|
|
|
356
366
|
}
|
|
357
367
|
export declare class Event {
|
|
358
368
|
[native_]: any;
|
|
369
|
+
[eventType_]: string | undefined;
|
|
359
370
|
get bubbles(): boolean;
|
|
360
371
|
get cancelable(): boolean;
|
|
361
372
|
get isComposing(): any;
|
|
@@ -368,7 +379,9 @@ export declare class Event {
|
|
|
368
379
|
stopPropagation(): void;
|
|
369
380
|
preventDefault(): void;
|
|
370
381
|
get type(): string;
|
|
371
|
-
set type(
|
|
382
|
+
set type(value: string);
|
|
383
|
+
get button(): number;
|
|
384
|
+
set button(_: number);
|
|
372
385
|
get target(): any;
|
|
373
386
|
set target(_: any);
|
|
374
387
|
set currentTarget(_: any);
|
package/common.js
CHANGED
|
@@ -3,11 +3,14 @@ var _a, _b, _c, _d;
|
|
|
3
3
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
4
4
|
import { CustomLayoutView, View as NSView, getViewById, Property, widthProperty, heightProperty, marginLeftProperty, marginRightProperty, marginTopProperty, marginBottomProperty, minWidthProperty, minHeightProperty, fontSizeProperty, fontWeightProperty, fontStyleProperty, colorProperty, Color, lineHeightProperty, letterSpacingProperty, textAlignmentProperty, textDecorationProperty, borderLeftWidthProperty, borderTopWidthProperty, borderRightWidthProperty, borderBottomWidthProperty, backgroundColorProperty, paddingLeftProperty, paddingRightProperty, paddingTopProperty, paddingBottomProperty, zIndexProperty, PseudoClassHandler } from '@nativescript/core';
|
|
5
5
|
import { alignItemsProperty, alignSelfProperty, flexDirectionProperty, flexGrowProperty, flexShrinkProperty, flexWrapProperty, justifyContentProperty } from '@nativescript/core/ui/layouts/flexbox-layout';
|
|
6
|
-
|
|
6
|
+
// The per-corner radius and per-side colour longhands core's `border-radius`
|
|
7
|
+
// / `border-color` shorthands expand into. They live in the styling module
|
|
8
|
+
// rather than core's root export, unlike the border *width* longhands above.
|
|
9
|
+
import { fontInternalProperty, borderTopLeftRadiusProperty, borderTopRightRadiusProperty, borderBottomRightRadiusProperty, borderBottomLeftRadiusProperty, borderTopColorProperty, borderRightColorProperty, borderBottomColorProperty, borderLeftColorProperty } from '@nativescript/core/ui/styling/style-properties';
|
|
7
10
|
import { _forceStyleUpdate } from './utils';
|
|
8
11
|
import { Style } from './style';
|
|
9
|
-
import { alignContentProperty, aspectRatioProperty, backgroundProperty, borderProperty, borderLeftProperty, borderTopProperty, borderRightProperty, borderBottomProperty, borderRadiusProperty, bottomProperty, boxSizingProperty, clearProperty, columnGapProperty, cornerShapeProperty, displayProperty, filterProperty, flexBasisProperty, floatProperty, gridAreaProperty, gridAutoColumnsProperty, gridAutoFlowProperty, gridAutoRowsProperty, gridColumnEndProperty, gridColumnProperty, gridColumnStartProperty, gridRowEndProperty, gridRowProperty, gridRowStartProperty, gridTemplateAreasProperty, gridTemplateColumnsProperty, gridTemplateRowsProperty, justifyItemsProperty, justifySelfProperty, leftProperty, marginProperty, maxHeightProperty, maxWidthProperty, overflowXProperty, overflowYProperty, paddingProperty, positionProperty, rightProperty, rowGapProperty, scrollBarWidthProperty, textOverFlowProperty, textProperty, textWrapProperty, topProperty, verticalAlignProperty, boxShadowProperty, transformProperty, borderColorProperty, borderStyleProperty, backgroundImageProperty, listStyleTypeProperty, listStylePositionProperty, } from './properties';
|
|
10
|
-
import { isMasonView_, isTextChild_, isText_, isPlaceholder_, text_, native_, textNode_, textNodeIndex_, textNodeProxied_, pseudoStyles_ } from './symbols';
|
|
12
|
+
import { alignContentProperty, aspectRatioProperty, backgroundProperty, borderProperty, borderLeftProperty, borderTopProperty, borderRightProperty, borderBottomProperty, borderRadiusProperty, bottomProperty, boxSizingProperty, clearProperty, columnGapProperty, cornerShapeProperty, displayProperty, filterProperty, flexBasisProperty, floatProperty, gridAreaProperty, gridAutoColumnsProperty, gridAutoFlowProperty, gridAutoRowsProperty, gridColumnEndProperty, gridColumnProperty, gridColumnStartProperty, gridRowEndProperty, gridRowProperty, gridRowStartProperty, gridTemplateAreasProperty, gridTemplateColumnsProperty, gridTemplateRowsProperty, justifyItemsProperty, justifySelfProperty, leftProperty, marginProperty, maxHeightProperty, maxWidthProperty, overflowXProperty, overflowYProperty, paddingProperty, positionProperty, rightProperty, rowGapProperty, scrollBarWidthProperty, textOverFlowProperty, textProperty, textWrapProperty, topProperty, verticalAlignProperty, boxShadowProperty, transformProperty, borderColorProperty, borderStyleProperty, backgroundImageProperty, listStyleTypeProperty, listStylePositionProperty, installMasonSizeUnits, } from './properties';
|
|
13
|
+
import { isMasonView_, isTextChild_, isText_, isPlaceholder_, text_, native_, textNode_, textNodeIndex_, textNodeProxied_, pseudoStyles_, emptyTextNode_, borderRadiusCorners_, borderSideColors_, eventType_ } from './symbols';
|
|
11
14
|
import { Tree } from './tree';
|
|
12
15
|
import { TextNode } from './text-node';
|
|
13
16
|
import { compile } from './pseudo';
|
|
@@ -188,6 +191,36 @@ export const textContentProperty = new Property({
|
|
|
188
191
|
function toCamelCase(prop) {
|
|
189
192
|
return prop.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
190
193
|
}
|
|
194
|
+
/** A core `Length` (number of dip, or `{ value, unit }`) as a CSS string. */
|
|
195
|
+
function lengthToCssString(value) {
|
|
196
|
+
if (value == null) {
|
|
197
|
+
return '0';
|
|
198
|
+
}
|
|
199
|
+
if (typeof value === 'number') {
|
|
200
|
+
return `${value}px`;
|
|
201
|
+
}
|
|
202
|
+
const unit = value.unit;
|
|
203
|
+
const amount = value.value ?? 0;
|
|
204
|
+
return unit === '%' ? `${amount * 100}%` : `${amount}px`;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* A core colour value as a CSS string. Duck-typed rather than
|
|
208
|
+
* `instanceof Color` on purpose: a `Color` can arrive from a different
|
|
209
|
+
* `@nativescript/core` copy, where `instanceof` fails.
|
|
210
|
+
*/
|
|
211
|
+
function colorToCssString(value) {
|
|
212
|
+
if (value == null) {
|
|
213
|
+
return 'transparent';
|
|
214
|
+
}
|
|
215
|
+
if (typeof value === 'string') {
|
|
216
|
+
return value;
|
|
217
|
+
}
|
|
218
|
+
const hex = value.hex;
|
|
219
|
+
if (typeof hex === 'string') {
|
|
220
|
+
return hex;
|
|
221
|
+
}
|
|
222
|
+
return String(value);
|
|
223
|
+
}
|
|
191
224
|
export class ViewBase extends CustomLayoutView {
|
|
192
225
|
/**
|
|
193
226
|
* Enable or disable CSS Preflight (web-normalised / Tailwind-like) defaults
|
|
@@ -225,6 +258,10 @@ export class ViewBase extends CustomLayoutView {
|
|
|
225
258
|
this[_c] = false;
|
|
226
259
|
this[_d] = {};
|
|
227
260
|
this._pendingEventsRegistration = [];
|
|
261
|
+
// `width`/`height` are core CssAnimationProperties whose stylesheet accessor
|
|
262
|
+
// is non-configurable, so units Mason understands but core does not (`vh`,
|
|
263
|
+
// `rem`, `pt`, …) have to be resolved on this view's own Style object.
|
|
264
|
+
installMasonSizeUnits(this.style);
|
|
228
265
|
}
|
|
229
266
|
get innerHTML() {
|
|
230
267
|
//@ts-ignore
|
|
@@ -1055,7 +1092,21 @@ export class ViewBase extends CustomLayoutView {
|
|
|
1055
1092
|
if (Array.isArray(frameworkEl.childNodes)) {
|
|
1056
1093
|
const rawChildNodes = frameworkEl.childNodes;
|
|
1057
1094
|
if (rawChildNodes.length === 0) {
|
|
1058
|
-
this
|
|
1095
|
+
// No framework-tracked DOM child backs this text (e.g. a Label-like
|
|
1096
|
+
// element with plain `.text` set directly). Without a stable node to
|
|
1097
|
+
// key the reuse cache on, every write fell through to the "always
|
|
1098
|
+
// new" `replaceChild` string branch, orphaning a native TextNode
|
|
1099
|
+
// each call. Cache a synthetic node on `this` instead, so repeat
|
|
1100
|
+
// writes route through the same update-in-place path a real DOM
|
|
1101
|
+
// text node gets (and never touch `replaceChild`, which a host
|
|
1102
|
+
// framework's DOM shim may itself shadow).
|
|
1103
|
+
let node = this[emptyTextNode_];
|
|
1104
|
+
if (!node) {
|
|
1105
|
+
node = {};
|
|
1106
|
+
this[emptyTextNode_] = node;
|
|
1107
|
+
}
|
|
1108
|
+
node.text = value;
|
|
1109
|
+
this._updateTextNode(node, { type: this._children.length === 0 ? 'add' : 'replace', index: 0, isBreak: false });
|
|
1059
1110
|
return;
|
|
1060
1111
|
}
|
|
1061
1112
|
// Deduplicate nodes (some frameworks expose the same nodes via both
|
|
@@ -1159,6 +1210,73 @@ export class ViewBase extends CustomLayoutView {
|
|
|
1159
1210
|
style.borderRadius = value;
|
|
1160
1211
|
}
|
|
1161
1212
|
}
|
|
1213
|
+
// `border-radius` / `border-color` arriving as core's longhands.
|
|
1214
|
+
//
|
|
1215
|
+
// Core expands both shorthands into four longhands before a *stylesheet*
|
|
1216
|
+
// declaration ever reaches a property (`_expandCssShorthand` in
|
|
1217
|
+
// ui/styling/css-selector), so our own shorthand `setNative` above only
|
|
1218
|
+
// ever fires for an inline `view.style.borderRadius = …`. A CSS class was
|
|
1219
|
+
// silently doing nothing. Each longhand below records its corner/side and
|
|
1220
|
+
// recomposes the whole shorthand string, which is the shape the native
|
|
1221
|
+
// side parses anyway.
|
|
1222
|
+
_borderRadiusCorner(corner, value) {
|
|
1223
|
+
// @ts-ignore
|
|
1224
|
+
const style = this._styleHelper;
|
|
1225
|
+
if (!style) {
|
|
1226
|
+
return;
|
|
1227
|
+
}
|
|
1228
|
+
let corners = this[borderRadiusCorners_];
|
|
1229
|
+
if (!corners) {
|
|
1230
|
+
corners = this[borderRadiusCorners_] = { tl: '0', tr: '0', br: '0', bl: '0' };
|
|
1231
|
+
}
|
|
1232
|
+
corners[corner] = lengthToCssString(value);
|
|
1233
|
+
// @ts-ignore
|
|
1234
|
+
style.borderRadius = `${corners.tl} ${corners.tr} ${corners.br} ${corners.bl}`;
|
|
1235
|
+
}
|
|
1236
|
+
[borderTopLeftRadiusProperty.setNative](value) {
|
|
1237
|
+
this._borderRadiusCorner('tl', value);
|
|
1238
|
+
}
|
|
1239
|
+
[borderTopRightRadiusProperty.setNative](value) {
|
|
1240
|
+
this._borderRadiusCorner('tr', value);
|
|
1241
|
+
}
|
|
1242
|
+
[borderBottomRightRadiusProperty.setNative](value) {
|
|
1243
|
+
this._borderRadiusCorner('br', value);
|
|
1244
|
+
}
|
|
1245
|
+
[borderBottomLeftRadiusProperty.setNative](value) {
|
|
1246
|
+
this._borderRadiusCorner('bl', value);
|
|
1247
|
+
}
|
|
1248
|
+
_borderSideColor(side, value) {
|
|
1249
|
+
let sides = this[borderSideColors_];
|
|
1250
|
+
if (!sides) {
|
|
1251
|
+
sides = this[borderSideColors_] = { t: 'transparent', r: 'transparent', b: 'transparent', l: 'transparent' };
|
|
1252
|
+
}
|
|
1253
|
+
sides[side] = colorToCssString(value);
|
|
1254
|
+
const shorthand = `${sides.t} ${sides.r} ${sides.b} ${sides.l}`;
|
|
1255
|
+
if (__ANDROID__) {
|
|
1256
|
+
// @ts-ignore
|
|
1257
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setBorderColor(this.nativeView, shorthand);
|
|
1258
|
+
}
|
|
1259
|
+
else if (__APPLE__) {
|
|
1260
|
+
// @ts-ignore
|
|
1261
|
+
this.nativeView?.style?.setBorderColor(shorthand);
|
|
1262
|
+
}
|
|
1263
|
+
else if (__WINDOWS__) {
|
|
1264
|
+
// @ts-ignore
|
|
1265
|
+
this._styleHelper?.setBorderColor(shorthand);
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
[borderTopColorProperty.setNative](value) {
|
|
1269
|
+
this._borderSideColor('t', value);
|
|
1270
|
+
}
|
|
1271
|
+
[borderRightColorProperty.setNative](value) {
|
|
1272
|
+
this._borderSideColor('r', value);
|
|
1273
|
+
}
|
|
1274
|
+
[borderBottomColorProperty.setNative](value) {
|
|
1275
|
+
this._borderSideColor('b', value);
|
|
1276
|
+
}
|
|
1277
|
+
[borderLeftColorProperty.setNative](value) {
|
|
1278
|
+
this._borderSideColor('l', value);
|
|
1279
|
+
}
|
|
1162
1280
|
set border(value) {
|
|
1163
1281
|
this.style.border = value;
|
|
1164
1282
|
}
|
|
@@ -2244,13 +2362,10 @@ export class Event {
|
|
|
2244
2362
|
return false;
|
|
2245
2363
|
}
|
|
2246
2364
|
get currentTarget() {
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
return this[native_]?.currentTarget;
|
|
2252
|
-
}
|
|
2253
|
-
return false;
|
|
2365
|
+
// DOM semantics: the element the listener is attached to, not the raw
|
|
2366
|
+
// native view. `_target` is set to that same owner at every dispatch
|
|
2367
|
+
// site (_registerNativeEvent), so reuse it here.
|
|
2368
|
+
return this['_target'];
|
|
2254
2369
|
}
|
|
2255
2370
|
stopImmediatePropagation() {
|
|
2256
2371
|
if (__ANDROID__) {
|
|
@@ -2276,13 +2391,31 @@ export class Event {
|
|
|
2276
2391
|
return this[native_]?.preventDefault();
|
|
2277
2392
|
}
|
|
2278
2393
|
}
|
|
2394
|
+
// Writable on purpose, unlike the DOM's read-only `Event.type`. Aliases
|
|
2395
|
+
// (e.g. 'tap') are folded onto the native name ('click') before the event
|
|
2396
|
+
// reaches JS; a host framework's DOM shim relabels it back to the name the
|
|
2397
|
+
// listener was registered under and re-dispatches, which needs a working
|
|
2398
|
+
// setter or the relabel is silently dropped and the listener never fires.
|
|
2279
2399
|
get type() {
|
|
2400
|
+
const override = this[eventType_];
|
|
2401
|
+
if (override !== undefined) {
|
|
2402
|
+
return override;
|
|
2403
|
+
}
|
|
2280
2404
|
if (__ANDROID__) {
|
|
2281
2405
|
return this[native_]?.getType();
|
|
2282
2406
|
}
|
|
2283
2407
|
return this[native_]?.type;
|
|
2284
2408
|
}
|
|
2285
|
-
set type(
|
|
2409
|
+
set type(value) {
|
|
2410
|
+
this[eventType_] = value;
|
|
2411
|
+
}
|
|
2412
|
+
// DOM MouseEvent.button: 0 = primary button. Mason's touch-originated
|
|
2413
|
+
// click has no native concept of mouse buttons, but callers checking
|
|
2414
|
+
// `e.button === 0` (e.g. a router's <Link> onClick guard) expect this.
|
|
2415
|
+
get button() {
|
|
2416
|
+
return 0;
|
|
2417
|
+
}
|
|
2418
|
+
set button(_) { }
|
|
2286
2419
|
get target() {
|
|
2287
2420
|
return this['_target'];
|
|
2288
2421
|
}
|