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