@team-monolith/cds 1.79.0 → 1.79.2

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.
@@ -48,7 +48,10 @@ export declare class ProblemInputNode extends DecoratorNode<ReactNode> {
48
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
  }
@@ -85,7 +85,6 @@ export class ProblemInputNode extends DecoratorNode {
85
85
  showCharacterNumber: serializedNode.showCharacterNumber,
86
86
  placeholder: serializedNode.placeholder,
87
87
  answer: serializedNode.answer,
88
- // 기존에 등록된 노드에 대한 defaultData 적용
89
88
  caseSensitive: (_a = serializedNode.caseSensitive) !== null && _a !== void 0 ? _a : false,
90
89
  ignoreWhitespace: (_b = serializedNode.ignoreWhitespace) !== null && _b !== void 0 ? _b : true,
91
90
  isCorrect: serializedNode.isCorrect,
@@ -1,13 +1,13 @@
1
- import { Control, FieldPath, UseFormTrigger } from "react-hook-form";
1
+ import { Control, UseFormTrigger } from "react-hook-form";
2
2
  import { ProblemInputPayload } from "../ProblemInputNode";
3
3
  import React from "react";
4
- export interface FormCharacterNumberProps {
4
+ export interface FormSegmentedControlProps {
5
5
  control: Control<ProblemInputPayload>;
6
6
  trigger: UseFormTrigger<ProblemInputPayload>;
7
- valueName: FieldPath<Pick<ProblemInputPayload, "showCharacterNumber" | "ignoreWhitespace" | "caseSensitive">>;
8
- valueList: {
7
+ name: keyof Pick<ProblemInputPayload, "showCharacterNumber" | "ignoreWhitespace" | "caseSensitive">;
8
+ items: {
9
9
  value: boolean;
10
10
  label: React.ReactNode;
11
11
  }[];
12
12
  }
13
- export declare function FormSegmentedControl(props: FormCharacterNumberProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function FormSegmentedControl(props: FormSegmentedControlProps): import("react/jsx-runtime").JSX.Element;
@@ -2,13 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Controller } from "react-hook-form";
3
3
  import { SegmentedControlButton, SegmentedControlGroup, } from "../../../../SegmentedControl";
4
4
  export function FormSegmentedControl(props) {
5
- const { control, trigger, valueName, valueList } = props;
6
- return (_jsx(Controller, { name: valueName, control: control, render: ({ field: { value, onChange } }) => {
5
+ const { control, trigger, name, items } = props;
6
+ return (_jsx(Controller, { name: name, control: control, render: ({ field: { value, onChange } }) => {
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: valueList.map(valueItem => {
11
- return _jsx(SegmentedControlButton, { value: valueItem.value, label: valueItem.label }, valueItem.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",
@@ -76,18 +76,18 @@ export function SettingForm(props) {
76
76
  ` }), _jsx(Label, { children: "\uAC00\uB2A5\uD55C \uC815\uB2F5\uC744 \uBAA8\uB450 \uCD94\uAC00\uD574\uC57C \uC6D0\uD65C\uD558\uAC8C \uC790\uB3D9 \uCC44\uC810\uD560 \uC218 \uC788\uC5B4\uC694." })] }))] }), _jsxs(Right, { children: [_jsxs(FormArea, { children: [_jsxs(Label, { children: ["\uC785\uB825 \uCE78", _jsx(Tooltip, Object.assign({ text: _jsxs("span", { children: [`예를 들어 정답이 '글자 수'이고`, _jsx("br", {}), _jsx("b", { children: "\uAE00\uC790 \uC218\uB300\uB85C" }), " \uC635\uC158\uC744 \uC120\uD0DD\uD588\uB2E4\uBA74", _jsx("br", {}), `입력 칸이 '☐☐ ☐' 처럼 표시됩니다.`] }), placement: "top" }, { children: _jsx(QuestionFillIcon, { css: css `
77
77
  width: 12px;
78
78
  height: 12px;
79
- ` }) }))] }), _jsx(FormSegmentedControl, { control: control, trigger: trigger, valueName: "showCharacterNumber", valueList: [
79
+ ` }) }))] }), _jsx(FormSegmentedControl, { control: control, trigger: trigger, name: "showCharacterNumber", items: [
80
80
  { value: false, label: "한 칸으로" },
81
- { value: true, label: "글자 수대로" }
81
+ { value: true, label: "글자 수대로" },
82
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 `
83
83
  width: 12px;
84
84
  height: 12px;
85
- ` }) }))] }), _jsx(FormPlaceholder, { control: control })] }), _jsxs(FormArea, { children: [_jsx(Label, { children: "\uB744\uC5B4\uC4F0\uAE30" }), _jsx(FormSegmentedControl, { control: control, trigger: trigger, valueName: "ignoreWhitespace", valueList: [
85
+ ` }) }))] }), _jsx(FormPlaceholder, { control: control })] }), _jsxs(FormArea, { children: [_jsx(Label, { children: "\uB744\uC5B4\uC4F0\uAE30" }), _jsx(FormSegmentedControl, { control: control, trigger: trigger, name: "ignoreWhitespace", items: [
86
86
  { value: true, label: "무시하기" },
87
- { value: false, label: "포함하기" }
88
- ] })] }), _jsxs(FormArea, { children: [_jsx(Label, { children: "\uB300\uC18C\uBB38\uC790" }), _jsx(FormSegmentedControl, { control: control, trigger: trigger, valueName: "caseSensitive", valueList: [
87
+ { value: false, label: "포함하기" },
88
+ ] })] }), _jsxs(FormArea, { children: [_jsx(Label, { children: "\uB300\uC18C\uBB38\uC790" }), _jsx(FormSegmentedControl, { control: control, trigger: trigger, name: "caseSensitive", items: [
89
89
  { value: false, label: "무시하기" },
90
- { value: true, label: "포함하기" }
90
+ { value: true, label: "포함하기" },
91
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" })] })] })));
92
92
  }
93
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.0",
3
+ "version": "1.79.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,