@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.
- package/native.d.cts +6 -3
- package/package.json +36 -28
- package/patches/dependencies.json +252 -0
- package/patches/expo-application@55.0.19.patch +54 -0
- package/patches/expo-blur@55.0.18.patch +130 -0
- package/patches/expo-device@55.0.21.patch +149 -0
- package/patches/expo-font@55.0.8.patch +55 -0
- package/patches/expo-glass-effect@55.0.11.patch +304 -0
- package/patches/expo-haptics@55.0.18.patch +54 -0
- package/patches/expo-image-manipulator@55.0.21.patch +312 -0
- package/patches/expo-image-picker@55.0.24.patch +327 -0
- package/patches/expo-image@55.0.11.patch +158 -0
- package/patches/expo-keep-awake@55.0.8.patch +41 -0
- package/patches/expo-localization@55.0.19.patch +32 -0
- package/patches/expo-location@55.1.15.patch +190 -0
- package/patches/expo-symbols@55.0.9.patch +286 -0
- package/patches/expo-system-ui@55.0.22.patch +61 -0
- package/patches/expo-web-browser@55.0.20.patch +13 -0
- package/patches/react-native-app-logs@0.3.1.patch +20 -0
- package/patches/react-native-blurhash@2.1.3.patch +318 -0
- package/patches/react-native-community-blur@4.4.1.patch +415 -0
- package/patches/react-native-community-datetimepicker@9.2.2.patch +320 -0
- package/patches/react-native-enriched-markdown@1.1.1.patch +141 -10
- package/patches/react-native-fast-image@10.9.9.patch +131 -0
- package/patches/react-native-graph@1.4.0.patch +157 -0
- package/patches/react-native-keyboard-controller@1.22.9.patch +16 -0
- package/patches/react-native-masked-view-masked-view@0.3.2.patch +140 -0
- package/patches/react-native-mmkv@4.3.2.patch +40 -0
- package/patches/react-native-nitro-fetch@1.9.0.patch +130 -0
- package/patches/react-native-nitro-zxing@0.3.0.patch +13 -0
- package/patches/react-native-quick-base64@3.0.1.patch +13 -0
- package/patches/react-native-quick-crypto@1.1.9.patch +31 -0
- package/patches/react-native-release-profiler@0.4.5.patch +37 -0
- package/patches/react-native-screen-corner-radius@0.2.3.patch +13 -0
- package/patches/react-native-screens@4.23.0.patch +160 -0
- package/patches/react-native-svg@15.15.3.patch +31 -0
- package/patches/react-native-unistyles@3.6.0.patch +203 -0
- package/patches/react-native-worklets-core@1.6.3.patch +13 -0
- package/patches/react-navigation-native-stack@7.21.0.patch +16 -0
- package/patches/sentry-react-native@8.32.0.patch +76 -0
- package/skills/spark/UPGRADING.md +122 -3
- package/vendor/node_modules/@legendapp/spark-ai/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-audio/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-audio/src/index.macos.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-auth-session/package.json +6 -6
- package/vendor/node_modules/@legendapp/spark-auth-session/src/index.macos.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +17 -5
- package/vendor/node_modules/@legendapp/spark-cli/dist/cli-arguments.js +4 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/create.js +8 -4
- package/vendor/node_modules/@legendapp/spark-cli/dist/dependency-pins.js +45 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +15 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/examples.js +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-patch.cjs +3 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-preload.cjs +3 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/index.js +26 -7
- package/vendor/node_modules/@legendapp/spark-cli/dist/metro.cjs +3 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.cjs +20 -5
- package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.d.cts +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +10 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/native-patch-preflight.js +3 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +28 -10
- package/vendor/node_modules/@legendapp/spark-cli/dist/release-runner-root.js +108 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +13 -13
- package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-input-cache.js +140 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/watchman.js +12 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/windows-geometry.js +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/windows.js +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/desktop.config.json +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +27 -25
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/desktop.config.json +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +35 -33
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +29 -27
- package/vendor/node_modules/@legendapp/spark-clipboard/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-clipboard/src/index.macos.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-codex/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-commands/package.json +7 -7
- package/vendor/node_modules/@legendapp/spark-context-menu/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.mm +7 -2
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.mm +64 -2
- package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-desktop-config/accessibility-state.cjs +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.cjs +12 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/autolinking.cjs +7 -6
- package/vendor/node_modules/@legendapp/spark-desktop-config/config.d.cts +1 -1
- package/vendor/node_modules/@legendapp/spark-desktop-config/fabric-lifecycle.cjs +1 -1
- package/vendor/node_modules/@legendapp/spark-desktop-config/keyboard-events.cjs +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-config/macos-host.cjs +39 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +73 -20
- package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.d.cts +2 -1
- package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +8 -6
- package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-scroll-view.cjs +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-text-alignment.cjs +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-text-input-alignment.cjs +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-config/text-input-accessibility.cjs +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-host/macos/AppDelegate.h +6 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/macos/Main.storyboard +684 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/macos/main.m +5 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +3 -2
- package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/index.macos.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.mm +68 -17
- package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos-adapter.ts +2 -1
- package/vendor/node_modules/@legendapp/spark-documents/package.json +9 -9
- package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-file-system/macos/RNDesktopFileSystem.mm +14 -5
- package/vendor/node_modules/@legendapp/spark-file-system/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-file-system/src/index.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-html/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-markdown/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-native-menu/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-notifications/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-processes/macos/RNDesktopProcesses.mm +110 -19
- package/vendor/node_modules/@legendapp/spark-processes/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-processes/src/index.ts +17 -3
- package/vendor/node_modules/@legendapp/spark-processes/src/types.ts +6 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/index.macos.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +6 -6
- package/vendor/node_modules/@legendapp/spark-sqlite/package.json +12 -5
- package/vendor/node_modules/@legendapp/spark-system/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-tray/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.mm +82 -18
- package/vendor/node_modules/@legendapp/spark-ui/package.json +6 -6
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SidebarSplitViewNativeComponent.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/index.tsx +11 -9
- package/vendor/node_modules/@legendapp/spark-ui/src/index.android.tsx +20 -10
- package/vendor/node_modules/@legendapp/spark-ui/src/index.ios.tsx +15 -10
- package/vendor/node_modules/@legendapp/spark-ui/src/index.macos.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-updates/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-webview/package.json +11 -4
- package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
- package/camera.ts +0 -13
|
@@ -256,6 +256,40 @@ static void RNSidebarSplitViewApplyColorOverlay(NSView *view, NSColor *color, CG
|
|
|
256
256
|
}
|
|
257
257
|
@end
|
|
258
258
|
|
|
259
|
+
// Hosts a React pane. Fabric lays panes out in split-view coordinates, so measure() matches the screen.
|
|
260
|
+
// The host's bounds start wherever the pane's frame starts, so the pane always draws at the AppKit pane's
|
|
261
|
+
// origin: a Fabric commit still carrying an origin from before a divider move cannot shift it sideways.
|
|
262
|
+
@interface RNSidebarSplitViewPaneHost : NSView
|
|
263
|
+
@end
|
|
264
|
+
|
|
265
|
+
@implementation RNSidebarSplitViewPaneHost
|
|
266
|
+
- (BOOL)isFlipped
|
|
267
|
+
{
|
|
268
|
+
return YES;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
- (void)didAddSubview:(NSView *)subview
|
|
272
|
+
{
|
|
273
|
+
[super didAddSubview:subview];
|
|
274
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
275
|
+
selector:@selector(paneFrameDidChange:)
|
|
276
|
+
name:NSViewFrameDidChangeNotification
|
|
277
|
+
object:subview];
|
|
278
|
+
[self setBoundsOrigin:subview.frame.origin];
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
- (void)willRemoveSubview:(NSView *)subview
|
|
282
|
+
{
|
|
283
|
+
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSViewFrameDidChangeNotification object:subview];
|
|
284
|
+
[super willRemoveSubview:subview];
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
- (void)paneFrameDidChange:(NSNotification *)notification
|
|
288
|
+
{
|
|
289
|
+
[self setBoundsOrigin:((NSView *)notification.object).frame.origin];
|
|
290
|
+
}
|
|
291
|
+
@end
|
|
292
|
+
|
|
259
293
|
// List and content panes are opaque in the window background color, as AppKit panes are. React content
|
|
260
294
|
// follows a native resize one commit later; until then the newly exposed strip matches the window instead
|
|
261
295
|
// of showing a white stripe. The sidebar container stays clear so its native material shows.
|
|
@@ -453,6 +487,9 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
453
487
|
NSView *_sidebarContainer;
|
|
454
488
|
NSView *_contentContainer;
|
|
455
489
|
NSView *_listContainer;
|
|
490
|
+
NSView *_sidebarHost;
|
|
491
|
+
NSView *_contentHost;
|
|
492
|
+
NSView *_listHost;
|
|
456
493
|
RCTUIView<RCTComponentViewProtocol> *_sidebarReactView;
|
|
457
494
|
RCTUIView<RCTComponentViewProtocol> *_contentReactView;
|
|
458
495
|
RCTUIView<RCTComponentViewProtocol> *_listReactView;
|
|
@@ -481,6 +518,9 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
481
518
|
CGFloat _lastContentWidth;
|
|
482
519
|
CGFloat _lastListWidth;
|
|
483
520
|
CGFloat _lastHeight;
|
|
521
|
+
CGPoint _lastSidebarOrigin;
|
|
522
|
+
CGPoint _lastContentOrigin;
|
|
523
|
+
CGPoint _lastListOrigin;
|
|
484
524
|
BOOL _lastLayoutReady;
|
|
485
525
|
BOOL _didPublishMount;
|
|
486
526
|
NSString *_appearanceName;
|
|
@@ -546,6 +586,16 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
546
586
|
_contentContainer.layer.zPosition = 0;
|
|
547
587
|
_listContainer.layer.zPosition = 0;
|
|
548
588
|
|
|
589
|
+
_sidebarHost = [RNSidebarSplitViewPaneHost new];
|
|
590
|
+
_contentHost = [RNSidebarSplitViewPaneHost new];
|
|
591
|
+
_listHost = [RNSidebarSplitViewPaneHost new];
|
|
592
|
+
for (NSView *host in @[ _sidebarHost, _contentHost, _listHost ]) {
|
|
593
|
+
host.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
|
|
594
|
+
}
|
|
595
|
+
[_sidebarContainer addSubview:_sidebarHost];
|
|
596
|
+
[_contentContainer addSubview:_contentHost];
|
|
597
|
+
[_listContainer addSubview:_listHost];
|
|
598
|
+
|
|
549
599
|
_sidebarViewController = [NSViewController new];
|
|
550
600
|
_contentViewController = [NSViewController new];
|
|
551
601
|
_listViewController = [NSViewController new];
|
|
@@ -780,7 +830,7 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
780
830
|
}
|
|
781
831
|
[_sidebarContainer addSubview:_sidebarTitlebarMaterialView
|
|
782
832
|
positioned:NSWindowAbove
|
|
783
|
-
relativeTo:
|
|
833
|
+
relativeTo:_sidebarHost];
|
|
784
834
|
}
|
|
785
835
|
|
|
786
836
|
- (void)layoutContentTitlebarMaterial
|
|
@@ -821,9 +871,9 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
821
871
|
|
|
822
872
|
if (_contentTitlebarMaterialView.superview != _contentContainer) {
|
|
823
873
|
[_contentTitlebarMaterialView removeFromSuperview];
|
|
824
|
-
[_contentContainer addSubview:_contentTitlebarMaterialView positioned:NSWindowAbove relativeTo:
|
|
874
|
+
[_contentContainer addSubview:_contentTitlebarMaterialView positioned:NSWindowAbove relativeTo:_contentHost];
|
|
825
875
|
} else {
|
|
826
|
-
[_contentContainer addSubview:_contentTitlebarMaterialView positioned:NSWindowAbove relativeTo:
|
|
876
|
+
[_contentContainer addSubview:_contentTitlebarMaterialView positioned:NSWindowAbove relativeTo:_contentHost];
|
|
827
877
|
}
|
|
828
878
|
|
|
829
879
|
[self layoutSidebarTitlebarMaterialWithHeight:materialHeight];
|
|
@@ -848,6 +898,11 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
848
898
|
previousLayoutMetrics:&_listReactLayoutMetrics];
|
|
849
899
|
}
|
|
850
900
|
|
|
901
|
+
- (CGPoint)splitViewOriginOfPane:(nullable NSView *)pane
|
|
902
|
+
{
|
|
903
|
+
return pane.superview ? [pane convertRect:pane.bounds toView:self].origin : CGPointZero;
|
|
904
|
+
}
|
|
905
|
+
|
|
851
906
|
- (void)syncReactSubview:(nullable RCTUIView<RCTComponentViewProtocol> *)subview
|
|
852
907
|
nativeBounds:(CGRect)nativeBounds
|
|
853
908
|
previousLayoutMetrics:(LayoutMetrics *)previousLayoutMetrics
|
|
@@ -856,15 +911,18 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
856
911
|
return;
|
|
857
912
|
}
|
|
858
913
|
|
|
914
|
+
NSView *host = subview.superview;
|
|
915
|
+
CGPoint origin = [self splitViewOriginOfPane:host.superview];
|
|
916
|
+
host.frame = host.superview.bounds;
|
|
859
917
|
subview.hidden = nativeBounds.size.width <= 0 || nativeBounds.size.height <= 0;
|
|
860
918
|
subview.translatesAutoresizingMaskIntoConstraints = YES;
|
|
861
|
-
subview.frame = nativeBounds;
|
|
919
|
+
subview.frame = CGRectMake(origin.x, origin.y, nativeBounds.size.width, nativeBounds.size.height);
|
|
862
920
|
LayoutMetrics nextLayoutMetrics = _currentLayoutMetrics;
|
|
863
921
|
if (nextLayoutMetrics == EmptyLayoutMetrics) {
|
|
864
922
|
nextLayoutMetrics = LayoutMetrics{};
|
|
865
923
|
}
|
|
866
924
|
nextLayoutMetrics.frame = facebook::react::Rect{
|
|
867
|
-
facebook::react::Point{
|
|
925
|
+
facebook::react::Point{(Float)origin.x, (Float)origin.y},
|
|
868
926
|
facebook::react::Size{(Float)nativeBounds.size.width, (Float)nativeBounds.size.height},
|
|
869
927
|
};
|
|
870
928
|
nextLayoutMetrics.contentInsets = {};
|
|
@@ -881,12 +939,10 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
881
939
|
|
|
882
940
|
- (void)emitSplitViewDidResizeWithSidebarWidth:(CGFloat)sidebarWidth
|
|
883
941
|
contentWidth:(CGFloat)contentWidth
|
|
884
|
-
contentX:(CGFloat)contentX
|
|
885
942
|
sidebarHeight:(CGFloat)sidebarHeight
|
|
886
943
|
contentHeight:(CGFloat)contentHeight
|
|
887
944
|
height:(CGFloat)height
|
|
888
945
|
listWidth:(CGFloat)listWidth
|
|
889
|
-
listX:(CGFloat)listX
|
|
890
946
|
layoutReady:(BOOL)layoutReady
|
|
891
947
|
{
|
|
892
948
|
const auto eventEmitter = std::static_pointer_cast<const SidebarSplitViewEventEmitter>(_eventEmitter);
|
|
@@ -906,10 +962,16 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
906
962
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"LegendSidebarSplitViewDidMount"
|
|
907
963
|
object:self];
|
|
908
964
|
}
|
|
965
|
+
CGPoint sidebarOrigin = [self splitViewOriginOfPane:_sidebarContainer];
|
|
966
|
+
CGPoint contentOrigin = [self splitViewOriginOfPane:_contentContainer];
|
|
967
|
+
CGPoint listOrigin = _hasList ? [self splitViewOriginOfPane:_listContainer] : CGPointZero;
|
|
909
968
|
if (fabs(sidebarWidth - _lastSidebarWidth) < 0.5 &&
|
|
910
969
|
fabs(contentWidth - _lastContentWidth) < 0.5 &&
|
|
911
970
|
fabs(listWidth - _lastListWidth) < 0.5 &&
|
|
912
971
|
fabs(height - _lastHeight) < 0.5 &&
|
|
972
|
+
CGPointEqualToPoint(sidebarOrigin, _lastSidebarOrigin) &&
|
|
973
|
+
CGPointEqualToPoint(contentOrigin, _lastContentOrigin) &&
|
|
974
|
+
CGPointEqualToPoint(listOrigin, _lastListOrigin) &&
|
|
913
975
|
panesReady == _lastLayoutReady) {
|
|
914
976
|
return;
|
|
915
977
|
}
|
|
@@ -918,20 +980,27 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
918
980
|
_lastContentWidth = contentWidth;
|
|
919
981
|
_lastListWidth = listWidth;
|
|
920
982
|
_lastHeight = height;
|
|
983
|
+
_lastSidebarOrigin = sidebarOrigin;
|
|
984
|
+
_lastContentOrigin = contentOrigin;
|
|
985
|
+
_lastListOrigin = listOrigin;
|
|
921
986
|
_lastLayoutReady = panesReady;
|
|
922
987
|
|
|
923
988
|
eventEmitter->onSplitViewDidResize(SidebarSplitViewEventEmitter::OnSplitViewDidResize{
|
|
924
989
|
.contentHeight = contentHeight,
|
|
925
990
|
.contentWidth = contentWidth,
|
|
926
|
-
.contentX =
|
|
991
|
+
.contentX = contentOrigin.x,
|
|
992
|
+
.contentY = contentOrigin.y,
|
|
927
993
|
.height = height,
|
|
928
994
|
.isLayoutReady = static_cast<bool>(panesReady),
|
|
929
995
|
.isVertical = true,
|
|
930
996
|
.listHeight = listWidth > 0 ? height : 0,
|
|
931
997
|
.listWidth = listWidth,
|
|
932
|
-
.listX =
|
|
998
|
+
.listX = listOrigin.x,
|
|
999
|
+
.listY = listOrigin.y,
|
|
933
1000
|
.sidebarHeight = sidebarHeight,
|
|
934
1001
|
.sidebarWidth = sidebarWidth,
|
|
1002
|
+
.sidebarX = sidebarOrigin.x,
|
|
1003
|
+
.sidebarY = sidebarOrigin.y,
|
|
935
1004
|
});
|
|
936
1005
|
}
|
|
937
1006
|
|
|
@@ -991,12 +1060,10 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
991
1060
|
if (!_layingOutSplitView) {
|
|
992
1061
|
[self emitSplitViewDidResizeWithSidebarWidth:sidebarWidth
|
|
993
1062
|
contentWidth:contentWidth
|
|
994
|
-
contentX:contentX
|
|
995
1063
|
sidebarHeight:bounds.size.height
|
|
996
1064
|
contentHeight:bounds.size.height
|
|
997
1065
|
height:bounds.size.height
|
|
998
1066
|
listWidth:listWidth
|
|
999
|
-
listX:_hasList ? listX : 0
|
|
1000
1067
|
layoutReady:layoutReady];
|
|
1001
1068
|
}
|
|
1002
1069
|
|
|
@@ -1008,11 +1075,10 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
1008
1075
|
[self adoptNativeSidebarCollapsed];
|
|
1009
1076
|
CGFloat sidebarWidth = [self sidebarPaneBounds].size.width;
|
|
1010
1077
|
CGFloat contentWidth = _contentContainer.bounds.size.width;
|
|
1011
|
-
CGFloat contentX = [
|
|
1078
|
+
CGFloat contentX = [self splitViewOriginOfPane:_contentContainer].x;
|
|
1012
1079
|
CGFloat sidebarHeight = _sidebarContainer.bounds.size.height;
|
|
1013
1080
|
CGFloat contentHeight = _contentContainer.bounds.size.height;
|
|
1014
1081
|
CGFloat listWidth = _hasList ? _listContainer.bounds.size.width : 0;
|
|
1015
|
-
CGFloat listX = _hasList ? [_listContainer convertRect:_listContainer.bounds toView:self].origin.x : 0;
|
|
1016
1082
|
CGFloat height = MAX(sidebarHeight, contentHeight);
|
|
1017
1083
|
CGRect bounds = [self currentLayoutBounds];
|
|
1018
1084
|
|
|
@@ -1036,12 +1102,10 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
1036
1102
|
[self layoutContentTitlebarMaterial];
|
|
1037
1103
|
[self emitSplitViewDidResizeWithSidebarWidth:sidebarWidth
|
|
1038
1104
|
contentWidth:contentWidth
|
|
1039
|
-
contentX:contentX
|
|
1040
1105
|
sidebarHeight:sidebarHeight
|
|
1041
1106
|
contentHeight:contentHeight
|
|
1042
1107
|
height:height
|
|
1043
1108
|
listWidth:listWidth
|
|
1044
|
-
listX:listX
|
|
1045
1109
|
layoutReady:YES];
|
|
1046
1110
|
}
|
|
1047
1111
|
|
|
@@ -1178,7 +1242,7 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
1178
1242
|
_sidebarReactView = childComponentView;
|
|
1179
1243
|
_sidebarReactLayoutMetrics = EmptyLayoutMetrics;
|
|
1180
1244
|
childComponentView.hidden = YES;
|
|
1181
|
-
[
|
|
1245
|
+
[_sidebarHost addSubview:childComponentView];
|
|
1182
1246
|
if (_sidebarContainer.bounds.size.width <= 0 || _sidebarContainer.bounds.size.height <= 0) {
|
|
1183
1247
|
[self applyEstimatedSplitViewLayoutForBounds:[self currentLayoutBounds] layoutReady:NO];
|
|
1184
1248
|
} else {
|
|
@@ -1197,7 +1261,7 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
1197
1261
|
_contentReactView = childComponentView;
|
|
1198
1262
|
_contentReactLayoutMetrics = EmptyLayoutMetrics;
|
|
1199
1263
|
childComponentView.hidden = YES;
|
|
1200
|
-
[
|
|
1264
|
+
[_contentHost addSubview:childComponentView];
|
|
1201
1265
|
if (_contentContainer.bounds.size.width <= 0 || _contentContainer.bounds.size.height <= 0) {
|
|
1202
1266
|
[self applyEstimatedSplitViewLayoutForBounds:[self currentLayoutBounds] layoutReady:NO];
|
|
1203
1267
|
} else {
|
|
@@ -1216,7 +1280,7 @@ static char RNSidebarSplitViewStartupKey;
|
|
|
1216
1280
|
_listReactView = childComponentView;
|
|
1217
1281
|
_listReactLayoutMetrics = EmptyLayoutMetrics;
|
|
1218
1282
|
childComponentView.hidden = YES;
|
|
1219
|
-
[
|
|
1283
|
+
[_listHost addSubview:childComponentView];
|
|
1220
1284
|
[self syncReactSubview:_listReactView
|
|
1221
1285
|
nativeBounds:_hasList ? _listContainer.bounds : CGRectZero
|
|
1222
1286
|
previousLayoutMetrics:&_listReactLayoutMetrics];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legendapp/spark-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "src/index",
|
|
6
6
|
"react-native": "src/index",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"uniwind.web.ts"
|
|
15
15
|
],
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"react": "^19.
|
|
18
|
-
"react-native": "0.
|
|
19
|
-
"@expo/ui": "
|
|
17
|
+
"react": "^19.2.0",
|
|
18
|
+
"react-native": "0.83.10",
|
|
19
|
+
"@expo/ui": "55.0.17",
|
|
20
20
|
"uniwind": "^1.6.3",
|
|
21
|
-
"react-native-windows": "0.
|
|
21
|
+
"react-native-windows": "0.83.2"
|
|
22
22
|
},
|
|
23
23
|
"peerDependenciesMeta": {
|
|
24
24
|
"@expo/ui": {
|
|
@@ -69,6 +69,6 @@
|
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"clsx": "^2.1.1",
|
|
71
71
|
"tailwind-merge": "^3.4.0",
|
|
72
|
-
"@legendapp/spark-desktop-app": "0.0.
|
|
72
|
+
"@legendapp/spark-desktop-app": "0.0.3"
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -6,14 +6,18 @@ export type SidebarSplitViewResizeEvent = Readonly<{
|
|
|
6
6
|
contentHeight: Double;
|
|
7
7
|
contentWidth: Double;
|
|
8
8
|
contentX: Double;
|
|
9
|
+
contentY: Double;
|
|
9
10
|
height: Double;
|
|
10
11
|
isLayoutReady: boolean;
|
|
11
12
|
isVertical: boolean;
|
|
12
13
|
listHeight: Double;
|
|
13
14
|
listWidth: Double;
|
|
14
15
|
listX: Double;
|
|
16
|
+
listY: Double;
|
|
15
17
|
sidebarHeight: Double;
|
|
16
18
|
sidebarWidth: Double;
|
|
19
|
+
sidebarX: Double;
|
|
20
|
+
sidebarY: Double;
|
|
17
21
|
}>;
|
|
18
22
|
|
|
19
23
|
export type SidebarSplitViewCollapsedChangeEvent = Readonly<{
|
|
@@ -7,7 +7,8 @@ import NativeSplitView from "./SidebarSplitViewNativeComponent";
|
|
|
7
7
|
export type SidebarSplitViewAppearance = "system" | "light" | "dark";
|
|
8
8
|
export type SidebarSplitViewTitlebarMaterial = "none" | "glass" | "titlebar" | "headerView" | "hudWindow" | "sidebar" | "windowBackground";
|
|
9
9
|
export interface SidebarSplitViewPaneMetrics { contentHeight: number; contentWidth: number; sidebarHeight: number; sidebarWidth: number; listHeight?: number; listWidth?: number }
|
|
10
|
-
export interface
|
|
10
|
+
export interface SidebarSplitViewPaneOrigins { sidebarX: number; sidebarY: number; contentX: number; contentY: number; listX: number; listY: number }
|
|
11
|
+
export interface SidebarSplitViewResizeEvent extends SidebarSplitViewPaneMetrics, SidebarSplitViewPaneOrigins { listHeight: number; listWidth: number; height: number; phase: "provisional" | "ready" }
|
|
11
12
|
export interface SplitViewTitleBarOverlay { color: string; opacity?: number }
|
|
12
13
|
export interface SplitViewTitleBarOptions {
|
|
13
14
|
content?: { height?: number; material?: SidebarSplitViewTitlebarMaterial; overlay?: SplitViewTitleBarOverlay };
|
|
@@ -39,7 +40,8 @@ function metrics(value: SidebarSplitViewPaneMetrics) {
|
|
|
39
40
|
for (const key of ["contentHeight", "contentWidth", "sidebarHeight", "sidebarWidth"] as const) finite(value[key], key);
|
|
40
41
|
for (const key of ["listHeight", "listWidth"] as const) if (value[key] !== undefined) finite(value[key], key);
|
|
41
42
|
}
|
|
42
|
-
const paneKeys = ["contentHeight", "contentWidth", "sidebarHeight", "sidebarWidth", "listHeight", "listWidth"] as const;
|
|
43
|
+
const paneKeys = ["contentHeight", "contentWidth", "sidebarHeight", "sidebarWidth", "listHeight", "listWidth", "sidebarX", "sidebarY", "contentX", "contentY", "listX", "listY"] as const;
|
|
44
|
+
const originKeys = ["sidebarX", "sidebarY", "contentX", "contentY", "listX", "listY"] as const;
|
|
43
45
|
function keys(value: unknown, allowed: readonly string[]) {
|
|
44
46
|
if (!value || typeof value !== "object" || Array.isArray(value)) throw new SparkError("E_INVALID_ARGUMENT", "Expected title-bar options");
|
|
45
47
|
for (const key of Object.keys(value)) if (!allowed.includes(key)) throw new SparkError("E_UNSUPPORTED_OPTION", `Unknown title-bar option: ${key}`);
|
|
@@ -65,14 +67,14 @@ export function SidebarSplitView({ sidebar, content, list, children, appearance:
|
|
|
65
67
|
if (!["none", "glass", "titlebar", "headerView", "hudWindow", "sidebar", "windowBackground"].includes(material)) throw new SparkError("E_INVALID_ARGUMENT", "Invalid title-bar material");
|
|
66
68
|
callback(onResize, "resize"); callback(onSidebarCollapsedChange, "sidebar collapsed change");
|
|
67
69
|
const control = useControl({ ref, onError }, getSplitViewAvailability());
|
|
68
|
-
const [paneMetrics, setPaneMetrics] = useState<SidebarSplitViewPaneMetrics | undefined>(() => initialPaneMetrics ? { ...initialPaneMetrics } : undefined);
|
|
69
|
-
function resize(event: NativeSyntheticEvent<SidebarSplitViewPaneMetrics &
|
|
70
|
+
const [paneMetrics, setPaneMetrics] = useState<SidebarSplitViewPaneMetrics & Partial<SidebarSplitViewPaneOrigins> | undefined>(() => initialPaneMetrics ? { ...initialPaneMetrics } : undefined);
|
|
71
|
+
function resize(event: NativeSyntheticEvent<SidebarSplitViewPaneMetrics & SidebarSplitViewPaneOrigins & { height: number; isLayoutReady: boolean }>) {
|
|
70
72
|
if (!control.active()) return;
|
|
71
73
|
let value: SidebarSplitViewResizeEvent;
|
|
72
74
|
try {
|
|
73
|
-
const data = event?.nativeEvent; metrics(data); finite(data.listHeight, "list height"); finite(data.listWidth, "list width");
|
|
75
|
+
const data = event?.nativeEvent; metrics(data); finite(data.listHeight, "list height"); finite(data.listWidth, "list width"); for (const key of originKeys) finite(data[key], key, -Infinity); finite(data.height, "height");
|
|
74
76
|
if (typeof data.isLayoutReady !== "boolean") throw new Error("Expected layout readiness");
|
|
75
|
-
value = { contentHeight: data.contentHeight, contentWidth: data.contentWidth, sidebarHeight: data.sidebarHeight, sidebarWidth: data.sidebarWidth, listHeight: data.listHeight, listWidth: data.listWidth, contentX: data.contentX, listX: data.listX, height: data.height, phase: data.isLayoutReady ? "ready" : "provisional" };
|
|
77
|
+
value = { contentHeight: data.contentHeight, contentWidth: data.contentWidth, sidebarHeight: data.sidebarHeight, sidebarWidth: data.sidebarWidth, listHeight: data.listHeight, listWidth: data.listWidth, sidebarX: data.sidebarX, sidebarY: data.sidebarY, contentX: data.contentX, contentY: data.contentY, listX: data.listX, listY: data.listY, height: data.height, phase: data.isLayoutReady ? "ready" : "provisional" };
|
|
76
78
|
} catch (cause) { control.error(new SparkError("E_INVALID_DATA", "Invalid split-view layout", { cause })); return; }
|
|
77
79
|
setPaneMetrics(current => current && paneKeys.every(key => current[key] === value[key]) ? current : value);
|
|
78
80
|
onResize?.(value);
|
|
@@ -87,8 +89,8 @@ export function SidebarSplitView({ sidebar, content, list, children, appearance:
|
|
|
87
89
|
return <NativeSplitView {...props} ref={control.ref} appearance={theme} contentMinWidth={contentMinWidth} sidebarMinWidth={sidebarMinWidth} sidebarWidth={sidebarWidth} hasList={hasList} listMinWidth={listMinWidth} listWidth={listWidth} sidebarCollapsed={sidebarCollapsed} onSplitViewDidResize={resize} onSidebarCollapsedChange={collapsedChange}
|
|
88
90
|
contentTitlebarHeight={titleBar.content?.height ?? 0} contentTitlebarMaterial={material} contentTitlebarOverlayColor={titleBar.content?.overlay?.color} contentTitlebarOverlayOpacity={titleBar.content?.overlay?.opacity ?? (titleBar.content?.overlay ? 1 : 0)}
|
|
89
91
|
sidebarTitlebarOverlayColor={titleBar.sidebar?.overlay?.color} sidebarTitlebarOverlayOpacity={titleBar.sidebar?.overlay?.opacity ?? (titleBar.sidebar?.overlay ? 1 : 0)}>
|
|
90
|
-
<View key="sidebar" style={{ position: "absolute", top: 0, left: 0, minWidth: 0, height: paneMetrics?.sidebarHeight, width: paneMetrics?.sidebarWidth ?? (sidebarCollapsed ? 0 : sidebarWidth ?? sidebarMinWidth) }}>{sidebar}</View>
|
|
91
|
-
<View key="content" style={{ position: "absolute", top: 0, left: 0, minWidth: 0, overflow: "hidden", height: paneMetrics?.contentHeight, width: paneMetrics?.contentWidth }}>{content}</View>
|
|
92
|
-
{hasList ? <View key="list" style={{ position: "absolute", top: 0, left: 0, minWidth: 0, height: paneMetrics?.listHeight, width: paneMetrics?.listWidth ?? listWidth ?? listMinWidth }}>{list}</View> : null}
|
|
92
|
+
<View key="sidebar" style={{ position: "absolute", top: paneMetrics?.sidebarY ?? 0, left: paneMetrics?.sidebarX ?? 0, minWidth: 0, height: paneMetrics?.sidebarHeight, width: paneMetrics?.sidebarWidth ?? (sidebarCollapsed ? 0 : sidebarWidth ?? sidebarMinWidth) }}>{sidebar}</View>
|
|
93
|
+
<View key="content" style={{ position: "absolute", top: paneMetrics?.contentY ?? 0, left: paneMetrics?.contentX ?? 0, minWidth: 0, overflow: "hidden", height: paneMetrics?.contentHeight, width: paneMetrics?.contentWidth }}>{content}</View>
|
|
94
|
+
{hasList ? <View key="list" style={{ position: "absolute", top: paneMetrics?.listY ?? 0, left: paneMetrics?.listX ?? 0, minWidth: 0, height: paneMetrics?.listHeight, width: paneMetrics?.listWidth ?? listWidth ?? listMinWidth }}>{list}</View> : null}
|
|
93
95
|
</NativeSplitView>;
|
|
94
96
|
}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import type { ComponentProps } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
type Compose = typeof import("@expo/ui/jetpack-compose");
|
|
3
|
+
const compose = () => require("@expo/ui/jetpack-compose") as Compose;
|
|
4
|
+
const buttons = { default: "Button", bordered: "OutlinedButton", borderless: "TextButton" } as const;
|
|
5
|
+
function ExpoButton({ variant, label, ...props }: Omit<ComponentProps<Compose["Button"]>, "children"> & { variant: keyof typeof buttons; label: string }) {
|
|
6
|
+
const { Host, Text, [buttons[variant]]: Component } = compose();
|
|
7
|
+
return <Host style={{ flex: 1 }}><Component {...props}><Text>{label}</Text></Component></Host>;
|
|
8
|
+
}
|
|
9
|
+
function Segments({ labels, selected, enabled, onSelect }: { labels: string[]; selected: number; enabled: boolean; onSelect: (index: number) => void }) {
|
|
10
|
+
const { Host, Text, SingleChoiceSegmentedButtonRow, SegmentedButton } = compose();
|
|
11
|
+
const { selectable } = require("@expo/ui/jetpack-compose/modifiers") as typeof import("@expo/ui/jetpack-compose/modifiers");
|
|
12
|
+
return <Host style={{ flex: 1 }}><SingleChoiceSegmentedButtonRow>{labels.map((label, index) =>
|
|
13
|
+
<SegmentedButton key={index} selected={index === selected} enabled={enabled} onClick={() => onSelect(index)}
|
|
14
|
+
modifiers={[selectable(index === selected, () => onSelect(index), "radioButton")]}><SegmentedButton.Label><Text>{label}</Text></SegmentedButton.Label></SegmentedButton>)}
|
|
15
|
+
</SingleChoiceSegmentedButtonRow></Host>;
|
|
5
16
|
}
|
|
6
17
|
import { View, Text } from "react-native";
|
|
7
18
|
import { requireOptionalNativeModule } from "expo-modules-core";
|
|
@@ -18,9 +29,9 @@ export function getControlAvailability(control: ControlKind): Availability {
|
|
|
18
29
|
export function Button(props: ButtonProps) {
|
|
19
30
|
validateButton(props); const control = useControl(props, getControlAvailability("button"));
|
|
20
31
|
const { children, onPress, variant = "default", style, testID, accessibilityLabel = children } = props;
|
|
21
|
-
return <View ref={control.ref} style={[{ width: 160, height: 48 }, style]} testID={testID}>
|
|
22
|
-
{control.failed ? <Text
|
|
23
|
-
<ExpoButton
|
|
32
|
+
return <View ref={control.ref} style={[{ width: 160, height: 48 }, style]} testID={testID} accessibilityLabel={accessibilityLabel}>
|
|
33
|
+
{control.failed ? <Text accessibilityState={{ disabled: true }}>{children}</Text> :
|
|
34
|
+
<ExpoButton onClick={() => { if (control.active()) onPress?.(); }} enabled={!control.disabled} variant={variant} label={children} />}
|
|
24
35
|
</View>;
|
|
25
36
|
}
|
|
26
37
|
function Selection(props: SelectProps) {
|
|
@@ -28,10 +39,9 @@ function Selection(props: SelectProps) {
|
|
|
28
39
|
if (typeof props.onValueChange !== "function") throw new SparkError("E_INVALID_ARGUMENT", "Expected onValueChange");
|
|
29
40
|
const control = useControl(props, getControlAvailability("select"));
|
|
30
41
|
return <View ref={control.ref} style={[{ width: 280, minHeight: 48, flexDirection: "row" }, props.style]} testID={props.testID} accessibilityLabel={props.accessibilityLabel}>
|
|
31
|
-
{control.failed ? <Text accessibilityState={{ disabled: true }}>{props.options[selected].label}</Text> :
|
|
32
|
-
<
|
|
33
|
-
{
|
|
34
|
-
onPress={() => { if (control.active()) props.onValueChange(option.value); }}>{option.label}</ExpoButton>)}
|
|
42
|
+
{control.failed ? <Text accessibilityState={{ disabled: true }}>{props.options[selected].label}</Text> :
|
|
43
|
+
<Segments labels={props.options.map(option => option.label)} selected={selected} enabled={!control.disabled}
|
|
44
|
+
onSelect={index => { if (control.active()) props.onValueChange(props.options[index].value); }} />}
|
|
35
45
|
</View>;
|
|
36
46
|
}
|
|
37
47
|
/** Android presents its choices inline; there is no dropdown backend in the pinned Expo UI. */
|
|
@@ -7,11 +7,15 @@ function Host(props: ComponentProps<typeof import("@expo/ui/swift-ui").Host>) {
|
|
|
7
7
|
const Component = (require("@expo/ui/swift-ui") as typeof import("@expo/ui/swift-ui")).Host;
|
|
8
8
|
return <Component {...props} />;
|
|
9
9
|
}
|
|
10
|
-
function Picker(props: ComponentProps<typeof import("@expo/ui/swift-ui").Picker
|
|
11
|
-
const Component = (require("@expo/ui/swift-ui") as typeof import("@expo/ui/swift-ui")).Picker
|
|
10
|
+
function Picker(props: ComponentProps<typeof import("@expo/ui/swift-ui").Picker<number>>) {
|
|
11
|
+
const Component = (require("@expo/ui/swift-ui") as typeof import("@expo/ui/swift-ui")).Picker<number>;
|
|
12
12
|
return <Component {...props} />;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
function Option(props: ComponentProps<typeof import("@expo/ui/swift-ui").Text>) {
|
|
15
|
+
const Component = (require("@expo/ui/swift-ui") as typeof import("@expo/ui/swift-ui")).Text;
|
|
16
|
+
return <Component {...props} />;
|
|
17
|
+
}
|
|
18
|
+
import { frame, buttonStyle, pickerStyle, tag, disabled as disabledModifier, accessibilityLabel as labelModifier } from "@expo/ui/swift-ui/modifiers";
|
|
15
19
|
import { View, Text } from "react-native";
|
|
16
20
|
import { SparkError, type Availability } from "@legendapp/spark-desktop-app/src/contracts";
|
|
17
21
|
import { requireOptionalNativeModule } from "expo-modules-core";
|
|
@@ -30,8 +34,8 @@ export function Button(props: ButtonProps) {
|
|
|
30
34
|
const { children, onPress, variant = "default", style, testID, accessibilityLabel = children } = props;
|
|
31
35
|
return <View ref={control.ref} style={[{ width: 160, height: 44 }, style]}>
|
|
32
36
|
{control.failed ? <Text accessibilityLabel={accessibilityLabel} accessibilityState={{ disabled: true }} testID={testID}>{children}</Text> :
|
|
33
|
-
<Host style={{ flex: 1 }}><ExpoButton onPress={() => { if (control.active()) onPress?.(); }}
|
|
34
|
-
|
|
37
|
+
<Host style={{ flex: 1 }}><ExpoButton label={children} onPress={() => { if (control.active()) onPress?.(); }}
|
|
38
|
+
modifiers={[...fill, buttonStyle(variant === "default" ? "automatic" : variant), disabledModifier(control.disabled), labelModifier(accessibilityLabel)]} testID={testID} /></Host>}
|
|
35
39
|
</View>;
|
|
36
40
|
}
|
|
37
41
|
function Selection({ segmented, ...props }: SelectProps & { segmented: boolean }) {
|
|
@@ -43,16 +47,17 @@ function Selection({ segmented, ...props }: SelectProps & { segmented: boolean }
|
|
|
43
47
|
const modifiers = [disabledModifier(control.disabled), ...(accessibilityLabel ? [labelModifier(accessibilityLabel)] : [])];
|
|
44
48
|
return <View ref={control.ref} style={[{ width: 240, height: 44 }, style]}>
|
|
45
49
|
{control.failed ? <Text accessibilityLabel={accessibilityLabel} accessibilityState={{ disabled: true }} testID={testID}>{options[selectedIndex].label}</Text> :
|
|
46
|
-
<Host style={{ flex: 1 }}><Picker key={selectionRevision}
|
|
47
|
-
|
|
50
|
+
<Host style={{ flex: 1 }}><Picker key={selectionRevision} selection={selectedIndex}
|
|
51
|
+
onSelectionChange={index => {
|
|
48
52
|
if (!control.active()) return;
|
|
49
|
-
const index = event?.nativeEvent?.index;
|
|
50
53
|
if (!Number.isInteger(index) || !options[index]) { control.error(new SparkError("E_INVALID_DATA", "Invalid native selection")); return; }
|
|
51
54
|
// Expo's SwiftUI picker retains local selection and ignores an unchanged
|
|
52
|
-
//
|
|
55
|
+
// selection. A fresh picker also restores a parent-vetoed selection.
|
|
53
56
|
revise(value => value + 1);
|
|
54
57
|
onValueChange(options[index].value);
|
|
55
|
-
}} modifiers={modifiers} testID={testID}
|
|
58
|
+
}} modifiers={[pickerStyle(segmented ? "segmented" : "menu"), ...modifiers]} testID={testID}>
|
|
59
|
+
{options.map((option, index) => <Option key={option.value} modifiers={[tag(index)]}>{option.label}</Option>)}
|
|
60
|
+
</Picker></Host>}
|
|
56
61
|
</View>;
|
|
57
62
|
}
|
|
58
63
|
export function Select(props: SelectProps) { return <Selection {...props} segmented={false} />; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./desktop";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legendapp/spark-updates",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"Sparkle.podspec.json"
|
|
12
12
|
],
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"react": "^19.
|
|
15
|
-
"react-native": "0.
|
|
14
|
+
"react": "^19.2.0",
|
|
15
|
+
"react-native": "0.83.10"
|
|
16
16
|
},
|
|
17
17
|
"codegenConfig": {
|
|
18
18
|
"name": "RNDesktopUpdatesSpec",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
]
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@legendapp/spark-desktop-app": "0.0.
|
|
41
|
+
"@legendapp/spark-desktop-app": "0.0.3"
|
|
42
42
|
},
|
|
43
43
|
"private": true
|
|
44
44
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legendapp/spark-webview",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -8,8 +8,15 @@
|
|
|
8
8
|
"src"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"
|
|
12
|
-
"@legendapp/spark-desktop-app": "0.0.1"
|
|
11
|
+
"@legendapp/spark-desktop-app": "0.0.3"
|
|
13
12
|
},
|
|
14
|
-
"private": true
|
|
13
|
+
"private": true,
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"react-native-webview": "16.0.0"
|
|
16
|
+
},
|
|
17
|
+
"peerDependenciesMeta": {
|
|
18
|
+
"react-native-webview": {
|
|
19
|
+
"optional": true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
15
22
|
}
|
package/camera.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
Camera, VisionCamera, getCameraDevice, getAllCameraDevices, getDefaultCameraDevice,
|
|
3
|
-
addOnCameraDevicesChangedListener, useCamera, useCameraDevice, useCameraDevices,
|
|
4
|
-
useCameraPermission, useMicrophonePermission, usePhotoOutput, useVideoOutput,
|
|
5
|
-
} from "react-native-vision-camera";
|
|
6
|
-
export type {
|
|
7
|
-
CameraDevice, CameraRef, CameraViewProps, CameraProps, CameraSession,
|
|
8
|
-
CameraSessionConfig, CameraSessionConfiguration, CameraController, CameraFactory,
|
|
9
|
-
CameraPhotoOutput, CameraVideoOutput, PhotoOutputOptions, VideoOutputOptions,
|
|
10
|
-
Photo, Recorder, PermissionStatus, PermissionState, Constraint,
|
|
11
|
-
} from "react-native-vision-camera";
|
|
12
|
-
export { NitroImage } from "react-native-nitro-image";
|
|
13
|
-
export type { Image } from "react-native-nitro-image";
|