@singlebase/elements 0.5.0 → 0.6.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.
- package/dist/{authui-display-BCZBP7HR.js → authui-display-CKfGK5va.js} +519 -503
- package/dist/authui-display-CKfGK5va.js.map +1 -0
- package/dist/{authui-display-CLGFSqRi.cjs → authui-display-aWNht0cW.cjs} +38 -58
- package/dist/authui-display-aWNht0cW.cjs.map +1 -0
- package/dist/authui.cjs +1 -1
- package/dist/authui.js +2 -2
- package/dist/chat-C-gsskho.cjs +3258 -0
- package/dist/chat-C-gsskho.cjs.map +1 -0
- package/dist/{chat-bXaRWel7.js → chat-CEh6RygY.js} +1957 -1137
- package/dist/chat-CEh6RygY.js.map +1 -0
- package/dist/chat-messages.d.ts +11 -5
- package/dist/chat.cjs +1 -1
- package/dist/chat.d.ts +4 -3
- package/dist/chat.js +8 -6
- package/dist/elements/authui-base.d.ts +2 -0
- package/dist/elements/authui-buttons.d.ts +1 -1
- package/dist/elements/authui-display.d.ts +1 -1
- package/dist/elements/authui.d.ts +5 -1
- package/dist/elements/chat.d.ts +153 -10
- package/dist/elements/uploader.d.ts +14 -0
- package/dist/{files-BOwtpYyQ.js → files-DDJWPzZW.js} +82 -35
- package/dist/files-DDJWPzZW.js.map +1 -0
- package/dist/files-DyxcjZsx.cjs +75 -0
- package/dist/files-DyxcjZsx.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +24 -22
- package/dist/singlebase-elements.min.js +3799 -2892
- package/dist/singlebase-elements.min.js.map +1 -1
- package/dist/styles/branding.d.ts +5 -0
- package/dist/styles/tokens.d.ts +2 -0
- package/dist/{uploader-DGV2y9uT.cjs → uploader-660JIgIN.cjs} +53 -76
- package/dist/uploader-660JIgIN.cjs.map +1 -0
- package/dist/{uploader-abQoem5q.js → uploader-vfczkX51.js} +294 -271
- package/dist/uploader-vfczkX51.js.map +1 -0
- package/dist/uploader.cjs +1 -1
- package/dist/uploader.js +2 -2
- package/dist/utils/branding.d.ts +8 -0
- package/dist/utils/markdown.d.ts +69 -12
- package/dist/utils/svg.d.ts +10 -0
- package/package.json +3 -3
- package/dist/authui-display-BCZBP7HR.js.map +0 -1
- package/dist/authui-display-CLGFSqRi.cjs.map +0 -1
- package/dist/chat-DRenTJlI.cjs +0 -3001
- package/dist/chat-DRenTJlI.cjs.map +0 -1
- package/dist/chat-bXaRWel7.js.map +0 -1
- package/dist/files-BOwtpYyQ.js.map +0 -1
- package/dist/files-DW8A4Jl-.cjs +0 -38
- package/dist/files-DW8A4Jl-.cjs.map +0 -1
- package/dist/uploader-DGV2y9uT.cjs.map +0 -1
- package/dist/uploader-abQoem5q.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ge = (r) => {
|
|
2
2
|
throw TypeError(r);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var d = (r, e, t) => (
|
|
6
|
-
import { css as
|
|
7
|
-
import { property as b, state as
|
|
8
|
-
import { getDefaultClient as
|
|
9
|
-
import { t as
|
|
10
|
-
const
|
|
4
|
+
var he = (r, e, t) => e.has(r) || ge("Cannot " + t);
|
|
5
|
+
var d = (r, e, t) => (he(r, e, "read from private field"), t ? t.call(r) : e.get(r)), l = (r, e, t) => e.has(r) ? ge("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), c = (r, e, t, i) => (he(r, e, "write to private field"), i ? i.call(r, t) : e.set(r, t), t);
|
|
6
|
+
import { css as ye, LitElement as Me, nothing as x, html as u } from "lit";
|
|
7
|
+
import { property as b, state as te, customElement as Ce } from "lit/decorators.js";
|
|
8
|
+
import { getDefaultClient as Te } from "@singlebase/core";
|
|
9
|
+
import { t as je, b as Fe, r as Oe, f as de, a as v, c as De, p as le, e as ie, g as Ee, h as Le, i as Ae, j as Ne, k as Pe } from "./files-DDJWPzZW.js";
|
|
10
|
+
const Re = ye`
|
|
11
11
|
/* ── layout primitives ───────────────────────────────────── */
|
|
12
12
|
.stack {
|
|
13
13
|
display: flex;
|
|
@@ -131,7 +131,7 @@ const Le = me`
|
|
|
131
131
|
color: var(--sb-ink, #16181a);
|
|
132
132
|
background: var(--sb-surface-alt, #fafafa);
|
|
133
133
|
border: 1px solid var(--sb-border, #e4e6e9);
|
|
134
|
-
border-radius: var(--sb-radius, 4px);
|
|
134
|
+
border-radius: calc(var(--sb-radius, 4px) * var(--sb-radius-scale, 1));
|
|
135
135
|
padding: var(--sb-field-pad, 11px 13px);
|
|
136
136
|
outline: none;
|
|
137
137
|
}
|
|
@@ -201,7 +201,7 @@ const Le = me`
|
|
|
201
201
|
font: inherit;
|
|
202
202
|
font-size: 13.5px;
|
|
203
203
|
font-weight: 500;
|
|
204
|
-
border-radius: var(--sb-radius, 4px);
|
|
204
|
+
border-radius: calc(var(--sb-radius, 4px) * var(--sb-radius-scale, 1));
|
|
205
205
|
cursor: pointer;
|
|
206
206
|
padding: 9px 14px;
|
|
207
207
|
border: 1px solid transparent;
|
|
@@ -377,7 +377,7 @@ const Le = me`
|
|
|
377
377
|
.notice {
|
|
378
378
|
font-size: 13px;
|
|
379
379
|
line-height: 1.45;
|
|
380
|
-
border-radius: var(--sb-radius, 4px);
|
|
380
|
+
border-radius: calc(var(--sb-radius, 4px) * var(--sb-radius-scale, 1));
|
|
381
381
|
padding: 10px 12px;
|
|
382
382
|
}
|
|
383
383
|
|
|
@@ -495,7 +495,7 @@ const Le = me`
|
|
|
495
495
|
|
|
496
496
|
.acc-item {
|
|
497
497
|
border: 1px solid var(--sb-border, #e4e6e9);
|
|
498
|
-
border-radius: var(--sb-radius, 4px);
|
|
498
|
+
border-radius: calc(var(--sb-radius, 4px) * var(--sb-radius-scale, 1));
|
|
499
499
|
overflow: hidden;
|
|
500
500
|
background: transparent;
|
|
501
501
|
transition:
|
|
@@ -610,7 +610,7 @@ const Le = me`
|
|
|
610
610
|
padding: 10px 12px;
|
|
611
611
|
background: var(--sb-surface-alt, #fafafa);
|
|
612
612
|
border: 1px solid var(--sb-border, #e4e6e9);
|
|
613
|
-
border-radius: var(--sb-radius, 4px);
|
|
613
|
+
border-radius: calc(var(--sb-radius, 4px) * var(--sb-radius-scale, 1));
|
|
614
614
|
}
|
|
615
615
|
|
|
616
616
|
.invite-label {
|
|
@@ -777,7 +777,7 @@ const Le = me`
|
|
|
777
777
|
padding: 14px;
|
|
778
778
|
background: var(--sb-surface-alt, #fafafa);
|
|
779
779
|
border: 1px solid var(--sb-border, #e4e6e9);
|
|
780
|
-
border-radius: var(--sb-radius, 4px);
|
|
780
|
+
border-radius: calc(var(--sb-radius, 4px) * var(--sb-radius-scale, 1));
|
|
781
781
|
}
|
|
782
782
|
|
|
783
783
|
/* 2FA switch */
|
|
@@ -826,7 +826,7 @@ const Le = me`
|
|
|
826
826
|
flex: 0 0 auto;
|
|
827
827
|
width: 74px;
|
|
828
828
|
height: 74px;
|
|
829
|
-
border-radius: var(--sb-radius, 4px);
|
|
829
|
+
border-radius: calc(var(--sb-radius, 4px) * var(--sb-radius-scale, 1));
|
|
830
830
|
background: var(--sb-surface-alt, #fafafa);
|
|
831
831
|
border: 1px dashed var(--sb-border-strong, #cdd1d6);
|
|
832
832
|
display: flex;
|
|
@@ -858,7 +858,7 @@ const Le = me`
|
|
|
858
858
|
gap: 12px;
|
|
859
859
|
padding: 10px 12px;
|
|
860
860
|
border: 1px solid var(--sb-border, #e4e6e9);
|
|
861
|
-
border-radius: var(--sb-radius, 4px);
|
|
861
|
+
border-radius: calc(var(--sb-radius, 4px) * var(--sb-radius-scale, 1));
|
|
862
862
|
background: var(--sb-surface-alt, #fafafa);
|
|
863
863
|
}
|
|
864
864
|
|
|
@@ -922,7 +922,7 @@ const Le = me`
|
|
|
922
922
|
font: inherit;
|
|
923
923
|
text-align: left;
|
|
924
924
|
padding: 10px 11px;
|
|
925
|
-
border-radius: var(--sb-radius, 4px);
|
|
925
|
+
border-radius: calc(var(--sb-radius, 4px) * var(--sb-radius-scale, 1));
|
|
926
926
|
border: 1px dashed var(--sb-border-strong, #cdd1d6);
|
|
927
927
|
background: transparent;
|
|
928
928
|
cursor: pointer;
|
|
@@ -974,7 +974,7 @@ const Le = me`
|
|
|
974
974
|
gap: 12px;
|
|
975
975
|
padding: 14px;
|
|
976
976
|
border: 1px solid var(--sb-danger-panel-border, #efd9d6);
|
|
977
|
-
border-radius: var(--sb-radius, 4px);
|
|
977
|
+
border-radius: calc(var(--sb-radius, 4px) * var(--sb-radius-scale, 1));
|
|
978
978
|
background: var(--sb-danger-panel-bg, #fdf7f6);
|
|
979
979
|
}
|
|
980
980
|
|
|
@@ -984,7 +984,7 @@ const Le = me`
|
|
|
984
984
|
font-style: italic;
|
|
985
985
|
}
|
|
986
986
|
`;
|
|
987
|
-
function
|
|
987
|
+
function Be(r, e, t) {
|
|
988
988
|
if (!r || !e) return null;
|
|
989
989
|
let i;
|
|
990
990
|
try {
|
|
@@ -992,32 +992,32 @@ function Te(r, e, t) {
|
|
|
992
992
|
} catch {
|
|
993
993
|
return null;
|
|
994
994
|
}
|
|
995
|
-
let
|
|
995
|
+
let n;
|
|
996
996
|
try {
|
|
997
|
-
|
|
997
|
+
n = new URL(r, i.href);
|
|
998
998
|
} catch {
|
|
999
999
|
return t == null || t(`"${r}" is not a valid URL`), null;
|
|
1000
1000
|
}
|
|
1001
|
-
return
|
|
1001
|
+
return n.protocol !== "http:" && n.protocol !== "https:" ? (t == null || t(`refusing redirect to unsupported scheme "${n.protocol}"`), null) : n.origin !== i.origin ? (t == null || t(`refusing cross-origin redirect to ${n.origin}; same-origin only`), null) : n.href === i.href ? null : n.href;
|
|
1002
1002
|
}
|
|
1003
|
-
const
|
|
1004
|
-
async function
|
|
1003
|
+
const we = { pages: null, encrypted: null }, me = 16 * 1024 * 1024, Ge = 2 * 1024 * 1024, Ie = 40, _e = 4 * 1024 * 1024, ke = /* @__PURE__ */ new Set(["docx", "pptx", "xlsx"]);
|
|
1004
|
+
async function Ke(r, e) {
|
|
1005
1005
|
try {
|
|
1006
|
-
if (e === "pdf") return await
|
|
1007
|
-
if (
|
|
1006
|
+
if (e === "pdf") return await Ve(r);
|
|
1007
|
+
if (ke.has(e)) return await He(r, e);
|
|
1008
1008
|
} catch {
|
|
1009
1009
|
}
|
|
1010
|
-
return
|
|
1010
|
+
return we;
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1013
|
-
return r === "pdf" ||
|
|
1012
|
+
function qe(r) {
|
|
1013
|
+
return r === "pdf" || ke.has(r);
|
|
1014
1014
|
}
|
|
1015
|
-
async function
|
|
1016
|
-
const e = await
|
|
1017
|
-
let g =
|
|
1018
|
-
return g === null && (g = await
|
|
1015
|
+
async function Ve(r) {
|
|
1016
|
+
const e = await ae(r.slice(0, me)), t = r.size > me ? await ae(r.slice(Math.max(0, r.size - Ge))) : null, i = se(e) + (t ? se(t) : ""), n = /\/Encrypt[\s/<>\]]/.test(i);
|
|
1017
|
+
let g = ze(i);
|
|
1018
|
+
return g === null && (g = await Ye(e)), { pages: g, encrypted: n };
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1020
|
+
function ze(r) {
|
|
1021
1021
|
if (/\/Type\s*\/Pages/.test(r)) {
|
|
1022
1022
|
let t = 0;
|
|
1023
1023
|
for (const i of r.matchAll(/\/Count\s+(\d+)/g))
|
|
@@ -1027,80 +1027,80 @@ function ye(r) {
|
|
|
1027
1027
|
const e = r.match(/\/Type\s*\/Page[^s]/g);
|
|
1028
1028
|
return e != null && e.length ? e.length : null;
|
|
1029
1029
|
}
|
|
1030
|
-
async function
|
|
1030
|
+
async function Ye(r) {
|
|
1031
1031
|
if (typeof DecompressionStream > "u") return null;
|
|
1032
|
-
const e =
|
|
1032
|
+
const e = se(r);
|
|
1033
1033
|
let t = "", i = 0;
|
|
1034
|
-
for (const
|
|
1035
|
-
if (i >=
|
|
1036
|
-
const g =
|
|
1037
|
-
let
|
|
1038
|
-
if (
|
|
1039
|
-
for (;
|
|
1040
|
-
` || e[
|
|
1034
|
+
for (const n of e.matchAll(/stream\r?\n/g)) {
|
|
1035
|
+
if (i >= Ie || t.length >= _e) break;
|
|
1036
|
+
const g = n.index + n[0].length;
|
|
1037
|
+
let s = e.indexOf("endstream", g);
|
|
1038
|
+
if (s < 0) break;
|
|
1039
|
+
for (; s > g && (e[s - 1] === `
|
|
1040
|
+
` || e[s - 1] === "\r"); ) s -= 1;
|
|
1041
1041
|
i += 1;
|
|
1042
1042
|
try {
|
|
1043
|
-
const a = await
|
|
1044
|
-
t +=
|
|
1043
|
+
const a = await $e(r.subarray(g, s), "deflate");
|
|
1044
|
+
t += se(a);
|
|
1045
1045
|
} catch {
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
|
-
return t ?
|
|
1048
|
+
return t ? ze(t) : null;
|
|
1049
1049
|
}
|
|
1050
|
-
async function
|
|
1051
|
-
const t = await
|
|
1052
|
-
if (
|
|
1053
|
-
if (t[0] !== 80 || t[1] !== 75) return
|
|
1054
|
-
const i = await
|
|
1050
|
+
async function He(r, e) {
|
|
1051
|
+
const t = await ae(r.slice(0, 8));
|
|
1052
|
+
if (Je(t)) return { pages: null, encrypted: !0 };
|
|
1053
|
+
if (t[0] !== 80 || t[1] !== 75) return we;
|
|
1054
|
+
const i = await Xe(r, "docProps/app.xml");
|
|
1055
1055
|
if (!i) return { pages: null, encrypted: !1 };
|
|
1056
|
-
const
|
|
1056
|
+
const n = e === "pptx" ? "Slides" : "Pages", g = new TextDecoder().decode(i).match(new RegExp(`<${n}>(\\d+)</${n}>`));
|
|
1057
1057
|
return { pages: g ? Number(g[1]) : null, encrypted: !1 };
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1059
|
+
function Je(r) {
|
|
1060
1060
|
return [208, 207, 17, 224, 161, 177, 26, 225].every((t, i) => r[i] === t);
|
|
1061
1061
|
}
|
|
1062
|
-
async function
|
|
1062
|
+
async function Xe(r, e) {
|
|
1063
1063
|
const t = Math.min(r.size, 66e3), i = new DataView(await r.slice(r.size - t).arrayBuffer());
|
|
1064
|
-
let
|
|
1064
|
+
let n = -1;
|
|
1065
1065
|
for (let h = i.byteLength - 22; h >= 0; h--)
|
|
1066
1066
|
if (i.getUint32(h, !0) === 101010256) {
|
|
1067
|
-
|
|
1067
|
+
n = h;
|
|
1068
1068
|
break;
|
|
1069
1069
|
}
|
|
1070
|
-
if (
|
|
1071
|
-
const g = i.getUint32(
|
|
1072
|
-
if (!g ||
|
|
1073
|
-
const a = new DataView(await r.slice(
|
|
1070
|
+
if (n < 0) return null;
|
|
1071
|
+
const g = i.getUint32(n + 12, !0), s = i.getUint32(n + 16, !0);
|
|
1072
|
+
if (!g || s === 4294967295) return null;
|
|
1073
|
+
const a = new DataView(await r.slice(s, s + g).arrayBuffer()), m = new TextDecoder();
|
|
1074
1074
|
let f = 0;
|
|
1075
1075
|
for (; f + 46 <= a.byteLength && a.getUint32(f, !0) === 33639248; ) {
|
|
1076
|
-
const h = a.getUint16(f + 10, !0),
|
|
1076
|
+
const h = a.getUint16(f + 10, !0), re = a.getUint32(f + 20, !0), y = a.getUint16(f + 28, !0), ne = a.getUint16(f + 30, !0), Se = a.getUint16(f + 32, !0), oe = a.getUint32(f + 42, !0);
|
|
1077
1077
|
if (m.decode(new Uint8Array(a.buffer, a.byteOffset + f + 46, y)) === e) {
|
|
1078
|
-
const
|
|
1079
|
-
return h === 0 ?
|
|
1078
|
+
const ue = new DataView(await r.slice(oe, oe + 30).arrayBuffer()), fe = oe + 30 + ue.getUint16(26, !0) + ue.getUint16(28, !0), be = await ae(r.slice(fe, fe + re));
|
|
1079
|
+
return h === 0 ? be : h === 8 && typeof DecompressionStream < "u" ? await $e(be, "deflate-raw") : null;
|
|
1080
1080
|
}
|
|
1081
|
-
f += 46 + y +
|
|
1081
|
+
f += 46 + y + ne + Se;
|
|
1082
1082
|
}
|
|
1083
1083
|
return null;
|
|
1084
1084
|
}
|
|
1085
|
-
async function
|
|
1085
|
+
async function ae(r) {
|
|
1086
1086
|
return new Uint8Array(await r.arrayBuffer());
|
|
1087
1087
|
}
|
|
1088
|
-
async function
|
|
1088
|
+
async function $e(r, e) {
|
|
1089
1089
|
const t = new Blob([r]).stream().pipeThrough(new DecompressionStream(e));
|
|
1090
1090
|
return new Uint8Array(await new Response(t).arrayBuffer());
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function se(r) {
|
|
1093
1093
|
let e = "";
|
|
1094
1094
|
for (let i = 0; i < r.length; i += 32768)
|
|
1095
1095
|
e += String.fromCharCode(...r.subarray(i, i + 32768));
|
|
1096
1096
|
return e;
|
|
1097
1097
|
}
|
|
1098
|
-
var
|
|
1099
|
-
for (var
|
|
1100
|
-
(
|
|
1101
|
-
return i &&
|
|
1102
|
-
},
|
|
1103
|
-
const
|
|
1098
|
+
var Ue = Object.defineProperty, We = Object.getOwnPropertyDescriptor, Ze = (r, e, t) => e in r ? Ue(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, p = (r, e, t, i) => {
|
|
1099
|
+
for (var n = i > 1 ? void 0 : i ? We(e, t) : e, g = r.length - 1, s; g >= 0; g--)
|
|
1100
|
+
(s = r[g]) && (n = (i ? s(e, t, n) : s(n)) || n);
|
|
1101
|
+
return i && n && Ue(e, t, n), n;
|
|
1102
|
+
}, Qe = (r, e, t) => Ze(r, e + "", t);
|
|
1103
|
+
const ce = {
|
|
1104
1104
|
fromAttribute: (r) => {
|
|
1105
1105
|
if (!r) return {};
|
|
1106
1106
|
try {
|
|
@@ -1111,15 +1111,17 @@ const ne = {
|
|
|
1111
1111
|
}
|
|
1112
1112
|
},
|
|
1113
1113
|
toAttribute: (r) => JSON.stringify(r ?? {})
|
|
1114
|
-
},
|
|
1114
|
+
}, pe = {
|
|
1115
1115
|
fromAttribute: (r) => r === null ? !0 : r !== "false",
|
|
1116
1116
|
toAttribute: (r) => r ? null : "false"
|
|
1117
|
-
},
|
|
1117
|
+
}, xe = [
|
|
1118
1118
|
"view",
|
|
1119
1119
|
"dropzone",
|
|
1120
1120
|
"allowRename",
|
|
1121
1121
|
"autoUpload",
|
|
1122
1122
|
"branding",
|
|
1123
|
+
"brandingText",
|
|
1124
|
+
"brandingUrl",
|
|
1123
1125
|
"logoUrl",
|
|
1124
1126
|
"logoText",
|
|
1125
1127
|
"heading",
|
|
@@ -1137,43 +1139,47 @@ const ne = {
|
|
|
1137
1139
|
"messages",
|
|
1138
1140
|
"theme",
|
|
1139
1141
|
"density",
|
|
1142
|
+
"radius",
|
|
1140
1143
|
"onComplete",
|
|
1141
1144
|
"onError"
|
|
1142
1145
|
];
|
|
1143
|
-
var k, z, $, U, S, M, C, j, F, O, D, E, L,
|
|
1144
|
-
let
|
|
1146
|
+
var k, z, $, U, S, M, C, T, j, F, O, D, E, L, A, N, P, R, B, G, I, _, K, q, V, Y, H, J, X, W, Z, Q, ee, ve;
|
|
1147
|
+
let o = (ve = class extends Me {
|
|
1145
1148
|
constructor() {
|
|
1146
1149
|
super(...arguments);
|
|
1147
1150
|
l(this, k, null);
|
|
1148
1151
|
l(this, z, {});
|
|
1149
1152
|
l(this, $);
|
|
1150
1153
|
l(this, U);
|
|
1151
|
-
l(this, S
|
|
1152
|
-
l(this, M,
|
|
1154
|
+
l(this, S);
|
|
1155
|
+
l(this, M, "full");
|
|
1153
1156
|
l(this, C, !0);
|
|
1157
|
+
l(this, T, !0);
|
|
1154
1158
|
l(this, j, !1);
|
|
1155
1159
|
l(this, F, !0);
|
|
1156
1160
|
l(this, O, "");
|
|
1157
1161
|
l(this, D, "");
|
|
1158
1162
|
l(this, E, "");
|
|
1159
1163
|
l(this, L, "");
|
|
1160
|
-
l(this,
|
|
1161
|
-
l(this,
|
|
1162
|
-
l(this,
|
|
1163
|
-
l(this,
|
|
1164
|
-
l(this,
|
|
1165
|
-
l(this, G, "
|
|
1166
|
-
l(this, B, {});
|
|
1164
|
+
l(this, A, "");
|
|
1165
|
+
l(this, N, "");
|
|
1166
|
+
l(this, P, 10);
|
|
1167
|
+
l(this, R, "25MB");
|
|
1168
|
+
l(this, B, 0);
|
|
1169
|
+
l(this, G, "");
|
|
1167
1170
|
l(this, I, {});
|
|
1168
|
-
l(this, _,
|
|
1169
|
-
l(this, K,
|
|
1170
|
-
l(this, q,
|
|
1171
|
-
l(this, V,
|
|
1172
|
-
l(this, Y,
|
|
1173
|
-
l(this, H,
|
|
1174
|
-
l(this, J,
|
|
1175
|
-
l(this, X,
|
|
1171
|
+
l(this, _, "default");
|
|
1172
|
+
l(this, K, {});
|
|
1173
|
+
l(this, q, {});
|
|
1174
|
+
l(this, V, !1);
|
|
1175
|
+
l(this, Y, "");
|
|
1176
|
+
l(this, H, null);
|
|
1177
|
+
l(this, J, null);
|
|
1178
|
+
l(this, X, []);
|
|
1176
1179
|
l(this, W, "");
|
|
1180
|
+
l(this, Z, !1);
|
|
1181
|
+
l(this, Q, !1);
|
|
1182
|
+
l(this, ee, "");
|
|
1177
1183
|
}
|
|
1178
1184
|
get client() {
|
|
1179
1185
|
return d(this, k);
|
|
@@ -1199,24 +1205,30 @@ let n = (he = class extends $e {
|
|
|
1199
1205
|
set density(e) {
|
|
1200
1206
|
c(this, U, e);
|
|
1201
1207
|
}
|
|
1202
|
-
get
|
|
1208
|
+
get radius() {
|
|
1203
1209
|
return d(this, S);
|
|
1204
1210
|
}
|
|
1205
|
-
set
|
|
1211
|
+
set radius(e) {
|
|
1206
1212
|
c(this, S, e);
|
|
1207
1213
|
}
|
|
1208
|
-
get
|
|
1214
|
+
get view() {
|
|
1209
1215
|
return d(this, M);
|
|
1210
1216
|
}
|
|
1211
|
-
set
|
|
1217
|
+
set view(e) {
|
|
1212
1218
|
c(this, M, e);
|
|
1213
1219
|
}
|
|
1214
|
-
get
|
|
1220
|
+
get dropzone() {
|
|
1215
1221
|
return d(this, C);
|
|
1216
1222
|
}
|
|
1217
|
-
set
|
|
1223
|
+
set dropzone(e) {
|
|
1218
1224
|
c(this, C, e);
|
|
1219
1225
|
}
|
|
1226
|
+
get allowRename() {
|
|
1227
|
+
return d(this, T);
|
|
1228
|
+
}
|
|
1229
|
+
set allowRename(e) {
|
|
1230
|
+
c(this, T, e);
|
|
1231
|
+
}
|
|
1220
1232
|
get autoUpload() {
|
|
1221
1233
|
return d(this, j);
|
|
1222
1234
|
}
|
|
@@ -1229,138 +1241,150 @@ let n = (he = class extends $e {
|
|
|
1229
1241
|
set branding(e) {
|
|
1230
1242
|
c(this, F, e);
|
|
1231
1243
|
}
|
|
1232
|
-
get
|
|
1244
|
+
get brandingText() {
|
|
1233
1245
|
return d(this, O);
|
|
1234
1246
|
}
|
|
1235
|
-
set
|
|
1247
|
+
set brandingText(e) {
|
|
1236
1248
|
c(this, O, e);
|
|
1237
1249
|
}
|
|
1238
|
-
get
|
|
1250
|
+
get brandingUrl() {
|
|
1239
1251
|
return d(this, D);
|
|
1240
1252
|
}
|
|
1241
|
-
set
|
|
1253
|
+
set brandingUrl(e) {
|
|
1242
1254
|
c(this, D, e);
|
|
1243
1255
|
}
|
|
1244
|
-
get
|
|
1256
|
+
get logoUrl() {
|
|
1245
1257
|
return d(this, E);
|
|
1246
1258
|
}
|
|
1247
|
-
set
|
|
1259
|
+
set logoUrl(e) {
|
|
1248
1260
|
c(this, E, e);
|
|
1249
1261
|
}
|
|
1250
|
-
get
|
|
1262
|
+
get logoText() {
|
|
1251
1263
|
return d(this, L);
|
|
1252
1264
|
}
|
|
1253
|
-
set
|
|
1265
|
+
set logoText(e) {
|
|
1254
1266
|
c(this, L, e);
|
|
1255
1267
|
}
|
|
1268
|
+
get heading() {
|
|
1269
|
+
return d(this, A);
|
|
1270
|
+
}
|
|
1271
|
+
set heading(e) {
|
|
1272
|
+
c(this, A, e);
|
|
1273
|
+
}
|
|
1274
|
+
get description() {
|
|
1275
|
+
return d(this, N);
|
|
1276
|
+
}
|
|
1277
|
+
set description(e) {
|
|
1278
|
+
c(this, N, e);
|
|
1279
|
+
}
|
|
1256
1280
|
get maxFiles() {
|
|
1257
|
-
return d(this,
|
|
1281
|
+
return d(this, P);
|
|
1258
1282
|
}
|
|
1259
1283
|
set maxFiles(e) {
|
|
1260
|
-
c(this,
|
|
1284
|
+
c(this, P, e);
|
|
1261
1285
|
}
|
|
1262
1286
|
get maxSize() {
|
|
1263
|
-
return d(this,
|
|
1287
|
+
return d(this, R);
|
|
1264
1288
|
}
|
|
1265
1289
|
set maxSize(e) {
|
|
1266
|
-
c(this,
|
|
1290
|
+
c(this, R, e);
|
|
1267
1291
|
}
|
|
1268
1292
|
get minSize() {
|
|
1269
|
-
return d(this,
|
|
1293
|
+
return d(this, B);
|
|
1270
1294
|
}
|
|
1271
1295
|
set minSize(e) {
|
|
1272
|
-
c(this,
|
|
1296
|
+
c(this, B, e);
|
|
1273
1297
|
}
|
|
1274
1298
|
get accept() {
|
|
1275
|
-
return d(this,
|
|
1299
|
+
return d(this, G);
|
|
1276
1300
|
}
|
|
1277
1301
|
set accept(e) {
|
|
1278
|
-
c(this,
|
|
1302
|
+
c(this, G, e);
|
|
1279
1303
|
}
|
|
1280
1304
|
get rules() {
|
|
1281
|
-
return d(this,
|
|
1305
|
+
return d(this, I);
|
|
1282
1306
|
}
|
|
1283
1307
|
set rules(e) {
|
|
1284
|
-
c(this,
|
|
1308
|
+
c(this, I, e);
|
|
1285
1309
|
}
|
|
1286
1310
|
get bucket() {
|
|
1287
|
-
return d(this,
|
|
1311
|
+
return d(this, _);
|
|
1288
1312
|
}
|
|
1289
1313
|
set bucket(e) {
|
|
1290
|
-
c(this,
|
|
1314
|
+
c(this, _, e);
|
|
1291
1315
|
}
|
|
1292
1316
|
get metadata() {
|
|
1293
|
-
return d(this,
|
|
1317
|
+
return d(this, K);
|
|
1294
1318
|
}
|
|
1295
1319
|
set metadata(e) {
|
|
1296
|
-
c(this,
|
|
1320
|
+
c(this, K, e);
|
|
1297
1321
|
}
|
|
1298
1322
|
get options() {
|
|
1299
|
-
return d(this,
|
|
1323
|
+
return d(this, q);
|
|
1300
1324
|
}
|
|
1301
1325
|
set options(e) {
|
|
1302
|
-
c(this,
|
|
1326
|
+
c(this, q, e);
|
|
1303
1327
|
}
|
|
1304
1328
|
get publicRead() {
|
|
1305
|
-
return d(this,
|
|
1329
|
+
return d(this, V);
|
|
1306
1330
|
}
|
|
1307
1331
|
set publicRead(e) {
|
|
1308
|
-
c(this,
|
|
1332
|
+
c(this, V, e);
|
|
1309
1333
|
}
|
|
1310
1334
|
get redirectUrl() {
|
|
1311
|
-
return d(this,
|
|
1335
|
+
return d(this, Y);
|
|
1312
1336
|
}
|
|
1313
1337
|
set redirectUrl(e) {
|
|
1314
|
-
c(this,
|
|
1338
|
+
c(this, Y, e);
|
|
1315
1339
|
}
|
|
1316
1340
|
get onComplete() {
|
|
1317
|
-
return d(this,
|
|
1341
|
+
return d(this, H);
|
|
1318
1342
|
}
|
|
1319
1343
|
set onComplete(e) {
|
|
1320
|
-
c(this,
|
|
1344
|
+
c(this, H, e);
|
|
1321
1345
|
}
|
|
1322
1346
|
get onError() {
|
|
1323
|
-
return d(this,
|
|
1347
|
+
return d(this, J);
|
|
1324
1348
|
}
|
|
1325
1349
|
set onError(e) {
|
|
1326
|
-
c(this,
|
|
1350
|
+
c(this, J, e);
|
|
1327
1351
|
}
|
|
1328
1352
|
get items() {
|
|
1329
|
-
return d(this,
|
|
1353
|
+
return d(this, X);
|
|
1330
1354
|
}
|
|
1331
1355
|
set items(e) {
|
|
1332
|
-
c(this,
|
|
1356
|
+
c(this, X, e);
|
|
1333
1357
|
}
|
|
1334
1358
|
get notice() {
|
|
1335
|
-
return d(this,
|
|
1359
|
+
return d(this, W);
|
|
1336
1360
|
}
|
|
1337
1361
|
set notice(e) {
|
|
1338
|
-
c(this,
|
|
1362
|
+
c(this, W, e);
|
|
1339
1363
|
}
|
|
1340
1364
|
get busy() {
|
|
1341
|
-
return d(this,
|
|
1365
|
+
return d(this, Z);
|
|
1342
1366
|
}
|
|
1343
1367
|
set busy(e) {
|
|
1344
|
-
c(this,
|
|
1368
|
+
c(this, Z, e);
|
|
1345
1369
|
}
|
|
1346
1370
|
get dragging() {
|
|
1347
|
-
return d(this,
|
|
1371
|
+
return d(this, Q);
|
|
1348
1372
|
}
|
|
1349
1373
|
set dragging(e) {
|
|
1350
|
-
c(this,
|
|
1374
|
+
c(this, Q, e);
|
|
1351
1375
|
}
|
|
1352
1376
|
get editing() {
|
|
1353
|
-
return d(this,
|
|
1377
|
+
return d(this, ee);
|
|
1354
1378
|
}
|
|
1355
1379
|
set editing(e) {
|
|
1356
|
-
c(this,
|
|
1380
|
+
c(this, ee, e);
|
|
1357
1381
|
}
|
|
1358
1382
|
get msg() {
|
|
1359
|
-
return
|
|
1383
|
+
return Oe(this.messages);
|
|
1360
1384
|
}
|
|
1361
1385
|
/** An explicit `.client`, else the page default. */
|
|
1362
1386
|
get resolvedClient() {
|
|
1363
|
-
return this.client ??
|
|
1387
|
+
return this.client ?? Te() ?? null;
|
|
1364
1388
|
}
|
|
1365
1389
|
/** The staging list, for host code that wants to inspect or persist it. */
|
|
1366
1390
|
get files() {
|
|
@@ -1386,12 +1410,19 @@ let n = (he = class extends $e {
|
|
|
1386
1410
|
*/
|
|
1387
1411
|
set config(e) {
|
|
1388
1412
|
const t = this;
|
|
1389
|
-
for (const i of
|
|
1413
|
+
for (const i of xe)
|
|
1390
1414
|
e && i in e && (t[i] = e[i]);
|
|
1391
1415
|
}
|
|
1416
|
+
/**
|
|
1417
|
+
* Changes settings on the fly. Only the keys you pass change; staged files
|
|
1418
|
+
* stay. Returns the element, so calls chain.
|
|
1419
|
+
*/
|
|
1420
|
+
configure(e) {
|
|
1421
|
+
return this.config = e, this;
|
|
1422
|
+
}
|
|
1392
1423
|
get config() {
|
|
1393
1424
|
const e = this;
|
|
1394
|
-
return Object.fromEntries(
|
|
1425
|
+
return Object.fromEntries(xe.map((t) => [t, e[t]]));
|
|
1395
1426
|
}
|
|
1396
1427
|
/** Drops every staged file and any notice. */
|
|
1397
1428
|
clear() {
|
|
@@ -1404,7 +1435,7 @@ let n = (he = class extends $e {
|
|
|
1404
1435
|
async upload() {
|
|
1405
1436
|
var g;
|
|
1406
1437
|
if (this.busy) return;
|
|
1407
|
-
const e = this.items.filter((
|
|
1438
|
+
const e = this.items.filter((s) => s.status === "ready" || s.status === "error");
|
|
1408
1439
|
if (!e.length) return;
|
|
1409
1440
|
const t = this.resolvedClient;
|
|
1410
1441
|
if (!t) {
|
|
@@ -1412,35 +1443,35 @@ let n = (he = class extends $e {
|
|
|
1412
1443
|
return;
|
|
1413
1444
|
}
|
|
1414
1445
|
this.busy = !0, this.notice = "";
|
|
1415
|
-
for (const
|
|
1416
|
-
|
|
1446
|
+
for (const s of e)
|
|
1447
|
+
s.status = "uploading", s.percent = 0, s.error = "";
|
|
1417
1448
|
this.items = [...this.items];
|
|
1418
|
-
const i = /* @__PURE__ */ new Map(),
|
|
1419
|
-
const a = { file:
|
|
1420
|
-
return this.bucket && (a.bucket = this.bucket), this.publicRead && (a.publicRead = !0),
|
|
1449
|
+
const i = /* @__PURE__ */ new Map(), n = e.map((s) => {
|
|
1450
|
+
const a = { file: s.file, filename: s.file.name };
|
|
1451
|
+
return this.bucket && (a.bucket = this.bucket), this.publicRead && (a.publicRead = !0), s.name !== s.file.name && (a.newName = s.name), Object.keys(this.metadata ?? {}).length && (a.metadata = { ...this.metadata }), Object.keys(this.options ?? {}).length && (a.options = { ...this.options }), i.set(a, s), a;
|
|
1421
1452
|
});
|
|
1422
1453
|
try {
|
|
1423
|
-
const
|
|
1454
|
+
const s = await t.files.upload(n, {
|
|
1424
1455
|
onProgress: (f) => {
|
|
1425
1456
|
const h = i.get(f.input);
|
|
1426
1457
|
h && (h.percent = f.percent, this.items = [...this.items], this.emit("singlebase-upload-progress", { file: h, percent: this.percent }));
|
|
1427
1458
|
}
|
|
1428
1459
|
});
|
|
1429
|
-
for (const f of
|
|
1460
|
+
for (const f of s.completed) {
|
|
1430
1461
|
const h = i.get(f.input);
|
|
1431
1462
|
h && (h.status = "done", h.percent = 100, h.record = f.file);
|
|
1432
1463
|
}
|
|
1433
|
-
for (const f of
|
|
1464
|
+
for (const f of s.failed) {
|
|
1434
1465
|
const h = i.get(f.input);
|
|
1435
1466
|
h && (h.status = "error", h.error = f.error.message || f.error.code);
|
|
1436
1467
|
}
|
|
1437
1468
|
this.items = [...this.items];
|
|
1438
|
-
const a =
|
|
1469
|
+
const a = s.completed.map((f) => i.get(f.input)).filter(Boolean), m = s.failed.map((f) => i.get(f.input)).filter(Boolean);
|
|
1439
1470
|
this.emit("singlebase-upload-complete", { completed: a, failed: m }), (g = this.onComplete) == null || g.call(this, { completed: a, failed: m }), m.length ? this.notice = this.msg.errUpload : this.redirect();
|
|
1440
|
-
} catch (
|
|
1471
|
+
} catch (s) {
|
|
1441
1472
|
for (const a of e)
|
|
1442
1473
|
a.status = "error", a.error = "";
|
|
1443
|
-
this.items = [...this.items], this.fail(
|
|
1474
|
+
this.items = [...this.items], this.fail(tt(s) || this.msg.errUpload);
|
|
1444
1475
|
} finally {
|
|
1445
1476
|
this.busy = !1;
|
|
1446
1477
|
}
|
|
@@ -1448,10 +1479,10 @@ let n = (he = class extends $e {
|
|
|
1448
1479
|
// ── staging ───────────────────────────────────────────────
|
|
1449
1480
|
/** The rule for this filename's extension, if the host set one. */
|
|
1450
1481
|
ruleFor(e) {
|
|
1451
|
-
const t =
|
|
1482
|
+
const t = de(e);
|
|
1452
1483
|
if (!t) return null;
|
|
1453
|
-
for (const [i,
|
|
1454
|
-
if (i.toLowerCase().replace(/^\./, "") === t) return
|
|
1484
|
+
for (const [i, n] of Object.entries(this.rules ?? {}))
|
|
1485
|
+
if (i.toLowerCase().replace(/^\./, "") === t) return n;
|
|
1455
1486
|
return null;
|
|
1456
1487
|
}
|
|
1457
1488
|
async add(e) {
|
|
@@ -1459,33 +1490,33 @@ let n = (he = class extends $e {
|
|
|
1459
1490
|
const a = this.items.filter((m) => m.status === "done" || m.status === "error");
|
|
1460
1491
|
a.forEach(w), this.items = this.items.filter((m) => !a.includes(m));
|
|
1461
1492
|
}
|
|
1462
|
-
const t = this.maxFiles > 0 ? this.maxFiles : Number.POSITIVE_INFINITY, i = [...this.items],
|
|
1463
|
-
let
|
|
1493
|
+
const t = this.maxFiles > 0 ? this.maxFiles : Number.POSITIVE_INFINITY, i = [...this.items], n = i.length, g = [];
|
|
1494
|
+
let s = "";
|
|
1464
1495
|
for (const a of Array.from(e)) {
|
|
1465
1496
|
if (i.length >= t) {
|
|
1466
|
-
|
|
1497
|
+
s = v(this.msg.errTooMany, { max: t });
|
|
1467
1498
|
break;
|
|
1468
1499
|
}
|
|
1469
|
-
if (this.accept && !
|
|
1470
|
-
|
|
1500
|
+
if (this.accept && !De(this.accept, a.name, a.type)) {
|
|
1501
|
+
s = v(this.msg.errType, { name: a.name });
|
|
1471
1502
|
continue;
|
|
1472
1503
|
}
|
|
1473
|
-
const m = this.ruleFor(a.name), f =
|
|
1504
|
+
const m = this.ruleFor(a.name), f = le((m == null ? void 0 : m.maxSize) ?? this.maxSize), h = le((m == null ? void 0 : m.minSize) ?? this.minSize);
|
|
1474
1505
|
if (f && a.size > f) {
|
|
1475
|
-
|
|
1506
|
+
s = v(this.msg.errTooLarge, { name: a.name, size: ie(f) });
|
|
1476
1507
|
continue;
|
|
1477
1508
|
}
|
|
1478
1509
|
if (h && a.size < h) {
|
|
1479
|
-
|
|
1510
|
+
s = v(this.msg.errTooSmall, { name: a.name, size: ie(h) });
|
|
1480
1511
|
continue;
|
|
1481
1512
|
}
|
|
1482
|
-
const
|
|
1483
|
-
if (i.some((
|
|
1484
|
-
|
|
1513
|
+
const re = Ee(a);
|
|
1514
|
+
if (i.some((ne) => ne.key === re)) {
|
|
1515
|
+
s = v(this.msg.errDuplicate, { name: a.name });
|
|
1485
1516
|
continue;
|
|
1486
1517
|
}
|
|
1487
1518
|
const y = {
|
|
1488
|
-
key:
|
|
1519
|
+
key: re,
|
|
1489
1520
|
file: a,
|
|
1490
1521
|
name: a.name,
|
|
1491
1522
|
// Reading bytes takes a moment, so the row appears immediately as
|
|
@@ -1496,16 +1527,16 @@ let n = (he = class extends $e {
|
|
|
1496
1527
|
record: null,
|
|
1497
1528
|
pages: null,
|
|
1498
1529
|
encrypted: null,
|
|
1499
|
-
preview:
|
|
1530
|
+
preview: et(a)
|
|
1500
1531
|
};
|
|
1501
1532
|
i.push(y), g.push(y);
|
|
1502
1533
|
}
|
|
1503
|
-
this.notice =
|
|
1534
|
+
this.notice = s, s && this.emit("singlebase-upload-rejected", { message: s }), i.length !== n && (this.items = i, this.emit("singlebase-upload-selected", { files: this.items }), await Promise.all(
|
|
1504
1535
|
g.filter((a) => a.status === "checking").map((a) => this.inspect(a, this.ruleFor(a.file.name)))
|
|
1505
1536
|
), (this.autoUpload || this.view === "button") && this.upload());
|
|
1506
1537
|
}
|
|
1507
1538
|
needsInspection(e, t) {
|
|
1508
|
-
return !e || !
|
|
1539
|
+
return !e || !qe(de(t)) ? !1 : e.maxPages !== void 0 || e.allowProtected === !1;
|
|
1509
1540
|
}
|
|
1510
1541
|
/**
|
|
1511
1542
|
* Reads the file and applies the rule. A fact the reader could not
|
|
@@ -1513,21 +1544,21 @@ let n = (he = class extends $e {
|
|
|
1513
1544
|
* the page rule simply doesn't apply to that file.
|
|
1514
1545
|
*/
|
|
1515
1546
|
async inspect(e, t) {
|
|
1516
|
-
const i = await
|
|
1547
|
+
const i = await Ke(e.file, de(e.file.name));
|
|
1517
1548
|
e.pages = i.pages, e.encrypted = i.encrypted;
|
|
1518
|
-
let
|
|
1519
|
-
t.allowProtected === !1 && i.encrypted === !0 ?
|
|
1549
|
+
let n = "";
|
|
1550
|
+
t.allowProtected === !1 && i.encrypted === !0 ? n = v(this.msg.errProtected, { name: e.name }) : t.maxPages && i.pages !== null && i.pages > t.maxPages && (n = v(this.msg.errTooManyPages, {
|
|
1520
1551
|
name: e.name,
|
|
1521
1552
|
pages: i.pages,
|
|
1522
1553
|
max: t.maxPages
|
|
1523
|
-
})),
|
|
1554
|
+
})), n ? (w(e), this.items = this.items.filter((g) => g !== e), this.notice = n, this.emit("singlebase-upload-rejected", { message: n })) : (e.status = "ready", this.items = [...this.items]);
|
|
1524
1555
|
}
|
|
1525
1556
|
/** Drops one staged file. Named for the row action, not Element.remove(). */
|
|
1526
1557
|
removeItem(e) {
|
|
1527
1558
|
this.items.filter((t) => t.key === e).forEach(w), this.items = this.items.filter((t) => t.key !== e), this.notice = "";
|
|
1528
1559
|
}
|
|
1529
1560
|
commitRename(e, t) {
|
|
1530
|
-
e.name =
|
|
1561
|
+
e.name = Le(e.file.name, t), this.editing = "", this.items = [...this.items];
|
|
1531
1562
|
}
|
|
1532
1563
|
fail(e) {
|
|
1533
1564
|
var t;
|
|
@@ -1538,7 +1569,7 @@ let n = (he = class extends $e {
|
|
|
1538
1569
|
}
|
|
1539
1570
|
redirect() {
|
|
1540
1571
|
if (!this.redirectUrl || typeof location > "u") return;
|
|
1541
|
-
const e =
|
|
1572
|
+
const e = Be(
|
|
1542
1573
|
this.redirectUrl,
|
|
1543
1574
|
location.href,
|
|
1544
1575
|
(t) => console.warn(`[singlebase-uploader] ${t}`)
|
|
@@ -1575,7 +1606,7 @@ let n = (he = class extends $e {
|
|
|
1575
1606
|
return this.items.filter((e) => e.status === "ready" || e.status === "error").length;
|
|
1576
1607
|
}
|
|
1577
1608
|
get hint() {
|
|
1578
|
-
const e =
|
|
1609
|
+
const e = Ae(this.accept), t = le(this.maxSize), i = t ? v(this.msg.hintUpTo, { size: ie(t) }) : "";
|
|
1579
1610
|
return [e, i].filter(Boolean).join(" · ");
|
|
1580
1611
|
}
|
|
1581
1612
|
renderInput() {
|
|
@@ -1596,11 +1627,12 @@ let n = (he = class extends $e {
|
|
|
1596
1627
|
/>` : this.logoText ? u`<div class="brand-mark" part="logo">${this.logoText}</div>` : x;
|
|
1597
1628
|
}
|
|
1598
1629
|
renderBranding() {
|
|
1599
|
-
return
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1630
|
+
return Ne(
|
|
1631
|
+
this.branding,
|
|
1632
|
+
this.brandingText,
|
|
1633
|
+
this.msg.brandingLabel,
|
|
1634
|
+
this.brandingUrl
|
|
1635
|
+
);
|
|
1604
1636
|
}
|
|
1605
1637
|
renderNotice() {
|
|
1606
1638
|
return this.notice ? u`<div class="banner" role="alert" part="error">${this.notice}</div>` : x;
|
|
@@ -1613,7 +1645,7 @@ let n = (he = class extends $e {
|
|
|
1613
1645
|
</div>`;
|
|
1614
1646
|
}
|
|
1615
1647
|
renderStatus(e) {
|
|
1616
|
-
const t =
|
|
1648
|
+
const t = ie(e.file.size);
|
|
1617
1649
|
if (e.status === "checking") return `${t} · ${this.msg.checking}`;
|
|
1618
1650
|
if (e.status === "uploading") return `${t} · ${this.msg.uploading}`;
|
|
1619
1651
|
if (e.status === "done") return `${t} · ${this.msg.uploaded}`;
|
|
@@ -1626,7 +1658,7 @@ let n = (he = class extends $e {
|
|
|
1626
1658
|
const t = this.allowRename && e.status === "ready";
|
|
1627
1659
|
return e.status === "uploading" || e.status, u`<div class="row" part="file">
|
|
1628
1660
|
<div class="chip" part="file-type">
|
|
1629
|
-
${e.preview ? u`<img class="thumb" src=${e.preview} alt="" part="preview" />` :
|
|
1661
|
+
${e.preview ? u`<img class="thumb" src=${e.preview} alt="" part="preview" />` : Pe(e.name) || "FILE"}
|
|
1630
1662
|
</div>
|
|
1631
1663
|
<div class="meta">
|
|
1632
1664
|
${this.editing === e.key ? u`<input
|
|
@@ -1748,11 +1780,12 @@ let n = (he = class extends $e {
|
|
|
1748
1780
|
render() {
|
|
1749
1781
|
return u`${this.renderInput()}${this.view === "button" ? this.renderButton() : this.view === "compact" ? this.renderCompact() : this.renderFull()}`;
|
|
1750
1782
|
}
|
|
1751
|
-
}, k = new WeakMap(), z = new WeakMap(), $ = new WeakMap(), U = new WeakMap(), S = new WeakMap(), M = new WeakMap(), C = new WeakMap(),
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1783
|
+
}, k = new WeakMap(), z = new WeakMap(), $ = new WeakMap(), U = new WeakMap(), S = new WeakMap(), M = new WeakMap(), C = new WeakMap(), T = new WeakMap(), j = new WeakMap(), F = new WeakMap(), O = new WeakMap(), D = new WeakMap(), E = new WeakMap(), L = new WeakMap(), A = new WeakMap(), N = new WeakMap(), P = new WeakMap(), R = new WeakMap(), B = new WeakMap(), G = new WeakMap(), I = new WeakMap(), _ = new WeakMap(), K = new WeakMap(), q = new WeakMap(), V = new WeakMap(), Y = new WeakMap(), H = new WeakMap(), J = new WeakMap(), X = new WeakMap(), W = new WeakMap(), Z = new WeakMap(), Q = new WeakMap(), ee = new WeakMap(), ve);
|
|
1784
|
+
Qe(o, "styles", [
|
|
1785
|
+
je,
|
|
1786
|
+
Re,
|
|
1787
|
+
Fe,
|
|
1788
|
+
ye`
|
|
1756
1789
|
.card {
|
|
1757
1790
|
display: flex;
|
|
1758
1791
|
flex-direction: column;
|
|
@@ -1762,7 +1795,7 @@ He(n, "styles", [
|
|
|
1762
1795
|
background: var(--sb-surface, #ffffff);
|
|
1763
1796
|
color: var(--sb-ink, #16181a);
|
|
1764
1797
|
border: 1px solid var(--sb-border, #e4e6e9);
|
|
1765
|
-
border-radius: calc(var(--sb-radius, 4px) + 4px);
|
|
1798
|
+
border-radius: calc((var(--sb-radius, 4px) + 4px) * var(--sb-radius-scale, 1));
|
|
1766
1799
|
}
|
|
1767
1800
|
|
|
1768
1801
|
.logo-img {
|
|
@@ -1804,7 +1837,7 @@ He(n, "styles", [
|
|
|
1804
1837
|
padding: 30px 20px;
|
|
1805
1838
|
text-align: center;
|
|
1806
1839
|
border: 1px dashed var(--sb-border-strong, #cdd1d6);
|
|
1807
|
-
border-radius: calc(var(--sb-radius, 4px) + 2px);
|
|
1840
|
+
border-radius: calc((var(--sb-radius, 4px) + 2px) * var(--sb-radius-scale, 1));
|
|
1808
1841
|
background: var(--sb-surface, #ffffff);
|
|
1809
1842
|
transition:
|
|
1810
1843
|
border-color 0.15s,
|
|
@@ -1844,7 +1877,7 @@ He(n, "styles", [
|
|
|
1844
1877
|
gap: 12px;
|
|
1845
1878
|
padding: 10px 12px;
|
|
1846
1879
|
border: 1px solid var(--sb-border, #e4e6e9);
|
|
1847
|
-
border-radius: calc(var(--sb-radius, 4px) + 2px);
|
|
1880
|
+
border-radius: calc((var(--sb-radius, 4px) + 2px) * var(--sb-radius-scale, 1));
|
|
1848
1881
|
background: var(--sb-surface-alt, #fafafa);
|
|
1849
1882
|
transition:
|
|
1850
1883
|
border-color 0.15s,
|
|
@@ -1891,7 +1924,7 @@ He(n, "styles", [
|
|
|
1891
1924
|
color: var(--sb-muted-ink, #61666c);
|
|
1892
1925
|
background: var(--sb-surface-alt, #fafafa);
|
|
1893
1926
|
border: 1px solid var(--sb-border, #e4e6e9);
|
|
1894
|
-
border-radius: var(--sb-radius, 4px);
|
|
1927
|
+
border-radius: calc(var(--sb-radius, 4px) * var(--sb-radius-scale, 1));
|
|
1895
1928
|
overflow: hidden;
|
|
1896
1929
|
}
|
|
1897
1930
|
|
|
@@ -1980,7 +2013,7 @@ He(n, "styles", [
|
|
|
1980
2013
|
color: var(--sb-ink, #16181a);
|
|
1981
2014
|
background: none;
|
|
1982
2015
|
border: 1px dashed var(--sb-border-strong, #cdd1d6);
|
|
1983
|
-
border-radius: calc(var(--sb-radius, 4px) + 2px);
|
|
2016
|
+
border-radius: calc((var(--sb-radius, 4px) + 2px) * var(--sb-radius-scale, 1));
|
|
1984
2017
|
}
|
|
1985
2018
|
|
|
1986
2019
|
button.add-more:hover:not(:disabled) {
|
|
@@ -1993,25 +2026,6 @@ He(n, "styles", [
|
|
|
1993
2026
|
font-size: 14px;
|
|
1994
2027
|
}
|
|
1995
2028
|
|
|
1996
|
-
.branding {
|
|
1997
|
-
text-align: center;
|
|
1998
|
-
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
1999
|
-
font-size: 10.5px;
|
|
2000
|
-
letter-spacing: 0.06em;
|
|
2001
|
-
color: var(--sb-muted-ink, #61666c);
|
|
2002
|
-
}
|
|
2003
|
-
|
|
2004
|
-
.branding a {
|
|
2005
|
-
color: inherit;
|
|
2006
|
-
text-decoration: none;
|
|
2007
|
-
}
|
|
2008
|
-
|
|
2009
|
-
.branding a:hover {
|
|
2010
|
-
color: var(--sb-ink, #16181a);
|
|
2011
|
-
text-decoration: underline;
|
|
2012
|
-
text-underline-offset: 3px;
|
|
2013
|
-
}
|
|
2014
|
-
|
|
2015
2029
|
/* the button view is just a control, not a card */
|
|
2016
2030
|
:host([view="button"]) {
|
|
2017
2031
|
display: inline-block;
|
|
@@ -2026,111 +2040,120 @@ He(n, "styles", [
|
|
|
2026
2040
|
]);
|
|
2027
2041
|
p([
|
|
2028
2042
|
b({ attribute: !1 })
|
|
2029
|
-
],
|
|
2043
|
+
], o.prototype, "client", 1);
|
|
2030
2044
|
p([
|
|
2031
2045
|
b({ attribute: !1 })
|
|
2032
|
-
],
|
|
2046
|
+
], o.prototype, "messages", 1);
|
|
2047
|
+
p([
|
|
2048
|
+
b({ reflect: !0 })
|
|
2049
|
+
], o.prototype, "theme", 1);
|
|
2033
2050
|
p([
|
|
2034
2051
|
b({ reflect: !0 })
|
|
2035
|
-
],
|
|
2052
|
+
], o.prototype, "density", 1);
|
|
2036
2053
|
p([
|
|
2037
2054
|
b({ reflect: !0 })
|
|
2038
|
-
],
|
|
2055
|
+
], o.prototype, "radius", 1);
|
|
2039
2056
|
p([
|
|
2040
2057
|
b({ reflect: !0 })
|
|
2041
|
-
],
|
|
2058
|
+
], o.prototype, "view", 1);
|
|
2042
2059
|
p([
|
|
2043
|
-
b({ converter:
|
|
2044
|
-
],
|
|
2060
|
+
b({ converter: pe })
|
|
2061
|
+
], o.prototype, "dropzone", 1);
|
|
2045
2062
|
p([
|
|
2046
|
-
b({ converter:
|
|
2047
|
-
],
|
|
2063
|
+
b({ converter: pe, attribute: "allow-rename" })
|
|
2064
|
+
], o.prototype, "allowRename", 1);
|
|
2048
2065
|
p([
|
|
2049
2066
|
b({ type: Boolean, attribute: "auto-upload" })
|
|
2050
|
-
],
|
|
2067
|
+
], o.prototype, "autoUpload", 1);
|
|
2068
|
+
p([
|
|
2069
|
+
b({ converter: pe })
|
|
2070
|
+
], o.prototype, "branding", 1);
|
|
2051
2071
|
p([
|
|
2052
|
-
b({
|
|
2053
|
-
],
|
|
2072
|
+
b({ attribute: "branding-text" })
|
|
2073
|
+
], o.prototype, "brandingText", 1);
|
|
2074
|
+
p([
|
|
2075
|
+
b({ attribute: "branding-url" })
|
|
2076
|
+
], o.prototype, "brandingUrl", 1);
|
|
2054
2077
|
p([
|
|
2055
2078
|
b({ attribute: "logo-url" })
|
|
2056
|
-
],
|
|
2079
|
+
], o.prototype, "logoUrl", 1);
|
|
2057
2080
|
p([
|
|
2058
2081
|
b({ attribute: "logo-text" })
|
|
2059
|
-
],
|
|
2082
|
+
], o.prototype, "logoText", 1);
|
|
2060
2083
|
p([
|
|
2061
2084
|
b()
|
|
2062
|
-
],
|
|
2085
|
+
], o.prototype, "heading", 1);
|
|
2063
2086
|
p([
|
|
2064
2087
|
b()
|
|
2065
|
-
],
|
|
2088
|
+
], o.prototype, "description", 1);
|
|
2066
2089
|
p([
|
|
2067
2090
|
b({ type: Number, attribute: "max-files" })
|
|
2068
|
-
],
|
|
2091
|
+
], o.prototype, "maxFiles", 1);
|
|
2069
2092
|
p([
|
|
2070
2093
|
b({ attribute: "max-size" })
|
|
2071
|
-
],
|
|
2094
|
+
], o.prototype, "maxSize", 1);
|
|
2072
2095
|
p([
|
|
2073
2096
|
b({ attribute: "min-size" })
|
|
2074
|
-
],
|
|
2097
|
+
], o.prototype, "minSize", 1);
|
|
2075
2098
|
p([
|
|
2076
2099
|
b()
|
|
2077
|
-
],
|
|
2100
|
+
], o.prototype, "accept", 1);
|
|
2078
2101
|
p([
|
|
2079
|
-
b({ converter:
|
|
2080
|
-
],
|
|
2102
|
+
b({ converter: ce })
|
|
2103
|
+
], o.prototype, "rules", 1);
|
|
2081
2104
|
p([
|
|
2082
2105
|
b()
|
|
2083
|
-
],
|
|
2106
|
+
], o.prototype, "bucket", 1);
|
|
2084
2107
|
p([
|
|
2085
|
-
b({ converter:
|
|
2086
|
-
],
|
|
2108
|
+
b({ converter: ce })
|
|
2109
|
+
], o.prototype, "metadata", 1);
|
|
2087
2110
|
p([
|
|
2088
|
-
b({ converter:
|
|
2089
|
-
],
|
|
2111
|
+
b({ converter: ce })
|
|
2112
|
+
], o.prototype, "options", 1);
|
|
2090
2113
|
p([
|
|
2091
2114
|
b({ type: Boolean, attribute: "public-read" })
|
|
2092
|
-
],
|
|
2115
|
+
], o.prototype, "publicRead", 1);
|
|
2093
2116
|
p([
|
|
2094
2117
|
b({ attribute: "redirect-url" })
|
|
2095
|
-
],
|
|
2118
|
+
], o.prototype, "redirectUrl", 1);
|
|
2096
2119
|
p([
|
|
2097
2120
|
b({ attribute: !1 })
|
|
2098
|
-
],
|
|
2121
|
+
], o.prototype, "onComplete", 1);
|
|
2099
2122
|
p([
|
|
2100
2123
|
b({ attribute: !1 })
|
|
2101
|
-
],
|
|
2124
|
+
], o.prototype, "onError", 1);
|
|
2102
2125
|
p([
|
|
2103
|
-
|
|
2104
|
-
],
|
|
2126
|
+
te()
|
|
2127
|
+
], o.prototype, "items", 1);
|
|
2105
2128
|
p([
|
|
2106
|
-
|
|
2107
|
-
],
|
|
2129
|
+
te()
|
|
2130
|
+
], o.prototype, "notice", 1);
|
|
2108
2131
|
p([
|
|
2109
|
-
|
|
2110
|
-
],
|
|
2132
|
+
te()
|
|
2133
|
+
], o.prototype, "busy", 1);
|
|
2111
2134
|
p([
|
|
2112
|
-
|
|
2113
|
-
],
|
|
2135
|
+
te()
|
|
2136
|
+
], o.prototype, "dragging", 1);
|
|
2114
2137
|
p([
|
|
2115
|
-
|
|
2116
|
-
],
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
],
|
|
2120
|
-
function
|
|
2138
|
+
te()
|
|
2139
|
+
], o.prototype, "editing", 1);
|
|
2140
|
+
o = p([
|
|
2141
|
+
Ce("singlebase-uploader")
|
|
2142
|
+
], o);
|
|
2143
|
+
function et(r) {
|
|
2121
2144
|
return !r.type.startsWith("image/") || typeof URL.createObjectURL != "function" ? "" : URL.createObjectURL(r);
|
|
2122
2145
|
}
|
|
2123
2146
|
function w(r) {
|
|
2124
2147
|
r.preview && URL.revokeObjectURL(r.preview);
|
|
2125
2148
|
}
|
|
2126
|
-
function
|
|
2149
|
+
function tt(r) {
|
|
2127
2150
|
return r instanceof Error ? r.message : "";
|
|
2128
2151
|
}
|
|
2129
2152
|
export {
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2153
|
+
o as S,
|
|
2154
|
+
qe as a,
|
|
2155
|
+
Ke as i,
|
|
2156
|
+
Be as r,
|
|
2157
|
+
Re as s
|
|
2135
2158
|
};
|
|
2136
|
-
//# sourceMappingURL=uploader-
|
|
2159
|
+
//# sourceMappingURL=uploader-vfczkX51.js.map
|