react-native-list 1.0.1 → 2.0.0-alpha.1
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/README.md +188 -32
- package/ReactNativeList.podspec +39 -0
- package/android/CMakeLists.txt +48 -0
- package/android/build.gradle +151 -0
- package/android/fix-prefab.gradle +51 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/JHybridUiListModule.cpp +192 -0
- package/android/src/main/cpp/JHybridUiListModule.h +50 -0
- package/android/src/main/cpp/cpp-adapter.cpp +12 -0
- package/android/src/main/java/com/hannojg/reactnativelist/ReactNativeListPackage.kt +27 -0
- package/android/src/main/java/com/margelo/nitro/reactnativelist/HybridNativeListDataSource.kt +146 -0
- package/android/src/main/java/com/margelo/nitro/reactnativelist/HybridNativeListLayout.kt +86 -0
- package/android/src/main/java/com/margelo/nitro/reactnativelist/HybridUiListModule.kt +116 -0
- package/android/src/main/java/com/margelo/nitro/reactnativelist/HybridUiListView.kt +410 -0
- package/android/src/main/java/com/margelo/nitro/reactnativelist/HybridViewHolder.kt +9 -0
- package/android/src/main/java/com/margelo/nitro/reactnativelist/NativeListAdapter.kt +217 -0
- package/ios/DataSource/HybridNativeListDataSource.swift +213 -0
- package/ios/HybridObjects/HybridUiListModule.swift +49 -0
- package/ios/HybridObjects/HybridViewHolder.swift +16 -0
- package/ios/Layout/HybridNativeListLayout.swift +128 -0
- package/ios/Utils/ErrorUtils.h +26 -0
- package/ios/Utils/HybridIOSWorkletsModuleProxyHolder.swift +10 -0
- package/ios/Utils/SurfaceHelper.h +20 -0
- package/ios/Utils/SurfaceHelper.mm +144 -0
- package/ios/Utils/SurfacePresenterRegistry.h +17 -0
- package/ios/Utils/SurfacePresenterRegistry.m +31 -0
- package/ios/Utils/TurboModuleInstaller.h +18 -0
- package/ios/Utils/TurboModuleInstaller.mm +267 -0
- package/ios/Views/HostCell.swift +216 -0
- package/ios/Views/HybridUiListView.swift +695 -0
- package/metro/RendererProxyThreadSwitch.js +66 -0
- package/metro-config.d.ts +1 -0
- package/metro-config.js +52 -0
- package/nitro.json +47 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/ReactNativeList+autolinking.cmake +99 -0
- package/nitrogen/generated/android/ReactNativeList+autolinking.gradle +27 -0
- package/nitrogen/generated/android/ReactNativeListOnLoad.cpp +156 -0
- package/nitrogen/generated/android/ReactNativeListOnLoad.hpp +34 -0
- package/nitrogen/generated/android/c++/JFunc_bool_NativeListItem_NativeListItem.hpp +83 -0
- package/nitrogen/generated/android/c++/JFunc_bool_double_NativeListItem_double.hpp +83 -0
- package/nitrogen/generated/android/c++/JFunc_double_std__string.hpp +78 -0
- package/nitrogen/generated/android/c++/JHybridIOSWorkletsModuleProxyHolderSpec.cpp +49 -0
- package/nitrogen/generated/android/c++/JHybridIOSWorkletsModuleProxyHolderSpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JHybridNativeLinearListLayoutSpec.cpp +63 -0
- package/nitrogen/generated/android/c++/JHybridNativeLinearListLayoutSpec.hpp +65 -0
- package/nitrogen/generated/android/c++/JHybridNativeListDataSourceSpec.cpp +101 -0
- package/nitrogen/generated/android/c++/JHybridNativeListDataSourceSpec.hpp +70 -0
- package/nitrogen/generated/android/c++/JHybridNativeListLayoutSpec.cpp +49 -0
- package/nitrogen/generated/android/c++/JHybridNativeListLayoutSpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JHybridUiListModuleSpec.cpp +65 -0
- package/nitrogen/generated/android/c++/JHybridUiListModuleSpec.hpp +64 -0
- package/nitrogen/generated/android/c++/JHybridUiListViewSpec.cpp +92 -0
- package/nitrogen/generated/android/c++/JHybridUiListViewSpec.hpp +67 -0
- package/nitrogen/generated/android/c++/JHybridViewHolderSpec.cpp +49 -0
- package/nitrogen/generated/android/c++/JHybridViewHolderSpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JNativeItemSizeEstimate.hpp +61 -0
- package/nitrogen/generated/android/c++/JNativeLinearListLayoutConfig.hpp +81 -0
- package/nitrogen/generated/android/c++/JNativeLinearListLayoutIOSConfig.hpp +59 -0
- package/nitrogen/generated/android/c++/JNativeListItem.hpp +76 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_HybridIOSWorkletsModuleProxyHolderSpec.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_HybridIOSWorkletsModuleProxyHolderSpec.hpp +72 -0
- package/nitrogen/generated/android/c++/views/JHybridUiListViewStateUpdater.cpp +53 -0
- package/nitrogen/generated/android/c++/views/JHybridUiListViewStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/c++/views/JHybridViewHolderStateUpdater.cpp +53 -0
- package/nitrogen/generated/android/c++/views/JHybridViewHolderStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/Func_bool_NativeListItem_NativeListItem.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/Func_bool_double_NativeListItem_double.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/Func_double_std__string.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/HybridIOSWorkletsModuleProxyHolderSpec.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/HybridNativeLinearListLayoutSpec.kt +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/HybridNativeListDataSourceSpec.kt +87 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/HybridNativeListLayoutSpec.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/HybridUiListModuleSpec.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/HybridUiListViewSpec.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/HybridViewHolderSpec.kt +53 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/NativeItemSizeEstimate.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/NativeLinearListLayoutConfig.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/NativeLinearListLayoutIOSConfig.kt +51 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/NativeListItem.kt +71 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/ReactNativeListOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/Variant_NullType_HybridIOSWorkletsModuleProxyHolderSpec.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/views/HybridUiListViewManager.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/views/HybridUiListViewStateUpdater.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/views/HybridViewHolderManager.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativelist/views/HybridViewHolderStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/ReactNativeList+autolinking.rb +62 -0
- package/nitrogen/generated/ios/ReactNativeList-Swift-Cxx-Bridge.cpp +162 -0
- package/nitrogen/generated/ios/ReactNativeList-Swift-Cxx-Bridge.hpp +368 -0
- package/nitrogen/generated/ios/ReactNativeList-Swift-Cxx-Umbrella.hpp +92 -0
- package/nitrogen/generated/ios/ReactNativeListAutolinking.mm +83 -0
- package/nitrogen/generated/ios/ReactNativeListAutolinking.swift +86 -0
- package/nitrogen/generated/ios/c++/HybridIOSWorkletsModuleProxyHolderSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridIOSWorkletsModuleProxyHolderSpecSwift.hpp +75 -0
- package/nitrogen/generated/ios/c++/HybridNativeLinearListLayoutSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNativeLinearListLayoutSpecSwift.hpp +92 -0
- package/nitrogen/generated/ios/c++/HybridNativeListDataSourceSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNativeListDataSourceSpecSwift.hpp +132 -0
- package/nitrogen/generated/ios/c++/HybridNativeListLayoutSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNativeListLayoutSpecSwift.hpp +75 -0
- package/nitrogen/generated/ios/c++/HybridUiListModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridUiListModuleSpecSwift.hpp +93 -0
- package/nitrogen/generated/ios/c++/HybridUiListViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridUiListViewSpecSwift.hpp +121 -0
- package/nitrogen/generated/ios/c++/HybridViewHolderSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridViewHolderSpecSwift.hpp +75 -0
- package/nitrogen/generated/ios/c++/views/HybridUiListViewComponent.mm +118 -0
- package/nitrogen/generated/ios/c++/views/HybridViewHolderComponent.mm +118 -0
- package/nitrogen/generated/ios/swift/Func_bool_NativeListItem_NativeListItem.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_bool_double_NativeListItem_double.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_double_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridIOSWorkletsModuleProxyHolderSpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridIOSWorkletsModuleProxyHolderSpec_cxx.swift +128 -0
- package/nitrogen/generated/ios/swift/HybridNativeLinearListLayoutSpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridNativeLinearListLayoutSpec_cxx.swift +140 -0
- package/nitrogen/generated/ios/swift/HybridNativeListDataSourceSpec.swift +62 -0
- package/nitrogen/generated/ios/swift/HybridNativeListDataSourceSpec_cxx.swift +222 -0
- package/nitrogen/generated/ios/swift/HybridNativeListLayoutSpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridNativeListLayoutSpec_cxx.swift +128 -0
- package/nitrogen/generated/ios/swift/HybridUiListModuleSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridUiListModuleSpec_cxx.swift +175 -0
- package/nitrogen/generated/ios/swift/HybridUiListViewSpec.swift +59 -0
- package/nitrogen/generated/ios/swift/HybridUiListViewSpec_cxx.swift +227 -0
- package/nitrogen/generated/ios/swift/HybridViewHolderSpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridViewHolderSpec_cxx.swift +147 -0
- package/nitrogen/generated/ios/swift/NativeItemSizeEstimate.swift +60 -0
- package/nitrogen/generated/ios/swift/NativeLinearListLayoutConfig.swift +60 -0
- package/nitrogen/generated/ios/swift/NativeLinearListLayoutIOSConfig.swift +35 -0
- package/nitrogen/generated/ios/swift/NativeListItem.swift +75 -0
- package/nitrogen/generated/ios/swift/Variant_NullType__any_HybridIOSWorkletsModuleProxyHolderSpec_.swift +30 -0
- package/nitrogen/generated/shared/c++/HybridIOSWorkletsModuleProxyHolderSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridIOSWorkletsModuleProxyHolderSpec.hpp +62 -0
- package/nitrogen/generated/shared/c++/HybridNativeLinearListLayoutSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridNativeLinearListLayoutSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridNativeListDataSourceSpec.cpp +28 -0
- package/nitrogen/generated/shared/c++/HybridNativeListDataSourceSpec.hpp +72 -0
- package/nitrogen/generated/shared/c++/HybridNativeListLayoutSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridNativeListLayoutSpec.hpp +62 -0
- package/nitrogen/generated/shared/c++/HybridUiListModuleSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridUiListModuleSpec.hpp +68 -0
- package/nitrogen/generated/shared/c++/HybridUiListViewSpec.cpp +25 -0
- package/nitrogen/generated/shared/c++/HybridUiListViewSpec.hpp +79 -0
- package/nitrogen/generated/shared/c++/HybridUiManagerHelperSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridUiManagerHelperSpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/HybridViewHolderSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridViewHolderSpec.hpp +62 -0
- package/nitrogen/generated/shared/c++/NativeItemSizeEstimate.hpp +87 -0
- package/nitrogen/generated/shared/c++/NativeLinearListLayoutConfig.hpp +105 -0
- package/nitrogen/generated/shared/c++/NativeLinearListLayoutIOSConfig.hpp +85 -0
- package/nitrogen/generated/shared/c++/NativeListItem.hpp +101 -0
- package/nitrogen/generated/shared/c++/views/HybridUiListViewComponent.cpp +72 -0
- package/nitrogen/generated/shared/c++/views/HybridUiListViewComponent.hpp +109 -0
- package/nitrogen/generated/shared/c++/views/HybridViewHolderComponent.cpp +72 -0
- package/nitrogen/generated/shared/c++/views/HybridViewHolderComponent.hpp +109 -0
- package/nitrogen/generated/shared/json/UiListViewConfig.json +9 -0
- package/nitrogen/generated/shared/json/ViewHolderConfig.json +9 -0
- package/package.json +152 -5
- package/react-native.config.js +16 -0
- package/src/ListDataSource.ts +232 -0
- package/src/ListLayout.ts +95 -0
- package/src/UiListModule.ts +5 -0
- package/src/hooks/useChangeEffect.ts +50 -0
- package/src/index.tsx +49 -0
- package/src/privateGlobals.ts +20 -0
- package/src/renderer/fabric/RenderHelper.ts +29 -0
- package/src/renderer/fabric/UiManagerHelper.ts +5 -0
- package/src/renderer/react/ReactFabricMirror.bundle.js +1984 -0
- package/src/renderer/react/ReactFabricMirror.ts +766 -0
- package/src/renderer/react/ReactFabricRenderer.ts +11 -0
- package/src/specs/IOSWorkletsModuleProxyHolder.nitro.ts +6 -0
- package/src/specs/NativeLinearListLayout.nitro.ts +23 -0
- package/src/specs/NativeListDataSource.nitro.ts +28 -0
- package/src/specs/NativeListLayout.nitro.ts +6 -0
- package/src/specs/UIListModule.nitro.ts +13 -0
- package/src/specs/UIManagerHelper.nitro.ts +34 -0
- package/src/specs/UiListView.nitro.ts +31 -0
- package/src/specs/ViewHolder.nitro.ts +11 -0
- package/src/views/List.tsx +525 -0
- package/src/views/UiListHostComponent.ts +8 -0
- package/FillRateHelper.js +0 -179
- package/FlatList.js +0 -494
- package/LICENSE.md +0 -31
- package/MetroListView.js +0 -166
- package/SectionList.js +0 -291
- package/ViewabilityHelper.js +0 -260
- package/VirtualizeUtils.js +0 -163
- package/VirtualizedList.js +0 -861
- package/VirtualizedSectionList.js +0 -397
- package/index.js +0 -5
|
@@ -0,0 +1,1984 @@
|
|
|
1
|
+
|
|
2
|
+
var IS_REACT_ACT_ENVIRONMENT = false;
|
|
3
|
+
var reportError = console.error;
|
|
4
|
+
var MessageChannel = undefined;
|
|
5
|
+
var __REACT_DEVTOOLS_GLOBAL_HOOK__ = undefined;
|
|
6
|
+
var AbortController = undefined;
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
+
function __accessProp(key) {
|
|
14
|
+
return this[key];
|
|
15
|
+
}
|
|
16
|
+
var __toCommonJS = (from) => {
|
|
17
|
+
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
18
|
+
if (entry)
|
|
19
|
+
return entry;
|
|
20
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (var key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(entry, key))
|
|
24
|
+
__defProp(entry, key, {
|
|
25
|
+
get: __accessProp.bind(from, key),
|
|
26
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
__moduleCache.set(from, entry);
|
|
30
|
+
return entry;
|
|
31
|
+
};
|
|
32
|
+
var __moduleCache;
|
|
33
|
+
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
34
|
+
var __returnValue = (v) => v;
|
|
35
|
+
function __exportSetter(name, newValue) {
|
|
36
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
37
|
+
}
|
|
38
|
+
var __export = (target, all) => {
|
|
39
|
+
for (var name in all)
|
|
40
|
+
__defProp(target, name, {
|
|
41
|
+
get: all[name],
|
|
42
|
+
enumerable: true,
|
|
43
|
+
configurable: true,
|
|
44
|
+
set: __exportSetter.bind(all, name)
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// ../node_modules/@babel/runtime/helpers/interopRequireDefault.js
|
|
49
|
+
var require_interopRequireDefault = __commonJS((exports2, module2) => {
|
|
50
|
+
function _interopRequireDefault(e) {
|
|
51
|
+
return e && e.__esModule ? e : {
|
|
52
|
+
default: e
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
module2.exports = _interopRequireDefault, module2.exports.__esModule = true, module2.exports["default"] = module2.exports;
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// ../node_modules/react-native/Libraries/Utilities/defineLazyObjectProperty.js
|
|
59
|
+
var require_defineLazyObjectProperty = __commonJS((exports2) => {
|
|
60
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
61
|
+
exports2.default = undefined;
|
|
62
|
+
function defineLazyObjectProperty(object, name, descriptor) {
|
|
63
|
+
var get = descriptor.get;
|
|
64
|
+
var enumerable = descriptor.enumerable !== false;
|
|
65
|
+
var writable = descriptor.writable !== false;
|
|
66
|
+
var value;
|
|
67
|
+
var valueSet = false;
|
|
68
|
+
function getValue() {
|
|
69
|
+
if (!valueSet) {
|
|
70
|
+
valueSet = true;
|
|
71
|
+
setValue(get());
|
|
72
|
+
}
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
function setValue(newValue) {
|
|
76
|
+
value = newValue;
|
|
77
|
+
valueSet = true;
|
|
78
|
+
Object.defineProperty(object, name, { value: newValue, configurable: true, enumerable, writable });
|
|
79
|
+
}
|
|
80
|
+
Object.defineProperty(object, name, { get: getValue, set: setValue, configurable: true, enumerable });
|
|
81
|
+
}
|
|
82
|
+
var _default = exports2.default = defineLazyObjectProperty;
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// ../node_modules/react-native/Libraries/ReactNative/FabricUIManager.js
|
|
86
|
+
var require_FabricUIManager = __commonJS((exports2) => {
|
|
87
|
+
var _interopRequireDefault = require_interopRequireDefault();
|
|
88
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
89
|
+
exports2.getFabricUIManager = getFabricUIManager;
|
|
90
|
+
var _defineLazyObjectProperty = _interopRequireDefault(require_defineLazyObjectProperty());
|
|
91
|
+
var nativeFabricUIManagerProxy;
|
|
92
|
+
var CACHED_PROPERTIES = ["createNode", "cloneNode", "cloneNodeWithNewChildren", "cloneNodeWithNewProps", "cloneNodeWithNewChildrenAndProps", "createChildSet", "appendChild", "appendChildToSet", "completeRoot", "measure", "measureInWindow", "measureLayout", "configureNextLayoutAnimation", "sendAccessibilityEvent", "findShadowNodeByTag_DEPRECATED", "setNativeProps", "dispatchCommand", "compareDocumentPosition", "getBoundingClientRect", "unstable_DefaultEventPriority", "unstable_DiscreteEventPriority", "unstable_ContinuousEventPriority", "unstable_IdleEventPriority", "unstable_getCurrentEventPriority"];
|
|
93
|
+
function getFabricUIManager() {
|
|
94
|
+
if (nativeFabricUIManagerProxy == null && global.nativeFabricUIManager != null) {
|
|
95
|
+
nativeFabricUIManagerProxy = createProxyWithCachedProperties(global.nativeFabricUIManager, CACHED_PROPERTIES);
|
|
96
|
+
}
|
|
97
|
+
return nativeFabricUIManagerProxy;
|
|
98
|
+
}
|
|
99
|
+
function createProxyWithCachedProperties(implementation, propertiesToCache) {
|
|
100
|
+
var proxy = Object.create(implementation);
|
|
101
|
+
var _loop = function _loop2(propertyName2) {
|
|
102
|
+
(0, _defineLazyObjectProperty.default)(proxy, propertyName2, { get: function get() {
|
|
103
|
+
return implementation[propertyName2];
|
|
104
|
+
} });
|
|
105
|
+
};
|
|
106
|
+
for (var propertyName of propertiesToCache) {
|
|
107
|
+
_loop(propertyName);
|
|
108
|
+
}
|
|
109
|
+
return proxy;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// ../node_modules/react-native/Libraries/StyleSheet/flattenStyle.js
|
|
114
|
+
var require_flattenStyle = __commonJS((exports2) => {
|
|
115
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116
|
+
exports2.default = undefined;
|
|
117
|
+
function flattenStyle(style) {
|
|
118
|
+
if (style === null || typeof style !== "object") {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (!Array.isArray(style)) {
|
|
122
|
+
return style;
|
|
123
|
+
}
|
|
124
|
+
var result = {};
|
|
125
|
+
for (var i = 0, styleLength = style.length;i < styleLength; ++i) {
|
|
126
|
+
var computedStyle = flattenStyle(style[i]);
|
|
127
|
+
if (computedStyle) {
|
|
128
|
+
for (var key in computedStyle) {
|
|
129
|
+
result[key] = computedStyle[key];
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
var _default = exports2.default = flattenStyle;
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// ../node_modules/react-native/Libraries/Utilities/differ/deepDiffer.js
|
|
139
|
+
var require_deepDiffer = __commonJS((exports2) => {
|
|
140
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
141
|
+
exports2.default = undefined;
|
|
142
|
+
var logListeners;
|
|
143
|
+
function unstable_setLogListeners(listeners) {
|
|
144
|
+
logListeners = listeners;
|
|
145
|
+
}
|
|
146
|
+
function deepDiffer(one, two) {
|
|
147
|
+
var maxDepthOrOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
|
|
148
|
+
var maybeOptions = arguments.length > 3 ? arguments[3] : undefined;
|
|
149
|
+
var options = typeof maxDepthOrOptions === "number" ? maybeOptions : maxDepthOrOptions;
|
|
150
|
+
var maxDepth = typeof maxDepthOrOptions === "number" ? maxDepthOrOptions : -1;
|
|
151
|
+
if (maxDepth === 0) {
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
if (one === two) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
if (typeof one === "function" && typeof two === "function") {
|
|
158
|
+
var unsafelyIgnoreFunctions = options == null ? undefined : options.unsafelyIgnoreFunctions;
|
|
159
|
+
if (unsafelyIgnoreFunctions == null) {
|
|
160
|
+
if (logListeners && logListeners.onDifferentFunctionsIgnored && (!options || !("unsafelyIgnoreFunctions" in options))) {
|
|
161
|
+
logListeners.onDifferentFunctionsIgnored(one.name, two.name);
|
|
162
|
+
}
|
|
163
|
+
unsafelyIgnoreFunctions = true;
|
|
164
|
+
}
|
|
165
|
+
return !unsafelyIgnoreFunctions;
|
|
166
|
+
}
|
|
167
|
+
if (typeof one !== "object" || one === null) {
|
|
168
|
+
return one !== two;
|
|
169
|
+
}
|
|
170
|
+
if (typeof two !== "object" || two === null) {
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
if (one.constructor !== two.constructor) {
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
if (Array.isArray(one)) {
|
|
177
|
+
var len = one.length;
|
|
178
|
+
if (two.length !== len) {
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
for (var ii = 0;ii < len; ii++) {
|
|
182
|
+
if (deepDiffer(one[ii], two[ii], maxDepth - 1, options)) {
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
} else {
|
|
187
|
+
for (var key in one) {
|
|
188
|
+
if (deepDiffer(one[key], two[key], maxDepth - 1, options)) {
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
for (var twoKey in two) {
|
|
193
|
+
if (one[twoKey] === undefined && two[twoKey] !== undefined) {
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
deepDiffer.unstable_setLogListeners = unstable_setLogListeners;
|
|
201
|
+
var _default = exports2.default = deepDiffer;
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
// ../node_modules/react-native/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js
|
|
205
|
+
var require_ReactNativeAttributePayload = __commonJS((exports2) => {
|
|
206
|
+
var _interopRequireDefault = require_interopRequireDefault();
|
|
207
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
208
|
+
exports2.create = create;
|
|
209
|
+
exports2.diff = diff;
|
|
210
|
+
var _flattenStyle = _interopRequireDefault(require_flattenStyle());
|
|
211
|
+
var _deepDiffer = _interopRequireDefault(require_deepDiffer());
|
|
212
|
+
var emptyObject = {};
|
|
213
|
+
var removedKeys = null;
|
|
214
|
+
var removedKeyCount = 0;
|
|
215
|
+
var deepDifferOptions = { unsafelyIgnoreFunctions: true };
|
|
216
|
+
function defaultDiffer(prevProp, nextProp) {
|
|
217
|
+
if (typeof nextProp !== "object" || nextProp === null) {
|
|
218
|
+
return true;
|
|
219
|
+
} else {
|
|
220
|
+
return (0, _deepDiffer.default)(prevProp, nextProp, deepDifferOptions);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) {
|
|
224
|
+
if (Array.isArray(node)) {
|
|
225
|
+
var i = node.length;
|
|
226
|
+
while (i-- && removedKeyCount > 0) {
|
|
227
|
+
restoreDeletedValuesInNestedArray(updatePayload, node[i], validAttributes);
|
|
228
|
+
}
|
|
229
|
+
} else if (node && removedKeyCount > 0) {
|
|
230
|
+
var obj = node;
|
|
231
|
+
for (var propKey in removedKeys) {
|
|
232
|
+
if (!removedKeys[propKey]) {
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
var nextProp = obj[propKey];
|
|
236
|
+
if (nextProp === undefined) {
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
var attributeConfig = validAttributes[propKey];
|
|
240
|
+
if (!attributeConfig) {
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
if (typeof nextProp === "function") {
|
|
244
|
+
nextProp = true;
|
|
245
|
+
}
|
|
246
|
+
if (typeof nextProp === "undefined") {
|
|
247
|
+
nextProp = null;
|
|
248
|
+
}
|
|
249
|
+
if (typeof attributeConfig !== "object") {
|
|
250
|
+
updatePayload[propKey] = nextProp;
|
|
251
|
+
} else if (typeof attributeConfig.diff === "function" || typeof attributeConfig.process === "function") {
|
|
252
|
+
var nextValue = typeof attributeConfig.process === "function" ? attributeConfig.process(nextProp) : nextProp;
|
|
253
|
+
updatePayload[propKey] = nextValue;
|
|
254
|
+
}
|
|
255
|
+
removedKeys[propKey] = false;
|
|
256
|
+
removedKeyCount--;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
function diffNestedArrayProperty(updatePayload, prevArray, nextArray, validAttributes) {
|
|
261
|
+
var minLength = prevArray.length < nextArray.length ? prevArray.length : nextArray.length;
|
|
262
|
+
var i;
|
|
263
|
+
for (i = 0;i < minLength; i++) {
|
|
264
|
+
updatePayload = diffNestedProperty(updatePayload, prevArray[i], nextArray[i], validAttributes);
|
|
265
|
+
}
|
|
266
|
+
for (;i < prevArray.length; i++) {
|
|
267
|
+
updatePayload = clearNestedProperty(updatePayload, prevArray[i], validAttributes);
|
|
268
|
+
}
|
|
269
|
+
for (;i < nextArray.length; i++) {
|
|
270
|
+
var nextProp = nextArray[i];
|
|
271
|
+
if (!nextProp) {
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
updatePayload = addNestedProperty(updatePayload, nextProp, validAttributes);
|
|
275
|
+
}
|
|
276
|
+
return updatePayload;
|
|
277
|
+
}
|
|
278
|
+
function diffNestedProperty(updatePayload, prevProp, nextProp, validAttributes) {
|
|
279
|
+
if (!updatePayload && prevProp === nextProp) {
|
|
280
|
+
return updatePayload;
|
|
281
|
+
}
|
|
282
|
+
if (!prevProp || !nextProp) {
|
|
283
|
+
if (nextProp) {
|
|
284
|
+
return addNestedProperty(updatePayload, nextProp, validAttributes);
|
|
285
|
+
}
|
|
286
|
+
if (prevProp) {
|
|
287
|
+
return clearNestedProperty(updatePayload, prevProp, validAttributes);
|
|
288
|
+
}
|
|
289
|
+
return updatePayload;
|
|
290
|
+
}
|
|
291
|
+
if (!Array.isArray(prevProp) && !Array.isArray(nextProp)) {
|
|
292
|
+
return diffProperties(updatePayload, prevProp, nextProp, validAttributes);
|
|
293
|
+
}
|
|
294
|
+
if (Array.isArray(prevProp) && Array.isArray(nextProp)) {
|
|
295
|
+
return diffNestedArrayProperty(updatePayload, prevProp, nextProp, validAttributes);
|
|
296
|
+
}
|
|
297
|
+
if (Array.isArray(prevProp)) {
|
|
298
|
+
return diffProperties(updatePayload, (0, _flattenStyle.default)(prevProp), nextProp, validAttributes);
|
|
299
|
+
}
|
|
300
|
+
return diffProperties(updatePayload, prevProp, (0, _flattenStyle.default)(nextProp), validAttributes);
|
|
301
|
+
}
|
|
302
|
+
function clearNestedProperty(updatePayload, prevProp, validAttributes) {
|
|
303
|
+
if (!prevProp) {
|
|
304
|
+
return updatePayload;
|
|
305
|
+
}
|
|
306
|
+
if (!Array.isArray(prevProp)) {
|
|
307
|
+
return clearProperties(updatePayload, prevProp, validAttributes);
|
|
308
|
+
}
|
|
309
|
+
for (var i = 0;i < prevProp.length; i++) {
|
|
310
|
+
updatePayload = clearNestedProperty(updatePayload, prevProp[i], validAttributes);
|
|
311
|
+
}
|
|
312
|
+
return updatePayload;
|
|
313
|
+
}
|
|
314
|
+
function diffProperties(updatePayload, prevProps, nextProps, validAttributes) {
|
|
315
|
+
var attributeConfig;
|
|
316
|
+
var nextProp;
|
|
317
|
+
var prevProp;
|
|
318
|
+
for (var propKey in nextProps) {
|
|
319
|
+
attributeConfig = validAttributes[propKey];
|
|
320
|
+
if (!attributeConfig) {
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
323
|
+
prevProp = prevProps[propKey];
|
|
324
|
+
nextProp = nextProps[propKey];
|
|
325
|
+
if (typeof nextProp === "function") {
|
|
326
|
+
var attributeConfigHasProcess = typeof attributeConfig === "object" && typeof attributeConfig.process === "function";
|
|
327
|
+
if (!attributeConfigHasProcess) {
|
|
328
|
+
nextProp = true;
|
|
329
|
+
if (typeof prevProp === "function") {
|
|
330
|
+
prevProp = true;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if (typeof nextProp === "undefined") {
|
|
335
|
+
nextProp = null;
|
|
336
|
+
if (typeof prevProp === "undefined") {
|
|
337
|
+
prevProp = null;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
if (removedKeys) {
|
|
341
|
+
removedKeys[propKey] = false;
|
|
342
|
+
}
|
|
343
|
+
if (updatePayload && updatePayload[propKey] !== undefined) {
|
|
344
|
+
if (typeof attributeConfig !== "object") {
|
|
345
|
+
updatePayload[propKey] = nextProp;
|
|
346
|
+
} else if (typeof attributeConfig.diff === "function" || typeof attributeConfig.process === "function") {
|
|
347
|
+
var nextValue = typeof attributeConfig.process === "function" ? attributeConfig.process(nextProp) : nextProp;
|
|
348
|
+
updatePayload[propKey] = nextValue;
|
|
349
|
+
}
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
if (prevProp === nextProp) {
|
|
353
|
+
continue;
|
|
354
|
+
}
|
|
355
|
+
if (typeof attributeConfig !== "object") {
|
|
356
|
+
if (defaultDiffer(prevProp, nextProp)) {
|
|
357
|
+
(updatePayload || (updatePayload = {}))[propKey] = nextProp;
|
|
358
|
+
}
|
|
359
|
+
} else if (typeof attributeConfig.diff === "function" || typeof attributeConfig.process === "function") {
|
|
360
|
+
var shouldUpdate = prevProp === undefined || (typeof attributeConfig.diff === "function" ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp));
|
|
361
|
+
if (shouldUpdate) {
|
|
362
|
+
var _nextValue = typeof attributeConfig.process === "function" ? attributeConfig.process(nextProp) : nextProp;
|
|
363
|
+
(updatePayload || (updatePayload = {}))[propKey] = _nextValue;
|
|
364
|
+
}
|
|
365
|
+
} else {
|
|
366
|
+
removedKeys = null;
|
|
367
|
+
removedKeyCount = 0;
|
|
368
|
+
updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig);
|
|
369
|
+
if (removedKeyCount > 0 && updatePayload) {
|
|
370
|
+
restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig);
|
|
371
|
+
removedKeys = null;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
for (var _propKey in prevProps) {
|
|
376
|
+
if (nextProps[_propKey] !== undefined) {
|
|
377
|
+
continue;
|
|
378
|
+
}
|
|
379
|
+
attributeConfig = validAttributes[_propKey];
|
|
380
|
+
if (!attributeConfig) {
|
|
381
|
+
continue;
|
|
382
|
+
}
|
|
383
|
+
if (updatePayload && updatePayload[_propKey] !== undefined) {
|
|
384
|
+
continue;
|
|
385
|
+
}
|
|
386
|
+
prevProp = prevProps[_propKey];
|
|
387
|
+
if (prevProp === undefined) {
|
|
388
|
+
continue;
|
|
389
|
+
}
|
|
390
|
+
if (typeof attributeConfig !== "object" || typeof attributeConfig.diff === "function" || typeof attributeConfig.process === "function") {
|
|
391
|
+
(updatePayload || (updatePayload = {}))[_propKey] = null;
|
|
392
|
+
if (!removedKeys) {
|
|
393
|
+
removedKeys = {};
|
|
394
|
+
}
|
|
395
|
+
if (!removedKeys[_propKey]) {
|
|
396
|
+
removedKeys[_propKey] = true;
|
|
397
|
+
removedKeyCount++;
|
|
398
|
+
}
|
|
399
|
+
} else {
|
|
400
|
+
updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
return updatePayload;
|
|
404
|
+
}
|
|
405
|
+
function addNestedProperty(payload, props, validAttributes) {
|
|
406
|
+
if (Array.isArray(props)) {
|
|
407
|
+
for (var i = 0;i < props.length; i++) {
|
|
408
|
+
payload = addNestedProperty(payload, props[i], validAttributes);
|
|
409
|
+
}
|
|
410
|
+
return payload;
|
|
411
|
+
}
|
|
412
|
+
for (var propKey in props) {
|
|
413
|
+
var prop = props[propKey];
|
|
414
|
+
var attributeConfig = validAttributes[propKey];
|
|
415
|
+
if (attributeConfig == null) {
|
|
416
|
+
continue;
|
|
417
|
+
}
|
|
418
|
+
var newValue = undefined;
|
|
419
|
+
if (prop === undefined) {
|
|
420
|
+
if (payload && payload[propKey] !== undefined) {
|
|
421
|
+
newValue = null;
|
|
422
|
+
} else {
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
} else if (typeof attributeConfig === "object") {
|
|
426
|
+
if (typeof attributeConfig.process === "function") {
|
|
427
|
+
newValue = attributeConfig.process(prop);
|
|
428
|
+
} else if (typeof attributeConfig.diff === "function") {
|
|
429
|
+
newValue = prop;
|
|
430
|
+
}
|
|
431
|
+
} else {
|
|
432
|
+
if (typeof prop === "function") {
|
|
433
|
+
newValue = true;
|
|
434
|
+
} else {
|
|
435
|
+
newValue = prop;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
if (newValue !== undefined) {
|
|
439
|
+
if (!payload) {
|
|
440
|
+
payload = {};
|
|
441
|
+
}
|
|
442
|
+
payload[propKey] = newValue;
|
|
443
|
+
continue;
|
|
444
|
+
}
|
|
445
|
+
payload = addNestedProperty(payload, prop, attributeConfig);
|
|
446
|
+
}
|
|
447
|
+
return payload;
|
|
448
|
+
}
|
|
449
|
+
function clearProperties(updatePayload, prevProps, validAttributes) {
|
|
450
|
+
return diffProperties(updatePayload, prevProps, emptyObject, validAttributes);
|
|
451
|
+
}
|
|
452
|
+
function create(props, validAttributes) {
|
|
453
|
+
return addNestedProperty(null, props, validAttributes);
|
|
454
|
+
}
|
|
455
|
+
function diff(prevProps, nextProps, validAttributes) {
|
|
456
|
+
return diffProperties(null, prevProps, nextProps, validAttributes);
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
// shims/react-fiber-config-fabric.js
|
|
461
|
+
var require_react_fiber_config_fabric = __commonJS((exports2, module2) => {
|
|
462
|
+
var ReactNativeElement = require("react-native/src/private/webapis/dom/nodes/ReactNativeElement").default;
|
|
463
|
+
function getPublicInstance(instance) {
|
|
464
|
+
if (instance?.canonical != null) {
|
|
465
|
+
if (instance.canonical.publicInstance == null) {
|
|
466
|
+
instance.canonical.publicInstance = new ReactNativeElement(instance.canonical.nativeTag, instance.canonical.viewConfig, instance.canonical.internalInstanceHandle, instance.canonical.publicRootInstance ?? null);
|
|
467
|
+
instance.canonical.publicRootInstance = null;
|
|
468
|
+
}
|
|
469
|
+
return instance.canonical.publicInstance;
|
|
470
|
+
}
|
|
471
|
+
if (instance?.containerInfo?.publicInstance != null) {
|
|
472
|
+
return instance.containerInfo.publicInstance;
|
|
473
|
+
}
|
|
474
|
+
if (instance?._nativeTag != null) {
|
|
475
|
+
return instance;
|
|
476
|
+
}
|
|
477
|
+
return null;
|
|
478
|
+
}
|
|
479
|
+
module2.exports = {
|
|
480
|
+
getPublicInstance
|
|
481
|
+
};
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
// ../third_party/react/packages/shared/isArray.js
|
|
485
|
+
var require_isArray = __commonJS((exports2) => {
|
|
486
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
487
|
+
exports2.default = undefined;
|
|
488
|
+
var isArrayImpl = Array.isArray;
|
|
489
|
+
function isArray(a) {
|
|
490
|
+
return isArrayImpl(a);
|
|
491
|
+
}
|
|
492
|
+
var _default = exports2.default = isArray;
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
// shims/react-current-fiber.js
|
|
496
|
+
var require_react_current_fiber = __commonJS((exports2, module2) => {
|
|
497
|
+
function runWithFiberInDEV(_fiber, fn, ...args) {
|
|
498
|
+
return fn(...args);
|
|
499
|
+
}
|
|
500
|
+
module2.exports = {
|
|
501
|
+
runWithFiberInDEV
|
|
502
|
+
};
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
// ../third_party/react/packages/react-native-renderer/src/legacy-events/EventPluginUtils.js
|
|
506
|
+
var require_EventPluginUtils = __commonJS((exports2) => {
|
|
507
|
+
var _interopRequireDefault = require_interopRequireDefault();
|
|
508
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
509
|
+
exports2.executeDirectDispatch = executeDirectDispatch;
|
|
510
|
+
exports2.executeDispatch = executeDispatch;
|
|
511
|
+
exports2.executeDispatchesInOrder = executeDispatchesInOrder;
|
|
512
|
+
exports2.executeDispatchesInOrderStopAtTrue = executeDispatchesInOrderStopAtTrue;
|
|
513
|
+
exports2.getNodeFromInstance = exports2.getInstanceFromNode = exports2.getFiberCurrentPropsFromNode = undefined;
|
|
514
|
+
exports2.hasDispatches = hasDispatches;
|
|
515
|
+
exports2.rethrowCaughtError = rethrowCaughtError;
|
|
516
|
+
exports2.setComponentTree = setComponentTree;
|
|
517
|
+
var _isArray = _interopRequireDefault(require_isArray());
|
|
518
|
+
var _ReactCurrentFiber = require_react_current_fiber();
|
|
519
|
+
var hasError = false;
|
|
520
|
+
var caughtError = null;
|
|
521
|
+
var getFiberCurrentPropsFromNode = exports2.getFiberCurrentPropsFromNode = null;
|
|
522
|
+
var getInstanceFromNode = exports2.getInstanceFromNode = null;
|
|
523
|
+
var getNodeFromInstance = exports2.getNodeFromInstance = null;
|
|
524
|
+
function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {
|
|
525
|
+
exports2.getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;
|
|
526
|
+
exports2.getInstanceFromNode = getInstanceFromNode = getInstanceFromNodeImpl;
|
|
527
|
+
exports2.getNodeFromInstance = getNodeFromInstance = getNodeFromInstanceImpl;
|
|
528
|
+
if (__DEV__) {
|
|
529
|
+
if (!getNodeFromInstance || !getInstanceFromNode) {
|
|
530
|
+
console.error("Injected " + "module is missing getNodeFromInstance or getInstanceFromNode.");
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
function validateEventDispatches(event) {
|
|
535
|
+
if (__DEV__) {
|
|
536
|
+
var dispatchListeners = event._dispatchListeners;
|
|
537
|
+
var dispatchInstances = event._dispatchInstances;
|
|
538
|
+
var listenersIsArr = (0, _isArray.default)(dispatchListeners);
|
|
539
|
+
var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
|
|
540
|
+
var instancesIsArr = (0, _isArray.default)(dispatchInstances);
|
|
541
|
+
var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
|
|
542
|
+
if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) {
|
|
543
|
+
console.error("EventPluginUtils: Invalid `event`.");
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
function executeDispatch(event, listener, inst) {
|
|
548
|
+
event.currentTarget = getNodeFromInstance(inst);
|
|
549
|
+
try {
|
|
550
|
+
listener(event);
|
|
551
|
+
} catch (error) {
|
|
552
|
+
if (!hasError) {
|
|
553
|
+
hasError = true;
|
|
554
|
+
caughtError = error;
|
|
555
|
+
} else {}
|
|
556
|
+
}
|
|
557
|
+
event.currentTarget = null;
|
|
558
|
+
}
|
|
559
|
+
function executeDispatchesInOrder(event) {
|
|
560
|
+
var dispatchListeners = event._dispatchListeners;
|
|
561
|
+
var dispatchInstances = event._dispatchInstances;
|
|
562
|
+
if (__DEV__) {
|
|
563
|
+
validateEventDispatches(event);
|
|
564
|
+
}
|
|
565
|
+
if ((0, _isArray.default)(dispatchListeners)) {
|
|
566
|
+
for (var i = 0;i < dispatchListeners.length; i++) {
|
|
567
|
+
if (event.isPropagationStopped()) {
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
var listener = dispatchListeners[i];
|
|
571
|
+
var instance = dispatchInstances[i];
|
|
572
|
+
if (__DEV__ && instance !== null) {
|
|
573
|
+
(0, _ReactCurrentFiber.runWithFiberInDEV)(instance, executeDispatch, event, listener, instance);
|
|
574
|
+
} else {
|
|
575
|
+
executeDispatch(event, listener, instance);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
} else if (dispatchListeners) {
|
|
579
|
+
var _listener = dispatchListeners;
|
|
580
|
+
var _instance = dispatchInstances;
|
|
581
|
+
if (__DEV__ && _instance !== null) {
|
|
582
|
+
(0, _ReactCurrentFiber.runWithFiberInDEV)(_instance, executeDispatch, event, _listener, _instance);
|
|
583
|
+
} else {
|
|
584
|
+
executeDispatch(event, _listener, _instance);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
event._dispatchListeners = null;
|
|
588
|
+
event._dispatchInstances = null;
|
|
589
|
+
}
|
|
590
|
+
function executeDispatchesInOrderStopAtTrueImpl(event) {
|
|
591
|
+
var dispatchListeners = event._dispatchListeners;
|
|
592
|
+
var dispatchInstances = event._dispatchInstances;
|
|
593
|
+
if (__DEV__) {
|
|
594
|
+
validateEventDispatches(event);
|
|
595
|
+
}
|
|
596
|
+
if ((0, _isArray.default)(dispatchListeners)) {
|
|
597
|
+
for (var i = 0;i < dispatchListeners.length; i++) {
|
|
598
|
+
if (event.isPropagationStopped()) {
|
|
599
|
+
break;
|
|
600
|
+
}
|
|
601
|
+
if (dispatchListeners[i](event, dispatchInstances[i])) {
|
|
602
|
+
return dispatchInstances[i];
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
} else if (dispatchListeners) {
|
|
606
|
+
if (dispatchListeners(event, dispatchInstances)) {
|
|
607
|
+
return dispatchInstances;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
return null;
|
|
611
|
+
}
|
|
612
|
+
function executeDispatchesInOrderStopAtTrue(event) {
|
|
613
|
+
var ret = executeDispatchesInOrderStopAtTrueImpl(event);
|
|
614
|
+
event._dispatchInstances = null;
|
|
615
|
+
event._dispatchListeners = null;
|
|
616
|
+
return ret;
|
|
617
|
+
}
|
|
618
|
+
function executeDirectDispatch(event) {
|
|
619
|
+
if (__DEV__) {
|
|
620
|
+
validateEventDispatches(event);
|
|
621
|
+
}
|
|
622
|
+
var dispatchListener = event._dispatchListeners;
|
|
623
|
+
var dispatchInstance = event._dispatchInstances;
|
|
624
|
+
if ((0, _isArray.default)(dispatchListener)) {
|
|
625
|
+
throw new Error("Invalid `event`.");
|
|
626
|
+
}
|
|
627
|
+
event.currentTarget = dispatchListener ? getNodeFromInstance(dispatchInstance) : null;
|
|
628
|
+
var res = dispatchListener ? dispatchListener(event) : null;
|
|
629
|
+
event.currentTarget = null;
|
|
630
|
+
event._dispatchListeners = null;
|
|
631
|
+
event._dispatchInstances = null;
|
|
632
|
+
return res;
|
|
633
|
+
}
|
|
634
|
+
function hasDispatches(event) {
|
|
635
|
+
return !!event._dispatchListeners;
|
|
636
|
+
}
|
|
637
|
+
function rethrowCaughtError() {
|
|
638
|
+
if (hasError) {
|
|
639
|
+
var error = caughtError;
|
|
640
|
+
hasError = false;
|
|
641
|
+
caughtError = null;
|
|
642
|
+
throw error;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
});
|
|
646
|
+
|
|
647
|
+
// ../third_party/react/packages/react-native-renderer/src/legacy-events/EventPluginRegistry.js
|
|
648
|
+
var require_EventPluginRegistry = __commonJS((exports2) => {
|
|
649
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
650
|
+
exports2.eventNameDispatchConfigs = undefined;
|
|
651
|
+
exports2.injectEventPluginOrder = injectEventPluginOrder;
|
|
652
|
+
exports2.injectEventPluginsByName = injectEventPluginsByName;
|
|
653
|
+
exports2.registrationNameModules = exports2.registrationNameDependencies = exports2.possibleRegistrationNames = exports2.plugins = undefined;
|
|
654
|
+
var eventPluginOrder = null;
|
|
655
|
+
var namesToPlugins = {};
|
|
656
|
+
function recomputePluginOrdering() {
|
|
657
|
+
if (!eventPluginOrder) {
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
for (var pluginName in namesToPlugins) {
|
|
661
|
+
var pluginModule = namesToPlugins[pluginName];
|
|
662
|
+
var pluginIndex = eventPluginOrder.indexOf(pluginName);
|
|
663
|
+
if (pluginIndex <= -1) {
|
|
664
|
+
throw new Error("EventPluginRegistry: Cannot inject event plugins that do not exist in " + `the plugin ordering, \`${pluginName}\`.`);
|
|
665
|
+
}
|
|
666
|
+
if (plugins[pluginIndex]) {
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
if (!pluginModule.extractEvents) {
|
|
670
|
+
throw new Error("EventPluginRegistry: Event plugins must implement an `extractEvents` " + `method, but \`${pluginName}\` does not.`);
|
|
671
|
+
}
|
|
672
|
+
plugins[pluginIndex] = pluginModule;
|
|
673
|
+
var publishedEvents = pluginModule.eventTypes;
|
|
674
|
+
for (var _eventName in publishedEvents) {
|
|
675
|
+
if (!publishEventForPlugin(publishedEvents[_eventName], pluginModule, _eventName)) {
|
|
676
|
+
throw new Error(`EventPluginRegistry: Failed to publish event \`${_eventName}\` for plugin \`${pluginName}\`.`);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
|
|
682
|
+
if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
|
|
683
|
+
throw new Error("EventPluginRegistry: More than one plugin attempted to publish the same " + `event name, \`${eventName}\`.`);
|
|
684
|
+
}
|
|
685
|
+
eventNameDispatchConfigs[eventName] = dispatchConfig;
|
|
686
|
+
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
|
|
687
|
+
if (phasedRegistrationNames) {
|
|
688
|
+
for (var phaseName in phasedRegistrationNames) {
|
|
689
|
+
if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
|
|
690
|
+
var phasedRegistrationName = phasedRegistrationNames[phaseName];
|
|
691
|
+
publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
return true;
|
|
695
|
+
} else if (dispatchConfig.registrationName) {
|
|
696
|
+
publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
|
|
697
|
+
return true;
|
|
698
|
+
}
|
|
699
|
+
return false;
|
|
700
|
+
}
|
|
701
|
+
function publishRegistrationName(registrationName, pluginModule, eventName) {
|
|
702
|
+
if (registrationNameModules[registrationName]) {
|
|
703
|
+
throw new Error("EventPluginRegistry: More than one plugin attempted to publish the same " + `registration name, \`${registrationName}\`.`);
|
|
704
|
+
}
|
|
705
|
+
registrationNameModules[registrationName] = pluginModule;
|
|
706
|
+
registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
|
|
707
|
+
if (__DEV__) {
|
|
708
|
+
var _lowerCasedName = registrationName.toLowerCase();
|
|
709
|
+
possibleRegistrationNames[_lowerCasedName] = registrationName;
|
|
710
|
+
if (registrationName === "onDoubleClick") {
|
|
711
|
+
possibleRegistrationNames.ondblclick = registrationName;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
var plugins = exports2.plugins = [];
|
|
716
|
+
var eventNameDispatchConfigs = exports2.eventNameDispatchConfigs = {};
|
|
717
|
+
var registrationNameModules = exports2.registrationNameModules = {};
|
|
718
|
+
var registrationNameDependencies = exports2.registrationNameDependencies = {};
|
|
719
|
+
var possibleRegistrationNames = exports2.possibleRegistrationNames = __DEV__ ? {} : null;
|
|
720
|
+
function injectEventPluginOrder(injectedEventPluginOrder) {
|
|
721
|
+
if (eventPluginOrder) {
|
|
722
|
+
throw new Error("EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React.");
|
|
723
|
+
}
|
|
724
|
+
eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
|
|
725
|
+
recomputePluginOrdering();
|
|
726
|
+
}
|
|
727
|
+
function injectEventPluginsByName(injectedNamesToPlugins) {
|
|
728
|
+
var isOrderingDirty = false;
|
|
729
|
+
for (var pluginName in injectedNamesToPlugins) {
|
|
730
|
+
if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
|
|
731
|
+
continue;
|
|
732
|
+
}
|
|
733
|
+
var pluginModule = injectedNamesToPlugins[pluginName];
|
|
734
|
+
if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
|
|
735
|
+
if (namesToPlugins[pluginName]) {
|
|
736
|
+
throw new Error("EventPluginRegistry: Cannot inject two different event plugins " + `using the same name, \`${pluginName}\`.`);
|
|
737
|
+
}
|
|
738
|
+
namesToPlugins[pluginName] = pluginModule;
|
|
739
|
+
isOrderingDirty = true;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
if (isOrderingDirty) {
|
|
743
|
+
recomputePluginOrdering();
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
});
|
|
747
|
+
|
|
748
|
+
// ../third_party/react/packages/shared/assign.js
|
|
749
|
+
var require_assign = __commonJS((exports2) => {
|
|
750
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
751
|
+
exports2.default = undefined;
|
|
752
|
+
var assign = Object.assign;
|
|
753
|
+
var _default = exports2.default = assign;
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
// ../third_party/react/packages/react-native-renderer/src/legacy-events/SyntheticEvent.js
|
|
757
|
+
var require_SyntheticEvent = __commonJS((exports2) => {
|
|
758
|
+
var _interopRequireDefault = require_interopRequireDefault();
|
|
759
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
760
|
+
exports2.default = undefined;
|
|
761
|
+
var _assign = _interopRequireDefault(require_assign());
|
|
762
|
+
var EVENT_POOL_SIZE = 10;
|
|
763
|
+
var EventInterface = { type: null, target: null, currentTarget: function currentTarget() {
|
|
764
|
+
return null;
|
|
765
|
+
}, eventPhase: null, bubbles: null, cancelable: null, timeStamp: function timeStamp(event) {
|
|
766
|
+
return event.timeStamp || Date.now();
|
|
767
|
+
}, defaultPrevented: null, isTrusted: null };
|
|
768
|
+
function functionThatReturnsTrue() {
|
|
769
|
+
return true;
|
|
770
|
+
}
|
|
771
|
+
function functionThatReturnsFalse() {
|
|
772
|
+
return false;
|
|
773
|
+
}
|
|
774
|
+
function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
|
|
775
|
+
if (__DEV__) {
|
|
776
|
+
delete this.nativeEvent;
|
|
777
|
+
delete this.preventDefault;
|
|
778
|
+
delete this.stopPropagation;
|
|
779
|
+
delete this.isDefaultPrevented;
|
|
780
|
+
delete this.isPropagationStopped;
|
|
781
|
+
}
|
|
782
|
+
this.dispatchConfig = dispatchConfig;
|
|
783
|
+
this._targetInst = targetInst;
|
|
784
|
+
this.nativeEvent = nativeEvent;
|
|
785
|
+
this._dispatchListeners = null;
|
|
786
|
+
this._dispatchInstances = null;
|
|
787
|
+
var Interface = this.constructor.Interface;
|
|
788
|
+
for (var propName in Interface) {
|
|
789
|
+
if (!Interface.hasOwnProperty(propName)) {
|
|
790
|
+
continue;
|
|
791
|
+
}
|
|
792
|
+
if (__DEV__) {
|
|
793
|
+
delete this[propName];
|
|
794
|
+
}
|
|
795
|
+
var normalize = Interface[propName];
|
|
796
|
+
if (normalize) {
|
|
797
|
+
this[propName] = normalize(nativeEvent);
|
|
798
|
+
} else {
|
|
799
|
+
if (propName === "target") {
|
|
800
|
+
this.target = nativeEventTarget;
|
|
801
|
+
} else {
|
|
802
|
+
this[propName] = nativeEvent[propName];
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
|
|
807
|
+
if (defaultPrevented) {
|
|
808
|
+
this.isDefaultPrevented = functionThatReturnsTrue;
|
|
809
|
+
} else {
|
|
810
|
+
this.isDefaultPrevented = functionThatReturnsFalse;
|
|
811
|
+
}
|
|
812
|
+
this.isPropagationStopped = functionThatReturnsFalse;
|
|
813
|
+
return this;
|
|
814
|
+
}
|
|
815
|
+
(0, _assign.default)(SyntheticEvent.prototype, { preventDefault: function preventDefault() {
|
|
816
|
+
this.defaultPrevented = true;
|
|
817
|
+
var event = this.nativeEvent;
|
|
818
|
+
if (!event) {
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
if (event.preventDefault) {
|
|
822
|
+
event.preventDefault();
|
|
823
|
+
} else if (typeof event.returnValue !== "unknown") {
|
|
824
|
+
event.returnValue = false;
|
|
825
|
+
}
|
|
826
|
+
this.isDefaultPrevented = functionThatReturnsTrue;
|
|
827
|
+
}, stopPropagation: function stopPropagation() {
|
|
828
|
+
var event = this.nativeEvent;
|
|
829
|
+
if (!event) {
|
|
830
|
+
return;
|
|
831
|
+
}
|
|
832
|
+
if (event.stopPropagation) {
|
|
833
|
+
event.stopPropagation();
|
|
834
|
+
} else if (typeof event.cancelBubble !== "unknown") {
|
|
835
|
+
event.cancelBubble = true;
|
|
836
|
+
}
|
|
837
|
+
this.isPropagationStopped = functionThatReturnsTrue;
|
|
838
|
+
}, persist: function persist() {
|
|
839
|
+
this.isPersistent = functionThatReturnsTrue;
|
|
840
|
+
}, isPersistent: functionThatReturnsFalse, destructor: function destructor() {
|
|
841
|
+
var Interface = this.constructor.Interface;
|
|
842
|
+
for (var propName in Interface) {
|
|
843
|
+
if (__DEV__) {
|
|
844
|
+
Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
|
|
845
|
+
} else {
|
|
846
|
+
this[propName] = null;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
this.dispatchConfig = null;
|
|
850
|
+
this._targetInst = null;
|
|
851
|
+
this.nativeEvent = null;
|
|
852
|
+
this.isDefaultPrevented = functionThatReturnsFalse;
|
|
853
|
+
this.isPropagationStopped = functionThatReturnsFalse;
|
|
854
|
+
this._dispatchListeners = null;
|
|
855
|
+
this._dispatchInstances = null;
|
|
856
|
+
if (__DEV__) {
|
|
857
|
+
Object.defineProperty(this, "nativeEvent", getPooledWarningPropertyDefinition("nativeEvent", null));
|
|
858
|
+
Object.defineProperty(this, "isDefaultPrevented", getPooledWarningPropertyDefinition("isDefaultPrevented", functionThatReturnsFalse));
|
|
859
|
+
Object.defineProperty(this, "isPropagationStopped", getPooledWarningPropertyDefinition("isPropagationStopped", functionThatReturnsFalse));
|
|
860
|
+
Object.defineProperty(this, "preventDefault", getPooledWarningPropertyDefinition("preventDefault", function() {}));
|
|
861
|
+
Object.defineProperty(this, "stopPropagation", getPooledWarningPropertyDefinition("stopPropagation", function() {}));
|
|
862
|
+
}
|
|
863
|
+
} });
|
|
864
|
+
SyntheticEvent.Interface = EventInterface;
|
|
865
|
+
SyntheticEvent.extend = function(Interface) {
|
|
866
|
+
var Super = this;
|
|
867
|
+
var E = function E2() {};
|
|
868
|
+
E.prototype = Super.prototype;
|
|
869
|
+
var prototype = new E;
|
|
870
|
+
function Class() {
|
|
871
|
+
return Super.apply(this, arguments);
|
|
872
|
+
}
|
|
873
|
+
(0, _assign.default)(prototype, Class.prototype);
|
|
874
|
+
Class.prototype = prototype;
|
|
875
|
+
Class.prototype.constructor = Class;
|
|
876
|
+
Class.Interface = (0, _assign.default)({}, Super.Interface, Interface);
|
|
877
|
+
Class.extend = Super.extend;
|
|
878
|
+
addEventPoolingTo(Class);
|
|
879
|
+
return Class;
|
|
880
|
+
};
|
|
881
|
+
addEventPoolingTo(SyntheticEvent);
|
|
882
|
+
function getPooledWarningPropertyDefinition(propName, getVal) {
|
|
883
|
+
function set(val) {
|
|
884
|
+
var action = isFunction ? "setting the method" : "setting the property";
|
|
885
|
+
warn(action, "This is effectively a no-op");
|
|
886
|
+
return val;
|
|
887
|
+
}
|
|
888
|
+
function get() {
|
|
889
|
+
var action = isFunction ? "accessing the method" : "accessing the property";
|
|
890
|
+
var result = isFunction ? "This is a no-op function" : "This is set to null";
|
|
891
|
+
warn(action, result);
|
|
892
|
+
return getVal;
|
|
893
|
+
}
|
|
894
|
+
function warn(action, result) {
|
|
895
|
+
if (__DEV__) {
|
|
896
|
+
console.error("This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + "If you must keep the original synthetic event around, use event.persist(). " + "See https://react.dev/link/event-pooling for more information.", action, propName, result);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
var isFunction = typeof getVal === "function";
|
|
900
|
+
return { configurable: true, set, get };
|
|
901
|
+
}
|
|
902
|
+
function createOrGetPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
|
|
903
|
+
var EventConstructor = this;
|
|
904
|
+
if (EventConstructor.eventPool.length) {
|
|
905
|
+
var instance = EventConstructor.eventPool.pop();
|
|
906
|
+
EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
|
|
907
|
+
return instance;
|
|
908
|
+
}
|
|
909
|
+
return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);
|
|
910
|
+
}
|
|
911
|
+
function releasePooledEvent(event) {
|
|
912
|
+
var EventConstructor = this;
|
|
913
|
+
if (!(event instanceof EventConstructor)) {
|
|
914
|
+
throw new Error("Trying to release an event instance into a pool of a different type.");
|
|
915
|
+
}
|
|
916
|
+
event.destructor();
|
|
917
|
+
if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
|
|
918
|
+
EventConstructor.eventPool.push(event);
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
function addEventPoolingTo(EventConstructor) {
|
|
922
|
+
EventConstructor.getPooled = createOrGetPooledEvent;
|
|
923
|
+
EventConstructor.eventPool = [];
|
|
924
|
+
EventConstructor.release = releasePooledEvent;
|
|
925
|
+
}
|
|
926
|
+
var _default = exports2.default = SyntheticEvent;
|
|
927
|
+
});
|
|
928
|
+
|
|
929
|
+
// ../third_party/react/packages/react-native-renderer/src/legacy-events/ResponderSyntheticEvent.js
|
|
930
|
+
var require_ResponderSyntheticEvent = __commonJS((exports2) => {
|
|
931
|
+
var _interopRequireDefault = require_interopRequireDefault();
|
|
932
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
933
|
+
exports2.default = undefined;
|
|
934
|
+
var _SyntheticEvent = _interopRequireDefault(require_SyntheticEvent());
|
|
935
|
+
var ResponderSyntheticEvent = _SyntheticEvent.default.extend({ touchHistory: function touchHistory(nativeEvent) {
|
|
936
|
+
return null;
|
|
937
|
+
} });
|
|
938
|
+
var _default = exports2.default = ResponderSyntheticEvent;
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
// ../third_party/react/packages/react-native-renderer/src/legacy-events/ResponderTopLevelEventTypes.js
|
|
942
|
+
var require_ResponderTopLevelEventTypes = __commonJS((exports2) => {
|
|
943
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
944
|
+
exports2.endDependencies = exports2.TOP_TOUCH_START = exports2.TOP_TOUCH_MOVE = exports2.TOP_TOUCH_END = exports2.TOP_TOUCH_CANCEL = exports2.TOP_SELECTION_CHANGE = exports2.TOP_SCROLL = undefined;
|
|
945
|
+
exports2.isEndish = isEndish;
|
|
946
|
+
exports2.isMoveish = isMoveish;
|
|
947
|
+
exports2.isStartish = isStartish;
|
|
948
|
+
exports2.startDependencies = exports2.moveDependencies = undefined;
|
|
949
|
+
var TOP_TOUCH_START = exports2.TOP_TOUCH_START = "topTouchStart";
|
|
950
|
+
var TOP_TOUCH_MOVE = exports2.TOP_TOUCH_MOVE = "topTouchMove";
|
|
951
|
+
var TOP_TOUCH_END = exports2.TOP_TOUCH_END = "topTouchEnd";
|
|
952
|
+
var TOP_TOUCH_CANCEL = exports2.TOP_TOUCH_CANCEL = "topTouchCancel";
|
|
953
|
+
var TOP_SCROLL = exports2.TOP_SCROLL = "topScroll";
|
|
954
|
+
var TOP_SELECTION_CHANGE = exports2.TOP_SELECTION_CHANGE = "topSelectionChange";
|
|
955
|
+
function isStartish(topLevelType) {
|
|
956
|
+
return topLevelType === TOP_TOUCH_START;
|
|
957
|
+
}
|
|
958
|
+
function isMoveish(topLevelType) {
|
|
959
|
+
return topLevelType === TOP_TOUCH_MOVE;
|
|
960
|
+
}
|
|
961
|
+
function isEndish(topLevelType) {
|
|
962
|
+
return topLevelType === TOP_TOUCH_END || topLevelType === TOP_TOUCH_CANCEL;
|
|
963
|
+
}
|
|
964
|
+
var startDependencies = exports2.startDependencies = [TOP_TOUCH_START];
|
|
965
|
+
var moveDependencies = exports2.moveDependencies = [TOP_TOUCH_MOVE];
|
|
966
|
+
var endDependencies = exports2.endDependencies = [TOP_TOUCH_CANCEL, TOP_TOUCH_END];
|
|
967
|
+
});
|
|
968
|
+
|
|
969
|
+
// ../third_party/react/packages/react-native-renderer/src/legacy-events/ResponderTouchHistoryStore.js
|
|
970
|
+
var require_ResponderTouchHistoryStore = __commonJS((exports2) => {
|
|
971
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
972
|
+
exports2.default = undefined;
|
|
973
|
+
var _ResponderTopLevelEventTypes = require_ResponderTopLevelEventTypes();
|
|
974
|
+
var MAX_TOUCH_BANK = 20;
|
|
975
|
+
var touchBank = [];
|
|
976
|
+
var touchHistory = { touchBank, numberActiveTouches: 0, indexOfSingleActiveTouch: -1, mostRecentTimeStamp: 0 };
|
|
977
|
+
function timestampForTouch(touch) {
|
|
978
|
+
return touch.timeStamp || touch.timestamp;
|
|
979
|
+
}
|
|
980
|
+
function createTouchRecord(touch) {
|
|
981
|
+
return { touchActive: true, startPageX: touch.pageX, startPageY: touch.pageY, startTimeStamp: timestampForTouch(touch), currentPageX: touch.pageX, currentPageY: touch.pageY, currentTimeStamp: timestampForTouch(touch), previousPageX: touch.pageX, previousPageY: touch.pageY, previousTimeStamp: timestampForTouch(touch) };
|
|
982
|
+
}
|
|
983
|
+
function resetTouchRecord(touchRecord, touch) {
|
|
984
|
+
touchRecord.touchActive = true;
|
|
985
|
+
touchRecord.startPageX = touch.pageX;
|
|
986
|
+
touchRecord.startPageY = touch.pageY;
|
|
987
|
+
touchRecord.startTimeStamp = timestampForTouch(touch);
|
|
988
|
+
touchRecord.currentPageX = touch.pageX;
|
|
989
|
+
touchRecord.currentPageY = touch.pageY;
|
|
990
|
+
touchRecord.currentTimeStamp = timestampForTouch(touch);
|
|
991
|
+
touchRecord.previousPageX = touch.pageX;
|
|
992
|
+
touchRecord.previousPageY = touch.pageY;
|
|
993
|
+
touchRecord.previousTimeStamp = timestampForTouch(touch);
|
|
994
|
+
}
|
|
995
|
+
function getTouchIdentifier(_ref) {
|
|
996
|
+
var identifier = _ref.identifier;
|
|
997
|
+
if (identifier == null) {
|
|
998
|
+
throw new Error("Touch object is missing identifier.");
|
|
999
|
+
}
|
|
1000
|
+
if (__DEV__) {
|
|
1001
|
+
if (identifier > MAX_TOUCH_BANK) {
|
|
1002
|
+
console.error("Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
return identifier;
|
|
1006
|
+
}
|
|
1007
|
+
function recordTouchStart(touch) {
|
|
1008
|
+
var identifier = getTouchIdentifier(touch);
|
|
1009
|
+
var touchRecord = touchBank[identifier];
|
|
1010
|
+
if (touchRecord) {
|
|
1011
|
+
resetTouchRecord(touchRecord, touch);
|
|
1012
|
+
} else {
|
|
1013
|
+
touchBank[identifier] = createTouchRecord(touch);
|
|
1014
|
+
}
|
|
1015
|
+
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
|
|
1016
|
+
}
|
|
1017
|
+
function recordTouchMove(touch) {
|
|
1018
|
+
var touchRecord = touchBank[getTouchIdentifier(touch)];
|
|
1019
|
+
if (touchRecord) {
|
|
1020
|
+
touchRecord.touchActive = true;
|
|
1021
|
+
touchRecord.previousPageX = touchRecord.currentPageX;
|
|
1022
|
+
touchRecord.previousPageY = touchRecord.currentPageY;
|
|
1023
|
+
touchRecord.previousTimeStamp = touchRecord.currentTimeStamp;
|
|
1024
|
+
touchRecord.currentPageX = touch.pageX;
|
|
1025
|
+
touchRecord.currentPageY = touch.pageY;
|
|
1026
|
+
touchRecord.currentTimeStamp = timestampForTouch(touch);
|
|
1027
|
+
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
|
|
1028
|
+
} else {
|
|
1029
|
+
if (__DEV__) {
|
|
1030
|
+
console.warn(`Cannot record touch move without a touch start.
|
|
1031
|
+
` + `Touch Move: %s
|
|
1032
|
+
` + "Touch Bank: %s", printTouch(touch), printTouchBank());
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
function recordTouchEnd(touch) {
|
|
1037
|
+
var touchRecord = touchBank[getTouchIdentifier(touch)];
|
|
1038
|
+
if (touchRecord) {
|
|
1039
|
+
touchRecord.touchActive = false;
|
|
1040
|
+
touchRecord.previousPageX = touchRecord.currentPageX;
|
|
1041
|
+
touchRecord.previousPageY = touchRecord.currentPageY;
|
|
1042
|
+
touchRecord.previousTimeStamp = touchRecord.currentTimeStamp;
|
|
1043
|
+
touchRecord.currentPageX = touch.pageX;
|
|
1044
|
+
touchRecord.currentPageY = touch.pageY;
|
|
1045
|
+
touchRecord.currentTimeStamp = timestampForTouch(touch);
|
|
1046
|
+
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
|
|
1047
|
+
} else {
|
|
1048
|
+
if (__DEV__) {
|
|
1049
|
+
console.warn(`Cannot record touch end without a touch start.
|
|
1050
|
+
` + `Touch End: %s
|
|
1051
|
+
` + "Touch Bank: %s", printTouch(touch), printTouchBank());
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
function printTouch(touch) {
|
|
1056
|
+
return JSON.stringify({ identifier: touch.identifier, pageX: touch.pageX, pageY: touch.pageY, timestamp: timestampForTouch(touch) });
|
|
1057
|
+
}
|
|
1058
|
+
function printTouchBank() {
|
|
1059
|
+
var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK));
|
|
1060
|
+
if (touchBank.length > MAX_TOUCH_BANK) {
|
|
1061
|
+
printed += " (original size: " + touchBank.length + ")";
|
|
1062
|
+
}
|
|
1063
|
+
return printed;
|
|
1064
|
+
}
|
|
1065
|
+
var instrumentationCallback;
|
|
1066
|
+
var ResponderTouchHistoryStore = { instrument: function instrument(callback) {
|
|
1067
|
+
instrumentationCallback = callback;
|
|
1068
|
+
}, recordTouchTrack: function recordTouchTrack(topLevelType, nativeEvent) {
|
|
1069
|
+
if (instrumentationCallback != null) {
|
|
1070
|
+
instrumentationCallback(topLevelType, nativeEvent);
|
|
1071
|
+
}
|
|
1072
|
+
if ((0, _ResponderTopLevelEventTypes.isMoveish)(topLevelType)) {
|
|
1073
|
+
nativeEvent.changedTouches.forEach(recordTouchMove);
|
|
1074
|
+
} else if ((0, _ResponderTopLevelEventTypes.isStartish)(topLevelType)) {
|
|
1075
|
+
nativeEvent.changedTouches.forEach(recordTouchStart);
|
|
1076
|
+
touchHistory.numberActiveTouches = nativeEvent.touches.length;
|
|
1077
|
+
if (touchHistory.numberActiveTouches === 1) {
|
|
1078
|
+
touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier;
|
|
1079
|
+
}
|
|
1080
|
+
} else if ((0, _ResponderTopLevelEventTypes.isEndish)(topLevelType)) {
|
|
1081
|
+
nativeEvent.changedTouches.forEach(recordTouchEnd);
|
|
1082
|
+
touchHistory.numberActiveTouches = nativeEvent.touches.length;
|
|
1083
|
+
if (touchHistory.numberActiveTouches === 1) {
|
|
1084
|
+
for (var i = 0;i < touchBank.length; i++) {
|
|
1085
|
+
var touchTrackToCheck = touchBank[i];
|
|
1086
|
+
if (touchTrackToCheck != null && touchTrackToCheck.touchActive) {
|
|
1087
|
+
touchHistory.indexOfSingleActiveTouch = i;
|
|
1088
|
+
break;
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
if (__DEV__) {
|
|
1092
|
+
var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch];
|
|
1093
|
+
if (activeRecord == null || !activeRecord.touchActive) {
|
|
1094
|
+
console.error("Cannot find single active touch.");
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
}, touchHistory };
|
|
1100
|
+
var _default = exports2.default = ResponderTouchHistoryStore;
|
|
1101
|
+
});
|
|
1102
|
+
|
|
1103
|
+
// ../third_party/react/packages/react-native-renderer/src/legacy-events/accumulate.js
|
|
1104
|
+
var require_accumulate = __commonJS((exports2) => {
|
|
1105
|
+
var _interopRequireDefault = require_interopRequireDefault();
|
|
1106
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1107
|
+
exports2.default = undefined;
|
|
1108
|
+
var _isArray = _interopRequireDefault(require_isArray());
|
|
1109
|
+
function accumulate(current, next) {
|
|
1110
|
+
if (next == null) {
|
|
1111
|
+
throw new Error("Accumulated items must not be null or undefined.");
|
|
1112
|
+
}
|
|
1113
|
+
if (current == null) {
|
|
1114
|
+
return next;
|
|
1115
|
+
}
|
|
1116
|
+
if ((0, _isArray.default)(current)) {
|
|
1117
|
+
return current.concat(next);
|
|
1118
|
+
}
|
|
1119
|
+
if ((0, _isArray.default)(next)) {
|
|
1120
|
+
return [current].concat(next);
|
|
1121
|
+
}
|
|
1122
|
+
return [current, next];
|
|
1123
|
+
}
|
|
1124
|
+
var _default = exports2.default = accumulate;
|
|
1125
|
+
});
|
|
1126
|
+
|
|
1127
|
+
// ../third_party/react/packages/react-native-renderer/src/legacy-events/accumulateInto.js
|
|
1128
|
+
var require_accumulateInto = __commonJS((exports2) => {
|
|
1129
|
+
var _interopRequireDefault = require_interopRequireDefault();
|
|
1130
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1131
|
+
exports2.default = undefined;
|
|
1132
|
+
var _isArray = _interopRequireDefault(require_isArray());
|
|
1133
|
+
function accumulateInto(current, next) {
|
|
1134
|
+
if (next == null) {
|
|
1135
|
+
throw new Error("Accumulated items must not be null or undefined.");
|
|
1136
|
+
}
|
|
1137
|
+
if (current == null) {
|
|
1138
|
+
return next;
|
|
1139
|
+
}
|
|
1140
|
+
if ((0, _isArray.default)(current)) {
|
|
1141
|
+
if ((0, _isArray.default)(next)) {
|
|
1142
|
+
current.push.apply(current, next);
|
|
1143
|
+
return current;
|
|
1144
|
+
}
|
|
1145
|
+
current.push(next);
|
|
1146
|
+
return current;
|
|
1147
|
+
}
|
|
1148
|
+
if ((0, _isArray.default)(next)) {
|
|
1149
|
+
return [current].concat(next);
|
|
1150
|
+
}
|
|
1151
|
+
return [current, next];
|
|
1152
|
+
}
|
|
1153
|
+
var _default = exports2.default = accumulateInto;
|
|
1154
|
+
});
|
|
1155
|
+
|
|
1156
|
+
// ../third_party/react/packages/react-native-renderer/src/legacy-events/forEachAccumulated.js
|
|
1157
|
+
var require_forEachAccumulated = __commonJS((exports2) => {
|
|
1158
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1159
|
+
exports2.default = undefined;
|
|
1160
|
+
function forEachAccumulated(arr, cb, scope) {
|
|
1161
|
+
if (Array.isArray(arr)) {
|
|
1162
|
+
arr.forEach(cb, scope);
|
|
1163
|
+
} else if (arr) {
|
|
1164
|
+
cb.call(scope, arr);
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
var _default = exports2.default = forEachAccumulated;
|
|
1168
|
+
});
|
|
1169
|
+
|
|
1170
|
+
// shims/react-work-tags.js
|
|
1171
|
+
var require_react_work_tags = __commonJS((exports2, module2) => {
|
|
1172
|
+
var HostComponent = 5;
|
|
1173
|
+
module2.exports = {
|
|
1174
|
+
HostComponent
|
|
1175
|
+
};
|
|
1176
|
+
});
|
|
1177
|
+
|
|
1178
|
+
// ../third_party/react/packages/react-native-renderer/src/legacy-events/ResponderEventPlugin.js
|
|
1179
|
+
var require_ResponderEventPlugin = __commonJS((exports2) => {
|
|
1180
|
+
var _interopRequireDefault = require_interopRequireDefault();
|
|
1181
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1182
|
+
exports2.default = undefined;
|
|
1183
|
+
exports2.getLowestCommonAncestor = getLowestCommonAncestor;
|
|
1184
|
+
var _EventPluginUtils = require_EventPluginUtils();
|
|
1185
|
+
var _ResponderSyntheticEvent = _interopRequireDefault(require_ResponderSyntheticEvent());
|
|
1186
|
+
var _ResponderTouchHistoryStore = _interopRequireDefault(require_ResponderTouchHistoryStore());
|
|
1187
|
+
var _accumulate = _interopRequireDefault(require_accumulate());
|
|
1188
|
+
var _ResponderTopLevelEventTypes = require_ResponderTopLevelEventTypes();
|
|
1189
|
+
var _accumulateInto = _interopRequireDefault(require_accumulateInto());
|
|
1190
|
+
var _forEachAccumulated = _interopRequireDefault(require_forEachAccumulated());
|
|
1191
|
+
var _ReactWorkTags = require_react_work_tags();
|
|
1192
|
+
var responderInst = null;
|
|
1193
|
+
var trackedTouchCount = 0;
|
|
1194
|
+
function changeResponder(nextResponderInst, blockHostResponder) {
|
|
1195
|
+
var oldResponderInst = responderInst;
|
|
1196
|
+
responderInst = nextResponderInst;
|
|
1197
|
+
if (ResponderEventPlugin.GlobalResponderHandler !== null) {
|
|
1198
|
+
ResponderEventPlugin.GlobalResponderHandler.onChange(oldResponderInst, nextResponderInst, blockHostResponder);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
var eventTypes = { startShouldSetResponder: { phasedRegistrationNames: { bubbled: "onStartShouldSetResponder", captured: "onStartShouldSetResponderCapture" }, dependencies: _ResponderTopLevelEventTypes.startDependencies }, scrollShouldSetResponder: { phasedRegistrationNames: { bubbled: "onScrollShouldSetResponder", captured: "onScrollShouldSetResponderCapture" }, dependencies: [_ResponderTopLevelEventTypes.TOP_SCROLL] }, selectionChangeShouldSetResponder: { phasedRegistrationNames: { bubbled: "onSelectionChangeShouldSetResponder", captured: "onSelectionChangeShouldSetResponderCapture" }, dependencies: [_ResponderTopLevelEventTypes.TOP_SELECTION_CHANGE] }, moveShouldSetResponder: { phasedRegistrationNames: { bubbled: "onMoveShouldSetResponder", captured: "onMoveShouldSetResponderCapture" }, dependencies: _ResponderTopLevelEventTypes.moveDependencies }, responderStart: { registrationName: "onResponderStart", dependencies: _ResponderTopLevelEventTypes.startDependencies }, responderMove: { registrationName: "onResponderMove", dependencies: _ResponderTopLevelEventTypes.moveDependencies }, responderEnd: { registrationName: "onResponderEnd", dependencies: _ResponderTopLevelEventTypes.endDependencies }, responderRelease: { registrationName: "onResponderRelease", dependencies: _ResponderTopLevelEventTypes.endDependencies }, responderTerminationRequest: { registrationName: "onResponderTerminationRequest", dependencies: [] }, responderGrant: { registrationName: "onResponderGrant", dependencies: [] }, responderReject: { registrationName: "onResponderReject", dependencies: [] }, responderTerminate: { registrationName: "onResponderTerminate", dependencies: [] } };
|
|
1202
|
+
function getParent(inst) {
|
|
1203
|
+
do {
|
|
1204
|
+
inst = inst.return;
|
|
1205
|
+
} while (inst && inst.tag !== _ReactWorkTags.HostComponent);
|
|
1206
|
+
if (inst) {
|
|
1207
|
+
return inst;
|
|
1208
|
+
}
|
|
1209
|
+
return null;
|
|
1210
|
+
}
|
|
1211
|
+
function getLowestCommonAncestor(instA, instB) {
|
|
1212
|
+
var depthA = 0;
|
|
1213
|
+
for (var tempA = instA;tempA; tempA = getParent(tempA)) {
|
|
1214
|
+
depthA++;
|
|
1215
|
+
}
|
|
1216
|
+
var depthB = 0;
|
|
1217
|
+
for (var tempB = instB;tempB; tempB = getParent(tempB)) {
|
|
1218
|
+
depthB++;
|
|
1219
|
+
}
|
|
1220
|
+
while (depthA - depthB > 0) {
|
|
1221
|
+
instA = getParent(instA);
|
|
1222
|
+
depthA--;
|
|
1223
|
+
}
|
|
1224
|
+
while (depthB - depthA > 0) {
|
|
1225
|
+
instB = getParent(instB);
|
|
1226
|
+
depthB--;
|
|
1227
|
+
}
|
|
1228
|
+
var depth = depthA;
|
|
1229
|
+
while (depth--) {
|
|
1230
|
+
if (instA === instB || instA === instB.alternate) {
|
|
1231
|
+
return instA;
|
|
1232
|
+
}
|
|
1233
|
+
instA = getParent(instA);
|
|
1234
|
+
instB = getParent(instB);
|
|
1235
|
+
}
|
|
1236
|
+
return null;
|
|
1237
|
+
}
|
|
1238
|
+
function isAncestor(instA, instB) {
|
|
1239
|
+
while (instB) {
|
|
1240
|
+
if (instA === instB || instA === instB.alternate) {
|
|
1241
|
+
return true;
|
|
1242
|
+
}
|
|
1243
|
+
instB = getParent(instB);
|
|
1244
|
+
}
|
|
1245
|
+
return false;
|
|
1246
|
+
}
|
|
1247
|
+
function traverseTwoPhase(inst, fn, arg) {
|
|
1248
|
+
var path = [];
|
|
1249
|
+
while (inst) {
|
|
1250
|
+
path.push(inst);
|
|
1251
|
+
inst = getParent(inst);
|
|
1252
|
+
}
|
|
1253
|
+
var i;
|
|
1254
|
+
for (i = path.length;i-- > 0; ) {
|
|
1255
|
+
fn(path[i], "captured", arg);
|
|
1256
|
+
}
|
|
1257
|
+
for (i = 0;i < path.length; i++) {
|
|
1258
|
+
fn(path[i], "bubbled", arg);
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
function getListener(inst, registrationName) {
|
|
1262
|
+
var stateNode = inst.stateNode;
|
|
1263
|
+
if (stateNode === null) {
|
|
1264
|
+
return null;
|
|
1265
|
+
}
|
|
1266
|
+
var props = (0, _EventPluginUtils.getFiberCurrentPropsFromNode)(stateNode);
|
|
1267
|
+
if (props === null) {
|
|
1268
|
+
return null;
|
|
1269
|
+
}
|
|
1270
|
+
var listener = props[registrationName];
|
|
1271
|
+
if (listener && typeof listener !== "function") {
|
|
1272
|
+
throw new Error(`Expected \`${registrationName}\` listener to be a function, instead got a value of \`${typeof listener}\` type.`);
|
|
1273
|
+
}
|
|
1274
|
+
return listener;
|
|
1275
|
+
}
|
|
1276
|
+
function listenerAtPhase(inst, event, propagationPhase) {
|
|
1277
|
+
var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
|
|
1278
|
+
return getListener(inst, registrationName);
|
|
1279
|
+
}
|
|
1280
|
+
function accumulateDirectionalDispatches(inst, phase, event) {
|
|
1281
|
+
if (__DEV__) {
|
|
1282
|
+
if (!inst) {
|
|
1283
|
+
console.error("Dispatching inst must not be null");
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
var listener = listenerAtPhase(inst, event, phase);
|
|
1287
|
+
if (listener) {
|
|
1288
|
+
event._dispatchListeners = (0, _accumulateInto.default)(event._dispatchListeners, listener);
|
|
1289
|
+
event._dispatchInstances = (0, _accumulateInto.default)(event._dispatchInstances, inst);
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
function accumulateDispatches(inst, ignoredDirection, event) {
|
|
1293
|
+
if (inst && event && event.dispatchConfig.registrationName) {
|
|
1294
|
+
var registrationName = event.dispatchConfig.registrationName;
|
|
1295
|
+
var listener = getListener(inst, registrationName);
|
|
1296
|
+
if (listener) {
|
|
1297
|
+
event._dispatchListeners = (0, _accumulateInto.default)(event._dispatchListeners, listener);
|
|
1298
|
+
event._dispatchInstances = (0, _accumulateInto.default)(event._dispatchInstances, inst);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
function accumulateDirectDispatchesSingle(event) {
|
|
1303
|
+
if (event && event.dispatchConfig.registrationName) {
|
|
1304
|
+
accumulateDispatches(event._targetInst, null, event);
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
function accumulateDirectDispatches(events) {
|
|
1308
|
+
(0, _forEachAccumulated.default)(events, accumulateDirectDispatchesSingle);
|
|
1309
|
+
}
|
|
1310
|
+
function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
|
|
1311
|
+
if (event && event.dispatchConfig.phasedRegistrationNames) {
|
|
1312
|
+
var targetInst = event._targetInst;
|
|
1313
|
+
var parentInst = targetInst ? getParent(targetInst) : null;
|
|
1314
|
+
traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
function accumulateTwoPhaseDispatchesSkipTarget(events) {
|
|
1318
|
+
(0, _forEachAccumulated.default)(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
|
|
1319
|
+
}
|
|
1320
|
+
function accumulateTwoPhaseDispatchesSingle(event) {
|
|
1321
|
+
if (event && event.dispatchConfig.phasedRegistrationNames) {
|
|
1322
|
+
traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
function accumulateTwoPhaseDispatches(events) {
|
|
1326
|
+
(0, _forEachAccumulated.default)(events, accumulateTwoPhaseDispatchesSingle);
|
|
1327
|
+
}
|
|
1328
|
+
function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
|
1329
|
+
var shouldSetEventType = (0, _ResponderTopLevelEventTypes.isStartish)(topLevelType) ? eventTypes.startShouldSetResponder : (0, _ResponderTopLevelEventTypes.isMoveish)(topLevelType) ? eventTypes.moveShouldSetResponder : topLevelType === _ResponderTopLevelEventTypes.TOP_SELECTION_CHANGE ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder;
|
|
1330
|
+
var bubbleShouldSetFrom = !responderInst ? targetInst : getLowestCommonAncestor(responderInst, targetInst);
|
|
1331
|
+
var skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst;
|
|
1332
|
+
var shouldSetEvent = _ResponderSyntheticEvent.default.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget);
|
|
1333
|
+
shouldSetEvent.touchHistory = _ResponderTouchHistoryStore.default.touchHistory;
|
|
1334
|
+
if (skipOverBubbleShouldSetFrom) {
|
|
1335
|
+
accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent);
|
|
1336
|
+
} else {
|
|
1337
|
+
accumulateTwoPhaseDispatches(shouldSetEvent);
|
|
1338
|
+
}
|
|
1339
|
+
var wantsResponderInst = (0, _EventPluginUtils.executeDispatchesInOrderStopAtTrue)(shouldSetEvent);
|
|
1340
|
+
if (!shouldSetEvent.isPersistent()) {
|
|
1341
|
+
shouldSetEvent.constructor.release(shouldSetEvent);
|
|
1342
|
+
}
|
|
1343
|
+
if (!wantsResponderInst || wantsResponderInst === responderInst) {
|
|
1344
|
+
return null;
|
|
1345
|
+
}
|
|
1346
|
+
var extracted;
|
|
1347
|
+
var grantEvent = _ResponderSyntheticEvent.default.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget);
|
|
1348
|
+
grantEvent.touchHistory = _ResponderTouchHistoryStore.default.touchHistory;
|
|
1349
|
+
accumulateDirectDispatches(grantEvent);
|
|
1350
|
+
var blockHostResponder = (0, _EventPluginUtils.executeDirectDispatch)(grantEvent) === true;
|
|
1351
|
+
if (responderInst) {
|
|
1352
|
+
var terminationRequestEvent = _ResponderSyntheticEvent.default.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget);
|
|
1353
|
+
terminationRequestEvent.touchHistory = _ResponderTouchHistoryStore.default.touchHistory;
|
|
1354
|
+
accumulateDirectDispatches(terminationRequestEvent);
|
|
1355
|
+
var shouldSwitch = !(0, _EventPluginUtils.hasDispatches)(terminationRequestEvent) || (0, _EventPluginUtils.executeDirectDispatch)(terminationRequestEvent);
|
|
1356
|
+
if (!terminationRequestEvent.isPersistent()) {
|
|
1357
|
+
terminationRequestEvent.constructor.release(terminationRequestEvent);
|
|
1358
|
+
}
|
|
1359
|
+
if (shouldSwitch) {
|
|
1360
|
+
var terminateEvent = _ResponderSyntheticEvent.default.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget);
|
|
1361
|
+
terminateEvent.touchHistory = _ResponderTouchHistoryStore.default.touchHistory;
|
|
1362
|
+
accumulateDirectDispatches(terminateEvent);
|
|
1363
|
+
extracted = (0, _accumulate.default)(extracted, [grantEvent, terminateEvent]);
|
|
1364
|
+
changeResponder(wantsResponderInst, blockHostResponder);
|
|
1365
|
+
} else {
|
|
1366
|
+
var rejectEvent = _ResponderSyntheticEvent.default.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget);
|
|
1367
|
+
rejectEvent.touchHistory = _ResponderTouchHistoryStore.default.touchHistory;
|
|
1368
|
+
accumulateDirectDispatches(rejectEvent);
|
|
1369
|
+
extracted = (0, _accumulate.default)(extracted, rejectEvent);
|
|
1370
|
+
}
|
|
1371
|
+
} else {
|
|
1372
|
+
extracted = (0, _accumulate.default)(extracted, grantEvent);
|
|
1373
|
+
changeResponder(wantsResponderInst, blockHostResponder);
|
|
1374
|
+
}
|
|
1375
|
+
return extracted;
|
|
1376
|
+
}
|
|
1377
|
+
function canTriggerTransfer(topLevelType, topLevelInst, nativeEvent) {
|
|
1378
|
+
return topLevelInst && (topLevelType === _ResponderTopLevelEventTypes.TOP_SCROLL && !nativeEvent.responderIgnoreScroll || trackedTouchCount > 0 && topLevelType === _ResponderTopLevelEventTypes.TOP_SELECTION_CHANGE || (0, _ResponderTopLevelEventTypes.isStartish)(topLevelType) || (0, _ResponderTopLevelEventTypes.isMoveish)(topLevelType));
|
|
1379
|
+
}
|
|
1380
|
+
function noResponderTouches(nativeEvent) {
|
|
1381
|
+
var touches = nativeEvent.touches;
|
|
1382
|
+
if (!touches || touches.length === 0) {
|
|
1383
|
+
return true;
|
|
1384
|
+
}
|
|
1385
|
+
for (var i = 0;i < touches.length; i++) {
|
|
1386
|
+
var activeTouch = touches[i];
|
|
1387
|
+
var target = activeTouch.target;
|
|
1388
|
+
if (target !== null && target !== undefined && target !== 0) {
|
|
1389
|
+
var targetInst = (0, _EventPluginUtils.getInstanceFromNode)(target);
|
|
1390
|
+
if (isAncestor(responderInst, targetInst)) {
|
|
1391
|
+
return false;
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
return true;
|
|
1396
|
+
}
|
|
1397
|
+
var ResponderEventPlugin = { _getResponder: function _getResponder() {
|
|
1398
|
+
return responderInst;
|
|
1399
|
+
}, eventTypes, extractEvents: function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
|
|
1400
|
+
if ((0, _ResponderTopLevelEventTypes.isStartish)(topLevelType)) {
|
|
1401
|
+
trackedTouchCount += 1;
|
|
1402
|
+
} else if ((0, _ResponderTopLevelEventTypes.isEndish)(topLevelType)) {
|
|
1403
|
+
if (trackedTouchCount >= 0) {
|
|
1404
|
+
trackedTouchCount -= 1;
|
|
1405
|
+
} else {
|
|
1406
|
+
if (__DEV__) {
|
|
1407
|
+
console.warn("Ended a touch event which was not counted in `trackedTouchCount`.");
|
|
1408
|
+
}
|
|
1409
|
+
return null;
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
_ResponderTouchHistoryStore.default.recordTouchTrack(topLevelType, nativeEvent);
|
|
1413
|
+
var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null;
|
|
1414
|
+
var isResponderTouchStart = responderInst && (0, _ResponderTopLevelEventTypes.isStartish)(topLevelType);
|
|
1415
|
+
var isResponderTouchMove = responderInst && (0, _ResponderTopLevelEventTypes.isMoveish)(topLevelType);
|
|
1416
|
+
var isResponderTouchEnd = responderInst && (0, _ResponderTopLevelEventTypes.isEndish)(topLevelType);
|
|
1417
|
+
var incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null;
|
|
1418
|
+
if (incrementalTouch) {
|
|
1419
|
+
var gesture = _ResponderSyntheticEvent.default.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget);
|
|
1420
|
+
gesture.touchHistory = _ResponderTouchHistoryStore.default.touchHistory;
|
|
1421
|
+
accumulateDirectDispatches(gesture);
|
|
1422
|
+
extracted = (0, _accumulate.default)(extracted, gesture);
|
|
1423
|
+
}
|
|
1424
|
+
var isResponderTerminate = responderInst && topLevelType === _ResponderTopLevelEventTypes.TOP_TOUCH_CANCEL;
|
|
1425
|
+
var isResponderRelease = responderInst && !isResponderTerminate && (0, _ResponderTopLevelEventTypes.isEndish)(topLevelType) && noResponderTouches(nativeEvent);
|
|
1426
|
+
var finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null;
|
|
1427
|
+
if (finalTouch) {
|
|
1428
|
+
var finalEvent = _ResponderSyntheticEvent.default.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget);
|
|
1429
|
+
finalEvent.touchHistory = _ResponderTouchHistoryStore.default.touchHistory;
|
|
1430
|
+
accumulateDirectDispatches(finalEvent);
|
|
1431
|
+
extracted = (0, _accumulate.default)(extracted, finalEvent);
|
|
1432
|
+
changeResponder(null);
|
|
1433
|
+
}
|
|
1434
|
+
return extracted;
|
|
1435
|
+
}, GlobalResponderHandler: null, injection: { injectGlobalResponderHandler: function injectGlobalResponderHandler(GlobalResponderHandler) {
|
|
1436
|
+
ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler;
|
|
1437
|
+
} } };
|
|
1438
|
+
var _default = exports2.default = ResponderEventPlugin;
|
|
1439
|
+
});
|
|
1440
|
+
|
|
1441
|
+
// ../third_party/react/packages/react-native-renderer/src/ReactNativeEventPluginOrder.js
|
|
1442
|
+
var require_ReactNativeEventPluginOrder = __commonJS((exports2) => {
|
|
1443
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1444
|
+
exports2.default = undefined;
|
|
1445
|
+
var ReactNativeEventPluginOrder = ["ResponderEventPlugin", "ReactNativeBridgeEventPlugin"];
|
|
1446
|
+
var _default = exports2.default = ReactNativeEventPluginOrder;
|
|
1447
|
+
});
|
|
1448
|
+
|
|
1449
|
+
// ../third_party/react/packages/react-native-renderer/src/ReactFabricGlobalResponderHandler.js
|
|
1450
|
+
var require_ReactFabricGlobalResponderHandler = __commonJS((exports2) => {
|
|
1451
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1452
|
+
exports2.default = undefined;
|
|
1453
|
+
var ReactFabricGlobalResponderHandler = { onChange: function onChange(from, to, blockNativeResponder) {
|
|
1454
|
+
if (from && from.stateNode) {
|
|
1455
|
+
nativeFabricUIManager.setIsJSResponder(from.stateNode.node, false, blockNativeResponder || false);
|
|
1456
|
+
}
|
|
1457
|
+
if (to && to.stateNode) {
|
|
1458
|
+
nativeFabricUIManager.setIsJSResponder(to.stateNode.node, true, blockNativeResponder || false);
|
|
1459
|
+
}
|
|
1460
|
+
} };
|
|
1461
|
+
var _default = exports2.default = ReactFabricGlobalResponderHandler;
|
|
1462
|
+
});
|
|
1463
|
+
|
|
1464
|
+
// ../third_party/react/packages/react-native-renderer/src/legacy-events/ReactGenericBatching.js
|
|
1465
|
+
var require_ReactGenericBatching = __commonJS((exports2) => {
|
|
1466
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1467
|
+
exports2.batchedUpdates = batchedUpdates;
|
|
1468
|
+
exports2.discreteUpdates = discreteUpdates;
|
|
1469
|
+
exports2.setBatchingImplementation = setBatchingImplementation;
|
|
1470
|
+
var batchedUpdatesImpl = function batchedUpdatesImpl2(fn, bookkeeping) {
|
|
1471
|
+
return fn(bookkeeping);
|
|
1472
|
+
};
|
|
1473
|
+
var discreteUpdatesImpl = function discreteUpdatesImpl2(fn, a, b, c, d) {
|
|
1474
|
+
return fn(a, b, c, d);
|
|
1475
|
+
};
|
|
1476
|
+
var isInsideEventHandler = false;
|
|
1477
|
+
function batchedUpdates(fn, bookkeeping) {
|
|
1478
|
+
if (isInsideEventHandler) {
|
|
1479
|
+
return fn(bookkeeping);
|
|
1480
|
+
}
|
|
1481
|
+
isInsideEventHandler = true;
|
|
1482
|
+
try {
|
|
1483
|
+
return batchedUpdatesImpl(fn, bookkeeping);
|
|
1484
|
+
} finally {
|
|
1485
|
+
isInsideEventHandler = false;
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
function discreteUpdates(fn, a, b, c, d) {
|
|
1489
|
+
var prevIsInsideEventHandler = isInsideEventHandler;
|
|
1490
|
+
isInsideEventHandler = true;
|
|
1491
|
+
try {
|
|
1492
|
+
return discreteUpdatesImpl(fn, a, b, c, d);
|
|
1493
|
+
} finally {
|
|
1494
|
+
isInsideEventHandler = prevIsInsideEventHandler;
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl) {
|
|
1498
|
+
batchedUpdatesImpl = _batchedUpdatesImpl;
|
|
1499
|
+
discreteUpdatesImpl = _discreteUpdatesImpl;
|
|
1500
|
+
}
|
|
1501
|
+
});
|
|
1502
|
+
|
|
1503
|
+
// ../third_party/react/packages/react-native-renderer/src/legacy-events/EventBatching.js
|
|
1504
|
+
var require_EventBatching = __commonJS((exports2) => {
|
|
1505
|
+
var _interopRequireDefault = require_interopRequireDefault();
|
|
1506
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1507
|
+
exports2.runEventsInBatch = runEventsInBatch;
|
|
1508
|
+
var _accumulateInto = _interopRequireDefault(require_accumulateInto());
|
|
1509
|
+
var _forEachAccumulated = _interopRequireDefault(require_forEachAccumulated());
|
|
1510
|
+
var _EventPluginUtils = require_EventPluginUtils();
|
|
1511
|
+
var eventQueue = null;
|
|
1512
|
+
function executeDispatchesAndRelease(event) {
|
|
1513
|
+
if (event) {
|
|
1514
|
+
(0, _EventPluginUtils.executeDispatchesInOrder)(event);
|
|
1515
|
+
if (!event.isPersistent()) {
|
|
1516
|
+
event.constructor.release(event);
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
function executeDispatchesAndReleaseTopLevel(e) {
|
|
1521
|
+
return executeDispatchesAndRelease(e);
|
|
1522
|
+
}
|
|
1523
|
+
function runEventsInBatch(events) {
|
|
1524
|
+
if (events !== null) {
|
|
1525
|
+
eventQueue = (0, _accumulateInto.default)(eventQueue, events);
|
|
1526
|
+
}
|
|
1527
|
+
var processingEventQueue = eventQueue;
|
|
1528
|
+
eventQueue = null;
|
|
1529
|
+
if (!processingEventQueue) {
|
|
1530
|
+
return;
|
|
1531
|
+
}
|
|
1532
|
+
(0, _forEachAccumulated.default)(processingEventQueue, executeDispatchesAndReleaseTopLevel);
|
|
1533
|
+
if (eventQueue) {
|
|
1534
|
+
throw new Error("processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented.");
|
|
1535
|
+
}
|
|
1536
|
+
(0, _EventPluginUtils.rethrowCaughtError)();
|
|
1537
|
+
}
|
|
1538
|
+
});
|
|
1539
|
+
|
|
1540
|
+
// src/renderer/react/ReactFabricMirror.ts
|
|
1541
|
+
var exports_ReactFabricMirror = {};
|
|
1542
|
+
__export(exports_ReactFabricMirror, {
|
|
1543
|
+
reactRender: () => reactRender,
|
|
1544
|
+
nativeLog: () => nativeLog,
|
|
1545
|
+
disposeReactRoot: () => disposeReactRoot
|
|
1546
|
+
});
|
|
1547
|
+
module.exports = __toCommonJS(exports_ReactFabricMirror);
|
|
1548
|
+
function nativeLog(...args) {
|
|
1549
|
+
global._log?.("[ReactFabricMirror] " + args.map((a) => {
|
|
1550
|
+
try {
|
|
1551
|
+
return JSON.stringify(a);
|
|
1552
|
+
} catch (e) {
|
|
1553
|
+
return "<failed to parse> " + String(a);
|
|
1554
|
+
}
|
|
1555
|
+
}).join(" "));
|
|
1556
|
+
}
|
|
1557
|
+
global.log = nativeLog;
|
|
1558
|
+
var Reconciler = require("react-reconciler");
|
|
1559
|
+
var {
|
|
1560
|
+
getFabricUIManager
|
|
1561
|
+
} = require_FabricUIManager();
|
|
1562
|
+
var uiManager = getFabricUIManager();
|
|
1563
|
+
var {
|
|
1564
|
+
create: createAttributePayload,
|
|
1565
|
+
diff: diffAttributePayloads
|
|
1566
|
+
} = require_ReactNativeAttributePayload();
|
|
1567
|
+
var ReactNativeViewConfigRegistry = require("react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry");
|
|
1568
|
+
global.rootHostContext = {};
|
|
1569
|
+
global.childHostContext = {};
|
|
1570
|
+
var {
|
|
1571
|
+
NoEventPriority,
|
|
1572
|
+
DefaultEventPriority,
|
|
1573
|
+
DiscreteEventPriority,
|
|
1574
|
+
ContinuousEventPriority,
|
|
1575
|
+
IdleEventPriority
|
|
1576
|
+
} = require("react-reconciler/constants");
|
|
1577
|
+
global.currentUpdatePriority = NoEventPriority;
|
|
1578
|
+
var currentCompleteRootSync = null;
|
|
1579
|
+
global.rootContainersBySurfaceId = global.rootContainersBySurfaceId ?? {};
|
|
1580
|
+
var {
|
|
1581
|
+
getPublicInstance
|
|
1582
|
+
} = require_react_fiber_config_fabric();
|
|
1583
|
+
var EventPluginUtilsModule = require_EventPluginUtils();
|
|
1584
|
+
var { setComponentTree } = EventPluginUtilsModule;
|
|
1585
|
+
var {
|
|
1586
|
+
injectEventPluginOrder,
|
|
1587
|
+
injectEventPluginsByName,
|
|
1588
|
+
plugins: legacyPlugins
|
|
1589
|
+
} = require_EventPluginRegistry();
|
|
1590
|
+
var ResponderEventPluginModule = require_ResponderEventPlugin();
|
|
1591
|
+
var ReactNativeEventPluginOrderModule = require_ReactNativeEventPluginOrder();
|
|
1592
|
+
var ReactFabricGlobalResponderHandlerModule = require_ReactFabricGlobalResponderHandler();
|
|
1593
|
+
var SyntheticEventModule = require_SyntheticEvent();
|
|
1594
|
+
var accumulateIntoModule = require_accumulateInto();
|
|
1595
|
+
var forEachAccumulatedModule = require_forEachAccumulated();
|
|
1596
|
+
var {
|
|
1597
|
+
batchedUpdates
|
|
1598
|
+
} = require_ReactGenericBatching();
|
|
1599
|
+
var {
|
|
1600
|
+
runEventsInBatch
|
|
1601
|
+
} = require_EventBatching();
|
|
1602
|
+
var { HostComponent } = require_react_work_tags();
|
|
1603
|
+
var ResponderEventPlugin = ResponderEventPluginModule.default ?? ResponderEventPluginModule;
|
|
1604
|
+
var ReactNativeEventPluginOrder = ReactNativeEventPluginOrderModule.default ?? ReactNativeEventPluginOrderModule;
|
|
1605
|
+
var ReactFabricGlobalResponderHandler = ReactFabricGlobalResponderHandlerModule.default ?? ReactFabricGlobalResponderHandlerModule;
|
|
1606
|
+
var SyntheticEvent = SyntheticEventModule.default ?? SyntheticEventModule;
|
|
1607
|
+
var accumulateInto = accumulateIntoModule.default ?? accumulateIntoModule;
|
|
1608
|
+
var forEachAccumulated = forEachAccumulatedModule.default ?? forEachAccumulatedModule;
|
|
1609
|
+
var { customBubblingEventTypes, customDirectEventTypes } = ReactNativeViewConfigRegistry;
|
|
1610
|
+
function getParent(inst) {
|
|
1611
|
+
do {
|
|
1612
|
+
inst = inst.return;
|
|
1613
|
+
} while (inst && inst.tag !== HostComponent);
|
|
1614
|
+
return inst || null;
|
|
1615
|
+
}
|
|
1616
|
+
function traverseTwoPhase(inst, fn, arg, skipBubbling) {
|
|
1617
|
+
const path = [];
|
|
1618
|
+
while (inst) {
|
|
1619
|
+
path.push(inst);
|
|
1620
|
+
inst = getParent(inst);
|
|
1621
|
+
}
|
|
1622
|
+
for (let i = path.length - 1;i >= 0; i--) {
|
|
1623
|
+
fn(path[i], "captured", arg);
|
|
1624
|
+
}
|
|
1625
|
+
if (skipBubbling) {
|
|
1626
|
+
fn(path[0], "bubbled", arg);
|
|
1627
|
+
} else {
|
|
1628
|
+
for (let i = 0;i < path.length; i++) {
|
|
1629
|
+
fn(path[i], "bubbled", arg);
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
function getListener(inst, registrationName) {
|
|
1634
|
+
const stateNode = inst.stateNode;
|
|
1635
|
+
if (stateNode == null) {
|
|
1636
|
+
return null;
|
|
1637
|
+
}
|
|
1638
|
+
const props = EventPluginUtilsModule.getFiberCurrentPropsFromNode(stateNode);
|
|
1639
|
+
if (props == null) {
|
|
1640
|
+
return null;
|
|
1641
|
+
}
|
|
1642
|
+
const listener = props[registrationName];
|
|
1643
|
+
if (listener != null && typeof listener !== "function") {
|
|
1644
|
+
throw new Error(`Expected \`${registrationName}\` listener to be a function, got \`${typeof listener}\`.`);
|
|
1645
|
+
}
|
|
1646
|
+
return listener;
|
|
1647
|
+
}
|
|
1648
|
+
function listenerAtPhase(inst, event, propagationPhase) {
|
|
1649
|
+
const registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
|
|
1650
|
+
return getListener(inst, registrationName);
|
|
1651
|
+
}
|
|
1652
|
+
function accumulateDirectionalDispatches(inst, phase, event) {
|
|
1653
|
+
const listener = listenerAtPhase(inst, event, phase);
|
|
1654
|
+
if (listener) {
|
|
1655
|
+
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
|
|
1656
|
+
event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
function accumulateTwoPhaseDispatchesSingle(event) {
|
|
1660
|
+
if (event && event.dispatchConfig.phasedRegistrationNames) {
|
|
1661
|
+
traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event, false);
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
function accumulateTwoPhaseDispatches(events) {
|
|
1665
|
+
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
|
|
1666
|
+
}
|
|
1667
|
+
function accumulateCapturePhaseDispatches(event) {
|
|
1668
|
+
if (event && event.dispatchConfig.phasedRegistrationNames) {
|
|
1669
|
+
traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event, true);
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
function accumulateDispatches(inst, _ignoredDirection, event) {
|
|
1673
|
+
if (inst && event && event.dispatchConfig.registrationName) {
|
|
1674
|
+
const registrationName = event.dispatchConfig.registrationName;
|
|
1675
|
+
const listener = getListener(inst, registrationName);
|
|
1676
|
+
if (listener) {
|
|
1677
|
+
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
|
|
1678
|
+
event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
function accumulateDirectDispatchesSingle(event) {
|
|
1683
|
+
if (event && event.dispatchConfig.registrationName) {
|
|
1684
|
+
accumulateDispatches(event._targetInst, null, event);
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
function accumulateDirectDispatches(events) {
|
|
1688
|
+
forEachAccumulated(events, accumulateDirectDispatchesSingle);
|
|
1689
|
+
}
|
|
1690
|
+
var ReactNativeBridgeEventPlugin = {
|
|
1691
|
+
eventTypes: {},
|
|
1692
|
+
extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
|
1693
|
+
if (targetInst == null) {
|
|
1694
|
+
return null;
|
|
1695
|
+
}
|
|
1696
|
+
const bubbleDispatchConfig = customBubblingEventTypes[topLevelType];
|
|
1697
|
+
const directDispatchConfig = customDirectEventTypes[topLevelType];
|
|
1698
|
+
if (!bubbleDispatchConfig && !directDispatchConfig) {
|
|
1699
|
+
throw new Error(`Unsupported top level event type "${topLevelType}" dispatched`);
|
|
1700
|
+
}
|
|
1701
|
+
const event = SyntheticEvent.getPooled(bubbleDispatchConfig || directDispatchConfig, targetInst, nativeEvent, nativeEventTarget);
|
|
1702
|
+
if (bubbleDispatchConfig) {
|
|
1703
|
+
const skipBubbling = event != null && event.dispatchConfig.phasedRegistrationNames != null && event.dispatchConfig.phasedRegistrationNames.skipBubbling;
|
|
1704
|
+
if (skipBubbling) {
|
|
1705
|
+
accumulateCapturePhaseDispatches(event);
|
|
1706
|
+
} else {
|
|
1707
|
+
accumulateTwoPhaseDispatches(event);
|
|
1708
|
+
}
|
|
1709
|
+
} else if (directDispatchConfig) {
|
|
1710
|
+
accumulateDirectDispatches(event);
|
|
1711
|
+
} else {
|
|
1712
|
+
return null;
|
|
1713
|
+
}
|
|
1714
|
+
return event;
|
|
1715
|
+
}
|
|
1716
|
+
};
|
|
1717
|
+
function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
|
1718
|
+
let events = null;
|
|
1719
|
+
for (let i = 0;i < legacyPlugins.length; i++) {
|
|
1720
|
+
const plugin = legacyPlugins[i];
|
|
1721
|
+
if (plugin) {
|
|
1722
|
+
const extractedEvents = plugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
|
|
1723
|
+
if (extractedEvents) {
|
|
1724
|
+
events = accumulateInto(events, extractedEvents);
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
return events;
|
|
1729
|
+
}
|
|
1730
|
+
function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
|
1731
|
+
const events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
|
|
1732
|
+
runEventsInBatch(events);
|
|
1733
|
+
}
|
|
1734
|
+
function ensureLegacyEventPluginsInjected() {
|
|
1735
|
+
try {
|
|
1736
|
+
injectEventPluginOrder(ReactNativeEventPluginOrder);
|
|
1737
|
+
} catch (error) {
|
|
1738
|
+
if (!String(error).includes("Cannot inject event plugin ordering more than once")) {
|
|
1739
|
+
throw error;
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
injectEventPluginsByName({
|
|
1743
|
+
ResponderEventPlugin,
|
|
1744
|
+
ReactNativeBridgeEventPlugin
|
|
1745
|
+
});
|
|
1746
|
+
setComponentTree((instance) => instance?.canonical?.currentProps ?? null, (node) => {
|
|
1747
|
+
if (node?.canonical != null && node.canonical.internalInstanceHandle != null) {
|
|
1748
|
+
return node.canonical.internalInstanceHandle;
|
|
1749
|
+
}
|
|
1750
|
+
return node ?? null;
|
|
1751
|
+
}, (fiber) => {
|
|
1752
|
+
const publicInstance = getPublicInstance(fiber.stateNode);
|
|
1753
|
+
if (publicInstance == null) {
|
|
1754
|
+
throw new Error("Could not find host instance from fiber");
|
|
1755
|
+
}
|
|
1756
|
+
return publicInstance;
|
|
1757
|
+
});
|
|
1758
|
+
ResponderEventPlugin.injection.injectGlobalResponderHandler(ReactFabricGlobalResponderHandler);
|
|
1759
|
+
}
|
|
1760
|
+
ensureLegacyEventPluginsInjected();
|
|
1761
|
+
function dispatchEvent(target, topLevelType, nativeEvent) {
|
|
1762
|
+
const targetFiber = target;
|
|
1763
|
+
let eventTarget = null;
|
|
1764
|
+
if (targetFiber != null) {
|
|
1765
|
+
const stateNode = targetFiber.stateNode;
|
|
1766
|
+
if (stateNode != null) {
|
|
1767
|
+
eventTarget = getPublicInstance(stateNode);
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
batchedUpdates(() => {
|
|
1771
|
+
runExtractedPluginEventsInBatch(topLevelType, targetFiber, nativeEvent, eventTarget);
|
|
1772
|
+
});
|
|
1773
|
+
}
|
|
1774
|
+
global.handleEvent = dispatchEvent;
|
|
1775
|
+
global.nextReactTag = 200000000;
|
|
1776
|
+
var HostConfig = {
|
|
1777
|
+
now: performance.now,
|
|
1778
|
+
getRootHostContext(rootContainerInstance) {
|
|
1779
|
+
return global.rootHostContext;
|
|
1780
|
+
},
|
|
1781
|
+
getChildHostContext() {
|
|
1782
|
+
return global.childHostContext;
|
|
1783
|
+
},
|
|
1784
|
+
supportsPersistence: true,
|
|
1785
|
+
createInstance: (type, props, rootContainerInstance, _currentHostContext, workInProgress) => {
|
|
1786
|
+
const tag = global.nextReactTag;
|
|
1787
|
+
global.nextReactTag += 2;
|
|
1788
|
+
const viewConfig = ReactNativeViewConfigRegistry.get(type);
|
|
1789
|
+
const updatePayload = createAttributePayload(props, viewConfig.validAttributes);
|
|
1790
|
+
let node;
|
|
1791
|
+
try {
|
|
1792
|
+
node = uiManager.createNode(tag, viewConfig.uiViewClassName, rootContainerInstance.containerTag, updatePayload, workInProgress);
|
|
1793
|
+
} catch (e) {
|
|
1794
|
+
nativeLog("[createInstance] ERROR in createNode:", e.message || String(e));
|
|
1795
|
+
nativeLog("Stack:", new Error().stack);
|
|
1796
|
+
throw e;
|
|
1797
|
+
}
|
|
1798
|
+
return {
|
|
1799
|
+
node,
|
|
1800
|
+
canonical: {
|
|
1801
|
+
nativeTag: tag,
|
|
1802
|
+
viewConfig,
|
|
1803
|
+
currentProps: props,
|
|
1804
|
+
internalInstanceHandle: workInProgress,
|
|
1805
|
+
publicInstance: null,
|
|
1806
|
+
publicRootInstance: rootContainerInstance.publicInstance
|
|
1807
|
+
}
|
|
1808
|
+
};
|
|
1809
|
+
},
|
|
1810
|
+
finalizeInitialChildren(parentInstance, type, props, hostContext) {
|
|
1811
|
+
return false;
|
|
1812
|
+
},
|
|
1813
|
+
cloneInstance(instance, type, oldProps, newProps, keepChildren, newChildSet) {
|
|
1814
|
+
const viewConfig = instance.canonical.viewConfig;
|
|
1815
|
+
const updatePayload = diffAttributePayloads(oldProps, newProps, viewConfig.validAttributes);
|
|
1816
|
+
instance.canonical.currentProps = newProps;
|
|
1817
|
+
const node = instance.node;
|
|
1818
|
+
let clone;
|
|
1819
|
+
if (keepChildren) {
|
|
1820
|
+
if (updatePayload !== null) {
|
|
1821
|
+
clone = uiManager.cloneNodeWithNewProps(node, updatePayload);
|
|
1822
|
+
} else {
|
|
1823
|
+
return instance;
|
|
1824
|
+
}
|
|
1825
|
+
} else {
|
|
1826
|
+
if (newChildSet != null) {
|
|
1827
|
+
if (updatePayload !== null) {
|
|
1828
|
+
clone = uiManager.cloneNodeWithNewChildrenAndProps(node, newChildSet, updatePayload);
|
|
1829
|
+
} else {
|
|
1830
|
+
clone = uiManager.cloneNodeWithNewChildren(node, newChildSet);
|
|
1831
|
+
}
|
|
1832
|
+
} else {
|
|
1833
|
+
if (updatePayload !== null) {
|
|
1834
|
+
clone = uiManager.cloneNodeWithNewChildrenAndProps(node, updatePayload);
|
|
1835
|
+
} else {
|
|
1836
|
+
clone = uiManager.cloneNodeWithNewChildren(node);
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
return {
|
|
1841
|
+
node: clone,
|
|
1842
|
+
canonical: instance.canonical
|
|
1843
|
+
};
|
|
1844
|
+
},
|
|
1845
|
+
createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
|
|
1846
|
+
const tag = global.nextReactTag;
|
|
1847
|
+
global.nextReactTag += 2;
|
|
1848
|
+
const node = uiManager.createNode(tag, "RCTRawText", rootContainerInstance.containerTag, { text }, internalInstanceHandle);
|
|
1849
|
+
return {
|
|
1850
|
+
node
|
|
1851
|
+
};
|
|
1852
|
+
},
|
|
1853
|
+
createContainerChildSet() {
|
|
1854
|
+
return uiManager.createChildSet();
|
|
1855
|
+
},
|
|
1856
|
+
appendChildToContainerChildSet(childSet, child) {
|
|
1857
|
+
uiManager.appendChildToSet(childSet, child.node);
|
|
1858
|
+
},
|
|
1859
|
+
finalizeContainerChildren(container, newChildren) {},
|
|
1860
|
+
appendInitialChild(parentInstance, child) {
|
|
1861
|
+
uiManager.appendChild(parentInstance.node, child.node);
|
|
1862
|
+
},
|
|
1863
|
+
replaceContainerChildren(container, newChildren) {
|
|
1864
|
+
const completeRootSync = currentCompleteRootSync;
|
|
1865
|
+
if (completeRootSync == null) {
|
|
1866
|
+
throw new Error("completeRootSync callback is required.");
|
|
1867
|
+
}
|
|
1868
|
+
completeRootSync(container.containerTag, newChildren);
|
|
1869
|
+
},
|
|
1870
|
+
setCurrentUpdatePriority(priority) {
|
|
1871
|
+
global.currentUpdatePriority = priority;
|
|
1872
|
+
},
|
|
1873
|
+
getCurrentUpdatePriority() {
|
|
1874
|
+
return global.currentUpdatePriority;
|
|
1875
|
+
},
|
|
1876
|
+
resolveUpdatePriority() {
|
|
1877
|
+
if (global.currentUpdatePriority !== NoEventPriority) {
|
|
1878
|
+
return global.currentUpdatePriority;
|
|
1879
|
+
} else {
|
|
1880
|
+
return DefaultEventPriority;
|
|
1881
|
+
}
|
|
1882
|
+
},
|
|
1883
|
+
getPublicInstance(instance) {
|
|
1884
|
+
return getPublicInstance(instance);
|
|
1885
|
+
},
|
|
1886
|
+
prepareForCommit(containerInfo) {
|
|
1887
|
+
return null;
|
|
1888
|
+
},
|
|
1889
|
+
resetAfterCommit(containerInfo) {},
|
|
1890
|
+
trackSchedulerEvent() {},
|
|
1891
|
+
resolveEventType() {
|
|
1892
|
+
return null;
|
|
1893
|
+
},
|
|
1894
|
+
resolveEventTimeStamp() {
|
|
1895
|
+
return -1.1;
|
|
1896
|
+
},
|
|
1897
|
+
shouldAttemptEagerTransition() {
|
|
1898
|
+
return false;
|
|
1899
|
+
},
|
|
1900
|
+
shouldSetTextContent(type, props) {
|
|
1901
|
+
return false;
|
|
1902
|
+
},
|
|
1903
|
+
supportsMicrotasks: false,
|
|
1904
|
+
detachDeletedInstance(node) {},
|
|
1905
|
+
beforeActiveInstanceBlur(internalInstanceHandle) {},
|
|
1906
|
+
afterActiveInstanceBlur() {},
|
|
1907
|
+
preparePortalMount(portalInstance) {},
|
|
1908
|
+
detachDeletedInstance(node) {},
|
|
1909
|
+
requestPostPaintCallback(callback) {},
|
|
1910
|
+
maySuspendCommit(type, props) {
|
|
1911
|
+
return false;
|
|
1912
|
+
},
|
|
1913
|
+
maySuspendCommitOnUpdate(type, oldProps, newProps) {
|
|
1914
|
+
return false;
|
|
1915
|
+
},
|
|
1916
|
+
maySuspendCommitInSyncRender(type, props) {
|
|
1917
|
+
return false;
|
|
1918
|
+
},
|
|
1919
|
+
preloadInstance(instance, type, props) {
|
|
1920
|
+
return true;
|
|
1921
|
+
},
|
|
1922
|
+
startSuspendingCommit() {
|
|
1923
|
+
return null;
|
|
1924
|
+
},
|
|
1925
|
+
suspendInstance(state, instance, type, props) {},
|
|
1926
|
+
suspendOnActiveViewTransition(state, container) {},
|
|
1927
|
+
waitForCommitToBeReady(state, timeoutOffset) {
|
|
1928
|
+
return null;
|
|
1929
|
+
},
|
|
1930
|
+
getSuspendedCommitReason(state, rootContainer) {
|
|
1931
|
+
return null;
|
|
1932
|
+
},
|
|
1933
|
+
isPrimaryRenderer: false
|
|
1934
|
+
};
|
|
1935
|
+
var Renderer = Reconciler(HostConfig);
|
|
1936
|
+
global.React = require("react");
|
|
1937
|
+
function createRootContainer(surfaceId) {
|
|
1938
|
+
const rootInstance = {
|
|
1939
|
+
containerTag: surfaceId,
|
|
1940
|
+
publicInstance: null
|
|
1941
|
+
};
|
|
1942
|
+
return Renderer.createContainer(rootInstance, 0, null, false, null, "ui-renderer-" + surfaceId, function onUncaughtError(error, info) {
|
|
1943
|
+
nativeLog("[Error][ReactFabricMirror] Uncaught error in React renderer: ", error, info);
|
|
1944
|
+
}, function onCaughtError(error, info) {
|
|
1945
|
+
nativeLog("[Error][ReactFabricMirror] Caught error in React renderer: ", error, info);
|
|
1946
|
+
}, function onRecoverableError(error, info) {
|
|
1947
|
+
nativeLog("[Error][ReactFabricMirror] Recoverable error in React renderer: ", error, info);
|
|
1948
|
+
}, function nativeOnDefaultTransitionIndicator() {});
|
|
1949
|
+
}
|
|
1950
|
+
function getRootContainer(surfaceId) {
|
|
1951
|
+
let rootContainer = global.rootContainersBySurfaceId[surfaceId];
|
|
1952
|
+
if (rootContainer == null) {
|
|
1953
|
+
rootContainer = createRootContainer(surfaceId);
|
|
1954
|
+
global.rootContainersBySurfaceId[surfaceId] = rootContainer;
|
|
1955
|
+
}
|
|
1956
|
+
return rootContainer;
|
|
1957
|
+
}
|
|
1958
|
+
function reactRender(surfaceId, element, callback, completeRootSync) {
|
|
1959
|
+
const rootContainer = getRootContainer(surfaceId);
|
|
1960
|
+
const previousCompleteRootSync = currentCompleteRootSync;
|
|
1961
|
+
currentCompleteRootSync = completeRootSync ?? null;
|
|
1962
|
+
try {
|
|
1963
|
+
Renderer.updateContainerSync(element, rootContainer, null, callback);
|
|
1964
|
+
Renderer.flushSyncWork();
|
|
1965
|
+
} finally {
|
|
1966
|
+
currentCompleteRootSync = previousCompleteRootSync;
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
function disposeReactRoot(surfaceId, completeRootSync) {
|
|
1970
|
+
const rootContainer = global.rootContainersBySurfaceId[surfaceId];
|
|
1971
|
+
if (rootContainer == null) {
|
|
1972
|
+
return;
|
|
1973
|
+
}
|
|
1974
|
+
const previousCompleteRootSync = currentCompleteRootSync;
|
|
1975
|
+
currentCompleteRootSync = completeRootSync;
|
|
1976
|
+
try {
|
|
1977
|
+
Renderer.updateContainerSync(null, rootContainer, null, null);
|
|
1978
|
+
Renderer.flushSyncWork();
|
|
1979
|
+
delete global.rootContainersBySurfaceId[surfaceId];
|
|
1980
|
+
} finally {
|
|
1981
|
+
currentCompleteRootSync = previousCompleteRootSync;
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
nativeLog("[ReactFabricMirror] ReactFabricMirror initialized");
|