@eliceio/cdk-cli 0.0.0-stage → 0.1.0-alpha.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.
- package/README.md +526 -2
- package/es/bin/index.d.ts +2 -0
- package/es/bin/index.js +10 -0
- package/es/cli.d.ts +5 -0
- package/es/cli.js +209 -0
- package/es/commands/build/index.d.ts +30 -0
- package/es/commands/build/index.js +163 -0
- package/es/commands/check/index.d.ts +9 -0
- package/es/commands/check/index.js +31 -0
- package/es/commands/create/index.d.ts +8 -0
- package/es/commands/create/index.js +22 -0
- package/es/commands/create/scaffold.d.ts +24 -0
- package/es/commands/create/scaffold.js +82 -0
- package/es/commands/dev/index.d.ts +6 -0
- package/es/commands/dev/index.js +40 -0
- package/es/commands/doctor/index.d.ts +34 -0
- package/es/commands/doctor/index.js +311 -0
- package/es/commands/guide/index.d.ts +29 -0
- package/es/commands/guide/index.js +120 -0
- package/es/commands/skill/index.d.ts +48 -0
- package/es/commands/skill/index.js +173 -0
- package/es/core/collect.d.ts +21 -0
- package/es/core/collect.js +89 -0
- package/es/core/config.d.ts +55 -0
- package/es/core/config.js +109 -0
- package/es/core/manifest.d.ts +15 -0
- package/es/core/manifest.js +43 -0
- package/es/core/minify.d.ts +18 -0
- package/es/core/minify.js +93 -0
- package/es/core/prepare.d.ts +12 -0
- package/es/core/prepare.js +86 -0
- package/es/core/protocol.d.ts +2 -0
- package/es/core/protocol.js +4 -0
- package/es/core/sandbox.d.ts +17 -0
- package/es/core/sandbox.js +182 -0
- package/es/core/zip.d.ts +4 -0
- package/es/core/zip.js +17 -0
- package/es/dev/grading.d.ts +15 -0
- package/es/dev/grading.js +37 -0
- package/es/dev/host-page.d.ts +7 -0
- package/es/dev/host-page.js +240 -0
- package/es/dev/inject.d.ts +8 -0
- package/es/dev/inject.js +38 -0
- package/es/dev/mock-api.d.ts +65 -0
- package/es/dev/mock-api.js +269 -0
- package/es/dev/server.d.ts +25 -0
- package/es/dev/server.js +309 -0
- package/es/engines/static/index.d.ts +3 -0
- package/es/engines/static/index.js +11 -0
- package/es/engines/types.d.ts +12 -0
- package/es/engines/vite/index.d.ts +2 -0
- package/es/engines/vite/index.js +4 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -0
- package/es/rules/check.d.ts +2 -0
- package/es/rules/check.js +282 -0
- package/es/rules/index.d.ts +8 -0
- package/es/rules/index.js +7 -0
- package/es/rules/manifest.d.ts +39 -0
- package/es/rules/manifest.js +168 -0
- package/es/rules/node.d.ts +11 -0
- package/es/rules/node.js +87 -0
- package/es/rules/path.d.ts +7 -0
- package/es/rules/path.js +35 -0
- package/es/rules/refs.d.ts +19 -0
- package/es/rules/refs.js +111 -0
- package/es/rules/skip.d.ts +12 -0
- package/es/rules/skip.js +55 -0
- package/es/rules/spec.d.ts +3 -0
- package/es/rules/spec.js +6 -0
- package/es/rules/types.d.ts +140 -0
- package/es/rules/unused.d.ts +7 -0
- package/es/rules/unused.js +21 -0
- package/es/rules/zip.d.ts +13 -0
- package/es/rules/zip.js +45 -0
- package/es/rules.json.js +3 -0
- package/es/types.d.ts +4 -0
- package/es/version.d.ts +2 -0
- package/es/version.js +7 -0
- package/guides/content-development.md +207 -0
- package/package.json +50 -3
- package/rules.json +608 -0
- package/skills/_shared/always.md +7 -0
- package/skills/elice-content-check/SKILL.md +22 -0
- package/skills/elice-content-create/SKILL.md +21 -0
- package/skills/elice-content-migrate/SKILL.md +21 -0
- package/templates/_shared/lib/cdk-mock.d.ts +94 -0
- package/templates/_shared/lib/cdk-mock.js +429 -0
- package/templates/_shared/lib/cdk.js +3 -0
- package/templates/_shared/lib/elice-content.css +262 -0
- package/templates/_shared/lib/elice-content.d.ts +123 -0
- package/templates/_shared/lib/elice-content.js +534 -0
- package/templates/_shared/lib/elice-tokens.css +446 -0
- package/templates/blank/README.md +64 -0
- package/templates/blank/commentary.txt +2 -0
- package/templates/blank/content.json +4 -0
- package/templates/blank/edit.html +15 -0
- package/templates/blank/elice.config.json +12 -0
- package/templates/blank/gitignore +3 -0
- package/templates/blank/index.html +15 -0
- package/templates/blank/instructor.html +15 -0
- package/templates/blank/screens/edit.js +21 -0
- package/templates/blank/screens/instructor.js +9 -0
- package/templates/blank/screens/learn.js +19 -0
- package/templates/blank/styles.css +1 -0
- package/templates/quiz/README.md +108 -0
- package/templates/quiz/commentary.txt +2 -0
- package/templates/quiz/content.json +81 -0
- package/templates/quiz/core/behaviors.d.ts +59 -0
- package/templates/quiz/core/behaviors.js +310 -0
- package/templates/quiz/core/dom.d.ts +13 -0
- package/templates/quiz/core/dom.js +83 -0
- package/templates/quiz/core/editor.d.ts +48 -0
- package/templates/quiz/core/editor.js +206 -0
- package/templates/quiz/core/markdown.d.ts +2 -0
- package/templates/quiz/core/markdown.js +84 -0
- package/templates/quiz/core/model.d.ts +20 -0
- package/templates/quiz/core/model.js +203 -0
- package/templates/quiz/edit.html +17 -0
- package/templates/quiz/elice.config.json +14 -0
- package/templates/quiz/gitignore +3 -0
- package/templates/quiz/grading.json +13 -0
- package/templates/quiz/index.html +17 -0
- package/templates/quiz/instructor.html +17 -0
- package/templates/quiz/screens/edit.js +139 -0
- package/templates/quiz/screens/instructor.js +27 -0
- package/templates/quiz/screens/learn.js +55 -0
- package/templates/quiz/styles.css +570 -0
- package/templates/quiz/ui/templates/choice.js +22 -0
- package/templates/quiz/ui/templates/edit.d.ts +13 -0
- package/templates/quiz/ui/templates/edit.js +183 -0
- package/templates/quiz/ui/templates/group.js +68 -0
- package/templates/quiz/ui/templates/index.d.ts +5 -0
- package/templates/quiz/ui/templates/index.js +17 -0
- package/templates/quiz/ui/templates/order.js +35 -0
- package/templates/quiz/ui/templates/page.js +29 -0
- package/templates/quiz/ui/templates/question.js +28 -0
- package/templates/quiz/ui/templates/text.js +16 -0
- package/templates/quiz/ui/texts.d.ts +3 -0
- package/templates/quiz/ui/texts.js +127 -0
- package/templates/quiz/ui/theme.css +50 -0
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
/* 퀴즈 앱 스타일. 색 · 간격 · 모서리 값은 ui/theme.css(그 아래는 EDS 토큰 lib/elice-tokens.css), 모양은 EDS 컴포넌트 명세를 따릅니다
|
|
2
|
+
보기 = RadioCard · 유형 표시(교육자) = Tag(muted) · 배지 = Tag(filled) · 해설 = Accordion */
|
|
3
|
+
|
|
4
|
+
/* ---------- 학생 · 교육자 ---------- */
|
|
5
|
+
/* Tag filled primary medium: 24px, 모서리 6px, 11px / 700 */
|
|
6
|
+
.qz-badge {
|
|
7
|
+
align-self: flex-start;
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
height: 24px;
|
|
11
|
+
padding: 0 6px;
|
|
12
|
+
border-radius: 6px;
|
|
13
|
+
font-size: 11px;
|
|
14
|
+
font-weight: var(--eds-fw-bold);
|
|
15
|
+
color: var(--qz-accent-contrast);
|
|
16
|
+
background: var(--qz-accent);
|
|
17
|
+
}
|
|
18
|
+
.qz-badge.dark {
|
|
19
|
+
background: var(--eds-secondary-main);
|
|
20
|
+
color: var(--eds-secondary-contrast-text);
|
|
21
|
+
}
|
|
22
|
+
.qz-title {
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
25
|
+
.qz-lead {
|
|
26
|
+
color: var(--ec-muted);
|
|
27
|
+
}
|
|
28
|
+
.qz-muted {
|
|
29
|
+
color: var(--ec-muted);
|
|
30
|
+
font-size: var(--eds-fs-caption);
|
|
31
|
+
margin: 0;
|
|
32
|
+
}
|
|
33
|
+
.qz-summary {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
gap: 6px;
|
|
37
|
+
padding: 16px 20px;
|
|
38
|
+
border: 1px solid var(--qz-question-border);
|
|
39
|
+
border-radius: var(--qz-radius-card);
|
|
40
|
+
background: var(--qz-surface);
|
|
41
|
+
}
|
|
42
|
+
.qz-summary p {
|
|
43
|
+
margin: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.qz-question {
|
|
47
|
+
margin: 0;
|
|
48
|
+
padding: var(--qz-card-padding);
|
|
49
|
+
border: 1px solid var(--qz-question-border);
|
|
50
|
+
border-radius: var(--qz-radius-card);
|
|
51
|
+
background: var(--qz-surface);
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
gap: var(--qz-card-gap);
|
|
55
|
+
min-width: 0;
|
|
56
|
+
}
|
|
57
|
+
.qz-question[data-result='correct'] {
|
|
58
|
+
border-color: var(--qz-correct);
|
|
59
|
+
}
|
|
60
|
+
.qz-question[data-result='wrong'] {
|
|
61
|
+
border-color: var(--qz-wrong);
|
|
62
|
+
}
|
|
63
|
+
/* EDS subtitle2: 18px / 800 / 1.5. legend를 테두리 위가 아니라 카드 안에 두려고 float */
|
|
64
|
+
.qz-question-head {
|
|
65
|
+
float: left;
|
|
66
|
+
width: 100%;
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-wrap: wrap;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: 8px;
|
|
71
|
+
padding: 0;
|
|
72
|
+
font-size: var(--eds-fs-subtitle2);
|
|
73
|
+
line-height: var(--eds-lh-subtitle2);
|
|
74
|
+
font-weight: var(--eds-fw-extrabold);
|
|
75
|
+
}
|
|
76
|
+
/* Tag muted default small: 20px, 모서리 4px */
|
|
77
|
+
.qz-chip {
|
|
78
|
+
display: inline-flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
height: 20px;
|
|
81
|
+
padding: 0 4px;
|
|
82
|
+
border-radius: 4px;
|
|
83
|
+
font-size: 11px;
|
|
84
|
+
font-weight: var(--eds-fw-bold);
|
|
85
|
+
color: var(--eds-text-secondary);
|
|
86
|
+
background: var(--qz-surface-gray);
|
|
87
|
+
}
|
|
88
|
+
.qz-markdown {
|
|
89
|
+
font-size: var(--eds-fs-body1);
|
|
90
|
+
line-height: var(--eds-lh-body1);
|
|
91
|
+
overflow-wrap: anywhere;
|
|
92
|
+
}
|
|
93
|
+
.qz-markdown p {
|
|
94
|
+
margin: 0 0 8px;
|
|
95
|
+
}
|
|
96
|
+
.qz-markdown code {
|
|
97
|
+
padding: 0 4px;
|
|
98
|
+
border-radius: 4px;
|
|
99
|
+
background: var(--qz-surface-gray);
|
|
100
|
+
}
|
|
101
|
+
.qz-markdown pre {
|
|
102
|
+
background: var(--qz-surface-gray);
|
|
103
|
+
color: var(--eds-text-primary);
|
|
104
|
+
padding: 12px 16px;
|
|
105
|
+
border-radius: var(--qz-radius);
|
|
106
|
+
overflow-x: auto;
|
|
107
|
+
}
|
|
108
|
+
.qz-passage {
|
|
109
|
+
color: var(--ec-muted);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* RadioCard: 간격 8px · 여백 20px · 모서리 12px · 테두리 surface.border,
|
|
113
|
+
hover action.hover, checked = primary 테두리 + primary.opacity02 배경 */
|
|
114
|
+
.qz-options {
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: column;
|
|
117
|
+
gap: var(--qz-list-gap);
|
|
118
|
+
}
|
|
119
|
+
.qz-option {
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
gap: var(--qz-option-gap);
|
|
123
|
+
padding: var(--qz-option-padding);
|
|
124
|
+
border: 1px solid var(--qz-option-border);
|
|
125
|
+
border-radius: var(--qz-option-radius);
|
|
126
|
+
background: var(--qz-option-bg);
|
|
127
|
+
font-size: var(--eds-fs-body1);
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
min-height: 44px;
|
|
130
|
+
transition:
|
|
131
|
+
background-color 150ms ease-in-out,
|
|
132
|
+
border-color 150ms ease-in-out;
|
|
133
|
+
}
|
|
134
|
+
.qz-option:hover {
|
|
135
|
+
background: var(--qz-option-hover-bg);
|
|
136
|
+
}
|
|
137
|
+
.qz-option:has(input:checked) {
|
|
138
|
+
border-color: var(--qz-option-checked-border);
|
|
139
|
+
outline: 1px solid var(--qz-option-checked-border);
|
|
140
|
+
background: var(--qz-option-checked-bg);
|
|
141
|
+
}
|
|
142
|
+
.qz-option:has(input:checked):hover {
|
|
143
|
+
background: var(--qz-option-checked-hover-bg);
|
|
144
|
+
}
|
|
145
|
+
.qz-option input {
|
|
146
|
+
flex: none;
|
|
147
|
+
width: 18px;
|
|
148
|
+
height: 18px;
|
|
149
|
+
margin: 0;
|
|
150
|
+
accent-color: var(--qz-accent);
|
|
151
|
+
}
|
|
152
|
+
/* 복수 선택 체크박스: 20px, 테두리 text.tertiary(흰 바탕 대비 3:1 이상), 고르면 primary 바탕에 흰 체크 */
|
|
153
|
+
.qz-option input[type='checkbox'] {
|
|
154
|
+
appearance: none;
|
|
155
|
+
width: 20px;
|
|
156
|
+
height: 20px;
|
|
157
|
+
padding: 0;
|
|
158
|
+
border: 2px solid var(--eds-text-tertiary);
|
|
159
|
+
border-radius: 4px;
|
|
160
|
+
background: var(--qz-surface) center / 14px 14px no-repeat;
|
|
161
|
+
cursor: inherit;
|
|
162
|
+
}
|
|
163
|
+
.qz-option input[type='checkbox']:checked {
|
|
164
|
+
border-color: var(--qz-accent);
|
|
165
|
+
background-color: var(--qz-accent);
|
|
166
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
|
167
|
+
}
|
|
168
|
+
.qz-option input[type='checkbox']:disabled:not(:checked) {
|
|
169
|
+
border-color: var(--eds-action-disabled);
|
|
170
|
+
}
|
|
171
|
+
.qz-option input[type='checkbox']:focus-visible {
|
|
172
|
+
outline: 2px solid var(--qz-accent);
|
|
173
|
+
outline-offset: 2px;
|
|
174
|
+
}
|
|
175
|
+
.qz-question:disabled .qz-option {
|
|
176
|
+
cursor: default;
|
|
177
|
+
}
|
|
178
|
+
.qz-question:disabled .qz-option:hover {
|
|
179
|
+
background: var(--qz-option-bg);
|
|
180
|
+
}
|
|
181
|
+
.qz-text {
|
|
182
|
+
min-height: 12rem;
|
|
183
|
+
resize: vertical;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Alert standard: success / error. 색만으로 구분하지 않게 ✓ · ✕ 기호를 함께 (기호는 화면 읽기에서 읽지 않음) */
|
|
187
|
+
.qz-result {
|
|
188
|
+
margin: 0;
|
|
189
|
+
padding: 8px 12px;
|
|
190
|
+
border-radius: var(--qz-radius);
|
|
191
|
+
font-weight: var(--eds-fw-bold);
|
|
192
|
+
}
|
|
193
|
+
.qz-result[data-result]::before {
|
|
194
|
+
margin-right: 6px;
|
|
195
|
+
}
|
|
196
|
+
.qz-result[data-result='correct']::before {
|
|
197
|
+
content: '✓';
|
|
198
|
+
content: '✓' / '';
|
|
199
|
+
}
|
|
200
|
+
.qz-result[data-result='wrong']::before {
|
|
201
|
+
content: '✕';
|
|
202
|
+
content: '✕' / '';
|
|
203
|
+
}
|
|
204
|
+
.qz-result[data-result='correct'] {
|
|
205
|
+
color: var(--qz-correct);
|
|
206
|
+
background: var(--qz-correct-bg);
|
|
207
|
+
}
|
|
208
|
+
.qz-result[data-result='wrong'] {
|
|
209
|
+
color: var(--qz-wrong);
|
|
210
|
+
background: var(--qz-wrong-bg);
|
|
211
|
+
}
|
|
212
|
+
/* Accordion */
|
|
213
|
+
.qz-explanation {
|
|
214
|
+
border-radius: var(--qz-radius);
|
|
215
|
+
padding: 12px 16px;
|
|
216
|
+
background: var(--eds-background-accordion);
|
|
217
|
+
}
|
|
218
|
+
.qz-explanation summary {
|
|
219
|
+
cursor: pointer;
|
|
220
|
+
font-weight: var(--eds-fw-bold);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* 끌어 놓기 공통 */
|
|
224
|
+
.qz-pool {
|
|
225
|
+
display: flex;
|
|
226
|
+
flex-wrap: wrap;
|
|
227
|
+
gap: var(--qz-list-gap);
|
|
228
|
+
min-height: var(--qz-slot-min-height);
|
|
229
|
+
padding: 12px;
|
|
230
|
+
border: 1px dashed var(--qz-border);
|
|
231
|
+
border-radius: var(--qz-radius-card);
|
|
232
|
+
background: var(--qz-surface-muted);
|
|
233
|
+
align-content: flex-start;
|
|
234
|
+
}
|
|
235
|
+
.qz-chip-option {
|
|
236
|
+
display: inline-flex;
|
|
237
|
+
align-items: center;
|
|
238
|
+
gap: 8px;
|
|
239
|
+
min-height: 40px;
|
|
240
|
+
padding: var(--qz-chip-padding);
|
|
241
|
+
border: 1px solid var(--qz-border);
|
|
242
|
+
border-radius: var(--qz-chip-radius);
|
|
243
|
+
background: var(--qz-surface);
|
|
244
|
+
color: var(--eds-text-primary);
|
|
245
|
+
font-weight: var(--eds-fw-medium);
|
|
246
|
+
cursor: grab;
|
|
247
|
+
touch-action: none;
|
|
248
|
+
user-select: none;
|
|
249
|
+
}
|
|
250
|
+
.qz-chip-option:hover {
|
|
251
|
+
background: var(--qz-hover);
|
|
252
|
+
}
|
|
253
|
+
.qz-chip-option.is-picked {
|
|
254
|
+
border-color: var(--qz-accent);
|
|
255
|
+
outline: 1px solid var(--qz-accent);
|
|
256
|
+
background: var(--qz-accent-soft);
|
|
257
|
+
}
|
|
258
|
+
.qz-chip-option[data-dragging] {
|
|
259
|
+
opacity: 0.38;
|
|
260
|
+
}
|
|
261
|
+
/* 그룹 분류 보기: 바깥(.qz-chip-option)이 보기 모양, 안에 고르기 버튼과 빼기 버튼이 형제로 있다 */
|
|
262
|
+
.qz-chip-group {
|
|
263
|
+
gap: 4px;
|
|
264
|
+
}
|
|
265
|
+
.qz-chip-group:has(.qz-chip-x) {
|
|
266
|
+
padding-right: 6px;
|
|
267
|
+
}
|
|
268
|
+
.qz-chip-pick {
|
|
269
|
+
min-height: 0;
|
|
270
|
+
padding: 0;
|
|
271
|
+
border: 0;
|
|
272
|
+
background: none;
|
|
273
|
+
color: inherit;
|
|
274
|
+
font: inherit;
|
|
275
|
+
white-space: normal;
|
|
276
|
+
text-align: left;
|
|
277
|
+
cursor: inherit;
|
|
278
|
+
}
|
|
279
|
+
.qz-chip-pick:hover {
|
|
280
|
+
background: none;
|
|
281
|
+
}
|
|
282
|
+
/* IconButton small: 28px 원, 아이콘 16px, 색 action.active, 마우스 올림 action.hover */
|
|
283
|
+
.qz-chip-x {
|
|
284
|
+
flex: none;
|
|
285
|
+
display: inline-grid;
|
|
286
|
+
place-items: center;
|
|
287
|
+
width: 28px;
|
|
288
|
+
height: 28px;
|
|
289
|
+
min-height: 28px;
|
|
290
|
+
padding: 0;
|
|
291
|
+
border: 0;
|
|
292
|
+
border-radius: 50%;
|
|
293
|
+
background: transparent;
|
|
294
|
+
color: var(--eds-action-active);
|
|
295
|
+
}
|
|
296
|
+
.qz-chip-x:hover {
|
|
297
|
+
background: var(--eds-action-hover);
|
|
298
|
+
}
|
|
299
|
+
/* 끄는 동안 손가락을 따라오는 복제본 (core/behaviors.js가 data-ghost를 붙임) */
|
|
300
|
+
[data-ghost] {
|
|
301
|
+
position: fixed;
|
|
302
|
+
z-index: 50;
|
|
303
|
+
pointer-events: none;
|
|
304
|
+
transform: translate(-50%, -50%);
|
|
305
|
+
box-shadow: var(--ec-shadow);
|
|
306
|
+
}
|
|
307
|
+
.qz-empty {
|
|
308
|
+
margin: 0;
|
|
309
|
+
color: var(--qz-text-muted);
|
|
310
|
+
font-size: var(--eds-fs-caption);
|
|
311
|
+
}
|
|
312
|
+
/* Button text small (답안 초기화): 13px / 600, 여백 4px 5px, 줄높이 22px, 모서리 8px, primary 글자 */
|
|
313
|
+
.qz-link {
|
|
314
|
+
min-height: 30px;
|
|
315
|
+
padding: 4px 5px;
|
|
316
|
+
border: 0;
|
|
317
|
+
border-radius: var(--qz-radius);
|
|
318
|
+
background: none;
|
|
319
|
+
color: var(--qz-accent);
|
|
320
|
+
font-size: 13px;
|
|
321
|
+
font-weight: var(--eds-fw-semibold);
|
|
322
|
+
line-height: 22px;
|
|
323
|
+
}
|
|
324
|
+
.qz-link:hover {
|
|
325
|
+
background: var(--eds-primary-opacity02);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/* 순서 맞추기 */
|
|
329
|
+
.qz-order {
|
|
330
|
+
display: grid;
|
|
331
|
+
grid-template-columns: 1fr auto 1fr;
|
|
332
|
+
gap: var(--qz-card-gap);
|
|
333
|
+
align-items: start;
|
|
334
|
+
}
|
|
335
|
+
.qz-order-arrow {
|
|
336
|
+
align-self: center;
|
|
337
|
+
color: var(--qz-text-muted);
|
|
338
|
+
font-size: 20px;
|
|
339
|
+
}
|
|
340
|
+
.qz-slots {
|
|
341
|
+
list-style: none;
|
|
342
|
+
margin: 0;
|
|
343
|
+
padding: 0;
|
|
344
|
+
display: flex;
|
|
345
|
+
flex-direction: column;
|
|
346
|
+
gap: var(--qz-list-gap);
|
|
347
|
+
}
|
|
348
|
+
.qz-slot {
|
|
349
|
+
display: flex;
|
|
350
|
+
align-items: center;
|
|
351
|
+
gap: 10px;
|
|
352
|
+
min-height: var(--qz-slot-min-height);
|
|
353
|
+
padding: 8px 12px;
|
|
354
|
+
border: 1px dashed var(--qz-border);
|
|
355
|
+
border-radius: var(--qz-radius-card);
|
|
356
|
+
background: var(--qz-surface);
|
|
357
|
+
}
|
|
358
|
+
.qz-slot-no {
|
|
359
|
+
flex: none;
|
|
360
|
+
width: 24px;
|
|
361
|
+
height: 24px;
|
|
362
|
+
border-radius: 50%;
|
|
363
|
+
background: var(--qz-accent-softer);
|
|
364
|
+
color: var(--qz-accent);
|
|
365
|
+
display: grid;
|
|
366
|
+
place-items: center;
|
|
367
|
+
font-size: 12px;
|
|
368
|
+
font-weight: var(--eds-fw-bold);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/* 그룹 분류 */
|
|
372
|
+
.qz-groups {
|
|
373
|
+
display: grid;
|
|
374
|
+
grid-template-columns: 1fr minmax(0, 1fr) 1fr;
|
|
375
|
+
gap: var(--qz-card-gap);
|
|
376
|
+
align-items: start;
|
|
377
|
+
}
|
|
378
|
+
.qz-group-col {
|
|
379
|
+
display: flex;
|
|
380
|
+
flex-direction: column;
|
|
381
|
+
gap: var(--qz-card-gap);
|
|
382
|
+
}
|
|
383
|
+
.qz-group {
|
|
384
|
+
border: 1px solid var(--qz-border);
|
|
385
|
+
border-radius: var(--qz-radius-card);
|
|
386
|
+
background: var(--qz-surface);
|
|
387
|
+
padding: 12px;
|
|
388
|
+
cursor: pointer;
|
|
389
|
+
}
|
|
390
|
+
.qz-group-name {
|
|
391
|
+
margin: 0 0 8px;
|
|
392
|
+
font-size: var(--eds-fs-body2);
|
|
393
|
+
font-weight: var(--eds-fw-bold);
|
|
394
|
+
}
|
|
395
|
+
.qz-group-items {
|
|
396
|
+
display: flex;
|
|
397
|
+
flex-wrap: wrap;
|
|
398
|
+
gap: var(--qz-list-gap);
|
|
399
|
+
min-height: 44px;
|
|
400
|
+
}
|
|
401
|
+
.qz-pool-head {
|
|
402
|
+
display: flex;
|
|
403
|
+
justify-content: space-between;
|
|
404
|
+
align-items: center;
|
|
405
|
+
font-size: var(--eds-fs-caption);
|
|
406
|
+
font-weight: var(--eds-fw-bold);
|
|
407
|
+
margin-bottom: 6px;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
@media (max-width: 767.98px) {
|
|
411
|
+
.qz-order {
|
|
412
|
+
grid-template-columns: 1fr;
|
|
413
|
+
}
|
|
414
|
+
.qz-order-arrow {
|
|
415
|
+
transform: rotate(90deg);
|
|
416
|
+
justify-self: center;
|
|
417
|
+
}
|
|
418
|
+
.qz-groups {
|
|
419
|
+
grid-template-columns: 1fr;
|
|
420
|
+
}
|
|
421
|
+
.qz-group-pool {
|
|
422
|
+
order: -1;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/* ---------- 편집 ---------- */
|
|
427
|
+
.qe-card {
|
|
428
|
+
display: flex;
|
|
429
|
+
flex-direction: column;
|
|
430
|
+
gap: 16px;
|
|
431
|
+
padding: var(--qz-card-padding);
|
|
432
|
+
border: 1px solid var(--qz-border);
|
|
433
|
+
border-radius: var(--qz-radius-card);
|
|
434
|
+
background: var(--qz-surface);
|
|
435
|
+
}
|
|
436
|
+
.qe-card-head {
|
|
437
|
+
display: flex;
|
|
438
|
+
flex-wrap: wrap;
|
|
439
|
+
align-items: center;
|
|
440
|
+
gap: 8px;
|
|
441
|
+
font-size: var(--eds-fs-subtitle2);
|
|
442
|
+
font-weight: var(--eds-fw-extrabold);
|
|
443
|
+
}
|
|
444
|
+
.qe-type {
|
|
445
|
+
width: auto;
|
|
446
|
+
margin-right: auto;
|
|
447
|
+
font-size: var(--eds-fs-body2);
|
|
448
|
+
}
|
|
449
|
+
.qe-field {
|
|
450
|
+
display: flex;
|
|
451
|
+
flex-direction: column;
|
|
452
|
+
gap: 6px;
|
|
453
|
+
}
|
|
454
|
+
.qe-label {
|
|
455
|
+
font-weight: var(--eds-fw-bold);
|
|
456
|
+
display: flex;
|
|
457
|
+
align-items: center;
|
|
458
|
+
gap: 8px;
|
|
459
|
+
}
|
|
460
|
+
.qe-required {
|
|
461
|
+
color: var(--eds-error-main);
|
|
462
|
+
}
|
|
463
|
+
.qe-optional,
|
|
464
|
+
.qe-hint,
|
|
465
|
+
.qe-count {
|
|
466
|
+
color: var(--eds-text-secondary);
|
|
467
|
+
font-weight: var(--eds-fw-medium);
|
|
468
|
+
font-size: var(--eds-fs-caption);
|
|
469
|
+
}
|
|
470
|
+
.qe-count {
|
|
471
|
+
align-self: flex-end;
|
|
472
|
+
}
|
|
473
|
+
.qe-number {
|
|
474
|
+
width: 120px;
|
|
475
|
+
}
|
|
476
|
+
.qe-section {
|
|
477
|
+
display: flex;
|
|
478
|
+
flex-direction: column;
|
|
479
|
+
gap: 8px;
|
|
480
|
+
}
|
|
481
|
+
.qe-options {
|
|
482
|
+
display: flex;
|
|
483
|
+
flex-direction: column;
|
|
484
|
+
gap: var(--qz-list-gap);
|
|
485
|
+
}
|
|
486
|
+
.qe-option {
|
|
487
|
+
display: flex;
|
|
488
|
+
align-items: center;
|
|
489
|
+
gap: 6px;
|
|
490
|
+
border-radius: var(--eds-radius);
|
|
491
|
+
transition: transform 150ms ease-in-out;
|
|
492
|
+
}
|
|
493
|
+
/* 끄는 줄은 손가락을 바로 따라오고(전환 없음) 위에 뜬다 */
|
|
494
|
+
.qe-option[data-dragging] {
|
|
495
|
+
position: relative;
|
|
496
|
+
z-index: 1;
|
|
497
|
+
transition: none;
|
|
498
|
+
background: var(--eds-background-paper);
|
|
499
|
+
box-shadow: var(--ec-shadow);
|
|
500
|
+
}
|
|
501
|
+
/* 끌기 손잡이: 터치에서 화면이 스크롤되지 않게 touch-action: none */
|
|
502
|
+
.qe-handle {
|
|
503
|
+
flex: none;
|
|
504
|
+
width: 32px;
|
|
505
|
+
min-height: 40px;
|
|
506
|
+
padding: 0;
|
|
507
|
+
border: 0;
|
|
508
|
+
background: none;
|
|
509
|
+
color: var(--qz-text-muted);
|
|
510
|
+
font-size: 18px;
|
|
511
|
+
cursor: grab;
|
|
512
|
+
touch-action: none;
|
|
513
|
+
}
|
|
514
|
+
.qe-handle:hover {
|
|
515
|
+
background: var(--qz-hover);
|
|
516
|
+
color: var(--eds-text-secondary);
|
|
517
|
+
}
|
|
518
|
+
.qe-option[data-dragging] .qe-handle {
|
|
519
|
+
cursor: grabbing;
|
|
520
|
+
}
|
|
521
|
+
.qe-option-no {
|
|
522
|
+
flex: none;
|
|
523
|
+
width: 24px;
|
|
524
|
+
text-align: center;
|
|
525
|
+
color: var(--qz-text-muted);
|
|
526
|
+
font-weight: var(--eds-fw-bold);
|
|
527
|
+
}
|
|
528
|
+
/* IconButton outlined */
|
|
529
|
+
.qe-icon {
|
|
530
|
+
flex: none;
|
|
531
|
+
width: 40px;
|
|
532
|
+
min-height: 40px;
|
|
533
|
+
padding: 0;
|
|
534
|
+
border-color: var(--qz-border);
|
|
535
|
+
color: var(--eds-text-secondary);
|
|
536
|
+
}
|
|
537
|
+
.qe-icon:hover {
|
|
538
|
+
background: var(--qz-hover);
|
|
539
|
+
}
|
|
540
|
+
.qe-add {
|
|
541
|
+
align-self: flex-start;
|
|
542
|
+
border-style: dashed;
|
|
543
|
+
}
|
|
544
|
+
.qe-add-question {
|
|
545
|
+
align-self: stretch;
|
|
546
|
+
}
|
|
547
|
+
.qe-switch {
|
|
548
|
+
display: flex;
|
|
549
|
+
align-items: center;
|
|
550
|
+
gap: 8px;
|
|
551
|
+
}
|
|
552
|
+
.qe-switch input {
|
|
553
|
+
width: 18px;
|
|
554
|
+
height: 18px;
|
|
555
|
+
accent-color: var(--qz-accent);
|
|
556
|
+
}
|
|
557
|
+
.qe-link {
|
|
558
|
+
min-height: 0;
|
|
559
|
+
padding: 0 4px;
|
|
560
|
+
border: 0;
|
|
561
|
+
background: none;
|
|
562
|
+
color: var(--qz-accent);
|
|
563
|
+
font-size: var(--eds-fs-caption);
|
|
564
|
+
font-weight: var(--eds-fw-medium);
|
|
565
|
+
}
|
|
566
|
+
.qe-preview {
|
|
567
|
+
padding: 12px 16px;
|
|
568
|
+
border: 1px dashed var(--qz-border);
|
|
569
|
+
border-radius: var(--eds-radius);
|
|
570
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// 객관식 (단일 · 복수 선택) 보기 목록. 보기 카드 모양은 여기와 styles.css의 .qz-option을 고치면 됩니다.
|
|
2
|
+
// 꼭 남길 것: 보기마다 <input data-role="choice" value="보기 id"> (radio · checkbox)
|
|
3
|
+
import { html } from '../../core/dom.js';
|
|
4
|
+
|
|
5
|
+
/** @param {{ q: object, options: object[], multiple: boolean }} props options: 화면 순서(섞였으면 섞인 순서) */
|
|
6
|
+
export const choice = ({ q, options, multiple }) => html`
|
|
7
|
+
<div class="qz-options" role="${multiple ? 'group' : 'radiogroup'}">
|
|
8
|
+
${options.map(
|
|
9
|
+
(o) => html`
|
|
10
|
+
<label class="qz-option">
|
|
11
|
+
<input
|
|
12
|
+
type="${multiple ? 'checkbox' : 'radio'}"
|
|
13
|
+
name="${q.id}"
|
|
14
|
+
value="${o.id}"
|
|
15
|
+
data-role="choice"
|
|
16
|
+
/>
|
|
17
|
+
<span class="qz-option-text">${o.text}</span>
|
|
18
|
+
</label>
|
|
19
|
+
`,
|
|
20
|
+
)}
|
|
21
|
+
</div>
|
|
22
|
+
`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// ui/templates/edit.js 타입 (테스트용). 각 조각이 남겨야 할 data-role은 edit.js에 적혀 있습니다.
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
type Template = (props?: any) => any;
|
|
4
|
+
|
|
5
|
+
export declare const field: Template;
|
|
6
|
+
export declare const numberField: Template;
|
|
7
|
+
export declare const toggle: Template;
|
|
8
|
+
export declare const section: Template;
|
|
9
|
+
export declare const list: Template;
|
|
10
|
+
export declare const row: Template;
|
|
11
|
+
export declare const addButton: Template;
|
|
12
|
+
export declare const card: Template;
|
|
13
|
+
export declare const addQuestion: Template;
|