Compare commits

..

15 commits

Author SHA1 Message Date
6184961153
chore: change settings for supnas 2024-05-18 10:02:07 +08:00
b54f356bb1
Merge 'upstream/dev' 2024-05-18 10:01:37 +08:00
dependabot[bot]
e15b16b19b
Bump nginx from 1.25.5-alpine to 1.26.0-alpine (#1718)
Bumps nginx from 1.25.5-alpine to 1.26.0-alpine.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 14:18:40 +10:00
dependabot[bot]
76d60b0958
Bump vite-plugin-static-copy from 0.13.0 to 1.0.4 (#1722)
* Bump vite-plugin-static-copy from 0.13.0 to 1.0.4

Bumps [vite-plugin-static-copy](https://github.com/sapphi-red/vite-plugin-static-copy) from 0.13.0 to 1.0.4.
- [Release notes](https://github.com/sapphi-red/vite-plugin-static-copy/releases)
- [Changelog](https://github.com/sapphi-red/vite-plugin-static-copy/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sapphi-red/vite-plugin-static-copy/compare/v0.13.0...vite-plugin-static-copy@1.0.4)

---
updated-dependencies:
- dependency-name: vite-plugin-static-copy
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Change type to module

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Krishan <33421343+kfiven@users.noreply.github.com>
2024-05-14 14:01:45 +10:00
aceArt-GmbH
97d02fd7c8
Scroll tab target into view (#1580) 2024-05-14 09:19:04 +05:30
dependabot[bot]
5817186129
Bump softprops/action-gh-release from 2.0.4 to 2.0.5 (#1734)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.4 to 2.0.5.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](9d7c94cfd0...69320dbe05)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 13:34:57 +10:00
dependabot[bot]
2d6dd3b0b2
Bump cla-assistant/github-action from 2.3.2 to 2.4.0 (#1735)
Bumps [cla-assistant/github-action](https://github.com/cla-assistant/github-action) from 2.3.2 to 2.4.0.
- [Release notes](https://github.com/cla-assistant/github-action/releases)
- [Commits](https://github.com/cla-assistant/github-action/compare/v2.3.2...v2.4.0)

---
updated-dependencies:
- dependency-name: cla-assistant/github-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 13:33:58 +10:00
Krishan
cd5d8e1c20
Fix pdf opening (#1732) 2024-05-12 16:14:34 +10:00
dependabot[bot]
fe2332ee87
Bump actions/checkout from 4.1.4 to 4.1.5 (#1721)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.4 to 4.1.5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.4...v4.1.5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-12 14:39:43 +10:00
Krishan
215537a261
Fix crash when img without src tag (#1731) 2024-05-12 10:06:35 +05:30
renovate[bot]
ec65b98874
Update dependency eslint-plugin-import to v2.29.1 (#1730)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-12 14:27:02 +10:00
renovate[bot]
f1c4a38a49
Update dependency sanitize-html to v2.12.1 [SECURITY] (#1729)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-12 14:25:07 +10:00
Krishan
5259f11679
Remove svg loader as available in Vite by default (#1728) 2024-05-12 09:47:41 +05:30
dependabot[bot]
565a6563e1
Bump pdfjs-dist from 3.10.111 to 4.2.67 (#1717)
* Bump pdfjs-dist from 3.10.111 to 4.2.67

Bumps [pdfjs-dist](https://github.com/mozilla/pdfjs-dist) from 3.10.111 to 4.2.67.
- [Commits](https://github.com/mozilla/pdfjs-dist/commits)

---
updated-dependencies:
- dependency-name: pdfjs-dist
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix pdfjs top level await

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Krishan <33421343+kfiven@users.noreply.github.com>
2024-05-12 14:06:53 +10:00
b011a4413a
fix: await mx.sendMessage() 2024-05-11 18:50:46 +08:00
14 changed files with 1680 additions and 3077 deletions

View file

@ -12,7 +12,7 @@ jobs:
PR_NUMBER: ${{github.event.number}}
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.4
uses: actions/checkout@v4.1.5
- name: Setup node
uses: actions/setup-node@v4.0.2
with:

View file

@ -12,7 +12,7 @@ jobs:
- 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'
# Beta Release
uses: cla-assistant/github-action@v2.3.2
uses: cla-assistant/github-action@v2.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the below token should have repo scope and must be manually added by you in the repository's secret

View file

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.4
uses: actions/checkout@v4.1.5
- name: Build Docker image
uses: docker/build-push-action@v5.3.0
with:

View file

@ -14,7 +14,7 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4.1.4
uses: actions/checkout@v4.1.5
- name: NPM Lockfile Changes
uses: codepunkt/npm-lockfile-changes@b40543471c36394409466fdb277a73a0856d7891
with:

View file

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.4
uses: actions/checkout@v4.1.5
- name: Setup node
uses: actions/setup-node@v4.0.2
with:

View file

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.4
uses: actions/checkout@v4.1.5
- name: Setup node
uses: actions/setup-node@v4.0.2
with:
@ -52,7 +52,7 @@ jobs:
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
- name: Upload tagged release
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87
with:
files: |
cinny-${{ steps.vars.outputs.tag }}.tar.gz
@ -66,7 +66,7 @@ jobs:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.4
uses: actions/checkout@v4.1.5
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
- name: Set up Docker Buildx

View file

@ -11,7 +11,7 @@ RUN npm run build
## App
FROM nginx:1.25.5-alpine
FROM nginx:1.26.0-alpine
COPY --from=builder /src/dist /app

4649
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -3,6 +3,7 @@
"version": "3.2.0",
"description": "Yet another matrix client",
"main": "index.js",
"type": "module",
"engines": {
"node": ">=16.0.0"
},
@ -52,7 +53,7 @@
"linkifyjs": "4.0.2",
"matrix-js-sdk": "29.1.0",
"millify": "6.1.0",
"pdfjs-dist": "3.10.111",
"pdfjs-dist": "4.2.67",
"prismjs": "1.29.0",
"prop-types": "15.8.1",
"react": "18.2.0",
@ -67,7 +68,7 @@
"react-modal": "3.16.1",
"react-range": "1.8.14",
"react-router-dom": "6.20.0",
"sanitize-html": "2.8.0",
"sanitize-html": "2.12.1",
"slate": "0.94.1",
"slate-history": "0.93.0",
"slate-react": "0.98.4",
@ -93,15 +94,15 @@
"eslint": "8.29.0",
"eslint-config-airbnb": "19.0.4",
"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-react": "7.31.11",
"eslint-plugin-react-hooks": "4.6.0",
"mini-svg-data-uri": "1.4.4",
"prettier": "2.8.1",
"sass": "1.56.2",
"typescript": "4.9.4",
"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"
}
}

View file

@ -41,8 +41,9 @@ TabItem.propTypes = {
function Tabs({ items, defaultSelected, onSelect }) {
const [selectedItem, setSelectedItem] = useState(items[defaultSelected]);
const handleTabSelection = (item, index) => {
const handleTabSelection = (item, index, target) => {
if (selectedItem === item) return;
target.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' });
setSelectedItem(item);
onSelect(item, index);
};
@ -57,7 +58,7 @@ function Tabs({ items, defaultSelected, onSelect }) {
selected={selectedItem.text === item.text}
iconSrc={item.iconSrc}
disabled={item.disabled}
onClick={() => handleTabSelection(item, index)}
onClick={(e) => handleTabSelection(item, index, e.currentTarget)}
>
{item.text}
</TabItem>

View file

@ -232,10 +232,12 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
});
handleCancelUpload(uploads);
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();
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);
resetEditorHistory(editor);
setReplyDraft();

View file

@ -107,7 +107,7 @@ const transformATag: Transformer = (tagName, attribs) => ({
const transformImgTag: Transformer = (tagName, attribs) => {
const { src } = attribs;
if (src.startsWith('mxc://') === false) {
if (typeof src === 'string' && src.startsWith('mxc://') === false) {
return {
tagName: 'a',
attribs: {

View file

@ -2,11 +2,11 @@ import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { wasm } from '@rollup/plugin-wasm';
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 inject from '@rollup/plugin-inject';
import { svgLoader } from './viteSvgLoader'
import buildConfig from "./build.config"
import topLevelAwait from 'vite-plugin-top-level-await';
import buildConfig from './build.config';
const copyFiles = {
targets: [
@ -15,8 +15,9 @@ const copyFiles = {
dest: '',
},
{
src: 'node_modules/pdfjs-dist/build/pdf.worker.min.js',
src: 'node_modules/pdfjs-dist/build/pdf.worker.min.mjs',
dest: '',
rename: 'pdf.worker.min.js',
},
{
src: 'netlify.toml',
@ -43,7 +44,7 @@ const copyFiles = {
dest: 'twemoji/',
},
],
}
};
export default defineConfig({
appType: 'spa',
@ -54,16 +55,21 @@ export default defineConfig({
host: true,
},
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),
vanillaExtractPlugin(),
svgLoader(),
wasm(),
react(),
],
optimizeDeps: {
esbuildOptions: {
define: {
global: 'globalThis'
global: 'globalThis',
},
plugins: [
// Enable esbuild polyfill plugins
@ -71,17 +77,15 @@ export default defineConfig({
process: false,
buffer: true,
}),
]
}
],
},
},
build: {
outDir: 'dist',
sourcemap: true,
copyPublicDir: false,
rollupOptions: {
plugins: [
inject({ Buffer: ['buffer', 'Buffer'] })
]
}
plugins: [inject({ Buffer: ['buffer', 'Buffer'] })],
},
},
});

View file

@ -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;
},
});