@fluentui-react-native/focus-zone 0.23.3 → 0.23.5
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/.cache/tsconfig.tsbuildinfo +1 -1
- package/CHANGELOG.md +33 -0
- package/RCTFocusZone.podspec +1 -1
- package/SPEC.md +47 -0
- package/lib/FocusZone.d.ts +2 -6
- package/lib/FocusZone.d.ts.map +1 -1
- package/lib/FocusZone.js +28 -45
- package/lib/FocusZone.js.map +1 -1
- package/lib/FocusZone.types.d.ts +19 -17
- package/lib/FocusZone.types.d.ts.map +1 -1
- package/lib/FocusZone.types.js.map +1 -1
- package/lib/FocusZoneNativeComponent.d.ts +5 -3
- package/lib/FocusZoneNativeComponent.d.ts.map +1 -1
- package/lib/FocusZoneNativeComponent.js +3 -1
- package/lib/FocusZoneNativeComponent.js.map +1 -1
- package/lib/FocusZoneNativeComponent.win32.d.ts +16 -0
- package/lib/FocusZoneNativeComponent.win32.d.ts.map +1 -0
- package/lib/FocusZoneNativeComponent.win32.js +3 -0
- package/lib/FocusZoneNativeComponent.win32.js.map +1 -0
- package/lib/__tests__/FocusZone.test.js +68 -70
- package/lib/__tests__/FocusZone.test.js.map +1 -1
- package/lib/__tests__/FocusZone.types.test.d.ts +2 -0
- package/lib/__tests__/FocusZone.types.test.d.ts.map +1 -0
- package/lib/__tests__/FocusZone.types.test.js +26 -0
- package/lib/__tests__/FocusZone.types.test.js.map +1 -0
- package/macos/RCTFocusZone.m +76 -17
- package/macos/RCTFocusZoneComponentView.h +14 -0
- package/macos/RCTFocusZoneComponentView.mm +201 -0
- package/package.json +30 -8
- package/react-native.config.cjs +15 -0
- package/src/FocusZone.tsx +50 -0
- package/src/FocusZone.types.ts +19 -18
- package/src/FocusZoneNativeComponent.ts +8 -6
- package/src/FocusZoneNativeComponent.win32.ts +18 -0
- package/src/__tests__/FocusZone.test.tsx +105 -125
- package/src/__tests__/FocusZone.types.test.ts +36 -0
- package/tsconfig.json +5 -7
- package/windows/ExperimentalFeatures.props +33 -0
- package/windows/FRNFocusZone/FRNFocusZone.def +3 -0
- package/windows/FRNFocusZone/FRNFocusZone.rc +0 -0
- package/windows/FRNFocusZone/FRNFocusZone.vcxproj +147 -0
- package/windows/FRNFocusZone/FRNFocusZone.vcxproj.filters +44 -0
- package/windows/FRNFocusZone/FocusZoneComponentView.cpp +590 -0
- package/windows/FRNFocusZone/FocusZoneComponentView.h +7 -0
- package/windows/FRNFocusZone/ReactPackageProvider.cpp +24 -0
- package/windows/FRNFocusZone/ReactPackageProvider.h +24 -0
- package/windows/FRNFocusZone/ReactPackageProvider.idl +9 -0
- package/windows/FRNFocusZone/codegen/.clang-format +2 -0
- package/windows/FRNFocusZone/codegen/react/components/FRNFocusZoneSpec/FocusZone.g.h +243 -0
- package/windows/FRNFocusZone/packages.lock.json +151 -0
- package/windows/FRNFocusZone/pch.cpp +1 -0
- package/windows/FRNFocusZone/pch.h +40 -0
- package/windows/FRNFocusZone/resource.h +5 -0
- package/windows/FRNFocusZone/targetver.h +8 -0
- package/windows/FRNFocusZone.sln +43 -0
- package/windows/NuGet.Config +13 -0
- package/src/FocusZone.ts +0 -57
- package/src/__tests__/__snapshots__/FocusZone.test.tsx.snap +0 -1516
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* This file is auto-generated from FocusZoneNativeComponent spec file in flow / TypeScript.
|
|
4
|
+
*/
|
|
5
|
+
// clang-format off
|
|
6
|
+
#pragma once
|
|
7
|
+
|
|
8
|
+
#include <NativeModules.h>
|
|
9
|
+
|
|
10
|
+
#ifdef RNW_NEW_ARCH
|
|
11
|
+
#include <JSValueComposition.h>
|
|
12
|
+
|
|
13
|
+
#include <winrt/Microsoft.ReactNative.Composition.h>
|
|
14
|
+
#include <winrt/Microsoft.UI.Composition.h>
|
|
15
|
+
#endif // #ifdef RNW_NEW_ARCH
|
|
16
|
+
|
|
17
|
+
#ifdef RNW_NEW_ARCH
|
|
18
|
+
|
|
19
|
+
namespace FRNFocusZoneCodegen {
|
|
20
|
+
|
|
21
|
+
REACT_STRUCT(FocusZoneProps)
|
|
22
|
+
struct FocusZoneProps : winrt::implements<FocusZoneProps, winrt::Microsoft::ReactNative::IComponentProps> {
|
|
23
|
+
FocusZoneProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom)
|
|
24
|
+
: ViewProps(props)
|
|
25
|
+
{
|
|
26
|
+
if (cloneFrom) {
|
|
27
|
+
auto cloneFromProps = cloneFrom.as<FocusZoneProps>();
|
|
28
|
+
navigateAtEnd = cloneFromProps->navigateAtEnd;
|
|
29
|
+
defaultTabbableElement = cloneFromProps->defaultTabbableElement.Copy();
|
|
30
|
+
focusZoneDirection = cloneFromProps->focusZoneDirection;
|
|
31
|
+
use2DNavigation = cloneFromProps->use2DNavigation;
|
|
32
|
+
tabKeyNavigation = cloneFromProps->tabKeyNavigation;
|
|
33
|
+
disabled = cloneFromProps->disabled;
|
|
34
|
+
isTabNavigation = cloneFromProps->isTabNavigation;
|
|
35
|
+
navigationOrderInRenderOrder = cloneFromProps->navigationOrderInRenderOrder;
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept {
|
|
41
|
+
winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
REACT_FIELD(navigateAtEnd)
|
|
45
|
+
std::optional<std::string> navigateAtEnd;
|
|
46
|
+
|
|
47
|
+
REACT_FIELD(defaultTabbableElement)
|
|
48
|
+
winrt::Microsoft::ReactNative::JSValue defaultTabbableElement{nullptr};
|
|
49
|
+
|
|
50
|
+
REACT_FIELD(focusZoneDirection)
|
|
51
|
+
std::optional<std::string> focusZoneDirection;
|
|
52
|
+
|
|
53
|
+
REACT_FIELD(use2DNavigation)
|
|
54
|
+
std::optional<bool> use2DNavigation{};
|
|
55
|
+
|
|
56
|
+
REACT_FIELD(tabKeyNavigation)
|
|
57
|
+
std::optional<std::string> tabKeyNavigation;
|
|
58
|
+
|
|
59
|
+
REACT_FIELD(disabled)
|
|
60
|
+
std::optional<bool> disabled{};
|
|
61
|
+
|
|
62
|
+
REACT_FIELD(isTabNavigation)
|
|
63
|
+
std::optional<bool> isTabNavigation{};
|
|
64
|
+
|
|
65
|
+
REACT_FIELD(navigationOrderInRenderOrder)
|
|
66
|
+
std::optional<bool> navigationOrderInRenderOrder{};
|
|
67
|
+
|
|
68
|
+
const winrt::Microsoft::ReactNative::ViewProps ViewProps;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
struct FocusZoneEventEmitter {
|
|
72
|
+
FocusZoneEventEmitter(const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter)
|
|
73
|
+
: m_eventEmitter(eventEmitter) {}
|
|
74
|
+
|
|
75
|
+
private:
|
|
76
|
+
winrt::Microsoft::ReactNative::EventEmitter m_eventEmitter{nullptr};
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
template<typename TUserData>
|
|
80
|
+
struct BaseFocusZone {
|
|
81
|
+
|
|
82
|
+
virtual void UpdateProps(
|
|
83
|
+
const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
|
|
84
|
+
const winrt::com_ptr<FocusZoneProps> &newProps,
|
|
85
|
+
const winrt::com_ptr<FocusZoneProps> &/*oldProps*/) noexcept {
|
|
86
|
+
m_props = newProps;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// UpdateLayoutMetrics will only be called if this method is overridden
|
|
90
|
+
virtual void UpdateLayoutMetrics(
|
|
91
|
+
const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
|
|
92
|
+
const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/,
|
|
93
|
+
const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept {
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// UpdateState will only be called if this method is overridden
|
|
97
|
+
virtual void UpdateState(
|
|
98
|
+
const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
|
|
99
|
+
const winrt::Microsoft::ReactNative::IComponentState &/*newState*/) noexcept {
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
virtual void UpdateEventEmitter(const std::shared_ptr<FocusZoneEventEmitter> &eventEmitter) noexcept {
|
|
103
|
+
m_eventEmitter = eventEmitter;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// MountChildComponentView will only be called if this method is overridden
|
|
107
|
+
virtual void MountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
|
|
108
|
+
const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &/*args*/) noexcept {
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// UnmountChildComponentView will only be called if this method is overridden
|
|
112
|
+
virtual void UnmountChildComponentView(const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
|
|
113
|
+
const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &/*args*/) noexcept {
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Initialize will only be called if this method is overridden
|
|
117
|
+
virtual void Initialize(const winrt::Microsoft::ReactNative::ComponentView &/*view*/) noexcept {
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// CreateVisual will only be called if this method is overridden
|
|
121
|
+
virtual winrt::Microsoft::UI::Composition::Visual CreateVisual(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
|
|
122
|
+
return view.as<winrt::Microsoft::ReactNative::Composition::ComponentView>().Compositor().CreateSpriteVisual();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// FinalizeUpdate will only be called if this method is overridden
|
|
126
|
+
virtual void FinalizeUpdate(const winrt::Microsoft::ReactNative::ComponentView &/*view*/,
|
|
127
|
+
winrt::Microsoft::ReactNative::ComponentViewUpdateMask /*mask*/) noexcept {
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// CreateAutomationPeer will only be called if this method is overridden
|
|
131
|
+
virtual winrt::Windows::Foundation::IInspectable CreateAutomationPeer(const winrt::Microsoft::ReactNative::ComponentView & /*view*/,
|
|
132
|
+
const winrt::Microsoft::ReactNative::CreateAutomationPeerArgs& /*args*/) noexcept {
|
|
133
|
+
return nullptr;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
const std::shared_ptr<FocusZoneEventEmitter>& EventEmitter() const { return m_eventEmitter; }
|
|
139
|
+
const winrt::com_ptr<FocusZoneProps>& Props() const { return m_props; }
|
|
140
|
+
|
|
141
|
+
private:
|
|
142
|
+
winrt::com_ptr<FocusZoneProps> m_props;
|
|
143
|
+
std::shared_ptr<FocusZoneEventEmitter> m_eventEmitter;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
template <typename TUserData>
|
|
147
|
+
void RegisterFocusZoneNativeComponent(
|
|
148
|
+
winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder,
|
|
149
|
+
std::function<void(const winrt::Microsoft::ReactNative::Composition::IReactCompositionViewComponentBuilder&)> builderCallback) noexcept {
|
|
150
|
+
packageBuilder.as<winrt::Microsoft::ReactNative::IReactPackageBuilderFabric>().AddViewComponent(
|
|
151
|
+
L"FocusZone", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept {
|
|
152
|
+
auto compBuilder = builder.as<winrt::Microsoft::ReactNative::Composition::IReactCompositionViewComponentBuilder>();
|
|
153
|
+
|
|
154
|
+
builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props,
|
|
155
|
+
const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept {
|
|
156
|
+
return winrt::make<FocusZoneProps>(props, cloneFrom);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
160
|
+
const winrt::Microsoft::ReactNative::IComponentProps &newProps,
|
|
161
|
+
const winrt::Microsoft::ReactNative::IComponentProps &oldProps) noexcept {
|
|
162
|
+
auto userData = view.UserData().as<TUserData>();
|
|
163
|
+
userData->UpdateProps(view, newProps ? newProps.as<FocusZoneProps>() : nullptr, oldProps ? oldProps.as<FocusZoneProps>() : nullptr);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
167
|
+
const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics,
|
|
168
|
+
const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept {
|
|
169
|
+
auto userData = view.UserData().as<TUserData>();
|
|
170
|
+
userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
174
|
+
const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept {
|
|
175
|
+
auto userData = view.UserData().as<TUserData>();
|
|
176
|
+
userData->UpdateEventEmitter(std::make_shared<FocusZoneEventEmitter>(eventEmitter));
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseFocusZone<TUserData>::FinalizeUpdate) {
|
|
180
|
+
builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
181
|
+
winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept {
|
|
182
|
+
auto userData = view.UserData().as<TUserData>();
|
|
183
|
+
userData->FinalizeUpdate(view, mask);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseFocusZone<TUserData>::UpdateState) {
|
|
188
|
+
builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
189
|
+
const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
|
|
190
|
+
auto userData = view.UserData().as<TUserData>();
|
|
191
|
+
userData->UpdateState(view, newState);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseFocusZone<TUserData>::MountChildComponentView) {
|
|
196
|
+
builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
197
|
+
const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept {
|
|
198
|
+
auto userData = view.UserData().as<TUserData>();
|
|
199
|
+
return userData->MountChildComponentView(view, args);
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseFocusZone<TUserData>::UnmountChildComponentView) {
|
|
204
|
+
builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
205
|
+
const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept {
|
|
206
|
+
auto userData = view.UserData().as<TUserData>();
|
|
207
|
+
return userData->UnmountChildComponentView(view, args);
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateAutomationPeer != &BaseFocusZone<TUserData>::CreateAutomationPeer) {
|
|
212
|
+
builder.SetCreateAutomationPeerHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
213
|
+
const winrt::Microsoft::ReactNative::CreateAutomationPeerArgs& args) noexcept {
|
|
214
|
+
auto userData = view.UserData().as<TUserData>();
|
|
215
|
+
return userData->CreateAutomationPeer(view, args);
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
|
|
220
|
+
auto userData = winrt::make_self<TUserData>();
|
|
221
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseFocusZone<TUserData>::Initialize) {
|
|
222
|
+
userData->Initialize(view);
|
|
223
|
+
}
|
|
224
|
+
view.UserData(*userData);
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseFocusZone<TUserData>::CreateVisual) {
|
|
228
|
+
compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
|
|
229
|
+
auto userData = view.UserData().as<TUserData>();
|
|
230
|
+
return userData->CreateVisual(view);
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Allow app to further customize the builder
|
|
235
|
+
if (builderCallback) {
|
|
236
|
+
builderCallback(compBuilder);
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
} // namespace FRNFocusZoneCodegen
|
|
242
|
+
|
|
243
|
+
#endif // #ifdef RNW_NEW_ARCH
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"dependencies": {
|
|
4
|
+
"native,Version=v0.0": {
|
|
5
|
+
"boost": {
|
|
6
|
+
"type": "Direct",
|
|
7
|
+
"requested": "[1.84.0, )",
|
|
8
|
+
"resolved": "1.84.0",
|
|
9
|
+
"contentHash": "4el2YP3cNJDVFPdzOso+LxGvdWP2rHxML4siq8VdonNypW2m4q503tHfCj6vK0L1UfxioE2hpFGb4ITEua73tg=="
|
|
10
|
+
},
|
|
11
|
+
"Microsoft.ReactNative": {
|
|
12
|
+
"type": "Direct",
|
|
13
|
+
"requested": "[0.81.35, )",
|
|
14
|
+
"resolved": "0.81.35",
|
|
15
|
+
"contentHash": "WjsJFALaLLUvJHUBw8k8G8/PB3p5qvqqXG7NYJefHOgqB7MbCSOnD/bckIqKcp53J+MkPxqaeg5tnYLVTVhqwQ=="
|
|
16
|
+
},
|
|
17
|
+
"Microsoft.ReactNative.Cxx": {
|
|
18
|
+
"type": "Direct",
|
|
19
|
+
"requested": "[0.81.35, )",
|
|
20
|
+
"resolved": "0.81.35",
|
|
21
|
+
"contentHash": "oadpIMSLN11M9W/hyZKyiCKE2wMvjb80Bl5jInVUmqDJWNswxnu7W5Kt/NA9ciy+BN0ru62ucO0E2PJDrnP/Jg==",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"Microsoft.ReactNative": "0.81.35"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"Microsoft.VCRTForwarders.140": {
|
|
27
|
+
"type": "Direct",
|
|
28
|
+
"requested": "[1.0.2-rc, )",
|
|
29
|
+
"resolved": "1.0.2-rc",
|
|
30
|
+
"contentHash": "/r+sjtEeCIGyDhobIZ5hSmYhC/dSyGZxf1SxYJpElUhB0LMCktOMFs9gXrauXypIFECpVynNyVjAmJt6hjJ5oQ=="
|
|
31
|
+
},
|
|
32
|
+
"Microsoft.Windows.CppWinRT": {
|
|
33
|
+
"type": "Direct",
|
|
34
|
+
"requested": "[2.0.230706.1, )",
|
|
35
|
+
"resolved": "2.0.230706.1",
|
|
36
|
+
"contentHash": "l0D7oCw/5X+xIKHqZTi62TtV+1qeSz7KVluNFdrJ9hXsst4ghvqQ/Yhura7JqRdZWBXAuDS0G0KwALptdoxweQ=="
|
|
37
|
+
},
|
|
38
|
+
"Microsoft.WindowsAppSDK": {
|
|
39
|
+
"type": "Direct",
|
|
40
|
+
"requested": "[1.8.260508005, )",
|
|
41
|
+
"resolved": "1.8.260508005",
|
|
42
|
+
"contentHash": "+aA+zrvqJKgsn/1TPOSR0Uy7dkMO5jI/+cDWPu2pWmXe4KQxYkR8gQFY9IrfbgCxxSd/yl1zMcAKD/4HBbNqaw==",
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"Microsoft.WindowsAppSDK.AI": "[1.8.76]",
|
|
45
|
+
"Microsoft.WindowsAppSDK.Base": "[1.8.251216001]",
|
|
46
|
+
"Microsoft.WindowsAppSDK.DWrite": "[1.8.25122902]",
|
|
47
|
+
"Microsoft.WindowsAppSDK.Foundation": "[1.8.260505001]",
|
|
48
|
+
"Microsoft.WindowsAppSDK.InteractiveExperiences": "[1.8.260430001]",
|
|
49
|
+
"Microsoft.WindowsAppSDK.ML": "[1.8.2197]",
|
|
50
|
+
"Microsoft.WindowsAppSDK.Runtime": "[1.8.260508005]",
|
|
51
|
+
"Microsoft.WindowsAppSDK.Widgets": "[1.8.251231004]",
|
|
52
|
+
"Microsoft.WindowsAppSDK.WinUI": "[1.8.260505002]"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"Microsoft.Web.WebView2": {
|
|
56
|
+
"type": "Transitive",
|
|
57
|
+
"resolved": "1.0.3179.45",
|
|
58
|
+
"contentHash": "3pokSH5CnN0G6rGhGFo1y87inxYhNxBQ2Vdf0wlvBj99KHxQJormjDACmqRnFeUsmuNFIhWwfAL1ztq7wD5qRA=="
|
|
59
|
+
},
|
|
60
|
+
"Microsoft.Windows.SDK.BuildTools": {
|
|
61
|
+
"type": "Transitive",
|
|
62
|
+
"resolved": "10.0.26100.4654",
|
|
63
|
+
"contentHash": "2mgcOlj/t2RfSyyw+pVESfO+Tk1RkfQzto9Vrq42M1lUQIfQEwbi8QLha9GXWIOj+TFzeHIEJckIoF25mgiM8A=="
|
|
64
|
+
},
|
|
65
|
+
"Microsoft.Windows.SDK.BuildTools.MSIX": {
|
|
66
|
+
"type": "Transitive",
|
|
67
|
+
"resolved": "1.7.20250829.1",
|
|
68
|
+
"contentHash": "IMdvRmCIZnBS5GkYnv0po1bcx6U1OF39pqA4TphQ9evDzpCRoSE19/PkDvlUNNrBavTsLIEJgd/TAIFner75ow=="
|
|
69
|
+
},
|
|
70
|
+
"Microsoft.WindowsAppSDK.AI": {
|
|
71
|
+
"type": "Transitive",
|
|
72
|
+
"resolved": "1.8.76",
|
|
73
|
+
"contentHash": "Ayn9QybcwzH+c8eQlE7dm2oO3Jrcn2uohLcsHJpCbLOAfcisjzwtSBe0oyulbaJ86R4eDSX3RDS25tsjGpIqyQ==",
|
|
74
|
+
"dependencies": {
|
|
75
|
+
"Microsoft.WindowsAppSDK.Base": "1.8.251216001",
|
|
76
|
+
"Microsoft.WindowsAppSDK.Foundation": "1.8.260501000"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"Microsoft.WindowsAppSDK.Base": {
|
|
80
|
+
"type": "Transitive",
|
|
81
|
+
"resolved": "1.8.251216001",
|
|
82
|
+
"contentHash": "PS1wriuFknz3W2F2P/e6RvOTM35w89Lsj/f0QmUEPrJjKnc+jM0JLX1vfdytI14y1gNRUTm9uclwP0aH/SVU5w==",
|
|
83
|
+
"dependencies": {
|
|
84
|
+
"Microsoft.Windows.SDK.BuildTools": "10.0.26100.4654",
|
|
85
|
+
"Microsoft.Windows.SDK.BuildTools.MSIX": "1.7.20250829.1"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"Microsoft.WindowsAppSDK.DWrite": {
|
|
89
|
+
"type": "Transitive",
|
|
90
|
+
"resolved": "1.8.25122902",
|
|
91
|
+
"contentHash": "zFNn07i7Cyz62Y8FnPQAyzeZK7ww3m9t42i9pzy4C04pNbyUDQ4fG7pB6VSh6n4EyFuYtuFQuDzt4mKmXFrkrg==",
|
|
92
|
+
"dependencies": {
|
|
93
|
+
"Microsoft.WindowsAppSDK.Base": "1.8.251216001"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"Microsoft.WindowsAppSDK.Foundation": {
|
|
97
|
+
"type": "Transitive",
|
|
98
|
+
"resolved": "1.8.260505001",
|
|
99
|
+
"contentHash": "41SSoEn3sKKCAVPA/w18zVJwV1C7aDEkPS2f6Zyp19m27tDEmteEp0XS3Ln3b0ElYR4FfPEPvIDbJPSA9vePGw==",
|
|
100
|
+
"dependencies": {
|
|
101
|
+
"Microsoft.WindowsAppSDK.Base": "1.8.251216001",
|
|
102
|
+
"Microsoft.WindowsAppSDK.InteractiveExperiences": "1.8.260430001"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"Microsoft.WindowsAppSDK.InteractiveExperiences": {
|
|
106
|
+
"type": "Transitive",
|
|
107
|
+
"resolved": "1.8.260430001",
|
|
108
|
+
"contentHash": "fTPCnQb3ZarMh9khlEfbLDllcZzK0tSP+2S6W/T4cPyLLSAmARm8Gd3AC5kqubnDjzTvG+1lNZ1bZGFsIHplJQ==",
|
|
109
|
+
"dependencies": {
|
|
110
|
+
"Microsoft.WindowsAppSDK.Base": "1.8.251216001"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"Microsoft.WindowsAppSDK.ML": {
|
|
114
|
+
"type": "Transitive",
|
|
115
|
+
"resolved": "1.8.2197",
|
|
116
|
+
"contentHash": "6Bc1SOLd5HicY3GbF+zr76YBfH4iZOKeEGxTK/lHKAK2ExZTWavOADxB2CKSi/irF4dWSngUdRFopWPmckJ6fA==",
|
|
117
|
+
"dependencies": {
|
|
118
|
+
"Microsoft.WindowsAppSDK.Base": "1.8.251216001",
|
|
119
|
+
"Microsoft.WindowsAppSDK.Foundation": "1.8.260505001"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"Microsoft.WindowsAppSDK.Runtime": {
|
|
123
|
+
"type": "Transitive",
|
|
124
|
+
"resolved": "1.8.260508005",
|
|
125
|
+
"contentHash": "2JqXzA4heHSkkaXJNyEvYtpv2wsEUMhwQzgXmZsFmYSkUXSdeVc6hdHcWoBK1SY9l1Sjd1brLt7h16kIpgh2kA==",
|
|
126
|
+
"dependencies": {
|
|
127
|
+
"Microsoft.WindowsAppSDK.Base": "1.8.251216001"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"Microsoft.WindowsAppSDK.Widgets": {
|
|
131
|
+
"type": "Transitive",
|
|
132
|
+
"resolved": "1.8.251231004",
|
|
133
|
+
"contentHash": "bIWqQYR8DCoB1SoPOMil5AtgtkTn438wJTdpsHgyO/6o7Eh7PMP5BzrR0KbDsFqy+4LhPWQ4vtwko5k93fECcA==",
|
|
134
|
+
"dependencies": {
|
|
135
|
+
"Microsoft.WindowsAppSDK.Base": "1.8.251216001"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"Microsoft.WindowsAppSDK.WinUI": {
|
|
139
|
+
"type": "Transitive",
|
|
140
|
+
"resolved": "1.8.260505002",
|
|
141
|
+
"contentHash": "/hGl6EOmo8aeJR2bYbOmGhOicnJK4EY+u+cQI+jm8H1uXThfMX32DsfKOt9LkOcu8AKX3j5FpiBay8ObUSytIw==",
|
|
142
|
+
"dependencies": {
|
|
143
|
+
"Microsoft.Web.WebView2": "1.0.3179.45",
|
|
144
|
+
"Microsoft.WindowsAppSDK.Base": "1.8.251216001",
|
|
145
|
+
"Microsoft.WindowsAppSDK.Foundation": "1.8.260505001",
|
|
146
|
+
"Microsoft.WindowsAppSDK.InteractiveExperiences": "1.8.260430001"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#include "pch.h"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// pch.h : include file for standard system include files,
|
|
2
|
+
// or project specific include files that are used frequently, but
|
|
3
|
+
// are changed infrequently
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
#pragma once
|
|
7
|
+
|
|
8
|
+
#include "targetver.h"
|
|
9
|
+
|
|
10
|
+
#define NOMINMAX 1
|
|
11
|
+
#define WIN32_LEAN_AND_MEAN 1
|
|
12
|
+
#define WINRT_LEAN_AND_MEAN 1
|
|
13
|
+
|
|
14
|
+
// Windows Header Files
|
|
15
|
+
#include <windows.h>
|
|
16
|
+
#undef GetCurrentTime
|
|
17
|
+
#include <unknwn.h>
|
|
18
|
+
|
|
19
|
+
// WinRT Header Files
|
|
20
|
+
#include <winrt/base.h>
|
|
21
|
+
#include <CppWinRTIncludes.h>
|
|
22
|
+
#include <winrt/Microsoft.ReactNative.Composition.h>
|
|
23
|
+
#include <winrt/Microsoft.ReactNative.Composition.Input.h>
|
|
24
|
+
#include <winrt/Microsoft.ReactNative.h>
|
|
25
|
+
#include <winrt/Windows.System.h>
|
|
26
|
+
|
|
27
|
+
// C RunTime Header Files
|
|
28
|
+
#include <malloc.h>
|
|
29
|
+
#include <memory.h>
|
|
30
|
+
#include <stdlib.h>
|
|
31
|
+
#include <tchar.h>
|
|
32
|
+
|
|
33
|
+
#include <algorithm>
|
|
34
|
+
#include <cmath>
|
|
35
|
+
#include <cstdint>
|
|
36
|
+
#include <optional>
|
|
37
|
+
#include <string>
|
|
38
|
+
#include <vector>
|
|
39
|
+
|
|
40
|
+
// Reference additional headers your project requires here
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
// Including SDKDDKVer.h defines the highest available Windows platform.
|
|
4
|
+
|
|
5
|
+
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
|
|
6
|
+
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
|
|
7
|
+
|
|
8
|
+
#include <SDKDDKVer.h>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
3
|
+
# Visual Studio Version 17
|
|
4
|
+
VisualStudioVersion = 17.3.32929.385
|
|
5
|
+
MinimumVisualStudioVersion = 10.0.40219.1
|
|
6
|
+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FRNFocusZone", "FRNFocusZone\FRNFocusZone.vcxproj", "{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}"
|
|
7
|
+
EndProject
|
|
8
|
+
Global
|
|
9
|
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
10
|
+
Debug|x64 = Debug|x64
|
|
11
|
+
Debug|x86 = Debug|x86
|
|
12
|
+
Debug|ARM64 = Debug|ARM64
|
|
13
|
+
Release|x64 = Release|x64
|
|
14
|
+
Release|x86 = Release|x86
|
|
15
|
+
Release|ARM64 = Release|ARM64
|
|
16
|
+
EndGlobalSection
|
|
17
|
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
18
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Debug|x64.ActiveCfg = Debug|x64
|
|
19
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Debug|x64.Build.0 = Debug|x64
|
|
20
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Debug|x64.Deploy.0 = Debug|x64
|
|
21
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Debug|x86.ActiveCfg = Debug|Win32
|
|
22
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Debug|x86.Build.0 = Debug|Win32
|
|
23
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Debug|x86.Deploy.0 = Debug|Win32
|
|
24
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
|
25
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Debug|ARM64.Build.0 = Debug|ARM64
|
|
26
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Debug|ARM64.Deploy.0 = Debug|ARM64
|
|
27
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Release|x64.ActiveCfg = Release|x64
|
|
28
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Release|x64.Build.0 = Release|x64
|
|
29
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Release|x64.Deploy.0 = Release|x64
|
|
30
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Release|x86.ActiveCfg = Release|Win32
|
|
31
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Release|x86.Build.0 = Release|Win32
|
|
32
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Release|x86.Deploy.0 = Release|Win32
|
|
33
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Release|ARM64.ActiveCfg = Release|ARM64
|
|
34
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Release|ARM64.Build.0 = Release|ARM64
|
|
35
|
+
{85648B33-7A31-434B-ACE5-6E4F6E52EBAD}.Release|ARM64.Deploy.0 = Release|ARM64
|
|
36
|
+
EndGlobalSection
|
|
37
|
+
GlobalSection(SolutionProperties) = preSolution
|
|
38
|
+
HideSolutionNode = FALSE
|
|
39
|
+
EndGlobalSection
|
|
40
|
+
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
41
|
+
SolutionGuid = {CA064327-BA5B-4132-B77B-23C9DDDF9E92}
|
|
42
|
+
EndGlobalSection
|
|
43
|
+
EndGlobal
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<configuration>
|
|
3
|
+
<config>
|
|
4
|
+
<add key="repositoryPath" value="packages" />
|
|
5
|
+
</config>
|
|
6
|
+
<packageSources>
|
|
7
|
+
<clear />
|
|
8
|
+
<add key="react-native" value="https://pkgs.dev.azure.com/ms/react-native/_packaging/react-native-public/nuget/v3/index.json" />
|
|
9
|
+
</packageSources>
|
|
10
|
+
<disabledPackageSources>
|
|
11
|
+
<clear />
|
|
12
|
+
</disabledPackageSources>
|
|
13
|
+
</configuration>
|
package/src/FocusZone.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* @format
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import * as React from 'react';
|
|
8
|
-
import { findNodeHandle } from 'react-native';
|
|
9
|
-
|
|
10
|
-
import { useViewCommandFocus } from '@fluentui-react-native/interactive-hooks';
|
|
11
|
-
import type { IUseStyling } from '@uifabricshared/foundation-composable';
|
|
12
|
-
import { composable } from '@uifabricshared/foundation-composable';
|
|
13
|
-
import { mergeSettings } from '@uifabricshared/foundation-settings';
|
|
14
|
-
|
|
15
|
-
import type { FocusZoneProps, FocusZoneSlotProps, FocusZoneType } from './FocusZone.types';
|
|
16
|
-
import RCTFocusZone from './FocusZoneNativeComponent';
|
|
17
|
-
|
|
18
|
-
const filterOutComponentRef = <T>(props: T): T => {
|
|
19
|
-
if (props && typeof props === 'object' && 'componentRef' in props) {
|
|
20
|
-
const { componentRef: _componentRef, ...rest } = props as Record<string, unknown>;
|
|
21
|
-
return rest as T;
|
|
22
|
-
}
|
|
23
|
-
return props;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const FocusZone = composable<FocusZoneType>({
|
|
27
|
-
usePrepareProps: (userProps: FocusZoneProps, useStyling: IUseStyling<FocusZoneType>) => {
|
|
28
|
-
const { componentRef, defaultTabbableElement, isCircularNavigation, ...rest } = userProps;
|
|
29
|
-
|
|
30
|
-
const ftzRef = useViewCommandFocus(componentRef);
|
|
31
|
-
|
|
32
|
-
const [targetFirstFocus, setTargetFirstFocus] = React.useState<number | string>(undefined);
|
|
33
|
-
React.useLayoutEffect(() => {
|
|
34
|
-
if (typeof defaultTabbableElement === 'string') {
|
|
35
|
-
setTargetFirstFocus(defaultTabbableElement);
|
|
36
|
-
} else if (defaultTabbableElement?.current) {
|
|
37
|
-
setTargetFirstFocus(findNodeHandle(defaultTabbableElement.current));
|
|
38
|
-
} else {
|
|
39
|
-
setTargetFirstFocus(undefined);
|
|
40
|
-
}
|
|
41
|
-
}, [defaultTabbableElement]);
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
slotProps: mergeSettings<FocusZoneSlotProps>(useStyling(userProps), {
|
|
45
|
-
root: {
|
|
46
|
-
navigateAtEnd: isCircularNavigation ? 'NavigateWrap' : 'NavigateStopAtEnds', // let rest override
|
|
47
|
-
...rest,
|
|
48
|
-
defaultTabbableElement: targetFirstFocus,
|
|
49
|
-
ref: ftzRef,
|
|
50
|
-
},
|
|
51
|
-
}),
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
slots: {
|
|
55
|
-
root: { slotType: RCTFocusZone, filter: filterOutComponentRef },
|
|
56
|
-
},
|
|
57
|
-
});
|