@octane-xplat/nativescript-mason-core 0.0.1 → 1.0.0-beta.1

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 (194) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +198 -2
  3. package/artifact-inventory.json +774 -0
  4. package/box-shadow.d.ts +10 -0
  5. package/box-shadow.js +48 -0
  6. package/common.d.ts +485 -0
  7. package/common.js +2659 -0
  8. package/css-colors.d.ts +17 -0
  9. package/css-colors.js +54 -0
  10. package/css-environment.d.ts +49 -0
  11. package/css-environment.js +309 -0
  12. package/css-filter.d.ts +17 -0
  13. package/css-filter.js +140 -0
  14. package/css-keyframes.d.ts +41 -0
  15. package/css-keyframes.js +437 -0
  16. package/css-math.d.ts +34 -0
  17. package/css-math.js +300 -0
  18. package/css-shorthands.d.ts +65 -0
  19. package/css-shorthands.js +673 -0
  20. package/css-transform.d.ts +6 -0
  21. package/css-transform.js +100 -0
  22. package/diagnostics.d.ts +51 -0
  23. package/diagnostics.js +52 -0
  24. package/display-density.d.ts +9 -0
  25. package/display-density.js +20 -0
  26. package/fonts.d.ts +20 -0
  27. package/fonts.js +88 -0
  28. package/foreign-layout.d.ts +6 -0
  29. package/foreign-layout.js +151 -0
  30. package/gradient-stops.d.ts +25 -0
  31. package/gradient-stops.js +112 -0
  32. package/index.android.d.ts +11 -0
  33. package/index.android.js +9 -0
  34. package/index.d.ts +12 -0
  35. package/index.ios.d.ts +11 -0
  36. package/index.ios.js +9 -0
  37. package/ios-host-README.md +124 -0
  38. package/layout-types.d.ts +192 -0
  39. package/mask.d.ts +54 -0
  40. package/mask.js +26 -0
  41. package/native-environment.android.d.ts +3 -0
  42. package/native-environment.android.js +69 -0
  43. package/native-environment.d.ts +3 -0
  44. package/native-environment.ios.d.ts +3 -0
  45. package/native-environment.ios.js +65 -0
  46. package/native-types-README.md +51 -0
  47. package/package.json +47 -6
  48. package/panel-helpers.d.ts +3 -0
  49. package/panel-helpers.js +8 -0
  50. package/platforms/android/MasonCore.aar +0 -0
  51. package/platforms/android/include.gradle +6 -0
  52. package/platforms/android/manifest.json +73 -0
  53. package/platforms/ios/FontManager.LICENSE +201 -0
  54. package/platforms/ios/MasonCore.xcframework/Info.plist +43 -0
  55. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/Mason.h +25 -0
  56. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/MasonCore-Swift.h +1739 -0
  57. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/mason_native.h +601 -0
  58. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Info.plist +0 -0
  59. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/MasonCore +0 -0
  60. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  61. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.abi.json +100095 -0
  62. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.private.swiftinterface +3174 -0
  63. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  64. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.swiftinterface +3174 -0
  65. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/module.modulemap +9 -0
  66. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/SDWebImage_SDWebImage.bundle/Info.plist +0 -0
  67. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/SDWebImage_SDWebImage.bundle/PrivacyInfo.xcprivacy +23 -0
  68. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/Mason.h +25 -0
  69. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/MasonCore-Swift.h +1739 -0
  70. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/mason_native.h +601 -0
  71. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Info.plist +0 -0
  72. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/MasonCore +0 -0
  73. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  74. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.abi.json +100095 -0
  75. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +3174 -0
  76. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  77. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +3174 -0
  78. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/module.modulemap +9 -0
  79. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/SDWebImage_SDWebImage.bundle/Info.plist +0 -0
  80. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/SDWebImage_SDWebImage.bundle/PrivacyInfo.xcprivacy +23 -0
  81. package/platforms/ios/Package.resolved +24 -0
  82. package/platforms/ios/SDWebImage.LICENSE +20 -0
  83. package/platforms/ios/build.xcconfig +4 -0
  84. package/platforms/ios/device-manifest.json +213 -0
  85. package/platforms/ios/include/FontManager/NSCFontDescriptors.h +36 -0
  86. package/platforms/ios/include/FontManager/NSCFontFace.h +98 -0
  87. package/platforms/ios/include/FontManager/NSCFontFaceSet.h +73 -0
  88. package/platforms/ios/include/FontManager/NSCFontManagerUmbrella.h +7 -0
  89. package/platforms/ios/include/FontManager/NSCFontParser.h +22 -0
  90. package/platforms/ios/include/FontManager/NSCFontRegex.h +4 -0
  91. package/platforms/ios/include/FontManager/NSCFontResolver.h +43 -0
  92. package/platforms/ios/include/FontManager/NSCFontStyle.h +27 -0
  93. package/platforms/ios/include/FontManager/NSCFontTypes.h +41 -0
  94. package/platforms/ios/include/SDWebImage/NSButton+WebCache.h +340 -0
  95. package/platforms/ios/include/SDWebImage/NSData+ImageContentType.h +63 -0
  96. package/platforms/ios/include/SDWebImage/NSImage+Compatibility.h +67 -0
  97. package/platforms/ios/include/SDWebImage/SDAnimatedImage.h +136 -0
  98. package/platforms/ios/include/SDWebImage/SDAnimatedImagePlayer.h +113 -0
  99. package/platforms/ios/include/SDWebImage/SDAnimatedImageRep.h +33 -0
  100. package/platforms/ios/include/SDWebImage/SDAnimatedImageView+WebCache.h +168 -0
  101. package/platforms/ios/include/SDWebImage/SDAnimatedImageView.h +125 -0
  102. package/platforms/ios/include/SDWebImage/SDCallbackQueue.h +59 -0
  103. package/platforms/ios/include/SDWebImage/SDDiskCache.h +146 -0
  104. package/platforms/ios/include/SDWebImage/SDGraphicsImageRenderer.h +84 -0
  105. package/platforms/ios/include/SDWebImage/SDImageAPNGCoder.h +19 -0
  106. package/platforms/ios/include/SDWebImage/SDImageAWebPCoder.h +23 -0
  107. package/platforms/ios/include/SDWebImage/SDImageCache.h +482 -0
  108. package/platforms/ios/include/SDWebImage/SDImageCacheConfig.h +153 -0
  109. package/platforms/ios/include/SDWebImage/SDImageCacheDefine.h +179 -0
  110. package/platforms/ios/include/SDWebImage/SDImageCachesManager.h +81 -0
  111. package/platforms/ios/include/SDWebImage/SDImageCoder.h +347 -0
  112. package/platforms/ios/include/SDWebImage/SDImageCoderHelper.h +251 -0
  113. package/platforms/ios/include/SDWebImage/SDImageCodersManager.h +58 -0
  114. package/platforms/ios/include/SDWebImage/SDImageFrame.h +44 -0
  115. package/platforms/ios/include/SDWebImage/SDImageGIFCoder.h +22 -0
  116. package/platforms/ios/include/SDWebImage/SDImageGraphics.h +28 -0
  117. package/platforms/ios/include/SDWebImage/SDImageHEICCoder.h +25 -0
  118. package/platforms/ios/include/SDWebImage/SDImageIOAnimatedCoder.h +65 -0
  119. package/platforms/ios/include/SDWebImage/SDImageIOCoder.h +30 -0
  120. package/platforms/ios/include/SDWebImage/SDImageLoader.h +146 -0
  121. package/platforms/ios/include/SDWebImage/SDImageLoadersManager.h +40 -0
  122. package/platforms/ios/include/SDWebImage/SDImageTransformer.h +283 -0
  123. package/platforms/ios/include/SDWebImage/SDMemoryCache.h +78 -0
  124. package/platforms/ios/include/SDWebImage/SDWebImage.h +91 -0
  125. package/platforms/ios/include/SDWebImage/SDWebImageCacheKeyFilter.h +35 -0
  126. package/platforms/ios/include/SDWebImage/SDWebImageCacheSerializer.h +39 -0
  127. package/platforms/ios/include/SDWebImage/SDWebImageCompat.h +102 -0
  128. package/platforms/ios/include/SDWebImage/SDWebImageDefine.h +420 -0
  129. package/platforms/ios/include/SDWebImage/SDWebImageDownloader.h +320 -0
  130. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderConfig.h +113 -0
  131. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderDecryptor.h +52 -0
  132. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderOperation.h +191 -0
  133. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderRequestModifier.h +72 -0
  134. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderResponseModifier.h +72 -0
  135. package/platforms/ios/include/SDWebImage/SDWebImageError.h +33 -0
  136. package/platforms/ios/include/SDWebImage/SDWebImageIndicator.h +119 -0
  137. package/platforms/ios/include/SDWebImage/SDWebImageManager.h +290 -0
  138. package/platforms/ios/include/SDWebImage/SDWebImageOperation.h +27 -0
  139. package/platforms/ios/include/SDWebImage/SDWebImageOptionsProcessor.h +78 -0
  140. package/platforms/ios/include/SDWebImage/SDWebImagePrefetcher.h +168 -0
  141. package/platforms/ios/include/SDWebImage/SDWebImageTransition.h +131 -0
  142. package/platforms/ios/include/SDWebImage/UIButton+WebCache.h +402 -0
  143. package/platforms/ios/include/SDWebImage/UIImage+ExtendedCacheData.h +24 -0
  144. package/platforms/ios/include/SDWebImage/UIImage+ForceDecode.h +52 -0
  145. package/platforms/ios/include/SDWebImage/UIImage+GIF.h +26 -0
  146. package/platforms/ios/include/SDWebImage/UIImage+MemoryCacheCost.h +27 -0
  147. package/platforms/ios/include/SDWebImage/UIImage+Metadata.h +104 -0
  148. package/platforms/ios/include/SDWebImage/UIImage+MultiFormat.h +81 -0
  149. package/platforms/ios/include/SDWebImage/UIImage+Transform.h +164 -0
  150. package/platforms/ios/include/SDWebImage/UIImageView+HighlightedWebCache.h +142 -0
  151. package/platforms/ios/include/SDWebImage/UIImageView+WebCache.h +209 -0
  152. package/platforms/ios/include/SDWebImage/UIView+WebCache.h +131 -0
  153. package/platforms/ios/include/SDWebImage/UIView+WebCacheOperation.h +52 -0
  154. package/platforms/ios/include/SDWebImage/UIView+WebCacheState.h +63 -0
  155. package/platforms/ios/include/module.modulemap +2 -0
  156. package/platforms/ios/manifest.json +132 -0
  157. package/platforms/ios/simulator-manifest.json +213 -0
  158. package/plugin-README.md +234 -0
  159. package/properties.d.ts +154 -0
  160. package/properties.js +2456 -0
  161. package/pseudo.d.ts +9 -0
  162. package/pseudo.js +57 -0
  163. package/scroll/index.android.d.ts +15 -0
  164. package/scroll/index.android.js +72 -0
  165. package/scroll/index.d.ts +5 -0
  166. package/scroll/index.ios.d.ts +18 -0
  167. package/scroll/index.ios.js +106 -0
  168. package/style.d.ts +768 -0
  169. package/style.js +7167 -0
  170. package/symbols.d.ts +25 -0
  171. package/symbols.js +41 -0
  172. package/tree/index.android.d.ts +11 -0
  173. package/tree/index.android.js +42 -0
  174. package/tree/index.d.ts +15 -0
  175. package/tree/index.ios.d.ts +26 -0
  176. package/tree/index.ios.js +53 -0
  177. package/typings/android-declarations.d.ts +4 -0
  178. package/typings/android.d.ts +9730 -0
  179. package/typings/manifest.json +45 -0
  180. package/typings/native.d.ts +5 -0
  181. package/typings/objc!FontManager.d.ts +389 -0
  182. package/typings/objc!MasonCore.d.ts +2472 -0
  183. package/typings/objc!SDWebImage.d.ts +3378 -0
  184. package/units.d.ts +29 -0
  185. package/units.js +44 -0
  186. package/utils/index.android.d.ts +211 -0
  187. package/utils/index.android.js +595 -0
  188. package/utils/index.ios.d.ts +222 -0
  189. package/utils/index.ios.js +790 -0
  190. package/view/index.android.d.ts +13 -0
  191. package/view/index.android.js +74 -0
  192. package/view/index.d.ts +2 -0
  193. package/view/index.ios.d.ts +24 -0
  194. package/view/index.ios.js +157 -0
package/pseudo.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { View } from '@nativescript/core';
2
+ type PseudoStyleMap = Record<string, Record<string, any>>;
3
+ /**
4
+ * Safely extract all pseudo styles for a view without touching live UI.
5
+ * Leverages the internal matching engine to handle hierarchy,
6
+ * specificity sorting, and media queries automatically.
7
+ */
8
+ export declare function compile(view: View): PseudoStyleMap;
9
+ export {};
package/pseudo.js ADDED
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Safely extract all pseudo styles for a view without touching live UI.
3
+ * Leverages the internal matching engine to handle hierarchy,
4
+ * specificity sorting, and media queries automatically.
5
+ */
6
+ export function compile(view) {
7
+ const pseudos = {};
8
+ const styleScope = view._styleScope;
9
+ if (!styleScope)
10
+ return pseudos;
11
+ // `matchSelectors` filters out selectors that don't match the view statically.
12
+ // Dynamic parts (like :hover, :active) always return true for `mayMatch`,
13
+ // so they are safely returned here without needing the live UI to be in that state!
14
+ //@ts-ignore
15
+ const match = styleScope.matchSelectors(view);
16
+ if (!match || !match.selectors)
17
+ return pseudos;
18
+ // Helper to extract pseudo-classes recursively.
19
+ // NativeScript stores them in `PseudoClassSelector` or nested in `ComplexSelector` / `SimpleSelectorSequence`
20
+ const getPseudoClasses = (sel) => {
21
+ const classes = [];
22
+ // Base case: it's a PseudoClassSelector
23
+ if (sel.cssPseudoClass) {
24
+ classes.push(sel.cssPseudoClass);
25
+ }
26
+ // Recursive case: it's a ComplexSelector or SimpleSelectorSequence
27
+ if (Array.isArray(sel.selectors)) {
28
+ for (const s of sel.selectors) {
29
+ classes.push(...getPseudoClasses(s));
30
+ }
31
+ }
32
+ return classes;
33
+ };
34
+ // Note: match.selectors is already sorted by CSS specificity internally!
35
+ // So as we build our `pseudos` object, heavier overrides are correctly applied last.
36
+ for (const selector of match.selectors) {
37
+ // Optimization: skip strictly static selectors (like standard `.btn` or `#myId`)
38
+ if (!selector.dynamic)
39
+ continue;
40
+ const ruleset = selector.ruleset;
41
+ if (!ruleset || !ruleset.declarations)
42
+ continue;
43
+ const states = getPseudoClasses(selector);
44
+ if (states.length === 0)
45
+ continue;
46
+ // Apply declarations for every pseudo-state found on this selector
47
+ for (const state of states) {
48
+ if (!pseudos[state]) {
49
+ pseudos[state] = {};
50
+ }
51
+ for (const decl of ruleset.declarations) {
52
+ pseudos[state][decl.property] = decl.value;
53
+ }
54
+ }
55
+ }
56
+ return pseudos;
57
+ }
@@ -0,0 +1,15 @@
1
+ import { ViewBase } from '../common';
2
+ import { style_ } from '../symbols';
3
+ export declare class Scroll extends ViewBase {
4
+ [style_]: any;
5
+ _inBatch: boolean;
6
+ constructor();
7
+ /** `<scroll>` treats default `visible` Y overflow as `auto`; HTML block elements opt out. */
8
+ get _visibleOverflowScrolls(): boolean;
9
+ get _view(): org.nativescript.mason.masonkit.Scroll;
10
+ get _styleHelper(): any;
11
+ createNativeView(): org.nativescript.mason.masonkit.Scroll;
12
+ get android(): org.nativescript.mason.masonkit.Scroll;
13
+ _addViewToNativeVisualTree(child: MasonChild, atIndex?: number): boolean;
14
+ _removeViewFromNativeVisualTree(view: MasonChild): void;
15
+ }
@@ -0,0 +1,72 @@
1
+ import { CSSType, Utils } from '@nativescript/core';
2
+ import { ViewBase } from '../common';
3
+ import { Style } from '../style';
4
+ import { Tree } from '../tree';
5
+ import { style_, isMasonView_, native_, isPlaceholder_ } from '../symbols';
6
+ let Scroll = class Scroll extends ViewBase {
7
+ constructor() {
8
+ super();
9
+ this._inBatch = false;
10
+ this[isMasonView_] = true;
11
+ }
12
+ /** `<scroll>` treats default `visible` Y overflow as `auto`; HTML block elements opt out. */
13
+ get _visibleOverflowScrolls() {
14
+ return true;
15
+ }
16
+ get _view() {
17
+ if (!this[native_]) {
18
+ const context = Utils.android.getCurrentActivity() || Utils.android.getApplicationContext();
19
+ const view = Tree.instance.createScrollView(context);
20
+ // Native default is true.
21
+ if (!this._visibleOverflowScrolls)
22
+ view.setVisibleOverflowScrolls(false);
23
+ this[native_] = view;
24
+ }
25
+ return this[native_];
26
+ }
27
+ get _styleHelper() {
28
+ if (this[style_] === undefined) {
29
+ this[style_] = Style.fromView(this, this._view);
30
+ }
31
+ return this[style_];
32
+ }
33
+ createNativeView() {
34
+ return this._view;
35
+ }
36
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
37
+ // @ts-ignore
38
+ get android() {
39
+ return this._view;
40
+ }
41
+ // @ts-ignore
42
+ _addViewToNativeVisualTree(child, atIndex = -1) {
43
+ const nativeView = this._view;
44
+ if (nativeView && (child.nativeViewProtected || child.android)) {
45
+ child._hasNativeView = true;
46
+ // Map the JS index onto the native children list (views attach lazily,
47
+ // so the raw index can run ahead of native state).
48
+ const { nativeIndex: index } = this._nativeAttachIndex(child, atIndex);
49
+ child._isMasonChild = true;
50
+ if (child[isPlaceholder_]) {
51
+ nativeView.addChildAt(child.android, index);
52
+ }
53
+ else {
54
+ nativeView.addView(child.nativeViewProtected, index);
55
+ this._masonAdoptForeign(child);
56
+ }
57
+ return true;
58
+ }
59
+ return false;
60
+ }
61
+ // @ts-ignore
62
+ _removeViewFromNativeVisualTree(view) {
63
+ this._invalidateAttachCursor();
64
+ // @ts-ignore
65
+ super._removeViewFromNativeVisualTree(view);
66
+ }
67
+ };
68
+ Scroll = __decorate([
69
+ CSSType('Scroll'),
70
+ __metadata("design:paramtypes", [])
71
+ ], Scroll);
72
+ export { Scroll };
@@ -0,0 +1,5 @@
1
+ import { ViewBase } from '../common';
2
+
3
+ export class Scroll extends ViewBase {
4
+ get _visibleOverflowScrolls(): boolean;
5
+ }
@@ -0,0 +1,18 @@
1
+ import { ViewBase } from '../common';
2
+ import { style_ } from '../symbols';
3
+ export declare class Scroll extends ViewBase {
4
+ [style_]: any;
5
+ constructor();
6
+ /** `<scroll>` treats default `visible` Y overflow as `auto`; HTML block elements opt out. */
7
+ get _visibleOverflowScrolls(): boolean;
8
+ get _view(): MasonUIView;
9
+ get _styleHelper(): any;
10
+ _inBatch: boolean;
11
+ createNativeView(): MasonUIView;
12
+ get ios(): MasonUIView;
13
+ onLayout(left: number, top: number, right: number, bottom: number): void;
14
+ onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
15
+ _addViewToNativeVisualTree(child: MasonChild, atIndex?: number): boolean;
16
+ _setNativeViewFrame(nativeView: any, frame: CGRect): void;
17
+ _removeViewFromNativeVisualTree(view: MasonChild): void;
18
+ }
@@ -0,0 +1,106 @@
1
+ import { CSSType } from '@nativescript/core';
2
+ import { ViewBase, setRootNativeViewFrame, setMeasuredFromNative } from '../common';
3
+ import { Style } from '../style';
4
+ import { Tree } from '../tree';
5
+ import { style_, isMasonView_, native_, isPlaceholder_ } from '../symbols';
6
+ let Scroll = class Scroll extends ViewBase {
7
+ constructor() {
8
+ super();
9
+ this._inBatch = false;
10
+ this[isMasonView_] = true;
11
+ }
12
+ /** `<scroll>` treats default `visible` Y overflow as `auto`; HTML block elements opt out. */
13
+ get _visibleOverflowScrolls() {
14
+ return true;
15
+ }
16
+ get _view() {
17
+ if (!this[native_]) {
18
+ // MasonUIView has its own scroll handling; UIScrollView breaks when nested.
19
+ const view = Tree.instance.createView();
20
+ // Native default is false; most block elements keep it.
21
+ if (this._visibleOverflowScrolls)
22
+ view.isScrollContainer = true;
23
+ this[native_] = view;
24
+ return view;
25
+ }
26
+ return this[native_];
27
+ }
28
+ get _styleHelper() {
29
+ if (this[style_] === undefined) {
30
+ this[style_] = Style.fromView(this, this._view);
31
+ }
32
+ return this[style_];
33
+ }
34
+ createNativeView() {
35
+ return this._view;
36
+ }
37
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
38
+ // @ts-ignore
39
+ get ios() {
40
+ return this._view;
41
+ }
42
+ onLayout(left, top, right, bottom) {
43
+ super.onLayout(left, top, right, bottom);
44
+ // Mason descendants were placed by the native compute; only a root's
45
+ // non-Mason views still need core's layout.
46
+ if (!this._masonPlacedNatively) {
47
+ this._masonLayoutForeignDescendants();
48
+ }
49
+ }
50
+ onMeasure(widthMeasureSpec, heightMeasureSpec) {
51
+ const nativeView = this._view;
52
+ if (nativeView) {
53
+ // As a root, the box is the viewport: clamped to the specs so the content overflows it and scrolls.
54
+ // @ts-ignore
55
+ setMeasuredFromNative(this, nativeView.mason_measure(widthMeasureSpec, heightMeasureSpec, !!this.parent && !this.parent[isMasonView_], true));
56
+ }
57
+ }
58
+ // @ts-ignore
59
+ _addViewToNativeVisualTree(child, atIndex = -1) {
60
+ const nativeView = this._view;
61
+ if (nativeView && (child.nativeViewProtected || child.ios)) {
62
+ child._hasNativeView = true;
63
+ // Map the JS index onto the native children list (views attach lazily,
64
+ // so the raw index can run ahead of native state).
65
+ const { nativeIndex: index } = this._nativeAttachIndex(child, atIndex);
66
+ child._isMasonChild = true;
67
+ if (child[isPlaceholder_]) {
68
+ // @ts-ignore
69
+ nativeView.mason_addChildAtElement(child.ios, index);
70
+ }
71
+ else {
72
+ nativeView.addViewAt(child.nativeViewProtected, index);
73
+ this._masonAdoptForeign(child);
74
+ this._masonMeasureForeign(child);
75
+ }
76
+ return true;
77
+ }
78
+ return false;
79
+ }
80
+ _setNativeViewFrame(nativeView, frame) {
81
+ if (this.parent?.[isMasonView_]) {
82
+ nativeView.frame = frame;
83
+ }
84
+ else {
85
+ setRootNativeViewFrame(this, nativeView, frame);
86
+ }
87
+ }
88
+ // @ts-ignore
89
+ _removeViewFromNativeVisualTree(view) {
90
+ this._invalidateAttachCursor();
91
+ // Inverse of `_addViewToNativeVisualTree` — unlink the mason node so
92
+ // removal detaches the Rust node + native view rather than orphaning it.
93
+ const nativeView = this._view;
94
+ if (nativeView && view.nativeViewProtected && typeof nativeView.removeView === 'function') {
95
+ nativeView.removeView(view.nativeViewProtected);
96
+ this._masonRequestLayoutAfterRemoval();
97
+ }
98
+ // @ts-ignore
99
+ super._removeViewFromNativeVisualTree(view);
100
+ }
101
+ };
102
+ Scroll = __decorate([
103
+ CSSType('Scroll'),
104
+ __metadata("design:paramtypes", [])
105
+ ], Scroll);
106
+ export { Scroll };