@vuepress/plugin-pwa 2.0.0-rc.122 → 2.0.0-rc.124

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.
Files changed (37) hide show
  1. package/lib/PwaInstallModal-DH0cwyM5.js +2 -0
  2. package/lib/PwaInstallModal-DH0cwyM5.js.map +1 -0
  3. package/lib/client/components/PwaFoundPopup.d.ts +21 -19
  4. package/lib/client/components/PwaFoundPopup.js +2 -2
  5. package/lib/client/components/PwaFoundPopup.js.map +1 -1
  6. package/lib/client/components/PwaInstall.d.ts +15 -15
  7. package/lib/client/components/PwaInstall.js +2 -2
  8. package/lib/client/components/PwaInstall.js.map +1 -1
  9. package/lib/client/components/PwaReadyPopup.d.ts +21 -19
  10. package/lib/client/components/PwaReadyPopup.js +2 -2
  11. package/lib/client/components/PwaReadyPopup.js.map +1 -1
  12. package/lib/client/composables/index.d.ts +19 -16
  13. package/lib/client/composables/index.js +1 -2
  14. package/lib/client/index.d.ts +16 -14
  15. package/lib/client/index.js +2 -2
  16. package/lib/client/index.js.map +1 -1
  17. package/lib/{client/icons-DQk7h1-3.js → icons-RRw4DIWa.js} +2 -2
  18. package/lib/icons-RRw4DIWa.js.map +1 -0
  19. package/lib/locales-BlsUewPq.d.ts +72 -0
  20. package/lib/node/index.d.ts +263 -327
  21. package/lib/node/index.js +18 -18
  22. package/lib/node/index.js.map +1 -1
  23. package/lib/setupViewPoint-DS4c13mS.js +2 -0
  24. package/lib/setupViewPoint-DS4c13mS.js.map +1 -0
  25. package/lib/skipWaiting-wM8NHpWa.js +2 -0
  26. package/lib/skipWaiting-wM8NHpWa.js.map +1 -0
  27. package/lib/types-CGDCqUfb.d.ts +8 -0
  28. package/package.json +31 -27
  29. package/lib/client/PwaReadyPopup-Crl_YRc0.js +0 -2
  30. package/lib/client/PwaReadyPopup-Crl_YRc0.js.map +0 -1
  31. package/lib/client/composables/index.js.map +0 -1
  32. package/lib/client/icons-DQk7h1-3.js.map +0 -1
  33. package/lib/client/index-B2tGW6v2.js +0 -2
  34. package/lib/client/index-B2tGW6v2.js.map +0 -1
  35. package/lib/client/types-B0Ty8tPv.d.ts +0 -74
  36. package/lib/client/usePwaEvent-CUDY9qle.js +0 -2
  37. package/lib/client/usePwaEvent-CUDY9qle.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{n as e,r as t,t as n}from"./icons-RRw4DIWa.js";import{useLocale as r}from"@vuepress/helper/client";import{useEventListener as i}from"@vueuse/core";import{defineComponent as a,h as o,onMounted as s,shallowRef as c}from"vue";import{withBase as l}from"vuepress/client";const u=()=>{let e=document.querySelector(`.screenshot`);e&&e.scrollBy({left:-e.clientWidth,top:0,behavior:`smooth`})},d=()=>{let e=document.querySelector(`.screenshot`);e&&e.scrollBy({left:e.clientWidth,top:0,behavior:`smooth`})},f=a({name:`PwaInstallModal`,props:{locales:{type:Object,required:!0},useHint:Boolean},emits:[`canInstall`,`hint`,`close`],setup(a,{emit:f}){let p=r(a.locales),m=c({}),h=c(),g=async()=>{let e=localStorage.getItem(`manifest`);if(e)m.value=JSON.parse(e);else try{let e=await(await fetch(l(`manifest.webmanifest`))).json();m.value=e,localStorage.setItem(`manifest`,JSON.stringify(e))}catch{console.error(`[PWA]: Error getting manifest, check that you have a valid web manifest or network connection`)}},_=async()=>{h.value&&(h.value.prompt(),document.dispatchEvent(new CustomEvent(`show`)),(await h.value.userChoice).outcome===`accepted`?(console.info(`PWA has been installed`),f(`close`,!1),f(`canInstall`,!1)):(console.info(`You choose to not install PWA`),f(`close`,!1),f(`canInstall`,!1)))},v=()=>{console.info(`You accepted the install hint`),f(`hint`)};return s(()=>{window.hasOwnProperty(`BeforeInstallPromptEvent`)&&(i(window,`beforeinstallprompt`,e=>{h.value=e,f(`canInstall`,!0),e.preventDefault()}),i(`keyup`,e=>{e.key===`Escape`&&f(`close`,!1)},{passive:!0}),g())}),()=>o(`div`,{id:`install-modal-wrapper`},[o(`div`,{class:`background`,onClick:()=>{f(`close`,!1)}}),o(`div`,{class:`install-modal`},[o(`div`,{class:`header`},[o(`button`,{type:`button`,class:`close-button`,"aria-label":p.value.close,onClick:()=>{f(`close`,!1)}},o(t)),o(`div`,{class:`logo`},[m.value.icons?o(`img`,{src:m.value.icons[0]?.src,alt:`App Logo`}):null,o(`div`,{class:`title`},[o(`h1`,m.value.short_name||m.value.name),o(`p`,{class:`desc`},p.value.explain)])])]),o(`div`,{class:`content`},[o(`div`,{class:`highlight`},[m.value.features?o(`div`,{class:`feature-wrapper`},[o(`h3`,p.value.feature),o(`ul`,m.value.features.map(e=>o(`li`,e)))]):null,m.value.screenshots?o(`div`,{class:`screenshot-wrapper`},[o(`button`,{type:`button`,"aria-label":p.value.prevImage,onClick:u},o(n)),o(`section`,{class:`screenshot`},[m.value.screenshots.map(e=>o(`div`,o(`img`,{src:e.src,alt:`App Screenshot`})))]),o(`button`,{type:`button`,"aria-label":p.value.nextImage,onClick:d},o(e))]):null]),o(`div`,{class:`description`},[o(`h3`,p.value.desc),o(`p`,m.value.description)])]),a.useHint?o(`div`,{class:`ios-text`,onClick:v},[o(`p`,p.value.iOSInstall),o(`button`,{type:`button`,class:`success`},`Got it!`)]):o(`div`,{class:`button-wrapper`},[o(`button`,{type:`button`,class:`install-button`,onClick:_},[p.value.install,o(`span`,m.value.short_name)]),o(`button`,{type:`button`,class:`cancel-button`,onClick:()=>{f(`close`,!1)}},p.value.cancel)])])])}});export{f as t};
2
+ //# sourceMappingURL=PwaInstallModal-DH0cwyM5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PwaInstallModal-DH0cwyM5.js","names":[],"sources":["../src/client/components/PwaInstallModal.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { useLocale } from '@vuepress/helper/client'\nimport { useEventListener } from '@vueuse/core'\nimport type { PropType, VNode } from 'vue'\nimport { defineComponent, h, onMounted, shallowRef } from 'vue'\nimport { withBase } from 'vuepress/client'\nimport type { AppManifest } from '../../shared/index.js'\nimport type { PwaPluginLocaleConfig } from '../types.js'\nimport { ArrowLeftIcon, ArrowRightIcon, CloseIcon } from './icons.js'\n\ninterface InstallPromptEvent extends Event {\n readonly platforms: string\n prompt: () => void\n readonly userChoice: Promise<{ outcome: 'accepted' | 'dismissed' }>\n}\n\nconst scrollToLeft = (): void => {\n const screenshotsDiv = document.querySelector('.screenshot')\n\n if (screenshotsDiv) {\n screenshotsDiv.scrollBy({\n left: -screenshotsDiv.clientWidth,\n top: 0,\n behavior: 'smooth',\n })\n }\n}\n\nconst scrollToRight = (): void => {\n const screenshotsDiv = document.querySelector('.screenshot')\n\n if (screenshotsDiv) {\n screenshotsDiv.scrollBy({\n left: screenshotsDiv.clientWidth,\n top: 0,\n behavior: 'smooth',\n })\n }\n}\n\nexport const PwaInstallModal = defineComponent({\n name: 'PwaInstallModal',\n\n props: {\n /** locale data */\n locales: {\n type: Object as PropType<PwaPluginLocaleConfig>,\n required: true,\n },\n\n /**\n * Whether use hint message instead of showing a button\n *\n * 是否使用提示\n */\n useHint: Boolean,\n },\n\n emits: ['canInstall', 'hint', 'close'],\n\n setup(props, { emit }) {\n const locale = useLocale(props.locales)\n\n const manifest = shallowRef<AppManifest>({})\n const deferredPrompt = shallowRef<InstallPromptEvent>()\n\n const getManifest = async (): Promise<void> => {\n const manifestContent = localStorage.getItem('manifest')\n\n if (manifestContent) {\n manifest.value = JSON.parse(manifestContent) as AppManifest\n } else {\n try {\n const response = await fetch(withBase('manifest.webmanifest'))\n const data = (await response.json()) as AppManifest\n\n manifest.value = data\n localStorage.setItem('manifest', JSON.stringify(data))\n } catch {\n console.error(\n '[PWA]: Error getting manifest, check that you have a valid web manifest or network connection',\n )\n }\n }\n }\n\n const install = async (): Promise<void> => {\n if (deferredPrompt.value) {\n deferredPrompt.value.prompt()\n\n document.dispatchEvent(new CustomEvent('show'))\n\n const choiceResult = await deferredPrompt.value.userChoice\n\n if (choiceResult.outcome === 'accepted') {\n console.info('PWA has been installed')\n\n emit('close', false)\n emit('canInstall', false)\n } else {\n console.info('You choose to not install PWA')\n\n emit('close', false)\n emit('canInstall', false)\n }\n }\n }\n\n const hint = (): void => {\n console.info('You accepted the install hint')\n emit('hint')\n }\n\n onMounted(() => {\n // eslint-disable-next-line no-prototype-builtins\n if (window.hasOwnProperty('BeforeInstallPromptEvent')) {\n useEventListener(window, 'beforeinstallprompt', (event) => {\n deferredPrompt.value = event as InstallPromptEvent\n\n emit('canInstall', true)\n event.preventDefault()\n })\n\n useEventListener(\n 'keyup',\n (event): void => {\n if (event.key === 'Escape') emit('close', false)\n },\n { passive: true },\n )\n\n void getManifest()\n }\n })\n\n return (): VNode =>\n h('div', { id: 'install-modal-wrapper' }, [\n h('div', {\n class: 'background',\n onClick: () => {\n emit('close', false)\n },\n }),\n\n h('div', { class: 'install-modal' }, [\n h('div', { class: 'header' }, [\n // close button\n h(\n 'button',\n {\n 'type': 'button',\n 'class': 'close-button',\n 'aria-label': locale.value.close,\n 'onClick': () => {\n emit('close', false)\n },\n },\n h(CloseIcon),\n ),\n\n h('div', { class: 'logo' }, [\n manifest.value.icons\n ? h('img', {\n src: manifest.value.icons[0]?.src,\n alt: 'App Logo',\n })\n : null,\n h('div', { class: 'title' }, [\n h('h1', manifest.value.short_name || manifest.value.name),\n h('p', { class: 'desc' }, locale.value.explain),\n ]),\n ]),\n ]),\n\n h('div', { class: 'content' }, [\n h('div', { class: 'highlight' }, [\n manifest.value.features\n ? h('div', { class: 'feature-wrapper' }, [\n h('h3', locale.value.feature),\n h(\n 'ul',\n manifest.value.features.map((feature) =>\n h('li', feature),\n ),\n ),\n ])\n : null,\n\n manifest.value.screenshots\n ? h('div', { class: 'screenshot-wrapper' }, [\n h(\n 'button',\n {\n 'type': 'button',\n 'aria-label': locale.value.prevImage,\n 'onClick': scrollToLeft,\n },\n h(ArrowLeftIcon),\n ),\n h('section', { class: 'screenshot' }, [\n manifest.value.screenshots.map((screenshot) =>\n h(\n 'div',\n h('img', {\n src: screenshot.src,\n alt: 'App Screenshot',\n }),\n ),\n ),\n ]),\n h(\n 'button',\n {\n 'type': 'button',\n 'aria-label': locale.value.nextImage,\n 'onClick': scrollToRight,\n },\n h(ArrowRightIcon),\n ),\n ])\n : null,\n ]),\n\n h('div', { class: 'description' }, [\n h('h3', locale.value.desc),\n h('p', manifest.value.description),\n ]),\n ]),\n\n props.useHint\n ? h('div', { class: 'ios-text', onClick: hint }, [\n h('p', locale.value.iOSInstall),\n h('button', { type: 'button', class: 'success' }, 'Got it!'),\n ])\n : h('div', { class: 'button-wrapper' }, [\n h(\n 'button',\n { type: 'button', class: 'install-button', onClick: install },\n [locale.value.install, h('span', manifest.value.short_name)],\n ),\n h(\n 'button',\n {\n type: 'button',\n class: 'cancel-button',\n onClick: () => {\n emit('close', false)\n },\n },\n locale.value.cancel,\n ),\n ]),\n ]),\n ])\n },\n})\n"],"mappings":"iRAgBA,MAAM,MAA2B,CAC/B,IAAM,EAAiB,SAAS,cAAc,cAAc,CAExD,GACF,EAAe,SAAS,CACtB,KAAM,CAAC,EAAe,YACtB,IAAK,EACL,SAAU,SACX,CAAC,EAIA,MAA4B,CAChC,IAAM,EAAiB,SAAS,cAAc,cAAc,CAExD,GACF,EAAe,SAAS,CACtB,KAAM,EAAe,YACrB,IAAK,EACL,SAAU,SACX,CAAC,EAIO,EAAkB,EAAgB,CAC7C,KAAM,kBAEN,MAAO,CAEL,QAAS,CACP,KAAM,OACN,SAAU,GACX,CAOD,QAAS,QACV,CAED,MAAO,CAAC,aAAc,OAAQ,QAAQ,CAEtC,MAAM,EAAO,CAAE,QAAQ,CACrB,IAAM,EAAS,EAAU,EAAM,QAAQ,CAEjC,EAAW,EAAwB,EAAE,CAAC,CACtC,EAAiB,GAAgC,CAEjD,EAAc,SAA2B,CAC7C,IAAM,EAAkB,aAAa,QAAQ,WAAW,CAExD,GAAI,EACF,EAAS,MAAQ,KAAK,MAAM,EAAgB,MAE5C,GAAI,CAEF,IAAM,EAAQ,MADG,MAAM,MAAM,EAAS,uBAAuB,CAAC,EACjC,MAAM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AE,CACpC,EACE,SACA,CAAE,KAAM,SAAU,MAAO,iBAAkB,QAAS,EAAS,CAC7D,CAAC,EAAO,MAAM,QAAS,EAAE,OAAQ,EAAS,MAAM,WAAW,CAAC,CAC7D,CACD,EACE,SACA,CACE,KAAM,SACN,MAAO,gBACP,YAAe,CACb,EAAK,QAAS,GAAM,EAEvB,CACD,EAAO,MAAM,OACd,CACF,CAAC,CACP,CAAC,CACH,CAAC,EAEP,CAAC"}
@@ -1,25 +1,27 @@
1
- import * as vue from 'vue';
2
- import { PropType, VNode, SlotsType } from 'vue';
3
- import { Slot } from '@vuepress/helper/client';
4
- import { P as PwaPluginLocaleConfig } from '../types-B0Ty8tPv.js';
1
+ import { t as PwaPluginLocaleConfig } from "../../types-CGDCqUfb.js";
2
+ import { Slot } from "@vuepress/helper/client";
3
+ import * as vue from "vue";
4
+ import { PropType, SlotsType, VNode } from "vue";
5
+ import "@vuepress/helper/transition/fade-in-scale-up.css";
6
+ import "../styles/popup.css";
5
7
 
8
+ //#region src/client/components/PwaFoundPopup.d.ts
6
9
  declare const PwaFoundPopup: vue.DefineComponent<vue.ExtractPropTypes<{
7
- /** locale data */
8
- locales: {
9
- type: PropType<PwaPluginLocaleConfig>;
10
- required: true;
11
- };
10
+ /** locale data */locales: {
11
+ type: PropType<PwaPluginLocaleConfig>;
12
+ required: true;
13
+ };
12
14
  }>, () => VNode, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
13
- /** locale data */
14
- locales: {
15
- type: PropType<PwaPluginLocaleConfig>;
16
- required: true;
17
- };
15
+ /** locale data */locales: {
16
+ type: PropType<PwaPluginLocaleConfig>;
17
+ required: true;
18
+ };
18
19
  }>> & Readonly<{}>, {}, SlotsType<{
19
- default?: Slot<{
20
- found: boolean;
21
- refresh: () => void;
22
- }>;
20
+ default?: Slot<{
21
+ found: boolean;
22
+ refresh: () => void;
23
+ }>;
23
24
  }>, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
24
-
25
+ //#endregion
25
26
  export { PwaFoundPopup };
27
+ //# sourceMappingURL=PwaFoundPopup.d.ts.map
@@ -1,2 +1,2 @@
1
- import{useLocale as p}from"@vuepress/helper/client";import{defineComponent as l,ref as i,onMounted as c,h as o,Transition as d}from"vue";import{U as f}from"../icons-DQk7h1-3.js";import"@vuepress/helper/transition/fade-in-scale-up.css";import"../styles/popup.css";import{u as m}from"../usePwaEvent-CUDY9qle.js";const v=l({name:"PwaFoundPopup",props:{locales:{type:Object,required:!0}},slots:Object,setup(n,{slots:r}){const u=p(n.locales),e=i(!1),t=()=>{e.value&&(window.location.reload(!0),e.value=!1)};return c(()=>{const a=m();a.on("updatefound",()=>{navigator.serviceWorker.getRegistration().then(s=>{s?.active&&(e.value=!0)})}),a.on("updated",()=>{e.value=!1})}),()=>o(d,{name:"fade-in-scale-up"},()=>r.default?.({found:e.value,refresh:t})??(e.value?o("button",{type:"button",class:"sw-hint-popup",tabindex:0,onClick:()=>{t()}},[u.value.hint,o("span",{class:"icon-wrapper"},o(f))]):null))}});export{v as PwaFoundPopup};
2
- //# sourceMappingURL=PwaFoundPopup.js.map
1
+ import{i as e}from"../../icons-RRw4DIWa.js";import{a as t}from"../../setupViewPoint-DS4c13mS.js";import{useLocale as n}from"@vuepress/helper/client";import{Transition as r,defineComponent as i,h as a,onMounted as o,ref as s}from"vue";import"@vuepress/helper/transition/fade-in-scale-up.css";import"../styles/popup.css";const c=i({name:`PwaFoundPopup`,props:{locales:{type:Object,required:!0}},slots:Object,setup(i,{slots:c}){let l=n(i.locales),u=s(!1),d=()=>{u.value&&=(window.location.reload(!0),!1)};return o(()=>{let e=t();e.on(`updatefound`,()=>{navigator.serviceWorker.getRegistration().then(e=>{e?.active&&(u.value=!0)})}),e.on(`updated`,()=>{u.value=!1})}),()=>a(r,{name:`fade-in-scale-up`},()=>c.default?.({found:u.value,refresh:d})??(u.value?a(`button`,{type:`button`,class:`sw-hint-popup`,tabindex:0,onClick:()=>{d()}},[l.value.hint,a(`span`,{class:`icon-wrapper`},a(e))]):null))}});export{c as PwaFoundPopup};
2
+ //# sourceMappingURL=PwaFoundPopup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PwaFoundPopup.js","sources":["../../../src/client/components/PwaFoundPopup.ts"],"sourcesContent":["import type { Slot } from '@vuepress/helper/client'\nimport { useLocale } from '@vuepress/helper/client'\nimport type { PropType, SlotsType, VNode } from 'vue'\nimport { Transition, defineComponent, h, onMounted, ref } from 'vue'\nimport { usePwaEvent } from '../composables/index.js'\nimport type { PwaPluginLocaleConfig } from '../types.js'\nimport { UpdateIcon } from './icons.js'\n\nimport '@vuepress/helper/transition/fade-in-scale-up.css'\nimport '../styles/popup.css'\n\nexport const PwaFoundPopup = defineComponent({\n name: 'PwaFoundPopup',\n\n props: {\n /** locale data */\n locales: {\n type: Object as PropType<PwaPluginLocaleConfig>,\n required: true,\n },\n },\n\n slots: Object as SlotsType<{\n default?: Slot<{ found: boolean; refresh: () => void }>\n }>,\n\n setup(props, { slots }) {\n const locale = useLocale(props.locales)\n const found = ref(false)\n\n const refresh = (): void => {\n if (found.value) {\n // force refresh\n // @ts-expect-error: A non-standard API\n window.location.reload(true)\n found.value = false\n }\n }\n\n onMounted(() => {\n const event = usePwaEvent()\n\n event.on('updatefound', () => {\n void navigator.serviceWorker.getRegistration().then((registration) => {\n // Check whether a valid service worker is active\n if (registration?.active) found.value = true\n })\n })\n\n event.on('updated', () => {\n found.value = false\n })\n })\n\n return (): VNode =>\n h(\n Transition,\n { name: 'fade-in-scale-up' },\n () =>\n slots.default?.({\n found: found.value,\n refresh,\n }) ??\n (found.value\n ? h(\n 'button',\n {\n type: 'button',\n class: 'sw-hint-popup',\n tabindex: 0,\n onClick: () => {\n refresh()\n },\n },\n [\n locale.value.hint,\n h('span', { class: 'icon-wrapper' }, h(UpdateIcon)),\n ],\n )\n : null),\n )\n },\n})\n"],"names":["PwaFoundPopup","defineComponent","props","slots","locale","useLocale","found","ref","refresh","onMounted","event","usePwaEvent","registration","h","Transition","UpdateIcon"],"mappings":"sTAWO,MAAMA,EAAgBC,EAAgB,CAC3C,KAAM,gBAEN,MAAO,CAEL,QAAS,CACP,KAAM,OACN,SAAU,EACZ,CACF,EAEA,MAAO,OAIP,MAAMC,EAAO,CAAE,MAAAC,CAAM,EAAG,CACtB,MAAMC,EAASC,EAAUH,EAAM,OAAO,EAChCI,EAAQC,EAAI,EAAK,EAEjBC,EAAU,IAAY,CACtBF,EAAM,QAGR,OAAO,SAAS,OAAO,EAAI,EAC3BA,EAAM,MAAQ,GAElB,EAEA,OAAAG,EAAU,IAAM,CACd,MAAMC,EAAQC,EAAAA,EAEdD,EAAM,GAAG,cAAe,IAAM,CACvB,UAAU,cAAc,kBAAkB,KAAME,GAAiB,CAEhEA,GAAc,SAAQN,EAAM,MAAQ,GAC1C,CAAC,CACH,CAAC,EAEDI,EAAM,GAAG,UAAW,IAAM,CACxBJ,EAAM,MAAQ,EAChB,CAAC,CACH,CAAC,EAEM,IACLO,EACEC,EACA,CAAE,KAAM,kBAAmB,EAC3B,IACEX,EAAM,UAAU,CACd,MAAOG,EAAM,MACb,QAAAE,CACF,CAAC,IACAF,EAAM,MACHO,EACE,SACA,CACE,KAAM,SACN,MAAO,gBACP,SAAU,EACV,QAAS,IAAM,CACbL,GACF,CACF,EACA,CACEJ,EAAO,MAAM,KACbS,EAAE,OAAQ,CAAE,MAAO,cAAe,EAAGA,EAAEE,CAAU,CAAC,CACpD,CACF,EACA,KACR,CACJ,CACF,CAAC"}
1
+ {"version":3,"file":"PwaFoundPopup.js","names":[],"sources":["../../../src/client/components/PwaFoundPopup.ts"],"sourcesContent":["import type { Slot } from '@vuepress/helper/client'\nimport { useLocale } from '@vuepress/helper/client'\nimport type { PropType, SlotsType, VNode } from 'vue'\nimport { Transition, defineComponent, h, onMounted, ref } from 'vue'\nimport { usePwaEvent } from '../composables/index.js'\nimport type { PwaPluginLocaleConfig } from '../types.js'\nimport { UpdateIcon } from './icons.js'\n\nimport '@vuepress/helper/transition/fade-in-scale-up.css'\nimport '../styles/popup.css'\n\nexport const PwaFoundPopup = defineComponent({\n name: 'PwaFoundPopup',\n\n props: {\n /** locale data */\n locales: {\n type: Object as PropType<PwaPluginLocaleConfig>,\n required: true,\n },\n },\n\n slots: Object as SlotsType<{\n default?: Slot<{ found: boolean; refresh: () => void }>\n }>,\n\n setup(props, { slots }) {\n const locale = useLocale(props.locales)\n const found = ref(false)\n\n const refresh = (): void => {\n if (found.value) {\n // force refresh\n // @ts-expect-error: A non-standard API\n window.location.reload(true)\n found.value = false\n }\n }\n\n onMounted(() => {\n const event = usePwaEvent()\n\n event.on('updatefound', () => {\n void navigator.serviceWorker.getRegistration().then((registration) => {\n // Check whether a valid service worker is active\n if (registration?.active) found.value = true\n })\n })\n\n event.on('updated', () => {\n found.value = false\n })\n })\n\n return (): VNode =>\n h(\n Transition,\n { name: 'fade-in-scale-up' },\n () =>\n slots.default?.({\n found: found.value,\n refresh,\n }) ??\n (found.value\n ? h(\n 'button',\n {\n type: 'button',\n class: 'sw-hint-popup',\n tabindex: 0,\n onClick: () => {\n refresh()\n },\n },\n [\n locale.value.hint,\n h('span', { class: 'icon-wrapper' }, h(UpdateIcon)),\n ],\n )\n : null),\n )\n },\n})\n"],"mappings":"+TAWA,MAAa,EAAgB,EAAgB,CAC3C,KAAM,gBAEN,MAAO,CAEL,QAAS,CACP,KAAM,OACN,SAAU,GACX,CACF,CAED,MAAO,OAIP,MAAM,EAAO,CAAE,SAAS,CACtB,IAAM,EAAS,EAAU,EAAM,QAAQ,CACjC,EAAQ,EAAI,GAAM,CAElB,MAAsB,CAC1B,AAIE,EAAM,SADN,OAAO,SAAS,OAAO,GAAK,CACd,KAmBlB,OAfA,MAAgB,CACd,IAAM,EAAQ,GAAa,CAE3B,EAAM,GAAG,kBAAqB,CACvB,UAAU,cAAc,iBAAiB,CAAC,KAAM,GAAiB,CAEhE,GAAc,SAAQ,EAAM,MAAQ,KACxC,EACF,CAEF,EAAM,GAAG,cAAiB,CACxB,EAAM,MAAQ,IACd,EACF,KAGA,EACE,EACA,CAAE,KAAM,mBAAoB,KAE1B,EAAM,UAAU,CACd,MAAO,EAAM,MACb,UACD,CAAC,GACD,EAAM,MACH,EACE,SACA,CACE,KAAM,SACN,MAAO,gBACP,SAAU,EACV,YAAe,CACb,GAAS,EAEZ,CACD,CACE,EAAO,MAAM,KACb,EAAE,OAAQ,CAAE,MAAO,eAAgB,CAAE,EAAE,EAAW,CAAC,CACpD,CACF,CACD,MACP,EAEN,CAAC"}
@@ -1,20 +1,20 @@
1
- import * as vue from 'vue';
2
- import { PropType, VNode } from 'vue';
3
- import { P as PwaPluginLocaleConfig } from '../types-B0Ty8tPv.js';
4
- import '@vuepress/helper/client';
1
+ import { t as PwaPluginLocaleConfig } from "../../types-CGDCqUfb.js";
2
+ import * as vue from "vue";
3
+ import { PropType, VNode } from "vue";
4
+ import "../styles/modal.css";
5
5
 
6
+ //#region src/client/components/PwaInstall.d.ts
6
7
  declare const PwaInstall: vue.DefineComponent<vue.ExtractPropTypes<{
7
- /** locale data */
8
- locales: {
9
- type: PropType<PwaPluginLocaleConfig>;
10
- required: true;
11
- };
8
+ /** locale data */locales: {
9
+ type: PropType<PwaPluginLocaleConfig>;
10
+ required: true;
11
+ };
12
12
  }>, () => VNode, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
13
- /** locale data */
14
- locales: {
15
- type: PropType<PwaPluginLocaleConfig>;
16
- required: true;
17
- };
13
+ /** locale data */locales: {
14
+ type: PropType<PwaPluginLocaleConfig>;
15
+ required: true;
16
+ };
18
17
  }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
19
-
18
+ //#endregion
20
19
  export { PwaInstall };
20
+ //# sourceMappingURL=PwaInstall.d.ts.map
@@ -1,2 +1,2 @@
1
- import{useLocale as h}from"@vuepress/helper/client";import{useEventListener as f,useToggle as C}from"@vueuse/core";import{defineComponent as g,shallowRef as b,onMounted as w,h as e,ref as u,computed as y}from"vue";import{withBase as k}from"vuepress/client";import{C as P,A as S,a as A}from"../icons-DQk7h1-3.js";import"../styles/modal.css";const O=g({name:"PwaInstallModal",props:{locales:{type:Object,required:!0},useHint:Boolean},emits:["canInstall","hint","close"],setup(c,{emit:l}){const s=h(c.locales),t=b({}),n=b(),r=async()=>{const a=localStorage.getItem("manifest");if(a)t.value=JSON.parse(a);else try{const m=await(await fetch(k("manifest.webmanifest"))).json();t.value=m,localStorage.setItem("manifest",JSON.stringify(m))}catch{console.error("[PWA]: Error getting manifest, check that you have a valid web manifest or network connection")}},v=()=>{const a=document.querySelector(".screenshot");a&&a.scrollBy({left:-a.clientWidth,top:0,behavior:"smooth"})},p=()=>{const a=document.querySelector(".screenshot");a&&a.scrollBy({left:a.clientWidth,top:0,behavior:"smooth"})},i=async()=>{n.value&&(n.value.prompt(),document.dispatchEvent(new CustomEvent("show")),(await n.value.userChoice).outcome==="accepted"?(console.info("PWA has been installed"),l("close",!1),l("canInstall",!1)):(console.info("You choose to not install PWA"),l("close",!1),l("canInstall",!1)))},d=()=>{console.info("You accepted the install hint"),l("hint")};return w(()=>{window.hasOwnProperty("BeforeInstallPromptEvent")&&(f(window,"beforeinstallprompt",a=>{n.value=a,l("canInstall",!0),a.preventDefault()}),f("keyup",a=>{a.key==="Escape"&&l("close",!1)},{passive:!0}),r())}),()=>e("div",{id:"install-modal-wrapper"},[e("div",{class:"background",onClick:()=>{l("close",!1)}}),e("div",{class:"install-modal"},[e("div",{class:"header"},[e("button",{type:"button",class:"close-button","aria-label":s.value.close,onClick:()=>{l("close",!1)}},e(P)),e("div",{class:"logo"},[t.value.icons?e("img",{src:t.value.icons[0]?.src,alt:"App Logo"}):null,e("div",{class:"title"},[e("h1",t.value.short_name||t.value.name),e("p",{class:"desc"},s.value.explain)])])]),e("div",{class:"content"},[e("div",{class:"highlight"},[t.value.features?e("div",{class:"feature-wrapper"},[e("h3",s.value.feature),e("ul",t.value.features.map(a=>e("li",a)))]):null,t.value.screenshots?e("div",{class:"screenshot-wrapper"},[e("button",{type:"button","aria-label":s.value.prevImage,onClick:v},e(S)),e("section",{class:"screenshot"},[t.value.screenshots.map(a=>e("div",e("img",{src:a.src,alt:"App Screenshot"})))]),e("button",{type:"button","aria-label":s.value.nextImage,onClick:p},e(A))]):null]),e("div",{class:"description"},[e("h3",s.value.desc),e("p",t.value.description)])]),c.useHint?e("div",{class:"ios-text",onClick:d},[e("p",s.value.iOSInstall),e("button",{type:"button",class:"success"},"Got it!")]):e("div",{class:"button-wrapper"},[e("button",{type:"button",class:"install-button",onClick:i},[s.value.install,e("span",t.value.short_name)]),e("button",{type:"button",class:"cancel-button",onClick:()=>{l("close",!1)}},s.value.cancel)])])])}}),x=g({name:"PwaInstall",props:{locales:{type:Object,required:!0}},setup(c){const l=h(c.locales),[s,t]=C(),n=u(!1),r=u(!1),v=u(!1),p=u(!1),i=u(!1),d=y(()=>v.value&&p.value&&!i.value),a=y(()=>r.value&&n.value||d.value),m=()=>navigator.standalone?navigator.standalone:matchMedia("(display-mode: standalone)").matches,I=()=>{t(!1),i.value=!0,localStorage.setItem("iOS-pwa-hint","hinted")};return w(()=>{if(m()){const{userAgent:o}=navigator;v.value=o.includes("iPhone")||o.includes("iPad")||!!(o.includes("Macintosh")&&navigator.maxTouchPoints&&navigator.maxTouchPoints>2),p.value=navigator.userAgent.includes("Safari")&&!o.includes("Chrome"),i.value=!!localStorage.getItem("iOS-pwa-hint")}"getInstalledRelatedApps"in navigator&&navigator.getInstalledRelatedApps().then(o=>{r.value=o.length>0})}),()=>e("div",{id:"pwa-install"},[a.value?e("button",{type:"button",class:"modal-button",onClick:()=>{t(!0)}},l.value.install):null,e(O,{style:{display:s.value?"block":"none"},locales:c.locales,useHint:d.value,onCanInstall:o=>{n.value=o},onHint:()=>{I()},onClose:()=>t(!1)})])}});export{x as PwaInstall};
2
- //# sourceMappingURL=PwaInstall.js.map
1
+ import{t as e}from"../../PwaInstallModal-DH0cwyM5.js";import{useLocale as t}from"@vuepress/helper/client";import{useToggle as n}from"@vueuse/core";import{computed as r,defineComponent as i,h as a,onMounted as o,ref as s}from"vue";import"../styles/modal.css";const c=i({name:`PwaInstall`,props:{locales:{type:Object,required:!0}},setup(i){let c=t(i.locales),[l,u]=n(),d=s(!1),f=s(!1),p=s(!1),m=s(!1),h=s(!1),g=r(()=>p.value&&m.value&&!h.value),_=r(()=>f.value&&d.value||g.value),v=()=>navigator.standalone?navigator.standalone:matchMedia(`(display-mode: standalone)`).matches,y=()=>{u(!1),h.value=!0,localStorage.setItem(`iOS-pwa-hint`,`hinted`)};return o(()=>{if(v()){let{userAgent:e}=navigator;p.value=e.includes(`iPhone`)||e.includes(`iPad`)||!!(e.includes(`Macintosh`)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>2),m.value=navigator.userAgent.includes(`Safari`)&&!e.includes(`Chrome`),h.value=!!localStorage.getItem(`iOS-pwa-hint`)}`getInstalledRelatedApps`in navigator&&navigator.getInstalledRelatedApps().then(e=>{f.value=e.length>0})}),()=>a(`div`,{id:`pwa-install`},[_.value?a(`button`,{type:`button`,class:`modal-button`,onClick:()=>{u(!0)}},c.value.install):null,a(e,{style:{display:l.value?`block`:`none`},locales:i.locales,useHint:g.value,onCanInstall:e=>{d.value=e},onHint:()=>{y()},onClose:()=>u(!1)})])}});export{c as PwaInstall};
2
+ //# sourceMappingURL=PwaInstall.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PwaInstall.js","sources":["../../../src/client/components/PwaInstallModal.ts","../../../src/client/components/PwaInstall.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { useLocale } from '@vuepress/helper/client'\nimport { useEventListener } from '@vueuse/core'\nimport type { PropType, VNode } from 'vue'\nimport { defineComponent, h, onMounted, shallowRef } from 'vue'\nimport { withBase } from 'vuepress/client'\nimport type { AppManifest } from '../../shared/index.js'\nimport type { PwaPluginLocaleConfig } from '../types.js'\nimport { ArrowLeftIcon, ArrowRightIcon, CloseIcon } from './icons.js'\n\ninterface InstallPromptEvent extends Event {\n readonly platforms: string\n prompt: () => void\n readonly userChoice: Promise<{ outcome: 'accepted' | 'dismissed' }>\n}\n\nexport const PwaInstallModal = defineComponent({\n name: 'PwaInstallModal',\n\n props: {\n /** locale data */\n locales: {\n type: Object as PropType<PwaPluginLocaleConfig>,\n required: true,\n },\n\n /**\n * Whether use hint message instead of showing a button\n *\n * 是否使用提示\n */\n useHint: Boolean,\n },\n\n emits: ['canInstall', 'hint', 'close'],\n\n setup(props, { emit }) {\n const locale = useLocale(props.locales)\n\n const manifest = shallowRef<AppManifest>({})\n const deferredPrompt = shallowRef<InstallPromptEvent>()\n\n const getManifest = async (): Promise<void> => {\n const manifestContent = localStorage.getItem('manifest')\n\n if (manifestContent)\n manifest.value = JSON.parse(manifestContent) as AppManifest\n else\n try {\n const response = await fetch(withBase('manifest.webmanifest'))\n const data = (await response.json()) as AppManifest\n\n manifest.value = data\n localStorage.setItem('manifest', JSON.stringify(data))\n } catch {\n console.error(\n '[PWA]: Error getting manifest, check that you have a valid web manifest or network connection',\n )\n }\n }\n\n const scrollToLeft = (): void => {\n const screenshotsDiv = document.querySelector('.screenshot')\n\n if (screenshotsDiv)\n screenshotsDiv.scrollBy({\n left: -screenshotsDiv.clientWidth,\n top: 0,\n behavior: 'smooth',\n })\n }\n\n const scrollToRight = (): void => {\n const screenshotsDiv = document.querySelector('.screenshot')\n\n if (screenshotsDiv)\n screenshotsDiv.scrollBy({\n left: screenshotsDiv.clientWidth,\n top: 0,\n behavior: 'smooth',\n })\n }\n\n const install = async (): Promise<void> => {\n if (deferredPrompt.value) {\n deferredPrompt.value.prompt()\n\n document.dispatchEvent(new CustomEvent('show'))\n\n const choiceResult = await deferredPrompt.value.userChoice\n\n if (choiceResult.outcome === 'accepted') {\n console.info('PWA has been installed')\n\n emit('close', false)\n emit('canInstall', false)\n } else {\n console.info('You choose to not install PWA')\n\n emit('close', false)\n emit('canInstall', false)\n }\n }\n }\n\n const hint = (): void => {\n console.info('You accepted the install hint')\n emit('hint')\n }\n\n onMounted(() => {\n // eslint-disable-next-line no-prototype-builtins\n if (window.hasOwnProperty('BeforeInstallPromptEvent')) {\n useEventListener(window, 'beforeinstallprompt', (event) => {\n deferredPrompt.value = event as InstallPromptEvent\n\n emit('canInstall', true)\n event.preventDefault()\n })\n\n useEventListener(\n 'keyup',\n (event): void => {\n if (event.key === 'Escape') emit('close', false)\n },\n { passive: true },\n )\n\n void getManifest()\n }\n })\n\n return (): VNode =>\n h('div', { id: 'install-modal-wrapper' }, [\n h('div', {\n class: 'background',\n onClick: () => {\n emit('close', false)\n },\n }),\n\n h('div', { class: 'install-modal' }, [\n h('div', { class: 'header' }, [\n // close button\n h(\n 'button',\n {\n 'type': 'button',\n 'class': 'close-button',\n 'aria-label': locale.value.close,\n 'onClick': () => {\n emit('close', false)\n },\n },\n h(CloseIcon),\n ),\n\n h('div', { class: 'logo' }, [\n manifest.value.icons\n ? h('img', {\n src: manifest.value.icons[0]?.src,\n alt: 'App Logo',\n })\n : null,\n h('div', { class: 'title' }, [\n h('h1', manifest.value.short_name || manifest.value.name),\n h('p', { class: 'desc' }, locale.value.explain),\n ]),\n ]),\n ]),\n\n h('div', { class: 'content' }, [\n h('div', { class: 'highlight' }, [\n manifest.value.features\n ? h('div', { class: 'feature-wrapper' }, [\n h('h3', locale.value.feature),\n h(\n 'ul',\n manifest.value.features.map((feature) =>\n h('li', feature),\n ),\n ),\n ])\n : null,\n\n manifest.value.screenshots\n ? h('div', { class: 'screenshot-wrapper' }, [\n h(\n 'button',\n {\n 'type': 'button',\n 'aria-label': locale.value.prevImage,\n 'onClick': scrollToLeft,\n },\n h(ArrowLeftIcon),\n ),\n h('section', { class: 'screenshot' }, [\n manifest.value.screenshots.map((screenshot) =>\n h(\n 'div',\n h('img', {\n src: screenshot.src,\n alt: 'App Screenshot',\n }),\n ),\n ),\n ]),\n h(\n 'button',\n {\n 'type': 'button',\n 'aria-label': locale.value.nextImage,\n 'onClick': scrollToRight,\n },\n h(ArrowRightIcon),\n ),\n ])\n : null,\n ]),\n\n h('div', { class: 'description' }, [\n h('h3', locale.value.desc),\n h('p', manifest.value.description),\n ]),\n ]),\n\n props.useHint\n ? h('div', { class: 'ios-text', onClick: hint }, [\n h('p', locale.value.iOSInstall),\n h('button', { type: 'button', class: 'success' }, 'Got it!'),\n ])\n : h('div', { class: 'button-wrapper' }, [\n h(\n 'button',\n { type: 'button', class: 'install-button', onClick: install },\n [locale.value.install, h('span', manifest.value.short_name)],\n ),\n h(\n 'button',\n {\n type: 'button',\n class: 'cancel-button',\n onClick: () => {\n emit('close', false)\n },\n },\n locale.value.cancel,\n ),\n ]),\n ]),\n ])\n },\n})\n","import { useLocale } from '@vuepress/helper/client'\nimport { useToggle } from '@vueuse/core'\nimport type { PropType, VNode } from 'vue'\nimport { computed, defineComponent, h, onMounted, ref } from 'vue'\nimport type { ManifestExternalApplicationResource } from '../../shared/index.js'\nimport type { PwaPluginLocaleConfig } from '../types.js'\nimport { PwaInstallModal } from './PwaInstallModal.js'\n\nimport '../styles/modal.css'\n\ninterface ModernNavigator extends Navigator {\n // Nonstandard Api\n getInstalledRelatedApps: () => Promise<ManifestExternalApplicationResource[]>\n}\n\ninterface SafariNavigator extends Navigator {\n // Available on Apple’s iOS Safari only.\n standalone: boolean\n}\n\nexport const PwaInstall = defineComponent({\n name: 'PwaInstall',\n\n props: {\n /** locale data */\n locales: {\n type: Object as PropType<PwaPluginLocaleConfig>,\n required: true,\n },\n },\n\n setup(props) {\n const locale = useLocale(props.locales)\n const [isOpen, toggleIsOpen] = useToggle()\n\n const canInstall = ref(false)\n const hasRelatedApps = ref(false)\n const isIOS = ref(false)\n const isSafari = ref(false)\n const hinted = ref(false)\n\n const useHint = computed(\n () => isIOS.value && isSafari.value && !hinted.value,\n )\n\n const showInstall = computed(\n () => (hasRelatedApps.value && canInstall.value) || useHint.value,\n )\n\n const getInstallStatus = (): boolean => {\n if ((navigator as SafariNavigator).standalone)\n return (navigator as SafariNavigator).standalone\n\n return matchMedia('(display-mode: standalone)').matches\n }\n\n const hint = (): void => {\n toggleIsOpen(false)\n hinted.value = true\n // do not notify again\n localStorage.setItem('iOS-pwa-hint', 'hinted')\n }\n\n onMounted(() => {\n if (getInstallStatus()) {\n const { userAgent } = navigator\n\n // handle iOS specifically\n isIOS.value =\n // regular iPhone\n userAgent.includes('iPhone') ||\n // regular iPad\n userAgent.includes('iPad') ||\n // iPad pro\n Boolean(\n userAgent.includes('Macintosh') &&\n navigator.maxTouchPoints &&\n navigator.maxTouchPoints > 2,\n )\n\n isSafari.value =\n navigator.userAgent.includes('Safari') &&\n !userAgent.includes('Chrome')\n\n hinted.value = Boolean(localStorage.getItem('iOS-pwa-hint'))\n }\n\n if ('getInstalledRelatedApps' in (navigator as ModernNavigator))\n void (navigator as ModernNavigator)\n .getInstalledRelatedApps()\n .then((result) => {\n hasRelatedApps.value = result.length > 0\n })\n })\n\n return (): VNode =>\n h('div', { id: 'pwa-install' }, [\n showInstall.value\n ? h(\n 'button',\n {\n type: 'button',\n class: 'modal-button',\n onClick: () => {\n toggleIsOpen(true)\n },\n },\n locale.value.install,\n )\n : null,\n h(PwaInstallModal, {\n style: {\n display: isOpen.value ? 'block' : 'none',\n },\n locales: props.locales,\n useHint: useHint.value,\n onCanInstall: (value: boolean) => {\n canInstall.value = value\n },\n onHint: () => {\n hint()\n },\n onClose: () => toggleIsOpen(false),\n }),\n ])\n },\n})\n"],"names":["PwaInstallModal","defineComponent","props","emit","locale","useLocale","manifest","shallowRef","deferredPrompt","getManifest","manifestContent","data","withBase","scrollToLeft","screenshotsDiv","scrollToRight","install","hint","onMounted","useEventListener","event","h","CloseIcon","feature","ArrowLeftIcon","screenshot","ArrowRightIcon","PwaInstall","isOpen","toggleIsOpen","useToggle","canInstall","ref","hasRelatedApps","isIOS","isSafari","hinted","useHint","computed","showInstall","getInstallStatus","user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,KAAM,SACN,MAAO,eACP,QAAS,IAAM,CACbQ,EAAa,EAAI,CACnB,CACF,EACAzB,EAAO,MAAM,OACf,EACA,KACJiB,EAAErB,EAAiB,CACjB,MAAO,CACL,QAAS4B,EAAO,MAAQ,QAAU,MACpC,EACA,QAAS1B,EAAM,QACf,QAASmC,EAAQ,MACjB,aAAeM,GAAmB,CAChCZ,EAAW,MAAQY,CACrB,EACA,OAAQ,IAAM,CACZ1B,EAAAA,CACF,EACA,QAAS,IAAMY,EAAa,EAAK,CACnC,CAAC,CACH,CAAC,CACL,CACF,CAAC"}
1
+ {"version":3,"file":"PwaInstall.js","names":[],"sources":["../../../src/client/components/PwaInstall.ts"],"sourcesContent":["import { useLocale } from '@vuepress/helper/client'\nimport { useToggle } from '@vueuse/core'\nimport type { PropType, VNode } from 'vue'\nimport { computed, defineComponent, h, onMounted, ref } from 'vue'\nimport type { ManifestExternalApplicationResource } from '../../shared/index.js'\nimport type { PwaPluginLocaleConfig } from '../types.js'\nimport { PwaInstallModal } from './PwaInstallModal.js'\n\nimport '../styles/modal.css'\n\ninterface ModernNavigator extends Navigator {\n // Nonstandard Api\n getInstalledRelatedApps: () => Promise<ManifestExternalApplicationResource[]>\n}\n\ninterface SafariNavigator extends Navigator {\n // Available on Apple’s iOS Safari only.\n standalone: boolean\n}\n\nexport const PwaInstall = defineComponent({\n name: 'PwaInstall',\n\n props: {\n /** locale data */\n locales: {\n type: Object as PropType<PwaPluginLocaleConfig>,\n required: true,\n },\n },\n\n setup(props) {\n const locale = useLocale(props.locales)\n const [isOpen, toggleIsOpen] = useToggle()\n\n const canInstall = ref(false)\n const hasRelatedApps = ref(false)\n const isIOS = ref(false)\n const isSafari = ref(false)\n const hinted = ref(false)\n\n const useHint = computed(\n () => isIOS.value && isSafari.value && !hinted.value,\n )\n\n const showInstall = computed(\n () => (hasRelatedApps.value && canInstall.value) || useHint.value,\n )\n\n const getInstallStatus = (): boolean => {\n if ((navigator as SafariNavigator).standalone)\n return (navigator as SafariNavigator).standalone\n\n return matchMedia('(display-mode: standalone)').matches\n }\n\n const hint = (): void => {\n toggleIsOpen(false)\n hinted.value = true\n // do not notify again\n localStorage.setItem('iOS-pwa-hint', 'hinted')\n }\n\n onMounted(() => {\n if (getInstallStatus()) {\n const { userAgent } = navigator\n\n // handle iOS specifically\n isIOS.value =\n // regular iPhone\n userAgent.includes('iPhone') ||\n // regular iPad\n userAgent.includes('iPad') ||\n // iPad pro\n Boolean(\n userAgent.includes('Macintosh') &&\n navigator.maxTouchPoints &&\n navigator.maxTouchPoints > 2,\n )\n\n isSafari.value =\n navigator.userAgent.includes('Safari') &&\n !userAgent.includes('Chrome')\n\n hinted.value = Boolean(localStorage.getItem('iOS-pwa-hint'))\n }\n\n if ('getInstalledRelatedApps' in (navigator as ModernNavigator)) {\n void (navigator as ModernNavigator)\n .getInstalledRelatedApps()\n .then((result) => {\n hasRelatedApps.value = result.length > 0\n })\n }\n })\n\n return (): VNode =>\n h('div', { id: 'pwa-install' }, [\n showInstall.value\n ? h(\n 'button',\n {\n type: 'button',\n class: 'modal-button',\n onClick: () => {\n toggleIsOpen(true)\n },\n },\n locale.value.install,\n )\n : null,\n h(PwaInstallModal, {\n style: {\n display: isOpen.value ? 'block' : 'none',\n },\n locales: props.locales,\n useHint: useHint.value,\n onCanInstall: (value: boolean) => {\n canInstall.value = value\n },\n onHint: () => {\n hint()\n },\n onClose: () => toggleIsOpen(false),\n }),\n ])\n },\n})\n"],"mappings":"kQAoBA,MAAa,EAAa,EAAgB,CACxC,KAAM,aAEN,MAAO,CAEL,QAAS,CACP,KAAM,OACN,SAAU,GACX,CACF,CAED,MAAM,EAAO,CACX,IAAM,EAAS,EAAU,EAAM,QAAQ,CACjC,CAAC,EAAQ,GAAgB,GAAW,CAEpC,EAAa,EAAI,GAAM,CACvB,EAAiB,EAAI,GAAM,CAC3B,EAAQ,EAAI,GAAM,CAClB,EAAW,EAAI,GAAM,CACrB,EAAS,EAAI,GAAM,CAEnB,EAAU,MACR,EAAM,OAAS,EAAS,OAAS,CAAC,EAAO,MAChD,CAEK,EAAc,MACX,EAAe,OAAS,EAAW,OAAU,EAAQ,MAC7D,CAEK,MACC,UAA8B,WACzB,UAA8B,WAEjC,WAAW,6BAA6B,CAAC,QAG5C,MAAmB,CACvB,EAAa,GAAM,CACnB,EAAO,MAAQ,GAEf,aAAa,QAAQ,eAAgB,SAAS,EAoChD,OAjCA,MAAgB,CACd,GAAI,GAAkB,CAAE,CACtB,GAAM,CAAE,aAAc,UAGtB,EAAM,MAEJ,EAAU,SAAS,SAAS,EAE5B,EAAU,SAAS,OAAO,EAE1B,GACE,EAAU,SAAS,YAAY,EAC/B,UAAU,gBACV,UAAU,eAAiB,GAG/B,EAAS,MACP,UAAU,UAAU,SAAS,SAAS,EACtC,CAAC,EAAU,SAAS,SAAS,CAE/B,EAAO,MAAQ,EAAQ,aAAa,QAAQ,eAAe,CAGzD,4BAA8B,WAC1B,UACH,yBAAyB,CACzB,KAAM,GAAW,CAChB,EAAe,MAAQ,EAAO,OAAS,GACvC,EAEN,KAGA,EAAE,MAAO,CAAE,GAAI,cAAe,CAAE,CAC9B,EAAY,MACR,EACE,SACA,CACE,KAAM,SACN,MAAO,eACP,YAAe,CACb,EAAa,GAAK,EAErB,CACD,EAAO,MAAM,QACd,CACD,KACJ,EAAE,EAAiB,CACjB,MAAO,CACL,QAAS,EAAO,MAAQ,QAAU,OACnC,CACD,QAAS,EAAM,QACf,QAAS,EAAQ,MACjB,aAAe,GAAmB,CAChC,EAAW,MAAQ,GAErB,WAAc,CACZ,GAAM,EAER,YAAe,EAAa,GAAM,CACnC,CAAC,CACH,CAAC,EAEP,CAAC"}
@@ -1,25 +1,27 @@
1
- import * as vue from 'vue';
2
- import { PropType, VNode, SlotsType } from 'vue';
3
- import { Slot } from '@vuepress/helper/client';
4
- import { P as PwaPluginLocaleConfig } from '../types-B0Ty8tPv.js';
1
+ import { t as PwaPluginLocaleConfig } from "../../types-CGDCqUfb.js";
2
+ import { Slot } from "@vuepress/helper/client";
3
+ import * as vue from "vue";
4
+ import { PropType, SlotsType, VNode } from "vue";
5
+ import "@vuepress/helper/transition/fade-in-scale-up.css";
6
+ import "../styles/popup.css";
5
7
 
8
+ //#region src/client/components/PwaReadyPopup.d.ts
6
9
  declare const PwaReadyPopup: vue.DefineComponent<vue.ExtractPropTypes<{
7
- /** locale data */
8
- locales: {
9
- type: PropType<PwaPluginLocaleConfig>;
10
- required: true;
11
- };
10
+ /** locale data */locales: {
11
+ type: PropType<PwaPluginLocaleConfig>;
12
+ required: true;
13
+ };
12
14
  }>, () => VNode, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
13
- /** locale data */
14
- locales: {
15
- type: PropType<PwaPluginLocaleConfig>;
16
- required: true;
17
- };
15
+ /** locale data */locales: {
16
+ type: PropType<PwaPluginLocaleConfig>;
17
+ required: true;
18
+ };
18
19
  }>> & Readonly<{}>, {}, SlotsType<{
19
- default?: Slot<{
20
- isReady: boolean;
21
- reload: () => void;
22
- }>;
20
+ default?: Slot<{
21
+ isReady: boolean;
22
+ reload: () => void;
23
+ }>;
23
24
  }>, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
24
-
25
+ //#endregion
25
26
  export { PwaReadyPopup };
27
+ //# sourceMappingURL=PwaReadyPopup.d.ts.map
@@ -1,2 +1,2 @@
1
- import"@vuepress/helper/client";import"vue";import"../icons-DQk7h1-3.js";import"@vuepress/helper/transition/fade-in-scale-up.css";import"../styles/popup.css";import{P as e}from"../PwaReadyPopup-Crl_YRc0.js";import"../usePwaEvent-CUDY9qle.js";export{e as PwaReadyPopup};
2
- //# sourceMappingURL=PwaReadyPopup.js.map
1
+ import{i as e}from"../../icons-RRw4DIWa.js";import{a as t}from"../../setupViewPoint-DS4c13mS.js";import{t as n}from"../../skipWaiting-wM8NHpWa.js";import{useLocale as r}from"@vuepress/helper/client";import{Transition as i,computed as a,defineComponent as o,h as s,onMounted as c,shallowRef as l}from"vue";import"@vuepress/helper/transition/fade-in-scale-up.css";import"../styles/popup.css";const u=o({name:`PwaReadyPopup`,props:{locales:{type:Object,required:!0}},slots:Object,setup(o,{slots:u}){let d=r(o.locales),f=l(),p=a(()=>!!f.value),m=()=>{f.value&&=(n(f.value),void 0)};return c(()=>{t().on(`updated`,e=>{f.value=e})}),()=>s(i,{name:`fade-in-scale-up`},()=>u.default?.({isReady:p.value,reload:m})??(p.value?s(`button`,{type:`button`,class:`sw-update-popup`,tabindex:0,onClick:()=>{m()}},[d.value.update,s(`span`,{class:`icon-wrapper`},s(e))]):null))}});export{u as PwaReadyPopup};
2
+ //# sourceMappingURL=PwaReadyPopup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PwaReadyPopup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"PwaReadyPopup.js","names":[],"sources":["../../../src/client/components/PwaReadyPopup.ts"],"sourcesContent":["import type { Slot } from '@vuepress/helper/client'\nimport { useLocale } from '@vuepress/helper/client'\nimport type { PropType, SlotsType, VNode } from 'vue'\nimport {\n Transition,\n computed,\n defineComponent,\n h,\n onMounted,\n shallowRef,\n} from 'vue'\nimport { usePwaEvent } from '../composables/index.js'\nimport type { PwaPluginLocaleConfig } from '../types.js'\nimport { skipWaiting } from '../utils/index.js'\nimport { UpdateIcon } from './icons.js'\n\nimport '@vuepress/helper/transition/fade-in-scale-up.css'\nimport '../styles/popup.css'\n\nexport const PwaReadyPopup = defineComponent({\n name: 'PwaReadyPopup',\n\n props: {\n /** locale data */\n locales: {\n type: Object as PropType<PwaPluginLocaleConfig>,\n required: true,\n },\n },\n\n slots: Object as SlotsType<{\n default?: Slot<{ isReady: boolean; reload: () => void }>\n }>,\n\n setup(props, { slots }) {\n const locale = useLocale(props.locales)\n const registration = shallowRef<ServiceWorkerRegistration>()\n\n const isReady = computed(() => Boolean(registration.value))\n\n const reload = (): void => {\n if (registration.value) {\n skipWaiting(registration.value)\n registration.value = undefined\n }\n }\n\n onMounted(() => {\n const event = usePwaEvent()\n\n event.on('updated', (reg) => {\n registration.value = reg\n })\n })\n\n return (): VNode =>\n h(\n Transition,\n { name: 'fade-in-scale-up' },\n () =>\n slots.default?.({\n isReady: isReady.value,\n reload,\n }) ??\n (isReady.value\n ? h(\n 'button',\n {\n type: 'button',\n class: 'sw-update-popup',\n tabindex: 0,\n onClick: () => {\n reload()\n },\n },\n [\n locale.value.update,\n h('span', { class: 'icon-wrapper' }, h(UpdateIcon)),\n ],\n )\n : null),\n )\n },\n})\n"],"mappings":"sYAmBA,MAAa,EAAgB,EAAgB,CAC3C,KAAM,gBAEN,MAAO,CAEL,QAAS,CACP,KAAM,OACN,SAAU,GACX,CACF,CAED,MAAO,OAIP,MAAM,EAAO,CAAE,SAAS,CACtB,IAAM,EAAS,EAAU,EAAM,QAAQ,CACjC,EAAe,GAAuC,CAEtD,EAAU,MAAe,EAAQ,EAAa,MAAO,CAErD,MAAqB,CACzB,AAEE,EAAa,SADb,EAAY,EAAa,MAAM,CACV,IAAA,KAYzB,OARA,MAAgB,CACA,GAAa,CAErB,GAAG,UAAY,GAAQ,CAC3B,EAAa,MAAQ,GACrB,EACF,KAGA,EACE,EACA,CAAE,KAAM,mBAAoB,KAE1B,EAAM,UAAU,CACd,QAAS,EAAQ,MACjB,SACD,CAAC,GACD,EAAQ,MACL,EACE,SACA,CACE,KAAM,SACN,MAAO,kBACP,SAAU,EACV,YAAe,CACb,GAAQ,EAEX,CACD,CACE,EAAO,MAAM,OACb,EAAE,OAAQ,CAAE,MAAO,eAAgB,CAAE,EAAE,EAAW,CAAC,CACpD,CACF,CACD,MACP,EAEN,CAAC"}
@@ -1,6 +1,7 @@
1
- import { Emitter } from 'mitt';
2
- import { InjectionKey } from 'vue';
1
+ import { InjectionKey } from "vue";
2
+ import { Emitter } from "mitt";
3
3
 
4
+ //#region src/client/composables/setupPwa.d.ts
4
5
  /**
5
6
  * Setup PWA functionality
6
7
  *
@@ -10,22 +11,24 @@ import { InjectionKey } from 'vue';
10
11
  * @param shouldForceUpdate - Whether to force update / 是否强制更新
11
12
  */
12
13
  declare const setupPwa: (serviceWorkerPath: string, shouldForceUpdate?: boolean) => void;
13
-
14
+ //#endregion
15
+ //#region src/client/composables/setupViewPoint.d.ts
14
16
  /**
15
17
  * Setup viewport for PWA standalone mode
16
18
  *
17
19
  * 为 PWA 独立模式设置视口
18
20
  */
19
21
  declare const setupViewPoint: () => void;
20
-
22
+ //#endregion
23
+ //#region src/client/composables/usePwaEvent.d.ts
21
24
  type PwaEvent = Emitter<{
22
- ready: ServiceWorkerRegistration;
23
- registered: ServiceWorkerRegistration;
24
- cached: ServiceWorkerRegistration;
25
- updatefound: ServiceWorkerRegistration;
26
- updated: ServiceWorkerRegistration;
27
- offline: void;
28
- error: Error;
25
+ ready: ServiceWorkerRegistration;
26
+ registered: ServiceWorkerRegistration;
27
+ cached: ServiceWorkerRegistration;
28
+ updatefound: ServiceWorkerRegistration;
29
+ updated: ServiceWorkerRegistration;
30
+ offline: void;
31
+ error: Error;
29
32
  }>;
30
33
  declare const pwaEventSymbol: InjectionKey<PwaEvent>;
31
34
  /**
@@ -36,7 +39,8 @@ declare const pwaEventSymbol: InjectionKey<PwaEvent>;
36
39
  * @returns PWA event emitter / PWA 事件发射器
37
40
  */
38
41
  declare const usePwaEvent: () => PwaEvent;
39
-
42
+ //#endregion
43
+ //#region src/client/composables/useRegisterSW.d.ts
40
44
  /**
41
45
  * Register service worker with event emitter
42
46
  *
@@ -44,9 +48,8 @@ declare const usePwaEvent: () => PwaEvent;
44
48
  *
45
49
  * @param serviceWorkerPath - Service Worker path / Service Worker 路径
46
50
  * @param event - PWA event emitter / PWA 事件发射器
47
- * @returns Promise that resolves when registration is complete / 注册完成时解析的 Promise
48
51
  */
49
52
  declare const useRegisterSW: (serviceWorkerPath: string, event: PwaEvent) => Promise<void>;
50
-
51
- export { pwaEventSymbol, setupPwa, setupViewPoint, usePwaEvent, useRegisterSW };
52
- export type { PwaEvent };
53
+ //#endregion
54
+ export { PwaEvent, pwaEventSymbol, setupPwa, setupViewPoint, usePwaEvent, useRegisterSW };
55
+ //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
- import{s as p,a as r,u as i}from"../index-B2tGW6v2.js";import{p as u,u as w}from"../usePwaEvent-CUDY9qle.js";import"mitt";import"vue";import"vuepress/client";export{u as pwaEventSymbol,p as setupPwa,r as setupViewPoint,w as usePwaEvent,i as useRegisterSW};
2
- //# sourceMappingURL=index.js.map
1
+ import{a as e,i as t,n,r,t as i}from"../../setupViewPoint-DS4c13mS.js";export{t as pwaEventSymbol,n as setupPwa,i as setupViewPoint,e as usePwaEvent,r as useRegisterSW};
@@ -1,20 +1,19 @@
1
- export { PwaInstall } from './components/PwaInstall.js';
2
- export { PwaFoundPopup } from './components/PwaFoundPopup.js';
3
- export { PwaReadyPopup } from './components/PwaReadyPopup.js';
4
- export { PwaEvent, pwaEventSymbol, setupPwa, setupViewPoint, usePwaEvent, useRegisterSW } from './composables/index.js';
5
- import { Hooks } from 'register-service-worker';
6
- export { P as PwaPluginLocaleConfig } from './types-B0Ty8tPv.js';
7
- import 'vue';
8
- import '@vuepress/helper/client';
9
- import 'mitt';
1
+ import { t as PwaPluginLocaleConfig } from "../types-CGDCqUfb.js";
2
+ import { PwaFoundPopup } from "./components/PwaFoundPopup.js";
3
+ import { PwaInstall } from "./components/PwaInstall.js";
4
+ import { PwaReadyPopup } from "./components/PwaReadyPopup.js";
5
+ import { PwaEvent, pwaEventSymbol, setupPwa, setupViewPoint, usePwaEvent, useRegisterSW } from "./composables/index.js";
6
+ import { Hooks } from "register-service-worker";
10
7
 
8
+ //#region src/client/utils/forceUpdate.d.ts
11
9
  /**
12
10
  * Force update page content
13
11
  *
14
12
  * 强制更新页面内容
15
13
  */
16
14
  declare const forceUpdate: () => void;
17
-
15
+ //#endregion
16
+ //#region src/client/utils/registerSW.d.ts
18
17
  /**
19
18
  * Register serviceWorker under `serviceWorkerPath`
20
19
  *
@@ -25,7 +24,8 @@ declare const forceUpdate: () => void;
25
24
  * @param showStatus - Whether to show status in console / 是否在控制台显示状态
26
25
  */
27
26
  declare const registerSW: (serviceWorkerPath: string, hooks?: Hooks, showStatus?: boolean) => Promise<void>;
28
-
27
+ //#endregion
28
+ //#region src/client/utils/skipWaiting.d.ts
29
29
  /**
30
30
  * Call `skipWaiting()` inside current waiting worker
31
31
  *
@@ -34,7 +34,8 @@ declare const registerSW: (serviceWorkerPath: string, hooks?: Hooks, showStatus?
34
34
  * @param registration - The registration of the service worker you want activate / 想要激活的 Service Worker 的注册
35
35
  */
36
36
  declare const skipWaiting: (registration: ServiceWorkerRegistration) => void;
37
-
37
+ //#endregion
38
+ //#region src/client/utils/unregisterSW.d.ts
38
39
  /**
39
40
  * Call `unregister()` inside current active worker
40
41
  *
@@ -43,5 +44,6 @@ declare const skipWaiting: (registration: ServiceWorkerRegistration) => void;
43
44
  * @returns `true` if unregister success, `false` if unregister failed / `true` 表示注销成功,`false` 表示注销失败
44
45
  */
45
46
  declare const unregisterSW: () => Promise<boolean>;
46
-
47
- export { forceUpdate, registerSW, skipWaiting, unregisterSW };
47
+ //#endregion
48
+ export { PwaEvent, PwaFoundPopup, PwaInstall, PwaPluginLocaleConfig, PwaReadyPopup, forceUpdate, pwaEventSymbol, registerSW, setupPwa, setupViewPoint, skipWaiting, unregisterSW, usePwaEvent, useRegisterSW };
49
+ //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- import{PwaFoundPopup as f}from"./components/PwaFoundPopup.js";import{PwaInstall as l}from"./components/PwaInstall.js";import{P as v,s as x}from"./PwaReadyPopup-Crl_YRc0.js";import{f as h,r as k,s as S,a as R,u as y}from"./index-B2tGW6v2.js";import{p as E,u as U}from"./usePwaEvent-CUDY9qle.js";import"@vuepress/helper/client";import"vue";import"./icons-DQk7h1-3.js";import"@vuepress/helper/transition/fade-in-scale-up.css";import"./styles/popup.css";import"@vueuse/core";import"vuepress/client";import"./styles/modal.css";import"mitt";const t=()=>navigator.serviceWorker.getRegistration().then(r=>r?r.unregister().then(e=>(e&&console.log("[PWA] Current service worker unregistered"),e)):!1).catch(r=>(console.error("[PWA] Unregister current service worker failed with error:",r),!1));export{f as PwaFoundPopup,l as PwaInstall,v as PwaReadyPopup,h as forceUpdate,E as pwaEventSymbol,k as registerSW,S as setupPwa,R as setupViewPoint,x as skipWaiting,t as unregisterSW,U as usePwaEvent,y as useRegisterSW};
2
- //# sourceMappingURL=index.js.map
1
+ import{PwaInstall as e}from"./components/PwaInstall.js";import{a as t,i as n,n as r,o as i,r as a,s as o,t as s}from"../setupViewPoint-DS4c13mS.js";import{t as c}from"../skipWaiting-wM8NHpWa.js";import{PwaFoundPopup as l}from"./components/PwaFoundPopup.js";import{PwaReadyPopup as u}from"./components/PwaReadyPopup.js";const d=async()=>{try{let e=await navigator.serviceWorker.getRegistration();if(e){let t=await e.unregister();return t&&console.log(`[PWA] Current service worker unregistered`),t}}catch(e){console.error(`[PWA] Unregister current service worker failed with error:`,e)}return!1};export{l as PwaFoundPopup,e as PwaInstall,u as PwaReadyPopup,o as forceUpdate,n as pwaEventSymbol,i as registerSW,r as setupPwa,s as setupViewPoint,c as skipWaiting,d as unregisterSW,t as usePwaEvent,a as useRegisterSW};
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/client/utils/unregisterSW.ts"],"sourcesContent":["/* eslint-disable no-console */\n/**\n * Call `unregister()` inside current active worker\n *\n * 在当前激活的 Service Worker 中调用 `unregister()`\n *\n * @returns `true` if unregister success, `false` if unregister failed / `true` 表示注销成功,`false` 表示注销失败\n */\nexport const unregisterSW = (): Promise<boolean> =>\n navigator.serviceWorker\n .getRegistration()\n .then((registration) => {\n if (registration)\n return registration.unregister().then((found) => {\n if (found) console.log('[PWA] Current service worker unregistered')\n\n return found\n })\n\n return false\n })\n .catch((error: unknown) => {\n console.error(\n '[PWA] Unregister current service worker failed with error:',\n error,\n )\n\n return false\n })\n"],"names":["unregisterSW","registration","found","error"],"mappings":"uhBAQO,MAAMA,EAAe,IAC1B,UAAU,cACP,gBAAA,EACA,KAAMC,GACDA,EACKA,EAAa,WAAA,EAAa,KAAMC,IACjCA,GAAO,QAAQ,IAAI,2CAA2C,EAE3DA,EACR,EAEI,EACR,EACA,MAAOC,IACN,QAAQ,MACN,6DACAA,CACF,EAEO,GACR"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/client/utils/unregisterSW.ts"],"sourcesContent":["/* eslint-disable no-console */\n/**\n * Call `unregister()` inside current active worker\n *\n * 在当前激活的 Service Worker 中调用 `unregister()`\n *\n * @returns `true` if unregister success, `false` if unregister failed / `true` 表示注销成功,`false` 表示注销失败\n */\nexport const unregisterSW = async (): Promise<boolean> => {\n try {\n const registration = await navigator.serviceWorker.getRegistration()\n if (registration) {\n const found = await registration.unregister()\n if (found) console.log('[PWA] Current service worker unregistered')\n return found\n }\n } catch (err: unknown) {\n console.error(\n '[PWA] Unregister current service worker failed with error:',\n err,\n )\n }\n return false\n}\n"],"mappings":"+TAQA,MAAa,EAAe,SAA8B,CACxD,GAAI,CACF,IAAM,EAAe,MAAM,UAAU,cAAc,iBAAiB,CACpE,GAAI,EAAc,CAChB,IAAM,EAAQ,MAAM,EAAa,YAAY,CAE7C,OADI,GAAO,QAAQ,IAAI,4CAA4C,CAC5D,SAEF,EAAc,CACrB,QAAQ,MACN,6DACA,EACD,CAEH,MAAO"}
@@ -1,2 +1,2 @@
1
- import{h as a}from"vue";const c=({name:o="",color:n="currentColor"},{slots:r})=>a("svg",{xmlns:"http://www.w3.org/2000/svg",class:["icon",`${o}-icon`],viewBox:"0 0 1024 1024",fill:n,"aria-label":`${o} icon`},r.default());c.displayName="SVGWrapper";const l=()=>a(c,{name:"arrow-left"},()=>a("path",{d:"M802.8 448h-428l166-158.8c23.8-25 23.8-65.4 0-90.4s-62.4-25-86.4 0L178 466.8c-12 11.6-18 27.4-18 44.8v0.8c0 17.4 6 33.2 18 44.8l276.2 268c24 25 62.6 25 86.4 0 23.8-25 23.8-65.4 0-90.4l-166-158.8h428c33.8 0 61.2-28.6 61.2-64 0.2-36-27.2-64-61-64z"}));l.displayName="ArrowLeftIcon";const s=()=>a(c,{name:"arrow-right"},()=>a("path",{d:"M569.8 825.2l276.2-268c12-11.6 18-27.4 18-44.8v-0.8c0-17.4-6-33.2-18-44.8l-276.2-268c-24-25-62.6-25-86.4 0-23.8 25-23.8 65.4 0 90.4l166 158.8h-428c-34 0-61.4 28.6-61.4 64 0 36 27.4 64 61.2 64h428l-166 158.8c-23.8 25-23.8 65.4 0 90.4 24 25 62.6 25 86.6 0z"}));s.displayName="ArrowRightIcon";const t=()=>a(c,{name:"close"},()=>a("path",{d:"M589.654 511.965 1007.212 84.22a49.777 49.777 0 0 0-.73-70.02 49.046 49.046 0 0 0-69.687.665L519.967 441.946 85.882 14.2a49.08 49.08 0 0 0-69.687.664 49.777 49.777 0 0 0 .664 70.019l433.454 427.082L16.859 939.048a49.777 49.777 0 0 0-.664 70.019 49.013 49.013 0 0 0 69.687.663l434.085-427.746 416.828 427.083A49.013 49.013 0 0 0 972.037 1024a48.416 48.416 0 0 0 34.512-14.27 49.777 49.777 0 0 0 .73-70.019z"}));t.displayName="CloseIcon";const e=()=>a(c,{name:"update"},()=>a("path",{d:"M949.949 146.25v255.826c0 21.981-13.989 35.97-35.97 35.97H658.154c-13.988 0-25.983-7.992-33.973-21.981-5.997-13.989-4-27.977 7.991-39.97l79.942-77.946c-55.954-51.973-121.918-77.955-199.863-77.955-37.975 0-75.95 8.002-113.924 21.99-37.975 15.985-67.948 37.976-91.934 63.957-25.982 23.987-47.973 53.96-63.957 91.934-29.983 73.955-29.983 153.895 0 227.85 15.984 37.976 37.975 67.947 63.957 91.934 23.986 25.982 53.959 47.973 91.934 63.956 37.974 13.989 75.95 21.991 113.924 21.991 45.967 0 87.942-9.998 127.913-29.982 41.976-17.99 75.951-45.967 101.931-83.943 7.993-4 11.994-5.995 13.989-5.995 5.997 0 9.998 1.994 13.988 5.995l77.958 77.946c3.989 4 5.986 7.993 5.986 11.994 0 1.994-1.996 5.995-3.99 11.994-43.973 51.962-93.941 91.934-151.9 117.914-53.958 25.983-115.92 39.972-185.874 39.972-61.961 0-119.921-11.984-169.89-33.973-57.96-25.985-105.923-57.963-139.896-93.943-35.98-33.972-67.958-81.936-93.94-139.897-45.967-101.93-45.967-237.846 0-339.777 25.982-57.96 57.96-105.923 93.94-139.896 33.973-35.98 81.936-67.958 139.896-93.94 49.968-21.99 107.928-33.974 169.89-33.974 55.963 0 109.923 9.988 161.885 29.973 53.97 21.99 101.933 51.963 139.908 89.938l73.954-73.944c9.987-9.998 23.987-13.988 39.971-8.002 13.988 8.002 21.98 19.995 21.98 33.984z"}));e.displayName="UpdateIcon";export{l as A,t as C,e as U,s as a};
2
- //# sourceMappingURL=icons-DQk7h1-3.js.map
1
+ import{h as e}from"vue";const t=({name:t=``,color:n=`currentColor`},{slots:r})=>e(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:[`icon`,`${t}-icon`],viewBox:`0 0 1024 1024`,fill:n,"aria-label":`${t} icon`},r.default());t.displayName=`SVGWrapper`;const n=()=>e(t,{name:`arrow-left`},()=>e(`path`,{d:`M802.8 448h-428l166-158.8c23.8-25 23.8-65.4 0-90.4s-62.4-25-86.4 0L178 466.8c-12 11.6-18 27.4-18 44.8v0.8c0 17.4 6 33.2 18 44.8l276.2 268c24 25 62.6 25 86.4 0 23.8-25 23.8-65.4 0-90.4l-166-158.8h428c33.8 0 61.2-28.6 61.2-64 0.2-36-27.2-64-61-64z`}));n.displayName=`ArrowLeftIcon`;const r=()=>e(t,{name:`arrow-right`},()=>e(`path`,{d:`M569.8 825.2l276.2-268c12-11.6 18-27.4 18-44.8v-0.8c0-17.4-6-33.2-18-44.8l-276.2-268c-24-25-62.6-25-86.4 0-23.8 25-23.8 65.4 0 90.4l166 158.8h-428c-34 0-61.4 28.6-61.4 64 0 36 27.4 64 61.2 64h428l-166 158.8c-23.8 25-23.8 65.4 0 90.4 24 25 62.6 25 86.6 0z`}));r.displayName=`ArrowRightIcon`;const i=()=>e(t,{name:`close`},()=>e(`path`,{d:`M589.654 511.965 1007.212 84.22a49.777 49.777 0 0 0-.73-70.02 49.046 49.046 0 0 0-69.687.665L519.967 441.946 85.882 14.2a49.08 49.08 0 0 0-69.687.664 49.777 49.777 0 0 0 .664 70.019l433.454 427.082L16.859 939.048a49.777 49.777 0 0 0-.664 70.019 49.013 49.013 0 0 0 69.687.663l434.085-427.746 416.828 427.083A49.013 49.013 0 0 0 972.037 1024a48.416 48.416 0 0 0 34.512-14.27 49.777 49.777 0 0 0 .73-70.019z`}));i.displayName=`CloseIcon`;const a=()=>e(t,{name:`update`},()=>e(`path`,{d:`M949.949 146.25v255.826c0 21.981-13.989 35.97-35.97 35.97H658.154c-13.988 0-25.983-7.992-33.973-21.981-5.997-13.989-4-27.977 7.991-39.97l79.942-77.946c-55.954-51.973-121.918-77.955-199.863-77.955-37.975 0-75.95 8.002-113.924 21.99-37.975 15.985-67.948 37.976-91.934 63.957-25.982 23.987-47.973 53.96-63.957 91.934-29.983 73.955-29.983 153.895 0 227.85 15.984 37.976 37.975 67.947 63.957 91.934 23.986 25.982 53.959 47.973 91.934 63.956 37.974 13.989 75.95 21.991 113.924 21.991 45.967 0 87.942-9.998 127.913-29.982 41.976-17.99 75.951-45.967 101.931-83.943 7.993-4 11.994-5.995 13.989-5.995 5.997 0 9.998 1.994 13.988 5.995l77.958 77.946c3.989 4 5.986 7.993 5.986 11.994 0 1.994-1.996 5.995-3.99 11.994-43.973 51.962-93.941 91.934-151.9 117.914-53.958 25.983-115.92 39.972-185.874 39.972-61.961 0-119.921-11.984-169.89-33.973-57.96-25.985-105.923-57.963-139.896-93.943-35.98-33.972-67.958-81.936-93.94-139.897-45.967-101.93-45.967-237.846 0-339.777 25.982-57.96 57.96-105.923 93.94-139.896 33.973-35.98 81.936-67.958 139.896-93.94 49.968-21.99 107.928-33.974 169.89-33.974 55.963 0 109.923 9.988 161.885 29.973 53.97 21.99 101.933 51.963 139.908 89.938l73.954-73.944c9.987-9.998 23.987-13.988 39.971-8.002 13.988 8.002 21.98 19.995 21.98 33.984z`}));a.displayName=`UpdateIcon`;export{a as i,r as n,i as r,n as t};
2
+ //# sourceMappingURL=icons-RRw4DIWa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons-RRw4DIWa.js","names":[],"sources":["../src/client/components/icons.ts"],"sourcesContent":["// oxlint-disable id-length\nimport type { FunctionalComponent, VNode } from 'vue'\nimport { h } from 'vue'\n\ninterface SVGWrapperProps {\n name?: string\n color?: string\n}\n\nconst SVGWrapper: FunctionalComponent<\n SVGWrapperProps,\n Record<never, never>,\n { default: () => VNode | VNode[] }\n> = ({ name = '', color = 'currentColor' }, { slots }) =>\n h(\n 'svg',\n {\n 'xmlns': 'http://www.w3.org/2000/svg',\n 'class': ['icon', `${name}-icon`],\n 'viewBox': '0 0 1024 1024',\n 'fill': color,\n 'aria-label': `${name} icon`,\n },\n slots.default(),\n )\n\nSVGWrapper.displayName = 'SVGWrapper'\n\nexport const ArrowLeftIcon: FunctionalComponent = () =>\n h(SVGWrapper, { name: 'arrow-left' }, () =>\n h('path', {\n d: 'M802.8 448h-428l166-158.8c23.8-25 23.8-65.4 0-90.4s-62.4-25-86.4 0L178 466.8c-12 11.6-18 27.4-18 44.8v0.8c0 17.4 6 33.2 18 44.8l276.2 268c24 25 62.6 25 86.4 0 23.8-25 23.8-65.4 0-90.4l-166-158.8h428c33.8 0 61.2-28.6 61.2-64 0.2-36-27.2-64-61-64z',\n }),\n )\n\nArrowLeftIcon.displayName = 'ArrowLeftIcon'\n\nexport const ArrowRightIcon: FunctionalComponent = () =>\n h(SVGWrapper, { name: 'arrow-right' }, () =>\n h('path', {\n d: 'M569.8 825.2l276.2-268c12-11.6 18-27.4 18-44.8v-0.8c0-17.4-6-33.2-18-44.8l-276.2-268c-24-25-62.6-25-86.4 0-23.8 25-23.8 65.4 0 90.4l166 158.8h-428c-34 0-61.4 28.6-61.4 64 0 36 27.4 64 61.2 64h428l-166 158.8c-23.8 25-23.8 65.4 0 90.4 24 25 62.6 25 86.6 0z',\n }),\n )\n\nArrowRightIcon.displayName = 'ArrowRightIcon'\n\nexport const CloseIcon: FunctionalComponent = () =>\n h(SVGWrapper, { name: 'close' }, () =>\n h('path', {\n d: 'M589.654 511.965 1007.212 84.22a49.777 49.777 0 0 0-.73-70.02 49.046 49.046 0 0 0-69.687.665L519.967 441.946 85.882 14.2a49.08 49.08 0 0 0-69.687.664 49.777 49.777 0 0 0 .664 70.019l433.454 427.082L16.859 939.048a49.777 49.777 0 0 0-.664 70.019 49.013 49.013 0 0 0 69.687.663l434.085-427.746 416.828 427.083A49.013 49.013 0 0 0 972.037 1024a48.416 48.416 0 0 0 34.512-14.27 49.777 49.777 0 0 0 .73-70.019z',\n }),\n )\n\nCloseIcon.displayName = 'CloseIcon'\n\nexport const UpdateIcon: FunctionalComponent = () =>\n h(SVGWrapper, { name: 'update' }, () =>\n h('path', {\n d: 'M949.949 146.25v255.826c0 21.981-13.989 35.97-35.97 35.97H658.154c-13.988 0-25.983-7.992-33.973-21.981-5.997-13.989-4-27.977 7.991-39.97l79.942-77.946c-55.954-51.973-121.918-77.955-199.863-77.955-37.975 0-75.95 8.002-113.924 21.99-37.975 15.985-67.948 37.976-91.934 63.957-25.982 23.987-47.973 53.96-63.957 91.934-29.983 73.955-29.983 153.895 0 227.85 15.984 37.976 37.975 67.947 63.957 91.934 23.986 25.982 53.959 47.973 91.934 63.956 37.974 13.989 75.95 21.991 113.924 21.991 45.967 0 87.942-9.998 127.913-29.982 41.976-17.99 75.951-45.967 101.931-83.943 7.993-4 11.994-5.995 13.989-5.995 5.997 0 9.998 1.994 13.988 5.995l77.958 77.946c3.989 4 5.986 7.993 5.986 11.994 0 1.994-1.996 5.995-3.99 11.994-43.973 51.962-93.941 91.934-151.9 117.914-53.958 25.983-115.92 39.972-185.874 39.972-61.961 0-119.921-11.984-169.89-33.973-57.96-25.985-105.923-57.963-139.896-93.943-35.98-33.972-67.958-81.936-93.94-139.897-45.967-101.93-45.967-237.846 0-339.777 25.982-57.96 57.96-105.923 93.94-139.896 33.973-35.98 81.936-67.958 139.896-93.94 49.968-21.99 107.928-33.974 169.89-33.974 55.963 0 109.923 9.988 161.885 29.973 53.97 21.99 101.933 51.963 139.908 89.938l73.954-73.944c9.987-9.998 23.987-13.988 39.971-8.002 13.988 8.002 21.98 19.995 21.98 33.984z',\n }),\n )\n\nUpdateIcon.displayName = 'UpdateIcon'\n"],"mappings":"wBASA,MAAM,GAID,CAAE,OAAO,GAAI,QAAQ,gBAAkB,CAAE,WAC5C,EACE,MACA,CACE,MAAS,6BACT,MAAS,CAAC,OAAQ,GAAG,EAAK,OAAO,CACjC,QAAW,gBACX,KAAQ,EACR,aAAc,GAAG,EAAK,OACvB,CACD,EAAM,SAAS,CAChB,CAEH,EAAW,YAAc,aAEzB,MAAa,MACX,EAAE,EAAY,CAAE,KAAM,aAAc,KAClC,EAAE,OAAQ,CACR,EAAG,wPACJ,CAAC,CACH,CAEH,EAAc,YAAc,gBAE5B,MAAa,MACX,EAAE,EAAY,CAAE,KAAM,cAAe,KACnC,EAAE,OAAQ,CACR,EAAG,iQACJ,CAAC,CACH,CAEH,EAAe,YAAc,iBAE7B,MAAa,MACX,EAAE,EAAY,CAAE,KAAM,QAAS,KAC7B,EAAE,OAAQ,CACR,EAAG,wZACJ,CAAC,CACH,CAEH,EAAU,YAAc,YAExB,MAAa,MACX,EAAE,EAAY,CAAE,KAAM,SAAU,KAC9B,EAAE,OAAQ,CACR,EAAG,guCACJ,CAAC,CACH,CAEH,EAAW,YAAc"}
@@ -0,0 +1,72 @@
1
+ //#region src/shared/locales.d.ts
2
+ interface PwaPluginLocaleData {
3
+ /**
4
+ * Install button text
5
+ *
6
+ * 安装按钮文字
7
+ */
8
+ install: string;
9
+ /**
10
+ * iOS install hint text
11
+ *
12
+ * iOS 安装文字
13
+ */
14
+ iOSInstall: string;
15
+ /**
16
+ * Cancel button text
17
+ *
18
+ * 取消按钮文字
19
+ */
20
+ cancel: string;
21
+ /**
22
+ * Close button text
23
+ *
24
+ * 关闭按钮文字
25
+ */
26
+ close: string;
27
+ /**
28
+ * Previous image text
29
+ *
30
+ * 上一张图片文字
31
+ */
32
+ prevImage: string;
33
+ /**
34
+ * Next image text
35
+ *
36
+ * 下一张图片文字
37
+ */
38
+ nextImage: string;
39
+ /**
40
+ * Install explain text
41
+ *
42
+ * 安装解释
43
+ */
44
+ explain: string;
45
+ /**
46
+ * Description label text
47
+ *
48
+ * 描述标签文字
49
+ */
50
+ desc: string;
51
+ /**
52
+ * Feature label text
53
+ *
54
+ * 特性标签文字
55
+ */
56
+ feature: string;
57
+ /**
58
+ * Update hint text
59
+ *
60
+ * 提示有更新文字
61
+ */
62
+ hint: string;
63
+ /**
64
+ * Update available text
65
+ *
66
+ * 更新可用文字
67
+ */
68
+ update: string;
69
+ }
70
+ //#endregion
71
+ export { PwaPluginLocaleData as t };
72
+ //# sourceMappingURL=locales-BlsUewPq.d.ts.map