allow ctrl+v to paste image to editor

This commit is contained in:
Qing
2022-10-08 21:41:26 +08:00
parent 4980675730
commit 3c5781c947
4 changed files with 51 additions and 7 deletions

View File

@@ -22,12 +22,12 @@ const SidePanel = () => {
className="btn-primary side-panel-trigger"
onClick={() => toggleOpen()}
>
Stable Diffusion
Configurations
</PopoverPrimitive.Trigger>
<PopoverPrimitive.Portal>
<PopoverPrimitive.Content className="side-panel-content">
<SettingBlock
title="Show Croper"
title="Croper"
input={
<Switch
checked={setting.showCroper}

View File

@@ -1,10 +1,16 @@
import React, { useEffect } from 'react'
import React, { useCallback, useEffect } from 'react'
import { useRecoilState, useRecoilValue } from 'recoil'
import Editor from './Editor/Editor'
import ShortcutsModal from './Shortcuts/ShortcutsModal'
import SettingModal from './Settings/SettingsModal'
import Toast from './shared/Toast'
import { AIModel, isSDState, settingState, toastState } from '../store/Atoms'
import {
AIModel,
fileState,
isSDState,
settingState,
toastState,
} from '../store/Atoms'
import {
currentModel,
modelDownloaded,
@@ -13,6 +19,7 @@ import {
import SidePanel from './SidePanel/SidePanel'
const Workspace = () => {
const [file, setFile] = useRecoilState(fileState)
const [settings, setSettingState] = useRecoilState(settingState)
const [toastVal, setToastState] = useRecoilState(toastState)
const isSD = useRecoilValue(isSDState)

View File

@@ -31,6 +31,7 @@ const TextInput = React.forwardRef<
type="text"
onFocus={handleOnFocus}
onBlur={handleOnBlur}
onPaste={evt => evt.stopPropagation()}
onKeyDown={e => {
if (e.key === 'Escape') {
e.currentTarget.blur()