native-fn 1.2.2 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +191 -49
- package/dist/index.d.ts +148 -98
- package/dist/native.cjs +810 -288
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +810 -288
- package/dist/native.umd.js +810 -288
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/appearance/index.cjs +65 -64
- package/dist/plugin/appearance/index.d.ts +5 -5
- package/dist/plugin/appearance/index.mjs +66 -65
- package/dist/plugin/appearance/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/appearance/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/appearance/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/appearance/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/plugin/appearance/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/plugin/appearance/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/appearance/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/appearance/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/appearance/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/appearance/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/appearance/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/appearance/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/appearance/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/appearance/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/appearance/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/appearance/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/appearance/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/appearance/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/badge/index.d.ts +3 -3
- package/dist/plugin/badge/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/badge/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/badge/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/badge/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/badge/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/badge/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/plugin/badge/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/badge/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/plugin/badge/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/badge/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/badge/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/badge/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/badge/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/badge/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/badge/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/badge/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/badge/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/badge/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/badge/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/badge/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/badge/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/badge/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/badge/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/badge/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/battery/index.cjs +4 -6
- package/dist/plugin/battery/index.d.ts +3 -3
- package/dist/plugin/battery/index.mjs +4 -6
- package/dist/plugin/battery/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/battery/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/battery/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/battery/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/battery/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/battery/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/plugin/battery/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/battery/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/plugin/battery/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/battery/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/battery/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/battery/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/battery/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/battery/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/battery/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/battery/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/battery/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/battery/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/battery/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/battery/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/battery/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/battery/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/battery/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/battery/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/clipboard/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/clipboard/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/clipboard/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/clipboard/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/plugin/clipboard/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/plugin/clipboard/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/clipboard/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/clipboard/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/clipboard/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/clipboard/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/clipboard/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/clipboard/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/clipboard/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/clipboard/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/clipboard/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/clipboard/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/dimension/index.cjs +711 -122
- package/dist/plugin/dimension/index.d.ts +81 -31
- package/dist/plugin/dimension/index.mjs +712 -122
- package/dist/plugin/dimension/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/dimension/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/dimension/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/dimension/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/plugin/dimension/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/plugin/dimension/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/dimension/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/dimension/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/dimension/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/dimension/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/dimension/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/dimension/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/dimension/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/dimension/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/dimension/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/dimension/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/dimension/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/dimension/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/fullscreen/index.cjs +96 -91
- package/dist/plugin/fullscreen/index.d.ts +7 -7
- package/dist/plugin/fullscreen/index.mjs +96 -91
- package/dist/plugin/fullscreen/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/fullscreen/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/fullscreen/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/fullscreen/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/plugin/fullscreen/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/plugin/fullscreen/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/fullscreen/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/fullscreen/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/fullscreen/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/fullscreen/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/fullscreen/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/fullscreen/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/fullscreen/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/fullscreen/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/fullscreen/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/fullscreen/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/geolocation/index.cjs +249 -182
- package/dist/plugin/geolocation/index.d.ts +4 -4
- package/dist/plugin/geolocation/index.mjs +249 -182
- package/dist/plugin/geolocation/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/geolocation/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/geolocation/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/geolocation/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/geolocation/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/geolocation/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/plugin/geolocation/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/geolocation/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/plugin/geolocation/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/geolocation/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/geolocation/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/geolocation/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/geolocation/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/geolocation/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/geolocation/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/geolocation/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/geolocation/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/geolocation/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/geolocation/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/geolocation/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/geolocation/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/geolocation/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/geolocation/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/geolocation/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/notification/index.cjs +288 -13
- package/dist/plugin/notification/index.d.ts +4 -4
- package/dist/plugin/notification/index.mjs +288 -13
- package/dist/plugin/notification/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/notification/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/notification/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/notification/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/notification/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/notification/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/plugin/notification/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/notification/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/plugin/notification/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/notification/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/notification/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/notification/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/notification/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/notification/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/notification/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/notification/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/notification/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/notification/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/notification/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/notification/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/notification/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/notification/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/notification/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/notification/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/open/index.cjs +64 -55
- package/dist/plugin/open/index.d.ts +28 -12
- package/dist/plugin/open/index.mjs +64 -55
- package/dist/plugin/open/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/open/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/open/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/open/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/open/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/open/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/plugin/open/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/open/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/plugin/open/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/open/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/open/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/open/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/open/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/open/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/open/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/open/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/open/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/open/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/open/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/open/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/open/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/open/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/open/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/open/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/permission/index.cjs +372 -13
- package/dist/plugin/permission/index.d.ts +11 -5
- package/dist/plugin/permission/index.mjs +372 -13
- package/dist/plugin/permission/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/permission/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/permission/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/permission/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/permission/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/permission/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/plugin/permission/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/permission/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/plugin/permission/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/permission/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/permission/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/permission/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/permission/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/permission/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/permission/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/permission/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/permission/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/permission/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/permission/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/permission/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/permission/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/permission/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/permission/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/permission/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/pip/index.cjs +58 -57
- package/dist/plugin/pip/index.d.ts +7 -7
- package/dist/plugin/pip/index.mjs +58 -57
- package/dist/plugin/pip/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/pip/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/pip/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/pip/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/pip/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/pip/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/plugin/pip/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/pip/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/plugin/pip/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/pip/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/pip/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/pip/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/pip/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/pip/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/pip/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/pip/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/pip/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/pip/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/pip/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/pip/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/pip/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/pip/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/pip/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/pip/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/platform/index.cjs +98 -92
- package/dist/plugin/platform/index.d.ts +30 -14
- package/dist/plugin/platform/index.mjs +92 -85
- package/dist/plugin/platform/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/platform/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/platform/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/platform/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/plugin/platform/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/platform/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/plugin/platform/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/platform/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/platform/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/platform/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/platform/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/platform/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/platform/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/platform/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/platform/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/platform/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/platform/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/platform/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/theme/index.cjs +63 -54
- package/dist/plugin/theme/index.d.ts +2 -2
- package/dist/plugin/theme/index.mjs +63 -54
- package/dist/plugin/theme/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/theme/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/theme/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/theme/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/plugin/theme/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/theme/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/plugin/theme/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/theme/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/theme/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/theme/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/theme/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/theme/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/theme/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/theme/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/theme/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/theme/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/theme/src/utils/insert-sort.d.ts +1 -0
- package/dist/plugin/vibration/index.d.ts +3 -3
- package/dist/plugin/vibration/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/plugin/vibration/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/vibration/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/vibration/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/vibration/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/vibration/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/plugin/vibration/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/plugin/vibration/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/plugin/vibration/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/plugin/vibration/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/plugin/vibration/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/vibration/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/vibration/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/vibration/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/vibration/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/vibration/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/vibration/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/vibration/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/plugin/vibration/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/vibration/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/vibration/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/vibration/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/vibration/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/vibration/src/utils/insert-sort.d.ts +1 -0
- package/dist/src/plugin/appearance/constants/index.d.ts +1 -1
- package/dist/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/src/plugin/dimension/constants/index.d.ts +10 -6
- package/dist/src/plugin/dimension/cores/index.d.ts +15 -0
- package/dist/src/plugin/dimension/types/dimensions.d.ts +52 -24
- package/dist/src/plugin/dimension/utils/create-env-observer.d.ts +16 -7
- package/dist/src/plugin/dimension/utils/create-environment-observer.d.ts +33 -0
- package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/src/plugin/open/types/open.d.ts +12 -12
- package/dist/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/src/plugin/platform/constants/index.d.ts +1 -1
- package/dist/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/src/types/subscription-manager.d.ts +3 -3
- package/dist/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/src/utils/insert-sort.d.ts +1 -0
- package/package.json +1 -1
package/dist/native.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var version = "1.
|
|
1
|
+
var version = "1.3.1";
|
|
2
2
|
var packageJSON = {
|
|
3
3
|
version: version};
|
|
4
4
|
|
|
@@ -25,11 +25,11 @@ var Appearances;
|
|
|
25
25
|
Appearances["Light"] = "light";
|
|
26
26
|
Appearances["Dark"] = "dark";
|
|
27
27
|
})(Appearances || (Appearances = {}));
|
|
28
|
-
var
|
|
28
|
+
var PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST;
|
|
29
29
|
if (typeof globalThis.matchMedia !== 'undefined')
|
|
30
|
-
|
|
30
|
+
PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST = globalThis.matchMedia('(prefers-color-scheme: dark)');
|
|
31
31
|
else
|
|
32
|
-
|
|
32
|
+
PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST = FALLBACK_MEDIA_QUERY_LIST;
|
|
33
33
|
var CONTEXT = globalThis.document.createElement('canvas').getContext('2d', { willReadFrequently: true });
|
|
34
34
|
var SVG_PIXEL_DATA_URL = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxIiBoZWlnaHQ9IjEiPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0wIDBoMXYxSDB6Ii8+PC9zdmc+';
|
|
35
35
|
|
|
@@ -122,11 +122,11 @@ var Browsers;
|
|
|
122
122
|
Browsers["IE"] = "IE";
|
|
123
123
|
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
124
124
|
})(Browsers || (Browsers = {}));
|
|
125
|
-
var USER_AGENT
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
var USER_AGENT;
|
|
126
|
+
if (typeof globalThis.navigator.userAgent !== 'undefined')
|
|
127
|
+
USER_AGENT = globalThis.navigator.userAgent;
|
|
128
|
+
else
|
|
129
|
+
USER_AGENT = '';
|
|
130
130
|
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
131
131
|
'Google Chrome': 'Chrome',
|
|
132
132
|
'Microsoft Edge': 'Edge',
|
|
@@ -403,9 +403,12 @@ var EventListener = {
|
|
|
403
403
|
|
|
404
404
|
var currentUserAgent = USER_AGENT;
|
|
405
405
|
var parsedCache = null;
|
|
406
|
-
var
|
|
407
|
-
var
|
|
408
|
-
var
|
|
406
|
+
var parsedFromHighEntropyValuesOSName = undefined;
|
|
407
|
+
var parsedFromHighEntropyValuesOSVersion = undefined;
|
|
408
|
+
var parsedFromHighEntropyValuesBrowserName = undefined;
|
|
409
|
+
var parsedFromHighEntropyValuesBrowserVersion = undefined;
|
|
410
|
+
var parsedFromHighEntropyValuesEngineName = undefined;
|
|
411
|
+
var parsedFromHighEntropyValuesEngineVersion = undefined;
|
|
409
412
|
var parsedFromHighEntropyValuesDevice = null;
|
|
410
413
|
var parsedFromNavigatorGPU = {};
|
|
411
414
|
var cachedLocale = null;
|
|
@@ -452,9 +455,12 @@ function normalizeLocale(locale) {
|
|
|
452
455
|
function invalidateCache() {
|
|
453
456
|
parsedCache = null;
|
|
454
457
|
cachedLocale = null;
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
+
parsedFromHighEntropyValuesOSName = undefined;
|
|
459
|
+
parsedFromHighEntropyValuesOSVersion = undefined;
|
|
460
|
+
parsedFromHighEntropyValuesBrowserName = undefined;
|
|
461
|
+
parsedFromHighEntropyValuesBrowserVersion = undefined;
|
|
462
|
+
parsedFromHighEntropyValuesEngineName = undefined;
|
|
463
|
+
parsedFromHighEntropyValuesEngineVersion = undefined;
|
|
458
464
|
parsedFromHighEntropyValuesDevice = null;
|
|
459
465
|
parsedFromNavigatorGPU = {};
|
|
460
466
|
}
|
|
@@ -470,71 +476,74 @@ function getParsedCache() {
|
|
|
470
476
|
return parsedCache;
|
|
471
477
|
}
|
|
472
478
|
function parseOS() {
|
|
473
|
-
var
|
|
479
|
+
var name = OS.Unknown;
|
|
480
|
+
var version = '';
|
|
474
481
|
for (var i = 0; i < OS_RESOLVER_MAP.length; i++) {
|
|
475
482
|
var map = OS_RESOLVER_MAP[i];
|
|
476
483
|
var matched = currentUserAgent.match(map[0]);
|
|
477
484
|
if (matched !== null) {
|
|
478
|
-
|
|
479
|
-
|
|
485
|
+
name = map[1];
|
|
486
|
+
version = resolveVersion(matched[1], map[2]);
|
|
480
487
|
break;
|
|
481
488
|
}
|
|
482
489
|
}
|
|
483
|
-
if (
|
|
484
|
-
var
|
|
485
|
-
if (
|
|
486
|
-
var major = parseInt(
|
|
490
|
+
if (name === OS.iOS && compareVersion(version, '18.6') === 0) {
|
|
491
|
+
var execs = /\) Version\/([\d.]+)/.exec(currentUserAgent);
|
|
492
|
+
if (execs !== null) {
|
|
493
|
+
var major = parseInt(execs[1].split('.')[0], 10);
|
|
487
494
|
if (major >= 26)
|
|
488
|
-
|
|
495
|
+
version = execs[1];
|
|
489
496
|
}
|
|
490
497
|
}
|
|
491
498
|
if (currentUserAgent === USER_AGENT) {
|
|
492
|
-
if (typeof
|
|
493
|
-
|
|
494
|
-
if (typeof
|
|
495
|
-
|
|
496
|
-
if (
|
|
497
|
-
|
|
499
|
+
if (typeof parsedFromHighEntropyValuesOSName !== 'undefined')
|
|
500
|
+
name = parsedFromHighEntropyValuesOSName;
|
|
501
|
+
if (typeof parsedFromHighEntropyValuesOSVersion !== 'undefined')
|
|
502
|
+
version = parsedFromHighEntropyValuesOSVersion;
|
|
503
|
+
if (name === OS.MacOS && typeof globalThis.navigator.standalone !== 'undefined' && globalThis.navigator.maxTouchPoints > 2)
|
|
504
|
+
name = OS.iOS;
|
|
498
505
|
}
|
|
499
|
-
return
|
|
506
|
+
return { name: name, version: version };
|
|
500
507
|
}
|
|
501
508
|
function parseBrowser() {
|
|
502
|
-
var
|
|
509
|
+
var name = Browsers.Unknown;
|
|
510
|
+
var version = '';
|
|
503
511
|
for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
|
|
504
512
|
var map = BROWSER_RESOLVER_MAP[i];
|
|
505
513
|
var matched = currentUserAgent.match(map[0]);
|
|
506
514
|
if (matched !== null) {
|
|
507
|
-
|
|
508
|
-
|
|
515
|
+
name = map[1];
|
|
516
|
+
version = resolveVersion(matched[1], map[2]);
|
|
509
517
|
break;
|
|
510
518
|
}
|
|
511
519
|
}
|
|
512
520
|
if (currentUserAgent === USER_AGENT) {
|
|
513
|
-
if (typeof
|
|
514
|
-
|
|
515
|
-
if (typeof
|
|
516
|
-
|
|
521
|
+
if (typeof parsedFromHighEntropyValuesBrowserName !== 'undefined')
|
|
522
|
+
name = parsedFromHighEntropyValuesBrowserName;
|
|
523
|
+
if (typeof parsedFromHighEntropyValuesBrowserVersion !== 'undefined')
|
|
524
|
+
version = parsedFromHighEntropyValuesBrowserVersion;
|
|
517
525
|
}
|
|
518
|
-
return
|
|
526
|
+
return { name: name, version: version };
|
|
519
527
|
}
|
|
520
528
|
function parseEngine() {
|
|
521
|
-
var
|
|
529
|
+
var name = Engines.Unknown;
|
|
530
|
+
var version = '';
|
|
522
531
|
for (var i = 0; i < ENGINE_RESOLVER_MAP.length; i++) {
|
|
523
532
|
var map = ENGINE_RESOLVER_MAP[i];
|
|
524
533
|
var matched = currentUserAgent.match(map[0]);
|
|
525
534
|
if (matched !== null) {
|
|
526
|
-
|
|
527
|
-
|
|
535
|
+
name = map[1];
|
|
536
|
+
version = resolveVersion(matched[1], map[2]);
|
|
528
537
|
break;
|
|
529
538
|
}
|
|
530
539
|
}
|
|
531
540
|
if (currentUserAgent === USER_AGENT) {
|
|
532
|
-
if (typeof
|
|
533
|
-
|
|
534
|
-
if (typeof
|
|
535
|
-
|
|
541
|
+
if (typeof parsedFromHighEntropyValuesEngineName !== 'undefined')
|
|
542
|
+
name = parsedFromHighEntropyValuesEngineName;
|
|
543
|
+
if (typeof parsedFromHighEntropyValuesEngineVersion !== 'undefined')
|
|
544
|
+
version = parsedFromHighEntropyValuesEngineVersion;
|
|
536
545
|
}
|
|
537
|
-
return
|
|
546
|
+
return { name: name, version: version };
|
|
538
547
|
}
|
|
539
548
|
function getGPU() {
|
|
540
549
|
return {
|
|
@@ -547,24 +556,22 @@ function getGPU() {
|
|
|
547
556
|
function getLocale() {
|
|
548
557
|
if (cachedLocale !== null)
|
|
549
558
|
return cachedLocale;
|
|
550
|
-
var
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
locale.language = language;
|
|
567
|
-
locale.languages.push(language);
|
|
559
|
+
var language = null;
|
|
560
|
+
var languages = [];
|
|
561
|
+
var timezone = null;
|
|
562
|
+
var offset = 0;
|
|
563
|
+
var isRTL = false;
|
|
564
|
+
var isRTLResolved = null;
|
|
565
|
+
function addLanguages(langs) {
|
|
566
|
+
for (var i = 0; i < langs.length; i++)
|
|
567
|
+
addLanguage(langs[i]);
|
|
568
|
+
}
|
|
569
|
+
function addLanguage(lang) {
|
|
570
|
+
lang = normalizeLocale(lang);
|
|
571
|
+
if (typeof lang === 'string' && languages.indexOf(lang) === -1) {
|
|
572
|
+
if (language === null)
|
|
573
|
+
language = lang;
|
|
574
|
+
languages.push(lang);
|
|
568
575
|
}
|
|
569
576
|
}
|
|
570
577
|
if (typeof Intl !== 'undefined') {
|
|
@@ -574,7 +581,7 @@ function getLocale() {
|
|
|
574
581
|
catch (_) {
|
|
575
582
|
}
|
|
576
583
|
try {
|
|
577
|
-
|
|
584
|
+
timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
578
585
|
}
|
|
579
586
|
catch (_) {
|
|
580
587
|
}
|
|
@@ -592,38 +599,38 @@ function getLocale() {
|
|
|
592
599
|
addLanguage(globalThis.navigator.systemLanguage);
|
|
593
600
|
}
|
|
594
601
|
try {
|
|
595
|
-
|
|
602
|
+
offset = new Date().getTimezoneOffset() * -1;
|
|
596
603
|
}
|
|
597
604
|
catch (_) {
|
|
598
605
|
}
|
|
599
|
-
if (typeof
|
|
606
|
+
if (typeof language === 'string') {
|
|
600
607
|
if (typeof Intl !== 'undefined' && typeof Intl.Locale !== 'undefined') {
|
|
601
608
|
try {
|
|
602
|
-
var intlLocale = new Intl.Locale(
|
|
609
|
+
var intlLocale = new Intl.Locale(language);
|
|
603
610
|
if (typeof intlLocale.getTextInfo === 'function')
|
|
604
|
-
|
|
611
|
+
isRTLResolved = intlLocale.getTextInfo().direction === 'rtl';
|
|
605
612
|
else if (typeof intlLocale.textInfo !== 'undefined')
|
|
606
|
-
|
|
613
|
+
isRTLResolved = intlLocale.textInfo.direction === 'rtl';
|
|
607
614
|
}
|
|
608
615
|
catch (_) {
|
|
609
616
|
}
|
|
610
617
|
}
|
|
611
|
-
if (typeof
|
|
612
|
-
var matched = /^([A-Za-z]{1,8})(?:[-_][A-Za-z0-9]{1,8})*$/.exec(
|
|
618
|
+
if (typeof isRTLResolved !== 'boolean') {
|
|
619
|
+
var matched = /^([A-Za-z]{1,8})(?:[-_][A-Za-z0-9]{1,8})*$/.exec(language);
|
|
613
620
|
if (matched !== null) {
|
|
614
|
-
var
|
|
621
|
+
var lang = matched[1].toLowerCase();
|
|
615
622
|
for (var i = 0; i < RTL_LANGUAGES.length; i++) {
|
|
616
|
-
if (RTL_LANGUAGES[i] ===
|
|
617
|
-
|
|
623
|
+
if (RTL_LANGUAGES[i] === lang) {
|
|
624
|
+
isRTLResolved = true;
|
|
618
625
|
break;
|
|
619
626
|
}
|
|
620
627
|
}
|
|
621
628
|
}
|
|
622
629
|
}
|
|
623
630
|
}
|
|
624
|
-
if (typeof
|
|
625
|
-
|
|
626
|
-
cachedLocale =
|
|
631
|
+
if (typeof isRTLResolved === 'boolean')
|
|
632
|
+
isRTL = isRTLResolved;
|
|
633
|
+
cachedLocale = { language: language, languages: languages, timezone: timezone, offset: offset, isRTL: isRTL };
|
|
627
634
|
return cachedLocale;
|
|
628
635
|
}
|
|
629
636
|
function getDevice() {
|
|
@@ -674,38 +681,38 @@ function parseFromHighEntropyValues() {
|
|
|
674
681
|
if (prevBrandName === null || /Chrom/.test(prevBrandName) || !/Chrom/.test(brandName)) {
|
|
675
682
|
browserName = brandName;
|
|
676
683
|
if (browserName === 'Chrome' || browserName === 'Chrome WebView' || browserName === 'Chrome Headless')
|
|
677
|
-
|
|
684
|
+
parsedFromHighEntropyValuesBrowserName = Browsers.Chrome;
|
|
678
685
|
else if (browserName === 'Edge' || browserName === 'Edge WebView2')
|
|
679
|
-
|
|
686
|
+
parsedFromHighEntropyValuesBrowserName = Browsers.Edge;
|
|
680
687
|
else if (browserName === 'Opera Mobi')
|
|
681
|
-
|
|
682
|
-
|
|
688
|
+
parsedFromHighEntropyValuesBrowserName = Browsers.Opera;
|
|
689
|
+
parsedFromHighEntropyValuesBrowserVersion = brandVersion;
|
|
683
690
|
}
|
|
684
691
|
prevBrandName = brandName;
|
|
685
692
|
}
|
|
686
693
|
if (brandName === 'Chromium')
|
|
687
|
-
|
|
694
|
+
parsedFromHighEntropyValuesEngineVersion = brandVersion;
|
|
688
695
|
}
|
|
689
696
|
if (typeof platformVersion === 'string') {
|
|
690
697
|
if (getParsedCache().os.name === OS.Windows) {
|
|
691
698
|
if (parseInt(platformVersion.split('.')[0], 10) >= 13)
|
|
692
|
-
|
|
699
|
+
parsedFromHighEntropyValuesOSVersion = '11';
|
|
693
700
|
else
|
|
694
|
-
|
|
701
|
+
parsedFromHighEntropyValuesOSVersion = '10';
|
|
695
702
|
}
|
|
696
703
|
else {
|
|
697
|
-
|
|
704
|
+
parsedFromHighEntropyValuesOSVersion = platformVersion;
|
|
698
705
|
}
|
|
699
706
|
}
|
|
700
707
|
if (typeof platform === 'string') {
|
|
701
708
|
if (/android/i.test(platform))
|
|
702
|
-
|
|
709
|
+
parsedFromHighEntropyValuesOSName = OS.Android;
|
|
703
710
|
else if (/ios|iphone|ipad/i.test(platform))
|
|
704
|
-
|
|
711
|
+
parsedFromHighEntropyValuesOSName = OS.iOS;
|
|
705
712
|
else if (/windows|win32/i.test(platform))
|
|
706
|
-
|
|
713
|
+
parsedFromHighEntropyValuesOSName = OS.Windows;
|
|
707
714
|
else if (/macos|macintel/i.test(platform))
|
|
708
|
-
|
|
715
|
+
parsedFromHighEntropyValuesOSName = OS.MacOS;
|
|
709
716
|
}
|
|
710
717
|
if (result.mobile === true)
|
|
711
718
|
parsedFromHighEntropyValuesDevice = Devices.Mobile;
|
|
@@ -827,6 +834,8 @@ function createSubscriptionManager(attach, detach) {
|
|
|
827
834
|
},
|
|
828
835
|
subscribe: function (listener, options) {
|
|
829
836
|
if (options === void 0) { options = {}; }
|
|
837
|
+
if (typeof options.signal !== 'undefined' && options.signal.aborted)
|
|
838
|
+
return function () { };
|
|
830
839
|
var entry = { fn: listener, once: false };
|
|
831
840
|
if (typeof options.once !== 'undefined')
|
|
832
841
|
entry.once = options.once;
|
|
@@ -845,12 +854,8 @@ function createSubscriptionManager(attach, detach) {
|
|
|
845
854
|
EventListener.remove(entry.signal, { type: 'abort', callback: cleanup });
|
|
846
855
|
removeEntry(entry);
|
|
847
856
|
};
|
|
848
|
-
if (typeof entry.signal !== 'undefined')
|
|
849
|
-
|
|
850
|
-
removeEntry(entry);
|
|
851
|
-
else
|
|
852
|
-
EventListener.add(entry.signal, { type: 'abort', callback: cleanup });
|
|
853
|
-
}
|
|
857
|
+
if (typeof entry.signal !== 'undefined')
|
|
858
|
+
EventListener.add(entry.signal, { type: 'abort', callback: cleanup });
|
|
854
859
|
return function unsubscribe() {
|
|
855
860
|
removeEntry(entry);
|
|
856
861
|
};
|
|
@@ -858,14 +863,14 @@ function createSubscriptionManager(attach, detach) {
|
|
|
858
863
|
};
|
|
859
864
|
}
|
|
860
865
|
|
|
861
|
-
var onChangeSubscriptionManager$
|
|
866
|
+
var onChangeSubscriptionManager$4 = createSubscriptionManager(attachOnChange$4, detachOnChange$4);
|
|
862
867
|
var appearanceRef = null;
|
|
863
868
|
var pollingIntervalId = null;
|
|
864
869
|
var Appearance = {
|
|
865
870
|
get value() {
|
|
866
871
|
return getAppearance();
|
|
867
872
|
},
|
|
868
|
-
onChange: onChangeSubscriptionManager$
|
|
873
|
+
onChange: onChangeSubscriptionManager$4.subscribe,
|
|
869
874
|
Constants: {
|
|
870
875
|
Appearances: Appearances
|
|
871
876
|
},
|
|
@@ -884,9 +889,9 @@ function getAppearanceFromEngine() {
|
|
|
884
889
|
return Appearances.Light;
|
|
885
890
|
}
|
|
886
891
|
function getAppearanceFromMediaQuery() {
|
|
887
|
-
if (
|
|
892
|
+
if (PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST.media === 'not all')
|
|
888
893
|
return Appearances.Unknown;
|
|
889
|
-
if (
|
|
894
|
+
if (PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST.matches)
|
|
890
895
|
return Appearances.Dark;
|
|
891
896
|
return Appearances.Light;
|
|
892
897
|
}
|
|
@@ -901,7 +906,7 @@ function startPolling() {
|
|
|
901
906
|
var appearance = getAppearanceFromEngine();
|
|
902
907
|
if (appearance !== appearanceRef) {
|
|
903
908
|
appearanceRef = appearance;
|
|
904
|
-
onChangeSubscriptionManager$
|
|
909
|
+
onChangeSubscriptionManager$4.emit(appearance);
|
|
905
910
|
}
|
|
906
911
|
}, 2000);
|
|
907
912
|
}
|
|
@@ -912,15 +917,15 @@ function stopPolling() {
|
|
|
912
917
|
pollingIntervalId = null;
|
|
913
918
|
}
|
|
914
919
|
}
|
|
915
|
-
function attachOnChange$
|
|
920
|
+
function attachOnChange$4() {
|
|
916
921
|
appearanceRef = getAppearanceFromMediaQuery();
|
|
917
|
-
EventListener.add(
|
|
922
|
+
EventListener.add(PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST, { type: 'change', callback: onMediaChange });
|
|
918
923
|
if (Platform.browser.name === Browsers.SamsungInternet)
|
|
919
924
|
startPolling();
|
|
920
925
|
}
|
|
921
|
-
function detachOnChange$
|
|
926
|
+
function detachOnChange$4() {
|
|
922
927
|
appearanceRef = null;
|
|
923
|
-
EventListener.remove(
|
|
928
|
+
EventListener.remove(PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST, { type: 'change', callback: onMediaChange });
|
|
924
929
|
if (Platform.browser.name === Browsers.SamsungInternet)
|
|
925
930
|
stopPolling();
|
|
926
931
|
}
|
|
@@ -931,7 +936,7 @@ function onMediaChange(event) {
|
|
|
931
936
|
else
|
|
932
937
|
appearance = Appearances.Light;
|
|
933
938
|
if (appearance !== appearanceRef)
|
|
934
|
-
onChangeSubscriptionManager$
|
|
939
|
+
onChangeSubscriptionManager$4.emit(appearanceRef = appearance);
|
|
935
940
|
}
|
|
936
941
|
|
|
937
942
|
function isSecureContext() {
|
|
@@ -1348,9 +1353,20 @@ function cleanupPaste(div, onPaste) {
|
|
|
1348
1353
|
|
|
1349
1354
|
var Orientation;
|
|
1350
1355
|
(function (Orientation) {
|
|
1351
|
-
Orientation["
|
|
1352
|
-
Orientation["
|
|
1353
|
-
Orientation["
|
|
1356
|
+
Orientation["PortraitPrimary"] = "portrait-primary";
|
|
1357
|
+
Orientation["PortraitSecondary"] = "portrait-secondary";
|
|
1358
|
+
Orientation["LandscapePrimary"] = "landscape-primary";
|
|
1359
|
+
Orientation["LandscapeSecondary"] = "landscape-secondary";
|
|
1360
|
+
})(Orientation || (Orientation = {}));
|
|
1361
|
+
(function (Orientation) {
|
|
1362
|
+
function isLandscape(orientation) {
|
|
1363
|
+
return orientation === Orientation.LandscapePrimary || orientation === Orientation.LandscapeSecondary;
|
|
1364
|
+
}
|
|
1365
|
+
Orientation.isLandscape = isLandscape;
|
|
1366
|
+
function isPortrait(orientation) {
|
|
1367
|
+
return orientation === Orientation.PortraitPrimary || orientation === Orientation.PortraitSecondary;
|
|
1368
|
+
}
|
|
1369
|
+
Orientation.isPortrait = isPortrait;
|
|
1354
1370
|
})(Orientation || (Orientation = {}));
|
|
1355
1371
|
var ENV_PRESETS = {
|
|
1356
1372
|
'safe-area-inset': {
|
|
@@ -1388,19 +1404,16 @@ var ENV_PRESETS = {
|
|
|
1388
1404
|
left: 'viewport-segment-left',
|
|
1389
1405
|
},
|
|
1390
1406
|
};
|
|
1391
|
-
var
|
|
1392
|
-
innerWidth: -1,
|
|
1393
|
-
innerHeight: -1,
|
|
1394
|
-
outerWidth: -1,
|
|
1395
|
-
outerHeight: -1,
|
|
1396
|
-
scale: 1,
|
|
1397
|
-
orientation: Orientation.Unknown,
|
|
1398
|
-
};
|
|
1399
|
-
var MEDIA_QUERY_LIST;
|
|
1407
|
+
var ORIENTATION_MEDIA_QUERY_LIST;
|
|
1400
1408
|
if (typeof globalThis.matchMedia !== 'undefined')
|
|
1401
|
-
|
|
1409
|
+
ORIENTATION_MEDIA_QUERY_LIST = globalThis.matchMedia('(orientation: portrait)');
|
|
1402
1410
|
else
|
|
1403
|
-
|
|
1411
|
+
ORIENTATION_MEDIA_QUERY_LIST = FALLBACK_MEDIA_QUERY_LIST;
|
|
1412
|
+
var DEVICE_POSTURE_MEDIA_QUERY_LIST;
|
|
1413
|
+
if (typeof globalThis.matchMedia !== 'undefined')
|
|
1414
|
+
DEVICE_POSTURE_MEDIA_QUERY_LIST = globalThis.matchMedia('(device-posture: folded)');
|
|
1415
|
+
else
|
|
1416
|
+
DEVICE_POSTURE_MEDIA_QUERY_LIST = FALLBACK_MEDIA_QUERY_LIST;
|
|
1404
1417
|
|
|
1405
1418
|
function keys(object) {
|
|
1406
1419
|
var keys = [];
|
|
@@ -1422,8 +1435,297 @@ function defer(task) {
|
|
|
1422
1435
|
globalThis.setTimeout(task, 0);
|
|
1423
1436
|
}
|
|
1424
1437
|
|
|
1438
|
+
var MAX_SEGMENTS_PER_AXIS = 4;
|
|
1425
1439
|
function noop() {
|
|
1426
1440
|
}
|
|
1441
|
+
function getSupportedEnvironment() {
|
|
1442
|
+
if (typeof globalThis.CSS !== 'undefined' && typeof globalThis.CSS.supports === 'function') {
|
|
1443
|
+
if (globalThis.CSS.supports('x: env(x)'))
|
|
1444
|
+
return 'env';
|
|
1445
|
+
if (globalThis.CSS.supports('x: constant(x)'))
|
|
1446
|
+
return 'constant';
|
|
1447
|
+
}
|
|
1448
|
+
return undefined;
|
|
1449
|
+
}
|
|
1450
|
+
function getSegmentGrid() {
|
|
1451
|
+
if (typeof globalThis.matchMedia !== 'function')
|
|
1452
|
+
return { rows: 1, cols: 1 };
|
|
1453
|
+
var cols = 1;
|
|
1454
|
+
var rows = 1;
|
|
1455
|
+
for (var i = MAX_SEGMENTS_PER_AXIS; i >= 2; i--) {
|
|
1456
|
+
if (globalThis.matchMedia('(horizontal-viewport-segments: ' + i + ')').matches) {
|
|
1457
|
+
cols = i;
|
|
1458
|
+
break;
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
for (var i = MAX_SEGMENTS_PER_AXIS; i >= 2; i--) {
|
|
1462
|
+
if (globalThis.matchMedia('(vertical-viewport-segments: ' + i + ')').matches) {
|
|
1463
|
+
rows = i;
|
|
1464
|
+
break;
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
return { rows: rows, cols: cols };
|
|
1468
|
+
}
|
|
1469
|
+
function buildSegmentMediaQueryLists() {
|
|
1470
|
+
if (typeof globalThis.matchMedia !== 'function')
|
|
1471
|
+
return [];
|
|
1472
|
+
var mediaQueryLists = [];
|
|
1473
|
+
for (var i = 2; i <= MAX_SEGMENTS_PER_AXIS; i++) {
|
|
1474
|
+
mediaQueryLists.push(globalThis.matchMedia('(horizontal-viewport-segments: ' + i + ')'));
|
|
1475
|
+
mediaQueryLists.push(globalThis.matchMedia('(vertical-viewport-segments: ' + i + ')'));
|
|
1476
|
+
}
|
|
1477
|
+
return mediaQueryLists;
|
|
1478
|
+
}
|
|
1479
|
+
function createViewportSegmentObserver() {
|
|
1480
|
+
var viewport = globalThis.viewport;
|
|
1481
|
+
var visualViewport = globalThis.visualViewport;
|
|
1482
|
+
var devicePosture = globalThis.navigator.devicePosture;
|
|
1483
|
+
var hasSegmentsAPI = typeof viewport !== 'undefined';
|
|
1484
|
+
var hasLegacySegmentsAPI = !hasSegmentsAPI && typeof visualViewport !== 'undefined' && visualViewport !== null && typeof visualViewport.segments !== 'undefined';
|
|
1485
|
+
var hasDevicePosture = typeof devicePosture !== 'undefined';
|
|
1486
|
+
var onChangeSubscriptionManager = createSubscriptionManager(attachOnChange, detachOnChange);
|
|
1487
|
+
var support = getSupportedEnvironment();
|
|
1488
|
+
var cachedDiv = null;
|
|
1489
|
+
var segmentMediaQueryLists = [];
|
|
1490
|
+
var previousSegments = null;
|
|
1491
|
+
function attachCSSFallbackListeners() {
|
|
1492
|
+
segmentMediaQueryLists = buildSegmentMediaQueryLists();
|
|
1493
|
+
for (var i = 0; i < segmentMediaQueryLists.length; i++)
|
|
1494
|
+
EventListener.add(segmentMediaQueryLists[i], { type: 'change', callback: onSegmentChange });
|
|
1495
|
+
if (DEVICE_POSTURE_MEDIA_QUERY_LIST.media !== 'not all')
|
|
1496
|
+
EventListener.add(DEVICE_POSTURE_MEDIA_QUERY_LIST, { type: 'change', callback: onSegmentChange });
|
|
1497
|
+
}
|
|
1498
|
+
function detachCSSFallbackListeners() {
|
|
1499
|
+
for (var i = 0; i < segmentMediaQueryLists.length; i++)
|
|
1500
|
+
EventListener.remove(segmentMediaQueryLists[i], { type: 'change', callback: onSegmentChange });
|
|
1501
|
+
segmentMediaQueryLists = [];
|
|
1502
|
+
if (DEVICE_POSTURE_MEDIA_QUERY_LIST.media !== 'not all')
|
|
1503
|
+
EventListener.remove(DEVICE_POSTURE_MEDIA_QUERY_LIST, { type: 'change', callback: onSegmentChange });
|
|
1504
|
+
}
|
|
1505
|
+
function attachDevicePostureChangeListener() {
|
|
1506
|
+
if (hasDevicePosture)
|
|
1507
|
+
EventListener.add(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
1508
|
+
attachCSSFallbackListeners();
|
|
1509
|
+
}
|
|
1510
|
+
function detachDevicePostureChangeListener() {
|
|
1511
|
+
if (hasDevicePosture)
|
|
1512
|
+
EventListener.remove(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
1513
|
+
detachCSSFallbackListeners();
|
|
1514
|
+
}
|
|
1515
|
+
function attachVisualViewportResizeListener() {
|
|
1516
|
+
EventListener.add(visualViewport, { type: 'resize', callback: onSegmentChange, options: { passive: true } });
|
|
1517
|
+
}
|
|
1518
|
+
function detachVisualViewportResizeListener() {
|
|
1519
|
+
EventListener.remove(visualViewport, { type: 'resize', callback: onSegmentChange, options: { passive: true } });
|
|
1520
|
+
}
|
|
1521
|
+
function attachOnChange() {
|
|
1522
|
+
EventListener.add(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
1523
|
+
if (hasSegmentsAPI) {
|
|
1524
|
+
attachDevicePostureChangeListener();
|
|
1525
|
+
}
|
|
1526
|
+
else if (hasLegacySegmentsAPI) {
|
|
1527
|
+
attachVisualViewportResizeListener();
|
|
1528
|
+
attachDevicePostureChangeListener();
|
|
1529
|
+
}
|
|
1530
|
+
else {
|
|
1531
|
+
getOrCreateCachedDiv();
|
|
1532
|
+
attachVisualViewportResizeListener();
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
function detachOnChange() {
|
|
1536
|
+
EventListener.remove(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
1537
|
+
if (hasSegmentsAPI) {
|
|
1538
|
+
detachDevicePostureChangeListener();
|
|
1539
|
+
}
|
|
1540
|
+
else if (hasLegacySegmentsAPI) {
|
|
1541
|
+
detachVisualViewportResizeListener();
|
|
1542
|
+
detachDevicePostureChangeListener();
|
|
1543
|
+
}
|
|
1544
|
+
else {
|
|
1545
|
+
detachVisualViewportResizeListener();
|
|
1546
|
+
releaseDiv();
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
function segmentsEqual(segments1, segments2) {
|
|
1550
|
+
if (segments1.length !== segments2.length)
|
|
1551
|
+
return false;
|
|
1552
|
+
for (var i = 0; i < segments1.length; i++) {
|
|
1553
|
+
var segment1 = segments1[i];
|
|
1554
|
+
var segment2 = segments2[i];
|
|
1555
|
+
if (segment1.width !== segment2.width || segment1.height !== segment2.height || segment1.top !== segment2.top || segment1.left !== segment2.left || segment1.bottom !== segment2.bottom || segment1.right !== segment2.right)
|
|
1556
|
+
return false;
|
|
1557
|
+
}
|
|
1558
|
+
return true;
|
|
1559
|
+
}
|
|
1560
|
+
function onSegmentChange() {
|
|
1561
|
+
var next = getValue();
|
|
1562
|
+
if (previousSegments !== null && segmentsEqual(previousSegments, next))
|
|
1563
|
+
return;
|
|
1564
|
+
previousSegments = next;
|
|
1565
|
+
onChangeSubscriptionManager.emit(next);
|
|
1566
|
+
}
|
|
1567
|
+
function buildDiv() {
|
|
1568
|
+
var div = createHiddenElement('div');
|
|
1569
|
+
div.setAttribute('data-viewport-segment-observer', '');
|
|
1570
|
+
div.style.setProperty('position', 'fixed', 'important');
|
|
1571
|
+
div.style.setProperty('top', '0', 'important');
|
|
1572
|
+
div.style.setProperty('left', '0', 'important');
|
|
1573
|
+
div.style.setProperty('visibility', 'hidden', 'important');
|
|
1574
|
+
div.style.setProperty('pointer-events', 'none', 'important');
|
|
1575
|
+
div.style.setProperty('z-index', '-1', 'important');
|
|
1576
|
+
div.style.setProperty('box-sizing', 'content-box', 'important');
|
|
1577
|
+
div.style.setProperty('padding', '0', 'important');
|
|
1578
|
+
div.style.setProperty('margin', '0', 'important');
|
|
1579
|
+
div.style.setProperty('border', '0', 'important');
|
|
1580
|
+
div.style.setProperty('width', '0', 'important');
|
|
1581
|
+
div.style.setProperty('height', '0', 'important');
|
|
1582
|
+
div.style.setProperty('min-width', '0', 'important');
|
|
1583
|
+
div.style.setProperty('min-height', '0', 'important');
|
|
1584
|
+
div.style.setProperty('max-width', 'none', 'important');
|
|
1585
|
+
div.style.setProperty('max-height', 'none', 'important');
|
|
1586
|
+
div.style.setProperty('transition', 'none', 'important');
|
|
1587
|
+
div.style.setProperty('animation', 'none', 'important');
|
|
1588
|
+
div.style.setProperty('display', 'block', 'important');
|
|
1589
|
+
div.style.setProperty('float', 'none', 'important');
|
|
1590
|
+
div.style.setProperty('transform', 'none', 'important');
|
|
1591
|
+
return div;
|
|
1592
|
+
}
|
|
1593
|
+
function getOrCreateCachedDiv() {
|
|
1594
|
+
if (cachedDiv !== null)
|
|
1595
|
+
return cachedDiv;
|
|
1596
|
+
cachedDiv = buildDiv();
|
|
1597
|
+
globalThis.document.body.appendChild(cachedDiv);
|
|
1598
|
+
return cachedDiv;
|
|
1599
|
+
}
|
|
1600
|
+
function releaseDiv() {
|
|
1601
|
+
if (cachedDiv !== null) {
|
|
1602
|
+
if (cachedDiv.parentNode !== null)
|
|
1603
|
+
cachedDiv.parentNode.removeChild(cachedDiv);
|
|
1604
|
+
cachedDiv = null;
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
function readFromSegmentsAPI() {
|
|
1608
|
+
var segments;
|
|
1609
|
+
if (hasSegmentsAPI)
|
|
1610
|
+
segments = viewport.segments;
|
|
1611
|
+
else
|
|
1612
|
+
segments = visualViewport.segments;
|
|
1613
|
+
if (segments === null || typeof segments === 'undefined')
|
|
1614
|
+
return [];
|
|
1615
|
+
var results = [];
|
|
1616
|
+
for (var i = 0; i < segments.length; i++) {
|
|
1617
|
+
var segment = segments[i];
|
|
1618
|
+
results.push({
|
|
1619
|
+
width: segment.width,
|
|
1620
|
+
height: segment.height,
|
|
1621
|
+
top: segment.top,
|
|
1622
|
+
left: segment.left,
|
|
1623
|
+
bottom: segment.bottom,
|
|
1624
|
+
right: segment.right,
|
|
1625
|
+
});
|
|
1626
|
+
}
|
|
1627
|
+
return results;
|
|
1628
|
+
}
|
|
1629
|
+
function buildFullViewportSegment() {
|
|
1630
|
+
var width = globalThis.innerWidth;
|
|
1631
|
+
var height = globalThis.innerHeight;
|
|
1632
|
+
return {
|
|
1633
|
+
width: width,
|
|
1634
|
+
height: height,
|
|
1635
|
+
top: 0,
|
|
1636
|
+
left: 0,
|
|
1637
|
+
bottom: height,
|
|
1638
|
+
right: width,
|
|
1639
|
+
};
|
|
1640
|
+
}
|
|
1641
|
+
function readFromCSSEnv(div) {
|
|
1642
|
+
var grid = getSegmentGrid();
|
|
1643
|
+
if (grid.rows === 1 && grid.cols === 1)
|
|
1644
|
+
return [buildFullViewportSegment()];
|
|
1645
|
+
if (typeof support === 'undefined' || typeof div.style.setProperty === 'undefined')
|
|
1646
|
+
return [buildFullViewportSegment()];
|
|
1647
|
+
var results = [];
|
|
1648
|
+
for (var row = 0; row < grid.rows; row++) {
|
|
1649
|
+
for (var col = 0; col < grid.cols; col++) {
|
|
1650
|
+
div.style.setProperty('width', support + '(viewport-segment-width ' + row + ' ' + col + ', -1px)', 'important');
|
|
1651
|
+
div.style.setProperty('height', support + '(viewport-segment-height ' + row + ' ' + col + ', -1px)', 'important');
|
|
1652
|
+
div.style.setProperty('margin-top', support + '(viewport-segment-top ' + row + ' ' + col + ', -1px)', 'important');
|
|
1653
|
+
div.style.setProperty('margin-left', support + '(viewport-segment-left ' + row + ' ' + col + ', -1px)', 'important');
|
|
1654
|
+
div.style.setProperty('margin-bottom', support + '(viewport-segment-bottom ' + row + ' ' + col + ', -1px)', 'important');
|
|
1655
|
+
div.style.setProperty('margin-right', support + '(viewport-segment-right ' + row + ' ' + col + ', -1px)', 'important');
|
|
1656
|
+
var computed = globalThis.getComputedStyle(div);
|
|
1657
|
+
var top_1 = globalThis.parseFloat(computed.marginTop);
|
|
1658
|
+
if (top_1 < 0)
|
|
1659
|
+
continue;
|
|
1660
|
+
var left = globalThis.parseFloat(computed.marginLeft);
|
|
1661
|
+
var bottom = globalThis.parseFloat(computed.marginBottom);
|
|
1662
|
+
var right = globalThis.parseFloat(computed.marginRight);
|
|
1663
|
+
var width = globalThis.parseFloat(computed.width);
|
|
1664
|
+
var height = globalThis.parseFloat(computed.height);
|
|
1665
|
+
results.push({
|
|
1666
|
+
width: width,
|
|
1667
|
+
height: height,
|
|
1668
|
+
top: top_1,
|
|
1669
|
+
left: left,
|
|
1670
|
+
bottom: bottom,
|
|
1671
|
+
right: right,
|
|
1672
|
+
});
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
return results;
|
|
1676
|
+
}
|
|
1677
|
+
function getValue() {
|
|
1678
|
+
if (hasSegmentsAPI || hasLegacySegmentsAPI)
|
|
1679
|
+
return readFromSegmentsAPI();
|
|
1680
|
+
if (cachedDiv !== null)
|
|
1681
|
+
return readFromCSSEnv(cachedDiv);
|
|
1682
|
+
var div = buildDiv();
|
|
1683
|
+
globalThis.document.body.appendChild(div);
|
|
1684
|
+
var results = readFromCSSEnv(div);
|
|
1685
|
+
globalThis.document.body.removeChild(div);
|
|
1686
|
+
return results;
|
|
1687
|
+
}
|
|
1688
|
+
function useCssVariable(prefix) {
|
|
1689
|
+
if (typeof globalThis.document === 'undefined')
|
|
1690
|
+
return noop;
|
|
1691
|
+
var attributes = keys(ENV_PRESETS['viewport-segment']);
|
|
1692
|
+
var element = globalThis.document.documentElement;
|
|
1693
|
+
var lastCount = 0;
|
|
1694
|
+
function applySegments(segments) {
|
|
1695
|
+
for (var i = segments.length; i < lastCount; i++) {
|
|
1696
|
+
for (var j = 0; j < attributes.length; j++) {
|
|
1697
|
+
element.style.removeProperty('--' + prefix + '-' + i + '-' + attributes[j]);
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
lastCount = segments.length;
|
|
1701
|
+
for (var i = 0; i < segments.length; i++) {
|
|
1702
|
+
var segment = segments[i];
|
|
1703
|
+
for (var j = 0; j < attributes.length; j++) {
|
|
1704
|
+
var attribute = attributes[j];
|
|
1705
|
+
element.style.setProperty('--' + prefix + '-' + i + '-' + attribute, segment[attribute] + 'px');
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
applySegments(getValue());
|
|
1710
|
+
var unsubscribe = onChangeSubscriptionManager.subscribe(function (segments) {
|
|
1711
|
+
applySegments(segments);
|
|
1712
|
+
});
|
|
1713
|
+
return function () {
|
|
1714
|
+
unsubscribe();
|
|
1715
|
+
for (var i = 0; i < lastCount; i++)
|
|
1716
|
+
for (var j = 0; j < attributes.length; j++)
|
|
1717
|
+
element.style.removeProperty('--' + prefix + '-' + i + '-' + attributes[j]);
|
|
1718
|
+
lastCount = 0;
|
|
1719
|
+
};
|
|
1720
|
+
}
|
|
1721
|
+
return {
|
|
1722
|
+
get value() {
|
|
1723
|
+
return getValue();
|
|
1724
|
+
},
|
|
1725
|
+
onChange: onChangeSubscriptionManager.subscribe,
|
|
1726
|
+
useCssVariable: useCssVariable,
|
|
1727
|
+
};
|
|
1728
|
+
}
|
|
1427
1729
|
function createVirtualKeyboardObserver() {
|
|
1428
1730
|
var onChangeSubscriptionManager = createSubscriptionManager(attachOnChange, detachOnChange);
|
|
1429
1731
|
function attachOnChange() {
|
|
@@ -1441,16 +1743,16 @@ function createVirtualKeyboardObserver() {
|
|
|
1441
1743
|
var top = rect.y;
|
|
1442
1744
|
var width = rect.width;
|
|
1443
1745
|
var height = rect.height;
|
|
1444
|
-
var right
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
var bottom
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1746
|
+
var right;
|
|
1747
|
+
if (width === 0)
|
|
1748
|
+
right = 0;
|
|
1749
|
+
else
|
|
1750
|
+
right = Math.max(0, globalThis.innerWidth - (left + width));
|
|
1751
|
+
var bottom;
|
|
1752
|
+
if (height === 0)
|
|
1753
|
+
bottom = 0;
|
|
1754
|
+
else
|
|
1755
|
+
bottom = Math.max(0, globalThis.innerHeight - (top + height));
|
|
1454
1756
|
return {
|
|
1455
1757
|
top: top,
|
|
1456
1758
|
right: right,
|
|
@@ -1460,17 +1762,43 @@ function createVirtualKeyboardObserver() {
|
|
|
1460
1762
|
height: height,
|
|
1461
1763
|
};
|
|
1462
1764
|
}
|
|
1765
|
+
function useCssVariable(prefix) {
|
|
1766
|
+
if (typeof globalThis.document === 'undefined')
|
|
1767
|
+
return noop;
|
|
1768
|
+
var attributes = keys(ENV_PRESETS['keyboard-inset']);
|
|
1769
|
+
var element = globalThis.document.documentElement;
|
|
1770
|
+
function applyValues(values) {
|
|
1771
|
+
for (var i = 0; i < attributes.length; i++) {
|
|
1772
|
+
var attribute = attributes[i];
|
|
1773
|
+
element.style.setProperty('--' + prefix + '-' + attribute, values[attribute] + 'px');
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
applyValues(getValue());
|
|
1777
|
+
var unsubscribe = onChangeSubscriptionManager.subscribe(function (values) {
|
|
1778
|
+
applyValues(values);
|
|
1779
|
+
});
|
|
1780
|
+
return function () {
|
|
1781
|
+
unsubscribe();
|
|
1782
|
+
for (var i = 0; i < attributes.length; i++)
|
|
1783
|
+
element.style.removeProperty('--' + prefix + '-' + attributes[i]);
|
|
1784
|
+
};
|
|
1785
|
+
}
|
|
1463
1786
|
return {
|
|
1464
|
-
get
|
|
1787
|
+
get value() {
|
|
1788
|
+
return getValue();
|
|
1789
|
+
},
|
|
1465
1790
|
onChange: onChangeSubscriptionManager.subscribe,
|
|
1791
|
+
useCssVariable: useCssVariable,
|
|
1466
1792
|
};
|
|
1467
1793
|
}
|
|
1468
|
-
function
|
|
1794
|
+
function createEnvironmentObserver(preset) {
|
|
1469
1795
|
if (preset === 'keyboard-inset' && typeof globalThis.navigator.virtualKeyboard !== 'undefined')
|
|
1470
1796
|
return createVirtualKeyboardObserver();
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
var
|
|
1797
|
+
if (preset === 'viewport-segment')
|
|
1798
|
+
return createViewportSegmentObserver();
|
|
1799
|
+
var environmentMap = ENV_PRESETS[preset];
|
|
1800
|
+
var attributes = keys(environmentMap);
|
|
1801
|
+
var support = getSupportedEnvironment();
|
|
1474
1802
|
var parentReadyCallbacks = [];
|
|
1475
1803
|
var onChangeSubscriptionManager = createSubscriptionManager(attachOnChange, detachOnChange);
|
|
1476
1804
|
var elementComputedStyle = {};
|
|
@@ -1487,15 +1815,6 @@ function createEnvObserver(preset) {
|
|
|
1487
1815
|
function detachOnChange() {
|
|
1488
1816
|
removeDetector();
|
|
1489
1817
|
}
|
|
1490
|
-
function getSupportedEnv() {
|
|
1491
|
-
if (typeof globalThis.CSS !== 'undefined' && typeof globalThis.CSS.supports === 'function') {
|
|
1492
|
-
if (globalThis.CSS.supports('x: env(x)'))
|
|
1493
|
-
return 'env';
|
|
1494
|
-
if (globalThis.CSS.supports('x: constant(x)'))
|
|
1495
|
-
return 'constant';
|
|
1496
|
-
}
|
|
1497
|
-
return undefined;
|
|
1498
|
-
}
|
|
1499
1818
|
function isSameValues(a, b) {
|
|
1500
1819
|
for (var i = 0; i < attributes.length; i++) {
|
|
1501
1820
|
var key = attributes[i];
|
|
@@ -1535,7 +1854,7 @@ function createEnvObserver(preset) {
|
|
|
1535
1854
|
parentReadyCallbacks[i]();
|
|
1536
1855
|
}
|
|
1537
1856
|
function addChild(parent, attribute) {
|
|
1538
|
-
var envVar =
|
|
1857
|
+
var envVar = environmentMap[attribute];
|
|
1539
1858
|
var p1 = globalThis.document.createElement('div');
|
|
1540
1859
|
var p2 = globalThis.document.createElement('div');
|
|
1541
1860
|
var c1 = globalThis.document.createElement('div');
|
|
@@ -1598,9 +1917,8 @@ function createEnvObserver(preset) {
|
|
|
1598
1917
|
}
|
|
1599
1918
|
function init() {
|
|
1600
1919
|
if (typeof support === 'undefined') {
|
|
1601
|
-
for (var i = 0; i < attributes.length; i++)
|
|
1920
|
+
for (var i = 0; i < attributes.length; i++)
|
|
1602
1921
|
elementComputedStyle[attributes[i]] = 0;
|
|
1603
|
-
}
|
|
1604
1922
|
return;
|
|
1605
1923
|
}
|
|
1606
1924
|
elementComputedStyle = {};
|
|
@@ -1644,8 +1962,28 @@ function createEnvObserver(preset) {
|
|
|
1644
1962
|
}
|
|
1645
1963
|
return result;
|
|
1646
1964
|
}
|
|
1965
|
+
function useCssVariable(prefix) {
|
|
1966
|
+
if (typeof support === 'undefined' || typeof globalThis.document === 'undefined')
|
|
1967
|
+
return noop;
|
|
1968
|
+
var element = globalThis.document.documentElement;
|
|
1969
|
+
function applyValues(values) {
|
|
1970
|
+
for (var i = 0; i < attributes.length; i++) {
|
|
1971
|
+
var attribute = attributes[i];
|
|
1972
|
+
element.style.setProperty('--' + prefix + '-' + String(attributes[i]), values[attribute] + 'px');
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
var unsubscribe = onChangeSubscriptionManager.subscribe(function (values) {
|
|
1976
|
+
applyValues(values);
|
|
1977
|
+
});
|
|
1978
|
+
applyValues(readValues());
|
|
1979
|
+
return function () {
|
|
1980
|
+
unsubscribe();
|
|
1981
|
+
for (var i = 0; i < attributes.length; i++)
|
|
1982
|
+
element.style.removeProperty('--' + prefix + '-' + String(attributes[i]));
|
|
1983
|
+
};
|
|
1984
|
+
}
|
|
1647
1985
|
return {
|
|
1648
|
-
get
|
|
1986
|
+
get value() {
|
|
1649
1987
|
if (parentDiv !== null)
|
|
1650
1988
|
return readValues();
|
|
1651
1989
|
init();
|
|
@@ -1658,133 +1996,10 @@ function createEnvObserver(preset) {
|
|
|
1658
1996
|
if (typeof support === 'undefined')
|
|
1659
1997
|
return noop;
|
|
1660
1998
|
return onChangeSubscriptionManager.subscribe(callback, options);
|
|
1661
|
-
}
|
|
1662
|
-
};
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
var safeAreaInsetObserver = createEnvObserver('safe-area-inset');
|
|
1666
|
-
var safeAreaMaxInsetObserver = createEnvObserver('safe-area-max-inset');
|
|
1667
|
-
var keyboardInsetObserver = createEnvObserver('keyboard-inset');
|
|
1668
|
-
var titlebarAreaObserver = createEnvObserver('titlebar-area');
|
|
1669
|
-
var viewportSegmentObserver = createEnvObserver('viewport-segment');
|
|
1670
|
-
var onChangeSubscriptionManager$4 = createSubscriptionManager(attachOnChange$4, detachOnChange$4);
|
|
1671
|
-
var dimensionRef = null;
|
|
1672
|
-
var Dimension = {
|
|
1673
|
-
get value() {
|
|
1674
|
-
return getDimension();
|
|
1675
|
-
},
|
|
1676
|
-
environment: getEnvironment(),
|
|
1677
|
-
onChange: onChangeSubscriptionManager$4.subscribe,
|
|
1678
|
-
Constants: {
|
|
1679
|
-
Orientation: Orientation,
|
|
1680
|
-
},
|
|
1681
|
-
Errors: {},
|
|
1682
|
-
};
|
|
1683
|
-
function getOrientation() {
|
|
1684
|
-
if (typeof globalThis.screen !== 'undefined') {
|
|
1685
|
-
switch (globalThis.screen.orientation.type) {
|
|
1686
|
-
case 'portrait-primary':
|
|
1687
|
-
case 'portrait-secondary':
|
|
1688
|
-
return Orientation.Portrait;
|
|
1689
|
-
case 'landscape-primary':
|
|
1690
|
-
case 'landscape-secondary':
|
|
1691
|
-
return Orientation.Landscape;
|
|
1692
|
-
}
|
|
1693
|
-
}
|
|
1694
|
-
if (typeof globalThis.orientation !== 'undefined') {
|
|
1695
|
-
switch (globalThis.orientation) {
|
|
1696
|
-
case 0:
|
|
1697
|
-
case 180:
|
|
1698
|
-
return Orientation.Portrait;
|
|
1699
|
-
case 90:
|
|
1700
|
-
case 270:
|
|
1701
|
-
return Orientation.Landscape;
|
|
1702
|
-
}
|
|
1703
|
-
}
|
|
1704
|
-
if (MEDIA_QUERY_LIST.media === 'not all')
|
|
1705
|
-
return Orientation.Unknown;
|
|
1706
|
-
else if (MEDIA_QUERY_LIST.matches)
|
|
1707
|
-
return Orientation.Portrait;
|
|
1708
|
-
else
|
|
1709
|
-
return Orientation.Landscape;
|
|
1710
|
-
}
|
|
1711
|
-
function getScale() {
|
|
1712
|
-
if (typeof globalThis.devicePixelRatio !== 'undefined')
|
|
1713
|
-
return globalThis.devicePixelRatio;
|
|
1714
|
-
return -1;
|
|
1715
|
-
}
|
|
1716
|
-
function getEnvironment() {
|
|
1717
|
-
return {
|
|
1718
|
-
safeAreaInset: {
|
|
1719
|
-
get value() {
|
|
1720
|
-
return safeAreaInsetObserver.get();
|
|
1721
|
-
},
|
|
1722
|
-
onChange: safeAreaInsetObserver.onChange,
|
|
1723
|
-
},
|
|
1724
|
-
safeAreaMaxInset: {
|
|
1725
|
-
get value() {
|
|
1726
|
-
return safeAreaMaxInsetObserver.get();
|
|
1727
|
-
},
|
|
1728
|
-
onChange: safeAreaMaxInsetObserver.onChange,
|
|
1729
|
-
},
|
|
1730
|
-
keyboardInset: {
|
|
1731
|
-
get value() {
|
|
1732
|
-
return keyboardInsetObserver.get();
|
|
1733
|
-
},
|
|
1734
|
-
onChange: keyboardInsetObserver.onChange,
|
|
1735
|
-
},
|
|
1736
|
-
titlebarArea: {
|
|
1737
|
-
get value() {
|
|
1738
|
-
return titlebarAreaObserver.get();
|
|
1739
|
-
},
|
|
1740
|
-
onChange: titlebarAreaObserver.onChange,
|
|
1741
|
-
},
|
|
1742
|
-
viewportSegment: {
|
|
1743
|
-
get value() {
|
|
1744
|
-
return viewportSegmentObserver.get();
|
|
1745
|
-
},
|
|
1746
|
-
onChange: viewportSegmentObserver.onChange,
|
|
1747
1999
|
},
|
|
2000
|
+
useCssVariable: useCssVariable
|
|
1748
2001
|
};
|
|
1749
2002
|
}
|
|
1750
|
-
function getDimension() {
|
|
1751
|
-
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
1752
|
-
return {
|
|
1753
|
-
innerWidth: globalThis.innerWidth,
|
|
1754
|
-
innerHeight: globalThis.innerHeight,
|
|
1755
|
-
outerWidth: globalThis.outerWidth,
|
|
1756
|
-
outerHeight: globalThis.outerHeight,
|
|
1757
|
-
scale: getScale(),
|
|
1758
|
-
orientation: getOrientation(),
|
|
1759
|
-
};
|
|
1760
|
-
}
|
|
1761
|
-
return FALLBACK_DIMENSION;
|
|
1762
|
-
}
|
|
1763
|
-
function attachOnChange$4() {
|
|
1764
|
-
dimensionRef = getDimension();
|
|
1765
|
-
EventListener.add(globalThis, { type: 'resize', callback: onResize });
|
|
1766
|
-
if (typeof globalThis.screen.orientation.addEventListener === 'function')
|
|
1767
|
-
EventListener.add(globalThis.screen.orientation, { type: 'change', callback: onResize });
|
|
1768
|
-
else if (typeof globalThis.orientation !== 'undefined')
|
|
1769
|
-
EventListener.add(globalThis, { type: 'orientationChange', callback: onResize });
|
|
1770
|
-
else if (MEDIA_QUERY_LIST.media !== 'not all')
|
|
1771
|
-
EventListener.add(MEDIA_QUERY_LIST, { type: 'change', callback: onResize });
|
|
1772
|
-
}
|
|
1773
|
-
function detachOnChange$4() {
|
|
1774
|
-
dimensionRef = null;
|
|
1775
|
-
EventListener.remove(globalThis, { type: 'resize', callback: onResize });
|
|
1776
|
-
if (typeof globalThis.screen.orientation.removeEventListener === 'function')
|
|
1777
|
-
EventListener.remove(globalThis.screen.orientation, { type: 'change', callback: onResize });
|
|
1778
|
-
else if (typeof globalThis.orientation !== 'undefined')
|
|
1779
|
-
EventListener.remove(globalThis, { type: 'orientationChange', callback: onResize });
|
|
1780
|
-
else if (MEDIA_QUERY_LIST.media !== 'not all')
|
|
1781
|
-
EventListener.remove(MEDIA_QUERY_LIST, { type: 'change', callback: onResize });
|
|
1782
|
-
}
|
|
1783
|
-
function onResize() {
|
|
1784
|
-
var dimension = getDimension();
|
|
1785
|
-
if (dimensionRef === null || dimension.innerWidth !== dimensionRef.innerWidth || dimension.innerHeight !== dimensionRef.innerHeight || dimension.outerWidth !== dimensionRef.outerWidth || dimension.outerHeight !== dimensionRef.outerHeight || dimension.scale !== dimensionRef.scale || dimension.orientation !== dimensionRef.orientation)
|
|
1786
|
-
onChangeSubscriptionManager$4.emit(dimensionRef = dimension);
|
|
1787
|
-
}
|
|
1788
2003
|
|
|
1789
2004
|
function createCustomError(name, Base) {
|
|
1790
2005
|
if (Base === void 0) { Base = Error; }
|
|
@@ -1868,8 +2083,248 @@ function createCustomError(name, Base) {
|
|
|
1868
2083
|
return CustomError;
|
|
1869
2084
|
}
|
|
1870
2085
|
|
|
2086
|
+
var PermissionNotGrantedError = createCustomError('PermissionNotGrantedError');
|
|
2087
|
+
|
|
1871
2088
|
var NotSupportedError = createCustomError('NotSupportedError');
|
|
1872
2089
|
|
|
2090
|
+
var safeAreaInsetObserver = createEnvironmentObserver('safe-area-inset');
|
|
2091
|
+
var safeAreaMaxInsetObserver = createEnvironmentObserver('safe-area-max-inset');
|
|
2092
|
+
var keyboardInsetObserver = createEnvironmentObserver('keyboard-inset');
|
|
2093
|
+
var titlebarAreaObserver = createEnvironmentObserver('titlebar-area');
|
|
2094
|
+
var viewportSegmentObserver = createEnvironmentObserver('viewport-segment');
|
|
2095
|
+
var onDimensionChangeSubscriptionManager = createSubscriptionManager(attachOnDimensionChange, detachOnDimensionChange);
|
|
2096
|
+
var onScreenOrientationChangeSubscriptionManager = createSubscriptionManager(attachOnScreenOrientationChange, detachOnScreenOrientationChange);
|
|
2097
|
+
var onDeviceOrientationChangeSubscriptionManager = createSubscriptionManager(attachOnDeviceOrientationChange, detachOnDeviceOrientationChange);
|
|
2098
|
+
var dimensionRef = null;
|
|
2099
|
+
var screenOrientationRef = null;
|
|
2100
|
+
var deviceOrientationRef = null;
|
|
2101
|
+
var Dimension = {
|
|
2102
|
+
get value() {
|
|
2103
|
+
return getDimension();
|
|
2104
|
+
},
|
|
2105
|
+
environment: getEnvironment(),
|
|
2106
|
+
screenOrientation: getScreenOrientation(),
|
|
2107
|
+
deviceOrientation: getDeviceOrientation(),
|
|
2108
|
+
onChange: onDimensionChangeSubscriptionManager.subscribe,
|
|
2109
|
+
Constants: {
|
|
2110
|
+
Orientation: Orientation,
|
|
2111
|
+
},
|
|
2112
|
+
Errors: {
|
|
2113
|
+
NotSupportedError: NotSupportedError,
|
|
2114
|
+
PermissionNotGrantedError: PermissionNotGrantedError,
|
|
2115
|
+
},
|
|
2116
|
+
};
|
|
2117
|
+
function getOrientation() {
|
|
2118
|
+
if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.type !== 'undefined') {
|
|
2119
|
+
switch (globalThis.screen.orientation.type) {
|
|
2120
|
+
case 'portrait-primary':
|
|
2121
|
+
return Orientation.PortraitPrimary;
|
|
2122
|
+
case 'portrait-secondary':
|
|
2123
|
+
return Orientation.PortraitSecondary;
|
|
2124
|
+
case 'landscape-primary':
|
|
2125
|
+
return Orientation.LandscapePrimary;
|
|
2126
|
+
case 'landscape-secondary':
|
|
2127
|
+
return Orientation.LandscapeSecondary;
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
if (typeof globalThis.orientation !== 'undefined') {
|
|
2131
|
+
switch (globalThis.orientation) {
|
|
2132
|
+
case 0:
|
|
2133
|
+
return Orientation.PortraitPrimary;
|
|
2134
|
+
case 180:
|
|
2135
|
+
return Orientation.PortraitSecondary;
|
|
2136
|
+
case 90:
|
|
2137
|
+
return Orientation.LandscapePrimary;
|
|
2138
|
+
case -90:
|
|
2139
|
+
case 270:
|
|
2140
|
+
return Orientation.LandscapeSecondary;
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
if (ORIENTATION_MEDIA_QUERY_LIST.media === 'not all')
|
|
2144
|
+
throw new NotSupportedError('\'screen.orientation\', \'window.orientation\', and the orientation media query are all unsupported');
|
|
2145
|
+
if (ORIENTATION_MEDIA_QUERY_LIST.matches)
|
|
2146
|
+
return Orientation.PortraitPrimary;
|
|
2147
|
+
else
|
|
2148
|
+
return Orientation.LandscapePrimary;
|
|
2149
|
+
}
|
|
2150
|
+
function getScale() {
|
|
2151
|
+
if (typeof globalThis.devicePixelRatio !== 'undefined')
|
|
2152
|
+
return globalThis.devicePixelRatio;
|
|
2153
|
+
return -1;
|
|
2154
|
+
}
|
|
2155
|
+
function getEnvironment() {
|
|
2156
|
+
return {
|
|
2157
|
+
safeAreaInset: safeAreaInsetObserver,
|
|
2158
|
+
safeAreaMaxInset: safeAreaMaxInsetObserver,
|
|
2159
|
+
keyboardInset: keyboardInsetObserver,
|
|
2160
|
+
titlebarArea: titlebarAreaObserver,
|
|
2161
|
+
viewportSegment: viewportSegmentObserver,
|
|
2162
|
+
};
|
|
2163
|
+
}
|
|
2164
|
+
function getScreenOrientation() {
|
|
2165
|
+
return {
|
|
2166
|
+
get supported() {
|
|
2167
|
+
return screenOrientationSupported();
|
|
2168
|
+
},
|
|
2169
|
+
get value() {
|
|
2170
|
+
return getOrientation();
|
|
2171
|
+
},
|
|
2172
|
+
onChange: onScreenOrientationChangeSubscriptionManager.subscribe,
|
|
2173
|
+
};
|
|
2174
|
+
}
|
|
2175
|
+
function getDeviceOrientation() {
|
|
2176
|
+
return {
|
|
2177
|
+
get supported() {
|
|
2178
|
+
return deviceOrientationSupported();
|
|
2179
|
+
},
|
|
2180
|
+
get value() {
|
|
2181
|
+
return getDeviceOrientationValue();
|
|
2182
|
+
},
|
|
2183
|
+
onChange: onDeviceOrientationChangeSubscriptionManager.subscribe,
|
|
2184
|
+
};
|
|
2185
|
+
}
|
|
2186
|
+
function getDimension() {
|
|
2187
|
+
var innerWidth = 0;
|
|
2188
|
+
var innerHeight = 0;
|
|
2189
|
+
var outerWidth = 0;
|
|
2190
|
+
var outerHeight = 0;
|
|
2191
|
+
var scale = getScale();
|
|
2192
|
+
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
2193
|
+
innerWidth = globalThis.innerWidth;
|
|
2194
|
+
innerHeight = globalThis.innerHeight;
|
|
2195
|
+
outerWidth = globalThis.outerWidth;
|
|
2196
|
+
outerHeight = globalThis.outerHeight;
|
|
2197
|
+
}
|
|
2198
|
+
return {
|
|
2199
|
+
innerWidth: innerWidth,
|
|
2200
|
+
innerHeight: innerHeight,
|
|
2201
|
+
outerWidth: outerWidth,
|
|
2202
|
+
outerHeight: outerHeight,
|
|
2203
|
+
scale: scale,
|
|
2204
|
+
};
|
|
2205
|
+
}
|
|
2206
|
+
function attachOnDimensionChange() {
|
|
2207
|
+
dimensionRef = getDimension();
|
|
2208
|
+
EventListener.add(globalThis, { type: 'resize', callback: onDimensionChange });
|
|
2209
|
+
}
|
|
2210
|
+
function detachOnDimensionChange() {
|
|
2211
|
+
dimensionRef = null;
|
|
2212
|
+
EventListener.remove(globalThis, { type: 'resize', callback: onDimensionChange });
|
|
2213
|
+
}
|
|
2214
|
+
function onDimensionChange() {
|
|
2215
|
+
var dimension = getDimension();
|
|
2216
|
+
if (dimensionRef === null || dimension.innerWidth !== dimensionRef.innerWidth || dimension.innerHeight !== dimensionRef.innerHeight || dimension.outerWidth !== dimensionRef.outerWidth || dimension.outerHeight !== dimensionRef.outerHeight || dimension.scale !== dimensionRef.scale)
|
|
2217
|
+
onDimensionChangeSubscriptionManager.emit(dimensionRef = dimension);
|
|
2218
|
+
}
|
|
2219
|
+
function screenOrientationSupported() {
|
|
2220
|
+
if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.type !== 'undefined')
|
|
2221
|
+
return true;
|
|
2222
|
+
if (typeof globalThis.orientation !== 'undefined')
|
|
2223
|
+
return true;
|
|
2224
|
+
return ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all';
|
|
2225
|
+
}
|
|
2226
|
+
function attachOnScreenOrientationChange() {
|
|
2227
|
+
if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.addEventListener === 'function')
|
|
2228
|
+
EventListener.add(globalThis.screen.orientation, {
|
|
2229
|
+
type: 'change',
|
|
2230
|
+
callback: onScreenOrientationChange
|
|
2231
|
+
});
|
|
2232
|
+
else if (typeof globalThis.orientation !== 'undefined')
|
|
2233
|
+
EventListener.add(globalThis, { type: 'orientationchange', callback: onScreenOrientationChange });
|
|
2234
|
+
else if (ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all')
|
|
2235
|
+
EventListener.add(ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback: onScreenOrientationChange });
|
|
2236
|
+
throw new NotSupportedError('\'screen.orientation\', \'window.orientation\', and the orientation media query are all unsupported');
|
|
2237
|
+
}
|
|
2238
|
+
function detachOnScreenOrientationChange() {
|
|
2239
|
+
if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.removeEventListener === 'function')
|
|
2240
|
+
EventListener.remove(globalThis.screen.orientation, {
|
|
2241
|
+
type: 'change',
|
|
2242
|
+
callback: onScreenOrientationChange
|
|
2243
|
+
});
|
|
2244
|
+
else if (typeof globalThis.orientation !== 'undefined')
|
|
2245
|
+
EventListener.remove(globalThis, { type: 'orientationchange', callback: onScreenOrientationChange });
|
|
2246
|
+
else if (ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all')
|
|
2247
|
+
EventListener.remove(ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback: onScreenOrientationChange });
|
|
2248
|
+
throw new NotSupportedError('\'screen.orientation\', \'window.orientation\', and the orientation media query are all unsupported');
|
|
2249
|
+
}
|
|
2250
|
+
function onScreenOrientationChange() {
|
|
2251
|
+
var orientation = getOrientation();
|
|
2252
|
+
if (screenOrientationRef === null || orientation !== screenOrientationRef)
|
|
2253
|
+
onScreenOrientationChangeSubscriptionManager.emit(screenOrientationRef = orientation);
|
|
2254
|
+
}
|
|
2255
|
+
function deviceOrientationSupported() {
|
|
2256
|
+
return typeof globalThis.DeviceOrientationEvent !== 'undefined';
|
|
2257
|
+
}
|
|
2258
|
+
function attachOnDeviceOrientationChange() {
|
|
2259
|
+
return new Promise(function (resolve, reject) {
|
|
2260
|
+
if (!deviceOrientationSupported())
|
|
2261
|
+
return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
|
|
2262
|
+
var DeviceOrientationEventWithPermission = DeviceOrientationEvent;
|
|
2263
|
+
if (typeof DeviceOrientationEventWithPermission.requestPermission === 'function') {
|
|
2264
|
+
DeviceOrientationEventWithPermission.requestPermission().then(function (permission) {
|
|
2265
|
+
if (permission === 'granted') {
|
|
2266
|
+
EventListener.add(globalThis, { type: 'deviceorientation', callback: onDeviceOrientationChange });
|
|
2267
|
+
return resolve();
|
|
2268
|
+
}
|
|
2269
|
+
return reject(new PermissionNotGrantedError('\'deviceorientation\' permission is not granted.'));
|
|
2270
|
+
}).catch(function (_) {
|
|
2271
|
+
return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
|
|
2272
|
+
});
|
|
2273
|
+
}
|
|
2274
|
+
else {
|
|
2275
|
+
EventListener.add(globalThis, { type: 'deviceorientation', callback: onDeviceOrientationChange });
|
|
2276
|
+
return resolve();
|
|
2277
|
+
}
|
|
2278
|
+
});
|
|
2279
|
+
}
|
|
2280
|
+
function detachOnDeviceOrientationChange() {
|
|
2281
|
+
EventListener.remove(globalThis, { type: 'deviceorientation', callback: onDeviceOrientationChange });
|
|
2282
|
+
}
|
|
2283
|
+
function onDeviceOrientationChange(event) {
|
|
2284
|
+
deviceOrientationRef = {
|
|
2285
|
+
alpha: event.alpha,
|
|
2286
|
+
beta: event.beta,
|
|
2287
|
+
gamma: event.gamma,
|
|
2288
|
+
absolute: event.absolute,
|
|
2289
|
+
};
|
|
2290
|
+
onDeviceOrientationChangeSubscriptionManager.emit(deviceOrientationRef);
|
|
2291
|
+
}
|
|
2292
|
+
function getDeviceOrientationValue() {
|
|
2293
|
+
return new Promise(function (resolve, reject) {
|
|
2294
|
+
if (deviceOrientationRef !== null)
|
|
2295
|
+
return resolve(deviceOrientationRef);
|
|
2296
|
+
if (!deviceOrientationSupported())
|
|
2297
|
+
return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
|
|
2298
|
+
var DeviceOrientationEventWithPermission = DeviceOrientationEvent;
|
|
2299
|
+
var callback = function (event) {
|
|
2300
|
+
var value = {
|
|
2301
|
+
alpha: event.alpha,
|
|
2302
|
+
beta: event.beta,
|
|
2303
|
+
gamma: event.gamma,
|
|
2304
|
+
absolute: event.absolute,
|
|
2305
|
+
};
|
|
2306
|
+
deviceOrientationRef = value;
|
|
2307
|
+
EventListener.remove(globalThis, { type: 'deviceorientation', callback: callback });
|
|
2308
|
+
return resolve(value);
|
|
2309
|
+
};
|
|
2310
|
+
if (typeof DeviceOrientationEventWithPermission.requestPermission === 'function') {
|
|
2311
|
+
DeviceOrientationEventWithPermission.requestPermission().then(function (permission) {
|
|
2312
|
+
if (permission === 'granted') {
|
|
2313
|
+
EventListener.add(globalThis, { type: 'deviceorientation', callback: callback });
|
|
2314
|
+
return;
|
|
2315
|
+
}
|
|
2316
|
+
return reject(new PermissionNotGrantedError('\'deviceorientation\' permission is not granted.'));
|
|
2317
|
+
}).catch(function (_) {
|
|
2318
|
+
return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
|
|
2319
|
+
});
|
|
2320
|
+
}
|
|
2321
|
+
else {
|
|
2322
|
+
EventListener.add(globalThis, { type: 'deviceorientation', callback: callback });
|
|
2323
|
+
return;
|
|
2324
|
+
}
|
|
2325
|
+
});
|
|
2326
|
+
}
|
|
2327
|
+
|
|
1873
2328
|
var InvalidStateError = createCustomError('InvalidStateError');
|
|
1874
2329
|
|
|
1875
2330
|
var videoElement$1 = null;
|
|
@@ -2274,6 +2729,8 @@ var PermissionType;
|
|
|
2274
2729
|
PermissionType["ClipboardRead"] = "clipboard-read";
|
|
2275
2730
|
PermissionType["Microphone"] = "microphone";
|
|
2276
2731
|
PermissionType["MIDI"] = "midi";
|
|
2732
|
+
PermissionType["DeviceOrientation"] = "device-orientation";
|
|
2733
|
+
PermissionType["DeviceMotion"] = "device-motion";
|
|
2277
2734
|
})(PermissionType || (PermissionType = {}));
|
|
2278
2735
|
var PermissionState;
|
|
2279
2736
|
(function (PermissionState) {
|
|
@@ -2315,14 +2772,45 @@ var Permission = {
|
|
|
2315
2772
|
PermissionType: PermissionType,
|
|
2316
2773
|
PermissionState: PermissionState,
|
|
2317
2774
|
},
|
|
2318
|
-
Errors: {
|
|
2775
|
+
Errors: {
|
|
2776
|
+
NotSupportedError: NotSupportedError,
|
|
2777
|
+
},
|
|
2319
2778
|
};
|
|
2779
|
+
function toPermissionState(permission) {
|
|
2780
|
+
switch (permission) {
|
|
2781
|
+
case 'granted':
|
|
2782
|
+
return PermissionState.Grant;
|
|
2783
|
+
case 'denied':
|
|
2784
|
+
return PermissionState.Denied;
|
|
2785
|
+
case 'prompt':
|
|
2786
|
+
case 'default':
|
|
2787
|
+
return PermissionState.Prompt;
|
|
2788
|
+
default:
|
|
2789
|
+
return PermissionState.Unsupported;
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
function toSafariSensorEventMap(type) {
|
|
2793
|
+
switch (type) {
|
|
2794
|
+
case PermissionType.DeviceOrientation:
|
|
2795
|
+
return {
|
|
2796
|
+
event: globalThis.DeviceOrientationEvent,
|
|
2797
|
+
type: 'deviceorientation',
|
|
2798
|
+
};
|
|
2799
|
+
case PermissionType.DeviceMotion:
|
|
2800
|
+
return {
|
|
2801
|
+
event: globalThis.DeviceMotionEvent,
|
|
2802
|
+
type: 'devicemotion',
|
|
2803
|
+
};
|
|
2804
|
+
default:
|
|
2805
|
+
return undefined;
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2320
2808
|
function supported$5() {
|
|
2321
2809
|
return typeof globalThis.navigator.permissions !== 'undefined';
|
|
2322
2810
|
}
|
|
2323
2811
|
function request$2(type) {
|
|
2324
2812
|
var instance = this;
|
|
2325
|
-
return new Promise(function (resolve) {
|
|
2813
|
+
return new Promise(function (resolve, reject) {
|
|
2326
2814
|
function resolveAfterCheck() {
|
|
2327
2815
|
instance.check(type).then(resolve);
|
|
2328
2816
|
}
|
|
@@ -2334,17 +2822,8 @@ function request$2(type) {
|
|
|
2334
2822
|
case PermissionType.Notification:
|
|
2335
2823
|
if (typeof globalThis.Notification === 'undefined')
|
|
2336
2824
|
return resolve(PermissionState.Unsupported);
|
|
2337
|
-
globalThis.Notification.requestPermission().then(function (
|
|
2338
|
-
|
|
2339
|
-
case 'default':
|
|
2340
|
-
return resolve(PermissionState.Prompt);
|
|
2341
|
-
case 'granted':
|
|
2342
|
-
return resolve(PermissionState.Grant);
|
|
2343
|
-
case 'denied':
|
|
2344
|
-
return resolve(PermissionState.Denied);
|
|
2345
|
-
default:
|
|
2346
|
-
resolveAfterCheck();
|
|
2347
|
-
}
|
|
2825
|
+
globalThis.Notification.requestPermission().then(function (permission) {
|
|
2826
|
+
resolve(toPermissionState(permission));
|
|
2348
2827
|
});
|
|
2349
2828
|
break;
|
|
2350
2829
|
case PermissionType.Geolocation:
|
|
@@ -2382,6 +2861,23 @@ function request$2(type) {
|
|
|
2382
2861
|
.then(resolveAfterCheck)
|
|
2383
2862
|
.catch(resolveAfterCheck);
|
|
2384
2863
|
break;
|
|
2864
|
+
case PermissionType.DeviceOrientation:
|
|
2865
|
+
case PermissionType.DeviceMotion:
|
|
2866
|
+
var sensorEventMap = toSafariSensorEventMap(type);
|
|
2867
|
+
if (typeof sensorEventMap === 'undefined' || typeof sensorEventMap.event === 'undefined')
|
|
2868
|
+
return resolve(PermissionState.Unsupported);
|
|
2869
|
+
if (typeof sensorEventMap.event.requestPermission !== 'function')
|
|
2870
|
+
return resolve(PermissionState.Grant);
|
|
2871
|
+
try {
|
|
2872
|
+
sensorEventMap.event.requestPermission()
|
|
2873
|
+
.then(function (permission) {
|
|
2874
|
+
resolve(toPermissionState(permission));
|
|
2875
|
+
});
|
|
2876
|
+
}
|
|
2877
|
+
catch (_) {
|
|
2878
|
+
return reject(new NotSupportedError('\'DeviceOrientationEvent.requestPermission()\' must be called within a user gesture context.'));
|
|
2879
|
+
}
|
|
2880
|
+
break;
|
|
2385
2881
|
default:
|
|
2386
2882
|
return resolve(PermissionState.Unsupported);
|
|
2387
2883
|
}
|
|
@@ -2389,6 +2885,34 @@ function request$2(type) {
|
|
|
2389
2885
|
});
|
|
2390
2886
|
}
|
|
2391
2887
|
function check(type) {
|
|
2888
|
+
if (type === PermissionType.DeviceOrientation || type === PermissionType.DeviceMotion) {
|
|
2889
|
+
return new Promise(function (resolve) {
|
|
2890
|
+
var sensorEventMap = toSafariSensorEventMap(type);
|
|
2891
|
+
if (typeof sensorEventMap === 'undefined' || typeof sensorEventMap.event === 'undefined')
|
|
2892
|
+
return resolve(PermissionState.Unsupported);
|
|
2893
|
+
if (typeof sensorEventMap.event.requestPermission !== 'function')
|
|
2894
|
+
return resolve(PermissionState.Grant);
|
|
2895
|
+
var granted = false;
|
|
2896
|
+
EventListener.add(globalThis, {
|
|
2897
|
+
type: sensorEventMap.type,
|
|
2898
|
+
callback: function () {
|
|
2899
|
+
granted = true;
|
|
2900
|
+
},
|
|
2901
|
+
options: { once: true }
|
|
2902
|
+
});
|
|
2903
|
+
setTimeout(function () {
|
|
2904
|
+
if (granted)
|
|
2905
|
+
return resolve(PermissionState.Grant);
|
|
2906
|
+
sensorEventMap.event.requestPermission()
|
|
2907
|
+
.then(function (permission) {
|
|
2908
|
+
resolve(toPermissionState(permission));
|
|
2909
|
+
})
|
|
2910
|
+
.catch(function () {
|
|
2911
|
+
resolve(PermissionState.Prompt);
|
|
2912
|
+
});
|
|
2913
|
+
}, 50);
|
|
2914
|
+
});
|
|
2915
|
+
}
|
|
2392
2916
|
return new Promise(function (resolve) {
|
|
2393
2917
|
if (typeof globalThis.navigator.permissions === 'undefined')
|
|
2394
2918
|
return resolve(PermissionState.Unsupported);
|
|
@@ -2408,8 +2932,6 @@ function check(type) {
|
|
|
2408
2932
|
});
|
|
2409
2933
|
}
|
|
2410
2934
|
|
|
2411
|
-
var PermissionNotGrantedError = createCustomError('PermissionNotGrantedError');
|
|
2412
|
-
|
|
2413
2935
|
function request$1(url, options) {
|
|
2414
2936
|
return new Promise(function (resolve) {
|
|
2415
2937
|
var method = 'GET';
|
|
@@ -2712,7 +3234,7 @@ function getTopmostWindow() {
|
|
|
2712
3234
|
}
|
|
2713
3235
|
|
|
2714
3236
|
function dispatchClickEvent(element, view) {
|
|
2715
|
-
if (view === void 0) { view =
|
|
3237
|
+
if (view === void 0) { view = globalThis; }
|
|
2716
3238
|
var fake;
|
|
2717
3239
|
try {
|
|
2718
3240
|
fake = new MouseEvent('click', {
|