@eliceio/cdk-cli 0.0.0-stage → 0.1.0-alpha.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/README.md +511 -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 +171 -0
- package/es/commands/build/index.d.ts +27 -0
- package/es/commands/build/index.js +154 -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 +33 -0
- package/es/commands/doctor/index.js +230 -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/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 +24 -0
- package/es/dev/server.js +294 -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 +209 -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 +138 -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 +1 -0
- package/es/version.js +3 -0
- package/package.json +48 -3
- package/rules.json +555 -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 +252 -0
- package/templates/_shared/lib/elice-content.d.ts +121 -0
- package/templates/_shared/lib/elice-content.js +541 -0
- package/templates/_shared/lib/elice-tokens.css +446 -0
- package/templates/blank/README.md +64 -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/content.json +81 -0
- package/templates/quiz/core/behaviors.d.ts +59 -0
- package/templates/quiz/core/behaviors.js +309 -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 +50 -0
- package/templates/quiz/styles.css +510 -0
- package/templates/quiz/ui/templates/choice.js +22 -0
- package/templates/quiz/ui/templates/edit.d.ts +14 -0
- package/templates/quiz/ui/templates/edit.js +187 -0
- package/templates/quiz/ui/templates/group.js +47 -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 +128 -0
- package/templates/quiz/ui/theme.css +50 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/* Elice Content 기본 스타일 · 템플릿이 제공 (고치지 말고 styles.css에서 덮어쓰세요)
|
|
2
|
+
색 · 글꼴 · 크기는 Elice Design System 토큰(lib/elice-tokens.css)을 씁니다.
|
|
3
|
+
컴포넌트 값은 EDS 명세(specs/components)를 따릅니다: Button · OutlinedInput · Tag · Alert */
|
|
4
|
+
:root {
|
|
5
|
+
--ec-bg: var(--eds-background-default);
|
|
6
|
+
--ec-surface: var(--eds-background-neutral);
|
|
7
|
+
--ec-fg: var(--eds-text-primary);
|
|
8
|
+
--ec-muted: var(--eds-text-secondary);
|
|
9
|
+
--ec-line: var(--eds-divider);
|
|
10
|
+
--ec-border: var(--eds-surface-border);
|
|
11
|
+
--ec-accent: var(--eds-primary-main);
|
|
12
|
+
--ec-accent-dark: var(--eds-primary-dark);
|
|
13
|
+
--ec-accent-bg: var(--eds-primary-opacity02);
|
|
14
|
+
--ec-ok: var(--eds-success-main);
|
|
15
|
+
--ec-ok-bg: var(--eds-success-background);
|
|
16
|
+
--ec-no: var(--eds-error-main);
|
|
17
|
+
--ec-no-bg: var(--eds-error-background);
|
|
18
|
+
--ec-warn-bg: var(--eds-warning-background);
|
|
19
|
+
--ec-info: var(--eds-info-dark);
|
|
20
|
+
--ec-info-bg: var(--eds-info-background);
|
|
21
|
+
--ec-radius: var(--eds-radius);
|
|
22
|
+
/* 떠 있는 요소(끄는 보기 등). 그림자는 두 테마 모두 검정 */
|
|
23
|
+
--ec-shadow: 0 8px 24px rgb(0 0 0 / 0.16);
|
|
24
|
+
font-family: var(--eds-font-family);
|
|
25
|
+
font-size: var(--eds-fs-body2);
|
|
26
|
+
font-weight: var(--eds-fw-medium);
|
|
27
|
+
color: var(--ec-fg);
|
|
28
|
+
background: var(--ec-bg);
|
|
29
|
+
}
|
|
30
|
+
/* 어두운 테마(<html data-eds-theme="dark">, ecdk create --theme dark): 색은 elice-tokens.css가 바꾸고,
|
|
31
|
+
여기서는 체크박스 · 선택 상자 · 스크롤바 같은 브라우저 기본 요소도 어둡게 */
|
|
32
|
+
:root[data-eds-theme='dark'] {
|
|
33
|
+
color-scheme: dark;
|
|
34
|
+
--ec-shadow: 0 8px 24px rgb(0 0 0 / 0.48);
|
|
35
|
+
}
|
|
36
|
+
* {
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
}
|
|
39
|
+
body {
|
|
40
|
+
margin: 0;
|
|
41
|
+
padding: 24px 16px 96px;
|
|
42
|
+
line-height: var(--eds-lh-body2);
|
|
43
|
+
}
|
|
44
|
+
main {
|
|
45
|
+
max-width: 720px;
|
|
46
|
+
margin: 0 auto;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
gap: 20px;
|
|
50
|
+
}
|
|
51
|
+
/* EDS h6: 24px / 800 / 1.3 / -1% */
|
|
52
|
+
h1 {
|
|
53
|
+
font-size: var(--eds-fs-h6);
|
|
54
|
+
line-height: var(--eds-lh-h6);
|
|
55
|
+
font-weight: var(--eds-fw-extrabold);
|
|
56
|
+
letter-spacing: -0.01em;
|
|
57
|
+
margin: 0;
|
|
58
|
+
}
|
|
59
|
+
p {
|
|
60
|
+
margin: 0;
|
|
61
|
+
}
|
|
62
|
+
.ec-muted {
|
|
63
|
+
color: var(--ec-muted);
|
|
64
|
+
font-size: var(--eds-fs-body2);
|
|
65
|
+
}
|
|
66
|
+
.ec-card {
|
|
67
|
+
border: 1px solid var(--ec-border);
|
|
68
|
+
border-radius: var(--ec-radius);
|
|
69
|
+
padding: 16px;
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
gap: 10px;
|
|
73
|
+
}
|
|
74
|
+
/* EDS Tag (muted · primary · medium): 높이 24px, 모서리 6px, 11px / 700 */
|
|
75
|
+
.ec-badge {
|
|
76
|
+
align-self: flex-start;
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
height: 24px;
|
|
80
|
+
padding: 0 6px;
|
|
81
|
+
border-radius: 6px;
|
|
82
|
+
font-size: 11px;
|
|
83
|
+
font-weight: var(--eds-fw-bold);
|
|
84
|
+
background: var(--ec-accent-bg);
|
|
85
|
+
color: var(--ec-accent);
|
|
86
|
+
}
|
|
87
|
+
/* EDS OutlinedInput: 배경 background.input, 테두리 surface.border, small 여백 8px 12px.
|
|
88
|
+
모바일 규칙(디자인 제작 가이드 "4. 모바일"): 입력 글자 16px */
|
|
89
|
+
input,
|
|
90
|
+
textarea,
|
|
91
|
+
select {
|
|
92
|
+
font: inherit;
|
|
93
|
+
font-size: 16px;
|
|
94
|
+
padding: 8px 12px;
|
|
95
|
+
border: 1px solid var(--ec-border);
|
|
96
|
+
border-radius: var(--ec-radius);
|
|
97
|
+
background: var(--eds-background-input);
|
|
98
|
+
color: var(--ec-fg);
|
|
99
|
+
width: 100%;
|
|
100
|
+
}
|
|
101
|
+
/* 선택 상자: 브라우저 기본 화살표는 테두리에 붙어 보여서, 오른쪽에서 12px 띄운 화살표를 직접 그린다 (EDS Select).
|
|
102
|
+
두 삼각형 그라데이션으로 그려 글자색 토큰을 따르므로 어두운 테마에서도 보인다 */
|
|
103
|
+
select {
|
|
104
|
+
appearance: none;
|
|
105
|
+
padding-right: 36px;
|
|
106
|
+
background-image:
|
|
107
|
+
linear-gradient(45deg, transparent 50%, var(--eds-text-secondary) 50%),
|
|
108
|
+
linear-gradient(135deg, var(--eds-text-secondary) 50%, transparent 50%);
|
|
109
|
+
background-position:
|
|
110
|
+
right 17px center,
|
|
111
|
+
right 12px center;
|
|
112
|
+
background-size: 5px 5px;
|
|
113
|
+
background-repeat: no-repeat;
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
}
|
|
116
|
+
input:focus,
|
|
117
|
+
textarea:focus,
|
|
118
|
+
select:focus {
|
|
119
|
+
outline: 2px solid var(--ec-accent);
|
|
120
|
+
outline-offset: -1px;
|
|
121
|
+
}
|
|
122
|
+
/* EDS Button medium: 14px / 600, 여백 8px 16px, 줄높이 24px, 모서리 8px, 대문자 변환 없음.
|
|
123
|
+
기본은 outlined(primary), .ec-primary는 contained. 누르는 영역 44px 이상(모바일 규칙) */
|
|
124
|
+
button {
|
|
125
|
+
font: inherit;
|
|
126
|
+
font-size: 14px;
|
|
127
|
+
font-weight: var(--eds-fw-semibold);
|
|
128
|
+
line-height: 24px;
|
|
129
|
+
min-height: 44px;
|
|
130
|
+
padding: 7px 15px;
|
|
131
|
+
border-radius: var(--ec-radius);
|
|
132
|
+
border: 1px solid var(--ec-accent);
|
|
133
|
+
background: transparent;
|
|
134
|
+
color: var(--ec-accent);
|
|
135
|
+
white-space: nowrap;
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
transition: background-color 150ms ease-in-out;
|
|
138
|
+
}
|
|
139
|
+
button:hover {
|
|
140
|
+
background: var(--eds-primary-opacity01);
|
|
141
|
+
}
|
|
142
|
+
button.ec-primary {
|
|
143
|
+
padding: 8px 16px;
|
|
144
|
+
border: 0;
|
|
145
|
+
background: var(--ec-accent);
|
|
146
|
+
color: var(--eds-primary-contrast-text);
|
|
147
|
+
}
|
|
148
|
+
button.ec-primary:hover {
|
|
149
|
+
background: var(--ec-accent-dark);
|
|
150
|
+
}
|
|
151
|
+
button:disabled {
|
|
152
|
+
border-color: var(--eds-action-disabled-background);
|
|
153
|
+
background: var(--eds-action-disabled-background);
|
|
154
|
+
color: var(--eds-action-disabled);
|
|
155
|
+
cursor: not-allowed;
|
|
156
|
+
}
|
|
157
|
+
.ec-option {
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
gap: 10px;
|
|
161
|
+
min-height: 44px;
|
|
162
|
+
padding: 8px 12px;
|
|
163
|
+
border: 1px solid var(--ec-border);
|
|
164
|
+
border-radius: var(--ec-radius);
|
|
165
|
+
}
|
|
166
|
+
.ec-option input {
|
|
167
|
+
width: auto;
|
|
168
|
+
}
|
|
169
|
+
.ec-row {
|
|
170
|
+
display: flex;
|
|
171
|
+
gap: 8px;
|
|
172
|
+
align-items: center;
|
|
173
|
+
flex-wrap: wrap;
|
|
174
|
+
}
|
|
175
|
+
.ec-col {
|
|
176
|
+
display: flex;
|
|
177
|
+
flex-direction: column;
|
|
178
|
+
gap: 12px;
|
|
179
|
+
}
|
|
180
|
+
/* EDS Alert(standard) 색: success · error · info background */
|
|
181
|
+
.ec-result {
|
|
182
|
+
padding: 12px 16px;
|
|
183
|
+
border-radius: var(--ec-radius);
|
|
184
|
+
background: var(--ec-info-bg);
|
|
185
|
+
color: var(--ec-info);
|
|
186
|
+
font-weight: var(--eds-fw-semibold);
|
|
187
|
+
}
|
|
188
|
+
.ec-result.ok {
|
|
189
|
+
background: var(--ec-ok-bg);
|
|
190
|
+
color: var(--ec-ok);
|
|
191
|
+
}
|
|
192
|
+
.ec-result.no {
|
|
193
|
+
background: var(--ec-no-bg);
|
|
194
|
+
color: var(--ec-no);
|
|
195
|
+
}
|
|
196
|
+
.ec-error {
|
|
197
|
+
color: var(--ec-no);
|
|
198
|
+
font-size: var(--eds-fs-body2);
|
|
199
|
+
}
|
|
200
|
+
/* 제출 바: 모바일에서 화면 아래 고정, EDS Button large(48px, 모서리 10px) */
|
|
201
|
+
.ec-submitbar {
|
|
202
|
+
position: sticky;
|
|
203
|
+
bottom: 0;
|
|
204
|
+
background: var(--ec-bg);
|
|
205
|
+
padding: 12px 0;
|
|
206
|
+
border-top: 1px solid var(--ec-line);
|
|
207
|
+
display: flex;
|
|
208
|
+
gap: 12px;
|
|
209
|
+
align-items: center;
|
|
210
|
+
justify-content: flex-end;
|
|
211
|
+
}
|
|
212
|
+
@media (max-width: 511.98px) {
|
|
213
|
+
.ec-submitbar button {
|
|
214
|
+
flex: 1;
|
|
215
|
+
height: 48px;
|
|
216
|
+
font-size: 15px;
|
|
217
|
+
font-weight: var(--eds-fw-bold);
|
|
218
|
+
border-radius: 10px;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
#elice-banner {
|
|
222
|
+
position: sticky;
|
|
223
|
+
top: 0;
|
|
224
|
+
z-index: 10;
|
|
225
|
+
background: var(--ec-warn-bg);
|
|
226
|
+
color: var(--eds-warning-dark);
|
|
227
|
+
padding: 10px 16px;
|
|
228
|
+
margin: -24px -16px 16px;
|
|
229
|
+
font-size: var(--eds-fs-body2);
|
|
230
|
+
}
|
|
231
|
+
#elice-status {
|
|
232
|
+
position: sticky;
|
|
233
|
+
top: 0;
|
|
234
|
+
z-index: 9;
|
|
235
|
+
background: var(--ec-accent-bg);
|
|
236
|
+
color: var(--ec-accent);
|
|
237
|
+
padding: 8px 16px;
|
|
238
|
+
margin: -24px -16px 16px;
|
|
239
|
+
font-size: var(--eds-fs-caption);
|
|
240
|
+
font-weight: var(--eds-fw-semibold);
|
|
241
|
+
}
|
|
242
|
+
[aria-readonly='true'] {
|
|
243
|
+
opacity: 0.85;
|
|
244
|
+
}
|
|
245
|
+
.ec-submitbar,
|
|
246
|
+
.ec-result {
|
|
247
|
+
max-width: 720px;
|
|
248
|
+
margin-inline: auto;
|
|
249
|
+
}
|
|
250
|
+
[hidden] {
|
|
251
|
+
display: none !important;
|
|
252
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// 편집기 자동완성용 타입. lib/elice-content.js와 같이 고치지 않습니다.
|
|
2
|
+
|
|
3
|
+
export type Screen = 'learn' | 'instructor' | 'edit';
|
|
4
|
+
export type Scope = 'learn' | 'edit';
|
|
5
|
+
export type Viewer = 'student' | 'instructor' | 'tutor';
|
|
6
|
+
|
|
7
|
+
export declare class ContentError extends Error {
|
|
8
|
+
code: string;
|
|
9
|
+
constructor(code: string, message: string, cause?: unknown);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export declare const LOCAL_MATERIAL_PATH: string;
|
|
13
|
+
|
|
14
|
+
export declare function pickSdk(where: {
|
|
15
|
+
hash: string;
|
|
16
|
+
pathname: string;
|
|
17
|
+
search: string;
|
|
18
|
+
/** 로컬(localhost · 127.0.0.1)이면 자료 주소라도 토큰 없이 mock */
|
|
19
|
+
hostname?: string;
|
|
20
|
+
}): 'real' | 'mock';
|
|
21
|
+
|
|
22
|
+
export declare function resolveLaunch(
|
|
23
|
+
hash: string,
|
|
24
|
+
pathname: string,
|
|
25
|
+
screen: Screen,
|
|
26
|
+
): { hash: string; pathname: string; local: boolean };
|
|
27
|
+
|
|
28
|
+
/** 서버 채점 결과. 점수 없는 채점(manual · none)이면 둘 다 null */
|
|
29
|
+
export interface SubmitResult {
|
|
30
|
+
isCorrect: boolean | null;
|
|
31
|
+
score: number | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Navigation {
|
|
35
|
+
previous(): void;
|
|
36
|
+
next(): void;
|
|
37
|
+
navigate(lecturePageId: number): void;
|
|
38
|
+
getHasPrevious(): Promise<boolean>;
|
|
39
|
+
getHasNext(): Promise<boolean>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface SubmitOptions<A = unknown> {
|
|
43
|
+
getAnswer: () => A;
|
|
44
|
+
setAnswer?: (answer: A) => void;
|
|
45
|
+
validate?: (answer: A) => true | string | false;
|
|
46
|
+
/** 채점 결과 (제출 직후 · 다시 열었을 때) */
|
|
47
|
+
onResult?: (result: SubmitResult & { answer?: A }, info: { restored: boolean }) => void;
|
|
48
|
+
root?: Element;
|
|
49
|
+
label?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface SaveOptions<C> {
|
|
53
|
+
getContent: () => C;
|
|
54
|
+
validate?: (content: C) => true | string | false;
|
|
55
|
+
root?: Element;
|
|
56
|
+
label?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export declare function statusText(app: ContentApp): string;
|
|
60
|
+
|
|
61
|
+
export interface ContentApp<C = Record<string, unknown>> {
|
|
62
|
+
screen: Screen;
|
|
63
|
+
scope: Scope;
|
|
64
|
+
viewer: Viewer;
|
|
65
|
+
readOnly: boolean;
|
|
66
|
+
isDraft: boolean;
|
|
67
|
+
navigation: Navigation | null;
|
|
68
|
+
isLocal: boolean;
|
|
69
|
+
sdkKind: 'real' | 'mock' | 'custom';
|
|
70
|
+
account: { anonymousId: string; fullname: string | null } | null;
|
|
71
|
+
result: { score: number | null; submitCount: number; completedAt: string | null } | null;
|
|
72
|
+
readonly records: boolean;
|
|
73
|
+
readonly content: C;
|
|
74
|
+
submit(answer: unknown): Promise<SubmitResult>;
|
|
75
|
+
lastAnswer(): Promise<unknown>;
|
|
76
|
+
lastSubmission(): Promise<
|
|
77
|
+
(SubmitResult & { id: string; answer: unknown; createdAt: string }) | null
|
|
78
|
+
>;
|
|
79
|
+
saveContent(content: C): Promise<void>;
|
|
80
|
+
/** 학생 화면 제출 영역 (보는 사람별 처리는 키트가) */
|
|
81
|
+
useSubmit<A = unknown>(
|
|
82
|
+
options: SubmitOptions<A>,
|
|
83
|
+
): { element: Element; result: Element; restored: Promise<void> };
|
|
84
|
+
/** 편집 화면 저장 영역 */
|
|
85
|
+
useSave(options: SaveOptions<C>): {
|
|
86
|
+
element: Element;
|
|
87
|
+
markDirty(): void;
|
|
88
|
+
readonly dirty: boolean;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface StartOptions {
|
|
93
|
+
screen: Screen;
|
|
94
|
+
defaults?: string;
|
|
95
|
+
onError?: (error: ContentError) => void;
|
|
96
|
+
sdk?: 'real' | 'mock' | object;
|
|
97
|
+
mock?: {
|
|
98
|
+
scenario?:
|
|
99
|
+
| 'session_expired'
|
|
100
|
+
| 'rate_limited'
|
|
101
|
+
| 'request_failed'
|
|
102
|
+
| 'external_service_error'
|
|
103
|
+
| 'slow'
|
|
104
|
+
| 'content_not_ready'
|
|
105
|
+
| 'unauthorized';
|
|
106
|
+
grading?: unknown;
|
|
107
|
+
settings?: Record<string, unknown>;
|
|
108
|
+
delayMs?: number;
|
|
109
|
+
};
|
|
110
|
+
loadJson?: (url: string) => Promise<unknown>;
|
|
111
|
+
hash?: string;
|
|
112
|
+
pathname?: string;
|
|
113
|
+
search?: string;
|
|
114
|
+
/** 테스트용: location.hostname 대신 */
|
|
115
|
+
hostname?: string;
|
|
116
|
+
status?: boolean;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export declare function start<C = Record<string, unknown>>(
|
|
120
|
+
options: StartOptions,
|
|
121
|
+
): Promise<ContentApp<C>>;
|