@ynput/ayon-frontend-shared 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/ContextMenu.es.js +34 -16
  2. package/dist/DetailsPanel.es.js +292 -298
  3. package/dist/Feed.es.js +179 -50
  4. package/dist/ListTable.es.js +32 -35
  5. package/dist/NewEntity.es.js +1256 -11
  6. package/dist/ProjectTreeTable.es.js +4451 -2965
  7. package/dist/SimpleTable.es.js +8 -7
  8. package/dist/Slicer.es.js +451 -147
  9. package/dist/Views.es.js +918 -310
  10. package/dist/chunks/Actions.es.js +9 -4
  11. package/dist/chunks/ColumnDropIndicator.es.js +174 -328
  12. package/dist/chunks/ColumnDropIndicator.styled.es.js +281 -0
  13. package/dist/chunks/ColumnHeaderMenuUI.es.js +52 -0
  14. package/dist/chunks/ContextMenuContextInstance.es.js +12 -0
  15. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +229 -0
  16. package/dist/chunks/DeleteEntitiesContextInstance.es.js +827 -0
  17. package/dist/chunks/EmptyPlaceholder.es.js +4 -4
  18. package/dist/chunks/EntityPath.es.js +58 -53
  19. package/dist/chunks/EntityPickerDialog.es.js +24 -20
  20. package/dist/chunks/EntityTooltip.es.js +20 -13
  21. package/dist/chunks/EntityUpdatesContext.es.js +38 -96
  22. package/dist/chunks/Feed.es.js +1495 -1439
  23. package/dist/chunks/FilterErrorActions.es.js +25 -229
  24. package/dist/chunks/Menu.es.js +21 -17
  25. package/dist/chunks/MenuContext.es.js +14 -65
  26. package/dist/chunks/MenuItem.es.js +34 -24
  27. package/dist/chunks/MetaWidget.es.js +2835 -4301
  28. package/dist/chunks/NewEntityContextInstance.es.js +11 -0
  29. package/dist/chunks/PlayableIcon.es.js +1532 -1594
  30. package/dist/chunks/ProjectContext.es.js +102 -66
  31. package/dist/chunks/RepresentationsList.es.js +1 -1
  32. package/dist/chunks/ReviewablesSelector.es.js +457 -458
  33. package/dist/chunks/SimpleForm.es.js +9 -9
  34. package/dist/chunks/SimpleTable.es.js +15 -13
  35. package/dist/chunks/Slicer.es.js +163 -154
  36. package/dist/chunks/TableSettingsFallback.es.js +25 -13
  37. package/dist/chunks/ThumbnailSimple.es.js +150 -261
  38. package/dist/chunks/VersionUploadContextInstance.es.js +12 -0
  39. package/dist/chunks/VideoPlayer.es.js +24 -28
  40. package/dist/chunks/Watchers.es.js +384 -389
  41. package/dist/chunks/entityDefinitions.es.js +2 -350
  42. package/dist/chunks/extractVersionFromFilename.es.js +28 -0
  43. package/dist/chunks/getBundleMode.es.js +61 -16
  44. package/dist/chunks/getUris.es.js +737 -712
  45. package/dist/chunks/searchTerms.es.js +57 -56
  46. package/dist/chunks/useAttributeEnums.es.js +4 -4
  47. package/dist/chunks/useCreateContextMenu.es.js +66 -90
  48. package/dist/chunks/useHierarchySelection.es.js +24 -0
  49. package/dist/chunks/useLoadModule.es.js +74 -0
  50. package/dist/chunks/useQueryArgumentChangeLoading.es.js +11 -0
  51. package/dist/chunks/versionUploadHelpers.es.js +16 -42
  52. package/dist/chunks/viewUpdateHelper.es.js +67 -50
  53. package/dist/components.es.js +1425 -999
  54. package/dist/context.es.js +791 -80
  55. package/dist/hooks.es.js +115 -120
  56. package/dist/index.es.js +19 -23
  57. package/dist/types/Actions.d.ts +7 -7
  58. package/dist/types/ContextMenu.d.ts +11 -8
  59. package/dist/types/DetailsPanel.d.ts +102 -9
  60. package/dist/types/EntityPickerDialog.d.ts +7 -7
  61. package/dist/types/Feed.d.ts +11 -8
  62. package/dist/types/ListTable.d.ts +7 -7
  63. package/dist/types/NewEntity.d.ts +16 -10
  64. package/dist/types/ProjectTreeTable.d.ts +22 -115
  65. package/dist/types/RepresentationsList.d.ts +7 -7
  66. package/dist/types/SimpleTable.d.ts +11 -8
  67. package/dist/types/Slicer.d.ts +10 -7
  68. package/dist/types/Views.d.ts +10 -7
  69. package/dist/types/api.d.ts +132 -120
  70. package/dist/types/components.d.ts +13 -8
  71. package/dist/types/context.d.ts +56 -16
  72. package/dist/types/hooks.d.ts +7 -7
  73. package/dist/types/index.d.ts +7 -7
  74. package/dist/types/util.d.ts +12 -7
  75. package/dist/util.es.js +72 -71
  76. package/package.json +1 -1
  77. package/dist/chunks/DeleteEntitiesContext.es.js +0 -748
  78. package/dist/chunks/DetailsPanelContext.es.js +0 -155
  79. package/dist/chunks/GlobalContext.es.js +0 -52
  80. package/dist/chunks/NewEntityContext.es.js +0 -1242
  81. package/dist/chunks/ProjectFoldersContext.es.js +0 -134
  82. package/dist/chunks/ProjectFoldersContextInstance.es.js +0 -7
  83. package/dist/chunks/VersionUploadContext.es.js +0 -232
  84. package/dist/chunks/ViewsContext.es.js +0 -878
  85. package/dist/chunks/uriUtils.es.js +0 -48
  86. package/dist/chunks/useColumnDragRestriction.es.js +0 -158
  87. package/dist/chunks/useLocalStorage.es.js +0 -355
  88. package/dist/chunks/useSessionStorage.es.js +0 -61
  89. /package/dist/{useCreateContextMenu.css → ContextMenuContextInstance.css} +0 -0
@@ -1,29 +1,41 @@
1
- import { jsx as o, jsxs as e, Fragment as n } from "react/jsx-runtime";
2
- import { R as c, P as l } from "./ReviewablesSelector.es.js";
1
+ import { jsx as o, jsxs as a, Fragment as s } from "react/jsx-runtime";
2
+ import { R as e, P as n } from "./ReviewablesSelector.es.js";
3
3
  import "react";
4
4
  import "@ynput/ayon-react-components";
5
- import { a as m } from "./useLocalStorage.es.js";
6
- const P = ({
5
+ import "@module-federation/enhanced/runtime";
6
+ import "./searchTerms.es.js";
7
+ import "./getUris.es.js";
8
+ import "primereact/confirmdialog";
9
+ import { a as c } from "./DeleteEntitiesContextInstance.es.js";
10
+ import "lodash";
11
+ import "react-toastify";
12
+ import "uuid";
13
+ import "semver";
14
+ import "./ContextMenuContextInstance.es.js";
15
+ import "clsx";
16
+ import "react-dom";
17
+ import "react-redux";
18
+ const A = ({
7
19
  requiredVersion: r,
8
20
  feature: t,
9
- button: a,
10
- children: i
21
+ button: i,
22
+ children: m
11
23
  }) => {
12
- const { setPowerpackDialog: s } = m();
13
- return r ? /* @__PURE__ */ o(c, { requiredVersion: r }) : /* @__PURE__ */ e(n, { children: [
14
- !!a && /* @__PURE__ */ o(
15
- l,
24
+ const { setPowerpackDialog: p } = c();
25
+ return r ? /* @__PURE__ */ o(e, { requiredVersion: r }) : /* @__PURE__ */ a(s, { children: [
26
+ !!i && /* @__PURE__ */ o(
27
+ n,
16
28
  {
17
29
  style: { width: "100%" },
18
30
  icon: "add",
19
31
  variant: "filled",
20
- ...a,
32
+ ...i,
21
33
  feature: t
22
34
  }
23
35
  ),
24
- /* @__PURE__ */ o("div", { onClick: () => s(t), children: i })
36
+ /* @__PURE__ */ o("div", { onClick: () => p(t), children: m })
25
37
  ] });
26
38
  };
27
39
  export {
28
- P as T
40
+ A as T
29
41
  };
@@ -1,91 +1,48 @@
1
- import { jsx as s, jsxs as g } from "react/jsx-runtime";
2
- import { createPortal as te } from "react-dom";
3
- import { useMemo as b, createContext as ie, useState as _, useContext as ne, useEffect as oe } from "react";
4
- import { aQ as D } from "./searchTerms.es.js";
5
- import { bf as ae, C as se, bi as re, aE as ce, dd as le, aR as de, aL as ue, a_ as me, K as pe, bA as ye, bh as fe, bs as ge } from "./getUris.es.js";
1
+ import { jsxs as m, jsx as i } from "react/jsx-runtime";
2
+ import { createPortal as R } from "react-dom";
3
+ import { createContext as z, useContext as L, useEffect as $ } from "react";
4
+ import { aQ as j } from "./searchTerms.es.js";
5
+ import { C as A } from "./getUris.es.js";
6
6
  import "primereact/confirmdialog";
7
- import { union as ve, isEqual as he } from "lodash";
8
- import { e as xe } from "./expandRelativeDates.es.js";
9
- import { u as be } from "./DetailsPanelContext.es.js";
10
- import { U as we } from "./PlayableIcon.es.js";
11
- import y, { keyframes as Te } from "styled-components";
12
- import { Icon as P, Dialog as ke, FormRow as I, InputDate as j, SaveButton as Me } from "@ynput/ayon-react-components";
13
- import { a as _e } from "./EntityTooltip.es.js";
14
- import { format as L, parse as R } from "date-fns";
7
+ import "lodash";
8
+ import { e as F } from "./expandRelativeDates.es.js";
9
+ import "@module-federation/enhanced/runtime";
10
+ import "./DeleteEntitiesContextInstance.es.js";
15
11
  import "react-toastify";
16
12
  import "uuid";
17
- import { g as Ne } from "./getThumbnailUrl.es.js";
18
- const Ae = ({
19
- entities: e,
20
- filter: t,
21
- backendFilter: i,
22
- activityTypes: n,
23
- projectName: r,
24
- entityType: c
25
- }) => {
26
- const o = b(
27
- () => e.map((p) => ({ id: p.id, projectName: p.projectName, entityType: c })),
28
- [e]
29
- ).map((p) => p.id), a = !e.length || !t || !n || !r, f = {
30
- entityIds: o,
31
- projectName: r,
32
- referenceTypes: ["origin", "mention", "relation"],
33
- activityTypes: n,
34
- activityFilter: i,
35
- filter: t
36
- };
37
- let {
38
- data: u,
39
- isLoading: l,
40
- isFetchingNextPage: h,
41
- currentData: v,
42
- fetchNextPage: w,
43
- hasNextPage: x
44
- } = ae(f, { skip: a });
45
- const T = b(() => u?.pages ? u.pages.flatMap((p) => p.activities || []) : [], [u?.pages]), k = b(() => v?.pages ? v.pages.flatMap((p) => p.activities || []) : [], [v?.pages]), N = async () => {
46
- if (!x) {
47
- console.log("No more activities to load");
48
- return;
49
- }
50
- return console.log("loading next page..."), await w();
51
- }, A = b(() => {
52
- if (!l) return !1;
53
- const p = ve(
54
- k?.flatMap((M) => M.entityId ? M.entityId : [])
55
- );
56
- return !he(p, o);
57
- }, [k, o, l]);
58
- return a && (l = !0), {
59
- activitiesData: T,
60
- isLoadingActivities: l,
61
- isLoadingNew: A,
62
- isLoadingNextPage: h,
63
- hasNextPage: x,
64
- loadNextPage: N
65
- };
66
- }, Ee = new Set(Object.keys(se).filter((e) => e !== "activity")), Ce = {
13
+ import "semver";
14
+ import { Icon as w, Dialog as N, FormRow as v, InputDate as x, SaveButton as B } from "@ynput/ayon-react-components";
15
+ import "./ContextMenuContextInstance.es.js";
16
+ import "clsx";
17
+ import "react-redux";
18
+ import { U } from "./PlayableIcon.es.js";
19
+ import p, { keyframes as O } from "styled-components";
20
+ import { a as K } from "./EntityTooltip.es.js";
21
+ import { format as b, parse as k } from "date-fns";
22
+ import { g as P } from "./getThumbnailUrl.es.js";
23
+ const Y = new Set(Object.keys(A).filter((e) => e !== "activity")), D = {
67
24
  has_attachments: "activity_data.files",
68
25
  // not `entity_type`: on inbox rows that column is always 'user'
69
26
  origin_type: "activity_data.origin.type"
70
- }, Fe = (e) => !!e && "key" in e, Ie = (e) => {
71
- const t = Ce[e.key] ?? e.key;
27
+ }, q = (e) => !!e && "key" in e, H = (e) => {
28
+ const t = D[e.key] ?? e.key;
72
29
  if (e.key === "has_attachments")
73
30
  return e.value ? { key: t, operator: "ne", value: [] } : null;
74
31
  if (e.key === "in_review_session")
75
32
  return e.value ? { key: "activity_data.entityList", operator: "notnull" } : null;
76
33
  if (e.key === "category") {
77
- const i = Array.isArray(e.value) ? e.value : [], n = i.includes("__none__"), r = i.filter((o) => o !== "__none__"), c = {
34
+ const o = Array.isArray(e.value) ? e.value : [], n = o.includes("__none__"), s = o.filter((a) => a !== "__none__"), l = {
78
35
  operator: "or",
79
36
  conditions: [
80
37
  { key: "activity_data.category", operator: "isnull" },
81
38
  { key: "activity_data.category", operator: "eq", value: "" }
82
39
  ]
83
- }, d = {
40
+ }, c = {
84
41
  key: "activity_data.category",
85
42
  operator: "in",
86
- value: r
43
+ value: s
87
44
  };
88
- return n && r.length ? { operator: "or", conditions: [c, d] } : n ? c : r.length ? d : null;
45
+ return n && s.length ? { operator: "or", conditions: [l, c] } : n ? l : s.length ? c : null;
89
46
  }
90
47
  return e.key === "body" && e.operator === "like" && typeof e.value == "string" ? { ...e, key: t, value: `%${e.value}%` } : e.key === "author" ? {
91
48
  operator: "or",
@@ -94,98 +51,30 @@ const Ae = ({
94
51
  { ...e, key: "activity_data.assignee" }
95
52
  ]
96
53
  } : { ...e, key: t };
97
- }, z = (e) => {
98
- if (Fe(e))
99
- return Ee.has(e.key) ? null : Ie(e);
100
- const t = (e.conditions || []).map((i) => z(i)).filter((i) => i !== null);
54
+ }, C = (e) => {
55
+ if (q(e))
56
+ return Y.has(e.key) ? null : H(e);
57
+ const t = (e.conditions || []).map((o) => C(o)).filter((o) => o !== null);
101
58
  return t.length === 0 ? null : { operator: e.operator || "and", conditions: t };
102
- }, je = (e) => {
59
+ }, Q = (e) => {
103
60
  if (!e || !e.conditions?.length) return null;
104
- const t = xe(e), i = z(t);
105
- return i || null;
106
- }, Le = (e) => {
107
- const t = je(e);
61
+ const t = F(e), o = C(t);
62
+ return o || null;
63
+ }, $e = (e) => {
64
+ const t = Q(e);
108
65
  if (t)
109
66
  return JSON.stringify(t);
110
- }, pt = "__new__", U = ie(void 0), yt = ({ children: e, ...t }) => {
111
- const { isGuest: i } = be(), { data: n = [] } = re({ projects: [t.projectName] }), { data: r = [] } = D.useGetTeamsQuery(
112
- { projectName: t.projectName, showMembers: !0 },
113
- { skip: !t.projectName }
114
- ), c = b(
115
- () => r.filter((m) => m.members?.some((ee) => ee.name === t.userName)).map((m) => m.name),
116
- [r, t.userName]
117
- ), [d, o] = _({
118
- operator: "and",
119
- conditions: []
120
- }), [a, f] = _(""), u = t.feedFilter ?? d, l = t.setFeedFilter ?? o, [h, v] = _(null), [w, x] = _(null), [T, { isLoading: k }] = ce(), [N, { isLoading: A }] = le(), [p, { isLoading: M }] = de(), G = k || A || M, B = async (m) => await T(m).unwrap(), O = async (m) => await N(m).unwrap(), K = async (m) => await p(m).unwrap(), [q] = ue(), [Y] = me(), W = async (m) => await q(m).unwrap(), H = async (m) => await Y(m).unwrap(), C = pe(u), F = b(() => Le(u), [u]), J = Ae({
121
- entities: t.entities,
122
- filter: u,
123
- backendFilter: F,
124
- activityTypes: C,
125
- projectName: t.projectName,
126
- entityType: t.entityType
127
- }), { data: V = {} } = ye(
128
- {
129
- suggestRequest: {
130
- entityType: t.entityType,
131
- entityId: t.entities[0]?.id
132
- },
133
- projectName: t.projectName
134
- },
135
- { skip: !h }
136
- ), { data: X = [] } = fe({
137
- projectName: t.projectName
138
- }), { data: Z } = ge(
139
- {
140
- projectName: t.projectName,
141
- entityIds: t.entities.map((m) => m.id)
142
- },
143
- { skip: !t.projectName || !t.entities.length }
144
- );
145
- return /* @__PURE__ */ s(
146
- U.Provider,
147
- {
148
- value: {
149
- ...t,
150
- ...J,
151
- mentionSuggestionsData: V,
152
- categories: X,
153
- checklistCount: Z,
154
- users: n,
155
- isUpdatingActivity: G,
156
- userTeamNames: c,
157
- refTooltip: w,
158
- activityTypes: C,
159
- feedFilter: u,
160
- setFeedFilter: l,
161
- backendFilter: F,
162
- searchText: a,
163
- setSearchText: f,
164
- isGuest: i,
165
- editingId: h,
166
- setEditingId: v,
167
- setRefTooltip: x,
168
- // Query functions
169
- createEntityActivity: B,
170
- updateActivity: O,
171
- deleteActivity: K,
172
- createReaction: W,
173
- deleteReaction: H
174
- },
175
- children: e
176
- }
177
- );
178
- }, E = () => {
179
- const e = ne(U);
67
+ }, W = z(void 0), g = () => {
68
+ const e = L(W);
180
69
  if (!e)
181
70
  throw new Error("useFeedContext must be used within a FeedProvider");
182
71
  return e;
183
- }, Re = () => {
184
- const { refTooltip: e, setRefTooltip: t } = E();
72
+ }, G = () => {
73
+ const { refTooltip: e, setRefTooltip: t } = g();
185
74
  return [e, (n) => {
186
75
  n && n.id !== e?.id && t(n), n || t(null);
187
76
  }];
188
- }, Se = y.span`
77
+ }, J = p.span`
189
78
  display: flex;
190
79
  align-items: center;
191
80
  gap: var(--base-gap-large);
@@ -202,7 +91,7 @@ const Ae = ({
202
91
  span {
203
92
  white-space: nowrap;
204
93
  }
205
- `, De = y.span`
94
+ `, V = p.span`
206
95
  display: flex;
207
96
  flex-direction: column;
208
97
 
@@ -210,13 +99,13 @@ const Ae = ({
210
99
  color: var(--md-sys-color-outline);
211
100
  font-size: 0.85em;
212
101
  }
213
- `, $ = ({ name: e, fullName: t, showSubtitle: i, size: n = 24 }) => /* @__PURE__ */ g(Se, { $size: n, children: [
214
- /* @__PURE__ */ s(we, { name: e, size: n }),
215
- i ? /* @__PURE__ */ g(De, { children: [
216
- /* @__PURE__ */ s("span", { children: t || e }),
217
- t && /* @__PURE__ */ s("span", { className: "label", children: e })
218
- ] }) : /* @__PURE__ */ s("span", { children: t || e })
219
- ] }), Pe = Te`
102
+ `, E = ({ name: e, fullName: t, showSubtitle: o, size: n = 24 }) => /* @__PURE__ */ m(J, { $size: n, children: [
103
+ /* @__PURE__ */ i(U, { name: e, size: n }),
104
+ o ? /* @__PURE__ */ m(V, { children: [
105
+ /* @__PURE__ */ i("span", { children: t || e }),
106
+ t && /* @__PURE__ */ i("span", { className: "label", children: e })
107
+ ] }) : /* @__PURE__ */ i("span", { children: t || e })
108
+ ] }), X = O`
220
109
  from {
221
110
  opacity: 0.4;
222
111
  scale: 0.9;
@@ -225,7 +114,7 @@ const Ae = ({
225
114
  opacity: 1;
226
115
  scale: 1;
227
116
  }
228
- `, Q = y.span`
117
+ `, M = p.span`
229
118
  display: flex;
230
119
  padding: 8px;
231
120
  gap: var(--base-gap-large);
@@ -249,14 +138,14 @@ const Ae = ({
249
138
  }
250
139
  }
251
140
 
252
- animation: ${Pe} 50ms ease-out;
141
+ animation: ${X} 50ms ease-out;
253
142
  transform-origin: left bottom;
254
- `, ze = ({ name: e, label: t, pos: i }) => /* @__PURE__ */ s(Q, { style: { ...i }, children: /* @__PURE__ */ s($, { name: e || "", fullName: t, showSubtitle: !0, size: 32 }) }), Ue = y(Q)`
143
+ `, Z = ({ name: e, label: t, pos: o }) => /* @__PURE__ */ i(M, { style: { ...o }, children: /* @__PURE__ */ i(E, { name: e || "", fullName: t, showSubtitle: !0, size: 32 }) }), ee = p(M)`
255
144
  flex-direction: column;
256
145
  align-items: flex-start;
257
146
  gap: 8px;
258
147
  min-width: 180px;
259
- `, $e = y.span`
148
+ `, te = p.span`
260
149
  display: flex;
261
150
  align-items: center;
262
151
  gap: var(--base-gap-large);
@@ -264,7 +153,7 @@ const Ae = ({
264
153
  .icon {
265
154
  font-size: 20px;
266
155
  }
267
- `, Qe = y.span`
156
+ `, oe = p.span`
268
157
  display: flex;
269
158
  flex-direction: column;
270
159
 
@@ -276,7 +165,7 @@ const Ae = ({
276
165
  color: var(--md-sys-color-outline);
277
166
  font-size: 0.85em;
278
167
  }
279
- `, Ge = y.ul`
168
+ `, ne = p.ul`
280
169
  list-style: none;
281
170
  margin: 0;
282
171
  padding: 0;
@@ -284,124 +173,124 @@ const Ae = ({
284
173
  flex-direction: column;
285
174
  gap: 4px;
286
175
  width: 100%;
287
- `, Be = y.li`
176
+ `, ie = p.li`
288
177
  display: flex;
289
178
  align-items: center;
290
- `, Oe = y.span`
179
+ `, re = p.span`
291
180
  color: var(--md-sys-color-outline);
292
181
  font-size: 0.85em;
293
182
  padding-left: 32px;
294
- `, S = 5, Ke = ({ name: e, pos: t }) => {
295
- const { projectName: i, users: n } = E(), { data: r = [] } = D.useGetTeamsQuery(
296
- { projectName: i, showMembers: !0 },
297
- { skip: !i || !e }
298
- ), c = r.find((l) => l.name === e), d = c?.members ?? [], o = c?.memberCount ?? 0, a = d.slice(0, S), f = Math.max(0, o - S), u = new Map(n.map((l) => [l.name, l.attrib?.fullName || void 0]));
299
- return /* @__PURE__ */ g(Ue, { style: { ...t }, children: [
300
- /* @__PURE__ */ g($e, { children: [
301
- /* @__PURE__ */ s(P, { icon: "group" }),
302
- /* @__PURE__ */ g(Qe, { children: [
303
- /* @__PURE__ */ s("span", { children: e }),
304
- c && /* @__PURE__ */ g("span", { className: "label", children: [
305
- o,
183
+ `, _ = 5, ae = ({ name: e, pos: t }) => {
184
+ const { projectName: o, users: n } = g(), { data: s = [] } = j.useGetTeamsQuery(
185
+ { projectName: o, showMembers: !0 },
186
+ { skip: !o || !e }
187
+ ), l = s.find((d) => d.name === e), c = l?.members ?? [], a = l?.memberCount ?? 0, r = c.slice(0, _), u = Math.max(0, a - _), f = new Map(n.map((d) => [d.name, d.attrib?.fullName || void 0]));
188
+ return /* @__PURE__ */ m(ee, { style: { ...t }, children: [
189
+ /* @__PURE__ */ m(te, { children: [
190
+ /* @__PURE__ */ i(w, { icon: "group" }),
191
+ /* @__PURE__ */ m(oe, { children: [
192
+ /* @__PURE__ */ i("span", { children: e }),
193
+ l && /* @__PURE__ */ m("span", { className: "label", children: [
194
+ a,
306
195
  " ",
307
- o === 1 ? "member" : "members"
196
+ a === 1 ? "member" : "members"
308
197
  ] })
309
198
  ] })
310
199
  ] }),
311
- a.length > 0 && /* @__PURE__ */ g(Ge, { children: [
312
- a.map((l) => /* @__PURE__ */ s(Be, { children: /* @__PURE__ */ s(
313
- $,
200
+ r.length > 0 && /* @__PURE__ */ m(ne, { children: [
201
+ r.map((d) => /* @__PURE__ */ i(ie, { children: /* @__PURE__ */ i(
202
+ E,
314
203
  {
315
- name: l.name,
316
- fullName: u.get(l.name),
204
+ name: d.name,
205
+ fullName: f.get(d.name),
317
206
  size: 20
318
207
  }
319
- ) }, l.name)),
320
- f > 0 && /* @__PURE__ */ g(Oe, { children: [
208
+ ) }, d.name)),
209
+ u > 0 && /* @__PURE__ */ m(re, { children: [
321
210
  "+",
322
- f,
211
+ u,
323
212
  " more"
324
213
  ] })
325
214
  ] })
326
215
  ] });
327
- }, qe = ({ type: e, id: t, pos: i }) => {
328
- const { projectInfo: n, projectName: r } = E();
329
- return /* @__PURE__ */ s(
330
- _e,
216
+ }, se = ({ type: e, id: t, pos: o }) => {
217
+ const { projectInfo: n, projectName: s } = g();
218
+ return /* @__PURE__ */ i(
219
+ K,
331
220
  {
332
221
  entityType: e,
333
222
  entityId: t,
334
- projectName: r,
223
+ projectName: s,
335
224
  projectInfo: n,
336
- pos: i
225
+ pos: o
337
226
  }
338
227
  );
339
- }, ft = () => {
340
- const [e, t] = Re(), { type: i, label: n, name: r, pos: c, id: d } = e || {}, o = document.querySelector(".feed ul");
341
- return oe(() => {
342
- if (d) {
343
- const a = (f) => {
344
- const u = f.target, l = CSS.escape(`ref-${d.replaceAll(".", "-")}`), h = u?.closest(`#${l}`), v = u?.closest("[data-mention-value], .reference");
345
- !h && !v && (t(null), document.removeEventListener("mouseover", a), o && o.removeEventListener("scroll", a));
228
+ }, je = () => {
229
+ const [e, t] = G(), { type: o, label: n, name: s, pos: l, id: c } = e || {}, a = document.querySelector(".feed ul");
230
+ return $(() => {
231
+ if (c) {
232
+ const r = (u) => {
233
+ const f = u.target, d = CSS.escape(`ref-${c.replaceAll(".", "-")}`), y = f?.closest(`#${d}`), h = f?.closest("[data-mention-value], .reference");
234
+ !y && !h && (t(null), document.removeEventListener("mouseover", r), a && a.removeEventListener("scroll", r));
346
235
  };
347
- return document.addEventListener("mouseover", a), o && o.addEventListener("scroll", a), () => {
348
- document.removeEventListener("mouseover", a), o && o.removeEventListener("scroll", a);
236
+ return document.addEventListener("mouseover", r), a && a.addEventListener("scroll", r), () => {
237
+ document.removeEventListener("mouseover", r), a && a.removeEventListener("scroll", r);
349
238
  };
350
239
  }
351
- }, [d, t, o]), d ? te(
352
- i === "user" && c ? /* @__PURE__ */ s(ze, { name: r, label: n, pos: c }) : i === "team" && c ? /* @__PURE__ */ s(Ke, { name: r, pos: c }) : /* @__PURE__ */ s(qe, { type: i, label: n, name: r, pos: c, id: d }),
240
+ }, [c, t, a]), c ? R(
241
+ o === "user" && l ? /* @__PURE__ */ i(Z, { name: s, label: n, pos: l }) : o === "team" && l ? /* @__PURE__ */ i(ae, { name: s, pos: l }) : /* @__PURE__ */ i(se, { type: o, label: n, name: s, pos: l, id: c }),
353
242
  document.body
354
243
  ) : null;
355
- }, Ye = y.div`
244
+ }, le = p.div`
356
245
  display: flex;
357
246
  flex-direction: column;
358
247
  gap: 12px;
359
- `, gt = ({
248
+ `, Ae = ({
360
249
  isOpen: e,
361
250
  header: t,
362
- startDate: i,
251
+ startDate: o,
363
252
  endDate: n,
364
- onStartDateChange: r,
365
- onEndDateChange: c,
366
- onApply: d,
367
- onClose: o
368
- }) => /* @__PURE__ */ s(
369
- ke,
253
+ onStartDateChange: s,
254
+ onEndDateChange: l,
255
+ onApply: c,
256
+ onClose: a
257
+ }) => /* @__PURE__ */ i(
258
+ N,
370
259
  {
371
260
  isOpen: e,
372
- onClose: o,
261
+ onClose: a,
373
262
  header: t,
374
263
  size: "sm",
375
264
  hideCancelButton: !0,
376
- footer: /* @__PURE__ */ s(
377
- Me,
265
+ footer: /* @__PURE__ */ i(
266
+ B,
378
267
  {
379
268
  label: "Confirm",
380
269
  icon: "check",
381
- onClick: d,
382
- active: !!i && !!n && n >= i
270
+ onClick: c,
271
+ active: !!o && !!n && n >= o
383
272
  }
384
273
  ),
385
- children: /* @__PURE__ */ g(Ye, { children: [
386
- /* @__PURE__ */ s(I, { label: "Start date", children: /* @__PURE__ */ s(
387
- j,
274
+ children: /* @__PURE__ */ m(le, { children: [
275
+ /* @__PURE__ */ i(v, { label: "Start date", children: /* @__PURE__ */ i(
276
+ x,
388
277
  {
389
- selected: i ? R(i, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : void 0,
390
- onChange: (a) => r(a ? L(a, "yyyy-MM-dd") : ""),
278
+ selected: o ? k(o, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : void 0,
279
+ onChange: (r) => s(r ? b(r, "yyyy-MM-dd") : ""),
391
280
  autoFocus: !0
392
281
  }
393
282
  ) }),
394
- /* @__PURE__ */ s(I, { label: "End date", children: /* @__PURE__ */ s(
395
- j,
283
+ /* @__PURE__ */ i(v, { label: "End date", children: /* @__PURE__ */ i(
284
+ x,
396
285
  {
397
- selected: n ? R(n, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : void 0,
398
- onChange: (a) => c(a ? L(a, "yyyy-MM-dd") : ""),
399
- openToDate: i ? new Date(i) : void 0
286
+ selected: n ? k(n, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : void 0,
287
+ onChange: (r) => l(r ? b(r, "yyyy-MM-dd") : ""),
288
+ openToDate: o ? new Date(o) : void 0
400
289
  }
401
290
  ) })
402
291
  ] })
403
292
  }
404
- ), We = y.div`
293
+ ), ce = p.div`
405
294
  position: relative;
406
295
  width: 100%;
407
296
  max-width: 500px;
@@ -423,7 +312,7 @@ const Ae = ({
423
312
  background-color: hsl(220 20% 8%);
424
313
  color: var(--md-sys-color-outline);
425
314
  }
426
- `, He = y.img`
315
+ `, de = p.img`
427
316
  width: 100%;
428
317
  height: 100%;
429
318
  object-fit: contain;
@@ -432,46 +321,46 @@ const Ae = ({
432
321
  display: block;
433
322
  position: absolute;
434
323
  inset: 0;
435
- `, vt = ({
324
+ `, Fe = ({
436
325
  projectName: e,
437
326
  entityType: t,
438
- entityId: i,
327
+ entityId: o,
439
328
  icon: n,
440
- thumbnailHash: r,
441
- isLoading: c,
442
- className: d,
443
- disabled: o,
444
- src: a,
445
- onLoad: f,
446
- onError: u,
447
- iconOnly: l,
448
- ...h
329
+ thumbnailHash: s,
330
+ isLoading: l,
331
+ className: c,
332
+ disabled: a,
333
+ src: r,
334
+ onLoad: u,
335
+ onError: f,
336
+ iconOnly: d,
337
+ ...y
449
338
  }) => {
450
- const v = Ne({
339
+ const h = P({
451
340
  projectName: e,
452
341
  entityType: t,
453
- entityId: i,
454
- thumbnailHash: r ? String(r) : void 0
455
- }), w = t === "project", x = ["product"].includes(t), T = w ? !!e : !!i;
456
- return /* @__PURE__ */ g(We, { className: d + " thumbnail", ...h, children: [
457
- !c && !o && /* @__PURE__ */ s(P, { icon: n || "image" }),
458
- (t && !x && T || a) && !l && /* @__PURE__ */ s(
459
- He,
342
+ entityId: o,
343
+ thumbnailHash: s ? String(s) : void 0
344
+ }), T = t === "project", S = ["product"].includes(t), I = T ? !!e : !!o;
345
+ return /* @__PURE__ */ m(ce, { className: c + " thumbnail", ...y, children: [
346
+ !l && !a && /* @__PURE__ */ i(w, { icon: n || "image" }),
347
+ (t && !S && I || r) && !d && /* @__PURE__ */ i(
348
+ de,
460
349
  {
461
- alt: `Entity thumbnail ${i || e}`,
462
- src: a || v || void 0,
463
- onLoad: f,
464
- onError: u
350
+ alt: `Entity thumbnail ${o || e}`,
351
+ src: r || h || void 0,
352
+ onLoad: u,
353
+ onError: f
465
354
  }
466
355
  )
467
356
  ] });
468
357
  };
469
358
  export {
470
- ft as A,
471
- gt as C,
472
- pt as F,
473
- vt as T,
474
- yt as a,
475
- Re as b,
476
- E as u
359
+ je as A,
360
+ Ae as C,
361
+ W as F,
362
+ Fe as T,
363
+ G as a,
364
+ $e as b,
365
+ g as u
477
366
  };
@@ -0,0 +1,12 @@
1
+ import { createContext as n, useContext as t } from "react";
2
+ const e = n(void 0), s = () => {
3
+ const o = t(e);
4
+ if (o === void 0)
5
+ throw new Error("useVersionUploadContext must be used within a VersionUploadProvider");
6
+ return o;
7
+ }, i = () => t(e) ?? null;
8
+ export {
9
+ e as V,
10
+ s as a,
11
+ i as u
12
+ };