@leonsilicon/react-native-wishlist 0.0.0
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/LICENSE +20 -0
- package/MGWishList.podspec +40 -0
- package/README.md +281 -0
- package/android/CMakeLists.txt +86 -0
- package/android/build.gradle +72 -0
- package/android/gradle.properties +5 -0
- package/android/spotless.gradle +24 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/wishlist/ContentContainer.kt +22 -0
- package/android/src/main/java/com/wishlist/Orchestrator.kt +38 -0
- package/android/src/main/java/com/wishlist/TemplateContainer.kt +30 -0
- package/android/src/main/java/com/wishlist/TemplateContainerViewManager.kt +65 -0
- package/android/src/main/java/com/wishlist/TemplateInterceptor.kt +29 -0
- package/android/src/main/java/com/wishlist/TemplateInterceptorViewManager.kt +23 -0
- package/android/src/main/java/com/wishlist/UIScheduler.kt +15 -0
- package/android/src/main/java/com/wishlist/Wishlist.kt +135 -0
- package/android/src/main/java/com/wishlist/WishlistManagerModule.kt +51 -0
- package/android/src/main/java/com/wishlist/WishlistPackage.kt +47 -0
- package/android/src/main/java/com/wishlist/WishlistSoLoader.kt +17 -0
- package/android/src/main/java/com/wishlist/WishlistViewManager.kt +69 -0
- package/android/src/main/jni/ErrorHandlerAndroid.cpp +16 -0
- package/android/src/main/jni/ErrorHandlerAndroid.h +13 -0
- package/android/src/main/jni/JNIStateRegistry.cpp +22 -0
- package/android/src/main/jni/JNIStateRegistry.h +23 -0
- package/android/src/main/jni/OnLoad.cpp +12 -0
- package/android/src/main/jni/Orchestrator.cpp +167 -0
- package/android/src/main/jni/Orchestrator.hpp +78 -0
- package/android/src/main/jni/UISchedulerAndroid.cpp +20 -0
- package/android/src/main/jni/UISchedulerAndroid.h +18 -0
- package/android/src/main/jni/WishlistManagerModule.cpp +91 -0
- package/android/src/main/jni/WishlistManagerModule.hpp +43 -0
- package/android/src/main/jni/wishlist.h +19 -0
- package/cpp/ContentContainer/MGContentContainerComponentDescriptor.h +40 -0
- package/cpp/ContentContainer/MGContentContainerShadowNode.cpp +21 -0
- package/cpp/ContentContainer/MGContentContainerShadowNode.h +30 -0
- package/cpp/ContentContainer/MGContentContainerState.cpp +31 -0
- package/cpp/ContentContainer/MGContentContainerState.h +39 -0
- package/cpp/DataBinding/MGBindingProvider.hpp +21 -0
- package/cpp/DataBinding/MGDataBinding.hpp +23 -0
- package/cpp/DataBinding/MGDataBindingImpl.cpp +112 -0
- package/cpp/DataBinding/MGDataBindingImpl.hpp +35 -0
- package/cpp/DependencyInjection/MGDI.hpp +33 -0
- package/cpp/DependencyInjection/MGDIImpl.cpp +65 -0
- package/cpp/DependencyInjection/MGDIImpl.hpp +45 -0
- package/cpp/DependencyInjection/MGUIManagerHolder.cpp +21 -0
- package/cpp/DependencyInjection/MGUIManagerHolder.h +24 -0
- package/cpp/ItemProvider/ComponentsPool.cpp +91 -0
- package/cpp/ItemProvider/ComponentsPool.h +49 -0
- package/cpp/ItemProvider/ItemProvider.cpp +60 -0
- package/cpp/ItemProvider/ItemProvider.h +67 -0
- package/cpp/ItemProvider/ShadowNodeBinding.cpp +356 -0
- package/cpp/ItemProvider/ShadowNodeBinding.h +59 -0
- package/cpp/ItemProvider/ShadowNodeCopyMachine.cpp +95 -0
- package/cpp/ItemProvider/ShadowNodeCopyMachine.h +25 -0
- package/cpp/MGErrorHandler.h +12 -0
- package/cpp/MGViewportCarer/MGVSyncRequester.hpp +18 -0
- package/cpp/MGViewportCarer/MGViewportCarer.hpp +42 -0
- package/cpp/MGViewportCarer/MGViewportCarerImpl.cpp +453 -0
- package/cpp/MGViewportCarer/MGViewportCarerImpl.h +80 -0
- package/cpp/MGViewportCarer/MGViewportCarerListener.hpp +27 -0
- package/cpp/TemplateContainer/MGTemplateContainerComponentDescriptor.h +15 -0
- package/cpp/TemplateContainer/MGTemplateContainerShadowNode.cpp +43 -0
- package/cpp/TemplateContainer/MGTemplateContainerShadowNode.h +42 -0
- package/cpp/TemplateContainer/MGTemplateContainerState.cpp +37 -0
- package/cpp/TemplateContainer/MGTemplateContainerState.h +39 -0
- package/cpp/UIScheduler/MGUIScheduler.cpp +8 -0
- package/cpp/UIScheduler/MGUIScheduler.hpp +18 -0
- package/cpp/Wishlist/MGWishlistComponentDescriptor.h +14 -0
- package/cpp/Wishlist/MGWishlistShadowNode.cpp +49 -0
- package/cpp/Wishlist/MGWishlistShadowNode.h +37 -0
- package/cpp/Wishlist/MGWishlistState.cpp +57 -0
- package/cpp/Wishlist/MGWishlistState.h +42 -0
- package/cpp/WishlistDefine.h +3 -0
- package/cpp/WishlistJsRuntime.cpp +139 -0
- package/cpp/WishlistJsRuntime.h +59 -0
- package/ios/MGContentContainerComponent.h +9 -0
- package/ios/MGContentContainerComponent.mm +34 -0
- package/ios/MGErrorHandlerIOS.h +13 -0
- package/ios/MGErrorHandlerIOS.mm +12 -0
- package/ios/MGObjCJSIUtils.h +63 -0
- package/ios/MGTemplateContainerComponent.h +12 -0
- package/ios/MGTemplateContainerComponent.mm +105 -0
- package/ios/MGTemplateInterceptorComponent.h +9 -0
- package/ios/MGTemplateInterceptorComponent.mm +72 -0
- package/ios/MGWishListComponent.h +17 -0
- package/ios/MGWishListComponent.mm +187 -0
- package/ios/MGWishlistManager.h +21 -0
- package/ios/MGWishlistManager.mm +319 -0
- package/ios/MGWishlistQueue.h +11 -0
- package/ios/MGWishlistQueue.m +34 -0
- package/ios/Orchestrator/MGOrchestrator.h +35 -0
- package/ios/Orchestrator/MGOrchestrator.mm +139 -0
- package/ios/Orchestrator/MGOrchestratorCppAdapter.cpp +25 -0
- package/ios/Orchestrator/MGOrchestratorCppAdapter.hpp +32 -0
- package/ios/UIScheduleriOS/MGUIScheduleriOS.hpp +19 -0
- package/ios/UIScheduleriOS/MGUIScheduleriOS.mm +21 -0
- package/lib/commonjs/Colors.js +399 -0
- package/lib/commonjs/Colors.js.map +1 -0
- package/lib/commonjs/ComponentPool.js +28 -0
- package/lib/commonjs/ComponentPool.js.map +1 -0
- package/lib/commonjs/Components/ForEach.js +21 -0
- package/lib/commonjs/Components/ForEach.js.map +1 -0
- package/lib/commonjs/Components/ForEachBase.js +19 -0
- package/lib/commonjs/Components/ForEachBase.js.map +1 -0
- package/lib/commonjs/Components/IF.js +34 -0
- package/lib/commonjs/Components/IF.js.map +1 -0
- package/lib/commonjs/Components/Pressable.js +73 -0
- package/lib/commonjs/Components/Pressable.js.map +1 -0
- package/lib/commonjs/Components/Switch.js +52 -0
- package/lib/commonjs/Components/Switch.js.map +1 -0
- package/lib/commonjs/Components/WishlistImage.js +29 -0
- package/lib/commonjs/Components/WishlistImage.js.map +1 -0
- package/lib/commonjs/Components/WishlistText.js +24 -0
- package/lib/commonjs/Components/WishlistText.js.map +1 -0
- package/lib/commonjs/Components/WishlistView.js +10 -0
- package/lib/commonjs/Components/WishlistView.js.map +1 -0
- package/lib/commonjs/EventHandler.js +72 -0
- package/lib/commonjs/EventHandler.js.map +1 -0
- package/lib/commonjs/InflatorRepository.js +155 -0
- package/lib/commonjs/InflatorRepository.js.map +1 -0
- package/lib/commonjs/OrchestratorBinding.js +12 -0
- package/lib/commonjs/OrchestratorBinding.js.map +1 -0
- package/lib/commonjs/Specs/NativeContentContainer.js +12 -0
- package/lib/commonjs/Specs/NativeContentContainer.js.map +1 -0
- package/lib/commonjs/Specs/NativeTemplateContainer.js +12 -0
- package/lib/commonjs/Specs/NativeTemplateContainer.js.map +1 -0
- package/lib/commonjs/Specs/NativeTemplateInterceptor.js +10 -0
- package/lib/commonjs/Specs/NativeTemplateInterceptor.js.map +1 -0
- package/lib/commonjs/Specs/NativeWishlist.js +16 -0
- package/lib/commonjs/Specs/NativeWishlist.js.map +1 -0
- package/lib/commonjs/Specs/NativeWishlistManager.js +9 -0
- package/lib/commonjs/Specs/NativeWishlistManager.js.map +1 -0
- package/lib/commonjs/TemplateContext.js +17 -0
- package/lib/commonjs/TemplateContext.js.map +1 -0
- package/lib/commonjs/TemplateItem.js +2 -0
- package/lib/commonjs/TemplateItem.js.map +1 -0
- package/lib/commonjs/TemplateValue.js +68 -0
- package/lib/commonjs/TemplateValue.js.map +1 -0
- package/lib/commonjs/Utils.js +20 -0
- package/lib/commonjs/Utils.js.map +1 -0
- package/lib/commonjs/Wishlist.js +290 -0
- package/lib/commonjs/Wishlist.js.map +1 -0
- package/lib/commonjs/WishlistContext.js +17 -0
- package/lib/commonjs/WishlistContext.js.map +1 -0
- package/lib/commonjs/WishlistData.js +149 -0
- package/lib/commonjs/WishlistData.js.map +1 -0
- package/lib/commonjs/WishlistDataCopy.js +115 -0
- package/lib/commonjs/WishlistDataCopy.js.map +1 -0
- package/lib/commonjs/WishlistJsRuntime.android.js +22 -0
- package/lib/commonjs/WishlistJsRuntime.android.js.map +1 -0
- package/lib/commonjs/WishlistJsRuntime.js +42 -0
- package/lib/commonjs/WishlistJsRuntime.js.map +1 -0
- package/lib/commonjs/createTemplateComponent.js +196 -0
- package/lib/commonjs/createTemplateComponent.js.map +1 -0
- package/lib/commonjs/global.d.js +2 -0
- package/lib/commonjs/global.d.js.map +1 -0
- package/lib/commonjs/index.js +83 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/renderTemplate.js +14 -0
- package/lib/commonjs/renderTemplate.js.map +1 -0
- package/lib/module/Colors.js +395 -0
- package/lib/module/Colors.js.map +1 -0
- package/lib/module/ComponentPool.js +24 -0
- package/lib/module/ComponentPool.js.map +1 -0
- package/lib/module/Components/ForEach.js +17 -0
- package/lib/module/Components/ForEach.js.map +1 -0
- package/lib/module/Components/ForEachBase.js +14 -0
- package/lib/module/Components/ForEachBase.js.map +1 -0
- package/lib/module/Components/IF.js +29 -0
- package/lib/module/Components/IF.js.map +1 -0
- package/lib/module/Components/Pressable.js +68 -0
- package/lib/module/Components/Pressable.js.map +1 -0
- package/lib/module/Components/Switch.js +45 -0
- package/lib/module/Components/Switch.js.map +1 -0
- package/lib/module/Components/WishlistImage.js +25 -0
- package/lib/module/Components/WishlistImage.js.map +1 -0
- package/lib/module/Components/WishlistText.js +20 -0
- package/lib/module/Components/WishlistText.js.map +1 -0
- package/lib/module/Components/WishlistView.js +6 -0
- package/lib/module/Components/WishlistView.js.map +1 -0
- package/lib/module/EventHandler.js +66 -0
- package/lib/module/EventHandler.js.map +1 -0
- package/lib/module/InflatorRepository.js +149 -0
- package/lib/module/InflatorRepository.js.map +1 -0
- package/lib/module/OrchestratorBinding.js +8 -0
- package/lib/module/OrchestratorBinding.js.map +1 -0
- package/lib/module/Specs/NativeContentContainer.js +7 -0
- package/lib/module/Specs/NativeContentContainer.js.map +1 -0
- package/lib/module/Specs/NativeTemplateContainer.js +7 -0
- package/lib/module/Specs/NativeTemplateContainer.js.map +1 -0
- package/lib/module/Specs/NativeTemplateInterceptor.js +5 -0
- package/lib/module/Specs/NativeTemplateInterceptor.js.map +1 -0
- package/lib/module/Specs/NativeWishlist.js +11 -0
- package/lib/module/Specs/NativeWishlist.js.map +1 -0
- package/lib/module/Specs/NativeWishlistManager.js +5 -0
- package/lib/module/Specs/NativeWishlistManager.js.map +1 -0
- package/lib/module/TemplateContext.js +12 -0
- package/lib/module/TemplateContext.js.map +1 -0
- package/lib/module/TemplateItem.js +2 -0
- package/lib/module/TemplateItem.js.map +1 -0
- package/lib/module/TemplateValue.js +63 -0
- package/lib/module/TemplateValue.js.map +1 -0
- package/lib/module/Utils.js +15 -0
- package/lib/module/Utils.js.map +1 -0
- package/lib/module/Wishlist.js +284 -0
- package/lib/module/Wishlist.js.map +1 -0
- package/lib/module/WishlistContext.js +12 -0
- package/lib/module/WishlistContext.js.map +1 -0
- package/lib/module/WishlistData.js +144 -0
- package/lib/module/WishlistData.js.map +1 -0
- package/lib/module/WishlistDataCopy.js +111 -0
- package/lib/module/WishlistDataCopy.js.map +1 -0
- package/lib/module/WishlistJsRuntime.android.js +16 -0
- package/lib/module/WishlistJsRuntime.android.js.map +1 -0
- package/lib/module/WishlistJsRuntime.js +35 -0
- package/lib/module/WishlistJsRuntime.js.map +1 -0
- package/lib/module/createTemplateComponent.js +191 -0
- package/lib/module/createTemplateComponent.js.map +1 -0
- package/lib/module/global.d.js +2 -0
- package/lib/module/global.d.js.map +1 -0
- package/lib/module/index.js +14 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/renderTemplate.js +10 -0
- package/lib/module/renderTemplate.js.map +1 -0
- package/lib/typescript/Colors.d.ts +7 -0
- package/lib/typescript/Colors.d.ts.map +1 -0
- package/lib/typescript/ComponentPool.d.ts +10 -0
- package/lib/typescript/ComponentPool.d.ts.map +1 -0
- package/lib/typescript/Components/ForEach.d.ts +2 -0
- package/lib/typescript/Components/ForEach.d.ts.map +1 -0
- package/lib/typescript/Components/ForEachBase.d.ts +3 -0
- package/lib/typescript/Components/ForEachBase.d.ts.map +1 -0
- package/lib/typescript/Components/IF.d.ts +3 -0
- package/lib/typescript/Components/IF.d.ts.map +1 -0
- package/lib/typescript/Components/Pressable.d.ts +15 -0
- package/lib/typescript/Components/Pressable.d.ts.map +1 -0
- package/lib/typescript/Components/Switch.d.ts +17 -0
- package/lib/typescript/Components/Switch.d.ts.map +1 -0
- package/lib/typescript/Components/WishlistImage.d.ts +3 -0
- package/lib/typescript/Components/WishlistImage.d.ts.map +1 -0
- package/lib/typescript/Components/WishlistText.d.ts +3 -0
- package/lib/typescript/Components/WishlistText.d.ts.map +1 -0
- package/lib/typescript/Components/WishlistView.d.ts +3 -0
- package/lib/typescript/Components/WishlistView.d.ts.map +1 -0
- package/lib/typescript/EventHandler.d.ts +9 -0
- package/lib/typescript/EventHandler.d.ts.map +1 -0
- package/lib/typescript/InflatorRepository.d.ts +28 -0
- package/lib/typescript/InflatorRepository.d.ts.map +1 -0
- package/lib/typescript/OrchestratorBinding.d.ts +13 -0
- package/lib/typescript/OrchestratorBinding.d.ts.map +1 -0
- package/lib/typescript/Specs/NativeContentContainer.d.ts +6 -0
- package/lib/typescript/Specs/NativeContentContainer.d.ts.map +1 -0
- package/lib/typescript/Specs/NativeTemplateContainer.d.ts +9 -0
- package/lib/typescript/Specs/NativeTemplateContainer.d.ts.map +1 -0
- package/lib/typescript/Specs/NativeTemplateInterceptor.d.ts +6 -0
- package/lib/typescript/Specs/NativeTemplateInterceptor.d.ts.map +1 -0
- package/lib/typescript/Specs/NativeWishlist.d.ts +22 -0
- package/lib/typescript/Specs/NativeWishlist.d.ts.map +1 -0
- package/lib/typescript/Specs/NativeWishlistManager.d.ts +7 -0
- package/lib/typescript/Specs/NativeWishlistManager.d.ts.map +1 -0
- package/lib/typescript/TemplateContext.d.ts +9 -0
- package/lib/typescript/TemplateContext.d.ts.map +1 -0
- package/lib/typescript/TemplateItem.d.ts +13 -0
- package/lib/typescript/TemplateItem.d.ts.map +1 -0
- package/lib/typescript/TemplateValue.d.ts +16 -0
- package/lib/typescript/TemplateValue.d.ts.map +1 -0
- package/lib/typescript/Utils.d.ts +3 -0
- package/lib/typescript/Utils.d.ts.map +1 -0
- package/lib/typescript/Wishlist.d.ts +59 -0
- package/lib/typescript/Wishlist.d.ts.map +1 -0
- package/lib/typescript/WishlistContext.d.ts +11 -0
- package/lib/typescript/WishlistContext.d.ts.map +1 -0
- package/lib/typescript/WishlistData.d.ts +20 -0
- package/lib/typescript/WishlistData.d.ts.map +1 -0
- package/lib/typescript/WishlistDataCopy.d.ts +25 -0
- package/lib/typescript/WishlistDataCopy.d.ts.map +1 -0
- package/lib/typescript/WishlistJsRuntime.android.d.ts +4 -0
- package/lib/typescript/WishlistJsRuntime.android.d.ts.map +1 -0
- package/lib/typescript/WishlistJsRuntime.d.ts +6 -0
- package/lib/typescript/WishlistJsRuntime.d.ts.map +1 -0
- package/lib/typescript/createTemplateComponent.d.ts +35 -0
- package/lib/typescript/createTemplateComponent.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +8 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/renderTemplate.d.ts +3 -0
- package/lib/typescript/renderTemplate.d.ts.map +1 -0
- package/package.json +195 -0
- package/src/Colors.ts +474 -0
- package/src/ComponentPool.ts +33 -0
- package/src/Components/ForEach.tsx +22 -0
- package/src/Components/ForEachBase.tsx +8 -0
- package/src/Components/IF.tsx +20 -0
- package/src/Components/Pressable.tsx +111 -0
- package/src/Components/Switch.tsx +49 -0
- package/src/Components/WishlistImage.tsx +25 -0
- package/src/Components/WishlistText.tsx +14 -0
- package/src/Components/WishlistView.tsx +4 -0
- package/src/EventHandler.ts +78 -0
- package/src/InflatorRepository.ts +231 -0
- package/src/OrchestratorBinding.ts +15 -0
- package/src/Specs/NativeContentContainer.ts +9 -0
- package/src/Specs/NativeTemplateContainer.ts +13 -0
- package/src/Specs/NativeTemplateInterceptor.ts +8 -0
- package/src/Specs/NativeWishlist.ts +42 -0
- package/src/Specs/NativeWishlistManager.ts +7 -0
- package/src/TemplateContext.tsx +14 -0
- package/src/TemplateItem.ts +15 -0
- package/src/TemplateValue.tsx +101 -0
- package/src/Utils.ts +15 -0
- package/src/Wishlist.tsx +417 -0
- package/src/WishlistContext.tsx +15 -0
- package/src/WishlistData.ts +179 -0
- package/src/WishlistDataCopy.ts +138 -0
- package/src/WishlistJsRuntime.android.ts +20 -0
- package/src/WishlistJsRuntime.ts +59 -0
- package/src/createTemplateComponent.tsx +263 -0
- package/src/global.d.ts +1 -0
- package/src/index.ts +17 -0
- package/src/renderTemplate.ts +22 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Image, Platform } from 'react-native';
|
|
4
|
+
import { createTemplateComponent } from '../createTemplateComponent';
|
|
5
|
+
export const WishlistImage = createTemplateComponent(Image, {
|
|
6
|
+
addProps: (item, props) => {
|
|
7
|
+
'worklet';
|
|
8
|
+
|
|
9
|
+
if (Platform.OS === 'android') {
|
|
10
|
+
const {
|
|
11
|
+
source,
|
|
12
|
+
...rest
|
|
13
|
+
} = props;
|
|
14
|
+
const src = source != null && !Array.isArray(source) ? [source] : source;
|
|
15
|
+
item.addProps({
|
|
16
|
+
src,
|
|
17
|
+
...rest
|
|
18
|
+
});
|
|
19
|
+
} else {
|
|
20
|
+
item.addProps(props);
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
additionalTemplateProps: ['style.borderRadius', 'style.borderTopLeftRadius', 'style.borderTopRightRadius', 'style.borderBottomLeftRadius', 'style.borderBottomRightRadius']
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=WishlistImage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Image","Platform","createTemplateComponent","WishlistImage","addProps","item","props","OS","source","rest","src","Array","isArray","additionalTemplateProps"],"sourceRoot":"../../../src","sources":["Components/WishlistImage.tsx"],"mappings":";;AAAA,SAASA,KAAK,EAAEC,QAAQ,QAAQ,cAAc;AAC9C,SAASC,uBAAuB,QAAQ,4BAA4B;AAEpE,OAAO,MAAMC,aAAa,GAAGD,uBAAuB,CAACF,KAAK,EAAE;EAC1DI,QAAQ,EAAEA,CAACC,IAAI,EAAEC,KAAK,KAAK;IACzB,SAAS;;IACT,IAAIL,QAAQ,CAACM,EAAE,KAAK,SAAS,EAAE;MAC7B,MAAM;QAAEC,MAAM;QAAE,GAAGC;MAAK,CAAC,GAAGH,KAAK;MACjC,MAAMI,GAAG,GAAGF,MAAM,IAAI,IAAI,IAAI,CAACG,KAAK,CAACC,OAAO,CAACJ,MAAM,CAAC,GAAG,CAACA,MAAM,CAAC,GAAGA,MAAM;MACxEH,IAAI,CAACD,QAAQ,CAAC;QACZM,GAAG;QACH,GAAGD;MACL,CAAC,CAAC;IACJ,CAAC,MAAM;MACLJ,IAAI,CAACD,QAAQ,CAACE,KAAK,CAAC;IACtB;EACF,CAAC;EACDO,uBAAuB,EAAE,CACvB,oBAAoB,EACpB,2BAA2B,EAC3B,4BAA4B,EAC5B,8BAA8B,EAC9B,+BAA+B;AAEnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Text } from 'react-native';
|
|
4
|
+
import { createTemplateComponent } from '../createTemplateComponent';
|
|
5
|
+
export const WishlistText = createTemplateComponent(Text, {
|
|
6
|
+
addProps: (item, props) => {
|
|
7
|
+
'worklet';
|
|
8
|
+
|
|
9
|
+
const {
|
|
10
|
+
children,
|
|
11
|
+
...other
|
|
12
|
+
} = props;
|
|
13
|
+
const value = typeof children === 'string' ? children : children?.toString();
|
|
14
|
+
item.RawText?.addProps({
|
|
15
|
+
text: value
|
|
16
|
+
});
|
|
17
|
+
item.addProps(other);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=WishlistText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Text","createTemplateComponent","WishlistText","addProps","item","props","children","other","value","toString","RawText","text"],"sourceRoot":"../../../src","sources":["Components/WishlistText.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,uBAAuB,QAAQ,4BAA4B;AAEpE,OAAO,MAAMC,YAAY,GAAGD,uBAAuB,CAACD,IAAI,EAAE;EACxDG,QAAQ,EAAEA,CAACC,IAAI,EAAEC,KAAK,KAAK;IACzB,SAAS;;IAET,MAAM;MAAEC,QAAQ;MAAE,GAAGC;IAAM,CAAC,GAAGF,KAAK;IACpC,MAAMG,KAAK,GACT,OAAOF,QAAQ,KAAK,QAAQ,GAAGA,QAAQ,GAAGA,QAAQ,EAAEG,QAAQ,CAAC,CAAC;IAChEL,IAAI,CAACM,OAAO,EAAEP,QAAQ,CAAC;MAAEQ,IAAI,EAAEH;IAAM,CAAC,CAAC;IACvCJ,IAAI,CAACD,QAAQ,CAACI,KAAK,CAAC;EACtB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","createTemplateComponent","WishlistView"],"sourceRoot":"../../../src","sources":["Components/WishlistView.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,uBAAuB,QAAQ,4BAA4B;AAEpE,OAAO,MAAMC,YAAY,GAAGD,uBAAuB,CAACD,IAAI,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { createRunInWishlistFn } from './WishlistJsRuntime';
|
|
5
|
+
|
|
6
|
+
// Older React Native versions exposed `global.global`. Newer versions only
|
|
7
|
+
// set `global.window` and `global.self`, so the wishlist native code, which
|
|
8
|
+
// reads `global.global.handlers` / `global.global.handleEvent`, needs the
|
|
9
|
+
// alias re-established before any events fire. This must run at module load
|
|
10
|
+
// because the native event observer is registered as soon as the TurboModule
|
|
11
|
+
// loads — before any Wishlist component renders.
|
|
12
|
+
const setupRuntimeGlobals = () => {
|
|
13
|
+
if (global.global === undefined) {
|
|
14
|
+
global.global = global;
|
|
15
|
+
}
|
|
16
|
+
global.handlers = global.handlers ?? {};
|
|
17
|
+
global.handleEvent = (type, tag, event) => {
|
|
18
|
+
const key = tag.toString() + type.replace(/^topOn/, 'on');
|
|
19
|
+
const callback = global.handlers[key];
|
|
20
|
+
if (callback) {
|
|
21
|
+
callback(event);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
setupRuntimeGlobals();
|
|
26
|
+
let done = false;
|
|
27
|
+
const maybeInit = () => {
|
|
28
|
+
if (!done) {
|
|
29
|
+
done = true;
|
|
30
|
+
// Mirror the same setup on the worklets UI runtime — that's where
|
|
31
|
+
// `WishlistJsRuntime` lives natively, so its `handleEvent` lookup happens
|
|
32
|
+
// there.
|
|
33
|
+
createRunInWishlistFn(() => {
|
|
34
|
+
'worklet';
|
|
35
|
+
|
|
36
|
+
if (global.global === undefined) {
|
|
37
|
+
global.global = global;
|
|
38
|
+
}
|
|
39
|
+
global.handlers = global.handlers ?? {};
|
|
40
|
+
global.handleEvent = (type, tag, event) => {
|
|
41
|
+
'worklet';
|
|
42
|
+
|
|
43
|
+
const key = tag.toString() + type.replace(/^topOn/, 'on');
|
|
44
|
+
const callback = global.handlers[key];
|
|
45
|
+
if (callback) {
|
|
46
|
+
callback(event);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
})();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
export class TemplateCallback {
|
|
53
|
+
constructor(worklet, eventName) {
|
|
54
|
+
this.worklet = worklet;
|
|
55
|
+
this.eventName = eventName;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export function useTemplateCallback(worklet, eventName) {
|
|
59
|
+
return useMemo(() => {
|
|
60
|
+
return new TemplateCallback(worklet, eventName);
|
|
61
|
+
}, [worklet, eventName]);
|
|
62
|
+
}
|
|
63
|
+
export function initEventHandler() {
|
|
64
|
+
maybeInit();
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=EventHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useMemo","createRunInWishlistFn","setupRuntimeGlobals","global","undefined","handlers","handleEvent","type","tag","event","key","toString","replace","callback","done","maybeInit","TemplateCallback","constructor","worklet","eventName","useTemplateCallback","initEventHandler"],"sourceRoot":"../../src","sources":["EventHandler.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,qBAAqB,QAAQ,qBAAqB;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EAChC,IAAIC,MAAM,CAACA,MAAM,KAAKC,SAAS,EAAE;IAC/BD,MAAM,CAACA,MAAM,GAAGA,MAAM;EACxB;EACAA,MAAM,CAACE,QAAQ,GAAGF,MAAM,CAACE,QAAQ,IAAI,CAAC,CAAC;EACvCF,MAAM,CAACG,WAAW,GAAG,CAACC,IAAY,EAAEC,GAAW,EAAEC,KAAU,KAAK;IAC9D,MAAMC,GAAG,GAAGF,GAAG,CAACG,QAAQ,CAAC,CAAC,G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;IACnB,OAAO,IAAIgB,gBAAgB,CAACE,OAAO,EAAEC,SAAS,CAAC;EACjD,CAAC,EAAE,CAACD,OAAO,EAAEC,SAAS,CAAC,CAAC;AAC1B;AAEA,OAAO,SAASE,gBAAgBA,CAAA,EAAG;EACjCN,SAAS,CAAC,CAAC;AACb","ignoreList":[]}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { getColorsUIModule } from './Colors';
|
|
4
|
+
import { wrapComponentPool } from './ComponentPool';
|
|
5
|
+
import { createRunInWishlistFn } from './WishlistJsRuntime';
|
|
6
|
+
let done = false;
|
|
7
|
+
const maybeInit = () => {
|
|
8
|
+
if (!done) {
|
|
9
|
+
done = true;
|
|
10
|
+
createRunInWishlistFn(() => {
|
|
11
|
+
'worklet';
|
|
12
|
+
|
|
13
|
+
const registry = new Map();
|
|
14
|
+
const mappings = new Map();
|
|
15
|
+
const templateValueStates = new Map();
|
|
16
|
+
let pushChildrenCallbacks = [];
|
|
17
|
+
let currentValue;
|
|
18
|
+
let currentRootValue;
|
|
19
|
+
const inflatorRegistry = {
|
|
20
|
+
inflateItem: (id, index, nativePool, prevItem) => {
|
|
21
|
+
const pool = wrapComponentPool(nativePool);
|
|
22
|
+
const inflator = registry.get(id);
|
|
23
|
+
if (inflator) {
|
|
24
|
+
const result = inflator(index, pool, prevItem);
|
|
25
|
+
if (!result) {
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
const [item, value] = result;
|
|
29
|
+
return inflatorRegistry.useMappings(item, value, value.type, id, pool, value // rootValue
|
|
30
|
+
);
|
|
31
|
+
} else {
|
|
32
|
+
console.log('Inflator not found for id: ' + id);
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
useMappings: (item, value, templateType, id, pool, rootValue) => {
|
|
37
|
+
// We need to save and restore current values to support things like ForEach
|
|
38
|
+
// where current value can change.
|
|
39
|
+
inflatorRegistry.withCurrentValues(value, rootValue, () => {
|
|
40
|
+
const mapping = mappings.get(id)?.get(templateType);
|
|
41
|
+
if (mapping) {
|
|
42
|
+
for (const [nativeId, inflate] of mapping.entries()) {
|
|
43
|
+
const templateItem = item.getByWishId(nativeId);
|
|
44
|
+
if (templateItem) {
|
|
45
|
+
templateValueStates.clear();
|
|
46
|
+
inflate(value, templateItem, pool, rootValue);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return item;
|
|
52
|
+
},
|
|
53
|
+
registerInflator: (id, inflateMethod) => {
|
|
54
|
+
registry.set(id, inflateMethod);
|
|
55
|
+
},
|
|
56
|
+
unregisterInflator: id => {
|
|
57
|
+
// TODO(Szymon) It should be done on UI Thread as it may be still in use
|
|
58
|
+
registry.delete(id);
|
|
59
|
+
mappings.delete(id);
|
|
60
|
+
},
|
|
61
|
+
registerMapping: (inflatorId, nativeId, templateType, inflateMethod) => {
|
|
62
|
+
const mapping = mappings.get(inflatorId) ?? new Map();
|
|
63
|
+
const innerMapping = mapping.get(templateType) ?? new Map();
|
|
64
|
+
innerMapping.set(nativeId, inflateMethod);
|
|
65
|
+
mapping.set(templateType, innerMapping);
|
|
66
|
+
mappings.set(inflatorId, mapping);
|
|
67
|
+
},
|
|
68
|
+
getTemplateValueState: id => {
|
|
69
|
+
return templateValueStates.get(id);
|
|
70
|
+
},
|
|
71
|
+
setTemplateValueState: (id, state) => {
|
|
72
|
+
templateValueStates.set(id, state);
|
|
73
|
+
},
|
|
74
|
+
deleteTemplateValueState: id => {
|
|
75
|
+
templateValueStates.delete(id);
|
|
76
|
+
},
|
|
77
|
+
withCurrentValues: (value, rootValue, callback) => {
|
|
78
|
+
templateValueStates.clear();
|
|
79
|
+
const previousValue = currentValue;
|
|
80
|
+
const previousRootValue = currentRootValue;
|
|
81
|
+
currentValue = value;
|
|
82
|
+
currentRootValue = rootValue;
|
|
83
|
+
callback();
|
|
84
|
+
currentValue = previousValue;
|
|
85
|
+
currentRootValue = previousRootValue;
|
|
86
|
+
},
|
|
87
|
+
getCurrentValue: () => {
|
|
88
|
+
return currentValue;
|
|
89
|
+
},
|
|
90
|
+
getCurrentRootValue: () => {
|
|
91
|
+
return currentRootValue;
|
|
92
|
+
},
|
|
93
|
+
// TODO: Scope this by wishlist
|
|
94
|
+
didPushChildren: () => {
|
|
95
|
+
pushChildrenCallbacks.forEach(cb => cb());
|
|
96
|
+
pushChildrenCallbacks = [];
|
|
97
|
+
},
|
|
98
|
+
addPushChildrenCallback: callback => {
|
|
99
|
+
pushChildrenCallbacks.push(callback);
|
|
100
|
+
},
|
|
101
|
+
processProps: props => {
|
|
102
|
+
const colors = getColorsUIModule();
|
|
103
|
+
const result = {};
|
|
104
|
+
for (const [key, value] of Object.entries(props)) {
|
|
105
|
+
if (colors.colorProps.includes(key)) {
|
|
106
|
+
result[key] = colors.processColor(value);
|
|
107
|
+
} else {
|
|
108
|
+
result[key] = value;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
global.__wishlistInflatorRegistry = inflatorRegistry;
|
|
115
|
+
})();
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
export function getUIInflatorRegistry() {
|
|
119
|
+
'worklet';
|
|
120
|
+
|
|
121
|
+
return global.__wishlistInflatorRegistry;
|
|
122
|
+
}
|
|
123
|
+
export default class InflatorRepository {
|
|
124
|
+
static register(id, inflateMethod) {
|
|
125
|
+
maybeInit();
|
|
126
|
+
createRunInWishlistFn(() => {
|
|
127
|
+
'worklet';
|
|
128
|
+
|
|
129
|
+
getUIInflatorRegistry().registerInflator(id, inflateMethod);
|
|
130
|
+
})();
|
|
131
|
+
}
|
|
132
|
+
static unregister(id) {
|
|
133
|
+
maybeInit();
|
|
134
|
+
createRunInWishlistFn(() => {
|
|
135
|
+
'worklet';
|
|
136
|
+
|
|
137
|
+
getUIInflatorRegistry().unregisterInflator(id);
|
|
138
|
+
})();
|
|
139
|
+
}
|
|
140
|
+
static registerMapping(inflatorId, nativeId, templateType, inflateMethod) {
|
|
141
|
+
maybeInit();
|
|
142
|
+
createRunInWishlistFn(() => {
|
|
143
|
+
'worklet';
|
|
144
|
+
|
|
145
|
+
getUIInflatorRegistry().registerMapping(inflatorId, nativeId, templateType, inflateMethod);
|
|
146
|
+
})();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=InflatorRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getColorsUIModule","wrapComponentPool","createRunInWishlistFn","done","maybeInit","registry","Map","mappings","templateValueStates","pushChildrenCallbacks","currentValue","currentRootValue","inflatorRegistry","inflateItem","id","index","nativePool","prevItem","pool","inflator","get","result","item","value","useMappings","type","console","log","undefined","templateType","rootValue","withCurrentValues","mapping","nativeId","inflate","entries","templateItem","getByWishId","clear","registerInflator","inflateMethod","set","unregisterInflator","delete","registerMapping","inflatorId","innerMapping","getTemplateValueState","setTemplateValueState","state","deleteTemplateValueState","callback","previousValue","previousRootValue","getCurrentValue","getCurrentRootValue","didPushChildren","forEach","cb","addPushChildrenCallback","push","processProps","props","colors","key","Object","colorProps","includes","processColor","global","__wishlistInflatorRegistry","getUIInflatorRegistry","InflatorRepository","register","unregister"],"sourceRoot":"../../src","sources":["InflatorRepository.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,UAAU;AAC5C,SAGEC,iBAAiB,QACZ,iBAAiB;AAGxB,SAASC,qBAAqB,QAAQ,qBAAqB;AAqD3D,IAAIC,IAAI,GAAG,KAAK;AAChB,MAAMC,SAAS,GAAGA,CAAA,KAAM;EACtB,IAAI,CAACD,IAAI,EAAE;IACTA,IAAI,GAAG,IAAI;IACXD,qBAAqB,CAAC,MAAM;MAC1B,SAAS;;MAET,MAAMG,QAAQ,GAAG,IAAIC,GAAG,CAAwB,CAAC;MACjD,MAAMC,QAAQ,GAAG,IAAID,GAAG,CAGtB,CAAC;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,CAAC,MAAM;cACLF,MAAM,CAAC2C,GAAG,CAAC,GAAGzC,KAAK;YACrB;UACF;UACA,OAAOF,MAAM;QACf;MACF,CAAC;MACDgD,MAAM,CAACC,0BAA0B,GAAG1D,gBAAgB;IACtD,CAAC,CAAC,CAAC,CAAC;EACN;AACF,CAAC;AAED,OAAO,SAAS2D,qBAAqBA,CAAA,EAAuB;EAC1D,SAAS;;EAET,OAAOF,MAAM,CAACC,0BAA0B;AAC1C;AAEA,eAAe,MAAME,kBAAkB,CAAC;EACtC,OAAOC,QAAQA,CAAC3D,EAAU,EAAE0B,aAA4B,EAAE;IACxDpC,SAAS,CAAC,CAAC;IACXF,qBAAqB,CAAC,MAAM;MAC1B,SAAS;;MACTqE,qBAAqB,CAAC,CAAC,CAAChC,gBAAgB,CAACzB,EAAE,EAAE0B,aAAa,CAAC;IAC7D,CAAC,CAAC,CAAC,CAAC;EACN;EAEA,OAAOkC,UAAUA,CAAC5D,EAAU,EAAE;IAC5BV,SAAS,CAAC,CAAC;IACXF,qBAAqB,CAAC,MAAM;MAC1B,SAAS;;MACTqE,qBAAqB,CAAC,CAAC,CAAC7B,kBAAkB,CAAC5B,EAAE,CAAC;IAChD,CAAC,CAAC,CAAC,CAAC;EACN;EAEA,OAAO8B,eAAeA,CACpBC,UAAkB,EAClBZ,QAAgB,EAChBJ,YAAoB,EACpBW,aAAmC,EACnC;IACApC,SAAS,CAAC,CAAC;IACXF,qBAAqB,CAAC,MAAM;MAC1B,SAAS;;MACTqE,qBAAqB,CAAC,CAAC,CAAC3B,eAAe,CACrCC,UAAU,EACVZ,QAAQ,EACRJ,YAAY,EACZW,aACF,CAAC;IACH,CAAC,CAAC,CAAC,CAAC;EACN;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["scheduleSyncUp","wishlistId","global","wishlists"],"sourceRoot":"../../src","sources":["OrchestratorBinding.ts"],"mappings":";;AAWA,OAAO,SAASA,cAAcA,CAACC,UAAkB,EAAE;EACjD,SAAS;;EACTC,MAAM,CAACC,SAAS,CAACF,UAAU,CAAC,CAACD,cAAc,CAAC,CAAC;AAC/C","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent","interfaceOnly"],"sourceRoot":"../../../src","sources":["Specs/NativeContentContainer.ts"],"mappings":";;AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAI5F,eAAeA,sBAAsB,CACnC,oBAAoB,EACpB;EAAEC,aAAa,EAAE;AAAK,CACxB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent","interfaceOnly"],"sourceRoot":"../../../src","sources":["Specs/NativeTemplateContainer.ts"],"mappings":";;AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAQ5F,eAAeA,sBAAsB,CACnC,qBAAqB,EACrB;EAAEC,aAAa,EAAE;AAAK,CACxB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["Specs/NativeTemplateInterceptor.ts"],"mappings":";;AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAI5F,eAAeA,sBAAsB,CACnC,uBACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
4
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
5
|
+
export const Commands = codegenNativeCommands({
|
|
6
|
+
supportedCommands: ['scrollToItem']
|
|
7
|
+
});
|
|
8
|
+
export default codegenNativeComponent('MGWishlist', {
|
|
9
|
+
interfaceOnly: true
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=NativeWishlist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["codegenNativeCommands","codegenNativeComponent","Commands","supportedCommands","interfaceOnly"],"sourceRoot":"../../../src","sources":["Specs/NativeWishlist.ts"],"mappings":";;AAOA,OAAOA,qBAAqB,MAAM,wDAAwD;AAC1F,OAAOC,sBAAsB,MAEtB,yDAAyD;AAyBhE,OAAO,MAAMC,QAAQ,GAAGF,qBAAqB,CAAiB;EAC5DG,iBAAiB,EAAE,CAAC,cAAc;AACpC,CAAC,CAAC;AAEF,eAAeF,sBAAsB,CAAgB,YAAY,EAAE;EACjEG,aAAa,EAAE;AACjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["Specs/NativeWishlistManager.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAqB,cAAc;AAM/D,eAAeA,mBAAmB,CAACC,YAAY,CAAO,iBAAiB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext } from 'react';
|
|
4
|
+
export const TemplateContext = /*#__PURE__*/createContext(null);
|
|
5
|
+
export function useTemplateContext() {
|
|
6
|
+
const context = useContext(TemplateContext);
|
|
7
|
+
if (!context) {
|
|
8
|
+
throw Error('Must be rendered inside a Template component.');
|
|
9
|
+
}
|
|
10
|
+
return context;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=TemplateContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","useContext","TemplateContext","useTemplateContext","context","Error"],"sourceRoot":"../../src","sources":["TemplateContext.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,UAAU,QAAQ,OAAO;AAEjD,OAAO,MAAMC,eAAe,gBAAGF,aAAa,CAGlC,IAAI,CAAC;AAEf,OAAO,SAASG,kBAAkBA,CAAA,EAAG;EACnC,MAAMC,OAAO,GAAGH,UAAU,CAACC,eAAe,CAAC;EAC3C,IAAI,CAACE,OAAO,EAAE;IACZ,MAAMC,KAAK,CAAC,+CAA+C,CAAC;EAC9D;EACA,OAAOD,OAAO;AAChB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["TemplateItem.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useMemo } from 'react';
|
|
4
|
+
import { getUIInflatorRegistry } from './InflatorRepository';
|
|
5
|
+
import { generateId } from './Utils';
|
|
6
|
+
import { createRunInWishlistFn } from './WishlistJsRuntime';
|
|
7
|
+
|
|
8
|
+
// Object cloned by reanimated are feezed so we store mutation state in a
|
|
9
|
+
// side map.
|
|
10
|
+
|
|
11
|
+
export function createTemplateValue(mapper) {
|
|
12
|
+
const id = generateId();
|
|
13
|
+
function getOrCreateUIState() {
|
|
14
|
+
'worklet';
|
|
15
|
+
|
|
16
|
+
const registry = getUIInflatorRegistry();
|
|
17
|
+
let state = registry.getTemplateValueState(id);
|
|
18
|
+
if (!state) {
|
|
19
|
+
state = {
|
|
20
|
+
dirty: true,
|
|
21
|
+
current: undefined
|
|
22
|
+
};
|
|
23
|
+
registry.setTemplateValueState(id, state);
|
|
24
|
+
}
|
|
25
|
+
return state;
|
|
26
|
+
}
|
|
27
|
+
function value() {
|
|
28
|
+
'worklet';
|
|
29
|
+
|
|
30
|
+
const registry = getUIInflatorRegistry();
|
|
31
|
+
const state = getOrCreateUIState();
|
|
32
|
+
if (state.dirty) {
|
|
33
|
+
state.current = mapper(registry.getCurrentValue(), registry.getCurrentRootValue());
|
|
34
|
+
state.dirty = false;
|
|
35
|
+
}
|
|
36
|
+
return state.current;
|
|
37
|
+
}
|
|
38
|
+
function remove() {
|
|
39
|
+
createRunInWishlistFn(() => {
|
|
40
|
+
'worklet';
|
|
41
|
+
|
|
42
|
+
getUIInflatorRegistry().deleteTemplateValueState(id);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
__isTemplateValue: true,
|
|
47
|
+
__remove: remove,
|
|
48
|
+
value
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export function isTemplateValue(value) {
|
|
52
|
+
return value !== null && typeof value === 'object' && value.__isTemplateValue === true;
|
|
53
|
+
}
|
|
54
|
+
export function useTemplateValue(mapper) {
|
|
55
|
+
const value = useMemo(() => {
|
|
56
|
+
return createTemplateValue(mapper);
|
|
57
|
+
}, [mapper]);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
return () => value.__remove();
|
|
60
|
+
}, [value]);
|
|
61
|
+
return value;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=TemplateValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useMemo","getUIInflatorRegistry","generateId","createRunInWishlistFn","createTemplateValue","mapper","id","getOrCreateUIState","registry","state","getTemplateValueState","dirty","current","undefined","setTemplateValueState","value","getCurrentValue","getCurrentRootValue","remove","deleteTemplateValueState","__isTemplateValue","__remove","isTemplateValue","useTemplateValue"],"sourceRoot":"../../src","sources":["TemplateValue.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAC1C,SAASC,qBAAqB,QAAQ,sBAAsB;AAC5D,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,qBAAqB,QAAQ,qBAAqB;;AAO3D;AACA;;AAeA,OAAO,SAASC,mBAAmBA,CACjCC,MAAwC,EACT;EAC/B,MAAMC,EAAE,GAAGJ,UAAU,CAAC,CAAC;EAEvB,SAASK,kBAAkBA,CAAA,EAAG;IAC5B,SAAS;;IAET,MAAMC,QAAQ,GAAGP,qBAAqB,CAAC,CAAC;IACxC,IAAIQ,KAAK,GAAGD,QAAQ,CAACE,qBAAqB,CAACJ,EAAE,CAAC;IAC9C,IAAI,CAACG,KAAK,EAAE;MACVA,KA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;EAEX,OAAOA,KAAK;AACd","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
let idGenerator = 0;
|
|
5
|
+
export function generateId() {
|
|
6
|
+
return `id_${idGenerator++}`;
|
|
7
|
+
}
|
|
8
|
+
export function useGeneratedId() {
|
|
9
|
+
const ref = useRef(null);
|
|
10
|
+
if (ref.current === null) {
|
|
11
|
+
ref.current = generateId();
|
|
12
|
+
}
|
|
13
|
+
return ref.current;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useRef","idGenerator","generateId","useGeneratedId","ref","current"],"sourceRoot":"../../src","sources":["Utils.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,OAAO;AAE9B,IAAIC,WAAW,GAAG,CAAC;AAEnB,OAAO,SAASC,UAAUA,CAAA,EAAW;EACnC,OAAO,MAAMD,WAAW,EAAE,EAAE;AAC9B;AAEA,OAAO,SAASE,cAAcA,CAAA,EAAW;EACvC,MAAMC,GAAG,GAAGJ,MAAM,CAAgB,IAAI,CAAC;EACvC,IAAII,GAAG,CAACC,OAAO,KAAK,IAAI,EAAE;IACxBD,GAAG,CAACC,OAAO,GAAGH,UAAU,CAAC,CAAC;EAC5B;EACA,OAAOE,GAAG,CAACC,OAAO;AACpB","ignoreList":[]}
|