Skip to content

Commit

Permalink
🚀release: v0.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
blinko-space committed Oct 30, 2024
1 parent 26ac1e3 commit 59e98fd
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 41 deletions.
3 changes: 0 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ if [ $? -ne 0 ]; then
echo "Failed to download the docker-compose file. Please check your internet connection or the GitHub URL."
exit 1
fi

echo "Successfully downloaded docker-compose file: $compose_file"

# Default environment variables
Expand All @@ -27,8 +26,6 @@ else
NEXTAUTH_URL=$NEXTAUTH_URL_DEFAULT
fi



# Ask user if they want to change NEXT_PUBLIC_BASE_URL
read -p "Do you want to change NEXT_PUBLIC_BASE_URL from the default ($NEXT_PUBLIC_BASE_URL_DEFAULT)? [y/N]: " change_next_public_base_url
if [[ "$change_next_public_base_url" == "y" || "$change_next_public_base_url" == "Y" ]]; then
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": "blinko",
"version": "0.0.8",
"version": "0.0.9",
"private": true,
"browser": {
"fs": false,
Expand Down
39 changes: 20 additions & 19 deletions src/components/BlinkoAi/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ export const BlinkoAiChat = observer(() => {
})}
</ScrollArea>
<div className="flex gap-2 mt-auto w-full ">
<div className="relative w-full ">
<div className="relative w-full pb-4 md:pb-0">
<Textarea
className="w-[85%]"
className="w-[78%]"
variant="bordered"
onKeyDown={e => {
if (e.key === 'Enter') {
Expand All @@ -101,19 +101,22 @@ export const BlinkoAiChat = observer(() => {
ai.aiSearchText = e.target.value
}}
/>
<div onClick={e => {
if (ai.aiSearchText == '') return
ai.completionsStream()
ai.aiSearchText = ''
}} className={`${ai.aiSearchText == '' ? 'opacity-30 select-none' : ''} absolute bottom-[9px] right-[5px] cursor-pointer hover:opacity-80 transition-all rounded-full bg-primary text-primary-foreground`}>
<Icon icon="uil:arrow-up" width="20" height="20" />
</div>

<div className="flex gap-3 absolute bottom-[22px] md:bottom-[7px] right-[5px] ">
<div onClick={e => {
ai.aiSearchText = ''
ai.chatHistory.clear()
}} className="absolute bottom-[9px] right-[35px] cursor-pointer hover:opacity-80 transition-all rounded-full ">
<Icon icon="ant-design:clear-outlined" width="20" height="20" />
ai.aiSearchText = ''
ai.chatHistory.clear()
}} className="cursor-pointer hover:opacity-80 transition-all rounded-full">
<Icon icon="ant-design:clear-outlined" width="26" height="26" />
</div>

<div onClick={e => {
if (ai.aiSearchText == '') return
ai.completionsStream()
ai.aiSearchText = ''
}} className={`${ai.aiSearchText == '' ? 'opacity-30 select-none' : ''} cursor-pointer hover:opacity-70 transition-all rounded-full bg-primary text-primary-foreground`}>
<Icon icon="uil:arrow-up" width="26" height="26" />
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -147,12 +150,10 @@ export const BlinkoAi = observer(() => {
{
isPc ? <Popover placement="top">
<PopoverTrigger>
<div>
<motion.div whileHover={{ opacity: 1, scale: 1.1 }} whileTap={{ scale: 1.2 }}
className="fixed rounded-full p-2 cursor-pointer bg-primary bottom-[15%] right-[10%] md:bottom-10 md:right-20 z-10 opacity-70 text-primary-foreground">
<Icon icon="mingcute:ai-line" width="20" height="20" />
</motion.div>
</div>
<motion.div whileHover={{ opacity: 1, scale: 1.1 }} whileTap={{ scale: 1.2 }}
className="fixed rounded-full p-2 cursor-pointer bg-primary bottom-[15%] right-[10%] md:bottom-10 md:right-20 z-10 opacity-70 text-primary-foreground">
<Icon icon="mingcute:ai-line" width="20" height="20" />
</motion.div>
</PopoverTrigger>
<PopoverContent>
<div className="h-[420px] w-[420px]">
Expand Down
6 changes: 3 additions & 3 deletions src/components/BlinkoCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const BlinkoCard = observer(({ blinkoItem }: { blinkoItem: Note }) => {
}
}}>
<Card shadow='none' className={`mb-4 flex flex-col p-4 bg-background transition-all ${blinko.curMultiSelectIds?.includes(blinkoItem.id!) ? 'border-2 border-primary' : ''}`}>
<div className="flex items-center">
<div className="flex items-center select-none">
<div className='mb-2 text-xs text-desc'>{dayjs(blinkoItem.createdAt).fromNow()}</div>
{blinkoItem.isTop && <Icon className="ml-auto text-[#EFC646]" icon="solar:bookmark-bold" width="24" height="24" />}
</div>
Expand All @@ -40,11 +40,11 @@ export const BlinkoCard = observer(({ blinkoItem }: { blinkoItem: Note }) => {
blinkoItem.type == NoteType.BLINKO ?
<div className='flex items-center justify-start mt-2'>
<Icon className='text-yellow-500' icon="basil:lightning-solid" width="12" height="12" />
<div className='text-desc text-xs font-bold ml-1'>{t('blinko')}</div>
<div className='text-desc text-xs font-bold ml-1 select-none'>{t('blinko')}</div>
</div> :
<div className='flex items-center justify-start mt-2'>
<Icon className='text-blue-500' icon="solar:notes-minimalistic-bold-duotone" width="12" height="12" />
<div className='text-desc text-xs font-bold ml-1'>{t('note')}</div>
<div className='text-desc text-xs font-bold ml-1 select-none'>{t('note')}</div>
</div>
}
</Card>
Expand Down
7 changes: 4 additions & 3 deletions src/components/BlinkoMultiSelectPop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { api } from '@/lib/trpc';

const SelectBox = `select-none multi-select-toolbar flex fixed w-fit h-[50px]
p-4 rounded-xl font-bold items-center justify-center
left-[calc(50%_-_190px)] md:left-[40%] top-10 md:bottom-10 md:top-auto
left-[calc(50%_-_150px)] md:left-[40%] top-10 md:bottom-10 md:top-auto
bg-primary text-primary-foreground z-[-99] gap-4 shadow-lg`

const SelectItems = "flex items-center justify-center gap-1 cursor-pointer hover:opacity-80 transition-all"
Expand All @@ -42,13 +42,14 @@ export const BlinkoMultiSelectPop = observer(() => {
},
}}
className={SelectBox}>
<div className='flex items-center justify-center gap-2'>
<div className='items-center justify-center gap-2 hidden md:flex'>
<Icon onClick={e => {
blinko.curMultiSelectIds = blinko.noteList.value?.map(i => i.id) || []
}}
className='cursor-pointer hover:opacity-80 transition-all' icon="fluent:select-all-on-16-filled" width="20" height="20" />
{blinko.noteList.value?.length}/{blinko.curMultiSelectIds.length} {t('items')}</div>
<div className='w-[2px] rounded-sm h-full bg-primary-foreground'></div>

<div className='w-[2px] rounded-sm h-full bg-primary-foreground hidden md:flex'></div>

<div className={SelectItems}
onClick={async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/Editor/attachmentsRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const AttachmentsRender = observer(({ files, preview = false, columns = 3 }: IPr
</PhotoProvider>

</div>
<div className={`columns-${columns} mt-3`}>
<div className={`columns-${columns} mt-3 select-none`}>
{files?.filter(i => !i.isImage).map((file, index) => (
<div onClick={() => {
if (preview) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/MarkdownRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const highlightTags = (text) => {
return parts.map((part, index) => {
if (part.match(helper.regex.isContainHashTag)) {
return (
<span key={index} className='blinko-tag px-11 font-bold cursor-pointer hover:opacity-80 transition-all' >
<span key={index} className='select-none blinko-tag px-11 font-bold cursor-pointer hover:opacity-80 transition-all' >
{part + " "}
</span>
);
Expand Down
13 changes: 3 additions & 10 deletions update.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/bin/bash

# set GitHub URL for the docker-compose file
github_url="https://raw.githubusercontent.com/blinko-space/blinko/refs/heads/main/docker-compose.prod.yml"
compose_file="docker-compose.prod.yml"

# Remove existing Docker image and container
echo "Removing existing blinkospace/blinko Docker image..."
docker rmi blinkospace/blinko:latest -f

Expand All @@ -14,7 +12,6 @@ else
echo "Successfully removed Docker image: blinkospace/blinko:latest"
fi

# Remove existing blinko-website container
echo "Removing existing blinko-website container..."
docker rm blinko-website -f

Expand All @@ -24,7 +21,6 @@ else
echo "Successfully removed Docker container: blinko-website"
fi

# Fetch docker-compose file using curl
echo "Fetching docker-compose file from GitHub..."
curl -o $compose_file $github_url

Expand All @@ -36,35 +32,32 @@ fi

echo "Successfully downloaded docker-compose file: $compose_file"


# Default environment variables
NEXTAUTH_URL_DEFAULT="http://localhost:1111"
NEXT_PUBLIC_BASE_URL_DEFAULT="http://localhost:1111"

# Ask user if they want to change NEXTAUTH_URL

read -p "Do you want to change NEXTAUTH_URL from the default ($NEXTAUTH_URL_DEFAULT)? [y/N]: " change_nextauth_url
if [[ "$change_nextauth_url" == "y" || "$change_nextauth_url" == "Y" ]]; then
read -p "Enter new NEXTAUTH_URL: " NEXTAUTH_URL
else
NEXTAUTH_URL=$NEXTAUTH_URL_DEFAULT
fi

# Ask user if they want to change NEXT_PUBLIC_BASE_URL
read -p "Do you want to change NEXT_PUBLIC_BASE_URL from the default ($NEXT_PUBLIC_BASE_URL_DEFAULT)? [y/N]: " change_next_public_base_url
if [[ "$change_next_public_base_url" == "y" || "$change_next_public_base_url" == "Y" ]]; then
read -p "Enter new NEXT_PUBLIC_BASE_URL: " NEXT_PUBLIC_BASE_URL
else
NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL_DEFAULT
fi

# Update the docker-compose file with the chosen environment variables

echo "Updating environment variables in $compose_file..."
sed -i "s|NEXTAUTH_URL:.*|NEXTAUTH_URL: $NEXTAUTH_URL|" $compose_file
sed -i "s|NEXT_PUBLIC_BASE_URL:.*|NEXT_PUBLIC_BASE_URL: $NEXT_PUBLIC_BASE_URL|" $compose_file

echo "Environment variables updated."

# Run the docker-compose file (excluding postgres)

echo "Starting the Docker Compose setup without postgres..."
docker compose -f $compose_file up -d blinko-website

Expand Down

0 comments on commit 59e98fd

Please sign in to comment.