Skip to content

Commit

Permalink
refactor: update display texT
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 22, 2023
1 parent 6fbfd96 commit aff5b91
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# To get started with Next.js see: https://nextjs.org/docs/getting-started
#
name: Deploy Next.js site to Pages
name: Deploy

on:
# Runs on pushes targeting the default branch
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 3b

[![Deploy Next.js site to Pages](https://github.com/unit-mesh/3b/actions/workflows/deploy.yml/badge.svg)](https://github.com/unit-mesh/3b/actions/workflows/deploy.yml)
[![Deploy](https://github.com/unit-mesh/3b/actions/workflows/deploy.yml/badge.svg)](https://github.com/unit-mesh/3b/actions/workflows/deploy.yml)

> 3b is a sophisticated editor designed for content creation, catering to various formats such as blogs, articles, user
> stories, and more.
Expand Down
38 changes: 23 additions & 15 deletions components/editor/intelli/menu/menu-bubble.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,31 @@ export const MenuBubble = ({ editor }) => {

// 根据长度优化
return <BubbleMenu className={'ToggleGroup'} editor={editor} tippyOptions={{ duration: 100 }}>
{selectLength > 20 && <button
onClick={() => {
editor.commands.setTrackChangeStatus(true)
{selectLength > 20 && <div className={"BubbleMenuGroup"}>
<button
onClick={() => {
editor.commands.setTrackChangeStatus(true)

const selection = editor.state.selection
editor.chain().focus().insertContentAt({
from: selection.from,
to: selection.to
}, '永和九年,岁在癸丑,暮春之初,会于会稽山阴之兰亭,修禊事也。群贤毕至,少长咸集。此地有崇山峻岭,茂林修竹;又有清流激湍,映带左右').run()
const selection = editor.state.selection
editor.chain().focus().insertContentAt({
from: selection.from,
to: selection.to
}, '永和九年,岁在癸丑,暮春之初,会于会稽山阴之兰亭,修禊事也。群贤毕至,少长咸集。此地有崇山峻岭,茂林修竹;又有清流激湍,映带左右').run()

editor.commands.setTrackChangeStatus(false)
}}
value="left" aria-label="Left aligned"
className={editor.isActive('bold') ? 'is-active BubbleMenuItem' : 'BubbleMenuItem'}
>
<MagicWandIcon/> 优化表达
</button>
editor.commands.setTrackChangeStatus(false)
}}
value="left" aria-label="Left aligned"
className={editor.isActive('bold') ? 'is-active BubbleMenuItem' : 'BubbleMenuItem'}
>
<MagicWandIcon/> 优化表达
</button>
<button
value="right" aria-label="Left aligned"
className={editor.isActive('bold') ? 'is-active BubbleMenuItem' : 'BubbleMenuItem'}
>
精炼内容
</button>
</div>
}
</BubbleMenu>
}
4 changes: 2 additions & 2 deletions components/editor/live-editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ const extensions = [
createSlashExtension('ai-slash', {
items: [
{
title: '续写',
title: 'AI 续写',
command: 'continue',
},
{
title: '总结',
title: 'AI 总结',
command: 'summarize',
}
]
Expand Down
8 changes: 6 additions & 2 deletions pages/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,17 @@ button {
box-shadow: 0 0 0 2px var(--violet-11);
}

.BubbleMenuGroup {
border-radius: 4px;
box-shadow: 0 2px 2px var(--black-a7);
}

.BubbleMenuItem {
padding: 0.5em;
background: #fff;
border-radius: 4px;
color: #000;
box-shadow: 0 2px 2px var(--black-a7);
cursor: pointer;
border: 1px solid var(--violet-6);
}

.BubbleMenuItem svg {
Expand Down
8 changes: 3 additions & 5 deletions styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,14 @@ input {
.DropdownMenuCheckboxItem,
.DropdownMenuRadioItem,
.DropdownMenuSubTrigger {
font-size: 13px;
line-height: 1;
font-size: 14px;
line-height: 1.4;
padding: 10px 5px;
color: var(--violet-11);
border-radius: 3px;
display: flex;
align-items: center;
height: 25px;
padding: 0 5px;
position: relative;
padding-left: 25px;
user-select: none;
outline: none;
cursor: pointer;
Expand Down

0 comments on commit aff5b91

Please sign in to comment.