podo-ui 0.2.1 → 0.3.1

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/global.scss CHANGED
@@ -57,3 +57,4 @@
57
57
  @forward './scss/molecule/table.scss';
58
58
  @forward './scss/molecule/pagination.scss';
59
59
  @forward './scss/molecule/toast.scss';
60
+
package/next.ts CHANGED
@@ -3,9 +3,10 @@ import dynamic from 'next/dynamic';
3
3
 
4
4
  import Input from './react/atom/input';
5
5
  import Textarea from './react/atom/textarea';
6
+ import EditorView from './react/atom/editor-view';
7
+ import Pagination from './react/molecule/pagination';
6
8
  import Field from './react/molecule/field';
7
9
  const Editor = dynamic(() => import('./react/atom/editor'), { ssr: false });
8
- import EditorView from './react/atom/editor-view';
9
10
 
10
11
  const Form = {
11
12
  Input,
@@ -17,4 +18,4 @@ const Form = {
17
18
 
18
19
  export default Form;
19
20
 
20
- export { Input, Textarea, Editor, EditorView, Field };
21
+ export { Input, Textarea, Editor, EditorView, Pagination, Field };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podo-ui",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "author": "hada0127 <work@tarucy.net>",
6
6
  "license": "MIT",
@@ -27,7 +27,6 @@
27
27
  "react": "^18.3.1",
28
28
  "react-dom": "^18.3.1",
29
29
  "sass": "^1.83.0",
30
- "suneditor": "^2.47.1",
31
30
  "uuid": "^11.0.3",
32
31
  "zod": "^3.23.8"
33
32
  },
@@ -0,0 +1,203 @@
1
+ @use '../../scss/color/function.scss' as *;
2
+ @use '../../scss/typo/mixin.scss' as typo;
3
+
4
+ .editorView {
5
+ color: color(text-body);
6
+ font-family: inherit;
7
+ word-wrap: break-word;
8
+ overflow-wrap: break-word;
9
+
10
+ // 텍스트 서식
11
+ strong,
12
+ b {
13
+ font-weight: bold;
14
+ }
15
+
16
+ em,
17
+ i {
18
+ font-style: italic;
19
+ }
20
+
21
+ u {
22
+ text-decoration: underline;
23
+ }
24
+
25
+ s,
26
+ strike {
27
+ text-decoration: line-through;
28
+ }
29
+
30
+ // 제목 - podo-ui 스타일 상속
31
+ h1 {
32
+ @include typo.h1;
33
+ margin: 0.67em 0;
34
+ }
35
+
36
+ h2 {
37
+ @include typo.h2;
38
+ margin: 0.75em 0;
39
+ }
40
+
41
+ h3 {
42
+ @include typo.h3;
43
+ margin: 0.83em 0;
44
+ }
45
+
46
+ // p1~p5 스타일 클래스
47
+ .p1 {
48
+ @include typo.p1;
49
+ }
50
+
51
+ .p2 {
52
+ @include typo.p2;
53
+ }
54
+
55
+ .p3 {
56
+ @include typo.p3;
57
+ }
58
+
59
+ .p4 {
60
+ @include typo.p4;
61
+ }
62
+
63
+ .p5 {
64
+ @include typo.p5;
65
+ }
66
+
67
+ // Semibold 스타일
68
+ .p1_semibold {
69
+ @include typo.p1;
70
+ font-weight: 600;
71
+ }
72
+
73
+ .p2_semibold {
74
+ @include typo.p2;
75
+ font-weight: 600;
76
+ }
77
+
78
+ .p3_semibold {
79
+ @include typo.p3-semibold;
80
+ }
81
+
82
+ .p4_semibold {
83
+ @include typo.p4-semibold;
84
+ }
85
+
86
+ .p5_semibold {
87
+ @include typo.p5-semibold;
88
+ }
89
+
90
+ // 단락 - 기본 본문 스타일 p3 적용
91
+ p {
92
+ @include typo.p3;
93
+ margin: 1em 0;
94
+
95
+ &:first-child {
96
+ margin-top: 0;
97
+ }
98
+
99
+ &:last-child {
100
+ margin-bottom: 0;
101
+ }
102
+ }
103
+
104
+ // 링크
105
+ a {
106
+ color: color(link);
107
+ text-decoration: underline;
108
+ cursor: pointer;
109
+
110
+ &:hover {
111
+ color: color(link-hover);
112
+ }
113
+ }
114
+
115
+ // 목록 - podo-ui p3 스타일 적용
116
+ ul,
117
+ ol {
118
+ @include typo.p3;
119
+ margin: 1em 0 !important;
120
+ padding-left: 2em !important;
121
+ padding-top: 0 !important;
122
+ padding-right: 0 !important;
123
+ padding-bottom: 0 !important;
124
+
125
+ &:first-child {
126
+ margin-top: 0 !important;
127
+ }
128
+
129
+ &:last-child {
130
+ margin-bottom: 0 !important;
131
+ }
132
+ }
133
+
134
+ ul {
135
+ list-style: disc !important;
136
+ list-style-type: disc !important;
137
+ list-style-position: outside !important;
138
+ }
139
+
140
+ ol {
141
+ list-style: decimal !important;
142
+ list-style-type: decimal !important;
143
+ list-style-position: outside !important;
144
+ }
145
+
146
+ li {
147
+ display: list-item !important;
148
+ margin: 0.5em 0 !important;
149
+ padding: 0 !important;
150
+ list-style: inherit !important;
151
+ list-style-position: outside !important;
152
+
153
+ // 중첩된 리스트
154
+ ul,
155
+ ol {
156
+ margin: 0.5em 0 !important;
157
+ padding-left: 1.5em !important;
158
+ }
159
+
160
+ ul {
161
+ list-style-type: circle !important;
162
+ }
163
+
164
+ ol {
165
+ list-style-type: lower-alpha !important;
166
+ }
167
+ }
168
+
169
+ // 이미지
170
+ img {
171
+ display: inline-block !important;
172
+ vertical-align: middle;
173
+ max-width: 100%;
174
+ height: auto;
175
+ }
176
+
177
+ // 인용
178
+ blockquote {
179
+ @include typo.p3;
180
+ margin: 1em 0;
181
+ padding-left: 1em;
182
+ border-left: 4px solid color(border);
183
+ color: color(text-sub);
184
+ font-style: italic;
185
+ }
186
+
187
+ // 유튜브 컨테이너 (editor에서 삽입된 스타일 유지)
188
+ :global(.youtube-container) {
189
+ position: relative;
190
+ display: inline-block;
191
+ max-width: 100%;
192
+
193
+ iframe {
194
+ width: 100%;
195
+ height: 100%;
196
+ display: block;
197
+ }
198
+
199
+ :global(.youtube-overlay) {
200
+ display: none; // view 모드에서는 오버레이 숨김
201
+ }
202
+ }
203
+ }
@@ -1,10 +1,15 @@
1
- import 'suneditor/dist/css/suneditor.min.css';
1
+ import styles from './editor-view.module.scss';
2
2
 
3
- const EditorView = ({ content }: { content: string }) => {
3
+ interface Props {
4
+ value: string;
5
+ className?: string;
6
+ }
7
+
8
+ const EditorView = ({ value, className }: Props) => {
4
9
  return (
5
10
  <div
6
- className="context sun-editor-editable"
7
- dangerouslySetInnerHTML={{ __html: content }}
11
+ className={`${styles.editorView} ${className || ''}`}
12
+ dangerouslySetInnerHTML={{ __html: value }}
8
13
  />
9
14
  );
10
15
  };