@team-monolith/cds 1.93.0 → 1.94.0
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.
|
@@ -3,7 +3,7 @@ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext
|
|
|
3
3
|
import { useLexicalNodeSelection } from "@lexical/react/useLexicalNodeSelection";
|
|
4
4
|
import { mergeRegister } from "@lexical/utils";
|
|
5
5
|
import { $getNodeByKey, $getSelection, $isNodeSelection, $isRangeSelection, $setSelection, CLICK_COMMAND, COMMAND_PRIORITY_LOW, createCommand, DRAGSTART_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND, SELECTION_CHANGE_COMMAND, } from "lexical";
|
|
6
|
-
import { Suspense, useCallback, useEffect, useRef, useState } from "react";
|
|
6
|
+
import { Suspense, useCallback, useEffect, useRef, useState, } from "react";
|
|
7
7
|
import { $isImageNode } from "./ImageNode";
|
|
8
8
|
import { SquareButton } from "../../../../components/SquareButton";
|
|
9
9
|
import { Settings3FillIcon } from "../../../../icons";
|
|
@@ -30,7 +30,7 @@ function useSuspenseImage(src) {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function LazyImage({ altText, className, imageRef, src, width, height, maxWidth: _maxWidth, onError, }) {
|
|
33
|
+
function LazyImage({ altText, className, imageRef, src, width, height, maxWidth: _maxWidth, onError, title, onClick, }) {
|
|
34
34
|
useSuspenseImage(src);
|
|
35
35
|
return (_jsx("img", { className: className || undefined, src: src, alt: altText, ref: imageRef, style: {
|
|
36
36
|
height,
|
|
@@ -40,7 +40,7 @@ function LazyImage({ altText, className, imageRef, src, width, height, maxWidth:
|
|
|
40
40
|
// fixme: maxWidth를 수정할 수 있게 되면 원복합니다.
|
|
41
41
|
maxWidth: "100%",
|
|
42
42
|
width,
|
|
43
|
-
}, onError: onError, draggable: "false" }));
|
|
43
|
+
}, title: title, onClick: onClick, onError: onError, draggable: "false" }));
|
|
44
44
|
}
|
|
45
45
|
export function ImageComponent({ src, altText, nodeKey, width, height, maxWidth, resizable, }) {
|
|
46
46
|
const imageRef = useRef(null);
|
|
@@ -182,7 +182,9 @@ export function ImageComponent({ src, altText, nodeKey, width, height, maxWidth,
|
|
|
182
182
|
if (!isEditable) {
|
|
183
183
|
return (_jsx(Suspense, Object.assign({ fallback: null }, { children: _jsx("div", Object.assign({ draggable: draggable }, { children: isLoadError ? (_jsx(ImageNotAvailable, {})) : (_jsx(LazyImage, { className: isFocused
|
|
184
184
|
? `focused ${$isNodeSelection(selection) ? "draggable" : ""}`
|
|
185
|
-
: null,
|
|
185
|
+
: null, css: css `
|
|
186
|
+
cursor: pointer;
|
|
187
|
+
`, src: src, altText: altText, imageRef: imageRef, width: width, height: height, maxWidth: maxWidth, onError: () => setIsLoadError(true), onClick: () => window.open(src, "_blank"), title: "\uD074\uB9AD\uD574\uC11C \uC6D0\uBCF8 \uC774\uBBF8\uC9C0 \uBCF4\uAE30" })) })) })));
|
|
186
188
|
}
|
|
187
189
|
return (_jsxs(_Fragment, { children: [_jsxs(EditContainer, { children: [_jsx(Suspense, Object.assign({ fallback: null }, { children: _jsx("div", Object.assign({ draggable: draggable, css: css `
|
|
188
190
|
// ImageResizer를 위한 relative 설정입니다.
|
|
@@ -31,18 +31,17 @@ export const ParagraphPlaceholderPlugin = ({ placeholder, }) => {
|
|
|
31
31
|
if (!selection ||
|
|
32
32
|
!$isRangeSelection(selection) ||
|
|
33
33
|
!selection.isCollapsed()) {
|
|
34
|
-
return
|
|
34
|
+
return;
|
|
35
35
|
}
|
|
36
36
|
const focusedNode = selection.focus.getNode();
|
|
37
37
|
if (!$isParagraphNode(focusedNode) || !focusedNode.isEmpty())
|
|
38
|
-
return
|
|
38
|
+
return;
|
|
39
39
|
const el = editor.getElementByKey(focusedNode.getKey());
|
|
40
40
|
if (el instanceof HTMLParagraphElement) {
|
|
41
41
|
paragraphRef.current = el;
|
|
42
42
|
paragraphRef.current.setAttribute("data-placeholder", placeholder);
|
|
43
43
|
paragraphRef.current.classList.add(placeholderClassName);
|
|
44
44
|
}
|
|
45
|
-
return false;
|
|
46
45
|
});
|
|
47
46
|
});
|
|
48
47
|
return () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@team-monolith/cds",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.94.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"scripts": {
|
|
34
34
|
"clean": "rimraf dist",
|
|
35
|
-
"compile": "npm run clean && mkdir dist && npm run iconconvert && npm run svgr-customicon && tsc && npm run postbundle",
|
|
35
|
+
"compile": "npm i && npm run clean && mkdir dist && npm run iconconvert && npm run svgr-customicon && tsc && npm run postbundle",
|
|
36
36
|
"postbundle": "copyfiles -u 2 src/cds/**/*.{svg,jpg,png} dist/",
|
|
37
37
|
"storybook": "storybook dev -p 6006",
|
|
38
38
|
"build-storybook": "storybook build",
|