@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
@@ -2,15 +2,22 @@ import { jsx as I } from "react/jsx-runtime";
2
2
  import { EntityCard as S } from "@ynput/ayon-react-components";
3
3
  import U, { keyframes as W } from "styled-components";
4
4
  import "./searchTerms.es.js";
5
- import { bC as L } from "./getUris.es.js";
5
+ import { bD as L } from "./getUris.es.js";
6
6
  import "primereact/confirmdialog";
7
- import { u as Y } from "./ProjectContext.es.js";
7
+ import "react";
8
+ import "@module-federation/enhanced/runtime";
9
+ import { n as Y } from "./DeleteEntitiesContextInstance.es.js";
8
10
  import "lodash";
9
11
  import "react-toastify";
10
12
  import { g as _ } from "./getEntityTypeIcon.es.js";
11
13
  import "uuid";
12
14
  import { g as z } from "./getThumbnailUrl.es.js";
13
- const F = W`
15
+ import "semver";
16
+ import "./ContextMenuContextInstance.es.js";
17
+ import "clsx";
18
+ import "react-dom";
19
+ import "react-redux";
20
+ const D = W`
14
21
  from {
15
22
  opacity: 0.4;
16
23
  scale: 0.9;
@@ -18,7 +25,7 @@ from {
18
25
  opacity: 1;
19
26
  scale: 1;
20
27
  }
21
- `, G = U(S)`
28
+ `, F = U(S)`
22
29
  position: fixed;
23
30
  max-width: 220px;
24
31
  z-index: 9999;
@@ -26,7 +33,7 @@ from {
26
33
  translate: -50% calc(-100% - 4px);
27
34
  transform-origin: bottom center;
28
35
 
29
- animation: ${F} 100ms ease-out;
36
+ animation: ${D} 100ms ease-out;
30
37
 
31
38
  /* path always open */
32
39
  .description {
@@ -35,20 +42,20 @@ from {
35
42
 
36
43
  /* shadow */
37
44
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
38
- `, H = ["folder", "task", "version", "workfile"], tt = ({
45
+ `, G = ["folder", "task", "version", "workfile"], nt = ({
39
46
  entityType: t,
40
- entityId: e,
41
- projectName: m,
42
- pos: { left: i = 0, top: l = 0 } = {},
47
+ entityId: i,
48
+ projectName: c,
49
+ pos: { left: e = 0, top: l = 0 } = {},
43
50
  projectInfo: r,
44
51
  onMouseEnter: d,
45
52
  onMouseLeave: u
46
53
  }) => {
47
- const o = Y(), a = m || o?.projectName, p = !!t && H.includes(t), { data: c, isFetching: f } = L(
48
- { entityType: t, entityId: e, projectName: a },
49
- { skip: !p || !e || !a }
54
+ const o = Y(), a = c || o?.projectName, p = !!t && G.includes(t), { data: m, isFetching: f } = L(
55
+ { entityType: t, entityId: i, projectName: a },
56
+ { skip: !p || !i || !a }
50
57
  ), n = 220;
51
- i + n / 2 > window.innerWidth && (i = window.innerWidth - n / 2);
58
+ e + n / 2 > window.innerWidth && (e = window.innerWidth - n / 2);
52
59
  const {
53
60
  title: h,
54
61
  subTitle: T,
@@ -60,23 +67,23 @@ from {
60
67
  thumbnailId: b,
61
68
  status: E,
62
69
  thumbnailHash: P
63
- } = c || {}, j = r?.taskTypes || o?.taskTypes || [], N = r?.folderTypes || o?.folderTypes || [], v = (r?.statuses || o?.statuses || []).find((s) => s.name === E), C = c ? z({
64
- entityId: e || "",
70
+ } = m || {}, j = r?.taskTypes || o?.taskTypes || [], N = r?.folderTypes || o?.folderTypes || [], v = (r?.statuses || o?.statuses || []).find((s) => s.name === E), O = m ? z({
71
+ entityId: i || "",
65
72
  entityType: t,
66
73
  thumbnailHash: P,
67
74
  thumbnailId: b,
68
75
  projectName: a || "",
69
76
  placeholder: "none"
70
- }) : null, O = {
77
+ }) : null, C = {
71
78
  task: j.find((s) => s.name === w)?.icon,
72
79
  folder: N.find((s) => s.name === g)?.icon,
73
80
  version: o?.getProductType(k).icon,
74
81
  workfile: _("workfile")
75
82
  };
76
83
  return p ? /* @__PURE__ */ I(
77
- G,
84
+ F,
78
85
  {
79
- style: { left: i, top: l, maxWidth: n },
86
+ style: { left: e, top: l, maxWidth: n },
80
87
  onMouseEnter: d,
81
88
  onMouseLeave: u,
82
89
  title: h,
@@ -88,12 +95,12 @@ from {
88
95
  hidePriority: !0,
89
96
  isLoading: f,
90
97
  loadingSections: ["header", "title", "users", "status"],
91
- titleIcon: O[t || ""],
92
- imageUrl: C || void 0
98
+ titleIcon: C[t || ""],
99
+ imageUrl: O || void 0
93
100
  }
94
101
  ) : null;
95
102
  };
96
103
  export {
97
- H as E,
98
- tt as a
104
+ G as E,
105
+ nt as a
99
106
  };
@@ -1,118 +1,60 @@
1
1
  import { jsx as E } from "react/jsx-runtime";
2
- import { useContext as _, useRef as f, useEffect as U, useState as x, useMemo as I } from "react";
2
+ import { useRef as U, useState as h, useEffect as x, useMemo as A } from "react";
3
3
  import "lodash";
4
4
  import "primereact/confirmdialog";
5
5
  import "react-toastify";
6
6
  import "uuid";
7
- import { bd as b } from "./searchTerms.es.js";
8
- import { c as C } from "./realtimeUpdatesUtils.es.js";
9
- import { E as S } from "./DeleteEntitiesContext.es.js";
10
- import { u as P } from "./viewUpdateHelper.es.js";
11
- const T = !0, m = (t) => ({
12
- created: t,
13
- label_changed: t,
14
- renamed: t,
15
- type_changed: t,
16
- status_changed: t,
17
- tags_changed: t,
18
- attrib_changed: t,
19
- deleted: t
20
- }), v = (t, e) => t === e || t.startsWith(`${e}.`), y = (t, e) => e.length === 0 ? !0 : e.includes(t || ""), w = (t) => {
21
- const e = t.split(".").pop();
22
- if (e && [
23
- "created",
24
- "label_changed",
25
- "renamed",
26
- "type_changed",
27
- "status_changed",
28
- "tags_changed",
29
- "attrib_changed",
30
- "deleted"
31
- ].includes(e))
32
- return e;
33
- }, Y = ({ children: t, projectNames: e }) => {
34
- const n = f(0), [l = m(!1), r] = P("autoSync"), [c, o] = x([]);
35
- U(() => {
36
- const i = C(
37
- (a) => {
38
- const p = a.map(({ project: s, topic: g, updateType: A, message: h }) => ({
39
- id: ++n.current,
40
- project: s,
41
- topic: g,
42
- updateType: A,
43
- entityId: h.summary?.entityId,
44
- message: h
7
+ import { be as f } from "./searchTerms.es.js";
8
+ import { c as I } from "./realtimeUpdatesUtils.es.js";
9
+ import { t as y, m as S, g as T, c as v, E as w } from "./DeleteEntitiesContextInstance.es.js";
10
+ import { u as C } from "./viewUpdateHelper.es.js";
11
+ const P = !0, Y = ({ children: l, projectNames: r }) => {
12
+ const a = U(0), [s = y(!1), p] = C("autoSync"), [u, m] = h([]);
13
+ x(() => {
14
+ const n = I(
15
+ (o) => {
16
+ const e = o.map(({ project: t, topic: i, updateType: b, message: d }) => ({
17
+ id: ++a.current,
18
+ project: t,
19
+ topic: i,
20
+ updateType: b,
21
+ entityId: d.summary?.entityId,
22
+ message: d
45
23
  }));
46
- o((s) => [...s, ...p]);
24
+ m((t) => [...t, ...e]);
47
25
  },
48
- ({ key: a }) => String(a),
26
+ ({ key: o }) => String(o),
49
27
  0
50
- ), d = b.subscribeAll((a, p) => {
51
- if (!p?.topic || !y(p.project, e)) return;
52
- const s = w(p.topic);
53
- !s || l[s];
28
+ ), c = f.subscribeAll((o, e) => {
29
+ if (!e?.topic || !S(e.project, r)) return;
30
+ const t = T(e.topic);
31
+ !t || s[t];
54
32
  });
55
33
  return () => {
56
- b.unsubscribe(d), i.clear();
34
+ f.unsubscribe(c), n.clear();
57
35
  };
58
- }, [l, e]);
59
- const u = I(
36
+ }, [s, r]);
37
+ const g = A(
60
38
  () => ({
61
- updates: c,
62
- projectNames: e,
63
- acknowledge: (i, d, a) => {
64
- o(
65
- (p) => p.filter(
66
- (s) => s.id > a || !i.some((g) => v(s.topic, g)) || !y(s.project, d)
39
+ updates: u,
40
+ projectNames: r,
41
+ acknowledge: (n, c, o) => {
42
+ m(
43
+ (e) => e.filter(
44
+ (t) => t.id > o || !n.some((i) => v(t.topic, i)) || !S(t.project, c)
67
45
  )
68
46
  );
69
47
  },
70
- getLatestId: () => n.current,
71
- autoSyncSettings: m(!0),
48
+ getLatestId: () => a.current,
49
+ autoSyncSettings: y(!0),
72
50
  // force auto sync on always if the flag is set
73
- setAutoSyncSettings: r
51
+ setAutoSyncSettings: p
74
52
  }),
75
- [l, e, r, c]
53
+ [s, r, p, u]
76
54
  );
77
- return /* @__PURE__ */ E(S.Provider, { value: u, children: t });
78
- }, $ = ({
79
- projectNames: t,
80
- topics: e,
81
- isSyncing: n = !1,
82
- shouldSyncOnUpdate: l
83
- }) => {
84
- const r = _(S);
85
- if (!r)
86
- throw new Error("useSyncUpdates must be used within an EntityUpdatesProvider");
87
- const c = t || r.projectNames, o = f(0), u = f(!1), i = r.updates.filter(
88
- (d) => y(d.project, c) && e.some((a) => v(d.topic, a)) && (l?.(d) ?? !0)
89
- );
90
- return U(() => {
91
- n && !u.current ? o.current = r.getLatestId() : !n && u.current && r.acknowledge(e, c, o.current), u.current = n;
92
- }, [r, n, c, e]), {
93
- updates: i,
94
- hasUpdates: i.length > 0,
95
- updateCount: i.length
96
- };
97
- }, q = () => {
98
- const t = _(S);
99
- if (!t)
100
- throw new Error("useAutoSyncSettings must be used within an EntityUpdatesProvider");
101
- const { autoSyncSettings: e, setAutoSyncSettings: n } = t;
102
- return [e, (r) => {
103
- const { settings: c, global: o } = r;
104
- n(o !== void 0 ? m(o) : (u) => ({ ...u, ...c }));
105
- }];
106
- }, z = (t, e) => {
107
- if (!e) return !1;
108
- const n = w(t);
109
- return n ? e[n] : !1;
55
+ return /* @__PURE__ */ E(w.Provider, { value: g, children: l });
110
56
  };
111
57
  export {
112
58
  Y as E,
113
- T as F,
114
- w as a,
115
- $ as b,
116
- z as g,
117
- q as u
59
+ P as F
118
60
  };