podo-ui 0.3.12 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../react/atom/editor.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,SAAS,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,MAAM,iGAUT,WAAW,4CAovGb,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../react/atom/editor.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,SAAS,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,MAAM,iGAUT,WAAW,4CAuxGb,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -56,6 +56,8 @@ const Editor = ({ value = '', width = '100%', height = '400px', minHeight, maxHe
56
56
  const historyRef = useRef([value]);
57
57
  const historyIndexRef = useRef(0);
58
58
  const isUndoRedoRef = useRef(false); // undo/redo 실행 중 플래그
59
+ const isComposingRef = useRef(false); // IME 입력 중 플래그
60
+ const justComposedRef = useRef(false); // compositionend 직후 플래그
59
61
  const editorRef = useRef(null);
60
62
  const codeEditorRef = useRef(null);
61
63
  const containerRef = useRef(null);
@@ -290,6 +292,14 @@ const Editor = ({ value = '', width = '100%', height = '400px', minHeight, maxHe
290
292
  }
291
293
  }, [onChange]);
292
294
  const handleInput = useCallback(() => {
295
+ // IME 입력 중에는 처리하지 않음
296
+ if (isComposingRef.current)
297
+ return;
298
+ // compositionend 직후 input 이벤트는 무시
299
+ if (justComposedRef.current) {
300
+ justComposedRef.current = false;
301
+ return;
302
+ }
293
303
  if (editorRef.current) {
294
304
  const content = editorRef.current.innerHTML;
295
305
  onChange(content);
@@ -301,6 +311,25 @@ const Editor = ({ value = '', width = '100%', height = '400px', minHeight, maxHe
301
311
  }
302
312
  // eslint-disable-next-line react-hooks/exhaustive-deps
303
313
  }, [onChange, addToHistory]);
314
+ // IME 입력 시작
315
+ const handleCompositionStart = useCallback(() => {
316
+ isComposingRef.current = true;
317
+ }, []);
318
+ // IME 입력 종료
319
+ const handleCompositionEnd = useCallback(() => {
320
+ isComposingRef.current = false;
321
+ justComposedRef.current = true;
322
+ // composition 종료 시 직접 업데이트 처리
323
+ if (editorRef.current) {
324
+ const content = editorRef.current.innerHTML;
325
+ onChange(content);
326
+ validateHandler(content);
327
+ detectCurrentParagraphStyle();
328
+ detectCurrentAlign();
329
+ addToHistory(content);
330
+ }
331
+ // eslint-disable-next-line react-hooks/exhaustive-deps
332
+ }, [onChange, addToHistory]);
304
333
  // 붙여넣기 이벤트 핸들러 - 지원하지 않는 스타일 제거
305
334
  const handlePaste = useCallback((e) => {
306
335
  e.preventDefault();
@@ -2177,7 +2206,7 @@ const Editor = ({ value = '', width = '100%', height = '400px', minHeight, maxHe
2177
2206
  minHeight: height === 'contents' ? 'auto' : 0,
2178
2207
  height: height === 'contents' && savedEditorHeight ? `${savedEditorHeight}px` : undefined,
2179
2208
  resize: 'none'
2180
- }, placeholder: placeholder })) : (_jsx("div", { ref: editorRef, id: editorID, className: styles.editorContent, contentEditable: true, onInput: handleInput, onPaste: handlePaste, onClick: handleEditorClick, onKeyUp: () => {
2209
+ }, placeholder: placeholder })) : (_jsx("div", { ref: editorRef, id: editorID, className: styles.editorContent, contentEditable: true, onInput: handleInput, onCompositionStart: handleCompositionStart, onCompositionEnd: handleCompositionEnd, onPaste: handlePaste, onClick: handleEditorClick, onKeyUp: () => {
2181
2210
  detectCurrentParagraphStyle();
2182
2211
  detectCurrentAlign();
2183
2212
  }, onKeyDown: handleKeyDown, style: {
@@ -1,4 +1,4 @@
1
- @use '../../../mixin.scss' as *;
1
+ @use '../../mixin.scss' as *;
2
2
  .style {
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -1,4 +1,4 @@
1
- @use '../../../mixin.scss' as *;
1
+ @use '../../mixin.scss' as *;
2
2
  .style {
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -1,4 +1,4 @@
1
- @use '../../../mixin.scss' as *;
1
+ @use '../../mixin.scss' as *;
2
2
  .style {
3
3
  width: 100%;
4
4
  display: flex;
@@ -1,4 +1,4 @@
1
- @use '../../../mixin.scss' as *;
1
+ @use '../../mixin.scss' as *;
2
2
 
3
3
  .pagination {
4
4
  display: flex;
@@ -1,4 +1,4 @@
1
- @use '../../../mixin' as *;
1
+ @use '../../mixin' as *;
2
2
 
3
3
  .toastPortal {
4
4
  position: fixed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podo-ui",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "type": "module",
5
5
  "author": "hada0127 <work@tarucy.net>",
6
6
  "license": "MIT",
@@ -62,7 +62,7 @@
62
62
  "build": "next build",
63
63
  "build:lib": "npm run clean && tsc -p tsconfig.build.json && npm run copy:styles && npm run fix:scss-paths",
64
64
  "copy:styles": "find react -name '*.scss' -exec sh -c 'mkdir -p \"dist/$(dirname \"{}\")\" && cp \"{}\" \"dist/{}\"' \\;",
65
- "fix:scss-paths": "find dist/react -name '*.scss' -type f -exec sed -i '' -e 's|../../scss|../../../scss|g' -e \"s|'../../mixin'|'../../../mixin'|g\" -e 's|\\.\\./\\.\\./mixin\\.scss|../../../mixin.scss|g' -e 's|\\.\\./\\.\\./global\\.scss|../../../global.scss|g' {} \\;",
65
+ "fix:scss-paths": "find dist/react -name '*.scss' -type f -exec sed -i '' 's|../../scss|../../../scss|g' {} \\;",
66
66
  "clean": "rm -rf dist && rm -f .tsbuildinfo",
67
67
  "prepublishOnly": "npm run build:lib",
68
68
  "start": "next start",