@ynput/ayon-frontend-shared 0.7.5 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/DetailsPanel.es.js +471 -469
  2. package/dist/Feed.es.js +1 -1
  3. package/dist/ListTable.es.js +20 -20
  4. package/dist/NewEntity.es.js +7 -7
  5. package/dist/ProjectTreeTable.es.js +2523 -2502
  6. package/dist/ProjectsTable.es.js +5 -5
  7. package/dist/Slicer.es.js +28 -25
  8. package/dist/Views.es.js +150 -151
  9. package/dist/api.es.js +166 -165
  10. package/dist/chunks/Actions.es.js +9 -10
  11. package/dist/chunks/ColumnDropIndicator.es.js +4 -4
  12. package/dist/chunks/ColumnHeaderMenuUI.es.js +4 -5
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +2 -2
  14. package/dist/chunks/DetailsDialog.es.js +3 -3
  15. package/dist/chunks/EmptyPlaceholder.es.js +7 -7
  16. package/dist/chunks/EntityPath.es.js +38 -39
  17. package/dist/chunks/EntityPickerDialog.es.js +482 -462
  18. package/dist/chunks/EntityTooltip.es.js +18 -19
  19. package/dist/chunks/Feed.es.js +1382 -1355
  20. package/dist/chunks/FilmstripEntityCard.es.js +5201 -0
  21. package/dist/chunks/FilterErrorActions.es.js +3 -4
  22. package/dist/chunks/GroupSettingsFallback.es.js +4 -4
  23. package/dist/chunks/Menu.es.js +242 -240
  24. package/dist/chunks/MetaWidget.es.js +1948 -1875
  25. package/dist/chunks/ProjectFoldersContext.es.js +237 -0
  26. package/dist/chunks/RepresentationsList.es.js +1 -1
  27. package/dist/chunks/ReviewablesSelector.es.js +1260 -1190
  28. package/dist/chunks/SimpleTable.es.js +303 -297
  29. package/dist/chunks/Slicer.es.js +420 -413
  30. package/dist/chunks/TableExportContextInstance.es.js +622 -378
  31. package/dist/chunks/TableSettingsFallback.es.js +3 -4
  32. package/dist/chunks/ThumbnailSimple.es.js +114 -99
  33. package/dist/chunks/ThumbnailUploaderContext.es.js +48 -0
  34. package/dist/chunks/VideoPlayer.es.js +8 -9
  35. package/dist/chunks/Watchers.es.js +929 -872
  36. package/dist/chunks/{ColumnDropIndicator.styled.es.js → addonColumnTags.es.js} +60 -47
  37. package/dist/chunks/expandRelativeDates.es.js +1 -1
  38. package/dist/chunks/getThumbnailUrl.es.js +33 -21
  39. package/dist/chunks/getUris.es.js +1580 -1610
  40. package/dist/chunks/queryFilterToClientFilter.es.js +1 -1
  41. package/dist/chunks/realtimeUpdatesUtils.es.js +15 -15
  42. package/dist/chunks/searchTerms.es.js +773 -696
  43. package/dist/chunks/useAttributeEnums.es.js +22 -22
  44. package/dist/chunks/useDateRangeFilter.es.js +1 -1
  45. package/dist/chunks/useHierarchySelection.es.js +3 -4
  46. package/dist/chunks/useLoadModule.es.js +3 -4
  47. package/dist/components.es.js +1391 -1253
  48. package/dist/context.es.js +645 -668
  49. package/dist/hooks.es.js +193 -171
  50. package/dist/index.es.js +4 -4
  51. package/dist/types/Actions.d.ts +10 -8
  52. package/dist/types/DetailsPanel.d.ts +54 -76
  53. package/dist/types/EntityPickerDialog.d.ts +51 -2
  54. package/dist/types/Feed.d.ts +24 -24
  55. package/dist/types/ListTable.d.ts +33 -27
  56. package/dist/types/NewEntity.d.ts +26 -39
  57. package/dist/types/ProjectTreeTable.d.ts +318 -212
  58. package/dist/types/ProjectsTable.d.ts +6 -6
  59. package/dist/types/RepresentationsList.d.ts +4 -0
  60. package/dist/types/Slicer.d.ts +63 -246
  61. package/dist/types/Views.d.ts +71 -298
  62. package/dist/types/api.d.ts +3164 -2363
  63. package/dist/types/components.d.ts +537 -497
  64. package/dist/types/context.d.ts +293 -572
  65. package/dist/types/hooks.d.ts +76 -47
  66. package/dist/types/index.d.ts +6 -0
  67. package/dist/types/util.d.ts +141 -120
  68. package/dist/util.es.js +71 -68
  69. package/package.json +6 -6
  70. package/dist/chunks/EntityUpdatesContext.es.js +0 -61
  71. package/dist/chunks/PlayableIcon.es.js +0 -5020
  72. package/dist/chunks/ProjectContext.es.js +0 -158
  73. package/dist/chunks/useQueryArgumentChangeLoading.es.js +0 -11
  74. package/dist/chunks/viewUpdateHelper.es.js +0 -153
@@ -1,18 +1,18 @@
1
- import { createContext as _, useContext as u, forwardRef as I } from "react";
2
- import { jsxs as l, jsx as i, Fragment as S } from "react/jsx-runtime";
3
- import { Button as p, Icon as N } from "@ynput/ayon-react-components";
1
+ import { createContext as _, useContext as h, forwardRef as I } from "react";
2
+ import { jsxs as d, jsx as i, Fragment as S } from "react/jsx-runtime";
3
+ import { Button as m, Icon as N } from "@ynput/ayon-react-components";
4
4
  import a from "clsx";
5
5
  import n from "styled-components";
6
- import { R as d, D as f } from "./realtimeUpdatesUtils.es.js";
6
+ import { R as p, D as f } from "./realtimeUpdatesUtils.es.js";
7
7
  import "lodash";
8
8
  import "primereact/confirmdialog";
9
9
  import "react-toastify";
10
10
  import { c as z } from "./copyToClipboard.es.js";
11
11
  import "uuid";
12
- import "./searchTerms.es.js";
12
+ import { a as E } from "./searchTerms.es.js";
13
13
  import "axios";
14
- const E = (t) => {
15
- const o = t.getIsPinned(), s = t.id !== d && t.id !== f ? -30 : 0;
14
+ const T = (t) => {
15
+ const o = t.getIsPinned(), s = t.id !== p && t.id !== f ? -30 : 0;
16
16
  return {
17
17
  left: o === "left" ? `${t.getStart("left") + s}px` : void 0,
18
18
  right: o === "right" ? `${t.getAfter("right")}px` : void 0,
@@ -20,12 +20,12 @@ const E = (t) => {
20
20
  width: t.getSize(),
21
21
  zIndex: o ? 100 : 0
22
22
  };
23
- }, M = (t) => `calc(var(--col-${t}-size) * 1px)`, g = _(void 0), X = () => {
24
- const t = u(g);
23
+ }, A = (t) => `calc(var(--col-${t}-size) * 1px)`, g = _(void 0), ot = () => {
24
+ const t = h(g);
25
25
  if (!t)
26
26
  throw new Error("useFeedback must be used within a FeedbackProvider");
27
27
  return t;
28
- }, Y = () => u(g), tt = I(({ ...t }, o) => /* @__PURE__ */ l(
28
+ }, et = () => h(g), it = I(({ ...t }, o) => /* @__PURE__ */ d(
29
29
  "svg",
30
30
  {
31
31
  width: "25",
@@ -64,7 +64,7 @@ const E = (t) => {
64
64
  )
65
65
  ]
66
66
  }
67
- )), B = n(p)`
67
+ )), D = n(m)`
68
68
  width: 24px;
69
69
  height: 24px;
70
70
  padding: 2px;
@@ -86,8 +86,8 @@ const E = (t) => {
86
86
  &.selected {
87
87
  display: flex !important;
88
88
  }
89
- `, ot = ({ selected: t, style: o, ...s }) => /* @__PURE__ */ i(
90
- B,
89
+ `, nt = ({ selected: t, style: o, ...s }) => /* @__PURE__ */ i(
90
+ D,
91
91
  {
92
92
  ...s,
93
93
  selected: t,
@@ -95,7 +95,7 @@ const E = (t) => {
95
95
  variant: "text",
96
96
  style: { ...o }
97
97
  }
98
- ), et = n(p)`
98
+ ), st = n(m)`
99
99
  background-color: unset !important;
100
100
  z-index: 110;
101
101
  position: relative;
@@ -115,20 +115,20 @@ const E = (t) => {
115
115
  ${({ $isOpen: t }) => t && `
116
116
  background-color: var(--md-sys-color-surface-container-hover) !important;
117
117
  `}
118
- `, D = n.tfoot`
118
+ `, M = n.tfoot`
119
119
  display: grid !important;
120
120
  position: sticky;
121
121
  bottom: 0;
122
122
  z-index: 10;
123
123
  background-color: var(--md-sys-color-surface-container-lowest);
124
- `, P = n.tr`
124
+ `, B = n.tr`
125
125
  display: flex;
126
126
  background-color: var(--md-sys-color-surface-container-low);
127
127
 
128
128
  &.clickable {
129
129
  cursor: pointer;
130
130
  }
131
- `, R = n.td`
131
+ `, P = n.td`
132
132
  position: relative;
133
133
  box-shadow: inset 1px 1px 0 0 var(--md-sys-color-surface-container);
134
134
  background-color: var(--md-sys-color-surface-container-lowest);
@@ -152,7 +152,7 @@ const E = (t) => {
152
152
  width: 24px !important;
153
153
  min-width: unset;
154
154
  }
155
- `, A = n.div`
155
+ `, R = n.div`
156
156
  display: flex;
157
157
  align-items: center;
158
158
  gap: var(--base-gap-small);
@@ -187,24 +187,24 @@ const E = (t) => {
187
187
  height: auto;
188
188
  margin: 0;
189
189
  pointer-events: none;
190
- `, it = ({
190
+ `, rt = ({
191
191
  columnVirtualizer: t,
192
192
  table: o,
193
193
  virtualPaddingLeft: s,
194
- virtualPaddingRight: m,
194
+ virtualPaddingRight: l,
195
195
  renderCellContent: v,
196
196
  onClick: c,
197
197
  isLoading: y,
198
- statsLoading: w,
198
+ statsLoading: C,
199
199
  error: r
200
200
  }) => {
201
- const C = [
201
+ const w = [
202
202
  ...o.getLeftVisibleLeafColumns(),
203
203
  ...o.getCenterVisibleLeafColumns(),
204
204
  ...o.getRightVisibleLeafColumns()
205
- ], b = t.getVirtualItems(), h = r instanceof Error ? r.message : typeof r == "string" ? r : "";
206
- return /* @__PURE__ */ i(D, { children: /* @__PURE__ */ l(
207
- P,
205
+ ], b = t.getVirtualItems(), u = r instanceof Error ? r.message : typeof r == "string" ? r : "";
206
+ return /* @__PURE__ */ i(M, { children: /* @__PURE__ */ d(
207
+ B,
208
208
  {
209
209
  className: a({ clickable: !!c }),
210
210
  onClick: c,
@@ -212,71 +212,84 @@ const E = (t) => {
212
212
  children: [
213
213
  s ? /* @__PURE__ */ i("td", { style: { display: "flex", width: s } }) : null,
214
214
  b.map((k) => {
215
- const e = C[k.index];
215
+ const e = w[k.index];
216
216
  if (!e) return null;
217
- const L = e.id === f || e.id === d, F = e.getIsPinned() === "left" && e.getIsLastColumn("left");
217
+ const L = e.id === f || e.id === p, F = e.getIsPinned() === "left" && e.getIsLastColumn("left");
218
218
  return /* @__PURE__ */ i(
219
- R,
219
+ P,
220
220
  {
221
221
  className: a(e.id, { "last-pinned-left": F }),
222
- style: { ...E(e), width: M(e.id) },
222
+ style: { ...T(e), width: A(e.id) },
223
223
  children: y ? /* @__PURE__ */ i(
224
224
  x,
225
225
  {
226
226
  className: a("loading", "shimmer-dark", {
227
- selection: e.id === d
227
+ selection: e.id === p
228
228
  })
229
229
  }
230
- ) : r ? e.id === "name" ? /* @__PURE__ */ l(A, { style: { color: "var(--md-sys-color-error)" }, children: [
230
+ ) : r ? e.id === "name" ? /* @__PURE__ */ d(R, { style: { color: "var(--md-sys-color-error)" }, children: [
231
231
  "Error loading stats",
232
232
  /* @__PURE__ */ i(
233
233
  N,
234
234
  {
235
235
  icon: "info",
236
236
  style: { fontSize: 16, cursor: "help" },
237
- "data-tooltip": h,
237
+ "data-tooltip": u,
238
238
  "data-tooltip-as": "markdown"
239
239
  }
240
240
  ),
241
241
  /* @__PURE__ */ i(
242
- p,
242
+ m,
243
243
  {
244
244
  icon: "content_copy",
245
245
  "data-tooltip": "Copy error message",
246
- onClick: () => z(h),
246
+ onClick: () => z(u),
247
247
  iconProps: { style: { fontSize: 16 } },
248
248
  style: { padding: 2 },
249
249
  variant: "text"
250
250
  }
251
251
  )
252
- ] }) : null : !L && /* @__PURE__ */ l(S, { children: [
252
+ ] }) : null : !L && /* @__PURE__ */ d(S, { children: [
253
253
  v?.(e.id),
254
- w && /* @__PURE__ */ i(O, { className: a("loading", "shimmer-dark") })
254
+ C && /* @__PURE__ */ i(O, { className: a("loading", "shimmer-dark") })
255
255
  ] })
256
256
  },
257
257
  e.id
258
258
  );
259
259
  }),
260
- m ? /* @__PURE__ */ i("td", { style: { display: "flex", width: m } }) : null
260
+ l ? /* @__PURE__ */ i("td", { style: { display: "flex", width: l } }) : null
261
261
  ]
262
262
  }
263
263
  ) });
264
- }, nt = n.div`
264
+ }, at = n.div`
265
265
  position: fixed;
266
266
  z-index: 2000;
267
267
  pointer-events: none;
268
268
  width: 2px;
269
269
  background-color: var(--md-sys-color-primary);
270
270
  `;
271
+ let W = 0;
272
+ const U = E.injectEndpoints({
273
+ endpoints: (t) => ({
274
+ // a number that changes on every refetch; no request
275
+ addonColumnTags: t.query({
276
+ queryFn: () => ({ data: ++W }),
277
+ // tag types are the addon's (addTagTypes) or the host's, unknown to this api's types
278
+ providesTags: (o, s, { tags: l }) => l,
279
+ keepUnusedDataFor: 0
280
+ })
281
+ })
282
+ }), { useAddonColumnTagsQuery: lt } = U;
271
283
  export {
272
- et as C,
284
+ st as C,
273
285
  g as F,
274
- ot as H,
275
- tt as S,
276
- it as T,
277
- nt as a,
278
- X as b,
279
- E as c,
280
- M as g,
281
- Y as u
286
+ nt as H,
287
+ it as S,
288
+ rt as T,
289
+ at as a,
290
+ ot as b,
291
+ lt as c,
292
+ T as d,
293
+ A as g,
294
+ et as u
282
295
  };
@@ -1,4 +1,4 @@
1
- import { f as r } from "./PlayableIcon.es.js";
1
+ import { f as r } from "./FilmstripEntityCard.es.js";
2
2
  const a = "relative:", i = (t) => typeof t == "string" && t.startsWith(a), o = (t) => {
3
3
  const e = t.replace(a, "").split(":");
4
4
  if (e.length !== 2) return null;
@@ -1,25 +1,37 @@
1
- const o = ({
2
- projectName: r,
3
- entityType: s,
1
+ const c = ({
2
+ projectName: s,
3
+ entityType: r,
4
4
  entityId: n,
5
- thumbnailId: $,
6
- thumbnailHash: u,
7
- placeholder: a
5
+ thumbnailId: t,
6
+ thumbnailHash: l,
7
+ placeholder: u
8
8
  }) => {
9
- if (!r) return null;
10
- if (s === "project")
11
- return l(r, u);
12
- if (!$ && (!n || !s)) return null;
13
- const t = new URLSearchParams();
14
- u && t.set("hash", u), a && t.set("placeholder", a);
15
- const i = t.toString() ? `?${t.toString()}` : "";
16
- return n && s ? `/api/projects/${r}/${s}s/${n}/thumbnail${i}` : `/api/projects/${r}/thumbnails/${$}${i}`;
17
- }, l = (r, s) => {
18
- if (!r) return null;
19
- const n = s ? `?hash=${s}` : "";
20
- return `/api/projects/${r}/thumbnail${n}`;
21
- };
9
+ if (!s) return null;
10
+ if (r === "project")
11
+ return a(s, l);
12
+ if (!t && (!n || !r)) return null;
13
+ const i = new URLSearchParams();
14
+ l && i.set("hash", l), u && i.set("placeholder", u);
15
+ const $ = i.toString() ? `?${i.toString()}` : "";
16
+ return n && r ? `/api/projects/${s}/${r}s/${n}/thumbnail${$}` : `/api/projects/${s}/thumbnails/${t}${$}`;
17
+ }, a = (s, r) => {
18
+ if (!s) return null;
19
+ const n = r ? `?hash=${r}` : "";
20
+ return `/api/projects/${s}/thumbnail${n}`;
21
+ }, o = ["folder", "task", "version"], f = ({
22
+ projectName: s,
23
+ entityType: r,
24
+ entityId: n,
25
+ thumbnailHash: t
26
+ }) => {
27
+ if (!s || !n || !r || !o.includes(r)) return null;
28
+ const l = t ? `?hash=${t}` : "";
29
+ return `/api/projects/${s}/${r}s/${n}/filmstrip${l}`;
30
+ }, e = (s, r) => !s || !r ? null : `/api/projects/${s}/files/${r}/filmstrip`;
22
31
  export {
23
- l as a,
24
- o as g
32
+ o as F,
33
+ f as a,
34
+ e as b,
35
+ a as c,
36
+ c as g
25
37
  };