@ynput/ayon-frontend-shared 0.7.6 → 0.8.1
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 +774 -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 +1261 -1206
- 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 +275 -194
- 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 +3165 -2363
- package/dist/types/components.d.ts +444 -473
- 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
package/dist/chunks/Feed.es.js
CHANGED
|
@@ -1,55 +1,54 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { v4 as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { toast as
|
|
11
|
-
import { $createListItemNode as
|
|
12
|
-
import { $getRoot as
|
|
13
|
-
import { Button as
|
|
14
|
-
import {
|
|
1
|
+
import { jsx as c, jsxs as x, Fragment as Te } from "react/jsx-runtime";
|
|
2
|
+
import nn, { useMemo as I, useState as L, useEffect as W, lazy as xo, Suspense as ko, useCallback as Je, useRef as pe, forwardRef as ft, useId as Ao, Fragment as Fo } from "react";
|
|
3
|
+
import { v4 as xn } from "uuid";
|
|
4
|
+
import ne, { clsx as kn } from "clsx";
|
|
5
|
+
import An from "react-markdown";
|
|
6
|
+
import Fn from "remark-emoji";
|
|
7
|
+
import Cn from "remark-gfm";
|
|
8
|
+
import Co from "remark-directive";
|
|
9
|
+
import To from "remark-directive-rehype";
|
|
10
|
+
import { toast as Ce } from "react-toastify";
|
|
11
|
+
import { $createListItemNode as Do, $createListNode as No } from "@lexical/list";
|
|
12
|
+
import { $getRoot as Io } from "lexical";
|
|
13
|
+
import { Button as st, Dialog as So, getFileSizeString as Eo, Icon as se, theme as Tn, getTextColor as Lt, Dropdown as Mo, SaveButton as Po, UserImage as Dn, SEARCH_FILTER_ID as Nn, buildFilterId as on, getFilterFromId as _o, SearchFilter as Ro } from "@ynput/ayon-react-components";
|
|
14
|
+
import { a8 as Lo, aa as In, ab as $o, P as Oo, ac as Vo, ad as an, ae as jo, af as Uo, ag as zo, J as Bo, ah as Go, ai as Ho, aj as qo, ak as Wo, al as Qo, am as Yo, an as Jo, ao as Ko, ap as Xo, aq as Zo, ar as ea, V as $t, a3 as Sn, a0 as ta, as as na, at as oa, au as aa, av as ra, aw as ia, ax as sa, ay as ca, az as rn, aA as la, b as da, c as ua, i as ma, aB as pa, _ as ga, e as ha, T as fa, S as ya, U as va } from "./FilmstripEntityCard.es.js";
|
|
15
15
|
import "@lexical/code";
|
|
16
16
|
import "@lexical/rich-text";
|
|
17
17
|
import "@lexical/selection";
|
|
18
18
|
import "@lexical/utils";
|
|
19
19
|
import "@lexical/react/LexicalBlockWithAlignableContents";
|
|
20
20
|
import "@lexical/react/LexicalDecoratorBlockNode";
|
|
21
|
-
import F, { css as
|
|
22
|
-
import { C as
|
|
23
|
-
import { E as
|
|
21
|
+
import F, { css as Ot } from "styled-components";
|
|
22
|
+
import { C as ba } from "./CodeEditor.es.js";
|
|
23
|
+
import { E as It } from "./EmptyPlaceholder.es.js";
|
|
24
24
|
import "./EmptyPlaceholderFlex.styled.es.js";
|
|
25
|
-
import { a_ as
|
|
26
|
-
import {
|
|
25
|
+
import { a_ as wa, bs as sn } from "./searchTerms.es.js";
|
|
26
|
+
import { bl as xa, bo as ka, aJ as Aa, dp as Fa, aW as Ca, aQ as Ta, b3 as Da, Q as Na, bG as Ia, bn as Sa, by as Ea, bs as Ma, bm as Pa, cF as _a, c2 as Ra } from "./getUris.es.js";
|
|
27
27
|
import "primereact/confirmdialog";
|
|
28
|
-
import { union as
|
|
29
|
-
import { b as
|
|
28
|
+
import { union as La, isEqual as $a } from "lodash";
|
|
29
|
+
import { b as Oa, F as Va, u as $e, a as En, T as ja, C as Ua } from "./ThumbnailSimple.es.js";
|
|
30
30
|
import "@module-federation/enhanced/runtime";
|
|
31
31
|
import "@ynput/ayon-addon/host";
|
|
32
|
-
import
|
|
33
|
-
import
|
|
32
|
+
import Vt from "axios";
|
|
33
|
+
import { m as Be, q as za, a2 as yt, u as Ba } from "./TableExportContextInstance.es.js";
|
|
34
34
|
import "semver";
|
|
35
35
|
import "./ContextMenuContextInstance.es.js";
|
|
36
36
|
import "react-dom";
|
|
37
|
-
import "react-redux";
|
|
38
37
|
import "react-router-dom";
|
|
39
|
-
import { p as
|
|
40
|
-
import { b as
|
|
38
|
+
import { p as ve } from "./parseFilename.es.js";
|
|
39
|
+
import { b as cn } from "./colorUtils.es.js";
|
|
41
40
|
import "./EntityTooltip.es.js";
|
|
42
|
-
import { isValid as
|
|
41
|
+
import { isValid as Ke, isToday as Ga, isSameYear as Ha, isSameDay as qa, isSameWeek as Wa, isSameMinute as Qa, format as St, formatISO as Ya, differenceInMinutes as Ja, differenceInSeconds as Ka, compareAsc as Xa } from "date-fns";
|
|
43
42
|
import "@ynput/ayon-addon";
|
|
44
|
-
import { a as
|
|
45
|
-
import { InView as
|
|
46
|
-
import { t as
|
|
47
|
-
import { r as
|
|
43
|
+
import { a as Za, M as er } from "./Menu.es.js";
|
|
44
|
+
import { InView as tr } from "react-intersection-observer";
|
|
45
|
+
import { t as nr, c as or } from "./queryFilterToClientFilter.es.js";
|
|
46
|
+
import { r as ar, a as rr, m as ir, u as sr } from "./useDateRangeFilter.es.js";
|
|
48
47
|
import "match-sorter";
|
|
49
|
-
import { c as
|
|
50
|
-
import { c as
|
|
51
|
-
import { g as
|
|
52
|
-
const
|
|
48
|
+
import { c as cr } from "./confirmDelete.es.js";
|
|
49
|
+
import { c as Mn } from "./copyToClipboard.es.js";
|
|
50
|
+
import { g as ln } from "./realtimeUpdatesUtils.es.js";
|
|
51
|
+
const lr = ({
|
|
53
52
|
entities: e,
|
|
54
53
|
filter: t,
|
|
55
54
|
backendFilter: o,
|
|
@@ -57,10 +56,10 @@ const ar = ({
|
|
|
57
56
|
projectName: a,
|
|
58
57
|
entityType: r
|
|
59
58
|
}) => {
|
|
60
|
-
const i =
|
|
61
|
-
() => e.map((
|
|
59
|
+
const i = I(
|
|
60
|
+
() => e.map((w) => ({ id: w.id, projectName: w.projectName, entityType: r })),
|
|
62
61
|
[e]
|
|
63
|
-
).map((
|
|
62
|
+
).map((w) => w.id), l = !e.length || !t || !n || !a, m = {
|
|
64
63
|
entityIds: i,
|
|
65
64
|
projectName: a,
|
|
66
65
|
referenceTypes: ["origin", "mention", "relation"],
|
|
@@ -73,23 +72,23 @@ const ar = ({
|
|
|
73
72
|
isLoading: g,
|
|
74
73
|
isFetchingNextPage: u,
|
|
75
74
|
currentData: h,
|
|
76
|
-
fetchNextPage:
|
|
75
|
+
fetchNextPage: b,
|
|
77
76
|
hasNextPage: y
|
|
78
|
-
} =
|
|
79
|
-
const D =
|
|
77
|
+
} = xa(m, { skip: l });
|
|
78
|
+
const D = I(() => p?.pages ? p.pages.flatMap((w) => w.activities || []) : [], [p?.pages]), M = I(() => h?.pages ? h.pages.flatMap((w) => w.activities || []) : [], [h?.pages]), C = async () => {
|
|
80
79
|
if (!y) {
|
|
81
80
|
console.log("No more activities to load");
|
|
82
81
|
return;
|
|
83
82
|
}
|
|
84
|
-
return console.log("loading next page..."), await
|
|
85
|
-
}, f =
|
|
83
|
+
return console.log("loading next page..."), await b();
|
|
84
|
+
}, f = I(() => {
|
|
86
85
|
if (!g) return !1;
|
|
87
|
-
const
|
|
88
|
-
|
|
86
|
+
const w = La(
|
|
87
|
+
M?.flatMap((A) => A.entityId ? A.entityId : [])
|
|
89
88
|
);
|
|
90
|
-
return
|
|
91
|
-
}, [
|
|
92
|
-
return
|
|
89
|
+
return !$a(w, i);
|
|
90
|
+
}, [M, i, g]);
|
|
91
|
+
return l && (g = !0), {
|
|
93
92
|
activitiesData: D,
|
|
94
93
|
isLoadingActivities: g,
|
|
95
94
|
isLoadingNew: f,
|
|
@@ -97,24 +96,24 @@ const ar = ({
|
|
|
97
96
|
hasNextPage: y,
|
|
98
97
|
loadNextPage: C
|
|
99
98
|
};
|
|
100
|
-
},
|
|
101
|
-
const { isGuest: o } =
|
|
99
|
+
}, rt = "__new__", Mc = ({ children: e, ...t }) => {
|
|
100
|
+
const { isGuest: o } = Be(), { data: n = [] } = ka({ projects: [t.projectName] }), { data: a = [] } = wa.useGetTeamsQuery(
|
|
102
101
|
{ projectName: t.projectName, showMembers: !0 },
|
|
103
102
|
{ skip: !t.projectName }
|
|
104
|
-
), r =
|
|
105
|
-
() => a.filter((
|
|
103
|
+
), r = I(
|
|
104
|
+
() => a.filter((j) => j.members?.some((de) => de.name === t.userName)).map((j) => j.name),
|
|
106
105
|
[a, t.userName]
|
|
107
106
|
), [s, i] = L({
|
|
108
107
|
operator: "and",
|
|
109
108
|
conditions: []
|
|
110
|
-
}), [
|
|
109
|
+
}), [l, m] = L(""), p = t.feedFilter ?? s, g = t.setFeedFilter ?? i, [u, h] = L(null), [b, y] = L(null), [D, { isLoading: M }] = Aa(), [C, { isLoading: f }] = Fa(), [w, { isLoading: A }] = Ca(), S = M || f || A, P = async (j) => await D(j).unwrap(), _ = async (j) => await C(j).unwrap(), E = async (j) => await w(j).unwrap(), [N] = Ta(), [G] = Da(), X = async (j) => await N(j).unwrap(), Q = async (j) => await G(j).unwrap(), Z = Na(p), Y = I(() => Oa(p), [p]), $ = lr({
|
|
111
110
|
entities: t.entities,
|
|
112
111
|
filter: p,
|
|
113
|
-
backendFilter:
|
|
114
|
-
activityTypes:
|
|
112
|
+
backendFilter: Y,
|
|
113
|
+
activityTypes: Z,
|
|
115
114
|
projectName: t.projectName,
|
|
116
115
|
entityType: t.entityType
|
|
117
|
-
}), { data:
|
|
116
|
+
}), { data: oe = {} } = Ia(
|
|
118
117
|
{
|
|
119
118
|
suggestRequest: {
|
|
120
119
|
entityType: t.entityType,
|
|
@@ -123,49 +122,49 @@ const ar = ({
|
|
|
123
122
|
projectName: t.projectName
|
|
124
123
|
},
|
|
125
124
|
{ skip: !u }
|
|
126
|
-
), { data:
|
|
125
|
+
), { data: ae = [] } = Sa({
|
|
127
126
|
projectName: t.projectName
|
|
128
|
-
}), { data:
|
|
127
|
+
}), { data: J } = Ea(
|
|
129
128
|
{
|
|
130
129
|
projectName: t.projectName,
|
|
131
|
-
entityIds: t.entities.map((
|
|
130
|
+
entityIds: t.entities.map((j) => j.id)
|
|
132
131
|
},
|
|
133
132
|
{ skip: !t.projectName || !t.entities.length }
|
|
134
133
|
);
|
|
135
|
-
return /* @__PURE__ */
|
|
136
|
-
|
|
134
|
+
return /* @__PURE__ */ c(
|
|
135
|
+
Va.Provider,
|
|
137
136
|
{
|
|
138
137
|
value: {
|
|
139
138
|
...t,
|
|
140
139
|
...$,
|
|
141
|
-
mentionSuggestionsData:
|
|
142
|
-
categories:
|
|
143
|
-
checklistCount:
|
|
140
|
+
mentionSuggestionsData: oe,
|
|
141
|
+
categories: ae,
|
|
142
|
+
checklistCount: J,
|
|
144
143
|
users: n,
|
|
145
|
-
isUpdatingActivity:
|
|
144
|
+
isUpdatingActivity: S,
|
|
146
145
|
userTeamNames: r,
|
|
147
|
-
refTooltip:
|
|
148
|
-
activityTypes:
|
|
146
|
+
refTooltip: b,
|
|
147
|
+
activityTypes: Z,
|
|
149
148
|
feedFilter: p,
|
|
150
149
|
setFeedFilter: g,
|
|
151
|
-
backendFilter:
|
|
152
|
-
searchText:
|
|
150
|
+
backendFilter: Y,
|
|
151
|
+
searchText: l,
|
|
153
152
|
setSearchText: m,
|
|
154
153
|
isGuest: o,
|
|
155
154
|
editingId: u,
|
|
156
155
|
setEditingId: h,
|
|
157
156
|
setRefTooltip: y,
|
|
158
157
|
// Query functions
|
|
159
|
-
createEntityActivity:
|
|
160
|
-
updateActivity:
|
|
158
|
+
createEntityActivity: P,
|
|
159
|
+
updateActivity: _,
|
|
161
160
|
deleteActivity: E,
|
|
162
|
-
createReaction:
|
|
163
|
-
deleteReaction:
|
|
161
|
+
createReaction: X,
|
|
162
|
+
deleteReaction: Q
|
|
164
163
|
},
|
|
165
164
|
children: e
|
|
166
165
|
}
|
|
167
166
|
);
|
|
168
|
-
},
|
|
167
|
+
}, dr = F.div`
|
|
169
168
|
display: grid;
|
|
170
169
|
grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
|
|
171
170
|
gap: var(--base-gap-large);
|
|
@@ -181,7 +180,7 @@ const ar = ({
|
|
|
181
180
|
301px + var(--padding-s) + var(--padding-s) + var(--base-gap-large)+ var(--base-gap-large)
|
|
182
181
|
);
|
|
183
182
|
overflow: auto;
|
|
184
|
-
`,
|
|
183
|
+
`, ur = F.div`
|
|
185
184
|
position: relative;
|
|
186
185
|
display: flex;
|
|
187
186
|
flex-direction: column;
|
|
@@ -227,7 +226,7 @@ const ar = ({
|
|
|
227
226
|
.download-icon {
|
|
228
227
|
color: var(--md-sys-color-outline);
|
|
229
228
|
}
|
|
230
|
-
`,
|
|
229
|
+
`, mr = F.footer`
|
|
231
230
|
background-color: var(--md-sys-color-surface-container-low);
|
|
232
231
|
display: flex;
|
|
233
232
|
align-items: center;
|
|
@@ -327,7 +326,7 @@ const ar = ({
|
|
|
327
326
|
}
|
|
328
327
|
}
|
|
329
328
|
}
|
|
330
|
-
`,
|
|
329
|
+
`, pr = F.div`
|
|
331
330
|
position: relative;
|
|
332
331
|
display: flex;
|
|
333
332
|
justify-content: center;
|
|
@@ -364,7 +363,7 @@ const ar = ({
|
|
|
364
363
|
&:hover .image-wrapper::after {
|
|
365
364
|
opacity: 0.8;
|
|
366
365
|
}
|
|
367
|
-
`,
|
|
366
|
+
`, dn = F.div`
|
|
368
367
|
position: absolute;
|
|
369
368
|
inset: 0;
|
|
370
369
|
display: flex;
|
|
@@ -403,7 +402,7 @@ const ar = ({
|
|
|
403
402
|
&.posterError {
|
|
404
403
|
background-color: transparent;
|
|
405
404
|
}
|
|
406
|
-
`,
|
|
405
|
+
`, gr = F.div`
|
|
407
406
|
display: none;
|
|
408
407
|
position: absolute;
|
|
409
408
|
left: 0;
|
|
@@ -412,7 +411,7 @@ const ar = ({
|
|
|
412
411
|
height: calc(100% - 20px);
|
|
413
412
|
width: 100%;
|
|
414
413
|
gap: 0;
|
|
415
|
-
`,
|
|
414
|
+
`, un = F(st)`
|
|
416
415
|
height: 100%;
|
|
417
416
|
width: 100%;
|
|
418
417
|
border: none;
|
|
@@ -423,7 +422,7 @@ const ar = ({
|
|
|
423
422
|
background: none;
|
|
424
423
|
opacity: 1;
|
|
425
424
|
}
|
|
426
|
-
`,
|
|
425
|
+
`, hr = F(Lo)`
|
|
427
426
|
--icon-size: 32px;
|
|
428
427
|
top: calc(50% - 10px);
|
|
429
428
|
left: 50%;
|
|
@@ -435,7 +434,7 @@ const ar = ({
|
|
|
435
434
|
.icon {
|
|
436
435
|
font-size: var(--icon-size);
|
|
437
436
|
}
|
|
438
|
-
`,
|
|
437
|
+
`, Pc = F(So)`
|
|
439
438
|
min-height: 90vh;
|
|
440
439
|
max-height: 90vh;
|
|
441
440
|
min-width: min(90vw, 100%);
|
|
@@ -520,7 +519,7 @@ const ar = ({
|
|
|
520
519
|
&:focus-visible {
|
|
521
520
|
outline: none;
|
|
522
521
|
}
|
|
523
|
-
`,
|
|
522
|
+
`, fr = F.img`
|
|
524
523
|
height: 100%;
|
|
525
524
|
width: 100%;
|
|
526
525
|
|
|
@@ -530,7 +529,7 @@ const ar = ({
|
|
|
530
529
|
max-width: 90vw;
|
|
531
530
|
min-width: 300px;
|
|
532
531
|
background-color: var(--md-sys-color-surface-container-lowest);
|
|
533
|
-
`,
|
|
532
|
+
`, _c = F.div`
|
|
534
533
|
&.scrollable {
|
|
535
534
|
position: absolute;
|
|
536
535
|
inset: 56px;
|
|
@@ -542,7 +541,7 @@ const ar = ({
|
|
|
542
541
|
inset: 56px 0 0 0;
|
|
543
542
|
display: flex;
|
|
544
543
|
}
|
|
545
|
-
`,
|
|
544
|
+
`, mn = F.div`
|
|
546
545
|
position: relative;
|
|
547
546
|
display: flex;
|
|
548
547
|
flex: 1;
|
|
@@ -559,45 +558,45 @@ const ar = ({
|
|
|
559
558
|
flex: 1;
|
|
560
559
|
min-width: 0;
|
|
561
560
|
}
|
|
562
|
-
`,
|
|
561
|
+
`, ct = (e, t) => `/api/projects/${t}/files/${e}`, yr = ({
|
|
563
562
|
file: e,
|
|
564
563
|
fullPreviews: t = ["png", "jpg", "jpeg", "gif", "svg", "webp"]
|
|
565
564
|
}) => {
|
|
566
565
|
const { id: o, projectName: n, mime: a } = e;
|
|
567
|
-
let r =
|
|
568
|
-
return t.some((i) => a.includes(i)) || (r += "/thumbnail"), /* @__PURE__ */
|
|
569
|
-
},
|
|
566
|
+
let r = ct(o, n);
|
|
567
|
+
return t.some((i) => a.includes(i)) || (r += "/thumbnail"), /* @__PURE__ */ c(fr, { src: r, autoFocus: !0 });
|
|
568
|
+
}, vr = F(ba)`
|
|
570
569
|
border-radius: var(--border-radius-m);
|
|
571
570
|
height: 100%;
|
|
572
571
|
overflow: auto !important;
|
|
573
|
-
`,
|
|
574
|
-
let t =
|
|
572
|
+
`, br = ({ file: e }) => {
|
|
573
|
+
let t = ct(e.id, e.projectName);
|
|
575
574
|
const [o, n] = L(""), [a, r] = L(null);
|
|
576
|
-
return
|
|
575
|
+
return W(() => {
|
|
577
576
|
(async () => {
|
|
578
577
|
try {
|
|
579
578
|
const i = await fetch(t);
|
|
580
579
|
if (!i.ok)
|
|
581
580
|
throw new Error(`HTTP error! status: ${i.status}`);
|
|
582
|
-
const
|
|
583
|
-
n(
|
|
581
|
+
const l = await i.text();
|
|
582
|
+
n(l);
|
|
584
583
|
} catch (i) {
|
|
585
584
|
r(i.message);
|
|
586
585
|
}
|
|
587
586
|
})();
|
|
588
|
-
}, [e.projectName, e.id, t]), a ? /* @__PURE__ */
|
|
587
|
+
}, [e.projectName, e.id, t]), a ? /* @__PURE__ */ x("div", { children: [
|
|
589
588
|
"Error: ",
|
|
590
589
|
a
|
|
591
|
-
] }) : e.mime?.includes("markdown") ? /* @__PURE__ */
|
|
592
|
-
},
|
|
590
|
+
] }) : e.mime?.includes("markdown") ? /* @__PURE__ */ c(An, { remarkPlugins: [Cn, Fn], children: o }) : /* @__PURE__ */ c(vr, { value: o, language: e.extension, readOnly: !0 });
|
|
591
|
+
}, Pn = () => import("./VideoPlayer.es.js"), wr = xo(Pn), xr = ({ duration: e, width: t, height: o }) => Number.isFinite(e) && e > 0 && t > 0 && o > 0, kr = 1e4, Ar = (e) => e ? `code ${e.code}${e.message ? `: ${e.message}` : ""}` : "no MediaError", Fr = (e, t) => {
|
|
593
592
|
const [o, n] = L({ status: "loading" });
|
|
594
|
-
return
|
|
593
|
+
return W(() => {
|
|
595
594
|
n({ status: "loading" });
|
|
596
595
|
let a = !1, r = null, s;
|
|
597
596
|
const i = () => {
|
|
598
|
-
r && (r.removeEventListener("loadedmetadata",
|
|
597
|
+
r && (r.removeEventListener("loadedmetadata", l), r.removeEventListener("error", m), r.removeAttribute("src"), r.load(), r = null);
|
|
599
598
|
};
|
|
600
|
-
function
|
|
599
|
+
function l() {
|
|
601
600
|
if (a || !r) return;
|
|
602
601
|
clearTimeout(s);
|
|
603
602
|
const u = {
|
|
@@ -605,14 +604,14 @@ const ar = ({
|
|
|
605
604
|
width: r.videoWidth,
|
|
606
605
|
height: r.videoHeight
|
|
607
606
|
};
|
|
608
|
-
if (
|
|
607
|
+
if (xr(u)) {
|
|
609
608
|
i(), n({ status: "ready", metadata: u });
|
|
610
609
|
return;
|
|
611
610
|
}
|
|
612
611
|
p(`unusable metadata ${JSON.stringify(u)}`);
|
|
613
612
|
}
|
|
614
613
|
function m() {
|
|
615
|
-
a || (clearTimeout(s), p(
|
|
614
|
+
a || (clearTimeout(s), p(Ar(r?.error ?? null)));
|
|
616
615
|
}
|
|
617
616
|
const p = (u) => {
|
|
618
617
|
const h = r?.preload === "metadata";
|
|
@@ -623,7 +622,7 @@ const ar = ({
|
|
|
623
622
|
console.warn(`[VideoMime] video cannot be played: ${u}`, e), n({ status: "error" });
|
|
624
623
|
};
|
|
625
624
|
function g(u) {
|
|
626
|
-
r = document.createElement("video"), r.preload = u, r.muted = !0, r.playsInline = !0, s = setTimeout(() => !a && p("timed out"),
|
|
625
|
+
r = document.createElement("video"), r.preload = u, r.muted = !0, r.playsInline = !0, s = setTimeout(() => !a && p("timed out"), kr), r.addEventListener("loadedmetadata", l), r.addEventListener("error", m), r.src = e;
|
|
627
626
|
}
|
|
628
627
|
return g("metadata"), () => {
|
|
629
628
|
a = !0, clearTimeout(s), i();
|
|
@@ -639,18 +638,18 @@ const ar = ({
|
|
|
639
638
|
codec: t?.codec
|
|
640
639
|
}
|
|
641
640
|
};
|
|
642
|
-
},
|
|
643
|
-
const { id: t, projectName: o, name: n, mediaInfo: a } = e, r =
|
|
644
|
-
if (
|
|
645
|
-
|
|
641
|
+
}, Cr = ({ file: e }) => {
|
|
642
|
+
const { id: t, projectName: o, name: n, mediaInfo: a } = e, r = ct(t, o), s = Fr(r, a);
|
|
643
|
+
if (W(() => {
|
|
644
|
+
Pn();
|
|
646
645
|
}, []), s.status === "error")
|
|
647
|
-
return /* @__PURE__ */
|
|
646
|
+
return /* @__PURE__ */ c(mn, { children: /* @__PURE__ */ c(It, { icon: "videocam_off", message: "This video cannot be played in the browser", children: /* @__PURE__ */ x("a", { href: r, target: "_blank", rel: "noopener noreferrer", children: [
|
|
648
647
|
"Download ",
|
|
649
648
|
n
|
|
650
649
|
] }) }) });
|
|
651
|
-
const i = /* @__PURE__ */
|
|
652
|
-
return s.status === "loading" ? i : /* @__PURE__ */
|
|
653
|
-
|
|
650
|
+
const i = /* @__PURE__ */ c(mn, { children: /* @__PURE__ */ c(It, { icon: "hourglass_empty", message: "Loading video..." }) });
|
|
651
|
+
return s.status === "loading" ? i : /* @__PURE__ */ c(ko, { fallback: i, children: /* @__PURE__ */ c(
|
|
652
|
+
wr,
|
|
654
653
|
{
|
|
655
654
|
id: t,
|
|
656
655
|
name: n,
|
|
@@ -663,20 +662,20 @@ const ar = ({
|
|
|
663
662
|
codec: s.metadata.codec
|
|
664
663
|
}
|
|
665
664
|
) });
|
|
666
|
-
},
|
|
665
|
+
}, Tr = {
|
|
667
666
|
image: {
|
|
668
|
-
component:
|
|
667
|
+
component: yr,
|
|
669
668
|
mimeTypes: ["image/"],
|
|
670
669
|
fullPreviews: ["png", "jpg", "jpeg", "gif", "svg", "webp"],
|
|
671
670
|
id: "image"
|
|
672
671
|
},
|
|
673
672
|
video: {
|
|
674
|
-
component:
|
|
673
|
+
component: Cr,
|
|
675
674
|
mimeTypes: ["video/"],
|
|
676
675
|
id: "video"
|
|
677
676
|
},
|
|
678
677
|
text: {
|
|
679
|
-
component:
|
|
678
|
+
component: br,
|
|
680
679
|
mimeTypes: ["text/", "application/json", "scss", "jsx"],
|
|
681
680
|
id: "text"
|
|
682
681
|
},
|
|
@@ -684,11 +683,11 @@ const ar = ({
|
|
|
684
683
|
component: null,
|
|
685
684
|
mimeTypes: ["pdf"],
|
|
686
685
|
id: "pdf",
|
|
687
|
-
callback: (e) => window.open(
|
|
686
|
+
callback: (e) => window.open(ct(e.id, e.projectName), "_blank")
|
|
688
687
|
}
|
|
689
|
-
}, vt = (e = "", t = "") => Object.values(
|
|
688
|
+
}, vt = (e = "", t = "") => Object.values(Tr).some(
|
|
690
689
|
({ mimeTypes: o = [] }) => o.some((n) => (e || t)?.includes(n))
|
|
691
|
-
),
|
|
690
|
+
), Dr = {
|
|
692
691
|
// special cases
|
|
693
692
|
description: ["doc"],
|
|
694
693
|
folder_zip: ["zip"],
|
|
@@ -730,12 +729,12 @@ const ar = ({
|
|
|
730
729
|
filter_none: ["sequence"],
|
|
731
730
|
font_download: ["font"],
|
|
732
731
|
deployed_code: ["model", ".obj", ".abc", ".stl", ".fbx", ".gltf", ".glb", ".usd"]
|
|
733
|
-
},
|
|
734
|
-
for (const [t, o] of Object.entries(
|
|
732
|
+
}, Nr = (e) => {
|
|
733
|
+
for (const [t, o] of Object.entries(Dr))
|
|
735
734
|
if (o.some((n) => e.includes(n)))
|
|
736
735
|
return t;
|
|
737
736
|
return "draft";
|
|
738
|
-
},
|
|
737
|
+
}, Ir = ({
|
|
739
738
|
name: e,
|
|
740
739
|
mime: t,
|
|
741
740
|
src: o,
|
|
@@ -744,31 +743,31 @@ const ar = ({
|
|
|
744
743
|
annotationFrameStart: r,
|
|
745
744
|
size: s,
|
|
746
745
|
progress: i,
|
|
747
|
-
onRemove:
|
|
746
|
+
onRemove: l,
|
|
748
747
|
isCompact: m,
|
|
749
748
|
isDownloadable: p = !1,
|
|
750
749
|
onExpand: g,
|
|
751
750
|
disableExpand: u,
|
|
752
751
|
onJumpTo: h,
|
|
753
|
-
className:
|
|
752
|
+
className: b,
|
|
754
753
|
...y
|
|
755
754
|
}) => {
|
|
756
|
-
const D = i && i < 100, [
|
|
757
|
-
/* @__PURE__ */
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
] }),
|
|
755
|
+
const D = i && i < 100, [M, C] = L(!1), [f, w] = L(!1), { feedAnnotationsEnabled: A } = Be(), { entities: S } = $e(), P = e.split("."), _ = P.pop() || "", E = P.join("."), N = vt(t || "." + _), G = t?.includes("image/") || !!n, Q = !!t?.includes("video/") && !n && o ? `${o}/thumbnail` : void 0, Z = /* @__PURE__ */ x(Te, { children: [
|
|
756
|
+
/* @__PURE__ */ c("span", { className: "size", children: Eo(s) }),
|
|
757
|
+
/* @__PURE__ */ c(se, { icon: "download", className: "download-icon" })
|
|
758
|
+
] }), Y = I(
|
|
760
759
|
() => n ?? a,
|
|
761
760
|
[n, a]
|
|
762
|
-
), $ =
|
|
763
|
-
if (!
|
|
761
|
+
), $ = I(() => S.at(0), [S]), oe = I(() => {
|
|
762
|
+
if (!Y?.range)
|
|
764
763
|
return [1, 1];
|
|
765
|
-
const
|
|
766
|
-
return Number.isFinite(
|
|
767
|
-
}, [
|
|
768
|
-
return /* @__PURE__ */
|
|
769
|
-
|
|
764
|
+
const ae = r === void 0 ? $?.attrib?.frameStart : r;
|
|
765
|
+
return Number.isFinite(ae) ? [ae - 1 + Y.range[0], ae - 1 + Y.range[1]] : Y.range;
|
|
766
|
+
}, [Y, r, $]);
|
|
767
|
+
return /* @__PURE__ */ x(
|
|
768
|
+
ur,
|
|
770
769
|
{
|
|
771
|
-
className:
|
|
770
|
+
className: ne(b, {
|
|
772
771
|
compact: m,
|
|
773
772
|
isDownloadable: p,
|
|
774
773
|
isPreviewable: N,
|
|
@@ -776,51 +775,51 @@ const ar = ({
|
|
|
776
775
|
}),
|
|
777
776
|
...y,
|
|
778
777
|
children: [
|
|
779
|
-
/* @__PURE__ */
|
|
780
|
-
|
|
778
|
+
/* @__PURE__ */ x(
|
|
779
|
+
pr,
|
|
781
780
|
{
|
|
782
|
-
className:
|
|
781
|
+
className: ne("content-wrapper", {
|
|
783
782
|
isPreviewable: N,
|
|
784
783
|
isUnsavedAnnotation: !!n
|
|
785
784
|
}),
|
|
786
785
|
children: [
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
|
|
789
|
-
|
|
786
|
+
/* @__PURE__ */ c(se, { icon: Nr(t || "." + _), className: "type-icon" }),
|
|
787
|
+
G && o && /* @__PURE__ */ c(
|
|
788
|
+
dn,
|
|
790
789
|
{
|
|
791
|
-
className:
|
|
790
|
+
className: ne({
|
|
792
791
|
"image-wrapper": !0,
|
|
793
792
|
isDownloadable: p || N || n
|
|
794
793
|
}),
|
|
795
|
-
children: /* @__PURE__ */
|
|
794
|
+
children: /* @__PURE__ */ c(
|
|
796
795
|
"img",
|
|
797
796
|
{
|
|
798
797
|
src: o,
|
|
799
798
|
onError: () => C(!0),
|
|
800
799
|
style: {
|
|
801
|
-
display:
|
|
800
|
+
display: M ? "none" : "block"
|
|
802
801
|
}
|
|
803
802
|
}
|
|
804
803
|
)
|
|
805
804
|
}
|
|
806
805
|
),
|
|
807
|
-
|
|
808
|
-
|
|
806
|
+
Q && /* @__PURE__ */ x(
|
|
807
|
+
dn,
|
|
809
808
|
{
|
|
810
|
-
className:
|
|
809
|
+
className: ne({
|
|
811
810
|
"image-wrapper": !0,
|
|
812
811
|
isDownloadable: p || N,
|
|
813
812
|
posterError: f
|
|
814
813
|
}),
|
|
815
814
|
children: [
|
|
816
|
-
!f && /* @__PURE__ */
|
|
817
|
-
/* @__PURE__ */
|
|
815
|
+
!f && /* @__PURE__ */ c("img", { src: Q, onError: () => w(!0) }),
|
|
816
|
+
/* @__PURE__ */ c(hr, {})
|
|
818
817
|
]
|
|
819
818
|
}
|
|
820
819
|
),
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
-
N && !u && /* @__PURE__ */
|
|
823
|
-
|
|
820
|
+
/* @__PURE__ */ x(gr, { className: "expand-buttons", children: [
|
|
821
|
+
N && !u && /* @__PURE__ */ c(
|
|
822
|
+
un,
|
|
824
823
|
{
|
|
825
824
|
"data-tooltip": "Open preview",
|
|
826
825
|
icon: "open_in_full",
|
|
@@ -828,8 +827,8 @@ const ar = ({
|
|
|
828
827
|
onClick: g
|
|
829
828
|
}
|
|
830
829
|
),
|
|
831
|
-
(n ||
|
|
832
|
-
|
|
830
|
+
(n || A && a) && /* @__PURE__ */ c(
|
|
831
|
+
un,
|
|
833
832
|
{
|
|
834
833
|
"data-tooltip": "Jump to annotation",
|
|
835
834
|
icon: "play_circle",
|
|
@@ -841,36 +840,36 @@ const ar = ({
|
|
|
841
840
|
]
|
|
842
841
|
}
|
|
843
842
|
),
|
|
844
|
-
/* @__PURE__ */
|
|
845
|
-
|
|
843
|
+
/* @__PURE__ */ x(
|
|
844
|
+
mr,
|
|
846
845
|
{
|
|
847
|
-
className:
|
|
846
|
+
className: ne({
|
|
848
847
|
inProgress: D,
|
|
849
848
|
isPreviewable: N && !u,
|
|
850
849
|
isDownloadable: p
|
|
851
850
|
}),
|
|
852
851
|
children: [
|
|
853
|
-
/* @__PURE__ */
|
|
854
|
-
/* @__PURE__ */
|
|
855
|
-
/* @__PURE__ */
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
] }) : /* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ c("span", { className: "progress", style: { right: `${100 - i}%` } }),
|
|
853
|
+
/* @__PURE__ */ c("div", { className: "name-wrapper", children: Y ? /* @__PURE__ */ x("span", { className: "name", children: [
|
|
854
|
+
/* @__PURE__ */ c(se, { icon: "draw" }),
|
|
855
|
+
oe[0],
|
|
856
|
+
oe[1] !== oe[0] && ` - ${oe[1]}`
|
|
857
|
+
] }) : /* @__PURE__ */ x("span", { className: "name", children: [
|
|
859
858
|
E,
|
|
860
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ x("span", { className: "extension", children: [
|
|
861
860
|
".",
|
|
862
|
-
|
|
861
|
+
_
|
|
863
862
|
] })
|
|
864
863
|
] }) }),
|
|
865
|
-
p && (
|
|
864
|
+
p && (l ? /* @__PURE__ */ c("div", { className: "download", children: Z }) : /* @__PURE__ */ c("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "download", children: Z }))
|
|
866
865
|
]
|
|
867
866
|
}
|
|
868
867
|
),
|
|
869
|
-
|
|
868
|
+
l && /* @__PURE__ */ c(st, { className: "remove", onClick: l, icon: "close" })
|
|
870
869
|
]
|
|
871
870
|
}
|
|
872
871
|
);
|
|
873
|
-
},
|
|
872
|
+
}, _n = ({
|
|
874
873
|
files: e = [],
|
|
875
874
|
activityId: t,
|
|
876
875
|
isCompact: o,
|
|
@@ -879,26 +878,26 @@ const ar = ({
|
|
|
879
878
|
projectName: r,
|
|
880
879
|
isDownloadable: s,
|
|
881
880
|
onExpand: i,
|
|
882
|
-
onAnnotationClick:
|
|
881
|
+
onAnnotationClick: l,
|
|
883
882
|
pt: m,
|
|
884
883
|
...p
|
|
885
884
|
}) => {
|
|
886
885
|
if (!e.length) return null;
|
|
887
|
-
const g =
|
|
886
|
+
const g = Je(
|
|
888
887
|
(u) => {
|
|
889
|
-
const h = e.filter((y) => vt(y.mime, y.ext)),
|
|
890
|
-
i?.({ files: h, index:
|
|
888
|
+
const h = e.filter((y) => vt(y.mime, y.ext)), b = h.findIndex((y) => y.id === e[u].id);
|
|
889
|
+
i?.({ files: h, index: b, activityId: t || "" });
|
|
891
890
|
},
|
|
892
891
|
[i]
|
|
893
892
|
);
|
|
894
|
-
return /* @__PURE__ */
|
|
895
|
-
|
|
893
|
+
return /* @__PURE__ */ c(dr, { className: ne({ compact: o }), ...p, children: e.map((u, h) => /* @__PURE__ */ c(
|
|
894
|
+
Ir,
|
|
896
895
|
{
|
|
897
896
|
id: u.id || u.name,
|
|
898
897
|
name: u.name,
|
|
899
898
|
mime: u.mime || u.type,
|
|
900
899
|
size: u.size,
|
|
901
|
-
src: u.unsavedAnnotation ? u.thumbnail : u.id ?
|
|
900
|
+
src: u.unsavedAnnotation ? u.thumbnail : u.id ? ct(u.id, r) : void 0,
|
|
902
901
|
unsavedAnnotation: u.unsavedAnnotation,
|
|
903
902
|
savedAnnotation: u.annotation,
|
|
904
903
|
progress: u.progress,
|
|
@@ -906,13 +905,13 @@ const ar = ({
|
|
|
906
905
|
isCompact: o,
|
|
907
906
|
isDownloadable: s,
|
|
908
907
|
onExpand: () => g(h),
|
|
909
|
-
onJumpTo: () =>
|
|
908
|
+
onJumpTo: () => l?.(u),
|
|
910
909
|
disableExpand: n,
|
|
911
910
|
...m?.file
|
|
912
911
|
},
|
|
913
912
|
u.id || u.name
|
|
914
913
|
)) });
|
|
915
|
-
},
|
|
914
|
+
}, Sr = (e) => {
|
|
916
915
|
const t = /!\[.*?\]\((.*?)\)/g, o = e.match(t);
|
|
917
916
|
let n = e;
|
|
918
917
|
return o && o.forEach((a) => {
|
|
@@ -920,46 +919,46 @@ const ar = ({
|
|
|
920
919
|
const r = a.match(/\(([^)]+)\)/)[1], s = r.split("?")[0];
|
|
921
920
|
n = e.replace(r, s);
|
|
922
921
|
}), n;
|
|
923
|
-
},
|
|
922
|
+
}, Er = new AbortController(), Mr = Vt.CancelToken, Pr = Mr.source(), Xe = (e, t, o) => new Promise((n, a) => {
|
|
924
923
|
new FormData().append("image", e);
|
|
925
924
|
const s = {
|
|
926
|
-
signal:
|
|
927
|
-
cancelToken:
|
|
925
|
+
signal: Er.signal,
|
|
926
|
+
cancelToken: Pr.token,
|
|
928
927
|
onUploadProgress: (i) => o && o(i, e),
|
|
929
928
|
headers: {
|
|
930
929
|
"Content-Type": e.type,
|
|
931
|
-
"x-file-name":
|
|
930
|
+
"x-file-name": ve(e.name)
|
|
932
931
|
}
|
|
933
932
|
};
|
|
934
|
-
|
|
933
|
+
Vt.post(`/api/projects/${t}/files`, e, s).then((i) => {
|
|
935
934
|
n({ file: e, data: i.data });
|
|
936
935
|
}).catch((i) => {
|
|
937
936
|
console.error(i), a({ message: "Upload failed: " + i.response.data.detail });
|
|
938
937
|
});
|
|
939
|
-
}),
|
|
938
|
+
}), _r = (e, t, o, n, a) => {
|
|
940
939
|
e.preventDefault(), e.stopPropagation();
|
|
941
940
|
let r = e.dataTransfer.files;
|
|
942
941
|
if (r?.length) {
|
|
943
942
|
if (r.length === 0) return;
|
|
944
943
|
for (const s of r)
|
|
945
|
-
|
|
944
|
+
Xe(s, t, o).then(
|
|
946
945
|
(i) => n(i),
|
|
947
946
|
(i) => {
|
|
948
|
-
a && a(s),
|
|
947
|
+
a && a(s), Ce.error(i.message), console.warn(i);
|
|
949
948
|
}
|
|
950
949
|
);
|
|
951
950
|
}
|
|
952
|
-
},
|
|
951
|
+
}, Rr = (e, t, o) => (t || console.warn("filterEntityAnnotations: entityId is empty"), Object.values(e).forEach((n) => {
|
|
953
952
|
n.versionId || console.warn("filterEntityAnnotations: annotation.versionId is empty", n);
|
|
954
953
|
}), Object.values(e).filter(
|
|
955
|
-
(n) => n.versionId === t && !o.some((a) => a.name ===
|
|
954
|
+
(n) => n.versionId === t && !o.some((a) => a.name === ve(n.name))
|
|
956
955
|
).map((n) => ({
|
|
957
956
|
...n,
|
|
958
957
|
unsavedAnnotation: n
|
|
959
|
-
}))),
|
|
960
|
-
const { editingId: o, setEditingId: n, annotations: a, removeAnnotation: r } = $e(), { onGoToFrame: s } =
|
|
961
|
-
return
|
|
962
|
-
i.length > 0 && !o && n(
|
|
958
|
+
}))), Lr = ({ entityId: e, filesUploading: t }) => {
|
|
959
|
+
const { editingId: o, setEditingId: n, annotations: a, removeAnnotation: r } = $e(), { onGoToFrame: s } = Be(), i = Rr(a || [], e, t);
|
|
960
|
+
return W(() => {
|
|
961
|
+
i.length > 0 && !o && n(rt);
|
|
963
962
|
}, [i]), {
|
|
964
963
|
annotations: i,
|
|
965
964
|
goToAnnotation: (m) => {
|
|
@@ -968,101 +967,101 @@ const ar = ({
|
|
|
968
967
|
},
|
|
969
968
|
removeAnnotation: r
|
|
970
969
|
};
|
|
971
|
-
},
|
|
970
|
+
}, Rn = (e) => I(() => {
|
|
972
971
|
if (!e)
|
|
973
972
|
return { primary: void 0, secondary: void 0 };
|
|
974
|
-
const t = getComputedStyle(document.documentElement), o = t.getPropertyValue("--md-sys-color-surface-container").trim(), n = t.getPropertyValue("--md-sys-color-surface-container-high").trim(), a = o || e, r = n || e, s =
|
|
973
|
+
const t = getComputedStyle(document.documentElement), o = t.getPropertyValue("--md-sys-color-surface-container").trim(), n = t.getPropertyValue("--md-sys-color-surface-container-high").trim(), a = o || e, r = n || e, s = cn(e, a, 0.1) || e, i = cn(e, r, 0.2) || e;
|
|
975
974
|
return {
|
|
976
975
|
primary: s,
|
|
977
976
|
secondary: i
|
|
978
977
|
};
|
|
979
|
-
}, [e]),
|
|
980
|
-
const { exportAnnotationComposite: r } = $e(), s = async (
|
|
981
|
-
const m = await r?.(
|
|
978
|
+
}, [e]), $r = ({ projectName: e, onSuccess: t, onProgress: o, onStart: n, onError: a }) => {
|
|
979
|
+
const { exportAnnotationComposite: r } = $e(), s = async (l) => {
|
|
980
|
+
const m = await r?.(l.id);
|
|
982
981
|
if (!m)
|
|
983
|
-
throw new Error(`Exporting composite image for annotation ${
|
|
984
|
-
const p = new File([m],
|
|
982
|
+
throw new Error(`Exporting composite image for annotation ${l.id} failed`);
|
|
983
|
+
const p = new File([m], l.name, {
|
|
985
984
|
type: "image/png"
|
|
986
|
-
}), g = await fetch(
|
|
985
|
+
}), g = await fetch(l.annotationData).then((M) => M.blob()), u = new File([g], `annotation-${l.name}`, {
|
|
987
986
|
type: "image/png"
|
|
988
987
|
}), h = await Promise.all([
|
|
989
|
-
|
|
990
|
-
|
|
988
|
+
Xe(p, e, o),
|
|
989
|
+
Xe(u, e, () => {
|
|
991
990
|
})
|
|
992
|
-
]), [
|
|
993
|
-
return { annotation:
|
|
991
|
+
]), [b, y] = h, D = [t(b), t(y, !0)];
|
|
992
|
+
return { annotation: l, uploads: h, files: D };
|
|
994
993
|
};
|
|
995
|
-
return async (
|
|
994
|
+
return async (l) => {
|
|
996
995
|
try {
|
|
997
|
-
const m =
|
|
996
|
+
const m = l.map(async (h) => {
|
|
998
997
|
n?.(h);
|
|
999
998
|
try {
|
|
1000
999
|
return await s(h);
|
|
1001
|
-
} catch (
|
|
1002
|
-
throw a?.(h),
|
|
1000
|
+
} catch (b) {
|
|
1001
|
+
throw a?.(h), b;
|
|
1003
1002
|
}
|
|
1004
1003
|
}), p = await Promise.allSettled(m), g = [], u = [];
|
|
1005
1004
|
return p.forEach((h) => {
|
|
1006
1005
|
if (h.status === "fulfilled") {
|
|
1007
|
-
const { uploads:
|
|
1006
|
+
const { uploads: b, annotation: y, files: D } = h.value;
|
|
1008
1007
|
g.push(...D), u.push({
|
|
1009
1008
|
range: y.range,
|
|
1010
1009
|
id: y.id,
|
|
1011
|
-
composite:
|
|
1012
|
-
transparent:
|
|
1010
|
+
composite: b[0].data.id,
|
|
1011
|
+
transparent: b[1].data.id
|
|
1013
1012
|
});
|
|
1014
1013
|
} else
|
|
1015
|
-
|
|
1014
|
+
Ce.error("Upload failed: " + h.reason.message);
|
|
1016
1015
|
}), { files: g, metadata: u };
|
|
1017
1016
|
} catch (m) {
|
|
1018
|
-
return
|
|
1017
|
+
return Ce.error("Upload failed: " + m.message), { files: [], metadata: [] };
|
|
1019
1018
|
}
|
|
1020
1019
|
};
|
|
1021
|
-
},
|
|
1020
|
+
}, Ln = "ayon-comment-draft/", $n = 720 * 60 * 60 * 1e3, Or = (e) => !e.text.trim() && !e.files.length && !e.uploadedAnnotations.length, On = (e) => {
|
|
1022
1021
|
try {
|
|
1023
1022
|
const t = localStorage.getItem(e);
|
|
1024
1023
|
return t ? JSON.parse(t) : null;
|
|
1025
1024
|
} catch {
|
|
1026
1025
|
return null;
|
|
1027
1026
|
}
|
|
1028
|
-
},
|
|
1027
|
+
}, Vr = (e, t) => {
|
|
1029
1028
|
try {
|
|
1030
|
-
|
|
1029
|
+
Or(t) ? localStorage.removeItem(e) : localStorage.setItem(e, JSON.stringify({ ...t, savedAt: Date.now() }));
|
|
1031
1030
|
} catch (o) {
|
|
1032
1031
|
console.warn("Could not save comment draft", o);
|
|
1033
1032
|
}
|
|
1034
|
-
},
|
|
1033
|
+
}, jr = () => {
|
|
1035
1034
|
try {
|
|
1036
1035
|
const e = Date.now();
|
|
1037
1036
|
for (const t of Object.keys(localStorage)) {
|
|
1038
|
-
if (!t.startsWith(
|
|
1039
|
-
const o =
|
|
1040
|
-
(!o || e - o.savedAt >
|
|
1037
|
+
if (!t.startsWith(Ln)) continue;
|
|
1038
|
+
const o = On(t);
|
|
1039
|
+
(!o || e - o.savedAt > $n) && localStorage.removeItem(t);
|
|
1041
1040
|
}
|
|
1042
1041
|
} catch {
|
|
1043
1042
|
}
|
|
1044
|
-
},
|
|
1045
|
-
const a =
|
|
1046
|
-
|
|
1043
|
+
}, Ur = (e, t, o) => e && t && o.length ? `${Ln}${e}/${t}/${[...o].sort().join(",")}` : null, zr = ({ draftKey: e, draft: t, paused: o, restore: n }) => {
|
|
1044
|
+
const a = pe(null), r = pe(!1);
|
|
1045
|
+
W(() => {
|
|
1047
1046
|
if (!e || o) return;
|
|
1048
1047
|
const s = a.current;
|
|
1049
1048
|
if (a.current = e, s === e) return;
|
|
1050
|
-
s ||
|
|
1051
|
-
const i =
|
|
1052
|
-
i && Date.now() - i.savedAt <=
|
|
1049
|
+
s || jr();
|
|
1050
|
+
const i = On(e);
|
|
1051
|
+
i && Date.now() - i.savedAt <= $n ? (r.current = !0, n({
|
|
1053
1052
|
text: i.text ?? "",
|
|
1054
1053
|
files: i.files ?? [],
|
|
1055
1054
|
uploadedAnnotations: i.uploadedAnnotations ?? [],
|
|
1056
1055
|
category: i.category ?? null
|
|
1057
1056
|
})) : s && (r.current = !0, n({ text: "", files: [], uploadedAnnotations: [], category: t.category }));
|
|
1058
|
-
}, [e, o]),
|
|
1057
|
+
}, [e, o]), W(() => {
|
|
1059
1058
|
if (r.current) {
|
|
1060
1059
|
r.current = !1;
|
|
1061
1060
|
return;
|
|
1062
1061
|
}
|
|
1063
|
-
!e || o ||
|
|
1062
|
+
!e || o || Vr(e, t);
|
|
1064
1063
|
}, [e, o, t.text, t.files, t.uploadedAnnotations, t.category]);
|
|
1065
|
-
},
|
|
1064
|
+
}, Br = "Category", Gr = F.div`
|
|
1066
1065
|
display: flex;
|
|
1067
1066
|
padding: 2px 4px;
|
|
1068
1067
|
justify-content: center;
|
|
@@ -1088,7 +1087,7 @@ const ar = ({
|
|
|
1088
1087
|
|
|
1089
1088
|
&.compact {
|
|
1090
1089
|
padding: 1px 2px;
|
|
1091
|
-
${
|
|
1090
|
+
${Tn.labelMedium}
|
|
1092
1091
|
}
|
|
1093
1092
|
|
|
1094
1093
|
&.editing {
|
|
@@ -1111,13 +1110,13 @@ const ar = ({
|
|
|
1111
1110
|
color: var(--md-sys-color-tertiary);
|
|
1112
1111
|
}
|
|
1113
1112
|
}
|
|
1114
|
-
`,
|
|
1115
|
-
({ value: e, color: t, isCompact: o, isEditing: n, isPower: a, isDisabled: r, style: s, className: i, ...
|
|
1116
|
-
|
|
1113
|
+
`, it = ft(
|
|
1114
|
+
({ value: e, color: t, isCompact: o, isEditing: n, isPower: a, isDisabled: r, style: s, className: i, ...l }, m) => /* @__PURE__ */ c(
|
|
1115
|
+
Gr,
|
|
1117
1116
|
{
|
|
1118
|
-
...
|
|
1117
|
+
...l,
|
|
1119
1118
|
ref: m,
|
|
1120
|
-
className:
|
|
1119
|
+
className: ne(i, {
|
|
1121
1120
|
none: !e,
|
|
1122
1121
|
compact: o,
|
|
1123
1122
|
editing: n,
|
|
@@ -1129,13 +1128,13 @@ const ar = ({
|
|
|
1129
1128
|
...t && {
|
|
1130
1129
|
backgroundColor: t,
|
|
1131
1130
|
borderColor: t,
|
|
1132
|
-
color:
|
|
1131
|
+
color: Lt(t)
|
|
1133
1132
|
}
|
|
1134
1133
|
},
|
|
1135
|
-
children: e ||
|
|
1134
|
+
children: e || Br
|
|
1136
1135
|
}
|
|
1137
1136
|
)
|
|
1138
|
-
),
|
|
1137
|
+
), Hr = F.span`
|
|
1139
1138
|
display: flex;
|
|
1140
1139
|
justify-content: flex-start;
|
|
1141
1140
|
align-items: center;
|
|
@@ -1154,7 +1153,7 @@ const ar = ({
|
|
|
1154
1153
|
color: var(--md-sys-color-on-surface) !important;
|
|
1155
1154
|
}
|
|
1156
1155
|
}
|
|
1157
|
-
`,
|
|
1156
|
+
`, qr = ft(
|
|
1158
1157
|
({
|
|
1159
1158
|
label: e,
|
|
1160
1159
|
color: t,
|
|
@@ -1164,18 +1163,18 @@ const ar = ({
|
|
|
1164
1163
|
endContent: r,
|
|
1165
1164
|
isClear: s,
|
|
1166
1165
|
style: i,
|
|
1167
|
-
className:
|
|
1166
|
+
className: l,
|
|
1168
1167
|
...m
|
|
1169
|
-
}, p) => /* @__PURE__ */
|
|
1170
|
-
|
|
1168
|
+
}, p) => /* @__PURE__ */ x(
|
|
1169
|
+
Hr,
|
|
1171
1170
|
{
|
|
1172
1171
|
...m,
|
|
1173
|
-
className:
|
|
1174
|
-
style: { backgroundColor: n && t ? t : "", color:
|
|
1172
|
+
className: ne(l, { selected: n }),
|
|
1173
|
+
style: { backgroundColor: n && t ? t : "", color: Lt(n && t ? t : ""), ...i },
|
|
1175
1174
|
ref: p,
|
|
1176
1175
|
children: [
|
|
1177
1176
|
a,
|
|
1178
|
-
/* @__PURE__ */
|
|
1177
|
+
/* @__PURE__ */ c(
|
|
1179
1178
|
se,
|
|
1180
1179
|
{
|
|
1181
1180
|
icon: o || (s ? "clear" : "crop_square"),
|
|
@@ -1187,7 +1186,7 @@ const ar = ({
|
|
|
1187
1186
|
]
|
|
1188
1187
|
}
|
|
1189
1188
|
)
|
|
1190
|
-
),
|
|
1189
|
+
), Wr = "1.3.0", Qr = F(Mo)`
|
|
1191
1190
|
button {
|
|
1192
1191
|
/* remove all styles and just use a wrapper */
|
|
1193
1192
|
background-color: unset !important;
|
|
@@ -1198,7 +1197,7 @@ const ar = ({
|
|
|
1198
1197
|
width: unset !important;
|
|
1199
1198
|
color: var(--md-sys-color-on-surface) !important;
|
|
1200
1199
|
}
|
|
1201
|
-
`,
|
|
1200
|
+
`, Yr = ({
|
|
1202
1201
|
value: e,
|
|
1203
1202
|
categories: t,
|
|
1204
1203
|
readonly: o,
|
|
@@ -1207,34 +1206,34 @@ const ar = ({
|
|
|
1207
1206
|
hasPowerpack: r,
|
|
1208
1207
|
onPowerFeature: s,
|
|
1209
1208
|
onChange: i,
|
|
1210
|
-
...
|
|
1209
|
+
...l
|
|
1211
1210
|
}) => {
|
|
1212
1211
|
if (n) return null;
|
|
1213
1212
|
const m = t.find((u) => u.name === e), { color: p } = m || {};
|
|
1214
1213
|
if (!r)
|
|
1215
|
-
return /* @__PURE__ */
|
|
1216
|
-
|
|
1214
|
+
return /* @__PURE__ */ c(
|
|
1215
|
+
it,
|
|
1217
1216
|
{
|
|
1218
1217
|
value: null,
|
|
1219
1218
|
isPower: !0,
|
|
1220
1219
|
isDisabled: !0,
|
|
1221
|
-
style:
|
|
1220
|
+
style: l.style,
|
|
1222
1221
|
onClick: () => s?.("commentCategories"),
|
|
1223
1222
|
"data-tooltip": "Comment categories is a Powerpack feature"
|
|
1224
1223
|
}
|
|
1225
1224
|
);
|
|
1226
1225
|
if (o)
|
|
1227
|
-
return /* @__PURE__ */
|
|
1226
|
+
return /* @__PURE__ */ c(it, { value: e, color: p, isCompact: a, style: l.style });
|
|
1228
1227
|
if (!t.length)
|
|
1229
|
-
return /* @__PURE__ */
|
|
1230
|
-
|
|
1228
|
+
return /* @__PURE__ */ c(
|
|
1229
|
+
it,
|
|
1231
1230
|
{
|
|
1232
1231
|
value: e,
|
|
1233
1232
|
color: p,
|
|
1234
1233
|
isCompact: a,
|
|
1235
|
-
style:
|
|
1236
|
-
onClick: () =>
|
|
1237
|
-
`No categories found. Ensure they are set in the Powerpack settings and the version is at least ${
|
|
1234
|
+
style: l.style,
|
|
1235
|
+
onClick: () => Ce.warning(
|
|
1236
|
+
`No categories found. Ensure they are set in the Powerpack settings and the version is at least ${Wr}.`
|
|
1238
1237
|
)
|
|
1239
1238
|
}
|
|
1240
1239
|
);
|
|
@@ -1247,48 +1246,48 @@ const ar = ({
|
|
|
1247
1246
|
icon: null
|
|
1248
1247
|
}))
|
|
1249
1248
|
];
|
|
1250
|
-
return /* @__PURE__ */
|
|
1251
|
-
|
|
1249
|
+
return /* @__PURE__ */ c(
|
|
1250
|
+
Qr,
|
|
1252
1251
|
{
|
|
1253
1252
|
options: g,
|
|
1254
1253
|
value: e ? [e] : [],
|
|
1255
1254
|
onChange: (u) => i(u[0]),
|
|
1256
|
-
valueTemplate: () => /* @__PURE__ */
|
|
1257
|
-
itemTemplate: (u, h,
|
|
1258
|
-
|
|
1255
|
+
valueTemplate: () => /* @__PURE__ */ c(it, { value: e, color: p, isCompact: a, isEditing: !0 }),
|
|
1256
|
+
itemTemplate: (u, h, b, y) => /* @__PURE__ */ c(
|
|
1257
|
+
qr,
|
|
1259
1258
|
{
|
|
1260
1259
|
label: u.label,
|
|
1261
1260
|
color: u.color,
|
|
1262
|
-
isSelected:
|
|
1261
|
+
isSelected: b,
|
|
1263
1262
|
isClear: u.value === null
|
|
1264
1263
|
},
|
|
1265
1264
|
y
|
|
1266
1265
|
),
|
|
1267
|
-
...
|
|
1266
|
+
...l
|
|
1268
1267
|
}
|
|
1269
1268
|
);
|
|
1270
|
-
},
|
|
1269
|
+
}, Jr = (e, { isGuest: t, isAdmin: o }) => !!(t || !e.length && !o), Kr = ["tip", "status"], Xr = ["textDirective", "leafDirective", "containerDirective"], Vn = (e) => ({ type: "text", value: e }), Ft = (e) => ({ type: "paragraph", children: [Vn(e)] }), Zr = (e, t) => {
|
|
1271
1270
|
const o = e.position?.start.offset, n = e.position?.end.offset;
|
|
1272
1271
|
return o === void 0 || n === void 0 ? null : t.slice(o, n);
|
|
1273
|
-
},
|
|
1274
|
-
const o =
|
|
1272
|
+
}, ei = (e, t) => {
|
|
1273
|
+
const o = Zr(e, t);
|
|
1275
1274
|
if (o === null) return null;
|
|
1276
|
-
if (e.type === "textDirective") return [
|
|
1275
|
+
if (e.type === "textDirective") return [Vn(o)];
|
|
1277
1276
|
if (e.type === "leafDirective") return [Ft(o)];
|
|
1278
1277
|
const [n, ...a] = o.split(`
|
|
1279
1278
|
`), r = a.length ? a[a.length - 1].match(/:{3,}\s*$/) : null;
|
|
1280
1279
|
return [Ft(n), ...e.children || [], ...r ? [Ft(r[0])] : []];
|
|
1281
|
-
},
|
|
1280
|
+
}, jn = (e, t, o) => {
|
|
1282
1281
|
if (!e.children) return;
|
|
1283
1282
|
const n = [];
|
|
1284
1283
|
for (const a of e.children) {
|
|
1285
|
-
const s =
|
|
1284
|
+
const s = Xr.includes(a.type) && !o.includes(a.name || "") ? ei(a, t) : null;
|
|
1286
1285
|
n.push(...s || [a]);
|
|
1287
1286
|
}
|
|
1288
|
-
e.children = n, n.forEach((a) =>
|
|
1289
|
-
},
|
|
1290
|
-
|
|
1291
|
-
},
|
|
1287
|
+
e.children = n, n.forEach((a) => jn(a, t, o));
|
|
1288
|
+
}, ti = (e = Kr) => (t, o) => {
|
|
1289
|
+
jn(t, String(o.value ?? ""), e);
|
|
1290
|
+
}, Un = 1e4, ni = F.span`
|
|
1292
1291
|
margin-left: auto;
|
|
1293
1292
|
color: var(--md-sys-color-outline);
|
|
1294
1293
|
user-select: none;
|
|
@@ -1301,99 +1300,99 @@ const ar = ({
|
|
|
1301
1300
|
min-width: 0;
|
|
1302
1301
|
max-width: fit-content;
|
|
1303
1302
|
|
|
1304
|
-
${
|
|
1305
|
-
`,
|
|
1303
|
+
${Tn.bodySmall}
|
|
1304
|
+
`, lt = ({ date: e, isExact: t, exactTooltip: o = !1, ...n }) => {
|
|
1306
1305
|
const [a, r] = L(!0), [s, i] = L(/* @__PURE__ */ new Date());
|
|
1307
1306
|
if (!e) return null;
|
|
1308
|
-
const
|
|
1309
|
-
if (!
|
|
1310
|
-
|
|
1311
|
-
const
|
|
1307
|
+
const l = new Date(e);
|
|
1308
|
+
if (!Ke(l)) return null;
|
|
1309
|
+
W(() => {
|
|
1310
|
+
const w = setInterval(
|
|
1312
1311
|
() => i(/* @__PURE__ */ new Date()),
|
|
1313
|
-
|
|
1312
|
+
Un
|
|
1314
1313
|
);
|
|
1315
|
-
return () => clearInterval(
|
|
1314
|
+
return () => clearInterval(w);
|
|
1316
1315
|
}, []);
|
|
1317
|
-
const m =
|
|
1318
|
-
let C = a && !t ? D :
|
|
1316
|
+
const m = Ga(l), p = Ha(l, s), g = qa(l, new Date(s.setDate(s.getDate() - 1))), u = Wa(l, s), h = Qa(l, s), b = g ? "" : p ? u ? "E" : "MMM d" : "MMM d yyyy", y = "h:mm a", D = I(() => In(l), [l]), M = I(() => m ? St(l, `${b}, ${y}`) : St(l, `EEEE, dd MMM yyyy ${y}`), [l, m]);
|
|
1317
|
+
let C = a && !t ? D : M;
|
|
1319
1318
|
g && a && !t && (C = `Yesterday${C}`), h && (C = "Just now");
|
|
1320
1319
|
const f = () => {
|
|
1321
1320
|
r(!a);
|
|
1322
1321
|
};
|
|
1323
|
-
return /* @__PURE__ */
|
|
1324
|
-
|
|
1322
|
+
return /* @__PURE__ */ c(
|
|
1323
|
+
ni,
|
|
1325
1324
|
{
|
|
1326
|
-
className:
|
|
1325
|
+
className: ne("date"),
|
|
1327
1326
|
...n,
|
|
1328
1327
|
onClick: f,
|
|
1329
1328
|
onMouseOver: () => !o && r(!1),
|
|
1330
1329
|
onMouseOut: () => !o && r(!0),
|
|
1331
|
-
"data-tooltip": o ?
|
|
1330
|
+
"data-tooltip": o ? M : null,
|
|
1332
1331
|
"data-tooltip-delay": 0,
|
|
1333
1332
|
children: C
|
|
1334
1333
|
}
|
|
1335
1334
|
);
|
|
1336
1335
|
};
|
|
1337
|
-
var
|
|
1338
|
-
const
|
|
1336
|
+
var Se = /* @__PURE__ */ ((e) => (e.APPROVE = "approve", e.REQUEST_CHANGES = "request_changes", e))(Se || {});
|
|
1337
|
+
const zn = (e) => {
|
|
1339
1338
|
switch (e) {
|
|
1340
|
-
case
|
|
1339
|
+
case Se.REQUEST_CHANGES:
|
|
1341
1340
|
return "requested changes";
|
|
1342
|
-
case
|
|
1341
|
+
case Se.APPROVE:
|
|
1343
1342
|
default:
|
|
1344
1343
|
return "approved this";
|
|
1345
1344
|
}
|
|
1346
|
-
},
|
|
1345
|
+
}, oi = (e, t) => {
|
|
1347
1346
|
switch (e) {
|
|
1348
|
-
case
|
|
1347
|
+
case Se.REQUEST_CHANGES:
|
|
1349
1348
|
return "Requested changes on " + t;
|
|
1350
|
-
case
|
|
1349
|
+
case Se.APPROVE:
|
|
1351
1350
|
default:
|
|
1352
1351
|
return "Approved " + t;
|
|
1353
1352
|
}
|
|
1354
|
-
},
|
|
1353
|
+
}, Bn = (e) => {
|
|
1355
1354
|
switch (e) {
|
|
1356
|
-
case
|
|
1355
|
+
case Se.REQUEST_CHANGES:
|
|
1357
1356
|
return "refresh";
|
|
1358
|
-
case
|
|
1357
|
+
case Se.APPROVE:
|
|
1359
1358
|
default:
|
|
1360
1359
|
return "task_alt";
|
|
1361
1360
|
}
|
|
1362
|
-
},
|
|
1361
|
+
}, ai = ({ lastOwnVersionReview: e }) => {
|
|
1363
1362
|
const [t, o] = L(/* @__PURE__ */ new Date());
|
|
1364
|
-
|
|
1365
|
-
const r = setInterval(() => o(/* @__PURE__ */ new Date()),
|
|
1363
|
+
W(() => {
|
|
1364
|
+
const r = setInterval(() => o(/* @__PURE__ */ new Date()), Un);
|
|
1366
1365
|
return () => clearInterval(r);
|
|
1367
1366
|
}, []);
|
|
1368
|
-
const n =
|
|
1369
|
-
return /* @__PURE__ */
|
|
1370
|
-
/* @__PURE__ */
|
|
1367
|
+
const n = I(() => e?.activityData?.feedback, [e]), a = I(() => e?.createdAt ? In(new Date(e?.createdAt)).toLowerCase() : "", [e?.createdAt, t]);
|
|
1368
|
+
return /* @__PURE__ */ x($o, { className: kn(n), children: [
|
|
1369
|
+
/* @__PURE__ */ c(se, { icon: Bn(n) }),
|
|
1371
1370
|
"You last ",
|
|
1372
|
-
|
|
1371
|
+
zn(n),
|
|
1373
1372
|
" ",
|
|
1374
1373
|
a,
|
|
1375
1374
|
" ",
|
|
1376
1375
|
a === "just now" ? "" : "ago"
|
|
1377
1376
|
] });
|
|
1378
|
-
},
|
|
1377
|
+
}, pn = (e) => {
|
|
1379
1378
|
const t = /^(\d+)(?:\s*-\s*(\d+))?$/.exec(e.trim());
|
|
1380
1379
|
if (!t) return null;
|
|
1381
1380
|
const o = Number(t[1]), n = t[2] ? Number(t[2]) : o;
|
|
1382
1381
|
return Number.isSafeInteger(o) && o > 0 && Number.isSafeInteger(n) && n >= o ? { startFrame: o, endFrame: n } : null;
|
|
1383
|
-
},
|
|
1382
|
+
}, Et = (e) => typeof e == "number" && Number.isFinite(e) ? e - 1 : 0, Gn = (e, t) => String(e + Et(t)), ri = (e, t) => {
|
|
1384
1383
|
if (!e) return null;
|
|
1385
|
-
const o = e.startFrame -
|
|
1384
|
+
const o = e.startFrame - Et(t), n = e.endFrame - Et(t);
|
|
1386
1385
|
return o > 0 ? { startFrame: o, endFrame: n } : null;
|
|
1387
|
-
},
|
|
1388
|
-
const { data: r } = await
|
|
1386
|
+
}, gn = async (e, t, o, n, a) => {
|
|
1387
|
+
const { data: r } = await Vt.get(`/api/projects/${e}/files/${t}`, {
|
|
1389
1388
|
responseType: "blob"
|
|
1390
1389
|
}), s = new File([r], o, { type: n || r.type });
|
|
1391
|
-
return
|
|
1392
|
-
},
|
|
1390
|
+
return Xe(s, e, a);
|
|
1391
|
+
}, hn = (e, t) => `/api/projects/${e}/files/${t}`, fn = (e, t) => !!e && $t(t).has(e), ii = [
|
|
1393
1392
|
{ trigger: "@", icon: "person", tooltip: "Mention user" },
|
|
1394
1393
|
{ trigger: "@@", icon: "layers", tooltip: "Mention version" },
|
|
1395
1394
|
{ trigger: "@@@", icon: "check_circle", tooltip: "Mention task" }
|
|
1396
|
-
],
|
|
1395
|
+
], Hn = ({
|
|
1397
1396
|
initValue: e,
|
|
1398
1397
|
initFiles: t = [],
|
|
1399
1398
|
annotationFrameStart: o,
|
|
@@ -1402,440 +1401,440 @@ const Un = (e) => {
|
|
|
1402
1401
|
activityId: r,
|
|
1403
1402
|
versionReview: s,
|
|
1404
1403
|
lastOwnVersionReview: i,
|
|
1405
|
-
onSubmit:
|
|
1404
|
+
onSubmit: l,
|
|
1406
1405
|
onReview: m,
|
|
1407
1406
|
duplicate: p,
|
|
1408
1407
|
onDuplicateHandled: g,
|
|
1409
1408
|
isEditing: u,
|
|
1410
1409
|
disabled: h,
|
|
1411
|
-
isLoading:
|
|
1410
|
+
isLoading: b,
|
|
1412
1411
|
isOpen: y,
|
|
1413
1412
|
onOpen: D,
|
|
1414
|
-
onClose:
|
|
1413
|
+
onClose: M,
|
|
1415
1414
|
saveDraft: C = !0
|
|
1416
1415
|
}) => {
|
|
1417
1416
|
const {
|
|
1418
1417
|
projectName: f,
|
|
1419
|
-
entities:
|
|
1420
|
-
projectInfo:
|
|
1421
|
-
feedFilter:
|
|
1422
|
-
mentionSuggestionsData:
|
|
1423
|
-
categories:
|
|
1418
|
+
entities: w,
|
|
1419
|
+
projectInfo: A,
|
|
1420
|
+
feedFilter: S,
|
|
1421
|
+
mentionSuggestionsData: P,
|
|
1422
|
+
categories: _,
|
|
1424
1423
|
isGuest: E,
|
|
1425
1424
|
userName: N,
|
|
1426
|
-
editingId:
|
|
1427
|
-
} = $e(), { hasLicense:
|
|
1425
|
+
editingId: G
|
|
1426
|
+
} = $e(), { hasLicense: X, onPowerFeature: Q, user: Z, openSlideOut: Y, commentFrameLink: $ } = Be(), oe = Z?.data?.isAdmin, ae = za(), [, J] = En(), [j, de] = L(e || ""), [H, ee] = L(
|
|
1428
1427
|
() => t.map(
|
|
1429
|
-
(d) =>
|
|
1428
|
+
(d) => fn(d.id, e || "") ? { ...d, isInline: !0 } : d
|
|
1430
1429
|
)
|
|
1431
|
-
), [
|
|
1432
|
-
entityId:
|
|
1433
|
-
filesUploading:
|
|
1434
|
-
}), re =
|
|
1430
|
+
), [Oe, De] = L(0), Ve = pe(/* @__PURE__ */ new Map()), [be, ge] = L([]), [Ge, ue] = L(!1), [xe, he] = L(!1), [Ne, Ie] = L([]), [Ze, Re] = L([]), { annotations: fe, removeAnnotation: He, goToAnnotation: qe } = Lr({
|
|
1431
|
+
entityId: w[0]?.id,
|
|
1432
|
+
filesUploading: be
|
|
1433
|
+
}), re = w.length === 1 && w[0].entityType === "version" ? w[0] : void 0, et = $?.draft && $.draft.entityId === re?.id ? $.draft : null, [je, We] = L(
|
|
1435
1434
|
() => u && Number.isSafeInteger(a?.startFrame) && a.startFrame > 0 ? {
|
|
1436
1435
|
startFrame: a.startFrame,
|
|
1437
1436
|
endFrame: Number.isSafeInteger(a.endFrame) && a.endFrame >= a.startFrame ? a.endFrame : a.startFrame
|
|
1438
1437
|
} : null
|
|
1439
|
-
),
|
|
1438
|
+
), Ee = (d) => We(d && { ...d, entityId: re?.id }), Ue = u || je?.entityId === re?.id ? je : null, [ke, Me] = L(!1), q = u ? Ue : Ue ?? et, Pe = u ? !!re || !!Ue : !!$ && !!re, T = $?.formatFrame, R = T ?? ((d) => Gn(d, o)), U = (d) => T ? pn(d) : ri(pn(d), o), v = q ? q.endFrame > q.startFrame ? `${R(q.startFrame)}-${R(q.endFrame)}` : R(q.startFrame) : void 0, [K, we] = L(v ?? ""), Ae = pe(!1), Fe = pe(null), Le = (d) => {
|
|
1440
1439
|
if (!re) return;
|
|
1441
|
-
const
|
|
1440
|
+
const k = d ? { ...d, entityId: re.id } : null;
|
|
1442
1441
|
if (!u) {
|
|
1443
|
-
$?.setDraft(
|
|
1442
|
+
$?.setDraft(k);
|
|
1444
1443
|
return;
|
|
1445
1444
|
}
|
|
1446
1445
|
r && $?.setEditPreview({
|
|
1447
1446
|
activityId: r,
|
|
1448
|
-
link:
|
|
1447
|
+
link: k
|
|
1449
1448
|
});
|
|
1450
|
-
},
|
|
1451
|
-
|
|
1452
|
-
const
|
|
1453
|
-
|
|
1449
|
+
}, jt = (d) => {
|
|
1450
|
+
we(d);
|
|
1451
|
+
const k = U(d);
|
|
1452
|
+
k && Le(k);
|
|
1454
1453
|
};
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
}, [
|
|
1454
|
+
W(() => {
|
|
1455
|
+
ke || we(v ?? "");
|
|
1456
|
+
}, [v, ke]), W(
|
|
1458
1457
|
() => () => {
|
|
1459
1458
|
u && $?.setEditPreview(null);
|
|
1460
1459
|
},
|
|
1461
1460
|
[u, $?.setEditPreview]
|
|
1462
1461
|
);
|
|
1463
|
-
const
|
|
1464
|
-
if (
|
|
1465
|
-
|
|
1462
|
+
const dt = () => {
|
|
1463
|
+
if (Ae.current) {
|
|
1464
|
+
Ae.current = !1, we(v ?? ""), Le(Fe.current), Me(!1);
|
|
1466
1465
|
return;
|
|
1467
1466
|
}
|
|
1468
|
-
const d =
|
|
1469
|
-
d ? (
|
|
1470
|
-
},
|
|
1471
|
-
|
|
1472
|
-
},
|
|
1473
|
-
!u && $ && re ? $.link(re.id) : (
|
|
1474
|
-
},
|
|
1475
|
-
if (!
|
|
1467
|
+
const d = U(K);
|
|
1468
|
+
d ? (Ee(d), Le(d)) : (we(v ?? ""), Le(Fe.current)), Me(!1);
|
|
1469
|
+
}, Qe = () => {
|
|
1470
|
+
Ee(null), u ? Le(null) : $?.unlink();
|
|
1471
|
+
}, Ye = () => {
|
|
1472
|
+
!u && $ && re ? $.link(re.id) : (we(""), Me(!0));
|
|
1473
|
+
}, bt = () => q ? Qe() : Ye(), ut = I(() => {
|
|
1474
|
+
if (!Pe || !u && !$ || !re) return;
|
|
1476
1475
|
const d = ["frame", "time", "timecode", "link", "range"];
|
|
1477
1476
|
return [
|
|
1478
|
-
|
|
1477
|
+
q ? {
|
|
1479
1478
|
id: "frame-link",
|
|
1480
1479
|
label: "Remove frame link",
|
|
1481
1480
|
icon: "timer_off",
|
|
1482
1481
|
keywords: [...d, "unlink", "remove"],
|
|
1483
|
-
hint:
|
|
1484
|
-
run:
|
|
1482
|
+
hint: v,
|
|
1483
|
+
run: Qe
|
|
1485
1484
|
} : {
|
|
1486
1485
|
id: "frame-link",
|
|
1487
1486
|
label: u ? "Add frame link" : "Link to current frame",
|
|
1488
1487
|
icon: "timer",
|
|
1489
1488
|
keywords: d,
|
|
1490
|
-
run:
|
|
1489
|
+
run: Ye
|
|
1491
1490
|
}
|
|
1492
1491
|
];
|
|
1493
|
-
}, [
|
|
1494
|
-
|
|
1495
|
-
draftKey: C && !u ?
|
|
1492
|
+
}, [Pe, u, $, re?.id, !!q, v]), [_e, mt] = L(n);
|
|
1493
|
+
zr({
|
|
1494
|
+
draftKey: C && !u ? Ur(
|
|
1496
1495
|
f,
|
|
1497
1496
|
N,
|
|
1498
|
-
|
|
1497
|
+
w.map((d) => d.id)
|
|
1499
1498
|
) : null,
|
|
1500
|
-
draft: { text:
|
|
1501
|
-
paused:
|
|
1499
|
+
draft: { text: j, files: H, uploadedAnnotations: Ne, category: _e },
|
|
1500
|
+
paused: xe,
|
|
1502
1501
|
restore: (d) => {
|
|
1503
|
-
de(d.text),
|
|
1502
|
+
de(d.text), ee(d.files), Ie(d.uploadedAnnotations), mt(d.category), (d.text.trim() || d.files.length || d.uploadedAnnotations.length) && !y && !G && D?.();
|
|
1504
1503
|
}
|
|
1505
1504
|
});
|
|
1506
|
-
const
|
|
1505
|
+
const Ut = _.filter((d) => d.accessLevel >= 20), zt = _.find((d) => d.name === _e), Bt = Rn(zt?.color), tt = pe(null), Gt = pe(null), Ht = pe(null), pt = !!j.trim(), no = !pt && !H.length && !be.length && !Oe && !Ne.length && !fe.length && !xe, qt = !!S?.conditions?.some(
|
|
1507
1506
|
(d) => "key" in d && d.key === "checklists" && d.value === !0
|
|
1508
1507
|
);
|
|
1509
|
-
|
|
1510
|
-
if (!y || u || !
|
|
1511
|
-
const d =
|
|
1508
|
+
W(() => {
|
|
1509
|
+
if (!y || u || !qt) return;
|
|
1510
|
+
const d = tt.current;
|
|
1512
1511
|
!d || !d.isEmpty() || d.getEditor().update(() => {
|
|
1513
|
-
const
|
|
1514
|
-
|
|
1512
|
+
const k = Do(!1);
|
|
1513
|
+
Io().clear().append(No("check").append(k)), k.select();
|
|
1515
1514
|
});
|
|
1516
|
-
}, [y, u,
|
|
1517
|
-
const
|
|
1515
|
+
}, [y, u, qt]);
|
|
1516
|
+
const Wt = w[0]?.entityType, Qt = ae?.productTypes, oo = I(
|
|
1518
1517
|
() => E ? void 0 : {
|
|
1519
|
-
...
|
|
1520
|
-
suggestions:
|
|
1521
|
-
project: { productTypes:
|
|
1522
|
-
taskTypes:
|
|
1523
|
-
entityType:
|
|
1518
|
+
...Oo({
|
|
1519
|
+
suggestions: P,
|
|
1520
|
+
project: { productTypes: Qt },
|
|
1521
|
+
taskTypes: A?.taskTypes,
|
|
1522
|
+
entityType: Wt
|
|
1524
1523
|
}),
|
|
1525
1524
|
// keep the picker short
|
|
1526
1525
|
limit: 5
|
|
1527
1526
|
},
|
|
1528
|
-
[E,
|
|
1529
|
-
),
|
|
1530
|
-
d === "user" || d === "team" ||
|
|
1531
|
-
},
|
|
1532
|
-
const { x: z, y: ce, width: le } =
|
|
1533
|
-
|
|
1534
|
-
}, [
|
|
1535
|
-
|
|
1527
|
+
[E, P, Qt, A?.taskTypes, Wt]
|
|
1528
|
+
), ao = ({ type: d, id: k }) => {
|
|
1529
|
+
d === "user" || d === "team" || Y({ entityId: k, entityType: d, projectName: f });
|
|
1530
|
+
}, ro = ({ type: d, id: k, label: O }, V) => {
|
|
1531
|
+
const { x: z, y: ce, width: le } = V.getBoundingClientRect();
|
|
1532
|
+
J({ id: k, name: k, type: d, label: O, pos: { left: z + le / 2, top: ce } });
|
|
1533
|
+
}, [io, wt] = L(!1);
|
|
1534
|
+
W(() => {
|
|
1536
1535
|
y || wt(!1);
|
|
1537
1536
|
}, [y]);
|
|
1538
|
-
const
|
|
1537
|
+
const so = () => {
|
|
1539
1538
|
y || h || (wt(!0), D && D());
|
|
1540
|
-
},
|
|
1541
|
-
u && $?.setEditPreview(null), (!pt || u) && de(""),
|
|
1542
|
-
},
|
|
1543
|
-
const
|
|
1544
|
-
id:
|
|
1545
|
-
name:
|
|
1539
|
+
}, Yt = () => {
|
|
1540
|
+
u && $?.setEditPreview(null), (!pt || u) && de(""), M && M(), Ht.current?.closest("#viewer-dialog")?.focus();
|
|
1541
|
+
}, nt = ({ file: d, data: k }, O = !1) => {
|
|
1542
|
+
const V = ve(d.name), z = {
|
|
1543
|
+
id: k.id,
|
|
1544
|
+
name: V,
|
|
1546
1545
|
mime: d.type,
|
|
1547
1546
|
size: d.size,
|
|
1548
|
-
order:
|
|
1549
|
-
isAnnotationLayer:
|
|
1547
|
+
order: H.length,
|
|
1548
|
+
isAnnotationLayer: O
|
|
1550
1549
|
};
|
|
1551
|
-
return
|
|
1552
|
-
(ce) => ce.filter((le) =>
|
|
1550
|
+
return ee((ce) => [...ce, z]), ge(
|
|
1551
|
+
(ce) => ce.filter((le) => ve(le.name) !== V)
|
|
1553
1552
|
), z;
|
|
1554
|
-
},
|
|
1555
|
-
|
|
1556
|
-
},
|
|
1557
|
-
const
|
|
1558
|
-
if (
|
|
1559
|
-
const
|
|
1560
|
-
|
|
1561
|
-
const ce = z.find((B) =>
|
|
1562
|
-
name:
|
|
1563
|
-
progress:
|
|
1564
|
-
type:
|
|
1565
|
-
order: ce?.order ??
|
|
1553
|
+
}, co = (d, k, O) => {
|
|
1554
|
+
O ? He?.(d) : (ee((V) => V.filter((z) => z.id !== d)), ge((V) => V.filter((z) => ve(z.name) !== ve(k))));
|
|
1555
|
+
}, ot = (d, k) => {
|
|
1556
|
+
const O = Math.round(d.loaded * 100 / d.total);
|
|
1557
|
+
if (O !== 100) {
|
|
1558
|
+
const V = ve(k.name);
|
|
1559
|
+
ge((z) => {
|
|
1560
|
+
const ce = z.find((B) => ve(B.name) === V), le = z.filter((B) => ve(B.name) !== V), ze = {
|
|
1561
|
+
name: V,
|
|
1562
|
+
progress: O,
|
|
1563
|
+
type: k.type,
|
|
1564
|
+
order: ce?.order ?? H.length + z.length
|
|
1566
1565
|
};
|
|
1567
|
-
return [...le,
|
|
1566
|
+
return [...le, ze];
|
|
1568
1567
|
});
|
|
1569
1568
|
}
|
|
1570
1569
|
}, gt = (d) => {
|
|
1571
|
-
|
|
1572
|
-
},
|
|
1573
|
-
for (const
|
|
1574
|
-
const
|
|
1575
|
-
|
|
1576
|
-
(
|
|
1577
|
-
(
|
|
1578
|
-
gt(
|
|
1570
|
+
ge((k) => k.filter((O) => O.name !== ve(d)));
|
|
1571
|
+
}, Jt = (d) => {
|
|
1572
|
+
for (const k of d) {
|
|
1573
|
+
const O = Xe(k, f, ot);
|
|
1574
|
+
Ve.current.set(k, O), O.then(
|
|
1575
|
+
(V) => nt(V),
|
|
1576
|
+
(V) => {
|
|
1577
|
+
gt(k.name), Ce.error(V.message), console.warn(V);
|
|
1579
1578
|
}
|
|
1580
1579
|
);
|
|
1581
1580
|
}
|
|
1582
|
-
},
|
|
1583
|
-
|
|
1581
|
+
}, lo = async (d) => {
|
|
1582
|
+
De((k) => k + 1);
|
|
1584
1583
|
try {
|
|
1585
|
-
const
|
|
1586
|
-
if (
|
|
1587
|
-
const { data: z } = await
|
|
1588
|
-
return
|
|
1589
|
-
src:
|
|
1590
|
-
name:
|
|
1584
|
+
const k = Ve.current.get(d);
|
|
1585
|
+
if (k) {
|
|
1586
|
+
const { data: z } = await k;
|
|
1587
|
+
return ee((ce) => ce.map((le) => le.id === z.id ? { ...le, isInline: !0 } : le)), {
|
|
1588
|
+
src: hn(f, z.id),
|
|
1589
|
+
name: ve(d.name),
|
|
1591
1590
|
mime: d.type
|
|
1592
1591
|
};
|
|
1593
1592
|
}
|
|
1594
|
-
const { data:
|
|
1595
|
-
return
|
|
1593
|
+
const { data: O } = await Xe(d, f, void 0), V = ve(d.name);
|
|
1594
|
+
return ee((z) => [
|
|
1596
1595
|
...z,
|
|
1597
|
-
{ id:
|
|
1598
|
-
]), { src:
|
|
1599
|
-
} catch (
|
|
1600
|
-
throw
|
|
1596
|
+
{ id: O.id, name: V, mime: d.type, size: d.size, order: z.length, isInline: !0 }
|
|
1597
|
+
]), { src: hn(f, O.id), name: V, mime: d.type };
|
|
1598
|
+
} catch (k) {
|
|
1599
|
+
throw Ve.current.has(d) || Ce.error(k?.message || "Upload failed"), k;
|
|
1601
1600
|
} finally {
|
|
1602
|
-
|
|
1601
|
+
De((k) => k - 1);
|
|
1603
1602
|
}
|
|
1604
|
-
},
|
|
1605
|
-
|
|
1603
|
+
}, uo = (d) => {
|
|
1604
|
+
ue(!1), !d.defaultPrevented && _r(
|
|
1606
1605
|
d,
|
|
1607
1606
|
f,
|
|
1608
|
-
at,
|
|
1609
1607
|
ot,
|
|
1610
|
-
|
|
1608
|
+
nt,
|
|
1609
|
+
(k) => gt(k.name)
|
|
1611
1610
|
);
|
|
1612
|
-
},
|
|
1613
|
-
d.preventDefault(), d.stopPropagation(),
|
|
1614
|
-
},
|
|
1615
|
-
const
|
|
1616
|
-
|
|
1617
|
-
const
|
|
1618
|
-
const
|
|
1611
|
+
}, mo = (d) => {
|
|
1612
|
+
d.preventDefault(), d.stopPropagation(), ue(!0);
|
|
1613
|
+
}, Kt = pe(null), po = async ({ activity: d }) => {
|
|
1614
|
+
const k = yt(d);
|
|
1615
|
+
k && k.entityId === re?.id && (Ee({ startFrame: k.startFrame, endFrame: k.endFrame }), $?.setDraft(k));
|
|
1616
|
+
const O = Sn(d.body || ""), V = d.files || [], z = $t(O), ce = w.length === 1 && w[0].id === (d.origin?.id ?? d.entityId), le = (B) => {
|
|
1617
|
+
const me = d.origin ?? (d.entityId && d.entityType ? { id: d.entityId, type: d.entityType } : void 0), ie = `[Source](${ta(d.activityId, me)})`, te = [B.trim(), ie].filter(Boolean).join(`
|
|
1619
1618
|
|
|
1620
1619
|
`);
|
|
1621
|
-
de((
|
|
1620
|
+
de((ye) => ye.trim() ? `${ye.trim()}
|
|
1622
1621
|
|
|
1623
|
-
${
|
|
1624
|
-
},
|
|
1625
|
-
const
|
|
1622
|
+
${te}` : te), tt.current?.focus();
|
|
1623
|
+
}, ze = async (B) => {
|
|
1624
|
+
const me = z.has(B.id);
|
|
1626
1625
|
try {
|
|
1627
|
-
const ie = await
|
|
1626
|
+
const ie = await gn(
|
|
1628
1627
|
f,
|
|
1629
1628
|
B.id,
|
|
1630
1629
|
B.name,
|
|
1631
1630
|
B.mime,
|
|
1632
|
-
|
|
1631
|
+
me ? void 0 : ot
|
|
1633
1632
|
);
|
|
1634
|
-
if (
|
|
1635
|
-
const { file:
|
|
1636
|
-
|
|
1637
|
-
...
|
|
1638
|
-
{ id:
|
|
1633
|
+
if (me) {
|
|
1634
|
+
const { file: ye, data: at } = ie, ht = ve(ye.name);
|
|
1635
|
+
ee((tn) => [
|
|
1636
|
+
...tn,
|
|
1637
|
+
{ id: at.id, name: ht, mime: ye.type, size: ye.size, order: tn.length, isInline: me }
|
|
1639
1638
|
]);
|
|
1640
|
-
} else
|
|
1641
|
-
const
|
|
1642
|
-
if (
|
|
1643
|
-
const
|
|
1639
|
+
} else nt(ie);
|
|
1640
|
+
const te = B.annotation;
|
|
1641
|
+
if (te && ce) {
|
|
1642
|
+
const ye = await gn(
|
|
1644
1643
|
f,
|
|
1645
|
-
|
|
1644
|
+
te.transparent,
|
|
1646
1645
|
`annotation-${B.name}`,
|
|
1647
1646
|
"image/png"
|
|
1648
1647
|
);
|
|
1649
|
-
|
|
1650
|
-
...
|
|
1648
|
+
nt(ye, !0), Ie((at) => [
|
|
1649
|
+
...at,
|
|
1651
1650
|
{
|
|
1652
|
-
...
|
|
1653
|
-
id: `${
|
|
1651
|
+
...te,
|
|
1652
|
+
id: `${te.id}-${xn()}`,
|
|
1654
1653
|
composite: ie.data.id,
|
|
1655
|
-
transparent:
|
|
1654
|
+
transparent: ye.data.id
|
|
1656
1655
|
}
|
|
1657
1656
|
]);
|
|
1658
1657
|
}
|
|
1659
1658
|
return [B.id, ie.data.id];
|
|
1660
1659
|
} catch (ie) {
|
|
1661
|
-
return gt(B.name),
|
|
1660
|
+
return gt(B.name), Ce.error(`Could not copy ${B.name}`), console.warn(ie), null;
|
|
1662
1661
|
}
|
|
1663
1662
|
};
|
|
1664
|
-
|
|
1663
|
+
De((B) => B + 1);
|
|
1665
1664
|
try {
|
|
1666
|
-
const B =
|
|
1665
|
+
const B = V.filter((te) => z.has(te.id)), me = V.filter((te) => !z.has(te.id)), ie = Promise.all(me.map(ze));
|
|
1667
1666
|
if (B.length) {
|
|
1668
|
-
const
|
|
1669
|
-
(await Promise.all(B.map(
|
|
1670
|
-
(
|
|
1667
|
+
const te = new Map(
|
|
1668
|
+
(await Promise.all(B.map(ze))).filter(
|
|
1669
|
+
(ye) => !!ye
|
|
1671
1670
|
)
|
|
1672
1671
|
);
|
|
1673
1672
|
le(
|
|
1674
|
-
|
|
1673
|
+
O.replace(
|
|
1675
1674
|
/(\/api\/projects\/[^/]+\/files\/)([\w-]+)/g,
|
|
1676
|
-
(
|
|
1675
|
+
(ye, at, ht) => te.has(ht) ? at + te.get(ht) : ye
|
|
1677
1676
|
)
|
|
1678
1677
|
);
|
|
1679
|
-
} else le(
|
|
1678
|
+
} else le(O);
|
|
1680
1679
|
await ie;
|
|
1681
1680
|
} finally {
|
|
1682
|
-
|
|
1681
|
+
De((B) => B - 1);
|
|
1683
1682
|
}
|
|
1684
1683
|
};
|
|
1685
|
-
|
|
1686
|
-
!p ||
|
|
1684
|
+
W(() => {
|
|
1685
|
+
!p || Kt.current === p.key || (Kt.current = p.key, wt(!0), g?.(), po(p));
|
|
1687
1686
|
}, [p?.key]);
|
|
1688
|
-
const
|
|
1687
|
+
const go = $r({
|
|
1689
1688
|
projectName: f,
|
|
1690
|
-
onSuccess:
|
|
1691
|
-
onProgress:
|
|
1689
|
+
onSuccess: nt,
|
|
1690
|
+
onProgress: ot,
|
|
1692
1691
|
// seed progress so the card switches to uploading before the export finishes
|
|
1693
|
-
onStart: (d) =>
|
|
1692
|
+
onStart: (d) => ot({ loaded: 1, total: 100 }, { name: d.name, type: "image/png" }),
|
|
1694
1693
|
onError: (d) => gt(d.name)
|
|
1695
|
-
}),
|
|
1694
|
+
}), ho = be.length > 0 || Oe > 0, xt = xe || ho, kt = async () => {
|
|
1696
1695
|
if (!xt)
|
|
1697
1696
|
try {
|
|
1698
|
-
|
|
1699
|
-
let d = [],
|
|
1697
|
+
he(!0);
|
|
1698
|
+
let d = [], k = Ne, O = [];
|
|
1700
1699
|
if (fe.length) {
|
|
1701
|
-
|
|
1702
|
-
const { files:
|
|
1703
|
-
d =
|
|
1700
|
+
Re(fe.map((te) => te.id));
|
|
1701
|
+
const { files: me, metadata: ie } = await go(fe);
|
|
1702
|
+
d = me, k = [...k, ...ie], O = ie.map((te) => te.id), Re(O);
|
|
1704
1703
|
}
|
|
1705
|
-
const { annotations:
|
|
1704
|
+
const { annotations: V = [] } = a || {}, z = k.length ? [...V, ...k] : void 0, ce = Sr(tt.current?.getMarkdown() ?? j), le = H.filter((me) => !me.isInline || fn(me.id, ce)), ze = [...le, ...d], B = {
|
|
1706
1705
|
...a,
|
|
1707
1706
|
annotations: z,
|
|
1708
1707
|
// could be undefined
|
|
1709
|
-
category: E ? null :
|
|
1708
|
+
category: E ? null : _e,
|
|
1710
1709
|
// guests cannot set category (it is done by default on backend)
|
|
1711
1710
|
// one frame link per comment, stored as metadata rather than in the text
|
|
1712
|
-
startFrame:
|
|
1713
|
-
endFrame:
|
|
1711
|
+
startFrame: q?.startFrame ?? void 0,
|
|
1712
|
+
endFrame: q?.endFrame ?? void 0
|
|
1714
1713
|
};
|
|
1715
|
-
if ((ce ||
|
|
1716
|
-
const
|
|
1717
|
-
de(""),
|
|
1714
|
+
if ((ce || ze.length) && l) {
|
|
1715
|
+
const me = j;
|
|
1716
|
+
de(""), ee([]);
|
|
1718
1717
|
try {
|
|
1719
|
-
await
|
|
1718
|
+
await l(ce, ze, B), O.forEach((ie) => He?.(ie)), u && $?.setEditPreview(null), Ie([]), !u && q && $?.unlink(), u || Ee(null);
|
|
1720
1719
|
} catch {
|
|
1721
|
-
de(
|
|
1720
|
+
de(me), ee(le), Ie(Ne);
|
|
1722
1721
|
return;
|
|
1723
1722
|
}
|
|
1724
1723
|
}
|
|
1725
1724
|
} catch (d) {
|
|
1726
|
-
console.error(d),
|
|
1725
|
+
console.error(d), Ce.error("Something went wrong");
|
|
1727
1726
|
} finally {
|
|
1728
|
-
|
|
1727
|
+
Re([]), he(!1);
|
|
1729
1728
|
}
|
|
1730
|
-
},
|
|
1731
|
-
...fe.filter((d) => !
|
|
1732
|
-
...(
|
|
1733
|
-
...
|
|
1734
|
-
].sort((d,
|
|
1729
|
+
}, Xt = [
|
|
1730
|
+
...fe.filter((d) => !Ze.includes(d.id)),
|
|
1731
|
+
...(H || []).filter((d) => !d.isAnnotationLayer && !d.isInline),
|
|
1732
|
+
...be
|
|
1733
|
+
].sort((d, k) => d.order - k.order), fo = Xt.length > 3, Zt = (d) => h ? E ? "You do not have permission to comment." : "Commenting is disabled across multiple projects." : E || !d ? "Leave a comment" : "Comment, or type / to add mentions, checklists, code and more...", en = async (d) => {
|
|
1735
1734
|
if (m)
|
|
1736
1735
|
try {
|
|
1737
|
-
(pt ||
|
|
1738
|
-
} catch (
|
|
1739
|
-
console.error(
|
|
1736
|
+
(pt || H.length > 0 || fe.length > 0) && await kt(), m(d);
|
|
1737
|
+
} catch (k) {
|
|
1738
|
+
console.error(k), Ce.error("Something went wrong while submitting the review");
|
|
1740
1739
|
}
|
|
1741
|
-
},
|
|
1742
|
-
/* @__PURE__ */
|
|
1743
|
-
|
|
1740
|
+
}, yo = s && m && !h && /* @__PURE__ */ x(Vo, { className: ne("version-review-buttons", { guest: E }), children: [
|
|
1741
|
+
/* @__PURE__ */ c(
|
|
1742
|
+
an,
|
|
1744
1743
|
{
|
|
1745
1744
|
icon: "check",
|
|
1746
1745
|
variant: "tertiary",
|
|
1747
1746
|
"data-tooltip": "Approve",
|
|
1748
|
-
onClick: () =>
|
|
1749
|
-
children: /* @__PURE__ */
|
|
1747
|
+
onClick: () => en(Se.APPROVE),
|
|
1748
|
+
children: /* @__PURE__ */ c("span", { className: "label", children: "Approve" })
|
|
1750
1749
|
}
|
|
1751
1750
|
),
|
|
1752
|
-
/* @__PURE__ */
|
|
1753
|
-
|
|
1751
|
+
/* @__PURE__ */ c(
|
|
1752
|
+
an,
|
|
1754
1753
|
{
|
|
1755
1754
|
icon: "refresh",
|
|
1756
1755
|
variant: "danger",
|
|
1757
1756
|
"data-tooltip": "Request changes",
|
|
1758
|
-
onClick: () =>
|
|
1759
|
-
children: /* @__PURE__ */
|
|
1757
|
+
onClick: () => en(Se.REQUEST_CHANGES),
|
|
1758
|
+
children: /* @__PURE__ */ c("span", { className: "label", children: "Request changes" })
|
|
1760
1759
|
}
|
|
1761
1760
|
)
|
|
1762
|
-
] }), At = !E && /* @__PURE__ */
|
|
1763
|
-
|
|
1761
|
+
] }), At = !E && /* @__PURE__ */ c(
|
|
1762
|
+
Yr,
|
|
1764
1763
|
{
|
|
1765
|
-
value:
|
|
1766
|
-
categories:
|
|
1767
|
-
onChange: (d) =>
|
|
1764
|
+
value: _e,
|
|
1765
|
+
categories: Ut,
|
|
1766
|
+
onChange: (d) => mt(d),
|
|
1768
1767
|
isCompact: u,
|
|
1769
|
-
hasPowerpack:
|
|
1770
|
-
onPowerFeature:
|
|
1771
|
-
isHidden:
|
|
1768
|
+
hasPowerpack: X,
|
|
1769
|
+
onPowerFeature: Q,
|
|
1770
|
+
isHidden: Jr(Ut, { isGuest: E, isAdmin: oe })
|
|
1772
1771
|
}
|
|
1773
|
-
),
|
|
1774
|
-
/* @__PURE__ */
|
|
1775
|
-
|
|
1772
|
+
), vo = /* @__PURE__ */ x(Te, { children: [
|
|
1773
|
+
/* @__PURE__ */ c(
|
|
1774
|
+
st,
|
|
1776
1775
|
{
|
|
1777
1776
|
icon: "attach_file",
|
|
1778
1777
|
variant: "text",
|
|
1779
1778
|
className: "md-toolbar-button",
|
|
1780
1779
|
"data-tooltip": "Attach files",
|
|
1781
1780
|
onMouseDown: (d) => d.preventDefault(),
|
|
1782
|
-
onClick: () =>
|
|
1781
|
+
onClick: () => Gt.current?.click()
|
|
1783
1782
|
}
|
|
1784
1783
|
),
|
|
1785
|
-
/* @__PURE__ */
|
|
1784
|
+
/* @__PURE__ */ c(
|
|
1786
1785
|
"input",
|
|
1787
1786
|
{
|
|
1788
|
-
ref:
|
|
1787
|
+
ref: Gt,
|
|
1789
1788
|
type: "file",
|
|
1790
1789
|
multiple: !0,
|
|
1791
1790
|
hidden: !0,
|
|
1792
1791
|
onChange: (d) => {
|
|
1793
|
-
|
|
1792
|
+
Jt(Array.from(d.target.files || [])), d.target.value = "";
|
|
1794
1793
|
}
|
|
1795
1794
|
}
|
|
1796
1795
|
)
|
|
1797
|
-
] }),
|
|
1798
|
-
return /* @__PURE__ */
|
|
1799
|
-
|
|
1796
|
+
] }), bo = u || io, wo = `calc(${Math.max((ke ? K || "Frame or range" : v || "").length, 1) + 2}ch + 16px)`;
|
|
1797
|
+
return /* @__PURE__ */ c(Te, { children: /* @__PURE__ */ x(
|
|
1798
|
+
jo,
|
|
1800
1799
|
{
|
|
1801
|
-
ref:
|
|
1802
|
-
className:
|
|
1803
|
-
onDragOver:
|
|
1804
|
-
onDragLeave: () =>
|
|
1805
|
-
onDrop:
|
|
1806
|
-
onClick: () =>
|
|
1800
|
+
ref: Ht,
|
|
1801
|
+
className: ne("comment-container", "md-mention-anchor", { isOpen: y, isEditing: u }),
|
|
1802
|
+
onDragOver: mo,
|
|
1803
|
+
onDragLeave: () => ue(!1),
|
|
1804
|
+
onDrop: uo,
|
|
1805
|
+
onClick: () => ue(!1),
|
|
1807
1806
|
onKeyDown: (d) => {
|
|
1808
|
-
const
|
|
1809
|
-
|
|
1807
|
+
const k = d.key === "ArrowUp" || d.key === "ArrowDown", O = d.target.isContentEditable;
|
|
1808
|
+
k && O && no && !u || d.stopPropagation();
|
|
1810
1809
|
},
|
|
1811
1810
|
children: [
|
|
1812
|
-
s && i && /* @__PURE__ */
|
|
1813
|
-
/* @__PURE__ */
|
|
1814
|
-
|
|
1811
|
+
s && i && /* @__PURE__ */ c(ai, { lastOwnVersionReview: i }),
|
|
1812
|
+
/* @__PURE__ */ x(
|
|
1813
|
+
Uo,
|
|
1815
1814
|
{
|
|
1816
|
-
className:
|
|
1815
|
+
className: ne("block-shortcuts", {
|
|
1817
1816
|
isOpen: y,
|
|
1818
1817
|
isClosed: !y || h,
|
|
1819
1818
|
isEditing: u,
|
|
1820
|
-
isDropping:
|
|
1819
|
+
isDropping: Ge,
|
|
1821
1820
|
disabled: h,
|
|
1822
|
-
isLoading:
|
|
1823
|
-
isSubmitting:
|
|
1824
|
-
category: !!
|
|
1821
|
+
isLoading: b,
|
|
1822
|
+
isSubmitting: xe,
|
|
1823
|
+
category: !!_e && !E
|
|
1825
1824
|
}),
|
|
1826
|
-
onClick:
|
|
1827
|
-
$categoryPrimary:
|
|
1828
|
-
$categoryTertiary:
|
|
1829
|
-
$categorySecondary:
|
|
1825
|
+
onClick: so,
|
|
1826
|
+
$categoryPrimary: zt?.color,
|
|
1827
|
+
$categoryTertiary: Bt.primary,
|
|
1828
|
+
$categorySecondary: Bt.secondary,
|
|
1830
1829
|
children: [
|
|
1831
|
-
y && /* @__PURE__ */
|
|
1832
|
-
|
|
1830
|
+
y && /* @__PURE__ */ c(
|
|
1831
|
+
_n,
|
|
1833
1832
|
{
|
|
1834
|
-
files:
|
|
1835
|
-
isCompact:
|
|
1836
|
-
onRemove:
|
|
1833
|
+
files: Xt,
|
|
1834
|
+
isCompact: fo || u,
|
|
1835
|
+
onRemove: co,
|
|
1837
1836
|
projectName: f,
|
|
1838
|
-
onAnnotationClick:
|
|
1837
|
+
onAnnotationClick: qe,
|
|
1839
1838
|
style: {
|
|
1840
1839
|
borderBottom: "1px solid var(--md-sys-color-outline-variant)",
|
|
1841
1840
|
height: "100%"
|
|
@@ -1851,131 +1850,131 @@ ${Z}` : Z), nt.current?.focus();
|
|
|
1851
1850
|
}
|
|
1852
1851
|
}
|
|
1853
1852
|
),
|
|
1854
|
-
y && !h ? /* @__PURE__ */
|
|
1855
|
-
u && At && /* @__PURE__ */
|
|
1856
|
-
/* @__PURE__ */
|
|
1857
|
-
|
|
1853
|
+
y && !h ? /* @__PURE__ */ x(Te, { children: [
|
|
1854
|
+
u && At && /* @__PURE__ */ c(zo, { children: At }),
|
|
1855
|
+
/* @__PURE__ */ c(
|
|
1856
|
+
Bo,
|
|
1858
1857
|
{
|
|
1859
|
-
ref:
|
|
1858
|
+
ref: tt,
|
|
1860
1859
|
className: "comment-editor",
|
|
1861
|
-
value:
|
|
1860
|
+
value: j,
|
|
1862
1861
|
onChange: de,
|
|
1863
|
-
placeholder:
|
|
1864
|
-
mentions:
|
|
1862
|
+
placeholder: Zt(!0),
|
|
1863
|
+
mentions: oo,
|
|
1865
1864
|
mentionPlacement: u ? "inline" : "top",
|
|
1866
|
-
onMentionClick:
|
|
1867
|
-
onMentionHover:
|
|
1865
|
+
onMentionClick: ao,
|
|
1866
|
+
onMentionHover: ro,
|
|
1868
1867
|
onSubmit: kt,
|
|
1869
|
-
onEscape:
|
|
1870
|
-
onFiles:
|
|
1871
|
-
onUploadMedia:
|
|
1872
|
-
commands:
|
|
1868
|
+
onEscape: Yt,
|
|
1869
|
+
onFiles: Jt,
|
|
1870
|
+
onUploadMedia: lo,
|
|
1871
|
+
commands: ut,
|
|
1873
1872
|
toolbar: !u,
|
|
1874
1873
|
floatingToolbar: u,
|
|
1875
1874
|
toolbarStart: At,
|
|
1876
|
-
toolbarEnd: /* @__PURE__ */
|
|
1877
|
-
/* @__PURE__ */
|
|
1878
|
-
|
|
1875
|
+
toolbarEnd: /* @__PURE__ */ x(Te, { children: [
|
|
1876
|
+
/* @__PURE__ */ c(Go, {}),
|
|
1877
|
+
vo
|
|
1879
1878
|
] }),
|
|
1880
1879
|
bordered: !1,
|
|
1881
|
-
autoFocus:
|
|
1880
|
+
autoFocus: bo,
|
|
1882
1881
|
minHeight: u ? 40 : 88,
|
|
1883
1882
|
maxHeight: 259
|
|
1884
1883
|
}
|
|
1885
1884
|
)
|
|
1886
|
-
] }) : /* @__PURE__ */
|
|
1887
|
-
/* @__PURE__ */
|
|
1888
|
-
(!E ||
|
|
1889
|
-
!E &&
|
|
1890
|
-
|
|
1885
|
+
] }) : /* @__PURE__ */ c(Ho, { children: Zt() }),
|
|
1886
|
+
/* @__PURE__ */ x(qo, { children: [
|
|
1887
|
+
(!E || Pe) && /* @__PURE__ */ x(Wo, { children: [
|
|
1888
|
+
!E && ii.map(({ trigger: d, icon: k, tooltip: O }) => /* @__PURE__ */ c(
|
|
1889
|
+
st,
|
|
1891
1890
|
{
|
|
1892
|
-
icon:
|
|
1891
|
+
icon: k,
|
|
1893
1892
|
variant: "text",
|
|
1894
|
-
onMouseDown: (
|
|
1895
|
-
onClick: () =>
|
|
1896
|
-
"data-tooltip":
|
|
1893
|
+
onMouseDown: (V) => V.preventDefault(),
|
|
1894
|
+
onClick: () => tt.current?.insertMentionTrigger(d),
|
|
1895
|
+
"data-tooltip": O,
|
|
1897
1896
|
"data-shortcut": d
|
|
1898
1897
|
},
|
|
1899
1898
|
d
|
|
1900
1899
|
)),
|
|
1901
|
-
|
|
1902
|
-
|
|
1900
|
+
Pe && /* @__PURE__ */ x(
|
|
1901
|
+
Qo,
|
|
1903
1902
|
{
|
|
1904
|
-
className:
|
|
1903
|
+
className: ne("frame-link", { selected: !!q || ke }),
|
|
1905
1904
|
children: [
|
|
1906
|
-
/* @__PURE__ */
|
|
1907
|
-
|
|
1905
|
+
/* @__PURE__ */ c(
|
|
1906
|
+
Yo,
|
|
1908
1907
|
{
|
|
1909
1908
|
icon: "timer",
|
|
1910
1909
|
variant: "text",
|
|
1911
|
-
onClick:
|
|
1912
|
-
"aria-label":
|
|
1913
|
-
"data-tooltip":
|
|
1910
|
+
onClick: bt,
|
|
1911
|
+
"aria-label": q ? "Remove frame link" : "Add frame link",
|
|
1912
|
+
"data-tooltip": q ? "Remove frame link" : u ? "Add frame link" : "Link to current frame",
|
|
1914
1913
|
"data-testid": "comment-frame-link"
|
|
1915
1914
|
}
|
|
1916
1915
|
),
|
|
1917
|
-
(
|
|
1918
|
-
|
|
1916
|
+
(q || ke) && (ke ? /* @__PURE__ */ c(
|
|
1917
|
+
Jo,
|
|
1919
1918
|
{
|
|
1920
1919
|
autoFocus: !0,
|
|
1921
1920
|
"aria-label": "Linked frame or range",
|
|
1922
|
-
value:
|
|
1921
|
+
value: K,
|
|
1923
1922
|
placeholder: "Frame",
|
|
1924
1923
|
onFocus: (d) => {
|
|
1925
|
-
|
|
1924
|
+
Fe.current = q, d.currentTarget.select();
|
|
1926
1925
|
},
|
|
1927
|
-
onChange: (d) =>
|
|
1928
|
-
onBlur:
|
|
1929
|
-
style: { width:
|
|
1926
|
+
onChange: (d) => jt(d.target.value),
|
|
1927
|
+
onBlur: dt,
|
|
1928
|
+
style: { width: wo },
|
|
1930
1929
|
onKeyDown: (d) => {
|
|
1931
|
-
d.key === "Enter" && (d.preventDefault(), d.currentTarget.blur()), d.key === "Escape" && (
|
|
1930
|
+
d.key === "Enter" && (d.preventDefault(), d.currentTarget.blur()), d.key === "Escape" && (Ae.current = !0, d.currentTarget.blur());
|
|
1932
1931
|
},
|
|
1933
1932
|
"data-testid": "comment-frame-link-input"
|
|
1934
1933
|
}
|
|
1935
|
-
) : /* @__PURE__ */
|
|
1936
|
-
|
|
1934
|
+
) : /* @__PURE__ */ c(
|
|
1935
|
+
Ko,
|
|
1937
1936
|
{
|
|
1938
1937
|
variant: "text",
|
|
1939
|
-
"aria-label": `Edit linked frame ${
|
|
1940
|
-
onClick: () =>
|
|
1938
|
+
"aria-label": `Edit linked frame ${v ?? ""}`,
|
|
1939
|
+
onClick: () => Me(!0),
|
|
1941
1940
|
"data-tooltip": "Edit linked frame or range",
|
|
1942
|
-
children:
|
|
1941
|
+
children: v || "Frame or range"
|
|
1943
1942
|
}
|
|
1944
1943
|
))
|
|
1945
1944
|
]
|
|
1946
1945
|
}
|
|
1947
1946
|
)
|
|
1948
1947
|
] }),
|
|
1949
|
-
/* @__PURE__ */
|
|
1950
|
-
u && /* @__PURE__ */
|
|
1951
|
-
/* @__PURE__ */
|
|
1952
|
-
|
|
1948
|
+
/* @__PURE__ */ x(Xo, { children: [
|
|
1949
|
+
u && /* @__PURE__ */ c(st, { variant: "text", onClick: Yt, children: "Cancel" }),
|
|
1950
|
+
/* @__PURE__ */ c(
|
|
1951
|
+
Po,
|
|
1953
1952
|
{
|
|
1954
1953
|
label: u ? "Save" : "Comment",
|
|
1955
1954
|
className: "comment",
|
|
1956
|
-
active: pt || !!
|
|
1955
|
+
active: pt || !!H.length,
|
|
1957
1956
|
onClick: kt,
|
|
1958
|
-
disabled:
|
|
1957
|
+
disabled: b || xt,
|
|
1959
1958
|
saving: xt
|
|
1960
1959
|
}
|
|
1961
1960
|
)
|
|
1962
1961
|
] })
|
|
1963
1962
|
] }),
|
|
1964
|
-
/* @__PURE__ */
|
|
1963
|
+
/* @__PURE__ */ c(Zo, { className: ne({ show: Ge && y }), children: /* @__PURE__ */ c(se, { icon: "cloud_upload" }) })
|
|
1965
1964
|
]
|
|
1966
1965
|
}
|
|
1967
1966
|
),
|
|
1968
|
-
/* @__PURE__ */
|
|
1969
|
-
|
|
1967
|
+
/* @__PURE__ */ c(ea, {}),
|
|
1968
|
+
yo
|
|
1970
1969
|
]
|
|
1971
1970
|
}
|
|
1972
1971
|
) });
|
|
1973
|
-
},
|
|
1972
|
+
}, si = (e, t, o) => e && Ot`
|
|
1974
1973
|
--reaction-border-color: ${e};
|
|
1975
1974
|
--reaction-active-bg: ${t};
|
|
1976
1975
|
--reaction-hover-bg: ${t};
|
|
1977
1976
|
--reaction-active-border: ${e};
|
|
1978
|
-
`,
|
|
1977
|
+
`, ci = F.div`
|
|
1979
1978
|
/* VARS */
|
|
1980
1979
|
--reaction-border-color: var(--md-sys-color-outline-variant);
|
|
1981
1980
|
--reaction-hover-bg: var(--md-sys-color-surface-container-high-hover);
|
|
@@ -1988,7 +1987,7 @@ ${Z}` : Z), nt.current?.focus();
|
|
|
1988
1987
|
--reaction-compact-active-hover-bg: var(--md-sys-color-primary-container-hover);
|
|
1989
1988
|
|
|
1990
1989
|
/* CATEGORY */
|
|
1991
|
-
${({ $categoryPrimary: e, $categorySecondary: t, $categoryTertiary: o }) =>
|
|
1990
|
+
${({ $categoryPrimary: e, $categorySecondary: t, $categoryTertiary: o }) => si(e, t)}
|
|
1992
1991
|
|
|
1993
1992
|
display: flex;
|
|
1994
1993
|
justify-content: center;
|
|
@@ -2039,23 +2038,23 @@ ${Z}` : Z), nt.current?.focus();
|
|
|
2039
2038
|
position: relative;
|
|
2040
2039
|
height: 19px;
|
|
2041
2040
|
}
|
|
2042
|
-
`,
|
|
2041
|
+
`, li = F.div`
|
|
2043
2042
|
outline: 'solid 1px red';
|
|
2044
2043
|
display: flex;
|
|
2045
2044
|
gap: 8px;
|
|
2046
|
-
`,
|
|
2045
|
+
`, di = F.div`
|
|
2047
2046
|
position: fixed;
|
|
2048
2047
|
top: 0;
|
|
2049
2048
|
bottom: 0;
|
|
2050
2049
|
left: 0;
|
|
2051
2050
|
right: 0;
|
|
2052
2051
|
z-index: 55;
|
|
2053
|
-
`,
|
|
2052
|
+
`, ui = F.div`
|
|
2054
2053
|
/* VARS */
|
|
2055
2054
|
--panel-bg: var(--md-sys-color-surface-container-high);
|
|
2056
2055
|
|
|
2057
2056
|
/* CATEGORY */
|
|
2058
|
-
${({ $categoryPrimary: e, $categorySecondary: t }) => t &&
|
|
2057
|
+
${({ $categoryPrimary: e, $categorySecondary: t }) => t && Ot`
|
|
2059
2058
|
--panel-bg: ${t};
|
|
2060
2059
|
`}
|
|
2061
2060
|
|
|
@@ -2071,14 +2070,14 @@ ${Z}` : Z), nt.current?.focus();
|
|
|
2071
2070
|
padding: 4px;
|
|
2072
2071
|
border-radius: 4px;
|
|
2073
2072
|
box-shadow: 0px 0px 6px 2px rgba(0, 0, 0, 0.15);
|
|
2074
|
-
`,
|
|
2073
|
+
`, mi = F.div`
|
|
2075
2074
|
/* VARS */
|
|
2076
2075
|
--opener-bg: var(--md-sys-color-surface-container-high);
|
|
2077
2076
|
--opener-hover-bg: var(--md-sys-color-surface-container-high-hover);
|
|
2078
2077
|
--opener-color: var(--md-sys-color-outline);
|
|
2079
2078
|
|
|
2080
2079
|
/* CATEGORY */
|
|
2081
|
-
${({ $categoryPrimary: e, $categorySecondary: t }) => t &&
|
|
2080
|
+
${({ $categoryPrimary: e, $categorySecondary: t }) => t && Ot`
|
|
2082
2081
|
--opener-bg: ${t};
|
|
2083
2082
|
--opener-hover-bg: ${t};
|
|
2084
2083
|
--opener-color: ${e};
|
|
@@ -2101,31 +2100,31 @@ ${Z}` : Z), nt.current?.focus();
|
|
|
2101
2100
|
filter: ${({ $categoryPrimary: e }) => e ? "brightness(1.2)" : "none"};
|
|
2102
2101
|
}
|
|
2103
2102
|
}
|
|
2104
|
-
`,
|
|
2103
|
+
`, pi = F.div`
|
|
2105
2104
|
display: flex;
|
|
2106
2105
|
gap: 8px;
|
|
2107
2106
|
position: relative;
|
|
2108
|
-
`,
|
|
2107
|
+
`, gi = [
|
|
2109
2108
|
{ key: "thumb_up", value: "👍" },
|
|
2110
2109
|
{ key: "thumb_down", value: "👎" },
|
|
2111
2110
|
{ key: "heart_plus", value: "❤" },
|
|
2112
2111
|
{ key: "celebration", value: "🎉" },
|
|
2113
2112
|
{ key: "notes", value: "📝" }
|
|
2114
|
-
],
|
|
2113
|
+
], hi = {
|
|
2115
2114
|
thumb_up: "👍",
|
|
2116
2115
|
thumb_down: "👎",
|
|
2117
2116
|
heart_plus: "❤️",
|
|
2118
2117
|
celebration: "🎉",
|
|
2119
2118
|
notes: "📝"
|
|
2120
|
-
},
|
|
2119
|
+
}, Mt = [
|
|
2121
2120
|
"thumb_up",
|
|
2122
2121
|
"thumb_down",
|
|
2123
2122
|
"heart_plus",
|
|
2124
2123
|
"celebration",
|
|
2125
2124
|
"notes"
|
|
2126
|
-
],
|
|
2127
|
-
(o, n) =>
|
|
2128
|
-
),
|
|
2125
|
+
], fi = (e) => [...e].sort(
|
|
2126
|
+
(o, n) => Mt.indexOf(o.type) - Mt.indexOf(n.type)
|
|
2127
|
+
), qn = ({
|
|
2129
2128
|
reaction: e,
|
|
2130
2129
|
variant: t = "standard",
|
|
2131
2130
|
onClick: o,
|
|
@@ -2134,29 +2133,29 @@ ${Z}` : Z), nt.current?.focus();
|
|
|
2134
2133
|
categoryTertiary: r
|
|
2135
2134
|
}) => {
|
|
2136
2135
|
const s = e.users?.join(", ") || void 0;
|
|
2137
|
-
return /* @__PURE__ */
|
|
2138
|
-
|
|
2136
|
+
return /* @__PURE__ */ x(
|
|
2137
|
+
ci,
|
|
2139
2138
|
{
|
|
2140
|
-
className:
|
|
2139
|
+
className: ne(t, { active: e.isActive }),
|
|
2141
2140
|
onClick: o,
|
|
2142
2141
|
"data-tooltip": s,
|
|
2143
2142
|
$categoryPrimary: n,
|
|
2144
2143
|
$categorySecondary: a,
|
|
2145
2144
|
$categoryTertiary: r,
|
|
2146
2145
|
children: [
|
|
2147
|
-
/* @__PURE__ */
|
|
2148
|
-
e.users && /* @__PURE__ */
|
|
2146
|
+
/* @__PURE__ */ c("span", { className: "emoji", children: hi[e.type] }),
|
|
2147
|
+
e.users && /* @__PURE__ */ c("span", { children: e.users.length })
|
|
2149
2148
|
]
|
|
2150
2149
|
}
|
|
2151
2150
|
);
|
|
2152
|
-
},
|
|
2151
|
+
}, yi = ({
|
|
2153
2152
|
reactions: e,
|
|
2154
2153
|
changeHandler: t,
|
|
2155
2154
|
categoryPrimary: o,
|
|
2156
2155
|
categorySecondary: n,
|
|
2157
2156
|
categoryTertiary: a
|
|
2158
|
-
}) => /* @__PURE__ */
|
|
2159
|
-
|
|
2157
|
+
}) => /* @__PURE__ */ c(li, { children: e.map((r) => /* @__PURE__ */ c(
|
|
2158
|
+
qn,
|
|
2160
2159
|
{
|
|
2161
2160
|
reaction: r,
|
|
2162
2161
|
isActive: r.isActive,
|
|
@@ -2168,22 +2167,22 @@ ${Z}` : Z), nt.current?.focus();
|
|
|
2168
2167
|
categoryTertiary: a
|
|
2169
2168
|
},
|
|
2170
2169
|
r.type
|
|
2171
|
-
)) }),
|
|
2170
|
+
)) }), vi = ({
|
|
2172
2171
|
reactions: e,
|
|
2173
2172
|
changeHandler: t,
|
|
2174
2173
|
categoryPrimary: o,
|
|
2175
2174
|
categorySecondary: n,
|
|
2176
2175
|
categoryTertiary: a
|
|
2177
2176
|
}) => {
|
|
2178
|
-
const [r, s] = L(!1), i = e.filter((
|
|
2179
|
-
return /* @__PURE__ */
|
|
2180
|
-
|
|
2177
|
+
const [r, s] = L(!1), i = e.filter((l) => l.isActive).map((l) => l.type);
|
|
2178
|
+
return /* @__PURE__ */ x(
|
|
2179
|
+
mi,
|
|
2181
2180
|
{
|
|
2182
2181
|
$categoryPrimary: o,
|
|
2183
2182
|
$categorySecondary: n,
|
|
2184
2183
|
$categoryTertiary: a,
|
|
2185
2184
|
children: [
|
|
2186
|
-
/* @__PURE__ */
|
|
2185
|
+
/* @__PURE__ */ c(
|
|
2187
2186
|
se,
|
|
2188
2187
|
{
|
|
2189
2188
|
icon: "add_reaction",
|
|
@@ -2191,21 +2190,21 @@ ${Z}` : Z), nt.current?.focus();
|
|
|
2191
2190
|
onClick: () => s(!r)
|
|
2192
2191
|
}
|
|
2193
2192
|
),
|
|
2194
|
-
r && /* @__PURE__ */
|
|
2195
|
-
/* @__PURE__ */
|
|
2196
|
-
/* @__PURE__ */
|
|
2197
|
-
|
|
2193
|
+
r && /* @__PURE__ */ x(Te, { children: [
|
|
2194
|
+
/* @__PURE__ */ c(di, { onClick: () => s(!1) }),
|
|
2195
|
+
/* @__PURE__ */ c(
|
|
2196
|
+
ui,
|
|
2198
2197
|
{
|
|
2199
2198
|
$categoryPrimary: o,
|
|
2200
2199
|
$categorySecondary: n,
|
|
2201
2200
|
$categoryTertiary: a,
|
|
2202
|
-
children:
|
|
2201
|
+
children: gi.map((l) => {
|
|
2203
2202
|
const m = {
|
|
2204
|
-
type:
|
|
2205
|
-
isActive: i.includes(
|
|
2203
|
+
type: l.key,
|
|
2204
|
+
isActive: i.includes(l.key)
|
|
2206
2205
|
};
|
|
2207
|
-
return /* @__PURE__ */
|
|
2208
|
-
|
|
2206
|
+
return /* @__PURE__ */ c(
|
|
2207
|
+
qn,
|
|
2209
2208
|
{
|
|
2210
2209
|
reaction: m,
|
|
2211
2210
|
variant: "compact",
|
|
@@ -2225,7 +2224,7 @@ ${Z}` : Z), nt.current?.focus();
|
|
|
2225
2224
|
]
|
|
2226
2225
|
}
|
|
2227
2226
|
);
|
|
2228
|
-
},
|
|
2227
|
+
}, bi = ({
|
|
2229
2228
|
reactions: e,
|
|
2230
2229
|
changeHandler: t,
|
|
2231
2230
|
readOnly: o,
|
|
@@ -2235,27 +2234,27 @@ ${Z}` : Z), nt.current?.focus();
|
|
|
2235
2234
|
categoryTertiary: s
|
|
2236
2235
|
}) => {
|
|
2237
2236
|
const i = n ? { categoryPrimary: a, categorySecondary: r, categoryTertiary: s } : {};
|
|
2238
|
-
return /* @__PURE__ */
|
|
2239
|
-
!o && /* @__PURE__ */
|
|
2240
|
-
|
|
2237
|
+
return /* @__PURE__ */ x(pi, { children: [
|
|
2238
|
+
!o && /* @__PURE__ */ c(
|
|
2239
|
+
vi,
|
|
2241
2240
|
{
|
|
2242
2241
|
reactions: e,
|
|
2243
2242
|
changeHandler: t,
|
|
2244
2243
|
...i
|
|
2245
2244
|
}
|
|
2246
2245
|
),
|
|
2247
|
-
/* @__PURE__ */
|
|
2246
|
+
/* @__PURE__ */ c(yi, { reactions: e, changeHandler: t, ...i })
|
|
2248
2247
|
] });
|
|
2249
|
-
},
|
|
2248
|
+
}, wi = (e = "") => (e.match(/\((.*?)\)/g) || []).flatMap((o) => {
|
|
2250
2249
|
if (o.includes("http")) return [];
|
|
2251
2250
|
const n = o.match(/\(([^)]+)\)/), a = n ? n[1].split(":") : [];
|
|
2252
2251
|
return { type: a[0], id: a[1] };
|
|
2253
|
-
}),
|
|
2252
|
+
}), xi = (e) => e.replace(/@(?=@|\[)/g, ""), ki = {
|
|
2254
2253
|
"&": "&",
|
|
2255
2254
|
"<": "<",
|
|
2256
2255
|
">": ">",
|
|
2257
2256
|
'"': """
|
|
2258
|
-
}, Ct = (e) => e.replace(/[&<>"]/g, (t) =>
|
|
2257
|
+
}, Ct = (e) => e.replace(/[&<>"]/g, (t) => ki[t]), Ai = (e) => e.replaceAll(" ", "%20"), Fi = (e, t) => {
|
|
2259
2258
|
const o = t.cloneContents();
|
|
2260
2259
|
if (!o.querySelector("[data-mention-value]")) return null;
|
|
2261
2260
|
let n = "", a = "";
|
|
@@ -2270,11 +2269,11 @@ ${Z}` : Z), nt.current?.focus();
|
|
|
2270
2269
|
return;
|
|
2271
2270
|
}
|
|
2272
2271
|
if (s.nodeType !== Node.ELEMENT_NODE) return;
|
|
2273
|
-
const i = s,
|
|
2274
|
-
if (
|
|
2272
|
+
const i = s, l = i.getAttribute("data-mention-value");
|
|
2273
|
+
if (l) {
|
|
2275
2274
|
const m = i.getAttribute("data-mention-label") || (i.textContent || "").trim();
|
|
2276
2275
|
if (m) {
|
|
2277
|
-
const p =
|
|
2276
|
+
const p = Ai(l);
|
|
2278
2277
|
n += `[${m}](${p})`, a += `<a href="@${Ct(p)}">@${Ct(m)}</a>`;
|
|
2279
2278
|
}
|
|
2280
2279
|
return;
|
|
@@ -2293,37 +2292,37 @@ ${Z}` : Z), nt.current?.focus();
|
|
|
2293
2292
|
s.childNodes.forEach(r);
|
|
2294
2293
|
};
|
|
2295
2294
|
return r(o), n ? { text: n, html: a } : null;
|
|
2296
|
-
},
|
|
2297
|
-
const t =
|
|
2298
|
-
if (!
|
|
2295
|
+
}, Ci = ({ children: e }) => {
|
|
2296
|
+
const t = nn.Children.map(e, (n) => {
|
|
2297
|
+
if (!nn.isValidElement(n)) return n;
|
|
2299
2298
|
const a = n.props.children;
|
|
2300
2299
|
return typeof a != "string" ? n : {
|
|
2301
2300
|
...n,
|
|
2302
2301
|
props: {
|
|
2303
2302
|
...n.props,
|
|
2304
|
-
children:
|
|
2303
|
+
children: xi(a)
|
|
2305
2304
|
}
|
|
2306
2305
|
};
|
|
2307
|
-
}), o =
|
|
2306
|
+
}), o = Je((n) => {
|
|
2308
2307
|
const a = window.getSelection();
|
|
2309
2308
|
if (!a || a.rangeCount === 0 || a.isCollapsed) return;
|
|
2310
2309
|
const r = a.getRangeAt(0), s = n.currentTarget;
|
|
2311
2310
|
if (!s.contains(r.startContainer) || !s.contains(r.endContainer)) return;
|
|
2312
|
-
const i =
|
|
2311
|
+
const i = Fi(s, r);
|
|
2313
2312
|
i && (n.preventDefault(), n.clipboardData.setData("text/plain", i.text), n.clipboardData.setData("text/html", i.html));
|
|
2314
2313
|
}, []);
|
|
2315
|
-
return /* @__PURE__ */
|
|
2316
|
-
},
|
|
2314
|
+
return /* @__PURE__ */ c("div", { className: "comment-text", onCopy: o, children: t });
|
|
2315
|
+
}, Ti = (e = [], t) => {
|
|
2317
2316
|
let o = {};
|
|
2318
2317
|
return e.forEach((n) => {
|
|
2319
2318
|
const a = n.reaction;
|
|
2320
|
-
|
|
2321
|
-
}),
|
|
2322
|
-
},
|
|
2319
|
+
Mt.includes(a) && (o[a] === void 0 && (o[a] = { type: a, isActive: !1, users: [] }), t == n.userName && (o[a].isActive = !0), o[a].users?.push(n.fullName || n.userName));
|
|
2320
|
+
}), fi(Object.values(o));
|
|
2321
|
+
}, Di = F.div`
|
|
2323
2322
|
display: flex;
|
|
2324
2323
|
align-items: center;
|
|
2325
2324
|
gap: var(--base-gap-small);
|
|
2326
|
-
`,
|
|
2325
|
+
`, Ni = F.span`
|
|
2327
2326
|
border-radius: var(--border-radius-m);
|
|
2328
2327
|
padding: 2px 6px;
|
|
2329
2328
|
margin: 0 2px;
|
|
@@ -2340,19 +2339,19 @@ ${Z}` : Z), nt.current?.focus();
|
|
|
2340
2339
|
font-size: 16px;
|
|
2341
2340
|
font-variation-settings: 'FILL' 1;
|
|
2342
2341
|
}
|
|
2343
|
-
`,
|
|
2344
|
-
const n =
|
|
2345
|
-
return /* @__PURE__ */
|
|
2342
|
+
`, Ii = ({ name: e, statuses: t, children: o }) => {
|
|
2343
|
+
const n = Si(e, t);
|
|
2344
|
+
return /* @__PURE__ */ x(Di, { children: [
|
|
2346
2345
|
o,
|
|
2347
|
-
/* @__PURE__ */
|
|
2348
|
-
n.icon && /* @__PURE__ */
|
|
2346
|
+
/* @__PURE__ */ x(Ni, { $color: Lt(n.color), style: { backgroundColor: n.color }, children: [
|
|
2347
|
+
n.icon && /* @__PURE__ */ c(se, { icon: n.icon }),
|
|
2349
2348
|
e
|
|
2350
2349
|
] })
|
|
2351
2350
|
] });
|
|
2352
|
-
},
|
|
2351
|
+
}, Si = (e, t) => {
|
|
2353
2352
|
const o = { name: e, color: "var(--md-sys-color-primary)", icon: void 0 };
|
|
2354
2353
|
return t.find((n) => n.name === e) || o;
|
|
2355
|
-
},
|
|
2354
|
+
}, Ei = F.header`
|
|
2356
2355
|
display: flex;
|
|
2357
2356
|
align-items: flex-end;
|
|
2358
2357
|
gap: var(--base-gap-small);
|
|
@@ -2364,7 +2363,7 @@ ${Z}` : Z), nt.current?.focus();
|
|
|
2364
2363
|
margin-left: 4px;
|
|
2365
2364
|
font-weight: 800;
|
|
2366
2365
|
}
|
|
2367
|
-
`,
|
|
2366
|
+
`, Mi = F.div`
|
|
2368
2367
|
display: flex;
|
|
2369
2368
|
gap: var(--base-gap-small);
|
|
2370
2369
|
align-items: center;
|
|
@@ -2393,7 +2392,7 @@ const Tt = F.span`
|
|
|
2393
2392
|
strong {
|
|
2394
2393
|
font-weight: 800;
|
|
2395
2394
|
}
|
|
2396
|
-
`,
|
|
2395
|
+
`, Pi = F.li`
|
|
2397
2396
|
list-style: none;
|
|
2398
2397
|
margin: var(--padding-s) var(--padding-m);
|
|
2399
2398
|
padding: var(--padding-s) var(--padding-m) var(--padding-s) 0;
|
|
@@ -2420,7 +2419,7 @@ const Tt = F.span`
|
|
|
2420
2419
|
&.request_changes .date, {
|
|
2421
2420
|
color: var(--md-sys-color-error);
|
|
2422
2421
|
}
|
|
2423
|
-
`,
|
|
2422
|
+
`, _i = F.div`
|
|
2424
2423
|
display: flex;
|
|
2425
2424
|
flex-wrap: nowrap;
|
|
2426
2425
|
align-items: center;
|
|
@@ -2439,7 +2438,7 @@ const Tt = F.span`
|
|
|
2439
2438
|
color: var(--md-sys-color-outline);
|
|
2440
2439
|
opacity: 0.5;
|
|
2441
2440
|
}
|
|
2442
|
-
`,
|
|
2441
|
+
`, Ri = F.span`
|
|
2443
2442
|
white-space: nowrap;
|
|
2444
2443
|
font-size: 12px;
|
|
2445
2444
|
text-overflow: ellipsis;
|
|
@@ -2450,16 +2449,16 @@ const Tt = F.span`
|
|
|
2450
2449
|
font-size: 12px;
|
|
2451
2450
|
font-weight: 800;
|
|
2452
2451
|
}
|
|
2453
|
-
`,
|
|
2454
|
-
function
|
|
2455
|
-
const { categories: t } = $e(), { categoryData: o, categoryNotFound: n } =
|
|
2452
|
+
`, Li = "#c5c5c5";
|
|
2453
|
+
function Wn(e) {
|
|
2454
|
+
const { categories: t } = $e(), { categoryData: o, categoryNotFound: n } = I(() => {
|
|
2456
2455
|
let a = !1;
|
|
2457
2456
|
if (e) {
|
|
2458
2457
|
const r = t.find((s) => s.name === e);
|
|
2459
2458
|
return r || (a = !0), {
|
|
2460
2459
|
categoryData: r || {
|
|
2461
2460
|
name: e,
|
|
2462
|
-
color:
|
|
2461
|
+
color: Li
|
|
2463
2462
|
},
|
|
2464
2463
|
categoryNotFound: a
|
|
2465
2464
|
};
|
|
@@ -2471,21 +2470,21 @@ function qn(e) {
|
|
|
2471
2470
|
}, [e, t]);
|
|
2472
2471
|
return { categoryData: o, categoryNotFound: n };
|
|
2473
2472
|
}
|
|
2474
|
-
const
|
|
2475
|
-
const { authorName: o, authorFullName: n, createdAt: a, activityData: r } = t || {}, s =
|
|
2473
|
+
const $i = "anonymous.guest", Oi = "Anonymous User", Vi = "unknown.user", Qn = (e) => !e || !e.name ? Vi : e.name === $i && !e.label ? Oi : e.label ? e.label : e.name, Pt = "anonymous.guest", ji = ({ isGuest: e, activity: t }) => {
|
|
2474
|
+
const { authorName: o, authorFullName: n, createdAt: a, activityData: r } = t || {}, s = I(
|
|
2476
2475
|
() => [
|
|
2477
|
-
|
|
2478
|
-
|
|
2476
|
+
Qn({ name: o, label: n }),
|
|
2477
|
+
zn(r?.feedback ?? Se.APPROVE)
|
|
2479
2478
|
].join(" "),
|
|
2480
2479
|
[n, o, r?.feedback, a]
|
|
2481
|
-
), { categoryData: i, categoryNotFound:
|
|
2482
|
-
if (!o?.startsWith(
|
|
2480
|
+
), { categoryData: i, categoryNotFound: l } = Wn(r?.category), m = I(() => {
|
|
2481
|
+
if (!o?.startsWith(Pt))
|
|
2483
2482
|
return `/api/users/${o}/avatar`;
|
|
2484
2483
|
}, [o]);
|
|
2485
2484
|
if (r?.feedback)
|
|
2486
|
-
return /* @__PURE__ */
|
|
2487
|
-
o && /* @__PURE__ */
|
|
2488
|
-
|
|
2485
|
+
return /* @__PURE__ */ c(Pi, { className: kn(r.feedback), children: /* @__PURE__ */ x(_i, { children: [
|
|
2486
|
+
o && /* @__PURE__ */ c(
|
|
2487
|
+
Dn,
|
|
2489
2488
|
{
|
|
2490
2489
|
name: o,
|
|
2491
2490
|
fullName: n,
|
|
@@ -2493,21 +2492,21 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
2493
2492
|
size: 22
|
|
2494
2493
|
}
|
|
2495
2494
|
),
|
|
2496
|
-
/* @__PURE__ */
|
|
2497
|
-
i && !e && /* @__PURE__ */
|
|
2498
|
-
|
|
2495
|
+
/* @__PURE__ */ c(se, { icon: Bn(r.feedback) }),
|
|
2496
|
+
i && !e && /* @__PURE__ */ c(
|
|
2497
|
+
it,
|
|
2499
2498
|
{
|
|
2500
2499
|
value: i.name,
|
|
2501
2500
|
color: i.color,
|
|
2502
2501
|
isCompact: !0,
|
|
2503
|
-
"data-tooltip":
|
|
2502
|
+
"data-tooltip": l ? "Category not found. It may have been deleted." : void 0,
|
|
2504
2503
|
"data-tooltip-delay": 0
|
|
2505
2504
|
}
|
|
2506
2505
|
),
|
|
2507
|
-
/* @__PURE__ */
|
|
2508
|
-
/* @__PURE__ */
|
|
2506
|
+
/* @__PURE__ */ c(Ri, { children: s }),
|
|
2507
|
+
/* @__PURE__ */ c(lt, { date: a, exactTooltip: !0 })
|
|
2509
2508
|
] }) });
|
|
2510
|
-
},
|
|
2509
|
+
}, Yn = ({
|
|
2511
2510
|
name: e,
|
|
2512
2511
|
fullName: t,
|
|
2513
2512
|
date: o,
|
|
@@ -2516,34 +2515,34 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
2516
2515
|
children: r,
|
|
2517
2516
|
projectName: s,
|
|
2518
2517
|
entityType: i,
|
|
2519
|
-
onReferenceClick:
|
|
2518
|
+
onReferenceClick: l,
|
|
2520
2519
|
onReferenceTooltip: m
|
|
2521
2520
|
}) => {
|
|
2522
|
-
const { referenceType: p, origin: g, activityType: u, versions: h, activityId:
|
|
2523
|
-
if (!e?.startsWith(
|
|
2521
|
+
const { referenceType: p, origin: g, activityType: u, versions: h, activityId: b } = a, y = p === "mention", D = u === "version.publish", C = h && h?.length > 1 ? "published versions" : "published a version", f = y ? "mentioned" : "commented", w = y ? ` ${i} on` : "on", A = e?.startsWith("guest.") || e?.startsWith(Pt), S = (a.author?.deleted || !a.author?.active) && !A, P = I(() => {
|
|
2522
|
+
if (!e?.startsWith(Pt))
|
|
2524
2523
|
return `/api/users/${e}/avatar`;
|
|
2525
2524
|
}, [e]);
|
|
2526
|
-
return /* @__PURE__ */
|
|
2527
|
-
/* @__PURE__ */
|
|
2528
|
-
e && !
|
|
2529
|
-
|
|
2530
|
-
/* @__PURE__ */
|
|
2531
|
-
n && /* @__PURE__ */
|
|
2532
|
-
/* @__PURE__ */
|
|
2533
|
-
/* @__PURE__ */
|
|
2534
|
-
g && /* @__PURE__ */
|
|
2535
|
-
|
|
2525
|
+
return /* @__PURE__ */ x(Ei, { children: [
|
|
2526
|
+
/* @__PURE__ */ x(Mi, { children: [
|
|
2527
|
+
e && !S && /* @__PURE__ */ c(Dn, { name: e, fullName: t, src: P, size: 22 }),
|
|
2528
|
+
S && /* @__PURE__ */ c(se, { icon: "account_circle" }),
|
|
2529
|
+
/* @__PURE__ */ c("h5", { children: t || a.activityData?.author || "Unknown" }),
|
|
2530
|
+
n && /* @__PURE__ */ x(Te, { children: [
|
|
2531
|
+
/* @__PURE__ */ c(Tt, { children: /* @__PURE__ */ c("strong", { children: f }) }),
|
|
2532
|
+
/* @__PURE__ */ c(Tt, { style: { overflow: "hidden", textOverflow: "ellipsis" }, children: w }),
|
|
2533
|
+
g && /* @__PURE__ */ c(
|
|
2534
|
+
na,
|
|
2536
2535
|
{
|
|
2537
2536
|
id: g.id,
|
|
2538
2537
|
type: g.type,
|
|
2539
2538
|
variant: "text",
|
|
2540
|
-
onClick: () =>
|
|
2539
|
+
onClick: () => l?.({
|
|
2541
2540
|
entityId: g.id,
|
|
2542
2541
|
entityType: g.type,
|
|
2543
2542
|
projectName: s,
|
|
2544
|
-
activityId:
|
|
2543
|
+
activityId: b
|
|
2545
2544
|
}),
|
|
2546
|
-
onMouseEnter: (
|
|
2545
|
+
onMouseEnter: (_, E) => m?.({
|
|
2547
2546
|
type: g.type,
|
|
2548
2547
|
id: g.id,
|
|
2549
2548
|
label: g.label,
|
|
@@ -2554,13 +2553,13 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
2554
2553
|
}
|
|
2555
2554
|
)
|
|
2556
2555
|
] }),
|
|
2557
|
-
D && /* @__PURE__ */
|
|
2556
|
+
D && /* @__PURE__ */ c(Tt, { children: C }),
|
|
2558
2557
|
r
|
|
2559
2558
|
] }),
|
|
2560
|
-
/* @__PURE__ */
|
|
2559
|
+
/* @__PURE__ */ c(lt, { date: o })
|
|
2561
2560
|
] });
|
|
2562
|
-
},
|
|
2563
|
-
|
|
2561
|
+
}, Ui = ({ flags: e }) => e.length ? /* @__PURE__ */ c(oa, { children: e.map(({ id: t, label: o, icon: n, tooltip: a, onClick: r, disabled: s, testId: i }) => /* @__PURE__ */ x(
|
|
2562
|
+
aa,
|
|
2564
2563
|
{
|
|
2565
2564
|
as: r ? "button" : "span",
|
|
2566
2565
|
type: r ? "button" : void 0,
|
|
@@ -2570,12 +2569,12 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
2570
2569
|
"data-tooltip-delay": 0,
|
|
2571
2570
|
"data-testid": i,
|
|
2572
2571
|
children: [
|
|
2573
|
-
n && /* @__PURE__ */
|
|
2572
|
+
n && /* @__PURE__ */ c(se, { icon: n }),
|
|
2574
2573
|
o
|
|
2575
2574
|
]
|
|
2576
2575
|
},
|
|
2577
2576
|
t
|
|
2578
|
-
)) }) : null,
|
|
2577
|
+
)) }) : null, zi = ({
|
|
2579
2578
|
category: e,
|
|
2580
2579
|
categoryNotFound: t,
|
|
2581
2580
|
frameLink: o,
|
|
@@ -2602,7 +2601,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
2602
2601
|
testId: "comment-frame-link-chip"
|
|
2603
2602
|
}
|
|
2604
2603
|
] : []
|
|
2605
|
-
],
|
|
2604
|
+
], Bi = ({
|
|
2606
2605
|
onDelete: e,
|
|
2607
2606
|
onEdit: t,
|
|
2608
2607
|
onCopyText: o,
|
|
@@ -2612,37 +2611,37 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
2612
2611
|
projectName: s,
|
|
2613
2612
|
entity: i
|
|
2614
2613
|
}) => {
|
|
2615
|
-
const
|
|
2614
|
+
const l = [], m = (p) => () => {
|
|
2616
2615
|
a?.(), p();
|
|
2617
2616
|
};
|
|
2618
|
-
return t &&
|
|
2617
|
+
return t && l.push({
|
|
2619
2618
|
id: "edit",
|
|
2620
2619
|
label: "Edit",
|
|
2621
2620
|
icon: "edit_square",
|
|
2622
2621
|
onClick: m(t)
|
|
2623
|
-
}), o &&
|
|
2622
|
+
}), o && l.push({
|
|
2624
2623
|
id: "copy-text",
|
|
2625
2624
|
label: "Copy text",
|
|
2626
2625
|
icon: "content_copy",
|
|
2627
2626
|
onClick: m(o)
|
|
2628
|
-
}), n &&
|
|
2627
|
+
}), n && l.push({
|
|
2629
2628
|
id: "duplicate",
|
|
2630
2629
|
label: "Duplicate",
|
|
2631
2630
|
icon: "library_add",
|
|
2632
2631
|
onClick: m(n)
|
|
2633
|
-
}),
|
|
2632
|
+
}), l.push({
|
|
2634
2633
|
id: "copy-link",
|
|
2635
2634
|
label: "Copy link",
|
|
2636
2635
|
icon: "link",
|
|
2637
|
-
onClick: m(() =>
|
|
2638
|
-
}), e &&
|
|
2636
|
+
onClick: m(() => Mn(ra(s, r, i)))
|
|
2637
|
+
}), e && l.push({
|
|
2639
2638
|
id: "delete",
|
|
2640
2639
|
label: "Delete",
|
|
2641
2640
|
icon: "delete",
|
|
2642
2641
|
onClick: m(e),
|
|
2643
2642
|
danger: !0
|
|
2644
|
-
}), /* @__PURE__ */
|
|
2645
|
-
},
|
|
2643
|
+
}), /* @__PURE__ */ c(Za, { menu: l });
|
|
2644
|
+
}, Gi = ({
|
|
2646
2645
|
activity: e = {},
|
|
2647
2646
|
annotationFrameStart: t,
|
|
2648
2647
|
onCheckChange: o,
|
|
@@ -2651,277 +2650,277 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
2651
2650
|
onDuplicate: r,
|
|
2652
2651
|
projectInfo: s,
|
|
2653
2652
|
editProps: i,
|
|
2654
|
-
projectName:
|
|
2653
|
+
projectName: l,
|
|
2655
2654
|
entityType: m,
|
|
2656
2655
|
onReferenceClick: p,
|
|
2657
2656
|
onFileExpand: g,
|
|
2658
2657
|
showOrigin: u,
|
|
2659
2658
|
isHighlighted: h,
|
|
2660
|
-
readOnly:
|
|
2659
|
+
readOnly: b,
|
|
2661
2660
|
statuses: y = []
|
|
2662
2661
|
}) => {
|
|
2663
2662
|
const {
|
|
2664
2663
|
userName: D,
|
|
2665
|
-
createReaction:
|
|
2664
|
+
createReaction: M,
|
|
2666
2665
|
deleteReaction: C,
|
|
2667
2666
|
editingId: f,
|
|
2668
|
-
setEditingId:
|
|
2669
|
-
isGuest:
|
|
2670
|
-
userTeamNames:
|
|
2671
|
-
} = $e(),
|
|
2667
|
+
setEditingId: w,
|
|
2668
|
+
isGuest: A,
|
|
2669
|
+
userTeamNames: S
|
|
2670
|
+
} = $e(), P = pe(null), { toggleMenuOpen: _, menuOpen: E } = Ba(), { categoryData: N, categoryNotFound: G } = Wn(e?.activityData?.category), X = Rn(N?.color);
|
|
2672
2671
|
let {
|
|
2673
|
-
body:
|
|
2674
|
-
authorName:
|
|
2675
|
-
authorFullName:
|
|
2672
|
+
body: Q,
|
|
2673
|
+
authorName: Z,
|
|
2674
|
+
authorFullName: Y,
|
|
2676
2675
|
createdAt: $,
|
|
2677
|
-
referenceType:
|
|
2678
|
-
entityId:
|
|
2679
|
-
activityId:
|
|
2680
|
-
author:
|
|
2676
|
+
referenceType: oe,
|
|
2677
|
+
entityId: ae,
|
|
2678
|
+
activityId: J,
|
|
2679
|
+
author: j,
|
|
2681
2680
|
isOwner: de,
|
|
2682
|
-
files:
|
|
2683
|
-
origin:
|
|
2681
|
+
files: H = [],
|
|
2682
|
+
origin: ee
|
|
2684
2683
|
} = e;
|
|
2685
|
-
|
|
2686
|
-
const
|
|
2687
|
-
|
|
2688
|
-
},
|
|
2689
|
-
|
|
2690
|
-
},
|
|
2691
|
-
await a?.(
|
|
2692
|
-
}, fe = f ===
|
|
2693
|
-
document.getElementById(
|
|
2694
|
-
},
|
|
2695
|
-
const
|
|
2696
|
-
|
|
2697
|
-
},
|
|
2698
|
-
|
|
2684
|
+
Z || (Z = j?.name || ""), Y = Qn({ name: Z, label: Y });
|
|
2685
|
+
const Oe = Ao(), De = `activity-comment-menu-${J}-${Oe}`, Ve = E === De, { onGoToFrame: be, setHighlightedActivities: ge, user: Ge, commentFrameLink: ue } = Be(), xe = !!Ge?.data?.isAdmin, he = de || xe, Ne = de || xe, Ie = () => {
|
|
2686
|
+
w(J);
|
|
2687
|
+
}, Ze = () => {
|
|
2688
|
+
w(null);
|
|
2689
|
+
}, Re = async (v, K, we) => {
|
|
2690
|
+
await a?.(v, K, void 0, we), w(null);
|
|
2691
|
+
}, fe = f === J, He = ({ activityId: v, url: K }) => {
|
|
2692
|
+
document.getElementById(v) ? ge([v]) : window.open(K, "_blank", "noreferrer");
|
|
2693
|
+
}, qe = oe !== "origin" || u, re = async () => {
|
|
2694
|
+
const v = wi(Q);
|
|
2695
|
+
qe && ee && v.push({ id: ee.id, type: ee.type }), n && await n(J, ae, v);
|
|
2696
|
+
}, et = () => {
|
|
2697
|
+
cr({
|
|
2699
2698
|
title: "Delete comment",
|
|
2700
2699
|
message: "Are you sure you want to delete this comment?",
|
|
2701
2700
|
accept: async () => {
|
|
2702
2701
|
await re();
|
|
2703
2702
|
}
|
|
2704
2703
|
});
|
|
2705
|
-
}, [,
|
|
2706
|
-
() =>
|
|
2704
|
+
}, [, je] = En(), We = I(
|
|
2705
|
+
() => Ti(e.reactions, D),
|
|
2707
2706
|
[[...e.reactions || []]]
|
|
2708
|
-
),
|
|
2709
|
-
|
|
2710
|
-
projectName:
|
|
2707
|
+
), Ee = (v) => {
|
|
2708
|
+
v.isActive ? M({
|
|
2709
|
+
projectName: l,
|
|
2711
2710
|
// @ts-ignore exposed endpoint doesn't need the username, we still need to pass it for the optimistic update
|
|
2712
2711
|
userName: D,
|
|
2713
|
-
activityId:
|
|
2712
|
+
activityId: J,
|
|
2714
2713
|
createReactionModel: {
|
|
2715
|
-
reaction:
|
|
2714
|
+
reaction: v.type
|
|
2716
2715
|
}
|
|
2717
2716
|
}) : C({
|
|
2718
|
-
projectName:
|
|
2717
|
+
projectName: l,
|
|
2719
2718
|
// @ts-ignore exposed endpoint doesn't need the username, we still need to pass it for the optimistic update
|
|
2720
2719
|
userName: D,
|
|
2721
|
-
activityId:
|
|
2722
|
-
reaction:
|
|
2720
|
+
activityId: J,
|
|
2721
|
+
reaction: v.type
|
|
2723
2722
|
});
|
|
2724
|
-
},
|
|
2725
|
-
(
|
|
2726
|
-
|
|
2723
|
+
}, Ue = Je(
|
|
2724
|
+
(v) => {
|
|
2725
|
+
v.annotation && (be?.(v.annotation.range[0]), ge([J]));
|
|
2727
2726
|
},
|
|
2728
|
-
[
|
|
2729
|
-
),
|
|
2730
|
-
() => (
|
|
2731
|
-
[
|
|
2732
|
-
),
|
|
2733
|
-
const
|
|
2734
|
-
|
|
2735
|
-
},
|
|
2736
|
-
|
|
2727
|
+
[be]
|
|
2728
|
+
), ke = I(() => $t(Q), [Q]), Me = I(
|
|
2729
|
+
() => (H || []).filter((v) => !ke.has(v.id)),
|
|
2730
|
+
[H, ke]
|
|
2731
|
+
), q = (v) => {
|
|
2732
|
+
const K = ga(v), we = (H || []).filter((Fe) => vt(Fe.mime, Fe.ext)), Ae = we.findIndex((Fe) => Fe.id === K);
|
|
2733
|
+
Ae !== -1 && g?.({ files: we, index: Ae, activityId: J });
|
|
2734
|
+
}, Pe = I(() => Sn(Q || ""), [Q]), T = I(() => yt(e), [e]), R = ue?.formatFrame ?? ((v) => Gn(v, t)), U = () => {
|
|
2735
|
+
T && (ue ? ue.goTo(T) : be?.(T.startFrame), ge([J]));
|
|
2737
2736
|
};
|
|
2738
|
-
return /* @__PURE__ */
|
|
2739
|
-
/* @__PURE__ */
|
|
2740
|
-
|
|
2737
|
+
return /* @__PURE__ */ x(Te, { children: [
|
|
2738
|
+
/* @__PURE__ */ x(
|
|
2739
|
+
ia,
|
|
2741
2740
|
{
|
|
2742
|
-
className:
|
|
2741
|
+
className: ne("comment", {
|
|
2743
2742
|
isOwner: de,
|
|
2744
2743
|
isEditing: fe,
|
|
2745
2744
|
isHighlighted: h,
|
|
2746
|
-
category: !!N && !
|
|
2747
|
-
menuOpen:
|
|
2745
|
+
category: !!N && !A,
|
|
2746
|
+
menuOpen: Ve
|
|
2748
2747
|
}),
|
|
2749
|
-
id:
|
|
2748
|
+
id: J,
|
|
2750
2749
|
$categoryPrimary: N?.color,
|
|
2751
|
-
$categoryTertiary:
|
|
2752
|
-
$categorySecondary:
|
|
2750
|
+
$categoryTertiary: X.primary,
|
|
2751
|
+
$categorySecondary: X.secondary,
|
|
2753
2752
|
children: [
|
|
2754
|
-
/* @__PURE__ */
|
|
2755
|
-
|
|
2753
|
+
/* @__PURE__ */ c(
|
|
2754
|
+
Yn,
|
|
2756
2755
|
{
|
|
2757
|
-
name:
|
|
2758
|
-
fullName:
|
|
2756
|
+
name: Z,
|
|
2757
|
+
fullName: Y,
|
|
2759
2758
|
date: $,
|
|
2760
|
-
isRef:
|
|
2759
|
+
isRef: qe,
|
|
2761
2760
|
activity: e,
|
|
2762
|
-
projectName:
|
|
2761
|
+
projectName: l,
|
|
2763
2762
|
entityType: m,
|
|
2764
2763
|
onReferenceClick: p,
|
|
2765
|
-
onReferenceTooltip:
|
|
2764
|
+
onReferenceTooltip: je,
|
|
2766
2765
|
children: void 0
|
|
2767
2766
|
}
|
|
2768
2767
|
),
|
|
2769
|
-
/* @__PURE__ */
|
|
2770
|
-
!
|
|
2771
|
-
|
|
2772
|
-
/* @__PURE__ */
|
|
2773
|
-
|
|
2768
|
+
/* @__PURE__ */ x(sa, { className: ne("comment-body", { isEditing: fe }), children: [
|
|
2769
|
+
!b && /* @__PURE__ */ x(ca, { className: "tools", children: [
|
|
2770
|
+
Ne && /* @__PURE__ */ c(rn, { icon: "edit_square", onClick: Ie, variant: "text" }),
|
|
2771
|
+
/* @__PURE__ */ c(
|
|
2772
|
+
rn,
|
|
2774
2773
|
{
|
|
2775
2774
|
icon: "more_horiz",
|
|
2776
|
-
ref:
|
|
2777
|
-
onClick: (
|
|
2778
|
-
|
|
2775
|
+
ref: P,
|
|
2776
|
+
onClick: (v) => {
|
|
2777
|
+
v.stopPropagation(), _(De);
|
|
2779
2778
|
},
|
|
2780
|
-
className:
|
|
2779
|
+
className: Ve ? "active" : ""
|
|
2781
2780
|
}
|
|
2782
2781
|
)
|
|
2783
2782
|
] }),
|
|
2784
|
-
fe ? /* @__PURE__ */
|
|
2785
|
-
|
|
2783
|
+
fe ? /* @__PURE__ */ c(
|
|
2784
|
+
Hn,
|
|
2786
2785
|
{
|
|
2787
|
-
initValue:
|
|
2788
|
-
initFiles:
|
|
2786
|
+
initValue: Q,
|
|
2787
|
+
initFiles: H,
|
|
2789
2788
|
annotationFrameStart: t,
|
|
2790
2789
|
initCategory: N?.name,
|
|
2791
2790
|
data: e.activityData,
|
|
2792
|
-
activityId:
|
|
2791
|
+
activityId: J,
|
|
2793
2792
|
versionReview: !1,
|
|
2794
2793
|
isEditing: !0,
|
|
2795
|
-
onClose:
|
|
2796
|
-
onSubmit:
|
|
2794
|
+
onClose: Ze,
|
|
2795
|
+
onSubmit: Re,
|
|
2797
2796
|
isOpen: !0,
|
|
2798
2797
|
...i
|
|
2799
2798
|
}
|
|
2800
|
-
) : /* @__PURE__ */
|
|
2801
|
-
/* @__PURE__ */
|
|
2802
|
-
|
|
2799
|
+
) : /* @__PURE__ */ x(Te, { children: [
|
|
2800
|
+
/* @__PURE__ */ c(
|
|
2801
|
+
Ui,
|
|
2803
2802
|
{
|
|
2804
|
-
flags:
|
|
2803
|
+
flags: zi({
|
|
2805
2804
|
category: N,
|
|
2806
|
-
categoryNotFound:
|
|
2807
|
-
frameLink:
|
|
2808
|
-
formatFrame:
|
|
2809
|
-
onFrameLinkClick:
|
|
2810
|
-
canNavigateToFrame: !!
|
|
2811
|
-
isGuest:
|
|
2805
|
+
categoryNotFound: G,
|
|
2806
|
+
frameLink: T,
|
|
2807
|
+
formatFrame: R,
|
|
2808
|
+
onFrameLinkClick: U,
|
|
2809
|
+
canNavigateToFrame: !!ue || !!be,
|
|
2810
|
+
isGuest: A
|
|
2812
2811
|
})
|
|
2813
2812
|
}
|
|
2814
2813
|
),
|
|
2815
|
-
/* @__PURE__ */
|
|
2816
|
-
|
|
2814
|
+
/* @__PURE__ */ c(Ci, { children: /* @__PURE__ */ c(
|
|
2815
|
+
An,
|
|
2817
2816
|
{
|
|
2818
2817
|
remarkPlugins: [
|
|
2818
|
+
Cn,
|
|
2819
2819
|
Fn,
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
Ao
|
|
2820
|
+
Co,
|
|
2821
|
+
ti,
|
|
2822
|
+
To
|
|
2824
2823
|
],
|
|
2825
|
-
urlTransform: (
|
|
2824
|
+
urlTransform: (v) => v,
|
|
2826
2825
|
components: {
|
|
2827
2826
|
// a links
|
|
2828
2827
|
// @ts-ignore
|
|
2829
|
-
a: (
|
|
2828
|
+
a: (v) => (
|
|
2830
2829
|
// @ts-ignore
|
|
2831
|
-
|
|
2832
|
-
entityId:
|
|
2833
|
-
entityType:
|
|
2830
|
+
pa(v, {
|
|
2831
|
+
entityId: ee?.id ?? ae,
|
|
2832
|
+
entityType: ee?.type ?? m,
|
|
2834
2833
|
userName: D,
|
|
2835
|
-
userTeamNames:
|
|
2836
|
-
projectName:
|
|
2834
|
+
userTeamNames: S,
|
|
2835
|
+
projectName: l,
|
|
2837
2836
|
onReferenceClick: p,
|
|
2838
|
-
onReferenceTooltip:
|
|
2839
|
-
activityId:
|
|
2837
|
+
onReferenceTooltip: je,
|
|
2838
|
+
activityId: J,
|
|
2840
2839
|
categoryPrimary: N?.color,
|
|
2841
|
-
categorySecondary:
|
|
2842
|
-
onActivityLinkClick:
|
|
2840
|
+
categorySecondary: X.secondary,
|
|
2841
|
+
onActivityLinkClick: He
|
|
2843
2842
|
})
|
|
2844
2843
|
),
|
|
2845
2844
|
// checkbox inputs
|
|
2846
2845
|
// @ts-ignore
|
|
2847
|
-
input: (
|
|
2846
|
+
input: (v) => ma(v, { activity: e, onCheckChange: o }),
|
|
2848
2847
|
// code syntax highlighting
|
|
2849
2848
|
// eslint-disable-next-line
|
|
2850
2849
|
// @ts-ignore
|
|
2851
|
-
code: (
|
|
2850
|
+
code: (v) => ua(v),
|
|
2852
2851
|
// @ts-ignore
|
|
2853
|
-
blockquote: (
|
|
2852
|
+
blockquote: (v) => da(v),
|
|
2854
2853
|
// @ts-ignore
|
|
2855
|
-
tip: (
|
|
2856
|
-
/* @__PURE__ */
|
|
2857
|
-
|
|
2854
|
+
tip: (v) => /* @__PURE__ */ x(la, { children: [
|
|
2855
|
+
/* @__PURE__ */ c(se, { icon: "info" }),
|
|
2856
|
+
v.children
|
|
2858
2857
|
] }),
|
|
2859
2858
|
// a video url on its own line is an embedded video
|
|
2860
2859
|
// @ts-ignore
|
|
2861
|
-
p: (
|
|
2860
|
+
p: (v) => ar(v, { onOpen: q }) ?? rr(v) ?? /* @__PURE__ */ c("p", { children: v.children }),
|
|
2862
2861
|
// @ts-ignore
|
|
2863
|
-
status: (
|
|
2862
|
+
status: (v) => /* @__PURE__ */ c(Ii, { name: v.id, statuses: y, children: v.children })
|
|
2864
2863
|
},
|
|
2865
|
-
children:
|
|
2864
|
+
children: Pe
|
|
2866
2865
|
}
|
|
2867
2866
|
) }),
|
|
2868
|
-
/* @__PURE__ */
|
|
2869
|
-
|
|
2867
|
+
/* @__PURE__ */ c(
|
|
2868
|
+
_n,
|
|
2870
2869
|
{
|
|
2871
|
-
files:
|
|
2872
|
-
isCompact:
|
|
2873
|
-
activityId:
|
|
2874
|
-
projectName:
|
|
2870
|
+
files: Me,
|
|
2871
|
+
isCompact: Me.length > 6,
|
|
2872
|
+
activityId: J,
|
|
2873
|
+
projectName: l,
|
|
2875
2874
|
isDownloadable: !0,
|
|
2876
2875
|
onExpand: g,
|
|
2877
|
-
onAnnotationClick:
|
|
2876
|
+
onAnnotationClick: Ue,
|
|
2878
2877
|
pt: { file: { annotationFrameStart: t } },
|
|
2879
2878
|
onRemove: void 0
|
|
2880
2879
|
}
|
|
2881
2880
|
)
|
|
2882
2881
|
] }),
|
|
2883
|
-
!fe && /* @__PURE__ */
|
|
2884
|
-
|
|
2882
|
+
!fe && /* @__PURE__ */ c("div", { style: { marginTop: "16px" }, children: We && /* @__PURE__ */ c(
|
|
2883
|
+
bi,
|
|
2885
2884
|
{
|
|
2886
|
-
reactions:
|
|
2887
|
-
changeHandler:
|
|
2888
|
-
readOnly:
|
|
2889
|
-
category: N && !
|
|
2885
|
+
reactions: We,
|
|
2886
|
+
changeHandler: Ee,
|
|
2887
|
+
readOnly: b,
|
|
2888
|
+
category: N && !A ? N.name : void 0,
|
|
2890
2889
|
categoryPrimary: N?.color,
|
|
2891
|
-
categorySecondary:
|
|
2892
|
-
categoryTertiary:
|
|
2890
|
+
categorySecondary: X.secondary,
|
|
2891
|
+
categoryTertiary: X.primary
|
|
2893
2892
|
}
|
|
2894
2893
|
) })
|
|
2895
2894
|
] })
|
|
2896
2895
|
]
|
|
2897
2896
|
}
|
|
2898
2897
|
),
|
|
2899
|
-
/* @__PURE__ */
|
|
2900
|
-
|
|
2898
|
+
/* @__PURE__ */ c(
|
|
2899
|
+
er,
|
|
2901
2900
|
{
|
|
2902
|
-
target:
|
|
2903
|
-
id:
|
|
2901
|
+
target: P.current,
|
|
2902
|
+
id: De,
|
|
2904
2903
|
align: "right",
|
|
2905
|
-
onClose: (
|
|
2906
|
-
|
|
2904
|
+
onClose: (v) => {
|
|
2905
|
+
v?.stopPropagation(), _(!1);
|
|
2907
2906
|
},
|
|
2908
|
-
children: /* @__PURE__ */
|
|
2909
|
-
|
|
2907
|
+
children: /* @__PURE__ */ c(
|
|
2908
|
+
Bi,
|
|
2910
2909
|
{
|
|
2911
|
-
onDelete:
|
|
2912
|
-
onEdit:
|
|
2913
|
-
onCopyText:
|
|
2910
|
+
onDelete: he && n ? et : void 0,
|
|
2911
|
+
onEdit: Ne ? Ie : void 0,
|
|
2912
|
+
onCopyText: Pe ? () => Mn(Pe) : void 0,
|
|
2914
2913
|
onDuplicate: r ? () => r(e) : void 0,
|
|
2915
|
-
activityId:
|
|
2916
|
-
onSelect: () =>
|
|
2917
|
-
projectName:
|
|
2918
|
-
entity:
|
|
2914
|
+
activityId: J,
|
|
2915
|
+
onSelect: () => _(!1),
|
|
2916
|
+
projectName: l,
|
|
2917
|
+
entity: ee ?? (ae ? { id: ae, type: m } : void 0)
|
|
2919
2918
|
}
|
|
2920
2919
|
)
|
|
2921
2920
|
}
|
|
2922
2921
|
)
|
|
2923
2922
|
] });
|
|
2924
|
-
},
|
|
2923
|
+
}, Hi = F.li`
|
|
2925
2924
|
list-style: none;
|
|
2926
2925
|
margin: 0;
|
|
2927
2926
|
padding: 0;
|
|
@@ -2931,7 +2930,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
2931
2930
|
padding: 4px 8px;
|
|
2932
2931
|
border-radius: var(--border-radius-m);
|
|
2933
2932
|
user-select: none;
|
|
2934
|
-
`,
|
|
2933
|
+
`, qi = F.div`
|
|
2935
2934
|
display: flex;
|
|
2936
2935
|
flex-wrap: wrap;
|
|
2937
2936
|
align-items: center;
|
|
@@ -2954,10 +2953,10 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
2954
2953
|
font-size: 12px;
|
|
2955
2954
|
font-weight: 800;
|
|
2956
2955
|
}
|
|
2957
|
-
`,
|
|
2956
|
+
`, Wi = (e, t) => {
|
|
2958
2957
|
let o = [], n = {};
|
|
2959
2958
|
return e.activityData.origin.type == "folder" && !n.folder && (n.folder = !0, o.push(e.activityData.origin.name)), e.activityData.origin.type == "task" && !n.task && (n.task = !0, o.push(e.activityData.origin.name)), (t == "version" || e.activityData.origin.type == "version") && (n.product || (n.product = !0, o.push(e.activityData.parents?.find((a) => a.type == "product")?.name)), n.version || (n.version = !0, o.push(e.activityData.origin.name))), o;
|
|
2960
|
-
},
|
|
2959
|
+
}, Qi = F.div`
|
|
2961
2960
|
display: inline-flex;
|
|
2962
2961
|
align-items: center;
|
|
2963
2962
|
gap: var(--base-gap-small);
|
|
@@ -2966,7 +2965,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
2966
2965
|
font-variation-settings: 'FILL' 1;
|
|
2967
2966
|
font-size: 16px;
|
|
2968
2967
|
}
|
|
2969
|
-
`,
|
|
2968
|
+
`, Yi = F.span`
|
|
2970
2969
|
color: var(--md-sys-color-outline);
|
|
2971
2970
|
font-size: 12px;
|
|
2972
2971
|
max-width: 300px;
|
|
@@ -2976,37 +2975,37 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
2976
2975
|
span {
|
|
2977
2976
|
font-size: inherit;
|
|
2978
2977
|
}
|
|
2979
|
-
`,
|
|
2980
|
-
({ icon: e, color: t, name: o, items: n, ...a }, r) => /* @__PURE__ */
|
|
2981
|
-
e && /* @__PURE__ */
|
|
2982
|
-
/* @__PURE__ */
|
|
2983
|
-
/* @__PURE__ */
|
|
2978
|
+
`, _t = ft(
|
|
2979
|
+
({ icon: e, color: t, name: o, items: n, ...a }, r) => /* @__PURE__ */ x(Qi, { ...a, ref: r, children: [
|
|
2980
|
+
e && /* @__PURE__ */ c(se, { icon: e, style: { color: t } }),
|
|
2981
|
+
/* @__PURE__ */ c(Yi, { title: o, children: n ? n.map((s, i) => /* @__PURE__ */ x(Fo, { children: [
|
|
2982
|
+
/* @__PURE__ */ c("span", { style: { color: s.color }, children: s.label }),
|
|
2984
2983
|
i < n.length - 1 && ", "
|
|
2985
2984
|
] }, i)) : o })
|
|
2986
2985
|
] })
|
|
2987
|
-
),
|
|
2986
|
+
), Ji = (e) => {
|
|
2988
2987
|
const t = typeof e.icon == "string" ? e.icon : e.icon?.name, o = e.color ?? (typeof e.icon == "object" ? e.icon?.color : void 0);
|
|
2989
2988
|
return { name: e.label, icon: t, color: o };
|
|
2990
|
-
},
|
|
2989
|
+
}, Ki = (e, t) => {
|
|
2991
2990
|
const o = t?.data.enum?.find((n) => n.value === e)?.label;
|
|
2992
2991
|
if (o) return o;
|
|
2993
2992
|
if (t?.data.type === "datetime") {
|
|
2994
2993
|
const n = new Date(String(e));
|
|
2995
|
-
if (!isNaN(n.getTime())) return
|
|
2994
|
+
if (!isNaN(n.getTime())) return ha(n, "dd-MM-yyyy");
|
|
2996
2995
|
}
|
|
2997
2996
|
return String(e);
|
|
2998
|
-
},
|
|
2997
|
+
}, Xi = (e, t) => e === "description" || t?.data.widget === "markdown", Zi = (e, t, o) => {
|
|
2999
2998
|
if (e == null || e === "" || Array.isArray(e) && !e.length) return { name: "none" };
|
|
3000
|
-
if (typeof e == "string" &&
|
|
3001
|
-
return { name:
|
|
2999
|
+
if (typeof e == "string" && Xi(o, t))
|
|
3000
|
+
return { name: ir(e) || "none" };
|
|
3002
3001
|
if (t?.data.type === "boolean") return { name: e ? "Checked" : "Unchecked" };
|
|
3003
3002
|
const a = Array.isArray(e) ? e : [e];
|
|
3004
3003
|
if (a.length === 1) {
|
|
3005
3004
|
const r = t?.data.enum?.find((s) => s.value === a[0]);
|
|
3006
|
-
if (r) return
|
|
3005
|
+
if (r) return Ji(r);
|
|
3007
3006
|
}
|
|
3008
|
-
return { name: a.map((r) =>
|
|
3009
|
-
},
|
|
3007
|
+
return { name: a.map((r) => Ki(r, t)).join(", ") };
|
|
3008
|
+
}, es = ({
|
|
3010
3009
|
entityType: e,
|
|
3011
3010
|
projectInfo: t,
|
|
3012
3011
|
activity: o = {}
|
|
@@ -3017,37 +3016,37 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3017
3016
|
authorFullName: r,
|
|
3018
3017
|
createdAt: s,
|
|
3019
3018
|
oldStatus: i,
|
|
3020
|
-
newStatus:
|
|
3019
|
+
newStatus: l,
|
|
3021
3020
|
activityData: m = {}
|
|
3022
|
-
} = o, { key: p, oldValue: g, newValue: u } = m, h =
|
|
3021
|
+
} = o, { key: p, oldValue: g, newValue: u } = m, h = Wi(o, e), b = n === "attrib.change", y = n === "tags.change", D = n === "subtype.change", { data: M = [] } = Ma(void 0, { skip: !b }), C = I(() => M.find((N) => N.name === p), [M, p]), f = b ? C?.data.title || p : y ? "Tags" : D ? "Type" : void 0, w = (N) => ({
|
|
3023
3022
|
name: N?.name || "",
|
|
3024
3023
|
icon: N?.icon,
|
|
3025
3024
|
color: N?.color
|
|
3026
|
-
}),
|
|
3027
|
-
const
|
|
3028
|
-
if (!
|
|
3029
|
-
const
|
|
3030
|
-
label:
|
|
3031
|
-
color: t?.tags?.find((
|
|
3025
|
+
}), A = (N) => {
|
|
3026
|
+
const G = Array.isArray(N) ? N.map(String) : [];
|
|
3027
|
+
if (!G.length) return { name: "none" };
|
|
3028
|
+
const X = G.map((Q) => ({
|
|
3029
|
+
label: Q,
|
|
3030
|
+
color: t?.tags?.find((Z) => Z.name === Q)?.color
|
|
3032
3031
|
}));
|
|
3033
|
-
return { name:
|
|
3034
|
-
},
|
|
3035
|
-
return /* @__PURE__ */
|
|
3036
|
-
/* @__PURE__ */
|
|
3037
|
-
/* @__PURE__ */
|
|
3038
|
-
/* @__PURE__ */
|
|
3032
|
+
return { name: G.join(", "), items: X };
|
|
3033
|
+
}, S = n === "status.change", P = (N, G) => S ? w(G) : y ? A(N) : Zi(N, C, p), _ = P(g, i), E = P(u, l);
|
|
3034
|
+
return /* @__PURE__ */ x(Hi, { children: [
|
|
3035
|
+
/* @__PURE__ */ x(qi, { children: [
|
|
3036
|
+
/* @__PURE__ */ c(Dt, { children: r || a }),
|
|
3037
|
+
/* @__PURE__ */ x(Dt, { children: [
|
|
3039
3038
|
"- ",
|
|
3040
3039
|
h.join(" / "),
|
|
3041
3040
|
" -"
|
|
3042
3041
|
] }),
|
|
3043
|
-
f && /* @__PURE__ */
|
|
3044
|
-
/* @__PURE__ */
|
|
3045
|
-
/* @__PURE__ */
|
|
3046
|
-
/* @__PURE__ */
|
|
3042
|
+
f && /* @__PURE__ */ c(Dt, { children: /* @__PURE__ */ c("strong", { children: f }) }),
|
|
3043
|
+
/* @__PURE__ */ c(_t, { ..._ }),
|
|
3044
|
+
/* @__PURE__ */ c(se, { icon: "trending_flat" }),
|
|
3045
|
+
/* @__PURE__ */ c(_t, { ...E })
|
|
3047
3046
|
] }),
|
|
3048
|
-
/* @__PURE__ */
|
|
3047
|
+
/* @__PURE__ */ c(lt, { date: s })
|
|
3049
3048
|
] });
|
|
3050
|
-
},
|
|
3049
|
+
}, Jn = F.li`
|
|
3051
3050
|
/* reset default */
|
|
3052
3051
|
list-style: none;
|
|
3053
3052
|
margin: 0;
|
|
@@ -3060,7 +3059,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3060
3059
|
padding: 4px 8px;
|
|
3061
3060
|
border-radius: var(--border-radius-m);
|
|
3062
3061
|
user-select: none;
|
|
3063
|
-
`,
|
|
3062
|
+
`, Kn = F.div`
|
|
3064
3063
|
display: flex;
|
|
3065
3064
|
flex-wrap: nowrap;
|
|
3066
3065
|
align-items: start;
|
|
@@ -3068,18 +3067,18 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3068
3067
|
gap: var(--base-gap-small);
|
|
3069
3068
|
padding: 0px 4px;
|
|
3070
3069
|
overflow: hidden;
|
|
3071
|
-
`,
|
|
3070
|
+
`, Rt = F.span`
|
|
3072
3071
|
color: var(--md-sys-color-outline);
|
|
3073
3072
|
white-space: wrap;
|
|
3074
3073
|
font-size: 12px;
|
|
3075
|
-
`,
|
|
3074
|
+
`, yn = ({ activity: e, isAdding: t }) => {
|
|
3076
3075
|
const { authorFullName: o, createdAt: n, activityData: a, authorName: r } = e || {}, { assignee: s } = a || {};
|
|
3077
3076
|
let i = o || r;
|
|
3078
|
-
return i += t ? " added " : " removed ", i += "assignee: " + s, /* @__PURE__ */
|
|
3079
|
-
/* @__PURE__ */
|
|
3080
|
-
/* @__PURE__ */
|
|
3077
|
+
return i += t ? " added " : " removed ", i += "assignee: " + s, /* @__PURE__ */ c(Jn, { children: /* @__PURE__ */ x(Kn, { children: [
|
|
3078
|
+
/* @__PURE__ */ c(Rt, { children: i }),
|
|
3079
|
+
/* @__PURE__ */ c(lt, { date: n })
|
|
3081
3080
|
] }) });
|
|
3082
|
-
},
|
|
3081
|
+
}, ts = F.li`
|
|
3083
3082
|
/* reset default */
|
|
3084
3083
|
list-style: none;
|
|
3085
3084
|
margin: 0;
|
|
@@ -3091,7 +3090,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3091
3090
|
|
|
3092
3091
|
width: 100%;
|
|
3093
3092
|
padding: 8px;
|
|
3094
|
-
`,
|
|
3093
|
+
`, ns = F.div`
|
|
3095
3094
|
border-radius: var(--border-radius-m);
|
|
3096
3095
|
padding: var(--padding-m);
|
|
3097
3096
|
|
|
@@ -3107,7 +3106,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3107
3106
|
display: inline;
|
|
3108
3107
|
}
|
|
3109
3108
|
}
|
|
3110
|
-
`,
|
|
3109
|
+
`, os = F.div`
|
|
3111
3110
|
display: flex;
|
|
3112
3111
|
flex-direction: row;
|
|
3113
3112
|
justify-content: space-between;
|
|
@@ -3121,7 +3120,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3121
3120
|
min-width: 0;
|
|
3122
3121
|
overflow: hidden;
|
|
3123
3122
|
}
|
|
3124
|
-
`,
|
|
3123
|
+
`, vn = F.div`
|
|
3125
3124
|
display: flex;
|
|
3126
3125
|
align-items: center;
|
|
3127
3126
|
justify-content: space-between;
|
|
@@ -3145,7 +3144,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3145
3144
|
display: none;
|
|
3146
3145
|
flex: 1;
|
|
3147
3146
|
}
|
|
3148
|
-
`,
|
|
3147
|
+
`, as = F(ja)`
|
|
3149
3148
|
width: 74px;
|
|
3150
3149
|
min-width: 74px;
|
|
3151
3150
|
height: unset;
|
|
@@ -3159,23 +3158,23 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3159
3158
|
img {
|
|
3160
3159
|
object-fit: cover;
|
|
3161
3160
|
}
|
|
3162
|
-
`,
|
|
3161
|
+
`, rs = F.span`
|
|
3163
3162
|
overflow: hidden;
|
|
3164
3163
|
text-overflow: ellipsis;
|
|
3165
3164
|
white-space: nowrap;
|
|
3166
3165
|
display: block;
|
|
3167
3166
|
min-width: 0;
|
|
3168
|
-
`,
|
|
3167
|
+
`, is = F.div`
|
|
3169
3168
|
margin-top: var(--base-gap-small);
|
|
3170
3169
|
color: var(--md-sys-color-outline);
|
|
3171
3170
|
word-break: break-word;
|
|
3172
|
-
`,
|
|
3171
|
+
`, ss = F.li`
|
|
3173
3172
|
/* reset default */
|
|
3174
3173
|
list-style: none;
|
|
3175
3174
|
margin: 0;
|
|
3176
3175
|
padding: 0;
|
|
3177
3176
|
padding: 0px 8px;
|
|
3178
|
-
`,
|
|
3177
|
+
`, Xn = F.div`
|
|
3179
3178
|
width: 100%;
|
|
3180
3179
|
display: flex;
|
|
3181
3180
|
align-items: center;
|
|
@@ -3198,7 +3197,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3198
3197
|
&:hover {
|
|
3199
3198
|
background-color: var(--md-sys-color-surface-container-hover);
|
|
3200
3199
|
}
|
|
3201
|
-
`,
|
|
3200
|
+
`, cs = ({
|
|
3202
3201
|
activity: e,
|
|
3203
3202
|
projectName: t,
|
|
3204
3203
|
entityType: o,
|
|
@@ -3206,15 +3205,24 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3206
3205
|
filter: a,
|
|
3207
3206
|
statuses: r = []
|
|
3208
3207
|
}) => {
|
|
3209
|
-
const { onOpenViewer: s } =
|
|
3210
|
-
let { authorName: i, authorFullName:
|
|
3211
|
-
const g = a === "versions" || a && typeof a == "object" && a.conditions?.some((C) => C.key === "versions" && C.value === !0), [u, h] = L(g),
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3208
|
+
const { onOpenViewer: s } = Be();
|
|
3209
|
+
let { authorName: i, authorFullName: l, createdAt: m, versions: p = [] } = e;
|
|
3210
|
+
const g = a === "versions" || a && typeof a == "object" && a.conditions?.some((C) => C.key === "versions" && C.value === !0), [u, h] = L(g), b = 2, [y, D] = L(!1), M = (C, f, w) => {
|
|
3211
|
+
const A = fa(C);
|
|
3212
|
+
s?.({
|
|
3213
|
+
versionIds: [f],
|
|
3214
|
+
productId: w,
|
|
3215
|
+
projectName: t,
|
|
3216
|
+
reviewableIds: A && [A.fileId],
|
|
3217
|
+
goToPosition: A?.position
|
|
3218
|
+
});
|
|
3219
|
+
};
|
|
3220
|
+
return /* @__PURE__ */ x(ts, { children: [
|
|
3221
|
+
/* @__PURE__ */ c(
|
|
3222
|
+
Yn,
|
|
3215
3223
|
{
|
|
3216
3224
|
name: i,
|
|
3217
|
-
fullName:
|
|
3225
|
+
fullName: l || i,
|
|
3218
3226
|
date: m,
|
|
3219
3227
|
activity: e,
|
|
3220
3228
|
projectName: t,
|
|
@@ -3223,19 +3231,19 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3223
3231
|
}
|
|
3224
3232
|
),
|
|
3225
3233
|
p.flatMap((C, f) => {
|
|
3226
|
-
const { name:
|
|
3227
|
-
return (f <
|
|
3228
|
-
/* @__PURE__ */
|
|
3229
|
-
/* @__PURE__ */
|
|
3230
|
-
/* @__PURE__ */
|
|
3231
|
-
/* @__PURE__ */
|
|
3232
|
-
/* @__PURE__ */
|
|
3234
|
+
const { name: w, id: A, productId: S, productName: P, thumbnailHash: _, comment: E } = C, N = r.find((G) => G.name === C.status);
|
|
3235
|
+
return (f < b || u) && /* @__PURE__ */ x(ns, { onClick: (G) => M(G, A, S), children: [
|
|
3236
|
+
/* @__PURE__ */ x(os, { children: [
|
|
3237
|
+
/* @__PURE__ */ x("div", { children: [
|
|
3238
|
+
/* @__PURE__ */ x(vn, { children: [
|
|
3239
|
+
/* @__PURE__ */ c("span", { children: P }),
|
|
3240
|
+
/* @__PURE__ */ c(lt, { date: m, isExact: !0 })
|
|
3233
3241
|
] }),
|
|
3234
|
-
/* @__PURE__ */
|
|
3235
|
-
/* @__PURE__ */
|
|
3242
|
+
/* @__PURE__ */ x(vn, { children: [
|
|
3243
|
+
/* @__PURE__ */ c(rs, { className: "version", children: w }),
|
|
3236
3244
|
" -",
|
|
3237
|
-
/* @__PURE__ */
|
|
3238
|
-
|
|
3245
|
+
/* @__PURE__ */ c(
|
|
3246
|
+
_t,
|
|
3239
3247
|
{
|
|
3240
3248
|
icon: N?.icon,
|
|
3241
3249
|
color: N?.color,
|
|
@@ -3244,38 +3252,40 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3244
3252
|
)
|
|
3245
3253
|
] })
|
|
3246
3254
|
] }),
|
|
3247
|
-
/* @__PURE__ */
|
|
3248
|
-
|
|
3255
|
+
/* @__PURE__ */ c(
|
|
3256
|
+
as,
|
|
3249
3257
|
{
|
|
3250
3258
|
projectName: t,
|
|
3251
|
-
entityId:
|
|
3259
|
+
entityId: A,
|
|
3252
3260
|
entityType: "version",
|
|
3253
3261
|
onError: () => D(!0),
|
|
3254
3262
|
iconOnly: y,
|
|
3255
|
-
thumbnailHash:
|
|
3256
|
-
icon: "play_circle"
|
|
3263
|
+
thumbnailHash: _,
|
|
3264
|
+
icon: "play_circle",
|
|
3265
|
+
filmstrip: !0,
|
|
3266
|
+
filmstripFit: "cover"
|
|
3257
3267
|
}
|
|
3258
3268
|
)
|
|
3259
3269
|
] }),
|
|
3260
|
-
E && /* @__PURE__ */
|
|
3261
|
-
] },
|
|
3270
|
+
E && /* @__PURE__ */ c(is, { children: E })
|
|
3271
|
+
] }, A);
|
|
3262
3272
|
}),
|
|
3263
|
-
!g && p.length >
|
|
3264
|
-
/* @__PURE__ */
|
|
3265
|
-
/* @__PURE__ */
|
|
3273
|
+
!g && p.length > b && /* @__PURE__ */ x(Xn, { onClick: () => h(!u), children: [
|
|
3274
|
+
/* @__PURE__ */ c(se, { icon: "more" }),
|
|
3275
|
+
/* @__PURE__ */ c("span", { children: u ? "Show less" : `Show ${p.length - b} more versions` })
|
|
3266
3276
|
] })
|
|
3267
3277
|
] });
|
|
3268
|
-
},
|
|
3278
|
+
}, ls = ({ activities: e, editProps: t, ...o }) => {
|
|
3269
3279
|
const [n, a] = L(!1);
|
|
3270
|
-
return /* @__PURE__ */
|
|
3271
|
-
/* @__PURE__ */
|
|
3272
|
-
/* @__PURE__ */
|
|
3280
|
+
return /* @__PURE__ */ x(Te, { children: [
|
|
3281
|
+
/* @__PURE__ */ c(ss, { children: /* @__PURE__ */ x(Xn, { onClick: () => a(!n), children: [
|
|
3282
|
+
/* @__PURE__ */ c(se, { icon: n ? "expand_less" : "chevron_right" }),
|
|
3273
3283
|
n ? "Show less" : "Show more"
|
|
3274
3284
|
] }) }),
|
|
3275
3285
|
n && e.map((r) => (
|
|
3276
3286
|
// @ts-expect-error
|
|
3277
|
-
/* @__PURE__ */
|
|
3278
|
-
|
|
3287
|
+
/* @__PURE__ */ c(
|
|
3288
|
+
Zn,
|
|
3279
3289
|
{
|
|
3280
3290
|
editProps: t,
|
|
3281
3291
|
activity: r,
|
|
@@ -3286,7 +3296,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3286
3296
|
)
|
|
3287
3297
|
))
|
|
3288
3298
|
] });
|
|
3289
|
-
},
|
|
3299
|
+
}, Zn = ({
|
|
3290
3300
|
activity: e,
|
|
3291
3301
|
fromGroup: t,
|
|
3292
3302
|
annotationFrameStart: o,
|
|
@@ -3295,7 +3305,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3295
3305
|
editProps: r,
|
|
3296
3306
|
filter: s,
|
|
3297
3307
|
readOnly: i,
|
|
3298
|
-
statuses:
|
|
3308
|
+
statuses: l,
|
|
3299
3309
|
isSlideOut: m,
|
|
3300
3310
|
isGuest: p,
|
|
3301
3311
|
...g
|
|
@@ -3304,15 +3314,15 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3304
3314
|
case "comment":
|
|
3305
3315
|
return (
|
|
3306
3316
|
// @ts-expect-error
|
|
3307
|
-
/* @__PURE__ */
|
|
3308
|
-
|
|
3317
|
+
/* @__PURE__ */ c(
|
|
3318
|
+
Gi,
|
|
3309
3319
|
{
|
|
3310
3320
|
activity: e,
|
|
3311
3321
|
annotationFrameStart: o,
|
|
3312
3322
|
projectInfo: n,
|
|
3313
3323
|
editProps: r,
|
|
3314
3324
|
readOnly: i,
|
|
3315
|
-
statuses:
|
|
3325
|
+
statuses: l,
|
|
3316
3326
|
isSlideOut: m,
|
|
3317
3327
|
...g
|
|
3318
3328
|
}
|
|
@@ -3322,18 +3332,18 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3322
3332
|
case "attrib.change":
|
|
3323
3333
|
case "tags.change":
|
|
3324
3334
|
case "subtype.change":
|
|
3325
|
-
return /* @__PURE__ */
|
|
3335
|
+
return /* @__PURE__ */ c(es, { activity: e, projectInfo: n, ...g });
|
|
3326
3336
|
case "assignee.add":
|
|
3327
|
-
return /* @__PURE__ */
|
|
3337
|
+
return /* @__PURE__ */ c(yn, { activity: e, ...g, isAdding: !0 });
|
|
3328
3338
|
case "assignee.remove":
|
|
3329
|
-
return /* @__PURE__ */
|
|
3339
|
+
return /* @__PURE__ */ c(yn, { activity: e, ...g });
|
|
3330
3340
|
case "version.publish":
|
|
3331
|
-
return /* @__PURE__ */
|
|
3341
|
+
return /* @__PURE__ */ c(cs, { activity: e, projectInfo: n, filter: s, statuses: l, ...g });
|
|
3332
3342
|
case "version.review":
|
|
3333
|
-
return /* @__PURE__ */
|
|
3343
|
+
return /* @__PURE__ */ c(ji, { activity: e, isGuest: p, ...g });
|
|
3334
3344
|
case "group":
|
|
3335
|
-
return !t && /* @__PURE__ */
|
|
3336
|
-
|
|
3345
|
+
return !t && /* @__PURE__ */ c(
|
|
3346
|
+
ls,
|
|
3337
3347
|
{
|
|
3338
3348
|
editProps: r,
|
|
3339
3349
|
activities: e.items || [],
|
|
@@ -3344,7 +3354,7 @@ const Mi = "anonymous.guest", Pi = "Anonymous User", _i = "unknown.user", Wn = (
|
|
|
3344
3354
|
default:
|
|
3345
3355
|
return null;
|
|
3346
3356
|
}
|
|
3347
|
-
},
|
|
3357
|
+
}, ds = F.section`
|
|
3348
3358
|
padding-bottom: 4px;
|
|
3349
3359
|
overflow: hidden;
|
|
3350
3360
|
position: relative;
|
|
@@ -3392,7 +3402,7 @@ F.div`
|
|
|
3392
3402
|
color: inherit;
|
|
3393
3403
|
}
|
|
3394
3404
|
`;
|
|
3395
|
-
const
|
|
3405
|
+
const us = F.ul`
|
|
3396
3406
|
gap: var(--base-gap-large);
|
|
3397
3407
|
overflow-y: auto;
|
|
3398
3408
|
padding: 24px 0;
|
|
@@ -3413,11 +3423,11 @@ const ls = F.ul`
|
|
|
3413
3423
|
& > *:last-child {
|
|
3414
3424
|
margin-top: 32px;
|
|
3415
3425
|
}
|
|
3416
|
-
`,
|
|
3426
|
+
`, ms = F.span`
|
|
3417
3427
|
padding: 16px 8px;
|
|
3418
3428
|
color: var(--md-sys-color-outline);
|
|
3419
3429
|
font-size: 11px;
|
|
3420
|
-
`,
|
|
3430
|
+
`, ps = F.div`
|
|
3421
3431
|
height: 50px;
|
|
3422
3432
|
border-radius: 8px;
|
|
3423
3433
|
overflow: hidden;
|
|
@@ -3425,7 +3435,7 @@ const ls = F.ul`
|
|
|
3425
3435
|
opacity: 0.5;
|
|
3426
3436
|
|
|
3427
3437
|
position: relative;
|
|
3428
|
-
`,
|
|
3438
|
+
`, gs = ({
|
|
3429
3439
|
projectName: e,
|
|
3430
3440
|
entityType: t,
|
|
3431
3441
|
entities: o = [],
|
|
@@ -3436,33 +3446,33 @@ const ls = F.ul`
|
|
|
3436
3446
|
createEntityActivity: r,
|
|
3437
3447
|
updateActivity: s,
|
|
3438
3448
|
deleteActivity: i,
|
|
3439
|
-
isUpdatingActivity:
|
|
3449
|
+
isUpdatingActivity: l,
|
|
3440
3450
|
userName: m,
|
|
3441
3451
|
userFullName: p,
|
|
3442
3452
|
activityTypes: g
|
|
3443
3453
|
} = $e(), u = o.map((C) => C.id), h = ({
|
|
3444
3454
|
entityId: C,
|
|
3445
3455
|
newId: f,
|
|
3446
|
-
subTitle:
|
|
3447
|
-
value:
|
|
3448
|
-
files:
|
|
3449
|
-
data:
|
|
3456
|
+
subTitle: w,
|
|
3457
|
+
value: A,
|
|
3458
|
+
files: S = [],
|
|
3459
|
+
data: P = {}
|
|
3450
3460
|
}) => ({
|
|
3451
|
-
body:
|
|
3461
|
+
body: A,
|
|
3452
3462
|
activityType: "comment",
|
|
3453
3463
|
activityId: f,
|
|
3454
3464
|
entityId: C,
|
|
3455
3465
|
referenceType: "origin",
|
|
3456
3466
|
authorName: m,
|
|
3457
3467
|
authorFullName: p,
|
|
3458
|
-
createdAt:
|
|
3459
|
-
files:
|
|
3468
|
+
createdAt: Ya(/* @__PURE__ */ new Date()),
|
|
3469
|
+
files: S,
|
|
3460
3470
|
reactions: [],
|
|
3461
|
-
activityData:
|
|
3471
|
+
activityData: P,
|
|
3462
3472
|
origin: {
|
|
3463
3473
|
id: "8090c2dafcc811eeaf820242c0a80002",
|
|
3464
3474
|
type: t,
|
|
3465
|
-
name:
|
|
3475
|
+
name: w
|
|
3466
3476
|
},
|
|
3467
3477
|
author: {
|
|
3468
3478
|
active: !0,
|
|
@@ -3470,61 +3480,61 @@ const ls = F.ul`
|
|
|
3470
3480
|
}
|
|
3471
3481
|
});
|
|
3472
3482
|
return {
|
|
3473
|
-
submitComment: async (C, f = [],
|
|
3474
|
-
const
|
|
3475
|
-
const N =
|
|
3483
|
+
submitComment: async (C, f = [], w = {}) => {
|
|
3484
|
+
const A = o.map(({ id: _, subTitle: E }) => {
|
|
3485
|
+
const N = ln(), G = f.map((oe) => oe.id), X = a ? { ...w, entityList: a } : w, Q = {
|
|
3476
3486
|
body: C,
|
|
3477
3487
|
activityType: "comment",
|
|
3478
3488
|
id: N,
|
|
3479
|
-
files:
|
|
3480
|
-
data:
|
|
3481
|
-
},
|
|
3482
|
-
({ id:
|
|
3483
|
-
(
|
|
3489
|
+
files: G,
|
|
3490
|
+
data: X
|
|
3491
|
+
}, Z = f.filter(
|
|
3492
|
+
({ id: oe }) => !w.annotations?.some(
|
|
3493
|
+
(ae) => ae.transparent === oe
|
|
3484
3494
|
)
|
|
3485
|
-
),
|
|
3495
|
+
), Y = h({ entityId: _, newId: N, subTitle: E, value: C, files: Z, data: w });
|
|
3486
3496
|
return r({
|
|
3487
3497
|
projectName: e,
|
|
3488
3498
|
entityType: t,
|
|
3489
|
-
entityId:
|
|
3490
|
-
data:
|
|
3491
|
-
patch:
|
|
3499
|
+
entityId: _,
|
|
3500
|
+
data: Q,
|
|
3501
|
+
patch: Y,
|
|
3492
3502
|
filter: n,
|
|
3493
3503
|
...{ entityIds: u, activityTypes: g }
|
|
3494
3504
|
});
|
|
3495
|
-
}),
|
|
3496
|
-
if (
|
|
3497
|
-
const
|
|
3498
|
-
throw
|
|
3505
|
+
}), P = (await Promise.all(A)).filter((_) => _.error);
|
|
3506
|
+
if (P.length > 0) {
|
|
3507
|
+
const _ = sn(P[0].error) || "Failed to create comment";
|
|
3508
|
+
throw Ce.error(_), new Error(_);
|
|
3499
3509
|
}
|
|
3500
3510
|
},
|
|
3501
|
-
updateComment: async (C, f,
|
|
3502
|
-
const
|
|
3511
|
+
updateComment: async (C, f, w = [], A = {}) => {
|
|
3512
|
+
const S = w.map((N) => N.id), P = {
|
|
3503
3513
|
body: f,
|
|
3504
|
-
files:
|
|
3505
|
-
data:
|
|
3506
|
-
},
|
|
3514
|
+
files: S,
|
|
3515
|
+
data: A
|
|
3516
|
+
}, _ = {
|
|
3507
3517
|
...C,
|
|
3508
|
-
...
|
|
3509
|
-
files:
|
|
3510
|
-
activityData:
|
|
3518
|
+
...P,
|
|
3519
|
+
files: w,
|
|
3520
|
+
activityData: A
|
|
3511
3521
|
}, E = { entityType: t, entityIds: u, activityTypes: g };
|
|
3512
3522
|
try {
|
|
3513
3523
|
await s({
|
|
3514
3524
|
projectName: e,
|
|
3515
|
-
data:
|
|
3525
|
+
data: P,
|
|
3516
3526
|
activityId: C.activityId,
|
|
3517
3527
|
entityId: C.entityId,
|
|
3518
|
-
patch:
|
|
3528
|
+
patch: _,
|
|
3519
3529
|
filter: n,
|
|
3520
3530
|
...E
|
|
3521
3531
|
});
|
|
3522
3532
|
} catch (N) {
|
|
3523
|
-
throw
|
|
3533
|
+
throw Ce.error(sn(N)), N;
|
|
3524
3534
|
}
|
|
3525
3535
|
},
|
|
3526
|
-
deleteComment: async (C, f,
|
|
3527
|
-
const
|
|
3536
|
+
deleteComment: async (C, f, w = []) => {
|
|
3537
|
+
const A = { entityType: t, entityIds: u, activityTypes: g };
|
|
3528
3538
|
if (C)
|
|
3529
3539
|
try {
|
|
3530
3540
|
await i({
|
|
@@ -3533,32 +3543,32 @@ const ls = F.ul`
|
|
|
3533
3543
|
entityId: f,
|
|
3534
3544
|
filter: n,
|
|
3535
3545
|
patch: { activityId: C },
|
|
3536
|
-
refs:
|
|
3537
|
-
...
|
|
3546
|
+
refs: w,
|
|
3547
|
+
...A
|
|
3538
3548
|
});
|
|
3539
3549
|
} catch {
|
|
3540
3550
|
}
|
|
3541
3551
|
},
|
|
3542
3552
|
submitReview: async (C) => {
|
|
3543
|
-
const f = o.map(({ id:
|
|
3544
|
-
const
|
|
3545
|
-
body:
|
|
3553
|
+
const f = o.map(({ id: w, subTitle: A }) => {
|
|
3554
|
+
const S = ln(), P = { feedback: C, entityList: a }, _ = {
|
|
3555
|
+
body: oi(C, t),
|
|
3546
3556
|
activityType: "version.review",
|
|
3547
|
-
id:
|
|
3548
|
-
data:
|
|
3549
|
-
}, E = h({ entityId:
|
|
3557
|
+
id: S,
|
|
3558
|
+
data: P
|
|
3559
|
+
}, E = h({ entityId: w, newId: S, subTitle: A, value: "", data: P });
|
|
3550
3560
|
return r({
|
|
3551
3561
|
projectName: e,
|
|
3552
3562
|
entityType: t,
|
|
3553
|
-
entityId:
|
|
3554
|
-
data:
|
|
3563
|
+
entityId: w,
|
|
3564
|
+
data: _,
|
|
3555
3565
|
patch: E,
|
|
3556
3566
|
filter: n
|
|
3557
3567
|
});
|
|
3558
3568
|
});
|
|
3559
3569
|
await Promise.all(f);
|
|
3560
3570
|
},
|
|
3561
|
-
isSaving:
|
|
3571
|
+
isSaving: l
|
|
3562
3572
|
};
|
|
3563
3573
|
}, Nt = (e = {}) => {
|
|
3564
3574
|
const {
|
|
@@ -3567,9 +3577,9 @@ const ls = F.ul`
|
|
|
3567
3577
|
origin: n = {},
|
|
3568
3578
|
activityData: { context: { productName: a, productType: r, productId: s } = {} } = {},
|
|
3569
3579
|
version: i
|
|
3570
|
-
} = e, { name:
|
|
3580
|
+
} = e, { name: l, id: m } = n;
|
|
3571
3581
|
return {
|
|
3572
|
-
name:
|
|
3582
|
+
name: l,
|
|
3573
3583
|
id: m,
|
|
3574
3584
|
productId: s,
|
|
3575
3585
|
productName: a,
|
|
@@ -3580,7 +3590,7 @@ const ls = F.ul`
|
|
|
3580
3590
|
status: i?.status,
|
|
3581
3591
|
thumbnailHash: i?.thumbnailHash
|
|
3582
3592
|
};
|
|
3583
|
-
},
|
|
3593
|
+
}, hs = 5, fs = (e = []) => {
|
|
3584
3594
|
const t = [];
|
|
3585
3595
|
let o = null;
|
|
3586
3596
|
for (const n of e) {
|
|
@@ -3592,10 +3602,10 @@ const ls = F.ul`
|
|
|
3592
3602
|
o = { ...n }, o.versions = [Nt(n)];
|
|
3593
3603
|
continue;
|
|
3594
3604
|
}
|
|
3595
|
-
const a = o.authorName === n.authorName, r = o.origin.id === n.origin.id, i =
|
|
3605
|
+
const a = o.authorName === n.authorName, r = o.origin.id === n.origin.id, i = Ja(
|
|
3596
3606
|
new Date(o.createdAt),
|
|
3597
3607
|
new Date(n.createdAt)
|
|
3598
|
-
) <=
|
|
3608
|
+
) <= hs;
|
|
3599
3609
|
if (a && i && r) {
|
|
3600
3610
|
o.versions.push(Nt(n));
|
|
3601
3611
|
continue;
|
|
@@ -3605,34 +3615,34 @@ const ls = F.ul`
|
|
|
3605
3615
|
}
|
|
3606
3616
|
}
|
|
3607
3617
|
return o && t.push(o), t;
|
|
3608
|
-
},
|
|
3618
|
+
}, ys = (e, t) => {
|
|
3609
3619
|
let o = {};
|
|
3610
|
-
t.reduce((i,
|
|
3620
|
+
t.reduce((i, l) => (i[l.name] = l, i), o);
|
|
3611
3621
|
const n = [];
|
|
3612
3622
|
let a = [];
|
|
3613
3623
|
const r = (i) => {
|
|
3614
|
-
const
|
|
3624
|
+
const l = (h) => ["assignee.add", "assignee.remove"].includes(h[0].activityType) ? [
|
|
3615
3625
|
{
|
|
3616
3626
|
...h[0],
|
|
3617
3627
|
activityType: h[0].activityType,
|
|
3618
3628
|
assignee: [
|
|
3619
3629
|
...h.map(
|
|
3620
|
-
(
|
|
3630
|
+
(b) => o[b.activityData.assignee]?.attrib?.fullName || b.activityData.assignee
|
|
3621
3631
|
)
|
|
3622
3632
|
].join(", "),
|
|
3623
3633
|
activityData: {
|
|
3624
3634
|
...h[0].activityData,
|
|
3625
3635
|
assignee: h.map(
|
|
3626
|
-
(
|
|
3636
|
+
(b) => o[b.activityData.assignee]?.attrib?.fullName || b.activityData.assignee
|
|
3627
3637
|
).join(", ")
|
|
3628
3638
|
}
|
|
3629
3639
|
}
|
|
3630
3640
|
] : h;
|
|
3631
3641
|
let m = [], p = [], g = null, u = null;
|
|
3632
3642
|
return i.forEach((h) => {
|
|
3633
|
-
g === null || g === h.activityType && u == h.authorName ? p.push(h) : (m.push(...
|
|
3634
|
-
}), p.length != 0 && m.push(...
|
|
3635
|
-
}, s = (i,
|
|
3643
|
+
g === null || g === h.activityType && u == h.authorName ? p.push(h) : (m.push(...l(p)), p = [h]), g = h.activityType, u = h.authorName;
|
|
3644
|
+
}), p.length != 0 && m.push(...l(p)), m;
|
|
3645
|
+
}, s = (i, l) => {
|
|
3636
3646
|
if (a.length > 2) {
|
|
3637
3647
|
if (i) {
|
|
3638
3648
|
const m = a[0].activityData.assignee;
|
|
@@ -3647,20 +3657,20 @@ const ls = F.ul`
|
|
|
3647
3657
|
n.push({
|
|
3648
3658
|
activityType: "group",
|
|
3649
3659
|
items: r(i ? a.slice(1) : a),
|
|
3650
|
-
activityId: "group-" +
|
|
3660
|
+
activityId: "group-" + l
|
|
3651
3661
|
});
|
|
3652
3662
|
} else a.length > 0 && a.forEach((m) => n.push(m));
|
|
3653
3663
|
a = [];
|
|
3654
3664
|
};
|
|
3655
3665
|
for (const i of e)
|
|
3656
|
-
if (
|
|
3666
|
+
if (vs.includes(i.activityType))
|
|
3657
3667
|
a.push(i);
|
|
3658
3668
|
else {
|
|
3659
|
-
const
|
|
3660
|
-
s(
|
|
3669
|
+
const l = n.length === 0;
|
|
3670
|
+
s(l, n.length), n.push(i);
|
|
3661
3671
|
}
|
|
3662
3672
|
return a.length > 0 && s(!1, n.length), n;
|
|
3663
|
-
},
|
|
3673
|
+
}, bn = (e, t, o = "oldValue") => {
|
|
3664
3674
|
const n = [];
|
|
3665
3675
|
let a = null, r = null;
|
|
3666
3676
|
for (const s of e)
|
|
@@ -3669,104 +3679,104 @@ const ls = F.ul`
|
|
|
3669
3679
|
a = { ...s }, r = new Date(s.createdAt);
|
|
3670
3680
|
continue;
|
|
3671
3681
|
}
|
|
3672
|
-
const i = a.authorName === s.authorName,
|
|
3673
|
-
i && u &&
|
|
3682
|
+
const i = a.authorName === s.authorName, l = a.origin.id === s.entityId, m = a.activityData?.key === s.activityData?.key, p = new Date(s.createdAt), u = r !== null && Ke(r) && Ke(p) && Math.abs(Ka(r, p)) <= 20;
|
|
3683
|
+
i && u && l && m ? (s[o] !== void 0 && (a[o] = s[o]), a.activityData = {
|
|
3674
3684
|
...a.activityData,
|
|
3675
3685
|
oldValue: s.activityData.oldValue
|
|
3676
3686
|
}, a.hasPreviousPage = s.hasPreviousPage, a.cursor = s.cursor, r = p) : (a.activityData.oldValue !== a.activityData.newValue && n.push(a), a = { ...s }, r = p);
|
|
3677
3687
|
} else
|
|
3678
3688
|
a && (a.activityData.oldValue !== a.activityData.newValue && n.push(a), a = null, r = null), n.push(s);
|
|
3679
3689
|
return a && a.activityData.oldValue !== a.activityData.newValue && !n.some((s) => s.activityId === a.activityId) && n.push(a), n;
|
|
3680
|
-
},
|
|
3690
|
+
}, vs = [
|
|
3681
3691
|
"status.change",
|
|
3682
3692
|
"assignee.add",
|
|
3683
3693
|
"assignee.remove",
|
|
3684
3694
|
"attrib.change",
|
|
3685
3695
|
"tags.change",
|
|
3686
3696
|
"subtype.change"
|
|
3687
|
-
],
|
|
3697
|
+
], bs = (e = [], t = {}) => e.map((o) => {
|
|
3688
3698
|
const n = { ...o, origin: { ...o.origin } };
|
|
3689
3699
|
if (n.activityType === "status.change") {
|
|
3690
3700
|
if (!t) return n;
|
|
3691
|
-
const a = n.activityData?.oldValue, r = n.activityData?.newValue, s = t.statuses?.find((
|
|
3701
|
+
const a = n.activityData?.oldValue, r = n.activityData?.newValue, s = t.statuses?.find((l) => l.name === a), i = t.statuses?.find((l) => l.name === r);
|
|
3692
3702
|
n.oldStatus = { ...s, name: a }, n.newStatus = { ...i, name: r };
|
|
3693
3703
|
}
|
|
3694
3704
|
return n;
|
|
3695
|
-
}),
|
|
3696
|
-
const s =
|
|
3697
|
-
() =>
|
|
3705
|
+
}), ws = (e = [], t = [], o) => t.includes(o) ? e.filter((n) => n.referenceType !== "relation") : e, xs = (e = [], t = [], o = {}, n, a, r) => {
|
|
3706
|
+
const s = I(
|
|
3707
|
+
() => bs(e, o),
|
|
3698
3708
|
[e, o]
|
|
3699
|
-
), i =
|
|
3700
|
-
() =>
|
|
3709
|
+
), i = I(() => s.map((y) => ({ ...y, isOwner: a === y.authorName })), [s, a]), l = I(
|
|
3710
|
+
() => ws(i, ["version"], n),
|
|
3701
3711
|
[i, n]
|
|
3702
|
-
), m =
|
|
3703
|
-
const C = new Date(D.createdAt), f = new Date(
|
|
3704
|
-
if (!
|
|
3712
|
+
), m = I(() => [...l].sort((D, M) => {
|
|
3713
|
+
const C = new Date(D.createdAt), f = new Date(M.createdAt), w = Ke(C), A = Ke(f);
|
|
3714
|
+
if (!w && !A)
|
|
3705
3715
|
return 0;
|
|
3706
|
-
if (
|
|
3707
|
-
if (!
|
|
3716
|
+
if (w) {
|
|
3717
|
+
if (!A)
|
|
3708
3718
|
return -1;
|
|
3709
3719
|
} else return 1;
|
|
3710
|
-
return
|
|
3711
|
-
}), [
|
|
3712
|
-
() =>
|
|
3720
|
+
return Xa(f, C);
|
|
3721
|
+
}), [l]), p = I(
|
|
3722
|
+
() => bn(m, "status.change", "oldStatus"),
|
|
3713
3723
|
[m]
|
|
3714
|
-
), g =
|
|
3715
|
-
() =>
|
|
3724
|
+
), g = I(
|
|
3725
|
+
() => bn(p, "attrib.change"),
|
|
3716
3726
|
[p]
|
|
3717
|
-
), u =
|
|
3727
|
+
), u = I(() => r?.conditions?.some(
|
|
3718
3728
|
(D) => "key" in D && D.key === "updates" && D.value === !0
|
|
3719
|
-
) ? g :
|
|
3720
|
-
() =>
|
|
3729
|
+
) ? g : ys(g, t), [g, t, r]), h = I(
|
|
3730
|
+
() => fs(u),
|
|
3721
3731
|
[u]
|
|
3722
3732
|
);
|
|
3723
|
-
return
|
|
3733
|
+
return I(() => [...new Map(
|
|
3724
3734
|
h.filter((D) => D && D.activityId).map((D) => [D.activityId, D])
|
|
3725
3735
|
).values()], [h]);
|
|
3726
|
-
},
|
|
3736
|
+
}, wn = (e, t) => JSON.stringify({ entities: e.map((o) => o.id), filter: t }), ks = ({
|
|
3727
3737
|
entities: e = [],
|
|
3728
3738
|
feedRef: t,
|
|
3729
3739
|
filter: o,
|
|
3730
3740
|
disabled: n,
|
|
3731
3741
|
isLoading: a
|
|
3732
3742
|
}) => {
|
|
3733
|
-
const r =
|
|
3734
|
-
const
|
|
3743
|
+
const r = pe({}), s = (i) => {
|
|
3744
|
+
const l = i.current.querySelectorAll(".scroll-to"), m = Array.from(l).map((g) => g.closest("li.comment"));
|
|
3735
3745
|
return (m[m.length - 1]?.offsetTop || 0) - 8 || 0;
|
|
3736
3746
|
};
|
|
3737
|
-
|
|
3738
|
-
const i =
|
|
3747
|
+
W(() => {
|
|
3748
|
+
const i = wn(e, o);
|
|
3739
3749
|
!t.current || n || a || (t.current.scrollTop = r.current[i] || s(t));
|
|
3740
|
-
}, [e, o, t.current, a]),
|
|
3750
|
+
}, [e, o, t.current, a]), W(() => {
|
|
3741
3751
|
let i = null;
|
|
3742
3752
|
if (!t.current || n) return;
|
|
3743
|
-
const
|
|
3753
|
+
const l = (m) => {
|
|
3744
3754
|
if (i)
|
|
3745
3755
|
return;
|
|
3746
3756
|
i = setTimeout(() => {
|
|
3747
3757
|
i = null;
|
|
3748
3758
|
}, 300);
|
|
3749
|
-
const { scrollTop: p } = m.target, g =
|
|
3759
|
+
const { scrollTop: p } = m.target, g = wn(e, o);
|
|
3750
3760
|
r.current[g] = p;
|
|
3751
3761
|
};
|
|
3752
|
-
return t.current?.addEventListener("scroll",
|
|
3753
|
-
t.current?.removeEventListener("scroll",
|
|
3762
|
+
return t.current?.addEventListener("scroll", l), () => {
|
|
3763
|
+
t.current?.removeEventListener("scroll", l);
|
|
3754
3764
|
};
|
|
3755
3765
|
}, [t.current, o, e, n]);
|
|
3756
|
-
},
|
|
3757
|
-
|
|
3766
|
+
}, As = ({ feedRef: e, isInputOpen: t, height: o }) => {
|
|
3767
|
+
W(() => {
|
|
3758
3768
|
if (!e.current) return;
|
|
3759
3769
|
const n = o;
|
|
3760
3770
|
e.current.scrollTop === 0 || (t ? e.current.scrollBy(0, n) : e.current.scrollBy(0, -n));
|
|
3761
3771
|
}, [t, e, o]);
|
|
3762
|
-
},
|
|
3763
|
-
|
|
3772
|
+
}, Fs = (e = 50, t = 200) => Math.floor(Math.random() * (t - e + 1) + e), Cs = (e) => new Array(e).fill(0).map((t, o) => /* @__PURE__ */ c(
|
|
3773
|
+
ps,
|
|
3764
3774
|
{
|
|
3765
3775
|
className: "loading",
|
|
3766
|
-
style: { minHeight:
|
|
3776
|
+
style: { minHeight: Fs(50, 150) }
|
|
3767
3777
|
},
|
|
3768
3778
|
o
|
|
3769
|
-
)),
|
|
3779
|
+
)), Ts = ({
|
|
3770
3780
|
feedRef: e,
|
|
3771
3781
|
highlighted: t = [],
|
|
3772
3782
|
isLoading: o,
|
|
@@ -3774,26 +3784,26 @@ const ls = F.ul`
|
|
|
3774
3784
|
hasNextPage: a,
|
|
3775
3785
|
activities: r
|
|
3776
3786
|
}) => {
|
|
3777
|
-
const s =
|
|
3787
|
+
const s = pe([]), i = async (m, p = 0) => {
|
|
3778
3788
|
if (!n) return null;
|
|
3779
3789
|
const g = m.querySelector("li.isHighlighted");
|
|
3780
3790
|
if (g) return g;
|
|
3781
3791
|
if (p++, p > 10) return null;
|
|
3782
3792
|
const u = await n();
|
|
3783
|
-
return !u || !u.hasNextPage ? null : (await new Promise((
|
|
3784
|
-
},
|
|
3793
|
+
return !u || !u.hasNextPage ? null : (await new Promise((b) => requestAnimationFrame(() => b())), i(m, p));
|
|
3794
|
+
}, l = async (m) => {
|
|
3785
3795
|
const p = await i(m);
|
|
3786
3796
|
if (!p) {
|
|
3787
3797
|
console.error("No highlighted element found");
|
|
3788
3798
|
return;
|
|
3789
3799
|
}
|
|
3790
|
-
const g = p.offsetTop, u = p.offsetHeight, h = m.offsetHeight || 0,
|
|
3800
|
+
const g = p.offsetTop, u = p.offsetHeight, h = m.offsetHeight || 0, b = 64, D = u + b > h ? g - 16 : g + u - h + b;
|
|
3791
3801
|
console.log("FOUND: scrolling to highlighted..."), m.scrollTo({ top: D }), s.current = t;
|
|
3792
3802
|
};
|
|
3793
|
-
|
|
3794
|
-
!t.length || !e.current || o || !n || t.every((m) => s.current?.includes(m)) || (console.log("trying to scroll to highlighted..."),
|
|
3803
|
+
W(() => {
|
|
3804
|
+
!t.length || !e.current || o || !n || t.every((m) => s.current?.includes(m)) || (console.log("trying to scroll to highlighted..."), l(e.current));
|
|
3795
3805
|
}, [e, t, r, o, n, s, a]);
|
|
3796
|
-
},
|
|
3806
|
+
}, Ds = (e) => e.map((t) => {
|
|
3797
3807
|
if (t.activityType !== "comment" || !t.activityData?.annotations) return t;
|
|
3798
3808
|
const o = t.files.map((a) => {
|
|
3799
3809
|
const r = t.activityData.annotations.find(
|
|
@@ -3802,79 +3812,79 @@ const ls = F.ul`
|
|
|
3802
3812
|
return r ? r.transparent === a.id ? null : { ...a, annotation: r } : a;
|
|
3803
3813
|
}).filter(Boolean);
|
|
3804
3814
|
return { ...t, files: o };
|
|
3805
|
-
}),
|
|
3815
|
+
}), eo = [
|
|
3806
3816
|
"comments",
|
|
3807
3817
|
"versions",
|
|
3808
3818
|
"updates",
|
|
3809
3819
|
"checklists",
|
|
3810
3820
|
"has_attachments",
|
|
3811
3821
|
"in_review_session"
|
|
3812
|
-
],
|
|
3822
|
+
], Ns = (e) => !!e && "key" in e, Is = (e, t) => {
|
|
3813
3823
|
const o = [], n = [], a = (r) => {
|
|
3814
3824
|
if (!r) return;
|
|
3815
|
-
if (
|
|
3825
|
+
if (Ns(r)) {
|
|
3816
3826
|
const i = r.key;
|
|
3817
3827
|
if (i === "body") {
|
|
3818
3828
|
const p = String(r.value ?? "");
|
|
3819
3829
|
p && n.push({ id: p, label: p });
|
|
3820
3830
|
return;
|
|
3821
3831
|
}
|
|
3822
|
-
const
|
|
3823
|
-
if (!
|
|
3824
|
-
if (
|
|
3832
|
+
const l = t.find((p) => p.id === i);
|
|
3833
|
+
if (!l) return;
|
|
3834
|
+
if (eo.includes(i)) {
|
|
3825
3835
|
r.value === !0 && o.push({
|
|
3826
|
-
id:
|
|
3827
|
-
label:
|
|
3828
|
-
icon:
|
|
3836
|
+
id: on(i),
|
|
3837
|
+
label: l.label,
|
|
3838
|
+
icon: l.icon,
|
|
3829
3839
|
type: "boolean",
|
|
3830
3840
|
singleSelect: !0,
|
|
3831
3841
|
// value label = filter name so the compact chip (label hidden) reads
|
|
3832
3842
|
// e.g. "Checklists" instead of "Yes"
|
|
3833
|
-
values: [{ id: "true", label:
|
|
3843
|
+
values: [{ id: "true", label: l.label }]
|
|
3834
3844
|
});
|
|
3835
3845
|
return;
|
|
3836
3846
|
}
|
|
3837
3847
|
const m = Array.isArray(r.value) ? r.value : [r.value];
|
|
3838
3848
|
o.push({
|
|
3839
|
-
id:
|
|
3840
|
-
label:
|
|
3841
|
-
type:
|
|
3842
|
-
icon:
|
|
3843
|
-
singleSelect:
|
|
3849
|
+
id: on(i),
|
|
3850
|
+
label: l.label,
|
|
3851
|
+
type: l.type,
|
|
3852
|
+
icon: l.icon,
|
|
3853
|
+
singleSelect: l.singleSelect,
|
|
3844
3854
|
operator: "OR",
|
|
3845
3855
|
values: m.map((p) => {
|
|
3846
|
-
const g =
|
|
3856
|
+
const g = l.values?.find((u) => u.id === String(p));
|
|
3847
3857
|
return g ? { ...g } : { id: String(p), label: String(p) };
|
|
3848
3858
|
})
|
|
3849
3859
|
});
|
|
3850
3860
|
return;
|
|
3851
3861
|
}
|
|
3852
|
-
const s =
|
|
3862
|
+
const s = nr(r, t);
|
|
3853
3863
|
if (s) {
|
|
3854
3864
|
o.push(s);
|
|
3855
3865
|
return;
|
|
3856
3866
|
}
|
|
3857
3867
|
r.conditions?.forEach(a);
|
|
3858
3868
|
};
|
|
3859
|
-
return e?.conditions?.forEach(a), n.length && o.push({ id:
|
|
3860
|
-
},
|
|
3869
|
+
return e?.conditions?.forEach(a), n.length && o.push({ id: Nn, label: "", values: n }), o;
|
|
3870
|
+
}, Ss = (e) => {
|
|
3861
3871
|
const t = [], o = [];
|
|
3862
3872
|
return e.forEach((n) => {
|
|
3863
|
-
const a =
|
|
3873
|
+
const a = _o(n.id), r = (n.values || []).map((s) => s.id);
|
|
3864
3874
|
if (r.length)
|
|
3865
|
-
if (a ===
|
|
3875
|
+
if (a === Nn)
|
|
3866
3876
|
r.forEach(
|
|
3867
3877
|
(s) => o.push({ key: "body", operator: "like", value: String(s) })
|
|
3868
3878
|
);
|
|
3869
|
-
else if (
|
|
3879
|
+
else if (eo.includes(a))
|
|
3870
3880
|
r.includes("true") && t.push({ key: a, operator: "eq", value: !0 });
|
|
3871
3881
|
else if (n.type === "datetime") {
|
|
3872
|
-
const s =
|
|
3882
|
+
const s = or(a, n);
|
|
3873
3883
|
s && t.push(s);
|
|
3874
3884
|
} else
|
|
3875
3885
|
t.push({ key: a, operator: "in", value: r.map(String) });
|
|
3876
3886
|
}), o.length === 1 ? t.push(o[0]) : o.length > 1 && t.push({ operator: "or", conditions: o }), { operator: "and", conditions: t };
|
|
3877
|
-
},
|
|
3887
|
+
}, Es = F.div`
|
|
3878
3888
|
padding: 4px 8px;
|
|
3879
3889
|
padding-bottom: 0;
|
|
3880
3890
|
filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.25));
|
|
@@ -3889,7 +3899,7 @@ const ls = F.ul`
|
|
|
3889
3899
|
opacity: 0.5;
|
|
3890
3900
|
pointer-events: none;
|
|
3891
3901
|
}
|
|
3892
|
-
`,
|
|
3902
|
+
`, to = ft(
|
|
3893
3903
|
({
|
|
3894
3904
|
feedFilter: e,
|
|
3895
3905
|
setFeedFilter: t,
|
|
@@ -3900,11 +3910,11 @@ const ls = F.ul`
|
|
|
3900
3910
|
checklistCount: s,
|
|
3901
3911
|
onSearchTextChange: i
|
|
3902
3912
|
}) => {
|
|
3903
|
-
const
|
|
3904
|
-
const f = (
|
|
3905
|
-
id:
|
|
3906
|
-
label:
|
|
3907
|
-
icon:
|
|
3913
|
+
const l = I(() => {
|
|
3914
|
+
const f = (A, S, P) => ({
|
|
3915
|
+
id: A,
|
|
3916
|
+
label: S,
|
|
3917
|
+
icon: P,
|
|
3908
3918
|
type: "boolean",
|
|
3909
3919
|
singleSelect: !0,
|
|
3910
3920
|
values: []
|
|
@@ -3925,11 +3935,11 @@ const ls = F.ul`
|
|
|
3925
3935
|
operator: "OR",
|
|
3926
3936
|
values: [
|
|
3927
3937
|
{ id: "__none__", label: "No category", icon: "crop_square" },
|
|
3928
|
-
...n.map((
|
|
3929
|
-
id:
|
|
3930
|
-
label:
|
|
3938
|
+
...n.map((A) => ({
|
|
3939
|
+
id: A.name,
|
|
3940
|
+
label: A.name,
|
|
3931
3941
|
icon: "crop_square",
|
|
3932
|
-
color:
|
|
3942
|
+
color: A.color
|
|
3933
3943
|
}))
|
|
3934
3944
|
]
|
|
3935
3945
|
}
|
|
@@ -3940,10 +3950,10 @@ const ls = F.ul`
|
|
|
3940
3950
|
icon: "person",
|
|
3941
3951
|
type: "list_of_strings",
|
|
3942
3952
|
operator: "OR",
|
|
3943
|
-
values: o.map((
|
|
3944
|
-
id:
|
|
3945
|
-
label:
|
|
3946
|
-
img: `/api/users/${
|
|
3953
|
+
values: o.map((A) => ({
|
|
3954
|
+
id: A.name,
|
|
3955
|
+
label: A.attrib?.fullName || A.name,
|
|
3956
|
+
img: `/api/users/${A.name}/avatar`
|
|
3947
3957
|
}))
|
|
3948
3958
|
},
|
|
3949
3959
|
{
|
|
@@ -3951,85 +3961,85 @@ const ls = F.ul`
|
|
|
3951
3961
|
label: "Posted date",
|
|
3952
3962
|
icon: "calendar_today",
|
|
3953
3963
|
type: "datetime",
|
|
3954
|
-
values:
|
|
3964
|
+
values: ya()
|
|
3955
3965
|
}
|
|
3956
3966
|
];
|
|
3957
3967
|
}, [o, n, a]);
|
|
3958
3968
|
let m = "";
|
|
3959
3969
|
s?.total && s.total > 0 && (m = `${s.checked}/${s.total}`);
|
|
3960
|
-
const p =
|
|
3970
|
+
const p = I(
|
|
3961
3971
|
() => ["comments", { id: "checklists", label: m, tooltip: "Checklists" }],
|
|
3962
3972
|
[m]
|
|
3963
|
-
), g =
|
|
3964
|
-
() =>
|
|
3965
|
-
[e,
|
|
3966
|
-
), [u, h] = L(g),
|
|
3967
|
-
|
|
3973
|
+
), g = I(
|
|
3974
|
+
() => Is(e, l),
|
|
3975
|
+
[e, l]
|
|
3976
|
+
), [u, h] = L(g), b = sr(), y = pe(null);
|
|
3977
|
+
W(() => {
|
|
3968
3978
|
h(g);
|
|
3969
|
-
}, [JSON.stringify(g)]),
|
|
3970
|
-
const f = (
|
|
3971
|
-
const
|
|
3972
|
-
|
|
3979
|
+
}, [JSON.stringify(g)]), W(() => {
|
|
3980
|
+
const f = (w) => {
|
|
3981
|
+
const A = y.current?.getContainerElement();
|
|
3982
|
+
A && !A.contains(w.target) && y.current?.close();
|
|
3973
3983
|
};
|
|
3974
3984
|
return document.addEventListener("mousedown", f), () => {
|
|
3975
3985
|
document.removeEventListener("mousedown", f);
|
|
3976
3986
|
};
|
|
3977
3987
|
}, [y]);
|
|
3978
3988
|
const D = (f) => {
|
|
3979
|
-
t(
|
|
3989
|
+
t(Ss(f)), i?.("");
|
|
3980
3990
|
};
|
|
3981
|
-
return /* @__PURE__ */
|
|
3982
|
-
/* @__PURE__ */
|
|
3983
|
-
|
|
3991
|
+
return /* @__PURE__ */ x(Es, { className: r ? "loading" : void 0, children: [
|
|
3992
|
+
/* @__PURE__ */ c(
|
|
3993
|
+
Ro,
|
|
3984
3994
|
{
|
|
3985
3995
|
ref: y,
|
|
3986
3996
|
compact: !0,
|
|
3987
|
-
options:
|
|
3997
|
+
options: l,
|
|
3988
3998
|
filters: u,
|
|
3989
3999
|
onChange: (f) => {
|
|
3990
|
-
|
|
4000
|
+
b.wrapFilterChange(f, u, h);
|
|
3991
4001
|
},
|
|
3992
4002
|
onFinish: D,
|
|
3993
4003
|
enableGlobalSearch: !0,
|
|
3994
4004
|
enableMultipleSameFilters: !1,
|
|
3995
4005
|
enableAutosuggestion: !1,
|
|
3996
|
-
onSearchChange: (f,
|
|
3997
|
-
|
|
4006
|
+
onSearchChange: (f, w) => {
|
|
4007
|
+
w || i?.(f);
|
|
3998
4008
|
},
|
|
3999
4009
|
quickActions: p,
|
|
4000
4010
|
placeholder: "Search and filter feed...",
|
|
4001
4011
|
pt: {
|
|
4002
4012
|
searchBar: {
|
|
4003
|
-
onClickCapture: (f) =>
|
|
4013
|
+
onClickCapture: (f) => b.handleSearchBarClickCapture(f, u)
|
|
4004
4014
|
},
|
|
4005
4015
|
dropdown: {
|
|
4006
4016
|
pt: {
|
|
4007
4017
|
item: {
|
|
4008
|
-
onClick: (f) =>
|
|
4018
|
+
onClick: (f) => b.handleDropdownItemClick(f, u, l)
|
|
4009
4019
|
}
|
|
4010
4020
|
}
|
|
4011
4021
|
}
|
|
4012
4022
|
}
|
|
4013
4023
|
}
|
|
4014
4024
|
),
|
|
4015
|
-
/* @__PURE__ */
|
|
4016
|
-
|
|
4025
|
+
/* @__PURE__ */ c(
|
|
4026
|
+
Ua,
|
|
4017
4027
|
{
|
|
4018
|
-
isOpen: !!
|
|
4019
|
-
header:
|
|
4020
|
-
startDate:
|
|
4021
|
-
endDate:
|
|
4022
|
-
onStartDateChange:
|
|
4023
|
-
onEndDateChange:
|
|
4024
|
-
onApply: () =>
|
|
4025
|
-
onClose:
|
|
4028
|
+
isOpen: !!b.customRangeFilterId,
|
|
4029
|
+
header: l.find((f) => f.id === b.customRangeFilterId?.split("__")[0])?.label ?? "Custom range",
|
|
4030
|
+
startDate: b.customStartDate,
|
|
4031
|
+
endDate: b.customEndDate,
|
|
4032
|
+
onStartDateChange: b.setCustomStartDate,
|
|
4033
|
+
onEndDateChange: b.setCustomEndDate,
|
|
4034
|
+
onApply: () => b.handleCustomRangeApply(u, l, D, y),
|
|
4035
|
+
onClose: b.handleCustomRangeClose
|
|
4026
4036
|
}
|
|
4027
4037
|
)
|
|
4028
4038
|
] });
|
|
4029
4039
|
}
|
|
4030
4040
|
);
|
|
4031
|
-
|
|
4032
|
-
function
|
|
4041
|
+
to.displayName = "FeedSearchFilter";
|
|
4042
|
+
function Ms({
|
|
4033
4043
|
projectName: e,
|
|
4034
4044
|
enabled: t,
|
|
4035
4045
|
entityIds: o,
|
|
@@ -4037,10 +4047,10 @@ function Is({
|
|
|
4037
4047
|
loadingActivities: a,
|
|
4038
4048
|
userName: r
|
|
4039
4049
|
}) {
|
|
4040
|
-
const s =
|
|
4050
|
+
const s = I(
|
|
4041
4051
|
() => n.find((p) => p.activityType === "version.review" && p.authorName === r),
|
|
4042
4052
|
[n, r]
|
|
4043
|
-
), i = !!(o.length === 0 || !t || a || s), { data:
|
|
4053
|
+
), i = !!(o.length === 0 || !t || a || s), { data: l } = Pa(
|
|
4044
4054
|
{
|
|
4045
4055
|
projectName: e,
|
|
4046
4056
|
entityIds: o,
|
|
@@ -4050,27 +4060,27 @@ function Is({
|
|
|
4050
4060
|
},
|
|
4051
4061
|
{ skip: i }
|
|
4052
4062
|
);
|
|
4053
|
-
return
|
|
4063
|
+
return I(() => s ?? l?.activities.at(-1), [s, l]);
|
|
4054
4064
|
}
|
|
4055
|
-
const
|
|
4056
|
-
const a =
|
|
4065
|
+
const Ps = (e) => !!e.activityData?.annotations?.length || !!yt(e), _s = ({ projectName: e, entityType: t, entities: o, activities: n }) => {
|
|
4066
|
+
const a = I(
|
|
4057
4067
|
() => t === "version" ? Object.fromEntries(
|
|
4058
4068
|
o.filter((i) => i.attrib).map((i) => [i.id, i.attrib?.frameStart ?? null])
|
|
4059
4069
|
) : {},
|
|
4060
4070
|
[t, o]
|
|
4061
|
-
), r =
|
|
4071
|
+
), r = I(() => {
|
|
4062
4072
|
const i = /* @__PURE__ */ new Set();
|
|
4063
|
-
for (const
|
|
4064
|
-
const m =
|
|
4065
|
-
|
|
4073
|
+
for (const l of n) {
|
|
4074
|
+
const m = l.origin;
|
|
4075
|
+
l.activityType !== "comment" || m?.type !== "version" || m.id in a || !Ps(l) || i.add(m.id);
|
|
4066
4076
|
}
|
|
4067
4077
|
return [...i].sort();
|
|
4068
|
-
}, [n, a]), { data: s } =
|
|
4078
|
+
}, [n, a]), { data: s } = _a(
|
|
4069
4079
|
{ projectName: e, versionIds: r },
|
|
4070
4080
|
{ skip: !e || !r.length }
|
|
4071
4081
|
);
|
|
4072
|
-
return
|
|
4073
|
-
},
|
|
4082
|
+
return I(() => ({ ...s, ...a }), [s, a]);
|
|
4083
|
+
}, Rc = 30, Lc = ({
|
|
4074
4084
|
disabled: e,
|
|
4075
4085
|
readOnly: t,
|
|
4076
4086
|
statuses: o = [],
|
|
@@ -4081,249 +4091,265 @@ const Es = (e) => !!e.activityData?.annotations?.length || !!yt(e), Ms = ({ proj
|
|
|
4081
4091
|
}) => {
|
|
4082
4092
|
const {
|
|
4083
4093
|
projectName: i,
|
|
4084
|
-
entities:
|
|
4094
|
+
entities: l,
|
|
4085
4095
|
entityType: m,
|
|
4086
4096
|
editingId: p,
|
|
4087
4097
|
projectInfo: g,
|
|
4088
4098
|
setEditingId: u,
|
|
4089
4099
|
userName: h,
|
|
4090
|
-
activitiesData:
|
|
4100
|
+
activitiesData: b,
|
|
4091
4101
|
isLoadingNew: y,
|
|
4092
4102
|
isLoadingNextPage: D,
|
|
4093
|
-
loadNextPage:
|
|
4103
|
+
loadNextPage: M,
|
|
4094
4104
|
hasNextPage: C,
|
|
4095
4105
|
users: f,
|
|
4096
|
-
categories:
|
|
4097
|
-
checklistCount:
|
|
4098
|
-
feedFilter:
|
|
4099
|
-
setFeedFilter:
|
|
4100
|
-
isGuest:
|
|
4106
|
+
categories: w,
|
|
4107
|
+
checklistCount: A,
|
|
4108
|
+
feedFilter: S,
|
|
4109
|
+
setFeedFilter: P,
|
|
4110
|
+
isGuest: _,
|
|
4101
4111
|
searchText: E,
|
|
4102
4112
|
setSearchText: N
|
|
4103
4113
|
} = $e(), {
|
|
4104
|
-
openSlideOut:
|
|
4105
|
-
highlightedActivities:
|
|
4106
|
-
setHighlightedActivities:
|
|
4107
|
-
onOpenImage:
|
|
4108
|
-
setFeedAnnotations:
|
|
4114
|
+
openSlideOut: G,
|
|
4115
|
+
highlightedActivities: X,
|
|
4116
|
+
setHighlightedActivities: Q,
|
|
4117
|
+
onOpenImage: Z,
|
|
4118
|
+
setFeedAnnotations: Y,
|
|
4109
4119
|
setFeedFrameLinks: $,
|
|
4110
|
-
user:
|
|
4111
|
-
} =
|
|
4112
|
-
(
|
|
4113
|
-
),
|
|
4114
|
-
(
|
|
4115
|
-
),
|
|
4116
|
-
(
|
|
4117
|
-
), de = m === "version" || m === "folder", { data:
|
|
4118
|
-
() =>
|
|
4119
|
-
[
|
|
4120
|
+
user: oe
|
|
4121
|
+
} = Be(), ae = S.conditions?.some(
|
|
4122
|
+
(T) => "key" in T && T.key === "versions" && T.value === !0
|
|
4123
|
+
), J = S.conditions?.some(
|
|
4124
|
+
(T) => "key" in T && ["comments", "checklists", "versions", "updates"].includes(T.key) && T.value === !0
|
|
4125
|
+
), j = S.conditions?.some(
|
|
4126
|
+
(T) => "key" in T && (T.key === "comments" || T.key === "checklists") && T.value === !0
|
|
4127
|
+
), de = m === "version" || m === "folder", H = m === "folder" && l.length === 1 ? l[0] : null, ee = f.find((T) => T.name === H?.createdBy), { data: Oe, isLoading: De } = Ra({ projectName: i }, { skip: !i }), be = !oe.data?.isManager && !oe.data?.isAdmin && !De && Oe?.activities?.enabled && !Oe?.activities?.activities?.includes("comment") || J && !j, ge = I(
|
|
4128
|
+
() => Ds(b),
|
|
4129
|
+
[b]
|
|
4120
4130
|
);
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
const
|
|
4124
|
-
(
|
|
4125
|
-
...
|
|
4126
|
-
activityId:
|
|
4131
|
+
W(() => {
|
|
4132
|
+
ge.length || Y([]);
|
|
4133
|
+
const T = ge.map(
|
|
4134
|
+
(R) => R.activityData?.annotations?.map((U) => ({
|
|
4135
|
+
...U,
|
|
4136
|
+
activityId: R.activityId
|
|
4127
4137
|
}))
|
|
4128
4138
|
).filter(Boolean).flat();
|
|
4129
|
-
|
|
4130
|
-
}, [
|
|
4131
|
-
const
|
|
4132
|
-
const
|
|
4133
|
-
return
|
|
4134
|
-
}).filter((
|
|
4135
|
-
$(
|
|
4136
|
-
}, [
|
|
4137
|
-
const
|
|
4139
|
+
Y(T);
|
|
4140
|
+
}, [ge]), W(() => {
|
|
4141
|
+
const T = b.map((R) => {
|
|
4142
|
+
const U = yt(R);
|
|
4143
|
+
return U && { ...U, activityId: R.activityId };
|
|
4144
|
+
}).filter((R) => !!R);
|
|
4145
|
+
$(T);
|
|
4146
|
+
}, [b]);
|
|
4147
|
+
const Ge = _s({
|
|
4138
4148
|
projectName: i,
|
|
4139
4149
|
entityType: m,
|
|
4140
|
-
entities:
|
|
4141
|
-
activities:
|
|
4142
|
-
}),
|
|
4150
|
+
entities: l,
|
|
4151
|
+
activities: b
|
|
4152
|
+
}), ue = xs(
|
|
4143
4153
|
// @ts-ignore
|
|
4144
|
-
|
|
4154
|
+
ge,
|
|
4145
4155
|
f,
|
|
4146
4156
|
g,
|
|
4147
4157
|
m,
|
|
4148
4158
|
h,
|
|
4149
|
-
|
|
4150
|
-
),
|
|
4151
|
-
if (!E) return
|
|
4152
|
-
const
|
|
4153
|
-
return
|
|
4154
|
-
(
|
|
4159
|
+
S
|
|
4160
|
+
), xe = I(() => {
|
|
4161
|
+
if (!E) return ue;
|
|
4162
|
+
const T = E.toLowerCase();
|
|
4163
|
+
return ue.filter(
|
|
4164
|
+
(R) => R.body?.toLowerCase().includes(T)
|
|
4155
4165
|
);
|
|
4156
|
-
}, [
|
|
4157
|
-
|
|
4158
|
-
entities:
|
|
4159
|
-
feedRef:
|
|
4160
|
-
filter:
|
|
4161
|
-
disabled: !!
|
|
4166
|
+
}, [ue, E]), he = pe(null);
|
|
4167
|
+
As({ feedRef: he, isInputOpen: p === rt, height: 93 }), ks({
|
|
4168
|
+
entities: l,
|
|
4169
|
+
feedRef: he,
|
|
4170
|
+
filter: S,
|
|
4171
|
+
disabled: !!X.length,
|
|
4162
4172
|
isLoading: y
|
|
4163
|
-
}),
|
|
4164
|
-
feedRef:
|
|
4165
|
-
highlighted:
|
|
4173
|
+
}), Ts({
|
|
4174
|
+
feedRef: he,
|
|
4175
|
+
highlighted: X,
|
|
4166
4176
|
isLoading: y || D,
|
|
4167
|
-
loadNextPage:
|
|
4168
|
-
hasNextPage: !!
|
|
4169
|
-
activities:
|
|
4177
|
+
loadNextPage: M,
|
|
4178
|
+
hasNextPage: !!M,
|
|
4179
|
+
activities: b
|
|
4170
4180
|
});
|
|
4171
4181
|
const {
|
|
4172
|
-
submitComment:
|
|
4173
|
-
updateComment:
|
|
4174
|
-
deleteComment:
|
|
4175
|
-
submitReview:
|
|
4176
|
-
isSaving:
|
|
4177
|
-
} =
|
|
4182
|
+
submitComment: Ne,
|
|
4183
|
+
updateComment: Ie,
|
|
4184
|
+
deleteComment: Ze,
|
|
4185
|
+
submitReview: Re,
|
|
4186
|
+
isSaving: fe
|
|
4187
|
+
} = gs({
|
|
4178
4188
|
projectName: i,
|
|
4179
4189
|
entityType: m,
|
|
4180
|
-
entities:
|
|
4181
|
-
filter:
|
|
4190
|
+
entities: l,
|
|
4191
|
+
filter: S,
|
|
4182
4192
|
entityListId: n
|
|
4183
|
-
}),
|
|
4184
|
-
async (
|
|
4185
|
-
await
|
|
4193
|
+
}), He = Je(
|
|
4194
|
+
async (T, R = [], U = {}) => {
|
|
4195
|
+
await Ne(T, R, U), he.current && he.current.scrollTo({ top: 0 });
|
|
4186
4196
|
},
|
|
4187
|
-
[
|
|
4188
|
-
),
|
|
4189
|
-
async (
|
|
4190
|
-
await
|
|
4197
|
+
[Ne, he]
|
|
4198
|
+
), qe = Je(
|
|
4199
|
+
async (T) => {
|
|
4200
|
+
await Re(T);
|
|
4191
4201
|
},
|
|
4192
|
-
[
|
|
4193
|
-
),
|
|
4194
|
-
const
|
|
4195
|
-
if (!
|
|
4196
|
-
const
|
|
4197
|
-
|
|
4198
|
-
).findIndex((
|
|
4199
|
-
let
|
|
4200
|
-
(
|
|
4201
|
-
|
|
4202
|
+
[Re]
|
|
4203
|
+
), re = (T, R) => {
|
|
4204
|
+
const U = T?.target;
|
|
4205
|
+
if (!U || !R) return console.log("no target or activity");
|
|
4206
|
+
const v = U.checked, K = v ? "[ ]" : "[x]", we = v ? "[x]" : "[ ]", { body: Ae } = R, Fe = Array.from(
|
|
4207
|
+
U.closest(".comment-body")?.querySelectorAll(".task-list-item") || []
|
|
4208
|
+
).findIndex((_e) => _e === U.closest("li"));
|
|
4209
|
+
let Le = Fe;
|
|
4210
|
+
(Ae.match(/\[.\]/g) || []).forEach((_e, mt) => {
|
|
4211
|
+
_e !== K && mt < Fe && Le--;
|
|
4202
4212
|
});
|
|
4203
|
-
const
|
|
4204
|
-
let
|
|
4205
|
-
for (; (
|
|
4206
|
-
|
|
4207
|
-
const
|
|
4208
|
-
if (
|
|
4209
|
-
const
|
|
4210
|
-
|
|
4211
|
-
},
|
|
4212
|
-
const { entityId:
|
|
4213
|
-
if (!
|
|
4213
|
+
const dt = [];
|
|
4214
|
+
let Qe = -1;
|
|
4215
|
+
for (; (Qe = Ae.indexOf(K, Qe + 1)) > -1; )
|
|
4216
|
+
dt.push(Qe);
|
|
4217
|
+
const Ye = dt[Le];
|
|
4218
|
+
if (Ye === void 0) return;
|
|
4219
|
+
const bt = Ye + K.length, ut = Ae.slice(0, Ye) + we + Ae.slice(bt);
|
|
4220
|
+
ut && Ie(R, ut, R.files);
|
|
4221
|
+
}, et = (T) => {
|
|
4222
|
+
const { entityId: R, entityType: U, activityId: v } = T;
|
|
4223
|
+
if (!U || !["version", "task", "folder"].includes(U))
|
|
4214
4224
|
return console.log("Entity type not supported yet");
|
|
4215
|
-
if (!
|
|
4216
|
-
|
|
4217
|
-
},
|
|
4218
|
-
const
|
|
4219
|
-
id:
|
|
4220
|
-
files:
|
|
4221
|
-
})).filter((
|
|
4222
|
-
|
|
4223
|
-
}, [
|
|
4224
|
-
(
|
|
4225
|
-
|
|
4225
|
+
if (!R || !U || !i) return console.log("No entity id or type found");
|
|
4226
|
+
G({ entityId: R, entityType: U, projectName: i }), Q([v]);
|
|
4227
|
+
}, je = ({ index: T, activityId: R }) => {
|
|
4228
|
+
const U = Object.values(xe).reverse().filter((v) => v.activityType == "comment").map((v) => ({
|
|
4229
|
+
id: v.activityId,
|
|
4230
|
+
files: v.files.filter((K) => vt(K.mime, K.ext))
|
|
4231
|
+
})).filter((v) => v.files.length > 0);
|
|
4232
|
+
Z?.({ files: U, activityId: R, index: T, projectName: i });
|
|
4233
|
+
}, [We, Ee] = L(null), Ue = !be && !t && !e, ke = Je(
|
|
4234
|
+
(T) => {
|
|
4235
|
+
Ee({ key: xn(), activity: T }), u(rt);
|
|
4226
4236
|
},
|
|
4227
4237
|
[u]
|
|
4228
|
-
),
|
|
4238
|
+
), Me = I(() => Cs(10), []), q = Ms({
|
|
4229
4239
|
projectName: i,
|
|
4230
4240
|
enabled: r,
|
|
4231
|
-
entityIds:
|
|
4232
|
-
activities:
|
|
4241
|
+
entityIds: l.map((T) => T.id),
|
|
4242
|
+
activities: ue,
|
|
4233
4243
|
loadingActivities: y,
|
|
4234
4244
|
userName: h
|
|
4235
4245
|
});
|
|
4236
|
-
return /* @__PURE__ */
|
|
4246
|
+
return /* @__PURE__ */ c(Te, { children: /* @__PURE__ */ x(ds, { className: "feed", children: [
|
|
4237
4247
|
void 0,
|
|
4238
|
-
/* @__PURE__ */
|
|
4239
|
-
|
|
4248
|
+
/* @__PURE__ */ c(
|
|
4249
|
+
to,
|
|
4240
4250
|
{
|
|
4241
|
-
feedFilter:
|
|
4242
|
-
setFeedFilter:
|
|
4251
|
+
feedFilter: S,
|
|
4252
|
+
setFeedFilter: P,
|
|
4243
4253
|
users: f,
|
|
4244
|
-
categories:
|
|
4254
|
+
categories: w,
|
|
4245
4255
|
supportsReviewSession: de,
|
|
4246
4256
|
isLoading: y,
|
|
4247
4257
|
onSearchTextChange: N,
|
|
4248
|
-
checklistCount:
|
|
4258
|
+
checklistCount: A
|
|
4249
4259
|
}
|
|
4250
4260
|
),
|
|
4251
|
-
/* @__PURE__ */
|
|
4252
|
-
y ?
|
|
4253
|
-
|
|
4261
|
+
/* @__PURE__ */ x(us, { ref: he, className: ne({ loading: y }, "no-shimmer"), children: [
|
|
4262
|
+
y ? Me : xe.map((T) => /* @__PURE__ */ c(
|
|
4263
|
+
Zn,
|
|
4254
4264
|
{
|
|
4255
|
-
activity:
|
|
4256
|
-
annotationFrameStart:
|
|
4257
|
-
onCheckChange:
|
|
4258
|
-
onDelete:
|
|
4259
|
-
onUpdate: async (
|
|
4260
|
-
onDuplicate:
|
|
4265
|
+
activity: T,
|
|
4266
|
+
annotationFrameStart: Ge[T.origin?.id],
|
|
4267
|
+
onCheckChange: re,
|
|
4268
|
+
onDelete: Ze,
|
|
4269
|
+
onUpdate: async (R, U, v, K) => await Ie(T, R, U, K),
|
|
4270
|
+
onDuplicate: Ue ? ke : void 0,
|
|
4261
4271
|
projectInfo: g,
|
|
4262
4272
|
projectName: i,
|
|
4263
4273
|
entityType: m,
|
|
4264
|
-
onReferenceClick:
|
|
4265
|
-
createdAts:
|
|
4266
|
-
onFileExpand:
|
|
4267
|
-
showOrigin:
|
|
4268
|
-
filter:
|
|
4274
|
+
onReferenceClick: et,
|
|
4275
|
+
createdAts: l.map((R) => R.createdAt),
|
|
4276
|
+
onFileExpand: je,
|
|
4277
|
+
showOrigin: l.length > 1,
|
|
4278
|
+
filter: S,
|
|
4269
4279
|
editProps: {
|
|
4270
4280
|
projectName: i,
|
|
4271
|
-
entities:
|
|
4281
|
+
entities: l,
|
|
4272
4282
|
entityType: m
|
|
4273
4283
|
},
|
|
4274
|
-
isHighlighted:
|
|
4284
|
+
isHighlighted: X.includes(T.activityId),
|
|
4275
4285
|
readOnly: t,
|
|
4276
4286
|
statuses: o,
|
|
4277
4287
|
isSlideOut: a,
|
|
4278
|
-
isGuest:
|
|
4288
|
+
isGuest: _
|
|
4279
4289
|
},
|
|
4280
|
-
|
|
4290
|
+
T.activityId
|
|
4281
4291
|
)),
|
|
4282
|
-
|
|
4283
|
-
C &&
|
|
4284
|
-
|
|
4292
|
+
xe.length === 0 && ae && !j && !y && /* @__PURE__ */ c(It, { message: "No versions published yet", icon: "layers" }),
|
|
4293
|
+
C && M && /* @__PURE__ */ c(
|
|
4294
|
+
tr,
|
|
4285
4295
|
{
|
|
4286
|
-
root:
|
|
4287
|
-
onChange: (
|
|
4296
|
+
root: he.current,
|
|
4297
|
+
onChange: (T) => T && M(),
|
|
4288
4298
|
rootMargin: "400px 0px 0px 0px",
|
|
4289
|
-
children: /* @__PURE__ */
|
|
4299
|
+
children: /* @__PURE__ */ c(ms, { style: { height: 0 }, onClick: () => M(), children: D ? "Loading more..." : "Click to load more" })
|
|
4290
4300
|
}
|
|
4291
|
-
)
|
|
4301
|
+
),
|
|
4302
|
+
!y && !S.conditions?.length && !E && H?.createdAt && Ke(new Date(H.createdAt)) && /* @__PURE__ */ c(Jn, { children: /* @__PURE__ */ x(Kn, { style: { alignItems: "center" }, children: [
|
|
4303
|
+
/* @__PURE__ */ x(Rt, { children: [
|
|
4304
|
+
"Folder created at ",
|
|
4305
|
+
St(new Date(H.createdAt), "PPpp"),
|
|
4306
|
+
" by"
|
|
4307
|
+
] }),
|
|
4308
|
+
H.createdBy && /* @__PURE__ */ c(
|
|
4309
|
+
va,
|
|
4310
|
+
{
|
|
4311
|
+
name: H.createdBy,
|
|
4312
|
+
fullName: ee?.attrib?.fullName || void 0,
|
|
4313
|
+
size: 20
|
|
4314
|
+
}
|
|
4315
|
+
),
|
|
4316
|
+
/* @__PURE__ */ c(Rt, { children: ee?.attrib?.fullName || H.createdBy || "Unknown" })
|
|
4317
|
+
] }) })
|
|
4292
4318
|
] }),
|
|
4293
|
-
!
|
|
4294
|
-
|
|
4319
|
+
!be && /* @__PURE__ */ c(
|
|
4320
|
+
Hn,
|
|
4295
4321
|
{
|
|
4296
4322
|
initValue: null,
|
|
4297
|
-
onSubmit:
|
|
4298
|
-
isOpen: p ===
|
|
4323
|
+
onSubmit: He,
|
|
4324
|
+
isOpen: p === rt,
|
|
4299
4325
|
onClose: () => u(null),
|
|
4300
|
-
onOpen: () => u(
|
|
4326
|
+
onOpen: () => u(rt),
|
|
4301
4327
|
disabled: e,
|
|
4302
|
-
isLoading: y || !
|
|
4328
|
+
isLoading: y || !l.length || fe,
|
|
4303
4329
|
versionReview: r,
|
|
4304
|
-
lastOwnVersionReview:
|
|
4305
|
-
onReview:
|
|
4306
|
-
duplicate:
|
|
4307
|
-
onDuplicateHandled: () =>
|
|
4330
|
+
lastOwnVersionReview: q,
|
|
4331
|
+
onReview: qe,
|
|
4332
|
+
duplicate: We,
|
|
4333
|
+
onDuplicateHandled: () => Ee(null),
|
|
4308
4334
|
saveDraft: s
|
|
4309
4335
|
}
|
|
4310
4336
|
)
|
|
4311
4337
|
] }) });
|
|
4312
4338
|
};
|
|
4313
4339
|
export {
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4340
|
+
Yr as A,
|
|
4341
|
+
Kr as C,
|
|
4342
|
+
Pc as D,
|
|
4343
|
+
rt as F,
|
|
4344
|
+
mn as P,
|
|
4345
|
+
_c as S,
|
|
4346
|
+
qr as a,
|
|
4347
|
+
it as b,
|
|
4348
|
+
Lc as c,
|
|
4349
|
+
Mc as d,
|
|
4350
|
+
Tr as e,
|
|
4351
|
+
Rc as f,
|
|
4326
4352
|
vt as g,
|
|
4327
|
-
|
|
4328
|
-
|
|
4353
|
+
Jr as i,
|
|
4354
|
+
ti as r
|
|
4329
4355
|
};
|