Skip to content

Commit

Permalink
Merge pull request #732 from The-Commit-Company/develop
Browse files Browse the repository at this point in the history
Release v1.4.3
  • Loading branch information
nikkothari22 authored Feb 27, 2024
2 parents 9d6807c + 083947c commit ca31021
Show file tree
Hide file tree
Showing 19 changed files with 403 additions and 223 deletions.
14 changes: 14 additions & 0 deletions .github/helper/install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -e

echo "Setting Up System Dependencies..."

sudo apt update
sudo apt remove mysql-server mysql-client
sudo apt install libcups2-dev redis-server mariadb-client-10.6

install_wkhtmltopdf() {
wget -q https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb
}
install_wkhtmltopdf &
11 changes: 6 additions & 5 deletions mobile/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mobile",
"private": true,
"version": "1.4.2",
"version": "1.4.3",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -27,12 +27,16 @@
"@tiptap/react": "^2.2.3",
"@tiptap/starter-kit": "^2.2.3",
"@tiptap/suggestion": "^2.2.3",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.17",
"cal-sans": "^1.0.1",
"emoji-picker-element": "^1.21.1",
"frappe-react-sdk": "^1.3.11",
"highlight.js": "^11.9.0",
"html-react-parser": "^5.1.8",
"ionicons": "^7.2.2",
"lowlight": "^3.1.0",
"postcss": "^8.4.35",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -46,12 +50,9 @@
"rehype-raw": "^7.0.0",
"rehype-sanitize": "^6.0.0",
"remark-gfm": "^4.0.0",
"tailwindcss": "^3.4.1",
"tippy.js": "^6.3.7",
"turndown": "^7.1.2",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.17",
"postcss": "^8.4.35",
"tailwindcss": "^3.4.1",
"vite": "^5.1.4",
"vite-plugin-pwa": "^0.19.0"
},
Expand Down
2 changes: 2 additions & 0 deletions mobile/src/components/common/MarkdownRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useMemo } from 'react'
import rehypeRaw from 'rehype-raw'
import ReactMarkdown from 'react-markdown'
import remarkGfm from 'remark-gfm'
import './renderer.css'

interface MarkdownRendererProps {
content: string,
Expand All @@ -21,6 +22,7 @@ export const MarkdownRenderer: React.FC<MarkdownRendererProps> = ({ content, tru

return <ReactMarkdown
remarkPlugins={[remarkGfm]}
className='content'
// @ts-ignore
rehypePlugins={[rehypeRaw]}>
{truncatedContent}
Expand Down
4 changes: 4 additions & 0 deletions mobile/src/components/common/renderer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.content .mention,
.content a {
color: #6E6ADE;
}
8 changes: 4 additions & 4 deletions mobile/src/components/features/chat-input/Tiptap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ export const Tiptap = ({ onMessageSend, messageSending, defaultText = '' }: Tipt
}),
UserMention.configure({
HTMLAttributes: {
class: 'mention text-blue-500',
class: 'mention',
},
renderText({ options, node }) {
renderHTML({ options, node }) {
return `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`
},
suggestion: {
Expand Down Expand Up @@ -177,9 +177,9 @@ export const Tiptap = ({ onMessageSend, messageSending, defaultText = '' }: Tipt
}),
ChannelMention.configure({
HTMLAttributes: {
class: 'mention text-blue-500',
class: 'mention',
},
renderText({ options, node }) {
renderHTML({ options, node }) {
return `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`
},
suggestion: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { UserFields } from '@/utils/users/UserListProvider'
import { UserAvatarBlock } from '../chat-view/MessageBlock'
import { IonText } from '@ionic/react'
import { DateObjectToTimeString } from '@/utils/operations/operations'
import parse from 'html-react-parser';

type MessagePreview = { message: MessageBlock, user?: UserFields }

Expand All @@ -17,7 +18,7 @@ const MessagePreview = ({ message, user }: MessagePreview) => {
<IonText className='font-bold text-zinc-50 text-sm'>{user?.full_name ?? message.data.owner}</IonText>
<IonText className='text-xs pl-1.5 text-zinc-500'>{DateObjectToTimeString(message.data.creation)}</IonText>
</div>
{message.data.message_type === 'Text' && <div className='text-base line-clamp-3 text-ellipsis'>{message.data.content}</div>}
{message.data.message_type === 'Text' && <div className='text-base line-clamp-3 text-ellipsis'>{parse(message.data.content ?? '')}</div>}
{message.data.message_type === 'Image' && <div className='flex items-center space-x-2'>
<img src={message.data.file} alt={`Image`} className='inline-block w-10 h-10 rounded-md' />
<p className='text-sm font-semibold'>📸 &nbsp;Image</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { useIsUserActive } from '@/hooks/useIsUserActive'
import { useInView } from 'react-intersection-observer';
import useLongPress from '@/hooks/useLongPress'
import MessageReactions from './components/MessageReactions'
import parse from 'html-react-parser';

type Props = {
message: MessageBlock,
Expand Down Expand Up @@ -214,7 +215,7 @@ const ReplyBlock = ({ message }: { message: Message }) => {
<IonText className='font-bold text-sm'>{user?.full_name ?? message.owner}</IonText>
{date && <IonText className='font-normal text-xs pl-2' color='medium'>on {DateObjectToFormattedDateStringWithoutYear(date)} at {DateObjectToTimeString(date)}</IonText>}
</div>
{message.message_type === 'Text' && <div className='text-sm text-neutral-400 line-clamp-3'>{message.content}</div>}
{message.message_type === 'Text' && <div className='text-sm text-neutral-400 line-clamp-3'>{parse(message.content ?? '')}</div>}
{message.message_type === 'Image' && <div className='flex items-center space-x-2'>
<img src={message.file} alt={`Image`} className='inline-block w-10 h-10 rounded-md' />
<p className='text-sm font-semibold'>📸 &nbsp;Image</p>
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/pages/profile/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const Profile = () => {
</IonItem>
</IonList>
<div className="ion-text-center mt-16">
<IonText><span className='cal-sans text-lg tracking-[0.03em]'>Raven</span> <span className='text-zinc-500'>v1.4.2</span></IonText>
<IonText><span className='cal-sans text-lg tracking-[0.03em]'>Raven</span> <span className='text-zinc-500'>v1.4.3</span></IonText>
<br />
<p className='text-zinc-500'>Made by <IonText className='font-bold'>The Commit Company</IonText></p>
</div>
Expand Down
87 changes: 80 additions & 7 deletions mobile/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2475,11 +2475,41 @@ dlv@^1.1.3:
resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79"
integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==

dom-serializer@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53"
integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==
dependencies:
domelementtype "^2.3.0"
domhandler "^5.0.2"
entities "^4.2.0"

domelementtype@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d"
integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==

[email protected], domhandler@^5.0.2, domhandler@^5.0.3:
version "5.0.3"
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31"
integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==
dependencies:
domelementtype "^2.3.0"

domino@^2.1.6:
version "2.1.6"
resolved "https://registry.yarnpkg.com/domino/-/domino-2.1.6.tgz#fe4ace4310526e5e7b9d12c7de01b7f485a57ffe"
integrity sha512-3VdM/SXBZX2omc9JF9nOPCtDaYQ67BGp5CoLpIQlO2KCAPETs8TcDHacF26jXadGbvUteZzRTeos2fhID5+ucQ==

domutils@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.1.0.tgz#c47f551278d3dc4b0b1ab8cbb42d751a6f0d824e"
integrity sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==
dependencies:
dom-serializer "^2.0.0"
domelementtype "^2.3.0"
domhandler "^5.0.3"

eastasianwidth@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb"
Expand Down Expand Up @@ -2535,7 +2565,7 @@ engine.io-parser@~5.2.1:
resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.2.2.tgz#37b48e2d23116919a3453738c5720455e64e1c49"
integrity sha512-RcyUFKA93/CXH20l4SoVvzZfrSDMOTUS3bWVpTt2FuFP+XYrL8i8oonHP7WInRyVHXh0n/ORtoeiE1os+8qkSw==

entities@^4.4.0:
entities@^4.2.0, entities@^4.4.0, entities@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48"
integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==
Expand Down Expand Up @@ -3129,6 +3159,24 @@ hoist-non-react-statics@^3.1.0:
dependencies:
react-is "^16.7.0"

[email protected]:
version "5.0.8"
resolved "https://registry.yarnpkg.com/html-dom-parser/-/html-dom-parser-5.0.8.tgz#540057d8eb7ff28c9fd45fa9eead374c34dae20c"
integrity sha512-vuWiX9EXgu8CJ5m9EP5c7bvBmNSuQVnrY8tl0z0ZX96Uth1IPlYH/8W8VZ/hBajFf18EN+j2pukbCNd01HEd1w==
dependencies:
domhandler "5.0.3"
htmlparser2 "9.1.0"

html-react-parser@^5.1.8:
version "5.1.8"
resolved "https://registry.yarnpkg.com/html-react-parser/-/html-react-parser-5.1.8.tgz#b8a294854845bce96627aa4f2ba738362c0ebcf8"
integrity sha512-oAXgUB4JYHFg4le3RQZtoge1TGMkwXSZPiWiexwdx3AuldgG+QEvbwMrscSViu90JNje3V4Zq5gCUSoTxa0W0A==
dependencies:
domhandler "5.0.3"
html-dom-parser "5.0.8"
react-property "2.0.2"
style-to-js "1.1.10"

html-url-attributes@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/html-url-attributes/-/html-url-attributes-3.0.0.tgz#fc4abf0c3fb437e2329c678b80abb3c62cff6f08"
Expand All @@ -3139,6 +3187,16 @@ html-void-elements@^3.0.0:
resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-3.0.0.tgz#fc9dbd84af9e747249034d4d62602def6517f1d7"
integrity sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==

[email protected]:
version "9.1.0"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-9.1.0.tgz#cdb498d8a75a51f739b61d3f718136c369bc8c23"
integrity sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==
dependencies:
domelementtype "^2.3.0"
domhandler "^5.0.3"
domutils "^3.1.0"
entities "^4.5.0"

idb@^7.0.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/idb/-/idb-7.1.1.tgz#d910ded866d32c7ced9befc5bfdf36f572ced72b"
Expand Down Expand Up @@ -4807,6 +4865,11 @@ react-markdown@^9.0.1:
unist-util-visit "^5.0.0"
vfile "^6.0.0"

[email protected]:
version "2.0.2"
resolved "https://registry.yarnpkg.com/react-property/-/react-property-2.0.2.tgz#d5ac9e244cef564880a610bc8d868bd6f60fdda6"
integrity sha512-+PbtI3VuDV0l6CleQMsx2gtK0JZbZKbpdu5ynr+lbsuvtmgbNcS3VM0tuY2QjFNOcWxvXeHjDpy42RO+4U2rug==

react-refresh@^0.14.0:
version "0.14.0"
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e"
Expand Down Expand Up @@ -5289,6 +5352,7 @@ split2@^4.2.0:
integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0:
name string-width-cjs
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -5373,6 +5437,7 @@ stringify-object@^3.3.0:
is-regexp "^1.0.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
name strip-ansi-cjs
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand All @@ -5391,20 +5456,27 @@ strip-comments@^2.0.1:
resolved "https://registry.yarnpkg.com/strip-comments/-/strip-comments-2.0.1.tgz#4ad11c3fbcac177a67a40ac224ca339ca1c1ba9b"
integrity sha512-ZprKx+bBLXv067WTCALv8SSz5l2+XhpYCsVtSqlMnkAXMWDq+/ekVbl1ghqP9rUHTzv6sm/DwCOiYutU/yp1fw==

style-to-object@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46"
integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==
style-to-[email protected]:
version "1.1.10"
resolved "https://registry.yarnpkg.com/style-to-js/-/style-to-js-1.1.10.tgz#ec20e1264ba11dc7f71b94b3a3a05566ed856e54"
integrity sha512-VC7MBJa+y0RZhpnLKDPmVRLRswsASLmixkiZ5R8xZpNT9VyjeRzwnXd2pBzAWdgSGv/pCNNH01gPCCUsB9exYg==
dependencies:
inline-style-parser "0.1.1"
style-to-object "1.0.5"

style-to-object@^1.0.0:
style-to-object@1.0.5, style-to-object@^1.0.0:
version "1.0.5"
resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-1.0.5.tgz#5e918349bc3a39eee3a804497d97fcbbf2f0d7c0"
integrity sha512-rDRwHtoDD3UMMrmZ6BzOW0naTjMsVZLIjsGleSKS/0Oz+cgCfAPRspaqJuE8rDzpKha/nEvnM0IF4seEAZUTKQ==
dependencies:
inline-style-parser "0.2.2"

style-to-object@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46"
integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==
dependencies:
inline-style-parser "0.1.1"

sucrase@^3.32.0:
version "3.35.0"
resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.35.0.tgz#57f17a3d7e19b36d8995f06679d121be914ae263"
Expand Down Expand Up @@ -6179,6 +6251,7 @@ [email protected], workbox-window@^7.0.0:
workbox-core "7.0.0"

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
name wrap-ansi-cjs
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "raven",
"version": "1.4.2",
"version": "1.4.3",
"description": "Messaging Application",
"main": "index.js",
"scripts": {
Expand Down
11 changes: 6 additions & 5 deletions raven-app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "raven-app",
"private": true,
"version": "1.4.2",
"version": "1.4.3",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -23,6 +23,8 @@
"@tiptap/react": "^2.2.2",
"@tiptap/starter-kit": "^2.2.2",
"@tiptap/suggestion": "^2.2.2",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.17",
"cal-sans": "^1.0.1",
"clsx": "^2.1.0",
"cmdk": "^0.2.1",
Expand All @@ -31,6 +33,7 @@
"emoji-picker-element": "^1.21.0",
"frappe-react-sdk": "^1.3.10",
"highlight.js": "^11.9.0",
"html-react-parser": "^5.1.8",
"js-cookie": "^3.0.5",
"lowlight": "^3.1.0",
"moment-timezone": "^0.5.45",
Expand All @@ -43,12 +46,10 @@
"react-intersection-observer": "^9.8.0",
"react-router-dom": "^6.22.0",
"react-virtuoso": "^4.6.3",
"tippy.js": "^6.3.7",
"turndown": "^7.1.2",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.17",
"tailwindcss": "^3.4.1",
"tailwindcss-animate": "^1.0.7",
"tippy.js": "^6.3.7",
"turndown": "^7.1.2",
"vite": "^5.1.1",
"vite-plugin-pwa": "^0.17.5",
"vite-plugin-svgr": "^4.2.0"
Expand Down
4 changes: 2 additions & 2 deletions raven-app/src/components/feature/chat/ChatInput/Tiptap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ const Tiptap = ({ slotBefore, fileProps, onMessageSend, replyMessage, clearReply
HTMLAttributes: {
class: 'mention',
},
renderText({ options, node }) {
renderHTML({ options, node }) {
return `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`
},
suggestion: {
Expand Down Expand Up @@ -331,7 +331,7 @@ const Tiptap = ({ slotBefore, fileProps, onMessageSend, replyMessage, clearReply
HTMLAttributes: {
class: 'mention',
},
renderText({ options, node }) {
renderHTML({ options, node }) {
return `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`
},
suggestion: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ export const CustomLink = TiptapLink.extend({
return [
"a",
mergeAttributes(HTMLAttributes, {
class: 'rt-Text rt-reset rt-Link rt-underline-auto break-all line-clamp-3'
class: 'rt-Text rt-reset rt-Link rt-underline-auto break-all'
}), // mergeAttributes is a exported function from @tiptap/core
0,
];
},
}).configure({
protocols: ['mailto', 'https', 'http']
protocols: ['mailto', 'https', 'http'],
openOnClick: false,
})

export type LinkPreviewDetails = {
Expand Down
Loading

0 comments on commit ca31021

Please sign in to comment.