react-native-windows 0.81.36 → 0.81.38

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 (40) hide show
  1. package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +6 -2
  2. package/Microsoft.ReactNative/Fabric/AbiShadowNode.cpp +0 -47
  3. package/Microsoft.ReactNative/Fabric/AbiShadowNode.h +40 -8
  4. package/Microsoft.ReactNative/Fabric/AbiState.h +26 -8
  5. package/Microsoft.ReactNative/Fabric/AbiTextInputProps.h +51 -0
  6. package/Microsoft.ReactNative/Fabric/AbiTextInputShadowNode.cpp +88 -0
  7. package/Microsoft.ReactNative/Fabric/AbiTextInputShadowNode.h +65 -0
  8. package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.h +52 -18
  9. package/Microsoft.ReactNative/Fabric/AbiViewShadowNode.cpp +0 -18
  10. package/Microsoft.ReactNative/Fabric/AbiViewShadowNode.h +16 -4
  11. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +2 -1
  12. package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +1 -2
  13. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +3 -2
  14. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +22 -0
  15. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +2 -1
  16. package/Microsoft.ReactNative/Fabric/Composition/TextInput/AbiTextInputState.h +38 -0
  17. package/Microsoft.ReactNative/Fabric/Composition/TextInput/ConcreteTextInputShadowNode.h +272 -0
  18. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +21 -14
  19. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +328 -75
  20. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +24 -4
  21. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.h +1 -1
  22. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +0 -205
  23. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +22 -65
  24. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +2 -1
  25. package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +0 -1
  26. package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +5 -0
  27. package/Microsoft.ReactNative/TurboModulesProvider.cpp +30 -13
  28. package/Microsoft.ReactNative/ViewProps.idl +11 -0
  29. package/Microsoft.ReactNative.Cxx/ComponentView.Experimental.interop.h +12 -0
  30. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  31. package/PropertySheets/WinUI.props +2 -1
  32. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/Instance.cpp +386 -0
  33. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.h +148 -0
  34. package/Scripts/EnableInternalWinAppSDKFeed.ps1 +12 -5
  35. package/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 +2 -2
  36. package/Shared/Shared.vcxitems +3 -3
  37. package/Shared/Shared.vcxitems.filters +1 -1
  38. package/index.windows.js +5 -0
  39. package/package.json +2 -2
  40. package/Microsoft.ReactNative/Fabric/AbiState.cpp +0 -29
@@ -85,7 +85,7 @@ static inline void fromRawValue(
85
85
  }
86
86
  }
87
87
 
88
- class WindowsTextInputProps final : public ViewProps, public BaseTextProps {
88
+ class WindowsTextInputProps : public ViewProps, public BaseTextProps {
89
89
  public:
90
90
  WindowsTextInputProps() = default;
91
91
  WindowsTextInputProps(
@@ -1,213 +1,8 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
 
4
- #include "WindowsTextInputShadowNode.h"
5
-
6
- #include <react/featureflags/ReactNativeFeatureFlags.h>
7
- #include <react/renderer/attributedstring/AttributedStringBox.h>
8
- #include <react/renderer/attributedstring/PlaceholderAttributedString.h>
9
- #include <react/renderer/attributedstring/TextAttributes.h>
10
- #include <react/renderer/components/text/BaseTextShadowNode.h>
11
- #include <react/renderer/core/LayoutConstraints.h>
12
- #include <react/renderer/core/LayoutContext.h>
13
- #include <react/renderer/core/conversions.h>
14
- #include <react/renderer/textlayoutmanager/TextLayoutContext.h>
15
-
16
4
  namespace facebook::react {
17
5
 
18
6
  extern const char WindowsTextInputComponentName[] = "WindowsTextInput";
19
7
 
20
- void WindowsTextInputShadowNode::setTextLayoutManager(std::shared_ptr<const TextLayoutManager> textLayoutManager) {
21
- ensureUnsealed();
22
- textLayoutManager_ = std::move(textLayoutManager);
23
- }
24
-
25
- Size WindowsTextInputShadowNode::measureContent(
26
- const LayoutContext &layoutContext,
27
- const LayoutConstraints &layoutConstraints) const {
28
- // Layout is called right after measure.
29
- // Measure is marked as `const`, and `layout` is not; so State can be
30
- // updated during layout, but not during `measure`. If State is out-of-date
31
- // in layout, it's too late: measure will have already operated on old
32
- // State. Thus, we use the same value here that we *will* use in layout to
33
- // update the state.
34
- AttributedString attributedString = getMostRecentAttributedString(layoutContext);
35
-
36
- if (attributedString.isEmpty()) {
37
- attributedString = getPlaceholderAttributedString(layoutContext);
38
- }
39
-
40
- // BaseTextShadowNode only gets children. We must detect and prepend text
41
- // value attributes manually.
42
- if (!getConcreteProps().text.empty()) {
43
- auto textAttributes = TextAttributes::defaultTextAttributes();
44
- textAttributes.apply(getConcreteProps().textAttributes);
45
- auto fragment = AttributedString::Fragment{};
46
- fragment.string = getConcreteProps().text;
47
- fragment.textAttributes = textAttributes;
48
- // If the TextInput opacity is 0 < n < 1, the opacity of the TextInput and
49
- // text value's background will stack. This is a hack/workaround to prevent
50
- // that effect.
51
- fragment.textAttributes.backgroundColor = clearColor();
52
- fragment.parentShadowView = ShadowView(*this);
53
- attributedString.prependFragment(std::move(fragment));
54
- }
55
-
56
- TextLayoutContext textLayoutContext;
57
- textLayoutContext.pointScaleFactor = layoutContext.pointScaleFactor;
58
-
59
- facebook::react::ParagraphAttributes paragraphAttributes{};
60
- paragraphAttributes.maximumNumberOfLines = getConcreteProps().multiline ? 0 : 1;
61
- return textLayoutManager_
62
- ->measure(AttributedStringBox{attributedString}, paragraphAttributes, textLayoutContext, layoutConstraints)
63
- .size;
64
- }
65
-
66
- void WindowsTextInputShadowNode::layout(LayoutContext layoutContext) {
67
- updateStateIfNeeded(layoutContext);
68
- ConcreteViewShadowNode::layout(layoutContext);
69
- }
70
-
71
- LayoutConstraints WindowsTextInputShadowNode::getTextConstraints(const LayoutConstraints &layoutConstraints) const {
72
- if (getConcreteProps().multiline) {
73
- return layoutConstraints;
74
- } else {
75
- // A single line TextInput acts as a horizontal scroller of infinitely
76
- // expandable text, so we want to measure the text as if it is allowed to
77
- // infinitely expand horizontally, and later clamp to the constraints of the
78
- // input.
79
- return LayoutConstraints{
80
- .minimumSize = layoutConstraints.minimumSize,
81
- .maximumSize =
82
- Size{
83
- .width = std::numeric_limits<Float>::infinity(),
84
- .height = layoutConstraints.maximumSize.height,
85
- },
86
- .layoutDirection = layoutConstraints.layoutDirection,
87
- };
88
- }
89
- }
90
-
91
- void WindowsTextInputShadowNode::updateStateIfNeeded(const LayoutContext &layoutContext) {
92
- ensureUnsealed();
93
- const auto &stateData = getStateData();
94
- auto reactTreeAttributedString = getAttributedString(layoutContext);
95
-
96
- // Tree is often out of sync with the value of the TextInput.
97
- // This is by design - don't change the value of the TextInput in the State,
98
- // and therefore in Java, unless the tree itself changes.
99
- if (stateData.reactTreeAttributedString == reactTreeAttributedString) {
100
- return;
101
- }
102
-
103
- // If props event counter is less than what we already have in state, skip it
104
- const auto &props = BaseShadowNode::getConcreteProps();
105
- if (props.mostRecentEventCount < stateData.mostRecentEventCount) {
106
- return;
107
- }
108
-
109
- // Store default TextAttributes in state.
110
- // In the case where the TextInput is completely empty (no value, no
111
- // defaultValue, no placeholder, no children) there are therefore no fragments
112
- // in the AttributedString, and when State is updated, it needs some way to
113
- // reconstruct a Fragment with default TextAttributes.
114
- auto defaultTextAttributes = TextAttributes::defaultTextAttributes();
115
- defaultTextAttributes.fontSizeMultiplier = layoutContext.fontSizeMultiplier;
116
- defaultTextAttributes.apply(getConcreteProps().textAttributes);
117
-
118
- auto newEventCount = stateData.reactTreeAttributedString.isContentEqual(reactTreeAttributedString)
119
- ? 0
120
- : getConcreteProps().mostRecentEventCount;
121
- auto newAttributedString = getMostRecentAttributedString(layoutContext);
122
-
123
- // Even if we're here and updating state, it may be only to update the layout
124
- // manager If that is the case, make sure we don't update text: pass in the
125
- // current attributedString unchanged, and pass in zero for the "event count"
126
- // so no changes are applied There's no way to prevent a state update from
127
- // flowing to Java, so we just ensure it's a noop in those cases.
128
-
129
- setStateData(
130
- WindowsTextInputState{AttributedStringBox(newAttributedString), reactTreeAttributedString, {}, newEventCount});
131
- }
132
-
133
- AttributedString WindowsTextInputShadowNode::getAttributedString(const LayoutContext &layoutContext) const {
134
- // Use BaseTextShadowNode to get attributed string from children
135
-
136
- auto childTextAttributes = TextAttributes::defaultTextAttributes();
137
- childTextAttributes.fontSizeMultiplier = layoutContext.fontSizeMultiplier;
138
- childTextAttributes.apply(getConcreteProps().textAttributes);
139
- // Don't propagate the background color of the TextInput onto the attributed
140
- // string. Android tries to render shadow of the background alongside the
141
- // shadow of the text which results in weird artifacts.
142
- childTextAttributes.backgroundColor = HostPlatformColor::UndefinedColor;
143
-
144
- auto attributedString = AttributedString{};
145
- auto attachments = BaseTextShadowNode::Attachments{};
146
- BaseTextShadowNode::buildAttributedString(childTextAttributes, *this, attributedString, attachments);
147
- attributedString.setBaseTextAttributes(childTextAttributes);
148
-
149
- // BaseTextShadowNode only gets children. We must detect and prepend text
150
- // value attributes manually.
151
- if (!getConcreteProps().text.empty()) {
152
- auto textAttributes = TextAttributes::defaultTextAttributes();
153
- textAttributes.fontSizeMultiplier = layoutContext.fontSizeMultiplier;
154
- textAttributes.apply(getConcreteProps().textAttributes);
155
- textAttributes.fontSizeMultiplier = layoutContext.fontSizeMultiplier;
156
- auto fragment = AttributedString::Fragment{};
157
- fragment.string = getConcreteProps().text;
158
- fragment.textAttributes = textAttributes;
159
- // If the TextInput opacity is 0 < n < 1, the opacity of the TextInput and
160
- // text value's background will stack. This is a hack/workaround to prevent
161
- // that effect.
162
- fragment.textAttributes.backgroundColor = clearColor();
163
- fragment.parentShadowView = ShadowView(*this);
164
- attributedString.prependFragment(std::move(fragment));
165
- }
166
-
167
- return attributedString;
168
- }
169
-
170
- AttributedString WindowsTextInputShadowNode::getMostRecentAttributedString(const LayoutContext &layoutContext) const {
171
- const auto &state = getStateData();
172
-
173
- auto reactTreeAttributedString = getAttributedString(layoutContext);
174
-
175
- // Sometimes the treeAttributedString will only differ from the state
176
- // not by inherent properties (string or prop attributes), but by the frame of
177
- // the parent which has changed Thus, we can't directly compare the entire
178
- // AttributedString
179
- bool treeAttributedStringChanged =
180
- !state.reactTreeAttributedString.compareTextAttributesWithoutFrame(reactTreeAttributedString);
181
-
182
- return (!treeAttributedStringChanged ? state.attributedStringBox.getValue() : reactTreeAttributedString);
183
- }
184
-
185
- AttributedString WindowsTextInputShadowNode::getPlaceholderAttributedString(const LayoutContext &layoutContext) const {
186
- const auto &props = getConcreteProps();
187
-
188
- AttributedString attributedString;
189
- attributedString.setBaseTextAttributes(props.textAttributes);
190
- //[windows
191
- if (!props.placeholder.empty()) {
192
- auto textAttributes = TextAttributes::defaultTextAttributes();
193
- textAttributes.fontSizeMultiplier = layoutContext.fontSizeMultiplier;
194
- textAttributes.apply(props.textAttributes);
195
-
196
- /*
197
- * These props are applied to `View`, therefore they must not be a part of
198
- * base text attributes.
199
- */
200
- textAttributes.backgroundColor = clearColor();
201
- textAttributes.opacity = 1;
202
-
203
- attributedString.appendFragment(
204
- {.string = props.placeholder, .textAttributes = textAttributes, .parentShadowView = ShadowView(*this)});
205
- }
206
- // windows]
207
-
208
- return ensurePlaceholderIfEmpty_DO_NOT_USE(attributedString);
209
- }
210
-
211
- #pragma mark - LayoutableShadowNode
212
-
213
8
  } // namespace facebook::react
@@ -3,84 +3,41 @@
3
3
 
4
4
  #pragma once
5
5
 
6
- #include <react/renderer/textlayoutmanager/WindowsTextLayoutManager.h>
6
+ #include "ConcreteTextInputShadowNode.h"
7
7
  #include "WindowsTextInputEventEmitter.h"
8
8
  #include "WindowsTextInputProps.h"
9
9
  #include "WindowsTextInputState.h"
10
10
 
11
- #include <react/components/rnwcore/EventEmitters.h>
12
- #include <unordered_map>
13
-
11
+ #include <react/featureflags/ReactNativeFeatureFlags.h>
14
12
  #include <react/renderer/attributedstring/AttributedString.h>
15
- #include <react/renderer/components/view/ConcreteViewShadowNode.h>
16
- #include <react/utils/ContextContainer.h>
13
+ #include <react/renderer/attributedstring/AttributedStringBox.h>
14
+ #include <react/renderer/core/conversions.h>
17
15
 
18
16
  namespace facebook::react {
19
17
 
20
18
  extern const char WindowsTextInputComponentName[];
21
19
 
22
- /*
23
- * `ShadowNode` for <WindowsTextInput> component.
24
- */
25
- class WindowsTextInputShadowNode final : public ConcreteViewShadowNode<
20
+ class WindowsTextInputShadowNode final : public ConcreteTextInputShadowNode<
26
21
  WindowsTextInputComponentName,
27
- WindowsTextInputProps,
28
- WindowsTextInputEventEmitter,
29
- WindowsTextInputState> {
22
+ facebook::react::WindowsTextInputProps,
23
+ facebook::react::WindowsTextInputEventEmitter,
24
+ facebook::react::WindowsTextInputState> {
30
25
  public:
31
- using ConcreteViewShadowNode::ConcreteViewShadowNode;
32
-
33
- static ShadowNodeTraits BaseTraits() {
34
- auto traits = ConcreteViewShadowNode::BaseTraits();
35
- traits.set(ShadowNodeTraits::Trait::LeafYogaNode);
36
- traits.set(ShadowNodeTraits::Trait::MeasurableYogaNode);
37
- traits.set(ShadowNodeTraits::Trait::BaselineYogaNode);
38
- return traits;
39
- }
40
-
41
- /*
42
- * Associates a shared TextLayoutManager with the node.
43
- * `TextInputShadowNode` uses the manager to measure text content
44
- * and construct `TextInputState` objects.
45
- */
46
- void setTextLayoutManager(std::shared_ptr<const TextLayoutManager> textLayoutManager);
47
-
48
- #pragma mark - LayoutableShadowNode
49
- protected:
50
- Size measureContent(const LayoutContext &layoutContext, const LayoutConstraints &layoutConstraints) const override;
51
-
52
- void layout(LayoutContext layoutContext) override;
53
-
54
- Float baseline(const LayoutContext &layoutContext, Size size) const override {
55
- // Calculate baseline as 80% of the text height
56
- return size.height * 0.8f;
26
+ using Super = ConcreteTextInputShadowNode<
27
+ WindowsTextInputComponentName,
28
+ facebook::react::WindowsTextInputProps,
29
+ facebook::react::WindowsTextInputEventEmitter,
30
+ facebook::react::WindowsTextInputState>;
31
+ using Super::Super;
32
+
33
+ void updateTextInputState(
34
+ facebook::react::AttributedStringBox attributedStringBox,
35
+ facebook::react::AttributedString &reactTreeAttributedString,
36
+ facebook::react::ParagraphAttributes paragraphAttributes,
37
+ int64_t mostRecentEventCount) override {
38
+ Super::setStateData(facebook::react::WindowsTextInputState{
39
+ attributedStringBox, reactTreeAttributedString, paragraphAttributes, mostRecentEventCount});
57
40
  }
58
-
59
- std::shared_ptr<const TextLayoutManager> textLayoutManager_;
60
-
61
- /*
62
- * Determines the constraints to use while measure the underlying text
63
- */
64
- LayoutConstraints getTextConstraints(const LayoutConstraints &layoutConstraints) const;
65
-
66
- private:
67
- /*
68
- * Creates a `State` object (with `AttributedText` and
69
- * `TextLayoutManager`) if needed.
70
- */
71
- void updateStateIfNeeded(const LayoutContext &layoutContext);
72
-
73
- /*
74
- * Returns a `AttributedString` which represents text content of the node.
75
- */
76
- AttributedString getAttributedString(const LayoutContext &layoutContext) const;
77
-
78
- /**
79
- * Get the most up-to-date attributed string for measurement and State.
80
- */
81
- AttributedString getMostRecentAttributedString(const LayoutContext &layoutContext) const;
82
-
83
- AttributedString getPlaceholderAttributedString(const LayoutContext &layoutContext) const;
84
41
  };
85
42
 
86
43
  } // namespace facebook::react
@@ -11,6 +11,7 @@
11
11
  #include <react/renderer/attributedstring/ParagraphAttributes.h>
12
12
  #include <react/renderer/textlayoutmanager/TextLayoutManager.h>
13
13
 
14
+ #include <Fabric/AbiState.h>
14
15
  #include <folly/dynamic.h>
15
16
  #include <react/renderer/mapbuffer/MapBuffer.h>
16
17
  #include <react/renderer/mapbuffer/MapBufferBuilder.h> // [windows]
@@ -20,7 +21,7 @@ namespace facebook::react {
20
21
  /*
21
22
  * State for <TextInput> component.
22
23
  */
23
- class WindowsTextInputState final {
24
+ class WindowsTextInputState {
24
25
  public:
25
26
  WindowsTextInputState() = default;
26
27
 
@@ -5,7 +5,6 @@
5
5
  #include "WindowsComponentDescriptorRegistry.h"
6
6
 
7
7
  #include <Fabric/AbiComponentDescriptor.h>
8
- #include <Fabric/AbiViewComponentDescriptor.h>
9
8
  #include <Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h>
10
9
  #include <react/components/rnwcore/ComponentDescriptors.h>
11
10
  #include <react/renderer/components/image/ImageComponentDescriptor.h>
@@ -25,6 +25,10 @@ namespace Microsoft.ReactNative.Composition
25
25
  [experimental]
26
26
  delegate void PortalComponentViewInitializer(PortalComponentView view);
27
27
 
28
+ [webhosthidden]
29
+ [experimental]
30
+ delegate void TextInputComponentViewInitializer(WindowsTextInputComponentView view);
31
+
28
32
  [experimental]
29
33
  [webhosthidden]
30
34
  delegate Microsoft.UI.Composition.Visual CreateVisualDelegate(Microsoft.ReactNative.ComponentView view);
@@ -69,6 +73,7 @@ namespace Microsoft.ReactNative.Composition
69
73
  void SetViewComponentViewInitializer(ViewComponentViewInitializer initializer);
70
74
  void SetContentIslandComponentViewInitializer(ComponentIslandComponentViewInitializer initializer);
71
75
  void SetPortalComponentViewInitializer(PortalComponentViewInitializer initializer);
76
+ void SetTextInputComponentViewInitializer(TextInputComponentViewInitializer initializer);
72
77
  void SetCreateVisualHandler(CreateVisualDelegate impl);
73
78
  void SetViewFeatures(ComponentViewFeatures viewFeatures);
74
79
  void SetUpdateLayoutMetricsHandler(UpdateLayoutMetricsDelegate impl);
@@ -36,7 +36,8 @@ struct TurboModuleMethodInfo {
36
36
  };
37
37
 
38
38
  struct TurboModuleBuilder : winrt::implements<TurboModuleBuilder, IReactModuleBuilder> {
39
- TurboModuleBuilder(const IReactContext &reactContext) noexcept : m_reactContext(reactContext) {}
39
+ TurboModuleBuilder(const IReactContext &reactContext, IInspectable runtimeHandle) noexcept
40
+ : m_reactContext(reactContext), m_runtimeHandle(std::move(runtimeHandle)) {}
40
41
 
41
42
  public: // IReactModuleBuilder
42
43
  void AddInitializer(InitializerDelegate const &initializer) noexcept {
@@ -44,11 +45,7 @@ struct TurboModuleBuilder : winrt::implements<TurboModuleBuilder, IReactModuleBu
44
45
  }
45
46
 
46
47
  void AddJsiInitializer(JsiInitializerDelegate const &initializer) noexcept {
47
- initializer(
48
- m_reactContext,
49
- winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactContext>(m_reactContext)
50
- ->GetInner()
51
- .JsiRuntime());
48
+ initializer(m_reactContext, m_runtimeHandle);
52
49
  }
53
50
 
54
51
  void AddConstantProvider(ConstantProviderDelegate const &constantProvider) noexcept {
@@ -91,6 +88,10 @@ struct TurboModuleBuilder : winrt::implements<TurboModuleBuilder, IReactModuleBu
91
88
  return m_eventEmitters;
92
89
  }
93
90
 
91
+ void CompleteRegistration() noexcept {
92
+ m_runtimeHandle = nullptr;
93
+ }
94
+
94
95
  private:
95
96
  void EnsureMemberNotSet(const std::string &key, bool checkingMethod) noexcept {
96
97
  VerifyElseCrash(m_methods.find(key) == m_methods.end());
@@ -103,6 +104,7 @@ struct TurboModuleBuilder : winrt::implements<TurboModuleBuilder, IReactModuleBu
103
104
 
104
105
  private:
105
106
  IReactContext m_reactContext;
107
+ IInspectable m_runtimeHandle;
106
108
  std::unordered_map<std::string, EventEmitterInitializerDelegate> m_eventEmitters;
107
109
  std::unordered_map<std::string, TurboModuleMethodInfo> m_methods;
108
110
  std::unordered_map<std::string, SyncMethodDelegate> m_syncMethods;
@@ -121,17 +123,16 @@ class TurboModuleImpl : public facebook::react::TurboModule {
121
123
  const std::string &name,
122
124
  const std::shared_ptr<facebook::react::CallInvoker> &jsInvoker,
123
125
  std::weak_ptr<facebook::react::LongLivedObjectCollection> longLivedObjectCollection,
126
+ IInspectable runtimeHandle,
124
127
  const ReactModuleProvider &reactModuleProvider)
125
128
  : facebook::react::TurboModule(name, jsInvoker),
126
129
  m_reactContext(reactContext),
127
130
  m_longLivedObjectCollection(std::move(longLivedObjectCollection)),
128
- m_moduleBuilder(winrt::make_self<TurboModuleBuilder>(reactContext)),
129
- m_providedModule(reactModuleProvider(m_moduleBuilder.as<IReactModuleBuilder>())) {
131
+ m_moduleBuilder(winrt::make_self<TurboModuleBuilder>(reactContext, std::move(runtimeHandle))) {
132
+ m_providedModule = reactModuleProvider(m_moduleBuilder.as<IReactModuleBuilder>());
133
+ m_moduleBuilder->CompleteRegistration();
134
+
130
135
  if (auto hostObject = m_providedModule.try_as<IJsiHostObject>()) {
131
- // Force ABI runtime creation if it hasn't already been created
132
- winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactContext>(m_reactContext)
133
- ->GetInner()
134
- .JsiRuntime();
135
136
  m_hostObjectWrapper = std::make_shared<implementation::HostObjectWrapper>(hostObject);
136
137
  }
137
138
  }
@@ -488,8 +489,24 @@ std::shared_ptr<facebook::react::TurboModule> TurboModulesProvider::getModule(
488
489
  return nullptr;
489
490
  }
490
491
 
492
+ if (!m_reactContext) {
493
+ return nullptr;
494
+ }
495
+
496
+ auto runtimeHandle = winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactContext>(m_reactContext)
497
+ ->GetInner()
498
+ .JsiRuntime();
499
+ if (!runtimeHandle) {
500
+ return nullptr;
501
+ }
502
+
491
503
  auto tm = std::make_shared<TurboModuleImpl>(
492
- m_reactContext, moduleName, callInvoker, m_longLivedObjectCollection, /*reactModuleProvider*/ it->second);
504
+ m_reactContext,
505
+ moduleName,
506
+ callInvoker,
507
+ m_longLivedObjectCollection,
508
+ std::move(runtimeHandle),
509
+ /*reactModuleProvider*/ it->second);
493
510
  return tm;
494
511
  }
495
512
 
@@ -98,5 +98,16 @@ namespace Microsoft.ReactNative {
98
98
  // TODO add accessors to all the properties on ImageProps
99
99
  }
100
100
 
101
+ [default_interface]
102
+ [webhosthidden]
103
+ [experimental]
104
+ runtimeclass TextInputProps : ViewProps
105
+ {
106
+ String Placeholder { get; };
107
+ Boolean SecureTextEntry { get; };
108
+ // TODO add accessors to all the properties on TextInputProps
109
+ }
110
+
111
+
101
112
 
102
113
  } // namespace Microsoft. ReactNative
@@ -3,6 +3,12 @@
3
3
 
4
4
  #pragma once
5
5
 
6
+ // #include <tom.h>
7
+ // #include <textserv.h>
8
+ struct ITextDocument2;
9
+ class ITextServices2;
10
+ class ITextHost;
11
+
6
12
  namespace Microsoft::ReactNative::Composition::Experimental {
7
13
 
8
14
  // This interface will be removed once we complete internal transitions to ContentIsland, and new APIs for hosting
@@ -11,4 +17,10 @@ struct __declspec(uuid("2A60D68A-57B8-43CA-B1BA-2FAF0FCB344B")) IComponentViewIn
11
17
  virtual HWND GetHwndForParenting() noexcept = 0;
12
18
  };
13
19
 
20
+ struct __declspec(uuid("ABA4F071-1C26-4D56-A608-75361ED21545")) ITextInputComponentInterop : IUnknown {
21
+ virtual HRESULT GetTextDocument(ITextDocument2 **textDocument) noexcept = 0;
22
+ virtual HRESULT GetTextServices(ITextServices2 **textServices) noexcept = 0;
23
+ virtual HRESULT GetTextHost(ITextHost **textHost) noexcept = 0;
24
+ };
25
+
14
26
  } // namespace Microsoft::ReactNative::Composition::Experimental
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.81.36</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.81.38</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>81</ReactNativeWindowsMinor>
16
- <ReactNativeWindowsPatch>36</ReactNativeWindowsPatch>
16
+ <ReactNativeWindowsPatch>38</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>87ecc02fbc3641eb70d8179f61fdb98ba5dd8f04</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>ccb36ddd863f089338b00f6735c742d2bdf4e88f</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -4,7 +4,8 @@
4
4
 
5
5
  <!--
6
6
  Internal versions are typically only located at: https://microsoft.visualstudio.com/DefaultCollection/ProjectReunion/_artifacts/feed/Project.Reunion.nuget.internal/NuGet/Microsoft.WindowsAppSDK/versions
7
- For local testing of internal versions, modify WinUI3ExperimentalVersion, and comment out the additional nuget source in NuGet.Config
7
+ For local testing of internal versions, set WinUI3ExperimentalVersion and run
8
+ vnext\Scripts\EnableInternalWinAppSDKFeed.ps1 to add the internal source and its package mapping.
8
9
  When this version is updated, be sure to update the default for the enableInternalFeed parameter of /.ado/templates/enable-experimental-winui3.yml
9
10
  -->
10
11
  <WinUI3ExperimentalVersion Condition="'$(WinUI3ExperimentalVersion)'==''">1.8.251106002</WinUI3ExperimentalVersion>