@team-monolith/cds 1.82.4 → 1.83.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.
Files changed (29) hide show
  1. package/dist/components/CheckboxInput.js +11 -13
  2. package/dist/components/DecoratedNumber/Default/DefaultNumberLarge.d.ts +7 -5
  3. package/dist/components/DecoratedNumber/Default/DefaultNumberSmall.d.ts +6 -4
  4. package/dist/components/RadioInput.js +8 -10
  5. package/dist/icons/custom/uniqueidscripts.mjs +1 -3
  6. package/dist/patterns/Dropdown/Dropdown.js +1 -1
  7. package/dist/patterns/Dropdown/DropdownItem/DropdownItem.js +4 -6
  8. package/dist/patterns/Dropdown/DropdownMenu/DropdownMenu.d.ts +4 -3
  9. package/dist/patterns/Dropdown/DropdownMenu/DropdownMenu.js +33 -37
  10. package/dist/patterns/Dropdown/DropdownMenu/style.d.ts +5 -4
  11. package/dist/patterns/Dropdown/DropdownMenu/style.js +5 -65
  12. package/dist/patterns/LexicalEditor/LexicalEditor.js +2 -0
  13. package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageResizer.js +4 -0
  14. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormPlaceholder.js +1 -3
  15. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormSegmentedControl.js +4 -8
  16. package/dist/patterns/LexicalEditor/nodes/SheetInputNode/SettingForm.js +1 -3
  17. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/FormAllowMultipleAnswers.js +1 -3
  18. package/dist/patterns/LexicalEditor/nodes/nodes.js +1 -3
  19. package/dist/patterns/LexicalEditor/plugins/ActionsPlugin/index.js +3 -5
  20. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/ComponentAdderPlugin.js +1 -3
  21. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/useDraggableBlockMenu.js +3 -5
  22. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.js +2 -0
  23. package/dist/patterns/LexicalEditor/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js +12 -14
  24. package/dist/patterns/LexicalEditor/plugins/FloatingTextFormatToolbarPlugin/index.js +10 -12
  25. package/dist/patterns/LexicalEditor/plugins/ImagesPlugin/index.js +4 -7
  26. package/dist/patterns/LexicalEditor/plugins/LayoutPlugin/index.js +1 -1
  27. package/dist/patterns/LexicalEditor/plugins/ListMaxIndentLevelPlugin/index.js +1 -3
  28. package/dist/patterns/LexicalEditor/plugins/MarkdownTransformers/index.js +1 -3
  29. package/package.json +2 -2
@@ -15,21 +15,20 @@ import { css, useTheme } from "@emotion/react";
15
15
  import * as React from "react";
16
16
  import styled from "@emotion/styled";
17
17
  import { ZINDEX } from "../utils/zIndex";
18
- const CHECKBOX_ICON_STYLE = (theme, type, disabled) => {
19
- return {
20
- default: css `
18
+ const CHECKBOX_ICON_STYLE = (theme, type, disabled) => ({
19
+ default: css `
21
20
  rect {
22
21
  fill: ${theme.color.background.neutralBase};
23
22
  stroke: ${theme.color.background.neutralAltActive};
24
23
  }
25
24
  ${disabled
26
- ? css `
25
+ ? css `
27
26
  rect {
28
27
  fill: ${theme.color.background.neutralBaseDisabled};
29
28
  stroke: ${theme.color.foreground.neutralBaseDisabled};
30
29
  }
31
30
  `
32
- : css `
31
+ : css `
33
32
  input[type="checkbox"]:hover + & {
34
33
  rect {
35
34
  stroke: ${theme.color.background.primary};
@@ -37,7 +36,7 @@ const CHECKBOX_ICON_STYLE = (theme, type, disabled) => {
37
36
  }
38
37
  `}
39
38
  `,
40
- checked: css `
39
+ checked: css `
41
40
  rect {
42
41
  fill: ${theme.color.background.primary};
43
42
  stroke: ${theme.color.background.primary};
@@ -46,7 +45,7 @@ const CHECKBOX_ICON_STYLE = (theme, type, disabled) => {
46
45
  fill: ${theme.color.background.neutralBase};
47
46
  }
48
47
  ${disabled
49
- ? css `
48
+ ? css `
50
49
  rect {
51
50
  fill: ${theme.color.background.neutralBaseDisabled};
52
51
  stroke: ${theme.color.background.primaryDisabled};
@@ -55,7 +54,7 @@ const CHECKBOX_ICON_STYLE = (theme, type, disabled) => {
55
54
  fill: ${theme.color.background.primaryDisabled};
56
55
  }
57
56
  `
58
- : css `
57
+ : css `
59
58
  input[type="checkbox"]:hover + & {
60
59
  rect {
61
60
  fill: ${theme.color.background.primaryActive};
@@ -64,7 +63,7 @@ const CHECKBOX_ICON_STYLE = (theme, type, disabled) => {
64
63
  }
65
64
  `}
66
65
  `,
67
- partial: css `
66
+ partial: css `
68
67
  rect {
69
68
  fill: ${theme.color.background.neutralBase};
70
69
  stroke: ${theme.color.background.primary};
@@ -74,7 +73,7 @@ const CHECKBOX_ICON_STYLE = (theme, type, disabled) => {
74
73
  stroke: none;
75
74
  }
76
75
  ${disabled
77
- ? css `
76
+ ? css `
78
77
  rect {
79
78
  fill: ${theme.color.background.neutralBaseDisabled};
80
79
  stroke: ${theme.color.background.primaryDisabled};
@@ -84,7 +83,7 @@ const CHECKBOX_ICON_STYLE = (theme, type, disabled) => {
84
83
  stroke: none;
85
84
  }
86
85
  `
87
- : css `
86
+ : css `
88
87
  input[type="checkbox"]:hover + & {
89
88
  rect {
90
89
  stroke: ${theme.color.background.primaryActive};
@@ -96,8 +95,7 @@ const CHECKBOX_ICON_STYLE = (theme, type, disabled) => {
96
95
  }
97
96
  `}
98
97
  `,
99
- }[type];
100
- };
98
+ })[type];
101
99
  /**
102
100
  * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=36-907&t=G4t39O7uXZvsGQ9u-0)
103
101
  */
@@ -1,7 +1,9 @@
1
1
  /// <reference types="react" />
2
- export declare const DefaultNumberLarge: import("react").ForwardRefExoticComponent<{
3
- className?: string | undefined;
2
+ interface DefaultNumberLargeProps {
3
+ className?: string;
4
4
  number: number;
5
- innerColor?: string | undefined;
6
- outerColor?: string | undefined;
7
- } & import("react").RefAttributes<SVGSVGElement>>;
5
+ innerColor?: string;
6
+ outerColor?: string;
7
+ }
8
+ export declare const DefaultNumberLarge: import("react").ForwardRefExoticComponent<DefaultNumberLargeProps & import("react").RefAttributes<SVGSVGElement>>;
9
+ export {};
@@ -1,6 +1,8 @@
1
1
  /// <reference types="react" />
2
- export declare const DefaultNumberSmall: import("react").ForwardRefExoticComponent<{
3
- className?: string | undefined;
2
+ interface DefaultNumberSmallProps {
3
+ className?: string;
4
4
  number: number;
5
- color?: string | undefined;
6
- } & import("react").RefAttributes<SVGSVGElement>>;
5
+ color?: string;
6
+ }
7
+ export declare const DefaultNumberSmall: import("react").ForwardRefExoticComponent<DefaultNumberSmallProps & import("react").RefAttributes<SVGSVGElement>>;
8
+ export {};
@@ -15,21 +15,20 @@ import { css, useTheme } from "@emotion/react";
15
15
  import * as React from "react";
16
16
  import styled from "@emotion/styled";
17
17
  import { ZINDEX } from "../utils/zIndex";
18
- const TYPE_TO_ICON_STYLE = (theme, type, disabled) => {
19
- return {
20
- default: css `
18
+ const TYPE_TO_ICON_STYLE = (theme, type, disabled) => ({
19
+ default: css `
21
20
  path {
22
21
  stroke: ${theme.color.background.neutralAltActive};
23
22
  fill: ${theme.color.background.neutralBase};
24
23
  }
25
24
  ${disabled
26
- ? css `
25
+ ? css `
27
26
  path {
28
27
  stroke: ${theme.color.foreground.neutralBaseDisabled};
29
28
  fill: ${theme.color.background.neutralBaseDisabled};
30
29
  }
31
30
  `
32
- : css `
31
+ : css `
33
32
  input[type="radio"]:hover + & {
34
33
  path {
35
34
  stroke: ${theme.color.background.primary};
@@ -37,7 +36,7 @@ const TYPE_TO_ICON_STYLE = (theme, type, disabled) => {
37
36
  }
38
37
  `}
39
38
  `,
40
- selected: css `
39
+ selected: css `
41
40
  path {
42
41
  stroke: ${theme.color.background.primary};
43
42
  fill: ${theme.color.background.neutralBase};
@@ -46,7 +45,7 @@ const TYPE_TO_ICON_STYLE = (theme, type, disabled) => {
46
45
  fill: ${theme.color.background.primary};
47
46
  }
48
47
  ${disabled
49
- ? css `
48
+ ? css `
50
49
  path {
51
50
  stroke: ${theme.color.background.primaryDisabled};
52
51
  fill: ${theme.color.background.neutralBaseDisabled};
@@ -55,7 +54,7 @@ const TYPE_TO_ICON_STYLE = (theme, type, disabled) => {
55
54
  fill: ${theme.color.background.primaryDisabled};
56
55
  }
57
56
  `
58
- : css `
57
+ : css `
59
58
  input[type="radio"]:hover + & {
60
59
  path {
61
60
  stroke: ${theme.color.background.primaryActive};
@@ -66,8 +65,7 @@ const TYPE_TO_ICON_STYLE = (theme, type, disabled) => {
66
65
  }
67
66
  `}
68
67
  `,
69
- }[type];
70
- };
68
+ })[type];
71
69
  /**
72
70
  * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=420-3704&t=lvpbJKdtz7Lb8wIQ-0)
73
71
  */
@@ -15,9 +15,7 @@ function replaceUniqueIds(dirPath) {
15
15
  let content = fs.readFileSync(filePath).toString();
16
16
  if (content.match(UNIQUE_ID_PATTERN) !== null) {
17
17
  // uniqueId 템플릿 리터럴 replace 적용
18
- content = content.replaceAll(UNIQUE_ID_PATTERN, (_, _idPattern, id, _urlPattern, url) => {
19
- return `{\`${id || url}\`}`;
20
- });
18
+ content = content.replaceAll(UNIQUE_ID_PATTERN, (_, _idPattern, id, _urlPattern, url) => `{\`${id || url}\`}`);
21
19
  fs.writeFileSync(filePath, content);
22
20
  }
23
21
  }
@@ -50,7 +50,7 @@ const Dropdown = forwardRef(function Dropdown(props, ref) {
50
50
  });
51
51
  return newState;
52
52
  });
53
- (_a = menuProps === null || menuProps === void 0 ? void 0 : menuProps.onClose) === null || _a === void 0 ? void 0 : _a.call(menuProps, e);
53
+ (_a = menuProps.onClose) === null || _a === void 0 ? void 0 : _a.call(menuProps, e);
54
54
  };
55
55
  return (_jsxs(Component, Object.assign({ className: className }, other, { ref: ref }, { children: [_jsx(Button, Object.assign({ css: buttonCss, ref: menuRef }, buttonProps, { onClick: handleClick, fullWidth: true })), _jsx(DropdownMenu, Object.assign({}, menuProps, { open: isControlled ? menuProps.open : open, onClose: handleClose, anchorEl: menuRef.current, closeOnItemClick: closeOnItemClick, itemState: itemState, setItemState: setItemState }, { children: children }))] })));
56
56
  });
@@ -19,12 +19,10 @@ import { useContext, useRef } from "react";
19
19
  import { DropdownMenu } from "../DropdownMenu";
20
20
  import { DropdownContext } from "../DropdownContext";
21
21
  import { getSelected, setSelected } from "./selected";
22
- const TYPE_TO_COLOR = (theme, type) => {
23
- return {
24
- default: theme.color.foreground.neutralBase,
25
- danger: theme.color.foreground.danger,
26
- }[type];
27
- };
22
+ const TYPE_TO_COLOR = (theme, type) => ({
23
+ default: theme.color.foreground.neutralBase,
24
+ danger: theme.color.foreground.danger,
25
+ })[type];
28
26
  /**
29
27
  * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=106-1900&t=FwczLZ1IVvskUVbT-0)
30
28
  */
@@ -1,11 +1,12 @@
1
+ /** @jsxImportSource @emotion/react */
1
2
  import { SerializedStyles } from "@emotion/react";
2
3
  import React from "react";
3
- import { ModalProps } from "@mui/material";
4
4
  import { OriginProps } from "./style";
5
5
  import { ItemState } from "../DropdownItem";
6
6
  export declare const DROPDOWN_MENU_WIDTH = 132;
7
7
  export declare const DROPDOWN_MENU_MAX_HEIGHT = 160;
8
- export interface DropdownMenuProps extends Omit<ModalProps, "open" | "onClose" | "children"> {
8
+ export interface DropdownMenuProps {
9
+ className?: string;
9
10
  /** 드롭다운 메뉴의 커스텀 스타일 */
10
11
  menuCss?: SerializedStyles;
11
12
  /** 드롭다운 메뉴가 열리는지 여부 */
@@ -33,5 +34,5 @@ export interface DropdownMenuProps extends Omit<ModalProps, "open" | "onClose" |
33
34
  /**
34
35
  * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=106-1921&t=FwczLZ1IVvskUVbT-0)
35
36
  */
36
- declare const DropdownMenu: React.ForwardRefExoticComponent<Omit<DropdownMenuProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
37
+ declare const DropdownMenu: React.ForwardRefExoticComponent<DropdownMenuProps & React.RefAttributes<HTMLDivElement>>;
37
38
  export { DropdownMenu };
@@ -11,12 +11,11 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
13
13
  /** @jsxImportSource @emotion/react */
14
- import styled from "@emotion/styled";
15
14
  import { css } from "@emotion/react";
16
15
  import React, { useContext } from "react";
17
- import { Modal, shadows } from "../../..";
18
- import { Grow as MuiGrow, Portal } from "@mui/material";
19
- import { ORIGIN_PROPS_TO_POSITION, ORIGIN_PROPS_TO_TRANSFORM, } from "./style";
16
+ import { shadows } from "../../..";
17
+ import { Popover, Portal } from "@mui/material";
18
+ import { ORIGIN_PROPS_TO_POSITION } from "./style";
20
19
  import { DropdownContext } from "../DropdownContext";
21
20
  export const DROPDOWN_MENU_WIDTH = 132;
22
21
  export const DROPDOWN_MENU_MAX_HEIGHT = 160;
@@ -30,14 +29,29 @@ const DropdownMenu = React.forwardRef(function DropdownMenu(props, ref) {
30
29
  }, transformOrigin = {
31
30
  vertical: "top",
32
31
  horizontal: "left",
33
- }, closeOnItemClick, children, menuCss, itemState = new Map(), setItemState = () => { } } = props, other = __rest(props, ["className", "open", "anchorEl", "onClose", "isNestedMenu", "anchorOrigin", "transformOrigin", "closeOnItemClick", "children", "menuCss", "itemState", "setItemState"]);
32
+ }, closeOnItemClick, children, menuCss, itemState = new Map(), setItemState = () => { } } = props, _other = __rest(props, ["className", "open", "anchorEl", "onClose", "isNestedMenu", "anchorOrigin", "transformOrigin", "closeOnItemClick", "children", "menuCss", "itemState", "setItemState"]);
34
33
  const { nestedIndex, onCloseOnItemClick } = useContext(DropdownContext);
35
34
  // 드롭다운 메뉴 위치 조정
36
- const anchorRect = anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.getBoundingClientRect();
37
- const menuStyle = [
38
- ORIGIN_PROPS_TO_POSITION(anchorOrigin, anchorRect, isNestedMenu),
39
- ORIGIN_PROPS_TO_TRANSFORM(transformOrigin),
40
- ];
35
+ const menuStyle = (theme) => css `
36
+ .MuiPaper-root {
37
+ position: fixed;
38
+ display: flex;
39
+ flex-direction: column;
40
+ gap: 2px;
41
+ padding: 4px;
42
+ background-color: ${theme.color.background.neutralBase};
43
+ box-shadow: ${shadows.shadow04};
44
+ border-radius: 8px;
45
+ width: ${DROPDOWN_MENU_WIDTH}px;
46
+ max-height: ${DROPDOWN_MENU_MAX_HEIGHT}px;
47
+ overflow-y: auto;
48
+ overflow-x: hidden;
49
+ // 최상위 메뉴의 mui modal 백드롭의 z-index는 1300입니다.
50
+ z-index: 1300;
51
+ ${menuCss}
52
+ ${ORIGIN_PROPS_TO_POSITION(anchorOrigin)}
53
+ }
54
+ `;
41
55
  // 최상위 드롭다운 메뉴
42
56
  if (!isNestedMenu) {
43
57
  return (_jsx(DropdownContext.Provider, Object.assign({ value: {
@@ -46,13 +60,7 @@ const DropdownMenu = React.forwardRef(function DropdownMenu(props, ref) {
46
60
  nestedIndex,
47
61
  itemState,
48
62
  setItemState,
49
- } }, { children: _jsx(Modal, Object.assign({ className: className, open: open, onClose: onClose, slotProps: {
50
- backdrop: {
51
- style: {
52
- backgroundColor: "transparent",
53
- },
54
- },
55
- } }, other, { children: _jsx(Grow, Object.assign({ in: open }, { children: _jsx(Menu, Object.assign({ ref: ref, css: [menuCss, menuStyle] }, { children: children })) })) })) })));
63
+ } }, { children: _jsx(Popover, Object.assign({ className: className, open: open, onClose: onClose, anchorEl: anchorEl, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, ref: ref, css: menuStyle }, { children: children })) })));
56
64
  }
57
65
  // 중첩 드롭다운 메뉴
58
66
  // Portal을 사용하여 DOM이 중첩되지 않고 최상단에 렌더링 됩니다.
@@ -69,25 +77,13 @@ const DropdownMenu = React.forwardRef(function DropdownMenu(props, ref) {
69
77
  nestedIndex,
70
78
  itemState,
71
79
  setItemState,
72
- } }, { children: _jsx(Grow, Object.assign({ in: open }, { children: _jsx(Menu, Object.assign({ className: className, ref: ref, css: [menuCss, menuStyle] }, { children: children })) })) })) }));
80
+ } }, { children: _jsx(Popover, Object.assign({ className: className, open: open, onClose: onCloseOnItemClick, anchorEl: anchorEl, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, ref: ref, css: menuStyle, slotProps: {
81
+ root: {
82
+ sx: {
83
+ // root slot의 dom 요소를 생성하지 않도록 하여 다른 상위 메뉴를 선택할 수 있도록 처리
84
+ display: "contents",
85
+ },
86
+ },
87
+ } }, { children: children })) })) }));
73
88
  });
74
- const Grow = styled(MuiGrow)(css `
75
- transform-origin: top left;
76
- `);
77
- const Menu = styled.div(({ theme }) => css `
78
- position: fixed;
79
- display: flex;
80
- flex-direction: column;
81
- gap: 2px;
82
- padding: 4px;
83
- background-color: ${theme.color.background.neutralBase};
84
- box-shadow: ${shadows.shadow04};
85
- border-radius: 8px;
86
- width: ${DROPDOWN_MENU_WIDTH}px;
87
- max-height: ${DROPDOWN_MENU_MAX_HEIGHT}px;
88
- overflow-y: auto;
89
- overflow-x: hidden;
90
- // 최상위 메뉴의 mui modal 백드롭의 z-index는 1300입니다.
91
- z-index: 1300;
92
- `);
93
89
  export { DropdownMenu };
@@ -2,7 +2,8 @@ export interface OriginProps {
2
2
  vertical: "top" | "center" | "bottom";
3
3
  horizontal: "left" | "center" | "right";
4
4
  }
5
- /** anchor를 기준으로 드롭다운 메뉴 원점 위치 스타일을 리턴합니다. */
6
- export declare const ORIGIN_PROPS_TO_POSITION: (anchorOrigin: OriginProps, anchorRect: DOMRect | undefined, nested?: boolean) => import("@emotion/utils").SerializedStyles;
7
- /** 드롭다운 메뉴 원점을 조정하는 스타일을 리턴합니다. */
8
- export declare const ORIGIN_PROPS_TO_TRANSFORM: (transformOrigin: OriginProps) => import("@emotion/utils").SerializedStyles;
5
+ /**
6
+ * anchor를 기준으로 드롭다운 메뉴 원점 위치 스타일을 리턴합니다.
7
+ * position의 경우 Popover 컴포넌트의 내부에서 계산되므로 margin값만 반환합니다.
8
+ */
9
+ export declare const ORIGIN_PROPS_TO_POSITION: (anchorOrigin: OriginProps) => import("@emotion/utils").SerializedStyles;
@@ -1,104 +1,44 @@
1
1
  import { css } from "@emotion/react";
2
- import { DROPDOWN_MENU_WIDTH } from "./DropdownMenu";
3
- /** anchor를 기준으로 드롭다운 메뉴 원점 위치 스타일을 리턴합니다. */
4
- export const ORIGIN_PROPS_TO_POSITION = (anchorOrigin, anchorRect, nested) => {
2
+ /**
3
+ * anchor를 기준으로 드롭다운 메뉴 원점 위치 스타일을 리턴합니다.
4
+ * position의 경우 Popover 컴포넌트의 내부에서 계산되므로 margin값만 반환합니다.
5
+ */
6
+ export const ORIGIN_PROPS_TO_POSITION = (anchorOrigin) => {
5
7
  const { vertical, horizontal } = anchorOrigin;
6
- if (!anchorRect)
7
- return css `
8
- display: none;
9
- `;
10
- const { top, bottom, left, right, width, height } = anchorRect;
11
8
  return {
12
9
  top: {
13
10
  left: css `
14
- top: ${top}px;
15
- left: ${left}px;
16
11
  margin-right: 12px;
17
12
  `,
18
13
  center: css `
19
- top: ${top}px;
20
- left: ${left + width / 2}px;
21
14
  margin-bottom: 8px;
22
15
  `,
23
16
  right: css `
24
- top: ${top}px;
25
- left: ${left + (nested ? DROPDOWN_MENU_WIDTH : width)}px;
26
17
  margin-left: 4px;
27
18
  `,
28
19
  },
29
20
  center: {
30
21
  left: css `
31
- top: ${top + height / 2}px;
32
- left: ${left}px;
33
22
  margin-right: 12px;
34
23
  `,
35
24
  center: css `
36
- top: ${top + height / 2}px;
37
- left: ${left + width / 2}px;
38
25
  margin-bottom: 8px;
39
26
  `,
40
27
  right: css `
41
- top: ${top + height / 2}px;
42
- left: ${right}px;
43
28
  margin-left: 4px;
44
29
  `,
45
30
  },
46
31
  bottom: {
47
32
  left: css `
48
- top: ${bottom}px;
49
- left: ${left}px;
50
33
  margin-top: 8px;
51
34
  `,
52
35
  center: css `
53
- top: ${bottom}px;
54
- left: ${left + width / 2}px;
55
36
  margin-top: 8px;
56
37
  `,
57
38
  right: css `
58
- top: ${bottom}px;
59
- left: ${right}px;
60
39
  margin-top: 8px;
61
40
  margin-left: 4px;
62
41
  `,
63
42
  },
64
43
  }[vertical][horizontal];
65
44
  };
66
- /** 드롭다운 메뉴 원점을 조정하는 스타일을 리턴합니다. */
67
- export const ORIGIN_PROPS_TO_TRANSFORM = (transformOrigin) => {
68
- const { vertical, horizontal } = transformOrigin;
69
- return {
70
- top: {
71
- left: css `
72
- transform: none;
73
- `,
74
- center: css `
75
- transform: translateX(-50%) !important;
76
- `,
77
- right: css `
78
- transform: translateX(-100%) !important;
79
- `,
80
- },
81
- center: {
82
- left: css `
83
- transform: translateY(-50%) !important;
84
- `,
85
- center: css `
86
- transform: translateX(-50%) translateY(-50%) !important;
87
- `,
88
- right: css `
89
- transform: translateX(-100%) translateY(-50%) !important;
90
- `,
91
- },
92
- bottom: {
93
- left: css `
94
- transform: translateY(-100%) !important;
95
- `,
96
- center: css `
97
- transform: translateX(-50%) translateY(-100%) !important;
98
- `,
99
- right: css `
100
- transform: translateX(-100%) translateY(-100%) !important;
101
- `,
102
- },
103
- }[vertical][horizontal];
104
- };
@@ -9,6 +9,8 @@ import _ from "lodash";
9
9
  function validateValue(value) {
10
10
  var _a, _b;
11
11
  // value.root.children must be non-empty array
12
+ // Lexical 원본 코드를 가져왔기 때문에 코드 변경을 최소화하기위함
13
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
12
14
  if (!((_b = (_a = value === null || value === void 0 ? void 0 : value.root) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.length)) {
13
15
  return false;
14
16
  }
@@ -49,6 +49,8 @@ export function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, imageRef,
49
49
  if (editorRootElement !== null) {
50
50
  editorRootElement.style.setProperty("cursor", `${cursorDir}-resize`, "important");
51
51
  }
52
+ // Lexical 원본 코드를 가져왔기 때문에 코드 변경을 최소화하기위함
53
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
52
54
  if (document.body !== null) {
53
55
  document.body.style.setProperty("cursor", `${cursorDir}-resize`, "important");
54
56
  userSelect.current.value = document.body.style.getPropertyValue("-webkit-user-select");
@@ -60,6 +62,8 @@ export function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, imageRef,
60
62
  if (editorRootElement !== null) {
61
63
  editorRootElement.style.setProperty("cursor", "text");
62
64
  }
65
+ // Lexical 원본 코드를 가져왔기 때문에 코드 변경을 최소화하기위함
66
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
63
67
  if (document.body !== null) {
64
68
  document.body.style.setProperty("cursor", "default");
65
69
  document.body.style.setProperty("-webkit-user-select", userSelect.current.value, userSelect.current.priority);
@@ -3,7 +3,5 @@ import { Controller } from "react-hook-form";
3
3
  import { Input } from "../../../../../components/Input";
4
4
  export function FormPlaceholder(props) {
5
5
  const { control } = props;
6
- return (_jsx(Controller, { name: "placeholder", control: control, render: ({ field: { value, onChange } }) => {
7
- return (_jsx(Input, { size: "small", color: "default", value: value, onChange: onChange, placeholder: "\uC608) \uC5EC\uAE30\uC5D0 \uC785\uB825\uD558\uC138\uC694." }));
8
- } }));
6
+ return (_jsx(Controller, { name: "placeholder", control: control, render: ({ field: { value, onChange } }) => (_jsx(Input, { size: "small", color: "default", value: value, onChange: onChange, placeholder: "\uC608) \uC5EC\uAE30\uC5D0 \uC785\uB825\uD558\uC138\uC694." })) }));
9
7
  }
@@ -3,12 +3,8 @@ import { Controller } from "react-hook-form";
3
3
  import { SegmentedControlButton, SegmentedControlGroup, } from "../../../../SegmentedControl";
4
4
  export function FormSegmentedControl(props) {
5
5
  const { control, trigger, name, items } = props;
6
- return (_jsx(Controller, { name: name, control: control, render: ({ field: { value, onChange } }) => {
7
- return (_jsx(SegmentedControlGroup, Object.assign({ size: "xsmall", value: value, onChange: (value) => {
8
- onChange(value);
9
- trigger("solutions");
10
- }, fullWidth: true }, { children: items.map((item) => {
11
- return (_jsx(SegmentedControlButton, { value: item.value, label: item.label }, item.value.toString()));
12
- }) })));
13
- } }));
6
+ return (_jsx(Controller, { name: name, control: control, render: ({ field: { value, onChange } }) => (_jsx(SegmentedControlGroup, Object.assign({ size: "xsmall", value: value, onChange: (value) => {
7
+ onChange(value);
8
+ trigger("solutions");
9
+ }, fullWidth: true }, { children: items.map((item) => (_jsx(SegmentedControlButton, { value: item.value, label: item.label }, item.value.toString()))) }))) }));
14
10
  }
@@ -34,9 +34,7 @@ export function SettingForm(props) {
34
34
  ` }), multiline ? "서술형 입력 칸" : "단답형 입력 칸"] }), _jsx(Content, { children: _jsxs(FormArea, { children: [_jsxs(Label, { children: ["\uC790\uB9AC \uD45C\uC2DC\uC790", _jsx(Tooltip, Object.assign({ text: _jsx("span", { children: "\uC785\uB825 \uCE78\uC5D0 \uAE30\uBCF8\uC73C\uB85C \uB178\uCD9C\uB418\uB294 \uD14D\uC2A4\uD2B8\uC785\uB2C8\uB2E4." }), placement: "top" }, { children: _jsx(QuestionFillIcon, { css: css `
35
35
  width: 12px;
36
36
  height: 12px;
37
- ` }) }))] }), _jsx(Controller, { name: "placeholder", control: control, render: ({ field: { value, onChange } }) => {
38
- return (_jsx(Input, { size: "small", color: "default", value: value, onChange: onChange, placeholder: "\uC608) \uC5EC\uAE30\uC5D0 \uC785\uB825\uD558\uC138\uC694." }));
39
- } })] }) }), _jsxs(Buttons, { children: [_jsx(Button, { color: "grey", size: "xsmall", label: "\uB2EB\uAE30", onClick: onClose }), _jsx(Button, { color: "primary", size: "xsmall", label: "\uC774\uB300\uB85C \uB123\uAE30", bold: true, type: "submit" })] })] })));
37
+ ` }) }))] }), _jsx(Controller, { name: "placeholder", control: control, render: ({ field: { value, onChange } }) => (_jsx(Input, { size: "small", color: "default", value: value, onChange: onChange, placeholder: "\uC608) \uC5EC\uAE30\uC5D0 \uC785\uB825\uD558\uC138\uC694." })) })] }) }), _jsxs(Buttons, { children: [_jsx(Button, { color: "grey", size: "xsmall", label: "\uB2EB\uAE30", onClick: onClose }), _jsx(Button, { color: "primary", size: "xsmall", label: "\uC774\uB300\uB85C \uB123\uAE30", bold: true, type: "submit" })] })] })));
40
38
  }
41
39
  const Form = styled.form(({ theme }) => css `
42
40
  display: flex;
@@ -4,7 +4,5 @@ import { SegmentedControlButton, SegmentedControlGroup, } from "../../../../../S
4
4
  /** SheetSelectNode SettingForm의 다중 선택 허용 여부 폼입니다. */
5
5
  export function FormAllowMultipleAnswers(props) {
6
6
  const { control } = props;
7
- return (_jsx(Controller, { name: "allowMultipleAnswers", control: control, render: ({ field: { value, onChange } }) => {
8
- return (_jsxs(SegmentedControlGroup, Object.assign({ size: "xsmall", value: value, onChange: onChange, fullWidth: true }, { children: [_jsx(SegmentedControlButton, { value: false, label: "\uD558\uB098\uB9CC \uC120\uD0DD" }), _jsx(SegmentedControlButton, { value: true, label: "\uC5EC\uB7EC \uAC1C \uC120\uD0DD" })] })));
9
- } }));
7
+ return (_jsx(Controller, { name: "allowMultipleAnswers", control: control, render: ({ field: { value, onChange } }) => (_jsxs(SegmentedControlGroup, Object.assign({ size: "xsmall", value: value, onChange: onChange, fullWidth: true }, { children: [_jsx(SegmentedControlButton, { value: false, label: "\uD558\uB098\uB9CC \uC120\uD0DD" }), _jsx(SegmentedControlButton, { value: true, label: "\uC5EC\uB7EC \uAC1C \uC120\uD0DD" })] }))) }));
10
8
  }
@@ -37,8 +37,6 @@ export const nodes = [
37
37
  SelfEvaluationNode,
38
38
  {
39
39
  replace: QuoteNode,
40
- with: () => {
41
- return new ColoredQuoteNode("grey");
42
- },
40
+ with: () => new ColoredQuoteNode("grey"),
43
41
  },
44
42
  ];
@@ -13,11 +13,9 @@ import { Button, LockFillIcon, LockUnlockFillIcon } from "../../../..";
13
13
  export function ActionsPlugin() {
14
14
  const [editor] = useLexicalComposerContext();
15
15
  const [isEditable, setIsEditable] = useState(() => editor.isEditable());
16
- useEffect(() => {
17
- return mergeRegister(editor.registerEditableListener((editable) => {
18
- setIsEditable(editable);
19
- }));
20
- }, [editor]);
16
+ useEffect(() => mergeRegister(editor.registerEditableListener((editable) => {
17
+ setIsEditable(editable);
18
+ })), [editor]);
21
19
  return (_jsx(Button, { color: "primary", size: "small", startIcon: isEditable ? _jsx(LockFillIcon, {}) : _jsx(LockUnlockFillIcon, {}), onClick: () => {
22
20
  editor.setEditable(!editor.isEditable());
23
21
  }, title: "Read-Only Mode", label: `${!isEditable ? "수정 모드" : "읽기 모드"}로 변경`, "aria-label": `${!isEditable ? "Unlock" : "Lock"} read-only mode` }));
@@ -134,9 +134,7 @@ export function ComponentAdderPlugin(props) {
134
134
  const [resolves, setResolves] = useState([]);
135
135
  const onClose = () => __awaiter(this, void 0, void 0, function* () {
136
136
  resolves.forEach((resolve) => resolve());
137
- setResolves((newResolves) => {
138
- return newResolves.filter((newResolve) => resolves.indexOf(newResolve) === -1);
139
- });
137
+ setResolves((newResolves) => newResolves.filter((newResolve) => resolves.indexOf(newResolve) === -1));
140
138
  });
141
139
  const getContextMenuOptions = useContextMenuOptions({
142
140
  isSheetEnabled,
@@ -204,14 +204,12 @@ export function useDraggableBlockMenu(editor, anchorElem, blockElem, setBlockEle
204
204
  setBlockElem(null);
205
205
  return true;
206
206
  }
207
- return mergeRegister(editor.registerCommand(DRAGOVER_COMMAND, (event) => {
208
- return onDragover(event);
209
- }, COMMAND_PRIORITY_LOW), editor.registerCommand(DROP_COMMAND, (event) => {
210
- return onDrop(event);
211
- }, COMMAND_PRIORITY_HIGH));
207
+ return mergeRegister(editor.registerCommand(DRAGOVER_COMMAND, (event) => onDragover(event), COMMAND_PRIORITY_LOW), editor.registerCommand(DROP_COMMAND, (event) => onDrop(event), COMMAND_PRIORITY_HIGH));
212
208
  }, [anchorElem, editor, setBlockElem]);
213
209
  function onDragStart(event) {
214
210
  const dataTransfer = event.dataTransfer;
211
+ // Lexical 원본 코드를 가져왔기 때문에 코드 변경을 최소화하기위함
212
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
215
213
  if (!dataTransfer || !blockElem) {
216
214
  return;
217
215
  }
@@ -54,6 +54,8 @@ export class ComponentPickerOption extends MenuOption {
54
54
  }
55
55
  function getDynamicOptions(editor, queryString) {
56
56
  const options = [];
57
+ // Lexical 원본 코드를 가져왔기 때문에 코드 변경을 최소화하기위함
58
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
57
59
  if (queryString == null) {
58
60
  return options;
59
61
  }
@@ -82,22 +82,20 @@ export function FloatingLinkEditor(props) {
82
82
  }
83
83
  };
84
84
  }, [anchorElem.parentElement, editor, $updateLinkEditor]);
85
- useEffect(() => {
86
- return mergeRegister(editor.registerUpdateListener(({ editorState }) => {
87
- editorState.read(() => {
88
- $updateLinkEditor();
89
- });
90
- }), editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {
85
+ useEffect(() => mergeRegister(editor.registerUpdateListener(({ editorState }) => {
86
+ editorState.read(() => {
91
87
  $updateLinkEditor();
88
+ });
89
+ }), editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {
90
+ $updateLinkEditor();
91
+ return true;
92
+ }, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_ESCAPE_COMMAND, () => {
93
+ if (isLink) {
94
+ setIsLink(false);
92
95
  return true;
93
- }, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_ESCAPE_COMMAND, () => {
94
- if (isLink) {
95
- setIsLink(false);
96
- return true;
97
- }
98
- return false;
99
- }, COMMAND_PRIORITY_HIGH));
100
- }, [editor, $updateLinkEditor, setIsLink, isLink]);
96
+ }
97
+ return false;
98
+ }, COMMAND_PRIORITY_HIGH)), [editor, $updateLinkEditor, setIsLink, isLink]);
101
99
  useEffect(() => {
102
100
  editor.getEditorState().read(() => {
103
101
  $updateLinkEditor();
@@ -28,7 +28,7 @@ function TextFormatFloatingToolbar({ editor, anchorElem, isLink, isBold, isItali
28
28
  }
29
29
  }, [editor, isLink]);
30
30
  function mouseMoveListener(e) {
31
- if ((popupCharStylesEditorRef === null || popupCharStylesEditorRef === void 0 ? void 0 : popupCharStylesEditorRef.current) &&
31
+ if (popupCharStylesEditorRef.current &&
32
32
  (e.buttons === 1 || e.buttons === 3)) {
33
33
  if (popupCharStylesEditorRef.current.style.pointerEvents !== "none") {
34
34
  const x = e.clientX;
@@ -42,14 +42,14 @@ function TextFormatFloatingToolbar({ editor, anchorElem, isLink, isBold, isItali
42
42
  }
43
43
  }
44
44
  function mouseUpListener() {
45
- if (popupCharStylesEditorRef === null || popupCharStylesEditorRef === void 0 ? void 0 : popupCharStylesEditorRef.current) {
45
+ if (popupCharStylesEditorRef.current) {
46
46
  if (popupCharStylesEditorRef.current.style.pointerEvents !== "auto") {
47
47
  popupCharStylesEditorRef.current.style.pointerEvents = "auto";
48
48
  }
49
49
  }
50
50
  }
51
51
  useEffect(() => {
52
- if (popupCharStylesEditorRef === null || popupCharStylesEditorRef === void 0 ? void 0 : popupCharStylesEditorRef.current) {
52
+ if (popupCharStylesEditorRef.current) {
53
53
  document.addEventListener("mousemove", mouseMoveListener);
54
54
  document.addEventListener("mouseup", mouseUpListener);
55
55
  return () => {
@@ -170,15 +170,13 @@ function useFloatingTextFormatToolbar(editor, anchorElem) {
170
170
  document.removeEventListener("selectionchange", updatePopup);
171
171
  };
172
172
  }, [updatePopup]);
173
- useEffect(() => {
174
- return mergeRegister(editor.registerUpdateListener(() => {
175
- updatePopup();
176
- }), editor.registerRootListener(() => {
177
- if (editor.getRootElement() === null) {
178
- setIsText(false);
179
- }
180
- }));
181
- }, [editor, updatePopup]);
173
+ useEffect(() => mergeRegister(editor.registerUpdateListener(() => {
174
+ updatePopup();
175
+ }), editor.registerRootListener(() => {
176
+ if (editor.getRootElement() === null) {
177
+ setIsText(false);
178
+ }
179
+ })), [editor, updatePopup]);
182
180
  if (!isText) {
183
181
  return null;
184
182
  }
@@ -30,13 +30,7 @@ export function ImagesPlugin({ captionsEnabled, }) {
30
30
  // after: images/2025-01-06-15-14-39.png
31
31
  $insertNodeToNearestRoot(imageNode);
32
32
  return true;
33
- }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DRAGSTART_COMMAND, (event) => {
34
- return onDragStart(event);
35
- }, COMMAND_PRIORITY_HIGH), editor.registerCommand(DRAGOVER_COMMAND, (event) => {
36
- return onDragover(event);
37
- }, COMMAND_PRIORITY_LOW), editor.registerCommand(DROP_COMMAND, (event) => {
38
- return onDrop(event, editor);
39
- }, COMMAND_PRIORITY_HIGH));
33
+ }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DRAGSTART_COMMAND, (event) => onDragStart(event), COMMAND_PRIORITY_HIGH), editor.registerCommand(DRAGOVER_COMMAND, (event) => onDragover(event), COMMAND_PRIORITY_LOW), editor.registerCommand(DROP_COMMAND, (event) => onDrop(event, editor), COMMAND_PRIORITY_HIGH));
40
34
  }, [captionsEnabled, editor]);
41
35
  return null;
42
36
  }
@@ -139,6 +133,9 @@ function getDragSelection(event) {
139
133
  ? target.defaultView
140
134
  : target.ownerDocument.defaultView;
141
135
  const domSelection = getDOMSelection(targetWindow);
136
+ // caretRangeFromPoint는 WebKit 기반 브라우저에서만 지원되는 비표준(non-standard) Method입니다.
137
+ // Lexical 원본 코드를 가져왔기 때문에 코드 변경을 최소화하기위함
138
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
142
139
  if (document.caretRangeFromPoint) {
143
140
  range = document.caretRangeFromPoint(event.clientX, event.clientY);
144
141
  }
@@ -31,7 +31,7 @@ export function LayoutPlugin() {
31
31
  const child = parent &&
32
32
  (before
33
33
  ? parent.getFirstChild()
34
- : parent === null || parent === void 0 ? void 0 : parent.getLastChild());
34
+ : parent.getLastChild());
35
35
  const descendant = before
36
36
  ? (_a = container.getFirstDescendant()) === null || _a === void 0 ? void 0 : _a.getKey()
37
37
  : (_b = container.getLastDescendant()) === null || _b === void 0 ? void 0 : _b.getKey();
@@ -42,8 +42,6 @@ function isIndentPermitted(maxDepth) {
42
42
  }
43
43
  export function ListMaxIndentLevelPlugin({ maxDepth }) {
44
44
  const [editor] = useLexicalComposerContext();
45
- useEffect(() => {
46
- return editor.registerCommand(INDENT_CONTENT_COMMAND, () => !isIndentPermitted(maxDepth !== null && maxDepth !== void 0 ? maxDepth : 7), COMMAND_PRIORITY_CRITICAL);
47
- }, [editor, maxDepth]);
45
+ useEffect(() => editor.registerCommand(INDENT_CONTENT_COMMAND, () => !isIndentPermitted(maxDepth !== null && maxDepth !== void 0 ? maxDepth : 7), COMMAND_PRIORITY_CRITICAL), [editor, maxDepth]);
48
46
  return null;
49
47
  }
@@ -13,9 +13,7 @@ import { $createImageNode, $isImageNode, ImageNode } from "../../nodes";
13
13
  import { $isSheetInputNode, SheetInputNode } from "../../nodes/SheetInputNode";
14
14
  export const HR = {
15
15
  dependencies: [HorizontalRuleNode],
16
- export: (node) => {
17
- return $isHorizontalRuleNode(node) ? "***" : null;
18
- },
16
+ export: (node) => ($isHorizontalRuleNode(node) ? "***" : null),
19
17
  regExp: /^(---|\*\*\*|___)\s?$/,
20
18
  replace: (parentNode, _1, _2, isImport) => {
21
19
  const line = $createHorizontalRuleNode();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.82.4",
3
+ "version": "1.83.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,
@@ -85,6 +85,6 @@
85
85
  "prop-types": "^15.8.1",
86
86
  "rimraf": "^5.0.1",
87
87
  "storybook": "^7.4.6",
88
- "typescript-eslint": "^7.16.1"
88
+ "typescript-eslint": "^8.4.0"
89
89
  }
90
90
  }