react-native-windows 0.74.37 → 0.74.39
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/Libraries/Components/Button.windows.js +3 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +103 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +42 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +4 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +27 -7
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.cpp +21 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.h +6 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.cpp +4 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +6 -9
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/HostPlatformColor.h +3 -1
- package/Microsoft.ReactNative/Modules/Animated/AnimationDriver.cpp +2 -1
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +2 -2
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +17 -3
- package/package.json +1 -1
|
@@ -152,6 +152,7 @@ type ButtonProps = $ReadOnly<{|
|
|
|
152
152
|
accessible?: ?boolean,
|
|
153
153
|
accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
|
|
154
154
|
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
|
|
155
|
+
onAccessibilityTap?: ?() => void, // Windows
|
|
155
156
|
accessibilityState?: ?AccessibilityState,
|
|
156
157
|
|
|
157
158
|
/**
|
|
@@ -331,6 +332,7 @@ const Button: React.AbstractComponent<
|
|
|
331
332
|
accessibilityHint,
|
|
332
333
|
accessibilityLanguage,
|
|
333
334
|
onAccessibilityAction,
|
|
335
|
+
onAccessibilityTap, // Windows
|
|
334
336
|
tabIndex,
|
|
335
337
|
} = props;
|
|
336
338
|
const buttonStyles: Array<ViewStyleProp> = [styles.button];
|
|
@@ -389,6 +391,7 @@ const Button: React.AbstractComponent<
|
|
|
389
391
|
accessibilityLanguage={accessibilityLanguage}
|
|
390
392
|
accessibilityRole="button"
|
|
391
393
|
accessibilityState={_accessibilityState}
|
|
394
|
+
onAccessibilityTap={onAccessibilityTap} // Windows
|
|
392
395
|
importantForAccessibility={_importantForAccessibility}
|
|
393
396
|
hasTVPreferredFocus={hasTVPreferredFocus}
|
|
394
397
|
nextFocusDown={nextFocusDown}
|
|
@@ -260,7 +260,7 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPatternProvider(PATTE
|
|
|
260
260
|
return S_OK;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
long
|
|
263
|
+
long GetControlTypeFromString(const std::string &role) noexcept {
|
|
264
264
|
if (role == "adjustable") {
|
|
265
265
|
return UIA_SliderControlTypeId;
|
|
266
266
|
} else if (role == "group" || role == "search" || role == "radiogroup" || role == "timer" || role.empty()) {
|
|
@@ -323,6 +323,96 @@ long GetControlType(const std::string &role) noexcept {
|
|
|
323
323
|
return UIA_GroupControlTypeId;
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
+
long GetControlTypeFromRole(const facebook::react::Role &role) noexcept {
|
|
327
|
+
switch (role) {
|
|
328
|
+
case facebook::react::Role::Alert:
|
|
329
|
+
return UIA_TextControlTypeId;
|
|
330
|
+
case facebook::react::Role::Application:
|
|
331
|
+
return UIA_WindowControlTypeId;
|
|
332
|
+
case facebook::react::Role::Button:
|
|
333
|
+
return UIA_ButtonControlTypeId;
|
|
334
|
+
case facebook::react::Role::Checkbox:
|
|
335
|
+
return UIA_CheckBoxControlTypeId;
|
|
336
|
+
case facebook::react::Role::Columnheader:
|
|
337
|
+
return UIA_HeaderControlTypeId;
|
|
338
|
+
case facebook::react::Role::Combobox:
|
|
339
|
+
return UIA_ComboBoxControlTypeId;
|
|
340
|
+
case facebook::react::Role::Document:
|
|
341
|
+
return UIA_DocumentControlTypeId;
|
|
342
|
+
case facebook::react::Role::Grid:
|
|
343
|
+
return UIA_GroupControlTypeId;
|
|
344
|
+
case facebook::react::Role::Group:
|
|
345
|
+
return UIA_GroupControlTypeId;
|
|
346
|
+
case facebook::react::Role::Heading:
|
|
347
|
+
return UIA_TextControlTypeId;
|
|
348
|
+
case facebook::react::Role::Img:
|
|
349
|
+
return UIA_ImageControlTypeId;
|
|
350
|
+
case facebook::react::Role::Link:
|
|
351
|
+
return UIA_HyperlinkControlTypeId;
|
|
352
|
+
case facebook::react::Role::List:
|
|
353
|
+
return UIA_ListControlTypeId;
|
|
354
|
+
case facebook::react::Role::Listitem:
|
|
355
|
+
return UIA_ListItemControlTypeId;
|
|
356
|
+
case facebook::react::Role::Menu:
|
|
357
|
+
return UIA_MenuControlTypeId;
|
|
358
|
+
case facebook::react::Role::Menubar:
|
|
359
|
+
return UIA_MenuBarControlTypeId;
|
|
360
|
+
case facebook::react::Role::Menuitem:
|
|
361
|
+
return UIA_MenuItemControlTypeId;
|
|
362
|
+
case facebook::react::Role::None:
|
|
363
|
+
return UIA_GroupControlTypeId;
|
|
364
|
+
case facebook::react::Role::Presentation:
|
|
365
|
+
return UIA_GroupControlTypeId;
|
|
366
|
+
case facebook::react::Role::Progressbar:
|
|
367
|
+
return UIA_ProgressBarControlTypeId;
|
|
368
|
+
case facebook::react::Role::Radio:
|
|
369
|
+
return UIA_RadioButtonControlTypeId;
|
|
370
|
+
case facebook::react::Role::Radiogroup:
|
|
371
|
+
return UIA_GroupControlTypeId;
|
|
372
|
+
case facebook::react::Role::Rowgroup:
|
|
373
|
+
return UIA_GroupControlTypeId;
|
|
374
|
+
case facebook::react::Role::Rowheader:
|
|
375
|
+
return UIA_HeaderControlTypeId;
|
|
376
|
+
case facebook::react::Role::Scrollbar:
|
|
377
|
+
return UIA_ScrollBarControlTypeId;
|
|
378
|
+
case facebook::react::Role::Searchbox:
|
|
379
|
+
return UIA_EditControlTypeId;
|
|
380
|
+
case facebook::react::Role::Separator:
|
|
381
|
+
return UIA_SeparatorControlTypeId;
|
|
382
|
+
case facebook::react::Role::Slider:
|
|
383
|
+
return UIA_SliderControlTypeId;
|
|
384
|
+
case facebook::react::Role::Spinbutton:
|
|
385
|
+
return UIA_SpinnerControlTypeId;
|
|
386
|
+
case facebook::react::Role::Status:
|
|
387
|
+
return UIA_StatusBarControlTypeId;
|
|
388
|
+
case facebook::react::Role::Summary:
|
|
389
|
+
return UIA_GroupControlTypeId;
|
|
390
|
+
case facebook::react::Role::Switch:
|
|
391
|
+
return UIA_ButtonControlTypeId;
|
|
392
|
+
case facebook::react::Role::Tab:
|
|
393
|
+
return UIA_TabItemControlTypeId;
|
|
394
|
+
case facebook::react::Role::Table:
|
|
395
|
+
return UIA_TableControlTypeId;
|
|
396
|
+
case facebook::react::Role::Tablist:
|
|
397
|
+
return UIA_TabControlTypeId;
|
|
398
|
+
case facebook::react::Role::Tabpanel:
|
|
399
|
+
return UIA_TabControlTypeId;
|
|
400
|
+
case facebook::react::Role::Timer:
|
|
401
|
+
return UIA_ButtonControlTypeId;
|
|
402
|
+
case facebook::react::Role::Toolbar:
|
|
403
|
+
return UIA_ToolBarControlTypeId;
|
|
404
|
+
case facebook::react::Role::Tooltip:
|
|
405
|
+
return UIA_ToolTipControlTypeId;
|
|
406
|
+
case facebook::react::Role::Tree:
|
|
407
|
+
return UIA_TreeControlTypeId;
|
|
408
|
+
case facebook::react::Role::Treegrid:
|
|
409
|
+
return UIA_TreeControlTypeId;
|
|
410
|
+
case facebook::react::Role::Treeitem:
|
|
411
|
+
return UIA_TreeItemControlTypeId;
|
|
412
|
+
}
|
|
413
|
+
return UIA_GroupControlTypeId;
|
|
414
|
+
}
|
|
415
|
+
|
|
326
416
|
HRESULT __stdcall CompositionDynamicAutomationProvider::GetPropertyValue(PROPERTYID propertyId, VARIANT *pRetVal) {
|
|
327
417
|
if (pRetVal == nullptr)
|
|
328
418
|
return E_POINTER;
|
|
@@ -348,8 +438,10 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPropertyValue(PROPERT
|
|
|
348
438
|
switch (propertyId) {
|
|
349
439
|
case UIA_ControlTypePropertyId: {
|
|
350
440
|
pRetVal->vt = VT_I4;
|
|
351
|
-
|
|
352
|
-
|
|
441
|
+
pRetVal->lVal = props->role == facebook::react::Role::None ? props->accessibilityRole.empty()
|
|
442
|
+
? GetControlTypeFromString(compositionView->DefaultControlType())
|
|
443
|
+
: GetControlTypeFromString(props->accessibilityRole)
|
|
444
|
+
: GetControlTypeFromRole(props->role);
|
|
353
445
|
break;
|
|
354
446
|
}
|
|
355
447
|
case UIA_AutomationIdPropertyId: {
|
|
@@ -389,12 +481,18 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPropertyValue(PROPERT
|
|
|
389
481
|
}
|
|
390
482
|
case UIA_IsContentElementPropertyId: {
|
|
391
483
|
pRetVal->vt = VT_BOOL;
|
|
392
|
-
pRetVal->boolVal =
|
|
484
|
+
pRetVal->boolVal =
|
|
485
|
+
(props->accessible && (props->accessibilityRole != "none" || props->role != facebook::react::Role::None))
|
|
486
|
+
? VARIANT_TRUE
|
|
487
|
+
: VARIANT_FALSE;
|
|
393
488
|
break;
|
|
394
489
|
}
|
|
395
490
|
case UIA_IsControlElementPropertyId: {
|
|
396
491
|
pRetVal->vt = VT_BOOL;
|
|
397
|
-
pRetVal->boolVal =
|
|
492
|
+
pRetVal->boolVal =
|
|
493
|
+
(props->accessible && (props->accessibilityRole != "none" || props->role != facebook::react::Role::None))
|
|
494
|
+
? VARIANT_TRUE
|
|
495
|
+
: VARIANT_FALSE;
|
|
398
496
|
break;
|
|
399
497
|
}
|
|
400
498
|
case UIA_IsOffscreenPropertyId: {
|
|
@@ -541,7 +639,6 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::get_IsReadOnly(BOOL *pRe
|
|
|
541
639
|
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(strongView)->props());
|
|
542
640
|
if (props == nullptr)
|
|
543
641
|
return UIA_E_ELEMENTNOTAVAILABLE;
|
|
544
|
-
auto accessibilityRole = props->accessibilityRole;
|
|
545
642
|
if (props->accessibilityState.has_value() && props->accessibilityState->readOnly.has_value()) {
|
|
546
643
|
*pRetVal = props->accessibilityState->readOnly.value();
|
|
547
644
|
} else {
|
|
@@ -197,6 +197,20 @@ void CompositionEventHandler::Initialize() noexcept {
|
|
|
197
197
|
}
|
|
198
198
|
});
|
|
199
199
|
|
|
200
|
+
m_pointerExitedToken = pointerSource.PointerExited([wkThis = weak_from_this()](
|
|
201
|
+
winrt::Microsoft::UI::Input::InputPointerSource const &,
|
|
202
|
+
winrt::Microsoft::UI::Input::PointerEventArgs const &args) {
|
|
203
|
+
if (auto strongThis = wkThis.lock()) {
|
|
204
|
+
if (auto strongRootView = strongThis->m_wkRootView.get()) {
|
|
205
|
+
if (strongThis->SurfaceId() == -1)
|
|
206
|
+
return;
|
|
207
|
+
auto pp = winrt::make<winrt::Microsoft::ReactNative::Composition::Input::implementation::PointerPoint>(
|
|
208
|
+
args.CurrentPoint(), strongRootView.ScaleFactor());
|
|
209
|
+
strongThis->onPointerExited(pp, args.KeyModifiers());
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
|
|
200
214
|
m_pointerCaptureLostToken =
|
|
201
215
|
pointerSource.PointerCaptureLost([wkThis = weak_from_this()](
|
|
202
216
|
winrt::Microsoft::UI::Input::InputPointerSource const &,
|
|
@@ -1068,6 +1082,34 @@ void CompositionEventHandler::onPointerMoved(
|
|
|
1068
1082
|
}
|
|
1069
1083
|
}
|
|
1070
1084
|
|
|
1085
|
+
void CompositionEventHandler::onPointerExited(
|
|
1086
|
+
const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
|
|
1087
|
+
winrt::Windows::System::VirtualKeyModifiers keyModifiers) noexcept {
|
|
1088
|
+
if (SurfaceId() == -1)
|
|
1089
|
+
return;
|
|
1090
|
+
|
|
1091
|
+
int pointerId = pointerPoint.PointerId();
|
|
1092
|
+
auto position = pointerPoint.Position();
|
|
1093
|
+
|
|
1094
|
+
if (std::shared_ptr<FabricUIManager> fabricuiManager =
|
|
1095
|
+
::Microsoft::ReactNative::FabricUIManager::FromProperties(m_context.Properties())) {
|
|
1096
|
+
facebook::react::Tag tag = -1;
|
|
1097
|
+
facebook::react::Point ptLocal, ptScaled;
|
|
1098
|
+
getTargetPointerArgs(fabricuiManager, pointerPoint, tag, ptScaled, ptLocal);
|
|
1099
|
+
|
|
1100
|
+
tag = -1;
|
|
1101
|
+
|
|
1102
|
+
auto args = winrt::make<winrt::Microsoft::ReactNative::Composition::Input::implementation::PointerRoutedEventArgs>(
|
|
1103
|
+
m_context, tag, pointerPoint, keyModifiers);
|
|
1104
|
+
|
|
1105
|
+
facebook::react::PointerEvent pointerEvent = CreatePointerEventFromIncompleteHoverData(ptScaled, ptLocal);
|
|
1106
|
+
|
|
1107
|
+
auto handler = [](std::vector<winrt::Microsoft::ReactNative::ComponentView> &eventPathViews) {};
|
|
1108
|
+
|
|
1109
|
+
HandleIncomingPointerEvent(pointerEvent, nullptr, pointerPoint, keyModifiers, handler);
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1071
1113
|
void CompositionEventHandler::onPointerPressed(
|
|
1072
1114
|
const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
|
|
1073
1115
|
winrt::Windows::System::VirtualKeyModifiers keyModifiers) noexcept {
|
|
@@ -57,6 +57,9 @@ class CompositionEventHandler : public std::enable_shared_from_this<CompositionE
|
|
|
57
57
|
void onPointerMoved(
|
|
58
58
|
const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
|
|
59
59
|
winrt::Windows::System::VirtualKeyModifiers keyModifiers) noexcept;
|
|
60
|
+
void onPointerExited(
|
|
61
|
+
const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
|
|
62
|
+
winrt::Windows::System::VirtualKeyModifiers keyModifiers) noexcept;
|
|
60
63
|
void onPointerWheelChanged(
|
|
61
64
|
const winrt::Microsoft::ReactNative::Composition::Input::PointerPoint &pointerPoint,
|
|
62
65
|
winrt::Windows::System::VirtualKeyModifiers keyModifiers) noexcept;
|
|
@@ -169,6 +172,7 @@ class CompositionEventHandler : public std::enable_shared_from_this<CompositionE
|
|
|
169
172
|
winrt::event_token m_pointerMovedToken;
|
|
170
173
|
winrt::event_token m_pointerWheelChangedToken;
|
|
171
174
|
winrt::event_token m_pointerCaptureLostToken;
|
|
175
|
+
winrt::event_token m_pointerExitedToken;
|
|
172
176
|
winrt::event_token m_keyDownToken;
|
|
173
177
|
winrt::event_token m_keyUpToken;
|
|
174
178
|
winrt::event_token m_characterReceivedToken;
|
|
@@ -972,10 +972,10 @@ ReactNativeIsland::GetComponentView() noexcept {
|
|
|
972
972
|
|
|
973
973
|
if (auto fabricuiManager = ::Microsoft::ReactNative::FabricUIManager::FromProperties(
|
|
974
974
|
winrt::Microsoft::ReactNative::ReactPropertyBag(m_context.Properties()))) {
|
|
975
|
-
auto
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
975
|
+
if (auto view = fabricuiManager->GetViewRegistry().findComponentViewWithTag(
|
|
976
|
+
static_cast<facebook::react::SurfaceId>(m_rootTag))) {
|
|
977
|
+
return view.as<winrt::Microsoft::ReactNative::Composition::implementation::RootComponentView>();
|
|
978
|
+
}
|
|
979
979
|
}
|
|
980
980
|
return nullptr;
|
|
981
981
|
}
|
package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp
CHANGED
|
@@ -116,25 +116,25 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
|
|
|
116
116
|
|
|
117
117
|
//@cmember Show the scroll bar
|
|
118
118
|
BOOL TxShowScrollBar(INT fnBar, BOOL fShow) override {
|
|
119
|
-
assert(false);
|
|
119
|
+
// assert(false);
|
|
120
120
|
return {};
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
//@cmember Enable the scroll bar
|
|
124
124
|
BOOL TxEnableScrollBar(INT fuSBFlags, INT fuArrowflags) override {
|
|
125
|
-
assert(false);
|
|
125
|
+
// assert(false);
|
|
126
126
|
return {};
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
//@cmember Set the scroll range
|
|
130
130
|
BOOL TxSetScrollRange(INT fnBar, LONG nMinPos, INT nMaxPos, BOOL fRedraw) override {
|
|
131
|
-
assert(false);
|
|
131
|
+
// assert(false);
|
|
132
132
|
return {};
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
//@cmember Set the scroll position
|
|
136
136
|
BOOL TxSetScrollPos(INT fnBar, INT nPos, BOOL fRedraw) override {
|
|
137
|
-
assert(false);
|
|
137
|
+
// assert(false);
|
|
138
138
|
return {};
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -377,8 +377,11 @@ struct CompTextHost : public winrt::implements<CompTextHost, ITextHost> {
|
|
|
377
377
|
|
|
378
378
|
//@cmember Get the bits representing requested scroll bars for the window
|
|
379
379
|
HRESULT TxGetScrollBars(DWORD *pdwScrollBar) override {
|
|
380
|
-
|
|
381
|
-
|
|
380
|
+
if (m_outer->m_multiline) {
|
|
381
|
+
*pdwScrollBar = WS_VSCROLL | WS_HSCROLL | ES_AUTOVSCROLL | ES_AUTOHSCROLL;
|
|
382
|
+
} else {
|
|
383
|
+
*pdwScrollBar = WS_HSCROLL | ES_AUTOHSCROLL;
|
|
384
|
+
}
|
|
382
385
|
return S_OK;
|
|
383
386
|
}
|
|
384
387
|
|
|
@@ -1042,6 +1045,12 @@ void WindowsTextInputComponentView::updateProps(
|
|
|
1042
1045
|
autoCapitalizeOnUpdateProps(oldTextInputProps.autoCapitalize, newTextInputProps.autoCapitalize);
|
|
1043
1046
|
}
|
|
1044
1047
|
|
|
1048
|
+
if (oldTextInputProps.textAlign != newTextInputProps.textAlign) {
|
|
1049
|
+
// Let UpdateParaFormat() to refresh the text field with the new text alignment.
|
|
1050
|
+
m_propBitsMask |= TXTBIT_PARAFORMATCHANGE;
|
|
1051
|
+
m_propBits |= TXTBIT_PARAFORMATCHANGE;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1045
1054
|
UpdatePropertyBits();
|
|
1046
1055
|
}
|
|
1047
1056
|
|
|
@@ -1305,7 +1314,15 @@ void WindowsTextInputComponentView::UpdateParaFormat() noexcept {
|
|
|
1305
1314
|
m_pf.cbSize = sizeof(PARAFORMAT2);
|
|
1306
1315
|
m_pf.dwMask = PFM_ALL;
|
|
1307
1316
|
|
|
1308
|
-
|
|
1317
|
+
auto &textAlign = windowsTextInputProps().textAlign;
|
|
1318
|
+
|
|
1319
|
+
if (textAlign == facebook::react::TextAlignment::Center) {
|
|
1320
|
+
m_pf.wAlignment = PFA_CENTER;
|
|
1321
|
+
} else if (textAlign == facebook::react::TextAlignment::Right) {
|
|
1322
|
+
m_pf.wAlignment = PFA_RIGHT;
|
|
1323
|
+
} else {
|
|
1324
|
+
m_pf.wAlignment = PFA_LEFT;
|
|
1325
|
+
}
|
|
1309
1326
|
|
|
1310
1327
|
m_pf.cTabCount = 1;
|
|
1311
1328
|
m_pf.rgxTabs[0] = lDefaultTab;
|
|
@@ -1475,6 +1492,9 @@ WindowsTextInputComponentView::createVisual() noexcept {
|
|
|
1475
1492
|
winrt::check_hresult(g_pfnCreateTextServices(nullptr, m_textHost.get(), spUnk.put()));
|
|
1476
1493
|
spUnk.as(m_textServices);
|
|
1477
1494
|
|
|
1495
|
+
LRESULT res;
|
|
1496
|
+
winrt::check_hresult(m_textServices->TxSendMessage(EM_SETTEXTMODE, TM_PLAINTEXT, 0, &res));
|
|
1497
|
+
|
|
1478
1498
|
m_caretVisual = m_compContext.CreateCaretVisual();
|
|
1479
1499
|
visual.InsertAt(m_caretVisual.InnerVisual(), 0);
|
|
1480
1500
|
m_caretVisual.IsVisible(false);
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
#include "WindowsTextInputEventEmitter.h"
|
|
7
7
|
|
|
8
|
+
#include <react/renderer/core/graphicsConversions.h>
|
|
9
|
+
|
|
8
10
|
namespace facebook::react {
|
|
9
11
|
|
|
10
12
|
void WindowsTextInputEventEmitter::onChange(OnChange event) const {
|
|
@@ -46,4 +48,23 @@ void WindowsTextInputEventEmitter::onKeyPress(OnKeyPress event) const {
|
|
|
46
48
|
});
|
|
47
49
|
}
|
|
48
50
|
|
|
51
|
+
static jsi::Value textInputMetricsContentSizePayload(
|
|
52
|
+
jsi::Runtime &runtime,
|
|
53
|
+
const WindowsTextInputEventEmitter::OnContentSizeChange &event) {
|
|
54
|
+
auto payload = jsi::Object(runtime);
|
|
55
|
+
{
|
|
56
|
+
auto contentSize = jsi::Object(runtime);
|
|
57
|
+
contentSize.setProperty(runtime, "width", event.contentSize.width);
|
|
58
|
+
contentSize.setProperty(runtime, "height", event.contentSize.height);
|
|
59
|
+
payload.setProperty(runtime, "contentSize", contentSize);
|
|
60
|
+
}
|
|
61
|
+
return payload;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
void WindowsTextInputEventEmitter::onContentSizeChange(OnContentSizeChange event) const {
|
|
65
|
+
dispatchEvent("textInputContentSizeChange", [event = std::move(event)](jsi::Runtime &runtime) {
|
|
66
|
+
return textInputMetricsContentSizePayload(runtime, event);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
49
70
|
} // namespace facebook::react
|
|
@@ -36,10 +36,16 @@ class WindowsTextInputEventEmitter : public ViewEventEmitter {
|
|
|
36
36
|
std::string key;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
+
struct OnContentSizeChange {
|
|
40
|
+
int target;
|
|
41
|
+
facebook::react::Size contentSize;
|
|
42
|
+
};
|
|
43
|
+
|
|
39
44
|
void onChange(OnChange value) const;
|
|
40
45
|
void onSelectionChange(const OnSelectionChange &value) const;
|
|
41
46
|
void onSubmitEditing(OnSubmitEditing value) const;
|
|
42
47
|
void onKeyPress(OnKeyPress value) const;
|
|
48
|
+
void onContentSizeChange(OnContentSizeChange value) const;
|
|
43
49
|
};
|
|
44
50
|
|
|
45
51
|
} // namespace facebook::react
|
|
@@ -47,7 +47,10 @@ WindowsTextInputProps::WindowsTextInputProps(
|
|
|
47
47
|
autoCapitalize(convertRawProp(context, rawProps, "autoCapitalize", sourceProps.autoCapitalize, {})),
|
|
48
48
|
clearTextOnSubmit(convertRawProp(context, rawProps, "clearTextOnSubmit", sourceProps.clearTextOnSubmit, {false})),
|
|
49
49
|
submitKeyEvents(convertRawProp(context, rawProps, "submitKeyEvents", sourceProps.submitKeyEvents, {})),
|
|
50
|
-
autoFocus(convertRawProp(context, rawProps, "autoFocus", sourceProps.autoFocus, {false}))
|
|
50
|
+
autoFocus(convertRawProp(context, rawProps, "autoFocus", sourceProps.autoFocus, {false})),
|
|
51
|
+
textAlign(
|
|
52
|
+
convertRawProp(context, rawProps, "textAlign", sourceProps.textAlign, facebook::react::TextAlignment::Left)) {
|
|
53
|
+
}
|
|
51
54
|
|
|
52
55
|
void WindowsTextInputProps::setProp(
|
|
53
56
|
const PropsParserContext &context,
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
#pragma once
|
|
5
5
|
|
|
6
6
|
#include <react/components/rnwcore/Props.h>
|
|
7
|
+
#include <react/renderer/attributedstring/conversions.h>
|
|
7
8
|
#include <react/renderer/components/text/BaseTextProps.h>
|
|
8
9
|
#include <react/renderer/core/propsConversions.h>
|
|
9
10
|
|
|
@@ -118,6 +119,7 @@ class WindowsTextInputProps final : public ViewProps, public BaseTextProps {
|
|
|
118
119
|
bool clearTextOnSubmit{false};
|
|
119
120
|
std::vector<CompWindowsTextInputSubmitKeyEventsStruct> submitKeyEvents{};
|
|
120
121
|
bool autoFocus{false};
|
|
122
|
+
facebook::react::TextAlignment textAlign{};
|
|
121
123
|
};
|
|
122
124
|
|
|
123
125
|
} // namespace facebook::react
|
|
@@ -158,11 +158,10 @@ Size WindowsTextInputShadowNode::measureContent(
|
|
|
158
158
|
const LayoutContext &layoutContext,
|
|
159
159
|
const LayoutConstraints &layoutConstraints) const {
|
|
160
160
|
if (getStateData().cachedAttributedStringId != 0) {
|
|
161
|
+
facebook::react::ParagraphAttributes paragraphAttributes{};
|
|
162
|
+
paragraphAttributes.maximumNumberOfLines = getConcreteProps().multiline ? 0 : 1;
|
|
161
163
|
return m_textLayoutManager
|
|
162
|
-
->measureCachedSpannableById(
|
|
163
|
-
getStateData().cachedAttributedStringId,
|
|
164
|
-
{}, // TODO getConcreteProps().paragraphAttributes
|
|
165
|
-
layoutConstraints)
|
|
164
|
+
->measureCachedSpannableById(getStateData().cachedAttributedStringId, paragraphAttributes, layoutConstraints)
|
|
166
165
|
.size;
|
|
167
166
|
}
|
|
168
167
|
|
|
@@ -183,13 +182,11 @@ Size WindowsTextInputShadowNode::measureContent(
|
|
|
183
182
|
|
|
184
183
|
TextLayoutContext textLayoutContext;
|
|
185
184
|
textLayoutContext.pointScaleFactor = layoutContext.pointScaleFactor;
|
|
185
|
+
facebook::react::ParagraphAttributes paragraphAttributes{};
|
|
186
|
+
paragraphAttributes.maximumNumberOfLines = getConcreteProps().multiline ? 0 : 1;
|
|
186
187
|
return m_textLayoutManager
|
|
187
188
|
->measure(
|
|
188
|
-
AttributedStringBox{attributedString},
|
|
189
|
-
{}, // TODO getConcreteProps().paragraphAttributes,
|
|
190
|
-
textLayoutContext,
|
|
191
|
-
layoutConstraints,
|
|
192
|
-
nullptr)
|
|
189
|
+
AttributedStringBox{attributedString}, paragraphAttributes, textLayoutContext, layoutConstraints, nullptr)
|
|
193
190
|
.size;
|
|
194
191
|
}
|
|
195
192
|
|
|
@@ -38,7 +38,9 @@ struct Color {
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
namespace HostPlatformColor {
|
|
41
|
-
static const facebook::react::Color UndefinedColor{
|
|
41
|
+
static const facebook::react::Color UndefinedColor{
|
|
42
|
+
{0, 0, 0, 0} /*Black*/,
|
|
43
|
+
{"__undefinedColor"} /*Empty PlatformColors*/};
|
|
42
44
|
} // namespace HostPlatformColor
|
|
43
45
|
|
|
44
46
|
inline Color hostPlatformColorFromComponents(ColorComponents components) {
|
|
@@ -50,7 +50,6 @@ void AnimationDriver::StartAnimation() {
|
|
|
50
50
|
animatedValue->PropertySet().StartAnimation(ValueAnimatedNode::s_valueName, animation);
|
|
51
51
|
animatedValue->AddActiveAnimation(m_id);
|
|
52
52
|
}
|
|
53
|
-
scopedBatch.End();
|
|
54
53
|
|
|
55
54
|
m_scopedBatchCompletedToken = scopedBatch.Completed(
|
|
56
55
|
[weakSelf = weak_from_this(), weakManager = m_manager, id = m_id, tag = m_animatedValueTag](auto sender, auto) {
|
|
@@ -74,6 +73,8 @@ void AnimationDriver::StartAnimation() {
|
|
|
74
73
|
}
|
|
75
74
|
});
|
|
76
75
|
|
|
76
|
+
scopedBatch.End();
|
|
77
|
+
|
|
77
78
|
m_animation = animation;
|
|
78
79
|
m_scopedBatch = scopedBatch;
|
|
79
80
|
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<TurboModule_SourcePath Condition="'$(TurboModule_SourcePath)' == '' AND '$(ReactNativeDir)' != ''">$(ReactNativeDir)\ReactCommon\react\nativemodule\core</TurboModule_SourcePath>
|
|
17
17
|
<TurboModule_SourcePath Condition="'$(TurboModule_SourcePath)' == '' AND Exists('$(MSBuildThisFileDirectory)ReactCommon\TurboModule.h')">$(MSBuildThisFileDirectory)</TurboModule_SourcePath>
|
|
18
18
|
<Bridging_SourcePath Condition="'$(Bridging_SourcePath)' == '' AND '$(ReactNativeDir)' != ''">$(ReactNativeDir)\ReactCommon\react\bridging</Bridging_SourcePath>
|
|
19
|
-
<Bridging_SourcePath Condition="'$(Bridging_SourcePath)' == '' AND Exists('$(MSBuildThisFileDirectory)
|
|
19
|
+
<Bridging_SourcePath Condition="'$(Bridging_SourcePath)' == '' AND Exists('$(MSBuildThisFileDirectory)react\bridging\CallbackWrapper.h')">$(MSBuildThisFileDirectory)react\bridging</Bridging_SourcePath>
|
|
20
20
|
|
|
21
21
|
<NodeApiJsiCommitHash>83cfef428a97627c9185c73da097e42742de56eb</NodeApiJsiCommitHash>
|
|
22
22
|
<NodeApiJsiLocal Condition="Exists('$(MSBuildThisFileDirectory)NodeApiJsiRuntime.cpp')">true</NodeApiJsiLocal>
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
<ClInclude Include="$(CallInvoker_SourcePath)\ReactCommon\CallInvoker.h" />
|
|
59
59
|
<ClInclude Include="$(CallInvoker_SourcePath)\ReactCommon\SchedulerPriority.h" />
|
|
60
60
|
<ClInclude Include="$(MSBuildThisFileDirectory)XamlUtils.h" />
|
|
61
|
-
<ClInclude Include="$(
|
|
61
|
+
<ClInclude Include="$(Bridging_SourcePath)\LongLivedObject.h" />
|
|
62
62
|
<ClInclude Include="$(Bridging_SourcePath)\CallbackWrapper.h" />
|
|
63
63
|
<ClInclude Include="$(TurboModule_SourcePath)\ReactCommon\TurboModule.h" />
|
|
64
64
|
<ClInclude Include="$(TurboModule_SourcePath)\ReactCommon\TurboModuleUtils.h" />
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.74.
|
|
13
|
+
<ReactNativeWindowsVersion>0.74.39</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>74</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>39</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>238eab86141194a61a233a3fec3b4f22a7a3b0f9</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
|
@@ -77,11 +77,25 @@ Copy-Item -Force -Path $NodeApiJsiRoot\src\NodeApiJsiRuntime.h -Destination $Tar
|
|
|
77
77
|
|
|
78
78
|
# Microsoft.ReactNative.CXX project TurboModule files
|
|
79
79
|
New-Item -ItemType Directory -Path $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon -Force
|
|
80
|
+
New-Item -ItemType Directory -Path $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging -Force
|
|
80
81
|
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\callinvoker\ReactCommon\CallInvoker.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon\
|
|
81
82
|
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\callinvoker\ReactCommon\SchedulerPriority.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon\
|
|
82
|
-
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\
|
|
83
|
-
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\
|
|
84
|
-
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\
|
|
83
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Array.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
84
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\AString.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
85
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Base.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
86
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Bool.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
87
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Bridging.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
88
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\CallbackWrapper.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
89
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Class.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
90
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Convert.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
91
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Error.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
92
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Function.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
93
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\LongLivedObject.cpp -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
94
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\LongLivedObject.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
95
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Number.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
96
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Object.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
97
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Promise.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
98
|
+
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\bridging\Value.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\react\bridging\
|
|
85
99
|
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\nativemodule\core\ReactCommon\TurboModule.cpp -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon\
|
|
86
100
|
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\nativemodule\core\ReactCommon\TurboModule.h -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon\
|
|
87
101
|
Copy-Item -Force -Path $ReactNativeRoot\ReactCommon\react\nativemodule\core\ReactCommon\TurboModuleUtils.cpp -Destination $TargetRoot\Microsoft.ReactNative.Cxx\ReactCommon\
|