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