@ynput/ayon-frontend-shared 0.7.6 → 0.8.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/DetailsPanel.es.js +361 -355
- package/dist/Feed.es.js +1 -1
- package/dist/ListTable.es.js +18 -18
- package/dist/NewEntity.es.js +30 -30
- package/dist/ProjectTreeTable.es.js +984 -974
- package/dist/ProjectsTable.es.js +3 -3
- package/dist/Slicer.es.js +53 -50
- package/dist/Views.es.js +150 -151
- package/dist/api.es.js +166 -165
- package/dist/chunks/Actions.es.js +9 -10
- package/dist/chunks/ColumnDropIndicator.es.js +2 -2
- package/dist/chunks/ColumnHeaderMenuUI.es.js +3 -4
- package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +2 -2
- package/dist/chunks/DetailsDialog.es.js +3 -3
- package/dist/chunks/EmptyPlaceholder.es.js +7 -7
- package/dist/chunks/EntityPath.es.js +38 -39
- package/dist/chunks/EntityPickerDialog.es.js +65 -66
- package/dist/chunks/EntityTooltip.es.js +18 -19
- package/dist/chunks/Feed.es.js +1381 -1355
- package/dist/chunks/FilmstripEntityCard.es.js +5201 -0
- package/dist/chunks/FilterErrorActions.es.js +2 -3
- package/dist/chunks/GroupSettingsFallback.es.js +2 -2
- package/dist/chunks/Menu.es.js +52 -53
- package/dist/chunks/MetaWidget.es.js +1948 -1875
- package/dist/chunks/ProjectFoldersContext.es.js +40 -40
- package/dist/chunks/RepresentationsList.es.js +1 -1
- package/dist/chunks/ReviewablesSelector.es.js +759 -742
- package/dist/chunks/SimpleTable.es.js +2 -1
- package/dist/chunks/Slicer.es.js +49 -50
- package/dist/chunks/TableExportContextInstance.es.js +600 -402
- package/dist/chunks/TableSettingsFallback.es.js +3 -4
- package/dist/chunks/ThumbnailSimple.es.js +114 -99
- package/dist/chunks/VideoPlayer.es.js +8 -9
- package/dist/chunks/Watchers.es.js +928 -871
- package/dist/chunks/expandRelativeDates.es.js +1 -1
- package/dist/chunks/getThumbnailUrl.es.js +33 -21
- package/dist/chunks/getUris.es.js +1580 -1610
- package/dist/chunks/queryFilterToClientFilter.es.js +1 -1
- package/dist/chunks/realtimeUpdatesUtils.es.js +15 -15
- package/dist/chunks/searchTerms.es.js +773 -696
- package/dist/chunks/useAttributeEnums.es.js +22 -22
- package/dist/chunks/useDateRangeFilter.es.js +1 -1
- package/dist/chunks/useHierarchySelection.es.js +3 -4
- package/dist/chunks/useLoadModule.es.js +3 -4
- package/dist/components.es.js +475 -467
- package/dist/context.es.js +615 -540
- package/dist/hooks.es.js +193 -171
- package/dist/index.es.js +2 -2
- package/dist/types/Actions.d.ts +10 -8
- package/dist/types/DetailsPanel.d.ts +54 -76
- package/dist/types/EntityPickerDialog.d.ts +12 -6
- package/dist/types/Feed.d.ts +24 -24
- package/dist/types/ListTable.d.ts +33 -27
- package/dist/types/NewEntity.d.ts +26 -39
- package/dist/types/ProjectTreeTable.d.ts +199 -195
- package/dist/types/ProjectsTable.d.ts +6 -6
- package/dist/types/RepresentationsList.d.ts +4 -0
- package/dist/types/Slicer.d.ts +63 -246
- package/dist/types/Views.d.ts +71 -298
- package/dist/types/api.d.ts +3164 -2363
- package/dist/types/components.d.ts +327 -474
- package/dist/types/context.d.ts +285 -572
- package/dist/types/hooks.d.ts +76 -47
- package/dist/types/index.d.ts +6 -0
- package/dist/types/util.d.ts +141 -120
- package/dist/util.es.js +71 -68
- package/package.json +6 -6
- package/dist/chunks/EntityUpdatesContext.es.js +0 -61
- package/dist/chunks/PlayableIcon.es.js +0 -5020
- package/dist/chunks/viewUpdateHelper.es.js +0 -153
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as I, useCallback as
|
|
3
|
-
import { getMixedCounts as
|
|
4
|
-
import { snakeCase as
|
|
1
|
+
import { jsx as u, jsxs as z, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as I, useCallback as ee, useState as O, useEffect as G, useRef as ie, forwardRef as te, useContext as Ae } from "react";
|
|
3
|
+
import { getMixedCounts as je, BorderedSection as Z, Button as Q, applyMixedChange as De, StatusSelect as Ce, AssigneeSelect as Ne, TagsSelect as Ue, EnumDropdown as $e, Icon as V, getMimeTypeIcon as Me, theme as ze, getFileSizeString as Re, WatcherSelect as We } from "@ynput/ayon-react-components";
|
|
4
|
+
import { snakeCase as Le, upperFirst as Pe, intersectionBy as fe } from "lodash";
|
|
5
5
|
import "primereact/confirmdialog";
|
|
6
|
-
import { toast as
|
|
7
|
-
import { c as
|
|
6
|
+
import { toast as oe } from "react-toastify";
|
|
7
|
+
import { c as re } from "./copyToClipboard.es.js";
|
|
8
8
|
import "uuid";
|
|
9
|
-
import { aF as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { E as
|
|
14
|
-
import "./
|
|
15
|
-
import {
|
|
9
|
+
import { aF as ve, b6 as Be, br as ye, b9 as Oe, ba as Ie, bb as Ve, bB as _e, by as He, bJ as Qe, bq as qe, a as J, bz as Ge } from "./searchTerms.es.js";
|
|
10
|
+
import be from "axios";
|
|
11
|
+
import m, { keyframes as xe, css as we } from "styled-components";
|
|
12
|
+
import W from "clsx";
|
|
13
|
+
import { E as Ke, t as Je, M as Ze, T as Xe, D as Ye, B as et, l as tt } from "./MetaWidget.es.js";
|
|
14
|
+
import { U as ot, F as ke } from "./FilmstripEntityCard.es.js";
|
|
15
|
+
import { dr as rt, c1 as at, cf as Ee, bl as nt, cA as it, as as st, bA as lt, de as ct } from "./getUris.es.js";
|
|
16
16
|
import "@module-federation/enhanced/runtime";
|
|
17
17
|
import "@ynput/ayon-addon/host";
|
|
18
|
-
import {
|
|
18
|
+
import { m as ae, c as dt, q as pt, T as ut } from "./TableExportContextInstance.es.js";
|
|
19
19
|
import "semver";
|
|
20
20
|
import "./ContextMenuContextInstance.es.js";
|
|
21
21
|
import "react-dom";
|
|
22
|
-
import "react-redux";
|
|
23
22
|
import "react-router-dom";
|
|
24
|
-
import { format as
|
|
23
|
+
import { format as mt } from "date-fns";
|
|
25
24
|
import "lexical";
|
|
26
25
|
import "@lexical/markdown";
|
|
27
26
|
import "match-sorter";
|
|
@@ -34,71 +33,72 @@ import "@lexical/react/LexicalBlockWithAlignableContents";
|
|
|
34
33
|
import "@lexical/react/LexicalDecoratorBlockNode";
|
|
35
34
|
import "@ynput/ayon-addon";
|
|
36
35
|
import "@tanstack/react-table";
|
|
37
|
-
import
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
import "react-redux";
|
|
37
|
+
import { g as gt, h as se } from "./humanizeFieldName.es.js";
|
|
38
|
+
import { a as ht, A as ft } from "./ThumbnailSimple.es.js";
|
|
39
|
+
import { b as vt, g as yt, a as bt } from "./getThumbnailUrl.es.js";
|
|
40
|
+
import { p as q } from "./parseFilename.es.js";
|
|
41
|
+
import { classNames as xt } from "primereact/utils";
|
|
42
|
+
import { u as wt } from "./useCreateContextMenu.es.js";
|
|
43
|
+
const le = [], kt = (e) => {
|
|
44
|
+
const { data: t, isError: o } = Ve(void 0, { skip: !e });
|
|
45
45
|
return I(
|
|
46
46
|
() => ({
|
|
47
47
|
// a failed registry is settled too: every param is sent, same fallback as the batch
|
|
48
|
-
isRegistryLoaded: !!t ||
|
|
49
|
-
acceptedParams: t?.find(({ name:
|
|
48
|
+
isRegistryLoaded: !!t || o,
|
|
49
|
+
acceptedParams: t?.find(({ name: r }) => r === e)?.acceptedParams
|
|
50
50
|
}),
|
|
51
|
-
[t,
|
|
51
|
+
[t, o, e]
|
|
52
52
|
);
|
|
53
|
-
},
|
|
54
|
-
const [e] =
|
|
55
|
-
return
|
|
56
|
-
async (
|
|
57
|
-
const
|
|
58
|
-
}))?.find(({ name: a }) => a ===
|
|
53
|
+
}, rr = () => {
|
|
54
|
+
const [e] = Oe(), [t] = Ie();
|
|
55
|
+
return ee(
|
|
56
|
+
async (o, r) => {
|
|
57
|
+
const c = (await t(void 0, !0).unwrap().catch(() => {
|
|
58
|
+
}))?.find(({ name: a }) => a === o.enumResolver)?.acceptedParams;
|
|
59
59
|
try {
|
|
60
60
|
const a = await e(
|
|
61
|
-
|
|
61
|
+
ve(o, { projectName: r }, c),
|
|
62
62
|
!0
|
|
63
63
|
).unwrap();
|
|
64
64
|
if (a.error) throw new Error(a.error);
|
|
65
|
-
return
|
|
65
|
+
return ye(a.items);
|
|
66
66
|
} catch (a) {
|
|
67
|
-
throw
|
|
67
|
+
throw Et(a);
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
[e, t]
|
|
71
71
|
);
|
|
72
|
-
},
|
|
72
|
+
}, Et = (e) => {
|
|
73
73
|
if (e instanceof Error) return e;
|
|
74
74
|
const {
|
|
75
75
|
message: t,
|
|
76
|
-
data:
|
|
77
|
-
status:
|
|
78
|
-
error:
|
|
76
|
+
data: o,
|
|
77
|
+
status: r,
|
|
78
|
+
error: g
|
|
79
79
|
} = e || {};
|
|
80
|
-
return typeof
|
|
81
|
-
},
|
|
82
|
-
const
|
|
83
|
-
() =>
|
|
80
|
+
return typeof o?.detail == "string" ? new Error(o.detail) : typeof g == "string" ? new Error(g) : typeof t == "string" ? new Error(t) : new Error(r ? `Request failed (${r})` : "Request failed");
|
|
81
|
+
}, St = (e, { projectName: t, skip: o } = {}) => {
|
|
82
|
+
const r = e?.enumResolver, { acceptedParams: g, isRegistryLoaded: c } = kt(r), a = I(
|
|
83
|
+
() => ve(e, { projectName: t }, g),
|
|
84
84
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
85
|
-
[
|
|
85
|
+
[r, e?.enumResolverSettings, t, g]
|
|
86
86
|
), {
|
|
87
87
|
currentData: d,
|
|
88
|
-
isFetching:
|
|
88
|
+
isFetching: p,
|
|
89
89
|
isError: i
|
|
90
|
-
} =
|
|
90
|
+
} = Be(a, {
|
|
91
91
|
// waiting for the registry keeps the cache key final: no request is sent with params that get dropped
|
|
92
|
-
skip: !
|
|
93
|
-
}),
|
|
92
|
+
skip: !r || !!o || !c
|
|
93
|
+
}), f = I(() => r ? d ? ye(d.items) : le : e?.enum || le, [r, d, e?.enum]), s = !!r && !p && (i || !!d?.error);
|
|
94
94
|
return {
|
|
95
|
-
options:
|
|
95
|
+
options: f,
|
|
96
96
|
// a background refetch (tag invalidation) keeps the cached options, so it is not a load
|
|
97
|
-
isLoading: !!
|
|
98
|
-
isError:
|
|
99
|
-
errorMessage:
|
|
97
|
+
isLoading: !!r && !o && (!c || p && !d),
|
|
98
|
+
isError: s,
|
|
99
|
+
errorMessage: s ? d?.error : void 0
|
|
100
100
|
};
|
|
101
|
-
},
|
|
101
|
+
}, Tt = [
|
|
102
102
|
"id",
|
|
103
103
|
"name",
|
|
104
104
|
"label",
|
|
@@ -109,18 +109,22 @@ const se = [], ht = (e) => {
|
|
|
109
109
|
"tags",
|
|
110
110
|
"status",
|
|
111
111
|
"updatedAt",
|
|
112
|
+
"updatedBy",
|
|
112
113
|
"createdAt",
|
|
114
|
+
"createdBy",
|
|
113
115
|
"projectName",
|
|
114
116
|
"path",
|
|
115
117
|
"description"
|
|
116
|
-
],
|
|
118
|
+
], ce = [
|
|
117
119
|
"id",
|
|
118
120
|
"entityType",
|
|
119
121
|
"projectName",
|
|
120
122
|
"path",
|
|
121
123
|
"createdAt",
|
|
122
|
-
"
|
|
123
|
-
|
|
124
|
+
"createdBy",
|
|
125
|
+
"updatedAt",
|
|
126
|
+
"updatedBy"
|
|
127
|
+
], Ft = [
|
|
124
128
|
"name",
|
|
125
129
|
"label",
|
|
126
130
|
"taskType",
|
|
@@ -128,68 +132,70 @@ const se = [], ht = (e) => {
|
|
|
128
132
|
"productType",
|
|
129
133
|
"tags",
|
|
130
134
|
"status"
|
|
131
|
-
],
|
|
132
|
-
const [
|
|
133
|
-
const i = {},
|
|
134
|
-
e.forEach((
|
|
135
|
+
], At = (e, t) => {
|
|
136
|
+
const [o, r] = O([]), [g, c] = O(null), a = () => {
|
|
137
|
+
const i = {}, f = /* @__PURE__ */ new Set();
|
|
138
|
+
e.forEach((n) => {
|
|
135
139
|
const v = {
|
|
136
|
-
id:
|
|
137
|
-
name:
|
|
138
|
-
label:
|
|
139
|
-
entityType:
|
|
140
|
-
createdAt:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
140
|
+
id: n.id,
|
|
141
|
+
name: n.name,
|
|
142
|
+
label: n.label,
|
|
143
|
+
entityType: n.entityType,
|
|
144
|
+
createdAt: n.createdAt,
|
|
145
|
+
createdBy: n.createdBy,
|
|
146
|
+
updatedAt: n.updatedAt,
|
|
147
|
+
updatedBy: n.updatedBy,
|
|
148
|
+
projectName: n.projectName,
|
|
149
|
+
status: n.status,
|
|
150
|
+
tags: n.tags || [],
|
|
151
|
+
path: n.path,
|
|
152
|
+
folderType: n.folder?.folderType,
|
|
153
|
+
productType: n.product?.productType,
|
|
154
|
+
taskType: n.task?.taskType,
|
|
155
|
+
description: n.attrib?.description?.toString() ?? ""
|
|
150
156
|
};
|
|
151
|
-
Object.keys(v).forEach((
|
|
152
|
-
|
|
153
|
-
}),
|
|
154
|
-
if (
|
|
155
|
-
const
|
|
156
|
-
i[
|
|
157
|
+
Object.keys(v).forEach((h) => {
|
|
158
|
+
Tt.includes(h) && (i[h] = i[h] || [], i[h].push(v[h]));
|
|
159
|
+
}), n.attrib && Object.keys(n.attrib).forEach((h) => {
|
|
160
|
+
if (h !== "description") {
|
|
161
|
+
const x = `attrib.${h}`;
|
|
162
|
+
i[x] = i[x] || [], i[x].push(n.attrib?.[h]);
|
|
157
163
|
}
|
|
158
164
|
});
|
|
159
165
|
});
|
|
160
|
-
const
|
|
161
|
-
const { value:
|
|
162
|
-
return
|
|
166
|
+
const s = Object.entries(i).reduce((n, [v, h]) => {
|
|
167
|
+
const { value: x, isMixed: E } = gt(h);
|
|
168
|
+
return n[v] = x, E && f.add(v), n;
|
|
163
169
|
}, {});
|
|
164
|
-
|
|
170
|
+
c(s), r(Array.from(f));
|
|
165
171
|
};
|
|
166
|
-
return
|
|
172
|
+
return G(() => {
|
|
167
173
|
t || e.length === 0 || a();
|
|
168
174
|
}, [e, t]), {
|
|
169
|
-
formData:
|
|
170
|
-
mixedFields:
|
|
171
|
-
updateFormData: (i,
|
|
172
|
-
|
|
173
|
-
...
|
|
174
|
-
[i]:
|
|
175
|
+
formData: g,
|
|
176
|
+
mixedFields: o,
|
|
177
|
+
updateFormData: (i, f) => {
|
|
178
|
+
c((s) => s && {
|
|
179
|
+
...s,
|
|
180
|
+
[i]: f
|
|
175
181
|
});
|
|
176
182
|
},
|
|
177
183
|
clearMixedField: (i) => {
|
|
178
|
-
|
|
184
|
+
r((f) => f.filter((s) => s !== i));
|
|
179
185
|
}
|
|
180
186
|
};
|
|
181
|
-
},
|
|
187
|
+
}, jt = ({
|
|
182
188
|
attributes: e,
|
|
183
189
|
folderTypes: t,
|
|
184
|
-
taskTypes:
|
|
185
|
-
statuses:
|
|
186
|
-
tags:
|
|
187
|
-
entityType:
|
|
190
|
+
taskTypes: o,
|
|
191
|
+
statuses: r,
|
|
192
|
+
tags: g,
|
|
193
|
+
entityType: c,
|
|
188
194
|
folderHasVersions: a,
|
|
189
195
|
attribAccess: d
|
|
190
196
|
}) => {
|
|
191
|
-
const
|
|
192
|
-
const { readableAttributes:
|
|
197
|
+
const p = I(() => {
|
|
198
|
+
const { readableAttributes: s, writableAttributes: n, writableFields: v } = d || {}, x = [
|
|
193
199
|
{
|
|
194
200
|
name: "name",
|
|
195
201
|
data: {
|
|
@@ -208,7 +214,7 @@ const se = [], ht = (e) => {
|
|
|
208
214
|
},
|
|
209
215
|
{
|
|
210
216
|
name: "folderType",
|
|
211
|
-
hidden:
|
|
217
|
+
hidden: c !== "folder",
|
|
212
218
|
data: {
|
|
213
219
|
type: "string",
|
|
214
220
|
title: "Folder Type",
|
|
@@ -222,12 +228,12 @@ const se = [], ht = (e) => {
|
|
|
222
228
|
},
|
|
223
229
|
{
|
|
224
230
|
name: "taskType",
|
|
225
|
-
hidden:
|
|
231
|
+
hidden: c !== "task",
|
|
226
232
|
data: {
|
|
227
233
|
type: "string",
|
|
228
234
|
title: "Task Type",
|
|
229
235
|
description: "Type of the task",
|
|
230
|
-
enum:
|
|
236
|
+
enum: o.map((l) => ({
|
|
231
237
|
value: l.name,
|
|
232
238
|
label: l.name,
|
|
233
239
|
icon: l.icon
|
|
@@ -240,7 +246,7 @@ const se = [], ht = (e) => {
|
|
|
240
246
|
type: "string",
|
|
241
247
|
title: "Status",
|
|
242
248
|
description: "The state the entity is in, is it approved or in progress etc.",
|
|
243
|
-
enum:
|
|
249
|
+
enum: r.map((l) => ({
|
|
244
250
|
value: l.name,
|
|
245
251
|
label: l.name,
|
|
246
252
|
icon: l.icon,
|
|
@@ -254,7 +260,7 @@ const se = [], ht = (e) => {
|
|
|
254
260
|
type: "list_of_strings",
|
|
255
261
|
title: "Tags",
|
|
256
262
|
widget: "tags",
|
|
257
|
-
enum:
|
|
263
|
+
enum: g.map((l) => ({
|
|
258
264
|
value: l.name,
|
|
259
265
|
label: l.name,
|
|
260
266
|
color: l.color
|
|
@@ -262,7 +268,7 @@ const se = [], ht = (e) => {
|
|
|
262
268
|
}
|
|
263
269
|
}
|
|
264
270
|
].map(
|
|
265
|
-
(l) => l.name === "folderType" &&
|
|
271
|
+
(l) => l.name === "folderType" && c === "folder" && a ? {
|
|
266
272
|
...l,
|
|
267
273
|
readonly: !0,
|
|
268
274
|
data: {
|
|
@@ -270,95 +276,100 @@ const se = [], ht = (e) => {
|
|
|
270
276
|
description: "Folder type is locked because the folder has published versions."
|
|
271
277
|
}
|
|
272
278
|
} : l
|
|
273
|
-
),
|
|
274
|
-
...
|
|
279
|
+
), E = c === "version" ? [
|
|
280
|
+
...x.map(
|
|
275
281
|
(l) => ["tags", "status"].includes(l.name) ? l : { ...l, readonly: !0 }
|
|
276
282
|
)
|
|
277
|
-
] :
|
|
278
|
-
(l) => v.includes(l.name) || v.includes(
|
|
279
|
-
) :
|
|
283
|
+
] : x, S = v ? E.map(
|
|
284
|
+
(l) => v.includes(l.name) || v.includes(Le(l.name)) ? l : { ...l, readonly: !0 }
|
|
285
|
+
) : E, y = c ? e.filter((l) => l.scope?.includes(c) && l.name !== "description").filter((l) => !s || s.includes(l.name)).map((l) => ({
|
|
280
286
|
name: "attrib." + l.name,
|
|
281
287
|
data: l.data,
|
|
282
|
-
...
|
|
283
|
-
...
|
|
284
|
-
})) : [], k =
|
|
288
|
+
...c === "version" && l.builtin ? { readonly: !0 } : {},
|
|
289
|
+
...n && !n.includes(l.name) ? { readonly: !0 } : {}
|
|
290
|
+
})) : [], k = ce.map((l) => ({
|
|
285
291
|
name: l,
|
|
286
292
|
readonly: !0,
|
|
287
293
|
data: {
|
|
288
294
|
type: "string",
|
|
289
|
-
title:
|
|
295
|
+
title: {
|
|
296
|
+
createdAt: "Created at",
|
|
297
|
+
createdBy: "Created by",
|
|
298
|
+
updatedAt: "Updated at",
|
|
299
|
+
updatedBy: "Updated by"
|
|
300
|
+
}[l] || Pe(l)
|
|
290
301
|
}
|
|
291
|
-
})),
|
|
302
|
+
})), j = [
|
|
292
303
|
...S,
|
|
293
|
-
...
|
|
304
|
+
...y,
|
|
294
305
|
...k
|
|
295
|
-
],
|
|
296
|
-
return [...
|
|
297
|
-
const
|
|
298
|
-
return
|
|
306
|
+
], w = ["path", "name"];
|
|
307
|
+
return [...j].sort((l, $) => {
|
|
308
|
+
const N = w.indexOf(l.name), R = w.indexOf($.name);
|
|
309
|
+
return N === -1 && R === -1 ? 0 : N === -1 ? 1 : R === -1 ? -1 : N - R;
|
|
299
310
|
});
|
|
300
311
|
}, [
|
|
301
312
|
e,
|
|
302
313
|
t,
|
|
303
|
-
r,
|
|
304
314
|
o,
|
|
315
|
+
r,
|
|
316
|
+
g,
|
|
305
317
|
c,
|
|
306
|
-
n,
|
|
307
318
|
a,
|
|
308
319
|
d
|
|
309
|
-
]), i =
|
|
310
|
-
(
|
|
311
|
-
),
|
|
312
|
-
(
|
|
320
|
+
]), i = p.filter(
|
|
321
|
+
(s) => Ft.includes(s.name) || s.name.startsWith("attrib.")
|
|
322
|
+
), f = p.filter(
|
|
323
|
+
(s) => ce.includes(s.name)
|
|
313
324
|
);
|
|
314
325
|
return {
|
|
315
|
-
fields:
|
|
326
|
+
fields: p,
|
|
316
327
|
editableFields: i,
|
|
317
|
-
readOnlyFieldsData:
|
|
328
|
+
readOnlyFieldsData: f
|
|
318
329
|
};
|
|
319
|
-
},
|
|
320
|
-
const [
|
|
321
|
-
return { updateEntity: async (
|
|
330
|
+
}, Dt = ({ entities: e, entityType: t }) => {
|
|
331
|
+
const [o] = rt(), { onUpdateEntity: r } = ae();
|
|
332
|
+
return { updateEntity: async (c, a) => {
|
|
322
333
|
if (a == null) {
|
|
323
334
|
console.error("value is null or undefined");
|
|
324
335
|
return;
|
|
325
336
|
}
|
|
326
337
|
try {
|
|
327
|
-
const d = e.map((
|
|
328
|
-
id:
|
|
329
|
-
projectName:
|
|
338
|
+
const d = e.map((p) => ({
|
|
339
|
+
id: p.id,
|
|
340
|
+
projectName: p.projectName,
|
|
330
341
|
data: {
|
|
331
|
-
[
|
|
342
|
+
[c]: typeof a == "function" ? a(p.id) : a
|
|
332
343
|
},
|
|
333
|
-
currentAssignees:
|
|
344
|
+
currentAssignees: p.users,
|
|
334
345
|
meta: {
|
|
335
|
-
folderId:
|
|
346
|
+
folderId: p.folderId
|
|
336
347
|
}
|
|
337
348
|
}));
|
|
338
|
-
await
|
|
349
|
+
await o({ operations: d, entityType: t }), r?.({ operations: d, entityType: t });
|
|
339
350
|
} catch {
|
|
340
|
-
|
|
351
|
+
oe.error(`Error updating ${t}`);
|
|
341
352
|
}
|
|
342
353
|
} };
|
|
343
|
-
},
|
|
344
|
-
(t,
|
|
354
|
+
}, Y = (e) => e.reduce(
|
|
355
|
+
(t, o) => o ? t ? t.filter((r) => o.includes(r)) : o : t,
|
|
345
356
|
void 0
|
|
346
|
-
),
|
|
347
|
-
const { data:
|
|
348
|
-
if (!
|
|
357
|
+
), Ct = ({ entities: e, entityType: t }) => {
|
|
358
|
+
const { data: r } = at(), g = I(() => {
|
|
359
|
+
if (!r?.projects) return {};
|
|
349
360
|
const a = [...new Set(e.map((i) => i.projectName))].map(
|
|
350
|
-
(i) =>
|
|
351
|
-
), d = a.map((i) => i.attrib_read),
|
|
361
|
+
(i) => r.projects?.[i] || {}
|
|
362
|
+
), d = a.map((i) => i.attrib_read), p = a.map((i) => i.attrib_write);
|
|
352
363
|
return {
|
|
353
|
-
readableAttributes:
|
|
364
|
+
readableAttributes: Y(
|
|
354
365
|
d.map((i) => i?.enabled ? i.attributes ?? [] : void 0)
|
|
355
366
|
),
|
|
356
|
-
writableAttributes:
|
|
357
|
-
|
|
367
|
+
writableAttributes: Y(
|
|
368
|
+
p.map((i) => i?.enabled ? i.attributes ?? [] : void 0)
|
|
358
369
|
),
|
|
359
|
-
writableFields:
|
|
370
|
+
writableFields: Y(p.map((i) => i?.enabled ? i.fields ?? [] : void 0))
|
|
360
371
|
};
|
|
361
|
-
}, [
|
|
372
|
+
}, [r, e]), { updateEntity: c } = Dt({
|
|
362
373
|
entities: e.map((a) => ({
|
|
363
374
|
id: a.id,
|
|
364
375
|
projectName: a.projectName || "",
|
|
@@ -370,45 +381,45 @@ const se = [], ht = (e) => {
|
|
|
370
381
|
});
|
|
371
382
|
return {
|
|
372
383
|
enableEditing: !0,
|
|
373
|
-
attribAccess:
|
|
374
|
-
updateEntity:
|
|
384
|
+
attribAccess: g,
|
|
385
|
+
updateEntity: c
|
|
375
386
|
};
|
|
376
|
-
},
|
|
377
|
-
const
|
|
378
|
-
if (!
|
|
387
|
+
}, Nt = (e, t) => {
|
|
388
|
+
const o = Ee({ projects: [...new Set(e).values()] });
|
|
389
|
+
if (!o || !o.data)
|
|
379
390
|
return [];
|
|
380
|
-
let
|
|
381
|
-
for (const
|
|
382
|
-
const
|
|
391
|
+
let r;
|
|
392
|
+
for (const g of Object.values(o.data)) {
|
|
393
|
+
const c = g.statuses?.filter(
|
|
383
394
|
(a) => t.every((d) => !a.scope || a.scope?.includes(d))
|
|
384
395
|
) || [];
|
|
385
|
-
if (
|
|
386
|
-
|
|
396
|
+
if (r === void 0) {
|
|
397
|
+
r = c;
|
|
387
398
|
continue;
|
|
388
399
|
}
|
|
389
|
-
|
|
400
|
+
r = fe(r, c, "name");
|
|
390
401
|
}
|
|
391
|
-
return
|
|
392
|
-
},
|
|
393
|
-
let
|
|
394
|
-
return
|
|
395
|
-
(
|
|
402
|
+
return r;
|
|
403
|
+
}, ar = (e, t) => {
|
|
404
|
+
let o = Object.values(e || {});
|
|
405
|
+
return o.length == 0 || o[0].scope === void 0 ? o : o.filter(
|
|
406
|
+
(r) => t.every((g) => r.scope === void 0 || r.scope.includes(g))
|
|
396
407
|
);
|
|
397
|
-
},
|
|
398
|
-
const
|
|
399
|
-
if (!
|
|
408
|
+
}, Ut = (e, t) => {
|
|
409
|
+
const o = Ee({ projects: [...new Set(e).values()] });
|
|
410
|
+
if (!o || !o.data)
|
|
400
411
|
return [];
|
|
401
|
-
let
|
|
402
|
-
for (const
|
|
403
|
-
let
|
|
404
|
-
if (t === "task" ?
|
|
405
|
-
|
|
412
|
+
let r;
|
|
413
|
+
for (const g of Object.values(o.data)) {
|
|
414
|
+
let c = [];
|
|
415
|
+
if (t === "task" ? c = g.taskTypes || [] : t === "folder" && (c = g.folderTypes || []), r === void 0) {
|
|
416
|
+
r = c;
|
|
406
417
|
continue;
|
|
407
418
|
}
|
|
408
|
-
|
|
419
|
+
r = fe(r, c, "name");
|
|
409
420
|
}
|
|
410
|
-
return
|
|
411
|
-
},
|
|
421
|
+
return r || [];
|
|
422
|
+
}, de = m.div`
|
|
412
423
|
width: 100%;
|
|
413
424
|
overflow: hidden;
|
|
414
425
|
text-overflow: ellipsis;
|
|
@@ -418,7 +429,7 @@ const se = [], ht = (e) => {
|
|
|
418
429
|
input {
|
|
419
430
|
text-align: left;
|
|
420
431
|
}
|
|
421
|
-
`,
|
|
432
|
+
`, $t = m(Ke)`
|
|
422
433
|
.enum,
|
|
423
434
|
.edit-trigger {
|
|
424
435
|
&:hover {
|
|
@@ -428,179 +439,179 @@ const se = [], ht = (e) => {
|
|
|
428
439
|
&:hover {
|
|
429
440
|
background-color: unset;
|
|
430
441
|
}
|
|
431
|
-
`,
|
|
442
|
+
`, Mt = m(Je)`
|
|
432
443
|
&.enum:hover {
|
|
433
444
|
background-color: unset;
|
|
434
445
|
}
|
|
435
|
-
`,
|
|
446
|
+
`, zt = ({
|
|
436
447
|
field: e,
|
|
437
448
|
value: t,
|
|
438
|
-
isEditing:
|
|
439
|
-
isReadOnly:
|
|
440
|
-
isMixed:
|
|
441
|
-
onChange:
|
|
449
|
+
isEditing: o,
|
|
450
|
+
isReadOnly: r,
|
|
451
|
+
isMixed: g,
|
|
452
|
+
onChange: c,
|
|
442
453
|
onMixedChange: a,
|
|
443
454
|
onCancelEdit: d,
|
|
444
|
-
onExpand:
|
|
455
|
+
onExpand: p,
|
|
445
456
|
entities: i = [],
|
|
446
|
-
entityType:
|
|
447
|
-
projectName:
|
|
457
|
+
entityType: f = "task",
|
|
458
|
+
projectName: s
|
|
448
459
|
}) => {
|
|
449
|
-
const { type:
|
|
450
|
-
isEditing:
|
|
451
|
-
isReadOnly:
|
|
460
|
+
const { type: n, widget: v } = e.data, h = {
|
|
461
|
+
isEditing: o && !r,
|
|
462
|
+
isReadOnly: r,
|
|
452
463
|
isInherited: !1,
|
|
453
|
-
onChange: (
|
|
454
|
-
},
|
|
464
|
+
onChange: (D) => c(e.name, D)
|
|
465
|
+
}, x = i.map((D) => D.projectName), E = Nt(x, [f]), S = Ut(x, f), y = s || x[0], {
|
|
455
466
|
options: k,
|
|
456
|
-
isLoading:
|
|
457
|
-
isError:
|
|
458
|
-
errorMessage:
|
|
459
|
-
} =
|
|
460
|
-
if (!(!a || i.length < 2 ||
|
|
461
|
-
return
|
|
462
|
-
i.map((
|
|
463
|
-
const L = e.name === "tags" ?
|
|
467
|
+
isLoading: j,
|
|
468
|
+
isError: w,
|
|
469
|
+
errorMessage: T
|
|
470
|
+
} = St(e.data, { projectName: y }), l = w ? qe(T) : void 0, $ = I(() => {
|
|
471
|
+
if (!(!a || i.length < 2 || n !== "list_of_strings"))
|
|
472
|
+
return je(
|
|
473
|
+
i.map((D) => {
|
|
474
|
+
const L = e.name === "tags" ? D.tags : e.name.startsWith("attrib.") ? D.attrib?.[e.name.slice(7)] : void 0;
|
|
464
475
|
return Array.isArray(L) ? L.map(String) : [];
|
|
465
476
|
})
|
|
466
477
|
);
|
|
467
|
-
}, [a, i,
|
|
468
|
-
mixedCounts:
|
|
478
|
+
}, [a, i, n, e.name]), N = $ && {
|
|
479
|
+
mixedCounts: $,
|
|
469
480
|
mixedTotal: i.length,
|
|
470
|
-
mixedLabel: `${
|
|
471
|
-
onMixedChange: (
|
|
472
|
-
},
|
|
473
|
-
let
|
|
474
|
-
const
|
|
475
|
-
if (
|
|
476
|
-
return /* @__PURE__ */
|
|
481
|
+
mixedLabel: `${f}s`,
|
|
482
|
+
onMixedChange: (D) => a?.(e.name, D)
|
|
483
|
+
}, R = e.name === "attrib.endDate" && i.length > 0 && i.every((D) => D.data?.schedulerSyncData?.allDay === !0);
|
|
484
|
+
let C = t ?? "";
|
|
485
|
+
const b = e.data.title || e.name, F = t == null || t === "" || Array.isArray(t) && t.length === 0;
|
|
486
|
+
if (n !== "boolean" && r && !g && F)
|
|
487
|
+
return /* @__PURE__ */ u(de, { children: "-" });
|
|
477
488
|
switch (!0) {
|
|
478
|
-
case
|
|
479
|
-
return /* @__PURE__ */
|
|
480
|
-
case
|
|
481
|
-
return /* @__PURE__ */
|
|
482
|
-
|
|
489
|
+
case n === "boolean":
|
|
490
|
+
return /* @__PURE__ */ u(et, { value: !!C, ...h, style: { margin: 0 } });
|
|
491
|
+
case n === "datetime":
|
|
492
|
+
return /* @__PURE__ */ u(
|
|
493
|
+
Ye,
|
|
483
494
|
{
|
|
484
|
-
value:
|
|
485
|
-
...
|
|
495
|
+
value: C,
|
|
496
|
+
...h,
|
|
486
497
|
isEditing: !0,
|
|
487
498
|
onCancelEdit: d,
|
|
488
499
|
style: { width: "fit-content" },
|
|
489
500
|
autoFocus: !1,
|
|
490
|
-
isMidnightExclusive:
|
|
501
|
+
isMidnightExclusive: R
|
|
491
502
|
}
|
|
492
503
|
);
|
|
493
504
|
case v === "tags":
|
|
494
|
-
return /* @__PURE__ */
|
|
495
|
-
|
|
505
|
+
return /* @__PURE__ */ u(
|
|
506
|
+
Mt,
|
|
496
507
|
{
|
|
497
|
-
value: Array.isArray(
|
|
508
|
+
value: Array.isArray(C) ? C : [],
|
|
498
509
|
options: k,
|
|
499
|
-
projectName:
|
|
500
|
-
isProjectTags: e.name === "tags" && new Set(
|
|
510
|
+
projectName: y,
|
|
511
|
+
isProjectTags: e.name === "tags" && new Set(x).size <= 1,
|
|
501
512
|
pt: { template: { style: { height: 32 }, className: "enum" } },
|
|
502
|
-
placeholder:
|
|
503
|
-
|
|
513
|
+
placeholder: g ? `Mixed ${b}` : `Select ${b}...`,
|
|
514
|
+
...N,
|
|
504
515
|
onCancelEdit: d,
|
|
505
516
|
align: "right",
|
|
506
|
-
...
|
|
517
|
+
...h
|
|
507
518
|
}
|
|
508
519
|
);
|
|
509
|
-
case
|
|
510
|
-
const
|
|
520
|
+
case _e(e.data): {
|
|
521
|
+
const D = n?.includes("list");
|
|
511
522
|
let L = [];
|
|
512
|
-
|
|
513
|
-
let P = k.map((
|
|
514
|
-
value:
|
|
515
|
-
label:
|
|
516
|
-
icon:
|
|
517
|
-
color:
|
|
518
|
-
group:
|
|
519
|
-
hidden:
|
|
523
|
+
D ? L = Array.isArray(C) ? C : [] : g ? L = [] : L = [C];
|
|
524
|
+
let P = k.map((U) => ({
|
|
525
|
+
value: U.value,
|
|
526
|
+
label: U.label,
|
|
527
|
+
icon: He(U.icon),
|
|
528
|
+
color: U.color,
|
|
529
|
+
group: U.group,
|
|
530
|
+
hidden: U.hidden
|
|
520
531
|
}));
|
|
521
|
-
return e.name === "status" && i.length > 0 &&
|
|
522
|
-
value:
|
|
523
|
-
label:
|
|
524
|
-
icon:
|
|
525
|
-
color:
|
|
526
|
-
}))), e.name === "taskType" && i.length > 0 && S && S.length > 0 && (P = S.map((
|
|
527
|
-
value:
|
|
528
|
-
label:
|
|
529
|
-
icon:
|
|
530
|
-
color:
|
|
531
|
-
}))), e.allowNone && L.length && !
|
|
532
|
+
return e.name === "status" && i.length > 0 && E && E.length > 0 && (P = E.map((U) => ({
|
|
533
|
+
value: U.name,
|
|
534
|
+
label: U.name,
|
|
535
|
+
icon: U.icon,
|
|
536
|
+
color: U.color
|
|
537
|
+
}))), e.name === "taskType" && i.length > 0 && S && S.length > 0 && (P = S.map((U) => ({
|
|
538
|
+
value: U.name,
|
|
539
|
+
label: U.name,
|
|
540
|
+
icon: U.icon,
|
|
541
|
+
color: U.color
|
|
542
|
+
}))), e.allowNone && L.length && !D && C && C !== "" && (P = [
|
|
532
543
|
{ value: "", label: `No ${e.data.title || e.name}` },
|
|
533
544
|
...P
|
|
534
|
-
]), /* @__PURE__ */
|
|
535
|
-
|
|
545
|
+
]), /* @__PURE__ */ u(
|
|
546
|
+
$t,
|
|
536
547
|
{
|
|
537
548
|
"data-tooltip": l,
|
|
538
549
|
value: L,
|
|
539
550
|
options: P,
|
|
540
|
-
type:
|
|
551
|
+
type: n,
|
|
541
552
|
pt: {
|
|
542
553
|
template: {
|
|
543
554
|
style: { height: 32 },
|
|
544
555
|
className: "enum"
|
|
545
556
|
}
|
|
546
557
|
},
|
|
547
|
-
placeholder: l ? `Could not load ${
|
|
548
|
-
error:
|
|
558
|
+
placeholder: l ? `Could not load ${b}` : g ? `Mixed ${b}` : `Select ${b}...`,
|
|
559
|
+
error: Qe(l),
|
|
549
560
|
onCancelEdit: d,
|
|
550
561
|
align: "right",
|
|
551
562
|
enableCustomValues: e.enableCustomValues,
|
|
552
|
-
isLoadingOptions:
|
|
563
|
+
isLoadingOptions: j,
|
|
553
564
|
search: e.enableSearch ?? P.length >= 5,
|
|
554
565
|
sortBySelected: !P,
|
|
555
|
-
|
|
556
|
-
...
|
|
566
|
+
...N,
|
|
567
|
+
...h
|
|
557
568
|
}
|
|
558
569
|
);
|
|
559
570
|
}
|
|
560
|
-
case (
|
|
571
|
+
case (n === "string" || n === "integer" || n === "float"):
|
|
561
572
|
default:
|
|
562
|
-
return v === "markdown" ? /* @__PURE__ */
|
|
563
|
-
|
|
573
|
+
return v === "markdown" ? /* @__PURE__ */ u(
|
|
574
|
+
Ze,
|
|
564
575
|
{
|
|
565
|
-
value:
|
|
576
|
+
value: C.toString(),
|
|
566
577
|
onCancelEdit: d,
|
|
567
|
-
onExpand:
|
|
568
|
-
showExpand: !!
|
|
569
|
-
...
|
|
578
|
+
onExpand: p,
|
|
579
|
+
showExpand: !!p,
|
|
580
|
+
...h
|
|
570
581
|
}
|
|
571
|
-
) : /* @__PURE__ */
|
|
572
|
-
|
|
582
|
+
) : /* @__PURE__ */ u(de, { children: /* @__PURE__ */ u(
|
|
583
|
+
Xe,
|
|
573
584
|
{
|
|
574
|
-
value:
|
|
585
|
+
value: C.toString(),
|
|
575
586
|
onCancelEdit: d,
|
|
576
|
-
type:
|
|
577
|
-
...
|
|
587
|
+
type: n,
|
|
588
|
+
...h
|
|
578
589
|
}
|
|
579
590
|
) });
|
|
580
591
|
}
|
|
581
|
-
},
|
|
592
|
+
}, Rt = m.div`
|
|
582
593
|
color: var(--md-sys-color-outline);
|
|
583
594
|
white-space: nowrap;
|
|
584
595
|
overflow: hidden;
|
|
585
596
|
text-overflow: ellipsis;
|
|
586
597
|
font-size: 14px;
|
|
587
|
-
`,
|
|
598
|
+
`, Se = ({
|
|
588
599
|
name: e,
|
|
589
600
|
data: t,
|
|
590
|
-
showDetailedTooltip:
|
|
591
|
-
...
|
|
601
|
+
showDetailedTooltip: o = !1,
|
|
602
|
+
...r
|
|
592
603
|
}) => {
|
|
593
|
-
const
|
|
594
|
-
return /* @__PURE__ */
|
|
595
|
-
|
|
604
|
+
const g = t.title ? se(t.title) : se(e), c = o ? `${g} (${e}) ${t.description ? "-" : ""} ${t.description || ""}` : t.description || g;
|
|
605
|
+
return /* @__PURE__ */ u(
|
|
606
|
+
Rt,
|
|
596
607
|
{
|
|
597
|
-
"data-tooltip":
|
|
608
|
+
"data-tooltip": o ? c : void 0,
|
|
598
609
|
"data-tooltip-delay": 700,
|
|
599
|
-
...
|
|
600
|
-
children:
|
|
610
|
+
...r,
|
|
611
|
+
children: g
|
|
601
612
|
}
|
|
602
613
|
);
|
|
603
|
-
},
|
|
614
|
+
}, Te = m.div`
|
|
604
615
|
display: grid;
|
|
605
616
|
grid-template-columns: minmax(150px, 1fr) minmax(0, 1fr) 32px;
|
|
606
617
|
row-gap: 2px;
|
|
@@ -634,7 +645,7 @@ const se = [], ht = (e) => {
|
|
|
634
645
|
margin-top: 6px;
|
|
635
646
|
}
|
|
636
647
|
}
|
|
637
|
-
`,
|
|
648
|
+
`, Wt = m.div`
|
|
638
649
|
height: 32px;
|
|
639
650
|
overflow: hidden;
|
|
640
651
|
width: 100%;
|
|
@@ -670,7 +681,7 @@ const se = [], ht = (e) => {
|
|
|
670
681
|
&.readonly {
|
|
671
682
|
pointer-events: none;
|
|
672
683
|
}
|
|
673
|
-
`,
|
|
684
|
+
`, Lt = m.div`
|
|
674
685
|
display: flex;
|
|
675
686
|
flex-direction: column;
|
|
676
687
|
gap: var(--base-gap-small);
|
|
@@ -680,7 +691,7 @@ const se = [], ht = (e) => {
|
|
|
680
691
|
height: 32px;
|
|
681
692
|
padding: 2px;
|
|
682
693
|
}
|
|
683
|
-
`,
|
|
694
|
+
`, Pt = m(Te)`
|
|
684
695
|
&.loading {
|
|
685
696
|
width: 100%;
|
|
686
697
|
height: 33px;
|
|
@@ -688,114 +699,114 @@ const se = [], ht = (e) => {
|
|
|
688
699
|
border-radius: 4px;
|
|
689
700
|
margin-bottom: 4px;
|
|
690
701
|
}
|
|
691
|
-
`,
|
|
702
|
+
`, Bt = ({
|
|
692
703
|
title: e,
|
|
693
704
|
isLoading: t,
|
|
694
|
-
form:
|
|
695
|
-
fields:
|
|
696
|
-
enableEditing:
|
|
697
|
-
mixedFields:
|
|
705
|
+
form: o,
|
|
706
|
+
fields: r,
|
|
707
|
+
enableEditing: g,
|
|
708
|
+
mixedFields: c,
|
|
698
709
|
onChange: a,
|
|
699
710
|
onMixedChange: d,
|
|
700
|
-
entities:
|
|
711
|
+
entities: p = [],
|
|
701
712
|
projectName: i,
|
|
702
|
-
entityType:
|
|
713
|
+
entityType: f = "task"
|
|
703
714
|
}) => {
|
|
704
|
-
const [
|
|
705
|
-
() =>
|
|
706
|
-
[
|
|
715
|
+
const [s, n] = O(null), v = I(
|
|
716
|
+
() => p.map((y) => y?.id).join("|"),
|
|
717
|
+
[p]
|
|
707
718
|
);
|
|
708
|
-
|
|
709
|
-
|
|
719
|
+
G(() => {
|
|
720
|
+
n(null);
|
|
710
721
|
}, [v]);
|
|
711
|
-
const
|
|
712
|
-
|
|
713
|
-
enableEditing:
|
|
714
|
-
fieldReadonly:
|
|
722
|
+
const h = (y) => {
|
|
723
|
+
g && !r.find((k) => k.name === y)?.readonly ? n(y) : console.log("Editing not allowed:", {
|
|
724
|
+
enableEditing: g,
|
|
725
|
+
fieldReadonly: r.find((k) => k.name === y)?.readonly
|
|
715
726
|
});
|
|
716
|
-
},
|
|
717
|
-
|
|
718
|
-
},
|
|
719
|
-
|
|
727
|
+
}, x = (y, k) => {
|
|
728
|
+
n(null), a?.(y, k);
|
|
729
|
+
}, E = (y, k) => {
|
|
730
|
+
n(null), d?.(y, k);
|
|
720
731
|
}, S = () => {
|
|
721
|
-
|
|
732
|
+
n(null);
|
|
722
733
|
};
|
|
723
|
-
return t ? /* @__PURE__ */
|
|
724
|
-
/* @__PURE__ */
|
|
725
|
-
/* @__PURE__ */
|
|
726
|
-
] }, k)) }) : /* @__PURE__ */
|
|
727
|
-
|
|
734
|
+
return t ? /* @__PURE__ */ u(Z, { title: "Attributes", withPadding: !0, children: Array.from({ length: 10 }).map((y, k) => /* @__PURE__ */ z(Pt, { children: [
|
|
735
|
+
/* @__PURE__ */ u("div", { className: "loading" }),
|
|
736
|
+
/* @__PURE__ */ u("div", { className: "loading" })
|
|
737
|
+
] }, k)) }) : /* @__PURE__ */ u(
|
|
738
|
+
Z,
|
|
728
739
|
{
|
|
729
740
|
title: "Attributes",
|
|
730
741
|
autoHeight: !0,
|
|
731
742
|
showHeader: !0,
|
|
732
743
|
withPadding: !0,
|
|
733
744
|
pt: { content: { style: { minHeight: "unset" } } },
|
|
734
|
-
children:
|
|
735
|
-
const k =
|
|
736
|
-
return /* @__PURE__ */
|
|
737
|
-
|
|
745
|
+
children: r.filter((y) => !y.hidden).map((y) => {
|
|
746
|
+
const k = o[y.name], j = s === y.name, w = y.readonly || !g, T = c?.includes(y.name) || !1;
|
|
747
|
+
return /* @__PURE__ */ z(
|
|
748
|
+
Te,
|
|
738
749
|
{
|
|
739
|
-
className:
|
|
750
|
+
className: W("field-row", { "multi-line": y.data.widget === "markdown" }),
|
|
740
751
|
children: [
|
|
741
|
-
/* @__PURE__ */
|
|
742
|
-
|
|
752
|
+
/* @__PURE__ */ u(
|
|
753
|
+
Se,
|
|
743
754
|
{
|
|
744
|
-
name:
|
|
745
|
-
data:
|
|
755
|
+
name: y.name,
|
|
756
|
+
data: y.data,
|
|
746
757
|
showDetailedTooltip: !0,
|
|
747
758
|
className: "field-label"
|
|
748
759
|
}
|
|
749
760
|
),
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
|
|
761
|
+
/* @__PURE__ */ u(
|
|
762
|
+
Wt,
|
|
752
763
|
{
|
|
753
|
-
className:
|
|
754
|
-
editing:
|
|
755
|
-
readonly:
|
|
764
|
+
className: W("field-value", {
|
|
765
|
+
editing: j,
|
|
766
|
+
readonly: w
|
|
756
767
|
}),
|
|
757
768
|
onClick: (l) => {
|
|
758
|
-
l.target.closest("a") || (l.preventDefault(), !
|
|
769
|
+
l.target.closest("a") || (l.preventDefault(), !j && !w && y.data.type !== "boolean" && h(y.name));
|
|
759
770
|
},
|
|
760
|
-
children: /* @__PURE__ */
|
|
761
|
-
|
|
771
|
+
children: /* @__PURE__ */ u(
|
|
772
|
+
zt,
|
|
762
773
|
{
|
|
763
|
-
field:
|
|
774
|
+
field: y,
|
|
764
775
|
value: k,
|
|
765
|
-
isEditing:
|
|
766
|
-
isReadOnly:
|
|
767
|
-
isMixed:
|
|
768
|
-
onChange:
|
|
769
|
-
onMixedChange: d &&
|
|
776
|
+
isEditing: j,
|
|
777
|
+
isReadOnly: w,
|
|
778
|
+
isMixed: T,
|
|
779
|
+
onChange: x,
|
|
780
|
+
onMixedChange: d && E,
|
|
770
781
|
onCancelEdit: S,
|
|
771
782
|
onExpand: () => {
|
|
772
783
|
},
|
|
773
|
-
entities:
|
|
784
|
+
entities: p,
|
|
774
785
|
projectName: i,
|
|
775
|
-
entityType:
|
|
786
|
+
entityType: f
|
|
776
787
|
}
|
|
777
788
|
)
|
|
778
789
|
}
|
|
779
790
|
),
|
|
780
|
-
/* @__PURE__ */
|
|
781
|
-
|
|
791
|
+
/* @__PURE__ */ u(Lt, { className: "field-tools", children: /* @__PURE__ */ u(
|
|
792
|
+
Q,
|
|
782
793
|
{
|
|
783
794
|
className: "tool",
|
|
784
795
|
variant: "text",
|
|
785
796
|
icon: "content_copy",
|
|
786
797
|
onClick: (l) => {
|
|
787
|
-
l.preventDefault(), l.stopPropagation(),
|
|
798
|
+
l.preventDefault(), l.stopPropagation(), re((k ?? "").toString(), !0);
|
|
788
799
|
}
|
|
789
800
|
}
|
|
790
801
|
) })
|
|
791
802
|
]
|
|
792
803
|
},
|
|
793
|
-
|
|
804
|
+
y.name
|
|
794
805
|
);
|
|
795
806
|
})
|
|
796
807
|
}
|
|
797
808
|
);
|
|
798
|
-
},
|
|
809
|
+
}, pe = m.div`
|
|
799
810
|
display: grid;
|
|
800
811
|
grid-template-columns: minmax(200px, 1fr) 1fr 32px;
|
|
801
812
|
row-gap: 2px;
|
|
@@ -818,7 +829,7 @@ const se = [], ht = (e) => {
|
|
|
818
829
|
&:hover .copy-icon {
|
|
819
830
|
opacity: 1;
|
|
820
831
|
}
|
|
821
|
-
`,
|
|
832
|
+
`, Ot = m.div`
|
|
822
833
|
text-align: left;
|
|
823
834
|
color: var(--md-sys-color-on-surface);
|
|
824
835
|
white-space: nowrap;
|
|
@@ -827,7 +838,13 @@ const se = [], ht = (e) => {
|
|
|
827
838
|
justify-self: end;
|
|
828
839
|
font-size: 14px;
|
|
829
840
|
width: 100%;
|
|
830
|
-
|
|
841
|
+
|
|
842
|
+
&:has(img) {
|
|
843
|
+
display: flex;
|
|
844
|
+
align-items: center;
|
|
845
|
+
gap: 6px;
|
|
846
|
+
}
|
|
847
|
+
`, ue = m.div`
|
|
831
848
|
height: 20px;
|
|
832
849
|
background: var(--md-sys-color-surface-container-low);
|
|
833
850
|
border-radius: 4px;
|
|
@@ -844,55 +861,59 @@ const se = [], ht = (e) => {
|
|
|
844
861
|
opacity: 0.5;
|
|
845
862
|
}
|
|
846
863
|
}
|
|
847
|
-
`,
|
|
864
|
+
`, It = ({
|
|
848
865
|
fields: e,
|
|
849
866
|
form: t,
|
|
850
|
-
mixedFields:
|
|
851
|
-
isLoading:
|
|
867
|
+
mixedFields: o = [],
|
|
868
|
+
isLoading: r,
|
|
869
|
+
users: g = []
|
|
852
870
|
}) => {
|
|
853
|
-
const c = (
|
|
854
|
-
if (
|
|
871
|
+
const c = (a, d) => {
|
|
872
|
+
if (a == null)
|
|
855
873
|
return "-";
|
|
856
|
-
if (
|
|
874
|
+
if (d === "createdAt" || d === "updatedAt")
|
|
857
875
|
try {
|
|
858
|
-
return
|
|
876
|
+
return mt(new Date(a), "PPpp");
|
|
859
877
|
} catch {
|
|
860
|
-
return
|
|
878
|
+
return a.toString();
|
|
861
879
|
}
|
|
862
|
-
return
|
|
880
|
+
return a.toString();
|
|
863
881
|
};
|
|
864
|
-
return
|
|
865
|
-
/* @__PURE__ */
|
|
866
|
-
/* @__PURE__ */
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
] },
|
|
869
|
-
const
|
|
870
|
-
return /* @__PURE__ */
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
|
|
882
|
+
return r ? /* @__PURE__ */ u(Z, { title: "Details", withPadding: !0, children: Array.from({ length: 6 }).map((a, d) => /* @__PURE__ */ z(pe, { children: [
|
|
883
|
+
/* @__PURE__ */ u(ue, { style: { width: "80px" } }),
|
|
884
|
+
/* @__PURE__ */ u(ue, { style: { width: "120px", justifySelf: "end" } }),
|
|
885
|
+
/* @__PURE__ */ u("div", { style: { width: "24px" } })
|
|
886
|
+
] }, d)) }) : /* @__PURE__ */ u(Z, { title: "Details", autoHeight: !0, showHeader: !0, withPadding: !0, children: e.filter((a) => !a.hidden).map((a) => {
|
|
887
|
+
const d = t[a.name], p = o.includes(a.name), i = p ? "Multiple values" : c(d, a.name), s = ["createdBy", "updatedBy"].includes(a.name) && !p ? g.find((n) => n.name === d) : void 0;
|
|
888
|
+
return /* @__PURE__ */ z(pe, { children: [
|
|
889
|
+
/* @__PURE__ */ u(Se, { name: a.name, data: a.data, showDetailedTooltip: !0 }),
|
|
890
|
+
/* @__PURE__ */ z(
|
|
891
|
+
Ot,
|
|
874
892
|
{
|
|
875
893
|
style: {
|
|
876
|
-
color:
|
|
877
|
-
fontStyle:
|
|
894
|
+
color: p ? "var(--md-sys-color-on-surface-variant)" : "var(--md-sys-color-on-surface)",
|
|
895
|
+
fontStyle: p ? "italic" : "normal"
|
|
878
896
|
},
|
|
879
|
-
children:
|
|
897
|
+
children: [
|
|
898
|
+
s && /* @__PURE__ */ u(ot, { name: s.name, fullName: s.fullName || void 0, size: 20 }),
|
|
899
|
+
s ? s.fullName || s.name : i
|
|
900
|
+
]
|
|
880
901
|
}
|
|
881
902
|
),
|
|
882
|
-
/* @__PURE__ */
|
|
883
|
-
|
|
903
|
+
/* @__PURE__ */ u(
|
|
904
|
+
Q,
|
|
884
905
|
{
|
|
885
906
|
className: "copy-icon",
|
|
886
907
|
variant: "text",
|
|
887
908
|
icon: "content_copy",
|
|
888
|
-
onClick: (
|
|
889
|
-
|
|
909
|
+
onClick: (n) => {
|
|
910
|
+
n.stopPropagation(), re((d ?? "").toString(), !0);
|
|
890
911
|
}
|
|
891
912
|
}
|
|
892
913
|
)
|
|
893
|
-
] },
|
|
914
|
+
] }, a.name);
|
|
894
915
|
}) });
|
|
895
|
-
},
|
|
916
|
+
}, Vt = m.div`
|
|
896
917
|
display: flex;
|
|
897
918
|
flex-direction: column;
|
|
898
919
|
height: 100%;
|
|
@@ -901,106 +922,112 @@ const se = [], ht = (e) => {
|
|
|
901
922
|
padding-right: 8px;
|
|
902
923
|
padding-left: 8px;
|
|
903
924
|
margin-top: 16px;
|
|
904
|
-
`,
|
|
905
|
-
const { formData:
|
|
925
|
+
`, nr = ({ entities: e = [], isLoading: t }) => {
|
|
926
|
+
const { formData: o, mixedFields: r, updateFormData: g, clearMixedField: c } = At(
|
|
906
927
|
e,
|
|
907
928
|
t
|
|
908
|
-
), { attributes: a } =
|
|
929
|
+
), { attributes: a } = dt(), {
|
|
909
930
|
folderTypes: d = [],
|
|
910
|
-
taskTypes:
|
|
931
|
+
taskTypes: p = [],
|
|
911
932
|
statuses: i = [],
|
|
912
|
-
tags:
|
|
913
|
-
productTypes:
|
|
914
|
-
} =
|
|
933
|
+
tags: f = [],
|
|
934
|
+
productTypes: s
|
|
935
|
+
} = pt(), { openSlideOut: n } = ae(), [, v] = ht(), h = (e || []).filter((A) => A.entityType === "folder"), { data: x } = nt(
|
|
915
936
|
{
|
|
916
|
-
entityIds:
|
|
917
|
-
projectName:
|
|
937
|
+
entityIds: h.map((A) => A.id),
|
|
938
|
+
projectName: o?.projectName || "",
|
|
918
939
|
referenceTypes: ["origin", "mention", "relation"],
|
|
919
940
|
activityTypes: ["version.publish"]
|
|
920
941
|
},
|
|
921
942
|
{
|
|
922
|
-
skip: !
|
|
943
|
+
skip: !o?.projectName || h.length === 0
|
|
923
944
|
}
|
|
924
|
-
),
|
|
945
|
+
), E = !!x?.pages?.[0]?.activities?.length, S = o?.entityType || "task", { enableEditing: y, attribAccess: k, updateEntity: j } = Ct({
|
|
925
946
|
entities: e,
|
|
926
947
|
entityType: S
|
|
927
|
-
}), { editableFields:
|
|
948
|
+
}), { editableFields: w, readOnlyFieldsData: T } = jt({
|
|
928
949
|
attributes: a,
|
|
929
950
|
folderTypes: d,
|
|
930
|
-
taskTypes:
|
|
951
|
+
taskTypes: p,
|
|
931
952
|
statuses: i,
|
|
932
|
-
tags:
|
|
933
|
-
entityType:
|
|
934
|
-
folderHasVersions:
|
|
953
|
+
tags: f,
|
|
954
|
+
entityType: o?.entityType,
|
|
955
|
+
folderHasVersions: E,
|
|
935
956
|
attribAccess: k
|
|
936
|
-
}),
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
957
|
+
}), l = [o?.createdBy, o?.updatedBy].filter(
|
|
958
|
+
(A) => typeof A == "string" && !!A
|
|
959
|
+
), { data: $ = [] } = it(
|
|
960
|
+
{ names: l, projectName: o?.projectName || "" },
|
|
961
|
+
{ skip: !l.length || !o?.projectName }
|
|
962
|
+
), { writableAttributes: N } = k, R = !N || N.includes("description"), C = (A, M) => {
|
|
963
|
+
A === "tags" && (Array.isArray(M) || (M == null || M === "" ? M = [] : M = [String(M)])), A.startsWith("attrib.") && (M = {
|
|
964
|
+
[A.replace("attrib.", "")]: M
|
|
965
|
+
}, A = "attrib"), g(A, M), j(A, M);
|
|
966
|
+
}, b = (A, M) => {
|
|
967
|
+
const _ = A.startsWith("attrib.") ? A.replace("attrib.", "") : void 0, X = (B) => {
|
|
968
|
+
const H = _ ? B.attrib?.[_] : B.tags;
|
|
943
969
|
return Array.isArray(H) ? H.map(String) : [];
|
|
944
|
-
},
|
|
945
|
-
e.map((
|
|
970
|
+
}, K = new Map(
|
|
971
|
+
e.map((B) => [B.id, De(X(B), M)])
|
|
946
972
|
);
|
|
947
|
-
|
|
948
|
-
const H =
|
|
949
|
-
return
|
|
973
|
+
g(A, [...new Set([...K.values()].flat())]), j(_ ? "attrib" : A, (B) => {
|
|
974
|
+
const H = K.get(B) || [];
|
|
975
|
+
return _ ? { [_]: H } : H;
|
|
950
976
|
});
|
|
951
|
-
}, F =
|
|
952
|
-
() => F &&
|
|
953
|
-
[F, S,
|
|
954
|
-
),
|
|
955
|
-
|
|
956
|
-
},
|
|
957
|
-
const { x:
|
|
958
|
-
v({ id: M, name: M, type:
|
|
959
|
-
},
|
|
960
|
-
|
|
977
|
+
}, F = o?.projectName || e[0]?.projectName, D = e[0]?.id, L = I(
|
|
978
|
+
() => F && D ? { projectName: F, entityType: S, entityId: D, productTypes: s, taskTypes: p } : void 0,
|
|
979
|
+
[F, S, D, s, p]
|
|
980
|
+
), P = ({ type: A, id: M }) => {
|
|
981
|
+
A === "user" || A === "team" || !F || n({ entityId: M, entityType: A, projectName: F });
|
|
982
|
+
}, U = ({ type: A, id: M, label: _ }, X) => {
|
|
983
|
+
const { x: K, y: B, width: H } = X.getBoundingClientRect();
|
|
984
|
+
v({ id: M, name: M, type: A, label: _, pos: { left: K + H / 2, top: B } });
|
|
985
|
+
}, Fe = (A) => {
|
|
986
|
+
g("description", A), c("description"), j("attrib", { description: A });
|
|
961
987
|
};
|
|
962
|
-
return /* @__PURE__ */
|
|
963
|
-
/* @__PURE__ */
|
|
964
|
-
|
|
988
|
+
return /* @__PURE__ */ z(Vt, { children: [
|
|
989
|
+
/* @__PURE__ */ u(
|
|
990
|
+
tt,
|
|
965
991
|
{
|
|
966
|
-
description:
|
|
967
|
-
isMixed:
|
|
968
|
-
enableEditing:
|
|
969
|
-
onChange:
|
|
992
|
+
description: o?.description || "",
|
|
993
|
+
isMixed: r.includes("description"),
|
|
994
|
+
enableEditing: R,
|
|
995
|
+
onChange: Fe,
|
|
970
996
|
isLoading: t,
|
|
971
|
-
mentionsContext:
|
|
972
|
-
onMentionClick:
|
|
973
|
-
onMentionHover:
|
|
997
|
+
mentionsContext: L,
|
|
998
|
+
onMentionClick: P,
|
|
999
|
+
onMentionHover: U
|
|
974
1000
|
}
|
|
975
1001
|
),
|
|
976
|
-
/* @__PURE__ */
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
|
|
1002
|
+
/* @__PURE__ */ u(ft, {}),
|
|
1003
|
+
/* @__PURE__ */ u(
|
|
1004
|
+
Bt,
|
|
979
1005
|
{
|
|
980
|
-
fields:
|
|
981
|
-
form:
|
|
982
|
-
mixedFields:
|
|
1006
|
+
fields: w,
|
|
1007
|
+
form: o || {},
|
|
1008
|
+
mixedFields: r,
|
|
983
1009
|
isLoading: t,
|
|
984
|
-
enableEditing:
|
|
985
|
-
onChange:
|
|
986
|
-
onMixedChange:
|
|
1010
|
+
enableEditing: y,
|
|
1011
|
+
onChange: C,
|
|
1012
|
+
onMixedChange: b,
|
|
987
1013
|
entities: e,
|
|
988
1014
|
entityType: S
|
|
989
1015
|
}
|
|
990
1016
|
),
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
|
|
1017
|
+
/* @__PURE__ */ u(
|
|
1018
|
+
It,
|
|
993
1019
|
{
|
|
994
|
-
fields:
|
|
995
|
-
form:
|
|
996
|
-
mixedFields:
|
|
997
|
-
isLoading: t
|
|
1020
|
+
fields: T,
|
|
1021
|
+
form: o || {},
|
|
1022
|
+
mixedFields: r,
|
|
1023
|
+
isLoading: t,
|
|
1024
|
+
users: $
|
|
998
1025
|
}
|
|
999
1026
|
)
|
|
1000
1027
|
] });
|
|
1001
|
-
},
|
|
1028
|
+
}, ir = m.div`
|
|
1002
1029
|
position: relative;
|
|
1003
|
-
`,
|
|
1030
|
+
`, sr = m.div`
|
|
1004
1031
|
position: relative;
|
|
1005
1032
|
padding: 8px;
|
|
1006
1033
|
border-bottom: 1px solid var(--md-sys-color-outline-variant);
|
|
@@ -1032,13 +1059,13 @@ const se = [], ht = (e) => {
|
|
|
1032
1059
|
/* align center */
|
|
1033
1060
|
align-items: center;
|
|
1034
1061
|
}
|
|
1035
|
-
`,
|
|
1062
|
+
`, lr = m(Q)`
|
|
1036
1063
|
position: absolute;
|
|
1037
1064
|
right: 4px;
|
|
1038
1065
|
top: 4px;
|
|
1039
1066
|
width: fit-content;
|
|
1040
1067
|
z-index: 50;
|
|
1041
|
-
`,
|
|
1068
|
+
`, cr = m.header`
|
|
1042
1069
|
display: flex;
|
|
1043
1070
|
align-items: center;
|
|
1044
1071
|
gap: var(--base-gap-large);
|
|
@@ -1053,7 +1080,7 @@ const se = [], ht = (e) => {
|
|
|
1053
1080
|
display: none;
|
|
1054
1081
|
}
|
|
1055
1082
|
}
|
|
1056
|
-
`,
|
|
1083
|
+
`, dr = m.div`
|
|
1057
1084
|
display: flex;
|
|
1058
1085
|
align-items: center;
|
|
1059
1086
|
gap: var(--base-gap-small);
|
|
@@ -1061,7 +1088,7 @@ const se = [], ht = (e) => {
|
|
|
1061
1088
|
h2 {
|
|
1062
1089
|
min-width: fit-content;
|
|
1063
1090
|
}
|
|
1064
|
-
`,
|
|
1091
|
+
`, pr = m.div`
|
|
1065
1092
|
position: relative;
|
|
1066
1093
|
height: 100%;
|
|
1067
1094
|
|
|
@@ -1076,7 +1103,7 @@ const se = [], ht = (e) => {
|
|
|
1076
1103
|
flex-direction: column;
|
|
1077
1104
|
gap: var(--base-gap-small);
|
|
1078
1105
|
}
|
|
1079
|
-
`,
|
|
1106
|
+
`, ur = m.div`
|
|
1080
1107
|
display: flex;
|
|
1081
1108
|
flex-direction: column;
|
|
1082
1109
|
height: 100%;
|
|
@@ -1114,7 +1141,7 @@ const se = [], ht = (e) => {
|
|
|
1114
1141
|
align-items: center;
|
|
1115
1142
|
gap: var(--base-gap-medium);
|
|
1116
1143
|
}
|
|
1117
|
-
`,
|
|
1144
|
+
`, mr = m.div`
|
|
1118
1145
|
display: flex;
|
|
1119
1146
|
justify-content: space-between;
|
|
1120
1147
|
align-items: flex-start;
|
|
@@ -1123,10 +1150,10 @@ const se = [], ht = (e) => {
|
|
|
1123
1150
|
label {
|
|
1124
1151
|
color: var(--md-sys-color-outline);
|
|
1125
1152
|
}
|
|
1126
|
-
`,
|
|
1153
|
+
`, gr = m.div`
|
|
1127
1154
|
display: flex;
|
|
1128
1155
|
flex-direction: column;
|
|
1129
|
-
`,
|
|
1156
|
+
`, hr = m(Ce)`
|
|
1130
1157
|
width: fit-content;
|
|
1131
1158
|
.status-field.value {
|
|
1132
1159
|
position: relative;
|
|
@@ -1137,11 +1164,11 @@ const se = [], ht = (e) => {
|
|
|
1137
1164
|
margin-bottom: 2px;
|
|
1138
1165
|
color: ${(e) => e.$textColor};
|
|
1139
1166
|
}
|
|
1140
|
-
`,
|
|
1167
|
+
`, fr = m(Ne)`
|
|
1141
1168
|
width: fit-content;
|
|
1142
1169
|
justify-self: end;
|
|
1143
1170
|
max-width: 100%;
|
|
1144
|
-
`,
|
|
1171
|
+
`, vr = m(Ue)`
|
|
1145
1172
|
height: 24px;
|
|
1146
1173
|
.template-value {
|
|
1147
1174
|
padding: 0 2px;
|
|
@@ -1155,7 +1182,7 @@ const se = [], ht = (e) => {
|
|
|
1155
1182
|
display: none;
|
|
1156
1183
|
}
|
|
1157
1184
|
}
|
|
1158
|
-
`,
|
|
1185
|
+
`, yr = m.div`
|
|
1159
1186
|
display: flex;
|
|
1160
1187
|
align-items: center;
|
|
1161
1188
|
gap: 4px;
|
|
@@ -1175,7 +1202,7 @@ const se = [], ht = (e) => {
|
|
|
1175
1202
|
border-radius: 3px;
|
|
1176
1203
|
padding: 0 4px;
|
|
1177
1204
|
}
|
|
1178
|
-
`,
|
|
1205
|
+
`, br = m($e)`
|
|
1179
1206
|
width: max-content;
|
|
1180
1207
|
justify-self: end;
|
|
1181
1208
|
/* remove text and dropdown icon */
|
|
@@ -1199,12 +1226,12 @@ const se = [], ht = (e) => {
|
|
|
1199
1226
|
background-color: var(--md-sys-color-surface-container-low-hover);
|
|
1200
1227
|
}
|
|
1201
1228
|
}
|
|
1202
|
-
`,
|
|
1229
|
+
`, xr = m.footer`
|
|
1203
1230
|
display: flex;
|
|
1204
1231
|
align-items: center;
|
|
1205
1232
|
gap: var(--base-gap-small);
|
|
1206
1233
|
justify-content: space-between;
|
|
1207
|
-
`,
|
|
1234
|
+
`, wr = m.div`
|
|
1208
1235
|
height: 100%;
|
|
1209
1236
|
|
|
1210
1237
|
> input[type='file'] {
|
|
@@ -1215,7 +1242,7 @@ const se = [], ht = (e) => {
|
|
|
1215
1242
|
input[type='file'] {
|
|
1216
1243
|
display: none;
|
|
1217
1244
|
}
|
|
1218
|
-
`,
|
|
1245
|
+
`, kr = m.div`
|
|
1219
1246
|
z-index: 100;
|
|
1220
1247
|
position: absolute;
|
|
1221
1248
|
inset: 0;
|
|
@@ -1227,7 +1254,7 @@ const se = [], ht = (e) => {
|
|
|
1227
1254
|
display: flex;
|
|
1228
1255
|
align-items: center;
|
|
1229
1256
|
justify-content: center;
|
|
1230
|
-
`,
|
|
1257
|
+
`, Er = m.div`
|
|
1231
1258
|
flex: 1;
|
|
1232
1259
|
height: 100%;
|
|
1233
1260
|
border-radius: var(--border-radius-l);
|
|
@@ -1256,11 +1283,11 @@ const se = [], ht = (e) => {
|
|
|
1256
1283
|
/* show children */
|
|
1257
1284
|
opacity: 1;
|
|
1258
1285
|
}
|
|
1259
|
-
`,
|
|
1286
|
+
`, Sr = m(Q)`
|
|
1260
1287
|
position: absolute;
|
|
1261
1288
|
top: 4px;
|
|
1262
1289
|
right: 4px;
|
|
1263
|
-
`,
|
|
1290
|
+
`, Tr = m.div`
|
|
1264
1291
|
display: flex;
|
|
1265
1292
|
flex-direction: column;
|
|
1266
1293
|
align-items: center;
|
|
@@ -1273,7 +1300,7 @@ const se = [], ht = (e) => {
|
|
|
1273
1300
|
top: 12px;
|
|
1274
1301
|
position: relative;
|
|
1275
1302
|
}
|
|
1276
|
-
`,
|
|
1303
|
+
`, Fr = m.div`
|
|
1277
1304
|
height: 8px;
|
|
1278
1305
|
position: absolute;
|
|
1279
1306
|
border-radius: 4px;
|
|
@@ -1282,14 +1309,14 @@ const se = [], ht = (e) => {
|
|
|
1282
1309
|
background-color: var(--md-sys-color-primary);
|
|
1283
1310
|
|
|
1284
1311
|
transition: right 0.2s;
|
|
1285
|
-
`,
|
|
1312
|
+
`, _t = xe`
|
|
1286
1313
|
from {
|
|
1287
1314
|
transform: rotate(0deg);
|
|
1288
1315
|
}
|
|
1289
1316
|
to {
|
|
1290
1317
|
transform: rotate(360deg);
|
|
1291
1318
|
}
|
|
1292
|
-
`,
|
|
1319
|
+
`, Ht = m.div`
|
|
1293
1320
|
position: relative;
|
|
1294
1321
|
display: flex;
|
|
1295
1322
|
justify-content: center;
|
|
@@ -1298,10 +1325,15 @@ const se = [], ht = (e) => {
|
|
|
1298
1325
|
overflow: hidden;
|
|
1299
1326
|
|
|
1300
1327
|
background-color: var(--md-sys-color-surface-container-low);
|
|
1301
|
-
|
|
1302
|
-
|
|
1328
|
+
|
|
1329
|
+
/* the hover-scrub filmstrip replaces the static image */
|
|
1330
|
+
&[data-filmstrip-active] > img {
|
|
1331
|
+
visibility: hidden;
|
|
1332
|
+
}
|
|
1333
|
+
`, Qt = m(V)`
|
|
1334
|
+
animation: ${_t} 1s linear infinite;
|
|
1303
1335
|
opacity: 0.6;
|
|
1304
|
-
`,
|
|
1336
|
+
`, qt = m.img`
|
|
1305
1337
|
position: absolute;
|
|
1306
1338
|
inset: 0;
|
|
1307
1339
|
object-fit: cover;
|
|
@@ -1313,56 +1345,62 @@ const se = [], ht = (e) => {
|
|
|
1313
1345
|
&.hidden {
|
|
1314
1346
|
opacity: 0;
|
|
1315
1347
|
}
|
|
1316
|
-
`,
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1348
|
+
`, Gt = ({
|
|
1349
|
+
mimetype: e = "",
|
|
1350
|
+
src: t,
|
|
1351
|
+
filmstripSrc: o,
|
|
1352
|
+
...r
|
|
1353
|
+
}) => {
|
|
1354
|
+
const [g, c] = O(!1), [a, d] = O(!1), p = ie(null), i = ie(0);
|
|
1355
|
+
return G(() => {
|
|
1356
|
+
const f = i.current + 1;
|
|
1357
|
+
i.current = f, d(!1), c(!1);
|
|
1358
|
+
const s = p.current;
|
|
1359
|
+
let n = !1, v = 0, h = 0, x = 0;
|
|
1360
|
+
const E = (j) => {
|
|
1361
|
+
n || f !== i.current || (n = !0, cancelAnimationFrame(v), window.clearInterval(h), window.clearTimeout(x), j());
|
|
1362
|
+
}, S = () => {
|
|
1363
|
+
!s || f !== i.current || s.complete && s.naturalWidth > 0 && E(() => {
|
|
1364
|
+
d(!0), c(!1);
|
|
1328
1365
|
});
|
|
1329
|
-
},
|
|
1330
|
-
|
|
1331
|
-
}),
|
|
1332
|
-
|
|
1366
|
+
}, y = () => E(() => {
|
|
1367
|
+
d(!0), c(!1);
|
|
1368
|
+
}), k = () => E(() => {
|
|
1369
|
+
d(!0), c(!0);
|
|
1333
1370
|
});
|
|
1334
|
-
return
|
|
1335
|
-
() =>
|
|
1336
|
-
|
|
1371
|
+
return s && (s.addEventListener("load", y), s.addEventListener("error", k), typeof s.decode == "function" && s.decode().then(
|
|
1372
|
+
() => E(() => {
|
|
1373
|
+
d(!0), c(!1);
|
|
1337
1374
|
})
|
|
1338
1375
|
).catch(() => {
|
|
1339
|
-
|
|
1340
|
-
})),
|
|
1341
|
-
|
|
1342
|
-
|
|
1376
|
+
S();
|
|
1377
|
+
})), v = requestAnimationFrame(S), h = window.setInterval(S, 250), x = window.setTimeout(() => {
|
|
1378
|
+
E(() => {
|
|
1379
|
+
s && s.naturalWidth > 0 ? (d(!0), c(!1)) : d(!0);
|
|
1343
1380
|
});
|
|
1344
1381
|
}, 1e4), () => {
|
|
1345
|
-
cancelAnimationFrame(
|
|
1382
|
+
cancelAnimationFrame(v), window.clearInterval(h), window.clearTimeout(x), s && (s.removeEventListener("load", y), s.removeEventListener("error", k));
|
|
1346
1383
|
};
|
|
1347
|
-
}, [t]), /* @__PURE__ */
|
|
1348
|
-
|
|
1349
|
-
/* @__PURE__ */
|
|
1350
|
-
|
|
1384
|
+
}, [t]), /* @__PURE__ */ z(Ht, { ...r, className: W("file-thumbnail", r.className), children: [
|
|
1385
|
+
a ? /* @__PURE__ */ u(V, { icon: Me(e) }) : /* @__PURE__ */ u(Qt, { icon: "progress_activity" }),
|
|
1386
|
+
/* @__PURE__ */ u(
|
|
1387
|
+
qt,
|
|
1351
1388
|
{
|
|
1352
|
-
ref:
|
|
1389
|
+
ref: p,
|
|
1353
1390
|
src: t,
|
|
1354
1391
|
...r,
|
|
1355
|
-
onError: (
|
|
1356
|
-
|
|
1392
|
+
onError: (f) => {
|
|
1393
|
+
f.currentTarget === p.current && (d(!0), c(!0));
|
|
1357
1394
|
},
|
|
1358
|
-
onLoad: (
|
|
1359
|
-
|
|
1395
|
+
onLoad: (f) => {
|
|
1396
|
+
f.currentTarget === p.current && (d(!0), c(!1));
|
|
1360
1397
|
},
|
|
1361
|
-
className:
|
|
1398
|
+
className: W({ hidden: !a || g })
|
|
1362
1399
|
}
|
|
1363
|
-
)
|
|
1400
|
+
),
|
|
1401
|
+
o && /* @__PURE__ */ u(ke, { src: o, fit: "cover" })
|
|
1364
1402
|
] });
|
|
1365
|
-
},
|
|
1403
|
+
}, Kt = m.div`
|
|
1366
1404
|
display: flex;
|
|
1367
1405
|
align-items: center;
|
|
1368
1406
|
overflow: hidden;
|
|
@@ -1429,7 +1467,7 @@ const se = [], ht = (e) => {
|
|
|
1429
1467
|
background-color: var(--md-sys-color-primary-container);
|
|
1430
1468
|
}
|
|
1431
1469
|
}
|
|
1432
|
-
`,
|
|
1470
|
+
`, Jt = m.div`
|
|
1433
1471
|
display: flex;
|
|
1434
1472
|
flex-direction: column;
|
|
1435
1473
|
flex: 1;
|
|
@@ -1454,15 +1492,15 @@ const se = [], ht = (e) => {
|
|
|
1454
1492
|
.name {
|
|
1455
1493
|
color: var(--md-sys-color-outline);
|
|
1456
1494
|
}
|
|
1457
|
-
`,
|
|
1495
|
+
`, Zt = m.div`
|
|
1458
1496
|
display: flex;
|
|
1459
1497
|
align-items: center;
|
|
1460
1498
|
gap: var(--base-gap-small);
|
|
1461
1499
|
|
|
1462
1500
|
h4 {
|
|
1463
|
-
${
|
|
1501
|
+
${ze.titleSmall}
|
|
1464
1502
|
}
|
|
1465
|
-
`,
|
|
1503
|
+
`, Xt = m(Q)`
|
|
1466
1504
|
/* hidden by default and show on card hover */
|
|
1467
1505
|
display: none;
|
|
1468
1506
|
.icon {
|
|
@@ -1474,78 +1512,79 @@ const se = [], ht = (e) => {
|
|
|
1474
1512
|
}
|
|
1475
1513
|
|
|
1476
1514
|
margin: -2px;
|
|
1477
|
-
`,
|
|
1515
|
+
`, Yt = m(Gt)`
|
|
1478
1516
|
width: 71px;
|
|
1479
1517
|
height: 40px;
|
|
1480
1518
|
|
|
1481
1519
|
border-radius: var(--border-radius-m);
|
|
1482
1520
|
|
|
1483
1521
|
object-fit: cover;
|
|
1484
|
-
`,
|
|
1522
|
+
`, eo = m(V)`
|
|
1485
1523
|
font-size: 25px;
|
|
1486
1524
|
|
|
1487
1525
|
cursor: grab;
|
|
1488
1526
|
|
|
1489
1527
|
/* default hidden */
|
|
1490
1528
|
opacity: 0;
|
|
1491
|
-
`,
|
|
1529
|
+
`, Ar = te(
|
|
1492
1530
|
({
|
|
1493
1531
|
availability: e,
|
|
1494
1532
|
projectName: t,
|
|
1495
|
-
fileId:
|
|
1496
|
-
filename:
|
|
1497
|
-
label:
|
|
1498
|
-
processing:
|
|
1533
|
+
fileId: o,
|
|
1534
|
+
filename: r,
|
|
1535
|
+
label: g,
|
|
1536
|
+
processing: c,
|
|
1499
1537
|
mimetype: a,
|
|
1500
1538
|
isDragOverlay: d,
|
|
1501
|
-
isDropPlaceholder:
|
|
1539
|
+
isDropPlaceholder: p,
|
|
1502
1540
|
isSelected: i,
|
|
1503
|
-
isDragging:
|
|
1504
|
-
dragProps:
|
|
1505
|
-
sortingDisabled:
|
|
1541
|
+
isDragging: f,
|
|
1542
|
+
dragProps: s = {},
|
|
1543
|
+
sortingDisabled: n,
|
|
1506
1544
|
onEdit: v,
|
|
1507
|
-
...
|
|
1508
|
-
},
|
|
1509
|
-
const
|
|
1510
|
-
let k =
|
|
1511
|
-
S && (k = "Unoptimized - conversion recommended"),
|
|
1512
|
-
let
|
|
1513
|
-
return S && (
|
|
1514
|
-
|
|
1545
|
+
...h
|
|
1546
|
+
}, x) => {
|
|
1547
|
+
const E = (s || d) && !n, S = e === "conversionRecommended", y = S && !!c;
|
|
1548
|
+
let k = r;
|
|
1549
|
+
S && (k = "Unoptimized - conversion recommended"), y && (k = "Unoptimized - queued for conversion");
|
|
1550
|
+
let j = g;
|
|
1551
|
+
return S && (j = r), /* @__PURE__ */ z(
|
|
1552
|
+
Kt,
|
|
1515
1553
|
{
|
|
1516
|
-
id:
|
|
1517
|
-
ref:
|
|
1518
|
-
className:
|
|
1519
|
-
draggable:
|
|
1520
|
-
"drop-placeholder":
|
|
1554
|
+
id: o,
|
|
1555
|
+
ref: x,
|
|
1556
|
+
className: W({
|
|
1557
|
+
draggable: E,
|
|
1558
|
+
"drop-placeholder": p,
|
|
1521
1559
|
"drag-overlay": d,
|
|
1522
|
-
dragging:
|
|
1560
|
+
dragging: f,
|
|
1523
1561
|
// is anything dragging
|
|
1524
1562
|
selected: i,
|
|
1525
1563
|
editable: !!v
|
|
1526
1564
|
}),
|
|
1527
|
-
...
|
|
1565
|
+
...h,
|
|
1528
1566
|
children: [
|
|
1529
|
-
/* @__PURE__ */
|
|
1530
|
-
|
|
1567
|
+
/* @__PURE__ */ u(
|
|
1568
|
+
Yt,
|
|
1531
1569
|
{
|
|
1532
|
-
src: `/api/projects/${t}/files/${
|
|
1533
|
-
mimetype: a
|
|
1570
|
+
src: `/api/projects/${t}/files/${o}/thumbnail`,
|
|
1571
|
+
mimetype: a,
|
|
1572
|
+
filmstripSrc: !f && a?.startsWith("video/") ? vt(t, o) : null
|
|
1534
1573
|
}
|
|
1535
1574
|
),
|
|
1536
|
-
/* @__PURE__ */
|
|
1537
|
-
/* @__PURE__ */
|
|
1538
|
-
/* @__PURE__ */
|
|
1539
|
-
!!v && /* @__PURE__ */
|
|
1575
|
+
/* @__PURE__ */ z(Jt, { children: [
|
|
1576
|
+
/* @__PURE__ */ z(Zt, { children: [
|
|
1577
|
+
/* @__PURE__ */ u("h4", { children: j }),
|
|
1578
|
+
!!v && /* @__PURE__ */ u(Xt, { icon: "edit", variant: "text", className: "edit", onClick: v })
|
|
1540
1579
|
] }),
|
|
1541
|
-
/* @__PURE__ */
|
|
1580
|
+
/* @__PURE__ */ u("span", { className: "name", children: k })
|
|
1542
1581
|
] }),
|
|
1543
|
-
|
|
1582
|
+
E && /* @__PURE__ */ u(eo, { className: "handle", ...s, icon: "drag_indicator" })
|
|
1544
1583
|
]
|
|
1545
1584
|
}
|
|
1546
1585
|
);
|
|
1547
1586
|
}
|
|
1548
|
-
),
|
|
1587
|
+
), to = xe`
|
|
1549
1588
|
from {
|
|
1550
1589
|
transform: rotate(360deg);
|
|
1551
1590
|
}
|
|
@@ -1554,7 +1593,7 @@ const se = [], ht = (e) => {
|
|
|
1554
1593
|
transform: rotate(0deg);
|
|
1555
1594
|
}
|
|
1556
1595
|
|
|
1557
|
-
`,
|
|
1596
|
+
`, oo = m.div`
|
|
1558
1597
|
position: relative;
|
|
1559
1598
|
width: 100%;
|
|
1560
1599
|
min-height: 50px;
|
|
@@ -1620,13 +1659,13 @@ const se = [], ht = (e) => {
|
|
|
1620
1659
|
& > * {
|
|
1621
1660
|
z-index: 10;
|
|
1622
1661
|
}
|
|
1623
|
-
`,
|
|
1662
|
+
`, ro = m.div`
|
|
1624
1663
|
position: absolute;
|
|
1625
1664
|
inset: 0;
|
|
1626
1665
|
background-color: var(--md-sys-color-primary-container);
|
|
1627
1666
|
z-index: 0;
|
|
1628
1667
|
transition: right 0.2s;
|
|
1629
|
-
`,
|
|
1668
|
+
`, ao = m.div`
|
|
1630
1669
|
position: relative;
|
|
1631
1670
|
width: 71px;
|
|
1632
1671
|
height: 40px;
|
|
@@ -1645,7 +1684,7 @@ const se = [], ht = (e) => {
|
|
|
1645
1684
|
|
|
1646
1685
|
&.spinning {
|
|
1647
1686
|
/* spin animation */
|
|
1648
|
-
animation: ${
|
|
1687
|
+
animation: ${to} 1s infinite linear;
|
|
1649
1688
|
}
|
|
1650
1689
|
}
|
|
1651
1690
|
|
|
@@ -1657,84 +1696,84 @@ const se = [], ht = (e) => {
|
|
|
1657
1696
|
object-fit: cover;
|
|
1658
1697
|
opacity: 0.5;
|
|
1659
1698
|
}
|
|
1660
|
-
`,
|
|
1699
|
+
`, me = ({
|
|
1661
1700
|
name: e,
|
|
1662
1701
|
progress: t,
|
|
1663
|
-
size:
|
|
1664
|
-
type:
|
|
1665
|
-
fileId:
|
|
1666
|
-
src:
|
|
1702
|
+
size: o,
|
|
1703
|
+
type: r,
|
|
1704
|
+
fileId: g,
|
|
1705
|
+
src: c,
|
|
1667
1706
|
error: a,
|
|
1668
1707
|
tooltip: d,
|
|
1669
|
-
onRemove:
|
|
1708
|
+
onRemove: p,
|
|
1670
1709
|
...i
|
|
1671
1710
|
}) => {
|
|
1672
|
-
let
|
|
1673
|
-
switch (
|
|
1711
|
+
let f = "", s = !1, n = "";
|
|
1712
|
+
switch (r) {
|
|
1674
1713
|
case "processing":
|
|
1675
|
-
|
|
1714
|
+
f = "Transcoding", s = !0, n = "settings";
|
|
1676
1715
|
break;
|
|
1677
1716
|
case "unsupported":
|
|
1678
|
-
|
|
1717
|
+
f = "Unsupported - conversion required", n = "visibility_off";
|
|
1679
1718
|
break;
|
|
1680
1719
|
case "upload":
|
|
1681
|
-
|
|
1720
|
+
f = "Uploading", s = !0, n = "sync";
|
|
1682
1721
|
break;
|
|
1683
1722
|
case "queued":
|
|
1684
|
-
|
|
1723
|
+
f = "Queued - waiting to be transcoded", n = "hourglass";
|
|
1685
1724
|
break;
|
|
1686
1725
|
case "waiting":
|
|
1687
|
-
|
|
1726
|
+
f = "Waiting for upload", n = "schedule";
|
|
1688
1727
|
break;
|
|
1689
1728
|
case "importing":
|
|
1690
|
-
|
|
1729
|
+
f = "Importing", n = "upload_file";
|
|
1691
1730
|
break;
|
|
1692
1731
|
case "validating":
|
|
1693
|
-
|
|
1732
|
+
f = "Validating", n = "checklist";
|
|
1694
1733
|
break;
|
|
1695
1734
|
}
|
|
1696
|
-
a && (
|
|
1735
|
+
a && (s = !1, n = "error");
|
|
1697
1736
|
const v = t !== void 0 ? `- ${t}%` : "";
|
|
1698
|
-
return /* @__PURE__ */
|
|
1699
|
-
|
|
1737
|
+
return /* @__PURE__ */ z(
|
|
1738
|
+
oo,
|
|
1700
1739
|
{
|
|
1701
|
-
className:
|
|
1702
|
-
id:
|
|
1740
|
+
className: W({ finished: t === 100, error: !!a, [r]: !0 }),
|
|
1741
|
+
id: g,
|
|
1703
1742
|
...i,
|
|
1704
1743
|
children: [
|
|
1705
|
-
/* @__PURE__ */
|
|
1706
|
-
|
|
1707
|
-
|
|
1744
|
+
/* @__PURE__ */ z(ao, { children: [
|
|
1745
|
+
c && /* @__PURE__ */ u("img", { src: c }),
|
|
1746
|
+
n && /* @__PURE__ */ u(V, { icon: n, className: W({ spinning: s }) })
|
|
1708
1747
|
] }),
|
|
1709
|
-
/* @__PURE__ */
|
|
1710
|
-
/* @__PURE__ */
|
|
1711
|
-
/* @__PURE__ */
|
|
1748
|
+
/* @__PURE__ */ z("span", { className: "content", children: [
|
|
1749
|
+
/* @__PURE__ */ u("span", { className: "name", children: e }),
|
|
1750
|
+
/* @__PURE__ */ u("span", { className: "message", children: a || `${f} ${v}` })
|
|
1712
1751
|
] }),
|
|
1713
|
-
|
|
1714
|
-
d && /* @__PURE__ */
|
|
1715
|
-
(a ||
|
|
1716
|
-
/* @__PURE__ */
|
|
1752
|
+
o && /* @__PURE__ */ u("span", { className: "size", children: Re(o) }),
|
|
1753
|
+
d && /* @__PURE__ */ u(V, { icon: "info", className: "info", "data-tooltip": d, "data-tooltip-as": "markdown" }),
|
|
1754
|
+
(a || r === "waiting") && /* @__PURE__ */ u(Q, { icon: "close", variant: "text", onClick: p }),
|
|
1755
|
+
/* @__PURE__ */ u(ro, { className: "progress", style: { right: `${100 - (t ?? 0)}%` } })
|
|
1717
1756
|
]
|
|
1718
1757
|
},
|
|
1719
1758
|
e
|
|
1720
1759
|
);
|
|
1721
1760
|
};
|
|
1722
|
-
|
|
1761
|
+
m.div`
|
|
1723
1762
|
display: flex;
|
|
1724
1763
|
flex-direction: column;
|
|
1725
1764
|
gap: var(--base-gap-small);
|
|
1726
1765
|
min-height: 100%;
|
|
1727
1766
|
padding-bottom: var(--padding-m);
|
|
1728
1767
|
`;
|
|
1729
|
-
const
|
|
1768
|
+
const jr = m.div`
|
|
1730
1769
|
position: relative;
|
|
1731
1770
|
overflow: hidden;
|
|
1732
1771
|
border-radius: var(--border-radius-m);
|
|
1733
1772
|
width: 100%;
|
|
1734
1773
|
min-height: 50px;
|
|
1735
|
-
`,
|
|
1774
|
+
`, Dr = m.div`
|
|
1736
1775
|
word-break: break-all;
|
|
1737
|
-
`,
|
|
1776
|
+
`, no = m.div`
|
|
1738
1777
|
display: flex;
|
|
1739
1778
|
flex-direction: column;
|
|
1740
1779
|
gap: var(--base-gap-small);
|
|
@@ -1751,7 +1790,7 @@ const wr = p.div`
|
|
|
1751
1790
|
&.dragging {
|
|
1752
1791
|
opacity: 0;
|
|
1753
1792
|
}
|
|
1754
|
-
`,
|
|
1793
|
+
`, io = m.div`
|
|
1755
1794
|
position: relative;
|
|
1756
1795
|
min-height: 50px;
|
|
1757
1796
|
display: flex;
|
|
@@ -1780,7 +1819,7 @@ const wr = p.div`
|
|
|
1780
1819
|
opacity: 0;
|
|
1781
1820
|
cursor: pointer;
|
|
1782
1821
|
}
|
|
1783
|
-
`,
|
|
1822
|
+
`, so = m.div`
|
|
1784
1823
|
position: absolute;
|
|
1785
1824
|
inset: var(--padding-s);
|
|
1786
1825
|
background-color: var(--md-sys-color-surface-container-lowest);
|
|
@@ -1802,239 +1841,239 @@ const wr = p.div`
|
|
|
1802
1841
|
.icon {
|
|
1803
1842
|
font-size: 32px;
|
|
1804
1843
|
}
|
|
1805
|
-
`,
|
|
1806
|
-
if (
|
|
1844
|
+
`, ge = (e) => {
|
|
1845
|
+
if (be.isAxiosError(e)) {
|
|
1807
1846
|
const t = e.response?.data;
|
|
1808
1847
|
if (typeof t == "string" && t)
|
|
1809
1848
|
return t;
|
|
1810
1849
|
if (t && typeof t == "object" && "detail" in t) {
|
|
1811
|
-
const
|
|
1812
|
-
if (typeof
|
|
1813
|
-
return
|
|
1850
|
+
const o = t.detail;
|
|
1851
|
+
if (typeof o == "string" && o)
|
|
1852
|
+
return o;
|
|
1814
1853
|
}
|
|
1815
1854
|
return e.message || e.response?.statusText || "Unknown upload error";
|
|
1816
1855
|
}
|
|
1817
1856
|
return e instanceof Error ? e.message : typeof e == "string" ? e : "Unknown upload error";
|
|
1818
|
-
},
|
|
1857
|
+
}, lo = ({
|
|
1819
1858
|
projectName: e,
|
|
1820
1859
|
versionId: t,
|
|
1821
|
-
taskId:
|
|
1822
|
-
folderId:
|
|
1823
|
-
productId:
|
|
1824
|
-
dispatch:
|
|
1860
|
+
taskId: o,
|
|
1861
|
+
folderId: r,
|
|
1862
|
+
productId: g,
|
|
1863
|
+
dispatch: c,
|
|
1825
1864
|
onUpload: a,
|
|
1826
1865
|
onProgress: d
|
|
1827
1866
|
}) => {
|
|
1828
|
-
const [
|
|
1829
|
-
(
|
|
1867
|
+
const [p, i] = O({}), f = ee(
|
|
1868
|
+
(n) => {
|
|
1830
1869
|
t && i((v) => ({
|
|
1831
1870
|
...v,
|
|
1832
|
-
[t]: v[t]?.filter((
|
|
1871
|
+
[t]: v[t]?.filter((h) => h.name !== n) || []
|
|
1833
1872
|
}));
|
|
1834
1873
|
},
|
|
1835
1874
|
[t]
|
|
1836
1875
|
);
|
|
1837
1876
|
return {
|
|
1838
|
-
handleFileUpload:
|
|
1839
|
-
async (
|
|
1840
|
-
const
|
|
1841
|
-
if (!
|
|
1842
|
-
const
|
|
1843
|
-
name:
|
|
1844
|
-
size:
|
|
1877
|
+
handleFileUpload: ee(
|
|
1878
|
+
async (n, v) => {
|
|
1879
|
+
const h = v || t;
|
|
1880
|
+
if (!h || !e) return;
|
|
1881
|
+
const x = Array.from(n), E = x.map((w) => ({
|
|
1882
|
+
name: q(w.name),
|
|
1883
|
+
size: w.size,
|
|
1845
1884
|
progress: 0
|
|
1846
|
-
})), S = [...h
|
|
1847
|
-
i({ ...
|
|
1848
|
-
const
|
|
1849
|
-
if (!
|
|
1850
|
-
console.log(`Upload successful for ${
|
|
1851
|
-
const l =
|
|
1852
|
-
e && (
|
|
1885
|
+
})), S = [...p[h] || [], ...E];
|
|
1886
|
+
i({ ...p, [h]: S });
|
|
1887
|
+
const y = (w) => (T) => {
|
|
1888
|
+
if (!h) return;
|
|
1889
|
+
console.log(`Upload successful for ${w.name}`);
|
|
1890
|
+
const l = T.data;
|
|
1891
|
+
e && (c(
|
|
1853
1892
|
// @ts-ignore
|
|
1854
|
-
|
|
1893
|
+
st.util.updateQueryData(
|
|
1855
1894
|
"getReviewablesForVersion",
|
|
1856
|
-
{ projectName: e, versionId:
|
|
1857
|
-
(
|
|
1858
|
-
|
|
1895
|
+
{ projectName: e, versionId: h },
|
|
1896
|
+
($) => {
|
|
1897
|
+
$.reviewables || ($.reviewables = []), $.reviewables.push(l);
|
|
1859
1898
|
}
|
|
1860
1899
|
)
|
|
1861
|
-
),
|
|
1862
|
-
}, k = (
|
|
1863
|
-
|
|
1864
|
-
const
|
|
1865
|
-
...
|
|
1866
|
-
error:
|
|
1900
|
+
), g && c(J.util.invalidateTags([{ type: "viewer", id: g }])), c(J.util.invalidateTags([{ type: "viewer", id: h }])), r && c(J.util.invalidateTags([{ type: "viewer", id: r }])), o && c(J.util.invalidateTags([{ type: "viewer", id: o }])), f(q(w.name)));
|
|
1901
|
+
}, k = (w) => (T) => {
|
|
1902
|
+
h && (console.error(`Upload failed for ${w.name}: ${T}`), i((l) => {
|
|
1903
|
+
const N = (l[h] || []).map((R) => R.name !== q(w.name) ? R : {
|
|
1904
|
+
...R,
|
|
1905
|
+
error: ge(T)
|
|
1867
1906
|
});
|
|
1868
1907
|
return {
|
|
1869
1908
|
...l,
|
|
1870
|
-
[
|
|
1909
|
+
[h]: N
|
|
1871
1910
|
};
|
|
1872
1911
|
}));
|
|
1873
|
-
},
|
|
1874
|
-
const
|
|
1875
|
-
...
|
|
1876
|
-
progress:
|
|
1877
|
-
}),
|
|
1878
|
-
(
|
|
1912
|
+
}, j = (w) => h ? (T) => i((l) => {
|
|
1913
|
+
const N = (l[h] || []).map((b) => b.name !== q(w.name) ? b : {
|
|
1914
|
+
...b,
|
|
1915
|
+
progress: T.total ? Math.round(T.loaded / T.total * 100) : 0
|
|
1916
|
+
}), R = N.reduce(
|
|
1917
|
+
(b, F) => b + (F.progress || 0),
|
|
1879
1918
|
0
|
|
1880
|
-
),
|
|
1881
|
-
return d?.(
|
|
1919
|
+
), C = Math.round(R / N.length);
|
|
1920
|
+
return d?.(C), {
|
|
1882
1921
|
...l,
|
|
1883
|
-
[
|
|
1922
|
+
[h]: N
|
|
1884
1923
|
};
|
|
1885
1924
|
}) : () => {
|
|
1886
1925
|
};
|
|
1887
1926
|
try {
|
|
1888
|
-
const
|
|
1889
|
-
const l =
|
|
1890
|
-
return
|
|
1891
|
-
throw k(
|
|
1927
|
+
const w = x.map((T) => {
|
|
1928
|
+
const l = q(T.name), $ = l.split(".").slice(0, -1).join(".") || "unnamed", N = `/api/projects/${e}/versions/${h}/reviewables?label=${$}`, R = { "content-type": T.type, "x-file-name": l };
|
|
1929
|
+
return be.post(N, T, { headers: R, onUploadProgress: j(T) }).then(y(T)).catch((C) => {
|
|
1930
|
+
throw k(T)(C), C;
|
|
1892
1931
|
});
|
|
1893
1932
|
});
|
|
1894
|
-
await Promise.all(
|
|
1895
|
-
} catch (
|
|
1896
|
-
throw console.error(
|
|
1933
|
+
await Promise.all(w), a && a();
|
|
1934
|
+
} catch (w) {
|
|
1935
|
+
throw console.error(w), oe.error(`Failed to upload file/s: ${ge(w)}`), w;
|
|
1897
1936
|
}
|
|
1898
1937
|
},
|
|
1899
1938
|
[
|
|
1900
1939
|
t,
|
|
1901
1940
|
e,
|
|
1902
|
-
|
|
1903
|
-
n,
|
|
1941
|
+
p,
|
|
1904
1942
|
c,
|
|
1905
|
-
|
|
1943
|
+
g,
|
|
1906
1944
|
r,
|
|
1907
|
-
|
|
1945
|
+
o,
|
|
1946
|
+
f,
|
|
1908
1947
|
a,
|
|
1909
1948
|
d
|
|
1910
1949
|
]
|
|
1911
1950
|
),
|
|
1912
|
-
handleRemoveUpload:
|
|
1913
|
-
uploading:
|
|
1951
|
+
handleRemoveUpload: f,
|
|
1952
|
+
uploading: p
|
|
1914
1953
|
};
|
|
1915
|
-
},
|
|
1954
|
+
}, Cr = ({
|
|
1916
1955
|
projectName: e,
|
|
1917
1956
|
taskId: t,
|
|
1918
|
-
folderId:
|
|
1919
|
-
versionId:
|
|
1920
|
-
productId:
|
|
1921
|
-
onUpload:
|
|
1957
|
+
folderId: o,
|
|
1958
|
+
versionId: r,
|
|
1959
|
+
productId: g,
|
|
1960
|
+
onUpload: c,
|
|
1922
1961
|
onFilesAdded: a,
|
|
1923
1962
|
children: d,
|
|
1924
|
-
dispatch:
|
|
1963
|
+
dispatch: p,
|
|
1925
1964
|
variant: i = "normal",
|
|
1926
|
-
pendingFiles:
|
|
1927
|
-
setPendingFiles:
|
|
1928
|
-
className:
|
|
1965
|
+
pendingFiles: f = [],
|
|
1966
|
+
setPendingFiles: s,
|
|
1967
|
+
className: n,
|
|
1929
1968
|
readOnly: v = !1,
|
|
1930
|
-
pt:
|
|
1931
|
-
...
|
|
1969
|
+
pt: h,
|
|
1970
|
+
...x
|
|
1932
1971
|
}) => {
|
|
1933
|
-
const [
|
|
1934
|
-
handleFileUpload:
|
|
1972
|
+
const [E, S] = O(!1), {
|
|
1973
|
+
handleFileUpload: y,
|
|
1935
1974
|
handleRemoveUpload: k,
|
|
1936
|
-
uploading:
|
|
1937
|
-
} =
|
|
1975
|
+
uploading: j
|
|
1976
|
+
} = lo({
|
|
1938
1977
|
projectName: e,
|
|
1939
|
-
versionId:
|
|
1978
|
+
versionId: r,
|
|
1940
1979
|
taskId: t,
|
|
1941
|
-
folderId:
|
|
1942
|
-
productId:
|
|
1943
|
-
dispatch:
|
|
1944
|
-
onUpload:
|
|
1945
|
-
}),
|
|
1946
|
-
|
|
1947
|
-
if (
|
|
1948
|
-
const
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
}),
|
|
1980
|
+
folderId: o,
|
|
1981
|
+
productId: g,
|
|
1982
|
+
dispatch: p,
|
|
1983
|
+
onUpload: c
|
|
1984
|
+
}), w = !!r;
|
|
1985
|
+
G(() => {
|
|
1986
|
+
if (w && r && f.length > 0 && s) {
|
|
1987
|
+
const b = f.map((F) => F.file);
|
|
1988
|
+
f.forEach((F) => {
|
|
1989
|
+
F.preview && URL.revokeObjectURL(F.preview);
|
|
1990
|
+
}), s([]), y(b);
|
|
1952
1991
|
}
|
|
1953
|
-
}, [
|
|
1954
|
-
const
|
|
1955
|
-
file:
|
|
1956
|
-
preview:
|
|
1957
|
-
})),
|
|
1958
|
-
const
|
|
1959
|
-
if (a?.(
|
|
1960
|
-
|
|
1992
|
+
}, [w, r, f.length, y, s]);
|
|
1993
|
+
const T = (b) => b.type.startsWith("image/"), l = (b) => b.map((F) => ({
|
|
1994
|
+
file: F,
|
|
1995
|
+
preview: T(F) ? URL.createObjectURL(F) : void 0
|
|
1996
|
+
})), $ = async (b) => {
|
|
1997
|
+
const F = Array.from(b);
|
|
1998
|
+
if (a?.(F), !w || !r) {
|
|
1999
|
+
s && s((D) => [...D, ...l(F)]);
|
|
1961
2000
|
return;
|
|
1962
2001
|
}
|
|
1963
|
-
await b
|
|
1964
|
-
},
|
|
1965
|
-
const
|
|
1966
|
-
|
|
1967
|
-
},
|
|
1968
|
-
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1971
|
-
},
|
|
1972
|
-
return /* @__PURE__ */
|
|
1973
|
-
/* @__PURE__ */
|
|
1974
|
-
|
|
2002
|
+
await y(b);
|
|
2003
|
+
}, N = (b) => {
|
|
2004
|
+
const F = b.target.files;
|
|
2005
|
+
F && $(F);
|
|
2006
|
+
}, R = (b) => {
|
|
2007
|
+
b.preventDefault(), S(!1);
|
|
2008
|
+
const F = b.dataTransfer.files;
|
|
2009
|
+
F && $(F);
|
|
2010
|
+
}, C = i === "large" ? { minWidth: "360px", maxWidth: "480px", alignSelf: "center" } : {};
|
|
2011
|
+
return /* @__PURE__ */ z(ne, { children: [
|
|
2012
|
+
/* @__PURE__ */ u(
|
|
2013
|
+
no,
|
|
1975
2014
|
{
|
|
1976
|
-
className:
|
|
1977
|
-
...
|
|
2015
|
+
className: W(n, i, { dragging: E }),
|
|
2016
|
+
...x,
|
|
1978
2017
|
onDragEnter: () => !v && S(!0),
|
|
1979
|
-
onDragOver: (
|
|
1980
|
-
onDrop: (
|
|
1981
|
-
v && (
|
|
2018
|
+
onDragOver: (b) => b.preventDefault(),
|
|
2019
|
+
onDrop: (b) => {
|
|
2020
|
+
v && (b.preventDefault(), b.stopPropagation());
|
|
1982
2021
|
},
|
|
1983
|
-
children: /* @__PURE__ */
|
|
2022
|
+
children: /* @__PURE__ */ z(ne, { children: [
|
|
1984
2023
|
d,
|
|
1985
|
-
!
|
|
1986
|
-
|
|
2024
|
+
!w && f?.map((b) => /* @__PURE__ */ u(
|
|
2025
|
+
me,
|
|
1987
2026
|
{
|
|
1988
|
-
name:
|
|
1989
|
-
size:
|
|
1990
|
-
src:
|
|
2027
|
+
name: b.file.name,
|
|
2028
|
+
size: b.file.size,
|
|
2029
|
+
src: b.preview,
|
|
1991
2030
|
type: "waiting",
|
|
1992
2031
|
onRemove: () => {
|
|
1993
|
-
|
|
2032
|
+
s && s((F) => F.filter((D) => D.file.name !== b.file.name));
|
|
1994
2033
|
}
|
|
1995
2034
|
},
|
|
1996
|
-
|
|
2035
|
+
b.file.name
|
|
1997
2036
|
)),
|
|
1998
|
-
|
|
1999
|
-
|
|
2037
|
+
r && j[r]?.map((b) => /* @__PURE__ */ u(
|
|
2038
|
+
me,
|
|
2000
2039
|
{
|
|
2001
|
-
...
|
|
2040
|
+
...b,
|
|
2002
2041
|
type: "upload",
|
|
2003
|
-
onRemove: () => k(
|
|
2042
|
+
onRemove: () => k(b.name)
|
|
2004
2043
|
},
|
|
2005
|
-
|
|
2044
|
+
b.name
|
|
2006
2045
|
)),
|
|
2007
|
-
!v && /* @__PURE__ */
|
|
2008
|
-
|
|
2046
|
+
!v && /* @__PURE__ */ z(
|
|
2047
|
+
io,
|
|
2009
2048
|
{
|
|
2010
2049
|
id: "upload",
|
|
2011
|
-
className:
|
|
2012
|
-
style:
|
|
2013
|
-
...
|
|
2050
|
+
className: W("upload", i),
|
|
2051
|
+
style: C,
|
|
2052
|
+
...h?.upload,
|
|
2014
2053
|
children: [
|
|
2015
|
-
/* @__PURE__ */
|
|
2016
|
-
/* @__PURE__ */
|
|
2054
|
+
/* @__PURE__ */ u("span", { children: "Drop or click to upload" }),
|
|
2055
|
+
/* @__PURE__ */ u("input", { type: "file", multiple: !0, onChange: N })
|
|
2017
2056
|
]
|
|
2018
2057
|
}
|
|
2019
2058
|
)
|
|
2020
2059
|
] })
|
|
2021
2060
|
}
|
|
2022
2061
|
),
|
|
2023
|
-
|
|
2024
|
-
|
|
2062
|
+
E && !v && /* @__PURE__ */ z(
|
|
2063
|
+
so,
|
|
2025
2064
|
{
|
|
2026
|
-
onDragOver: (
|
|
2065
|
+
onDragOver: (b) => b.preventDefault(),
|
|
2027
2066
|
onDragLeave: () => S(!1),
|
|
2028
|
-
onDrop:
|
|
2029
|
-
...
|
|
2067
|
+
onDrop: R,
|
|
2068
|
+
...h?.dropzone,
|
|
2030
2069
|
children: [
|
|
2031
|
-
/* @__PURE__ */
|
|
2032
|
-
/* @__PURE__ */
|
|
2070
|
+
/* @__PURE__ */ u(V, { icon: "upload" }),
|
|
2071
|
+
/* @__PURE__ */ u("span", { children: "Upload reviewable" })
|
|
2033
2072
|
]
|
|
2034
2073
|
}
|
|
2035
2074
|
)
|
|
2036
2075
|
] });
|
|
2037
|
-
},
|
|
2076
|
+
}, Nr = m.div`
|
|
2038
2077
|
position: relative;
|
|
2039
2078
|
border-radius: var(--border-radius-m);
|
|
2040
2079
|
display: flex;
|
|
@@ -2049,9 +2088,9 @@ const wr = p.div`
|
|
|
2049
2088
|
}
|
|
2050
2089
|
|
|
2051
2090
|
flex: 1;
|
|
2052
|
-
`,
|
|
2091
|
+
`, Ur = m.div`
|
|
2053
2092
|
position: relative;
|
|
2054
|
-
`,
|
|
2093
|
+
`, $r = m.span`
|
|
2055
2094
|
position: relative;
|
|
2056
2095
|
padding: 0px 2px;
|
|
2057
2096
|
border-radius: var(--border-radius-m);
|
|
@@ -2073,29 +2112,29 @@ const wr = p.div`
|
|
|
2073
2112
|
color: var(--md-sys-color-on-surface);
|
|
2074
2113
|
}
|
|
2075
2114
|
}
|
|
2076
|
-
`,
|
|
2115
|
+
`, Mr = m.span`
|
|
2077
2116
|
text-overflow: ellipsis;
|
|
2078
2117
|
overflow: hidden;
|
|
2079
2118
|
display: inline-block;
|
|
2080
2119
|
white-space: nowrap;
|
|
2081
|
-
`,
|
|
2120
|
+
`, he = we`
|
|
2082
2121
|
background-color: var(--md-sys-color-surface-container);
|
|
2083
2122
|
&,
|
|
2084
2123
|
.icon {
|
|
2085
2124
|
color: var(--md-sys-color-on-surface);
|
|
2086
2125
|
}
|
|
2087
|
-
`,
|
|
2126
|
+
`, co = m.div`
|
|
2088
2127
|
& > span,
|
|
2089
2128
|
& > li {
|
|
2090
2129
|
cursor: pointer;
|
|
2091
2130
|
&:hover {
|
|
2092
|
-
${
|
|
2131
|
+
${he}
|
|
2093
2132
|
}
|
|
2094
2133
|
}
|
|
2095
2134
|
|
|
2096
2135
|
&.open {
|
|
2097
2136
|
& > span {
|
|
2098
|
-
${
|
|
2137
|
+
${he}
|
|
2099
2138
|
}
|
|
2100
2139
|
}
|
|
2101
2140
|
|
|
@@ -2107,7 +2146,7 @@ const wr = p.div`
|
|
|
2107
2146
|
}
|
|
2108
2147
|
}
|
|
2109
2148
|
}
|
|
2110
|
-
`,
|
|
2149
|
+
`, zr = m.div`
|
|
2111
2150
|
position: absolute;
|
|
2112
2151
|
top: 100%;
|
|
2113
2152
|
left: 0px;
|
|
@@ -2116,7 +2155,7 @@ const wr = p.div`
|
|
|
2116
2155
|
|
|
2117
2156
|
z-index: 200;
|
|
2118
2157
|
padding-top: 4px;
|
|
2119
|
-
`,
|
|
2158
|
+
`, Rr = m.ul`
|
|
2120
2159
|
display: flex;
|
|
2121
2160
|
flex-direction: column;
|
|
2122
2161
|
gap: var(--base-gap-small);
|
|
@@ -2131,46 +2170,46 @@ const wr = p.div`
|
|
|
2131
2170
|
|
|
2132
2171
|
max-height: 500px;
|
|
2133
2172
|
overflow: auto;
|
|
2134
|
-
`,
|
|
2173
|
+
`, Wr = m.li`
|
|
2135
2174
|
padding: var(--base-gap-small);
|
|
2136
2175
|
border-radius: var(--border-radius-m);
|
|
2137
2176
|
color: var(--md-sys-color-on-surface);
|
|
2138
2177
|
min-width: max-content;
|
|
2139
2178
|
width: 100%;
|
|
2140
|
-
`,
|
|
2141
|
-
({ children: e, segment: t, isOpen:
|
|
2142
|
-
const { openSlideOut: d } =
|
|
2143
|
-
if (!
|
|
2144
|
-
const { type: v, id:
|
|
2145
|
-
!v || v === "project" || v === "product" || !
|
|
2179
|
+
`, Lr = te(
|
|
2180
|
+
({ children: e, segment: t, isOpen: o, scope: r, projectName: g, ...c }, a) => {
|
|
2181
|
+
const { openSlideOut: d } = ae(), p = t?.type !== "product" && t?.type !== "project", i = () => {
|
|
2182
|
+
if (!p) return;
|
|
2183
|
+
const { type: v, id: h } = t || {};
|
|
2184
|
+
!v || v === "project" || v === "product" || !h || d({
|
|
2146
2185
|
entityType: v,
|
|
2147
|
-
entityId:
|
|
2148
|
-
projectName:
|
|
2186
|
+
entityId: h,
|
|
2187
|
+
projectName: g
|
|
2149
2188
|
});
|
|
2150
|
-
},
|
|
2189
|
+
}, f = (v) => [
|
|
2151
2190
|
{
|
|
2152
2191
|
label: `ID: ${v}`,
|
|
2153
2192
|
icon: "content_copy",
|
|
2154
|
-
command: () =>
|
|
2193
|
+
command: () => re(v)
|
|
2155
2194
|
}
|
|
2156
|
-
], [
|
|
2157
|
-
return /* @__PURE__ */
|
|
2158
|
-
|
|
2195
|
+
], [s] = wt();
|
|
2196
|
+
return /* @__PURE__ */ u(
|
|
2197
|
+
co,
|
|
2159
2198
|
{
|
|
2160
2199
|
onClick: i,
|
|
2161
2200
|
onContextMenu: (v) => {
|
|
2162
2201
|
if (!t) return;
|
|
2163
|
-
const
|
|
2164
|
-
|
|
2202
|
+
const h = f(t.id);
|
|
2203
|
+
s(v, h);
|
|
2165
2204
|
},
|
|
2166
|
-
className:
|
|
2167
|
-
...
|
|
2205
|
+
className: xt({ link: p, open: o }),
|
|
2206
|
+
...c,
|
|
2168
2207
|
ref: a,
|
|
2169
2208
|
children: e
|
|
2170
2209
|
}
|
|
2171
2210
|
);
|
|
2172
2211
|
}
|
|
2173
|
-
),
|
|
2212
|
+
), po = m.div`
|
|
2174
2213
|
position: relative;
|
|
2175
2214
|
width: 100%;
|
|
2176
2215
|
height: 52px;
|
|
@@ -2260,7 +2299,15 @@ const wr = p.div`
|
|
|
2260
2299
|
border: none;
|
|
2261
2300
|
border-color: transparent;
|
|
2262
2301
|
}
|
|
2263
|
-
|
|
2302
|
+
|
|
2303
|
+
/* the hover-scrub filmstrip replaces the static image */
|
|
2304
|
+
&[data-filmstrip-active] {
|
|
2305
|
+
img,
|
|
2306
|
+
.icon {
|
|
2307
|
+
visibility: hidden;
|
|
2308
|
+
}
|
|
2309
|
+
}
|
|
2310
|
+
`, uo = m.img`
|
|
2264
2311
|
width: 100%;
|
|
2265
2312
|
height: 100%;
|
|
2266
2313
|
object-fit: contain;
|
|
@@ -2272,63 +2319,71 @@ const wr = p.div`
|
|
|
2272
2319
|
inset: 0;
|
|
2273
2320
|
|
|
2274
2321
|
transition: scale 0.2s, opacity 0.2s;
|
|
2275
|
-
`,
|
|
2322
|
+
`, mo = ({
|
|
2276
2323
|
projectName: e = "",
|
|
2277
2324
|
entityType: t = "",
|
|
2278
|
-
entityId:
|
|
2279
|
-
icon:
|
|
2280
|
-
color:
|
|
2281
|
-
thumbnailHash:
|
|
2325
|
+
entityId: o = "",
|
|
2326
|
+
icon: r,
|
|
2327
|
+
color: g,
|
|
2328
|
+
thumbnailHash: c,
|
|
2282
2329
|
isLoading: a,
|
|
2283
2330
|
shimmer: d,
|
|
2284
|
-
className:
|
|
2331
|
+
className: p,
|
|
2285
2332
|
disabled: i,
|
|
2286
|
-
src:
|
|
2287
|
-
hoverIcon:
|
|
2288
|
-
showBorder:
|
|
2289
|
-
|
|
2333
|
+
src: f,
|
|
2334
|
+
hoverIcon: s,
|
|
2335
|
+
showBorder: n = !0,
|
|
2336
|
+
filmstrip: v,
|
|
2337
|
+
...h
|
|
2290
2338
|
}) => {
|
|
2291
|
-
const
|
|
2292
|
-
let
|
|
2293
|
-
t && (
|
|
2294
|
-
const [
|
|
2295
|
-
return
|
|
2296
|
-
if (
|
|
2297
|
-
|
|
2339
|
+
const x = t === "project", E = ["product"].includes(t), S = x ? !!e : !!o;
|
|
2340
|
+
let y = "";
|
|
2341
|
+
t && (c || x) && S && (f ? y = f : y = yt({ projectName: e, entityType: t, entityId: o, thumbnailHash: c }) ?? "");
|
|
2342
|
+
const [k, j] = O(!1), [w, T] = O(!1);
|
|
2343
|
+
return G(() => {
|
|
2344
|
+
if (y === "") {
|
|
2345
|
+
T(!0), j(!0);
|
|
2298
2346
|
return;
|
|
2299
2347
|
}
|
|
2300
|
-
|
|
2301
|
-
}, [
|
|
2302
|
-
|
|
2348
|
+
T(!1), j(!1);
|
|
2349
|
+
}, [y]), /* @__PURE__ */ z(
|
|
2350
|
+
po,
|
|
2303
2351
|
{
|
|
2304
|
-
className:
|
|
2305
|
-
loading: d && (a || !
|
|
2306
|
-
loaded:
|
|
2307
|
-
error:
|
|
2308
|
-
clickable: !!
|
|
2309
|
-
border:
|
|
2352
|
+
className: W(p, "thumbnail", {
|
|
2353
|
+
loading: d && (a || !w),
|
|
2354
|
+
loaded: w,
|
|
2355
|
+
error: k,
|
|
2356
|
+
clickable: !!h.onClick,
|
|
2357
|
+
border: n
|
|
2310
2358
|
}),
|
|
2311
|
-
...
|
|
2359
|
+
...h,
|
|
2312
2360
|
children: [
|
|
2313
|
-
(!a || !
|
|
2314
|
-
t && e && !
|
|
2315
|
-
|
|
2361
|
+
(!a || !w) && !i && /* @__PURE__ */ u(V, { style: { color: g || void 0 }, icon: r || "image", className: "type-icon" }),
|
|
2362
|
+
t && e && !E && S && /* @__PURE__ */ u(
|
|
2363
|
+
uo,
|
|
2316
2364
|
{
|
|
2317
|
-
alt: `Entity thumbnail ${
|
|
2318
|
-
src:
|
|
2365
|
+
alt: `Entity thumbnail ${o || e}`,
|
|
2366
|
+
src: y,
|
|
2319
2367
|
onLoad: () => {
|
|
2320
|
-
|
|
2368
|
+
T(!0), j(!1);
|
|
2321
2369
|
},
|
|
2322
2370
|
onError: () => {
|
|
2323
|
-
|
|
2371
|
+
T(!0), j(!0);
|
|
2324
2372
|
}
|
|
2325
2373
|
}
|
|
2326
2374
|
),
|
|
2327
|
-
|
|
2375
|
+
s && /* @__PURE__ */ u(V, { icon: s, className: "hover-icon" }),
|
|
2376
|
+
v && !a && !i && /* @__PURE__ */ u(
|
|
2377
|
+
ke,
|
|
2378
|
+
{
|
|
2379
|
+
src: bt({ projectName: e, entityType: t, entityId: o, thumbnailHash: c }),
|
|
2380
|
+
fit: "contain"
|
|
2381
|
+
}
|
|
2382
|
+
)
|
|
2328
2383
|
]
|
|
2329
2384
|
}
|
|
2330
2385
|
);
|
|
2331
|
-
},
|
|
2386
|
+
}, go = m.div`
|
|
2332
2387
|
display: flex;
|
|
2333
2388
|
z-index: 10;
|
|
2334
2389
|
height: 100%;
|
|
@@ -2349,7 +2404,7 @@ const wr = p.div`
|
|
|
2349
2404
|
font-size: 24px;
|
|
2350
2405
|
}
|
|
2351
2406
|
|
|
2352
|
-
${({ $length: e }) => e > 1 &&
|
|
2407
|
+
${({ $length: e }) => e > 1 && we`
|
|
2353
2408
|
:not(:last-child) {
|
|
2354
2409
|
box-shadow: 0 0 4px 0px black;
|
|
2355
2410
|
}
|
|
@@ -2365,131 +2420,133 @@ const wr = p.div`
|
|
|
2365
2420
|
object-fit: cover;
|
|
2366
2421
|
}
|
|
2367
2422
|
}
|
|
2368
|
-
`,
|
|
2423
|
+
`, Pr = ({
|
|
2369
2424
|
thumbnails: e = [],
|
|
2370
2425
|
isLoading: t,
|
|
2371
|
-
className:
|
|
2372
|
-
style:
|
|
2426
|
+
className: o,
|
|
2427
|
+
style: r,
|
|
2428
|
+
filmstrip: g,
|
|
2373
2429
|
...c
|
|
2374
2430
|
}) => {
|
|
2375
|
-
const { onContextMenu:
|
|
2431
|
+
const { onContextMenu: a } = Ae(ut);
|
|
2376
2432
|
e = e.slice(0, 5);
|
|
2377
|
-
const
|
|
2378
|
-
return e.length ? /* @__PURE__ */
|
|
2379
|
-
|
|
2433
|
+
const d = e.length > 1;
|
|
2434
|
+
return e.length ? /* @__PURE__ */ u(
|
|
2435
|
+
go,
|
|
2380
2436
|
{
|
|
2381
2437
|
$length: e.length,
|
|
2382
|
-
className:
|
|
2438
|
+
className: W("stacked-thumbnails", o, { stacking: d }),
|
|
2383
2439
|
children: e.map(
|
|
2384
|
-
(
|
|
2385
|
-
|
|
2440
|
+
(p, i) => p ? /* @__PURE__ */ u(
|
|
2441
|
+
mo,
|
|
2386
2442
|
{
|
|
2387
|
-
projectName:
|
|
2388
|
-
entityType:
|
|
2389
|
-
entityId:
|
|
2390
|
-
icon:
|
|
2391
|
-
color:
|
|
2392
|
-
style: { ...
|
|
2393
|
-
thumbnailHash:
|
|
2443
|
+
projectName: p.projectName,
|
|
2444
|
+
entityType: p.type,
|
|
2445
|
+
entityId: p.id,
|
|
2446
|
+
icon: p.icon,
|
|
2447
|
+
color: p.color,
|
|
2448
|
+
style: { ...r, zIndex: -i },
|
|
2449
|
+
thumbnailHash: p.thumbnailHash,
|
|
2394
2450
|
isLoading: t,
|
|
2395
|
-
src:
|
|
2396
|
-
|
|
2451
|
+
src: p.src,
|
|
2452
|
+
filmstrip: g && !d,
|
|
2453
|
+
onContextMenu: a,
|
|
2397
2454
|
...c
|
|
2398
2455
|
},
|
|
2399
|
-
|
|
2456
|
+
p.id || p.src || i
|
|
2400
2457
|
) : null
|
|
2401
2458
|
)
|
|
2402
2459
|
}
|
|
2403
2460
|
) : null;
|
|
2404
|
-
},
|
|
2405
|
-
({ entities: e, entityType: t, onWatchersUpdate:
|
|
2406
|
-
const a = e.map((
|
|
2407
|
-
entityId:
|
|
2461
|
+
}, Br = te(
|
|
2462
|
+
({ entities: e, entityType: t, onWatchersUpdate: o, userName: r, ...g }, c) => {
|
|
2463
|
+
const a = e.map((s) => ({
|
|
2464
|
+
entityId: s.id,
|
|
2408
2465
|
entityType: t,
|
|
2409
|
-
projectName:
|
|
2410
|
-
})), { data: d = [] } =
|
|
2466
|
+
projectName: s.projectName
|
|
2467
|
+
})), { data: d = [] } = lt(
|
|
2411
2468
|
{
|
|
2412
2469
|
entities: a
|
|
2413
2470
|
},
|
|
2414
2471
|
{ skip: !e.length }
|
|
2415
|
-
),
|
|
2416
|
-
const
|
|
2417
|
-
const
|
|
2418
|
-
return
|
|
2419
|
-
...
|
|
2420
|
-
watchers:
|
|
2472
|
+
), p = Array.from(new Set(d.flatMap((s) => s.watchers))), [i] = ct(), f = async (s) => {
|
|
2473
|
+
const n = s.filter((x) => !p.includes(x)), v = p.filter((x) => !s.includes(x)), h = d.map((x) => {
|
|
2474
|
+
const E = x.watchers.filter((S) => !v.includes(S));
|
|
2475
|
+
return E.push(...n), {
|
|
2476
|
+
...x,
|
|
2477
|
+
watchers: E
|
|
2421
2478
|
};
|
|
2422
2479
|
});
|
|
2423
2480
|
try {
|
|
2424
|
-
await i({ entities:
|
|
2481
|
+
await i({ entities: h }).unwrap(), o && o(n, v);
|
|
2425
2482
|
} catch {
|
|
2426
|
-
|
|
2483
|
+
oe.error("Failed to update watchers");
|
|
2427
2484
|
}
|
|
2428
2485
|
};
|
|
2429
|
-
return /* @__PURE__ */
|
|
2430
|
-
|
|
2486
|
+
return /* @__PURE__ */ u(
|
|
2487
|
+
We,
|
|
2431
2488
|
{
|
|
2432
2489
|
align: "right",
|
|
2433
|
-
...
|
|
2434
|
-
options:
|
|
2435
|
-
value:
|
|
2436
|
-
currentUser:
|
|
2437
|
-
onChange:
|
|
2438
|
-
ref:
|
|
2490
|
+
...g,
|
|
2491
|
+
options: Ge(g.options, p),
|
|
2492
|
+
value: p,
|
|
2493
|
+
currentUser: r,
|
|
2494
|
+
onChange: f,
|
|
2495
|
+
ref: c,
|
|
2439
2496
|
buttonProps: { "data-tooltip": "Watchers" }
|
|
2440
2497
|
}
|
|
2441
2498
|
);
|
|
2442
2499
|
}
|
|
2443
2500
|
);
|
|
2444
2501
|
export {
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2502
|
+
ur as A,
|
|
2503
|
+
dr as B,
|
|
2504
|
+
Sr as C,
|
|
2505
|
+
Er as D,
|
|
2506
|
+
vr as E,
|
|
2507
|
+
Mr as F,
|
|
2508
|
+
sr as G,
|
|
2509
|
+
ir as H,
|
|
2510
|
+
yr as I,
|
|
2511
|
+
hr as J,
|
|
2512
|
+
fr as K,
|
|
2513
|
+
jr as L,
|
|
2514
|
+
zr as M,
|
|
2515
|
+
br as N,
|
|
2516
|
+
lr as O,
|
|
2517
|
+
Fr as P,
|
|
2518
|
+
mr as Q,
|
|
2519
|
+
Ar as R,
|
|
2520
|
+
$r as S,
|
|
2521
|
+
pr as T,
|
|
2522
|
+
Tr as U,
|
|
2523
|
+
xr as V,
|
|
2524
|
+
Br as W,
|
|
2525
|
+
gr as X,
|
|
2526
|
+
Dr as a,
|
|
2527
|
+
Cr as b,
|
|
2528
|
+
me as c,
|
|
2529
|
+
wr as d,
|
|
2473
2530
|
kr as e,
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2531
|
+
Nr as f,
|
|
2532
|
+
Rr as g,
|
|
2533
|
+
Lr as h,
|
|
2534
|
+
Wr as i,
|
|
2535
|
+
Ur as j,
|
|
2536
|
+
ar as k,
|
|
2537
|
+
St as l,
|
|
2538
|
+
Dt as m,
|
|
2539
|
+
rr as n,
|
|
2540
|
+
Nt as o,
|
|
2541
|
+
Ut as p,
|
|
2542
|
+
Bt as q,
|
|
2543
|
+
It as r,
|
|
2544
|
+
nr as s,
|
|
2545
|
+
Se as t,
|
|
2546
|
+
lo as u,
|
|
2547
|
+
Gt as v,
|
|
2548
|
+
Pr as w,
|
|
2549
|
+
mo as x,
|
|
2550
|
+
Ct as y,
|
|
2551
|
+
cr as z
|
|
2495
2552
|
};
|