@burdenoff/microfe-coolandlovely 2026.1110.3 → 2026.1112.2
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/coolandlovely/CoolAndLovelyRoot.js +91 -88
- package/dist/coolandlovely/components/ImageUploadField.d.ts +2 -0
- package/dist/coolandlovely/components/ImageUploadField.js +142 -119
- package/dist/coolandlovely/hooks/uploadVisibility.d.ts +2 -0
- package/dist/coolandlovely/hooks/uploadVisibility.js +6 -0
- package/dist/coolandlovely/hooks/useCatalogImport.js +1 -1
- package/dist/coolandlovely/hooks/useCoolAndLovelyApi.js +308 -303
- package/dist/coolandlovely/hooks/useFiles.d.ts +3 -25
- package/dist/coolandlovely/hooks/useFiles.js +52 -50
- package/dist/coolandlovely/pages/brands/BrandFormPage.js +2 -0
- package/dist/coolandlovely/pages/collections/CollectionFormPage.js +1 -0
- package/dist/coolandlovely/pages/items/StyleItemFormPage.js +1 -0
- package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.js +1 -0
- package/dist/coolandlovely/pages/looks/LookFormPage.js +1 -0
- package/dist/coolandlovely/pages/wardrobe/WardrobeFormPage.js +1 -0
- package/dist/coolandlovely/utils/quota.d.ts +10 -0
- package/dist/coolandlovely/utils/quota.js +5 -0
- package/package.json +1 -1
|
@@ -6,214 +6,217 @@ import { FeedbackWidget as i } from "./components/FeedbackWidget.js";
|
|
|
6
6
|
import "./components/index.js";
|
|
7
7
|
import { useCallback as a, useEffect as o } from "react";
|
|
8
8
|
import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
9
|
+
import { useQuotaErrorToast as c } from "@burdenoff/fe-libs/shared/hooks";
|
|
10
|
+
import { BookHeart as l, Compass as u, Handshake as d, Heart as f, Home as p, Package as m, Shapes as h, Shield as g, Shirt as _, ShoppingBag as v, Sparkles as y, Store as b, TrendingUp as x, UserCircle as S, Wallet as C } from "lucide-react";
|
|
11
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
12
|
+
import { FeatureFlagProvider as E } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
13
|
+
import { useFeatureFlag as D } from "@burdenoff/fe-libs/shared/feature-flags/useFeatureFlag";
|
|
13
14
|
// src/coolandlovely/CoolAndLovelyRoot.tsx
|
|
14
|
-
var
|
|
15
|
-
let { registerNavItems:
|
|
16
|
-
let n =
|
|
15
|
+
var O = (O) => {
|
|
16
|
+
let { registerNavItems: k, registerFooterItems: A, basePath: j = "/" } = O, { t: M } = s(), N = a((e, t) => {
|
|
17
|
+
let n = M(e);
|
|
17
18
|
return n === e ? t : n;
|
|
18
|
-
}, [
|
|
19
|
+
}, [M]), P = D("coolandlovely.admin.curation", !1);
|
|
20
|
+
c();
|
|
21
|
+
let F = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
19
22
|
return o(() => {
|
|
20
|
-
if (!
|
|
23
|
+
if (!k) return;
|
|
21
24
|
let e = [
|
|
22
25
|
{
|
|
23
26
|
id: "coolandlovely-overview",
|
|
24
|
-
label:
|
|
25
|
-
path:
|
|
26
|
-
icon: /* @__PURE__ */
|
|
27
|
+
label: N("coolandlovely.nav.overview", "Overview"),
|
|
28
|
+
path: F(j, ""),
|
|
29
|
+
icon: /* @__PURE__ */ w(p, { size: 20 }),
|
|
27
30
|
order: 1,
|
|
28
31
|
group: "main"
|
|
29
32
|
},
|
|
30
33
|
{
|
|
31
34
|
id: "coolandlovely-brands",
|
|
32
|
-
label:
|
|
33
|
-
path:
|
|
34
|
-
icon: /* @__PURE__ */
|
|
35
|
+
label: N("coolandlovely.nav.brands", "Brands"),
|
|
36
|
+
path: F(j, "brands"),
|
|
37
|
+
icon: /* @__PURE__ */ w(b, { size: 20 }),
|
|
35
38
|
order: 10,
|
|
36
39
|
group: "catalog"
|
|
37
40
|
},
|
|
38
41
|
{
|
|
39
42
|
id: "coolandlovely-collections",
|
|
40
|
-
label:
|
|
41
|
-
path:
|
|
42
|
-
icon: /* @__PURE__ */
|
|
43
|
+
label: N("coolandlovely.nav.collections", "Collections"),
|
|
44
|
+
path: F(j, "collections"),
|
|
45
|
+
icon: /* @__PURE__ */ w(h, { size: 20 }),
|
|
43
46
|
order: 11,
|
|
44
47
|
group: "catalog"
|
|
45
48
|
},
|
|
46
49
|
{
|
|
47
50
|
id: "coolandlovely-items",
|
|
48
|
-
label:
|
|
49
|
-
path:
|
|
50
|
-
icon: /* @__PURE__ */
|
|
51
|
+
label: N("coolandlovely.nav.items", "Style Items"),
|
|
52
|
+
path: F(j, "items"),
|
|
53
|
+
icon: /* @__PURE__ */ w(_, { size: 20 }),
|
|
51
54
|
order: 12,
|
|
52
55
|
group: "catalog"
|
|
53
56
|
},
|
|
54
57
|
{
|
|
55
58
|
id: "coolandlovely-looks",
|
|
56
|
-
label:
|
|
57
|
-
path:
|
|
58
|
-
icon: /* @__PURE__ */
|
|
59
|
+
label: N("coolandlovely.nav.looks", "Looks"),
|
|
60
|
+
path: F(j, "looks"),
|
|
61
|
+
icon: /* @__PURE__ */ w(y, { size: 20 }),
|
|
59
62
|
order: 20,
|
|
60
63
|
group: "social"
|
|
61
64
|
},
|
|
62
65
|
{
|
|
63
66
|
id: "coolandlovely-collaborations",
|
|
64
|
-
label:
|
|
65
|
-
path:
|
|
66
|
-
icon: /* @__PURE__ */
|
|
67
|
+
label: N("coolandlovely.nav.collaborations", "Collaborations"),
|
|
68
|
+
path: F(j, "collaborations"),
|
|
69
|
+
icon: /* @__PURE__ */ w(d, { size: 20 }),
|
|
67
70
|
order: 21,
|
|
68
71
|
group: "social"
|
|
69
72
|
},
|
|
70
73
|
{
|
|
71
74
|
id: "coolandlovely-wardrobe",
|
|
72
|
-
label:
|
|
73
|
-
path:
|
|
74
|
-
icon: /* @__PURE__ */
|
|
75
|
+
label: N("coolandlovely.nav.wardrobe", "My Wardrobe"),
|
|
76
|
+
path: F(j, "wardrobe"),
|
|
77
|
+
icon: /* @__PURE__ */ w(f, { size: 20 }),
|
|
75
78
|
order: 30,
|
|
76
79
|
group: "my-style"
|
|
77
80
|
},
|
|
78
81
|
{
|
|
79
82
|
id: "coolandlovely-lookbooks",
|
|
80
|
-
label:
|
|
81
|
-
path:
|
|
82
|
-
icon: /* @__PURE__ */
|
|
83
|
+
label: N("coolandlovely.nav.lookbooks", "Lookbooks"),
|
|
84
|
+
path: F(j, "lookbooks"),
|
|
85
|
+
icon: /* @__PURE__ */ w(l, { size: 20 }),
|
|
83
86
|
order: 31,
|
|
84
87
|
group: "my-style"
|
|
85
88
|
},
|
|
86
89
|
{
|
|
87
90
|
id: "coolandlovely-profile",
|
|
88
|
-
label:
|
|
89
|
-
path:
|
|
90
|
-
icon: /* @__PURE__ */
|
|
91
|
+
label: N("coolandlovely.nav.profile", "Style Profile"),
|
|
92
|
+
path: F(j, "profile"),
|
|
93
|
+
icon: /* @__PURE__ */ w(S, { size: 20 }),
|
|
91
94
|
order: 32,
|
|
92
95
|
group: "my-style"
|
|
93
96
|
},
|
|
94
97
|
{
|
|
95
98
|
id: "coolandlovely-cart",
|
|
96
|
-
label:
|
|
97
|
-
path:
|
|
98
|
-
icon: /* @__PURE__ */
|
|
99
|
+
label: N("coolandlovely.nav.cart", "Cart"),
|
|
100
|
+
path: F(j, "cart"),
|
|
101
|
+
icon: /* @__PURE__ */ w(v, { size: 20 }),
|
|
99
102
|
order: 33,
|
|
100
103
|
group: "my-style"
|
|
101
104
|
},
|
|
102
105
|
{
|
|
103
106
|
id: "coolandlovely-orders",
|
|
104
|
-
label:
|
|
105
|
-
path:
|
|
106
|
-
icon: /* @__PURE__ */
|
|
107
|
+
label: N("coolandlovely.nav.orders", "My Orders"),
|
|
108
|
+
path: F(j, "orders"),
|
|
109
|
+
icon: /* @__PURE__ */ w(m, { size: 20 }),
|
|
107
110
|
order: 34,
|
|
108
111
|
group: "my-style"
|
|
109
112
|
},
|
|
110
113
|
{
|
|
111
114
|
id: "coolandlovely-earnings",
|
|
112
|
-
label:
|
|
113
|
-
path:
|
|
114
|
-
icon: /* @__PURE__ */ C
|
|
115
|
+
label: N("coolandlovely.nav.earnings", "Creator Earnings"),
|
|
116
|
+
path: F(j, "earnings"),
|
|
117
|
+
icon: /* @__PURE__ */ w(C, { size: 20 }),
|
|
115
118
|
order: 35,
|
|
116
119
|
group: "my-style"
|
|
117
120
|
},
|
|
118
121
|
{
|
|
119
122
|
id: "coolandlovely-marketplace",
|
|
120
|
-
label:
|
|
121
|
-
path:
|
|
122
|
-
icon: /* @__PURE__ */
|
|
123
|
+
label: N("coolandlovely.nav.marketplace", "Creator marketplace"),
|
|
124
|
+
path: F(j, "creator-marketplace"),
|
|
125
|
+
icon: /* @__PURE__ */ w(d, { size: 20 }),
|
|
123
126
|
order: 36,
|
|
124
127
|
group: "my-style"
|
|
125
128
|
},
|
|
126
129
|
{
|
|
127
130
|
id: "coolandlovely-resale",
|
|
128
|
-
label:
|
|
129
|
-
path:
|
|
130
|
-
icon: /* @__PURE__ */
|
|
131
|
+
label: N("coolandlovely.nav.resale", "Pre-loved marketplace"),
|
|
132
|
+
path: F(j, "resale"),
|
|
133
|
+
icon: /* @__PURE__ */ w(v, { size: 20 }),
|
|
131
134
|
order: 37,
|
|
132
135
|
group: "my-style"
|
|
133
136
|
},
|
|
134
137
|
{
|
|
135
138
|
id: "coolandlovely-discover",
|
|
136
|
-
label:
|
|
137
|
-
path:
|
|
138
|
-
icon: /* @__PURE__ */
|
|
139
|
+
label: N("coolandlovely.nav.discover", "Discover"),
|
|
140
|
+
path: F(j, "discover"),
|
|
141
|
+
icon: /* @__PURE__ */ w(u, { size: 20 }),
|
|
139
142
|
order: 40,
|
|
140
143
|
group: "signals"
|
|
141
144
|
},
|
|
142
145
|
{
|
|
143
146
|
id: "coolandlovely-trends",
|
|
144
|
-
label:
|
|
145
|
-
path:
|
|
146
|
-
icon: /* @__PURE__ */
|
|
147
|
+
label: N("coolandlovely.nav.trends", "Trends"),
|
|
148
|
+
path: F(j, "trends"),
|
|
149
|
+
icon: /* @__PURE__ */ w(x, { size: 20 }),
|
|
147
150
|
order: 41,
|
|
148
151
|
group: "signals"
|
|
149
152
|
},
|
|
150
153
|
{
|
|
151
154
|
id: "coolandlovely-journal",
|
|
152
|
-
label:
|
|
153
|
-
path:
|
|
154
|
-
icon: /* @__PURE__ */
|
|
155
|
+
label: N("coolandlovely.nav.journal", "Journal"),
|
|
156
|
+
path: F(j, "journal"),
|
|
157
|
+
icon: /* @__PURE__ */ w(x, { size: 20 }),
|
|
155
158
|
order: 42,
|
|
156
159
|
group: "signals"
|
|
157
160
|
},
|
|
158
|
-
...
|
|
161
|
+
...P ? [
|
|
159
162
|
{
|
|
160
163
|
id: "coolandlovely-admin",
|
|
161
|
-
label:
|
|
162
|
-
path:
|
|
163
|
-
icon: /* @__PURE__ */
|
|
164
|
+
label: N("coolandlovely.nav.admin", "Admin"),
|
|
165
|
+
path: F(j, "admin/brands"),
|
|
166
|
+
icon: /* @__PURE__ */ w(g, { size: 20 }),
|
|
164
167
|
order: 50,
|
|
165
168
|
group: "admin"
|
|
166
169
|
},
|
|
167
170
|
{
|
|
168
171
|
id: "coolandlovely-admin-brands",
|
|
169
|
-
label:
|
|
170
|
-
path:
|
|
171
|
-
icon: /* @__PURE__ */
|
|
172
|
+
label: N("coolandlovely.nav.adminBrands", "Brands"),
|
|
173
|
+
path: F(j, "admin/brands"),
|
|
174
|
+
icon: /* @__PURE__ */ w(b, { size: 20 }),
|
|
172
175
|
order: 51,
|
|
173
176
|
group: "admin"
|
|
174
177
|
},
|
|
175
178
|
{
|
|
176
179
|
id: "coolandlovely-admin-collaborations",
|
|
177
|
-
label:
|
|
178
|
-
path:
|
|
179
|
-
icon: /* @__PURE__ */
|
|
180
|
+
label: N("coolandlovely.nav.adminCollaborations", "Collaborations"),
|
|
181
|
+
path: F(j, "admin/collaborations"),
|
|
182
|
+
icon: /* @__PURE__ */ w(d, { size: 20 }),
|
|
180
183
|
order: 52,
|
|
181
184
|
group: "admin"
|
|
182
185
|
},
|
|
183
186
|
{
|
|
184
187
|
id: "coolandlovely-admin-featured-items",
|
|
185
|
-
label:
|
|
186
|
-
path:
|
|
187
|
-
icon: /* @__PURE__ */
|
|
188
|
+
label: N("coolandlovely.nav.adminFeaturedItems", "Featured Items"),
|
|
189
|
+
path: F(j, "admin/featured-items"),
|
|
190
|
+
icon: /* @__PURE__ */ w(_, { size: 20 }),
|
|
188
191
|
order: 53,
|
|
189
192
|
group: "admin"
|
|
190
193
|
}
|
|
191
194
|
] : []
|
|
192
195
|
];
|
|
193
|
-
return
|
|
196
|
+
return k(e);
|
|
194
197
|
}, [
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
198
|
+
k,
|
|
199
|
+
j,
|
|
200
|
+
N,
|
|
201
|
+
P
|
|
199
202
|
]), o(() => {
|
|
200
|
-
if (!
|
|
203
|
+
if (!A) return;
|
|
201
204
|
let e = [{
|
|
202
205
|
id: "coolandlovely-status",
|
|
203
|
-
label:
|
|
206
|
+
label: N("coolandlovely.footer.ready", "CoolAndLovely"),
|
|
204
207
|
type: "status",
|
|
205
208
|
order: 10,
|
|
206
209
|
section: "left"
|
|
207
210
|
}];
|
|
208
|
-
return
|
|
209
|
-
}, [
|
|
210
|
-
workspaceId:
|
|
211
|
+
return A(e);
|
|
212
|
+
}, [A, N]), /* @__PURE__ */ w(t, { children: /* @__PURE__ */ w(E, {
|
|
213
|
+
workspaceId: O.workspaceId ?? null,
|
|
211
214
|
gateway: "global",
|
|
212
215
|
defaultEnabled: !0,
|
|
213
|
-
children: /* @__PURE__ */
|
|
214
|
-
...
|
|
215
|
-
children: [/* @__PURE__ */
|
|
216
|
+
children: /* @__PURE__ */ T(e, {
|
|
217
|
+
...O,
|
|
218
|
+
children: [/* @__PURE__ */ w(r, {}), /* @__PURE__ */ w(i, {})]
|
|
216
219
|
})
|
|
217
|
-
}) }, n(
|
|
220
|
+
}) }, n(O));
|
|
218
221
|
};
|
|
219
|
-
export {
|
|
222
|
+
export { O as CoolAndLovelyRoot };
|
|
@@ -7,6 +7,8 @@ interface ImageUploadFieldProps {
|
|
|
7
7
|
onChange: (fileId: string) => void;
|
|
8
8
|
/** Destination folder in wspace-files (see COO_FILE_FOLDERS). */
|
|
9
9
|
folder?: string;
|
|
10
|
+
/** Only catalog forms opt into this choice. Personal wardrobe never does. */
|
|
11
|
+
allowWorkspace?: boolean;
|
|
10
12
|
hint?: string;
|
|
11
13
|
/** `accept` for the input; images only by default. */
|
|
12
14
|
accept?: string;
|
|
@@ -2,151 +2,174 @@ import { FieldShell as e } from "./Field.js";
|
|
|
2
2
|
import { useCoolAndLovely as t } from "../context/CoolAndLovelyContext.js";
|
|
3
3
|
import { uploadImageToFilesWithProgress as n, useFileUrl as r } from "../hooks/useFiles.js";
|
|
4
4
|
import { cn as i } from "../utils/cn.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { uploadVisibility as a } from "../hooks/uploadVisibility.js";
|
|
6
|
+
import { useTr as o } from "../hooks/useTr.js";
|
|
7
|
+
import { useEffect as s, useId as c, useRef as l, useState as u } from "react";
|
|
8
|
+
import { ImagePlus as d, Loader2 as f, UploadCloud as p, X as m } from "lucide-react";
|
|
9
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
10
|
// src/coolandlovely/components/ImageUploadField.tsx
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
+
var ee = 10485760;
|
|
12
|
+
function _(e) {
|
|
11
13
|
if (e < 1024) return `${e} B`;
|
|
12
14
|
let t = e / 1024;
|
|
13
15
|
return t < 1024 ? `${t < 10 ? t.toFixed(1) : Math.round(t)} KB` : `${(t / 1024).toFixed(1)} MB`;
|
|
14
16
|
}
|
|
15
|
-
var
|
|
16
|
-
let { apiGatewayUrl:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}, [
|
|
20
|
-
let
|
|
17
|
+
var v = ({ label: v, value: y, onChange: b, folder: x, allowWorkspace: S = !1, hint: C, accept: w = "image/*", disabled: T = !1, className: E, aspect: D = "square" }) => {
|
|
18
|
+
let O = o(), { apiGatewayUrl: k } = t(), A = l(null), j = c(), [M, N] = u(!1), [P, F] = u(null), [I, L] = u(null), [R, z] = u(null), [B, V] = u(!1), [H, U] = u(), [W, G] = u("PRIVATE"), K = l(!1);
|
|
19
|
+
s(() => () => {
|
|
20
|
+
R && URL.revokeObjectURL(R);
|
|
21
|
+
}, [R]);
|
|
22
|
+
let q = r(M ? void 0 : y || void 0).data ?? null, J = T || M, Y = async (e) => {
|
|
23
|
+
if (T || K.current) return;
|
|
21
24
|
if (!e.type.startsWith("image/")) {
|
|
22
|
-
|
|
25
|
+
U("Please choose an image file (JPG or PNG).");
|
|
23
26
|
return;
|
|
24
27
|
}
|
|
25
|
-
if (e.size >
|
|
26
|
-
|
|
28
|
+
if (e.size > ee) {
|
|
29
|
+
U("That image is over 10 MB — please choose a smaller file.");
|
|
27
30
|
return;
|
|
28
31
|
}
|
|
29
|
-
|
|
32
|
+
U(void 0), L(e.name);
|
|
30
33
|
let t = URL.createObjectURL(e);
|
|
31
|
-
|
|
34
|
+
z(t), F({
|
|
32
35
|
loaded: 0,
|
|
33
36
|
total: e.size,
|
|
34
37
|
pct: 0
|
|
35
|
-
}),
|
|
38
|
+
}), K.current = !0, N(!0);
|
|
36
39
|
try {
|
|
37
|
-
|
|
40
|
+
b((await n(e, k, x, F, S ? W : "PRIVATE")).id);
|
|
38
41
|
} catch (e) {
|
|
39
|
-
|
|
42
|
+
U(e instanceof Error ? e.message : "Upload failed — please try again.");
|
|
40
43
|
} finally {
|
|
41
|
-
|
|
44
|
+
K.current = !1, N(!1), F(null), L(null), z(null);
|
|
42
45
|
}
|
|
43
|
-
},
|
|
46
|
+
}, X = (e) => {
|
|
44
47
|
let t = e.target.files?.[0];
|
|
45
|
-
e.target.value = "", t &&
|
|
46
|
-
},
|
|
47
|
-
if (e.preventDefault(),
|
|
48
|
+
e.target.value = "", t && Y(t);
|
|
49
|
+
}, Z = (e) => {
|
|
50
|
+
if (e.preventDefault(), V(!1), J) return;
|
|
48
51
|
let t = e.dataTransfer.files?.[0];
|
|
49
|
-
t &&
|
|
50
|
-
},
|
|
51
|
-
e.preventDefault(),
|
|
52
|
-
},
|
|
53
|
-
e.preventDefault(),
|
|
54
|
-
},
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
label:
|
|
57
|
-
htmlFor:
|
|
58
|
-
hint:
|
|
59
|
-
error:
|
|
60
|
-
className:
|
|
61
|
-
children: [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
52
|
+
t && Y(t);
|
|
53
|
+
}, Q = (e) => {
|
|
54
|
+
e.preventDefault(), J || V(!0);
|
|
55
|
+
}, te = (e) => {
|
|
56
|
+
e.preventDefault(), V(!1);
|
|
57
|
+
}, $ = P?.pct ?? 0;
|
|
58
|
+
return /* @__PURE__ */ g(e, {
|
|
59
|
+
label: v,
|
|
60
|
+
htmlFor: j,
|
|
61
|
+
hint: C,
|
|
62
|
+
error: H,
|
|
63
|
+
className: E,
|
|
64
|
+
children: [
|
|
65
|
+
S ? /* @__PURE__ */ g("label", {
|
|
66
|
+
className: "mb-2 block text-sm text-text-secondary",
|
|
67
|
+
children: [O("coolandlovely.upload.audience", "New image audience"), /* @__PURE__ */ g("select", {
|
|
68
|
+
value: W,
|
|
69
|
+
disabled: J,
|
|
70
|
+
onChange: (e) => G(a(e.target.value)),
|
|
71
|
+
className: "ml-2 rounded-lg border border-border-seam bg-bg-surface p-2 text-text-primary",
|
|
72
|
+
children: [/* @__PURE__ */ h("option", {
|
|
73
|
+
value: "PRIVATE",
|
|
74
|
+
children: O("coolandlovely.upload.private", "Only me")
|
|
75
|
+
}), /* @__PURE__ */ h("option", {
|
|
76
|
+
value: "WORKSPACE",
|
|
77
|
+
children: O("coolandlovely.upload.workspace", "Workspace members")
|
|
78
|
+
})]
|
|
79
|
+
})]
|
|
80
|
+
}) : null,
|
|
81
|
+
/* @__PURE__ */ h("div", {
|
|
82
|
+
onDragEnter: Q,
|
|
83
|
+
onDragOver: Q,
|
|
84
|
+
onDragLeave: te,
|
|
85
|
+
onDrop: Z,
|
|
86
|
+
children: M ? /* @__PURE__ */ g("div", {
|
|
87
|
+
className: "flex items-center gap-3 rounded-lg border border-border-seam bg-bg-surface p-3",
|
|
88
|
+
children: [/* @__PURE__ */ h("div", {
|
|
89
|
+
className: "flex h-14 w-14 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-bg-sunken",
|
|
90
|
+
children: R ? /* @__PURE__ */ h("img", {
|
|
91
|
+
src: R,
|
|
92
|
+
alt: "",
|
|
93
|
+
className: "h-full w-full object-cover"
|
|
94
|
+
}) : /* @__PURE__ */ h(f, { className: "h-5 w-5 animate-spin text-text-secondary" })
|
|
95
|
+
}), /* @__PURE__ */ g("div", {
|
|
96
|
+
className: "min-w-0 flex-1",
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ h("p", {
|
|
99
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
100
|
+
children: I ?? "Uploading…"
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ h("div", {
|
|
103
|
+
className: "mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-bg-sunken",
|
|
104
|
+
children: /* @__PURE__ */ h("div", {
|
|
105
|
+
className: "h-full rounded-full bg-accent-primary transition-[width] duration-200",
|
|
106
|
+
style: { width: `${$}%` }
|
|
107
|
+
})
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ g("p", {
|
|
110
|
+
className: "mt-1 text-xs text-text-secondary tabular-nums",
|
|
111
|
+
children: [
|
|
112
|
+
$,
|
|
113
|
+
"%",
|
|
114
|
+
P ? ` · ${_(P.loaded)} of ${_(P.total)}` : ""
|
|
115
|
+
]
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
})]
|
|
119
|
+
}) : q ? /* @__PURE__ */ g("div", {
|
|
120
|
+
className: "relative overflow-hidden rounded-lg border border-border-seam bg-bg-sunken",
|
|
121
|
+
children: [/* @__PURE__ */ h("img", {
|
|
122
|
+
src: q,
|
|
72
123
|
alt: "",
|
|
73
|
-
className: "
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
|
|
124
|
+
className: i("w-full object-cover", D === "wide" ? "aspect-video" : "aspect-square max-h-64")
|
|
125
|
+
}), /* @__PURE__ */ g("div", {
|
|
126
|
+
className: "absolute inset-x-0 bottom-0 flex justify-end gap-2 bg-gradient-to-t from-bg-canvas/85 to-transparent p-2",
|
|
127
|
+
children: [/* @__PURE__ */ g("button", {
|
|
128
|
+
type: "button",
|
|
129
|
+
disabled: J,
|
|
130
|
+
onClick: () => A.current?.click(),
|
|
131
|
+
className: "inline-flex items-center gap-1.5 rounded-lg bg-bg-surface/90 px-3 py-1.5 text-sm font-medium text-text-primary shadow-sm backdrop-blur transition-colors hover:bg-bg-surface disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
132
|
+
children: [/* @__PURE__ */ h(d, { className: "h-4 w-4" }), " Replace"]
|
|
133
|
+
}), /* @__PURE__ */ g("button", {
|
|
134
|
+
type: "button",
|
|
135
|
+
disabled: T,
|
|
136
|
+
onClick: () => b(""),
|
|
137
|
+
className: "inline-flex items-center gap-1 rounded-lg bg-bg-surface/90 px-3 py-1.5 text-sm text-text-secondary shadow-sm backdrop-blur transition-colors hover:bg-status-error-bg-subtle hover:text-status-error-text disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
138
|
+
children: [/* @__PURE__ */ h(m, { className: "h-4 w-4" }), " Remove"]
|
|
139
|
+
})]
|
|
140
|
+
})]
|
|
141
|
+
}) : /* @__PURE__ */ g("button", {
|
|
142
|
+
type: "button",
|
|
143
|
+
disabled: J,
|
|
144
|
+
onClick: () => A.current?.click(),
|
|
145
|
+
className: i("flex min-h-40 w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-6 text-center transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-50", B ? "border-accent-primary bg-[var(--color-accent-soft)]" : "border-border-seam hover:border-accent-primary/60 hover:bg-bg-sunken"),
|
|
77
146
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
className: "
|
|
80
|
-
|
|
147
|
+
/* @__PURE__ */ h(p, {
|
|
148
|
+
className: "h-8 w-8 text-text-secondary",
|
|
149
|
+
"aria-hidden": "true"
|
|
81
150
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
className: "
|
|
84
|
-
children:
|
|
85
|
-
className: "h-full rounded-full bg-accent-primary transition-[width] duration-200",
|
|
86
|
-
style: { width: `${J}%` }
|
|
87
|
-
})
|
|
151
|
+
/* @__PURE__ */ h("span", {
|
|
152
|
+
className: "text-sm font-medium text-text-primary",
|
|
153
|
+
children: "Drag & drop an image here, or click to browse"
|
|
88
154
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
className: "
|
|
91
|
-
children:
|
|
92
|
-
J,
|
|
93
|
-
"%",
|
|
94
|
-
j ? ` · ${g(j.loaded)} of ${g(j.total)}` : ""
|
|
95
|
-
]
|
|
155
|
+
/* @__PURE__ */ h("span", {
|
|
156
|
+
className: "text-xs text-text-secondary",
|
|
157
|
+
children: "JPG · PNG · up to 10 MB"
|
|
96
158
|
})
|
|
97
159
|
]
|
|
98
|
-
})
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
disabled: H,
|
|
110
|
-
onClick: () => D.current?.click(),
|
|
111
|
-
className: "inline-flex items-center gap-1.5 rounded-lg bg-bg-surface/90 px-3 py-1.5 text-sm font-medium text-text-primary shadow-sm backdrop-blur transition-colors hover:bg-bg-surface disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
112
|
-
children: [/* @__PURE__ */ p(l, { className: "h-4 w-4" }), " Replace"]
|
|
113
|
-
}), /* @__PURE__ */ m("button", {
|
|
114
|
-
type: "button",
|
|
115
|
-
disabled: C,
|
|
116
|
-
onClick: () => y(""),
|
|
117
|
-
className: "inline-flex items-center gap-1 rounded-lg bg-bg-surface/90 px-3 py-1.5 text-sm text-text-secondary shadow-sm backdrop-blur transition-colors hover:bg-status-error-bg-subtle hover:text-status-error-text disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
118
|
-
children: [/* @__PURE__ */ p(f, { className: "h-4 w-4" }), " Remove"]
|
|
119
|
-
})]
|
|
120
|
-
})]
|
|
121
|
-
}) : /* @__PURE__ */ m("button", {
|
|
122
|
-
type: "button",
|
|
123
|
-
disabled: H,
|
|
124
|
-
onClick: () => D.current?.click(),
|
|
125
|
-
className: i("flex min-h-40 w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-6 text-center transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:opacity-50", L ? "border-accent-primary bg-[var(--color-accent-soft)]" : "border-border-seam hover:border-accent-primary/60 hover:bg-bg-sunken"),
|
|
126
|
-
children: [
|
|
127
|
-
/* @__PURE__ */ p(d, {
|
|
128
|
-
className: "h-8 w-8 text-text-secondary",
|
|
129
|
-
"aria-hidden": "true"
|
|
130
|
-
}),
|
|
131
|
-
/* @__PURE__ */ p("span", {
|
|
132
|
-
className: "text-sm font-medium text-text-primary",
|
|
133
|
-
children: "Drag & drop an image here, or click to browse"
|
|
134
|
-
}),
|
|
135
|
-
/* @__PURE__ */ p("span", {
|
|
136
|
-
className: "text-xs text-text-secondary",
|
|
137
|
-
children: "JPG · PNG · up to 10 MB"
|
|
138
|
-
})
|
|
139
|
-
]
|
|
160
|
+
})
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ h("input", {
|
|
163
|
+
ref: A,
|
|
164
|
+
id: j,
|
|
165
|
+
type: "file",
|
|
166
|
+
accept: w,
|
|
167
|
+
disabled: J,
|
|
168
|
+
className: "sr-only",
|
|
169
|
+
"aria-label": v,
|
|
170
|
+
onChange: X
|
|
140
171
|
})
|
|
141
|
-
|
|
142
|
-
ref: D,
|
|
143
|
-
id: O,
|
|
144
|
-
type: "file",
|
|
145
|
-
accept: S,
|
|
146
|
-
className: "sr-only",
|
|
147
|
-
"aria-label": _,
|
|
148
|
-
onChange: W
|
|
149
|
-
})]
|
|
172
|
+
]
|
|
150
173
|
});
|
|
151
174
|
};
|
|
152
|
-
export {
|
|
175
|
+
export { v as ImageUploadField };
|
|
@@ -25,7 +25,7 @@ async function f(e, t, n, i) {
|
|
|
25
25
|
let o = await a.blob();
|
|
26
26
|
if (!o.type.startsWith("image/") || o.size === 0 || o.size > c) return null;
|
|
27
27
|
let s = new File([o], d(e, t, o.type), { type: o.type });
|
|
28
|
-
return (await r(s, i, n)).id;
|
|
28
|
+
return (await r(s, i, n, "PRIVATE")).id;
|
|
29
29
|
} catch {
|
|
30
30
|
return null;
|
|
31
31
|
}
|