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