@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.
- package/dist/ContextMenu.es.js +34 -16
- package/dist/DetailsPanel.es.js +307 -311
- package/dist/Feed.es.js +179 -50
- package/dist/ListTable.es.js +99 -92
- package/dist/NewEntity.es.js +1256 -11
- package/dist/ProjectTreeTable.es.js +4459 -2959
- package/dist/SimpleTable.es.js +8 -7
- package/dist/Slicer.es.js +451 -147
- package/dist/Views.es.js +918 -310
- package/dist/api.es.js +331 -329
- package/dist/chunks/Actions.es.js +32 -27
- package/dist/chunks/ColumnDropIndicator.es.js +174 -328
- package/dist/chunks/ColumnDropIndicator.styled.es.js +281 -0
- package/dist/chunks/ColumnHeaderMenuUI.es.js +52 -0
- package/dist/chunks/ContextMenuContextInstance.es.js +12 -0
- package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +229 -0
- package/dist/chunks/DeleteEntitiesContextInstance.es.js +827 -0
- package/dist/chunks/DetailsDialog.es.js +3 -3
- package/dist/chunks/EmptyPlaceholder.es.js +4 -4
- package/dist/chunks/EntityPath.es.js +74 -69
- package/dist/chunks/EntityPickerDialog.es.js +25 -21
- package/dist/chunks/EntityTooltip.es.js +29 -22
- package/dist/chunks/EntityUpdatesContext.es.js +38 -96
- package/dist/chunks/Feed.es.js +2321 -2668
- package/dist/chunks/FilterErrorActions.es.js +25 -229
- package/dist/chunks/Menu.es.js +21 -17
- package/dist/chunks/MenuContext.es.js +14 -256
- package/dist/chunks/MenuItem.es.js +34 -24
- package/dist/chunks/MetaWidget.es.js +2895 -4919
- package/dist/chunks/NewEntityContextInstance.es.js +11 -0
- package/dist/chunks/PlayableIcon.es.js +4215 -1179
- package/dist/chunks/ProjectContext.es.js +102 -66
- package/dist/chunks/RepresentationsList.es.js +4 -4
- package/dist/chunks/ReviewablesSelector.es.js +468 -460
- package/dist/chunks/SimpleForm.es.js +18 -18
- package/dist/chunks/SimpleTable.es.js +15 -13
- package/dist/chunks/Slicer.es.js +109 -98
- package/dist/chunks/TableSettingsFallback.es.js +22 -10
- package/dist/chunks/ThumbnailSimple.es.js +290 -52
- package/dist/chunks/VersionUploadContextInstance.es.js +12 -0
- package/dist/chunks/VideoPlayer.es.js +24 -28
- package/dist/chunks/Watchers.es.js +669 -644
- package/dist/chunks/entityDefinitions.es.js +2 -350
- package/dist/chunks/expandRelativeDates.es.js +27 -0
- package/dist/chunks/extractVersionFromFilename.es.js +28 -0
- package/dist/chunks/getBundleMode.es.js +1 -1
- package/dist/chunks/getUris.es.js +737 -710
- package/dist/chunks/queryFilterToClientFilter.es.js +11 -10
- package/dist/chunks/searchTerms.es.js +179 -174
- package/dist/chunks/useAttributeEnums.es.js +9 -9
- package/dist/chunks/useCreateContextMenu.es.js +66 -90
- package/dist/chunks/useDateRangeFilter.es.js +3 -3
- package/dist/chunks/useHierarchySelection.es.js +24 -0
- package/dist/chunks/useLoadModule.es.js +74 -0
- package/dist/chunks/useQueryArgumentChangeLoading.es.js +11 -0
- package/dist/chunks/versionUploadHelpers.es.js +16 -42
- package/dist/chunks/viewUpdateHelper.es.js +74 -57
- package/dist/components.es.js +1432 -1001
- package/dist/context.es.js +791 -78
- package/dist/hooks.es.js +95 -94
- package/dist/index.es.js +27 -26
- package/dist/types/Actions.d.ts +15 -15
- package/dist/types/ContextMenu.d.ts +19 -16
- package/dist/types/DetailsPanel.d.ts +110 -17
- package/dist/types/EntityPickerDialog.d.ts +15 -15
- package/dist/types/Feed.d.ts +19 -16
- package/dist/types/ListTable.d.ts +15 -15
- package/dist/types/NewEntity.d.ts +24 -18
- package/dist/types/ProjectTreeTable.d.ts +34 -123
- package/dist/types/RepresentationsList.d.ts +15 -15
- package/dist/types/SimpleTable.d.ts +19 -16
- package/dist/types/Slicer.d.ts +18 -15
- package/dist/types/Views.d.ts +19 -16
- package/dist/types/api.d.ts +515 -207
- package/dist/types/components.d.ts +84 -20
- package/dist/types/context.d.ts +108 -25
- package/dist/types/hooks.d.ts +15 -15
- package/dist/types/index.d.ts +15 -15
- package/dist/types/util.d.ts +20 -15
- package/dist/util.es.js +117 -105
- package/package.json +16 -4
- package/dist/chunks/DeleteEntitiesContext.es.js +0 -748
- package/dist/chunks/GlobalContext.es.js +0 -52
- package/dist/chunks/NewEntityContext.es.js +0 -1242
- package/dist/chunks/ProjectFoldersContext.es.js +0 -134
- package/dist/chunks/ProjectFoldersContextInstance.es.js +0 -7
- package/dist/chunks/VersionUploadContext.es.js +0 -232
- package/dist/chunks/ViewsContext.es.js +0 -878
- package/dist/chunks/mentionTypeOptions.es.js +0 -15
- package/dist/chunks/useColumnDragRestriction.es.js +0 -148
- package/dist/chunks/useLocalStorage.es.js +0 -355
- /package/dist/{useCreateContextMenu.css → ContextMenuContextInstance.css} +0 -0
package/dist/Feed.es.js
CHANGED
|
@@ -1,58 +1,187 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import {
|
|
3
|
-
import { useMemo as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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:
|
|
15
|
-
config: { multiSelect:
|
|
142
|
+
onSelectionChange: e,
|
|
143
|
+
config: { multiSelect: n = !0 } = {}
|
|
16
144
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
}),
|
|
23
|
-
}, [
|
|
24
|
-
return
|
|
25
|
-
(
|
|
26
|
-
const { key: a, target:
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
if (!
|
|
30
|
-
const
|
|
31
|
-
if (!
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
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
|
-
[
|
|
166
|
+
[o, s]
|
|
39
167
|
);
|
|
40
168
|
};
|
|
41
169
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
};
|