Skip to content

feat(creation-toolbar): support long-press triggers drag selection an… #78

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

Merged
merged 6 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
- 💾 自动保存(浏览器缓存)
- ⚡ 编辑特性:撤销、重做、复制、粘贴等
- 🌌 无限画布:缩放、滚动、
- 🎨 主题模式(新增 🔥🔥🔥)
- 📱 移动设备适配(待优化
- 🎨 主题模式
- 📱 移动设备适配(交互优化 🔥🔥🔥


## 关于名称
Expand Down
4 changes: 2 additions & 2 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
- 💾 Auto-save (Browser Storage)
- ⚡ Edit Features: Undo, Redo, Copy, Paste, etc.
- 🌌 Infinite Canvas: Zoom, Pan
- 🎨 Theme Support(New 🔥🔥🔥)
- 📱 Mobile-friendly(To be optimized
- 🎨 Theme Support
- 📱 Mobile-friendly(Optimization completed 🔥🔥🔥


## About the Name
Expand Down
48 changes: 24 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"private": true,
"dependencies": {
"@floating-ui/react": "^0.26.24",
"@plait/common": "^0.75.0-next.0",
"@plait/core": "^0.75.0-next.0",
"@plait/draw": "^0.75.0-next.0",
"@plait/layouts": "^0.75.0-next.0",
"@plait/mind": "^0.75.0-next.0",
"@plait/text-plugins": "^0.75.0-next.0",
"@plait/common": "^0.75.0-next.5",
"@plait/core": "^0.75.0-next.5",
"@plait/draw": "^0.75.0-next.5",
"@plait/layouts": "^0.75.0-next.5",
"@plait/mind": "^0.75.0-next.5",
"@plait/text-plugins": "^0.75.0-next.5",
"ahooks": "^3.8.0",
"browser-fs-access": "^0.35.0",
"classnames": "^2.5.1",
Expand Down
10 changes: 9 additions & 1 deletion packages/drawnix/src/components/toolbar/creation-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ import { ArrowPicker } from '../arrow-picker';
import { useState } from 'react';
import { Popover, PopoverContent, PopoverTrigger } from '../popover/popover';
import { FreehandShape } from '../../plugins/freehand/type';
import { DrawnixPointerType, useSetPointer } from '../../hooks/use-drawnix';
import {
DrawnixPointerType,
useDrawnix,
useSetPointer,
} from '../../hooks/use-drawnix';

export enum PopupKey {
'shape' = 'shape',
Expand Down Expand Up @@ -98,6 +102,7 @@ export const isShapePointer = (board: PlaitBoard) => {

export const CreationToolbar = () => {
const board = useBoard();
const { appState } = useDrawnix();
const setPointer = useSetPointer();
const container = PlaitBoard.getBoardContainer(board);

Expand Down Expand Up @@ -128,6 +133,9 @@ export const CreationToolbar = () => {
>
<Stack.Row gap={1}>
{BUTTONS.map((button, index) => {
if (appState.isMobile && button.pointer === PlaitPointerType.hand) {
return <></>;
}
if (button.popupKey === PopupKey.shape) {
return (
<Popover
Expand Down
Loading