nová verze phanpy

This commit is contained in:
archos 2024-08-02 15:18:54 +02:00
parent 31d29abda9
commit 3c7b935d1e
20 changed files with 311 additions and 11 deletions

View File

@ -0,0 +1,2 @@
import{h as w,I as p,U as S,y as i,c as e,C as f,Y as h}from"./useTitle-YZXo8QRp.js";window.opener&&(console=window.opener.console);function m(){var s,a;const[t,d]=w("default"),{editStatus:n,replyToStatus:o,draftStatus:l}=window.__COMPOSE__||{};return p(n?"Editing source status":o?`Replying to @${((s=o.account)==null?void 0:s.acct)||((a=o.account)==null?void 0:a.username)}`:"Compose"),i(()=>{S()},[]),i(()=>{if(t==="closed"){try{window.opener.focus()}catch{}window.close()}},[t]),t==="closed"?e("div",{class:"box",children:[e("p",{children:"You may close this page now."}),e("p",{children:e("button",{onClick:()=>{window.close()},children:"Close window"})})]}):e(f,{editStatus:n,replyToStatus:o,draftStatus:l,standalone:!0,hasOpener:window.opener,onClose:c=>{const{newStatus:r,fn:u=()=>{}}=c||{};try{r&&window.opener.__STATES__.reloadStatusPage++,u(),d("closed")}catch{}}})}h(e(m,{}),document.getElementById("app-standalone"));
//# sourceMappingURL=compose-BMVCbqt4.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"compose-BMVCbqt4.js","sources":["../../src/compose.jsx"],"sourcesContent":["import './index.css';\nimport './app.css';\nimport './polyfills';\n\nimport { render } from 'preact';\nimport { useEffect, useState } from 'preact/hooks';\n\nimport ComposeSuspense from './components/compose-suspense';\nimport { initStates } from './utils/states';\nimport useTitle from './utils/useTitle';\n\nif (window.opener) {\n console = window.opener.console;\n}\n\nfunction App() {\n const [uiState, setUIState] = useState('default');\n\n const { editStatus, replyToStatus, draftStatus } = window.__COMPOSE__ || {};\n\n useTitle(\n editStatus\n ? 'Editing source status'\n : replyToStatus\n ? `Replying to @${\n replyToStatus.account?.acct || replyToStatus.account?.username\n }`\n : 'Compose',\n );\n\n useEffect(() => {\n initStates();\n }, []);\n\n useEffect(() => {\n if (uiState === 'closed') {\n try {\n // Focus parent window\n window.opener.focus();\n } catch (e) {}\n window.close();\n }\n }, [uiState]);\n\n if (uiState === 'closed') {\n return (\n <div class=\"box\">\n <p>You may close this page now.</p>\n <p>\n <button\n onClick={() => {\n window.close();\n }}\n >\n Close window\n </button>\n </p>\n </div>\n );\n }\n\n console.debug('OPEN COMPOSE');\n\n return (\n <ComposeSuspense\n editStatus={editStatus}\n replyToStatus={replyToStatus}\n draftStatus={draftStatus}\n standalone\n hasOpener={window.opener}\n onClose={(results) => {\n const { newStatus, fn = () => {} } = results || {};\n try {\n if (newStatus) {\n window.opener.__STATES__.reloadStatusPage++;\n }\n fn();\n setUIState('closed');\n } catch (e) {}\n }}\n />\n );\n}\n\nrender(<App />, document.getElementById('app-standalone'));\n"],"names":["window","opener","console","App","uiState","setUIState","useState","editStatus","replyToStatus","draftStatus","__COMPOSE__","account","acct","username","useEffect","initStates","focus","close","_jsxs","class","children","_jsx","onClick","standalone","hasOpener","newStatus","results","fn","render"],"mappings":"qFAWIA,OAAOC,SACTC,QAAUF,OAAOC,OAAOC,SAG1B,SAASC,GAAM,SACb,KAAM,CAACC,EAASC,CAAU,EAAIC,EAAS,SAAS,EAE1C,CAAEC,WAAAA,EAAYC,cAAAA,EAAeC,YAAAA,CAAAA,EAAgBT,OAAOU,aAAe,GA0BzE,OAvBEH,EAAAA,EACI,wBACAC,EACA,kBACEA,EAAAA,EAAcG,UAAdH,YAAAA,EAAuBI,SAAQJ,EAAAA,EAAcG,UAAdH,YAAAA,EAAuBK,SAAQ,GAEhE,SACN,EAEAC,EAAU,IAAM,CACHC,GACb,EAAG,CAAE,CAAA,EAELD,EAAU,IAAM,CACd,GAAIV,IAAY,SAAU,CACpB,GAAA,CAEFJ,OAAOC,OAAOe,aACJ,CAAC,CACbhB,OAAOiB,MAAM,CACf,CAAA,EACC,CAACb,CAAO,CAAC,EAERA,IAAY,SAEZc,EAAA,MAAA,CAAKC,MAAM,MAAKC,UACdC,EAAA,IAAA,CAAAD,SAAG,8BAAA,CAA+B,EAClCC,EAAA,IAAA,CAAAD,SACEC,EAAA,SAAA,CACEC,QAASA,IAAM,CACbtB,OAAOiB,MAAM,CACf,EAAEG,SACH,cAAA,CAEO,CAAA,CACP,CAAC,CAAA,CACD,EAITlB,IAA4B,CAE5B,WAAAK,EAEIA,cAAAA,EACAC,YAAAA,EACAC,WAAAA,GACAc,UAAU,OAAA,OACVC,WAAkBvB,OAEV,UAAAwB,EAAEA,GAAAA,EAAAA,IAAAA,EAAsB,EAACC,GAAA,CAAA,EAAE,GAAIA,CACjCD,GACF,OAAe,OAAA,WAAA,mBAEfE,IACGtB,EAAA,QAAA,CACHA,MAAAA,EACW,CAAA,CACf,CAAA,CAGNuB,EAAAP,EAAAlB,EAAA,CAAA,CAAA,EAAA,SAAA,eAAA,gBAAA,CAAA"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

183
assets/fuse-BiYvWrZm.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
assets/index-A6D3rukc.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

32
assets/main-63N-3YbG.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7,9 +7,9 @@
<title>Compose / Phanpy</title>
<meta name="color-scheme" content="dark light" />
<meta name="google" content="notranslate" />
<script type="module" crossorigin src="../assets/compose-Z2yW_miJ.js"></script>
<link rel="modulepreload" crossorigin href="../assets/useTitle-KlNTnsJV.js">
<link rel="stylesheet" crossorigin href="../assets/style-U9i6KDxy.css">
<script type="module" crossorigin src="../assets/compose-BMVCbqt4.js"></script>
<link rel="modulepreload" crossorigin href="../assets/useTitle-YZXo8QRp.js">
<link rel="stylesheet" crossorigin href="../assets/style-KZH8lEC5.css">
<link rel="manifest" href="./manifest.webmanifest"><script id="vite-plugin-pwa:inline-sw">if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('./sw.js', { scope: './' })})}</script></head>
<body>
<div id="app-standalone"></div>

View File

@ -55,12 +55,12 @@
content="Minimalistic opinionated Mastodon web client"
/>
<meta property="og:image" content="https://phanpy.social/og-image-2.jpg" />
<script type="module" crossorigin src="./assets/main-FOJmGvRC.js"></script>
<link rel="modulepreload" crossorigin href="./assets/useTitle-KlNTnsJV.js">
<script type="module" crossorigin src="./assets/main-63N-3YbG.js"></script>
<link rel="modulepreload" crossorigin href="./assets/useTitle-YZXo8QRp.js">
<link rel="modulepreload" crossorigin href="./assets/tinyld-light-PxOyhYWY.js">
<link rel="modulepreload" crossorigin href="./assets/index-cp67bciK.js">
<link rel="modulepreload" crossorigin href="./assets/fuse-eCqHk9H3.js">
<link rel="stylesheet" crossorigin href="./assets/style-U9i6KDxy.css">
<link rel="modulepreload" crossorigin href="./assets/index-A6D3rukc.js">
<link rel="modulepreload" crossorigin href="./assets/fuse-BiYvWrZm.js">
<link rel="stylesheet" crossorigin href="./assets/style-KZH8lEC5.css">
<link rel="manifest" href="./manifest.webmanifest"><script id="vite-plugin-pwa:inline-sw">if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('./sw.js', { scope: './' })})}</script></head>
<body>
<div id="app"></div>

2
sw.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"buildTime":"2024-07-22T10:39:10.061Z","commitHash":"81e330d"}
{"buildTime":"2024-08-02T12:58:02.851Z","commitHash":"1d77713"}