260728_03_ENH: 에디터 버그 수정
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "kri-ui-registry",
|
||||
"version": "0.9.4",
|
||||
"version": "0.9.5",
|
||||
"private": true,
|
||||
"description": "KRI internal shadcn UI registry",
|
||||
"scripts": {
|
||||
|
||||
@@ -5,12 +5,12 @@ import { KriEditorHtmlOnly } from "./KriEditorHtmlOnly";
|
||||
import { KriEditorWysiwyg } from "./KriEditorWysiwyg";
|
||||
import {KriEditorSms} from "./KriEditorSms";
|
||||
|
||||
function resolveMode(mode?: KriEditorMode): KriEditorMode {
|
||||
return mode ?? "wysiwyg";
|
||||
function resolveMode(mode?: KriEditorMode, editorMode?: KriEditorMode): KriEditorMode {
|
||||
return mode ?? editorMode ?? "wysiwyg";
|
||||
}
|
||||
|
||||
export function KriEditor(props: KriEditorProps) {
|
||||
const mode = resolveMode(props.mode);
|
||||
const mode = resolveMode(props.mode, props.editorMode);
|
||||
|
||||
if (mode === "html") {
|
||||
return <KriEditorHtmlOnly {...props} mode={mode} />;
|
||||
|
||||
@@ -23,6 +23,7 @@ export function KriEditorSms({
|
||||
changeSmsType,
|
||||
onEditorReady,
|
||||
onCommandReady,
|
||||
isSmsReadOnly = false,
|
||||
smsMaxBytes = 90,
|
||||
lmsMaxBytes = 2000,
|
||||
}: SmsEditorProps) {
|
||||
@@ -100,6 +101,7 @@ export function KriEditorSms({
|
||||
}}
|
||||
onBlur={() => flushChange(latestTextRef.current)}
|
||||
placeholder={placeholder}
|
||||
readOnly={isSmsReadOnly}
|
||||
style={{ minHeight: smsTitle ? '320px' : '360px' }}
|
||||
{...textareaInsert.bindSelectionHandlers}
|
||||
/>
|
||||
|
||||
@@ -408,6 +408,7 @@ export function KriEditorWysiwyg(props: KriEditorProps) {
|
||||
if(onImageUploadError){
|
||||
onImageUploadError(err);
|
||||
}else{
|
||||
toast.error("이미지 업로드에 실패했습니다.");
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ export type KriEditorProps = {
|
||||
debounceMs?: number
|
||||
smsTitle?: string
|
||||
changeSmsType?: (type: 'SMS' | 'LMS') => void
|
||||
isSmsReadOnly?: boolean
|
||||
smsMaxBytes?: number
|
||||
lmsMaxBytes?: number
|
||||
toolbar?: KriEditorToolbarConfig | false
|
||||
|
||||
Reference in New Issue
Block a user