@team-monolith/cds 1.122.3 → 1.122.4
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.
- package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageComponent.js +4 -1
- package/dist/patterns/LexicalEditor/plugins/ImagesPlugin/index.js +1 -1
- package/dist/patterns/LexicalEditor/plugins/ImagesPlugin/{imageNodeTransform.js → useImageNodeTransform.js} +2 -8
- package/package.json +1 -1
- /package/dist/patterns/LexicalEditor/plugins/ImagesPlugin/{imageNodeTransform.d.ts → useImageNodeTransform.d.ts} +0 -0
|
@@ -212,7 +212,10 @@ export function ImageComponent({ src, altText, nodeKey, width, height, maxWidth,
|
|
|
212
212
|
setOpen(true);
|
|
213
213
|
}, "aria-label": t("이미지 수정하기", {
|
|
214
214
|
context: "스퀘어버튼, 렉시컬 이미지 도구",
|
|
215
|
-
}) })] }), _jsx(InsertImageDialog
|
|
215
|
+
}) })] }), _jsx(InsertImageDialog
|
|
216
|
+
// AIDEV-NOTE
|
|
217
|
+
// 내부 폼 상태 초기화를 위해 key를 전달합니다.
|
|
218
|
+
, { open: open, title: t("이미지 수정하기", {
|
|
216
219
|
context: "제목, 이미지 수정 다이얼로그",
|
|
217
220
|
}), onClose: () => setOpen(false), imageProps: {
|
|
218
221
|
src,
|
|
@@ -10,7 +10,7 @@ import { $insertNodeToNearestRoot, mergeRegister } from "@lexical/utils";
|
|
|
10
10
|
import { $createRangeSelection, $getSelection, $isNodeSelection, $setSelection, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, createCommand, DRAGOVER_COMMAND, DRAGSTART_COMMAND, DROP_COMMAND, } from "lexical";
|
|
11
11
|
import { useEffect } from "react";
|
|
12
12
|
import { $createImageNode, $isImageNode, ImageNode, } from "../../nodes";
|
|
13
|
-
import { useImageNodeTransform } from "./
|
|
13
|
+
import { useImageNodeTransform } from "./useImageNodeTransform";
|
|
14
14
|
const CAN_USE_DOM = typeof window !== "undefined" &&
|
|
15
15
|
typeof window.document !== "undefined" &&
|
|
16
16
|
typeof window.document.createElement !== "undefined";
|
|
@@ -16,18 +16,12 @@ const DATA_URL_PATTERN = /^data:[^,]+,/i;
|
|
|
16
16
|
function isDataUrl(url) {
|
|
17
17
|
return DATA_URL_PATTERN.test(url);
|
|
18
18
|
}
|
|
19
|
-
function getExtensionFromMimeType(mimeType) {
|
|
20
|
-
var _a;
|
|
21
|
-
const extension = (_a = mimeType.split("/")[1]) === null || _a === void 0 ? void 0 : _a.split("+")[0];
|
|
22
|
-
return extension || "png";
|
|
23
|
-
}
|
|
24
19
|
function convertDataUrlToFile(dataUrl) {
|
|
25
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
21
|
try {
|
|
27
22
|
const response = yield fetch(dataUrl);
|
|
28
23
|
const blob = yield response.blob();
|
|
29
|
-
const
|
|
30
|
-
const filename = `pasted-image-${Date.now()}.${extension}`;
|
|
24
|
+
const filename = `pasted-image-${Date.now()}`;
|
|
31
25
|
return new File([blob], filename, { type: blob.type });
|
|
32
26
|
}
|
|
33
27
|
catch (_a) {
|
|
@@ -65,7 +59,7 @@ export function useImageNodeTransform(editor) {
|
|
|
65
59
|
const file = yield convertDataUrlToFile(src);
|
|
66
60
|
if (!file) {
|
|
67
61
|
processingNodesRef.current.delete(key);
|
|
68
|
-
showFileError === null || showFileError === void 0 ? void 0 : showFileError("upload", t("
|
|
62
|
+
showFileError === null || showFileError === void 0 ? void 0 : showFileError("upload", t("손상된 이미지입니다. 다른 이미지를 사용해 주세요."));
|
|
69
63
|
editor.update(() => {
|
|
70
64
|
const currentNode = $getNodeByKey(key);
|
|
71
65
|
if ($isImageNode(currentNode)) {
|
package/package.json
CHANGED
|
File without changes
|