mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 01:26:37 +08:00
fix: can't add image and delete more action button (#430)
This commit is contained in:
@@ -168,7 +168,9 @@ export const ImageView = ({ block, editor }: ImageView) => {
|
||||
<BlockPendantProvider editor={editor} block={block}>
|
||||
<ImageBlock>
|
||||
<div style={{ position: 'relative' }} ref={resizeBox}>
|
||||
{!isSelect ? <ImageShade onClick={handleClick} /> : null}
|
||||
{!isSelect && imgUrl ? (
|
||||
<ImageShade onClick={handleClick} />
|
||||
) : null}
|
||||
{imgUrl ? (
|
||||
<div
|
||||
onMouseDown={e => {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
import { CustomText, TextProps } from '@toeverything/components/common';
|
||||
import {
|
||||
BlockPendantProvider,
|
||||
@@ -11,9 +9,11 @@ import {
|
||||
import { styled } from '@toeverything/components/ui';
|
||||
import { Protocol } from '@toeverything/datasource/db-service';
|
||||
import { CreateView } from '@toeverything/framework/virgo';
|
||||
import { useState } from 'react';
|
||||
import { BlockContainer } from '../../components/BlockContainer';
|
||||
import { TextManage } from '../../components/text-manage';
|
||||
import { dedentBlock, tabBlock } from '../../utils/indent';
|
||||
|
||||
interface CreateTextView extends CreateView {
|
||||
// TODO: need to optimize
|
||||
containerClassName?: string;
|
||||
@@ -247,6 +247,9 @@ export const TextView = ({
|
||||
await block.setProperty('text', {
|
||||
value: options?.['text'] as CustomText[],
|
||||
});
|
||||
setTimeout(async () => {
|
||||
await editor.selectionManager.activeNodeByNodeId(block.id);
|
||||
}, 100);
|
||||
block.firstCreateFlag = true;
|
||||
};
|
||||
const onTab: TextProps['handleTab'] = async ({ isShiftKey }) => {
|
||||
|
||||
@@ -22,7 +22,6 @@ import {
|
||||
HeadingTwoIcon,
|
||||
ImageIcon,
|
||||
LinkIcon,
|
||||
MoreIcon,
|
||||
NumberIcon,
|
||||
PagesIcon,
|
||||
QuoteIcon,
|
||||
@@ -827,13 +826,13 @@ export const getInlineMenuData = ({
|
||||
nameKey: inlineMenuNamesKeys.backlinks,
|
||||
onClick: common_handler_for_inline_menu,
|
||||
},
|
||||
{
|
||||
type: INLINE_MENU_UI_TYPES.icon,
|
||||
icon: MoreIcon,
|
||||
name: inlineMenuNames.moreActions,
|
||||
nameKey: inlineMenuNamesKeys.moreActions,
|
||||
onClick: common_handler_for_inline_menu,
|
||||
},
|
||||
// {
|
||||
// type: INLINE_MENU_UI_TYPES.icon,
|
||||
// icon: MoreIcon,
|
||||
// name: inlineMenuNames.moreActions,
|
||||
// nameKey: inlineMenuNamesKeys.moreActions,
|
||||
// onClick: common_handler_for_inline_menu,
|
||||
// },
|
||||
];
|
||||
|
||||
return inlineMenuData.filter(item => Boolean(item));
|
||||
|
||||
Reference in New Issue
Block a user