@triniwiz/nativescript-masonkit 1.0.0-beta.111 → 1.0.0-beta.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common.d.ts +12 -0
- package/common.js +72 -1
- package/common.js.map +1 -1
- package/css-colors.d.ts +17 -0
- package/css-colors.js +55 -0
- package/css-colors.js.map +1 -0
- package/css-keyframes.d.ts +41 -0
- package/css-keyframes.js +438 -0
- package/css-keyframes.js.map +1 -0
- package/css-shorthands.d.ts +13 -0
- package/css-shorthands.js +199 -0
- package/css-shorthands.js.map +1 -1
- package/index.d.ts +45 -0
- package/input/common.d.ts +18 -1
- package/input/common.js +46 -2
- package/input/common.js.map +1 -1
- package/input/index.android.d.ts +4 -1
- package/input/index.android.js +21 -1
- package/input/index.android.js.map +1 -1
- package/input/index.ios.d.ts +4 -1
- package/input/index.ios.js +19 -1
- package/input/index.ios.js.map +1 -1
- package/input/index.windows.d.ts +7 -1
- package/input/index.windows.js +43 -1
- package/input/index.windows.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/masonkit-release.aar +0 -0
- package/platforms/ios/Mason.xcframework/Info.plist +7 -7
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +60 -1
- 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 +27634 -24898
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +325 -221
- 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 +325 -221
- 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 +9308 -8879
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +120 -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 +27634 -24898
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +325 -221
- 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 +325 -221
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +27634 -24898
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +325 -221
- 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 +325 -221
- 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 +9302 -8873
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +8878 -8474
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/Mason-Swift.h +60 -1
- 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 +27634 -24898
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.private.swiftinterface +325 -221
- 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 +325 -221
- 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 +8799 -8371
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/Mason-Swift.h +60 -1
- 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 +27634 -24898
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.private.swiftinterface +325 -221
- 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 +325 -221
- 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 +8798 -8370
- 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 +17 -0
- package/properties.js +294 -3
- package/properties.js.map +1 -1
- package/scroll/index.ios.d.ts +1 -1
- package/scroll/index.ios.js +7 -2
- package/scroll/index.ios.js.map +1 -1
- package/style.d.ts +75 -4
- package/style.js +413 -8
- package/style.js.map +1 -1
- package/typings/android.d.ts +43 -0
- package/typings/objc!Mason.d.ts +41 -0
- package/typings/windows.d.ts +6 -0
- package/view/index.ios.js +7 -2
- package/view/index.ios.js.map +1 -1
- package/windows-mask.d.ts +70 -0
- package/windows-mask.js +492 -0
- package/windows-mask.js.map +1 -0
package/common.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { AddChildFromBuilder, CustomLayoutView, View as NSView, ViewBase as NSVi
|
|
|
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
4
|
import { fontInternalProperty, backgroundInternalProperty, borderTopLeftRadiusProperty, borderTopRightRadiusProperty, borderBottomRightRadiusProperty, borderBottomLeftRadiusProperty, borderTopColorProperty, borderRightColorProperty, borderBottomColorProperty, borderLeftColorProperty } from '@nativescript/core/ui/styling/style-properties';
|
|
5
|
+
import { originXProperty, originYProperty } from '@nativescript/core/ui/core/view';
|
|
5
6
|
import { Style } from './style';
|
|
6
7
|
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
8
|
import { isMasonView_, isTextChild_, isText_, native_, pseudoStyles_, eventType_ } from './symbols';
|
|
@@ -61,6 +62,13 @@ declare module '@nativescript/core/ui/styling/style' {
|
|
|
61
62
|
transform: string;
|
|
62
63
|
}
|
|
63
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* iOS: sets the frame of a Mason root, a Mason view whose parent is a core view. Core leaves
|
|
67
|
+
* the safe area to each view (`View._modifyNativeViewFrame`), so the root honours
|
|
68
|
+
* `iosOverflowSafeArea` the same way: when the frame grows past the safe area it lays out
|
|
69
|
+
* again at the new size. Like core views, it raises `layoutChanged` when the frame changes.
|
|
70
|
+
*/
|
|
71
|
+
export declare function setRootNativeViewFrame(view: any, nativeView: any, frame: CGRect): void;
|
|
64
72
|
export declare function windowsMemberKind(child: any): 'run' | 'break' | 'text' | 'box';
|
|
65
73
|
export declare function setWindowsInnerHTML(build: (view: any, html: string) => void): void;
|
|
66
74
|
export declare class ViewBase extends CustomLayoutView implements AddChildFromBuilder {
|
|
@@ -168,6 +176,8 @@ export declare class ViewBase extends CustomLayoutView implements AddChildFromBu
|
|
|
168
176
|
[floatProperty.setNative]: (value: any) => void;
|
|
169
177
|
[cornerShapeProperty.setNative]: (value: any) => void;
|
|
170
178
|
[boxShadowProperty.setNative]: (value: any) => void;
|
|
179
|
+
[originXProperty.setNative]: (value: number) => any;
|
|
180
|
+
[originYProperty.setNative]: (value: number) => any;
|
|
171
181
|
[transformProperty.setNative]: (value: any) => void;
|
|
172
182
|
_children: (NSView | {
|
|
173
183
|
text?: string;
|
|
@@ -444,6 +454,8 @@ export declare class ViewBase extends CustomLayoutView implements AddChildFromBu
|
|
|
444
454
|
get inset(): LengthAuto;
|
|
445
455
|
set textOverFlow(value: CoreTypes.TextOverflowType);
|
|
446
456
|
get textOverFlow(): CoreTypes.TextOverflowType;
|
|
457
|
+
updateNativeTransform(): any;
|
|
458
|
+
animate(options: any): any;
|
|
447
459
|
}
|
|
448
460
|
export declare function windowsFontSource(font: any): string;
|
|
449
461
|
export declare class TextBase extends ViewBase {
|
package/common.js
CHANGED
|
@@ -9,6 +9,8 @@ import { alignItemsProperty, alignSelfProperty, flexDirectionProperty, flexGrowP
|
|
|
9
9
|
import { fontInternalProperty, backgroundInternalProperty, borderTopLeftRadiusProperty, borderTopRightRadiusProperty, borderBottomRightRadiusProperty, borderBottomLeftRadiusProperty, borderTopColorProperty, borderRightColorProperty, borderBottomColorProperty, borderLeftColorProperty } from '@nativescript/core/ui/styling/style-properties';
|
|
10
10
|
import { _forceStyleUpdate } from './utils';
|
|
11
11
|
import { borderRadiusCorners, composeBorderRadius, isCssLength, parseCornerRadius, toCamelCase } from './css-shorthands';
|
|
12
|
+
import { originXProperty, originYProperty } from '@nativescript/core/ui/core/view';
|
|
13
|
+
import { animateTransforms } from './css-keyframes';
|
|
12
14
|
import { Style, nodeHelper, cssLengthToDip } from './style';
|
|
13
15
|
import { encodeBoxShadows, parseBoxShadows } from './box-shadow';
|
|
14
16
|
import { parseCssTransform } from './css-transform';
|
|
@@ -174,6 +176,32 @@ function windowsBreakRun(child) {
|
|
|
174
176
|
}
|
|
175
177
|
return run;
|
|
176
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* iOS: sets the frame of a Mason root, a Mason view whose parent is a core view. Core leaves
|
|
181
|
+
* the safe area to each view (`View._modifyNativeViewFrame`), so the root honours
|
|
182
|
+
* `iosOverflowSafeArea` the same way: when the frame grows past the safe area it lays out
|
|
183
|
+
* again at the new size. Like core views, it raises `layoutChanged` when the frame changes.
|
|
184
|
+
*/
|
|
185
|
+
export function setRootNativeViewFrame(view, nativeView, frame) {
|
|
186
|
+
const adjusted = view.applySafeAreaInsets(frame) ?? frame;
|
|
187
|
+
nativeView.frame = adjusted;
|
|
188
|
+
if (!CGRectEqualToRect(adjusted, frame)) {
|
|
189
|
+
// Each measure pass lays the root out at the safe-area size again, so check the
|
|
190
|
+
// computed size rather than whether the frame changed.
|
|
191
|
+
const width = Utils.layout.toDevicePixels(adjusted.size.width);
|
|
192
|
+
const height = Utils.layout.toDevicePixels(adjusted.size.height);
|
|
193
|
+
const layout = view.ios.node.computedLayout;
|
|
194
|
+
if (Math.round(layout.width) !== Math.round(width) || Math.round(layout.height) !== Math.round(height)) {
|
|
195
|
+
view.ios.mason_computeWithSize(width, height);
|
|
196
|
+
view.ios.mason_markRootComputeAppliedWithSize(width, height);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
const previous = view._masonRootFrame;
|
|
200
|
+
if (!previous || !CGRectEqualToRect(previous, adjusted)) {
|
|
201
|
+
view._masonRootFrame = adjusted;
|
|
202
|
+
view._raiseLayoutChangedEvent();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
177
205
|
export function windowsMemberKind(child) {
|
|
178
206
|
if (child[textNode_])
|
|
179
207
|
return 'run';
|
|
@@ -3158,6 +3186,49 @@ export class ViewBase extends CustomLayoutView {
|
|
|
3158
3186
|
}
|
|
3159
3187
|
}
|
|
3160
3188
|
}
|
|
3189
|
+
// Core's scale/rotate/translate on Windows. Core's own TransformGroup never renders on a Mason
|
|
3190
|
+
// element, so View.rotate etc. did nothing; they're set natively as one matrix instead. CSS
|
|
3191
|
+
// keyframes and animate() play them per frame (css-keyframes.ts).
|
|
3192
|
+
updateNativeTransform() {
|
|
3193
|
+
if (!__WINDOWS__) {
|
|
3194
|
+
// @ts-ignore
|
|
3195
|
+
return super.updateNativeTransform?.();
|
|
3196
|
+
}
|
|
3197
|
+
const native = this.nativeViewProtected;
|
|
3198
|
+
if (!native)
|
|
3199
|
+
return;
|
|
3200
|
+
const self = this;
|
|
3201
|
+
NativeScript.Mason.Css.SetTransforms(native, typeof self.scaleX === 'number' ? self.scaleX : 1, typeof self.scaleY === 'number' ? self.scaleY : 1, self.rotate || 0, self.translateX || 0, self.translateY || 0, self.originX ?? 0.5, self.originY ?? 0.5);
|
|
3202
|
+
}
|
|
3203
|
+
animate(options) {
|
|
3204
|
+
if (!__WINDOWS__ || !options || !('rotate' in options || 'scale' in options || 'translate' in options)) {
|
|
3205
|
+
return super.animate(options);
|
|
3206
|
+
}
|
|
3207
|
+
// Core's storyboards would animate a transform that doesn't show on a Mason view.
|
|
3208
|
+
const { rotate, scale, translate, ...rest } = options;
|
|
3209
|
+
const core = ['opacity', 'backgroundColor', 'width', 'height'].some((key) => key in rest) ? super.animate(rest) : null;
|
|
3210
|
+
const transforms = animateTransforms(this, options);
|
|
3211
|
+
const promise = Promise.all([core, transforms.done]).then(() => undefined);
|
|
3212
|
+
promise.cancel = () => {
|
|
3213
|
+
transforms.cancel();
|
|
3214
|
+
core?.cancel?.();
|
|
3215
|
+
};
|
|
3216
|
+
return promise;
|
|
3217
|
+
}
|
|
3218
|
+
[originXProperty.setNative](value) {
|
|
3219
|
+
if (!__WINDOWS__) {
|
|
3220
|
+
// @ts-ignore
|
|
3221
|
+
return super[originXProperty.setNative]?.(value);
|
|
3222
|
+
}
|
|
3223
|
+
this.updateNativeTransform();
|
|
3224
|
+
}
|
|
3225
|
+
[originYProperty.setNative](value) {
|
|
3226
|
+
if (!__WINDOWS__) {
|
|
3227
|
+
// @ts-ignore
|
|
3228
|
+
return super[originYProperty.setNative]?.(value);
|
|
3229
|
+
}
|
|
3230
|
+
this.updateNativeTransform();
|
|
3231
|
+
}
|
|
3161
3232
|
[transformProperty.setNative](value) {
|
|
3162
3233
|
// @ts-ignore
|
|
3163
3234
|
const style = this._styleHelper;
|
|
@@ -3176,7 +3247,7 @@ export class ViewBase extends CustomLayoutView {
|
|
|
3176
3247
|
NativeScript.Mason.Css.ClearTransform(nv);
|
|
3177
3248
|
else {
|
|
3178
3249
|
NativeScript.Mason.Css.ApplyTransform(nv, m[0], m[1], m[2], m[3], m[4], m[5]);
|
|
3179
|
-
nv
|
|
3250
|
+
NativeScript.Mason.Css.SetTransformOrigin(nv, this.originX ?? 0.5, this.originY ?? 0.5);
|
|
3180
3251
|
}
|
|
3181
3252
|
}
|
|
3182
3253
|
catch (_) { }
|