@eliceio/cdk-cli 1.7.1-entryqa.1 → 1.7.2-sharedqa.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.
@@ -6,9 +6,18 @@
6
6
  // 카드는 한 보드의 글(post)이고 data에 섹션 · 색 · 링크를 넣습니다 (core/model.js). 저마다 자기 카드만 지웁니다.
7
7
  // 카드에는 쓴 사람 이름 · 시각을 보이지 않습니다 (교육자 화면도). 맨 위 제목(선택)에 학생이 원하면 이름 · 날짜를 직접 씁니다.
8
8
  // 승인 · 숨김 · 고정 · 닫기 · 1인당 카드 수는 화면에서만 지킵니다: 카드 내용은 모두의 브라우저에 내려갑니다.
9
+ // 파일(그림 · PDF)은 SDK 공유 파일(sdk.sharedFiles)로 올리고 카드에는 key만 둡니다 (core/files.js). 내 카드를 지우면 파일도
10
+ // 지우고(실패해도 진행), 교육자 메뉴의 '파일 삭제'는 파일을 지운 뒤 모두에게 '삭제된 파일'로 보이게 표시합니다.
11
+ // 편집기 미리보기 · 튜터 · 설정에서 끈 보드는 파일 올리기를 숨깁니다.
9
12
  import { showSnackbar } from '../lib/elice-content.js';
10
13
  import { createBoard } from '../core/board.js';
11
14
  import { html, part } from '../core/dom.js';
15
+ import {
16
+ createFileUrls,
17
+ fileValue,
18
+ uploadErrorKind,
19
+ uploadsAvailable,
20
+ } from '../core/files.js';
12
21
  import { canAdd, cardsByColumn, errorKind } from '../core/model.js';
13
22
  import { DEFAULT_POST_LIMIT, normalizeSettings } from '../core/settings.js';
14
23
  import { cardView, confirmTwice } from '../ui/card.js';
@@ -21,6 +30,8 @@ import { texts } from '../ui/texts.js';
21
30
  const t = texts.board;
22
31
  const m = texts.menu;
23
32
  const errText = err => texts.errors[errorKind(err)] ?? texts.errors.failed;
33
+ const uploadErrText = err =>
34
+ texts.composer.fileErrors[uploadErrorKind(err)] ?? texts.composer.fileErrors.failed;
24
35
 
25
36
  /**
26
37
  * @param {any} app start()가 준 화면 (lib/elice-content.js)
@@ -80,10 +91,19 @@ export async function mountBoard(app, { moderate }) {
80
91
  );
81
92
  };
82
93
  const fail = err => showSnackbar({ text: errText(err) });
94
+ const sdk = app.sdk;
95
+ const fileUrls = createFileUrls(sdk);
96
+ const uploadsOn = () => uploadsAvailable(sdk, settings, app.readOnly);
83
97
 
84
98
  const composer = createComposer({
85
99
  columns: () => columns,
86
100
  placeholder: () => settings.bodyPlaceholder,
101
+ upload: {
102
+ enabled: uploadsOn,
103
+ send: async (file, onProgress) => fileValue(await sdk.sharedFiles.post(file, { onProgress }), file),
104
+ discard: file => void sdk.sharedFiles.delete(file.key).catch(() => undefined),
105
+ errorText: uploadErrText,
106
+ },
87
107
  onSubmit: async value => {
88
108
  const blocked = addBlocked();
89
109
  if (blocked) return blocked;
@@ -171,6 +191,9 @@ export async function mountBoard(app, { moderate }) {
171
191
  pending: post.status === 'pending',
172
192
  hidden: post.status === 'hidden',
173
193
  pinned: post.pinned,
194
+ file: card.file ?? null,
195
+ fileDeleted: post.fileDeleted === true,
196
+ fileUrls,
174
197
  canDelete: mine && !app.readOnly,
175
198
  menu: showMenu && !app.readOnly,
176
199
  heart: settings.reactions
@@ -207,6 +230,24 @@ export async function mountBoard(app, { moderate }) {
207
230
  } catch (err) {
208
231
  fail(err);
209
232
  if (x) x.disabled = false;
233
+ return;
234
+ }
235
+ // 카드를 지웠으면 파일도 지운다 (서버는 kv를 모름). 실패해도 카드는 지워진 채로 둔다
236
+ const key = fileKeyOf(post);
237
+ if (key) await sdk.sharedFiles?.delete(key).catch(() => undefined);
238
+ }
239
+
240
+ /** 교육자: 파일만 지우고 모두에게 '삭제된 파일'로 보이게 표시 */
241
+ async function removeFile(post) {
242
+ const key = fileKeyOf(post);
243
+ if (!key) return;
244
+ try {
245
+ await sdk.sharedFiles.delete(key);
246
+ fileUrls.forget(key);
247
+ await board.markFileDeleted({ id: post.id });
248
+ say(m.fileDeletedDone);
249
+ } catch (err) {
250
+ fail(err);
210
251
  }
211
252
  }
212
253
 
@@ -221,6 +262,15 @@ export async function mountBoard(app, { moderate }) {
221
262
  post.pinned
222
263
  ? { act: 'unpin', icon: 'pin', label: m.unpin }
223
264
  : { act: 'pin', icon: 'pin', label: m.pin },
265
+ fileKeyOf(post) &&
266
+ !post.fileDeleted &&
267
+ typeof sdk.sharedFiles?.delete === 'function' && {
268
+ act: 'deleteFile',
269
+ icon: 'file',
270
+ label: m.deleteFile,
271
+ hint: m.deleteFileHint,
272
+ danger: true,
273
+ },
224
274
  ...(mine ? ['sep', { act: 'delete', icon: 'trash', label: m.delete, danger: true }] : []),
225
275
  ].filter(Boolean);
226
276
  openMenu(
@@ -228,6 +278,7 @@ export async function mountBoard(app, { moderate }) {
228
278
  items,
229
279
  async act => {
230
280
  if (act === 'delete') return removeCard(post, null);
281
+ if (act === 'deleteFile') return removeFile(post);
231
282
  const done = {
232
283
  approve: m.approved,
233
284
  hide: m.hiddenDone,
@@ -298,6 +349,7 @@ export async function mountBoard(app, { moderate }) {
298
349
  open: pre => composer.open(pre),
299
350
  columnAt: (x, y) => columnAtX(boardEl, x, y),
300
351
  notify: text => showSnackbar({ text }),
352
+ files: uploadsOn,
301
353
  });
302
354
 
303
355
  board.subscribe(next => {
@@ -307,6 +359,12 @@ export async function mountBoard(app, { moderate }) {
307
359
  render();
308
360
  }
309
361
 
362
+ /** 카드에 붙인 파일의 key (없으면 null) */
363
+ function fileKeyOf(post) {
364
+ const key = post?.data?.file?.key;
365
+ return typeof key === 'string' ? key : null;
366
+ }
367
+
310
368
  function unavailable(title, detail) {
311
369
  return html`<div class="bw-unavailable" role="status">
312
370
  <p class="bw-h1">${title}</p>
@@ -5,7 +5,8 @@
5
5
  // '초안으로 저장'과 상관없고 '저장하지 않은 변경'도 아니다. 보드가 어디인지(실제 서버 · 메모리)는 SDK kvstore가 고른다.
6
6
  // 저장 전 섹션(한 번도 저장하지 않은 자료 포함)에 올리면 지금 편집한 내용을 먼저 초안으로 저장한 뒤 올린다
7
7
  // (저장하지 않은 섹션에 카드만 남으면 어느 화면에도 안 보이고 지울 수도 없음). 저장이 실패하면 올리지 않음
8
- // 설정 탭: 승인 후 공개 · 하트 반응 · 1인당 카드 수 · 내용 칸 문구
8
+ // 설정 탭: 승인 후 공개 · 하트 반응 · 파일 업로드 · 1인당 카드 수 · 내용 칸 문구
9
+ // 카드 파일(그림 · PDF)도 학생 화면처럼 올림 (edit 토큰도 서버가 받음, draft 미리보기에서는 숨김)
9
10
  // 카드는 학생 화면과 같은 모양: 맨 위 제목(선택), 쓴 사람 이름 · 시각 없음
10
11
  // settings 모양 · 검증은 core/settings.js. settings.board의 require_approval은 보드 모델(core/board.js)이 읽습니다.
11
12
  // 섹션 id는 처음 만들 때 한 번 정하고 바꾸지 않습니다: 카드가 id로 가리키므로 이름만 바뀝니다.
@@ -13,6 +14,12 @@
13
14
  import { showSnackbar, start } from '../lib/elice-content.js';
14
15
  import { createBoard } from '../core/board.js';
15
16
  import { html, part, parts } from '../core/dom.js';
17
+ import {
18
+ createFileUrls,
19
+ fileValue,
20
+ uploadErrorKind,
21
+ uploadsAvailable,
22
+ } from '../core/files.js';
16
23
  import { cardsByColumn, errorKind } from '../core/model.js';
17
24
  import {
18
25
  LIMIT_MAX,
@@ -108,6 +115,12 @@ const shell = html`<div class="bw">
108
115
  ><input type="checkbox" data-role="reactions" /><span>${t.reactions}</span></label
109
116
  >
110
117
  </div>
118
+ <div class="bw-set">
119
+ <label class="bw-check"
120
+ ><input type="checkbox" data-role="uploads" /><span>${t.fileUpload}</span></label
121
+ >
122
+ <p class="bw-help">${t.fileUploadHint}</p>
123
+ </div>
111
124
  <div class="bw-set">
112
125
  <label class="bw-lab" for="bw-limit">${t.limit}</label>
113
126
  <input
@@ -165,6 +178,9 @@ const say = text => {
165
178
 
166
179
  // ---------- 카드 (보드 core/board.js, '초안으로 저장'과 따로) ----------
167
180
  const errText = err => texts.errors[errorKind(err)] ?? texts.errors.failed;
181
+ const uploadErrText = err =>
182
+ texts.composer.fileErrors[uploadErrorKind(err)] ?? texts.composer.fileErrors.failed;
183
+ const fileUrls = createFileUrls(app.sdk);
168
184
  /** 보드. 열 수 없는 SDK(kvstore 없음)면 null: 카드를 올리면 안내만 */
169
185
  let board = null;
170
186
  let view = null;
@@ -203,6 +219,14 @@ const composer = createComposer({
203
219
  columns: () => draft.columns,
204
220
  placeholder: () => draft.bodyPlaceholder.trim(),
205
221
  preview: column => (savedIds().has(column) ? texts.composer.preview : t.saveWithCard),
222
+ // 지금 편집 중인 설정(파일 업로드)을 따름
223
+ upload: {
224
+ enabled: () => Boolean(board) && uploadsAvailable(app.sdk, draft, false),
225
+ send: async (file, onProgress) =>
226
+ fileValue(await app.sdk.sharedFiles.post(file, { onProgress }), file),
227
+ discard: file => void app.sdk.sharedFiles.delete(file.key).catch(() => undefined),
228
+ errorText: uploadErrText,
229
+ },
206
230
  onSubmit: async value => {
207
231
  if (!board) return texts.board.unavailable.detail;
208
232
  if (!savedIds().has(value.data.column)) {
@@ -237,6 +261,9 @@ function postView(post, card) {
237
261
  pending: post.status === 'pending',
238
262
  hidden: post.status === 'hidden',
239
263
  pinned: post.pinned,
264
+ file: card.file ?? null,
265
+ fileDeleted: post.fileDeleted === true,
266
+ fileUrls,
240
267
  canDelete: mine,
241
268
  heart: draft.reactions
242
269
  ? { on: post.likedByMe, count: post.likeCount, disabled: !view.canWrite }
@@ -263,7 +290,11 @@ function postView(post, card) {
263
290
  } catch (err) {
264
291
  showSnackbar({ text: errText(err) });
265
292
  x.disabled = false;
293
+ return;
266
294
  }
295
+ // 카드를 지웠으면 파일도 지운다 (실패해도 카드는 지워진 채로)
296
+ const key = card.file?.key;
297
+ if (key) await app.sdk.sharedFiles?.delete(key).catch(() => undefined);
267
298
  });
268
299
  return el;
269
300
  }
@@ -341,6 +372,9 @@ reactionsEl.addEventListener('change', () => {
341
372
  draft.reactions = reactionsEl.checked;
342
373
  render();
343
374
  });
375
+ const uploadsEl = part(shell, 'uploads');
376
+ uploadsEl.checked = draft.fileUpload;
377
+ uploadsEl.addEventListener('change', () => (draft.fileUpload = uploadsEl.checked));
344
378
  const limitEl = part(shell, 'limit');
345
379
  limitEl.value = draft.board.postLimit == null ? '' : String(draft.board.postLimit);
346
380
  limitEl.addEventListener('input', () => {
@@ -614,6 +648,7 @@ attachQuickAdd({
614
648
  open: pre => openComposer(pre),
615
649
  columnAt: (x, y) => columnAtX(boardEl, x, y),
616
650
  notify: text => showSnackbar({ text }),
651
+ files: () => Boolean(board) && uploadsAvailable(app.sdk, draft, false),
617
652
  });
618
653
 
619
654
  render();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "board",
3
- "version": "1.1.3",
3
+ "version": "1.2.0",
4
4
  "title": "참여형 보드",
5
5
  "description": "카드를 올려 함께 생각을 나눕니다",
6
6
  "catalog": {
@@ -1122,3 +1122,176 @@ body.ec-edit-page:has(.bw) .ec-submitbar {
1122
1122
  .bw-card-x.bw-card-menu {
1123
1123
  opacity: 1;
1124
1124
  }
1125
+
1126
+ /* 파일 첨부 (카드 추가 창 · 카드). 연주님 시안(파일 업로드)의 모양 */
1127
+ .bw-drop {
1128
+ display: flex;
1129
+ align-items: center;
1130
+ min-height: 44px;
1131
+ border: 1px dashed var(--bw-border-strong);
1132
+ border-radius: 12px;
1133
+ background: rgba(255, 255, 255, 0.5);
1134
+ }
1135
+ .bw-drop[hidden] {
1136
+ display: none;
1137
+ }
1138
+ .bw-drop:hover,
1139
+ .bw-drop.is-over {
1140
+ border-color: var(--bw-primary);
1141
+ }
1142
+ .bw-drop-btn {
1143
+ flex: 1;
1144
+ height: 44px;
1145
+ display: flex;
1146
+ align-items: center;
1147
+ justify-content: center;
1148
+ gap: 8px;
1149
+ border: 0;
1150
+ background: transparent;
1151
+ border-radius: 12px;
1152
+ font: inherit;
1153
+ font-size: 13px;
1154
+ font-weight: 600;
1155
+ color: var(--bw-text2);
1156
+ cursor: pointer;
1157
+ }
1158
+ .bw-drop-btn:hover {
1159
+ color: var(--bw-primary);
1160
+ }
1161
+ .bw-drop-btn:focus-visible {
1162
+ outline: 2px solid var(--bw-primary);
1163
+ outline-offset: 2px;
1164
+ }
1165
+ .bw-drop-file {
1166
+ display: none;
1167
+ align-items: center;
1168
+ gap: 8px;
1169
+ width: 100%;
1170
+ min-width: 0;
1171
+ padding: 6px 8px;
1172
+ }
1173
+ .bw-drop.has-file {
1174
+ border-style: solid;
1175
+ }
1176
+ .bw-drop.has-file .bw-drop-btn {
1177
+ display: none;
1178
+ }
1179
+ .bw-drop.has-file .bw-drop-file {
1180
+ display: flex;
1181
+ }
1182
+ .bw-drop-img,
1183
+ .bw-drop-icon {
1184
+ flex: none;
1185
+ width: 44px;
1186
+ height: 44px;
1187
+ border-radius: 8px;
1188
+ background: var(--bw-gray);
1189
+ }
1190
+ .bw-drop-img {
1191
+ object-fit: cover;
1192
+ }
1193
+ .bw-drop-icon {
1194
+ display: flex;
1195
+ align-items: center;
1196
+ justify-content: center;
1197
+ color: var(--bw-text2);
1198
+ }
1199
+ .bw-drop-img[hidden],
1200
+ .bw-drop-icon[hidden] {
1201
+ display: none;
1202
+ }
1203
+ .bw-filename {
1204
+ flex: 1;
1205
+ min-width: 0;
1206
+ font-size: 13px;
1207
+ font-weight: 600;
1208
+ color: var(--bw-text);
1209
+ overflow: hidden;
1210
+ text-overflow: ellipsis;
1211
+ white-space: nowrap;
1212
+ }
1213
+ .bw-filehint {
1214
+ margin: -4px 0 0 4px;
1215
+ font-size: 12px;
1216
+ color: var(--bw-text2);
1217
+ }
1218
+ .bw-filehint[hidden] {
1219
+ display: none;
1220
+ }
1221
+ .bw-card-media {
1222
+ display: flex;
1223
+ flex-direction: column;
1224
+ min-width: 0;
1225
+ }
1226
+ .bw-card-img {
1227
+ display: block;
1228
+ width: 100%;
1229
+ height: auto;
1230
+ max-height: 320px;
1231
+ object-fit: cover;
1232
+ border-radius: 12px;
1233
+ background: var(--bw-gray);
1234
+ }
1235
+ .bw-card-file {
1236
+ display: flex;
1237
+ align-items: center;
1238
+ gap: 8px;
1239
+ padding: 10px 12px;
1240
+ border-radius: 12px;
1241
+ background: rgba(255, 255, 255, 0.7);
1242
+ color: var(--bw-primary-dark);
1243
+ font-size: 13px;
1244
+ font-weight: 600;
1245
+ text-decoration: none;
1246
+ min-width: 0;
1247
+ margin: 0;
1248
+ }
1249
+ .bw-card-file[aria-disabled='true'] {
1250
+ cursor: progress;
1251
+ }
1252
+ .bw-card-file-name {
1253
+ flex: 1;
1254
+ min-width: 0;
1255
+ overflow: hidden;
1256
+ text-overflow: ellipsis;
1257
+ white-space: nowrap;
1258
+ }
1259
+ .bw-card-file-size {
1260
+ flex: none;
1261
+ font-weight: 500;
1262
+ color: var(--bw-text3);
1263
+ }
1264
+ .bw-card-file.is-deleted {
1265
+ color: var(--bw-text3);
1266
+ font-weight: 500;
1267
+ }
1268
+ /* 지우기 · 메뉴 버튼(오른쪽 위)이 맨 위 그림을 가리지 않게 */
1269
+ .bw-card-x:has(+ .bw-card-media) {
1270
+ z-index: 1;
1271
+ background: rgba(255, 255, 255, 0.85);
1272
+ border-radius: 50%;
1273
+ }
1274
+ .bw-card-x + .bw-card-media .bw-card-file {
1275
+ margin-right: 28px;
1276
+ }
1277
+ /* 올리는 동안 버튼의 스피너 */
1278
+ .bw-spin {
1279
+ flex: none;
1280
+ width: 16px;
1281
+ height: 16px;
1282
+ border-radius: 50%;
1283
+ border: 2px solid currentColor;
1284
+ border-top-color: transparent;
1285
+ opacity: 0.9;
1286
+ animation: bw-spin 0.7s linear infinite;
1287
+ }
1288
+ @keyframes bw-spin {
1289
+ to {
1290
+ transform: rotate(360deg);
1291
+ }
1292
+ }
1293
+ @media (prefers-reduced-motion: reduce) {
1294
+ .bw-spin {
1295
+ animation-duration: 2s;
1296
+ }
1297
+ }
@@ -1,7 +1,10 @@
1
1
  // 카드 한 장 (학생 · 교육자 화면, 편집 화면 미리보기가 같이 씀). 맨 위에 굵은 제목(선택, 여러 줄), 쓴 사람 이름 · 시각은 없음.
2
+ // 파일: 그림은 <img loading=lazy>(저장한 크기로 자리를 잡음), PDF는 칩(누르면 새 탭). 카드 안에 PDF를 iframe으로 띄우지 않는다
3
+ // (LXP 샌드박스 iframe 안에서는 브라우저 PDF 보기가 막힘). 주소를 못 받거나 그림이 404 · 오류면 '삭제된 파일'.
2
4
  // 동작은 화면이 data-role로 찾아 붙입니다:
3
5
  // heart(하트) · card-x(내 카드 지우기) · menu-btn(교육자 ⋯ 메뉴)
4
6
  import { html } from '../core/dom.js';
7
+ import { formatSize, isImageType } from '../core/files.js';
5
8
  import { parseBody, parseInline } from '../core/model.js';
6
9
  import { icon } from './icons.js';
7
10
  import { texts } from './texts.js';
@@ -50,7 +53,9 @@ export function cardBody(text) {
50
53
  * pending?: boolean, hidden?: boolean, pinned?: boolean,
51
54
  * canDelete?: boolean, menu?: boolean,
52
55
  * heart?: { on: boolean, count: number, disabled: boolean } | null,
53
- * }} c
56
+ * file?: import('../core/files.js').CardFile | null, fileDeleted?: boolean,
57
+ * fileUrls?: import('../core/files.js').FileUrls,
58
+ * }} c file: 붙인 파일, fileDeleted: 교육자가 지움, fileUrls: 서명 주소 받기 (core/files.js createFileUrls)
54
59
  */
55
60
  export function cardView(c) {
56
61
  const badges = [
@@ -85,6 +90,7 @@ export function cardView(c) {
85
90
  ${c.title ? html`<h3 class="bw-card-title">${c.title}</h3>` : null}
86
91
  ${badges.length ? html`<div class="bw-badges">${badges}</div>` : null}
87
92
  ${c.text ? cardBody(c.text) : null}
93
+ ${c.file ? fileView(c) : null}
88
94
  ${c.url
89
95
  ? html`<a class="bw-card-link" href="${c.url}" target="_blank" rel="noopener noreferrer"
90
96
  >${icon('link', 14)}<span>${c.url}</span></a
@@ -114,6 +120,73 @@ export function cardView(c) {
114
120
  return el;
115
121
  }
116
122
 
123
+ /** 지운 파일 자리 */
124
+ function deletedFile() {
125
+ return html`<p class="bw-card-file is-deleted">${icon('file', 14)}<span>${t.fileDeleted}</span></p>`;
126
+ }
127
+
128
+ /**
129
+ * 카드의 파일: 그림 · PDF 칩. 주소는 비동기로 받아 채운다 (받아 둔 주소가 있으면 바로)
130
+ * @param {{ file: import('../core/files.js').CardFile, fileDeleted?: boolean,
131
+ * fileUrls?: import('../core/files.js').FileUrls, title?: string }} c
132
+ */
133
+ export function fileView(c) {
134
+ const { file } = c;
135
+ const wrap = html`<div class="bw-card-media" data-role="media"></div>`;
136
+ if (c.fileDeleted || !c.fileUrls) {
137
+ wrap.append(deletedFile());
138
+ return wrap;
139
+ }
140
+ const urls = c.fileUrls;
141
+ const gone = () => {
142
+ urls.forget(file.key);
143
+ wrap.replaceChildren(deletedFile());
144
+ };
145
+ if (isImageType(file.type)) {
146
+ const img = document.createElement('img');
147
+ img.className = 'bw-card-img';
148
+ img.loading = 'lazy';
149
+ img.decoding = 'async';
150
+ img.alt = c.title || t.image;
151
+ if (file.width && file.height) {
152
+ img.width = file.width;
153
+ img.height = file.height;
154
+ }
155
+ // 404(지운 파일) · 오류: 이미지 요청은 상태를 알 수 없어(콘텐츠 CSP가 같은 출처 fetch를 막음) 모두 '삭제된 파일'
156
+ img.addEventListener('error', gone, { once: true });
157
+ wrap.append(img);
158
+ const known = urls.peek(file.key);
159
+ if (known) img.src = known;
160
+ else if (known === null) gone();
161
+ else
162
+ urls.get(file.key).then(
163
+ url => (url ? (img.src = url) : gone()),
164
+ () => gone()
165
+ );
166
+ return wrap;
167
+ }
168
+ // PDF: 새 탭으로 연다 (주소를 받기 전에는 누르지 않음)
169
+ const chip = html`<a class="bw-card-file" target="_blank" rel="noopener noreferrer"
170
+ >${icon('file', 14)}<span class="bw-card-file-name">${file.name ?? ''}</span
171
+ ><span class="bw-card-file-size">${formatSize(file.size)}</span></a
172
+ >`;
173
+ chip.setAttribute('aria-label', t.openPdf(file.name ?? ''));
174
+ chip.setAttribute('aria-disabled', 'true');
175
+ chip.addEventListener('click', e => {
176
+ if (!chip.getAttribute('href')) e.preventDefault();
177
+ });
178
+ wrap.append(chip);
179
+ const ready = url => {
180
+ if (!url) return gone();
181
+ chip.href = url;
182
+ chip.removeAttribute('aria-disabled');
183
+ };
184
+ const known = urls.peek(file.key);
185
+ if (known !== undefined) ready(known);
186
+ else urls.get(file.key).then(ready, () => gone());
187
+ return wrap;
188
+ }
189
+
117
190
  /**
118
191
  * 지우기 버튼을 두 번 누름으로: 처음 누르면 "삭제"로 바뀌고 3초 안에 다시 누르면 onConfirm (confirm()은 샌드박스에서 막힘)
119
192
  * @param {HTMLButtonElement} x