@ynput/ayon-frontend-shared 0.5.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 (92) hide show
  1. package/dist/ContextMenu.es.js +34 -16
  2. package/dist/DetailsPanel.es.js +307 -311
  3. package/dist/Feed.es.js +179 -50
  4. package/dist/ListTable.es.js +99 -92
  5. package/dist/NewEntity.es.js +1256 -11
  6. package/dist/ProjectTreeTable.es.js +4459 -2959
  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/api.es.js +331 -329
  11. package/dist/chunks/Actions.es.js +32 -27
  12. package/dist/chunks/ColumnDropIndicator.es.js +174 -328
  13. package/dist/chunks/ColumnDropIndicator.styled.es.js +281 -0
  14. package/dist/chunks/ColumnHeaderMenuUI.es.js +52 -0
  15. package/dist/chunks/ContextMenuContextInstance.es.js +12 -0
  16. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +229 -0
  17. package/dist/chunks/DeleteEntitiesContextInstance.es.js +827 -0
  18. package/dist/chunks/DetailsDialog.es.js +3 -3
  19. package/dist/chunks/EmptyPlaceholder.es.js +4 -4
  20. package/dist/chunks/EntityPath.es.js +74 -69
  21. package/dist/chunks/EntityPickerDialog.es.js +25 -21
  22. package/dist/chunks/EntityTooltip.es.js +29 -22
  23. package/dist/chunks/EntityUpdatesContext.es.js +38 -96
  24. package/dist/chunks/Feed.es.js +2321 -2668
  25. package/dist/chunks/FilterErrorActions.es.js +25 -229
  26. package/dist/chunks/Menu.es.js +21 -17
  27. package/dist/chunks/MenuContext.es.js +14 -256
  28. package/dist/chunks/MenuItem.es.js +34 -24
  29. package/dist/chunks/MetaWidget.es.js +2895 -4919
  30. package/dist/chunks/NewEntityContextInstance.es.js +11 -0
  31. package/dist/chunks/PlayableIcon.es.js +4215 -1179
  32. package/dist/chunks/ProjectContext.es.js +102 -66
  33. package/dist/chunks/RepresentationsList.es.js +4 -4
  34. package/dist/chunks/ReviewablesSelector.es.js +468 -460
  35. package/dist/chunks/SimpleForm.es.js +18 -18
  36. package/dist/chunks/SimpleTable.es.js +15 -13
  37. package/dist/chunks/Slicer.es.js +109 -98
  38. package/dist/chunks/TableSettingsFallback.es.js +22 -10
  39. package/dist/chunks/ThumbnailSimple.es.js +290 -52
  40. package/dist/chunks/VersionUploadContextInstance.es.js +12 -0
  41. package/dist/chunks/VideoPlayer.es.js +24 -28
  42. package/dist/chunks/Watchers.es.js +669 -644
  43. package/dist/chunks/entityDefinitions.es.js +2 -350
  44. package/dist/chunks/expandRelativeDates.es.js +27 -0
  45. package/dist/chunks/extractVersionFromFilename.es.js +28 -0
  46. package/dist/chunks/getBundleMode.es.js +1 -1
  47. package/dist/chunks/getUris.es.js +737 -710
  48. package/dist/chunks/queryFilterToClientFilter.es.js +11 -10
  49. package/dist/chunks/searchTerms.es.js +179 -174
  50. package/dist/chunks/useAttributeEnums.es.js +9 -9
  51. package/dist/chunks/useCreateContextMenu.es.js +66 -90
  52. package/dist/chunks/useDateRangeFilter.es.js +3 -3
  53. package/dist/chunks/useHierarchySelection.es.js +24 -0
  54. package/dist/chunks/useLoadModule.es.js +74 -0
  55. package/dist/chunks/useQueryArgumentChangeLoading.es.js +11 -0
  56. package/dist/chunks/versionUploadHelpers.es.js +16 -42
  57. package/dist/chunks/viewUpdateHelper.es.js +74 -57
  58. package/dist/components.es.js +1432 -1001
  59. package/dist/context.es.js +791 -78
  60. package/dist/hooks.es.js +95 -94
  61. package/dist/index.es.js +27 -26
  62. package/dist/types/Actions.d.ts +15 -15
  63. package/dist/types/ContextMenu.d.ts +19 -16
  64. package/dist/types/DetailsPanel.d.ts +110 -17
  65. package/dist/types/EntityPickerDialog.d.ts +15 -15
  66. package/dist/types/Feed.d.ts +19 -16
  67. package/dist/types/ListTable.d.ts +15 -15
  68. package/dist/types/NewEntity.d.ts +24 -18
  69. package/dist/types/ProjectTreeTable.d.ts +34 -123
  70. package/dist/types/RepresentationsList.d.ts +15 -15
  71. package/dist/types/SimpleTable.d.ts +19 -16
  72. package/dist/types/Slicer.d.ts +18 -15
  73. package/dist/types/Views.d.ts +19 -16
  74. package/dist/types/api.d.ts +515 -207
  75. package/dist/types/components.d.ts +84 -20
  76. package/dist/types/context.d.ts +108 -25
  77. package/dist/types/hooks.d.ts +15 -15
  78. package/dist/types/index.d.ts +15 -15
  79. package/dist/types/util.d.ts +20 -15
  80. package/dist/util.es.js +117 -105
  81. package/package.json +16 -4
  82. package/dist/chunks/DeleteEntitiesContext.es.js +0 -748
  83. package/dist/chunks/GlobalContext.es.js +0 -52
  84. package/dist/chunks/NewEntityContext.es.js +0 -1242
  85. package/dist/chunks/ProjectFoldersContext.es.js +0 -134
  86. package/dist/chunks/ProjectFoldersContextInstance.es.js +0 -7
  87. package/dist/chunks/VersionUploadContext.es.js +0 -232
  88. package/dist/chunks/ViewsContext.es.js +0 -878
  89. package/dist/chunks/mentionTypeOptions.es.js +0 -15
  90. package/dist/chunks/useColumnDragRestriction.es.js +0 -148
  91. package/dist/chunks/useLocalStorage.es.js +0 -355
  92. /package/dist/{useCreateContextMenu.css → ContextMenuContextInstance.css} +0 -0
package/dist/Feed.es.js CHANGED
@@ -1,58 +1,187 @@
1
- import { A as D, a as I, C as M, b as P, F as K, c as L, d as N, e as k, i as j, f as O } from "./chunks/Feed.es.js";
2
- import { F as S, a as U, u as W } from "./chunks/PlayableIcon.es.js";
3
- import { useMemo as x, useCallback as E } from "react";
4
- const y = (t) => {
5
- const e = Array.from(t).find((s) => s.startsWith("id-"));
6
- return e ? e.split("-")[1] : null;
7
- }, F = (t, e, s, c, u) => {
8
- const i = Object.keys(t);
9
- return e = [.../* @__PURE__ */ new Set([...e, ...i])], e = s.filter((r) => e.includes(r)), i.includes(c) && (u === 1 ? e.shift() : e.pop()), e;
10
- }, A = ({
11
- tableRef: t,
12
- treeData: e,
1
+ import { A as lt, F as dt, u as ut } from "./chunks/ThumbnailSimple.es.js";
2
+ import { jsxs as V, jsx as A } from "react/jsx-runtime";
3
+ import { useRef as X, useEffect as _, useMemo as j, useCallback as G } from "react";
4
+ import T from "clsx";
5
+ import { Icon as z } from "@ynput/ayon-react-components";
6
+ import { e as J, D as Q, S as Y } from "./chunks/Feed.es.js";
7
+ import { A as vt, C as gt, a as yt, F as mt, b as pt, c as ht, d as xt, i as It, f as bt } from "./chunks/Feed.es.js";
8
+ const Z = ({ files: c, index: t, activityId: s, onNavigate: e }) => {
9
+ const n = c, o = t, u = s, l = () => n[0].id != u, a = () => n[n.length - 1].id != u, r = () => o > 0 || l(), I = () => o < n.find((i) => i.id == u).files.length - 1 || a(), g = () => n[n.findIndex((i) => i.id == u) - 1], m = () => n[n.findIndex((i) => i.id == u) + 1], f = () => g().id, d = () => m().id;
10
+ return {
11
+ canNavigateDown: a,
12
+ canNavigateUp: l,
13
+ canNavigateLeft: r,
14
+ canNavigateRight: I,
15
+ getPreviousActivity: g,
16
+ getNextActivityId: d,
17
+ getByIndexActivity: (i, h) => !i === null || h == null ? { id: null, projectName: null, mime: null, extension: null } : n.find((x) => x.id == i).files[h],
18
+ navigateUp: () => {
19
+ e({ activityId: f(), index: 0 });
20
+ },
21
+ navigateDown: () => e({ activityId: d(), index: 0 }),
22
+ navigateLeft: () => {
23
+ if (o > 0)
24
+ return e({ delta: -1 });
25
+ const i = g();
26
+ e({
27
+ activityId: i.id,
28
+ index: i.files.length - 1
29
+ });
30
+ },
31
+ navigateRight: () => {
32
+ if (o < n.find((i) => i.id == u).files.length - 1)
33
+ return e({ delta: 1 });
34
+ e({ activityId: d(), index: 0 });
35
+ }
36
+ };
37
+ }, ot = ({
38
+ files: c,
39
+ index: t,
40
+ activityId: s,
41
+ projectName: e,
42
+ onFilePreviewClose: n,
43
+ onNavigate: o
44
+ }) => {
45
+ const {
46
+ canNavigateDown: u,
47
+ canNavigateUp: l,
48
+ canNavigateLeft: a,
49
+ canNavigateRight: r,
50
+ getByIndexActivity: I,
51
+ navigateUp: g,
52
+ navigateDown: m,
53
+ navigateLeft: f,
54
+ navigateRight: d
55
+ } = Z({ files: c, index: t, activityId: s, onNavigate: o }), p = { ...I(s, t), projectName: e }, { id: v, mime: b, extension: w, name: P } = p, i = X(null);
56
+ _(() => {
57
+ v && e && i.current?.focus();
58
+ }, [v, e]);
59
+ const h = () => {
60
+ n();
61
+ }, k = Object.values(J).find(
62
+ ({ mimeTypes: L }) => L.some((N) => (b || w)?.includes(N))
63
+ ), { component: x, id: R, callback: C, fullPreviews: B } = k || {};
64
+ if (_(() => {
65
+ if (!v || !e || !x || C) return;
66
+ const L = {
67
+ ArrowUp: [l, g],
68
+ ArrowDown: [u, m],
69
+ ArrowLeft: [a, f],
70
+ ArrowRight: [r, d]
71
+ }, N = (y) => {
72
+ if (y.key === "Escape") {
73
+ y.preventDefault(), y.stopPropagation(), h();
74
+ return;
75
+ }
76
+ const U = L[y.code];
77
+ if (!U) return;
78
+ if (y.target instanceof HTMLElement) {
79
+ const { tagName: M, isContentEditable: q } = y.target;
80
+ if (M === "INPUT" || M === "TEXTAREA" || q) return;
81
+ }
82
+ y.preventDefault(), y.stopPropagation();
83
+ const [W, H] = U;
84
+ W() && H();
85
+ };
86
+ return document.addEventListener("keydown", N, !0), () => document.removeEventListener("keydown", N, !0);
87
+ }, [v, e, c, t, s, x, C]), !v || !e) return null;
88
+ if (C)
89
+ return C(p), null;
90
+ const O = () => a() && f(), S = () => r() && d(), D = R === "image", F = R === "video", E = 50;
91
+ return x ? /* @__PURE__ */ V(
92
+ Q,
93
+ {
94
+ size: "full",
95
+ isOpen: !!(v && e),
96
+ onClose: h,
97
+ hideCancelButton: D,
98
+ ref: i,
99
+ className: T({ isImage: D }, "block-shortcuts"),
100
+ header: D ? null : P,
101
+ children: [
102
+ /* @__PURE__ */ A("div", { style: { position: "absolute", inset: 0, zIndex: E }, onClick: h }),
103
+ /* @__PURE__ */ A(
104
+ z,
105
+ {
106
+ style: { zIndex: E + 1 },
107
+ icon: "chevron_left",
108
+ className: T("navIcon", "left", { disabled: !a() }),
109
+ onClick: O
110
+ }
111
+ ),
112
+ /* @__PURE__ */ A(
113
+ Y,
114
+ {
115
+ style: { zIndex: E + 1 },
116
+ className: T({ scrollable: !D && !F, fill: F }),
117
+ children: /* @__PURE__ */ A(x, { file: p, fullPreviews: B })
118
+ }
119
+ ),
120
+ /* @__PURE__ */ A(
121
+ z,
122
+ {
123
+ style: { zIndex: E + 1 },
124
+ icon: "chevron_right",
125
+ className: T("navIcon", "right", { disabled: !r() }),
126
+ onClick: S
127
+ }
128
+ )
129
+ ]
130
+ }
131
+ ) : null;
132
+ }, K = (c) => {
133
+ const t = Array.from(c).find((s) => s.startsWith("id-"));
134
+ return t ? t.split("-")[1] : null;
135
+ }, $ = (c, t, s, e, n) => {
136
+ const o = Object.keys(c);
137
+ return t = [.../* @__PURE__ */ new Set([...t, ...o])], t = s.filter((l) => t.includes(l)), o.includes(e) && (n === 1 ? t.shift() : t.pop()), t;
138
+ }, at = ({
139
+ tableRef: c,
140
+ treeData: t,
13
141
  selection: s,
14
- onSelectionChange: c,
15
- config: { multiSelect: u = !0 } = {}
142
+ onSelectionChange: e,
143
+ config: { multiSelect: n = !0 } = {}
16
144
  }) => {
17
- const i = x(() => {
18
- const r = [];
19
- return t.current?.getElement()?.querySelectorAll(".p-treetable-tbody tr").forEach((a) => {
20
- const o = y(a.classList);
21
- o && r.push(o);
22
- }), r;
23
- }, [t.current, e]);
24
- return E(
25
- (r) => {
26
- const { key: a, target: o, shiftKey: m } = r;
27
- if (o.tagName === "TR" && (a === "ArrowDown" || a === "ArrowUp")) {
28
- const d = a === "ArrowDown" ? 1 : -1, f = d === 1 ? o.nextElementSibling : o.previousElementSibling;
29
- if (!f) return;
30
- const n = y(f.classList);
31
- if (!n && n !== "undefined") return;
32
- let l = [n];
33
- m && u && (l = F(s, l, i, n, d));
34
- const g = l, v = l.reduce((p, C) => (p[C] = !0, p), {});
35
- c({ array: g, object: v });
145
+ const o = j(() => {
146
+ const l = [];
147
+ return c.current?.getElement()?.querySelectorAll(".p-treetable-tbody tr").forEach((a) => {
148
+ const r = K(a.classList);
149
+ r && l.push(r);
150
+ }), l;
151
+ }, [c.current, t]);
152
+ return G(
153
+ (l) => {
154
+ const { key: a, target: r, shiftKey: I } = l;
155
+ if (r.tagName === "TR" && (a === "ArrowDown" || a === "ArrowUp")) {
156
+ const g = a === "ArrowDown" ? 1 : -1, m = g === 1 ? r.nextElementSibling : r.previousElementSibling;
157
+ if (!m) return;
158
+ const f = K(m.classList);
159
+ if (!f && f !== "undefined") return;
160
+ let d = [f];
161
+ I && n && (d = $(s, d, o, f, g));
162
+ const p = d, v = d.reduce((b, w) => (b[w] = !0, b), {});
163
+ e({ array: p, object: v });
36
164
  }
37
165
  },
38
- [i, s]
166
+ [o, s]
39
167
  );
40
168
  };
41
169
  export {
42
- D as ActivityCategorySelect,
43
- I as ActivityReferenceTooltip,
44
- M as CategoryDropdownItem,
45
- P as CategoryTag,
46
- S as FEED_NEW_COMMENT,
47
- K as Feed,
48
- U as FeedProvider,
49
- L as FileUploadPreview,
50
- N as activitiesLast,
51
- k as expandableMimeTypes,
52
- y as extractIdFromClassList,
53
- F as getMultiSelection,
54
- j as isCategoryHidden,
55
- O as isFilePreviewable,
56
- W as useFeedContext,
57
- A as useTableKeyboardNavigation
170
+ vt as ActivityCategorySelect,
171
+ lt as ActivityReferenceTooltip,
172
+ gt as CategoryDropdownItem,
173
+ yt as CategoryTag,
174
+ mt as FEED_NEW_COMMENT,
175
+ pt as Feed,
176
+ dt as FeedContext,
177
+ ht as FeedProvider,
178
+ ot as FileUploadPreview,
179
+ xt as activitiesLast,
180
+ J as expandableMimeTypes,
181
+ K as extractIdFromClassList,
182
+ $ as getMultiSelection,
183
+ It as isCategoryHidden,
184
+ bt as isFilePreviewable,
185
+ ut as useFeedContext,
186
+ at as useTableKeyboardNavigation
58
187
  };