forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add multi-window support (#117)
* feat: add multi-window support * feat: introduce WindowManager fix: RCTReactViewController properly check props to update fix: use clearColor instead of systemBackgroundColor for visionOS (#125) feat: allow to use WindowHandlingModifier outside of RCTMainWindow fix: deep and universal links when app is running (#140) Co-authored-by: Thiago Brezinski <thiagobrez@gmail.com> fix: remove window init feat: add support for ornaments & dev menu trigger (#149) * feat: add support for ornaments * feat: add ornaments support to second window fix: allow to manually move dev menu to avoid conflicts (#150) fix: remove unnecessary diff after upstreaming changes (#151) Make CMake 3.29.0 as minimum required version (#155) fix: move visionOS codegen specs, sync with upstream chore: sync with upstream fix: remove template Move template to a separate repo fix: update oot-release scripts chore: remove unnecessary diff (#159) fix: react-native-config chore: sync with upstream chore: sync with upstrteam
- Loading branch information
1 parent
2355b98
commit c1f684a
Showing
76 changed files
with
1,358 additions
and
1,978 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
packages/react-native/Libraries/SwiftExtensions/RCTReactContext.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import SwiftUI | ||
import Observation | ||
|
||
@Observable | ||
public class RCTSceneData: Identifiable { | ||
public var id: String | ||
public var props: Dictionary<String, AnyHashable>? | ||
|
||
init(id: String, props: Dictionary<String, AnyHashable>?) { | ||
self.id = id | ||
self.props = props | ||
} | ||
} | ||
|
||
extension RCTSceneData: Equatable { | ||
public static func == (lhs: RCTSceneData, rhs: RCTSceneData) -> Bool { | ||
lhs.id == rhs.id && NSDictionary(dictionary: lhs.props ?? [:]).isEqual(to: rhs.props ?? [:]) | ||
} | ||
} | ||
|
||
@Observable | ||
public class RCTReactContext { | ||
public var scenes: Dictionary<String, RCTSceneData> = [:] | ||
|
||
public func getSceneData(id: String) -> RCTSceneData? { | ||
return scenes[id] | ||
} | ||
} | ||
|
||
extension RCTReactContext: Equatable { | ||
public static func == (lhs: RCTReactContext, rhs: RCTReactContext) -> Bool { | ||
NSDictionary(dictionary: lhs.scenes).isEqual(to: rhs.scenes) | ||
} | ||
} | ||
|
||
public extension EnvironmentValues { | ||
var reactContext: RCTReactContext { | ||
get { self[RCTSceneContextKey.self] } | ||
set { self[RCTSceneContextKey.self] = newValue } | ||
} | ||
} | ||
|
||
private struct RCTSceneContextKey: EnvironmentKey { | ||
static var defaultValue: RCTReactContext = RCTReactContext() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.