native-fn 1.3.0 → 1.3.2
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 +159 -41
- package/dist/index.d.ts +117 -88
- package/dist/native.cjs +464 -244
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +464 -244
- package/dist/native.umd.js +464 -244
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/appearance/index.cjs +49 -46
- package/dist/plugin/appearance/index.d.ts +3 -3
- package/dist/plugin/appearance/index.mjs +49 -46
- 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 +8 -3
- package/dist/plugin/appearance/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/badge/index.d.ts +3 -3
- 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 +8 -3
- package/dist/plugin/badge/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/battery/index.d.ts +3 -3
- 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 +8 -3
- package/dist/plugin/battery/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/clipboard/index.d.ts +2 -2
- 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 +8 -3
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/dimension/index.cjs +310 -80
- package/dist/plugin/dimension/index.d.ts +48 -19
- package/dist/plugin/dimension/index.mjs +310 -80
- 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 +8 -3
- package/dist/plugin/dimension/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/fullscreen/index.cjs +87 -80
- package/dist/plugin/fullscreen/index.d.ts +7 -7
- package/dist/plugin/fullscreen/index.mjs +87 -80
- 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 +8 -3
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/geolocation/index.cjs +245 -176
- package/dist/plugin/geolocation/index.d.ts +4 -4
- package/dist/plugin/geolocation/index.mjs +245 -176
- 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 +8 -3
- package/dist/plugin/geolocation/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/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/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 +8 -3
- package/dist/plugin/notification/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/open/index.cjs +58 -49
- package/dist/plugin/open/index.d.ts +12 -12
- package/dist/plugin/open/index.mjs +58 -49
- 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 +8 -3
- package/dist/plugin/open/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/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/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 +8 -3
- package/dist/plugin/permission/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/pip/index.cjs +49 -46
- package/dist/plugin/pip/index.d.ts +7 -7
- package/dist/plugin/pip/index.mjs +49 -46
- 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 +8 -3
- package/dist/plugin/pip/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/platform/index.cjs +87 -80
- package/dist/plugin/platform/index.d.ts +13 -13
- package/dist/plugin/platform/index.mjs +87 -80
- 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 +8 -3
- package/dist/plugin/platform/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/theme/index.cjs +58 -49
- package/dist/plugin/theme/index.d.ts +2 -2
- package/dist/plugin/theme/index.mjs +58 -49
- 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 +8 -3
- package/dist/plugin/theme/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/vibration/index.d.ts +3 -3
- 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 +8 -3
- package/dist/plugin/vibration/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/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 +8 -3
- package/dist/src/plugin/dimension/types/dimensions.d.ts +37 -15
- 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/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/package.json +1 -1
package/dist/native.umd.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Native = factory());
|
|
5
5
|
})(this, (function () { 'use strict';
|
|
6
6
|
|
|
7
|
-
var version = "1.3.
|
|
7
|
+
var version = "1.3.2";
|
|
8
8
|
var packageJSON = {
|
|
9
9
|
version: version};
|
|
10
10
|
|
|
@@ -409,9 +409,12 @@
|
|
|
409
409
|
|
|
410
410
|
var currentUserAgent = USER_AGENT;
|
|
411
411
|
var parsedCache = null;
|
|
412
|
-
var
|
|
413
|
-
var
|
|
414
|
-
var
|
|
412
|
+
var parsedFromHighEntropyValuesOSName = undefined;
|
|
413
|
+
var parsedFromHighEntropyValuesOSVersion = undefined;
|
|
414
|
+
var parsedFromHighEntropyValuesBrowserName = undefined;
|
|
415
|
+
var parsedFromHighEntropyValuesBrowserVersion = undefined;
|
|
416
|
+
var parsedFromHighEntropyValuesEngineName = undefined;
|
|
417
|
+
var parsedFromHighEntropyValuesEngineVersion = undefined;
|
|
415
418
|
var parsedFromHighEntropyValuesDevice = null;
|
|
416
419
|
var parsedFromNavigatorGPU = {};
|
|
417
420
|
var cachedLocale = null;
|
|
@@ -458,9 +461,12 @@
|
|
|
458
461
|
function invalidateCache() {
|
|
459
462
|
parsedCache = null;
|
|
460
463
|
cachedLocale = null;
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
+
parsedFromHighEntropyValuesOSName = undefined;
|
|
465
|
+
parsedFromHighEntropyValuesOSVersion = undefined;
|
|
466
|
+
parsedFromHighEntropyValuesBrowserName = undefined;
|
|
467
|
+
parsedFromHighEntropyValuesBrowserVersion = undefined;
|
|
468
|
+
parsedFromHighEntropyValuesEngineName = undefined;
|
|
469
|
+
parsedFromHighEntropyValuesEngineVersion = undefined;
|
|
464
470
|
parsedFromHighEntropyValuesDevice = null;
|
|
465
471
|
parsedFromNavigatorGPU = {};
|
|
466
472
|
}
|
|
@@ -476,71 +482,74 @@
|
|
|
476
482
|
return parsedCache;
|
|
477
483
|
}
|
|
478
484
|
function parseOS() {
|
|
479
|
-
var
|
|
485
|
+
var name = OS.Unknown;
|
|
486
|
+
var version = '';
|
|
480
487
|
for (var i = 0; i < OS_RESOLVER_MAP.length; i++) {
|
|
481
488
|
var map = OS_RESOLVER_MAP[i];
|
|
482
489
|
var matched = currentUserAgent.match(map[0]);
|
|
483
490
|
if (matched !== null) {
|
|
484
|
-
|
|
485
|
-
|
|
491
|
+
name = map[1];
|
|
492
|
+
version = resolveVersion(matched[1], map[2]);
|
|
486
493
|
break;
|
|
487
494
|
}
|
|
488
495
|
}
|
|
489
|
-
if (
|
|
490
|
-
var
|
|
491
|
-
if (
|
|
492
|
-
var major = parseInt(
|
|
496
|
+
if (name === OS.iOS && compareVersion(version, '18.6') === 0) {
|
|
497
|
+
var execs = /\) Version\/([\d.]+)/.exec(currentUserAgent);
|
|
498
|
+
if (execs !== null) {
|
|
499
|
+
var major = parseInt(execs[1].split('.')[0], 10);
|
|
493
500
|
if (major >= 26)
|
|
494
|
-
|
|
501
|
+
version = execs[1];
|
|
495
502
|
}
|
|
496
503
|
}
|
|
497
504
|
if (currentUserAgent === USER_AGENT) {
|
|
498
|
-
if (typeof
|
|
499
|
-
|
|
500
|
-
if (typeof
|
|
501
|
-
|
|
502
|
-
if (
|
|
503
|
-
|
|
505
|
+
if (typeof parsedFromHighEntropyValuesOSName !== 'undefined')
|
|
506
|
+
name = parsedFromHighEntropyValuesOSName;
|
|
507
|
+
if (typeof parsedFromHighEntropyValuesOSVersion !== 'undefined')
|
|
508
|
+
version = parsedFromHighEntropyValuesOSVersion;
|
|
509
|
+
if (name === OS.MacOS && typeof globalThis.navigator.standalone !== 'undefined' && globalThis.navigator.maxTouchPoints > 2)
|
|
510
|
+
name = OS.iOS;
|
|
504
511
|
}
|
|
505
|
-
return
|
|
512
|
+
return { name: name, version: version };
|
|
506
513
|
}
|
|
507
514
|
function parseBrowser() {
|
|
508
|
-
var
|
|
515
|
+
var name = Browsers.Unknown;
|
|
516
|
+
var version = '';
|
|
509
517
|
for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
|
|
510
518
|
var map = BROWSER_RESOLVER_MAP[i];
|
|
511
519
|
var matched = currentUserAgent.match(map[0]);
|
|
512
520
|
if (matched !== null) {
|
|
513
|
-
|
|
514
|
-
|
|
521
|
+
name = map[1];
|
|
522
|
+
version = resolveVersion(matched[1], map[2]);
|
|
515
523
|
break;
|
|
516
524
|
}
|
|
517
525
|
}
|
|
518
526
|
if (currentUserAgent === USER_AGENT) {
|
|
519
|
-
if (typeof
|
|
520
|
-
|
|
521
|
-
if (typeof
|
|
522
|
-
|
|
527
|
+
if (typeof parsedFromHighEntropyValuesBrowserName !== 'undefined')
|
|
528
|
+
name = parsedFromHighEntropyValuesBrowserName;
|
|
529
|
+
if (typeof parsedFromHighEntropyValuesBrowserVersion !== 'undefined')
|
|
530
|
+
version = parsedFromHighEntropyValuesBrowserVersion;
|
|
523
531
|
}
|
|
524
|
-
return
|
|
532
|
+
return { name: name, version: version };
|
|
525
533
|
}
|
|
526
534
|
function parseEngine() {
|
|
527
|
-
var
|
|
535
|
+
var name = Engines.Unknown;
|
|
536
|
+
var version = '';
|
|
528
537
|
for (var i = 0; i < ENGINE_RESOLVER_MAP.length; i++) {
|
|
529
538
|
var map = ENGINE_RESOLVER_MAP[i];
|
|
530
539
|
var matched = currentUserAgent.match(map[0]);
|
|
531
540
|
if (matched !== null) {
|
|
532
|
-
|
|
533
|
-
|
|
541
|
+
name = map[1];
|
|
542
|
+
version = resolveVersion(matched[1], map[2]);
|
|
534
543
|
break;
|
|
535
544
|
}
|
|
536
545
|
}
|
|
537
546
|
if (currentUserAgent === USER_AGENT) {
|
|
538
|
-
if (typeof
|
|
539
|
-
|
|
540
|
-
if (typeof
|
|
541
|
-
|
|
547
|
+
if (typeof parsedFromHighEntropyValuesEngineName !== 'undefined')
|
|
548
|
+
name = parsedFromHighEntropyValuesEngineName;
|
|
549
|
+
if (typeof parsedFromHighEntropyValuesEngineVersion !== 'undefined')
|
|
550
|
+
version = parsedFromHighEntropyValuesEngineVersion;
|
|
542
551
|
}
|
|
543
|
-
return
|
|
552
|
+
return { name: name, version: version };
|
|
544
553
|
}
|
|
545
554
|
function getGPU() {
|
|
546
555
|
return {
|
|
@@ -553,24 +562,22 @@
|
|
|
553
562
|
function getLocale() {
|
|
554
563
|
if (cachedLocale !== null)
|
|
555
564
|
return cachedLocale;
|
|
556
|
-
var
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
locale.language = language;
|
|
573
|
-
locale.languages.push(language);
|
|
565
|
+
var language = null;
|
|
566
|
+
var languages = [];
|
|
567
|
+
var timezone = null;
|
|
568
|
+
var offset = 0;
|
|
569
|
+
var isRTL = false;
|
|
570
|
+
var isRTLResolved = null;
|
|
571
|
+
function addLanguages(langs) {
|
|
572
|
+
for (var i = 0; i < langs.length; i++)
|
|
573
|
+
addLanguage(langs[i]);
|
|
574
|
+
}
|
|
575
|
+
function addLanguage(lang) {
|
|
576
|
+
lang = normalizeLocale(lang);
|
|
577
|
+
if (typeof lang === 'string' && languages.indexOf(lang) === -1) {
|
|
578
|
+
if (language === null)
|
|
579
|
+
language = lang;
|
|
580
|
+
languages.push(lang);
|
|
574
581
|
}
|
|
575
582
|
}
|
|
576
583
|
if (typeof Intl !== 'undefined') {
|
|
@@ -580,7 +587,7 @@
|
|
|
580
587
|
catch (_) {
|
|
581
588
|
}
|
|
582
589
|
try {
|
|
583
|
-
|
|
590
|
+
timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
584
591
|
}
|
|
585
592
|
catch (_) {
|
|
586
593
|
}
|
|
@@ -598,38 +605,38 @@
|
|
|
598
605
|
addLanguage(globalThis.navigator.systemLanguage);
|
|
599
606
|
}
|
|
600
607
|
try {
|
|
601
|
-
|
|
608
|
+
offset = new Date().getTimezoneOffset() * -1;
|
|
602
609
|
}
|
|
603
610
|
catch (_) {
|
|
604
611
|
}
|
|
605
|
-
if (typeof
|
|
612
|
+
if (typeof language === 'string') {
|
|
606
613
|
if (typeof Intl !== 'undefined' && typeof Intl.Locale !== 'undefined') {
|
|
607
614
|
try {
|
|
608
|
-
var intlLocale = new Intl.Locale(
|
|
615
|
+
var intlLocale = new Intl.Locale(language);
|
|
609
616
|
if (typeof intlLocale.getTextInfo === 'function')
|
|
610
|
-
|
|
617
|
+
isRTLResolved = intlLocale.getTextInfo().direction === 'rtl';
|
|
611
618
|
else if (typeof intlLocale.textInfo !== 'undefined')
|
|
612
|
-
|
|
619
|
+
isRTLResolved = intlLocale.textInfo.direction === 'rtl';
|
|
613
620
|
}
|
|
614
621
|
catch (_) {
|
|
615
622
|
}
|
|
616
623
|
}
|
|
617
|
-
if (typeof
|
|
618
|
-
var matched = /^([A-Za-z]{1,8})(?:[-_][A-Za-z0-9]{1,8})*$/.exec(
|
|
624
|
+
if (typeof isRTLResolved !== 'boolean') {
|
|
625
|
+
var matched = /^([A-Za-z]{1,8})(?:[-_][A-Za-z0-9]{1,8})*$/.exec(language);
|
|
619
626
|
if (matched !== null) {
|
|
620
|
-
var
|
|
627
|
+
var lang = matched[1].toLowerCase();
|
|
621
628
|
for (var i = 0; i < RTL_LANGUAGES.length; i++) {
|
|
622
|
-
if (RTL_LANGUAGES[i] ===
|
|
623
|
-
|
|
629
|
+
if (RTL_LANGUAGES[i] === lang) {
|
|
630
|
+
isRTLResolved = true;
|
|
624
631
|
break;
|
|
625
632
|
}
|
|
626
633
|
}
|
|
627
634
|
}
|
|
628
635
|
}
|
|
629
636
|
}
|
|
630
|
-
if (typeof
|
|
631
|
-
|
|
632
|
-
cachedLocale =
|
|
637
|
+
if (typeof isRTLResolved === 'boolean')
|
|
638
|
+
isRTL = isRTLResolved;
|
|
639
|
+
cachedLocale = { language: language, languages: languages, timezone: timezone, offset: offset, isRTL: isRTL };
|
|
633
640
|
return cachedLocale;
|
|
634
641
|
}
|
|
635
642
|
function getDevice() {
|
|
@@ -680,38 +687,38 @@
|
|
|
680
687
|
if (prevBrandName === null || /Chrom/.test(prevBrandName) || !/Chrom/.test(brandName)) {
|
|
681
688
|
browserName = brandName;
|
|
682
689
|
if (browserName === 'Chrome' || browserName === 'Chrome WebView' || browserName === 'Chrome Headless')
|
|
683
|
-
|
|
690
|
+
parsedFromHighEntropyValuesBrowserName = Browsers.Chrome;
|
|
684
691
|
else if (browserName === 'Edge' || browserName === 'Edge WebView2')
|
|
685
|
-
|
|
692
|
+
parsedFromHighEntropyValuesBrowserName = Browsers.Edge;
|
|
686
693
|
else if (browserName === 'Opera Mobi')
|
|
687
|
-
|
|
688
|
-
|
|
694
|
+
parsedFromHighEntropyValuesBrowserName = Browsers.Opera;
|
|
695
|
+
parsedFromHighEntropyValuesBrowserVersion = brandVersion;
|
|
689
696
|
}
|
|
690
697
|
prevBrandName = brandName;
|
|
691
698
|
}
|
|
692
699
|
if (brandName === 'Chromium')
|
|
693
|
-
|
|
700
|
+
parsedFromHighEntropyValuesEngineVersion = brandVersion;
|
|
694
701
|
}
|
|
695
702
|
if (typeof platformVersion === 'string') {
|
|
696
703
|
if (getParsedCache().os.name === OS.Windows) {
|
|
697
704
|
if (parseInt(platformVersion.split('.')[0], 10) >= 13)
|
|
698
|
-
|
|
705
|
+
parsedFromHighEntropyValuesOSVersion = '11';
|
|
699
706
|
else
|
|
700
|
-
|
|
707
|
+
parsedFromHighEntropyValuesOSVersion = '10';
|
|
701
708
|
}
|
|
702
709
|
else {
|
|
703
|
-
|
|
710
|
+
parsedFromHighEntropyValuesOSVersion = platformVersion;
|
|
704
711
|
}
|
|
705
712
|
}
|
|
706
713
|
if (typeof platform === 'string') {
|
|
707
714
|
if (/android/i.test(platform))
|
|
708
|
-
|
|
715
|
+
parsedFromHighEntropyValuesOSName = OS.Android;
|
|
709
716
|
else if (/ios|iphone|ipad/i.test(platform))
|
|
710
|
-
|
|
717
|
+
parsedFromHighEntropyValuesOSName = OS.iOS;
|
|
711
718
|
else if (/windows|win32/i.test(platform))
|
|
712
|
-
|
|
719
|
+
parsedFromHighEntropyValuesOSName = OS.Windows;
|
|
713
720
|
else if (/macos|macintel/i.test(platform))
|
|
714
|
-
|
|
721
|
+
parsedFromHighEntropyValuesOSName = OS.MacOS;
|
|
715
722
|
}
|
|
716
723
|
if (result.mobile === true)
|
|
717
724
|
parsedFromHighEntropyValuesDevice = Devices.Mobile;
|
|
@@ -862,14 +869,14 @@
|
|
|
862
869
|
};
|
|
863
870
|
}
|
|
864
871
|
|
|
865
|
-
var onChangeSubscriptionManager$
|
|
872
|
+
var onChangeSubscriptionManager$4 = createSubscriptionManager(attachOnChange$4, detachOnChange$4);
|
|
866
873
|
var appearanceRef = null;
|
|
867
874
|
var pollingIntervalId = null;
|
|
868
875
|
var Appearance = {
|
|
869
876
|
get value() {
|
|
870
877
|
return getAppearance();
|
|
871
878
|
},
|
|
872
|
-
onChange: onChangeSubscriptionManager$
|
|
879
|
+
onChange: onChangeSubscriptionManager$4.subscribe,
|
|
873
880
|
Constants: {
|
|
874
881
|
Appearances: Appearances
|
|
875
882
|
},
|
|
@@ -905,7 +912,7 @@
|
|
|
905
912
|
var appearance = getAppearanceFromEngine();
|
|
906
913
|
if (appearance !== appearanceRef) {
|
|
907
914
|
appearanceRef = appearance;
|
|
908
|
-
onChangeSubscriptionManager$
|
|
915
|
+
onChangeSubscriptionManager$4.emit(appearance);
|
|
909
916
|
}
|
|
910
917
|
}, 2000);
|
|
911
918
|
}
|
|
@@ -916,13 +923,13 @@
|
|
|
916
923
|
pollingIntervalId = null;
|
|
917
924
|
}
|
|
918
925
|
}
|
|
919
|
-
function attachOnChange$
|
|
926
|
+
function attachOnChange$4() {
|
|
920
927
|
appearanceRef = getAppearanceFromMediaQuery();
|
|
921
928
|
EventListener.add(PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST, { type: 'change', callback: onMediaChange });
|
|
922
929
|
if (Platform.browser.name === Browsers.SamsungInternet)
|
|
923
930
|
startPolling();
|
|
924
931
|
}
|
|
925
|
-
function detachOnChange$
|
|
932
|
+
function detachOnChange$4() {
|
|
926
933
|
appearanceRef = null;
|
|
927
934
|
EventListener.remove(PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST, { type: 'change', callback: onMediaChange });
|
|
928
935
|
if (Platform.browser.name === Browsers.SamsungInternet)
|
|
@@ -935,7 +942,7 @@
|
|
|
935
942
|
else
|
|
936
943
|
appearance = Appearances.Light;
|
|
937
944
|
if (appearance !== appearanceRef)
|
|
938
|
-
onChangeSubscriptionManager$
|
|
945
|
+
onChangeSubscriptionManager$4.emit(appearanceRef = appearance);
|
|
939
946
|
}
|
|
940
947
|
|
|
941
948
|
function isSecureContext() {
|
|
@@ -1352,9 +1359,20 @@
|
|
|
1352
1359
|
|
|
1353
1360
|
var Orientation;
|
|
1354
1361
|
(function (Orientation) {
|
|
1355
|
-
Orientation["
|
|
1356
|
-
Orientation["
|
|
1357
|
-
Orientation["
|
|
1362
|
+
Orientation["PortraitPrimary"] = "portrait-primary";
|
|
1363
|
+
Orientation["PortraitSecondary"] = "portrait-secondary";
|
|
1364
|
+
Orientation["LandscapePrimary"] = "landscape-primary";
|
|
1365
|
+
Orientation["LandscapeSecondary"] = "landscape-secondary";
|
|
1366
|
+
})(Orientation || (Orientation = {}));
|
|
1367
|
+
(function (Orientation) {
|
|
1368
|
+
function isLandscape(orientation) {
|
|
1369
|
+
return orientation === Orientation.LandscapePrimary || orientation === Orientation.LandscapeSecondary;
|
|
1370
|
+
}
|
|
1371
|
+
Orientation.isLandscape = isLandscape;
|
|
1372
|
+
function isPortrait(orientation) {
|
|
1373
|
+
return orientation === Orientation.PortraitPrimary || orientation === Orientation.PortraitSecondary;
|
|
1374
|
+
}
|
|
1375
|
+
Orientation.isPortrait = isPortrait;
|
|
1358
1376
|
})(Orientation || (Orientation = {}));
|
|
1359
1377
|
var ENV_PRESETS = {
|
|
1360
1378
|
'safe-area-inset': {
|
|
@@ -1477,7 +1495,6 @@
|
|
|
1477
1495
|
var segmentMediaQueryLists = [];
|
|
1478
1496
|
var previousSegments = null;
|
|
1479
1497
|
function attachCSSFallbackListeners() {
|
|
1480
|
-
EventListener.add(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
1481
1498
|
segmentMediaQueryLists = buildSegmentMediaQueryLists();
|
|
1482
1499
|
for (var i = 0; i < segmentMediaQueryLists.length; i++)
|
|
1483
1500
|
EventListener.add(segmentMediaQueryLists[i], { type: 'change', callback: onSegmentChange });
|
|
@@ -1485,50 +1502,53 @@
|
|
|
1485
1502
|
EventListener.add(DEVICE_POSTURE_MEDIA_QUERY_LIST, { type: 'change', callback: onSegmentChange });
|
|
1486
1503
|
}
|
|
1487
1504
|
function detachCSSFallbackListeners() {
|
|
1488
|
-
EventListener.remove(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
1489
1505
|
for (var i = 0; i < segmentMediaQueryLists.length; i++)
|
|
1490
1506
|
EventListener.remove(segmentMediaQueryLists[i], { type: 'change', callback: onSegmentChange });
|
|
1491
1507
|
segmentMediaQueryLists = [];
|
|
1492
1508
|
if (DEVICE_POSTURE_MEDIA_QUERY_LIST.media !== 'not all')
|
|
1493
1509
|
EventListener.remove(DEVICE_POSTURE_MEDIA_QUERY_LIST, { type: 'change', callback: onSegmentChange });
|
|
1494
1510
|
}
|
|
1511
|
+
function attachDevicePostureChangeListener() {
|
|
1512
|
+
if (hasDevicePosture)
|
|
1513
|
+
EventListener.add(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
1514
|
+
attachCSSFallbackListeners();
|
|
1515
|
+
}
|
|
1516
|
+
function detachDevicePostureChangeListener() {
|
|
1517
|
+
if (hasDevicePosture)
|
|
1518
|
+
EventListener.remove(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
1519
|
+
detachCSSFallbackListeners();
|
|
1520
|
+
}
|
|
1521
|
+
function attachVisualViewportResizeListener() {
|
|
1522
|
+
EventListener.add(visualViewport, { type: 'resize', callback: onSegmentChange, options: { passive: true } });
|
|
1523
|
+
}
|
|
1524
|
+
function detachVisualViewportResizeListener() {
|
|
1525
|
+
EventListener.remove(visualViewport, { type: 'resize', callback: onSegmentChange, options: { passive: true } });
|
|
1526
|
+
}
|
|
1495
1527
|
function attachOnChange() {
|
|
1528
|
+
EventListener.add(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
1496
1529
|
if (hasSegmentsAPI) {
|
|
1497
|
-
|
|
1498
|
-
EventListener.add(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
1499
|
-
EventListener.add(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
1500
|
-
}
|
|
1501
|
-
else {
|
|
1502
|
-
attachCSSFallbackListeners();
|
|
1503
|
-
}
|
|
1530
|
+
attachDevicePostureChangeListener();
|
|
1504
1531
|
}
|
|
1505
1532
|
else if (hasLegacySegmentsAPI) {
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
EventListener.add(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
1533
|
+
attachVisualViewportResizeListener();
|
|
1534
|
+
attachDevicePostureChangeListener();
|
|
1509
1535
|
}
|
|
1510
1536
|
else {
|
|
1511
1537
|
getOrCreateCachedDiv();
|
|
1512
|
-
|
|
1538
|
+
attachVisualViewportResizeListener();
|
|
1513
1539
|
}
|
|
1514
1540
|
}
|
|
1515
1541
|
function detachOnChange() {
|
|
1542
|
+
EventListener.remove(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
1516
1543
|
if (hasSegmentsAPI) {
|
|
1517
|
-
|
|
1518
|
-
EventListener.remove(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
1519
|
-
EventListener.remove(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
1520
|
-
}
|
|
1521
|
-
else {
|
|
1522
|
-
detachCSSFallbackListeners();
|
|
1523
|
-
}
|
|
1544
|
+
detachDevicePostureChangeListener();
|
|
1524
1545
|
}
|
|
1525
1546
|
else if (hasLegacySegmentsAPI) {
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
EventListener.remove(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
1547
|
+
detachVisualViewportResizeListener();
|
|
1548
|
+
detachDevicePostureChangeListener();
|
|
1529
1549
|
}
|
|
1530
1550
|
else {
|
|
1531
|
-
|
|
1551
|
+
detachVisualViewportResizeListener();
|
|
1532
1552
|
releaseDiv();
|
|
1533
1553
|
}
|
|
1534
1554
|
}
|
|
@@ -1680,7 +1700,7 @@
|
|
|
1680
1700
|
function applySegments(segments) {
|
|
1681
1701
|
for (var i = segments.length; i < lastCount; i++) {
|
|
1682
1702
|
for (var j = 0; j < attributes.length; j++) {
|
|
1683
|
-
element.style.removeProperty(
|
|
1703
|
+
element.style.removeProperty('--' + prefix + '-' + i + '-' + attributes[j]);
|
|
1684
1704
|
}
|
|
1685
1705
|
}
|
|
1686
1706
|
lastCount = segments.length;
|
|
@@ -1688,7 +1708,7 @@
|
|
|
1688
1708
|
var segment = segments[i];
|
|
1689
1709
|
for (var j = 0; j < attributes.length; j++) {
|
|
1690
1710
|
var attribute = attributes[j];
|
|
1691
|
-
element.style.setProperty(
|
|
1711
|
+
element.style.setProperty('--' + prefix + '-' + i + '-' + attribute, segment[attribute] + 'px');
|
|
1692
1712
|
}
|
|
1693
1713
|
}
|
|
1694
1714
|
}
|
|
@@ -1700,7 +1720,7 @@
|
|
|
1700
1720
|
unsubscribe();
|
|
1701
1721
|
for (var i = 0; i < lastCount; i++)
|
|
1702
1722
|
for (var j = 0; j < attributes.length; j++)
|
|
1703
|
-
element.style.removeProperty(
|
|
1723
|
+
element.style.removeProperty('--' + prefix + '-' + i + '-' + attributes[j]);
|
|
1704
1724
|
lastCount = 0;
|
|
1705
1725
|
};
|
|
1706
1726
|
}
|
|
@@ -1714,15 +1734,11 @@
|
|
|
1714
1734
|
}
|
|
1715
1735
|
function createVirtualKeyboardObserver() {
|
|
1716
1736
|
var onChangeSubscriptionManager = createSubscriptionManager(attachOnChange, detachOnChange);
|
|
1717
|
-
var previousOverlaysContent = false;
|
|
1718
1737
|
function attachOnChange() {
|
|
1719
|
-
previousOverlaysContent = globalThis.navigator.virtualKeyboard.overlaysContent;
|
|
1720
|
-
globalThis.navigator.virtualKeyboard.overlaysContent = true;
|
|
1721
1738
|
EventListener.add(globalThis.navigator.virtualKeyboard, { type: 'geometrychange', callback: onGeometryChange, options: { passive: true } });
|
|
1722
1739
|
}
|
|
1723
1740
|
function detachOnChange() {
|
|
1724
1741
|
EventListener.remove(globalThis.navigator.virtualKeyboard, { type: 'geometrychange', callback: onGeometryChange, options: { passive: true } });
|
|
1725
|
-
globalThis.navigator.virtualKeyboard.overlaysContent = previousOverlaysContent;
|
|
1726
1742
|
}
|
|
1727
1743
|
function onGeometryChange() {
|
|
1728
1744
|
onChangeSubscriptionManager.emit(getValue());
|
|
@@ -1760,7 +1776,7 @@
|
|
|
1760
1776
|
function applyValues(values) {
|
|
1761
1777
|
for (var i = 0; i < attributes.length; i++) {
|
|
1762
1778
|
var attribute = attributes[i];
|
|
1763
|
-
element.style.setProperty(
|
|
1779
|
+
element.style.setProperty('--' + prefix + '-' + attribute, values[attribute] + 'px');
|
|
1764
1780
|
}
|
|
1765
1781
|
}
|
|
1766
1782
|
applyValues(getValue());
|
|
@@ -1770,7 +1786,7 @@
|
|
|
1770
1786
|
return function () {
|
|
1771
1787
|
unsubscribe();
|
|
1772
1788
|
for (var i = 0; i < attributes.length; i++)
|
|
1773
|
-
element.style.removeProperty(
|
|
1789
|
+
element.style.removeProperty('--' + prefix + '-' + attributes[i]);
|
|
1774
1790
|
};
|
|
1775
1791
|
}
|
|
1776
1792
|
return {
|
|
@@ -1959,7 +1975,7 @@
|
|
|
1959
1975
|
function applyValues(values) {
|
|
1960
1976
|
for (var i = 0; i < attributes.length; i++) {
|
|
1961
1977
|
var attribute = attributes[i];
|
|
1962
|
-
element.style.setProperty(
|
|
1978
|
+
element.style.setProperty('--' + prefix + '-' + String(attributes[i]), values[attribute] + 'px');
|
|
1963
1979
|
}
|
|
1964
1980
|
}
|
|
1965
1981
|
var unsubscribe = onChangeSubscriptionManager.subscribe(function (values) {
|
|
@@ -1969,7 +1985,7 @@
|
|
|
1969
1985
|
return function () {
|
|
1970
1986
|
unsubscribe();
|
|
1971
1987
|
for (var i = 0; i < attributes.length; i++)
|
|
1972
|
-
element.style.removeProperty(
|
|
1988
|
+
element.style.removeProperty('--' + prefix + '-' + String(attributes[i]));
|
|
1973
1989
|
};
|
|
1974
1990
|
}
|
|
1975
1991
|
return {
|
|
@@ -1991,109 +2007,6 @@
|
|
|
1991
2007
|
};
|
|
1992
2008
|
}
|
|
1993
2009
|
|
|
1994
|
-
var safeAreaInsetObserver = createEnvironmentObserver('safe-area-inset');
|
|
1995
|
-
var safeAreaMaxInsetObserver = createEnvironmentObserver('safe-area-max-inset');
|
|
1996
|
-
var keyboardInsetObserver = createEnvironmentObserver('keyboard-inset');
|
|
1997
|
-
var titlebarAreaObserver = createEnvironmentObserver('titlebar-area');
|
|
1998
|
-
var viewportSegmentObserver = createEnvironmentObserver('viewport-segment');
|
|
1999
|
-
var onChangeSubscriptionManager$4 = createSubscriptionManager(attachOnChange$4, detachOnChange$4);
|
|
2000
|
-
var dimensionRef = null;
|
|
2001
|
-
var Dimension = {
|
|
2002
|
-
get value() {
|
|
2003
|
-
return getDimension();
|
|
2004
|
-
},
|
|
2005
|
-
environment: getEnvironment(),
|
|
2006
|
-
onChange: onChangeSubscriptionManager$4.subscribe,
|
|
2007
|
-
Constants: {
|
|
2008
|
-
Orientation: Orientation,
|
|
2009
|
-
},
|
|
2010
|
-
Errors: {},
|
|
2011
|
-
};
|
|
2012
|
-
function getOrientation() {
|
|
2013
|
-
if (typeof globalThis.screen !== 'undefined') {
|
|
2014
|
-
switch (globalThis.screen.orientation.type) {
|
|
2015
|
-
case 'portrait-primary':
|
|
2016
|
-
case 'portrait-secondary':
|
|
2017
|
-
return Orientation.Portrait;
|
|
2018
|
-
case 'landscape-primary':
|
|
2019
|
-
case 'landscape-secondary':
|
|
2020
|
-
return Orientation.Landscape;
|
|
2021
|
-
}
|
|
2022
|
-
}
|
|
2023
|
-
if (typeof globalThis.orientation !== 'undefined') {
|
|
2024
|
-
switch (globalThis.orientation) {
|
|
2025
|
-
case 0:
|
|
2026
|
-
case 180:
|
|
2027
|
-
return Orientation.Portrait;
|
|
2028
|
-
case 90:
|
|
2029
|
-
case 270:
|
|
2030
|
-
return Orientation.Landscape;
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
if (ORIENTATION_MEDIA_QUERY_LIST.media === 'not all')
|
|
2034
|
-
return Orientation.Unknown;
|
|
2035
|
-
else if (ORIENTATION_MEDIA_QUERY_LIST.matches)
|
|
2036
|
-
return Orientation.Portrait;
|
|
2037
|
-
else
|
|
2038
|
-
return Orientation.Landscape;
|
|
2039
|
-
}
|
|
2040
|
-
function getScale() {
|
|
2041
|
-
if (typeof globalThis.devicePixelRatio !== 'undefined')
|
|
2042
|
-
return globalThis.devicePixelRatio;
|
|
2043
|
-
return -1;
|
|
2044
|
-
}
|
|
2045
|
-
function getEnvironment() {
|
|
2046
|
-
return {
|
|
2047
|
-
safeAreaInset: safeAreaInsetObserver,
|
|
2048
|
-
safeAreaMaxInset: safeAreaMaxInsetObserver,
|
|
2049
|
-
keyboardInset: keyboardInsetObserver,
|
|
2050
|
-
titlebarArea: titlebarAreaObserver,
|
|
2051
|
-
viewportSegment: viewportSegmentObserver,
|
|
2052
|
-
};
|
|
2053
|
-
}
|
|
2054
|
-
function getDimension() {
|
|
2055
|
-
var dimensions = {
|
|
2056
|
-
innerWidth: 0,
|
|
2057
|
-
innerHeight: 0,
|
|
2058
|
-
outerWidth: 0,
|
|
2059
|
-
outerHeight: 0,
|
|
2060
|
-
scale: getScale(),
|
|
2061
|
-
orientation: getOrientation(),
|
|
2062
|
-
};
|
|
2063
|
-
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
2064
|
-
dimensions.innerWidth = globalThis.innerWidth;
|
|
2065
|
-
dimensions.innerHeight = globalThis.innerHeight;
|
|
2066
|
-
dimensions.outerWidth = globalThis.outerWidth;
|
|
2067
|
-
dimensions.outerHeight = globalThis.outerHeight;
|
|
2068
|
-
}
|
|
2069
|
-
return dimensions;
|
|
2070
|
-
}
|
|
2071
|
-
function attachOnChange$4() {
|
|
2072
|
-
dimensionRef = getDimension();
|
|
2073
|
-
EventListener.add(globalThis, { type: 'resize', callback: onResize });
|
|
2074
|
-
if (typeof globalThis.screen.orientation.addEventListener === 'function')
|
|
2075
|
-
EventListener.add(globalThis.screen.orientation, { type: 'change', callback: onResize });
|
|
2076
|
-
else if (typeof globalThis.orientation !== 'undefined')
|
|
2077
|
-
EventListener.add(globalThis, { type: 'orientationChange', callback: onResize });
|
|
2078
|
-
else if (ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all')
|
|
2079
|
-
EventListener.add(ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback: onResize });
|
|
2080
|
-
}
|
|
2081
|
-
function detachOnChange$4() {
|
|
2082
|
-
dimensionRef = null;
|
|
2083
|
-
EventListener.remove(globalThis, { type: 'resize', callback: onResize });
|
|
2084
|
-
if (typeof globalThis.screen.orientation.removeEventListener === 'function')
|
|
2085
|
-
EventListener.remove(globalThis.screen.orientation, { type: 'change', callback: onResize });
|
|
2086
|
-
else if (typeof globalThis.orientation !== 'undefined')
|
|
2087
|
-
EventListener.remove(globalThis, { type: 'orientationChange', callback: onResize });
|
|
2088
|
-
else if (ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all')
|
|
2089
|
-
EventListener.remove(ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback: onResize });
|
|
2090
|
-
}
|
|
2091
|
-
function onResize() {
|
|
2092
|
-
var dimension = getDimension();
|
|
2093
|
-
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)
|
|
2094
|
-
onChangeSubscriptionManager$4.emit(dimensionRef = dimension);
|
|
2095
|
-
}
|
|
2096
|
-
|
|
2097
2010
|
function createCustomError(name, Base) {
|
|
2098
2011
|
if (Base === void 0) { Base = Error; }
|
|
2099
2012
|
function CustomError(message) {
|
|
@@ -2176,8 +2089,248 @@
|
|
|
2176
2089
|
return CustomError;
|
|
2177
2090
|
}
|
|
2178
2091
|
|
|
2092
|
+
var PermissionNotGrantedError = createCustomError('PermissionNotGrantedError');
|
|
2093
|
+
|
|
2179
2094
|
var NotSupportedError = createCustomError('NotSupportedError');
|
|
2180
2095
|
|
|
2096
|
+
var safeAreaInsetObserver = createEnvironmentObserver('safe-area-inset');
|
|
2097
|
+
var safeAreaMaxInsetObserver = createEnvironmentObserver('safe-area-max-inset');
|
|
2098
|
+
var keyboardInsetObserver = createEnvironmentObserver('keyboard-inset');
|
|
2099
|
+
var titlebarAreaObserver = createEnvironmentObserver('titlebar-area');
|
|
2100
|
+
var viewportSegmentObserver = createEnvironmentObserver('viewport-segment');
|
|
2101
|
+
var onDimensionChangeSubscriptionManager = createSubscriptionManager(attachOnDimensionChange, detachOnDimensionChange);
|
|
2102
|
+
var onScreenOrientationChangeSubscriptionManager = createSubscriptionManager(attachOnScreenOrientationChange, detachOnScreenOrientationChange);
|
|
2103
|
+
var onDeviceOrientationChangeSubscriptionManager = createSubscriptionManager(attachOnDeviceOrientationChange, detachOnDeviceOrientationChange);
|
|
2104
|
+
var dimensionRef = null;
|
|
2105
|
+
var screenOrientationRef = null;
|
|
2106
|
+
var deviceOrientationRef = null;
|
|
2107
|
+
var Dimension = {
|
|
2108
|
+
get value() {
|
|
2109
|
+
return getDimension();
|
|
2110
|
+
},
|
|
2111
|
+
environment: getEnvironment(),
|
|
2112
|
+
screenOrientation: getScreenOrientation(),
|
|
2113
|
+
deviceOrientation: getDeviceOrientation(),
|
|
2114
|
+
onChange: onDimensionChangeSubscriptionManager.subscribe,
|
|
2115
|
+
Constants: {
|
|
2116
|
+
Orientation: Orientation,
|
|
2117
|
+
},
|
|
2118
|
+
Errors: {
|
|
2119
|
+
NotSupportedError: NotSupportedError,
|
|
2120
|
+
PermissionNotGrantedError: PermissionNotGrantedError,
|
|
2121
|
+
},
|
|
2122
|
+
};
|
|
2123
|
+
function getOrientation() {
|
|
2124
|
+
if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.type !== 'undefined') {
|
|
2125
|
+
switch (globalThis.screen.orientation.type) {
|
|
2126
|
+
case 'portrait-primary':
|
|
2127
|
+
return Orientation.PortraitPrimary;
|
|
2128
|
+
case 'portrait-secondary':
|
|
2129
|
+
return Orientation.PortraitSecondary;
|
|
2130
|
+
case 'landscape-primary':
|
|
2131
|
+
return Orientation.LandscapePrimary;
|
|
2132
|
+
case 'landscape-secondary':
|
|
2133
|
+
return Orientation.LandscapeSecondary;
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
if (typeof globalThis.orientation !== 'undefined') {
|
|
2137
|
+
switch (globalThis.orientation) {
|
|
2138
|
+
case 0:
|
|
2139
|
+
return Orientation.PortraitPrimary;
|
|
2140
|
+
case 180:
|
|
2141
|
+
return Orientation.PortraitSecondary;
|
|
2142
|
+
case 90:
|
|
2143
|
+
return Orientation.LandscapePrimary;
|
|
2144
|
+
case -90:
|
|
2145
|
+
case 270:
|
|
2146
|
+
return Orientation.LandscapeSecondary;
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
if (ORIENTATION_MEDIA_QUERY_LIST.media === 'not all')
|
|
2150
|
+
throw new NotSupportedError('\'screen.orientation\', \'window.orientation\', and the orientation media query are all unsupported');
|
|
2151
|
+
if (ORIENTATION_MEDIA_QUERY_LIST.matches)
|
|
2152
|
+
return Orientation.PortraitPrimary;
|
|
2153
|
+
else
|
|
2154
|
+
return Orientation.LandscapePrimary;
|
|
2155
|
+
}
|
|
2156
|
+
function getScale() {
|
|
2157
|
+
if (typeof globalThis.devicePixelRatio !== 'undefined')
|
|
2158
|
+
return globalThis.devicePixelRatio;
|
|
2159
|
+
return -1;
|
|
2160
|
+
}
|
|
2161
|
+
function getEnvironment() {
|
|
2162
|
+
return {
|
|
2163
|
+
safeAreaInset: safeAreaInsetObserver,
|
|
2164
|
+
safeAreaMaxInset: safeAreaMaxInsetObserver,
|
|
2165
|
+
keyboardInset: keyboardInsetObserver,
|
|
2166
|
+
titlebarArea: titlebarAreaObserver,
|
|
2167
|
+
viewportSegment: viewportSegmentObserver,
|
|
2168
|
+
};
|
|
2169
|
+
}
|
|
2170
|
+
function getScreenOrientation() {
|
|
2171
|
+
return {
|
|
2172
|
+
get supported() {
|
|
2173
|
+
return screenOrientationSupported();
|
|
2174
|
+
},
|
|
2175
|
+
get value() {
|
|
2176
|
+
return getOrientation();
|
|
2177
|
+
},
|
|
2178
|
+
onChange: onScreenOrientationChangeSubscriptionManager.subscribe,
|
|
2179
|
+
};
|
|
2180
|
+
}
|
|
2181
|
+
function getDeviceOrientation() {
|
|
2182
|
+
return {
|
|
2183
|
+
get supported() {
|
|
2184
|
+
return deviceOrientationSupported();
|
|
2185
|
+
},
|
|
2186
|
+
get value() {
|
|
2187
|
+
return getDeviceOrientationValue();
|
|
2188
|
+
},
|
|
2189
|
+
onChange: onDeviceOrientationChangeSubscriptionManager.subscribe,
|
|
2190
|
+
};
|
|
2191
|
+
}
|
|
2192
|
+
function getDimension() {
|
|
2193
|
+
var innerWidth = 0;
|
|
2194
|
+
var innerHeight = 0;
|
|
2195
|
+
var outerWidth = 0;
|
|
2196
|
+
var outerHeight = 0;
|
|
2197
|
+
var scale = getScale();
|
|
2198
|
+
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
2199
|
+
innerWidth = globalThis.innerWidth;
|
|
2200
|
+
innerHeight = globalThis.innerHeight;
|
|
2201
|
+
outerWidth = globalThis.outerWidth;
|
|
2202
|
+
outerHeight = globalThis.outerHeight;
|
|
2203
|
+
}
|
|
2204
|
+
return {
|
|
2205
|
+
innerWidth: innerWidth,
|
|
2206
|
+
innerHeight: innerHeight,
|
|
2207
|
+
outerWidth: outerWidth,
|
|
2208
|
+
outerHeight: outerHeight,
|
|
2209
|
+
scale: scale,
|
|
2210
|
+
};
|
|
2211
|
+
}
|
|
2212
|
+
function attachOnDimensionChange() {
|
|
2213
|
+
dimensionRef = getDimension();
|
|
2214
|
+
EventListener.add(globalThis, { type: 'resize', callback: onDimensionChange });
|
|
2215
|
+
}
|
|
2216
|
+
function detachOnDimensionChange() {
|
|
2217
|
+
dimensionRef = null;
|
|
2218
|
+
EventListener.remove(globalThis, { type: 'resize', callback: onDimensionChange });
|
|
2219
|
+
}
|
|
2220
|
+
function onDimensionChange() {
|
|
2221
|
+
var dimension = getDimension();
|
|
2222
|
+
if (dimensionRef === null || dimension.innerWidth !== dimensionRef.innerWidth || dimension.innerHeight !== dimensionRef.innerHeight || dimension.outerWidth !== dimensionRef.outerWidth || dimension.outerHeight !== dimensionRef.outerHeight || dimension.scale !== dimensionRef.scale)
|
|
2223
|
+
onDimensionChangeSubscriptionManager.emit(dimensionRef = dimension);
|
|
2224
|
+
}
|
|
2225
|
+
function screenOrientationSupported() {
|
|
2226
|
+
if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.type !== 'undefined')
|
|
2227
|
+
return true;
|
|
2228
|
+
if (typeof globalThis.orientation !== 'undefined')
|
|
2229
|
+
return true;
|
|
2230
|
+
return ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all';
|
|
2231
|
+
}
|
|
2232
|
+
function attachOnScreenOrientationChange() {
|
|
2233
|
+
if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.addEventListener === 'function')
|
|
2234
|
+
return EventListener.add(globalThis.screen.orientation, {
|
|
2235
|
+
type: 'change',
|
|
2236
|
+
callback: onScreenOrientationChange
|
|
2237
|
+
});
|
|
2238
|
+
else if (typeof globalThis.orientation !== 'undefined')
|
|
2239
|
+
return EventListener.add(globalThis, { type: 'orientationchange', callback: onScreenOrientationChange });
|
|
2240
|
+
else if (ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all')
|
|
2241
|
+
return EventListener.add(ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback: onScreenOrientationChange });
|
|
2242
|
+
throw new NotSupportedError('\'screen.orientation\', \'window.orientation\', and the orientation media query are all unsupported');
|
|
2243
|
+
}
|
|
2244
|
+
function detachOnScreenOrientationChange() {
|
|
2245
|
+
if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.removeEventListener === 'function')
|
|
2246
|
+
return EventListener.remove(globalThis.screen.orientation, {
|
|
2247
|
+
type: 'change',
|
|
2248
|
+
callback: onScreenOrientationChange
|
|
2249
|
+
});
|
|
2250
|
+
else if (typeof globalThis.orientation !== 'undefined')
|
|
2251
|
+
return EventListener.remove(globalThis, { type: 'orientationchange', callback: onScreenOrientationChange });
|
|
2252
|
+
else if (ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all')
|
|
2253
|
+
return EventListener.remove(ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback: onScreenOrientationChange });
|
|
2254
|
+
throw new NotSupportedError('\'screen.orientation\', \'window.orientation\', and the orientation media query are all unsupported');
|
|
2255
|
+
}
|
|
2256
|
+
function onScreenOrientationChange() {
|
|
2257
|
+
var orientation = getOrientation();
|
|
2258
|
+
if (screenOrientationRef === null || orientation !== screenOrientationRef)
|
|
2259
|
+
onScreenOrientationChangeSubscriptionManager.emit(screenOrientationRef = orientation);
|
|
2260
|
+
}
|
|
2261
|
+
function deviceOrientationSupported() {
|
|
2262
|
+
return typeof globalThis.DeviceOrientationEvent !== 'undefined';
|
|
2263
|
+
}
|
|
2264
|
+
function attachOnDeviceOrientationChange() {
|
|
2265
|
+
return new Promise(function (resolve, reject) {
|
|
2266
|
+
if (!deviceOrientationSupported())
|
|
2267
|
+
return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
|
|
2268
|
+
var DeviceOrientationEventWithPermission = DeviceOrientationEvent;
|
|
2269
|
+
if (typeof DeviceOrientationEventWithPermission.requestPermission === 'function') {
|
|
2270
|
+
DeviceOrientationEventWithPermission.requestPermission().then(function (permission) {
|
|
2271
|
+
if (permission === 'granted') {
|
|
2272
|
+
EventListener.add(globalThis, { type: 'deviceorientation', callback: onDeviceOrientationChange });
|
|
2273
|
+
return resolve();
|
|
2274
|
+
}
|
|
2275
|
+
return reject(new PermissionNotGrantedError('\'deviceorientation\' permission is not granted.'));
|
|
2276
|
+
}).catch(function (_) {
|
|
2277
|
+
return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
|
|
2278
|
+
});
|
|
2279
|
+
}
|
|
2280
|
+
else {
|
|
2281
|
+
EventListener.add(globalThis, { type: 'deviceorientation', callback: onDeviceOrientationChange });
|
|
2282
|
+
return resolve();
|
|
2283
|
+
}
|
|
2284
|
+
});
|
|
2285
|
+
}
|
|
2286
|
+
function detachOnDeviceOrientationChange() {
|
|
2287
|
+
EventListener.remove(globalThis, { type: 'deviceorientation', callback: onDeviceOrientationChange });
|
|
2288
|
+
}
|
|
2289
|
+
function onDeviceOrientationChange(event) {
|
|
2290
|
+
deviceOrientationRef = {
|
|
2291
|
+
alpha: event.alpha,
|
|
2292
|
+
beta: event.beta,
|
|
2293
|
+
gamma: event.gamma,
|
|
2294
|
+
absolute: event.absolute,
|
|
2295
|
+
};
|
|
2296
|
+
onDeviceOrientationChangeSubscriptionManager.emit(deviceOrientationRef);
|
|
2297
|
+
}
|
|
2298
|
+
function getDeviceOrientationValue() {
|
|
2299
|
+
return new Promise(function (resolve, reject) {
|
|
2300
|
+
if (deviceOrientationRef !== null)
|
|
2301
|
+
return resolve(deviceOrientationRef);
|
|
2302
|
+
if (!deviceOrientationSupported())
|
|
2303
|
+
return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
|
|
2304
|
+
var DeviceOrientationEventWithPermission = DeviceOrientationEvent;
|
|
2305
|
+
var callback = function (event) {
|
|
2306
|
+
var value = {
|
|
2307
|
+
alpha: event.alpha,
|
|
2308
|
+
beta: event.beta,
|
|
2309
|
+
gamma: event.gamma,
|
|
2310
|
+
absolute: event.absolute,
|
|
2311
|
+
};
|
|
2312
|
+
deviceOrientationRef = value;
|
|
2313
|
+
EventListener.remove(globalThis, { type: 'deviceorientation', callback: callback });
|
|
2314
|
+
return resolve(value);
|
|
2315
|
+
};
|
|
2316
|
+
if (typeof DeviceOrientationEventWithPermission.requestPermission === 'function') {
|
|
2317
|
+
DeviceOrientationEventWithPermission.requestPermission().then(function (permission) {
|
|
2318
|
+
if (permission === 'granted') {
|
|
2319
|
+
EventListener.add(globalThis, { type: 'deviceorientation', callback: callback });
|
|
2320
|
+
return;
|
|
2321
|
+
}
|
|
2322
|
+
return reject(new PermissionNotGrantedError('\'deviceorientation\' permission is not granted.'));
|
|
2323
|
+
}).catch(function (_) {
|
|
2324
|
+
return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
|
|
2325
|
+
});
|
|
2326
|
+
}
|
|
2327
|
+
else {
|
|
2328
|
+
EventListener.add(globalThis, { type: 'deviceorientation', callback: callback });
|
|
2329
|
+
return;
|
|
2330
|
+
}
|
|
2331
|
+
});
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2181
2334
|
var InvalidStateError = createCustomError('InvalidStateError');
|
|
2182
2335
|
|
|
2183
2336
|
var videoElement$1 = null;
|
|
@@ -2582,6 +2735,8 @@
|
|
|
2582
2735
|
PermissionType["ClipboardRead"] = "clipboard-read";
|
|
2583
2736
|
PermissionType["Microphone"] = "microphone";
|
|
2584
2737
|
PermissionType["MIDI"] = "midi";
|
|
2738
|
+
PermissionType["DeviceOrientation"] = "device-orientation";
|
|
2739
|
+
PermissionType["DeviceMotion"] = "device-motion";
|
|
2585
2740
|
})(PermissionType || (PermissionType = {}));
|
|
2586
2741
|
var PermissionState;
|
|
2587
2742
|
(function (PermissionState) {
|
|
@@ -2623,14 +2778,45 @@
|
|
|
2623
2778
|
PermissionType: PermissionType,
|
|
2624
2779
|
PermissionState: PermissionState,
|
|
2625
2780
|
},
|
|
2626
|
-
Errors: {
|
|
2781
|
+
Errors: {
|
|
2782
|
+
NotSupportedError: NotSupportedError,
|
|
2783
|
+
},
|
|
2627
2784
|
};
|
|
2785
|
+
function toPermissionState(permission) {
|
|
2786
|
+
switch (permission) {
|
|
2787
|
+
case 'granted':
|
|
2788
|
+
return PermissionState.Grant;
|
|
2789
|
+
case 'denied':
|
|
2790
|
+
return PermissionState.Denied;
|
|
2791
|
+
case 'prompt':
|
|
2792
|
+
case 'default':
|
|
2793
|
+
return PermissionState.Prompt;
|
|
2794
|
+
default:
|
|
2795
|
+
return PermissionState.Unsupported;
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
function toSafariSensorEventMap(type) {
|
|
2799
|
+
switch (type) {
|
|
2800
|
+
case PermissionType.DeviceOrientation:
|
|
2801
|
+
return {
|
|
2802
|
+
event: globalThis.DeviceOrientationEvent,
|
|
2803
|
+
type: 'deviceorientation',
|
|
2804
|
+
};
|
|
2805
|
+
case PermissionType.DeviceMotion:
|
|
2806
|
+
return {
|
|
2807
|
+
event: globalThis.DeviceMotionEvent,
|
|
2808
|
+
type: 'devicemotion',
|
|
2809
|
+
};
|
|
2810
|
+
default:
|
|
2811
|
+
return undefined;
|
|
2812
|
+
}
|
|
2813
|
+
}
|
|
2628
2814
|
function supported$5() {
|
|
2629
2815
|
return typeof globalThis.navigator.permissions !== 'undefined';
|
|
2630
2816
|
}
|
|
2631
2817
|
function request$2(type) {
|
|
2632
2818
|
var instance = this;
|
|
2633
|
-
return new Promise(function (resolve) {
|
|
2819
|
+
return new Promise(function (resolve, reject) {
|
|
2634
2820
|
function resolveAfterCheck() {
|
|
2635
2821
|
instance.check(type).then(resolve);
|
|
2636
2822
|
}
|
|
@@ -2642,17 +2828,8 @@
|
|
|
2642
2828
|
case PermissionType.Notification:
|
|
2643
2829
|
if (typeof globalThis.Notification === 'undefined')
|
|
2644
2830
|
return resolve(PermissionState.Unsupported);
|
|
2645
|
-
globalThis.Notification.requestPermission().then(function (
|
|
2646
|
-
|
|
2647
|
-
case 'default':
|
|
2648
|
-
return resolve(PermissionState.Prompt);
|
|
2649
|
-
case 'granted':
|
|
2650
|
-
return resolve(PermissionState.Grant);
|
|
2651
|
-
case 'denied':
|
|
2652
|
-
return resolve(PermissionState.Denied);
|
|
2653
|
-
default:
|
|
2654
|
-
resolveAfterCheck();
|
|
2655
|
-
}
|
|
2831
|
+
globalThis.Notification.requestPermission().then(function (permission) {
|
|
2832
|
+
resolve(toPermissionState(permission));
|
|
2656
2833
|
});
|
|
2657
2834
|
break;
|
|
2658
2835
|
case PermissionType.Geolocation:
|
|
@@ -2690,6 +2867,23 @@
|
|
|
2690
2867
|
.then(resolveAfterCheck)
|
|
2691
2868
|
.catch(resolveAfterCheck);
|
|
2692
2869
|
break;
|
|
2870
|
+
case PermissionType.DeviceOrientation:
|
|
2871
|
+
case PermissionType.DeviceMotion:
|
|
2872
|
+
var sensorEventMap = toSafariSensorEventMap(type);
|
|
2873
|
+
if (typeof sensorEventMap === 'undefined' || typeof sensorEventMap.event === 'undefined')
|
|
2874
|
+
return resolve(PermissionState.Unsupported);
|
|
2875
|
+
if (typeof sensorEventMap.event.requestPermission !== 'function')
|
|
2876
|
+
return resolve(PermissionState.Grant);
|
|
2877
|
+
try {
|
|
2878
|
+
sensorEventMap.event.requestPermission()
|
|
2879
|
+
.then(function (permission) {
|
|
2880
|
+
resolve(toPermissionState(permission));
|
|
2881
|
+
});
|
|
2882
|
+
}
|
|
2883
|
+
catch (_) {
|
|
2884
|
+
return reject(new NotSupportedError('\'DeviceOrientationEvent.requestPermission()\' must be called within a user gesture context.'));
|
|
2885
|
+
}
|
|
2886
|
+
break;
|
|
2693
2887
|
default:
|
|
2694
2888
|
return resolve(PermissionState.Unsupported);
|
|
2695
2889
|
}
|
|
@@ -2697,6 +2891,34 @@
|
|
|
2697
2891
|
});
|
|
2698
2892
|
}
|
|
2699
2893
|
function check(type) {
|
|
2894
|
+
if (type === PermissionType.DeviceOrientation || type === PermissionType.DeviceMotion) {
|
|
2895
|
+
return new Promise(function (resolve) {
|
|
2896
|
+
var sensorEventMap = toSafariSensorEventMap(type);
|
|
2897
|
+
if (typeof sensorEventMap === 'undefined' || typeof sensorEventMap.event === 'undefined')
|
|
2898
|
+
return resolve(PermissionState.Unsupported);
|
|
2899
|
+
if (typeof sensorEventMap.event.requestPermission !== 'function')
|
|
2900
|
+
return resolve(PermissionState.Grant);
|
|
2901
|
+
var granted = false;
|
|
2902
|
+
EventListener.add(globalThis, {
|
|
2903
|
+
type: sensorEventMap.type,
|
|
2904
|
+
callback: function () {
|
|
2905
|
+
granted = true;
|
|
2906
|
+
},
|
|
2907
|
+
options: { once: true }
|
|
2908
|
+
});
|
|
2909
|
+
setTimeout(function () {
|
|
2910
|
+
if (granted)
|
|
2911
|
+
return resolve(PermissionState.Grant);
|
|
2912
|
+
sensorEventMap.event.requestPermission()
|
|
2913
|
+
.then(function (permission) {
|
|
2914
|
+
resolve(toPermissionState(permission));
|
|
2915
|
+
})
|
|
2916
|
+
.catch(function () {
|
|
2917
|
+
resolve(PermissionState.Prompt);
|
|
2918
|
+
});
|
|
2919
|
+
}, 50);
|
|
2920
|
+
});
|
|
2921
|
+
}
|
|
2700
2922
|
return new Promise(function (resolve) {
|
|
2701
2923
|
if (typeof globalThis.navigator.permissions === 'undefined')
|
|
2702
2924
|
return resolve(PermissionState.Unsupported);
|
|
@@ -2716,8 +2938,6 @@
|
|
|
2716
2938
|
});
|
|
2717
2939
|
}
|
|
2718
2940
|
|
|
2719
|
-
var PermissionNotGrantedError = createCustomError('PermissionNotGrantedError');
|
|
2720
|
-
|
|
2721
2941
|
function request$1(url, options) {
|
|
2722
2942
|
return new Promise(function (resolve) {
|
|
2723
2943
|
var method = 'GET';
|