@team-monolith/cds 1.55.0 → 1.56.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 (51) hide show
  1. package/dist/icons/Custom.d.ts +0 -27
  2. package/dist/icons/Custom.js +0 -36
  3. package/dist/index.d.ts +0 -1
  4. package/dist/index.js +0 -1
  5. package/dist/patterns/LexicalEditor/LexicalEditor.js +0 -2
  6. package/dist/patterns/LexicalEditor/Plugins.js +1 -2
  7. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/useContextMenuOptions.js +0 -15
  8. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.js +1 -12
  9. package/dist/patterns/LexicalEditor/theme.d.ts +0 -1
  10. package/dist/patterns/LexicalEditor/theme.js +0 -7
  11. package/package.json +1 -1
  12. package/dist/icons/custom/emo-good-color.svg +0 -69
  13. package/dist/icons/custom/emo-good.svg +0 -13
  14. package/dist/icons/custom/emo-great-color.svg +0 -68
  15. package/dist/icons/custom/emo-great.svg +0 -13
  16. package/dist/icons/custom/emo-neutral-color.svg +0 -77
  17. package/dist/icons/custom/emo-neutral.svg +0 -15
  18. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/Evaluation.d.ts +0 -18
  19. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/Evaluation.js +0 -108
  20. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormDescription.d.ts +0 -10
  21. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormDescription.js +0 -55
  22. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormIconAndLabel.d.ts +0 -7
  23. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormIconAndLabel.js +0 -55
  24. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormLabel.d.ts +0 -8
  25. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormLabel.js +0 -33
  26. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/index.d.ts +0 -1
  27. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/index.js +0 -1
  28. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/SettingForm.d.ts +0 -19
  29. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/SettingForm.js +0 -111
  30. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/index.d.ts +0 -1
  31. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/index.js +0 -1
  32. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/index.d.ts +0 -2
  33. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/index.js +0 -2
  34. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/EvaluationComponent.d.ts +0 -12
  35. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/EvaluationComponent.js +0 -47
  36. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/index.d.ts +0 -1
  37. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/index.js +0 -1
  38. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/SelfEvaluationNode.d.ts +0 -43
  39. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/SelfEvaluationNode.js +0 -91
  40. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/iconData.d.ts +0 -14
  41. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/iconData.js +0 -61
  42. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/index.d.ts +0 -1
  43. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/index.js +0 -1
  44. package/dist/patterns/LexicalEditor/plugins/SelfEvaluationPlugin/index.d.ts +0 -5
  45. package/dist/patterns/LexicalEditor/plugins/SelfEvaluationPlugin/index.js +0 -20
  46. package/dist/patterns/ToggleButtonGroup/ToggleButton.d.ts +0 -9
  47. package/dist/patterns/ToggleButtonGroup/ToggleButton.js +0 -54
  48. package/dist/patterns/ToggleButtonGroup/ToggleButtonGroup.d.ts +0 -29
  49. package/dist/patterns/ToggleButtonGroup/ToggleButtonGroup.js +0 -42
  50. package/dist/patterns/ToggleButtonGroup/index.d.ts +0 -1
  51. package/dist/patterns/ToggleButtonGroup/index.js +0 -1
@@ -1,43 +0,0 @@
1
- import { DecoratorNode, EditorConfig, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from "lexical";
2
- import { ReactNode } from "react";
3
- export type IconType = "emoji" | "ascendingNumber" | "descendingNumber";
4
- export interface SelfEvaluationPayload {
5
- /** 아이콘 프리셋 타입 */
6
- iconType: IconType;
7
- /** 자기평가 레이블 */
8
- labels: string[];
9
- /** 자기평가 항목들 */
10
- descriptions: string[];
11
- /** 선택된 레이블 인덱스 */
12
- selectedLabelIndexes: (number | null)[];
13
- key?: NodeKey;
14
- }
15
- export type SerializedSelfEvaluationNode = Spread<SelfEvaluationPayload, SerializedLexicalNode>;
16
- /** 3단계 평가 입력칸을 나타내는 노드입니다.
17
- * 도구 이름으로서는 "3단계 평가 입력 칸"으로 나타나지만, n단계로 확장 가능합니다.
18
- */
19
- export declare class SelfEvaluationNode extends DecoratorNode<ReactNode> {
20
- __iconType: IconType;
21
- __labels: string[];
22
- __descriptions: string[];
23
- __selectedLabelIndexes: (number | null)[];
24
- isInline(): boolean;
25
- static getType(): string;
26
- getIconType(): IconType;
27
- getLabels(): string[];
28
- getDescriptions(): string[];
29
- getSelectedLabelIndexes(): (number | null)[];
30
- setIconType(iconType: IconType): void;
31
- setLabels(labels: string[]): void;
32
- setDescriptions(descriptions: string[]): void;
33
- setSelectedLabelIndexes(selectedLabelIndexes: (number | null)[]): void;
34
- static clone(node: SelfEvaluationNode): SelfEvaluationNode;
35
- constructor(iconType: IconType, labels: string[], descriptions: string[], selectedLabelIndexes: (number | null)[], key?: NodeKey);
36
- createDOM(config: EditorConfig): HTMLElement;
37
- updateDOM(): boolean;
38
- static importJSON(serializedNode: SerializedSelfEvaluationNode): SelfEvaluationNode;
39
- exportJSON(): SerializedSelfEvaluationNode;
40
- decorate(): ReactNode;
41
- }
42
- export declare function $createSelfEvaluationNode(payload: SelfEvaluationPayload): SelfEvaluationNode;
43
- export declare function $isSelfEvaluationNode(node: LexicalNode | null | undefined): node is SelfEvaluationNode;
@@ -1,91 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { $applyNodeReplacement, DecoratorNode, } from "lexical";
3
- import { addClassNamesToElement } from "@lexical/utils";
4
- import { EvaluationComponent } from "./EvaluationComponent";
5
- /** 3단계 평가 입력칸을 나타내는 노드입니다.
6
- * 도구 이름으로서는 "3단계 평가 입력 칸"으로 나타나지만, n단계로 확장 가능합니다.
7
- */
8
- export class SelfEvaluationNode extends DecoratorNode {
9
- isInline() {
10
- return false;
11
- }
12
- static getType() {
13
- return "self-evaluation";
14
- }
15
- getIconType() {
16
- return this.__iconType;
17
- }
18
- getLabels() {
19
- return this.__labels;
20
- }
21
- getDescriptions() {
22
- return this.__descriptions;
23
- }
24
- getSelectedLabelIndexes() {
25
- return this.__selectedLabelIndexes;
26
- }
27
- setIconType(iconType) {
28
- const self = this.getWritable();
29
- self.__iconType = iconType;
30
- }
31
- setLabels(labels) {
32
- const self = this.getWritable();
33
- self.__labels = labels;
34
- }
35
- setDescriptions(descriptions) {
36
- const self = this.getWritable();
37
- self.__descriptions = descriptions;
38
- }
39
- setSelectedLabelIndexes(selectedLabelIndexes) {
40
- const self = this.getWritable();
41
- self.__selectedLabelIndexes = selectedLabelIndexes;
42
- }
43
- static clone(node) {
44
- return new SelfEvaluationNode(node.__iconType, node.__labels, node.__descriptions, node.__selectedLabelIndexes);
45
- }
46
- constructor(iconType, labels, descriptions, selectedLabelIndexes, key) {
47
- super(key);
48
- this.__iconType = iconType;
49
- this.__labels = labels;
50
- this.__descriptions = descriptions;
51
- this.__selectedLabelIndexes = selectedLabelIndexes;
52
- }
53
- createDOM(config) {
54
- // Define the DOM element here
55
- const root = document.createElement("div");
56
- addClassNamesToElement(root, config.theme.selfEvaluation);
57
- return root;
58
- }
59
- updateDOM() {
60
- return false;
61
- }
62
- static importJSON(serializedNode) {
63
- return $createSelfEvaluationNode({
64
- key: serializedNode.key,
65
- iconType: serializedNode.iconType,
66
- labels: serializedNode.labels,
67
- descriptions: serializedNode.descriptions,
68
- selectedLabelIndexes: serializedNode.selectedLabelIndexes,
69
- });
70
- }
71
- exportJSON() {
72
- return {
73
- type: "self-evaluation",
74
- version: 1,
75
- iconType: this.__iconType,
76
- labels: this.__labels,
77
- descriptions: this.__descriptions,
78
- selectedLabelIndexes: this.__selectedLabelIndexes,
79
- };
80
- }
81
- decorate() {
82
- return (_jsx(EvaluationComponent, { iconType: this.__iconType, labels: this.__labels, descriptions: this.__descriptions, selectedLabelIndexes: this.__selectedLabelIndexes, nodeKey: this.getKey() }));
83
- }
84
- }
85
- export function $createSelfEvaluationNode(payload) {
86
- const { iconType, labels, descriptions, selectedLabelIndexes, key } = payload;
87
- return $applyNodeReplacement(new SelfEvaluationNode(iconType, labels, descriptions, selectedLabelIndexes, key));
88
- }
89
- export function $isSelfEvaluationNode(node) {
90
- return node instanceof SelfEvaluationNode;
91
- }
@@ -1,14 +0,0 @@
1
- import React from "react";
2
- import { IconType } from "./SelfEvaluationNode";
3
- import { Theme } from "@emotion/react";
4
- interface IconData {
5
- startIcon: React.ReactNode;
6
- title: string;
7
- icons: {
8
- onIcon: React.ReactNode;
9
- offIcon: React.ReactNode;
10
- }[];
11
- }
12
- export declare const ICON_TYPES: IconType[];
13
- export declare const ICON_DATA: (theme: Theme) => Record<IconType, IconData>;
14
- export {};
@@ -1,61 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { CustomEmoGoodColorIcon, CustomEmoGoodIcon, CustomEmoGreatColorIcon, CustomEmoGreatIcon, CustomEmoNeutralColorIcon, CustomEmoNeutralIcon, } from "../../../../icons/Custom";
3
- import { Number1Icon, Number2Icon, Number3Icon } from "../../../../icons";
4
- export const ICON_TYPES = [
5
- "emoji",
6
- "ascendingNumber",
7
- "descendingNumber",
8
- ];
9
- export const ICON_DATA = (theme) => ({
10
- emoji: {
11
- startIcon: _jsx(CustomEmoGreatColorIcon, {}),
12
- title: "이모지",
13
- icons: [
14
- {
15
- onIcon: _jsx(CustomEmoGreatColorIcon, {}),
16
- offIcon: _jsx(CustomEmoGreatIcon, {}),
17
- },
18
- { onIcon: _jsx(CustomEmoGoodColorIcon, {}), offIcon: _jsx(CustomEmoGoodIcon, {}) },
19
- {
20
- onIcon: _jsx(CustomEmoNeutralColorIcon, {}),
21
- offIcon: _jsx(CustomEmoNeutralIcon, {}),
22
- },
23
- ],
24
- },
25
- ascendingNumber: {
26
- startIcon: _jsx(Number1Icon, {}),
27
- title: "숫자, 1-2-3",
28
- icons: [
29
- {
30
- onIcon: _jsx(Number1Icon, { color: theme.color.background.primary }),
31
- offIcon: _jsx(Number1Icon, {}),
32
- },
33
- {
34
- onIcon: _jsx(Number2Icon, { color: theme.color.background.primary }),
35
- offIcon: _jsx(Number2Icon, {}),
36
- },
37
- {
38
- onIcon: _jsx(Number3Icon, { color: theme.color.background.primary }),
39
- offIcon: _jsx(Number3Icon, {}),
40
- },
41
- ],
42
- },
43
- descendingNumber: {
44
- startIcon: _jsx(Number3Icon, {}),
45
- title: "숫자, 3-2-1",
46
- icons: [
47
- {
48
- onIcon: _jsx(Number3Icon, { color: theme.color.background.primary }),
49
- offIcon: _jsx(Number3Icon, {}),
50
- },
51
- {
52
- onIcon: _jsx(Number2Icon, { color: theme.color.background.primary }),
53
- offIcon: _jsx(Number2Icon, {}),
54
- },
55
- {
56
- onIcon: _jsx(Number1Icon, { color: theme.color.background.primary }),
57
- offIcon: _jsx(Number1Icon, {}),
58
- },
59
- ],
60
- },
61
- });
@@ -1 +0,0 @@
1
- export * from "./SelfEvaluationNode";
@@ -1 +0,0 @@
1
- export * from "./SelfEvaluationNode";
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- import { LexicalCommand } from "lexical";
3
- import { SelfEvaluationPayload } from "../../nodes/SelfEvaluationNode";
4
- export declare const INSERT_SELF_EVALUATION_COMMAND: LexicalCommand<SelfEvaluationPayload>;
5
- export default function SelfEvaluationPlugin(): JSX.Element | null;
@@ -1,20 +0,0 @@
1
- import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
2
- import { $insertNodeToNearestRoot } from "@lexical/utils";
3
- import { COMMAND_PRIORITY_EDITOR, createCommand, } from "lexical";
4
- import { useEffect } from "react";
5
- import { $createSelfEvaluationNode, SelfEvaluationNode, } from "../../nodes/SelfEvaluationNode";
6
- export const INSERT_SELF_EVALUATION_COMMAND = createCommand("INSERT_SELF_EVALUATION_COMMAND");
7
- export default function SelfEvaluationPlugin() {
8
- const [editor] = useLexicalComposerContext();
9
- useEffect(() => {
10
- if (!editor.hasNodes([SelfEvaluationNode])) {
11
- throw new Error("SelfEvaluationNode: SelfEvaluationNode not registered on editor");
12
- }
13
- editor.registerCommand(INSERT_SELF_EVALUATION_COMMAND, (payload) => {
14
- const selfEvaluationNode = $createSelfEvaluationNode(payload);
15
- $insertNodeToNearestRoot(selfEvaluationNode);
16
- return true;
17
- }, COMMAND_PRIORITY_EDITOR);
18
- }, [editor]);
19
- return null;
20
- }
@@ -1,9 +0,0 @@
1
- import { ToggleButtonDatum } from "./ToggleButtonGroup";
2
- /** 하나의 ToggleButton을 그립니다. */
3
- export declare function ToggleButton(props: {
4
- datum: ToggleButtonDatum;
5
- /** tooltip의 placement */
6
- placement: "bottom-start" | "bottom" | "bottom-end";
7
- isActive: boolean;
8
- onClick: () => void;
9
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,54 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import styled from "@emotion/styled";
3
- import { HOVER, Tooltip } from "../..";
4
- import { css } from "@emotion/react";
5
- import { toggleButtonGroupClasses, } from "./ToggleButtonGroup";
6
- /** 하나의 ToggleButton을 그립니다. */
7
- export function ToggleButton(props) {
8
- const { datum, placement, isActive, onClick } = props;
9
- const { label, onIcon, offIcon } = datum;
10
- if (isActive) {
11
- return (_jsxs(Active, Object.assign({ className: toggleButtonGroupClasses.toggleButton.active, onClick: onClick }, { children: [onIcon, label] })));
12
- }
13
- return (_jsx(Tooltip, Object.assign({ placement: placement, text: label }, { children: _jsx(Inactive, Object.assign({ className: toggleButtonGroupClasses.toggleButton.inactive, onClick: onClick }, { children: offIcon })) })));
14
- }
15
- const Active = styled.div(({ theme }) => css `
16
- cursor: pointer;
17
- display: flex;
18
- padding: 8px 12px;
19
- justify-content: center;
20
- align-items: center;
21
- gap: 8px;
22
-
23
- border-radius: 99px;
24
- background: ${theme.color.blanket.neutralLight};
25
-
26
- color: ${theme.color.foreground.neutralBase};
27
- font-family: ${theme.fontFamily.ui};
28
- font-size: 16px;
29
- font-style: normal;
30
- font-weight: 700;
31
- line-height: 20px; /* 125% */
32
-
33
- svg {
34
- width: 24px;
35
- height: 24px;
36
- }
37
- `);
38
- const Inactive = styled.div `
39
- cursor: pointer;
40
- display: flex;
41
- padding: 8px 12px;
42
- justify-content: center;
43
- align-items: center;
44
-
45
- opacity: 0.6;
46
- ${HOVER(css `
47
- opacity: 1;
48
- `)}
49
-
50
- svg {
51
- width: 24px;
52
- height: 24px;
53
- }
54
- `;
@@ -1,29 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const toggleButtonGroupClasses: {
3
- readonly container: "ToggleButtonGroup-container";
4
- readonly toggleButton: {
5
- readonly active: "ToggleButtonGroup-ToggleButton-active";
6
- readonly inactive: "ToggleButtonGroup-ToggleButton-inactive";
7
- };
8
- };
9
- export interface ToggleButtonDatum {
10
- /** ToggleButton의 레이블. 호버시 툴팁 또는 활성화시 나타납니다. */
11
- label: React.ReactNode;
12
- /** on 일때의 아이콘. 내부에서 사이즈가 24x24로 조정됩니다. */
13
- onIcon: React.ReactNode;
14
- /** off 일때의 아이콘. 내부에서 사이즈가 24x24로 조정됩니다.*/
15
- offIcon: React.ReactNode;
16
- }
17
- /** n개의 toggleButton이 모여있는 형태를 나타내는 컴포넌트입니다.
18
- * 동작은 SegmentedControl과 비슷합니다.
19
- * 렉시컬 블록으로 활용하기 위해 선택된 버튼의 인덱스 상태를 외부에서 관리합니다.
20
- */
21
- export declare function ToggleButtonGroup(props: {
22
- className?: string;
23
- /** ToggleButton의 데이터 배열 */
24
- data: ToggleButtonDatum[];
25
- /** 활성화될 ToggleButton의 index */
26
- activeIndex: number | null;
27
- /** activeIndex set 함수 */
28
- setActiveIndex: (index: number | null) => void;
29
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,42 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import styled from "@emotion/styled";
3
- import { ToggleButton } from "./ToggleButton";
4
- export const toggleButtonGroupClasses = {
5
- container: "ToggleButtonGroup-container",
6
- toggleButton: {
7
- active: "ToggleButtonGroup-ToggleButton-active",
8
- inactive: "ToggleButtonGroup-ToggleButton-inactive",
9
- },
10
- };
11
- /** n개의 toggleButton이 모여있는 형태를 나타내는 컴포넌트입니다.
12
- * 동작은 SegmentedControl과 비슷합니다.
13
- * 렉시컬 블록으로 활용하기 위해 선택된 버튼의 인덱스 상태를 외부에서 관리합니다.
14
- */
15
- export function ToggleButtonGroup(props) {
16
- const { className, data, activeIndex, setActiveIndex } = props;
17
- return (_jsx(Container, Object.assign({ className: `${className} ${toggleButtonGroupClasses.container}` }, { children: data.map((datum, index) => {
18
- const isFirst = index === 0;
19
- const isLast = index === data.length - 1;
20
- const isFirstAndLast = isFirst && isLast;
21
- const isActive = activeIndex === index;
22
- return (_jsx(ToggleButton, { isActive: isActive, onClick: () => {
23
- setActiveIndex(isActive ? null : index);
24
- }, datum: datum, placement: isFirstAndLast
25
- ? "bottom"
26
- : isFirst
27
- ? "bottom-start"
28
- : isLast
29
- ? "bottom-end"
30
- : "bottom" }, index));
31
- }) })));
32
- }
33
- const Container = styled.div `
34
- display: flex;
35
- padding: 4px;
36
- justify-content: space-between;
37
- align-items: center;
38
- flex: 1 0 0;
39
-
40
- border-radius: 24px;
41
- background: linear-gradient(90deg, #eff7ed 0%, #faefe3 100%);
42
- `;
@@ -1 +0,0 @@
1
- export * from "./ToggleButtonGroup";
@@ -1 +0,0 @@
1
- export * from "./ToggleButtonGroup";