2
0

feat(editor): Add unlock/lock sidebar

This commit is contained in:
Baptiste Arnaud
2022-01-29 11:22:22 +01:00
parent 02bd2b94ba
commit 1c5bd06657
18 changed files with 249 additions and 170 deletions

View File

@ -94,6 +94,7 @@ export const ChoiceItemNode = ({
>
{(ref, isOpened) => (
<Flex
ref={ref}
align="center"
pos="relative"
onMouseEnter={handleMouseEnter}
@ -109,7 +110,6 @@ export const ChoiceItemNode = ({
borderColor={isOpened ? 'blue.400' : 'gray.300'}
>
<Editable
ref={ref}
defaultValue={item.content ?? 'Click to edit'}
flex="1"
startWithEditView={!isDefined(item.content)}

View File

@ -27,7 +27,7 @@ export const ContentPopover = ({ step }: Props) => {
return (
<Portal>
<PopoverContent onMouseDown={handleMouseDown}>
<PopoverContent onMouseDown={handleMouseDown} w="500px">
<PopoverArrow />
<PopoverBody ref={ref} shadow="lg">
<StepContent step={step} />

View File

@ -9,7 +9,7 @@ import {
import React, { useEffect, useState } from 'react'
import { BubbleStep, DraggableStep, Step, TextBubbleStep } from 'models'
import { Coordinates, useGraph } from 'contexts/GraphContext'
import { StepIcon } from 'components/board/StepTypesList/StepIcon'
import { StepIcon } from 'components/board/StepsSideBar/StepIcon'
import { isBubbleStep, isTextBubbleStep } from 'utils'
import { TextEditor } from './TextEditor/TextEditor'
import { StepNodeContent } from './StepNodeContent/StepNodeContent'
@ -152,7 +152,7 @@ export const StepNode = ({
renderMenu={() => <StepNodeContextMenu stepId={step.id} />}
>
{(ref, isOpened) => (
<Popover placement="left" isLazy isOpen={openedStepId === step.id}>
<Popover placement="bottom" isLazy isOpen={openedStepId === step.id}>
<PopoverTrigger>
<Flex
pos="relative"

View File

@ -1,6 +1,6 @@
import { StackProps, HStack } from '@chakra-ui/react'
import { StartStep, Step } from 'models'
import { StepIcon } from 'components/board/StepTypesList/StepIcon'
import { StepIcon } from 'components/board/StepsSideBar/StepIcon'
import { StepNodeContent } from './StepNodeContent/StepNodeContent'
export const StepNodeOverlay = ({