@team-monolith/cds 1.10.5 → 1.11.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/CodleDesignSystemProvider.d.ts +0 -12
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/InputComponent.js +24 -15
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SegmentedInput.d.ts +12 -0
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SegmentedInput.js +95 -0
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/TextInput.d.ts +6 -0
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/TextInput.js +28 -0
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/ProblemSelectNode.d.ts +1 -1
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox.js +5 -0
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SettingForm/SettingForm.js +3 -11
- package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.js +1 -0
- package/package.json +4 -17
- package/dist/patterns/ReactEditorJS/Layout.d.ts +0 -8
- package/dist/patterns/ReactEditorJS/Layout.js +0 -91
- package/dist/patterns/ReactEditorJS/ReactEditorJS.d.ts +0 -15
- package/dist/patterns/ReactEditorJS/ReactEditorJS.js +0 -87
- package/dist/patterns/ReactEditorJS/customTools/block/Callout.d.ts +0 -38
- package/dist/patterns/ReactEditorJS/customTools/block/Callout.js +0 -162
- package/dist/patterns/ReactEditorJS/customTools/block/Delimiter.d.ts +0 -10
- package/dist/patterns/ReactEditorJS/customTools/block/Delimiter.js +0 -26
- package/dist/patterns/ReactEditorJS/customTools/block/Header.d.ts +0 -60
- package/dist/patterns/ReactEditorJS/customTools/block/Header.js +0 -122
- package/dist/patterns/ReactEditorJS/customTools/block/Image.d.ts +0 -22
- package/dist/patterns/ReactEditorJS/customTools/block/Image.js +0 -61
- package/dist/patterns/ReactEditorJS/customTools/block/NestedList.d.ts +0 -28
- package/dist/patterns/ReactEditorJS/customTools/block/NestedList.js +0 -74
- package/dist/patterns/ReactEditorJS/customTools/block/Quote.d.ts +0 -42
- package/dist/patterns/ReactEditorJS/customTools/block/Quote.js +0 -171
- package/dist/patterns/ReactEditorJS/customTools/block/Raw.d.ts +0 -30
- package/dist/patterns/ReactEditorJS/customTools/block/Raw.js +0 -107
- package/dist/patterns/ReactEditorJS/customTools/block/Table.d.ts +0 -9
- package/dist/patterns/ReactEditorJS/customTools/block/Table.js +0 -28
- package/dist/patterns/ReactEditorJS/customTools/index.d.ts +0 -16
- package/dist/patterns/ReactEditorJS/customTools/index.js +0 -16
- package/dist/patterns/ReactEditorJS/customTools/inline/Bold.d.ts +0 -52
- package/dist/patterns/ReactEditorJS/customTools/inline/Bold.js +0 -83
- package/dist/patterns/ReactEditorJS/customTools/inline/InlineCode.d.ts +0 -4
- package/dist/patterns/ReactEditorJS/customTools/inline/InlineCode.js +0 -7
- package/dist/patterns/ReactEditorJS/customTools/inline/Italic.d.ts +0 -48
- package/dist/patterns/ReactEditorJS/customTools/inline/Italic.js +0 -79
- package/dist/patterns/ReactEditorJS/customTools/inline/StrikeThrough.d.ts +0 -4
- package/dist/patterns/ReactEditorJS/customTools/inline/StrikeThrough.js +0 -7
- package/dist/patterns/ReactEditorJS/customTools/inline/Underline.d.ts +0 -4
- package/dist/patterns/ReactEditorJS/customTools/inline/Underline.js +0 -7
- package/dist/patterns/ReactEditorJS/customTools/tunes/Delete.d.ts +0 -30
- package/dist/patterns/ReactEditorJS/customTools/tunes/Delete.js +0 -36
- package/dist/patterns/ReactEditorJS/customTools/tunes/MoveDown.d.ts +0 -34
- package/dist/patterns/ReactEditorJS/customTools/tunes/MoveDown.js +0 -58
- package/dist/patterns/ReactEditorJS/customTools/tunes/MoveUp.d.ts +0 -34
- package/dist/patterns/ReactEditorJS/customTools/tunes/MoveUp.js +0 -68
- package/dist/patterns/ReactEditorJS/i18n.d.ts +0 -128
- package/dist/patterns/ReactEditorJS/i18n.js +0 -128
- package/dist/patterns/ReactEditorJS/index.d.ts +0 -3
- package/dist/patterns/ReactEditorJS/index.js +0 -3
- package/dist/patterns/ReactEditorJS/tools.d.ts +0 -80
- package/dist/patterns/ReactEditorJS/tools.js +0 -106
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { css } from "@emotion/react";
|
|
2
|
-
import { hexToCSSFilter } from "hex-to-css-filter";
|
|
3
|
-
import { feedbackLineSvg, inputMethodLineSvg } from "../../../../icons";
|
|
4
|
-
export const CalloutStyle = (theme) => css `
|
|
5
|
-
.ce-callout {
|
|
6
|
-
outline: none;
|
|
7
|
-
margin-bottom: 8px;
|
|
8
|
-
padding: 4px 8px;
|
|
9
|
-
border-radius: 6px;
|
|
10
|
-
background-color: ${theme.color.container.marbleContainer};
|
|
11
|
-
color: ${theme.color.container.marbleOnContainer};
|
|
12
|
-
/* Default/Paragraph/14px-Rg */
|
|
13
|
-
font-family: ${theme.fontFamily.ui};
|
|
14
|
-
font-size: 14px;
|
|
15
|
-
font-style: normal;
|
|
16
|
-
font-weight: 400;
|
|
17
|
-
line-height: 20px; /* 142.857% */
|
|
18
|
-
&.red {
|
|
19
|
-
background-color: ${theme.color.container.dangerContainer};
|
|
20
|
-
color: ${theme.color.container.dangerOnContainer};
|
|
21
|
-
}
|
|
22
|
-
&.yellow {
|
|
23
|
-
background-color: ${theme.color.container.warningContainer};
|
|
24
|
-
color: ${theme.color.container.warningOnContainer};
|
|
25
|
-
}
|
|
26
|
-
&.blue {
|
|
27
|
-
background-color: ${theme.color.container.primaryContainer};
|
|
28
|
-
color: ${theme.color.container.primaryOnContainer};
|
|
29
|
-
}
|
|
30
|
-
&.green {
|
|
31
|
-
background-color: ${theme.color.container.successContainer};
|
|
32
|
-
color: ${theme.color.container.successOnContainer};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
// img태그에서는 color를 사용할 수 없으므로 filter를 사용합니다.
|
|
36
|
-
.ce-popover-item[data-item-name="grey"] .ce-popover-item__icon {
|
|
37
|
-
background: ${theme.color.container.marbleContainer};
|
|
38
|
-
img {
|
|
39
|
-
filter: ${hexToCSSFilter(theme.color.container.marbleOnContainer).filter};
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
.ce-popover-item[data-item-name="red"] .ce-popover-item__icon {
|
|
43
|
-
background: ${theme.color.container.dangerContainer};
|
|
44
|
-
img {
|
|
45
|
-
filter: ${hexToCSSFilter(theme.color.container.dangerOnContainer).filter};
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
.ce-popover-item[data-item-name="yellow"] .ce-popover-item__icon {
|
|
49
|
-
background: ${theme.color.container.warningContainer};
|
|
50
|
-
img {
|
|
51
|
-
filter: ${hexToCSSFilter(theme.color.container.warningOnContainer)
|
|
52
|
-
.filter};
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
.ce-popover-item[data-item-name="blue"] .ce-popover-item__icon {
|
|
56
|
-
background: ${theme.color.container.primaryContainer};
|
|
57
|
-
img {
|
|
58
|
-
filter: ${hexToCSSFilter(theme.color.container.primaryOnContainer)
|
|
59
|
-
.filter};
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
.ce-popover-item[data-item-name="green"] .ce-popover-item__icon {
|
|
63
|
-
background: ${theme.color.container.successContainer};
|
|
64
|
-
img {
|
|
65
|
-
filter: ${hexToCSSFilter(theme.color.container.successOnContainer)
|
|
66
|
-
.filter};
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
`;
|
|
70
|
-
export class Callout {
|
|
71
|
-
constructor({ api, config, readOnly, data }) {
|
|
72
|
-
this.api = api;
|
|
73
|
-
this.config = config;
|
|
74
|
-
this.readOnly = readOnly;
|
|
75
|
-
this._wrapper = this.createWrapper(data);
|
|
76
|
-
}
|
|
77
|
-
/** 주어진 data에 따라 HTML Element를 반환함. */
|
|
78
|
-
createWrapper(data) {
|
|
79
|
-
const wrapper = document.createElement("div");
|
|
80
|
-
wrapper.classList.add("ce-callout", data.color || this.defaultColor);
|
|
81
|
-
wrapper.contentEditable = this.readOnly ? "false" : "true";
|
|
82
|
-
wrapper.innerHTML = data.text || "";
|
|
83
|
-
return wrapper;
|
|
84
|
-
}
|
|
85
|
-
/** 주어진 data에 따라 this._wrapper를 업데이트함. */
|
|
86
|
-
updateWrapper(data) {
|
|
87
|
-
var _a;
|
|
88
|
-
const newWrapper = this.createWrapper(data);
|
|
89
|
-
(_a = this._wrapper.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(newWrapper, this._wrapper);
|
|
90
|
-
this._wrapper = newWrapper;
|
|
91
|
-
}
|
|
92
|
-
get colors() {
|
|
93
|
-
return ["grey", "red", "yellow", "blue", "green"];
|
|
94
|
-
}
|
|
95
|
-
get defaultColor() {
|
|
96
|
-
return this.colors[0];
|
|
97
|
-
}
|
|
98
|
-
get color() {
|
|
99
|
-
return this._wrapper.classList[1];
|
|
100
|
-
}
|
|
101
|
-
save() {
|
|
102
|
-
var _a;
|
|
103
|
-
return {
|
|
104
|
-
color: this.color,
|
|
105
|
-
text: (_a = this._wrapper.innerHTML) !== null && _a !== void 0 ? _a : "",
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
render() {
|
|
109
|
-
return this._wrapper;
|
|
110
|
-
}
|
|
111
|
-
// block tune 설정
|
|
112
|
-
renderSettings() {
|
|
113
|
-
const tunes = [
|
|
114
|
-
{
|
|
115
|
-
name: "grey",
|
|
116
|
-
label: this.api.i18n.t("Grey"),
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: "red",
|
|
120
|
-
label: this.api.i18n.t("Red"),
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
name: "yellow",
|
|
124
|
-
label: this.api.i18n.t("Yellow"),
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
name: "blue",
|
|
128
|
-
label: this.api.i18n.t("Blue"),
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
name: "green",
|
|
132
|
-
label: this.api.i18n.t("Green"),
|
|
133
|
-
},
|
|
134
|
-
];
|
|
135
|
-
return tunes.map((tune) => ({
|
|
136
|
-
name: tune.name,
|
|
137
|
-
icon: `<img src="${inputMethodLineSvg}" />`,
|
|
138
|
-
label: tune.label,
|
|
139
|
-
isActive: this.color === tune.name,
|
|
140
|
-
closeOnActivate: true,
|
|
141
|
-
onActivate: () => {
|
|
142
|
-
var _a;
|
|
143
|
-
this.updateWrapper({
|
|
144
|
-
color: tune.name,
|
|
145
|
-
text: (_a = this._wrapper.innerHTML) !== null && _a !== void 0 ? _a : "",
|
|
146
|
-
});
|
|
147
|
-
},
|
|
148
|
-
}));
|
|
149
|
-
}
|
|
150
|
-
static get isReadOnlySupported() {
|
|
151
|
-
return true;
|
|
152
|
-
}
|
|
153
|
-
static get enableLineBreaks() {
|
|
154
|
-
return true;
|
|
155
|
-
}
|
|
156
|
-
static get toolbox() {
|
|
157
|
-
return {
|
|
158
|
-
icon: `<img src="${feedbackLineSvg}" />`,
|
|
159
|
-
title: "Callout",
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import EditorJSDelimiter from "@editorjs/delimiter";
|
|
2
|
-
import { Theme } from "@emotion/react";
|
|
3
|
-
export declare const DelimiterStyle: (theme: Theme) => import("@emotion/utils").SerializedStyles;
|
|
4
|
-
export declare class Delimiter extends EditorJSDelimiter {
|
|
5
|
-
static get toolbox(): {
|
|
6
|
-
icon: string;
|
|
7
|
-
title: string;
|
|
8
|
-
};
|
|
9
|
-
drawView(): HTMLDivElement;
|
|
10
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import EditorJSDelimiter from "@editorjs/delimiter";
|
|
2
|
-
import { css } from "@emotion/react";
|
|
3
|
-
import { separatorSvg } from "../../../../icons";
|
|
4
|
-
export const DelimiterStyle = (theme) => css `
|
|
5
|
-
.ce-block__content {
|
|
6
|
-
hr {
|
|
7
|
-
border-top: 1px solid ${theme.color.foreground.neutralBaseDisabled};
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
`;
|
|
11
|
-
// https://github.com/editor-js/delimiter/blob/master/src/index.js
|
|
12
|
-
export class Delimiter extends EditorJSDelimiter {
|
|
13
|
-
static get toolbox() {
|
|
14
|
-
return {
|
|
15
|
-
icon: `<img src="${separatorSvg}" />`,
|
|
16
|
-
title: "Delimiter",
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
// EditorJSDelimiter constructor에서 this._element를 drawView로 생성합니다.
|
|
20
|
-
drawView() {
|
|
21
|
-
const div = document.createElement("div");
|
|
22
|
-
div.classList.add(this._CSS.block);
|
|
23
|
-
div.appendChild(document.createElement("HR"));
|
|
24
|
-
return div;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import EditorJSHeader from "@editorjs/header";
|
|
2
|
-
import { Theme } from "@emotion/react";
|
|
3
|
-
export declare const HeaderStyle: (theme: Theme) => import("@emotion/utils").SerializedStyles;
|
|
4
|
-
export declare class Header extends EditorJSHeader {
|
|
5
|
-
save(toolsContent: HTMLDivElement): {
|
|
6
|
-
text: string;
|
|
7
|
-
};
|
|
8
|
-
renderSettings(): {
|
|
9
|
-
icon: string;
|
|
10
|
-
label: any;
|
|
11
|
-
onActivate: () => void;
|
|
12
|
-
closeOnActivate: boolean;
|
|
13
|
-
isActive: boolean;
|
|
14
|
-
}[];
|
|
15
|
-
}
|
|
16
|
-
export declare class HeaderBig extends Header {
|
|
17
|
-
get currentLevel(): {
|
|
18
|
-
type: string;
|
|
19
|
-
number: number;
|
|
20
|
-
tag: string;
|
|
21
|
-
svg: string;
|
|
22
|
-
};
|
|
23
|
-
static get toolbox(): {
|
|
24
|
-
icon: string;
|
|
25
|
-
title: string;
|
|
26
|
-
};
|
|
27
|
-
static get pasteConfig(): {
|
|
28
|
-
tags: string[];
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export declare class HeaderMedium extends Header {
|
|
32
|
-
get currentLevel(): {
|
|
33
|
-
type: string;
|
|
34
|
-
number: number;
|
|
35
|
-
tag: string;
|
|
36
|
-
svg: string;
|
|
37
|
-
};
|
|
38
|
-
static get toolbox(): {
|
|
39
|
-
icon: string;
|
|
40
|
-
title: string;
|
|
41
|
-
};
|
|
42
|
-
static get pasteConfig(): {
|
|
43
|
-
tags: string[];
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export declare class HeaderSmall extends Header {
|
|
47
|
-
get currentLevel(): {
|
|
48
|
-
type: string;
|
|
49
|
-
number: number;
|
|
50
|
-
tag: string;
|
|
51
|
-
svg: string;
|
|
52
|
-
};
|
|
53
|
-
static get toolbox(): {
|
|
54
|
-
icon: string;
|
|
55
|
-
title: string;
|
|
56
|
-
};
|
|
57
|
-
static get pasteConfig(): {
|
|
58
|
-
tags: string[];
|
|
59
|
-
};
|
|
60
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import EditorJSHeader from "@editorjs/header";
|
|
2
|
-
import { css } from "@emotion/react";
|
|
3
|
-
import { h1Svg, h2Svg, h3Svg } from "../../../../icons";
|
|
4
|
-
export const HeaderStyle = (theme) => css `
|
|
5
|
-
.ce-header {
|
|
6
|
-
color: ${theme.color.foreground.neutralBase};
|
|
7
|
-
font-family: ${theme.fontFamily.ui};
|
|
8
|
-
}
|
|
9
|
-
h1.ce-header {
|
|
10
|
-
font-family: ${theme.fontFamily.title};
|
|
11
|
-
font-weight: 900;
|
|
12
|
-
font-size: 32px;
|
|
13
|
-
line-height: 40px;
|
|
14
|
-
padding: 12px 0 24px;
|
|
15
|
-
}
|
|
16
|
-
h2.ce-header {
|
|
17
|
-
font-weight: 700;
|
|
18
|
-
font-size: 24px;
|
|
19
|
-
line-height: 32px;
|
|
20
|
-
padding: 12px 0 16px;
|
|
21
|
-
}
|
|
22
|
-
h3.ce-header {
|
|
23
|
-
font-weight: 700;
|
|
24
|
-
font-size: 18px;
|
|
25
|
-
line-height: 28px;
|
|
26
|
-
padding: 12px 0 16px;
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
29
|
-
const AVAILABLE_LEVELS = [
|
|
30
|
-
{
|
|
31
|
-
type: "header",
|
|
32
|
-
number: 1,
|
|
33
|
-
tag: "H1",
|
|
34
|
-
svg: `<img src="${h1Svg}" />`,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
type: "sub_header",
|
|
38
|
-
number: 2,
|
|
39
|
-
tag: "H2",
|
|
40
|
-
svg: `<img src="${h2Svg}" />`,
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
type: "sub_sub_header",
|
|
44
|
-
number: 3,
|
|
45
|
-
tag: "H3",
|
|
46
|
-
svg: `<img src="${h3Svg}" />`,
|
|
47
|
-
},
|
|
48
|
-
];
|
|
49
|
-
// https://github.com/editor-js/header/blob/master/src/index.js
|
|
50
|
-
// 제목1, 제목2, 제목3을 블록 툴에 추가하기 위해 커스텀합니다.
|
|
51
|
-
// Header의 data 타입중 level을 드롭합니다. type만으로 level을 구분할 수 있기 때문입니다.
|
|
52
|
-
export class Header extends EditorJSHeader {
|
|
53
|
-
save(toolsContent) {
|
|
54
|
-
return {
|
|
55
|
-
text: toolsContent.innerHTML,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
// tune을 했을 때 block이 다른 Header class의 블록으로 변경되어야 합니다.
|
|
59
|
-
renderSettings() {
|
|
60
|
-
return AVAILABLE_LEVELS.map((level) => ({
|
|
61
|
-
icon: level.svg,
|
|
62
|
-
label: this.api.i18n.t(`${level.type}`),
|
|
63
|
-
onActivate: () => {
|
|
64
|
-
const blockIndex = this.api.blocks.getCurrentBlockIndex();
|
|
65
|
-
this.api.blocks.delete(blockIndex);
|
|
66
|
-
this.api.blocks.insert(level.type, {
|
|
67
|
-
text: this.data.text,
|
|
68
|
-
}, this._settings, blockIndex);
|
|
69
|
-
},
|
|
70
|
-
closeOnActivate: true,
|
|
71
|
-
isActive: this.currentLevel.number === level.number,
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
export class HeaderBig extends Header {
|
|
76
|
-
get currentLevel() {
|
|
77
|
-
return AVAILABLE_LEVELS[0];
|
|
78
|
-
}
|
|
79
|
-
static get toolbox() {
|
|
80
|
-
return {
|
|
81
|
-
icon: `<img src="${h1Svg}" />`,
|
|
82
|
-
title: "HeadingBig",
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
static get pasteConfig() {
|
|
86
|
-
return {
|
|
87
|
-
tags: ["H1"],
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
export class HeaderMedium extends Header {
|
|
92
|
-
get currentLevel() {
|
|
93
|
-
return AVAILABLE_LEVELS[1];
|
|
94
|
-
}
|
|
95
|
-
static get toolbox() {
|
|
96
|
-
return {
|
|
97
|
-
icon: `<img src="${h2Svg}" />`,
|
|
98
|
-
title: "HeadingMedium",
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
static get pasteConfig() {
|
|
102
|
-
return {
|
|
103
|
-
tags: ["H2"],
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
export class HeaderSmall extends Header {
|
|
108
|
-
get currentLevel() {
|
|
109
|
-
return AVAILABLE_LEVELS[2];
|
|
110
|
-
}
|
|
111
|
-
static get toolbox() {
|
|
112
|
-
return {
|
|
113
|
-
icon: `<img src="${h3Svg}" />`,
|
|
114
|
-
title: "HeadingSmall",
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
static get pasteConfig() {
|
|
118
|
-
return {
|
|
119
|
-
tags: ["H3"],
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import EditorJSImage from "@editorjs/image";
|
|
2
|
-
export declare class Image extends EditorJSImage {
|
|
3
|
-
static get toolbox(): {
|
|
4
|
-
icon: string;
|
|
5
|
-
title: string;
|
|
6
|
-
};
|
|
7
|
-
static get tunes(): {
|
|
8
|
-
name: string;
|
|
9
|
-
icon: string;
|
|
10
|
-
title: string;
|
|
11
|
-
toggle: boolean;
|
|
12
|
-
}[];
|
|
13
|
-
renderSettings(): {
|
|
14
|
-
icon: any;
|
|
15
|
-
label: any;
|
|
16
|
-
name: any;
|
|
17
|
-
toggle: any;
|
|
18
|
-
isActive: any;
|
|
19
|
-
onActivate: () => void;
|
|
20
|
-
}[];
|
|
21
|
-
uploadUrl(url: string): void;
|
|
22
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import EditorJSImage from "@editorjs/image";
|
|
2
|
-
import { imageLineSvg, artboard2LineSvg, expandLeftRightLineSvg, paintLineSvg, } from "../../../../icons";
|
|
3
|
-
// https://github.com/editor-js/image/blob/master/src/index.js
|
|
4
|
-
// 내부 tunes를 수정하기 위해 기존 Image를 상속해서 작성했습니다.
|
|
5
|
-
export class Image extends EditorJSImage {
|
|
6
|
-
static get toolbox() {
|
|
7
|
-
return {
|
|
8
|
-
icon: `<img src="${imageLineSvg}" />`,
|
|
9
|
-
title: "Image",
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
static get tunes() {
|
|
13
|
-
return [
|
|
14
|
-
{
|
|
15
|
-
name: "withBorder",
|
|
16
|
-
icon: `<img src="${artboard2LineSvg}" />`,
|
|
17
|
-
title: "With border",
|
|
18
|
-
toggle: true,
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: "stretched",
|
|
22
|
-
icon: `<img src="${expandLeftRightLineSvg}" />`,
|
|
23
|
-
title: "Stretch image",
|
|
24
|
-
toggle: true,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: "withBackground",
|
|
28
|
-
icon: `<img src="${paintLineSvg}" />`,
|
|
29
|
-
title: "With background",
|
|
30
|
-
toggle: true,
|
|
31
|
-
},
|
|
32
|
-
];
|
|
33
|
-
}
|
|
34
|
-
renderSettings() {
|
|
35
|
-
// Merge default tunes with the ones that might be added by user
|
|
36
|
-
// @see https://github.com/editor-js/image/pull/49
|
|
37
|
-
const tunes = Image.tunes.concat(this.config.actions);
|
|
38
|
-
return tunes.map((tune) => ({
|
|
39
|
-
icon: tune.icon,
|
|
40
|
-
label: this.api.i18n.t(tune.title),
|
|
41
|
-
name: tune.name,
|
|
42
|
-
toggle: tune.toggle,
|
|
43
|
-
isActive: this.data[tune.name],
|
|
44
|
-
onActivate: () => {
|
|
45
|
-
/* If it'a user defined tune, execute it's callback stored in action property */
|
|
46
|
-
if (typeof tune.action === "function") {
|
|
47
|
-
tune.action(tune.name);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
this.tuneToggled(tune.name);
|
|
51
|
-
},
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
// 아직 업로드를 할 수 있는 시스템이 없으므로 오류를 피하기 위해 uploadUrl 함수를 임시로 override 합니다.
|
|
55
|
-
uploadUrl(url) {
|
|
56
|
-
this.ui.showPreloader();
|
|
57
|
-
this.image = {
|
|
58
|
-
url: url,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import EditorJSNestedList from "@editorjs/nested-list";
|
|
2
|
-
export declare const NestedListStyle: import("@emotion/utils").SerializedStyles;
|
|
3
|
-
declare class NestedList extends EditorJSNestedList {
|
|
4
|
-
constructor({ data, config, api, readOnly }: any);
|
|
5
|
-
save(): {
|
|
6
|
-
items: any;
|
|
7
|
-
};
|
|
8
|
-
renderSettings(): any[];
|
|
9
|
-
}
|
|
10
|
-
export declare class ListOrdered extends NestedList {
|
|
11
|
-
static get toolbox(): {
|
|
12
|
-
title: string;
|
|
13
|
-
icon: string;
|
|
14
|
-
};
|
|
15
|
-
static get pasteConfig(): {
|
|
16
|
-
tags: string[];
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export declare class ListUnordered extends NestedList {
|
|
20
|
-
static get toolbox(): {
|
|
21
|
-
title: string;
|
|
22
|
-
icon: string;
|
|
23
|
-
};
|
|
24
|
-
static get pasteConfig(): {
|
|
25
|
-
tags: string[];
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export {};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import EditorJSNestedList from "@editorjs/nested-list";
|
|
2
|
-
import { css } from "@emotion/react";
|
|
3
|
-
import { listOrdered2Svg, listUnorderedSvg } from "../../../../icons";
|
|
4
|
-
const STYLE_TO_LIST_TYPE = (style) => {
|
|
5
|
-
switch (style) {
|
|
6
|
-
case "ordered":
|
|
7
|
-
return "numbered_list";
|
|
8
|
-
case "unordered":
|
|
9
|
-
default:
|
|
10
|
-
return "bulleted_list";
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
const TUNE_ICONS = [
|
|
14
|
-
`<img src="${listUnorderedSvg}" />`,
|
|
15
|
-
`<img src="${listOrdered2Svg}" />`,
|
|
16
|
-
];
|
|
17
|
-
export const NestedListStyle = css `
|
|
18
|
-
ul.cdx-nested-list {
|
|
19
|
-
margin-left: 10px;
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
22
|
-
// https://github.com/editor-js/nested-list/blob/main/src/index.js
|
|
23
|
-
// 일반 목록, 숫자 목록을 블록 툴에 추가하기 위해 커스텀합니다.
|
|
24
|
-
// NestedList의 data 타입중 style을 드롭합니다. type만으로 style을 구분할 수 있기 때문입니다.
|
|
25
|
-
class NestedList extends EditorJSNestedList {
|
|
26
|
-
constructor({ data, config, api, readOnly }) {
|
|
27
|
-
super({ data, config, api, readOnly });
|
|
28
|
-
this.data = {
|
|
29
|
-
items: data.items || [],
|
|
30
|
-
style: this.defaultListStyle,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
save() {
|
|
34
|
-
return {
|
|
35
|
-
items: super.save().items,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
// tune을 했을 때 block이 다른 Nestedlist class의 블록으로 변경되어야 합니다.
|
|
39
|
-
renderSettings() {
|
|
40
|
-
return Array.from(super.renderSettings()).map((setting, i) => (Object.assign(Object.assign({}, setting), { icon: TUNE_ICONS[i], isActive: this.data.style === setting.name, onActivate: () => {
|
|
41
|
-
const blockIndex = this.api.blocks.getCurrentBlockIndex();
|
|
42
|
-
this.api.blocks.delete(blockIndex);
|
|
43
|
-
this.api.blocks.insert(STYLE_TO_LIST_TYPE(setting.name), {
|
|
44
|
-
items: this.save().items,
|
|
45
|
-
}, this.config, blockIndex);
|
|
46
|
-
} })));
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
export class ListOrdered extends NestedList {
|
|
50
|
-
static get toolbox() {
|
|
51
|
-
return {
|
|
52
|
-
title: "ListOrdered",
|
|
53
|
-
icon: `<img src="${listOrdered2Svg}" />`,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
static get pasteConfig() {
|
|
57
|
-
return {
|
|
58
|
-
tags: ["OL", "LI"],
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
export class ListUnordered extends NestedList {
|
|
63
|
-
static get toolbox() {
|
|
64
|
-
return {
|
|
65
|
-
title: "ListUnordered",
|
|
66
|
-
icon: `<img src="${listUnorderedSvg}" />`,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
static get pasteConfig() {
|
|
70
|
-
return {
|
|
71
|
-
tags: ["UL", "LI"],
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { BlockTool } from "@editorjs/editorjs";
|
|
2
|
-
import { Theme } from "@emotion/react";
|
|
3
|
-
type COLOR_TYPE = "grey" | "red" | "yellow" | "blue" | "green";
|
|
4
|
-
export declare const QuoteStyle: (theme: Theme) => import("@emotion/utils").SerializedStyles;
|
|
5
|
-
export declare class Quote implements BlockTool {
|
|
6
|
-
api: any;
|
|
7
|
-
config: any;
|
|
8
|
-
readOnly: any;
|
|
9
|
-
private _wrapper;
|
|
10
|
-
constructor({ api, config, readOnly, data }: any);
|
|
11
|
-
/** 주어진 data에 따라 HTML Element를 반환함. */
|
|
12
|
-
private createWrapper;
|
|
13
|
-
/** 주어진 data에 따라 this._wrapper를 업데이트함. */
|
|
14
|
-
private updateWrapper;
|
|
15
|
-
get colors(): string[];
|
|
16
|
-
get defaultColor(): string;
|
|
17
|
-
get color(): COLOR_TYPE;
|
|
18
|
-
save(): {
|
|
19
|
-
color: COLOR_TYPE;
|
|
20
|
-
text: string;
|
|
21
|
-
};
|
|
22
|
-
render(): HTMLDivElement;
|
|
23
|
-
renderSettings(): {
|
|
24
|
-
name: string;
|
|
25
|
-
icon: string;
|
|
26
|
-
label: any;
|
|
27
|
-
isActive: boolean;
|
|
28
|
-
closeOnActivate: boolean;
|
|
29
|
-
onActivate: () => void;
|
|
30
|
-
}[];
|
|
31
|
-
static get isReadOnlySupported(): boolean;
|
|
32
|
-
static get enableLineBreaks(): boolean;
|
|
33
|
-
static get toolbox(): {
|
|
34
|
-
icon: string;
|
|
35
|
-
title: string;
|
|
36
|
-
};
|
|
37
|
-
onPaste(event: any): void;
|
|
38
|
-
static get pasteConfig(): {
|
|
39
|
-
tags: string[];
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
export {};
|