@openrails/contentkit-ui 0.85.1 → 0.86.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/README.md +7 -4
- package/dist/client/beacons.d.ts +13 -4
- package/dist/client/beacons.js +14 -7
- package/dist/client/beacons.js.map +1 -1
- package/dist/client/client.d.ts +3 -0
- package/dist/client/client.js +29 -27
- package/dist/client/client.js.map +1 -1
- package/dist/client/codes.d.ts +6 -1
- package/dist/client/codes.js +4 -1
- package/dist/client/codes.js.map +1 -1
- package/dist/client/generated/error-codes.js +1 -1
- package/dist/client/generated/error-codes.js.map +1 -1
- package/dist/client/generated/routes.d.ts +14 -1
- package/dist/client/generated/routes.js +17 -1
- package/dist/client/generated/routes.js.map +1 -1
- package/dist/client/generated/wire.d.ts +29 -0
- package/dist/client/generated/wire.js.map +1 -1
- package/dist/client/index.d.ts +2 -1
- package/dist/client/media/queue.d.ts +4 -2
- package/dist/client/media/queue.js +18 -12
- package/dist/client/media/queue.js.map +1 -1
- package/dist/client/media/rules.d.ts +7 -1
- package/dist/client/media/rules.js +27 -21
- package/dist/client/media/rules.js.map +1 -1
- package/dist/client/stats.d.ts +32 -0
- package/dist/client/stats.js +35 -0
- package/dist/client/stats.js.map +1 -0
- package/dist/client.js +30 -29
- package/dist/components/admin/content-manager.js +206 -206
- package/dist/components/admin/content-manager.js.map +1 -1
- package/dist/components/admin/group-manager.js +71 -70
- package/dist/components/admin/group-manager.js.map +1 -1
- package/dist/components/admin/media-item-panel.d.ts +24 -7
- package/dist/components/admin/media-item-panel.js +209 -197
- package/dist/components/admin/media-item-panel.js.map +1 -1
- package/dist/components/admin/poll-manager.js +25 -25
- package/dist/components/admin/stats-dashboard.d.ts +22 -0
- package/dist/components/admin/stats-dashboard.js +257 -0
- package/dist/components/admin/stats-dashboard.js.map +1 -0
- package/dist/components/content/card.js +42 -42
- package/dist/components/content/card.js.map +1 -1
- package/dist/components/content/editors.js +455 -427
- package/dist/components/content/editors.js.map +1 -1
- package/dist/components/content/grid.js +47 -47
- package/dist/components/content/index.d.ts +2 -1
- package/dist/components/content/listing.js +34 -34
- package/dist/components/content/listing.js.map +1 -1
- package/dist/components/content/paywall.d.ts +17 -5
- package/dist/components/content/paywall.js +115 -100
- package/dist/components/content/paywall.js.map +1 -1
- package/dist/components/content/reader-stats.d.ts +12 -0
- package/dist/components/content/reader-stats.js +47 -0
- package/dist/components/content/reader-stats.js.map +1 -0
- package/dist/components/groups/banner.js +33 -33
- package/dist/components/groups/directory.js +11 -11
- package/dist/components/groups/editor.js +293 -293
- package/dist/components/groups/editor.js.map +1 -1
- package/dist/components/groups/header.js +27 -27
- package/dist/components/groups/header.js.map +1 -1
- package/dist/components/groups/memberships.js +180 -180
- package/dist/components/groups/parts.d.ts +0 -2
- package/dist/components/groups/parts.js +9 -27
- package/dist/components/groups/parts.js.map +1 -1
- package/dist/components/media-folder-editor.js +239 -189
- package/dist/components/media-folder-editor.js.map +1 -1
- package/dist/components/notifications.js +17 -17
- package/dist/components/slot-upload.d.ts +2 -2
- package/dist/components/slot-upload.js +84 -79
- package/dist/components/slot-upload.js.map +1 -1
- package/dist/components/social/bans.js +34 -34
- package/dist/components/social/moderation.js +52 -48
- package/dist/components/social/moderation.js.map +1 -1
- package/dist/components/video-player.d.ts +2 -0
- package/dist/components/video-player.js +318 -314
- package/dist/components/video-player.js.map +1 -1
- package/dist/i18n/context.d.ts +2 -0
- package/dist/i18n/context.js +23 -5
- package/dist/i18n/context.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +12 -10
- package/dist/locales/admin/de.js +27 -0
- package/dist/locales/admin/de.js.map +1 -1
- package/dist/locales/admin/en.d.ts +27 -0
- package/dist/locales/admin/en.js +27 -0
- package/dist/locales/admin/en.js.map +1 -1
- package/dist/locales/admin/es.js +27 -0
- package/dist/locales/admin/es.js.map +1 -1
- package/dist/locales/admin/ja.js +27 -0
- package/dist/locales/admin/ja.js.map +1 -1
- package/dist/locales/admin/ko.js +27 -0
- package/dist/locales/admin/ko.js.map +1 -1
- package/dist/locales/admin/zh.js +27 -0
- package/dist/locales/admin/zh.js.map +1 -1
- package/dist/locales/content/de.js +6 -0
- package/dist/locales/content/de.js.map +1 -1
- package/dist/locales/content/en.d.ts +6 -0
- package/dist/locales/content/en.js +6 -0
- package/dist/locales/content/en.js.map +1 -1
- package/dist/locales/content/es.js +6 -0
- package/dist/locales/content/es.js.map +1 -1
- package/dist/locales/content/ja.js +6 -0
- package/dist/locales/content/ja.js.map +1 -1
- package/dist/locales/content/ko.js +6 -0
- package/dist/locales/content/ko.js.map +1 -1
- package/dist/locales/content/zh.js +6 -0
- package/dist/locales/content/zh.js.map +1 -1
- package/dist/locales/de.js +1 -0
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/en.d.ts +34 -0
- package/dist/locales/en.js +1 -0
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es.js +1 -0
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/ja.js +1 -0
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/ko.js +1 -0
- package/dist/locales/ko.js.map +1 -1
- package/dist/locales/zh.js +1 -0
- package/dist/locales/zh.js.map +1 -1
- package/dist/react/admin.js +22 -23
- package/dist/react/admin.js.map +1 -1
- package/dist/react/canonical.d.ts +4 -3
- package/dist/react/canonical.js +34 -33
- package/dist/react/canonical.js.map +1 -1
- package/dist/react/contents.js +144 -144
- package/dist/react/contents.js.map +1 -1
- package/dist/react/detail.d.ts +12 -6
- package/dist/react/detail.js +31 -24
- package/dist/react/detail.js.map +1 -1
- package/dist/react/folder.d.ts +7 -2
- package/dist/react/folder.js +165 -147
- package/dist/react/folder.js.map +1 -1
- package/dist/react/groups.d.ts +0 -1
- package/dist/react/groups.js +13 -12
- package/dist/react/groups.js.map +1 -1
- package/dist/react/index.d.ts +4 -2
- package/dist/react/location.d.ts +11 -0
- package/dist/react/location.js +18 -0
- package/dist/react/location.js.map +1 -0
- package/dist/react/public.d.ts +8 -0
- package/dist/react/public.js +32 -27
- package/dist/react/public.js.map +1 -1
- package/dist/react/stats.d.ts +24 -0
- package/dist/react/stats.js +28 -0
- package/dist/react/stats.js.map +1 -0
- package/dist/react/use-resource.js +8 -7
- package/dist/react/use-resource.js.map +1 -1
- package/dist/react/versions.js +20 -20
- package/dist/react.js +26 -24
- package/dist/styles.css +1 -1
- package/dist/urls/index.d.ts +35 -10
- package/dist/urls.js +100 -70
- package/dist/urls.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,15 +11,15 @@ import { isProcessing as u } from "../client/media/windows.js";
|
|
|
11
11
|
import { Alert as d, AlertDescription as f, AlertTitle as p } from "../ui/alert.js";
|
|
12
12
|
import { Button as m } from "../ui/button.js";
|
|
13
13
|
import { progressLabel as h, progressValue as g } from "./progress.js";
|
|
14
|
-
import { ImageCropDialog as
|
|
15
|
-
import { isAudioType as
|
|
16
|
-
import { useEditorCrop as
|
|
17
|
-
import { nameIn as
|
|
18
|
-
import { SortableList as
|
|
19
|
-
import { useEffect as
|
|
20
|
-
import { Fragment as
|
|
21
|
-
import { cn as
|
|
22
|
-
import { Alert02Icon as
|
|
14
|
+
import { ImageCropDialog as _ } from "./image-crop-dialog.js";
|
|
15
|
+
import { isAudioType as v, isImageType as y, isSubtitleType as b, isVideoType as x } from "../client/gallery.js";
|
|
16
|
+
import { useEditorCrop as S } from "../react/crop.js";
|
|
17
|
+
import { nameIn as C, thumbnailOf as w, useMediaFolder as T } from "../react/folder.js";
|
|
18
|
+
import { SortableList as E } from "./sortable-list.js";
|
|
19
|
+
import { useEffect as D, useImperativeHandle as ee, useMemo as O, useRef as te, useState as k } from "react";
|
|
20
|
+
import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
21
|
+
import { cn as N } from "cn";
|
|
22
|
+
import { Alert02Icon as P, CropIcon as F, Delete02Icon as I, Edit02Icon as L, File01Icon as R, Image01Icon as z, ImageAdd01Icon as ne, Loading03Icon as re, MusicNote01Icon as B, Refresh01Icon as V, RepeatIcon as H, Video01Icon as U } from "@hugeicons/core-free-icons";
|
|
23
23
|
import { HugeiconsIcon as W } from "@hugeicons/react";
|
|
24
24
|
//#region src/components/media-folder-editor.tsx
|
|
25
25
|
var ie = [
|
|
@@ -29,14 +29,14 @@ var ie = [
|
|
|
29
29
|
"16:9"
|
|
30
30
|
];
|
|
31
31
|
function G(e) {
|
|
32
|
-
return
|
|
32
|
+
return y(e) ? "image" : x(e) ? "video" : v(e) ? "audio" : b(e) ? "subtitle" : "file";
|
|
33
33
|
}
|
|
34
34
|
var K = {
|
|
35
|
-
image:
|
|
35
|
+
image: z,
|
|
36
36
|
video: U,
|
|
37
37
|
audio: B,
|
|
38
|
-
subtitle:
|
|
39
|
-
file:
|
|
38
|
+
subtitle: R,
|
|
39
|
+
file: R
|
|
40
40
|
};
|
|
41
41
|
function q(e) {
|
|
42
42
|
let t = new Set((e?.types ?? []).map(G));
|
|
@@ -60,16 +60,16 @@ function ae(e, t) {
|
|
|
60
60
|
function oe(e) {
|
|
61
61
|
if (e.folder) {
|
|
62
62
|
let { folder: n, ...r } = e;
|
|
63
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ j(J, {
|
|
64
64
|
folder: n,
|
|
65
65
|
...r
|
|
66
66
|
}, n.ref ? t(n.ref) : "");
|
|
67
67
|
}
|
|
68
|
-
return /* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ j(se, { ...e }, t(e.item));
|
|
69
69
|
}
|
|
70
70
|
function se(e) {
|
|
71
|
-
let { item: t, ref: n, label: r, toolbar: i, rowActions: a, footer: o, aspects: s, confirmRemove: c, disabled: l, className: u, appearance: d, ...f } = e, p =
|
|
72
|
-
return /* @__PURE__ */
|
|
71
|
+
let { item: t, ref: n, label: r, toolbar: i, rowActions: a, footer: o, aspects: s, confirmRemove: c, disabled: l, className: u, appearance: d, ...f } = e, p = T(t, f);
|
|
72
|
+
return /* @__PURE__ */ j(J, {
|
|
73
73
|
folder: p,
|
|
74
74
|
ref: n,
|
|
75
75
|
label: r,
|
|
@@ -88,57 +88,57 @@ var ce = {
|
|
|
88
88
|
id: ""
|
|
89
89
|
};
|
|
90
90
|
function J(e) {
|
|
91
|
-
let { folder: t, ref: n, label: i, toolbar: a, rowActions: c, footer: l, aspects: u = ie, confirmRemove: h, disabled: g, className:
|
|
92
|
-
|
|
91
|
+
let { folder: t, ref: n, label: i, toolbar: a, rowActions: c, footer: l, aspects: u = ie, confirmRemove: h, disabled: g, className: v, appearance: y } = e, { t: b, error: x } = o(), { groups: C, queue: w, read: T, options: O } = t;
|
|
92
|
+
ee(n, () => ({
|
|
93
93
|
discard: t.discard,
|
|
94
94
|
commit: t.commit,
|
|
95
95
|
folder: t
|
|
96
96
|
}), [t]);
|
|
97
|
-
let
|
|
98
|
-
|
|
97
|
+
let A = O.commit === "auto", F = C.flatMap((e) => e.rule ? [e.rule] : []), L = r(F), R = t.uploads.length + w.items.length + t.waiting.length + t.pending.length === 0, z = !!g, [B, V] = k(/* @__PURE__ */ new Set());
|
|
98
|
+
D(() => {
|
|
99
99
|
let e = new Set(t.uploads.map((e) => e.path));
|
|
100
100
|
V((t) => [...t].every((t) => e.has(t)) ? t : new Set([...t].filter((t) => e.has(t))));
|
|
101
101
|
}, [t.uploads]);
|
|
102
|
-
let [H, U] =
|
|
103
|
-
client:
|
|
104
|
-
onError:
|
|
102
|
+
let [H, U] = k(null), K = S(t.ref ?? ce, H, {
|
|
103
|
+
client: O.client,
|
|
104
|
+
onError: O.onError,
|
|
105
105
|
onSaved: () => U(null)
|
|
106
|
-
}), q = H ?
|
|
106
|
+
}), q = H ? C.find((e) => e.files.some((e) => e.path === H))?.rule : void 0, [oe, se] = k(null), J = te(null), [X, Z] = k(null), [Q, $] = k(!1), fe = {
|
|
107
107
|
onDragOver: (e) => {
|
|
108
|
-
!
|
|
108
|
+
!z && e.dataTransfer.types.includes("Files") && (e.preventDefault(), $(!0));
|
|
109
109
|
},
|
|
110
110
|
onDragLeave: (e) => {
|
|
111
111
|
e.currentTarget.contains(e.relatedTarget) || $(!1);
|
|
112
112
|
},
|
|
113
113
|
onDrop: (e) => {
|
|
114
|
-
!
|
|
114
|
+
!z && e.dataTransfer.files.length && (e.preventDefault(), $(!1), t.add(e.dataTransfer.files));
|
|
115
115
|
}
|
|
116
|
-
},
|
|
116
|
+
}, pe = async () => {
|
|
117
117
|
let e = [...B];
|
|
118
|
-
(h === !1 || (h ? await h(e.length) : globalThis.confirm?.(
|
|
119
|
-
},
|
|
120
|
-
className:
|
|
118
|
+
(h === !1 || (h ? await h(e.length) : globalThis.confirm?.(b("folder.confirmRemove", { count: e.length })) ?? !0)) && await t.remove(e).then(() => V(/* @__PURE__ */ new Set()), () => {});
|
|
119
|
+
}, me = w.items.filter((e) => e.status === "uploaded").length + t.pending.length, he = (e) => /* @__PURE__ */ M("label", {
|
|
120
|
+
className: N(e ? "flex cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border px-4 py-8 text-center text-sm text-muted-foreground transition-colors hover:border-primary hover:bg-primary/5" : "inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-md border border-border bg-background px-2.5 text-sm font-medium transition-colors hover:bg-muted focus-within:ring-3 focus-within:ring-ring/50", e && Q && "border-primary bg-primary/5", z && "pointer-events-none opacity-50"),
|
|
121
121
|
"data-ckui": e ? "folder-drop" : "folder-add",
|
|
122
122
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
icon:
|
|
123
|
+
/* @__PURE__ */ j(W, {
|
|
124
|
+
icon: ne,
|
|
125
125
|
strokeWidth: 1.75,
|
|
126
126
|
className: e ? "size-7" : "size-4"
|
|
127
127
|
}),
|
|
128
|
-
e ? /* @__PURE__ */
|
|
128
|
+
e ? /* @__PURE__ */ j("strong", {
|
|
129
129
|
className: "font-medium text-foreground",
|
|
130
|
-
children:
|
|
131
|
-
}) :
|
|
132
|
-
e &&
|
|
130
|
+
children: b("folder.drop")
|
|
131
|
+
}) : b("folder.add"),
|
|
132
|
+
e && F.length > 0 && /* @__PURE__ */ j("span", {
|
|
133
133
|
className: "text-xs",
|
|
134
|
-
children: ae(
|
|
134
|
+
children: ae(b, F)
|
|
135
135
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ j("input", {
|
|
137
137
|
type: "file",
|
|
138
138
|
multiple: !0,
|
|
139
|
-
accept:
|
|
139
|
+
accept: L,
|
|
140
140
|
className: "sr-only",
|
|
141
|
-
disabled:
|
|
141
|
+
disabled: z,
|
|
142
142
|
"data-ckui": "file",
|
|
143
143
|
onChange: (e) => {
|
|
144
144
|
t.add([...e.target.files ?? []]), e.target.value = "";
|
|
@@ -146,118 +146,118 @@ function J(e) {
|
|
|
146
146
|
})
|
|
147
147
|
]
|
|
148
148
|
});
|
|
149
|
-
return /* @__PURE__ */
|
|
150
|
-
appearance:
|
|
151
|
-
className:
|
|
149
|
+
return /* @__PURE__ */ M(s, {
|
|
150
|
+
appearance: y,
|
|
151
|
+
className: N("grid gap-3", v),
|
|
152
152
|
"data-ckui": "media-folder",
|
|
153
153
|
"data-over": Q ? "" : void 0,
|
|
154
|
-
...
|
|
154
|
+
...fe,
|
|
155
155
|
children: [
|
|
156
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ M("div", {
|
|
157
157
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
158
158
|
"data-ckui": "folder-header",
|
|
159
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ j("h3", {
|
|
160
160
|
className: "text-sm font-semibold",
|
|
161
|
-
children: i ??
|
|
162
|
-
}), /* @__PURE__ */
|
|
161
|
+
children: i ?? b("folder.label")
|
|
162
|
+
}), /* @__PURE__ */ M("div", {
|
|
163
163
|
className: "flex flex-wrap items-center gap-2",
|
|
164
|
-
children: [a, !
|
|
164
|
+
children: [a, !R && he(!1)]
|
|
165
165
|
})]
|
|
166
166
|
}),
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
R && (T.read || !t.ref) && he(!0),
|
|
168
|
+
R && !T.read && T.loading && /* @__PURE__ */ j("div", {
|
|
169
169
|
className: "flex justify-center py-6 text-muted-foreground",
|
|
170
170
|
"data-ckui": "folder-loading",
|
|
171
|
-
children: /* @__PURE__ */
|
|
172
|
-
icon:
|
|
171
|
+
children: /* @__PURE__ */ j(W, {
|
|
172
|
+
icon: re,
|
|
173
173
|
strokeWidth: 2,
|
|
174
174
|
className: "size-5 motion-safe:animate-spin"
|
|
175
175
|
})
|
|
176
176
|
}),
|
|
177
|
-
t.refused.length > 0 && /* @__PURE__ */
|
|
177
|
+
t.refused.length > 0 && /* @__PURE__ */ M(d, {
|
|
178
178
|
variant: "destructive",
|
|
179
179
|
role: "alert",
|
|
180
180
|
"data-ckui": "folder-refused",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
182
|
-
icon:
|
|
181
|
+
children: [/* @__PURE__ */ j(W, {
|
|
182
|
+
icon: P,
|
|
183
183
|
strokeWidth: 2
|
|
184
|
-
}), /* @__PURE__ */
|
|
184
|
+
}), /* @__PURE__ */ M(f, { children: [/* @__PURE__ */ j("ul", {
|
|
185
185
|
className: "grid gap-0.5",
|
|
186
|
-
children: t.refused.map((e, t) => /* @__PURE__ */
|
|
187
|
-
/* @__PURE__ */
|
|
186
|
+
children: t.refused.map((e, t) => /* @__PURE__ */ M("li", { children: [
|
|
187
|
+
/* @__PURE__ */ j("span", {
|
|
188
188
|
className: "font-medium",
|
|
189
189
|
children: e.file.name
|
|
190
190
|
}),
|
|
191
191
|
": ",
|
|
192
|
-
|
|
192
|
+
x(e.error)
|
|
193
193
|
] }, t))
|
|
194
|
-
}), /* @__PURE__ */
|
|
194
|
+
}), /* @__PURE__ */ j(m, {
|
|
195
195
|
variant: "outline",
|
|
196
196
|
size: "xs",
|
|
197
197
|
className: "mt-1 w-fit",
|
|
198
198
|
onClick: t.dismiss,
|
|
199
|
-
children:
|
|
199
|
+
children: b("folder.dismiss")
|
|
200
200
|
})] })]
|
|
201
201
|
}),
|
|
202
|
-
|
|
202
|
+
w.blocked && /* @__PURE__ */ M(d, {
|
|
203
203
|
variant: "destructive",
|
|
204
204
|
role: "alert",
|
|
205
205
|
"data-ckui": "folder-paused",
|
|
206
206
|
children: [
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
icon:
|
|
207
|
+
/* @__PURE__ */ j(W, {
|
|
208
|
+
icon: P,
|
|
209
209
|
strokeWidth: 2
|
|
210
210
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ j(p, { children: b("folder.paused") }),
|
|
212
|
+
/* @__PURE__ */ M(f, { children: [x(w.blocked), /* @__PURE__ */ j(m, {
|
|
213
213
|
variant: "outline",
|
|
214
214
|
size: "xs",
|
|
215
215
|
className: "mt-1 w-fit",
|
|
216
|
-
onClick: () =>
|
|
217
|
-
children:
|
|
216
|
+
onClick: () => w.start(),
|
|
217
|
+
children: b("folder.resume")
|
|
218
218
|
})] })
|
|
219
219
|
]
|
|
220
220
|
}),
|
|
221
|
-
t.error && /* @__PURE__ */
|
|
221
|
+
t.error && /* @__PURE__ */ M(d, {
|
|
222
222
|
variant: "destructive",
|
|
223
223
|
role: "alert",
|
|
224
224
|
"data-ckui": "folder-error",
|
|
225
|
-
children: [/* @__PURE__ */
|
|
226
|
-
icon:
|
|
225
|
+
children: [/* @__PURE__ */ j(W, {
|
|
226
|
+
icon: P,
|
|
227
227
|
strokeWidth: 2
|
|
228
|
-
}), /* @__PURE__ */
|
|
228
|
+
}), /* @__PURE__ */ j(f, { children: x(t.error) })]
|
|
229
229
|
}),
|
|
230
|
-
B.size > 0 && /* @__PURE__ */
|
|
230
|
+
B.size > 0 && /* @__PURE__ */ M("div", {
|
|
231
231
|
className: "flex flex-wrap items-center gap-2 rounded-md bg-muted px-3 py-1.5 text-sm",
|
|
232
232
|
"data-ckui": "folder-selection",
|
|
233
233
|
children: [
|
|
234
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ j("span", {
|
|
235
235
|
className: "tabular-nums",
|
|
236
|
-
children:
|
|
236
|
+
children: b("folder.selected", { count: B.size })
|
|
237
237
|
}),
|
|
238
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ M(m, {
|
|
239
239
|
variant: "destructive",
|
|
240
240
|
size: "xs",
|
|
241
|
-
disabled:
|
|
242
|
-
onClick: () => void
|
|
243
|
-
children: [/* @__PURE__ */
|
|
244
|
-
icon:
|
|
241
|
+
disabled: z || t.updating,
|
|
242
|
+
onClick: () => void pe(),
|
|
243
|
+
children: [/* @__PURE__ */ j(W, {
|
|
244
|
+
icon: I,
|
|
245
245
|
strokeWidth: 2
|
|
246
|
-
}),
|
|
246
|
+
}), b("folder.removeSelected")]
|
|
247
247
|
}),
|
|
248
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ j(m, {
|
|
249
249
|
variant: "ghost",
|
|
250
250
|
size: "xs",
|
|
251
251
|
onClick: () => V(/* @__PURE__ */ new Set()),
|
|
252
|
-
children:
|
|
252
|
+
children: b("folder.clearSelection")
|
|
253
253
|
})
|
|
254
254
|
]
|
|
255
255
|
}),
|
|
256
|
-
|
|
256
|
+
C.map((e) => e.files.length ? /* @__PURE__ */ j(le, {
|
|
257
257
|
group: e,
|
|
258
|
-
titled:
|
|
258
|
+
titled: C.length > 1,
|
|
259
259
|
folder: t,
|
|
260
|
-
disabled:
|
|
260
|
+
disabled: z,
|
|
261
261
|
selected: B,
|
|
262
262
|
onSelect: (e, t) => V((n) => t ? /* @__PURE__ */ new Set([...n, e]) : new Set([...n].filter((t) => t !== e))),
|
|
263
263
|
renaming: oe,
|
|
@@ -268,61 +268,72 @@ function J(e) {
|
|
|
268
268
|
},
|
|
269
269
|
rowActions: c
|
|
270
270
|
}, e.path) : null),
|
|
271
|
-
t.waiting.length > 0 && /* @__PURE__ */
|
|
271
|
+
t.waiting.length > 0 && /* @__PURE__ */ j("ul", {
|
|
272
272
|
className: "grid",
|
|
273
|
-
"aria-label":
|
|
274
|
-
children: t.waiting.map((e, t) => /* @__PURE__ */
|
|
273
|
+
"aria-label": b("folder.label"),
|
|
274
|
+
children: t.waiting.map((e, t) => /* @__PURE__ */ M("li", {
|
|
275
275
|
className: "flex min-h-11 items-center gap-2 px-1",
|
|
276
276
|
"data-ckui": "queue-row",
|
|
277
277
|
"data-status": "waiting",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ j(Y, { kind: G(e.type) }), /* @__PURE__ */ M("div", {
|
|
279
279
|
className: "grid min-w-0 flex-1 gap-1",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ j("span", {
|
|
281
281
|
className: "truncate text-sm",
|
|
282
282
|
children: e.name
|
|
283
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ j("span", {
|
|
284
284
|
className: "text-xs text-muted-foreground",
|
|
285
285
|
"data-ckui": "queue-status",
|
|
286
|
-
children:
|
|
286
|
+
children: b("folder.queued")
|
|
287
287
|
})]
|
|
288
288
|
})]
|
|
289
289
|
}, t))
|
|
290
290
|
}),
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
t.pending.length > 0 && /* @__PURE__ */ j("ul", {
|
|
292
|
+
className: "grid",
|
|
293
|
+
"aria-label": b("folder.label"),
|
|
294
|
+
"data-ckui": "folder-pending",
|
|
295
|
+
children: t.pending.map((e) => /* @__PURE__ */ j(ue, {
|
|
296
|
+
file: e,
|
|
297
|
+
folder: t,
|
|
298
|
+
auto: A,
|
|
299
|
+
disabled: z
|
|
300
|
+
}, e.path))
|
|
301
|
+
}),
|
|
302
|
+
w.items.length > 0 && /* @__PURE__ */ j(E, {
|
|
303
|
+
items: w.items,
|
|
293
304
|
id: (e) => e.id,
|
|
294
305
|
name: (e) => e.file.name,
|
|
295
|
-
disabled:
|
|
296
|
-
label:
|
|
297
|
-
onMove: (e, t) =>
|
|
306
|
+
disabled: A || z,
|
|
307
|
+
label: b("folder.label"),
|
|
308
|
+
onMove: (e, t) => w.move(w.items[e].id, t),
|
|
298
309
|
row: (e) => ({
|
|
299
310
|
className: "flex min-h-11 items-center gap-2 px-1",
|
|
300
311
|
"data-ckui": "queue-row",
|
|
301
312
|
"data-status": e.status
|
|
302
313
|
}),
|
|
303
|
-
children: (e, n) => /* @__PURE__ */
|
|
314
|
+
children: (e, n) => /* @__PURE__ */ j(de, {
|
|
304
315
|
item: e,
|
|
305
|
-
handle:
|
|
306
|
-
auto:
|
|
316
|
+
handle: A ? null : n,
|
|
317
|
+
auto: A,
|
|
307
318
|
folder: t
|
|
308
319
|
})
|
|
309
320
|
}),
|
|
310
|
-
(!
|
|
321
|
+
(!A && me > 0 || A && t.error && me > 0) && /* @__PURE__ */ M(m, {
|
|
311
322
|
className: "w-fit",
|
|
312
|
-
disabled:
|
|
323
|
+
disabled: z || w.items.length > 0 && !w.ready || t.committing,
|
|
313
324
|
onClick: () => void t.commit().catch(() => {}),
|
|
314
325
|
"data-ckui": "folder-commit",
|
|
315
|
-
children: [t.committing && /* @__PURE__ */
|
|
316
|
-
icon:
|
|
326
|
+
children: [t.committing && /* @__PURE__ */ j(W, {
|
|
327
|
+
icon: re,
|
|
317
328
|
strokeWidth: 2,
|
|
318
329
|
className: "motion-safe:animate-spin"
|
|
319
|
-
}),
|
|
330
|
+
}), A ? b("folder.commitAgain") : b("folder.commit", { count: w.items.filter((e) => e.status !== "committed").length + t.pending.length })]
|
|
320
331
|
}),
|
|
321
332
|
l,
|
|
322
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ j("input", {
|
|
323
334
|
ref: J,
|
|
324
335
|
type: "file",
|
|
325
|
-
accept:
|
|
336
|
+
accept: L,
|
|
326
337
|
className: "sr-only",
|
|
327
338
|
tabIndex: -1,
|
|
328
339
|
"aria-hidden": !0,
|
|
@@ -331,7 +342,7 @@ function J(e) {
|
|
|
331
342
|
e.target.value = "", n && X && t.replace(X, n).catch(() => {}), Z(null);
|
|
332
343
|
}
|
|
333
344
|
}),
|
|
334
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ j(_, {
|
|
335
346
|
open: !!H,
|
|
336
347
|
onOpenChange: (e) => !e && K.status !== "saving" && U(null),
|
|
337
348
|
source: "source" in K ? K.source ?? null : null,
|
|
@@ -339,9 +350,9 @@ function J(e) {
|
|
|
339
350
|
aspects: q?.aspect ? void 0 : u,
|
|
340
351
|
initialEdit: "edit" in K ? K.edit : null,
|
|
341
352
|
minWidth: q?.min_width,
|
|
342
|
-
title:
|
|
353
|
+
title: b("folder.crop"),
|
|
343
354
|
busy: K.status === "saving",
|
|
344
|
-
error: K.status === "error" ?
|
|
355
|
+
error: K.status === "error" ? x(K.error) : void 0,
|
|
345
356
|
onConfirm: (e) => void K.save(e)
|
|
346
357
|
})
|
|
347
358
|
]
|
|
@@ -349,21 +360,21 @@ function J(e) {
|
|
|
349
360
|
}
|
|
350
361
|
function le({ group: e, titled: t, folder: n, disabled: r, selected: i, onSelect: a, renaming: s, onRename: c, onCrop: l, onReplace: u, rowActions: d }) {
|
|
351
362
|
let { t: f } = o(), p = f(`folder.kinds.${q(e.rule)}`), m = e.rule?.max;
|
|
352
|
-
return /* @__PURE__ */
|
|
363
|
+
return /* @__PURE__ */ M("section", {
|
|
353
364
|
className: "grid gap-1",
|
|
354
365
|
"data-ckui": "folder-group",
|
|
355
366
|
"data-path": e.path,
|
|
356
|
-
children: [t && /* @__PURE__ */
|
|
367
|
+
children: [t && /* @__PURE__ */ M("h4", {
|
|
357
368
|
className: "px-1 text-xs font-medium text-muted-foreground tabular-nums",
|
|
358
369
|
children: [
|
|
359
370
|
p,
|
|
360
371
|
" · ",
|
|
361
372
|
m ? `${e.files.length} / ${m}` : e.files.length
|
|
362
373
|
]
|
|
363
|
-
}), /* @__PURE__ */
|
|
374
|
+
}), /* @__PURE__ */ j(E, {
|
|
364
375
|
items: e.files,
|
|
365
376
|
id: (e) => e.path,
|
|
366
|
-
name: (t) =>
|
|
377
|
+
name: (t) => C(e, t.path),
|
|
367
378
|
disabled: r || n.updating,
|
|
368
379
|
label: p,
|
|
369
380
|
onMove: (t, r) => void n.move(e.files[t].path, r).catch(() => {}),
|
|
@@ -372,7 +383,7 @@ function le({ group: e, titled: t, folder: n, disabled: r, selected: i, onSelect
|
|
|
372
383
|
"data-ckui": "upload-row",
|
|
373
384
|
"data-path": e.path
|
|
374
385
|
}),
|
|
375
|
-
children: (t, o) => /* @__PURE__ */
|
|
386
|
+
children: (t, o) => /* @__PURE__ */ j(X, {
|
|
376
387
|
file: t,
|
|
377
388
|
group: e,
|
|
378
389
|
handle: o,
|
|
@@ -390,135 +401,135 @@ function le({ group: e, titled: t, folder: n, disabled: r, selected: i, onSelect
|
|
|
390
401
|
});
|
|
391
402
|
}
|
|
392
403
|
function Y({ kind: e, url: t, busy: n }) {
|
|
393
|
-
return /* @__PURE__ */
|
|
404
|
+
return /* @__PURE__ */ M("span", {
|
|
394
405
|
className: "relative flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-md bg-muted text-muted-foreground",
|
|
395
406
|
"data-ckui": "thumb",
|
|
396
|
-
children: [t ? /* @__PURE__ */
|
|
407
|
+
children: [t ? /* @__PURE__ */ j("img", {
|
|
397
408
|
src: t,
|
|
398
409
|
alt: "",
|
|
399
410
|
loading: "lazy",
|
|
400
411
|
decoding: "async",
|
|
401
412
|
className: "size-full object-cover"
|
|
402
|
-
}) : /* @__PURE__ */
|
|
413
|
+
}) : /* @__PURE__ */ j(W, {
|
|
403
414
|
icon: K[e],
|
|
404
415
|
strokeWidth: 1.75,
|
|
405
416
|
className: "size-4.5"
|
|
406
|
-
}), n && !t && /* @__PURE__ */
|
|
417
|
+
}), n && !t && /* @__PURE__ */ j("span", {
|
|
407
418
|
"aria-hidden": !0,
|
|
408
419
|
className: "absolute inset-1.5 rounded-full border-2 border-current/25 border-t-current motion-safe:animate-spin"
|
|
409
420
|
})]
|
|
410
421
|
});
|
|
411
422
|
}
|
|
412
|
-
function X({ file: t, group: r, handle: i, folder: a, disabled: s, selected: c, onSelect: d, renaming: f, onRename: p, onCrop: h, onReplace: g, actions:
|
|
413
|
-
let { t:
|
|
414
|
-
return /* @__PURE__ */
|
|
423
|
+
function X({ file: t, group: r, handle: i, folder: a, disabled: s, selected: c, onSelect: d, renaming: f, onRename: p, onCrop: h, onReplace: g, actions: _ }) {
|
|
424
|
+
let { t: v, error: y } = o(), b = G(t.type), x = C(r, t.path), S = u(t), T = O(() => w(a.read.read, t), [a.read.read, t]), E = s || a.updating, D = t.failed ? y(e(t.failed)) : void 0;
|
|
425
|
+
return /* @__PURE__ */ M(A, { children: [
|
|
415
426
|
i,
|
|
416
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ j("input", {
|
|
417
428
|
type: "checkbox",
|
|
418
429
|
className: "size-4 shrink-0 accent-primary",
|
|
419
430
|
checked: c,
|
|
420
431
|
disabled: s,
|
|
421
|
-
"aria-label":
|
|
432
|
+
"aria-label": v("folder.select", { name: x }),
|
|
422
433
|
onChange: (e) => d(e.target.checked)
|
|
423
434
|
}),
|
|
424
|
-
/* @__PURE__ */
|
|
425
|
-
kind:
|
|
426
|
-
url:
|
|
427
|
-
busy:
|
|
435
|
+
/* @__PURE__ */ j(Y, {
|
|
436
|
+
kind: b,
|
|
437
|
+
url: T?.url,
|
|
438
|
+
busy: S
|
|
428
439
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ M("div", {
|
|
430
441
|
className: "grid min-w-0 flex-1 gap-1",
|
|
431
442
|
children: [
|
|
432
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ M("div", {
|
|
433
444
|
className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5",
|
|
434
445
|
children: [
|
|
435
|
-
f ? /* @__PURE__ */
|
|
436
|
-
name: n(
|
|
437
|
-
label:
|
|
446
|
+
f ? /* @__PURE__ */ j(Z, {
|
|
447
|
+
name: n(x),
|
|
448
|
+
label: v("folder.renameLabel", { name: x }),
|
|
438
449
|
onDone: (e) => e === null ? p(null) : a.rename(t.path, e).then(() => p(null))
|
|
439
|
-
}) : /* @__PURE__ */
|
|
450
|
+
}) : /* @__PURE__ */ j("span", {
|
|
440
451
|
className: "max-w-full truncate text-sm",
|
|
441
452
|
title: t.path,
|
|
442
453
|
"data-ckui": "upload-name",
|
|
443
|
-
children:
|
|
454
|
+
children: x
|
|
444
455
|
}),
|
|
445
|
-
t.edit && /* @__PURE__ */
|
|
456
|
+
t.edit && /* @__PURE__ */ j("span", {
|
|
446
457
|
className: "shrink-0 rounded-sm border border-border px-1.5 text-[11px] text-muted-foreground",
|
|
447
458
|
"data-ckui": "edited",
|
|
448
|
-
children:
|
|
459
|
+
children: v("folder.edited")
|
|
449
460
|
}),
|
|
450
|
-
|
|
461
|
+
D && /* @__PURE__ */ j("span", {
|
|
451
462
|
className: "shrink-0 rounded-sm bg-destructive/10 px-1.5 text-[11px] font-medium text-destructive",
|
|
452
|
-
title:
|
|
463
|
+
title: D,
|
|
453
464
|
"data-ckui": "failed",
|
|
454
|
-
children:
|
|
465
|
+
children: v(b === "video" ? "folder.failedVideo" : "folder.failed")
|
|
455
466
|
})
|
|
456
467
|
]
|
|
457
468
|
}),
|
|
458
|
-
|
|
469
|
+
D && /* @__PURE__ */ j("p", {
|
|
459
470
|
className: "text-xs text-destructive",
|
|
460
|
-
children:
|
|
471
|
+
children: D
|
|
461
472
|
}),
|
|
462
|
-
|
|
473
|
+
S && b === "video" && /* @__PURE__ */ j(l, {
|
|
463
474
|
progress: t.progress,
|
|
464
475
|
className: "max-w-sm text-xs"
|
|
465
476
|
}),
|
|
466
|
-
|
|
477
|
+
S && b !== "video" && /* @__PURE__ */ j("span", {
|
|
467
478
|
className: "text-xs text-muted-foreground",
|
|
468
|
-
children:
|
|
479
|
+
children: v("folder.processing")
|
|
469
480
|
})
|
|
470
481
|
]
|
|
471
482
|
}),
|
|
472
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ M("span", {
|
|
473
484
|
className: "flex shrink-0 items-center gap-0.5",
|
|
474
485
|
"data-ckui": "upload-actions",
|
|
475
486
|
children: [
|
|
476
|
-
|
|
477
|
-
|
|
487
|
+
_,
|
|
488
|
+
b === "image" && /* @__PURE__ */ j(m, {
|
|
478
489
|
variant: "ghost",
|
|
479
490
|
size: "icon-sm",
|
|
480
|
-
"aria-label":
|
|
481
|
-
title:
|
|
482
|
-
disabled:
|
|
491
|
+
"aria-label": v("folder.crop"),
|
|
492
|
+
title: v("folder.crop"),
|
|
493
|
+
disabled: E || !!t.staged || !t.size,
|
|
483
494
|
onClick: () => h(t.path),
|
|
484
|
-
children: /* @__PURE__ */
|
|
485
|
-
icon:
|
|
495
|
+
children: /* @__PURE__ */ j(W, {
|
|
496
|
+
icon: F,
|
|
486
497
|
strokeWidth: 2
|
|
487
498
|
})
|
|
488
499
|
}),
|
|
489
|
-
!r.rule?.named && /* @__PURE__ */
|
|
500
|
+
!r.rule?.named && /* @__PURE__ */ j(m, {
|
|
490
501
|
variant: "ghost",
|
|
491
502
|
size: "icon-sm",
|
|
492
|
-
"aria-label":
|
|
493
|
-
title:
|
|
494
|
-
disabled:
|
|
503
|
+
"aria-label": v("common.rename"),
|
|
504
|
+
title: v("common.rename"),
|
|
505
|
+
disabled: E,
|
|
495
506
|
onClick: () => p(t.path),
|
|
496
|
-
children: /* @__PURE__ */
|
|
497
|
-
icon:
|
|
507
|
+
children: /* @__PURE__ */ j(W, {
|
|
508
|
+
icon: L,
|
|
498
509
|
strokeWidth: 2
|
|
499
510
|
})
|
|
500
511
|
}),
|
|
501
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ j(m, {
|
|
502
513
|
variant: "ghost",
|
|
503
514
|
size: "icon-sm",
|
|
504
|
-
"aria-label":
|
|
505
|
-
title:
|
|
506
|
-
disabled:
|
|
515
|
+
"aria-label": v("common.replace"),
|
|
516
|
+
title: v("common.replace"),
|
|
517
|
+
disabled: E,
|
|
507
518
|
onClick: () => g(t.path),
|
|
508
|
-
children: /* @__PURE__ */
|
|
519
|
+
children: /* @__PURE__ */ j(W, {
|
|
509
520
|
icon: H,
|
|
510
521
|
strokeWidth: 2
|
|
511
522
|
})
|
|
512
523
|
}),
|
|
513
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ j(m, {
|
|
514
525
|
variant: "ghost",
|
|
515
526
|
size: "icon-sm",
|
|
516
|
-
"aria-label":
|
|
517
|
-
title:
|
|
518
|
-
disabled:
|
|
527
|
+
"aria-label": v("common.remove"),
|
|
528
|
+
title: v("common.remove"),
|
|
529
|
+
disabled: E,
|
|
519
530
|
onClick: () => void a.remove([t.path]).catch(() => {}),
|
|
520
|
-
children: /* @__PURE__ */
|
|
521
|
-
icon:
|
|
531
|
+
children: /* @__PURE__ */ j(W, {
|
|
532
|
+
icon: I,
|
|
522
533
|
strokeWidth: 2
|
|
523
534
|
})
|
|
524
535
|
})
|
|
@@ -527,10 +538,10 @@ function X({ file: t, group: r, handle: i, folder: a, disabled: s, selected: c,
|
|
|
527
538
|
] });
|
|
528
539
|
}
|
|
529
540
|
function Z({ name: e, label: t, onDone: n }) {
|
|
530
|
-
let [r, i] =
|
|
541
|
+
let [r, i] = k(e), a = te(!1), o = (t) => {
|
|
531
542
|
a.current || (a.current = !0, Promise.resolve(n(t && t.trim() && t.trim() !== e ? t.trim() : null)).catch(() => a.current = !1));
|
|
532
543
|
};
|
|
533
|
-
return /* @__PURE__ */
|
|
544
|
+
return /* @__PURE__ */ j("input", {
|
|
534
545
|
autoFocus: !0,
|
|
535
546
|
"aria-label": t,
|
|
536
547
|
value: r,
|
|
@@ -543,6 +554,45 @@ function Z({ name: e, label: t, onDone: n }) {
|
|
|
543
554
|
"data-ckui": "rename"
|
|
544
555
|
});
|
|
545
556
|
}
|
|
557
|
+
function ue({ file: t, folder: n, auto: r, disabled: i }) {
|
|
558
|
+
let { t: a, error: s } = o(), c = G(t.type), l = u(t), d = O(() => w(n.read.read, t), [n.read.read, t]), f = t.failed ? s(e(t.failed)) : l ? t.progress && t.progress.phase !== "queued" ? a("folder.processingPercent", { percent: Math.round(t.progress.percent) }) : a("folder.processing") : a(r ? "folder.adding" : "folder.notAdded");
|
|
559
|
+
return /* @__PURE__ */ M("li", {
|
|
560
|
+
className: "flex min-h-11 items-center gap-2 px-1",
|
|
561
|
+
"data-ckui": "pending-row",
|
|
562
|
+
"data-path": t.path,
|
|
563
|
+
children: [
|
|
564
|
+
/* @__PURE__ */ j(Y, {
|
|
565
|
+
kind: c,
|
|
566
|
+
url: d?.url,
|
|
567
|
+
busy: l
|
|
568
|
+
}),
|
|
569
|
+
/* @__PURE__ */ M("div", {
|
|
570
|
+
className: "grid min-w-0 flex-1 gap-1",
|
|
571
|
+
children: [/* @__PURE__ */ j("span", {
|
|
572
|
+
className: "truncate text-sm",
|
|
573
|
+
title: t.path,
|
|
574
|
+
children: t.path.slice(t.path.lastIndexOf("/") + 1)
|
|
575
|
+
}), /* @__PURE__ */ j("span", {
|
|
576
|
+
className: N("text-xs", t.failed ? "text-destructive" : "text-muted-foreground"),
|
|
577
|
+
"data-ckui": "queue-status",
|
|
578
|
+
children: f
|
|
579
|
+
})]
|
|
580
|
+
}),
|
|
581
|
+
/* @__PURE__ */ j(m, {
|
|
582
|
+
variant: "ghost",
|
|
583
|
+
size: "icon-sm",
|
|
584
|
+
"aria-label": a("common.remove"),
|
|
585
|
+
title: a("common.remove"),
|
|
586
|
+
disabled: i || n.updating,
|
|
587
|
+
onClick: () => void n.remove([t.path]).catch(() => {}),
|
|
588
|
+
children: /* @__PURE__ */ j(W, {
|
|
589
|
+
icon: I,
|
|
590
|
+
strokeWidth: 2
|
|
591
|
+
})
|
|
592
|
+
})
|
|
593
|
+
]
|
|
594
|
+
});
|
|
595
|
+
}
|
|
546
596
|
function Q(t, n, r, i) {
|
|
547
597
|
if (r.status === "failed") return n(r.error);
|
|
548
598
|
if (r.status === "uploading") return h(t, r.progress);
|
|
@@ -552,54 +602,54 @@ function Q(t, n, r, i) {
|
|
|
552
602
|
}
|
|
553
603
|
return r.status === "committed" ? t("folder.adding") : t("folder.queued");
|
|
554
604
|
}
|
|
555
|
-
function
|
|
605
|
+
function de({ item: e, handle: t, auto: n, folder: r }) {
|
|
556
606
|
let { t: i, error: a } = o(), { queue: s } = r, l = G(e.file.type), u = Q(i, a, e, n), d = e.status === "uploading" ? g(e.progress) : e.unattached && !e.processed && e.processing?.progress ? e.processing.progress.percent : null;
|
|
557
|
-
return /* @__PURE__ */
|
|
607
|
+
return /* @__PURE__ */ M(A, { children: [
|
|
558
608
|
t,
|
|
559
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ j(Y, {
|
|
560
610
|
kind: l,
|
|
561
611
|
busy: e.status === "uploading" || !!e.unattached && !e.processed
|
|
562
612
|
}),
|
|
563
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ M("div", {
|
|
564
614
|
className: "grid min-w-0 flex-1 gap-1",
|
|
565
615
|
children: [
|
|
566
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ j("span", {
|
|
567
617
|
className: "truncate text-sm",
|
|
568
618
|
title: e.path,
|
|
569
619
|
children: e.file.name
|
|
570
620
|
}),
|
|
571
|
-
d !== null && /* @__PURE__ */
|
|
621
|
+
d !== null && /* @__PURE__ */ j(c, {
|
|
572
622
|
value: d,
|
|
573
623
|
"aria-label": u,
|
|
574
624
|
className: "max-w-sm"
|
|
575
625
|
}),
|
|
576
|
-
/* @__PURE__ */
|
|
577
|
-
className:
|
|
626
|
+
/* @__PURE__ */ j("span", {
|
|
627
|
+
className: N("text-xs", e.status === "failed" ? "text-destructive" : "text-muted-foreground"),
|
|
578
628
|
"data-ckui": "queue-status",
|
|
579
629
|
children: u
|
|
580
630
|
})
|
|
581
631
|
]
|
|
582
632
|
}),
|
|
583
|
-
/* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ M("span", {
|
|
584
634
|
className: "flex shrink-0 items-center gap-0.5",
|
|
585
|
-
children: [e.status === "failed" && /* @__PURE__ */
|
|
635
|
+
children: [e.status === "failed" && /* @__PURE__ */ j(m, {
|
|
586
636
|
variant: "ghost",
|
|
587
637
|
size: "icon-sm",
|
|
588
638
|
"aria-label": i("common.retry"),
|
|
589
639
|
title: i("common.retry"),
|
|
590
640
|
onClick: () => s.retry(e.id),
|
|
591
|
-
children: /* @__PURE__ */
|
|
641
|
+
children: /* @__PURE__ */ j(W, {
|
|
592
642
|
icon: V,
|
|
593
643
|
strokeWidth: 2
|
|
594
644
|
})
|
|
595
|
-
}), /* @__PURE__ */
|
|
645
|
+
}), /* @__PURE__ */ j(m, {
|
|
596
646
|
variant: "ghost",
|
|
597
647
|
size: "icon-sm",
|
|
598
648
|
"aria-label": i("common.remove"),
|
|
599
649
|
title: i("common.remove"),
|
|
600
650
|
onClick: () => s.remove(e.id),
|
|
601
|
-
children: /* @__PURE__ */
|
|
602
|
-
icon:
|
|
651
|
+
children: /* @__PURE__ */ j(W, {
|
|
652
|
+
icon: I,
|
|
603
653
|
strokeWidth: 2
|
|
604
654
|
})
|
|
605
655
|
})]
|