one 2.6.17 → 2.6.19
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/One.podspec +2 -0
- package/android/src/main/java/com/margelo/nitro/one/HybridOneDevice.kt +124 -0
- package/android/src/main/java/com/margelo/nitro/one/HybridOneHaptics.kt +31 -0
- package/android/src/main/java/com/margelo/nitro/one/HybridOneImageManipulator.kt +25 -5
- package/android/src/main/java/com/margelo/nitro/one/HybridOneKeepAwake.kt +34 -9
- package/android/src/main/java/com/margelo/nitro/one/HybridOneSecureStore.kt +269 -78
- package/dist/cjs/index.cjs +3 -0
- package/dist/cjs/index.native.cjs +3 -0
- package/dist/cjs/index.native.js +3 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/one.cjs +1 -0
- package/dist/cjs/one.native.cjs +1 -0
- package/dist/cjs/one.native.js +1 -0
- package/dist/cjs/one.native.js.map +1 -1
- package/dist/cjs/platform/extras.cjs +4 -0
- package/dist/cjs/platform/extras.native.cjs +4 -0
- package/dist/cjs/platform/extras.native.js +4 -0
- package/dist/cjs/platform/extras.native.js.map +1 -1
- package/dist/cjs/platform/haptics/index.cjs +3 -0
- package/dist/cjs/platform/haptics/index.native.cjs +4 -0
- package/dist/cjs/platform/haptics/index.native.js +4 -0
- package/dist/cjs/platform/haptics/index.native.js.map +1 -1
- package/dist/cjs/platform/haptics/validation.cjs +28 -0
- package/dist/cjs/platform/haptics/validation.native.cjs +28 -0
- package/dist/cjs/platform/haptics/validation.native.js +28 -0
- package/dist/cjs/platform/haptics/validation.native.js.map +1 -1
- package/dist/cjs/platform/image-manipulator/index.cjs +10 -3
- package/dist/cjs/platform/image-manipulator/index.native.cjs +1 -0
- package/dist/cjs/platform/image-manipulator/index.native.js +1 -0
- package/dist/cjs/platform/image-manipulator/index.native.js.map +1 -1
- package/dist/cjs/platform/index.cjs +1 -0
- package/dist/cjs/platform/index.native.cjs +1 -0
- package/dist/cjs/platform/index.native.js +1 -0
- package/dist/cjs/platform/index.native.js.map +1 -1
- package/dist/cjs/platform/keep-awake/index.cjs +53 -14
- package/dist/cjs/platform/keep-awake/index.native.cjs +29 -2
- package/dist/cjs/platform/keep-awake/index.native.js +29 -2
- package/dist/cjs/platform/keep-awake/index.native.js.map +1 -1
- package/dist/cjs/platform/keep-awake/unavailable.cjs +11 -1
- package/dist/cjs/platform/keep-awake/unavailable.native.cjs +11 -1
- package/dist/cjs/platform/keep-awake/unavailable.native.js +11 -1
- package/dist/cjs/platform/keep-awake/unavailable.native.js.map +1 -1
- package/dist/cjs/platform/keep-awake/validate.cjs +15 -1
- package/dist/cjs/platform/keep-awake/validate.native.cjs +15 -1
- package/dist/cjs/platform/keep-awake/validate.native.js +15 -1
- package/dist/cjs/platform/keep-awake/validate.native.js.map +1 -1
- package/dist/cjs/platform/localization/index.cjs +100 -0
- package/dist/cjs/platform/localization/index.native.cjs +71 -0
- package/dist/cjs/platform/localization/index.native.js +73 -0
- package/dist/cjs/platform/localization/index.native.js.map +1 -0
- package/dist/cjs/platform/localization/map.cjs +86 -0
- package/dist/cjs/platform/localization/map.native.cjs +90 -0
- package/dist/cjs/platform/localization/map.native.js +92 -0
- package/dist/cjs/platform/localization/map.native.js.map +1 -0
- package/dist/cjs/platform/localization/types.cjs +16 -0
- package/dist/cjs/platform/localization/types.native.cjs +18 -0
- package/dist/cjs/platform/localization/types.native.js +20 -0
- package/dist/cjs/platform/localization/types.native.js.map +1 -0
- package/dist/cjs/platform/secure-store/index.cjs +12 -6
- package/dist/cjs/platform/secure-store/index.native.cjs +18 -12
- package/dist/cjs/platform/secure-store/index.native.js +18 -12
- package/dist/cjs/platform/secure-store/index.native.js.map +1 -1
- package/dist/cjs/platform/secure-store/types.cjs +16 -0
- package/dist/cjs/platform/secure-store/types.native.cjs +18 -0
- package/dist/cjs/platform/secure-store/types.native.js +20 -0
- package/dist/cjs/platform/secure-store/types.native.js.map +1 -0
- package/dist/cjs/platform/secure-store/validate.cjs +34 -0
- package/dist/cjs/platform/secure-store/validate.native.cjs +34 -0
- package/dist/cjs/platform/secure-store/validate.native.js +34 -0
- package/dist/cjs/platform/secure-store/validate.native.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/index.native.js +2 -2
- package/dist/esm/one.mjs +2 -1
- package/dist/esm/one.mjs.map +1 -1
- package/dist/esm/one.native.js +2 -1
- package/dist/esm/one.native.js.map +1 -1
- package/dist/esm/platform/extras.mjs +2 -1
- package/dist/esm/platform/extras.native.js +2 -1
- package/dist/esm/platform/haptics/index.mjs +4 -1
- package/dist/esm/platform/haptics/index.mjs.map +1 -1
- package/dist/esm/platform/haptics/index.native.js +5 -1
- package/dist/esm/platform/haptics/index.native.js.map +1 -1
- package/dist/esm/platform/haptics/validation.mjs +27 -1
- package/dist/esm/platform/haptics/validation.mjs.map +1 -1
- package/dist/esm/platform/haptics/validation.native.js +27 -1
- package/dist/esm/platform/haptics/validation.native.js.map +1 -1
- package/dist/esm/platform/image-manipulator/index.mjs +10 -3
- package/dist/esm/platform/image-manipulator/index.mjs.map +1 -1
- package/dist/esm/platform/image-manipulator/index.native.js +1 -0
- package/dist/esm/platform/image-manipulator/index.native.js.map +1 -1
- package/dist/esm/platform/index.mjs +2 -2
- package/dist/esm/platform/index.mjs.map +1 -1
- package/dist/esm/platform/index.native.js +2 -2
- package/dist/esm/platform/index.native.js.map +1 -1
- package/dist/esm/platform/keep-awake/index.mjs +51 -15
- package/dist/esm/platform/keep-awake/index.mjs.map +1 -1
- package/dist/esm/platform/keep-awake/index.native.js +27 -3
- package/dist/esm/platform/keep-awake/index.native.js.map +1 -1
- package/dist/esm/platform/keep-awake/unavailable.mjs +12 -2
- package/dist/esm/platform/keep-awake/unavailable.mjs.map +1 -1
- package/dist/esm/platform/keep-awake/unavailable.native.js +12 -2
- package/dist/esm/platform/keep-awake/unavailable.native.js.map +1 -1
- package/dist/esm/platform/keep-awake/validate.mjs +10 -1
- package/dist/esm/platform/keep-awake/validate.mjs.map +1 -1
- package/dist/esm/platform/keep-awake/validate.native.js +10 -1
- package/dist/esm/platform/keep-awake/validate.native.js.map +1 -1
- package/dist/esm/platform/localization/index.mjs +77 -0
- package/dist/esm/platform/localization/index.mjs.map +1 -0
- package/dist/esm/platform/localization/index.native.js +46 -0
- package/dist/esm/platform/localization/index.native.js.map +1 -0
- package/dist/esm/platform/localization/map.mjs +59 -0
- package/dist/esm/platform/localization/map.mjs.map +1 -0
- package/dist/esm/platform/localization/map.native.js +61 -0
- package/dist/esm/platform/localization/map.native.js.map +1 -0
- package/dist/esm/platform/localization/types.mjs +0 -0
- package/dist/esm/platform/localization/types.native.js +0 -0
- package/dist/esm/platform/secure-store/index.mjs +13 -7
- package/dist/esm/platform/secure-store/index.mjs.map +1 -1
- package/dist/esm/platform/secure-store/index.native.js +19 -13
- package/dist/esm/platform/secure-store/index.native.js.map +1 -1
- package/dist/esm/platform/secure-store/types.mjs +0 -0
- package/dist/esm/platform/secure-store/types.native.js +0 -0
- package/dist/esm/platform/secure-store/validate.mjs +33 -1
- package/dist/esm/platform/secure-store/validate.mjs.map +1 -1
- package/dist/esm/platform/secure-store/validate.native.js +33 -1
- package/dist/esm/platform/secure-store/validate.native.js.map +1 -1
- package/ios/Nitro/HybridOneDevice.swift +117 -0
- package/ios/Nitro/HybridOneHaptics.swift +4 -0
- package/ios/Nitro/HybridOneImageManipulator.swift +25 -8
- package/ios/Nitro/HybridOneKeepAwake.swift +34 -2
- package/ios/Nitro/HybridOneSecureStore.swift +112 -46
- package/ios/Tests/ImageManipulator/Package.swift +12 -0
- package/ios/Tests/ImageManipulator/README.md +21 -0
- package/ios/Tests/ImageManipulator/Sources/NitroModules/Promise.swift +33 -0
- package/ios/Tests/ImageManipulator/Sources/OneImageManipulatorCore/Types.swift +41 -0
- package/ios/Tests/ImageManipulator/Sources/SDWebImageWebPCoder/SDImageWebPCoder.swift +23 -0
- package/nitrogen/generated/android/c++/JAndroidHaptic.hpp +109 -0
- package/nitrogen/generated/android/c++/JCalendarInfo.hpp +70 -0
- package/nitrogen/generated/android/c++/JHapticImpact.hpp +3 -3
- package/nitrogen/generated/android/c++/JHybridOneDeviceSpec.cpp +52 -0
- package/nitrogen/generated/android/c++/JHybridOneDeviceSpec.hpp +3 -0
- package/nitrogen/generated/android/c++/JHybridOneHapticsSpec.cpp +8 -0
- package/nitrogen/generated/android/c++/JHybridOneHapticsSpec.hpp +1 -0
- package/nitrogen/generated/android/c++/JHybridOneImageManipulatorSpec.cpp +5 -1
- package/nitrogen/generated/android/c++/JHybridOneKeepAwakeSpec.cpp +31 -0
- package/nitrogen/generated/android/c++/JHybridOneKeepAwakeSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/JHybridOneSecureStoreSpec.cpp +26 -19
- package/nitrogen/generated/android/c++/JHybridOneSecureStoreSpec.hpp +6 -6
- package/nitrogen/generated/android/c++/JImageTransformOptions.hpp +7 -1
- package/nitrogen/generated/android/c++/JLocaleInfo.hpp +110 -0
- package/nitrogen/generated/android/c++/JOneImageFlip.hpp +58 -0
- package/nitrogen/generated/android/c++/JOneImageFormat.hpp +3 -0
- package/nitrogen/generated/android/c++/JSecureStoreAccessibility.hpp +73 -0
- package/nitrogen/generated/android/c++/JSecureStoreOptions.hpp +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/AndroidHaptic.kt +40 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/CalendarInfo.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HapticImpact.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HybridOneDeviceSpec.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HybridOneHapticsSpec.kt +4 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HybridOneKeepAwakeSpec.kt +8 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/HybridOneSecureStoreSpec.kt +6 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/ImageTransformOptions.kt +7 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/LocaleInfo.kt +116 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/OneImageFlip.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/OneImageFormat.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/SecureStoreAccessibility.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/one/SecureStoreOptions.kt +71 -0
- package/nitrogen/generated/ios/One-Swift-Cxx-Bridge.hpp +133 -51
- package/nitrogen/generated/ios/One-Swift-Cxx-Umbrella.hpp +19 -1
- package/nitrogen/generated/ios/c++/HybridOneDeviceSpecSwift.hpp +31 -0
- package/nitrogen/generated/ios/c++/HybridOneHapticsSpecSwift.hpp +9 -0
- package/nitrogen/generated/ios/c++/HybridOneImageManipulatorSpecSwift.hpp +4 -1
- package/nitrogen/generated/ios/c++/HybridOneKeepAwakeSpecSwift.hpp +18 -1
- package/nitrogen/generated/ios/c++/HybridOneSecureStoreSpecSwift.hpp +18 -13
- package/nitrogen/generated/ios/swift/AndroidHaptic.swift +108 -0
- package/nitrogen/generated/ios/swift/CalendarInfo.swift +96 -0
- package/nitrogen/generated/ios/swift/HapticImpact.swift +4 -4
- package/nitrogen/generated/ios/swift/HybridOneDeviceSpec.swift +3 -0
- package/nitrogen/generated/ios/swift/HybridOneDeviceSpec_cxx.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridOneHapticsSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridOneHapticsSpec_cxx.swift +11 -0
- package/nitrogen/generated/ios/swift/HybridOneKeepAwakeSpec.swift +3 -1
- package/nitrogen/generated/ios/swift/HybridOneKeepAwakeSpec_cxx.swift +41 -3
- package/nitrogen/generated/ios/swift/HybridOneSecureStoreSpec.swift +6 -6
- package/nitrogen/generated/ios/swift/HybridOneSecureStoreSpec_cxx.swift +12 -12
- package/nitrogen/generated/ios/swift/ImageTransformOptions.swift +16 -5
- package/nitrogen/generated/ios/swift/LocaleInfo.swift +250 -0
- package/nitrogen/generated/ios/swift/OneImageFlip.swift +40 -0
- package/nitrogen/generated/ios/swift/OneImageFormat.swift +4 -0
- package/nitrogen/generated/ios/swift/SecureStoreAccessibility.swift +60 -0
- package/nitrogen/generated/ios/swift/SecureStoreOptions.swift +107 -0
- package/nitrogen/generated/shared/c++/AndroidHaptic.hpp +144 -0
- package/nitrogen/generated/shared/c++/CalendarInfo.hpp +96 -0
- package/nitrogen/generated/shared/c++/HapticImpact.hpp +5 -5
- package/nitrogen/generated/shared/c++/HybridOneDeviceSpec.cpp +3 -0
- package/nitrogen/generated/shared/c++/HybridOneDeviceSpec.hpp +11 -0
- package/nitrogen/generated/shared/c++/HybridOneHapticsSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridOneHapticsSpec.hpp +4 -0
- package/nitrogen/generated/shared/c++/HybridOneKeepAwakeSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridOneKeepAwakeSpec.hpp +4 -1
- package/nitrogen/generated/shared/c++/HybridOneSecureStoreSpec.hpp +9 -7
- package/nitrogen/generated/shared/c++/ImageTransformOptions.hpp +8 -1
- package/nitrogen/generated/shared/c++/LocaleInfo.hpp +136 -0
- package/nitrogen/generated/shared/c++/OneImageFlip.hpp +76 -0
- package/nitrogen/generated/shared/c++/OneImageFormat.hpp +4 -0
- package/nitrogen/generated/shared/c++/SecureStoreAccessibility.hpp +96 -0
- package/nitrogen/generated/shared/c++/SecureStoreOptions.hpp +102 -0
- package/package.json +15 -15
- package/src/index.ts +3 -0
- package/src/one.test.ts +2 -0
- package/src/one.ts +3 -0
- package/src/platform/extras.ts +3 -0
- package/src/platform/haptics/index.native.ts +13 -3
- package/src/platform/haptics/index.ts +12 -3
- package/src/platform/haptics/types.ts +25 -0
- package/src/platform/haptics/validation.ts +31 -1
- package/src/platform/image-manipulator/index.native.ts +3 -0
- package/src/platform/image-manipulator/index.ts +10 -3
- package/src/platform/index.native.ts +3 -2
- package/src/platform/index.ts +3 -2
- package/src/platform/keep-awake/index.native.ts +31 -2
- package/src/platform/keep-awake/index.ts +66 -17
- package/src/platform/keep-awake/unavailable.ts +12 -2
- package/src/platform/keep-awake/validate.ts +16 -0
- package/src/platform/localization/index.native.ts +47 -0
- package/src/platform/localization/index.ts +90 -0
- package/src/platform/localization/map.ts +77 -0
- package/src/platform/localization/types.ts +36 -0
- package/src/platform/secure-store/index.native.ts +26 -13
- package/src/platform/secure-store/index.ts +20 -7
- package/src/platform/secure-store/types.ts +33 -0
- package/src/platform/secure-store/validate.ts +48 -0
- package/src/platform/specs/OneDevice.nitro.ts +34 -0
- package/src/platform/specs/OneHaptics.nitro.ts +4 -1
- package/src/platform/specs/OneImageManipulator.nitro.ts +4 -1
- package/src/platform/specs/OneKeepAwake.nitro.ts +2 -0
- package/src/platform/specs/OneSecureStore.nitro.ts +12 -8
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/one.d.ts +2 -1
- package/types/one.d.ts.map +1 -1
- package/types/platform/extras.d.ts +3 -0
- package/types/platform/extras.d.ts.map +1 -1
- package/types/platform/haptics/index.d.ts +2 -2
- package/types/platform/haptics/index.d.ts.map +1 -1
- package/types/platform/haptics/index.native.d.ts +2 -2
- package/types/platform/haptics/index.native.d.ts.map +1 -1
- package/types/platform/haptics/types.d.ts +3 -0
- package/types/platform/haptics/types.d.ts.map +1 -1
- package/types/platform/haptics/validation.d.ts +3 -1
- package/types/platform/haptics/validation.d.ts.map +1 -1
- package/types/platform/image-manipulator/index.d.ts +1 -1
- package/types/platform/image-manipulator/index.d.ts.map +1 -1
- package/types/platform/image-manipulator/index.native.d.ts +1 -1
- package/types/platform/image-manipulator/index.native.d.ts.map +1 -1
- package/types/platform/index.d.ts +3 -3
- package/types/platform/index.d.ts.map +1 -1
- package/types/platform/index.native.d.ts +3 -3
- package/types/platform/index.native.d.ts.map +1 -1
- package/types/platform/keep-awake/index.d.ts +3 -0
- package/types/platform/keep-awake/index.d.ts.map +1 -1
- package/types/platform/keep-awake/index.native.d.ts +5 -0
- package/types/platform/keep-awake/index.native.d.ts.map +1 -1
- package/types/platform/keep-awake/unavailable.d.ts +4 -0
- package/types/platform/keep-awake/unavailable.d.ts.map +1 -1
- package/types/platform/keep-awake/validate.d.ts +3 -0
- package/types/platform/keep-awake/validate.d.ts.map +1 -1
- package/types/platform/localization/index.d.ts +7 -0
- package/types/platform/localization/index.d.ts.map +1 -0
- package/types/platform/localization/index.native.d.ts +7 -0
- package/types/platform/localization/index.native.d.ts.map +1 -0
- package/types/platform/localization/map.d.ts +9 -0
- package/types/platform/localization/map.d.ts.map +1 -0
- package/types/platform/localization/types.d.ts +31 -0
- package/types/platform/localization/types.d.ts.map +1 -0
- package/types/platform/secure-store/index.d.ts +8 -7
- package/types/platform/secure-store/index.d.ts.map +1 -1
- package/types/platform/secure-store/index.native.d.ts +8 -7
- package/types/platform/secure-store/index.native.d.ts.map +1 -1
- package/types/platform/secure-store/types.d.ts +24 -0
- package/types/platform/secure-store/types.d.ts.map +1 -0
- package/types/platform/secure-store/validate.d.ts +3 -0
- package/types/platform/secure-store/validate.d.ts.map +1 -1
- package/types/platform/specs/OneDevice.nitro.d.ts +25 -0
- package/types/platform/specs/OneDevice.nitro.d.ts.map +1 -1
- package/types/platform/specs/OneHaptics.nitro.d.ts +2 -1
- package/types/platform/specs/OneHaptics.nitro.d.ts.map +1 -1
- package/types/platform/specs/OneImageManipulator.nitro.d.ts +3 -1
- package/types/platform/specs/OneImageManipulator.nitro.d.ts.map +1 -1
- package/types/platform/specs/OneKeepAwake.nitro.d.ts +2 -0
- package/types/platform/specs/OneKeepAwake.nitro.d.ts.map +1 -1
- package/types/platform/specs/OneSecureStore.nitro.d.ts +8 -6
- package/types/platform/specs/OneSecureStore.nitro.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["esm/platform/index.js"],"sourcesContent":["import * as UI from \"./effects\";\nimport { Swift } from \"./unsupported\";\nimport { Widgets, LiveActivities, WidgetUI } from \"./widgets/index\";\nexport * from \"./extras\";\nexport * from \"./unsupported\";\nimport {\n useSizeClass,\n getSizeClass,\n useHinge,\n getHinge,\n onHingeChange,\n ReservedRegions,\n useReservedRegions,\n useReservedRegionsReady,\n useWindowSegments,\n useSpanning\n} from \"./adaptive/index\";\nimport { Compose } from \"./compose\";\nimport { Notifications } from \"./notifications\";\nimport { useNativeState } from \"./nativeState\";\nimport { TextInput } from \"./universal/TextInput/index\";\nimport { Haptics } from \"./haptics/index\";\nimport { LaunchScreen } from \"./launchScreen/index\";\nimport { LocalAuthentication } from \"./local-authentication/index\";\nimport { ProtectedStore } from \"./protected-store/index\";\nimport { Storage } from \"./storage/index\";\nimport { KeepAwake } from \"./keep-awake/index\";\nimport { Print } from \"./print/index\";\nimport { StoreReview } from \"./store-review/index\";\nimport { QuickActions } from \"./quick-actions/index\";\nimport { Location } from \"./location/index\";\nimport { FileSystem } from \"./file-system/index\";\nimport { Audio } from \"./audio/index\";\nimport { CameraView } from \"./camera/index\";\nimport { Share } from \"./share/index\";\nimport { Open } from \"./open/index\";\nimport { PhotoLibrary } from \"./photo-library/index\";\nimport { MapServices } from \"./map-services/index\";\nimport { AppTracking } from \"./app-tracking/index\";\nimport { AppIcon } from \"./app-icon/index\";\nimport { ScreenOrientation } from \"./screen-orientation/index\";\nimport { ScreenCapture, usePreventScreenCapture } from \"./screen-capture/index\";\nimport { Purchases } from \"./purchases/index\";\nimport { ImageManipulator } from \"./image-manipulator/index\";\nimport { Device } from \"./device/index\";\nimport { Motion } from \"./motion/index\";\nimport { BackgroundTasks } from \"./background-tasks/index\";\nimport { AppIntents } from \"./app-intents/index\";\nimport { DeviceAttestation } from \"./device-attestation/index\";\nimport { Contacts } from \"./contacts/index\";\nimport { Calendar } from \"./calendar/index\";\nimport { AppInfo } from \"./app-info/index\";\nimport { ImagePicker } from \"./image-picker/index\";\nimport { DocumentPicker } from \"./document-picker/index\";\nimport { Database } from \"./database/index\";\nimport { VNDocumentCameraViewController } from \"./vision-kit/index\";\nimport { MFMailComposeViewController, MFMessageComposeViewController } from \"./message-ui/index\";\nimport { DataScannerViewController } from \"./data-scanner/index\";\nimport { CNContactViewController, CNMutableContact, CNContactStore } from \"./contact-ui/index\";\nconst Menu = Swift.Menu;\nconst ContextMenu = Swift.ContextMenu;\nexport {\n AppIcon,\n AppInfo,\n AppIntents,\n AppTracking,\n Audio,\n BackgroundTasks,\n CNContactStore,\n CNContactViewController,\n CNMutableContact,\n Calendar,\n CameraView,\n Compose,\n Contacts,\n ContextMenu,\n DataScannerViewController,\n Database,\n Device,\n DeviceAttestation,\n DocumentPicker,\n FileSystem,\n Haptics,\n ImageManipulator,\n ImagePicker,\n KeepAwake,\n LaunchScreen,\n LiveActivities,\n LocalAuthentication,\n Location,\n MFMailComposeViewController,\n MFMessageComposeViewController,\n MapServices,\n Menu,\n Motion,\n Notifications,\n Open,\n PhotoLibrary,\n Print,\n ProtectedStore,\n Purchases,\n QuickActions,\n ReservedRegions,\n ScreenCapture,\n ScreenOrientation,\n Share,\n Storage,\n StoreReview,\n TextInput,\n UI,\n VNDocumentCameraViewController,\n WidgetUI,\n Widgets,\n getHinge,\n getSizeClass,\n onHingeChange,\n useHinge,\n useNativeState,\n usePreventScreenCapture,\n useReservedRegions,\n useReservedRegionsReady,\n useSizeClass,\n useSpanning,\n useWindowSegments\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,MAAM,OAAO,MAAM;AACnB,MAAM,cAAc,MAAM"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/platform/index.js"],"sourcesContent":["import * as UI from \"./effects\";\nimport { Swift } from \"./unsupported\";\nimport { Widgets, LiveActivities, WidgetUI } from \"./widgets/index\";\nexport * from \"./extras\";\nexport * from \"./unsupported\";\nimport {\n useSizeClass,\n getSizeClass,\n useHinge,\n getHinge,\n onHingeChange,\n ReservedRegions,\n useReservedRegions,\n useReservedRegionsReady,\n useWindowSegments,\n useSpanning\n} from \"./adaptive/index\";\nimport { Compose } from \"./compose\";\nimport { Notifications } from \"./notifications\";\nimport { useNativeState } from \"./nativeState\";\nimport { TextInput } from \"./universal/TextInput/index\";\nimport { Haptics } from \"./haptics/index\";\nimport { LaunchScreen } from \"./launchScreen/index\";\nimport { LocalAuthentication } from \"./local-authentication/index\";\nimport { ProtectedStore } from \"./protected-store/index\";\nimport { Storage } from \"./storage/index\";\nimport { KeepAwake, useKeepAwake } from \"./keep-awake/index\";\nimport { Print } from \"./print/index\";\nimport { StoreReview } from \"./store-review/index\";\nimport { QuickActions } from \"./quick-actions/index\";\nimport { Location } from \"./location/index\";\nimport { FileSystem } from \"./file-system/index\";\nimport { Audio } from \"./audio/index\";\nimport { CameraView } from \"./camera/index\";\nimport { Share } from \"./share/index\";\nimport { Open } from \"./open/index\";\nimport { PhotoLibrary } from \"./photo-library/index\";\nimport { MapServices } from \"./map-services/index\";\nimport { AppTracking } from \"./app-tracking/index\";\nimport { AppIcon } from \"./app-icon/index\";\nimport { ScreenOrientation } from \"./screen-orientation/index\";\nimport { ScreenCapture, usePreventScreenCapture } from \"./screen-capture/index\";\nimport { Purchases } from \"./purchases/index\";\nimport { ImageManipulator } from \"./image-manipulator/index\";\nimport { Device } from \"./device/index\";\nimport { Motion } from \"./motion/index\";\nimport { BackgroundTasks } from \"./background-tasks/index\";\nimport { AppIntents } from \"./app-intents/index\";\nimport { DeviceAttestation } from \"./device-attestation/index\";\nimport { Contacts } from \"./contacts/index\";\nimport { Calendar } from \"./calendar/index\";\nimport { AppInfo } from \"./app-info/index\";\nimport { ImagePicker } from \"./image-picker/index\";\nimport { DocumentPicker } from \"./document-picker/index\";\nimport { Database } from \"./database/index\";\nimport { VNDocumentCameraViewController } from \"./vision-kit/index\";\nimport { MFMailComposeViewController, MFMessageComposeViewController } from \"./message-ui/index\";\nimport { DataScannerViewController } from \"./data-scanner/index\";\nimport { CNContactViewController, CNMutableContact, CNContactStore } from \"./contact-ui/index\";\nconst Menu = Swift.Menu;\nconst ContextMenu = Swift.ContextMenu;\nexport {\n AppIcon,\n AppInfo,\n AppIntents,\n AppTracking,\n Audio,\n BackgroundTasks,\n CNContactStore,\n CNContactViewController,\n CNMutableContact,\n Calendar,\n CameraView,\n Compose,\n Contacts,\n ContextMenu,\n DataScannerViewController,\n Database,\n Device,\n DeviceAttestation,\n DocumentPicker,\n FileSystem,\n Haptics,\n ImageManipulator,\n ImagePicker,\n KeepAwake,\n LaunchScreen,\n LiveActivities,\n LocalAuthentication,\n Location,\n MFMailComposeViewController,\n MFMessageComposeViewController,\n MapServices,\n Menu,\n Motion,\n Notifications,\n Open,\n PhotoLibrary,\n Print,\n ProtectedStore,\n Purchases,\n QuickActions,\n ReservedRegions,\n ScreenCapture,\n ScreenOrientation,\n Share,\n Storage,\n StoreReview,\n TextInput,\n UI,\n VNDocumentCameraViewController,\n WidgetUI,\n Widgets,\n getHinge,\n getSizeClass,\n onHingeChange,\n useHinge,\n useKeepAwake,\n useNativeState,\n usePreventScreenCapture,\n useReservedRegions,\n useReservedRegionsReady,\n useSizeClass,\n useSpanning,\n useWindowSegments\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,MAAM,OAAO,MAAM;AACnB,MAAM,cAAc,MAAM"}
|
|
@@ -19,7 +19,7 @@ import { Compose } from "./compose";
|
|
|
19
19
|
import * as UI from "./effects/index.native.js";
|
|
20
20
|
import { LiveActivities, WidgetUI, Widgets } from "./widgets/index.native.js";
|
|
21
21
|
import { Storage } from "./storage/index.native.js";
|
|
22
|
-
import { KeepAwake } from "./keep-awake/index.native.js";
|
|
22
|
+
import { KeepAwake, useKeepAwake } from "./keep-awake/index.native.js";
|
|
23
23
|
import { Print } from "./print/index.native.js";
|
|
24
24
|
import { StoreReview } from "./store-review/index.native.js";
|
|
25
25
|
import { QuickActions } from "./quick-actions/index.native.js";
|
|
@@ -129,5 +129,5 @@ var Swift = Platform.OS === "ios" ? {
|
|
|
129
129
|
Map
|
|
130
130
|
} : Swift$1;
|
|
131
131
|
|
|
132
|
-
export { AppIcon, AppInfo, AppIntents, AppTracking, Audio, BackgroundTasks, CNContactStore, CNContactViewController, CNMutableContact, Calendar, CameraView, Compose, Contacts, ContextMenu, DataScannerViewController, Database, Device, DeviceAttestation, DocumentPicker, FileSystem, Haptics, ImageManipulator, ImagePicker, KeepAwake, LaunchScreen, LiveActivities, LocalAuthentication, Location, MFMailComposeViewController, MFMessageComposeViewController, MapServices, Menu, Motion, Notifications, Open, PhotoLibrary, Print, ProtectedStore, Purchases, QuickActions, ReservedRegions, ScreenCapture, ScreenOrientation, Share, Storage, StoreReview, Swift, TextInput, UI, VNDocumentCameraViewController, WidgetUI, Widgets, getHinge, getSizeClass, onHingeChange, useHinge, useNativeState, usePreventScreenCapture, useReservedRegions, useReservedRegionsReady, useSizeClass, useSpanning, useWindowSegments };
|
|
132
|
+
export { AppIcon, AppInfo, AppIntents, AppTracking, Audio, BackgroundTasks, CNContactStore, CNContactViewController, CNMutableContact, Calendar, CameraView, Compose, Contacts, ContextMenu, DataScannerViewController, Database, Device, DeviceAttestation, DocumentPicker, FileSystem, Haptics, ImageManipulator, ImagePicker, KeepAwake, LaunchScreen, LiveActivities, LocalAuthentication, Location, MFMailComposeViewController, MFMessageComposeViewController, MapServices, Menu, Motion, Notifications, Open, PhotoLibrary, Print, ProtectedStore, Purchases, QuickActions, ReservedRegions, ScreenCapture, ScreenOrientation, Share, Storage, StoreReview, Swift, TextInput, UI, VNDocumentCameraViewController, WidgetUI, Widgets, getHinge, getSizeClass, onHingeChange, useHinge, useKeepAwake, useNativeState, usePreventScreenCapture, useReservedRegions, useReservedRegionsReady, useSizeClass, useSpanning, useWindowSegments };
|
|
133
133
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["AndroidMenu","IOSMenu","AndroidContextMenu","IOSContextMenu","MapWithControls","UnsupportedSwift"],"sources":["esm/platform/index.native.js"],"sourcesContent":["import { Platform } from \"react-native\";\nimport { Swift as UnsupportedSwift } from \"./unsupported\";\nimport { Button, ControlGroup, DisclosureGroup, Divider, Form, Glass, GlassEffectContainer, GeometryReader, Group, GroupBox, ViewThatFits, HStack, Host, LabeledContent, LazyHStack, LazyVStack, LazyHGrid, LazyVGrid, Grid, GridRow, Link, List, Overlay, ViewSlot, ScrollView, ScrollViewReader, Section, Slot, Spacer, SwipeActions, VStack, ZStack } from \"./Containers.native\";\nimport { ContextMenu as AndroidContextMenu, Menu as AndroidMenu } from \"./AndroidMenu\";\nimport { ContextMenu as IOSContextMenu, Menu as IOSMenu } from \"./Menu.native\";\nimport { Page, Pager } from \"./Pager.native\";\nimport { Popover } from \"./Popover.native\";\nimport { NavigationStack, Toolbar, ToolbarItem, ToolbarItemGroup, ToolbarSpacer } from \"./NavigationStack.native\";\nimport { NavigationSplitView } from \"./NavigationSplitView.native\";\nimport { FullScreenCover, Sheet } from \"./Sheet.native\";\nimport { ArrangementView } from \"./ArrangementView.native\";\nimport { withAnimation } from \"./withAnimation.native\";\nimport { KeyframeAnimator, PhaseAnimator } from \"./Animators.native\";\nimport { CubicKeyframe, KeyframeTrack, LinearKeyframe, MoveKeyframe, SpringKeyframe } from \"./keyframes\";\nimport * as Controls from \"./generated/Controls.native\";\nimport { Map as MapWithControls } from \"./mapControls.native\";\nimport { Tab, Tabs, TabSection, TabViewBottomAccessory, TabViewSlot } from \"./Tabs.native\";\nimport { Compose } from \"./compose\";\nimport * as UI from \"./effects\";\nimport { Widgets, LiveActivities, WidgetUI } from \"./widgets/index\";\nexport * from \"./extras\";\nimport { Storage } from \"./storage/index.native\";\nimport { KeepAwake } from \"./keep-awake/index\";\nimport { Print } from \"./print/index\";\nimport { StoreReview } from \"./store-review/index\";\nimport { QuickActions } from \"./quick-actions/index\";\nimport { useSizeClass, getSizeClass, useHinge, getHinge, onHingeChange, ReservedRegions, useReservedRegions, useReservedRegionsReady, useWindowSegments, useSpanning } from \"./adaptive/index.native\";\nimport { Notifications } from \"./notifications\";\nimport { useNativeState } from \"./nativeState\";\nimport { TextInput } from \"./universal/TextInput/index\";\nimport { Haptics } from \"./haptics/index.native\";\nimport { LaunchScreen } from \"./launchScreen/index.native\";\nimport { LocalAuthentication } from \"./local-authentication/index\";\nimport { ProtectedStore } from \"./protected-store/index\";\nimport { Location } from \"./location/index\";\nimport { FileSystem } from \"./file-system/index.native\";\nimport { Audio } from \"./audio/index\";\nimport { CameraView } from \"./camera/index.native\";\nimport { Share } from \"./share/index\";\nimport { Open } from \"./open/index.native\";\nimport { PhotoLibrary } from \"./photo-library/index\";\nimport { MapServices } from \"./map-services/index\";\nimport { AppTracking } from \"./app-tracking/index\";\nimport { AppIcon } from \"./app-icon/index\";\nimport { ScreenOrientation } from \"./screen-orientation/index\";\nimport { ScreenCapture, usePreventScreenCapture } from \"./screen-capture/index\";\nimport { Purchases } from \"./purchases/index\";\nimport { ImageManipulator } from \"./image-manipulator/index.native\";\nimport { Device } from \"./device/index\";\nimport { Motion } from \"./motion/index.native\";\nimport { BackgroundTasks } from \"./background-tasks/index\";\nimport { AppIntents } from \"./app-intents/index\";\nimport { DeviceAttestation } from \"./device-attestation/index\";\nimport { Contacts } from \"./contacts/index\";\nimport { Calendar } from \"./calendar/index\";\nimport { AppInfo } from \"./app-info/index.native\";\nimport { ImagePicker } from \"./image-picker/index.native\";\nimport { DocumentPicker } from \"./document-picker/index.native\";\nimport { Database } from \"./database/index.native\";\nimport { VNDocumentCameraViewController } from \"./vision-kit/index\";\nimport { MFMailComposeViewController, MFMessageComposeViewController } from \"./message-ui/index\";\nimport { DataScannerViewController } from \"./data-scanner/index\";\nimport { CNContactViewController, CNMutableContact, CNContactStore } from \"./contact-ui/index\";\nvar Menu = Platform.OS === \"android\" ? AndroidMenu : IOSMenu;\nvar ContextMenu = Platform.OS === \"android\" ? AndroidContextMenu : IOSContextMenu;\nvar Swift = Platform.OS === \"ios\" ? {\n ArrangementView,\n Tabs,\n Tab,\n TabSection,\n TabViewBottomAccessory,\n TabViewSlot,\n Menu,\n ContextMenu,\n Sheet,\n FullScreenCover,\n Popover,\n Host,\n HStack,\n VStack,\n ZStack,\n Form,\n Section,\n Glass,\n GlassEffectContainer,\n GeometryReader,\n LabeledContent,\n Button,\n List,\n ScrollView,\n ScrollViewReader,\n LazyVStack,\n LazyHStack,\n LazyVGrid,\n LazyHGrid,\n Grid,\n GridRow,\n ControlGroup,\n DisclosureGroup,\n Divider,\n Link,\n Group,\n GroupBox,\n ViewThatFits,\n Overlay,\n ViewSlot,\n SwipeActions,\n Pager,\n Page,\n NavigationStack,\n NavigationSplitView,\n Toolbar,\n ToolbarItem,\n ToolbarItemGroup,\n ToolbarSpacer,\n Spacer,\n Slot,\n withAnimation,\n PhaseAnimator,\n KeyframeAnimator,\n KeyframeTrack,\n LinearKeyframe,\n SpringKeyframe,\n CubicKeyframe,\n MoveKeyframe,\n ...Controls,\n // the generated map takes no children; the wrapper validates and names\n // the map-controls slot while the native view composes it.\n Map: MapWithControls\n} : UnsupportedSwift;\nexport {\n AppIcon,\n AppInfo,\n AppIntents,\n AppTracking,\n Audio,\n BackgroundTasks,\n CNContactStore,\n CNContactViewController,\n CNMutableContact,\n Calendar,\n CameraView,\n Compose,\n Contacts,\n ContextMenu,\n DataScannerViewController,\n Database,\n Device,\n DeviceAttestation,\n DocumentPicker,\n FileSystem,\n Haptics,\n ImageManipulator,\n ImagePicker,\n KeepAwake,\n LaunchScreen,\n LiveActivities,\n LocalAuthentication,\n Location,\n MFMailComposeViewController,\n MFMessageComposeViewController,\n MapServices,\n Menu,\n Motion,\n Notifications,\n Open,\n PhotoLibrary,\n Print,\n ProtectedStore,\n Purchases,\n QuickActions,\n ReservedRegions,\n ScreenCapture,\n ScreenOrientation,\n Share,\n Storage,\n StoreReview,\n Swift,\n TextInput,\n UI,\n VNDocumentCameraViewController,\n WidgetUI,\n Widgets,\n getHinge,\n getSizeClass,\n onHingeChange,\n useHinge,\n useNativeState,\n usePreventScreenCapture,\n useReservedRegions,\n useReservedRegionsReady,\n useSizeClass,\n useSpanning,\n useWindowSegments\n};\n//# sourceMappingURL=index.native.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,IAAI,OAAO,SAAS,OAAO,YAAYA,SAAcC;AACrD,IAAI,cAAc,SAAS,OAAO,YAAYC,gBAAqBC;AACnE,IAAI,QAAQ,SAAS,OAAO,QAAQ;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GAAG;CAGEC;AACP,IAAIC"}
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["AndroidMenu","IOSMenu","AndroidContextMenu","IOSContextMenu","MapWithControls","UnsupportedSwift"],"sources":["esm/platform/index.native.js"],"sourcesContent":["import { Platform } from \"react-native\";\nimport { Swift as UnsupportedSwift } from \"./unsupported\";\nimport { Button, ControlGroup, DisclosureGroup, Divider, Form, Glass, GlassEffectContainer, GeometryReader, Group, GroupBox, ViewThatFits, HStack, Host, LabeledContent, LazyHStack, LazyVStack, LazyHGrid, LazyVGrid, Grid, GridRow, Link, List, Overlay, ViewSlot, ScrollView, ScrollViewReader, Section, Slot, Spacer, SwipeActions, VStack, ZStack } from \"./Containers.native\";\nimport { ContextMenu as AndroidContextMenu, Menu as AndroidMenu } from \"./AndroidMenu\";\nimport { ContextMenu as IOSContextMenu, Menu as IOSMenu } from \"./Menu.native\";\nimport { Page, Pager } from \"./Pager.native\";\nimport { Popover } from \"./Popover.native\";\nimport { NavigationStack, Toolbar, ToolbarItem, ToolbarItemGroup, ToolbarSpacer } from \"./NavigationStack.native\";\nimport { NavigationSplitView } from \"./NavigationSplitView.native\";\nimport { FullScreenCover, Sheet } from \"./Sheet.native\";\nimport { ArrangementView } from \"./ArrangementView.native\";\nimport { withAnimation } from \"./withAnimation.native\";\nimport { KeyframeAnimator, PhaseAnimator } from \"./Animators.native\";\nimport { CubicKeyframe, KeyframeTrack, LinearKeyframe, MoveKeyframe, SpringKeyframe } from \"./keyframes\";\nimport * as Controls from \"./generated/Controls.native\";\nimport { Map as MapWithControls } from \"./mapControls.native\";\nimport { Tab, Tabs, TabSection, TabViewBottomAccessory, TabViewSlot } from \"./Tabs.native\";\nimport { Compose } from \"./compose\";\nimport * as UI from \"./effects\";\nimport { Widgets, LiveActivities, WidgetUI } from \"./widgets/index\";\nexport * from \"./extras\";\nimport { Storage } from \"./storage/index.native\";\nimport { KeepAwake, useKeepAwake } from \"./keep-awake/index\";\nimport { Print } from \"./print/index\";\nimport { StoreReview } from \"./store-review/index\";\nimport { QuickActions } from \"./quick-actions/index\";\nimport { useSizeClass, getSizeClass, useHinge, getHinge, onHingeChange, ReservedRegions, useReservedRegions, useReservedRegionsReady, useWindowSegments, useSpanning } from \"./adaptive/index.native\";\nimport { Notifications } from \"./notifications\";\nimport { useNativeState } from \"./nativeState\";\nimport { TextInput } from \"./universal/TextInput/index\";\nimport { Haptics } from \"./haptics/index.native\";\nimport { LaunchScreen } from \"./launchScreen/index.native\";\nimport { LocalAuthentication } from \"./local-authentication/index\";\nimport { ProtectedStore } from \"./protected-store/index\";\nimport { Location } from \"./location/index\";\nimport { FileSystem } from \"./file-system/index.native\";\nimport { Audio } from \"./audio/index\";\nimport { CameraView } from \"./camera/index.native\";\nimport { Share } from \"./share/index\";\nimport { Open } from \"./open/index.native\";\nimport { PhotoLibrary } from \"./photo-library/index\";\nimport { MapServices } from \"./map-services/index\";\nimport { AppTracking } from \"./app-tracking/index\";\nimport { AppIcon } from \"./app-icon/index\";\nimport { ScreenOrientation } from \"./screen-orientation/index\";\nimport { ScreenCapture, usePreventScreenCapture } from \"./screen-capture/index\";\nimport { Purchases } from \"./purchases/index\";\nimport { ImageManipulator } from \"./image-manipulator/index.native\";\nimport { Device } from \"./device/index\";\nimport { Motion } from \"./motion/index.native\";\nimport { BackgroundTasks } from \"./background-tasks/index\";\nimport { AppIntents } from \"./app-intents/index\";\nimport { DeviceAttestation } from \"./device-attestation/index\";\nimport { Contacts } from \"./contacts/index\";\nimport { Calendar } from \"./calendar/index\";\nimport { AppInfo } from \"./app-info/index.native\";\nimport { ImagePicker } from \"./image-picker/index.native\";\nimport { DocumentPicker } from \"./document-picker/index.native\";\nimport { Database } from \"./database/index.native\";\nimport { VNDocumentCameraViewController } from \"./vision-kit/index\";\nimport { MFMailComposeViewController, MFMessageComposeViewController } from \"./message-ui/index\";\nimport { DataScannerViewController } from \"./data-scanner/index\";\nimport { CNContactViewController, CNMutableContact, CNContactStore } from \"./contact-ui/index\";\nvar Menu = Platform.OS === \"android\" ? AndroidMenu : IOSMenu;\nvar ContextMenu = Platform.OS === \"android\" ? AndroidContextMenu : IOSContextMenu;\nvar Swift = Platform.OS === \"ios\" ? {\n ArrangementView,\n Tabs,\n Tab,\n TabSection,\n TabViewBottomAccessory,\n TabViewSlot,\n Menu,\n ContextMenu,\n Sheet,\n FullScreenCover,\n Popover,\n Host,\n HStack,\n VStack,\n ZStack,\n Form,\n Section,\n Glass,\n GlassEffectContainer,\n GeometryReader,\n LabeledContent,\n Button,\n List,\n ScrollView,\n ScrollViewReader,\n LazyVStack,\n LazyHStack,\n LazyVGrid,\n LazyHGrid,\n Grid,\n GridRow,\n ControlGroup,\n DisclosureGroup,\n Divider,\n Link,\n Group,\n GroupBox,\n ViewThatFits,\n Overlay,\n ViewSlot,\n SwipeActions,\n Pager,\n Page,\n NavigationStack,\n NavigationSplitView,\n Toolbar,\n ToolbarItem,\n ToolbarItemGroup,\n ToolbarSpacer,\n Spacer,\n Slot,\n withAnimation,\n PhaseAnimator,\n KeyframeAnimator,\n KeyframeTrack,\n LinearKeyframe,\n SpringKeyframe,\n CubicKeyframe,\n MoveKeyframe,\n ...Controls,\n // the generated map takes no children; the wrapper validates and names\n // the map-controls slot while the native view composes it.\n Map: MapWithControls\n} : UnsupportedSwift;\nexport {\n AppIcon,\n AppInfo,\n AppIntents,\n AppTracking,\n Audio,\n BackgroundTasks,\n CNContactStore,\n CNContactViewController,\n CNMutableContact,\n Calendar,\n CameraView,\n Compose,\n Contacts,\n ContextMenu,\n DataScannerViewController,\n Database,\n Device,\n DeviceAttestation,\n DocumentPicker,\n FileSystem,\n Haptics,\n ImageManipulator,\n ImagePicker,\n KeepAwake,\n LaunchScreen,\n LiveActivities,\n LocalAuthentication,\n Location,\n MFMailComposeViewController,\n MFMessageComposeViewController,\n MapServices,\n Menu,\n Motion,\n Notifications,\n Open,\n PhotoLibrary,\n Print,\n ProtectedStore,\n Purchases,\n QuickActions,\n ReservedRegions,\n ScreenCapture,\n ScreenOrientation,\n Share,\n Storage,\n StoreReview,\n Swift,\n TextInput,\n UI,\n VNDocumentCameraViewController,\n WidgetUI,\n Widgets,\n getHinge,\n getSizeClass,\n onHingeChange,\n useHinge,\n useKeepAwake,\n useNativeState,\n usePreventScreenCapture,\n useReservedRegions,\n useReservedRegionsReady,\n useSizeClass,\n useSpanning,\n useWindowSegments\n};\n//# sourceMappingURL=index.native.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,IAAI,OAAO,SAAS,OAAO,YAAYA,SAAcC;AACrD,IAAI,cAAc,SAAS,OAAO,YAAYC,gBAAqBC;AACnE,IAAI,QAAQ,SAAS,OAAO,QAAQ;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GAAG;CAGEC;AACP,IAAIC"}
|
|
@@ -1,27 +1,63 @@
|
|
|
1
|
+
import { useEffect, useId } from "react";
|
|
1
2
|
import { KeepAwake as KeepAwake$1 } from "./unavailable.mjs";
|
|
2
|
-
import { assertKeepAwakeEnabled } from "./validate.mjs";
|
|
3
|
+
import { assertKeepAwakeEnabled, assertKeepAwakeTag, normalizeKeepAwakeTag } from "./validate.mjs";
|
|
3
4
|
|
|
5
|
+
const active = /* @__PURE__ */ new Set();
|
|
4
6
|
let lock;
|
|
5
7
|
let operation = Promise.resolve();
|
|
8
|
+
function live() {
|
|
9
|
+
return !!lock && !lock.released;
|
|
10
|
+
}
|
|
11
|
+
function apply(owner) {
|
|
12
|
+
const next = operation.catch(() => {}).then(async () => {
|
|
13
|
+
if (active.size === 0) {
|
|
14
|
+
await lock?.release();
|
|
15
|
+
lock = void 0;
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (live()) return;
|
|
19
|
+
if (!navigator.wakeLock) throw new Error(`KeepAwake.${owner}: Screen Wake Lock is unavailable`);
|
|
20
|
+
lock = await navigator.wakeLock.request("screen");
|
|
21
|
+
});
|
|
22
|
+
operation = next;
|
|
23
|
+
return next;
|
|
24
|
+
}
|
|
6
25
|
const KeepAwake = Object.freeze({
|
|
7
|
-
isEnabled: async () => typeof window !== "undefined" &&
|
|
26
|
+
isEnabled: async () => typeof window !== "undefined" && active.size > 0 && live(),
|
|
8
27
|
setEnabled: (enabled) => {
|
|
9
28
|
assertKeepAwakeEnabled(enabled);
|
|
10
29
|
if (typeof window === "undefined") return KeepAwake$1.setEnabled(enabled);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
if (enabled) active.add(normalizeKeepAwakeTag(void 0));
|
|
31
|
+
else active.delete(normalizeKeepAwakeTag(void 0));
|
|
32
|
+
return apply("setEnabled");
|
|
33
|
+
},
|
|
34
|
+
activate: (tag) => {
|
|
35
|
+
assertKeepAwakeTag(tag, "activate");
|
|
36
|
+
if (typeof window === "undefined") return KeepAwake$1.activate(tag);
|
|
37
|
+
active.add(normalizeKeepAwakeTag(tag));
|
|
38
|
+
return apply("activate");
|
|
39
|
+
},
|
|
40
|
+
deactivate: (tag) => {
|
|
41
|
+
assertKeepAwakeTag(tag, "deactivate");
|
|
42
|
+
if (typeof window === "undefined") return KeepAwake$1.deactivate(tag);
|
|
43
|
+
active.delete(normalizeKeepAwakeTag(tag));
|
|
44
|
+
return apply("deactivate");
|
|
23
45
|
}
|
|
24
46
|
});
|
|
47
|
+
function useKeepAwake(tag) {
|
|
48
|
+
const fallback = useId();
|
|
49
|
+
assertKeepAwakeTag(tag, "useKeepAwake");
|
|
50
|
+
const effective = tag ?? fallback;
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (typeof window === "undefined") return;
|
|
53
|
+
KeepAwake.activate(effective).catch((error) => {
|
|
54
|
+
console.error(`Failed to keep the screen awake: ${String(error)}`);
|
|
55
|
+
});
|
|
56
|
+
return () => {
|
|
57
|
+
KeepAwake.deactivate(effective).catch(() => {});
|
|
58
|
+
};
|
|
59
|
+
}, [effective]);
|
|
60
|
+
}
|
|
25
61
|
|
|
26
|
-
export { KeepAwake };
|
|
62
|
+
export { KeepAwake, useKeepAwake };
|
|
27
63
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["unavailable"],"sources":["esm/platform/keep-awake/index.js"],"sourcesContent":["import { KeepAwake as unavailable } from \"./unavailable\";\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","names":["unavailable"],"sources":["esm/platform/keep-awake/index.js"],"sourcesContent":["import { useEffect, useId } from \"react\";\nimport { KeepAwake as unavailable } from \"./unavailable\";\nimport {\n assertKeepAwakeEnabled,\n assertKeepAwakeTag,\n normalizeKeepAwakeTag\n} from \"./validate\";\nconst active = /* @__PURE__ */ new Set();\nlet lock;\nlet operation = Promise.resolve();\nfunction live() {\n return !!lock && !lock.released;\n}\nfunction apply(owner) {\n const next = operation.catch(() => {\n }).then(async () => {\n if (active.size === 0) {\n await lock?.release();\n lock = void 0;\n return;\n }\n if (live()) return;\n if (!navigator.wakeLock)\n throw new Error(`KeepAwake.${owner}: Screen Wake Lock is unavailable`);\n lock = await navigator.wakeLock.request(\"screen\");\n });\n operation = next;\n return next;\n}\nconst KeepAwake = Object.freeze({\n isEnabled: async () => typeof window !== \"undefined\" && active.size > 0 && live(),\n setEnabled: (enabled) => {\n assertKeepAwakeEnabled(enabled);\n if (typeof window === \"undefined\") return unavailable.setEnabled(enabled);\n if (enabled) active.add(normalizeKeepAwakeTag(void 0));\n else active.delete(normalizeKeepAwakeTag(void 0));\n return apply(\"setEnabled\");\n },\n activate: (tag) => {\n assertKeepAwakeTag(tag, \"activate\");\n if (typeof window === \"undefined\") return unavailable.activate(tag);\n active.add(normalizeKeepAwakeTag(tag));\n return apply(\"activate\");\n },\n deactivate: (tag) => {\n assertKeepAwakeTag(tag, \"deactivate\");\n if (typeof window === \"undefined\") return unavailable.deactivate(tag);\n active.delete(normalizeKeepAwakeTag(tag));\n return apply(\"deactivate\");\n }\n});\nfunction useKeepAwake(tag) {\n const fallback = useId();\n assertKeepAwakeTag(tag, \"useKeepAwake\");\n const effective = tag ?? fallback;\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n KeepAwake.activate(effective).catch((error) => {\n console.error(`Failed to keep the screen awake: ${String(error)}`);\n });\n return () => {\n KeepAwake.deactivate(effective).catch(() => {\n });\n };\n }, [effective]);\n}\nexport {\n KeepAwake,\n useKeepAwake\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;AAOA,MAAM,yBAAyB,IAAI,IAAI;AACvC,IAAI;AACJ,IAAI,YAAY,QAAQ,QAAQ;AAChC,SAAS,OAAO;CACd,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK;AACzB;AACA,SAAS,MAAM,OAAO;CACpB,MAAM,OAAO,UAAU,YAAY,CACnC,CAAC,CAAC,CAAC,KAAK,YAAY;EAClB,IAAI,OAAO,SAAS,GAAG;GACrB,MAAM,MAAM,QAAQ;GACpB,OAAO,KAAK;GACZ;EACF;EACA,IAAI,KAAK,GAAG;EACZ,IAAI,CAAC,UAAU,UACb,MAAM,IAAI,MAAM,aAAa,MAAM,kCAAkC;EACvE,OAAO,MAAM,UAAU,SAAS,QAAQ,QAAQ;CAClD,CAAC;CACD,YAAY;CACZ,OAAO;AACT;AACA,MAAM,YAAY,OAAO,OAAO;CAC9B,WAAW,YAAY,OAAO,WAAW,eAAe,OAAO,OAAO,KAAK,KAAK;CAChF,aAAa,YAAY;EACvB,uBAAuB,OAAO;EAC9B,IAAI,OAAO,WAAW,aAAa,OAAOA,YAAY,WAAW,OAAO;EACxE,IAAI,SAAS,OAAO,IAAI,sBAAsB,KAAK,CAAC,CAAC;OAChD,OAAO,OAAO,sBAAsB,KAAK,CAAC,CAAC;EAChD,OAAO,MAAM,YAAY;CAC3B;CACA,WAAW,QAAQ;EACjB,mBAAmB,KAAK,UAAU;EAClC,IAAI,OAAO,WAAW,aAAa,OAAOA,YAAY,SAAS,GAAG;EAClE,OAAO,IAAI,sBAAsB,GAAG,CAAC;EACrC,OAAO,MAAM,UAAU;CACzB;CACA,aAAa,QAAQ;EACnB,mBAAmB,KAAK,YAAY;EACpC,IAAI,OAAO,WAAW,aAAa,OAAOA,YAAY,WAAW,GAAG;EACpE,OAAO,OAAO,sBAAsB,GAAG,CAAC;EACxC,OAAO,MAAM,YAAY;CAC3B;AACF,CAAC;AACD,SAAS,aAAa,KAAK;CACzB,MAAM,WAAW,MAAM;CACvB,mBAAmB,KAAK,cAAc;CACtC,MAAM,YAAY,OAAO;CACzB,gBAAgB;EACd,IAAI,OAAO,WAAW,aAAa;EACnC,UAAU,SAAS,SAAS,CAAC,CAAC,OAAO,UAAU;GAC7C,QAAQ,MAAM,oCAAoC,OAAO,KAAK,GAAG;EACnE,CAAC;EACD,aAAa;GACX,UAAU,WAAW,SAAS,CAAC,CAAC,YAAY,CAC5C,CAAC;EACH;CACF,GAAG,CAAC,SAAS,CAAC;AAChB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { useEffect, useId } from "react";
|
|
1
2
|
import { NitroModules } from "react-native-nitro-modules";
|
|
2
3
|
import { rethrowNativeError } from "../nativeError.native.js";
|
|
3
|
-
import { assertKeepAwakeEnabled } from "./validate.native.js";
|
|
4
|
+
import { assertKeepAwakeEnabled, assertKeepAwakeTag, normalizeKeepAwakeTag } from "./validate.native.js";
|
|
4
5
|
|
|
5
6
|
var hybrid;
|
|
6
7
|
function native() {
|
|
@@ -14,10 +15,33 @@ function setEnabled(enabled) {
|
|
|
14
15
|
assertKeepAwakeEnabled(enabled);
|
|
15
16
|
return native().setEnabled(enabled).catch(rethrowNativeError);
|
|
16
17
|
}
|
|
18
|
+
function activate(tag) {
|
|
19
|
+
assertKeepAwakeTag(tag, "activate");
|
|
20
|
+
return native().activate(normalizeKeepAwakeTag(tag)).catch(rethrowNativeError);
|
|
21
|
+
}
|
|
22
|
+
function deactivate(tag) {
|
|
23
|
+
assertKeepAwakeTag(tag, "deactivate");
|
|
24
|
+
return native().deactivate(normalizeKeepAwakeTag(tag)).catch(rethrowNativeError);
|
|
25
|
+
}
|
|
26
|
+
function useKeepAwake(tag) {
|
|
27
|
+
var fallback = useId();
|
|
28
|
+
assertKeepAwakeTag(tag, "useKeepAwake");
|
|
29
|
+
var effective = tag !== null && tag !== void 0 ? tag : fallback;
|
|
30
|
+
useEffect(function() {
|
|
31
|
+
activate(effective).catch(function(error) {
|
|
32
|
+
console.error(`Failed to keep the screen awake: ${String(error)}`);
|
|
33
|
+
});
|
|
34
|
+
return function() {
|
|
35
|
+
deactivate(effective).catch(function() {});
|
|
36
|
+
};
|
|
37
|
+
}, [effective]);
|
|
38
|
+
}
|
|
17
39
|
var KeepAwake = Object.freeze({
|
|
18
40
|
isEnabled,
|
|
19
|
-
setEnabled
|
|
41
|
+
setEnabled,
|
|
42
|
+
activate,
|
|
43
|
+
deactivate
|
|
20
44
|
});
|
|
21
45
|
|
|
22
|
-
export { KeepAwake };
|
|
46
|
+
export { KeepAwake, useKeepAwake };
|
|
23
47
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["esm/platform/keep-awake/index.native.js"],"sourcesContent":["import { NitroModules } from \"react-native-nitro-modules\";\nimport { rethrowNativeError } from \"../nativeError\";\nimport { assertKeepAwakeEnabled } from \"./validate\";\nvar hybrid;\nfunction native() {\n hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = NitroModules.createHybridObject(\"OneKeepAwake\");\n return hybrid;\n}\nfunction isEnabled() {\n return native().isEnabled().catch(rethrowNativeError);\n}\nfunction setEnabled(enabled) {\n assertKeepAwakeEnabled(enabled);\n return native().setEnabled(enabled).catch(rethrowNativeError);\n}\nvar KeepAwake = Object.freeze({\n isEnabled,\n setEnabled\n});\nexport {\n KeepAwake\n};\n//# sourceMappingURL=index.native.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["esm/platform/keep-awake/index.native.js"],"sourcesContent":["import { useEffect, useId } from \"react\";\nimport { NitroModules } from \"react-native-nitro-modules\";\nimport { rethrowNativeError } from \"../nativeError\";\nimport { assertKeepAwakeEnabled, assertKeepAwakeTag, normalizeKeepAwakeTag } from \"./validate\";\nvar hybrid;\nfunction native() {\n hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = NitroModules.createHybridObject(\"OneKeepAwake\");\n return hybrid;\n}\nfunction isEnabled() {\n return native().isEnabled().catch(rethrowNativeError);\n}\nfunction setEnabled(enabled) {\n assertKeepAwakeEnabled(enabled);\n return native().setEnabled(enabled).catch(rethrowNativeError);\n}\nfunction activate(tag) {\n assertKeepAwakeTag(tag, \"activate\");\n return native().activate(normalizeKeepAwakeTag(tag)).catch(rethrowNativeError);\n}\nfunction deactivate(tag) {\n assertKeepAwakeTag(tag, \"deactivate\");\n return native().deactivate(normalizeKeepAwakeTag(tag)).catch(rethrowNativeError);\n}\nfunction useKeepAwake(tag) {\n var fallback = useId();\n assertKeepAwakeTag(tag, \"useKeepAwake\");\n var effective = tag !== null && tag !== void 0 ? tag : fallback;\n useEffect(function() {\n activate(effective).catch(function(error) {\n console.error(`Failed to keep the screen awake: ${String(error)}`);\n });\n return function() {\n deactivate(effective).catch(function() {\n });\n };\n }, [\n effective\n ]);\n}\nvar KeepAwake = Object.freeze({\n isEnabled,\n setEnabled,\n activate,\n deactivate\n});\nexport {\n KeepAwake,\n useKeepAwake\n};\n//# sourceMappingURL=index.native.js.map\n"],"mappings":";;;;;;AAIA,IAAI;AACJ,SAAS,SAAS;CAChB,WAAW,QAAQ,WAAW,KAAK,IAAI,SAAS,SAAS,aAAa,mBAAmB,cAAc;CACvG,OAAO;AACT;AACA,SAAS,YAAY;CACnB,OAAO,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,kBAAkB;AACtD;AACA,SAAS,WAAW,SAAS;CAC3B,uBAAuB,OAAO;CAC9B,OAAO,OAAO,CAAC,CAAC,WAAW,OAAO,CAAC,CAAC,MAAM,kBAAkB;AAC9D;AACA,SAAS,SAAS,KAAK;CACrB,mBAAmB,KAAK,UAAU;CAClC,OAAO,OAAO,CAAC,CAAC,SAAS,sBAAsB,GAAG,CAAC,CAAC,CAAC,MAAM,kBAAkB;AAC/E;AACA,SAAS,WAAW,KAAK;CACvB,mBAAmB,KAAK,YAAY;CACpC,OAAO,OAAO,CAAC,CAAC,WAAW,sBAAsB,GAAG,CAAC,CAAC,CAAC,MAAM,kBAAkB;AACjF;AACA,SAAS,aAAa,KAAK;CACzB,IAAI,WAAW,MAAM;CACrB,mBAAmB,KAAK,cAAc;CACtC,IAAI,YAAY,QAAQ,QAAQ,QAAQ,KAAK,IAAI,MAAM;CACvD,UAAU,WAAW;EACnB,SAAS,SAAS,CAAC,CAAC,MAAM,SAAS,OAAO;GACxC,QAAQ,MAAM,oCAAoC,OAAO,KAAK,GAAG;EACnE,CAAC;EACD,OAAO,WAAW;GAChB,WAAW,SAAS,CAAC,CAAC,MAAM,WAAW,CACvC,CAAC;EACH;CACF,GAAG,CACD,SACF,CAAC;AACH;AACA,IAAI,YAAY,OAAO,OAAO;CAC5B;CACA;CACA;CACA;AACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assertKeepAwakeEnabled } from "./validate.mjs";
|
|
1
|
+
import { assertKeepAwakeEnabled, assertKeepAwakeTag } from "./validate.mjs";
|
|
2
2
|
|
|
3
3
|
function isEnabled() {
|
|
4
4
|
return Promise.resolve(false);
|
|
@@ -7,9 +7,19 @@ function setEnabled(enabled) {
|
|
|
7
7
|
assertKeepAwakeEnabled(enabled);
|
|
8
8
|
return Promise.resolve();
|
|
9
9
|
}
|
|
10
|
+
function activate(tag) {
|
|
11
|
+
assertKeepAwakeTag(tag, "activate");
|
|
12
|
+
return Promise.resolve();
|
|
13
|
+
}
|
|
14
|
+
function deactivate(tag) {
|
|
15
|
+
assertKeepAwakeTag(tag, "deactivate");
|
|
16
|
+
return Promise.resolve();
|
|
17
|
+
}
|
|
10
18
|
const KeepAwake = Object.freeze({
|
|
11
19
|
isEnabled,
|
|
12
|
-
setEnabled
|
|
20
|
+
setEnabled,
|
|
21
|
+
activate,
|
|
22
|
+
deactivate
|
|
13
23
|
});
|
|
14
24
|
|
|
15
25
|
export { KeepAwake };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unavailable.js","names":[],"sources":["esm/platform/keep-awake/unavailable.js"],"sourcesContent":["import { assertKeepAwakeEnabled } from \"./validate\";\nfunction isEnabled() {\n return Promise.resolve(false);\n}\nfunction setEnabled(enabled) {\n assertKeepAwakeEnabled(enabled);\n return Promise.resolve();\n}\nconst KeepAwake = Object.freeze({ isEnabled, setEnabled });\nexport {\n KeepAwake\n};\n//# sourceMappingURL=unavailable.js.map\n"],"mappings":";;;AACA,SAAS,YAAY;CACnB,OAAO,QAAQ,QAAQ,KAAK;AAC9B;AACA,SAAS,WAAW,SAAS;CAC3B,uBAAuB,OAAO;CAC9B,OAAO,QAAQ,QAAQ;AACzB;AACA,MAAM,YAAY,OAAO,OAAO;CAAE;CAAW;AAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"unavailable.js","names":[],"sources":["esm/platform/keep-awake/unavailable.js"],"sourcesContent":["import { assertKeepAwakeEnabled, assertKeepAwakeTag } from \"./validate\";\nfunction isEnabled() {\n return Promise.resolve(false);\n}\nfunction setEnabled(enabled) {\n assertKeepAwakeEnabled(enabled);\n return Promise.resolve();\n}\nfunction activate(tag) {\n assertKeepAwakeTag(tag, \"activate\");\n return Promise.resolve();\n}\nfunction deactivate(tag) {\n assertKeepAwakeTag(tag, \"deactivate\");\n return Promise.resolve();\n}\nconst KeepAwake = Object.freeze({ isEnabled, setEnabled, activate, deactivate });\nexport {\n KeepAwake\n};\n//# sourceMappingURL=unavailable.js.map\n"],"mappings":";;;AACA,SAAS,YAAY;CACnB,OAAO,QAAQ,QAAQ,KAAK;AAC9B;AACA,SAAS,WAAW,SAAS;CAC3B,uBAAuB,OAAO;CAC9B,OAAO,QAAQ,QAAQ;AACzB;AACA,SAAS,SAAS,KAAK;CACrB,mBAAmB,KAAK,UAAU;CAClC,OAAO,QAAQ,QAAQ;AACzB;AACA,SAAS,WAAW,KAAK;CACvB,mBAAmB,KAAK,YAAY;CACpC,OAAO,QAAQ,QAAQ;AACzB;AACA,MAAM,YAAY,OAAO,OAAO;CAAE;CAAW;CAAY;CAAU;AAAW,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assertKeepAwakeEnabled } from "./validate.native.js";
|
|
1
|
+
import { assertKeepAwakeEnabled, assertKeepAwakeTag } from "./validate.native.js";
|
|
2
2
|
|
|
3
3
|
function isEnabled() {
|
|
4
4
|
return Promise.resolve(false);
|
|
@@ -7,9 +7,19 @@ function setEnabled(enabled) {
|
|
|
7
7
|
assertKeepAwakeEnabled(enabled);
|
|
8
8
|
return Promise.resolve();
|
|
9
9
|
}
|
|
10
|
+
function activate(tag) {
|
|
11
|
+
assertKeepAwakeTag(tag, "activate");
|
|
12
|
+
return Promise.resolve();
|
|
13
|
+
}
|
|
14
|
+
function deactivate(tag) {
|
|
15
|
+
assertKeepAwakeTag(tag, "deactivate");
|
|
16
|
+
return Promise.resolve();
|
|
17
|
+
}
|
|
10
18
|
var KeepAwake = Object.freeze({
|
|
11
19
|
isEnabled,
|
|
12
|
-
setEnabled
|
|
20
|
+
setEnabled,
|
|
21
|
+
activate,
|
|
22
|
+
deactivate
|
|
13
23
|
});
|
|
14
24
|
|
|
15
25
|
export { KeepAwake };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unavailable.native.js","names":[],"sources":["esm/platform/keep-awake/unavailable.native.js"],"sourcesContent":["import { assertKeepAwakeEnabled } from \"./validate\";\nfunction isEnabled() {\n return Promise.resolve(false);\n}\nfunction setEnabled(enabled) {\n assertKeepAwakeEnabled(enabled);\n return Promise.resolve();\n}\nvar KeepAwake = Object.freeze({\n isEnabled,\n setEnabled\n});\nexport {\n KeepAwake\n};\n//# sourceMappingURL=unavailable.js.map\n"],"mappings":";;;AACA,SAAS,YAAY;CACnB,OAAO,QAAQ,QAAQ,KAAK;AAC9B;AACA,SAAS,WAAW,SAAS;CAC3B,uBAAuB,OAAO;CAC9B,OAAO,QAAQ,QAAQ;AACzB;AACA,IAAI,YAAY,OAAO,OAAO;CAC5B;CACA;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"unavailable.native.js","names":[],"sources":["esm/platform/keep-awake/unavailable.native.js"],"sourcesContent":["import { assertKeepAwakeEnabled, assertKeepAwakeTag } from \"./validate\";\nfunction isEnabled() {\n return Promise.resolve(false);\n}\nfunction setEnabled(enabled) {\n assertKeepAwakeEnabled(enabled);\n return Promise.resolve();\n}\nfunction activate(tag) {\n assertKeepAwakeTag(tag, \"activate\");\n return Promise.resolve();\n}\nfunction deactivate(tag) {\n assertKeepAwakeTag(tag, \"deactivate\");\n return Promise.resolve();\n}\nvar KeepAwake = Object.freeze({\n isEnabled,\n setEnabled,\n activate,\n deactivate\n});\nexport {\n KeepAwake\n};\n//# sourceMappingURL=unavailable.js.map\n"],"mappings":";;;AACA,SAAS,YAAY;CACnB,OAAO,QAAQ,QAAQ,KAAK;AAC9B;AACA,SAAS,WAAW,SAAS;CAC3B,uBAAuB,OAAO;CAC9B,OAAO,QAAQ,QAAQ;AACzB;AACA,SAAS,SAAS,KAAK;CACrB,mBAAmB,KAAK,UAAU;CAClC,OAAO,QAAQ,QAAQ;AACzB;AACA,SAAS,WAAW,KAAK;CACvB,mBAAmB,KAAK,YAAY;CACpC,OAAO,QAAQ,QAAQ;AACzB;AACA,IAAI,YAAY,OAAO,OAAO;CAC5B;CACA;CACA;CACA;AACF,CAAC"}
|
|
@@ -3,6 +3,15 @@ function assertKeepAwakeEnabled(value) {
|
|
|
3
3
|
throw new Error("KeepAwake.setEnabled: enabled must be a boolean");
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
|
+
const keepAwakeDefaultTag = "ExpoKeepAwakeDefaultTag";
|
|
7
|
+
function assertKeepAwakeTag(value, owner) {
|
|
8
|
+
if (value !== void 0 && typeof value !== "string") {
|
|
9
|
+
throw new Error(`KeepAwake.${owner}: tag must be a string`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function normalizeKeepAwakeTag(value) {
|
|
13
|
+
return value ?? "ExpoKeepAwakeDefaultTag";
|
|
14
|
+
}
|
|
6
15
|
|
|
7
|
-
export { assertKeepAwakeEnabled };
|
|
16
|
+
export { assertKeepAwakeEnabled, assertKeepAwakeTag, keepAwakeDefaultTag, normalizeKeepAwakeTag };
|
|
8
17
|
//# sourceMappingURL=validate.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","names":[],"sources":["esm/platform/keep-awake/validate.js"],"sourcesContent":["function assertKeepAwakeEnabled(value) {\n if (typeof value !== \"boolean\") {\n throw new Error(\"KeepAwake.setEnabled: enabled must be a boolean\");\n }\n}\nexport {\n assertKeepAwakeEnabled\n};\n//# sourceMappingURL=validate.js.map\n"],"mappings":";AAAA,SAAS,uBAAuB,OAAO;CACrC,IAAI,OAAO,UAAU,WAAW;EAC9B,MAAM,IAAI,MAAM,iDAAiD;CACnE;AACF"}
|
|
1
|
+
{"version":3,"file":"validate.js","names":[],"sources":["esm/platform/keep-awake/validate.js"],"sourcesContent":["function assertKeepAwakeEnabled(value) {\n if (typeof value !== \"boolean\") {\n throw new Error(\"KeepAwake.setEnabled: enabled must be a boolean\");\n }\n}\nconst keepAwakeDefaultTag = \"ExpoKeepAwakeDefaultTag\";\nfunction assertKeepAwakeTag(value, owner) {\n if (value !== void 0 && typeof value !== \"string\") {\n throw new Error(`KeepAwake.${owner}: tag must be a string`);\n }\n}\nfunction normalizeKeepAwakeTag(value) {\n return value ?? keepAwakeDefaultTag;\n}\nexport {\n assertKeepAwakeEnabled,\n assertKeepAwakeTag,\n keepAwakeDefaultTag,\n normalizeKeepAwakeTag\n};\n//# sourceMappingURL=validate.js.map\n"],"mappings":";AAAA,SAAS,uBAAuB,OAAO;CACrC,IAAI,OAAO,UAAU,WAAW;EAC9B,MAAM,IAAI,MAAM,iDAAiD;CACnE;AACF;AACA,MAAM,sBAAsB;AAC5B,SAAS,mBAAmB,OAAO,OAAO;CACxC,IAAI,UAAU,KAAK,KAAK,OAAO,UAAU,UAAU;EACjD,MAAM,IAAI,MAAM,aAAa,MAAM,uBAAuB;CAC5D;AACF;AACA,SAAS,sBAAsB,OAAO;CACpC,OAAO;AACT"}
|
|
@@ -3,6 +3,15 @@ function assertKeepAwakeEnabled(value) {
|
|
|
3
3
|
throw new Error("KeepAwake.setEnabled: enabled must be a boolean");
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
|
+
var keepAwakeDefaultTag = "ExpoKeepAwakeDefaultTag";
|
|
7
|
+
function assertKeepAwakeTag(value, owner) {
|
|
8
|
+
if (value !== void 0 && typeof value !== "string") {
|
|
9
|
+
throw new Error(`KeepAwake.${owner}: tag must be a string`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function normalizeKeepAwakeTag(value) {
|
|
13
|
+
return value !== null && value !== void 0 ? value : keepAwakeDefaultTag;
|
|
14
|
+
}
|
|
6
15
|
|
|
7
|
-
export { assertKeepAwakeEnabled };
|
|
16
|
+
export { assertKeepAwakeEnabled, assertKeepAwakeTag, keepAwakeDefaultTag, normalizeKeepAwakeTag };
|
|
8
17
|
//# sourceMappingURL=validate.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.native.js","names":[],"sources":["esm/platform/keep-awake/validate.native.js"],"sourcesContent":["function assertKeepAwakeEnabled(value) {\n if (typeof value !== \"boolean\") {\n throw new Error(\"KeepAwake.setEnabled: enabled must be a boolean\");\n }\n}\nexport {\n assertKeepAwakeEnabled\n};\n//# sourceMappingURL=validate.js.map\n"],"mappings":";AAAA,SAAS,uBAAuB,OAAO;CACrC,IAAI,OAAO,UAAU,WAAW;EAC9B,MAAM,IAAI,MAAM,iDAAiD;CACnE;AACF"}
|
|
1
|
+
{"version":3,"file":"validate.native.js","names":[],"sources":["esm/platform/keep-awake/validate.native.js"],"sourcesContent":["function assertKeepAwakeEnabled(value) {\n if (typeof value !== \"boolean\") {\n throw new Error(\"KeepAwake.setEnabled: enabled must be a boolean\");\n }\n}\nvar keepAwakeDefaultTag = \"ExpoKeepAwakeDefaultTag\";\nfunction assertKeepAwakeTag(value, owner) {\n if (value !== void 0 && typeof value !== \"string\") {\n throw new Error(`KeepAwake.${owner}: tag must be a string`);\n }\n}\nfunction normalizeKeepAwakeTag(value) {\n return value !== null && value !== void 0 ? value : keepAwakeDefaultTag;\n}\nexport {\n assertKeepAwakeEnabled,\n assertKeepAwakeTag,\n keepAwakeDefaultTag,\n normalizeKeepAwakeTag\n};\n//# sourceMappingURL=validate.js.map\n"],"mappings":";AAAA,SAAS,uBAAuB,OAAO;CACrC,IAAI,OAAO,UAAU,WAAW;EAC9B,MAAM,IAAI,MAAM,iDAAiD;CACnE;AACF;AACA,IAAI,sBAAsB;AAC1B,SAAS,mBAAmB,OAAO,OAAO;CACxC,IAAI,UAAU,KAAK,KAAK,OAAO,UAAU,UAAU;EACjD,MAAM,IAAI,MAAM,aAAa,MAAM,uBAAuB;CAC5D;AACF;AACA,SAAS,sBAAsB,OAAO;CACpC,OAAO,UAAU,QAAQ,UAAU,KAAK,IAAI,QAAQ;AACtD"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { FALLBACK_CALENDAR, FALLBACK_LOCALE } from "./map.mjs";
|
|
3
|
+
|
|
4
|
+
function localeFor(tag) {
|
|
5
|
+
try {
|
|
6
|
+
const parsed = new Intl.Locale(tag);
|
|
7
|
+
const numbers = new Intl.NumberFormat(tag).formatToParts(1234567.89);
|
|
8
|
+
const part = (type) => numbers.find((entry) => entry.type === type)?.value ?? null;
|
|
9
|
+
const direction = parsed.textInfo?.direction;
|
|
10
|
+
return {
|
|
11
|
+
languageTag: parsed.baseName,
|
|
12
|
+
languageCode: parsed.language ?? null,
|
|
13
|
+
languageScriptCode: parsed.script ?? null,
|
|
14
|
+
regionCode: parsed.region ?? null,
|
|
15
|
+
languageRegionCode: parsed.region ?? null,
|
|
16
|
+
currencyCode: null,
|
|
17
|
+
currencySymbol: null,
|
|
18
|
+
languageCurrencyCode: null,
|
|
19
|
+
languageCurrencySymbol: null,
|
|
20
|
+
decimalSeparator: part("decimal"),
|
|
21
|
+
digitGroupingSeparator: part("group"),
|
|
22
|
+
textDirection: direction === "rtl" ? "rtl" : "ltr",
|
|
23
|
+
measurementSystem: null,
|
|
24
|
+
temperatureUnit: null
|
|
25
|
+
};
|
|
26
|
+
} catch {
|
|
27
|
+
return {
|
|
28
|
+
...FALLBACK_LOCALE,
|
|
29
|
+
languageTag: tag
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function getLocales() {
|
|
34
|
+
if (typeof navigator === "undefined" || !navigator.languages?.length) {
|
|
35
|
+
return [FALLBACK_LOCALE];
|
|
36
|
+
}
|
|
37
|
+
const locales = [...navigator.languages].map(localeFor);
|
|
38
|
+
return locales.length > 0 ? locales : [FALLBACK_LOCALE];
|
|
39
|
+
}
|
|
40
|
+
function getCalendars() {
|
|
41
|
+
if (typeof Intl === "undefined") return [FALLBACK_CALENDAR];
|
|
42
|
+
try {
|
|
43
|
+
const options = new Intl.DateTimeFormat().resolvedOptions();
|
|
44
|
+
const parsed = new Intl.Locale(options.locale);
|
|
45
|
+
const firstDay = parsed.weekInfo?.firstDay;
|
|
46
|
+
return [{
|
|
47
|
+
calendar: options.calendar ?? null,
|
|
48
|
+
timeZone: options.timeZone ?? null,
|
|
49
|
+
uses24hourClock: parsed.hourCycle === void 0 ? null : parsed.hourCycle === "h23" || parsed.hourCycle === "h24",
|
|
50
|
+
firstWeekday: firstDay === void 0 ? null : firstDay % 7 + 1
|
|
51
|
+
}];
|
|
52
|
+
} catch {
|
|
53
|
+
return [FALLBACK_CALENDAR];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function subscribe(refresh) {
|
|
57
|
+
if (typeof window === "undefined") return void 0;
|
|
58
|
+
window.addEventListener("languagechange", refresh);
|
|
59
|
+
return () => window.removeEventListener("languagechange", refresh);
|
|
60
|
+
}
|
|
61
|
+
function useLocales() {
|
|
62
|
+
const [locales, setLocales] = useState(() => getLocales());
|
|
63
|
+
useEffect(() => subscribe(() => setLocales(getLocales())), []);
|
|
64
|
+
return locales;
|
|
65
|
+
}
|
|
66
|
+
function useCalendars() {
|
|
67
|
+
const [calendars, setCalendars] = useState(() => getCalendars());
|
|
68
|
+
useEffect(() => subscribe(() => setCalendars(getCalendars())), []);
|
|
69
|
+
return calendars;
|
|
70
|
+
}
|
|
71
|
+
const Localization = Object.freeze({
|
|
72
|
+
getLocales,
|
|
73
|
+
getCalendars
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export { Localization, useCalendars, useLocales };
|
|
77
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/platform/localization/index.js"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { FALLBACK_CALENDAR, FALLBACK_LOCALE } from \"./map\";\nfunction localeFor(tag) {\n try {\n const parsed = new Intl.Locale(tag);\n const numbers = new Intl.NumberFormat(tag).formatToParts(123456789e-2);\n const part = (type) => numbers.find((entry) => entry.type === type)?.value ?? null;\n const direction = parsed.textInfo?.direction;\n return {\n languageTag: parsed.baseName,\n languageCode: parsed.language ?? null,\n languageScriptCode: parsed.script ?? null,\n regionCode: parsed.region ?? null,\n languageRegionCode: parsed.region ?? null,\n currencyCode: null,\n currencySymbol: null,\n languageCurrencyCode: null,\n languageCurrencySymbol: null,\n decimalSeparator: part(\"decimal\"),\n digitGroupingSeparator: part(\"group\"),\n textDirection: direction === \"rtl\" ? \"rtl\" : \"ltr\",\n measurementSystem: null,\n temperatureUnit: null\n };\n } catch {\n return { ...FALLBACK_LOCALE, languageTag: tag };\n }\n}\nfunction getLocales() {\n if (typeof navigator === \"undefined\" || !navigator.languages?.length) {\n return [FALLBACK_LOCALE];\n }\n const locales = [...navigator.languages].map(localeFor);\n return locales.length > 0 ? locales : [FALLBACK_LOCALE];\n}\nfunction getCalendars() {\n if (typeof Intl === \"undefined\") return [FALLBACK_CALENDAR];\n try {\n const options = new Intl.DateTimeFormat().resolvedOptions();\n const parsed = new Intl.Locale(options.locale);\n const firstDay = parsed.weekInfo?.firstDay;\n return [\n {\n calendar: options.calendar ?? null,\n timeZone: options.timeZone ?? null,\n uses24hourClock: parsed.hourCycle === void 0 ? null : parsed.hourCycle === \"h23\" || parsed.hourCycle === \"h24\",\n // weekInfo numbers monday as 1; expo numbers sunday as 1.\n firstWeekday: firstDay === void 0 ? null : firstDay % 7 + 1\n }\n ];\n } catch {\n return [FALLBACK_CALENDAR];\n }\n}\nfunction subscribe(refresh) {\n if (typeof window === \"undefined\") return void 0;\n window.addEventListener(\"languagechange\", refresh);\n return () => window.removeEventListener(\"languagechange\", refresh);\n}\nfunction useLocales() {\n const [locales, setLocales] = useState(() => getLocales());\n useEffect(() => subscribe(() => setLocales(getLocales())), []);\n return locales;\n}\nfunction useCalendars() {\n const [calendars, setCalendars] = useState(() => getCalendars());\n useEffect(() => subscribe(() => setCalendars(getCalendars())), []);\n return calendars;\n}\nconst Localization = Object.freeze({ getLocales, getCalendars });\nexport {\n Localization,\n useCalendars,\n useLocales\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AAEA,SAAS,UAAU,KAAK;CACtB,IAAI;EACF,MAAM,SAAS,IAAI,KAAK,OAAO,GAAG;EAClC,MAAM,UAAU,IAAI,KAAK,aAAa,GAAG,CAAC,CAAC,cAAc,UAAY;EACrE,MAAM,QAAQ,SAAS,QAAQ,MAAM,UAAU,MAAM,SAAS,IAAI,CAAC,EAAE,SAAS;EAC9E,MAAM,YAAY,OAAO,UAAU;EACnC,OAAO;GACL,aAAa,OAAO;GACpB,cAAc,OAAO,YAAY;GACjC,oBAAoB,OAAO,UAAU;GACrC,YAAY,OAAO,UAAU;GAC7B,oBAAoB,OAAO,UAAU;GACrC,cAAc;GACd,gBAAgB;GAChB,sBAAsB;GACtB,wBAAwB;GACxB,kBAAkB,KAAK,SAAS;GAChC,wBAAwB,KAAK,OAAO;GACpC,eAAe,cAAc,QAAQ,QAAQ;GAC7C,mBAAmB;GACnB,iBAAiB;EACnB;CACF,QAAQ;EACN,OAAO;GAAE,GAAG;GAAiB,aAAa;EAAI;CAChD;AACF;AACA,SAAS,aAAa;CACpB,IAAI,OAAO,cAAc,eAAe,CAAC,UAAU,WAAW,QAAQ;EACpE,OAAO,CAAC,eAAe;CACzB;CACA,MAAM,UAAU,CAAC,GAAG,UAAU,SAAS,CAAC,CAAC,IAAI,SAAS;CACtD,OAAO,QAAQ,SAAS,IAAI,UAAU,CAAC,eAAe;AACxD;AACA,SAAS,eAAe;CACtB,IAAI,OAAO,SAAS,aAAa,OAAO,CAAC,iBAAiB;CAC1D,IAAI;EACF,MAAM,UAAU,IAAI,KAAK,eAAe,CAAC,CAAC,gBAAgB;EAC1D,MAAM,SAAS,IAAI,KAAK,OAAO,QAAQ,MAAM;EAC7C,MAAM,WAAW,OAAO,UAAU;EAClC,OAAO,CACL;GACE,UAAU,QAAQ,YAAY;GAC9B,UAAU,QAAQ,YAAY;GAC9B,iBAAiB,OAAO,cAAc,KAAK,IAAI,OAAO,OAAO,cAAc,SAAS,OAAO,cAAc;GAEzG,cAAc,aAAa,KAAK,IAAI,OAAO,WAAW,IAAI;EAC5D,CACF;CACF,QAAQ;EACN,OAAO,CAAC,iBAAiB;CAC3B;AACF;AACA,SAAS,UAAU,SAAS;CAC1B,IAAI,OAAO,WAAW,aAAa,OAAO,KAAK;CAC/C,OAAO,iBAAiB,kBAAkB,OAAO;CACjD,aAAa,OAAO,oBAAoB,kBAAkB,OAAO;AACnE;AACA,SAAS,aAAa;CACpB,MAAM,CAAC,SAAS,cAAc,eAAe,WAAW,CAAC;CACzD,gBAAgB,gBAAgB,WAAW,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC;CAC7D,OAAO;AACT;AACA,SAAS,eAAe;CACtB,MAAM,CAAC,WAAW,gBAAgB,eAAe,aAAa,CAAC;CAC/D,gBAAgB,gBAAgB,aAAa,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC;CACjE,OAAO;AACT;AACA,MAAM,eAAe,OAAO,OAAO;CAAE;CAAY;AAAa,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { NitroModules } from "react-native-nitro-modules";
|
|
3
|
+
import { toCalendars, toLocales } from "./map.native.js";
|
|
4
|
+
|
|
5
|
+
var hybrid;
|
|
6
|
+
function native() {
|
|
7
|
+
hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = NitroModules.createHybridObject("OneDevice");
|
|
8
|
+
return hybrid;
|
|
9
|
+
}
|
|
10
|
+
function getLocales() {
|
|
11
|
+
return toLocales(native().getLocales());
|
|
12
|
+
}
|
|
13
|
+
function getCalendars() {
|
|
14
|
+
return toCalendars(native().getCalendars());
|
|
15
|
+
}
|
|
16
|
+
function useLocales() {
|
|
17
|
+
var [locales, setLocales] = useState(function() {
|
|
18
|
+
return getLocales();
|
|
19
|
+
});
|
|
20
|
+
useEffect(function() {
|
|
21
|
+
setLocales(getLocales());
|
|
22
|
+
return native().addLocalizationListener(function() {
|
|
23
|
+
return setLocales(getLocales());
|
|
24
|
+
});
|
|
25
|
+
}, []);
|
|
26
|
+
return locales;
|
|
27
|
+
}
|
|
28
|
+
function useCalendars() {
|
|
29
|
+
var [calendars, setCalendars] = useState(function() {
|
|
30
|
+
return getCalendars();
|
|
31
|
+
});
|
|
32
|
+
useEffect(function() {
|
|
33
|
+
setCalendars(getCalendars());
|
|
34
|
+
return native().addLocalizationListener(function() {
|
|
35
|
+
return setCalendars(getCalendars());
|
|
36
|
+
});
|
|
37
|
+
}, []);
|
|
38
|
+
return calendars;
|
|
39
|
+
}
|
|
40
|
+
var Localization = Object.freeze({
|
|
41
|
+
getLocales,
|
|
42
|
+
getCalendars
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export { Localization, useCalendars, useLocales };
|
|
46
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["esm/platform/localization/index.native.js"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { NitroModules } from \"react-native-nitro-modules\";\nimport { toCalendars, toLocales } from \"./map\";\nvar hybrid;\nfunction native() {\n hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = NitroModules.createHybridObject(\"OneDevice\");\n return hybrid;\n}\nfunction getLocales() {\n return toLocales(native().getLocales());\n}\nfunction getCalendars() {\n return toCalendars(native().getCalendars());\n}\nfunction useLocales() {\n var [locales, setLocales] = useState(function() {\n return getLocales();\n });\n useEffect(function() {\n setLocales(getLocales());\n return native().addLocalizationListener(function() {\n return setLocales(getLocales());\n });\n }, []);\n return locales;\n}\nfunction useCalendars() {\n var [calendars, setCalendars] = useState(function() {\n return getCalendars();\n });\n useEffect(function() {\n setCalendars(getCalendars());\n return native().addLocalizationListener(function() {\n return setCalendars(getCalendars());\n });\n }, []);\n return calendars;\n}\nvar Localization = Object.freeze({\n getLocales,\n getCalendars\n});\nexport {\n Localization,\n useCalendars,\n useLocales\n};\n//# sourceMappingURL=index.native.js.map\n"],"mappings":";;;;;AAGA,IAAI;AACJ,SAAS,SAAS;CAChB,WAAW,QAAQ,WAAW,KAAK,IAAI,SAAS,SAAS,aAAa,mBAAmB,WAAW;CACpG,OAAO;AACT;AACA,SAAS,aAAa;CACpB,OAAO,UAAU,OAAO,CAAC,CAAC,WAAW,CAAC;AACxC;AACA,SAAS,eAAe;CACtB,OAAO,YAAY,OAAO,CAAC,CAAC,aAAa,CAAC;AAC5C;AACA,SAAS,aAAa;CACpB,IAAI,CAAC,SAAS,cAAc,SAAS,WAAW;EAC9C,OAAO,WAAW;CACpB,CAAC;CACD,UAAU,WAAW;EACnB,WAAW,WAAW,CAAC;EACvB,OAAO,OAAO,CAAC,CAAC,wBAAwB,WAAW;GACjD,OAAO,WAAW,WAAW,CAAC;EAChC,CAAC;CACH,GAAG,CAAC,CAAC;CACL,OAAO;AACT;AACA,SAAS,eAAe;CACtB,IAAI,CAAC,WAAW,gBAAgB,SAAS,WAAW;EAClD,OAAO,aAAa;CACtB,CAAC;CACD,UAAU,WAAW;EACnB,aAAa,aAAa,CAAC;EAC3B,OAAO,OAAO,CAAC,CAAC,wBAAwB,WAAW;GACjD,OAAO,aAAa,aAAa,CAAC;EACpC,CAAC;CACH,GAAG,CAAC,CAAC;CACL,OAAO;AACT;AACA,IAAI,eAAe,OAAO,OAAO;CAC/B;CACA;AACF,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
function toLocale(info) {
|
|
2
|
+
return {
|
|
3
|
+
languageTag: info.languageTag,
|
|
4
|
+
languageCode: info.languageCode ?? null,
|
|
5
|
+
languageScriptCode: info.languageScriptCode ?? null,
|
|
6
|
+
regionCode: info.regionCode ?? null,
|
|
7
|
+
languageRegionCode: info.languageRegionCode ?? null,
|
|
8
|
+
currencyCode: info.currencyCode ?? null,
|
|
9
|
+
currencySymbol: info.currencySymbol ?? null,
|
|
10
|
+
languageCurrencyCode: info.languageCurrencyCode ?? null,
|
|
11
|
+
languageCurrencySymbol: info.languageCurrencySymbol ?? null,
|
|
12
|
+
decimalSeparator: info.decimalSeparator ?? null,
|
|
13
|
+
digitGroupingSeparator: info.digitGroupingSeparator ?? null,
|
|
14
|
+
textDirection: info.textDirection === "rtl" ? "rtl" : "ltr",
|
|
15
|
+
measurementSystem: info.measurementSystem === "metric" || info.measurementSystem === "us" || info.measurementSystem === "uk" ? info.measurementSystem : null,
|
|
16
|
+
temperatureUnit: info.temperatureUnit === "celsius" || info.temperatureUnit === "fahrenheit" ? info.temperatureUnit : null
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function toCalendar(info) {
|
|
20
|
+
return {
|
|
21
|
+
calendar: info.calendar ?? null,
|
|
22
|
+
timeZone: info.timeZone ?? null,
|
|
23
|
+
uses24hourClock: info.uses24hourClock ?? null,
|
|
24
|
+
firstWeekday: info.firstWeekday ?? null
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const FALLBACK_LOCALE = {
|
|
28
|
+
languageTag: "en-US",
|
|
29
|
+
languageCode: "en",
|
|
30
|
+
languageScriptCode: null,
|
|
31
|
+
regionCode: "US",
|
|
32
|
+
languageRegionCode: "US",
|
|
33
|
+
currencyCode: null,
|
|
34
|
+
currencySymbol: null,
|
|
35
|
+
languageCurrencyCode: null,
|
|
36
|
+
languageCurrencySymbol: null,
|
|
37
|
+
decimalSeparator: null,
|
|
38
|
+
digitGroupingSeparator: null,
|
|
39
|
+
textDirection: "ltr",
|
|
40
|
+
measurementSystem: null,
|
|
41
|
+
temperatureUnit: null
|
|
42
|
+
};
|
|
43
|
+
const FALLBACK_CALENDAR = {
|
|
44
|
+
calendar: "gregory",
|
|
45
|
+
timeZone: null,
|
|
46
|
+
uses24hourClock: null,
|
|
47
|
+
firstWeekday: null
|
|
48
|
+
};
|
|
49
|
+
function toLocales(infos) {
|
|
50
|
+
const locales = infos.map(toLocale);
|
|
51
|
+
return locales.length > 0 ? locales : [FALLBACK_LOCALE];
|
|
52
|
+
}
|
|
53
|
+
function toCalendars(infos) {
|
|
54
|
+
const calendars = infos.map(toCalendar);
|
|
55
|
+
return calendars.length > 0 ? calendars : [FALLBACK_CALENDAR];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { FALLBACK_CALENDAR, FALLBACK_LOCALE, toCalendar, toCalendars, toLocale, toLocales };
|
|
59
|
+
//# sourceMappingURL=map.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map.js","names":[],"sources":["esm/platform/localization/map.js"],"sourcesContent":["function toLocale(info) {\n return {\n languageTag: info.languageTag,\n languageCode: info.languageCode ?? null,\n languageScriptCode: info.languageScriptCode ?? null,\n regionCode: info.regionCode ?? null,\n languageRegionCode: info.languageRegionCode ?? null,\n currencyCode: info.currencyCode ?? null,\n currencySymbol: info.currencySymbol ?? null,\n languageCurrencyCode: info.languageCurrencyCode ?? null,\n languageCurrencySymbol: info.languageCurrencySymbol ?? null,\n decimalSeparator: info.decimalSeparator ?? null,\n digitGroupingSeparator: info.digitGroupingSeparator ?? null,\n textDirection: info.textDirection === \"rtl\" ? \"rtl\" : \"ltr\",\n measurementSystem: info.measurementSystem === \"metric\" || info.measurementSystem === \"us\" || info.measurementSystem === \"uk\" ? info.measurementSystem : null,\n temperatureUnit: info.temperatureUnit === \"celsius\" || info.temperatureUnit === \"fahrenheit\" ? info.temperatureUnit : null\n };\n}\nfunction toCalendar(info) {\n return {\n calendar: info.calendar ?? null,\n timeZone: info.timeZone ?? null,\n uses24hourClock: info.uses24hourClock ?? null,\n firstWeekday: info.firstWeekday ?? null\n };\n}\nconst FALLBACK_LOCALE = {\n languageTag: \"en-US\",\n languageCode: \"en\",\n languageScriptCode: null,\n regionCode: \"US\",\n languageRegionCode: \"US\",\n currencyCode: null,\n currencySymbol: null,\n languageCurrencyCode: null,\n languageCurrencySymbol: null,\n decimalSeparator: null,\n digitGroupingSeparator: null,\n textDirection: \"ltr\",\n measurementSystem: null,\n temperatureUnit: null\n};\nconst FALLBACK_CALENDAR = {\n calendar: \"gregory\",\n timeZone: null,\n uses24hourClock: null,\n firstWeekday: null\n};\nfunction toLocales(infos) {\n const locales = infos.map(toLocale);\n return locales.length > 0 ? locales : [FALLBACK_LOCALE];\n}\nfunction toCalendars(infos) {\n const calendars = infos.map(toCalendar);\n return calendars.length > 0 ? calendars : [FALLBACK_CALENDAR];\n}\nexport {\n FALLBACK_CALENDAR,\n FALLBACK_LOCALE,\n toCalendar,\n toCalendars,\n toLocale,\n toLocales\n};\n//# sourceMappingURL=map.js.map\n"],"mappings":";AAAA,SAAS,SAAS,MAAM;CACtB,OAAO;EACL,aAAa,KAAK;EAClB,cAAc,KAAK,gBAAgB;EACnC,oBAAoB,KAAK,sBAAsB;EAC/C,YAAY,KAAK,cAAc;EAC/B,oBAAoB,KAAK,sBAAsB;EAC/C,cAAc,KAAK,gBAAgB;EACnC,gBAAgB,KAAK,kBAAkB;EACvC,sBAAsB,KAAK,wBAAwB;EACnD,wBAAwB,KAAK,0BAA0B;EACvD,kBAAkB,KAAK,oBAAoB;EAC3C,wBAAwB,KAAK,0BAA0B;EACvD,eAAe,KAAK,kBAAkB,QAAQ,QAAQ;EACtD,mBAAmB,KAAK,sBAAsB,YAAY,KAAK,sBAAsB,QAAQ,KAAK,sBAAsB,OAAO,KAAK,oBAAoB;EACxJ,iBAAiB,KAAK,oBAAoB,aAAa,KAAK,oBAAoB,eAAe,KAAK,kBAAkB;CACxH;AACF;AACA,SAAS,WAAW,MAAM;CACxB,OAAO;EACL,UAAU,KAAK,YAAY;EAC3B,UAAU,KAAK,YAAY;EAC3B,iBAAiB,KAAK,mBAAmB;EACzC,cAAc,KAAK,gBAAgB;CACrC;AACF;AACA,MAAM,kBAAkB;CACtB,aAAa;CACb,cAAc;CACd,oBAAoB;CACpB,YAAY;CACZ,oBAAoB;CACpB,cAAc;CACd,gBAAgB;CAChB,sBAAsB;CACtB,wBAAwB;CACxB,kBAAkB;CAClB,wBAAwB;CACxB,eAAe;CACf,mBAAmB;CACnB,iBAAiB;AACnB;AACA,MAAM,oBAAoB;CACxB,UAAU;CACV,UAAU;CACV,iBAAiB;CACjB,cAAc;AAChB;AACA,SAAS,UAAU,OAAO;CACxB,MAAM,UAAU,MAAM,IAAI,QAAQ;CAClC,OAAO,QAAQ,SAAS,IAAI,UAAU,CAAC,eAAe;AACxD;AACA,SAAS,YAAY,OAAO;CAC1B,MAAM,YAAY,MAAM,IAAI,UAAU;CACtC,OAAO,UAAU,SAAS,IAAI,YAAY,CAAC,iBAAiB;AAC9D"}
|