Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.5.2 #872

Merged
merged 42 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
aaaca58
wip: use SWR hook for pagination
yjane99 Apr 5, 2024
5478ff9
fix: newlines do not work in block quotes
prathameshkurunkar7 Apr 11, 2024
206203f
fix(poll): Always retain sequence of poll options
surajshetty3416 Apr 11, 2024
2a1fbd4
fix: Only show voted options in the poll results
surajshetty3416 Apr 11, 2024
1f3a38a
Merge pull request #853 from The-Commit-Company/844-bug-newlines-dont…
nikkothari22 Apr 11, 2024
cdfd65d
Merge pull request #854 from surajshetty3416/fix-poll-ux
nikkothari22 Apr 11, 2024
902b0ab
wip
yjane99 Apr 12, 2024
c64635f
fix: error banner on web app
nikkothari22 Apr 12, 2024
aaa31f4
Merge pull request #855 from The-Commit-Company/790-error-banner-does…
nikkothari22 Apr 12, 2024
3c3a17b
Delete .github/workflows/apply-issue-labels-to-pr.yml
nikkothari22 Apr 12, 2024
eb0d48d
fix: do not send notification if no peer user
nikkothari22 Apr 12, 2024
d3cb771
fix: do not play sound for self message
nikkothari22 Apr 12, 2024
f03b68a
fix: max height set on videos
nikkothari22 Apr 12, 2024
d95748f
Merge pull request #859 from The-Commit-Company/858-videos-should-hav…
nikkothari22 Apr 12, 2024
d790fdb
feat: pagination
yjane99 Apr 12, 2024
07b7dc2
build: bumped 'frappe-react-sdk' to latest version
yjane99 Apr 12, 2024
45b0a6b
chore: remove 'swr'
yjane99 Apr 12, 2024
9c8bd49
fix: import `useSWRInfinite` hook from 'frappe-react-sdk'
yjane99 Apr 12, 2024
f811d3c
feat: add option to hide link preview
nikkothari22 Apr 12, 2024
a6d060d
Merge pull request #860 from The-Commit-Company/819-allow-users-to-co…
nikkothari22 Apr 12, 2024
ddbda7c
fix: update count of poll options accurately
nikkothari22 Apr 12, 2024
edb30ae
feat: better installation message
nikkothari22 Apr 12, 2024
b7a130d
Merge pull request #864 from The-Commit-Company/861-unable-to-install…
nikkothari22 Apr 12, 2024
4d47b87
Merge branch 'develop' into 857-polls-should-display-real-time-voting…
nikkothari22 Apr 12, 2024
9df22ec
Merge pull request #862 from The-Commit-Company/857-polls-should-disp…
nikkothari22 Apr 12, 2024
b7d7bfd
feat: added sonner toasts
nikkothari22 Apr 12, 2024
610f634
Merge pull request #865 from The-Commit-Company/rav-add-pagination-in…
nikkothari22 Apr 12, 2024
b2c21e8
fix: filter selected users in dropdown
nikkothari22 Apr 12, 2024
14db6e1
Merge pull request #867 from The-Commit-Company/856-raven-should-not-…
nikkothari22 Apr 12, 2024
23ad4db
feat: persist expanded or collapsed state of sidebar sections
nikkothari22 Apr 12, 2024
2cade1a
Merge pull request #868 from The-Commit-Company/836-persist-collapsed…
nikkothari22 Apr 12, 2024
6caa1be
chore: upgrade tiptap to latest version
prathameshkurunkar7 Apr 12, 2024
f255c9f
fix: formatting issues on tiptap editor
prathameshkurunkar7 Apr 12, 2024
5b266a3
Merge pull request #869 from The-Commit-Company/866-fix-formatting-is…
nikkothari22 Apr 12, 2024
15b5cc2
bumped linkpreview version to 0.9.0
nikkothari22 Apr 12, 2024
bd43e69
fix: added keyboard shortcut for code block
prathameshkurunkar7 Apr 12, 2024
b205b32
fix: added keyboard shortcut for code block
prathameshkurunkar7 Apr 12, 2024
475fce4
fix: padding on link preview
nikkothari22 Apr 12, 2024
f79da4d
Create FUNDING.yml
nikkothari22 Apr 12, 2024
2d495e0
feat: emoji suggestions
nikkothari22 Apr 12, 2024
d276724
Merge pull request #871 from The-Commit-Company/774-telegramdiscord-l…
nikkothari22 Apr 12, 2024
adfb99b
chore: bumped version to 1.5.2
nikkothari22 Apr 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# These are supported funding model platforms

github: [The-Commit-Company]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
75 changes: 0 additions & 75 deletions .github/workflows/apply-issue-labels-to-pr.yml

This file was deleted.

2 changes: 1 addition & 1 deletion mobile/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mobile",
"private": true,
"version": "1.5.1",
"version": "1.5.2",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
5 changes: 5 additions & 0 deletions mobile/src/components/common/EmojiPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ import { createElement, useEffect, useRef } from "react"
import 'emoji-picker-element'
import './emojiPicker.styles.css'

import { Database } from "emoji-picker-element";

export const emojiDatabase = new Database();

const EmojiPicker = ({ onSelect }: { onSelect: (emoji: string) => void }) => {

const ref = useRef<any>(null)

useEffect(() => {
const handler = (event: any) => {
emojiDatabase.incrementFavoriteEmojiCount(event.detail.unicode)
onSelect(event.detail.unicode)
}
ref.current?.addEventListener('emoji-click', handler)
Expand Down
94 changes: 94 additions & 0 deletions mobile/src/components/features/chat-input/EmojiList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import { Text } from '@radix-ui/themes'
import { ReactRendererOptions } from '@tiptap/react'
import { NativeEmoji } from 'emoji-picker-element/shared'
import {
forwardRef, useEffect, useImperativeHandle,
useState,
} from 'react'

export default forwardRef((props: ReactRendererOptions['props'], ref) => {

const [selectedIndex, setSelectedIndex] = useState(0)

const selectItem = (index: number) => {
const item = props?.items[index]
if (item) {
props.command(item)
}
}

const upHandler = () => {
setSelectedIndex((selectedIndex + props?.items.length - 1) % props?.items.length)
}

const downHandler = () => {
setSelectedIndex((selectedIndex + 1) % props?.items.length)
}

const enterHandler = () => {
selectItem(selectedIndex)
}

useEffect(() => setSelectedIndex(0), [props?.items])

useImperativeHandle(ref, () => ({
onKeyDown: ({ event }: { event: KeyboardEvent }) => {
if (event.key === 'ArrowUp') {
upHandler()
return true
}

if (event.key === 'ArrowDown') {
downHandler()
return true
}

if (event.key === 'Enter') {
enterHandler()
return true
}

return false
},
}))

if (props?.items.length) {
return (
<ul role="list"
data-is-toolbar-element={true}
className="divide-y w-full divide-gray-5 overflow-x-hidden bg-gray-2 border border-gray-5 shadow-lg list-none rounded-md overflow-y-scroll max-h-72">
{props.items.map((item: NativeEmoji, index: number) => (
<EmojiItem
item={item}
index={index}
selectItem={selectItem}
selectedIndex={selectedIndex}
key={item.name}
itemsLength={props.items.length}
/>
))

}
</ul>
)
} else {
return null
}
})

const EmojiItem = ({ item, index, selectItem, selectedIndex, itemsLength }: { itemsLength: number, selectedIndex: number, index: number, item: NativeEmoji, selectItem: (index: number) => void }) => {

const roundedTop = index === 0 ? ' rounded-t-md' : ''

const roundedBottom = index === itemsLength - 1 ? ' rounded-b-md' : ''

return <li
data-is-toolbar-element={true}
className={'py-2 px-3 w-[90vw] text-md active:bg-gray-4 focus:bg-gray-4 focus-visible:bg-gray-4 hover:bg-gray-4' + roundedBottom + roundedTop}
onClick={() => selectItem(index)}
>
<Text as='span' weight='medium' size='2' data-is-toolbar-element={true}>
{item.unicode} {item.shortcodes?.[0] ?? item.annotation}
</Text>
</li>
}
104 changes: 104 additions & 0 deletions mobile/src/components/features/chat-input/EmojiSuggestion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import { Node } from '@tiptap/core'
import Suggestion from '@tiptap/suggestion'
import { ReactRenderer } from '@tiptap/react'
import EmojiList from './EmojiList'
import tippy from 'tippy.js';
import { NativeEmoji } from 'emoji-picker-element/shared';
import { PluginKey } from '@tiptap/pm/state';
import { emojiDatabase } from '@/components/common/EmojiPicker';

export const EmojiSuggestion = Node.create({
name: 'emoji',
group: 'inline',
pluginKey: new PluginKey('emojiSuggestion'),

inline: true,

selectable: false,

atom: true,

addProseMirrorPlugins() {
return [
Suggestion({
editor: this.editor,
char: ':',
items: (query) => {
if (query.query.length !== 0) {
return emojiDatabase.getEmojiBySearchQuery(query.query.toLowerCase()).then((emojis) => {
return emojis.slice(0, 10) as NativeEmoji[]
});
} else {
return emojiDatabase.getTopFavoriteEmoji(10) as Promise<NativeEmoji[]>
}


return []
},
render: () => {
let component: any;
let popup: any;

return {
onStart: props => {
component = new ReactRenderer(EmojiList, {
props,
editor: props.editor,
})

if (!props.clientRect) {
return
}

popup = tippy('body' as any, {
getReferenceClientRect: props.clientRect as any,
appendTo: () => document.body,
content: component.element,
showOnCreate: true,
interactive: true,
trigger: 'manual',
placement: 'bottom-start',
})
},

onUpdate(props) {
component.updateProps(props)

if (!props.clientRect) {
return
}

popup[0].setProps({
getReferenceClientRect: props.clientRect,
})
},

onKeyDown(props) {
if (props.event.key === 'Escape') {
popup[0].hide()

return true
}

return component.ref?.onKeyDown(props)
},

onExit() {
popup[0].destroy()
component.destroy()
},
}
},
command: ({ editor, range, props }) => {
// Replace the text from : to with the emoji node
editor.chain().focus().deleteRange(range).insertContent(props.unicode).run()

emojiDatabase.incrementFavoriteEmojiCount(props.unicode)

window.getSelection()?.collapseToEnd()
},
}),
]
},

})
7 changes: 4 additions & 3 deletions mobile/src/components/features/chat-input/Tiptap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import ts from 'highlight.js/lib/languages/typescript'
import html from 'highlight.js/lib/languages/xml'
import json from 'highlight.js/lib/languages/json'
import python from 'highlight.js/lib/languages/python'
import { BiSend, BiSolidSend } from 'react-icons/bi'
import { AiOutlinePaperClip } from 'react-icons/ai';
import { BiSolidSend } from 'react-icons/bi'
import { IconButton } from '@radix-ui/themes'
import { useKeyboardState } from '@ionic/react-hooks/keyboard';
import MessageInputActions from './MessageInputActions'
import { useClickAway } from '@uidotdev/usehooks'
import { FiPlus } from 'react-icons/fi'
import { EmojiSuggestion } from './EmojiSuggestion'

const lowlight = createLowlight(common)

Expand Down Expand Up @@ -109,7 +109,7 @@ export const Tiptap = ({ onMessageSend, messageSending, defaultText = '', onPick
},
code: {
HTMLAttributes: {
class: 'font-mono bg-slate-950 text-sm radius-md p-1 text-white'
class: 'pt-0.5 px-1 pb-px bg-[var(--gray-a3)] dark:bg-[#0d0d0d] text-[var(--ruby-a11)] dark-[var(--accent-a3)] text text-xs font-mono rounded border border-gray-4 dark:border-gray-6'
}
},

Expand Down Expand Up @@ -273,6 +273,7 @@ export const Tiptap = ({ onMessageSend, messageSending, defaultText = '', onPick
Placeholder.configure({
placeholder: 'Type a message...'
}),
EmojiSuggestion
]

const [focused, setFocused] = useState(false)
Expand Down
Loading
Loading