@legendapp/spark 0.0.2 → 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 (87) hide show
  1. package/package.json +2 -2
  2. package/patches/dependencies.json +252 -0
  3. package/patches/expo-application@55.0.19.patch +54 -0
  4. package/patches/expo-blur@55.0.18.patch +130 -0
  5. package/patches/expo-device@55.0.21.patch +149 -0
  6. package/patches/expo-font@55.0.8.patch +55 -0
  7. package/patches/expo-glass-effect@55.0.11.patch +304 -0
  8. package/patches/expo-haptics@55.0.18.patch +54 -0
  9. package/patches/expo-image-manipulator@55.0.21.patch +312 -0
  10. package/patches/expo-image-picker@55.0.24.patch +327 -0
  11. package/patches/expo-image@55.0.11.patch +158 -0
  12. package/patches/expo-keep-awake@55.0.8.patch +41 -0
  13. package/patches/expo-localization@55.0.19.patch +32 -0
  14. package/patches/expo-location@55.1.15.patch +190 -0
  15. package/patches/expo-symbols@55.0.9.patch +286 -0
  16. package/patches/expo-system-ui@55.0.22.patch +61 -0
  17. package/patches/expo-web-browser@55.0.20.patch +13 -0
  18. package/patches/react-native-app-logs@0.3.1.patch +20 -0
  19. package/patches/react-native-blurhash@2.1.3.patch +318 -0
  20. package/patches/react-native-community-blur@4.4.1.patch +415 -0
  21. package/patches/react-native-community-datetimepicker@9.2.2.patch +320 -0
  22. package/patches/react-native-fast-image@10.9.9.patch +131 -0
  23. package/patches/react-native-graph@1.4.0.patch +157 -0
  24. package/patches/react-native-keyboard-controller@1.22.9.patch +16 -0
  25. package/patches/react-native-masked-view-masked-view@0.3.2.patch +140 -0
  26. package/patches/react-native-mmkv@4.3.2.patch +40 -0
  27. package/patches/react-native-nitro-fetch@1.9.0.patch +130 -0
  28. package/patches/react-native-nitro-zxing@0.3.0.patch +13 -0
  29. package/patches/react-native-quick-base64@3.0.1.patch +13 -0
  30. package/patches/react-native-quick-crypto@1.1.9.patch +31 -0
  31. package/patches/react-native-release-profiler@0.4.5.patch +37 -0
  32. package/patches/react-native-screen-corner-radius@0.2.3.patch +13 -0
  33. package/patches/react-native-screens@4.23.0.patch +160 -0
  34. package/patches/react-native-svg@15.15.3.patch +31 -0
  35. package/patches/react-native-unistyles@3.6.0.patch +203 -0
  36. package/patches/react-native-worklets-core@1.6.3.patch +13 -0
  37. package/patches/react-navigation-native-stack@7.21.0.patch +16 -0
  38. package/patches/sentry-react-native@8.32.0.patch +76 -0
  39. package/skills/spark/UPGRADING.md +34 -0
  40. package/vendor/node_modules/@legendapp/spark-ai/package.json +3 -3
  41. package/vendor/node_modules/@legendapp/spark-audio/package.json +2 -2
  42. package/vendor/node_modules/@legendapp/spark-auth-session/package.json +3 -3
  43. package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +6 -3
  44. package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +7 -2
  45. package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +3 -0
  46. package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +13 -1
  47. package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +11 -11
  48. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-input-cache.js +140 -0
  49. package/vendor/node_modules/@legendapp/spark-cli/package.json +3 -3
  50. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +2 -2
  51. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +2 -2
  52. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +2 -2
  53. package/vendor/node_modules/@legendapp/spark-clipboard/package.json +2 -2
  54. package/vendor/node_modules/@legendapp/spark-codex/package.json +2 -2
  55. package/vendor/node_modules/@legendapp/spark-commands/package.json +5 -5
  56. package/vendor/node_modules/@legendapp/spark-context-menu/package.json +2 -2
  57. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.mm +64 -2
  58. package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +1 -1
  59. package/vendor/node_modules/@legendapp/spark-desktop-config/autolinking.cjs +3 -2
  60. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +28 -10
  61. package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +3 -3
  62. package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +2 -2
  63. package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +2 -2
  64. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +2 -2
  65. package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +3 -3
  66. package/vendor/node_modules/@legendapp/spark-documents/package.json +7 -7
  67. package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +2 -2
  68. package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +2 -2
  69. package/vendor/node_modules/@legendapp/spark-file-system/package.json +2 -2
  70. package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +2 -2
  71. package/vendor/node_modules/@legendapp/spark-html/package.json +2 -2
  72. package/vendor/node_modules/@legendapp/spark-markdown/package.json +2 -2
  73. package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +2 -2
  74. package/vendor/node_modules/@legendapp/spark-native-menu/package.json +2 -2
  75. package/vendor/node_modules/@legendapp/spark-notifications/package.json +2 -2
  76. package/vendor/node_modules/@legendapp/spark-processes/package.json +2 -2
  77. package/vendor/node_modules/@legendapp/spark-rich-text/package.json +2 -2
  78. package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +2 -2
  79. package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
  80. package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +4 -4
  81. package/vendor/node_modules/@legendapp/spark-sqlite/package.json +3 -3
  82. package/vendor/node_modules/@legendapp/spark-system/package.json +2 -2
  83. package/vendor/node_modules/@legendapp/spark-tray/package.json +2 -2
  84. package/vendor/node_modules/@legendapp/spark-ui/package.json +2 -2
  85. package/vendor/node_modules/@legendapp/spark-updates/package.json +2 -2
  86. package/vendor/node_modules/@legendapp/spark-webview/package.json +2 -2
  87. package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
@@ -0,0 +1,318 @@
1
+ diff --git a/ios/BlurhashModule.mm b/ios/BlurhashModule.mm
2
+ index 189b790..a5b24bd 100644
3
+ --- a/ios/BlurhashModule.mm
4
+ +++ b/ios/BlurhashModule.mm
5
+ @@ -1,7 +1,9 @@
6
+ #import "BlurhashModule.h"
7
+
8
+ #import <React/RCTUtils.h>
9
+ +#if !TARGET_OS_OSX
10
+ #import <UIKit/UIKit.h>
11
+ +#endif
12
+ #ifdef RCT_NEW_ARCH_ENABLED
13
+ #import <blurhash_codegen/blurhash_codegen.h>
14
+ #endif
15
+ diff --git a/ios/BlurhashModuleImpl.swift b/ios/BlurhashModuleImpl.swift
16
+ index dc5f62e..ca0f795 100644
17
+ --- a/ios/BlurhashModuleImpl.swift
18
+ +++ b/ios/BlurhashModuleImpl.swift
19
+ @@ -7,7 +7,11 @@
20
+ //
21
+
22
+ import Foundation
23
+ +#if canImport(UIKit)
24
+ import UIKit
25
+ +#else
26
+ +import AppKit
27
+ +#endif
28
+
29
+ @objc
30
+ public final class BlurhashModuleImpl: NSObject {
31
+ diff --git a/ios/BlurhashPlatform.swift b/ios/BlurhashPlatform.swift
32
+ new file mode 100644
33
+ index 0000000..b9a3e49
34
+ --- /dev/null
35
+ +++ b/ios/BlurhashPlatform.swift
36
+ @@ -0,0 +1,6 @@
37
+ +#if os(macOS)
38
+ +import AppKit
39
+ +
40
+ +// The decoder and encoder extend UIImage; on macOS that is NSImage.
41
+ +public typealias UIImage = NSImage
42
+ +#endif
43
+ diff --git a/ios/BlurhashView.swift b/ios/BlurhashView.swift
44
+ index 795e58e..45a3ace 100644
45
+ --- a/ios/BlurhashView.swift
46
+ +++ b/ios/BlurhashView.swift
47
+ @@ -7,7 +7,13 @@
48
+ //
49
+
50
+ import Foundation
51
+ +#if os(macOS)
52
+ +import AppKit
53
+ +public typealias BlurhashPlatformView = NSView
54
+ +#else
55
+ import UIKit
56
+ +public typealias BlurhashPlatformView = UIView
57
+ +#endif
58
+
59
+ @objc
60
+ public protocol BlurhashViewDelegate {
61
+ @@ -16,12 +22,17 @@ public protocol BlurhashViewDelegate {
62
+ func blurhashViewLoadDidError(_ message: String?)
63
+ }
64
+
65
+ -public final class BlurhashView: UIView {
66
+ +public final class BlurhashView: BlurhashPlatformView {
67
+ @objc public var blurhash: String?
68
+ @objc public var decodeWidth: Int = 32
69
+ @objc public var decodeHeight: Int = 32
70
+ @objc public var decodePunch: Float = 1
71
+ @objc public var decodeAsync: Bool = false
72
+ +#if os(macOS)
73
+ + @objc public var contentsGravity: CALayerContentsGravity = .resizeAspectFill {
74
+ + didSet { layer?.contentsGravity = contentsGravity }
75
+ + }
76
+ +#else
77
+ @objc override public var contentMode: ContentMode {
78
+ get {
79
+ imageContainer.contentMode
80
+ @@ -30,10 +41,19 @@ public final class BlurhashView: UIView {
81
+ imageContainer.contentMode = newValue
82
+ }
83
+ }
84
+ +#endif
85
+
86
+ @objc public weak var delegate: BlurhashViewDelegate?
87
+
88
+ private var lastState: BlurhashCache?
89
+ +#if os(macOS)
90
+ + override public init(frame: CGRect) {
91
+ + super.init(frame: frame)
92
+ + wantsLayer = true
93
+ + layer?.masksToBounds = true
94
+ + layer?.contentsGravity = contentsGravity
95
+ + }
96
+ +#else
97
+ private let imageContainer: UIImageView
98
+
99
+ override public init(frame: CGRect) {
100
+ @@ -44,6 +64,7 @@ public final class BlurhashView: UIView {
101
+ super.init(frame: frame)
102
+ addSubview(imageContainer)
103
+ }
104
+ +#endif
105
+
106
+ @available(*, unavailable)
107
+ required init?(coder _: NSCoder) {
108
+ @@ -119,12 +140,15 @@ public final class BlurhashView: UIView {
109
+ }
110
+
111
+ private final func setImageContainerImage(image: UIImage?) {
112
+ +#if os(macOS)
113
+ + let show: () -> Void = { self.layer?.contents = image?.cgImage(forProposedRect: nil, context: nil, hints: nil) }
114
+ +#else
115
+ + let show: () -> Void = { self.imageContainer.image = image }
116
+ +#endif
117
+ if Thread.isMainThread {
118
+ - imageContainer.image = image
119
+ + show()
120
+ } else {
121
+ - DispatchQueue.main.async {
122
+ - self.imageContainer.image = image
123
+ - }
124
+ + DispatchQueue.main.async(execute: show)
125
+ }
126
+ }
127
+
128
+ diff --git a/ios/BlurhashViewComponentView.h b/ios/BlurhashViewComponentView.h
129
+ index 51c9a3a..93a78eb 100644
130
+ --- a/ios/BlurhashViewComponentView.h
131
+ +++ b/ios/BlurhashViewComponentView.h
132
+ @@ -1,6 +1,8 @@
133
+ #ifdef RCT_NEW_ARCH_ENABLED
134
+
135
+ +#if !TARGET_OS_OSX
136
+ #import <UIKit/UIKit.h>
137
+ +#endif
138
+
139
+ #import <React/RCTViewComponentView.h>
140
+
141
+ diff --git a/ios/BlurhashViewComponentView.mm b/ios/BlurhashViewComponentView.mm
142
+ index e483bfb..ccc38ab 100644
143
+ --- a/ios/BlurhashViewComponentView.mm
144
+ +++ b/ios/BlurhashViewComponentView.mm
145
+ @@ -18,6 +18,21 @@
146
+
147
+ using namespace facebook::react;
148
+
149
+ +#if TARGET_OS_OSX
150
+ +static CALayerContentsGravity convertResizeMode(const BlurhashViewResizeMode &resizeMode)
151
+ +{
152
+ + switch (resizeMode) {
153
+ + case BlurhashViewResizeMode::Contain:
154
+ + return kCAGravityResizeAspect;
155
+ + case BlurhashViewResizeMode::Cover:
156
+ + return kCAGravityResizeAspectFill;
157
+ + case BlurhashViewResizeMode::Stretch:
158
+ + return kCAGravityResize;
159
+ + case BlurhashViewResizeMode::Center:
160
+ + return kCAGravityCenter;
161
+ + }
162
+ +}
163
+ +#else
164
+ static UIViewContentMode convertResizeMode(const BlurhashViewResizeMode &resizeMode)
165
+ {
166
+ switch (resizeMode) {
167
+ @@ -31,6 +46,7 @@ static UIViewContentMode convertResizeMode(const BlurhashViewResizeMode &resizeM
168
+ return UIViewContentMode::UIViewContentModeCenter;
169
+ }
170
+ }
171
+ +#endif
172
+
173
+ @interface BlurhashViewComponentView () <RCTBlurhashViewViewProtocol, BlurhashViewDelegate>
174
+ @end
175
+ @@ -81,7 +97,11 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
176
+ _blurhashView.decodeAsync = newViewProps.decodeAsync;
177
+ }
178
+ if (oldViewProps.resizeMode != newViewProps.resizeMode) {
179
+ +#if TARGET_OS_OSX
180
+ + _blurhashView.contentsGravity = convertResizeMode(newViewProps.resizeMode);
181
+ +#else
182
+ _blurhashView.contentMode = convertResizeMode(newViewProps.resizeMode);
183
+ +#endif
184
+ }
185
+
186
+ [super updateProps:props oldProps:oldProps];
187
+ diff --git a/ios/BlurhashViewManager.m b/ios/BlurhashViewManager.m
188
+ index 318c955..16292b7 100644
189
+ --- a/ios/BlurhashViewManager.m
190
+ +++ b/ios/BlurhashViewManager.m
191
+ @@ -1,3 +1,5 @@
192
+ +#include <TargetConditionals.h>
193
+ +#if !TARGET_OS_OSX
194
+ #import "BlurhashBridge.h"
195
+ #import <React/RCTViewManager.h>
196
+
197
+ @@ -17,3 +19,4 @@ @interface RCT_EXTERN_REMAP_MODULE (BlurhashView, BlurhashViewManager,
198
+ RCT_EXPORT_VIEW_PROPERTY(onLoadError, RCTDirectEventBlock);
199
+
200
+ @end
201
+ +#endif
202
+ diff --git a/ios/BlurhashViewManager.swift b/ios/BlurhashViewManager.swift
203
+ index c1abb62..6b5c6b1 100644
204
+ --- a/ios/BlurhashViewManager.swift
205
+ +++ b/ios/BlurhashViewManager.swift
206
+ @@ -6,6 +6,7 @@
207
+ // Copyright © 2020 Facebook. All rights reserved.
208
+ //
209
+
210
+ +#if !os(macOS)
211
+ import Foundation
212
+ import UIKit
213
+
214
+ @@ -151,3 +152,5 @@ final class BlurhashViewManager: RCTViewManager {
215
+ return true
216
+ }
217
+ }
218
+ +
219
+ +#endif
220
+ diff --git a/ios/UIImage+BlurhashDecode.swift b/ios/UIImage+BlurhashDecode.swift
221
+ index 7076215..a79516c 100644
222
+ --- a/ios/UIImage+BlurhashDecode.swift
223
+ +++ b/ios/UIImage+BlurhashDecode.swift
224
+ @@ -7,7 +7,11 @@
225
+ //
226
+
227
+ import Foundation
228
+ +#if canImport(UIKit)
229
+ import UIKit
230
+ +#else
231
+ +import AppKit
232
+ +#endif
233
+
234
+ public extension UIImage {
235
+ convenience init?(blurHash: String, size: CGSize, punch: Float = 1) {
236
+ @@ -95,6 +99,10 @@ public extension UIImage {
237
+ shouldInterpolate: true,
238
+ intent: .defaultIntent) else { return nil }
239
+
240
+ +#if os(macOS)
241
+ + self.init(cgImage: cgImage, size: NSSize(width: width, height: height))
242
+ +#else
243
+ self.init(cgImage: cgImage)
244
+ +#endif
245
+ }
246
+ }
247
+ diff --git a/ios/UIImage+BlurhashEncode.swift b/ios/UIImage+BlurhashEncode.swift
248
+ index bc68c95..c32c4af 100644
249
+ --- a/ios/UIImage+BlurhashEncode.swift
250
+ +++ b/ios/UIImage+BlurhashEncode.swift
251
+ @@ -7,12 +7,22 @@
252
+ //
253
+
254
+ import Foundation
255
+ +#if canImport(UIKit)
256
+ import UIKit
257
+ +#else
258
+ +import AppKit
259
+ +#endif
260
+
261
+ extension UIImage {
262
+ public func encodeBlurhash(numberOfComponents components: (Int, Int)) -> String? {
263
+ +#if os(macOS)
264
+ + guard let source = cgImage(forProposedRect: nil, context: nil, hints: nil) else { return nil }
265
+ + let pixelWidth = source.width
266
+ + let pixelHeight = source.height
267
+ +#else
268
+ let pixelWidth = Int(round(size.width * scale))
269
+ let pixelHeight = Int(round(size.height * scale))
270
+ +#endif
271
+
272
+ let context = CGContext(
273
+ data: nil,
274
+ @@ -23,12 +33,16 @@ extension UIImage {
275
+ space: CGColorSpace(name: CGColorSpace.sRGB)!,
276
+ bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue
277
+ )!
278
+ +#if os(macOS)
279
+ + context.draw(source, in: CGRect(x: 0, y: 0, width: pixelWidth, height: pixelHeight))
280
+ +#else
281
+ context.scaleBy(x: scale, y: -scale)
282
+ context.translateBy(x: 0, y: -size.height)
283
+
284
+ UIGraphicsPushContext(context)
285
+ draw(at: .zero)
286
+ UIGraphicsPopContext()
287
+ +#endif
288
+
289
+ guard let cgImage = context.makeImage(),
290
+ let dataProvider = cgImage.dataProvider,
291
+ diff --git a/package.json b/package.json
292
+ index dcc1bf5..6edaa33 100644
293
+ --- a/package.json
294
+ +++ b/package.json
295
+ @@ -108,6 +108,11 @@
296
+ "name": "blurhash_codegen",
297
+ "type": "all",
298
+ "jsSrcsDir": "./src/specs",
299
+ + "ios": {
300
+ + "componentProvider": {
301
+ + "BlurhashView": "BlurhashViewComponentView"
302
+ + }
303
+ + },
304
+ "android": {
305
+ "javaPackageName": "com.mrousavy.blurhash"
306
+ }
307
+ diff --git a/react-native-blurhash.podspec b/react-native-blurhash.podspec
308
+ index bb6ea68..ae7198c 100644
309
+ --- a/react-native-blurhash.podspec
310
+ +++ b/react-native-blurhash.podspec
311
+ @@ -17,6 +17,7 @@ Pod::Spec.new do |s|
312
+ s.authors = { "Marc Rousavy" => "marcrousavy@hotmail.com" }
313
+ s.ios.deployment_target = '9.0'
314
+ s.tvos.deployment_target = '9.0'
315
+ + s.osx.deployment_target = '14.0'
316
+ s.source = { :git => "https://github.com/mrousavy/react-native-blurhash.git", :tag => "#{s.version}" }
317
+
318
+ s.source_files = "ios/**/*.{h,c,m,mm,swift}"