@team-monolith/cds 1.65.3 → 1.67.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.
- package/dist/components/Banner.d.ts +3 -0
- package/dist/components/Banner.js +3 -3
- package/dist/icons/Custom.d.ts +12 -0
- package/dist/icons/Custom.js +56 -0
- package/dist/icons/custom/badge-gold.svg +11 -0
- package/dist/icons/custom/badge-green.svg +11 -0
- package/dist/icons/custom/badge-silver.svg +11 -0
- package/dist/patterns/LexicalEditor/convertToMarkdown.d.ts +1 -2
- package/dist/patterns/LexicalEditor/convertToMarkdown.js +2 -2
- package/dist/patterns/LexicalEditor/plugins/MarkdownTransformers/index.d.ts +0 -2
- package/dist/patterns/LexicalEditor/plugins/MarkdownTransformers/index.js +0 -34
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { ButtonProps } from "./Button";
|
|
2
3
|
export type BannerColor = "red" | "blue" | "green" | "yellow" | "white";
|
|
3
4
|
export interface BannerProps {
|
|
4
5
|
className?: string;
|
|
@@ -17,6 +18,8 @@ export interface BannerProps {
|
|
|
17
18
|
onButtonClick?: () => void;
|
|
18
19
|
/** 버튼 컴포넌트에 삽입될 ClassName */
|
|
19
20
|
buttonClassName?: string;
|
|
21
|
+
/** Button에 전달될 Props */
|
|
22
|
+
buttonProps?: Omit<ButtonProps, "className" | "label" | "onClick">;
|
|
20
23
|
/** 컴포넌트 우측에 표기될 닫기 버튼 유무 */
|
|
21
24
|
close?: boolean;
|
|
22
25
|
/** 닫기 버튼 클릭 시 호출될 콜백 함수 */
|
|
@@ -48,7 +48,7 @@ const COLOR_PALETTE = (theme, color) => ({
|
|
|
48
48
|
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=44-2847&t=bhnL1ombbddld3RQ-0)
|
|
49
49
|
*/
|
|
50
50
|
const Banner = React.forwardRef((props, ref) => {
|
|
51
|
-
const { className, component: Component = "div", headline, content, icon, color, buttonLabel, buttonClassName, onButtonClick, close, onClose, fullWidth } = props, other = __rest(props, ["className", "component", "headline", "content", "icon", "color", "buttonLabel", "buttonClassName", "onButtonClick", "close", "onClose", "fullWidth"]);
|
|
51
|
+
const { className, component: Component = "div", headline, content, icon, color, buttonLabel, buttonClassName, onButtonClick, buttonProps, close, onClose, fullWidth } = props, other = __rest(props, ["className", "component", "headline", "content", "icon", "color", "buttonLabel", "buttonClassName", "onButtonClick", "buttonProps", "close", "onClose", "fullWidth"]);
|
|
52
52
|
const theme = useTheme();
|
|
53
53
|
return (_jsxs(Component, Object.assign({}, other, { ref: ref, className: className, css: [
|
|
54
54
|
css `
|
|
@@ -73,9 +73,9 @@ const Banner = React.forwardRef((props, ref) => {
|
|
|
73
73
|
color: ${COLOR_PALETTE(theme, color).headline};
|
|
74
74
|
` }, { children: headline }))), content && (_jsx(ContentDiv, Object.assign({ css: css `
|
|
75
75
|
color: ${COLOR_PALETTE(theme, color).content};
|
|
76
|
-
` }, { children: content })))] }), buttonLabel && (_jsx(Button, { className: buttonClassName, css: css `
|
|
76
|
+
` }, { children: content })))] }), buttonLabel && (_jsx(Button, Object.assign({ className: buttonClassName, css: css `
|
|
77
77
|
color: ${COLOR_PALETTE(theme, color).content};
|
|
78
|
-
`, color: "textNeutral", size: "small", label: buttonLabel, onClick: onButtonClick })), close && (_jsx(SquareButton, { css: css `
|
|
78
|
+
`, color: "textNeutral", size: "small", label: buttonLabel, onClick: onButtonClick }, buttonProps))), close && (_jsx(SquareButton, { css: css `
|
|
79
79
|
> button {
|
|
80
80
|
color: ${COLOR_PALETTE(theme, color).content};
|
|
81
81
|
}
|
package/dist/icons/Custom.d.ts
CHANGED
|
@@ -316,3 +316,15 @@ export declare const customMakecodeColorSvg: string;
|
|
|
316
316
|
export declare const CustomMakecodeColorIcon: React.ForwardRefExoticComponent<{
|
|
317
317
|
className?: string | undefined;
|
|
318
318
|
} & React.RefAttributes<any>>;
|
|
319
|
+
export declare const customBadgeGreenSvg: string;
|
|
320
|
+
export declare const CustomBadgeGreenIcon: React.ForwardRefExoticComponent<{
|
|
321
|
+
className?: string | undefined;
|
|
322
|
+
} & React.RefAttributes<any>>;
|
|
323
|
+
export declare const customBadgeSilverSvg: string;
|
|
324
|
+
export declare const CustomBadgeSilverIcon: React.ForwardRefExoticComponent<{
|
|
325
|
+
className?: string | undefined;
|
|
326
|
+
} & React.RefAttributes<any>>;
|
|
327
|
+
export declare const customBadgeGoldSvg: string;
|
|
328
|
+
export declare const CustomBadgeGoldIcon: React.ForwardRefExoticComponent<{
|
|
329
|
+
className?: string | undefined;
|
|
330
|
+
} & React.RefAttributes<any>>;
|
package/dist/icons/Custom.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
/* eslint-disable react/display-name */
|
|
2
4
|
import { uid } from "uid";
|
|
3
5
|
import { useMemo, forwardRef } from "react";
|
|
4
6
|
import customClassSvgImport from "./custom/class.svg";
|
|
@@ -356,3 +358,57 @@ export const customMakecodeColorSvg = customMakecodeColorSvgImport;
|
|
|
356
358
|
export const CustomMakecodeColorIcon = forwardRef((props, ref) => {
|
|
357
359
|
return (_jsxs("svg", Object.assign({}, props, { ref: ref, width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M2.5 18V14.3C2.5 13.4716 1.82843 12.8 1 12.8H0.5V11.2H1C1.82843 11.2 2.5 10.5284 2.5 9.7V6C2.5 4.34315 3.84315 3 5.5 3H6.5V5H5.5C4.94772 5 4.5 5.44772 4.5 6V10.1C4.5 10.9858 3.92408 11.7372 3.12623 12C3.92408 12.2628 4.5 13.0142 4.5 13.9V18C4.5 18.5523 4.94772 19 5.5 19H6.5V21H5.5C3.84315 21 2.5 19.6569 2.5 18ZM21.5 14.3V18C21.5 19.6569 20.1569 21 18.5 21H17.5V19H18.5C19.0523 19 19.5 18.5523 19.5 18V13.9C19.5 13.0142 20.0759 12.2628 20.8738 12C20.0759 11.7372 19.5 10.9858 19.5 10.1V6C19.5 5.44772 19.0523 5 18.5 5H17.5V3H18.5C20.1569 3 21.5 4.34315 21.5 6V9.7C21.5 10.5284 22.1716 11.2 23 11.2H23.5V12.8H23C22.1716 12.8 21.5 13.4716 21.5 14.3Z", fill: "#FFE0F9" }), _jsx("path", { d: "M14.599 6.46154C14.368 6.46154 14.2188 6.21672 14.2885 6.00491C14.3609 5.78494 14.4 5.5507 14.4 5.30769C14.4 4.03319 13.3255 3 12 3C10.6745 3 9.6 4.03319 9.6 5.30769C9.6 5.5507 9.63906 5.78494 9.71148 6.00491C9.78121 6.21672 9.63201 6.46154 9.40096 6.46154H7.2C6.53726 6.46154 6 6.97813 6 7.61538V16.8462C6 17.4834 6.53726 18 7.2 18H16.8C17.4627 18 18 17.4834 18 16.8462V14.7298C18 14.5077 17.7454 14.3642 17.5251 14.4313C17.2963 14.5009 17.0527 14.5385 16.8 14.5385C15.4745 14.5385 14.4 13.5053 14.4 12.2308C14.4 10.9563 15.4745 9.92308 16.8 9.92308C17.0527 9.92308 17.2963 9.96064 17.5251 10.0303C17.7454 10.0973 18 9.95386 18 9.73169V7.61539C18 6.97813 17.4627 6.46154 16.8 6.46154H14.599Z", fill: "#AA278F" })] })));
|
|
358
360
|
});
|
|
361
|
+
import customBadgeGreenSvgImport from "./custom/badge-green.svg";
|
|
362
|
+
export const customBadgeGreenSvg = customBadgeGreenSvgImport;
|
|
363
|
+
export const CustomBadgeGreenIcon = forwardRef((props, ref) => {
|
|
364
|
+
const uniqueId = useMemo(uid, []);
|
|
365
|
+
return (_jsxs("svg", Object.assign({}, props, { ref: ref, width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12Z", fill: `url(#paint0_linear_${uniqueId})` }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21ZM12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23Z", fill: "#363636", style: {
|
|
366
|
+
fill: "color(display-p3 0.2118 0.2118 0.2118)",
|
|
367
|
+
fillOpacity: 1,
|
|
368
|
+
} }), _jsx("path", { d: "M10.5 14.1177L17 8L18 8.94118L10.5 16L6 11.7647L7 10.8236L10.5 14.1177Z", fill: "#363636", style: {
|
|
369
|
+
fill: "color(display-p3 0.2118 0.2118 0.2118)",
|
|
370
|
+
fillOpacity: 1,
|
|
371
|
+
} }), _jsx("defs", { children: _jsxs("linearGradient", Object.assign({ id: `paint0_linear_${uniqueId}`, x1: "12", y1: "1", x2: "12", y2: "23", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#EBFF54", style: {
|
|
372
|
+
stopColor: "color(display-p3 0.9217 1.0000 0.3286)",
|
|
373
|
+
stopOpacity: 1,
|
|
374
|
+
} }), _jsx("stop", { offset: "1", stopColor: "#BFFF00", style: {
|
|
375
|
+
stopColor: "color(display-p3 0.7500 1.0000 0.0000)",
|
|
376
|
+
stopOpacity: 1,
|
|
377
|
+
} })] })) })] })));
|
|
378
|
+
});
|
|
379
|
+
import customBadgeSilverSvgImport from "./custom/badge-silver.svg";
|
|
380
|
+
export const customBadgeSilverSvg = customBadgeSilverSvgImport;
|
|
381
|
+
export const CustomBadgeSilverIcon = forwardRef((props, ref) => {
|
|
382
|
+
const uniqueId = useMemo(uid, []);
|
|
383
|
+
return (_jsxs("svg", Object.assign({}, props, { ref: ref, width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M2 1V13.8215C2 18.8902 6.47651 23 12 23C17.5235 23 22 18.8912 22 13.8215V1H2Z", fill: `url(#paint0_linear_${uniqueId})` }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4 3V13.8215C4 17.6278 7.41639 21 12 21C16.5838 21 20 17.6287 20 13.8215V3H4ZM2 13.8215C2 18.8902 6.47651 23 12 23C17.5235 23 22 18.8912 22 13.8215V1H2V13.8215Z", fill: "#363636", style: {
|
|
384
|
+
fill: "color(display-p3 0.2118 0.2118 0.2118)",
|
|
385
|
+
fillOpacity: 1,
|
|
386
|
+
} }), _jsx("path", { d: "M10.5 14.1178L17 8.00009L18 8.94127L10.5 16.0001L6 11.7648L7 10.8237L10.5 14.1178Z", fill: "#363636", style: {
|
|
387
|
+
fill: "color(display-p3 0.2118 0.2118 0.2118)",
|
|
388
|
+
fillOpacity: 1,
|
|
389
|
+
} }), _jsx("defs", { children: _jsxs("linearGradient", Object.assign({ id: `paint0_linear_${uniqueId}`, x1: "12", y1: "1", x2: "12", y2: "23", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#EFEFF8", style: {
|
|
390
|
+
stopColor: "color(display-p3 0.9362 0.9356 0.9710)",
|
|
391
|
+
stopOpacity: 1,
|
|
392
|
+
} }), _jsx("stop", { offset: "1", stopColor: "#D2EEF7", style: {
|
|
393
|
+
stopColor: "color(display-p3 0.8235 0.9333 0.9686)",
|
|
394
|
+
stopOpacity: 1,
|
|
395
|
+
} })] })) })] })));
|
|
396
|
+
});
|
|
397
|
+
import customBadgeGoldSvgImport from "./custom/badge-gold.svg";
|
|
398
|
+
export const customBadgeGoldSvg = customBadgeGoldSvgImport;
|
|
399
|
+
export const CustomBadgeGoldIcon = forwardRef((props, ref) => {
|
|
400
|
+
const uniqueId = useMemo(uid, []);
|
|
401
|
+
return (_jsxs("svg", Object.assign({}, props, { ref: ref, width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M10.0723 2.06023C11.2727 1.40005 12.7273 1.40005 13.9277 2.06023L19.9277 5.36023C21.2059 6.06324 22 7.40633 22 8.86509V15.1349C22 16.5937 21.2059 17.9368 19.9277 18.6398L13.9277 21.9398C12.7273 22.6 11.2727 22.6 10.0723 21.9398L4.07232 18.6398C2.79413 17.9368 2 16.5937 2 15.1349V8.86509C2 7.40633 2.79413 6.06324 4.07232 5.36023L10.0723 2.06023Z", fill: `url(#paint0_linear_${uniqueId})` }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.9638 7.11266L12.9638 3.81266C12.3637 3.48257 11.6363 3.48257 11.0362 3.81266L5.03616 7.11266C4.39707 7.46417 4 8.13571 4 8.86509V15.1349C4 15.8643 4.39707 16.5359 5.03616 16.8874L11.0362 20.1874C11.6363 20.5174 12.3637 20.5174 12.9638 20.1874L18.9638 16.8874C19.6029 16.5359 20 15.8643 20 15.1349V8.86509C20 8.13571 19.6029 7.46417 18.9638 7.11266ZM13.9277 2.06023C12.7273 1.40005 11.2727 1.40005 10.0723 2.06023L4.07232 5.36023C2.79413 6.06324 2 7.40633 2 8.86509V15.1349C2 16.5937 2.79413 17.9368 4.07232 18.6398L10.0723 21.9398C11.2727 22.6 12.7273 22.6 13.9277 21.9398L19.9277 18.6398C21.2059 17.9368 22 16.5937 22 15.1349V8.86509C22 7.40633 21.2059 6.06324 19.9277 5.36023L13.9277 2.06023Z", fill: "#FFCC00", style: {
|
|
402
|
+
fill: "color(display-p3 1.0000 0.8000 0.0000)",
|
|
403
|
+
fillOpacity: 1,
|
|
404
|
+
} }), _jsx("path", { d: "M10.5 14.1177L17 8L18 8.94118L10.5 16L6 11.7647L7 10.8236L10.5 14.1177Z", fill: "#FFCC00", style: {
|
|
405
|
+
fill: "color(display-p3 1.0000 0.8000 0.0000)",
|
|
406
|
+
fillOpacity: 1,
|
|
407
|
+
} }), _jsx("defs", { children: _jsxs("linearGradient", Object.assign({ id: `paint0_linear_${uniqueId}`, x1: "12", y1: "1.00001", x2: "12", y2: "23", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#29335C", style: {
|
|
408
|
+
stopColor: "color(display-p3 0.1617 0.1985 0.3626)",
|
|
409
|
+
stopOpacity: 1,
|
|
410
|
+
} }), _jsx("stop", { offset: "1", stopColor: "#2C2F37", style: {
|
|
411
|
+
stopColor: "color(display-p3 0.1725 0.1843 0.2157)",
|
|
412
|
+
stopOpacity: 1,
|
|
413
|
+
} })] })) })] })));
|
|
414
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M10.0723 2.06023C11.2727 1.40005 12.7273 1.40005 13.9277 2.06023L19.9277 5.36023C21.2059 6.06324 22 7.40633 22 8.86509V15.1349C22 16.5937 21.2059 17.9368 19.9277 18.6398L13.9277 21.9398C12.7273 22.6 11.2727 22.6 10.0723 21.9398L4.07232 18.6398C2.79413 17.9368 2 16.5937 2 15.1349V8.86509C2 7.40633 2.79413 6.06324 4.07232 5.36023L10.0723 2.06023Z" fill="url(#paint0_linear_4029_17034)" style=""/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.9638 7.11266L12.9638 3.81266C12.3637 3.48257 11.6363 3.48257 11.0362 3.81266L5.03616 7.11266C4.39707 7.46417 4 8.13571 4 8.86509V15.1349C4 15.8643 4.39707 16.5359 5.03616 16.8874L11.0362 20.1874C11.6363 20.5174 12.3637 20.5174 12.9638 20.1874L18.9638 16.8874C19.6029 16.5359 20 15.8643 20 15.1349V8.86509C20 8.13571 19.6029 7.46417 18.9638 7.11266ZM13.9277 2.06023C12.7273 1.40005 11.2727 1.40005 10.0723 2.06023L4.07232 5.36023C2.79413 6.06324 2 7.40633 2 8.86509V15.1349C2 16.5937 2.79413 17.9368 4.07232 18.6398L10.0723 21.9398C11.2727 22.6 12.7273 22.6 13.9277 21.9398L19.9277 18.6398C21.2059 17.9368 22 16.5937 22 15.1349V8.86509C22 7.40633 21.2059 6.06324 19.9277 5.36023L13.9277 2.06023Z" fill="#FFCC00" style="fill:#FFCC00;fill:color(display-p3 1.0000 0.8000 0.0000);fill-opacity:1;"/>
|
|
4
|
+
<path d="M10.5 14.1177L17 8L18 8.94118L10.5 16L6 11.7647L7 10.8236L10.5 14.1177Z" fill="#FFCC00" style="fill:#FFCC00;fill:color(display-p3 1.0000 0.8000 0.0000);fill-opacity:1;"/>
|
|
5
|
+
<defs>
|
|
6
|
+
<linearGradient id="paint0_linear_4029_17034" x1="12" y1="1.00001" x2="12" y2="23" gradientUnits="userSpaceOnUse">
|
|
7
|
+
<stop stop-color="#29335C" style="stop-color:#29335C;stop-color:color(display-p3 0.1617 0.1985 0.3626);stop-opacity:1;"/>
|
|
8
|
+
<stop offset="1" stop-color="#2C2F37" style="stop-color:#2C2F37;stop-color:color(display-p3 0.1725 0.1843 0.2157);stop-opacity:1;"/>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
</defs>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12Z" fill="url(#paint0_linear_4029_17032)" style=""/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21ZM12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23Z" fill="#363636" style="fill:#363636;fill:color(display-p3 0.2118 0.2118 0.2118);fill-opacity:1;"/>
|
|
4
|
+
<path d="M10.5 14.1177L17 8L18 8.94118L10.5 16L6 11.7647L7 10.8236L10.5 14.1177Z" fill="#363636" style="fill:#363636;fill:color(display-p3 0.2118 0.2118 0.2118);fill-opacity:1;"/>
|
|
5
|
+
<defs>
|
|
6
|
+
<linearGradient id="paint0_linear_4029_17032" x1="12" y1="1" x2="12" y2="23" gradientUnits="userSpaceOnUse">
|
|
7
|
+
<stop stop-color="#EBFF54" style="stop-color:#EBFF54;stop-color:color(display-p3 0.9217 1.0000 0.3286);stop-opacity:1;"/>
|
|
8
|
+
<stop offset="1" stop-color="#BFFF00" style="stop-color:#BFFF00;stop-color:color(display-p3 0.7500 1.0000 0.0000);stop-opacity:1;"/>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
</defs>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M2 1V13.8215C2 18.8902 6.47651 23 12 23C17.5235 23 22 18.8912 22 13.8215V1H2Z" fill="url(#paint0_linear_4029_17033)" style=""/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 3V13.8215C4 17.6278 7.41639 21 12 21C16.5838 21 20 17.6287 20 13.8215V3H4ZM2 13.8215C2 18.8902 6.47651 23 12 23C17.5235 23 22 18.8912 22 13.8215V1H2V13.8215Z" fill="#363636" style="fill:#363636;fill:color(display-p3 0.2118 0.2118 0.2118);fill-opacity:1;"/>
|
|
4
|
+
<path d="M10.5 14.1178L17 8.00009L18 8.94127L10.5 16.0001L6 11.7648L7 10.8237L10.5 14.1178Z" fill="#363636" style="fill:#363636;fill:color(display-p3 0.2118 0.2118 0.2118);fill-opacity:1;"/>
|
|
5
|
+
<defs>
|
|
6
|
+
<linearGradient id="paint0_linear_4029_17033" x1="12" y1="1" x2="12" y2="23" gradientUnits="userSpaceOnUse">
|
|
7
|
+
<stop stop-color="#EFEFF8" style="stop-color:#EFEFF8;stop-color:color(display-p3 0.9362 0.9356 0.9710);stop-opacity:1;"/>
|
|
8
|
+
<stop offset="1" stop-color="#D2EEF7" style="stop-color:#D2EEF7;stop-color:color(display-p3 0.8235 0.9333 0.9686);stop-opacity:1;"/>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
</defs>
|
|
11
|
+
</svg>
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { SerializedEditorState } from "lexical";
|
|
2
|
-
|
|
3
|
-
export declare function convertToMarkdown(serializedLexical: SerializedEditorState, transformers?: Transformer[]): string;
|
|
2
|
+
export declare function convertToMarkdown(serializedLexical: SerializedEditorState): string;
|
|
@@ -2,7 +2,7 @@ import { createEditor } from "lexical";
|
|
|
2
2
|
import { $convertToMarkdownString } from "@lexical/markdown";
|
|
3
3
|
import { CODLE_TRANSFORMERS } from "./plugins/MarkdownTransformers";
|
|
4
4
|
import { nodes } from "./nodes";
|
|
5
|
-
export function convertToMarkdown(serializedLexical
|
|
5
|
+
export function convertToMarkdown(serializedLexical) {
|
|
6
6
|
// Create a Lexical editor instance
|
|
7
7
|
const editor = createEditor({
|
|
8
8
|
nodes,
|
|
@@ -15,7 +15,7 @@ export function convertToMarkdown(serializedLexical, transformers) {
|
|
|
15
15
|
// Convert the Lexical editor state to Markdown string
|
|
16
16
|
let markdown = "";
|
|
17
17
|
editor.update(() => {
|
|
18
|
-
markdown = $convertToMarkdownString(
|
|
18
|
+
markdown = $convertToMarkdownString(CODLE_TRANSFORMERS);
|
|
19
19
|
});
|
|
20
20
|
return markdown;
|
|
21
21
|
}
|
|
@@ -9,6 +9,4 @@ import { ElementTransformer, TextMatchTransformer, Transformer } from "@lexical/
|
|
|
9
9
|
export declare const HR: ElementTransformer;
|
|
10
10
|
export declare const IMAGE: TextMatchTransformer;
|
|
11
11
|
export declare const TABLE: ElementTransformer;
|
|
12
|
-
export declare const IMAGE_LLM: TextMatchTransformer;
|
|
13
12
|
export declare const CODLE_TRANSFORMERS: Array<Transformer>;
|
|
14
|
-
export declare const LLM_TRANSFORMERS: Array<Transformer>;
|
|
@@ -188,29 +188,6 @@ const SHEET_INPUT = {
|
|
|
188
188
|
regExp: /a^/,
|
|
189
189
|
replace: () => { },
|
|
190
190
|
};
|
|
191
|
-
// LLM에게 의미없는 이미지 URL을 제공하지 않습니다.
|
|
192
|
-
export const IMAGE_LLM = {
|
|
193
|
-
dependencies: [ImageNode],
|
|
194
|
-
export: (node) => {
|
|
195
|
-
if (!$isImageNode(node)) {
|
|
196
|
-
return null;
|
|
197
|
-
}
|
|
198
|
-
return `![${node.getAltText()}]()`;
|
|
199
|
-
},
|
|
200
|
-
importRegExp: /!(?:\[([^[]*)\])(?:\(([^(]+)\))/,
|
|
201
|
-
regExp: /!(?:\[([^[]*)\])(?:\(([^(]+)\))$/,
|
|
202
|
-
replace: (textNode, match) => {
|
|
203
|
-
const [, altText, src] = match;
|
|
204
|
-
const imageNode = $createImageNode({
|
|
205
|
-
altText,
|
|
206
|
-
maxWidth: 800,
|
|
207
|
-
src,
|
|
208
|
-
});
|
|
209
|
-
textNode.replace(imageNode);
|
|
210
|
-
},
|
|
211
|
-
trigger: ")",
|
|
212
|
-
type: "text-match",
|
|
213
|
-
};
|
|
214
191
|
export const CODLE_TRANSFORMERS = [
|
|
215
192
|
TABLE,
|
|
216
193
|
HR,
|
|
@@ -219,16 +196,5 @@ export const CODLE_TRANSFORMERS = [
|
|
|
219
196
|
...ELEMENT_TRANSFORMERS,
|
|
220
197
|
...TEXT_FORMAT_TRANSFORMERS,
|
|
221
198
|
...TEXT_MATCH_TRANSFORMERS,
|
|
222
|
-
];
|
|
223
|
-
// LLM에 전달하기 위한 용도로 사용되는 Transformer들의 모음입니다.
|
|
224
|
-
// Export 만을 지원하기도 합니다.
|
|
225
|
-
export const LLM_TRANSFORMERS = [
|
|
226
|
-
TABLE,
|
|
227
|
-
HR,
|
|
228
|
-
IMAGE_LLM,
|
|
229
|
-
CHECK_LIST,
|
|
230
|
-
...ELEMENT_TRANSFORMERS,
|
|
231
|
-
...TEXT_FORMAT_TRANSFORMERS,
|
|
232
|
-
...TEXT_MATCH_TRANSFORMERS,
|
|
233
199
|
SHEET_INPUT,
|
|
234
200
|
];
|