Compare commits
15 commits
a235fed768
...
6184961153
Author | SHA1 | Date | |
---|---|---|---|
6184961153 | |||
b54f356bb1 | |||
|
e15b16b19b | ||
|
76d60b0958 | ||
|
97d02fd7c8 | ||
|
5817186129 | ||
|
2d6dd3b0b2 | ||
|
cd5d8e1c20 | ||
|
fe2332ee87 | ||
|
215537a261 | ||
|
ec65b98874 | ||
|
f1c4a38a49 | ||
|
5259f11679 | ||
|
565a6563e1 | ||
b011a4413a |
18 changed files with 1696 additions and 3089 deletions
2
.github/workflows/build-pull-request.yml
vendored
2
.github/workflows/build-pull-request.yml
vendored
|
@ -12,7 +12,7 @@ jobs:
|
||||||
PR_NUMBER: ${{github.event.number}}
|
PR_NUMBER: ${{github.event.number}}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4.1.4
|
uses: actions/checkout@v4.1.5
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v4.0.2
|
uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
|
|
2
.github/workflows/cla.yml
vendored
2
.github/workflows/cla.yml
vendored
|
@ -12,7 +12,7 @@ jobs:
|
||||||
- name: 'CLA Assistant'
|
- name: 'CLA Assistant'
|
||||||
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
||||||
# Beta Release
|
# Beta Release
|
||||||
uses: cla-assistant/github-action@v2.3.2
|
uses: cla-assistant/github-action@v2.4.0
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# the below token should have repo scope and must be manually added by you in the repository's secret
|
# the below token should have repo scope and must be manually added by you in the repository's secret
|
||||||
|
|
2
.github/workflows/docker-pr.yml
vendored
2
.github/workflows/docker-pr.yml
vendored
|
@ -11,7 +11,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4.1.4
|
uses: actions/checkout@v4.1.5
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
uses: docker/build-push-action@v5.3.0
|
uses: docker/build-push-action@v5.3.0
|
||||||
with:
|
with:
|
||||||
|
|
2
.github/workflows/lockfile.yml
vendored
2
.github/workflows/lockfile.yml
vendored
|
@ -14,7 +14,7 @@ jobs:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4.1.4
|
uses: actions/checkout@v4.1.5
|
||||||
- name: NPM Lockfile Changes
|
- name: NPM Lockfile Changes
|
||||||
uses: codepunkt/npm-lockfile-changes@b40543471c36394409466fdb277a73a0856d7891
|
uses: codepunkt/npm-lockfile-changes@b40543471c36394409466fdb277a73a0856d7891
|
||||||
with:
|
with:
|
||||||
|
|
2
.github/workflows/netlify-dev.yml
vendored
2
.github/workflows/netlify-dev.yml
vendored
|
@ -11,7 +11,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4.1.4
|
uses: actions/checkout@v4.1.5
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v4.0.2
|
uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
|
|
6
.github/workflows/prod-deploy.yml
vendored
6
.github/workflows/prod-deploy.yml
vendored
|
@ -10,7 +10,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4.1.4
|
uses: actions/checkout@v4.1.5
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v4.0.2
|
uses: actions/setup-node@v4.0.2
|
||||||
with:
|
with:
|
||||||
|
@ -52,7 +52,7 @@ jobs:
|
||||||
gpg --export | xxd -p
|
gpg --export | xxd -p
|
||||||
echo '${{ secrets.GNUPG_PASSPHRASE }}' | gpg --batch --yes --pinentry-mode loopback --passphrase-fd 0 --armor --detach-sign cinny-${{ steps.vars.outputs.tag }}.tar.gz
|
echo '${{ secrets.GNUPG_PASSPHRASE }}' | gpg --batch --yes --pinentry-mode loopback --passphrase-fd 0 --armor --detach-sign cinny-${{ steps.vars.outputs.tag }}.tar.gz
|
||||||
- name: Upload tagged release
|
- name: Upload tagged release
|
||||||
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564
|
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
cinny-${{ steps.vars.outputs.tag }}.tar.gz
|
cinny-${{ steps.vars.outputs.tag }}.tar.gz
|
||||||
|
@ -66,7 +66,7 @@ jobs:
|
||||||
packages: write
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4.1.4
|
uses: actions/checkout@v4.1.5
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3.0.0
|
uses: docker/setup-qemu-action@v3.0.0
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
|
|
|
@ -11,7 +11,7 @@ RUN npm run build
|
||||||
|
|
||||||
|
|
||||||
## App
|
## App
|
||||||
FROM nginx:1.25.5-alpine
|
FROM nginx:1.26.0-alpine
|
||||||
|
|
||||||
COPY --from=builder /src/dist /app
|
COPY --from=builder /src/dist /app
|
||||||
|
|
||||||
|
|
13
config.json
13
config.json
|
@ -1,15 +1,10 @@
|
||||||
{
|
{
|
||||||
"defaultHomeserver": 2,
|
"defaultHomeserver": 0,
|
||||||
"homeserverList": [
|
"homeserverList": [
|
||||||
"converser.eu",
|
"chat.naskya.net",
|
||||||
"envs.net",
|
"chat.sup39.dev"
|
||||||
"matrix.org",
|
|
||||||
"monero.social",
|
|
||||||
"mozilla.org",
|
|
||||||
"xmr.se"
|
|
||||||
],
|
],
|
||||||
"allowCustomHomeservers": true,
|
"allowCustomHomeservers": false,
|
||||||
|
|
||||||
"hashRouter": {
|
"hashRouter": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"basename": "/"
|
"basename": "/"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
|
||||||
<title>Cinny</title>
|
<title>Cinny@さぽなす</title>
|
||||||
<meta name="name" content="Cinny" />
|
<meta name="name" content="Cinny" />
|
||||||
<meta name="author" content="Ajay Bura" />
|
<meta name="author" content="Ajay Bura" />
|
||||||
<meta
|
<meta
|
||||||
|
@ -26,6 +26,7 @@
|
||||||
<meta name="theme-color" content="#000000" />
|
<meta name="theme-color" content="#000000" />
|
||||||
|
|
||||||
<link id="favicon" rel="shortcut icon" href="./public/favicon.ico" />
|
<link id="favicon" rel="shortcut icon" href="./public/favicon.ico" />
|
||||||
|
<link rel="stylesheet" href="/mx-uc.css" />
|
||||||
|
|
||||||
<link rel="manifest" href="/manifest.json" />
|
<link rel="manifest" href="/manifest.json" />
|
||||||
<meta name="mobile-web-app-capable" content="yes" />
|
<meta name="mobile-web-app-capable" content="yes" />
|
||||||
|
|
4649
package-lock.json
generated
4649
package-lock.json
generated
File diff suppressed because it is too large
Load diff
11
package.json
11
package.json
|
@ -3,6 +3,7 @@
|
||||||
"version": "3.2.0",
|
"version": "3.2.0",
|
||||||
"description": "Yet another matrix client",
|
"description": "Yet another matrix client",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
"type": "module",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0"
|
"node": ">=16.0.0"
|
||||||
},
|
},
|
||||||
|
@ -52,7 +53,7 @@
|
||||||
"linkifyjs": "4.0.2",
|
"linkifyjs": "4.0.2",
|
||||||
"matrix-js-sdk": "29.1.0",
|
"matrix-js-sdk": "29.1.0",
|
||||||
"millify": "6.1.0",
|
"millify": "6.1.0",
|
||||||
"pdfjs-dist": "3.10.111",
|
"pdfjs-dist": "4.2.67",
|
||||||
"prismjs": "1.29.0",
|
"prismjs": "1.29.0",
|
||||||
"prop-types": "15.8.1",
|
"prop-types": "15.8.1",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
|
@ -67,7 +68,7 @@
|
||||||
"react-modal": "3.16.1",
|
"react-modal": "3.16.1",
|
||||||
"react-range": "1.8.14",
|
"react-range": "1.8.14",
|
||||||
"react-router-dom": "6.20.0",
|
"react-router-dom": "6.20.0",
|
||||||
"sanitize-html": "2.8.0",
|
"sanitize-html": "2.12.1",
|
||||||
"slate": "0.94.1",
|
"slate": "0.94.1",
|
||||||
"slate-history": "0.93.0",
|
"slate-history": "0.93.0",
|
||||||
"slate-react": "0.98.4",
|
"slate-react": "0.98.4",
|
||||||
|
@ -93,15 +94,15 @@
|
||||||
"eslint": "8.29.0",
|
"eslint": "8.29.0",
|
||||||
"eslint-config-airbnb": "19.0.4",
|
"eslint-config-airbnb": "19.0.4",
|
||||||
"eslint-config-prettier": "8.5.0",
|
"eslint-config-prettier": "8.5.0",
|
||||||
"eslint-plugin-import": "2.26.0",
|
"eslint-plugin-import": "2.29.1",
|
||||||
"eslint-plugin-jsx-a11y": "6.6.1",
|
"eslint-plugin-jsx-a11y": "6.6.1",
|
||||||
"eslint-plugin-react": "7.31.11",
|
"eslint-plugin-react": "7.31.11",
|
||||||
"eslint-plugin-react-hooks": "4.6.0",
|
"eslint-plugin-react-hooks": "4.6.0",
|
||||||
"mini-svg-data-uri": "1.4.4",
|
|
||||||
"prettier": "2.8.1",
|
"prettier": "2.8.1",
|
||||||
"sass": "1.56.2",
|
"sass": "1.56.2",
|
||||||
"typescript": "4.9.4",
|
"typescript": "4.9.4",
|
||||||
"vite": "5.0.13",
|
"vite": "5.0.13",
|
||||||
"vite-plugin-static-copy": "0.13.0"
|
"vite-plugin-static-copy": "1.0.4",
|
||||||
|
"vite-plugin-top-level-await": "1.4.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "Cinny",
|
"name": "Cinny@さぽなす",
|
||||||
"short_name": "Cinny",
|
"short_name": "Cinny",
|
||||||
"description": "Yet another matrix client",
|
"description": "Yet another matrix client for supnas",
|
||||||
"dir": "auto",
|
"dir": "auto",
|
||||||
"lang": "en-US",
|
"lang": "en-US",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
|
|
4
public/mx-uc.css
Normal file
4
public/mx-uc.css
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
:root {
|
||||||
|
--mx-uc--sup39-chat_sup39_dev: #2EE5B8;
|
||||||
|
--mx-uc--naskya-chat_naskya_net: #F25A85;
|
||||||
|
}
|
|
@ -41,8 +41,9 @@ TabItem.propTypes = {
|
||||||
function Tabs({ items, defaultSelected, onSelect }) {
|
function Tabs({ items, defaultSelected, onSelect }) {
|
||||||
const [selectedItem, setSelectedItem] = useState(items[defaultSelected]);
|
const [selectedItem, setSelectedItem] = useState(items[defaultSelected]);
|
||||||
|
|
||||||
const handleTabSelection = (item, index) => {
|
const handleTabSelection = (item, index, target) => {
|
||||||
if (selectedItem === item) return;
|
if (selectedItem === item) return;
|
||||||
|
target.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' });
|
||||||
setSelectedItem(item);
|
setSelectedItem(item);
|
||||||
onSelect(item, index);
|
onSelect(item, index);
|
||||||
};
|
};
|
||||||
|
@ -57,7 +58,7 @@ function Tabs({ items, defaultSelected, onSelect }) {
|
||||||
selected={selectedItem.text === item.text}
|
selected={selectedItem.text === item.text}
|
||||||
iconSrc={item.iconSrc}
|
iconSrc={item.iconSrc}
|
||||||
disabled={item.disabled}
|
disabled={item.disabled}
|
||||||
onClick={() => handleTabSelection(item, index)}
|
onClick={(e) => handleTabSelection(item, index, e.currentTarget)}
|
||||||
>
|
>
|
||||||
{item.text}
|
{item.text}
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
|
@ -232,10 +232,12 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
|
||||||
});
|
});
|
||||||
handleCancelUpload(uploads);
|
handleCancelUpload(uploads);
|
||||||
const contents = fulfilledPromiseSettledResult(await Promise.allSettled(contentsPromises));
|
const contents = fulfilledPromiseSettledResult(await Promise.allSettled(contentsPromises));
|
||||||
contents.forEach((content) => mx.sendMessage(roomId, content));
|
for (const content of contents) {
|
||||||
|
await mx.sendMessage(roomId, content);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const submit = useCallback(() => {
|
const submit = useCallback(async () => {
|
||||||
uploadBoardHandlers.current?.handleSend();
|
uploadBoardHandlers.current?.handleSend();
|
||||||
|
|
||||||
const commandName = getBeginCommand(editor);
|
const commandName = getBeginCommand(editor);
|
||||||
|
@ -304,7 +306,7 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
mx.sendMessage(roomId, content);
|
await mx.sendMessage(roomId, content);
|
||||||
resetEditor(editor);
|
resetEditor(editor);
|
||||||
resetEditorHistory(editor);
|
resetEditorHistory(editor);
|
||||||
setReplyDraft();
|
setReplyDraft();
|
||||||
|
|
|
@ -107,7 +107,7 @@ const transformATag: Transformer = (tagName, attribs) => ({
|
||||||
|
|
||||||
const transformImgTag: Transformer = (tagName, attribs) => {
|
const transformImgTag: Transformer = (tagName, attribs) => {
|
||||||
const { src } = attribs;
|
const { src } = attribs;
|
||||||
if (src.startsWith('mxc://') === false) {
|
if (typeof src === 'string' && src.startsWith('mxc://') === false) {
|
||||||
return {
|
return {
|
||||||
tagName: 'a',
|
tagName: 'a',
|
||||||
attribs: {
|
attribs: {
|
||||||
|
|
|
@ -2,11 +2,11 @@ import { defineConfig } from 'vite';
|
||||||
import react from '@vitejs/plugin-react';
|
import react from '@vitejs/plugin-react';
|
||||||
import { wasm } from '@rollup/plugin-wasm';
|
import { wasm } from '@rollup/plugin-wasm';
|
||||||
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
||||||
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
||||||
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill';
|
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill';
|
||||||
import inject from '@rollup/plugin-inject';
|
import inject from '@rollup/plugin-inject';
|
||||||
import { svgLoader } from './viteSvgLoader'
|
import topLevelAwait from 'vite-plugin-top-level-await';
|
||||||
import buildConfig from "./build.config"
|
import buildConfig from './build.config';
|
||||||
|
|
||||||
const copyFiles = {
|
const copyFiles = {
|
||||||
targets: [
|
targets: [
|
||||||
|
@ -15,8 +15,9 @@ const copyFiles = {
|
||||||
dest: '',
|
dest: '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: 'node_modules/pdfjs-dist/build/pdf.worker.min.js',
|
src: 'node_modules/pdfjs-dist/build/pdf.worker.min.mjs',
|
||||||
dest: '',
|
dest: '',
|
||||||
|
rename: 'pdf.worker.min.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: 'netlify.toml',
|
src: 'netlify.toml',
|
||||||
|
@ -34,12 +35,16 @@ const copyFiles = {
|
||||||
src: 'public/res/android',
|
src: 'public/res/android',
|
||||||
dest: 'public/',
|
dest: 'public/',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
src: 'public/mx-uc.css',
|
||||||
|
dest: '',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
src: 'twemoji/assets/svg/*',
|
src: 'twemoji/assets/svg/*',
|
||||||
dest: 'twemoji/',
|
dest: 'twemoji/',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
};
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
appType: 'spa',
|
appType: 'spa',
|
||||||
|
@ -50,16 +55,21 @@ export default defineConfig({
|
||||||
host: true,
|
host: true,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
topLevelAwait({
|
||||||
|
// The export name of top-level await promise for each chunk module
|
||||||
|
promiseExportName: '__tla',
|
||||||
|
// The function to generate import names of top-level await promise in each chunk module
|
||||||
|
promiseImportName: (i) => `__tla_${i}`,
|
||||||
|
}),
|
||||||
viteStaticCopy(copyFiles),
|
viteStaticCopy(copyFiles),
|
||||||
vanillaExtractPlugin(),
|
vanillaExtractPlugin(),
|
||||||
svgLoader(),
|
|
||||||
wasm(),
|
wasm(),
|
||||||
react(),
|
react(),
|
||||||
],
|
],
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
esbuildOptions: {
|
esbuildOptions: {
|
||||||
define: {
|
define: {
|
||||||
global: 'globalThis'
|
global: 'globalThis',
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
// Enable esbuild polyfill plugins
|
// Enable esbuild polyfill plugins
|
||||||
|
@ -67,17 +77,15 @@ export default defineConfig({
|
||||||
process: false,
|
process: false,
|
||||||
buffer: true,
|
buffer: true,
|
||||||
}),
|
}),
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
outDir: 'dist',
|
outDir: 'dist',
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
copyPublicDir: false,
|
copyPublicDir: false,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
plugins: [
|
plugins: [inject({ Buffer: ['buffer', 'Buffer'] })],
|
||||||
inject({ Buffer: ['buffer', 'Buffer'] })
|
},
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
import svgToMiniDataURI from 'mini-svg-data-uri';
|
|
||||||
import type { Plugin } from 'rollup';
|
|
||||||
import fs from 'fs';
|
|
||||||
|
|
||||||
// TODO: remove this once https://github.com/vitejs/vite/pull/2909 gets merged
|
|
||||||
export const svgLoader = (): Plugin => ({
|
|
||||||
name: 'vite-svg-patch-plugin',
|
|
||||||
transform: (code, id) => {
|
|
||||||
if (id.endsWith('.svg')) {
|
|
||||||
const extractedSvg = fs.readFileSync(id, 'utf8');
|
|
||||||
const datauri = svgToMiniDataURI.toSrcset(extractedSvg);
|
|
||||||
return `export default "${datauri}"`;
|
|
||||||
}
|
|
||||||
return code;
|
|
||||||
},
|
|
||||||
});
|
|
Loading…
Reference in a new issue