@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
@@ -1,15 +0,0 @@
1
- const i = {
2
- "@@@": {
3
- id: "task"
4
- },
5
- "@@": {
6
- id: "version"
7
- },
8
- "@": {
9
- id: "user",
10
- isCircle: !0
11
- }
12
- };
13
- export {
14
- i as m
15
- };
@@ -1,148 +0,0 @@
1
- import { useMemo as x, useRef as T, useCallback as d } from "react";
2
- import "react-toastify";
3
- import "lodash";
4
- import "primereact/confirmdialog";
5
- import { g as a } from "./parseHtmlToPlainTextWithLinks.es.js";
6
- import { bf as C } from "./searchTerms.es.js";
7
- import "uuid";
8
- import "react/jsx-runtime";
9
- import "clsx";
10
- import "./PlayableIcon.es.js";
11
- import "@ynput/ayon-react-components";
12
- import "react-router-dom";
13
- import { u as k, a as v } from "./MetaWidget.es.js";
14
- import "date-fns";
15
- import "./ProjectContext.es.js";
16
- import "./getUris.es.js";
17
- import "@tanstack/react-table";
18
- import "./useCreateContextMenu.es.js";
19
- import "./DeleteEntitiesContext.es.js";
20
- import "./GlobalContext.es.js";
21
- import "./useLocalStorage.es.js";
22
- import "@module-federation/enhanced/runtime";
23
- import "semver";
24
- import "./ProjectFoldersContextInstance.es.js";
25
- const E = ["string", "integer", "float"], L = (n, s, r, o) => (r || E).includes(n.data.type || "") && (!s || n.scope?.includes(s)) ? o ? C(n.data) : !0 : !1, Z = ({
26
- allowedTypes: n,
27
- enumOnly: s,
28
- scope: r
29
- }) => {
30
- const { columnOrder: o } = k(), { attribFields: l } = v();
31
- return x(
32
- () => [
33
- {
34
- value: "folderType",
35
- label: "Folder type",
36
- icon: a("folder"),
37
- scopes: ["folder", "task"]
38
- },
39
- {
40
- value: "taskType",
41
- label: "Task type",
42
- icon: a("task"),
43
- scopes: ["task", "version"]
44
- },
45
- {
46
- value: "productType",
47
- label: "Product type",
48
- icon: a("product"),
49
- scopes: ["product", "version"]
50
- },
51
- // {
52
- // value: 'version',
53
- // label: 'Version',
54
- // icon: getAttributeIcon('version'),
55
- // scopes: ['version'],
56
- // },
57
- // {
58
- // value: 'author',
59
- // label: 'Author',
60
- // icon: getAttributeIcon('author'),
61
- // scopes: ['version'],
62
- // },
63
- {
64
- value: "assignees",
65
- label: "Assignee",
66
- icon: a("assignees"),
67
- scopes: ["task"]
68
- },
69
- {
70
- value: "status",
71
- label: "Status",
72
- icon: a("status"),
73
- scopes: ["task", "version", "folder", "product"]
74
- },
75
- {
76
- value: "tags",
77
- label: "Tags",
78
- icon: a("tags"),
79
- scopes: ["task", "version", "folder", "product"]
80
- },
81
- ...l.filter((t) => L(t, r, n, s)).map((t) => ({
82
- value: "attrib." + t.name,
83
- label: t.data.title || t.name,
84
- icon: a(t.name)
85
- }))
86
- ].filter((t) => !r || ("scopes" in t ? t.scopes.includes(r) : !0)).sort((t, b) => {
87
- const c = o.indexOf(t.value), p = o.indexOf(b.value);
88
- return c === -1 && p === -1 ? 0 : c === -1 ? 1 : p === -1 ? -1 : c - p;
89
- }),
90
- [l, o, n, s, r]
91
- );
92
- }, S = "data-column-dnd-container", A = 100, z = ({
93
- columnPinning: n,
94
- columnSizing: s
95
- }) => {
96
- const r = T(null), o = T(null), l = d(() => {
97
- const e = n.left || [];
98
- let i = 24;
99
- return e.forEach((h) => {
100
- i += s[h] || 150;
101
- }), i;
102
- }, [n.left, s]), t = d(
103
- ({ transform: e, activeNodeRect: i, draggingNodeRect: h, active: y }) => {
104
- if (r.current === null || !i || y?.data.current?.type && y.data.current.type !== "column") return e;
105
- let f = o.current;
106
- f === null && (f = (document.querySelector(`[${S}]`)?.getBoundingClientRect().left ?? 0) + l());
107
- const m = h?.left ?? i.left;
108
- if (r.current) {
109
- const g = m + i.width + e.x, u = f + A;
110
- if (g > u)
111
- return { ...e, x: u - m - i.width };
112
- } else {
113
- const g = m + e.x, u = f - A;
114
- if (g < u)
115
- return { ...e, x: u - m };
116
- }
117
- return e;
118
- },
119
- [l]
120
- ), b = d(
121
- (e) => {
122
- if (e === null) {
123
- r.current = null;
124
- return;
125
- }
126
- r.current = n.left?.includes(e) || !1;
127
- },
128
- [n.left]
129
- ), c = d(() => {
130
- r.current = null, o.current = null;
131
- }, []), p = d((e) => {
132
- o.current = e;
133
- }, []);
134
- return {
135
- restrictToSection: t,
136
- setDragPinnedState: b,
137
- clearDragPinnedState: c,
138
- activePinnedState: r,
139
- setCachedBoundary: p
140
- };
141
- };
142
- export {
143
- S as T,
144
- E as a,
145
- Z as b,
146
- L as i,
147
- z as u
148
- };
@@ -1,355 +0,0 @@
1
- import { jsx as P } from "react/jsx-runtime";
2
- import { createContext as k, useState as m, useEffect as S, useContext as I, useRef as A, useCallback as C, useMemo as E } from "react";
3
- import { registerRemotes as O, loadRemote as j } from "@module-federation/enhanced/runtime";
4
- import "./searchTerms.es.js";
5
- import { cP as M } from "./getUris.es.js";
6
- import "primereact/confirmdialog";
7
- import { u as F } from "./GlobalContext.es.js";
8
- import D from "semver";
9
- const x = k({
10
- isLoading: !0,
11
- modules: [],
12
- remotesInitialized: !1
13
- }), _ = ({ children: e, skip: t }) => {
14
- const { data: o = [], isLoading: c } = M(void 0, {
15
- skip: t
16
- }), {
17
- siteInfo: r,
18
- isLoading: { siteInfo: d }
19
- } = F(), [n, i] = m(!1);
20
- return S(() => {
21
- if (c || d || n) return;
22
- if (!o.length) {
23
- i(!0);
24
- return;
25
- }
26
- const l = [];
27
- o.forEach((s) => {
28
- const { addonName: p, addonVersion: g, modules: w = {} } = s;
29
- Object.entries(w).forEach(([b, v]) => {
30
- l.push({
31
- remote: b,
32
- addon: p,
33
- version: g,
34
- modules: v
35
- });
36
- });
37
- }), O(
38
- l.map((s) => ({
39
- name: s.remote,
40
- alias: s.remote,
41
- entry: `/addons/${s.addon || s.remote}/${s.version}/frontend/modules/${s.remote}/remoteEntry.js?server=${r?.releaseInfo?.version || r?.releaseInfo}-${r?.releaseInfo?.buildDate}-${(/* @__PURE__ */ new Date()).getTime()}`,
42
- type: "module"
43
- }))
44
- ), i(!0);
45
- }, [o, c, d, n]), /* @__PURE__ */ P(
46
- x.Provider,
47
- {
48
- value: {
49
- isLoading: c,
50
- modules: o,
51
- remotesInitialized: n
52
- },
53
- children: e
54
- }
55
- );
56
- }, N = () => {
57
- const e = I(x);
58
- if (e === void 0)
59
- throw new Error("useRemoteModules must be used within a RemoteModulesProvider");
60
- return e;
61
- }, $ = ({
62
- addon: e,
63
- remote: t,
64
- module: o,
65
- fallback: c,
66
- minVersion: r,
67
- skip: d = !1
68
- }) => {
69
- const { remotesInitialized: n, modules: i } = N(), [l, s] = m(!0), [p, g] = m(!1), [w, b] = m(!1), v = A(c);
70
- return S(() => {
71
- if (d) {
72
- s(!1), g(!0);
73
- return;
74
- }
75
- if (!n || !e || !t || !o) return;
76
- const u = i.find((f) => f.addonName === e);
77
- if (!u) {
78
- console.log("remote not found", { addon: e, remote: t, module: o }), s(!1);
79
- return;
80
- }
81
- if (r && !D.gte(u.addonVersion, r) && r + "-dev" !== u.addonVersion) {
82
- console.log("remote version does not meet minimum requirement", {
83
- addon: e,
84
- remote: t,
85
- module: o,
86
- current: u.addonVersion,
87
- required: r
88
- }), b(!0), s(!1);
89
- return;
90
- }
91
- if (b(!1), !u.modules[t])
92
- return s(!1), console.log("module not found", { addon: e, remote: t, module: o });
93
- if (p === o) {
94
- s(!1);
95
- return;
96
- }
97
- j(`${t}/${o}`, {
98
- from: "runtime"
99
- }).then((f) => {
100
- g(o), s(!1), f && (v.current = f.default);
101
- }).catch((f) => {
102
- s(!1), console.error("error loading remote", t, o, f);
103
- });
104
- }, [p, n, i, e, t, o, r, d]), [
105
- v.current,
106
- {
107
- isLoaded: p === o,
108
- isLoading: l,
109
- outdated: w ? {
110
- current: i.find((u) => u.addonName === e)?.addonVersion || "unknown",
111
- required: r?.replace("-dev", "") || "unknown"
112
- } : void 0
113
- }
114
- ];
115
- }, T = {
116
- planner: {
117
- label: "Planner",
118
- icon: "calendar_month",
119
- features: {
120
- subtasks: {
121
- label: "Subtasks",
122
- description: "Divide complex tasks into smaller, actionable items for more granular tracking and clearer responsibility.",
123
- bullet: "Granular task breakdown with subtasks"
124
- },
125
- integratedPlanning: {
126
- label: "Integrated Planning",
127
- description: "Bridge high-level phase estimation and detailed task scheduling to map out production timelines before assigning artists.",
128
- bullet: "High-level and granular planning in one place"
129
- },
130
- studioOversight: {
131
- label: "Studio Oversight",
132
- description: "Toggle between a bird's-eye view of all studio projects and project-specific deep-dive views to spot scheduling overlaps.",
133
- bullet: "Cross-project scheduling and conflict detection"
134
- },
135
- sandboxScenarios: {
136
- label: "Sandbox Scenarios",
137
- description: 'Experiment with "what-if" scheduling strategies in private scenarios, then set your best version to "Live" with one click.',
138
- bullet: 'Risk-free "what-if" scheduling experiments'
139
- },
140
- trackBasedTimelines: {
141
- label: "Track-Based Timelines",
142
- description: "Manage complex timelines using familiar lane-based organization—similar to video editing—for episodes, departments, or assets.",
143
- bullet: "Familiar lane-based timeline organization"
144
- },
145
- dataPortability: {
146
- label: "Data Portability",
147
- description: "Export schedules to CSV or ICS to keep your team synced across spreadsheets, calendars, and other platforms.",
148
- bullet: "CSV and ICS export for universal sync"
149
- }
150
- },
151
- featureOrder: [
152
- "subtasks",
153
- "integratedPlanning",
154
- "studioOversight",
155
- "sandboxScenarios",
156
- "trackBasedTimelines",
157
- "dataPortability"
158
- ]
159
- }
160
- }, K = [
161
- "annotations",
162
- "sharedViews",
163
- "listFolders",
164
- "groupAttributes",
165
- "listAccess",
166
- "slicer",
167
- "projectFolders",
168
- "releases",
169
- "advancedFilters",
170
- "listAttributes",
171
- "commentCategories",
172
- "columnSummaries"
173
- ], V = {
174
- annotations: {
175
- label: "Annotations",
176
- description: "Create detailed visual feedback directly on media files.",
177
- bullet: "Advanced media review tools"
178
- },
179
- projectFolders: {
180
- label: "Project Folders",
181
- description: "Organize your projects into folders for a cleaner and more structured view.",
182
- bullet: "Organize projects into folders"
183
- },
184
- sharedViews: {
185
- label: "Shared Views",
186
- description: "Save custom views and share them with team members for better collaboration.",
187
- bullet: "Save and share custom views"
188
- },
189
- listFolders: {
190
- label: "List Folders",
191
- description: "Organize your lists into folders for a cleaner and more structured view.",
192
- bullet: "Organize lists into folders"
193
- },
194
- groupAttributes: {
195
- label: "Group Attributes",
196
- description: "Group tasks by assignees, status, or other attributes for better organization.",
197
- bullet: "Group tasks by attributes"
198
- },
199
- commentCategories: {
200
- label: "Comment Categories",
201
- description: "Organize comments with categories, assign permissions, and use colors for better distinction. Set visibility rules to control who can view specific comments.",
202
- bullet: "Enhanced comment organization, permissions, and visibility"
203
- },
204
- slicer: {
205
- label: "Slicer",
206
- description: "Advanced filtering system for project organization.",
207
- bullet: "Powerful project filtering tools"
208
- },
209
- releases: {
210
- label: "Release History",
211
- description: "Access and download the complete archive of releases",
212
- bullet: "Full release archive access"
213
- },
214
- advancedFilters: {
215
- label: "Advanced Filters",
216
- description: "Customize your view and find your data with powerful filtering options",
217
- bullet: "Advanced filtering options"
218
- },
219
- listAttributes: {
220
- label: "List Attributes",
221
- description: "Add custom attributes to your lists for better collaboration and organization.",
222
- bullet: "Custom attributes for lists"
223
- },
224
- listAccess: {
225
- label: "List Access",
226
- description: "Manage and control access to your lists with advanced sharing options.",
227
- bullet: "Advanced list sharing options"
228
- },
229
- columnSummaries: {
230
- label: "Column Summaries",
231
- description: "Aggregate each column totals, averages, distributions in a summary footer.",
232
- bullet: "Per-column summary footer"
233
- }
234
- }, z = k(void 0), X = ({
235
- children: e,
236
- debug: t
237
- }) => {
238
- const [o, c] = m(null), [r, d] = m(null), n = (a) => a !== null && typeof a == "object" && "addon" in a, i = C((a) => {
239
- a === null ? (c(null), d(null)) : n(a) ? (c(null), d(a)) : (d(null), c(a));
240
- }, []), l = (a) => a ? V[a] : null, s = (a) => {
241
- if (!a) return null;
242
- const h = T[a.addon];
243
- return h ? { ...h, selectedFeature: a.feature } : null;
244
- }, [p, g] = m(!1), [w, b] = m(!0), v = async () => !1, [u, { isLoaded: L, isLoading: f }] = $({
245
- addon: "powerpack",
246
- remote: "license",
247
- module: "checkPowerLicense",
248
- fallback: v
249
- });
250
- S(() => {
251
- (async () => {
252
- if (t?.powerLicense !== void 0)
253
- console.warn("Using debug power license:", t.powerLicense), g(t.powerLicense), b(!1);
254
- else if (L || !f) {
255
- try {
256
- const h = await u();
257
- g(h);
258
- } catch (h) {
259
- console.error("Error checking power license:", h), g(!1);
260
- } finally {
261
- b(!1);
262
- }
263
- b(!1);
264
- }
265
- })();
266
- }, [t, L, f, u]);
267
- const R = E(
268
- () => ({
269
- powerLicense: p,
270
- isLoading: w,
271
- selectedPowerPack: o,
272
- selectedAddon: r,
273
- setPowerpackDialog: i,
274
- powerpackDialog: l(o),
275
- addonDialog: s(r)
276
- }),
277
- [p, o, r, i, w]
278
- );
279
- return /* @__PURE__ */ P(z.Provider, { value: R, children: e });
280
- }, Y = () => {
281
- const e = I(z);
282
- if (e === void 0)
283
- throw new Error("usePowerpack must be used within a PowerpackProvider");
284
- return e;
285
- }, y = (e, t = null) => {
286
- if (!e) return t;
287
- try {
288
- return JSON.parse(e);
289
- } catch {
290
- return t;
291
- }
292
- }, Z = (e, t) => {
293
- if (typeof window > "u") return t;
294
- try {
295
- return y(localStorage.getItem(e), t);
296
- } catch {
297
- return t;
298
- }
299
- }, ee = (e, t) => {
300
- if (!(typeof window > "u"))
301
- try {
302
- localStorage.setItem(e, JSON.stringify(t)), window.dispatchEvent(new Event("storage"));
303
- } catch (o) {
304
- console.error(o);
305
- }
306
- };
307
- function te(e, t) {
308
- const o = A(t);
309
- o.current = t;
310
- const [c, r] = m(() => {
311
- const n = localStorage.getItem(e);
312
- return y(n, t);
313
- });
314
- S(() => {
315
- const n = localStorage.getItem(e);
316
- r(y(n, o.current)), n || localStorage.setItem(e, JSON.stringify(o.current));
317
- function i(l) {
318
- if (l.key && l.key !== e) return;
319
- const s = localStorage.getItem(e);
320
- r(y(s, o.current));
321
- }
322
- return window.addEventListener("storage", i), () => {
323
- window.removeEventListener("storage", i);
324
- };
325
- }, [e]);
326
- const d = C(
327
- (n) => {
328
- try {
329
- r((i) => {
330
- const l = typeof n == "function" ? n(i) : n;
331
- return localStorage.setItem(e, JSON.stringify(l)), typeof window < "u" && setTimeout(() => {
332
- window.dispatchEvent(new Event("storage"));
333
- }, 0), l;
334
- });
335
- } catch (i) {
336
- console.error(i);
337
- }
338
- },
339
- [e]
340
- );
341
- return [c, d];
342
- }
343
- export {
344
- X as P,
345
- _ as R,
346
- $ as a,
347
- T as b,
348
- V as c,
349
- N as d,
350
- te as e,
351
- K as p,
352
- Z as r,
353
- Y as u,
354
- ee as w
355
- };