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}>
|
<BlockPendantProvider editor={editor} block={block}>
|
||||||
<ImageBlock>
|
<ImageBlock>
|
||||||
<div style={{ position: 'relative' }} ref={resizeBox}>
|
<div style={{ position: 'relative' }} ref={resizeBox}>
|
||||||
{!isSelect ? <ImageShade onClick={handleClick} /> : null}
|
{!isSelect && imgUrl ? (
|
||||||
|
<ImageShade onClick={handleClick} />
|
||||||
|
) : null}
|
||||||
{imgUrl ? (
|
{imgUrl ? (
|
||||||
<div
|
<div
|
||||||
onMouseDown={e => {
|
onMouseDown={e => {
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { useState } from 'react';
|
|
||||||
|
|
||||||
import { CustomText, TextProps } from '@toeverything/components/common';
|
import { CustomText, TextProps } from '@toeverything/components/common';
|
||||||
import {
|
import {
|
||||||
BlockPendantProvider,
|
BlockPendantProvider,
|
||||||
@@ -11,9 +9,11 @@ import {
|
|||||||
import { styled } from '@toeverything/components/ui';
|
import { styled } from '@toeverything/components/ui';
|
||||||
import { Protocol } from '@toeverything/datasource/db-service';
|
import { Protocol } from '@toeverything/datasource/db-service';
|
||||||
import { CreateView } from '@toeverything/framework/virgo';
|
import { CreateView } from '@toeverything/framework/virgo';
|
||||||
|
import { useState } from 'react';
|
||||||
import { BlockContainer } from '../../components/BlockContainer';
|
import { BlockContainer } from '../../components/BlockContainer';
|
||||||
import { TextManage } from '../../components/text-manage';
|
import { TextManage } from '../../components/text-manage';
|
||||||
import { dedentBlock, tabBlock } from '../../utils/indent';
|
import { dedentBlock, tabBlock } from '../../utils/indent';
|
||||||
|
|
||||||
interface CreateTextView extends CreateView {
|
interface CreateTextView extends CreateView {
|
||||||
// TODO: need to optimize
|
// TODO: need to optimize
|
||||||
containerClassName?: string;
|
containerClassName?: string;
|
||||||
@@ -247,6 +247,9 @@ export const TextView = ({
|
|||||||
await block.setProperty('text', {
|
await block.setProperty('text', {
|
||||||
value: options?.['text'] as CustomText[],
|
value: options?.['text'] as CustomText[],
|
||||||
});
|
});
|
||||||
|
setTimeout(async () => {
|
||||||
|
await editor.selectionManager.activeNodeByNodeId(block.id);
|
||||||
|
}, 100);
|
||||||
block.firstCreateFlag = true;
|
block.firstCreateFlag = true;
|
||||||
};
|
};
|
||||||
const onTab: TextProps['handleTab'] = async ({ isShiftKey }) => {
|
const onTab: TextProps['handleTab'] = async ({ isShiftKey }) => {
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import {
|
|||||||
HeadingTwoIcon,
|
HeadingTwoIcon,
|
||||||
ImageIcon,
|
ImageIcon,
|
||||||
LinkIcon,
|
LinkIcon,
|
||||||
MoreIcon,
|
|
||||||
NumberIcon,
|
NumberIcon,
|
||||||
PagesIcon,
|
PagesIcon,
|
||||||
QuoteIcon,
|
QuoteIcon,
|
||||||
@@ -827,13 +826,13 @@ export const getInlineMenuData = ({
|
|||||||
nameKey: inlineMenuNamesKeys.backlinks,
|
nameKey: inlineMenuNamesKeys.backlinks,
|
||||||
onClick: common_handler_for_inline_menu,
|
onClick: common_handler_for_inline_menu,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
type: INLINE_MENU_UI_TYPES.icon,
|
// type: INLINE_MENU_UI_TYPES.icon,
|
||||||
icon: MoreIcon,
|
// icon: MoreIcon,
|
||||||
name: inlineMenuNames.moreActions,
|
// name: inlineMenuNames.moreActions,
|
||||||
nameKey: inlineMenuNamesKeys.moreActions,
|
// nameKey: inlineMenuNamesKeys.moreActions,
|
||||||
onClick: common_handler_for_inline_menu,
|
// onClick: common_handler_for_inline_menu,
|
||||||
},
|
// },
|
||||||
];
|
];
|
||||||
|
|
||||||
return inlineMenuData.filter(item => Boolean(item));
|
return inlineMenuData.filter(item => Boolean(item));
|
||||||
|
|||||||
Reference in New Issue
Block a user