@team-monolith/cds 1.79.1 → 1.79.3

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.
@@ -17,7 +17,7 @@ export interface DropdownProps {
17
17
  /** 버튼 컴포넌트 내 좌측에 표기될 아이콘 */
18
18
  startIcon?: React.ReactNode;
19
19
  /** 버튼 컴포넌트 내 우측에 표기될 아이콘.
20
- * 전달하지 않으면 기본으로 ArrowDropDownFillIcon이 표기됩니다.
20
+ * 전달하지 않으면 기본으로 ArrowDownSFillIcon이 표기됩니다.
21
21
  */
22
22
  endIcon?: React.ReactNode;
23
23
  /** 버튼에 전달할 Props */
@@ -12,13 +12,13 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
13
13
  /** @jsxImportSource @emotion/react */
14
14
  import { forwardRef, useRef, useState } from "react";
15
- import { Button, ArrowDropDownFillIcon, } from "../..";
15
+ import { Button, ArrowDownSFillIcon, } from "../..";
16
16
  import { DropdownMenu } from "./DropdownMenu";
17
17
  /**
18
18
  * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=203-95329&t=FwczLZ1IVvskUVbT-0)
19
19
  */
20
20
  const Dropdown = forwardRef(function Dropdown(props, ref) {
21
- const { className, component: Component = "div", disabled, color = "primary", size = "medium", bold, startIcon, endIcon = _jsx(ArrowDropDownFillIcon, {}), buttonCss, label, onClick, menuProps = {}, children, closeOnItemClick } = props, other = __rest(props, ["className", "component", "disabled", "color", "size", "bold", "startIcon", "endIcon", "buttonCss", "label", "onClick", "menuProps", "children", "closeOnItemClick"]);
21
+ const { className, component: Component = "div", disabled, color = "primary", size = "medium", bold, startIcon, endIcon = _jsx(ArrowDownSFillIcon, {}), buttonCss, label, onClick, menuProps = {}, children, closeOnItemClick } = props, other = __rest(props, ["className", "component", "disabled", "color", "size", "bold", "startIcon", "endIcon", "buttonCss", "label", "onClick", "menuProps", "children", "closeOnItemClick"]);
22
22
  const buttonProps = Object.assign(Object.assign({}, props.buttonProps), { disabled,
23
23
  color,
24
24
  size,
@@ -11,8 +11,8 @@ export interface ProblemInputPayload {
11
11
  * (ex: "코들 입니다" => "** ***") */
12
12
  solutions: Solution[];
13
13
  answer: string;
14
- caseSensitive?: boolean;
15
- ignoreWhitespace?: boolean;
14
+ caseSensitive: boolean;
15
+ ignoreWhitespace: boolean;
16
16
  /** FE에서만 사용하는 값. 문제의 정오답 여부를 주입하여 스타일을 변경합니다. */
17
17
  isCorrect?: boolean;
18
18
  key?: NodeKey;
@@ -45,10 +45,13 @@ export declare class ProblemInputNode extends DecoratorNode<ReactNode> {
45
45
  setCaseSensitive(caseSensitive: boolean): void;
46
46
  setIgnoreWhitespace(ignoreWhitespace: boolean): void;
47
47
  static clone(node: ProblemInputNode): ProblemInputNode;
48
- constructor(showCharacterNumber: boolean, placeholder: string, solutions: Solution[], answer: string, caseSensitive?: boolean, ignoreWhitespace?: boolean, isCorrect?: boolean, key?: NodeKey);
48
+ constructor(showCharacterNumber: boolean, placeholder: string, solutions: Solution[], answer: string, caseSensitive: boolean, ignoreWhitespace: boolean, isCorrect?: boolean, key?: NodeKey);
49
49
  createDOM(config: EditorConfig): HTMLElement;
50
50
  updateDOM(): boolean;
51
- static importJSON(serializedNode: SerializedProblemInputNode): ProblemInputNode;
51
+ static importJSON(serializedNode: Omit<SerializedProblemInputNode, "caseSensitive" | "ignoreWhitespace"> & {
52
+ caseSensitive?: boolean;
53
+ ignoreWhitespace?: boolean;
54
+ }): ProblemInputNode;
52
55
  exportJSON(): SerializedProblemInputNode;
53
56
  decorate(): ReactNode;
54
57
  }
@@ -64,8 +64,8 @@ export class ProblemInputNode extends DecoratorNode {
64
64
  this.__placeholder = placeholder;
65
65
  this.__solutions = solutions;
66
66
  this.__answer = answer;
67
- this.__caseSensitive = caseSensitive !== null && caseSensitive !== void 0 ? caseSensitive : false;
68
- this.__ignoreWhitespace = ignoreWhitespace !== null && ignoreWhitespace !== void 0 ? ignoreWhitespace : true;
67
+ this.__caseSensitive = caseSensitive;
68
+ this.__ignoreWhitespace = ignoreWhitespace;
69
69
  this.__isCorrect = isCorrect;
70
70
  }
71
71
  createDOM(config) {
@@ -78,14 +78,15 @@ export class ProblemInputNode extends DecoratorNode {
78
78
  return false;
79
79
  }
80
80
  static importJSON(serializedNode) {
81
+ var _a, _b;
81
82
  const node = $createProblemInputNode({
82
83
  key: serializedNode.key,
83
84
  solutions: serializedNode.solutions,
84
85
  showCharacterNumber: serializedNode.showCharacterNumber,
85
86
  placeholder: serializedNode.placeholder,
86
87
  answer: serializedNode.answer,
87
- caseSensitive: serializedNode.caseSensitive,
88
- ignoreWhitespace: serializedNode.ignoreWhitespace,
88
+ caseSensitive: (_a = serializedNode.caseSensitive) !== null && _a !== void 0 ? _a : false,
89
+ ignoreWhitespace: (_b = serializedNode.ignoreWhitespace) !== null && _b !== void 0 ? _b : true,
89
90
  isCorrect: serializedNode.isCorrect,
90
91
  });
91
92
  return node;
@@ -4,7 +4,7 @@ import React from "react";
4
4
  export interface FormSegmentedControlProps {
5
5
  control: Control<ProblemInputPayload>;
6
6
  trigger: UseFormTrigger<ProblemInputPayload>;
7
- name: "showCharacterNumber" | "ignoreWhitespace" | "caseSensitive";
7
+ name: keyof Pick<ProblemInputPayload, "showCharacterNumber" | "ignoreWhitespace" | "caseSensitive">;
8
8
  items: {
9
9
  value: boolean;
10
10
  label: React.ReactNode;
@@ -7,8 +7,8 @@ export function FormSegmentedControl(props) {
7
7
  return (_jsx(SegmentedControlGroup, Object.assign({ size: "xsmall", value: value, onChange: (value) => {
8
8
  onChange(value);
9
9
  trigger("solutions");
10
- }, fullWidth: true }, { children: items.map(item => {
11
- return _jsx(SegmentedControlButton, { value: item.value, label: item.label }, item.value.toString());
10
+ }, fullWidth: true }, { children: items.map((item) => {
11
+ return (_jsx(SegmentedControlButton, { value: item.value, label: item.label }, item.value.toString()));
12
12
  }) })));
13
13
  } }));
14
14
  }
@@ -14,7 +14,7 @@ import { FormPlaceholder } from "./FormPlaceholder";
14
14
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
15
15
  import { $getNodeByKey } from "lexical";
16
16
  export function SettingForm(props) {
17
- const { solutions, showCharacterNumber, placeholder, nodeKey, onClose, caseSensitive, ignoreWhitespace } = props;
17
+ const { solutions, showCharacterNumber, placeholder, nodeKey, onClose, caseSensitive, ignoreWhitespace, } = props;
18
18
  const [editor] = useLexicalComposerContext();
19
19
  const { control, handleSubmit, watch, trigger } = useForm({
20
20
  mode: "all",
@@ -34,7 +34,6 @@ export function SettingForm(props) {
34
34
  });
35
35
  const onSettingSubmit = (data) => {
36
36
  editor.update(() => {
37
- var _a, _b;
38
37
  const node = $getNodeByKey(nodeKey);
39
38
  if (!$isProblemInputNode(node)) {
40
39
  return;
@@ -42,8 +41,8 @@ export function SettingForm(props) {
42
41
  node.setSolutions(data.solutions);
43
42
  node.setShowCharacterNumber(data.showCharacterNumber);
44
43
  node.setPlaceholder(data.placeholder);
45
- node.setCaseSensitive((_a = data.caseSensitive) !== null && _a !== void 0 ? _a : false);
46
- node.setIgnoreWhitespace((_b = data.ignoreWhitespace) !== null && _b !== void 0 ? _b : true);
44
+ node.setCaseSensitive(data.caseSensitive);
45
+ node.setIgnoreWhitespace(data.ignoreWhitespace);
47
46
  });
48
47
  onClose();
49
48
  };
@@ -79,16 +78,16 @@ export function SettingForm(props) {
79
78
  height: 12px;
80
79
  ` }) }))] }), _jsx(FormSegmentedControl, { control: control, trigger: trigger, name: "showCharacterNumber", items: [
81
80
  { value: false, label: "한 칸으로" },
82
- { value: true, label: "글자 수대로" }
81
+ { value: true, label: "글자 수대로" },
83
82
  ] })] }), _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 `
84
83
  width: 12px;
85
84
  height: 12px;
86
85
  ` }) }))] }), _jsx(FormPlaceholder, { control: control })] }), _jsxs(FormArea, { children: [_jsx(Label, { children: "\uB744\uC5B4\uC4F0\uAE30" }), _jsx(FormSegmentedControl, { control: control, trigger: trigger, name: "ignoreWhitespace", items: [
87
86
  { value: true, label: "무시하기" },
88
- { value: false, label: "포함하기" }
87
+ { value: false, label: "포함하기" },
89
88
  ] })] }), _jsxs(FormArea, { children: [_jsx(Label, { children: "\uB300\uC18C\uBB38\uC790" }), _jsx(FormSegmentedControl, { control: control, trigger: trigger, name: "caseSensitive", items: [
90
89
  { value: false, label: "무시하기" },
91
- { value: true, label: "포함하기" }
90
+ { value: true, label: "포함하기" },
92
91
  ] })] })] })] }), _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", type: "submit" })] })] })));
93
92
  }
94
93
  const Form = styled.form(({ theme }) => css `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.79.1",
3
+ "version": "1.79.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,