@ynput/ayon-frontend-shared 0.6.7 → 0.6.9

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 (41) hide show
  1. package/dist/DetailsPanel.es.js +3 -3
  2. package/dist/Feed.es.js +64 -58
  3. package/dist/ListTable.es.js +5 -5
  4. package/dist/NewEntity.es.js +38 -38
  5. package/dist/ProjectTreeTable.es.js +1314 -1314
  6. package/dist/Slicer.es.js +21 -21
  7. package/dist/Views.es.js +1 -1
  8. package/dist/api.es.js +362 -360
  9. package/dist/chunks/Actions.es.js +21 -21
  10. package/dist/chunks/ColumnDropIndicator.es.js +7 -7
  11. package/dist/chunks/DeleteEntitiesContextInstance.es.js +22 -22
  12. package/dist/chunks/EmptyPlaceholder.es.js +9 -9
  13. package/dist/chunks/EntityPath.es.js +1 -1
  14. package/dist/chunks/EntityUpdatesContext.es.js +1 -1
  15. package/dist/chunks/Feed.es.js +1843 -1830
  16. package/dist/chunks/MetaWidget.es.js +816 -827
  17. package/dist/chunks/PlayableIcon.es.js +124 -85
  18. package/dist/chunks/ProjectContext.es.js +11 -11
  19. package/dist/chunks/ReviewablesSelector.es.js +572 -484
  20. package/dist/chunks/SimpleForm.es.js +6 -5
  21. package/dist/chunks/SimpleTable.es.js +1 -1
  22. package/dist/chunks/Slicer.es.js +75 -75
  23. package/dist/chunks/ThumbnailSimple.es.js +15 -15
  24. package/dist/chunks/Watchers.es.js +35 -35
  25. package/dist/chunks/getBundleMode.es.js +33 -25
  26. package/dist/chunks/getUris.es.js +236 -229
  27. package/dist/chunks/searchTerms.es.js +352 -333
  28. package/dist/chunks/useAttributeEnums.es.js +16 -16
  29. package/dist/chunks/useDateRangeFilter.es.js +85 -59
  30. package/dist/chunks/viewUpdateHelper.es.js +36 -36
  31. package/dist/components.es.js +793 -754
  32. package/dist/context.es.js +121 -120
  33. package/dist/hooks.es.js +15 -15
  34. package/dist/index.es.js +2 -2
  35. package/dist/types/Feed.d.ts +54 -0
  36. package/dist/types/ProjectTreeTable.d.ts +5 -2
  37. package/dist/types/api.d.ts +372 -0
  38. package/dist/types/components.d.ts +516 -0
  39. package/dist/types/util.d.ts +4 -0
  40. package/dist/util.es.js +68 -66
  41. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
- import { jsx as m, jsxs as z, Fragment as Z } from "react/jsx-runtime";
2
- import { useMemo as W, useCallback as Q, useState as L, useEffect as V, useRef as J, forwardRef as q, useContext as Ee } from "react";
1
+ import { jsx as m, jsxs as z, Fragment as J } from "react/jsx-runtime";
2
+ import { useMemo as W, useCallback as Q, useState as L, useEffect as V, useRef as X, forwardRef as q, useContext as Ee } from "react";
3
3
  import { snakeCase as Te, upperFirst as Se, intersectionBy as le } from "lodash";
4
4
  import "primereact/confirmdialog";
5
5
  import { toast as G } from "react-toastify";
6
6
  import { c as K } from "./copyToClipboard.es.js";
7
7
  import "uuid";
8
- import { aw as ce, aY as De, bh as de, a$ as je, b0 as Fe, b1 as Ce, bj as Ae, bn as Ne, bw as $e, bg as Re, a as B, bo as ze } from "./searchTerms.es.js";
8
+ import { ax as ce, aZ as De, bi as de, b0 as je, b1 as Fe, b2 as Ce, bk as Ae, bo as Ne, bx as $e, bh as Re, a as B, bp as ze } from "./searchTerms.es.js";
9
9
  import p, { keyframes as pe, css as ue } from "styled-components";
10
10
  import U from "clsx";
11
11
  import { BorderedSection as H, Button as O, StatusSelect as Me, AssigneeSelect as Ue, TagsSelect as Le, EnumDropdown as Pe, Icon as P, getMimeTypeIcon as We, theme as Oe, getFileSizeString as Ie, WatcherSelect as Ve } from "@ynput/ayon-react-components";
12
12
  import { o as Be, M as He, T as _e, n as Qe, B as qe, D as Ge } from "./MetaWidget.es.js";
13
13
  import "./PlayableIcon.es.js";
14
- import { dh as Ke, bW as Ye, c8 as me, bg as Ze, ao as Je, bv as Xe, d5 as et } from "./getUris.es.js";
14
+ import { di as Ke, bW as Ze, c8 as me, bg as Je, ao as Xe, bv as Ye, d6 as et } from "./getUris.es.js";
15
15
  import "@module-federation/enhanced/runtime";
16
- import { o as Y, d as tt, x as ot, T as rt } from "./DeleteEntitiesContextInstance.es.js";
16
+ import { o as Z, d as tt, x as ot, T as rt } from "./DeleteEntitiesContextInstance.es.js";
17
17
  import "semver";
18
18
  import "./ContextMenuContextInstance.es.js";
19
19
  import "react-dom";
@@ -21,16 +21,16 @@ import "react-redux";
21
21
  import { format as at } from "date-fns";
22
22
  import "lexical";
23
23
  import "@lexical/markdown";
24
- import "@lexical/react/LexicalBlockWithAlignableContents";
25
- import "@lexical/react/LexicalDecoratorBlockNode";
26
24
  import "match-sorter";
27
25
  import "@lexical/code";
28
26
  import "@lexical/list";
29
27
  import "@lexical/rich-text";
30
28
  import "@lexical/selection";
31
29
  import "@lexical/utils";
30
+ import "@lexical/react/LexicalBlockWithAlignableContents";
31
+ import "@lexical/react/LexicalDecoratorBlockNode";
32
32
  import "@tanstack/react-table";
33
- import { g as nt, h as X } from "./humanizeFieldName.es.js";
33
+ import { g as nt, h as Y } from "./humanizeFieldName.es.js";
34
34
  import { a as it, A as st } from "./ThumbnailSimple.es.js";
35
35
  import ge from "axios";
36
36
  import { p as I } from "./parseFilename.es.js";
@@ -313,7 +313,7 @@ const ee = [], pt = (e) => {
313
313
  readOnlyFieldsData: u
314
314
  };
315
315
  }, yt = ({ entities: e, entityType: t }) => {
316
- const [r] = Ke(), { onUpdateEntity: o } = Y();
316
+ const [r] = Ke(), { onUpdateEntity: o } = Z();
317
317
  return { updateEntity: async (n, a) => {
318
318
  if (a == null) {
319
319
  console.error("value is null or undefined");
@@ -340,7 +340,7 @@ const ee = [], pt = (e) => {
340
340
  (t, r) => r ? t ? t.filter((o) => r.includes(o)) : r : t,
341
341
  void 0
342
342
  ), bt = ({ entities: e, entityType: t }) => {
343
- const { data: o } = Ye(), l = W(() => {
343
+ const { data: o } = Ze(), l = W(() => {
344
344
  if (!o?.projects) return {};
345
345
  const a = [...new Set(e.map((s) => s.projectName))].map(
346
346
  (s) => o.projects?.[s] || {}
@@ -551,7 +551,7 @@ const ee = [], pt = (e) => {
551
551
  showDetailedTooltip: r = !1,
552
552
  ...o
553
553
  }) => {
554
- const l = t.title ? X(t.title) : X(e), n = r ? `${l} (${e}) ${t.description ? "-" : ""} ${t.description || ""}` : t.description || l;
554
+ const l = t.title ? Y(t.title) : Y(e), n = r ? `${l} (${e}) ${t.description ? "-" : ""} ${t.description || ""}` : t.description || l;
555
555
  return /* @__PURE__ */ m(
556
556
  Tt,
557
557
  {
@@ -868,7 +868,7 @@ const ee = [], pt = (e) => {
868
868
  statuses: s = [],
869
869
  tags: u = [],
870
870
  productTypes: i
871
- } = ot(), { openSlideOut: h } = Y(), [, v] = it(), f = (e || []).filter((R) => R.entityType === "folder"), { data: w } = Ze(
871
+ } = ot(), { openSlideOut: h } = Z(), [, v] = it(), f = (e || []).filter((R) => R.entityType === "folder"), { data: w } = Je(
872
872
  {
873
873
  entityIds: f.map((R) => R.id),
874
874
  projectName: r?.projectName || "",
@@ -1006,7 +1006,7 @@ const ee = [], pt = (e) => {
1006
1006
  h2 {
1007
1007
  min-width: fit-content;
1008
1008
  }
1009
- `, Yo = p.div`
1009
+ `, Zo = p.div`
1010
1010
  position: relative;
1011
1011
  height: 100%;
1012
1012
 
@@ -1021,7 +1021,7 @@ const ee = [], pt = (e) => {
1021
1021
  flex-direction: column;
1022
1022
  gap: var(--base-gap-small);
1023
1023
  }
1024
- `, Zo = p.div`
1024
+ `, Jo = p.div`
1025
1025
  display: flex;
1026
1026
  flex-direction: column;
1027
1027
  height: 100%;
@@ -1059,7 +1059,7 @@ const ee = [], pt = (e) => {
1059
1059
  align-items: center;
1060
1060
  gap: var(--base-gap-medium);
1061
1061
  }
1062
- `, Jo = p.div`
1062
+ `, Xo = p.div`
1063
1063
  display: flex;
1064
1064
  justify-content: space-between;
1065
1065
  align-items: flex-start;
@@ -1068,7 +1068,7 @@ const ee = [], pt = (e) => {
1068
1068
  label {
1069
1069
  color: var(--md-sys-color-outline);
1070
1070
  }
1071
- `, Xo = p.div`
1071
+ `, Yo = p.div`
1072
1072
  display: flex;
1073
1073
  flex-direction: column;
1074
1074
  `, er = p(Me)`
@@ -1259,7 +1259,7 @@ const ee = [], pt = (e) => {
1259
1259
  opacity: 0;
1260
1260
  }
1261
1261
  `, Ut = ({ mimetype: e = "", src: t, ...r }) => {
1262
- const [o, l] = L(!1), [n, a] = L(!1), c = J(null), g = J(0);
1262
+ const [o, l] = L(!1), [n, a] = L(!1), c = X(null), g = X(0);
1263
1263
  return V(() => {
1264
1264
  const s = g.current + 1;
1265
1265
  g.current = s, a(!1), l(!1);
@@ -1760,7 +1760,7 @@ const mr = p.div`
1760
1760
  return e.message || e.response?.statusText || "Unknown upload error";
1761
1761
  }
1762
1762
  return e instanceof Error ? e.message : typeof e == "string" ? e : "Unknown upload error";
1763
- }, Yt = ({
1763
+ }, Zt = ({
1764
1764
  projectName: e,
1765
1765
  versionId: t,
1766
1766
  taskId: r,
@@ -1796,7 +1796,7 @@ const mr = p.div`
1796
1796
  const d = S.data;
1797
1797
  e && (n(
1798
1798
  // @ts-ignore
1799
- Je.util.updateQueryData(
1799
+ Xe.util.updateQueryData(
1800
1800
  "getReviewablesForVersion",
1801
1801
  { projectName: e, versionId: f },
1802
1802
  (D) => {
@@ -1879,7 +1879,7 @@ const mr = p.div`
1879
1879
  handleFileUpload: F,
1880
1880
  handleRemoveUpload: T,
1881
1881
  uploading: A
1882
- } = Yt({
1882
+ } = Zt({
1883
1883
  projectName: e,
1884
1884
  versionId: o,
1885
1885
  taskId: t,
@@ -1914,7 +1914,7 @@ const mr = p.div`
1914
1914
  const E = b.dataTransfer.files;
1915
1915
  E && D(E);
1916
1916
  }, $ = s === "large" ? { minWidth: "360px", maxWidth: "480px", alignSelf: "center" } : {};
1917
- return /* @__PURE__ */ z(Z, { children: [
1917
+ return /* @__PURE__ */ z(J, { children: [
1918
1918
  /* @__PURE__ */ m(
1919
1919
  qt,
1920
1920
  {
@@ -1925,7 +1925,7 @@ const mr = p.div`
1925
1925
  onDrop: (b) => {
1926
1926
  v && (b.preventDefault(), b.stopPropagation());
1927
1927
  },
1928
- children: /* @__PURE__ */ z(Z, { children: [
1928
+ children: /* @__PURE__ */ z(J, { children: [
1929
1929
  c,
1930
1930
  !k && u?.map((b) => /* @__PURE__ */ m(
1931
1931
  ne,
@@ -2029,7 +2029,7 @@ const mr = p.div`
2029
2029
  .icon {
2030
2030
  color: var(--md-sys-color-on-surface);
2031
2031
  }
2032
- `, Zt = p.div`
2032
+ `, Jt = p.div`
2033
2033
  & > span,
2034
2034
  & > li {
2035
2035
  cursor: pointer;
@@ -2084,7 +2084,7 @@ const mr = p.div`
2084
2084
  width: 100%;
2085
2085
  `, Er = q(
2086
2086
  ({ children: e, segment: t, isOpen: r, scope: o, projectName: l, ...n }, a) => {
2087
- const { openSlideOut: c } = Y(), g = t?.type !== "product" && t?.type !== "project", s = () => {
2087
+ const { openSlideOut: c } = Z(), g = t?.type !== "product" && t?.type !== "project", s = () => {
2088
2088
  if (!g) return;
2089
2089
  const { type: v, id: f } = t || {};
2090
2090
  !v || v === "project" || v === "product" || !f || c({
@@ -2100,7 +2100,7 @@ const mr = p.div`
2100
2100
  }
2101
2101
  ], [i] = ct();
2102
2102
  return /* @__PURE__ */ m(
2103
- Zt,
2103
+ Jt,
2104
2104
  {
2105
2105
  onClick: s,
2106
2106
  onContextMenu: (v) => {
@@ -2115,7 +2115,7 @@ const mr = p.div`
2115
2115
  }
2116
2116
  );
2117
2117
  }
2118
- ), Jt = p.div`
2118
+ ), Xt = p.div`
2119
2119
  position: relative;
2120
2120
  width: 100%;
2121
2121
  height: 52px;
@@ -2205,7 +2205,7 @@ const mr = p.div`
2205
2205
  border: none;
2206
2206
  border-color: transparent;
2207
2207
  }
2208
- `, Xt = p.img`
2208
+ `, Yt = p.img`
2209
2209
  width: 100%;
2210
2210
  height: 100%;
2211
2211
  object-fit: contain;
@@ -2244,7 +2244,7 @@ const mr = p.div`
2244
2244
  }
2245
2245
  k(!1), T(!1);
2246
2246
  }, [x]), /* @__PURE__ */ z(
2247
- Jt,
2247
+ Xt,
2248
2248
  {
2249
2249
  className: U(g, "thumbnail", {
2250
2250
  loading: c && (a || !A),
@@ -2257,7 +2257,7 @@ const mr = p.div`
2257
2257
  children: [
2258
2258
  (!a || !A) && !s && /* @__PURE__ */ m(P, { style: { color: l || void 0 }, icon: o || "image", className: "type-icon" }),
2259
2259
  t && e && !w && y && /* @__PURE__ */ m(
2260
- Xt,
2260
+ Yt,
2261
2261
  {
2262
2262
  alt: `Entity thumbnail ${r || e}`,
2263
2263
  src: x,
@@ -2352,7 +2352,7 @@ const mr = p.div`
2352
2352
  entityId: i.id,
2353
2353
  entityType: t,
2354
2354
  projectName: i.projectName
2355
- })), { data: c = [] } = Xe(
2355
+ })), { data: c = [] } = Ye(
2356
2356
  {
2357
2357
  entities: a
2358
2358
  },
@@ -2387,7 +2387,7 @@ const mr = p.div`
2387
2387
  }
2388
2388
  );
2389
2389
  export {
2390
- Zo as A,
2390
+ Jo as A,
2391
2391
  Ko as B,
2392
2392
  cr as C,
2393
2393
  lr as D,
@@ -2403,14 +2403,14 @@ export {
2403
2403
  ar as N,
2404
2404
  qo as O,
2405
2405
  pr as P,
2406
- Jo as Q,
2406
+ Xo as Q,
2407
2407
  ur as R,
2408
2408
  yr as S,
2409
- Yo as T,
2409
+ Zo as T,
2410
2410
  dr as U,
2411
2411
  nr as V,
2412
2412
  Sr as W,
2413
- Xo as X,
2413
+ Yo as X,
2414
2414
  gr as a,
2415
2415
  hr as b,
2416
2416
  ne as c,
@@ -2431,7 +2431,7 @@ export {
2431
2431
  At as r,
2432
2432
  Ho as s,
2433
2433
  he as t,
2434
- Yt as u,
2434
+ Zt as u,
2435
2435
  Ut as v,
2436
2436
  Tr as w,
2437
2437
  eo as x,
@@ -1,12 +1,18 @@
1
- import { b2 as g } from "./searchTerms.es.js";
2
- import { toast as f } from "react-toastify";
3
- const p = (t) => {
1
+ import { b3 as u } from "./searchTerms.es.js";
2
+ import { toast as l } from "react-toastify";
3
+ const g = "uri";
4
+ let c;
5
+ const h = () => {
6
+ if (c !== void 0) return c;
7
+ const t = new URL(window.location.href);
8
+ return c = t.searchParams.get(g) ?? "", c && (t.searchParams.delete(g), window.history.replaceState(window.history.state, "", t)), c;
9
+ }, f = (t) => {
4
10
  const s = t.split("://")[1].split("?"), e = s[0], r = s[1];
5
11
  return {
6
12
  baseUri: e,
7
13
  queryParams: new URLSearchParams(r || "")
8
14
  };
9
- }, P = ({
15
+ }, v = ({
10
16
  projectName: t,
11
17
  folderPath: s,
12
18
  taskName: e,
@@ -15,34 +21,34 @@ const p = (t) => {
15
21
  }) => {
16
22
  const n = new URL(`ayon+entity://${t}/${s}`);
17
23
  return e && n.searchParams.append("task", e), r && n.searchParams.append("product", r), a && n.searchParams.append("version", a), n.toString();
18
- }, u = (t) => {
19
- const { baseUri: s, queryParams: e } = p(t), r = s.split("/"), a = r[0], n = r.slice(1), [o, c] = a.split(":"), d = e.get("site") ?? void 0, i = e.get("project") ?? void 0;
24
+ }, m = (t) => {
25
+ const { baseUri: s, queryParams: e } = f(t), r = s.split("/"), a = r[0], n = r.slice(1), [o, d] = a.split(":"), p = e.get("site") ?? void 0, i = e.get("project") ?? void 0;
20
26
  return {
21
27
  addonName: o,
22
- addonVersion: c,
28
+ addonVersion: d,
23
29
  settingsPath: n,
24
- site: d,
30
+ site: p,
25
31
  project: i
26
32
  };
27
- }, l = (t) => {
28
- const { baseUri: s, queryParams: e } = p(t), r = s.split("/"), a = r[0], n = r.slice(1).join("/"), o = e.get("task") ?? void 0, c = e.get("product") ?? void 0, d = e.get("version") ?? void 0;
33
+ }, y = (t) => {
34
+ const { baseUri: s, queryParams: e } = f(t), r = s.split("/"), a = r[0], n = r.slice(1).join("/"), o = e.get("task") ?? void 0, d = e.get("product") ?? void 0, p = e.get("version") ?? void 0;
29
35
  let i;
30
- return d ? i = "version" : c ? i = "product" : o ? i = "task" : i = "folder", {
36
+ return p ? i = "version" : d ? i = "product" : o ? i = "task" : i = "folder", {
31
37
  projectName: a,
32
38
  entityType: i,
33
39
  folderPath: n,
34
40
  taskName: o,
35
- productName: c,
36
- versionName: d
41
+ productName: d,
42
+ versionName: p
37
43
  };
38
- }, U = (t) => t ? t.startsWith("ayon+settings://") ? {
44
+ }, M = (t) => t ? t.startsWith("ayon+settings://") ? {
39
45
  type: "settings",
40
- settings: u(t)
46
+ settings: m(t)
41
47
  } : t.startsWith("ayon+entity://") ? {
42
48
  type: "entity",
43
- entity: l(t)
44
- } : { type: void 0 } : { type: void 0 }, v = (t) => t?.attrib?.developerMode ? "developer" : t?.data?.frontendPreferences?.stagingMode ? "staging" : "production", M = (t, s) => {
45
- const [e] = g();
49
+ entity: y(t)
50
+ } : { type: void 0 } : { type: void 0 }, S = (t) => t?.attrib?.developerMode ? "developer" : t?.data?.frontendPreferences?.stagingMode ? "staging" : "production", w = (t, s) => {
51
+ const [e] = u();
46
52
  return [t?.data?.frontendPreferences?.stagingMode ?? !1, async (n) => {
47
53
  try {
48
54
  const o = {
@@ -54,15 +60,17 @@ const p = (t) => {
54
60
  patchData: o
55
61
  }).unwrap(), s && s(o);
56
62
  } catch (o) {
57
- console.error(o), f.error("Failed to update staging mode");
63
+ console.error(o), l.error("Failed to update staging mode");
58
64
  }
59
65
  }];
60
66
  };
61
67
  export {
62
- l as a,
63
- P as b,
64
- u as c,
65
- v as g,
66
- U as p,
67
- M as u
68
+ g as U,
69
+ y as a,
70
+ v as b,
71
+ h as c,
72
+ m as d,
73
+ S as g,
74
+ M as p,
75
+ w as u
68
76
  };