diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml index 6d80727a..441da0de 100644 --- a/.github/workflows/build-pull-request.yml +++ b/.github/workflows/build-pull-request.yml @@ -25,7 +25,7 @@ jobs: NODE_OPTIONS: '--max_old_space_size=4096' run: npm run build - name: Upload artifact - uses: actions/upload-artifact@v4.6.1 + uses: actions/upload-artifact@v4.6.2 with: name: preview path: dist @@ -33,7 +33,7 @@ jobs: - name: Save pr number run: echo ${PR_NUMBER} > ./pr.txt - name: Upload pr number - uses: actions/upload-artifact@v4.6.1 + uses: actions/upload-artifact@v4.6.2 with: name: pr path: ./pr.txt diff --git a/contrib/caddy/caddyfile b/contrib/caddy/caddyfile index e55efe92..d23dcccb 100644 --- a/contrib/caddy/caddyfile +++ b/contrib/caddy/caddyfile @@ -1,6 +1,6 @@ +# more info: https://caddyserver.com/docs/caddyfile/patterns#single-page-apps-spas cinny.domain.tld { - @nativeRouter not file {path} / - rewrite @nativeRouter {http.matchers.file.relative} - root * /path/to/caddy/dist + root * /path/to/cinny/dist + try_files {path} / index.html file_server } diff --git a/package-lock.json b/package-lock.json index 83c6facd..ac6f5d30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "await-to-js": "3.0.0", "blurhash": "2.0.4", "browser-encrypt-attachment": "0.3.0", + "chroma-js": "3.1.2", "classnames": "2.3.2", "dateformat": "5.0.3", "dayjs": "1.11.10", @@ -74,6 +75,7 @@ "@esbuild-plugins/node-globals-polyfill": "0.2.3", "@rollup/plugin-inject": "5.0.3", "@rollup/plugin-wasm": "6.1.1", + "@types/chroma-js": "3.1.1", "@types/file-saver": "2.0.5", "@types/is-hotkey": "0.1.10", "@types/node": "18.11.18", @@ -97,7 +99,7 @@ "prettier": "2.8.1", "sass": "1.56.2", "typescript": "4.9.4", - "vite": "5.4.12", + "vite": "5.4.15", "vite-plugin-pwa": "0.20.5", "vite-plugin-static-copy": "1.0.4", "vite-plugin-top-level-await": "1.4.4" @@ -4573,6 +4575,13 @@ "@babel/types": "^7.20.7" } }, + "node_modules/@types/chroma-js": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/chroma-js/-/chroma-js-3.1.1.tgz", + "integrity": "sha512-SFCr4edNkZ1bGaLzGz7rgR1bRzVX4MmMxwsIa3/Bh6ose8v+hRpneoizHv0KChdjxaXyjRtaMq7sCuZSzPomQA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -5730,6 +5739,12 @@ "node": ">=10" } }, + "node_modules/chroma-js": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/chroma-js/-/chroma-js-3.1.2.tgz", + "integrity": "sha512-IJnETTalXbsLx1eKEgx19d5L6SRM7cH4vINw/99p/M11HCuXGRWL+6YmCm7FWFGIo6dtWuQoQi1dc5yQ7ESIHg==", + "license": "(BSD-3-Clause AND Apache-2.0)" + }, "node_modules/classnames": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", @@ -11289,9 +11304,9 @@ } }, "node_modules/vite": { - "version": "5.4.12", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.12.tgz", - "integrity": "sha512-KwUaKB27TvWwDJr1GjjWthLMATbGEbeWYZIbGZ5qFIsgPP3vWzLu4cVooqhm5/Z2SPDUMjyPVjTztm5tYKwQxA==", + "version": "5.4.15", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.15.tgz", + "integrity": "sha512-6ANcZRivqL/4WtwPGTKNaosuNJr5tWiftOC7liM7G9+rMb8+oeJeyzymDu4rTN93seySBmbjSfsS3Vzr19KNtA==", "license": "MIT", "dependencies": { "esbuild": "^0.21.3", diff --git a/package.json b/package.json index 59273043..dbc5e105 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "await-to-js": "3.0.0", "blurhash": "2.0.4", "browser-encrypt-attachment": "0.3.0", + "chroma-js": "3.1.2", "classnames": "2.3.2", "dateformat": "5.0.3", "dayjs": "1.11.10", @@ -85,6 +86,7 @@ "@esbuild-plugins/node-globals-polyfill": "0.2.3", "@rollup/plugin-inject": "5.0.3", "@rollup/plugin-wasm": "6.1.1", + "@types/chroma-js": "3.1.1", "@types/file-saver": "2.0.5", "@types/is-hotkey": "0.1.10", "@types/node": "18.11.18", @@ -108,7 +110,7 @@ "prettier": "2.8.1", "sass": "1.56.2", "typescript": "4.9.4", - "vite": "5.4.12", + "vite": "5.4.15", "vite-plugin-pwa": "0.20.5", "vite-plugin-static-copy": "1.0.4", "vite-plugin-top-level-await": "1.4.4" diff --git a/src/app/components/JoinRulesSwitcher.tsx b/src/app/components/JoinRulesSwitcher.tsx index ddd1903f..e78c19ce 100644 --- a/src/app/components/JoinRulesSwitcher.tsx +++ b/src/app/components/JoinRulesSwitcher.tsx @@ -29,6 +29,17 @@ export const useRoomJoinRuleIcon = (): JoinRuleIcons => }), [] ); +export const useSpaceJoinRuleIcon = (): JoinRuleIcons => + useMemo( + () => ({ + [JoinRule.Invite]: Icons.SpaceLock, + [JoinRule.Knock]: Icons.SpaceLock, + [JoinRule.Restricted]: Icons.Space, + [JoinRule.Public]: Icons.SpaceGlobe, + [JoinRule.Private]: Icons.SpaceLock, + }), + [] + ); type JoinRuleLabels = Record; export const useRoomJoinRuleLabel = (): JoinRuleLabels => diff --git a/src/app/components/RenderMessageContent.tsx b/src/app/components/RenderMessageContent.tsx index 55b0ffc2..2457e5e3 100644 --- a/src/app/components/RenderMessageContent.tsx +++ b/src/app/components/RenderMessageContent.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { MsgType } from 'matrix-js-sdk'; import { HTMLReactParserOptions } from 'html-react-parser'; import { Opts } from 'linkifyjs'; +import { config } from 'folds'; import { AudioContent, DownloadFile, @@ -29,7 +30,7 @@ import { ImageViewer } from './image-viewer'; import { PdfViewer } from './Pdf-viewer'; import { TextViewer } from './text-viewer'; import { testMatrixTo } from '../plugins/matrix-to'; -import {IImageContent} from "../../types/matrix/common"; +import { IImageContent } from '../../types/matrix/common'; type RenderMessageContentProps = { displayName: string; @@ -70,9 +71,10 @@ export function RenderMessageContent({ }; const renderCaption = () => { const content: IImageContent = getContent(); - if(content.filename && content.filename !== content.body) { + if (content.filename && content.filename !== content.body) { return ( ( @@ -85,41 +87,40 @@ export function RenderMessageContent({ )} renderUrlsPreview={urlPreview ? renderUrlsPreview : undefined} /> - ) + ); } return null; - } + }; const renderFile = () => ( <> ( - ( - } - /> - )} - renderAsTextFile={() => ( - } - /> - )} - > - - - + ( + } + /> + )} + renderAsTextFile={() => ( + } + /> + )} + > + + )} outlined={outlineAttachment} /> @@ -188,12 +189,12 @@ export function RenderMessageContent({ ( - } - renderViewer={(p) => } - /> + } + renderViewer={(p) => } + /> )} outlined={outlineAttachment} /> @@ -218,13 +219,13 @@ export function RenderMessageContent({ renderThumbnail={ mediaAutoLoad ? () => ( - ( - {body} - )} - /> - ) + ( + {body} + )} + /> + ) : undefined } renderVideo={(p) =>