@ynput/ayon-frontend-shared 0.6.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 (89) hide show
  1. package/dist/ContextMenu.es.js +34 -16
  2. package/dist/DetailsPanel.es.js +292 -298
  3. package/dist/Feed.es.js +179 -50
  4. package/dist/ListTable.es.js +32 -35
  5. package/dist/NewEntity.es.js +1256 -11
  6. package/dist/ProjectTreeTable.es.js +4451 -2965
  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/chunks/Actions.es.js +9 -4
  11. package/dist/chunks/ColumnDropIndicator.es.js +174 -328
  12. package/dist/chunks/ColumnDropIndicator.styled.es.js +281 -0
  13. package/dist/chunks/ColumnHeaderMenuUI.es.js +52 -0
  14. package/dist/chunks/ContextMenuContextInstance.es.js +12 -0
  15. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +229 -0
  16. package/dist/chunks/DeleteEntitiesContextInstance.es.js +827 -0
  17. package/dist/chunks/EmptyPlaceholder.es.js +4 -4
  18. package/dist/chunks/EntityPath.es.js +58 -53
  19. package/dist/chunks/EntityPickerDialog.es.js +24 -20
  20. package/dist/chunks/EntityTooltip.es.js +20 -13
  21. package/dist/chunks/EntityUpdatesContext.es.js +38 -96
  22. package/dist/chunks/Feed.es.js +1495 -1439
  23. package/dist/chunks/FilterErrorActions.es.js +25 -229
  24. package/dist/chunks/Menu.es.js +21 -17
  25. package/dist/chunks/MenuContext.es.js +14 -65
  26. package/dist/chunks/MenuItem.es.js +34 -24
  27. package/dist/chunks/MetaWidget.es.js +2835 -4301
  28. package/dist/chunks/NewEntityContextInstance.es.js +11 -0
  29. package/dist/chunks/PlayableIcon.es.js +1532 -1594
  30. package/dist/chunks/ProjectContext.es.js +102 -66
  31. package/dist/chunks/RepresentationsList.es.js +1 -1
  32. package/dist/chunks/ReviewablesSelector.es.js +457 -458
  33. package/dist/chunks/SimpleForm.es.js +9 -9
  34. package/dist/chunks/SimpleTable.es.js +15 -13
  35. package/dist/chunks/Slicer.es.js +163 -154
  36. package/dist/chunks/TableSettingsFallback.es.js +25 -13
  37. package/dist/chunks/ThumbnailSimple.es.js +150 -261
  38. package/dist/chunks/VersionUploadContextInstance.es.js +12 -0
  39. package/dist/chunks/VideoPlayer.es.js +24 -28
  40. package/dist/chunks/Watchers.es.js +384 -389
  41. package/dist/chunks/entityDefinitions.es.js +2 -350
  42. package/dist/chunks/extractVersionFromFilename.es.js +28 -0
  43. package/dist/chunks/getBundleMode.es.js +61 -16
  44. package/dist/chunks/getUris.es.js +737 -712
  45. package/dist/chunks/searchTerms.es.js +57 -56
  46. package/dist/chunks/useAttributeEnums.es.js +4 -4
  47. package/dist/chunks/useCreateContextMenu.es.js +66 -90
  48. package/dist/chunks/useHierarchySelection.es.js +24 -0
  49. package/dist/chunks/useLoadModule.es.js +74 -0
  50. package/dist/chunks/useQueryArgumentChangeLoading.es.js +11 -0
  51. package/dist/chunks/versionUploadHelpers.es.js +16 -42
  52. package/dist/chunks/viewUpdateHelper.es.js +67 -50
  53. package/dist/components.es.js +1425 -999
  54. package/dist/context.es.js +791 -80
  55. package/dist/hooks.es.js +115 -120
  56. package/dist/index.es.js +19 -23
  57. package/dist/types/Actions.d.ts +7 -7
  58. package/dist/types/ContextMenu.d.ts +11 -8
  59. package/dist/types/DetailsPanel.d.ts +102 -9
  60. package/dist/types/EntityPickerDialog.d.ts +7 -7
  61. package/dist/types/Feed.d.ts +11 -8
  62. package/dist/types/ListTable.d.ts +7 -7
  63. package/dist/types/NewEntity.d.ts +16 -10
  64. package/dist/types/ProjectTreeTable.d.ts +22 -115
  65. package/dist/types/RepresentationsList.d.ts +7 -7
  66. package/dist/types/SimpleTable.d.ts +11 -8
  67. package/dist/types/Slicer.d.ts +10 -7
  68. package/dist/types/Views.d.ts +10 -7
  69. package/dist/types/api.d.ts +132 -120
  70. package/dist/types/components.d.ts +13 -8
  71. package/dist/types/context.d.ts +56 -16
  72. package/dist/types/hooks.d.ts +7 -7
  73. package/dist/types/index.d.ts +7 -7
  74. package/dist/types/util.d.ts +12 -7
  75. package/dist/util.es.js +72 -71
  76. package/package.json +1 -1
  77. package/dist/chunks/DeleteEntitiesContext.es.js +0 -748
  78. package/dist/chunks/DetailsPanelContext.es.js +0 -155
  79. package/dist/chunks/GlobalContext.es.js +0 -52
  80. package/dist/chunks/NewEntityContext.es.js +0 -1242
  81. package/dist/chunks/ProjectFoldersContext.es.js +0 -134
  82. package/dist/chunks/ProjectFoldersContextInstance.es.js +0 -7
  83. package/dist/chunks/VersionUploadContext.es.js +0 -232
  84. package/dist/chunks/ViewsContext.es.js +0 -878
  85. package/dist/chunks/uriUtils.es.js +0 -48
  86. package/dist/chunks/useColumnDragRestriction.es.js +0 -158
  87. package/dist/chunks/useLocalStorage.es.js +0 -355
  88. package/dist/chunks/useSessionStorage.es.js +0 -61
  89. /package/dist/{useCreateContextMenu.css → ContextMenuContextInstance.css} +0 -0
@@ -5977,7 +5977,7 @@ const Oa = PubSub, Da = (t) => !!t?.enum?.length || !!t?.enumResolver, La = (t)
5977
5977
  if (!t.some((n) => n.hidden)) return t;
5978
5978
  const a = new Set(e.map(String));
5979
5979
  return t.filter((n) => !n.hidden || a.has(String(n.value)));
5980
- }, R = ["project_name", "user"], Ba = (t) => R.includes(t), Ua = (t) => R.filter((e) => e in (t || {})), Ha = (t, e) => {
5980
+ }, Ba = (t, e = []) => t.some((a) => a.hidden) ? t.filter((a) => !a.hidden || e.includes(a.name)) : t, R = ["project_name", "user"], Ua = (t) => R.includes(t), Ha = (t) => R.filter((e) => e in (t || {})), Ka = (t, e) => {
5981
5981
  const a = G(t), n = `${e}: ${a}`;
5982
5982
  return K.error(n), n;
5983
5983
  }, G = (t) => {
@@ -6001,7 +6001,7 @@ const Oa = PubSub, Da = (t) => !!t?.enum?.length || !!t?.enumResolver, La = (t)
6001
6001
  ([, a]) => a != null && a !== ""
6002
6002
  );
6003
6003
  return e.length ? Object.fromEntries(e) : void 0;
6004
- }, ht = ({ enumName: t, params: e }) => JSON.stringify({ enumName: t, params: E(V(e) ?? {}) }), Ka = (t, { projectName: e } = {}, a) => {
6004
+ }, ht = ({ enumName: t, params: e }) => JSON.stringify({ enumName: t, params: E(V(e) ?? {}) }), Qa = (t, { projectName: e } = {}, a) => {
6005
6005
  const n = {
6006
6006
  ...t?.enumResolverSettings || {}
6007
6007
  };
@@ -6055,12 +6055,12 @@ const Oa = PubSub, Da = (t) => !!t?.enum?.length || !!t?.enumResolver, La = (t)
6055
6055
  })
6056
6056
  }),
6057
6057
  overrideExisting: !1
6058
- }), Qa = M, {
6059
- useListEnumsQuery: Wa,
6060
- useLazyListEnumsQuery: za,
6061
- useGetEnumOptionsQuery: Ya,
6062
- useLazyGetEnumOptionsQuery: Ja,
6063
- useGetEnumOptionsBatchQuery: Xa
6058
+ }), Wa = M, {
6059
+ useListEnumsQuery: za,
6060
+ useLazyListEnumsQuery: Ya,
6061
+ useGetEnumOptionsQuery: Ja,
6062
+ useLazyGetEnumOptionsQuery: Xa,
6063
+ useGetEnumOptionsBatchQuery: Za
6064
6064
  } = M, vt = C.enhanceEndpoints({
6065
6065
  endpoints: {
6066
6066
  deleteUser: {
@@ -6173,25 +6173,25 @@ const Oa = PubSub, Da = (t) => !!t?.enum?.length || !!t?.enumResolver, La = (t)
6173
6173
  })
6174
6174
  })
6175
6175
  }), {
6176
- useUpdateUserMutation: Za,
6177
- useUpdateUsersMutation: Aa,
6178
- useUpdateUserNameMutation: es,
6179
- useUpdateUserPasswordMutation: ts,
6180
- useAddUserMutation: as,
6181
- useDeleteUserMutation: ss,
6182
- useDeleteAvatarMutation: rs,
6183
- useUpdateUserAPIKeyMutation: ns,
6184
- useInvalidateUserSessionMutation: os,
6185
- useSetFrontendPreferencesMutation: is,
6186
- useInviteUserMutation: ds,
6187
- useAcceptInviteMutation: ps
6188
- } = Nt, cs = (t) => t.split(",").map((e) => e.trim().split(/\s+/).filter(Boolean)).filter((e) => e.length > 0), _ = (t, e) => Object.freeze({
6176
+ useUpdateUserMutation: Aa,
6177
+ useUpdateUsersMutation: es,
6178
+ useUpdateUserNameMutation: ts,
6179
+ useUpdateUserPasswordMutation: as,
6180
+ useAddUserMutation: ss,
6181
+ useDeleteUserMutation: rs,
6182
+ useDeleteAvatarMutation: ns,
6183
+ useUpdateUserAPIKeyMutation: os,
6184
+ useInvalidateUserSessionMutation: is,
6185
+ useSetFrontendPreferencesMutation: ds,
6186
+ useInviteUserMutation: ps,
6187
+ useAcceptInviteMutation: cs
6188
+ } = Nt, ls = (t) => t.split(",").map((e) => e.trim().split(/\s+/).filter(Boolean)).filter((e) => e.length > 0), _ = (t, e) => Object.freeze({
6189
6189
  rankedValue: "",
6190
6190
  rank: t,
6191
6191
  accessorIndex: -1,
6192
6192
  accessorThreshold: k.CONTAINS,
6193
6193
  passed: e
6194
- }), Tt = _(k.NO_MATCH, !1), kt = _(k.CONTAINS, !0), ls = (t, e) => {
6194
+ }), Tt = _(k.NO_MATCH, !1), kt = _(k.CONTAINS, !0), ms = (t, e) => {
6195
6195
  if (!e.length) return kt;
6196
6196
  let a = null;
6197
6197
  for (const n of e) {
@@ -6238,7 +6238,7 @@ export {
6238
6238
  Ge as Z,
6239
6239
  ne as _,
6240
6240
  d as a,
6241
- Ja as a$,
6241
+ Xa as a$,
6242
6242
  Vt as a0,
6243
6243
  zt as a1,
6244
6244
  Ht as a2,
@@ -6268,14 +6268,14 @@ export {
6268
6268
  ba as aQ,
6269
6269
  Ia as aR,
6270
6270
  Fa as aS,
6271
- ps as aT,
6272
- as as aU,
6273
- rs as aV,
6274
- ss as aW,
6275
- Xa as aX,
6276
- Ya as aY,
6277
- os as aZ,
6278
- ds as a_,
6271
+ cs as aT,
6272
+ ss as aU,
6273
+ ns as aV,
6274
+ rs as aW,
6275
+ Za as aX,
6276
+ Ja as aY,
6277
+ is as aZ,
6278
+ ps as a_,
6279
6279
  Kt as aa,
6280
6280
  Wt as ab,
6281
6281
  Qt as ac,
@@ -6293,47 +6293,48 @@ export {
6293
6293
  ia as ao,
6294
6294
  da as ap,
6295
6295
  pa as aq,
6296
- Qa as ar,
6296
+ Wa as ar,
6297
6297
  yt as as,
6298
6298
  ca as at,
6299
6299
  la as au,
6300
6300
  ma as av,
6301
- Ka as aw,
6301
+ Qa as aw,
6302
6302
  ht as ax,
6303
6303
  Et as ay,
6304
6304
  Jt as az,
6305
6305
  Ot as b,
6306
- za as b0,
6307
- Wa as b1,
6308
- is as b2,
6309
- ns as b3,
6310
- Za as b4,
6311
- es as b5,
6312
- ts as b6,
6313
- Aa as b7,
6306
+ Ya as b0,
6307
+ za as b1,
6308
+ ds as b2,
6309
+ os as b3,
6310
+ Aa as b4,
6311
+ ts as b5,
6312
+ as as b6,
6313
+ es as b7,
6314
6314
  Nt as b8,
6315
6315
  C as b9,
6316
6316
  Ea as ba,
6317
6317
  qa as bb,
6318
6318
  wa as bc,
6319
6319
  xa as bd,
6320
- G as be,
6321
- Oa as bf,
6322
- Da as bg,
6323
- La as bh,
6324
- Ga as bi,
6325
- Ra as bj,
6326
- Ha as bk,
6320
+ Oa as be,
6321
+ La as bf,
6322
+ Ga as bg,
6323
+ Ra as bh,
6324
+ G as bi,
6325
+ Da as bj,
6326
+ Ka as bk,
6327
6327
  R as bl,
6328
- Ua as bm,
6328
+ Ha as bm,
6329
6329
  ft as bn,
6330
- _a as bo,
6331
- Ba as bp,
6332
- Ma as bq,
6333
- ls as br,
6334
- cs as bs,
6335
- E as bt,
6336
- Va as bu,
6330
+ Ba as bo,
6331
+ _a as bp,
6332
+ Ua as bq,
6333
+ Ma as br,
6334
+ ms as bs,
6335
+ ls as bt,
6336
+ E as bu,
6337
+ Va as bv,
6337
6338
  Dt as c,
6338
6339
  Lt as d,
6339
6340
  Rt as e,
@@ -1,9 +1,9 @@
1
1
  import { useMemo as g, useRef as w, useEffect as x } from "react";
2
- import { b1 as G, bh as M, aw as N, ax as C, aX as I, bi as A, bj as O } from "./searchTerms.es.js";
2
+ import { b1 as G, bf as M, aw as N, ax as C, aX as I, bg as A, bh as O } from "./searchTerms.es.js";
3
3
  import { W as B, ci as P, cv as q, ao as F, as as Q } from "./getUris.es.js";
4
4
  import "primereact/confirmdialog";
5
5
  import { U } from "./MetaWidget.es.js";
6
- const j = [], z = 3, H = (s) => {
6
+ const z = [], K = 3, H = (s) => {
7
7
  const { entity: i, groupBy: c, extraGroupBys: E, skip: p } = s, n = g(
8
8
  () => c ? B(c, i) : null,
9
9
  [c, i]
@@ -21,7 +21,7 @@ const j = [], z = 3, H = (s) => {
21
21
  ), v = q(
22
22
  { ...s.entity === "version" ? s.args : { projectName: m }, targets: h },
23
23
  { skip: u || s.entity !== "version" }
24
- ), e = s.entity === "task" ? k : v, r = e.data ?? j, o = !!e.data, { counts: L, total: a, complete: l } = g(() => {
24
+ ), e = s.entity === "task" ? k : v, r = e.data ?? z, o = !!e.data, { counts: L, total: a, complete: l } = g(() => {
25
25
  const t = F(r, n);
26
26
  return t.ungrouped.count > 0 && t.counts.set(U, t.ungrouped), {
27
27
  counts: o && t.counts.size > 0 ? t.counts : void 0,
@@ -40,7 +40,7 @@ const j = [], z = 3, H = (s) => {
40
40
  return;
41
41
  }
42
42
  const y = f.current.get(t) ?? 0;
43
- y >= z || (f.current.set(t, y + 1), e.refetch());
43
+ y >= K || (f.current.set(t, y + 1), e.refetch());
44
44
  }, [u, n, o, e.isFetching, l, r, e.refetch]), {
45
45
  counts: L,
46
46
  complete: l,
@@ -1,56 +1,34 @@
1
- import { jsx as i, jsxs as D } from "react/jsx-runtime";
2
- import { createContext as N, useContext as O, useState as M, useRef as S, useCallback as L, useMemo as R } from "react";
3
- import { Icon as p, ShortcutTag as T } from "@ynput/ayon-react-components";
4
- import j from "clsx";
5
- const w = N(void 0);
6
- function A({ children: t }) {
7
- const [l, n] = M(!1), e = S(null), [o, d] = M([]);
8
- function u(s, c) {
9
- !s || !e.current || !c?.length || (s.preventDefault(), d(c), e.current.show(s));
10
- }
11
- function a() {
12
- e.current && e.current.hide();
13
- }
14
- return /* @__PURE__ */ i(
15
- w.Provider,
16
- {
17
- value: { openContext: u, closeContext: a, ref: e, model: o, isContextOpen: l, setIsContextOpen: n },
18
- children: t
19
- }
20
- );
21
- }
22
- function z() {
23
- const t = O(w);
24
- if (t === void 0)
25
- throw new Error("useContextMenu must be used within a ContextMenuProvider");
26
- return t;
27
- }
28
- const P = ({
29
- icon: t,
30
- iconFilled: l,
1
+ import { jsxs as N, jsx as r } from "react/jsx-runtime";
2
+ import { useCallback as b, useMemo as D } from "react";
3
+ import { Icon as d, ShortcutTag as L } from "@ynput/ayon-react-components";
4
+ import { u as P } from "./ContextMenuContextInstance.es.js";
5
+ import S from "clsx";
6
+ const M = ({
7
+ icon: s,
8
+ iconFilled: i,
31
9
  label: n,
32
10
  shortcut: e,
33
11
  command: o,
34
- children: d,
35
- contextMenuRef: u,
36
- disabled: a,
37
- hidden: s,
38
- items: c,
39
- isSave: x,
40
- danger: m,
41
- developer: f,
42
- powerFeature: r,
12
+ children: f,
13
+ contextMenuRef: c,
14
+ disabled: m,
15
+ hidden: u,
16
+ items: p,
17
+ isSave: h,
18
+ danger: l,
19
+ developer: a,
20
+ powerFeature: t,
43
21
  // if the feature requires a Powerpack license
44
- powerLicense: C,
22
+ powerLicense: x,
45
23
  // if the user has a Powerpack license
46
- onPowerClick: h,
24
+ onPowerClick: g,
47
25
  // callback to handle when they do not have a license and click the power feature
48
- ...g
26
+ ...C
49
27
  }) => {
50
- if (s) return null;
51
- const I = (v) => {
52
- if (u.current?.hide(), v.preventDefault(), r && !C && h) {
53
- h(r);
28
+ if (u) return null;
29
+ const w = (v) => {
30
+ if (c.current?.hide(), v.preventDefault(), t && !x && g) {
31
+ g(t);
54
32
  return;
55
33
  }
56
34
  o?.({
@@ -62,26 +40,26 @@ const P = ({
62
40
  shortcut: e
63
41
  }
64
42
  });
65
- }, b = c && c.length === 0, y = r && !C;
66
- return /* @__PURE__ */ D(
43
+ }, y = p && p.length === 0, I = t && !x;
44
+ return /* @__PURE__ */ N(
67
45
  "a",
68
46
  {
69
- className: j("p-menuitem-link", {
70
- "p-disabled": a || b,
71
- danger: m,
72
- developer: f,
73
- save: x
47
+ className: S("p-menuitem-link", {
48
+ "p-disabled": m || y,
49
+ danger: l,
50
+ developer: a,
51
+ save: h
74
52
  }),
75
53
  role: "menuitem",
76
54
  href: "#",
77
- onClick: I,
55
+ onClick: w,
78
56
  style: {
79
- ...g?.style
57
+ ...C?.style
80
58
  },
81
- ...g,
59
+ ...C,
82
60
  children: [
83
- t && /* @__PURE__ */ i(p, { className: "p-menuitem-icon", icon: t, filled: l }),
84
- n && /* @__PURE__ */ i(
61
+ s && /* @__PURE__ */ r(d, { className: "p-menuitem-icon", icon: s, filled: i }),
62
+ n && /* @__PURE__ */ r(
85
63
  "span",
86
64
  {
87
65
  className: "p-menuitem-text",
@@ -91,10 +69,10 @@ const P = ({
91
69
  children: n
92
70
  }
93
71
  ),
94
- d,
95
- e && /* @__PURE__ */ i("div", { className: "p-menuitem-shortcut", children: /* @__PURE__ */ i(T, { children: e }) }),
96
- y && /* @__PURE__ */ i(
97
- p,
72
+ f,
73
+ e && /* @__PURE__ */ r("div", { className: "p-menuitem-shortcut", children: /* @__PURE__ */ r(L, { children: e }) }),
74
+ I && /* @__PURE__ */ r(
75
+ d,
98
76
  {
99
77
  icon: "bolt",
100
78
  style: {
@@ -104,8 +82,8 @@ const P = ({
104
82
  }
105
83
  }
106
84
  ),
107
- !!c?.length && /* @__PURE__ */ i(
108
- p,
85
+ !!p?.length && /* @__PURE__ */ r(
86
+ d,
109
87
  {
110
88
  icon: "chevron_right",
111
89
  style: {
@@ -117,13 +95,13 @@ const P = ({
117
95
  ]
118
96
  }
119
97
  );
120
- }, k = (t, l, n) => t.map((e) => {
98
+ }, k = (s, i, n) => s.map((e) => {
121
99
  const o = {
122
100
  ...e,
123
- template: /* @__PURE__ */ i(
124
- P,
101
+ template: /* @__PURE__ */ r(
102
+ M,
125
103
  {
126
- contextMenuRef: l,
104
+ contextMenuRef: i,
127
105
  ...e,
128
106
  powerLicense: n.powerLicense,
129
107
  onPowerClick: n.setPowerpackDialog
@@ -131,32 +109,30 @@ const P = ({
131
109
  e.label
132
110
  )
133
111
  };
134
- return o.items && (o.items = k(o.items, l, n)), o;
135
- }), G = (t = [], l) => {
136
- const { openContext: n, ref: e, isContextOpen: o, closeContext: d } = z(), { powerLicense: u, setPowerpackDialog: a } = l || {}, s = L(
137
- (m, f) => m.filter(Boolean).map((r) => ({
138
- template: /* @__PURE__ */ i(
139
- P,
112
+ return o.items && (o.items = k(o.items, i, n)), o;
113
+ }), B = (s = [], i) => {
114
+ const { openContext: n, ref: e, isContextOpen: o, closeContext: f } = P(), { powerLicense: c, setPowerpackDialog: m } = i || {}, u = b(
115
+ (l, a) => l.filter(Boolean).map((t) => ({
116
+ template: /* @__PURE__ */ r(
117
+ M,
140
118
  {
141
- contextMenuRef: f,
142
- ...r,
143
- powerLicense: u,
144
- onPowerClick: a
119
+ contextMenuRef: a,
120
+ ...t,
121
+ powerLicense: c,
122
+ onPowerClick: m
145
123
  },
146
- r.label
124
+ t.label
147
125
  ),
148
- items: r.items?.length ? k(r.items, f, { powerLicense: u, setPowerpackDialog: a }) : void 0
126
+ items: t.items?.length ? k(t.items, a, { powerLicense: c, setPowerpackDialog: m }) : void 0
149
127
  })),
150
- [u, a]
151
- ), c = R(() => s(t, e), [t, e, s]);
152
- return [(m, f) => {
153
- if (!m || !e.current) return console.error("No ref or event passed to openContext");
154
- let r;
155
- f && (r = s(f, e)), m.preventDefault(), n(m, r || c);
156
- }, d, o, e];
128
+ [c, m]
129
+ ), p = D(() => u(s, e), [s, e, u]);
130
+ return [(l, a) => {
131
+ if (!l || !e.current) return console.error("No ref or event passed to openContext");
132
+ let t;
133
+ a && (t = u(a, e)), l.preventDefault(), n(l, t || p);
134
+ }, f, o, e];
157
135
  };
158
136
  export {
159
- A as C,
160
- G as a,
161
- z as u
137
+ B as u
162
138
  };
@@ -0,0 +1,24 @@
1
+ import "react/jsx-runtime";
2
+ import "react";
3
+ import "@module-federation/enhanced/runtime";
4
+ import "./searchTerms.es.js";
5
+ import "./getUris.es.js";
6
+ import "primereact/confirmdialog";
7
+ import { a as o } from "./DeleteEntitiesContextInstance.es.js";
8
+ import "lodash";
9
+ import "react-toastify";
10
+ import "uuid";
11
+ import "semver";
12
+ import "@ynput/ayon-react-components";
13
+ import "./ContextMenuContextInstance.es.js";
14
+ import "clsx";
15
+ import "react-dom";
16
+ import "react-redux";
17
+ import { u as t } from "./MetaWidget.es.js";
18
+ const g = () => {
19
+ const i = t(), { powerLicense: e } = o();
20
+ return i ? (e ? i.slices : i.slices?.slice(0, 1))?.some((r) => r.sliceType === "hierarchy") ? i.getPanelSelection("hierarchy") : i.pinnedSlice?.rowSelection ?? null : null;
21
+ };
22
+ export {
23
+ g as u
24
+ };
@@ -0,0 +1,74 @@
1
+ import "react/jsx-runtime";
2
+ import { useState as f, useRef as R, useEffect as z } from "react";
3
+ import { loadRemote as I } from "@module-federation/enhanced/runtime";
4
+ import "./searchTerms.es.js";
5
+ import "./getUris.es.js";
6
+ import "primereact/confirmdialog";
7
+ import { b as M } from "./DeleteEntitiesContextInstance.es.js";
8
+ import "lodash";
9
+ import "react-toastify";
10
+ import "uuid";
11
+ import q from "semver";
12
+ import "@ynput/ayon-react-components";
13
+ import "./ContextMenuContextInstance.es.js";
14
+ import "clsx";
15
+ import "react-dom";
16
+ import "react-redux";
17
+ const G = ({
18
+ addon: o,
19
+ remote: t,
20
+ module: e,
21
+ fallback: g,
22
+ minVersion: s,
23
+ skip: u = !1
24
+ }) => {
25
+ const { remotesInitialized: l, modules: a } = M(), [L, r] = f(!0), [d, c] = f(!1), [v, m] = f(!1), p = R(g);
26
+ return z(() => {
27
+ if (u) {
28
+ r(!1), c(!0);
29
+ return;
30
+ }
31
+ if (!l || !o || !t || !e) return;
32
+ const i = a.find((n) => n.addonName === o);
33
+ if (!i) {
34
+ console.log("remote not found", { addon: o, remote: t, module: e }), r(!1);
35
+ return;
36
+ }
37
+ if (s && !q.gte(i.addonVersion, s) && s + "-dev" !== i.addonVersion) {
38
+ console.log("remote version does not meet minimum requirement", {
39
+ addon: o,
40
+ remote: t,
41
+ module: e,
42
+ current: i.addonVersion,
43
+ required: s
44
+ }), m(!0), r(!1);
45
+ return;
46
+ }
47
+ if (m(!1), !i.modules[t])
48
+ return r(!1), console.log("module not found", { addon: o, remote: t, module: e });
49
+ if (d === e) {
50
+ r(!1);
51
+ return;
52
+ }
53
+ I(`${t}/${e}`, {
54
+ from: "runtime"
55
+ }).then((n) => {
56
+ c(e), r(!1), n && (p.current = n.default);
57
+ }).catch((n) => {
58
+ r(!1), console.error("error loading remote", t, e, n);
59
+ });
60
+ }, [d, l, a, o, t, e, s, u]), [
61
+ p.current,
62
+ {
63
+ isLoaded: d === e,
64
+ isLoading: L,
65
+ outdated: v ? {
66
+ current: a.find((i) => i.addonName === o)?.addonVersion || "unknown",
67
+ required: s?.replace("-dev", "") || "unknown"
68
+ } : void 0
69
+ }
70
+ ];
71
+ };
72
+ export {
73
+ G as u
74
+ };
@@ -0,0 +1,11 @@
1
+ import { useRef as a, useState as c, useEffect as f } from "react";
2
+ const g = (e, n) => {
3
+ const o = a(null), [u, r] = c(!1);
4
+ return f(() => {
5
+ const t = o.current;
6
+ !t || Object.keys(e).some((s) => t[s] !== e[s]) || Object.keys(t).some((s) => t[s] !== e[s]) ? (o.current = { ...e }, r(n)) : n || r(!1);
7
+ }, [Object.values(e).join(","), n]), u;
8
+ };
9
+ export {
10
+ g as u
11
+ };
@@ -1,37 +1,12 @@
1
1
  import { toast as i } from "react-toastify";
2
2
  import { camelCase as c } from "lodash";
3
- function h(r) {
4
- const t = r.replace(/\.[^/.]+$/, ""), a = [
5
- // Pattern: file_v001, file_v1, file_v01 (with 'v' prefix)
6
- /.*[_\-\s]v(\d+)(?:[_\-\s].*|$)/i,
7
- // Pattern: file_001, file_01, file_1 (at end of filename)
8
- /.*[_\-\s](\d+)$/,
9
- // Pattern: file_001_name, file_1_description (version in middle)
10
- /.*[_\-\s](\d{2,})(?:[_\-\s].*)/,
11
- // Pattern: 001_file, 1_file (at start of filename)
12
- /^(\d+)[_\-\s]/,
13
- // Pattern: fileV1, fileV001 (no separator)
14
- /.*v(\d+)$/i,
15
- // Pattern: file1, file001 (number at end, no separator)
16
- /.*?(\d{2,})$/
17
- ];
18
- for (const e of a) {
19
- const o = t.match(e);
20
- if (o) {
21
- const n = o[1], s = parseInt(n, 10);
22
- if (!isNaN(s) && s > 0)
23
- return s;
24
- }
25
- }
26
- return null;
27
- }
28
- const v = (r) => c(r).replace(/[^a-zA-Z0-9_-]/g, ""), d = (r) => !r || r.trim() === "" ? { isValid: !1, error: "Name is required" } : /^[a-zA-Z0-9_]([a-zA-Z0-9_\\.\\-]*[a-zA-Z0-9_])?$/.test(r) ? { isValid: !0 } : {
3
+ const w = (r) => c(r).replace(/[^a-zA-Z0-9_-]/g, ""), d = (r) => !r || r.trim() === "" ? { isValid: !1, error: "Name is required" } : /^[a-zA-Z0-9_]([a-zA-Z0-9_\\.\\-]*[a-zA-Z0-9_])?$/.test(r) ? { isValid: !0 } : {
29
4
  isValid: !1,
30
5
  error: "Product name can only contain alphanumeric characters, underscores, dots, and dashes, and must not start or end with a dot or dash"
31
6
  }, u = (r, t) => r < 1 ? { isValid: !1, error: "Version must be greater than 0" } : t != null && r <= t ? {
32
7
  isValid: !1,
33
8
  error: `Version must be greater than ${t}`
34
- } : { isValid: !0 }, w = (r, t, a = !0) => {
9
+ } : { isValid: !0 }, f = (r, t, a = !0) => {
35
10
  const e = u(r.version, t);
36
11
  if (!e.isValid)
37
12
  return e;
@@ -66,28 +41,27 @@ const v = (r) => c(r).replace(/[^a-zA-Z0-9_-]/g, ""), d = (r) => !r || r.trim()
66
41
  throw console.error("Error creating version:", e), new Error(e.message || "Failed to create version");
67
42
  }
68
43
  }, V = async (r, t, a, e, o) => {
69
- const n = await l(r, a, e), s = await m(t, a, {
44
+ const s = await l(r, a, e), n = await m(t, a, {
70
45
  ...o,
71
- productId: n.id
46
+ productId: s.id
72
47
  });
73
48
  return {
74
- product: n,
75
- version: s
49
+ product: s,
50
+ version: n
76
51
  };
77
- }, g = (r, t) => {
52
+ }, v = (r, t) => {
78
53
  console.error(`Error ${t}:`, r);
79
54
  const a = r?.message || `Failed to ${t}`;
80
55
  throw i.error(a), r;
81
- }, _ = (r) => r ? r.version + 1 : 1;
56
+ }, g = (r) => r ? r.version + 1 : 1;
82
57
  export {
83
- V as a,
84
- l as b,
85
- m as c,
58
+ l as a,
59
+ m as b,
60
+ V as c,
86
61
  d,
87
- h as e,
88
- u as f,
89
- _ as g,
90
- g as h,
91
- v as s,
92
- w as v
62
+ u as e,
63
+ g,
64
+ v as h,
65
+ w as s,
66
+ f as v
93
67
  };