@loword/loword-design-system 0.7.2 → 0.7.4
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/README.md +21 -2
- package/dist/components/LDEditor/EditorBase.d.ts +5 -2
- package/dist/components/LDEditor/EditorBase.d.ts.map +1 -1
- package/dist/components/LDEditor/EditorBase.js +21 -13
- package/dist/components/LDEditor/LDEditor.d.ts +30 -1
- package/dist/components/LDEditor/LDEditor.d.ts.map +1 -1
- package/dist/components/LDEditor/LDEditor.js +184 -49
- package/dist/components/LDEditor/LDViewer.d.ts +7 -1
- package/dist/components/LDEditor/LDViewer.d.ts.map +1 -1
- package/dist/components/LDEditor/LDViewer.js +2 -2
- package/dist/components/LDEditor/extensions.d.ts +5 -0
- package/dist/components/LDEditor/extensions.d.ts.map +1 -1
- package/dist/components/LDEditor/extensions.js +109 -5
- package/dist/components/LDFileUpload/LDFileUpload.d.ts.map +1 -1
- package/dist/components/LDFileUpload/LDFileUpload.js +1 -1
- package/dist/components/LDPagination/PaginationBase.d.ts.map +1 -1
- package/dist/components/LDPagination/PaginationBase.js +7 -3
- package/dist/components/LDTeamHistory/TeamHistoryBase.d.ts.map +1 -1
- package/dist/components/LDTeamHistory/TeamHistoryBase.js +1 -1
- package/dist/index.css +75 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/utils/cn.d.ts +33 -0
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/cn.js +55 -23
- package/package.json +2 -3
- package/src/styles/components/editor.css +94 -2
|
@@ -11,14 +11,70 @@
|
|
|
11
11
|
line-height: calc(28 / 18) !important;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
/* 정적 렌더 옵트인(.ld-editor-render, 렌더 루트나 그 조상에 붙인다). 클래스가 없으면 기존 렌더 그대로다.
|
|
15
|
+
getHTML()은 빈 문단을 <p></p>로 내보낸다. 편집 화면은 <p><br class="ProseMirror-trailingBreak"></p>라
|
|
16
|
+
한 줄 높이인데, 내용 없는 <p>는 높이 0이라 margin이 겹쳐 사라진다. 제로폭 문자로 한 줄 높이를 만든다.
|
|
17
|
+
:empty는 자식 노드가 없을 때만 맞으므로 <br>이 있는 편집 화면에는 영향이 없다. */
|
|
18
|
+
.ld-editor-render .ProseMirror p:empty::before,
|
|
19
|
+
.ProseMirror.ld-editor-render p:empty::before {
|
|
20
|
+
content: '\200B';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* 링크 색(.ld-editor-render 옵트인, 편집 영역에도 붙는다): 링크 글자색은 주변 글자 색(색 mark 포함)을 따르고
|
|
24
|
+
밑줄도 그 글자색으로 그린다. 예전에 저장된 글의 링크에 박힌 파란색 클래스(text-blue-500)도 덮으려고 !important.
|
|
25
|
+
글자 색 mark가 링크 요소 바깥에 있어야 밑줄이 그 색을 따른다(extensions.ts의 TextStyle priority). */
|
|
26
|
+
.ld-editor-render .ProseMirror a,
|
|
27
|
+
.ProseMirror.ld-editor-render a {
|
|
28
|
+
color: inherit !important;
|
|
29
|
+
text-decoration-color: currentcolor !important;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* 밑줄(링크·밑줄 서식)이 글자에 붙어 보이지 않게 2px 띄운다. 편집 영역·LDViewer·정적 렌더가 같은 값을 받는다. */
|
|
33
|
+
.ld-editor-render .ProseMirror :is(a, u),
|
|
34
|
+
.ProseMirror.ld-editor-render :is(a, u) {
|
|
35
|
+
text-underline-offset: 2px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* 글 기본 색(.ld-editor-render 옵트인, 편집 영역에도 붙는다): 툴바 글자 색 목록의 '검정'(neutral900)이다.
|
|
39
|
+
색 mark가 없는 글이 이 색으로 보이므로, 목록에서 '검정'을 고르면 mark를 걷어 낸다. */
|
|
40
|
+
.ld-editor-render.prose,
|
|
41
|
+
.ld-editor-render .prose {
|
|
42
|
+
--tw-prose-body: var(--color-neutral900);
|
|
43
|
+
/* 자간: LDS 타이포(display10~30) 토큰과 같은 -1px. 편집 영역·LDViewer·정적 렌더가 같은 값을 받아
|
|
44
|
+
줄바꿈 위치가 같다. 글자 크기와 상관없이 고정 px(시안 letterSpacing -1). */
|
|
45
|
+
letter-spacing: var(--tracking-display16);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* 제목 위아래 여백은 제목 자기 글자 크기만큼(1em) 둔다. 제목이 클수록 앞뒤 본문과 더 벌어진다.
|
|
49
|
+
앞 문단의 아래 여백(0.8em)과는 겹쳐(margin collapse) 둘 중 큰 값만 남는다. */
|
|
14
50
|
.prose h1,
|
|
15
51
|
.prose h2,
|
|
16
52
|
.prose h3 {
|
|
17
|
-
margin-top:
|
|
18
|
-
margin-bottom:
|
|
53
|
+
margin-top: 1em !important;
|
|
54
|
+
margin-bottom: 1em !important;
|
|
19
55
|
padding: 0 !important;
|
|
20
56
|
}
|
|
21
57
|
|
|
58
|
+
/* 글 첫머리 제목은 위 여백 없이 시작한다(아래 .ProseMirror :first-child는 !important가 아니라 위 규칙에 진다). */
|
|
59
|
+
.prose :is(h1, h2, h3):first-child {
|
|
60
|
+
margin-top: 0 !important;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* 제목 줄 높이는 같은 글자 크기의 display 토큰(typography.css)을 따른다. 제목 크기는 본문 기준 em이라
|
|
64
|
+
(본문 18px일 때 48·30·24px) px 대신 토큰의 비율로 둬 defaultFontSize가 바뀌어도 같은 비율이다.
|
|
65
|
+
제목 1(48px)은 같은 크기 토큰이 없어 display40·display64처럼 글자 크기 + 8px로 둔다. */
|
|
66
|
+
.prose h1 {
|
|
67
|
+
line-height: calc(56 / 48) !important;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.prose h2 {
|
|
71
|
+
line-height: calc(36 / 30) !important; /* display30 */
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.prose h3 {
|
|
75
|
+
line-height: calc(28 / 24) !important; /* display24 */
|
|
76
|
+
}
|
|
77
|
+
|
|
22
78
|
.prose ul,
|
|
23
79
|
.prose ol {
|
|
24
80
|
margin-top: 0 !important;
|
|
@@ -52,6 +108,27 @@
|
|
|
52
108
|
}
|
|
53
109
|
}
|
|
54
110
|
|
|
111
|
+
/* 정적 렌더 옵트인(.ld-editor-render): 편집 화면과 같이 연속 공백·줄 구분 문자(U+2028 등)를 보존한다.
|
|
112
|
+
tiptap은 편집 가능한 에디터에만 같은 규칙을 주입한다. 클래스가 없는 정적 렌더는 기존 그대로다.
|
|
113
|
+
앞 줄은 break-spaces 미지원 브라우저용 폴백. */
|
|
114
|
+
@layer components {
|
|
115
|
+
.ld-editor-render .ProseMirror,
|
|
116
|
+
.ProseMirror.ld-editor-render {
|
|
117
|
+
white-space: pre-wrap;
|
|
118
|
+
white-space: break-spaces;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* 편집 영역은 고정 높이 + 내부 스크롤이라 스크롤바(classic 환경 15px)가 내용 폭을 줄인다.
|
|
122
|
+
편집 요소는 scrollbar-gutter: stable로 자리를 항상 확보하므로(LDEditor), 정적 렌더·LDViewer도
|
|
123
|
+
같은 거터를 확보해 줄바꿈이 같게 한다. 높이는 auto라 실제 스크롤은 생기지 않는다.
|
|
124
|
+
편집 요소(contenteditable="true")에도 ld-editor-render가 붙어 있어 제외한다. */
|
|
125
|
+
.ld-editor-render .ProseMirror:not([contenteditable='true']),
|
|
126
|
+
.ProseMirror.ld-editor-render:not([contenteditable='true']) {
|
|
127
|
+
overflow-y: auto;
|
|
128
|
+
scrollbar-gutter: stable;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
55
132
|
/* 이미지 정렬 스타일 */
|
|
56
133
|
/* height만 !important로 잠근다. 리사이즈 노드뷰가 width/height를 함께 인라인 px로
|
|
57
134
|
쓰는데, 높이가 고정되면 컨테이너가 좁아질 때 max-width로 폭만 줄어 이미지가
|
|
@@ -180,6 +257,21 @@
|
|
|
180
257
|
(래퍼는 부모가 block이면 기본값이 100%라 가만두면 벌어진다.) */
|
|
181
258
|
.ProseMirror [data-resize-wrapper] {
|
|
182
259
|
width: fit-content;
|
|
260
|
+
max-width: 100%;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* 편집 화면의 리사이즈 노드뷰는 flex 컨테이너라 이미지가 왼쪽에 붙는다. 정적 렌더(위 img 규칙)와
|
|
264
|
+
같게 기본은 가운데, text-align이 지정된 이미지는 그쪽으로 둔다. */
|
|
265
|
+
.ProseMirror [data-resize-container] {
|
|
266
|
+
justify-content: center;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.ProseMirror [data-resize-container]:has(img[style*='text-align: left']) {
|
|
270
|
+
justify-content: flex-start;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.ProseMirror [data-resize-container]:has(img[style*='text-align: right']) {
|
|
274
|
+
justify-content: flex-end;
|
|
183
275
|
}
|
|
184
276
|
|
|
185
277
|
/* 표
|