Enhance language preferences and RTL support

- Set sort order when filtering by Boosts in Catch-up
- Fix bugs related to user language preferences
- Improve RTL text direction handling
- Disable scroll snap for wider viewports
- Add support for new post languages (Jawi Malay, Kashubian, Mohawk, and more)
This commit is contained in:
archos 2024-08-11 19:34:25 +02:00
parent c910224027
commit 2afe460672
18 changed files with 309 additions and 9 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-4zhrJw0D.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-SFPeyg8r.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"compose-SFPeyg8r.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-7xj_Hrid.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-ELVm98zU.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-q4UThEef.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-25Dzs_uX.js"></script>
<link rel="modulepreload" crossorigin href="../assets/useTitle-Mh8hVeGN.js">
<link rel="stylesheet" crossorigin href="../assets/style-Jyj9EDmC.css">
<script type="module" crossorigin src="../assets/compose-SFPeyg8r.js"></script>
<link rel="modulepreload" crossorigin href="../assets/useTitle-4zhrJw0D.js">
<link rel="stylesheet" crossorigin href="../assets/style-hHkodcxc.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-Gn0PSoQw.js"></script>
<link rel="modulepreload" crossorigin href="./assets/useTitle-Mh8hVeGN.js">
<script type="module" crossorigin src="./assets/main-q4UThEef.js"></script>
<link rel="modulepreload" crossorigin href="./assets/useTitle-4zhrJw0D.js">
<link rel="modulepreload" crossorigin href="./assets/tinyld-light-PxOyhYWY.js">
<link rel="modulepreload" crossorigin href="./assets/index-CeOZgm-k.js">
<link rel="modulepreload" crossorigin href="./assets/fuse-4Bvpr1kU.js">
<link rel="stylesheet" crossorigin href="./assets/style-Jyj9EDmC.css">
<link rel="modulepreload" crossorigin href="./assets/index-ELVm98zU.js">
<link rel="modulepreload" crossorigin href="./assets/fuse-7xj_Hrid.js">
<link rel="stylesheet" crossorigin href="./assets/style-hHkodcxc.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>

View File

@ -1 +1 @@
{"buildTime":"2024-08-08T01:46:42.798Z","commitHash":"dabb480"}
{"buildTime":"2024-08-11T11:20:32.450Z","commitHash":"16248c4"}