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