@nextcloud/vue
Version:
Nextcloud vue components
1 lines • 1.37 kB
Source Map (JSON)
{"version":3,"file":"useIsFullscreen.mjs","sources":["../../src/composables/useIsFullscreen/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport type { DeepReadonly, Ref } from 'vue'\n\nimport { readonly, ref } from 'vue'\n\nconst isFullscreen = ref(checkIfIsFullscreen())\n\nwindow.addEventListener('resize', () => {\n\tisFullscreen.value = checkIfIsFullscreen()\n})\n\n/**\n * If the window height is equal to the screen height,\n * we are in full screen mode.\n */\nfunction checkIfIsFullscreen(): boolean {\n\treturn window.outerHeight === window.screen.height\n}\n\n/**\n * Use global `isFullscreen` state, based on the screen height check.\n */\nexport function useIsFullscreen(): DeepReadonly<Ref<boolean>> {\n\treturn readonly(isFullscreen)\n}\n\n/**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsFullscreen` instead.\n * Defined and exported only for isFullscreen mixin.\n */\nexport const isFullscreenState = readonly(isFullscreen)\n"],"names":[],"mappings":";AAQA,MAAM,eAAe,IAAI,qBAAqB;AAE9C,OAAO,iBAAiB,UAAU,MAAM;AACvC,eAAa,QAAQ,oBAAA;AACtB,CAAC;AAMD,SAAS,sBAA+B;AACvC,SAAO,OAAO,gBAAgB,OAAO,OAAO;AAC7C;AAKO,SAAS,kBAA8C;AAC7D,SAAO,SAAS,YAAY;AAC7B;AAOO,MAAM,oBAAoB,SAAS,YAAY;"}