native-fn 1.3.0 → 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 +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.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var version = "1.3.
|
|
1
|
+
var version = "1.3.1";
|
|
2
2
|
var packageJSON = {
|
|
3
3
|
version: version};
|
|
4
4
|
|
|
@@ -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;
|
|
@@ -856,14 +863,14 @@ function createSubscriptionManager(attach, detach) {
|
|
|
856
863
|
};
|
|
857
864
|
}
|
|
858
865
|
|
|
859
|
-
var onChangeSubscriptionManager$
|
|
866
|
+
var onChangeSubscriptionManager$4 = createSubscriptionManager(attachOnChange$4, detachOnChange$4);
|
|
860
867
|
var appearanceRef = null;
|
|
861
868
|
var pollingIntervalId = null;
|
|
862
869
|
var Appearance = {
|
|
863
870
|
get value() {
|
|
864
871
|
return getAppearance();
|
|
865
872
|
},
|
|
866
|
-
onChange: onChangeSubscriptionManager$
|
|
873
|
+
onChange: onChangeSubscriptionManager$4.subscribe,
|
|
867
874
|
Constants: {
|
|
868
875
|
Appearances: Appearances
|
|
869
876
|
},
|
|
@@ -899,7 +906,7 @@ function startPolling() {
|
|
|
899
906
|
var appearance = getAppearanceFromEngine();
|
|
900
907
|
if (appearance !== appearanceRef) {
|
|
901
908
|
appearanceRef = appearance;
|
|
902
|
-
onChangeSubscriptionManager$
|
|
909
|
+
onChangeSubscriptionManager$4.emit(appearance);
|
|
903
910
|
}
|
|
904
911
|
}, 2000);
|
|
905
912
|
}
|
|
@@ -910,13 +917,13 @@ function stopPolling() {
|
|
|
910
917
|
pollingIntervalId = null;
|
|
911
918
|
}
|
|
912
919
|
}
|
|
913
|
-
function attachOnChange$
|
|
920
|
+
function attachOnChange$4() {
|
|
914
921
|
appearanceRef = getAppearanceFromMediaQuery();
|
|
915
922
|
EventListener.add(PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST, { type: 'change', callback: onMediaChange });
|
|
916
923
|
if (Platform.browser.name === Browsers.SamsungInternet)
|
|
917
924
|
startPolling();
|
|
918
925
|
}
|
|
919
|
-
function detachOnChange$
|
|
926
|
+
function detachOnChange$4() {
|
|
920
927
|
appearanceRef = null;
|
|
921
928
|
EventListener.remove(PREFERS_COLOR_SCHEME_MEDIA_QUERY_LIST, { type: 'change', callback: onMediaChange });
|
|
922
929
|
if (Platform.browser.name === Browsers.SamsungInternet)
|
|
@@ -929,7 +936,7 @@ function onMediaChange(event) {
|
|
|
929
936
|
else
|
|
930
937
|
appearance = Appearances.Light;
|
|
931
938
|
if (appearance !== appearanceRef)
|
|
932
|
-
onChangeSubscriptionManager$
|
|
939
|
+
onChangeSubscriptionManager$4.emit(appearanceRef = appearance);
|
|
933
940
|
}
|
|
934
941
|
|
|
935
942
|
function isSecureContext() {
|
|
@@ -1346,9 +1353,20 @@ function cleanupPaste(div, onPaste) {
|
|
|
1346
1353
|
|
|
1347
1354
|
var Orientation;
|
|
1348
1355
|
(function (Orientation) {
|
|
1349
|
-
Orientation["
|
|
1350
|
-
Orientation["
|
|
1351
|
-
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;
|
|
1352
1370
|
})(Orientation || (Orientation = {}));
|
|
1353
1371
|
var ENV_PRESETS = {
|
|
1354
1372
|
'safe-area-inset': {
|
|
@@ -1471,7 +1489,6 @@ function createViewportSegmentObserver() {
|
|
|
1471
1489
|
var segmentMediaQueryLists = [];
|
|
1472
1490
|
var previousSegments = null;
|
|
1473
1491
|
function attachCSSFallbackListeners() {
|
|
1474
|
-
EventListener.add(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
1475
1492
|
segmentMediaQueryLists = buildSegmentMediaQueryLists();
|
|
1476
1493
|
for (var i = 0; i < segmentMediaQueryLists.length; i++)
|
|
1477
1494
|
EventListener.add(segmentMediaQueryLists[i], { type: 'change', callback: onSegmentChange });
|
|
@@ -1479,50 +1496,53 @@ function createViewportSegmentObserver() {
|
|
|
1479
1496
|
EventListener.add(DEVICE_POSTURE_MEDIA_QUERY_LIST, { type: 'change', callback: onSegmentChange });
|
|
1480
1497
|
}
|
|
1481
1498
|
function detachCSSFallbackListeners() {
|
|
1482
|
-
EventListener.remove(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
1483
1499
|
for (var i = 0; i < segmentMediaQueryLists.length; i++)
|
|
1484
1500
|
EventListener.remove(segmentMediaQueryLists[i], { type: 'change', callback: onSegmentChange });
|
|
1485
1501
|
segmentMediaQueryLists = [];
|
|
1486
1502
|
if (DEVICE_POSTURE_MEDIA_QUERY_LIST.media !== 'not all')
|
|
1487
1503
|
EventListener.remove(DEVICE_POSTURE_MEDIA_QUERY_LIST, { type: 'change', callback: onSegmentChange });
|
|
1488
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
|
+
}
|
|
1489
1521
|
function attachOnChange() {
|
|
1522
|
+
EventListener.add(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
1490
1523
|
if (hasSegmentsAPI) {
|
|
1491
|
-
|
|
1492
|
-
EventListener.add(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
1493
|
-
EventListener.add(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
1494
|
-
}
|
|
1495
|
-
else {
|
|
1496
|
-
attachCSSFallbackListeners();
|
|
1497
|
-
}
|
|
1524
|
+
attachDevicePostureChangeListener();
|
|
1498
1525
|
}
|
|
1499
1526
|
else if (hasLegacySegmentsAPI) {
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
EventListener.add(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
1527
|
+
attachVisualViewportResizeListener();
|
|
1528
|
+
attachDevicePostureChangeListener();
|
|
1503
1529
|
}
|
|
1504
1530
|
else {
|
|
1505
1531
|
getOrCreateCachedDiv();
|
|
1506
|
-
|
|
1532
|
+
attachVisualViewportResizeListener();
|
|
1507
1533
|
}
|
|
1508
1534
|
}
|
|
1509
1535
|
function detachOnChange() {
|
|
1536
|
+
EventListener.remove(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
1510
1537
|
if (hasSegmentsAPI) {
|
|
1511
|
-
|
|
1512
|
-
EventListener.remove(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
1513
|
-
EventListener.remove(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
1514
|
-
}
|
|
1515
|
-
else {
|
|
1516
|
-
detachCSSFallbackListeners();
|
|
1517
|
-
}
|
|
1538
|
+
detachDevicePostureChangeListener();
|
|
1518
1539
|
}
|
|
1519
1540
|
else if (hasLegacySegmentsAPI) {
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
EventListener.remove(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
1541
|
+
detachVisualViewportResizeListener();
|
|
1542
|
+
detachDevicePostureChangeListener();
|
|
1523
1543
|
}
|
|
1524
1544
|
else {
|
|
1525
|
-
|
|
1545
|
+
detachVisualViewportResizeListener();
|
|
1526
1546
|
releaseDiv();
|
|
1527
1547
|
}
|
|
1528
1548
|
}
|
|
@@ -1674,7 +1694,7 @@ function createViewportSegmentObserver() {
|
|
|
1674
1694
|
function applySegments(segments) {
|
|
1675
1695
|
for (var i = segments.length; i < lastCount; i++) {
|
|
1676
1696
|
for (var j = 0; j < attributes.length; j++) {
|
|
1677
|
-
element.style.removeProperty(
|
|
1697
|
+
element.style.removeProperty('--' + prefix + '-' + i + '-' + attributes[j]);
|
|
1678
1698
|
}
|
|
1679
1699
|
}
|
|
1680
1700
|
lastCount = segments.length;
|
|
@@ -1682,7 +1702,7 @@ function createViewportSegmentObserver() {
|
|
|
1682
1702
|
var segment = segments[i];
|
|
1683
1703
|
for (var j = 0; j < attributes.length; j++) {
|
|
1684
1704
|
var attribute = attributes[j];
|
|
1685
|
-
element.style.setProperty(
|
|
1705
|
+
element.style.setProperty('--' + prefix + '-' + i + '-' + attribute, segment[attribute] + 'px');
|
|
1686
1706
|
}
|
|
1687
1707
|
}
|
|
1688
1708
|
}
|
|
@@ -1694,7 +1714,7 @@ function createViewportSegmentObserver() {
|
|
|
1694
1714
|
unsubscribe();
|
|
1695
1715
|
for (var i = 0; i < lastCount; i++)
|
|
1696
1716
|
for (var j = 0; j < attributes.length; j++)
|
|
1697
|
-
element.style.removeProperty(
|
|
1717
|
+
element.style.removeProperty('--' + prefix + '-' + i + '-' + attributes[j]);
|
|
1698
1718
|
lastCount = 0;
|
|
1699
1719
|
};
|
|
1700
1720
|
}
|
|
@@ -1708,15 +1728,11 @@ function createViewportSegmentObserver() {
|
|
|
1708
1728
|
}
|
|
1709
1729
|
function createVirtualKeyboardObserver() {
|
|
1710
1730
|
var onChangeSubscriptionManager = createSubscriptionManager(attachOnChange, detachOnChange);
|
|
1711
|
-
var previousOverlaysContent = false;
|
|
1712
1731
|
function attachOnChange() {
|
|
1713
|
-
previousOverlaysContent = globalThis.navigator.virtualKeyboard.overlaysContent;
|
|
1714
|
-
globalThis.navigator.virtualKeyboard.overlaysContent = true;
|
|
1715
1732
|
EventListener.add(globalThis.navigator.virtualKeyboard, { type: 'geometrychange', callback: onGeometryChange, options: { passive: true } });
|
|
1716
1733
|
}
|
|
1717
1734
|
function detachOnChange() {
|
|
1718
1735
|
EventListener.remove(globalThis.navigator.virtualKeyboard, { type: 'geometrychange', callback: onGeometryChange, options: { passive: true } });
|
|
1719
|
-
globalThis.navigator.virtualKeyboard.overlaysContent = previousOverlaysContent;
|
|
1720
1736
|
}
|
|
1721
1737
|
function onGeometryChange() {
|
|
1722
1738
|
onChangeSubscriptionManager.emit(getValue());
|
|
@@ -1754,7 +1770,7 @@ function createVirtualKeyboardObserver() {
|
|
|
1754
1770
|
function applyValues(values) {
|
|
1755
1771
|
for (var i = 0; i < attributes.length; i++) {
|
|
1756
1772
|
var attribute = attributes[i];
|
|
1757
|
-
element.style.setProperty(
|
|
1773
|
+
element.style.setProperty('--' + prefix + '-' + attribute, values[attribute] + 'px');
|
|
1758
1774
|
}
|
|
1759
1775
|
}
|
|
1760
1776
|
applyValues(getValue());
|
|
@@ -1764,7 +1780,7 @@ function createVirtualKeyboardObserver() {
|
|
|
1764
1780
|
return function () {
|
|
1765
1781
|
unsubscribe();
|
|
1766
1782
|
for (var i = 0; i < attributes.length; i++)
|
|
1767
|
-
element.style.removeProperty(
|
|
1783
|
+
element.style.removeProperty('--' + prefix + '-' + attributes[i]);
|
|
1768
1784
|
};
|
|
1769
1785
|
}
|
|
1770
1786
|
return {
|
|
@@ -1953,7 +1969,7 @@ function createEnvironmentObserver(preset) {
|
|
|
1953
1969
|
function applyValues(values) {
|
|
1954
1970
|
for (var i = 0; i < attributes.length; i++) {
|
|
1955
1971
|
var attribute = attributes[i];
|
|
1956
|
-
element.style.setProperty(
|
|
1972
|
+
element.style.setProperty('--' + prefix + '-' + String(attributes[i]), values[attribute] + 'px');
|
|
1957
1973
|
}
|
|
1958
1974
|
}
|
|
1959
1975
|
var unsubscribe = onChangeSubscriptionManager.subscribe(function (values) {
|
|
@@ -1963,7 +1979,7 @@ function createEnvironmentObserver(preset) {
|
|
|
1963
1979
|
return function () {
|
|
1964
1980
|
unsubscribe();
|
|
1965
1981
|
for (var i = 0; i < attributes.length; i++)
|
|
1966
|
-
element.style.removeProperty(
|
|
1982
|
+
element.style.removeProperty('--' + prefix + '-' + String(attributes[i]));
|
|
1967
1983
|
};
|
|
1968
1984
|
}
|
|
1969
1985
|
return {
|
|
@@ -1985,109 +2001,6 @@ function createEnvironmentObserver(preset) {
|
|
|
1985
2001
|
};
|
|
1986
2002
|
}
|
|
1987
2003
|
|
|
1988
|
-
var safeAreaInsetObserver = createEnvironmentObserver('safe-area-inset');
|
|
1989
|
-
var safeAreaMaxInsetObserver = createEnvironmentObserver('safe-area-max-inset');
|
|
1990
|
-
var keyboardInsetObserver = createEnvironmentObserver('keyboard-inset');
|
|
1991
|
-
var titlebarAreaObserver = createEnvironmentObserver('titlebar-area');
|
|
1992
|
-
var viewportSegmentObserver = createEnvironmentObserver('viewport-segment');
|
|
1993
|
-
var onChangeSubscriptionManager$4 = createSubscriptionManager(attachOnChange$4, detachOnChange$4);
|
|
1994
|
-
var dimensionRef = null;
|
|
1995
|
-
var Dimension = {
|
|
1996
|
-
get value() {
|
|
1997
|
-
return getDimension();
|
|
1998
|
-
},
|
|
1999
|
-
environment: getEnvironment(),
|
|
2000
|
-
onChange: onChangeSubscriptionManager$4.subscribe,
|
|
2001
|
-
Constants: {
|
|
2002
|
-
Orientation: Orientation,
|
|
2003
|
-
},
|
|
2004
|
-
Errors: {},
|
|
2005
|
-
};
|
|
2006
|
-
function getOrientation() {
|
|
2007
|
-
if (typeof globalThis.screen !== 'undefined') {
|
|
2008
|
-
switch (globalThis.screen.orientation.type) {
|
|
2009
|
-
case 'portrait-primary':
|
|
2010
|
-
case 'portrait-secondary':
|
|
2011
|
-
return Orientation.Portrait;
|
|
2012
|
-
case 'landscape-primary':
|
|
2013
|
-
case 'landscape-secondary':
|
|
2014
|
-
return Orientation.Landscape;
|
|
2015
|
-
}
|
|
2016
|
-
}
|
|
2017
|
-
if (typeof globalThis.orientation !== 'undefined') {
|
|
2018
|
-
switch (globalThis.orientation) {
|
|
2019
|
-
case 0:
|
|
2020
|
-
case 180:
|
|
2021
|
-
return Orientation.Portrait;
|
|
2022
|
-
case 90:
|
|
2023
|
-
case 270:
|
|
2024
|
-
return Orientation.Landscape;
|
|
2025
|
-
}
|
|
2026
|
-
}
|
|
2027
|
-
if (ORIENTATION_MEDIA_QUERY_LIST.media === 'not all')
|
|
2028
|
-
return Orientation.Unknown;
|
|
2029
|
-
else if (ORIENTATION_MEDIA_QUERY_LIST.matches)
|
|
2030
|
-
return Orientation.Portrait;
|
|
2031
|
-
else
|
|
2032
|
-
return Orientation.Landscape;
|
|
2033
|
-
}
|
|
2034
|
-
function getScale() {
|
|
2035
|
-
if (typeof globalThis.devicePixelRatio !== 'undefined')
|
|
2036
|
-
return globalThis.devicePixelRatio;
|
|
2037
|
-
return -1;
|
|
2038
|
-
}
|
|
2039
|
-
function getEnvironment() {
|
|
2040
|
-
return {
|
|
2041
|
-
safeAreaInset: safeAreaInsetObserver,
|
|
2042
|
-
safeAreaMaxInset: safeAreaMaxInsetObserver,
|
|
2043
|
-
keyboardInset: keyboardInsetObserver,
|
|
2044
|
-
titlebarArea: titlebarAreaObserver,
|
|
2045
|
-
viewportSegment: viewportSegmentObserver,
|
|
2046
|
-
};
|
|
2047
|
-
}
|
|
2048
|
-
function getDimension() {
|
|
2049
|
-
var dimensions = {
|
|
2050
|
-
innerWidth: 0,
|
|
2051
|
-
innerHeight: 0,
|
|
2052
|
-
outerWidth: 0,
|
|
2053
|
-
outerHeight: 0,
|
|
2054
|
-
scale: getScale(),
|
|
2055
|
-
orientation: getOrientation(),
|
|
2056
|
-
};
|
|
2057
|
-
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
2058
|
-
dimensions.innerWidth = globalThis.innerWidth;
|
|
2059
|
-
dimensions.innerHeight = globalThis.innerHeight;
|
|
2060
|
-
dimensions.outerWidth = globalThis.outerWidth;
|
|
2061
|
-
dimensions.outerHeight = globalThis.outerHeight;
|
|
2062
|
-
}
|
|
2063
|
-
return dimensions;
|
|
2064
|
-
}
|
|
2065
|
-
function attachOnChange$4() {
|
|
2066
|
-
dimensionRef = getDimension();
|
|
2067
|
-
EventListener.add(globalThis, { type: 'resize', callback: onResize });
|
|
2068
|
-
if (typeof globalThis.screen.orientation.addEventListener === 'function')
|
|
2069
|
-
EventListener.add(globalThis.screen.orientation, { type: 'change', callback: onResize });
|
|
2070
|
-
else if (typeof globalThis.orientation !== 'undefined')
|
|
2071
|
-
EventListener.add(globalThis, { type: 'orientationChange', callback: onResize });
|
|
2072
|
-
else if (ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all')
|
|
2073
|
-
EventListener.add(ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback: onResize });
|
|
2074
|
-
}
|
|
2075
|
-
function detachOnChange$4() {
|
|
2076
|
-
dimensionRef = null;
|
|
2077
|
-
EventListener.remove(globalThis, { type: 'resize', callback: onResize });
|
|
2078
|
-
if (typeof globalThis.screen.orientation.removeEventListener === 'function')
|
|
2079
|
-
EventListener.remove(globalThis.screen.orientation, { type: 'change', callback: onResize });
|
|
2080
|
-
else if (typeof globalThis.orientation !== 'undefined')
|
|
2081
|
-
EventListener.remove(globalThis, { type: 'orientationChange', callback: onResize });
|
|
2082
|
-
else if (ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all')
|
|
2083
|
-
EventListener.remove(ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback: onResize });
|
|
2084
|
-
}
|
|
2085
|
-
function onResize() {
|
|
2086
|
-
var dimension = getDimension();
|
|
2087
|
-
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)
|
|
2088
|
-
onChangeSubscriptionManager$4.emit(dimensionRef = dimension);
|
|
2089
|
-
}
|
|
2090
|
-
|
|
2091
2004
|
function createCustomError(name, Base) {
|
|
2092
2005
|
if (Base === void 0) { Base = Error; }
|
|
2093
2006
|
function CustomError(message) {
|
|
@@ -2170,8 +2083,248 @@ function createCustomError(name, Base) {
|
|
|
2170
2083
|
return CustomError;
|
|
2171
2084
|
}
|
|
2172
2085
|
|
|
2086
|
+
var PermissionNotGrantedError = createCustomError('PermissionNotGrantedError');
|
|
2087
|
+
|
|
2173
2088
|
var NotSupportedError = createCustomError('NotSupportedError');
|
|
2174
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
|
+
|
|
2175
2328
|
var InvalidStateError = createCustomError('InvalidStateError');
|
|
2176
2329
|
|
|
2177
2330
|
var videoElement$1 = null;
|
|
@@ -2576,6 +2729,8 @@ var PermissionType;
|
|
|
2576
2729
|
PermissionType["ClipboardRead"] = "clipboard-read";
|
|
2577
2730
|
PermissionType["Microphone"] = "microphone";
|
|
2578
2731
|
PermissionType["MIDI"] = "midi";
|
|
2732
|
+
PermissionType["DeviceOrientation"] = "device-orientation";
|
|
2733
|
+
PermissionType["DeviceMotion"] = "device-motion";
|
|
2579
2734
|
})(PermissionType || (PermissionType = {}));
|
|
2580
2735
|
var PermissionState;
|
|
2581
2736
|
(function (PermissionState) {
|
|
@@ -2617,14 +2772,45 @@ var Permission = {
|
|
|
2617
2772
|
PermissionType: PermissionType,
|
|
2618
2773
|
PermissionState: PermissionState,
|
|
2619
2774
|
},
|
|
2620
|
-
Errors: {
|
|
2775
|
+
Errors: {
|
|
2776
|
+
NotSupportedError: NotSupportedError,
|
|
2777
|
+
},
|
|
2621
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
|
+
}
|
|
2622
2808
|
function supported$5() {
|
|
2623
2809
|
return typeof globalThis.navigator.permissions !== 'undefined';
|
|
2624
2810
|
}
|
|
2625
2811
|
function request$2(type) {
|
|
2626
2812
|
var instance = this;
|
|
2627
|
-
return new Promise(function (resolve) {
|
|
2813
|
+
return new Promise(function (resolve, reject) {
|
|
2628
2814
|
function resolveAfterCheck() {
|
|
2629
2815
|
instance.check(type).then(resolve);
|
|
2630
2816
|
}
|
|
@@ -2636,17 +2822,8 @@ function request$2(type) {
|
|
|
2636
2822
|
case PermissionType.Notification:
|
|
2637
2823
|
if (typeof globalThis.Notification === 'undefined')
|
|
2638
2824
|
return resolve(PermissionState.Unsupported);
|
|
2639
|
-
globalThis.Notification.requestPermission().then(function (
|
|
2640
|
-
|
|
2641
|
-
case 'default':
|
|
2642
|
-
return resolve(PermissionState.Prompt);
|
|
2643
|
-
case 'granted':
|
|
2644
|
-
return resolve(PermissionState.Grant);
|
|
2645
|
-
case 'denied':
|
|
2646
|
-
return resolve(PermissionState.Denied);
|
|
2647
|
-
default:
|
|
2648
|
-
resolveAfterCheck();
|
|
2649
|
-
}
|
|
2825
|
+
globalThis.Notification.requestPermission().then(function (permission) {
|
|
2826
|
+
resolve(toPermissionState(permission));
|
|
2650
2827
|
});
|
|
2651
2828
|
break;
|
|
2652
2829
|
case PermissionType.Geolocation:
|
|
@@ -2684,6 +2861,23 @@ function request$2(type) {
|
|
|
2684
2861
|
.then(resolveAfterCheck)
|
|
2685
2862
|
.catch(resolveAfterCheck);
|
|
2686
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;
|
|
2687
2881
|
default:
|
|
2688
2882
|
return resolve(PermissionState.Unsupported);
|
|
2689
2883
|
}
|
|
@@ -2691,6 +2885,34 @@ function request$2(type) {
|
|
|
2691
2885
|
});
|
|
2692
2886
|
}
|
|
2693
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
|
+
}
|
|
2694
2916
|
return new Promise(function (resolve) {
|
|
2695
2917
|
if (typeof globalThis.navigator.permissions === 'undefined')
|
|
2696
2918
|
return resolve(PermissionState.Unsupported);
|
|
@@ -2710,8 +2932,6 @@ function check(type) {
|
|
|
2710
2932
|
});
|
|
2711
2933
|
}
|
|
2712
2934
|
|
|
2713
|
-
var PermissionNotGrantedError = createCustomError('PermissionNotGrantedError');
|
|
2714
|
-
|
|
2715
2935
|
function request$1(url, options) {
|
|
2716
2936
|
return new Promise(function (resolve) {
|
|
2717
2937
|
var method = 'GET';
|