bi-components-library 1.1.83 → 1.1.84
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/dist/index.es.js +27 -19
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1343,32 +1343,39 @@ function cc(e, t, n, r, a = []) {
|
|
|
1343
1343
|
async (s, o) => {
|
|
1344
1344
|
if (!t || !o.trim()) return;
|
|
1345
1345
|
const u = oc(o);
|
|
1346
|
-
r((
|
|
1347
|
-
...
|
|
1348
|
-
[s]: { status: "loading" }
|
|
1346
|
+
r((p) => ({
|
|
1347
|
+
...p,
|
|
1348
|
+
[s]: { status: "loading", progress: 0 }
|
|
1349
1349
|
}));
|
|
1350
|
+
let l = 0;
|
|
1351
|
+
const d = setInterval(() => {
|
|
1352
|
+
l = Math.min(l + Math.random() * 15 + 5, 90), r((p) => {
|
|
1353
|
+
const g = p[s];
|
|
1354
|
+
return !g || g.status !== "loading" ? p : { ...p, [s]: { ...g, progress: Math.round(l) } };
|
|
1355
|
+
});
|
|
1356
|
+
}, 400);
|
|
1350
1357
|
try {
|
|
1351
|
-
const
|
|
1352
|
-
r((
|
|
1353
|
-
...
|
|
1358
|
+
const p = await t({ url: u });
|
|
1359
|
+
clearInterval(d), r((g) => ({
|
|
1360
|
+
...g,
|
|
1354
1361
|
[s]: {
|
|
1355
1362
|
status: "success",
|
|
1356
|
-
videoUrl:
|
|
1357
|
-
thumbnail:
|
|
1363
|
+
videoUrl: p.videoUrl,
|
|
1364
|
+
thumbnail: p.thumbnail || "",
|
|
1358
1365
|
fileName: u
|
|
1359
1366
|
}
|
|
1360
|
-
})), !
|
|
1361
|
-
|
|
1362
|
-
const
|
|
1363
|
-
return !
|
|
1367
|
+
})), !p.thumbnail && p.videoUrl && lc(p.videoUrl).then((g) => {
|
|
1368
|
+
g && r((f) => {
|
|
1369
|
+
const y = f[s];
|
|
1370
|
+
return !y || y.status !== "success" ? f : { ...f, [s]: { ...y, thumbnail: g } };
|
|
1364
1371
|
});
|
|
1365
1372
|
});
|
|
1366
|
-
} catch (
|
|
1367
|
-
r((
|
|
1368
|
-
...
|
|
1373
|
+
} catch (p) {
|
|
1374
|
+
clearInterval(d), r((g) => ({
|
|
1375
|
+
...g,
|
|
1369
1376
|
[s]: {
|
|
1370
1377
|
status: "error",
|
|
1371
|
-
errorMsg:
|
|
1378
|
+
errorMsg: p instanceof Error ? p.message : "解析失败"
|
|
1372
1379
|
}
|
|
1373
1380
|
}));
|
|
1374
1381
|
}
|
|
@@ -22115,9 +22122,10 @@ const Fb = (e, t) => {
|
|
|
22115
22122
|
}, Ua = `<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`, iT = (e, t) => {
|
|
22116
22123
|
const n = e.key, r = t[n], a = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", i = nt(e.tooltip), s = i ? ` data-tooltip="${ue(i)}"` : "";
|
|
22117
22124
|
let o;
|
|
22118
|
-
if (r?.status === "loading")
|
|
22119
|
-
|
|
22120
|
-
|
|
22125
|
+
if (r?.status === "loading") {
|
|
22126
|
+
const l = typeof r.progress == "number" ? Math.min(Math.max(r.progress, 0), 100) : 0, d = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='1'%3E%3Crect fill='%23999' width='1' height='1'/%3E%3C/svg%3E", p = 2 * Math.PI * 6.5, g = p * (1 - l / 100), f = `<svg class="video-upload-progress-ring" viewBox="0 0 16 16" width="16" height="16"><circle cx="8" cy="8" r="6.5" fill="none" stroke="rgba(255,255,255,0.5)" stroke-width="1.5"/><circle cx="8" cy="8" r="6.5" fill="none" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-dasharray="${p}" stroke-dashoffset="${g}" transform="rotate(-90 8 8)"/></svg>`;
|
|
22127
|
+
o = `<span class="video-inner-wrapper video-upload-inner video-uploading"><span class="video-thumbnail-wrapper"><img class="video-thumbnail" src="${d}" alt="thumbnail" /><span class="video-thumbnail-overlay"></span>${f}</span><span class="video-label">解析中...</span></span>`;
|
|
22128
|
+
} else if (r?.status === "success" && r.videoUrl) {
|
|
22121
22129
|
const l = r.fileName || "视频", d = '<svg class="video-play-icon" viewBox="0 0 16 16" width="16" height="16"><circle cx="8" cy="8" r="8" fill="rgba(0,0,0,0.5)"/><polygon points="6.5,4.5 6.5,11.5 12,8" fill="#fff"/></svg>';
|
|
22122
22130
|
o = `<span class="video-inner-wrapper video-url-inner has-video">${r.thumbnail ? `<span class="video-thumbnail-wrapper"><img class="video-thumbnail" src="${ue(r.thumbnail)}" alt="thumbnail" />${d}</span>` : `<span class="video-thumbnail-wrapper"><span class="video-thumbnail video-thumbnail-placeholder"><i class="iconfont icon-shipin" style="font-size:20px;color:#8c8c8c;"></i></span>${d}</span>`}<span class="video-label" data-file-name="${ue(l)}">${ue(l)}</span><span class="video-remove-btn" title="移除视频">×</span></span>`;
|
|
22123
22131
|
} else {
|