@legendapp/spark 0.0.1 → 0.0.3

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 (141) hide show
  1. package/native.d.cts +6 -3
  2. package/package.json +36 -28
  3. package/patches/dependencies.json +252 -0
  4. package/patches/expo-application@55.0.19.patch +54 -0
  5. package/patches/expo-blur@55.0.18.patch +130 -0
  6. package/patches/expo-device@55.0.21.patch +149 -0
  7. package/patches/expo-font@55.0.8.patch +55 -0
  8. package/patches/expo-glass-effect@55.0.11.patch +304 -0
  9. package/patches/expo-haptics@55.0.18.patch +54 -0
  10. package/patches/expo-image-manipulator@55.0.21.patch +312 -0
  11. package/patches/expo-image-picker@55.0.24.patch +327 -0
  12. package/patches/expo-image@55.0.11.patch +158 -0
  13. package/patches/expo-keep-awake@55.0.8.patch +41 -0
  14. package/patches/expo-localization@55.0.19.patch +32 -0
  15. package/patches/expo-location@55.1.15.patch +190 -0
  16. package/patches/expo-symbols@55.0.9.patch +286 -0
  17. package/patches/expo-system-ui@55.0.22.patch +61 -0
  18. package/patches/expo-web-browser@55.0.20.patch +13 -0
  19. package/patches/react-native-app-logs@0.3.1.patch +20 -0
  20. package/patches/react-native-blurhash@2.1.3.patch +318 -0
  21. package/patches/react-native-community-blur@4.4.1.patch +415 -0
  22. package/patches/react-native-community-datetimepicker@9.2.2.patch +320 -0
  23. package/patches/react-native-enriched-markdown@1.1.1.patch +141 -10
  24. package/patches/react-native-fast-image@10.9.9.patch +131 -0
  25. package/patches/react-native-graph@1.4.0.patch +157 -0
  26. package/patches/react-native-keyboard-controller@1.22.9.patch +16 -0
  27. package/patches/react-native-masked-view-masked-view@0.3.2.patch +140 -0
  28. package/patches/react-native-mmkv@4.3.2.patch +40 -0
  29. package/patches/react-native-nitro-fetch@1.9.0.patch +130 -0
  30. package/patches/react-native-nitro-zxing@0.3.0.patch +13 -0
  31. package/patches/react-native-quick-base64@3.0.1.patch +13 -0
  32. package/patches/react-native-quick-crypto@1.1.9.patch +31 -0
  33. package/patches/react-native-release-profiler@0.4.5.patch +37 -0
  34. package/patches/react-native-screen-corner-radius@0.2.3.patch +13 -0
  35. package/patches/react-native-screens@4.23.0.patch +160 -0
  36. package/patches/react-native-svg@15.15.3.patch +31 -0
  37. package/patches/react-native-unistyles@3.6.0.patch +203 -0
  38. package/patches/react-native-worklets-core@1.6.3.patch +13 -0
  39. package/patches/react-navigation-native-stack@7.21.0.patch +16 -0
  40. package/patches/sentry-react-native@8.32.0.patch +76 -0
  41. package/skills/spark/UPGRADING.md +122 -3
  42. package/vendor/node_modules/@legendapp/spark-ai/package.json +5 -5
  43. package/vendor/node_modules/@legendapp/spark-audio/package.json +5 -5
  44. package/vendor/node_modules/@legendapp/spark-audio/src/index.macos.ts +1 -0
  45. package/vendor/node_modules/@legendapp/spark-auth-session/package.json +6 -6
  46. package/vendor/node_modules/@legendapp/spark-auth-session/src/index.macos.ts +1 -0
  47. package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +2 -2
  48. package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +17 -5
  49. package/vendor/node_modules/@legendapp/spark-cli/dist/cli-arguments.js +4 -2
  50. package/vendor/node_modules/@legendapp/spark-cli/dist/create.js +8 -4
  51. package/vendor/node_modules/@legendapp/spark-cli/dist/dependency-pins.js +45 -1
  52. package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +15 -3
  53. package/vendor/node_modules/@legendapp/spark-cli/dist/examples.js +2 -2
  54. package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-patch.cjs +3 -3
  55. package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-preload.cjs +3 -0
  56. package/vendor/node_modules/@legendapp/spark-cli/dist/index.js +26 -7
  57. package/vendor/node_modules/@legendapp/spark-cli/dist/metro.cjs +3 -1
  58. package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.cjs +20 -5
  59. package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.d.cts +1 -0
  60. package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +10 -2
  61. package/vendor/node_modules/@legendapp/spark-cli/dist/native-patch-preflight.js +3 -3
  62. package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +28 -10
  63. package/vendor/node_modules/@legendapp/spark-cli/dist/release-runner-root.js +108 -0
  64. package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +13 -13
  65. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-input-cache.js +140 -0
  66. package/vendor/node_modules/@legendapp/spark-cli/dist/watchman.js +12 -0
  67. package/vendor/node_modules/@legendapp/spark-cli/dist/windows-geometry.js +2 -2
  68. package/vendor/node_modules/@legendapp/spark-cli/dist/windows.js +1 -1
  69. package/vendor/node_modules/@legendapp/spark-cli/package.json +3 -3
  70. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/desktop.config.json +1 -1
  71. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +27 -25
  72. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/desktop.config.json +1 -1
  73. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +35 -33
  74. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +29 -27
  75. package/vendor/node_modules/@legendapp/spark-clipboard/package.json +5 -5
  76. package/vendor/node_modules/@legendapp/spark-clipboard/src/index.macos.ts +1 -0
  77. package/vendor/node_modules/@legendapp/spark-codex/package.json +4 -4
  78. package/vendor/node_modules/@legendapp/spark-commands/package.json +7 -7
  79. package/vendor/node_modules/@legendapp/spark-context-menu/package.json +4 -4
  80. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.mm +7 -2
  81. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.mm +64 -2
  82. package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +3 -3
  83. package/vendor/node_modules/@legendapp/spark-desktop-config/accessibility-state.cjs +2 -2
  84. package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.cjs +12 -0
  85. package/vendor/node_modules/@legendapp/spark-desktop-config/autolinking.cjs +7 -6
  86. package/vendor/node_modules/@legendapp/spark-desktop-config/config.d.cts +1 -1
  87. package/vendor/node_modules/@legendapp/spark-desktop-config/fabric-lifecycle.cjs +1 -1
  88. package/vendor/node_modules/@legendapp/spark-desktop-config/keyboard-events.cjs +2 -2
  89. package/vendor/node_modules/@legendapp/spark-desktop-config/macos-host.cjs +39 -0
  90. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +73 -20
  91. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.d.cts +2 -1
  92. package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +8 -6
  93. package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-scroll-view.cjs +2 -2
  94. package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-text-alignment.cjs +2 -2
  95. package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-text-input-alignment.cjs +2 -2
  96. package/vendor/node_modules/@legendapp/spark-desktop-config/text-input-accessibility.cjs +2 -2
  97. package/vendor/node_modules/@legendapp/spark-desktop-host/macos/AppDelegate.h +6 -0
  98. package/vendor/node_modules/@legendapp/spark-desktop-host/macos/Main.storyboard +684 -0
  99. package/vendor/node_modules/@legendapp/spark-desktop-host/macos/main.m +5 -0
  100. package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +3 -2
  101. package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +5 -5
  102. package/vendor/node_modules/@legendapp/spark-desktop-links/src/index.macos.ts +1 -0
  103. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +4 -4
  104. package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.mm +68 -17
  105. package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +5 -5
  106. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos-adapter.ts +2 -1
  107. package/vendor/node_modules/@legendapp/spark-documents/package.json +9 -9
  108. package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +4 -4
  109. package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +4 -4
  110. package/vendor/node_modules/@legendapp/spark-file-system/macos/RNDesktopFileSystem.mm +14 -5
  111. package/vendor/node_modules/@legendapp/spark-file-system/package.json +4 -4
  112. package/vendor/node_modules/@legendapp/spark-file-system/src/index.ts +1 -1
  113. package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +4 -4
  114. package/vendor/node_modules/@legendapp/spark-html/package.json +4 -4
  115. package/vendor/node_modules/@legendapp/spark-markdown/package.json +4 -4
  116. package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +4 -4
  117. package/vendor/node_modules/@legendapp/spark-native-menu/package.json +4 -4
  118. package/vendor/node_modules/@legendapp/spark-notifications/package.json +4 -4
  119. package/vendor/node_modules/@legendapp/spark-processes/macos/RNDesktopProcesses.mm +110 -19
  120. package/vendor/node_modules/@legendapp/spark-processes/package.json +4 -4
  121. package/vendor/node_modules/@legendapp/spark-processes/src/index.ts +17 -3
  122. package/vendor/node_modules/@legendapp/spark-processes/src/types.ts +6 -0
  123. package/vendor/node_modules/@legendapp/spark-rich-text/package.json +4 -4
  124. package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +5 -5
  125. package/vendor/node_modules/@legendapp/spark-secure-storage/src/index.macos.ts +1 -0
  126. package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
  127. package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +6 -6
  128. package/vendor/node_modules/@legendapp/spark-sqlite/package.json +12 -5
  129. package/vendor/node_modules/@legendapp/spark-system/package.json +4 -4
  130. package/vendor/node_modules/@legendapp/spark-tray/package.json +4 -4
  131. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.mm +82 -18
  132. package/vendor/node_modules/@legendapp/spark-ui/package.json +6 -6
  133. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SidebarSplitViewNativeComponent.ts +4 -0
  134. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/index.tsx +11 -9
  135. package/vendor/node_modules/@legendapp/spark-ui/src/index.android.tsx +20 -10
  136. package/vendor/node_modules/@legendapp/spark-ui/src/index.ios.tsx +15 -10
  137. package/vendor/node_modules/@legendapp/spark-ui/src/index.macos.tsx +1 -0
  138. package/vendor/node_modules/@legendapp/spark-updates/package.json +4 -4
  139. package/vendor/node_modules/@legendapp/spark-webview/package.json +11 -4
  140. package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
  141. package/camera.ts +0 -13
@@ -0,0 +1,157 @@
1
+ diff --git a/lib/module/AnimatedLineGraph.js b/lib/module/AnimatedLineGraph.js
2
+ index f08d7f4..5621a8b 100644
3
+ --- a/lib/module/AnimatedLineGraph.js
4
+ +++ b/lib/module/AnimatedLineGraph.js
5
+ @@ -77,14 +77,14 @@ export function AnimatedLineGraph({
6
+ setHeight(Math.round(layout.height));
7
+ }, []);
8
+ const straightLine = useMemo(() => {
9
+ - const path = Skia.Path.Make();
10
+ + const path = Skia.PathBuilder.Make();
11
+ path.moveTo(0, height / 2);
12
+ for (let i = 0; i < width - 1; i += 2) {
13
+ const x = i;
14
+ const y = height / 2;
15
+ path.cubicTo(x, y, x, y, x, y);
16
+ }
17
+ - return path;
18
+ + return path.build();
19
+ }, [height, width]);
20
+ const paths = useSharedValue({});
21
+ const gradientPaths = useSharedValue({});
22
+ diff --git a/lib/module/CreateGraphPath.js b/lib/module/CreateGraphPath.js
23
+ index cad0ca6..28e70c7 100644
24
+ --- a/lib/module/CreateGraphPath.js
25
+ +++ b/lib/module/CreateGraphPath.js
26
+ @@ -49,13 +49,14 @@ function createGraphPathBase({
27
+ canvasWidth: width,
28
+ shouldFillGradient
29
+ }) {
30
+ - const path = Skia.Path.Make();
31
+ + // Skia 2 builds paths with PathBuilder; SkPath itself is immutable.
32
+ + const builder = Skia.PathBuilder.Make();
33
+
34
+ // Canvas width substracted by the horizontal padding => Actual drawing width
35
+ const drawingWidth = width - 2 * horizontalPadding;
36
+ // Canvas height substracted by the vertical padding => Actual drawing height
37
+ const drawingHeight = height - 2 * verticalPadding;
38
+ - if (graphData[0] == null) return path;
39
+ + if (graphData[0] == null) return builder.build();
40
+ const points = [];
41
+ const startX = getXInRange(drawingWidth, graphData[0].date, range.x) + horizontalPadding;
42
+ const endX = getXInRange(drawingWidth, graphData[graphData.length - 1].date, range.x) + horizontalPadding;
43
+ @@ -91,7 +92,7 @@ function createGraphPathBase({
44
+ const point = points[i];
45
+
46
+ // first point needs to start the path
47
+ - if (i === 0) path.moveTo(point.x, point.y);
48
+ + if (i === 0) builder.moveTo(point.x, point.y);
49
+ const prev = points[i - 1];
50
+ const prevPrev = points[i - 2];
51
+ if (prev == null) continue;
52
+ @@ -103,15 +104,19 @@ function createGraphPathBase({
53
+ const cp2y = (p0.y + 2 * p1.y) / 3;
54
+ const cp3x = (p0.x + 4 * p1.x + point.x) / 6;
55
+ const cp3y = (p0.y + 4 * p1.y + point.y) / 6;
56
+ - path.cubicTo(cp1x, cp1y, cp2x, cp2y, cp3x, cp3y);
57
+ + builder.cubicTo(cp1x, cp1y, cp2x, cp2y, cp3x, cp3y);
58
+ if (i === points.length - 1) {
59
+ - path.cubicTo(point.x, point.y, point.x, point.y, point.x, point.y);
60
+ + builder.cubicTo(point.x, point.y, point.x, point.y, point.x, point.y);
61
+ }
62
+ }
63
+ + const path = builder.build();
64
+ if (!shouldFillGradient) return path;
65
+ - const gradientPath = path.copy();
66
+ - gradientPath.lineTo(endX, height + verticalPadding);
67
+ - gradientPath.lineTo(0 + horizontalPadding, height + verticalPadding);
68
+ +
69
+ + // build() leaves the builder intact, so the gradient continues the line path.
70
+ + const gradientPath = builder
71
+ + .lineTo(endX, height + verticalPadding)
72
+ + .lineTo(0 + horizontalPadding, height + verticalPadding)
73
+ + .build();
74
+ return {
75
+ path: path,
76
+ gradientPath: gradientPath
77
+ diff --git a/src/AnimatedLineGraph.tsx b/src/AnimatedLineGraph.tsx
78
+ index 6b12417..f1b4b0a 100644
79
+ --- a/src/AnimatedLineGraph.tsx
80
+ +++ b/src/AnimatedLineGraph.tsx
81
+ @@ -133,7 +133,7 @@ export function AnimatedLineGraph({
82
+ );
83
+
84
+ const straightLine = useMemo(() => {
85
+ - const path = Skia.Path.Make();
86
+ + const path = Skia.PathBuilder.Make();
87
+ path.moveTo(0, height / 2);
88
+ for (let i = 0; i < width - 1; i += 2) {
89
+ const x = i;
90
+ @@ -141,7 +141,7 @@ export function AnimatedLineGraph({
91
+ path.cubicTo(x, y, x, y, x, y);
92
+ }
93
+
94
+ - return path;
95
+ + return path.build();
96
+ }, [height, width]);
97
+
98
+ const paths = useSharedValue<{ from?: SkPath; to?: SkPath }>({});
99
+ diff --git a/src/CreateGraphPath.ts b/src/CreateGraphPath.ts
100
+ index 0c7f1c0..38c4065 100644
101
+ --- a/src/CreateGraphPath.ts
102
+ +++ b/src/CreateGraphPath.ts
103
+ @@ -144,14 +144,15 @@ function createGraphPathBase({
104
+ }: GraphPathConfigWithGradient | GraphPathConfigWithoutGradient):
105
+ | SkPath
106
+ | GraphPathWithGradient {
107
+ - const path = Skia.Path.Make();
108
+ + // Skia 2 builds paths with PathBuilder; SkPath itself is immutable.
109
+ + const builder = Skia.PathBuilder.Make();
110
+
111
+ // Canvas width substracted by the horizontal padding => Actual drawing width
112
+ const drawingWidth = width - 2 * horizontalPadding;
113
+ // Canvas height substracted by the vertical padding => Actual drawing height
114
+ const drawingHeight = height - 2 * verticalPadding;
115
+
116
+ - if (graphData[0] == null) return path;
117
+ + if (graphData[0] == null) return builder.build();
118
+
119
+ const points: SkPoint[] = [];
120
+
121
+ @@ -215,7 +216,7 @@ function createGraphPathBase({
122
+ const point = points[i]!;
123
+
124
+ // first point needs to start the path
125
+ - if (i === 0) path.moveTo(point.x, point.y);
126
+ + if (i === 0) builder.moveTo(point.x, point.y);
127
+
128
+ const prev = points[i - 1];
129
+ const prevPrev = points[i - 2];
130
+ @@ -231,19 +232,21 @@ function createGraphPathBase({
131
+ const cp3x = (p0.x + 4 * p1.x + point.x) / 6;
132
+ const cp3y = (p0.y + 4 * p1.y + point.y) / 6;
133
+
134
+ - path.cubicTo(cp1x, cp1y, cp2x, cp2y, cp3x, cp3y);
135
+ + builder.cubicTo(cp1x, cp1y, cp2x, cp2y, cp3x, cp3y);
136
+
137
+ if (i === points.length - 1) {
138
+ - path.cubicTo(point.x, point.y, point.x, point.y, point.x, point.y);
139
+ + builder.cubicTo(point.x, point.y, point.x, point.y, point.x, point.y);
140
+ }
141
+ }
142
+
143
+ + const path = builder.build();
144
+ if (!shouldFillGradient) return path;
145
+
146
+ - const gradientPath = path.copy();
147
+ -
148
+ - gradientPath.lineTo(endX, height + verticalPadding);
149
+ - gradientPath.lineTo(0 + horizontalPadding, height + verticalPadding);
150
+ + // build() leaves the builder intact, so the gradient continues the line path.
151
+ + const gradientPath = builder
152
+ + .lineTo(endX, height + verticalPadding)
153
+ + .lineTo(0 + horizontalPadding, height + verticalPadding)
154
+ + .build();
155
+
156
+ return { path: path, gradientPath: gradientPath };
157
+ }
@@ -0,0 +1,16 @@
1
+ diff --git a/src/bindings.macos.ts b/src/bindings.macos.ts
2
+ new file mode 100644
3
+ index 0000000..30108ce
4
+ --- /dev/null
5
+ +++ b/src/bindings.macos.ts
6
+ @@ -0,0 +1,2 @@
7
+ +// macOS has no software keyboard: use the no-op bindings that web uses instead of the native module.
8
+ +export * from "./bindings.ts";
9
+ diff --git a/src/reanimated.macos.ts b/src/reanimated.macos.ts
10
+ new file mode 100644
11
+ index 0000000..fd25177
12
+ --- /dev/null
13
+ +++ b/src/reanimated.macos.ts
14
+ @@ -0,0 +1,2 @@
15
+ +// macOS has no software keyboard: keyboard handlers are no-ops, as on web.
16
+ +export * from "./reanimated.ts";
@@ -0,0 +1,140 @@
1
+ diff --git a/RNCMaskedView.podspec b/RNCMaskedView.podspec
2
+ index b29590c..6eefd94 100644
3
+ --- a/RNCMaskedView.podspec
4
+ +++ b/RNCMaskedView.podspec
5
+ @@ -10,7 +10,7 @@ Pod::Spec.new do |s|
6
+
7
+ s.authors = package['author']
8
+ s.homepage = package['homepage']
9
+ - s.platforms = { :ios => "9.0", :tvos => "9.0" }
10
+ + s.platforms = { :ios => "9.0", :tvos => "9.0", :osx => "14.0" }
11
+
12
+ s.source = { :git => "https://github.com/react-native-masked-view/masked-view.git", :tag => "v#{s.version}" }
13
+ s.source_files = "ios/**/*.{h,m}"
14
+ diff --git a/ios/RNCMaskedView.h b/ios/RNCMaskedView.h
15
+ index afaa6c3..9f80599 100644
16
+ --- a/ios/RNCMaskedView.h
17
+ +++ b/ios/RNCMaskedView.h
18
+ @@ -5,7 +5,10 @@
19
+ * LICENSE file in the root directory of this source tree.
20
+ */
21
+
22
+ +#include <TargetConditionals.h>
23
+ +#if !TARGET_OS_OSX
24
+ #import <UIKit/UIKit.h>
25
+ +#endif
26
+
27
+ #import <React/RCTView.h>
28
+
29
+ diff --git a/ios/RNCMaskedView.m b/ios/RNCMaskedView.m
30
+ index e8e51ac..dda4fa1 100644
31
+ --- a/ios/RNCMaskedView.m
32
+ +++ b/ios/RNCMaskedView.m
33
+ @@ -9,6 +9,86 @@
34
+
35
+ #import <React/UIView+React.h>
36
+
37
+ +#if TARGET_OS_OSX
38
+ +#import <QuartzCore/QuartzCore.h>
39
+ +
40
+ +// AppKit has no maskView. The mask stays a live view inside an invisible host so it keeps drawing;
41
+ +// each frame it is rendered into the layer mask of a container holding the other children.
42
+ +@implementation RNCMaskedView {
43
+ + RCTUIView *_maskHost;
44
+ + RCTUIView *_contentView;
45
+ + CALayer *_maskLayer;
46
+ + CADisplayLink *_displayLink;
47
+ +}
48
+ +
49
+ +- (instancetype)initWithFrame:(NSRect)frame
50
+ +{
51
+ + if (self = [super initWithFrame:frame]) {
52
+ + _maskHost = [[RCTUIView alloc] initWithFrame:self.bounds];
53
+ + _maskHost.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
54
+ + _maskHost.alphaValue = 0;
55
+ + _contentView = [[RCTUIView alloc] initWithFrame:self.bounds];
56
+ + _contentView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
57
+ + _contentView.wantsLayer = YES;
58
+ + _maskLayer = [CALayer layer];
59
+ + _contentView.layer.mask = _maskLayer;
60
+ + [self addSubview:_maskHost];
61
+ + [self addSubview:_contentView];
62
+ + }
63
+ + return self;
64
+ +}
65
+ +
66
+ +- (void)viewDidMoveToWindow
67
+ +{
68
+ + [super viewDidMoveToWindow];
69
+ + [_displayLink invalidate];
70
+ + _displayLink = nil;
71
+ + if (self.window) {
72
+ + _displayLink = [self displayLinkWithTarget:self selector:@selector(updateMask)];
73
+ + [_displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
74
+ + }
75
+ +}
76
+ +
77
+ +- (void)updateMask
78
+ +{
79
+ + NSView *maskView = _maskHost.subviews.firstObject;
80
+ + CGSize size = _contentView.bounds.size;
81
+ + CGFloat scale = self.window.backingScaleFactor ?: 1;
82
+ + CGImageRef image = NULL;
83
+ + if (maskView.layer && size.width > 0 && size.height > 0) {
84
+ + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
85
+ + CGContextRef context = CGBitmapContextCreate(NULL, ceil(size.width * scale), ceil(size.height * scale), 8, 0, colorSpace, kCGImageAlphaPremultipliedLast);
86
+ + CGColorSpaceRelease(colorSpace);
87
+ + // The mask image is drawn unflipped; React's views are flipped.
88
+ + CGContextTranslateCTM(context, 0, ceil(size.height * scale));
89
+ + CGContextScaleCTM(context, scale, -scale);
90
+ + [maskView.layer renderInContext:context];
91
+ + image = CGBitmapContextCreateImage(context);
92
+ + CGContextRelease(context);
93
+ + }
94
+ + [CATransaction begin];
95
+ + [CATransaction setDisableActions:YES];
96
+ + _maskLayer.frame = _contentView.layer.bounds;
97
+ + _maskLayer.contents = (__bridge_transfer id)image;
98
+ + [CATransaction commit];
99
+ +}
100
+ +
101
+ +- (void)didUpdateReactSubviews
102
+ +{
103
+ + // RNCMaskedView expects that the first subview rendered is the mask.
104
+ + NSArray<NSView *> *subviews = self.reactSubviews;
105
+ + if (subviews.firstObject) {
106
+ + [_maskHost addSubview:subviews.firstObject];
107
+ + }
108
+ + for (NSUInteger i = 1; i < subviews.count; i++) {
109
+ + [_contentView addSubview:subviews[i]];
110
+ + }
111
+ + [self updateMask];
112
+ +}
113
+ +
114
+ +@end
115
+ +
116
+ +#else
117
+ @implementation RNCMaskedView
118
+
119
+ - (void)didUpdateReactSubviews
120
+ @@ -32,3 +112,4 @@ - (void)displayLayer:(CALayer *)layer
121
+ }
122
+
123
+ @end
124
+ +#endif
125
+ diff --git a/ios/RNCMaskedViewManager.m b/ios/RNCMaskedViewManager.m
126
+ index 339ca26..977cbbd 100644
127
+ --- a/ios/RNCMaskedViewManager.m
128
+ +++ b/ios/RNCMaskedViewManager.m
129
+ @@ -13,7 +13,11 @@ @implementation RNCMaskedViewManager
130
+
131
+ RCT_EXPORT_MODULE()
132
+
133
+ +#if TARGET_OS_OSX
134
+ +- (RCTPlatformView *)view
135
+ +#else
136
+ - (UIView *)view
137
+ +#endif
138
+ {
139
+ return [RNCMaskedView new];
140
+ }
@@ -0,0 +1,40 @@
1
+ diff --git a/ios/HybridMMKVPlatformContext.swift b/ios/HybridMMKVPlatformContext.swift
2
+ index 0d19d4a..0644cbc 100644
3
+ --- a/ios/HybridMMKVPlatformContext.swift
4
+ +++ b/ios/HybridMMKVPlatformContext.swift
5
+ @@ -12,6 +12,8 @@ class HybridMMKVPlatformContext: HybridMMKVPlatformContextSpec {
6
+ static var directory: FileManager.SearchPathDirectory {
7
+ #if os(tvOS)
8
+ return .cachesDirectory
9
+ +#elseif os(macOS)
10
+ + return .applicationSupportDirectory
11
+ #else
12
+ return .documentDirectory
13
+ #endif
14
+ @@ -25,10 +27,26 @@ class HybridMMKVPlatformContext: HybridMMKVPlatformContextSpec {
15
+ }
16
+
17
+ // append /mmkv to it
18
+ +#if os(macOS)
19
+ + // Application Support is shared by every Mac app, so scope MMKV like Spark's other app data.
20
+ + let basePath = documentsPath.appendingPathComponent(Self.namespace, isDirectory: true).appendingPathComponent("mmkv", conformingTo: .directory)
21
+ +#else
22
+ let basePath = documentsPath.appendingPathComponent("mmkv", conformingTo: .directory)
23
+ +#endif
24
+ return basePath.path
25
+ }
26
+
27
+ +#if os(macOS)
28
+ + private static var namespace: String {
29
+ + // Spark's host exports SparkNamespace(); look it up at runtime so MMKV keeps no link dependency on Spark.
30
+ + typealias Namespace = @convention(c) () -> Unmanaged<NSString>
31
+ + if let symbol = dlsym(UnsafeMutableRawPointer(bitPattern: -2), "SparkNamespace") {
32
+ + return unsafeBitCast(symbol, to: Namespace.self)().takeUnretainedValue() as String
33
+ + }
34
+ + return Bundle.main.bundleIdentifier ?? ProcessInfo.processInfo.processName
35
+ + }
36
+ +#endif
37
+ +
38
+ func getAppGroupDirectory() throws -> String? {
39
+ // Read `AppGroupIdentifier` from `Info.plist`
40
+ guard let appGroupID = Bundle.main.object(forInfoDictionaryKey: "AppGroupIdentifier") as? String else {
@@ -0,0 +1,130 @@
1
+ diff --git a/NitroFetch.podspec b/NitroFetch.podspec
2
+ index 8b08083..d08a41d 100644
3
+ --- a/NitroFetch.podspec
4
+ +++ b/NitroFetch.podspec
5
+ @@ -10,7 +10,7 @@ Pod::Spec.new do |s|
6
+ s.license = package["license"]
7
+ s.authors = package["author"]
8
+
9
+ - s.platforms = { :ios => min_ios_version_supported, :tvos => min_ios_version_supported }
10
+ + s.platforms = { :ios => min_ios_version_supported, :tvos => min_ios_version_supported, :osx => "14.0" }
11
+ s.source = { :git => "https://github.com/margelo/react-native-nitro-fetch.git", :tag => "v#{s.version}" }
12
+
13
+
14
+ diff --git a/ios/HybridNativeStorage.swift b/ios/HybridNativeStorage.swift
15
+ index 68e5246..51bcf3b 100644
16
+ --- a/ios/HybridNativeStorage.swift
17
+ +++ b/ios/HybridNativeStorage.swift
18
+ @@ -10,7 +10,11 @@ import Security
19
+ /// Keep `keychainService` and `encPrefix` in sync with `NitroWSSecureAtRest.swift` in nitro-websockets.
20
+ internal enum NitroFetchSecureAtRest {
21
+ static let encPrefix = "nfc1:"
22
+ +#if os(macOS)
23
+ + private static let keychainService = "com.margelo.nitrofetch.aesgcm.v1.\(AppNamespace.value)"
24
+ +#else
25
+ private static let keychainService = "com.margelo.nitrofetch.aesgcm.v1"
26
+ +#endif
27
+ private static let keychainAccount = "master"
28
+
29
+ private static func loadOrCreateSymmetricKey() throws -> SymmetricKey {
30
+ @@ -119,7 +123,11 @@ internal enum NitroFetchSecureAtRest {
31
+ }
32
+
33
+ final class HybridNativeStorage: HybridNativeStorageSpec {
34
+ +#if os(macOS)
35
+ + private static let suiteName = "nitro_fetch_storage.\(AppNamespace.value)"
36
+ +#else
37
+ private static let suiteName = "nitro_fetch_storage"
38
+ +#endif
39
+
40
+ private let userDefaults: UserDefaults
41
+
42
+ diff --git a/ios/NitroAutoPrefetcher.swift b/ios/NitroAutoPrefetcher.swift
43
+ index 18ffea9..8b69d1f 100644
44
+ --- a/ios/NitroAutoPrefetcher.swift
45
+ +++ b/ios/NitroAutoPrefetcher.swift
46
+ @@ -6,7 +6,11 @@ public final class NitroAutoPrefetcher: NSObject {
47
+ // Serializes queue reads/writes and keeps Keychain work off the launch thread.
48
+ private static let workQueue = DispatchQueue(label: "com.margelo.nitrofetch.autoprefetch")
49
+ private static let queueKey = "nitrofetch_autoprefetch_queue"
50
+ +#if os(macOS)
51
+ + private static let suiteName = "nitro_fetch_storage.\(AppNamespace.value)"
52
+ +#else
53
+ private static let suiteName = "nitro_fetch_storage"
54
+ +#endif
55
+ private static let tokenRefreshKey = "nitro_token_refresh_fetch"
56
+ private static let tokenCacheKey = "nitro_token_refresh_fetch_cache"
57
+
58
+ diff --git a/ios/NitroBootstrap.mm b/ios/NitroBootstrap.mm
59
+ index 8e23106..41ad6fc 100644
60
+ --- a/ios/NitroBootstrap.mm
61
+ +++ b/ios/NitroBootstrap.mm
62
+ @@ -1,6 +1,8 @@
63
+ #import <Foundation/Foundation.h>
64
+ #if __has_include(<UIKit/UIKit.h>)
65
+ #import <UIKit/UIKit.h>
66
+ +#elif __has_include(<AppKit/AppKit.h>)
67
+ +#import <AppKit/AppKit.h>
68
+ #endif
69
+
70
+ @interface NitroAutoPrefetcher : NSObject
71
+ @@ -22,6 +24,15 @@ + (void)load {
72
+ [NitroAutoPrefetcher prefetchOnStart];
73
+ });
74
+ }
75
+ +#elif __has_include(<AppKit/AppKit.h>)
76
+ + [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidFinishLaunchingNotification
77
+ + object:nil queue:nil
78
+ + usingBlock:^(__unused NSNotification *note) {
79
+ + [NitroAutoPrefetcher prefetchOnStart];
80
+ + }];
81
+ + dispatch_async(dispatch_get_main_queue(), ^{
82
+ + [NitroAutoPrefetcher prefetchOnStart];
83
+ + });
84
+ #endif
85
+ }
86
+ @end
87
+ diff --git a/ios/NitroURLSession.swift b/ios/NitroURLSession.swift
88
+ index 871df60..0505ac4 100644
89
+ --- a/ios/NitroURLSession.swift
90
+ +++ b/ios/NitroURLSession.swift
91
+ @@ -18,12 +18,39 @@ private final class NitroPinningURLSessionDelegate: NSObject, URLSessionDelegate
92
+ }
93
+
94
+ enum NitroURLCache {
95
+ +#if os(macOS)
96
+ + // A relative diskPath resolves against the working directory on macOS, so keep the cache in
97
+ + // the app's Caches folder, scoped like Spark's other app data.
98
+ + static let shared = URLCache(
99
+ + memoryCapacity: 32 * 1024 * 1024,
100
+ + diskCapacity: 100 * 1024 * 1024,
101
+ + directory: FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0]
102
+ + .appendingPathComponent(AppNamespace.value, isDirectory: true)
103
+ + .appendingPathComponent("nitrofetch_urlcache", isDirectory: true)
104
+ + )
105
+ +#else
106
+ static let shared = URLCache(
107
+ memoryCapacity: 32 * 1024 * 1024,
108
+ diskCapacity: 100 * 1024 * 1024,
109
+ diskPath: "nitrofetch_urlcache"
110
+ )
111
+ +#endif
112
+ +}
113
+ +
114
+ +#if os(macOS)
115
+ +/// Mac apps share ~/Library, user defaults suites and Keychain services, so Nitro Fetch's stores are
116
+ +/// scoped like Spark's other app data.
117
+ +enum AppNamespace {
118
+ + static let value: String = {
119
+ + // Spark's host exports SparkNamespace(); look it up at runtime so Nitro Fetch keeps no link dependency on Spark.
120
+ + typealias Namespace = @convention(c) () -> Unmanaged<NSString>
121
+ + if let symbol = dlsym(UnsafeMutableRawPointer(bitPattern: -2), "SparkNamespace") {
122
+ + return unsafeBitCast(symbol, to: Namespace.self)().takeUnretainedValue() as String
123
+ + }
124
+ + return Bundle.main.bundleIdentifier ?? ProcessInfo.processInfo.processName
125
+ + }()
126
+ }
127
+ +#endif
128
+
129
+ enum NitroURLSession {
130
+ static let shared = make(configuration: .default)
@@ -0,0 +1,13 @@
1
+ diff --git a/VisionCameraZxing.podspec b/VisionCameraZxing.podspec
2
+ index 301b92f..c4fda73 100644
3
+ --- a/VisionCameraZxing.podspec
4
+ +++ b/VisionCameraZxing.podspec
5
+ @@ -20,7 +20,7 @@ Pod::Spec.new do |s|
6
+ s.license = package["license"]
7
+ s.authors = package["author"]
8
+
9
+ - s.platforms = { :ios => min_ios_version_supported, :visionos => 1.0 }
10
+ + s.platforms = { :ios => min_ios_version_supported, :visionos => 1.0, :osx => "14.0" }
11
+ s.source = { :git => "https://github.com/margelo/react-native-vision-camera-zxing.git", :tag => "v#{s.version}" }
12
+
13
+ s.source_files = [
@@ -0,0 +1,13 @@
1
+ diff --git a/react-native-quick-base64.podspec b/react-native-quick-base64.podspec
2
+ index eb43697..f02ee48 100644
3
+ --- a/react-native-quick-base64.podspec
4
+ +++ b/react-native-quick-base64.podspec
5
+ @@ -10,7 +10,7 @@ Pod::Spec.new do |s|
6
+ s.license = package["license"]
7
+ s.authors = package["author"]
8
+
9
+ - s.platforms = { :ios => min_ios_version_supported }
10
+ + s.platforms = { :ios => min_ios_version_supported, :osx => "14.0" }
11
+ s.source = { :git => "https://github.com/craftzdog/react-native-quick-base64.git", :tag => "#{s.version}" }
12
+
13
+ s.source_files = "ios/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}", "ios/generated/*.{h,cpp,mm}"
@@ -0,0 +1,31 @@
1
+ diff --git a/QuickCrypto.podspec b/QuickCrypto.podspec
2
+ index 8e026e5..0c45a92 100644
3
+ --- a/QuickCrypto.podspec
4
+ +++ b/QuickCrypto.podspec
5
+ @@ -198,7 +198,10 @@ Pod::Spec.new do |s|
6
+ # Disable x86 SIMD intrinsics on iOS simulator — the .c implementation files are already
7
+ # excluded above, but blake3_dispatch.c still references the symbols unless these macros
8
+ # are defined. Mirrors the Android CMakeLists.txt approach (line 18-22).
9
+ - "GCC_PREPROCESSOR_DEFINITIONS[sdk=iphonesimulator*][arch=x86_64]" => "$(inherited) BLAKE3_NO_AVX512 BLAKE3_NO_AVX2 BLAKE3_NO_SSE41 BLAKE3_NO_SSE2 NCRYPTO_EVP_ONLY=1"
10
+ + "GCC_PREPROCESSOR_DEFINITIONS[sdk=iphonesimulator*][arch=x86_64]" => "$(inherited) BLAKE3_NO_AVX512 BLAKE3_NO_AVX2 BLAKE3_NO_SSE41 BLAKE3_NO_SSE2 NCRYPTO_EVP_ONLY=1",
11
+ + # Intel Macs need the same: no NEON source and no x86 SIMD symbols.
12
+ + "EXCLUDED_SOURCE_FILE_NAMES[sdk=macosx*][arch=x86_64]" => "deps/blake3/c/blake3_neon.c",
13
+ + "GCC_PREPROCESSOR_DEFINITIONS[sdk=macosx*][arch=x86_64]" => "$(inherited) BLAKE3_NO_AVX512 BLAKE3_NO_AVX2 BLAKE3_NO_SSE41 BLAKE3_NO_SSE2 NCRYPTO_EVP_ONLY=1"
14
+ }
15
+
16
+ # Every translation unit calls the renamed OpenSSL symbols. Missing a rename
17
+ diff --git a/deps/fastpbkdf2/fastpbkdf2.c b/deps/fastpbkdf2/fastpbkdf2.c
18
+ index ee2d2f0..b04ec59 100644
19
+ --- a/deps/fastpbkdf2/fastpbkdf2.c
20
+ +++ b/deps/fastpbkdf2/fastpbkdf2.c
21
+ @@ -17,8 +17,8 @@
22
+ #include <assert.h>
23
+ #include <string.h>
24
+ #if defined(__GNUC__)
25
+ - #if TARGET_OS_MACCATALYST
26
+ - #include <machine/endian.h> // Mac Catalyst
27
+ + #if TARGET_OS_MACCATALYST || TARGET_OS_OSX
28
+ + #include <machine/endian.h> // Mac Catalyst, macOS
29
+ #else
30
+ #include <endian.h> // iOS
31
+ #endif
@@ -0,0 +1,37 @@
1
+ diff --git a/ios/ReleaseProfiler.mm b/ios/ReleaseProfiler.mm
2
+ index b38beb6..50e668d 100644
3
+ --- a/ios/ReleaseProfiler.mm
4
+ +++ b/ios/ReleaseProfiler.mm
5
+ @@ -1,5 +1,6 @@
6
+ #import <React/RCTBridgeModule.h>
7
+ #import <hermes/hermes.h>
8
+ +#include <dlfcn.h>
9
+
10
+ #ifdef __has_include
11
+ #if __has_include(<cxxreact/ReactNativeVersion.h>)
12
+ @@ -51,6 +52,12 @@ + (BOOL)requiresMainQueueSetup
13
+ withRejecter:(RCTPromiseRejectBlock)reject) {
14
+ NSFileManager* sharedFM = [NSFileManager defaultManager];
15
+ NSURL *appDir=[[sharedFM URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask] objectAtIndex:0];
16
+ +#if TARGET_OS_OSX
17
+ + // ~/Library/Caches is shared by every Mac app; use the app's own folder, scoped like Spark's other app data.
18
+ + NSString *(*sparkNamespace)(void) = (NSString *(*)(void))dlsym(RTLD_DEFAULT, "SparkNamespace");
19
+ + appDir = [appDir URLByAppendingPathComponent:sparkNamespace ? sparkNamespace() : NSBundle.mainBundle.bundleIdentifier isDirectory:YES];
20
+ + [sharedFM createDirectoryAtURL:appDir withIntermediateDirectories:YES attributes:nil error:nil];
21
+ +#endif
22
+ NSString * tempFilename = [NSString stringWithFormat:@"profile-%@%@", [[NSProcessInfo processInfo] globallyUniqueString], @".cpuprofile"];
23
+ NSURL *fileURL=[appDir URLByAppendingPathComponent:tempFilename];
24
+ std::string finalPath = std::string([fileURL.path UTF8String]);
25
+ diff --git a/react-native-release-profiler.podspec b/react-native-release-profiler.podspec
26
+ index 135d951..b5efe5e 100644
27
+ --- a/react-native-release-profiler.podspec
28
+ +++ b/react-native-release-profiler.podspec
29
+ @@ -11,7 +11,7 @@ Pod::Spec.new do |s|
30
+ s.license = package["license"]
31
+ s.authors = package["author"]
32
+
33
+ - s.platforms = { :ios => "11.0" }
34
+ + s.platforms = { :ios => "11.0", :osx => "14.0" }
35
+ s.source = { :git => "https://github.com/Szymon20000/react-native-release-profiler.git", :tag => "#{s.version}" }
36
+
37
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
@@ -0,0 +1,13 @@
1
+ diff --git a/src/index.ts b/src/index.ts
2
+ index 60f89f5..369c39a 100644
3
+ --- a/src/index.ts
4
+ +++ b/src/index.ts
5
+ @@ -4,7 +4,7 @@ import { NativeModules } from 'react-native';
6
+ * The current device's screen's corner radius. May also be `0` if the corner radius couldn't be detected.
7
+ */
8
+ export const ScreenCornerRadius: number =
9
+ - NativeModules.ScreenCornerRadius.cornerRadius ?? 0;
10
+ + NativeModules.ScreenCornerRadius?.cornerRadius ?? 0;
11
+
12
+ /**
13
+ * `true` if the screen has rounded corners, `false` otherwise.