@ynput/ayon-frontend-shared 0.5.0 → 0.6.0

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 (74) hide show
  1. package/dist/DetailsPanel.es.js +88 -86
  2. package/dist/Feed.es.js +22 -22
  3. package/dist/ListTable.es.js +77 -67
  4. package/dist/ProjectTreeTable.es.js +1164 -1150
  5. package/dist/Slicer.es.js +2 -2
  6. package/dist/Views.es.js +1 -1
  7. package/dist/api.es.js +331 -329
  8. package/dist/chunks/Actions.es.js +23 -23
  9. package/dist/chunks/DeleteEntitiesContext.es.js +115 -115
  10. package/dist/chunks/DetailsDialog.es.js +3 -3
  11. package/dist/chunks/DetailsPanelContext.es.js +155 -0
  12. package/dist/chunks/EntityPath.es.js +20 -20
  13. package/dist/chunks/EntityPickerDialog.es.js +1 -1
  14. package/dist/chunks/EntityTooltip.es.js +12 -12
  15. package/dist/chunks/EntityUpdatesContext.es.js +1 -1
  16. package/dist/chunks/Feed.es.js +2208 -2611
  17. package/dist/chunks/FilterErrorActions.es.js +1 -1
  18. package/dist/chunks/GlobalContext.es.js +14 -14
  19. package/dist/chunks/Menu.es.js +1 -1
  20. package/dist/chunks/MenuContext.es.js +51 -242
  21. package/dist/chunks/MenuItem.es.js +1 -1
  22. package/dist/chunks/MetaWidget.es.js +3341 -3899
  23. package/dist/chunks/NewEntityContext.es.js +40 -40
  24. package/dist/chunks/PlayableIcon.es.js +4261 -1163
  25. package/dist/chunks/ProjectContext.es.js +13 -13
  26. package/dist/chunks/ProjectFoldersContext.es.js +5 -5
  27. package/dist/chunks/RepresentationsList.es.js +3 -3
  28. package/dist/chunks/ReviewablesSelector.es.js +85 -76
  29. package/dist/chunks/SimpleForm.es.js +9 -9
  30. package/dist/chunks/SimpleTable.es.js +1 -1
  31. package/dist/chunks/Slicer.es.js +173 -171
  32. package/dist/chunks/TableSettingsFallback.es.js +6 -6
  33. package/dist/chunks/ThumbnailSimple.es.js +410 -61
  34. package/dist/chunks/VersionUploadContext.es.js +29 -29
  35. package/dist/chunks/ViewsContext.es.js +90 -90
  36. package/dist/chunks/Watchers.es.js +628 -598
  37. package/dist/chunks/entityDefinitions.es.js +31 -31
  38. package/dist/chunks/expandRelativeDates.es.js +27 -0
  39. package/dist/chunks/getBundleMode.es.js +16 -61
  40. package/dist/chunks/getUris.es.js +271 -269
  41. package/dist/chunks/queryFilterToClientFilter.es.js +11 -10
  42. package/dist/chunks/searchTerms.es.js +177 -173
  43. package/dist/chunks/uriUtils.es.js +48 -0
  44. package/dist/chunks/useAttributeEnums.es.js +11 -11
  45. package/dist/chunks/useColumnDragRestriction.es.js +37 -27
  46. package/dist/chunks/useDateRangeFilter.es.js +3 -3
  47. package/dist/chunks/useLocalStorage.es.js +9 -9
  48. package/dist/chunks/useSessionStorage.es.js +61 -0
  49. package/dist/chunks/viewUpdateHelper.es.js +19 -19
  50. package/dist/components.es.js +165 -160
  51. package/dist/context.es.js +60 -58
  52. package/dist/hooks.es.js +104 -98
  53. package/dist/index.es.js +18 -13
  54. package/dist/types/Actions.d.ts +16 -16
  55. package/dist/types/ContextMenu.d.ts +16 -16
  56. package/dist/types/DetailsPanel.d.ts +16 -16
  57. package/dist/types/EntityPickerDialog.d.ts +16 -16
  58. package/dist/types/Feed.d.ts +16 -16
  59. package/dist/types/ListTable.d.ts +16 -16
  60. package/dist/types/NewEntity.d.ts +16 -16
  61. package/dist/types/ProjectTreeTable.d.ts +20 -16
  62. package/dist/types/RepresentationsList.d.ts +16 -16
  63. package/dist/types/SimpleTable.d.ts +16 -16
  64. package/dist/types/Slicer.d.ts +16 -16
  65. package/dist/types/Views.d.ts +17 -17
  66. package/dist/types/api.d.ts +391 -95
  67. package/dist/types/components.d.ts +79 -20
  68. package/dist/types/context.d.ts +60 -17
  69. package/dist/types/hooks.d.ts +16 -16
  70. package/dist/types/index.d.ts +16 -16
  71. package/dist/types/util.d.ts +16 -16
  72. package/dist/util.es.js +108 -97
  73. package/package.json +16 -4
  74. package/dist/chunks/mentionTypeOptions.es.js +0 -15
@@ -1,11 +1,11 @@
1
1
  import { jsx as r, jsxs as q } from "react/jsx-runtime";
2
2
  import { Button as G, Dropdown as de, Icon as E, DefaultValueTemplate as ue, Spacer as pe } from "@ynput/ayon-react-components";
3
3
  import x, { keyframes as ge } from "styled-components";
4
- import { useRef as fe, useMemo as f, useState as _, useEffect as me } from "react";
5
- import O from "clsx";
4
+ import { useRef as fe, useMemo as f, useState as $, useEffect as me } from "react";
5
+ import B from "clsx";
6
6
  import { toast as w } from "react-toastify";
7
7
  import { be as he } from "./searchTerms.es.js";
8
- import { c$ as be, bb as ve, cO as ye, bc as xe, b7 as Ae } from "./getUris.es.js";
8
+ import { d0 as be, bb as ve, cP as ye, bc as xe, b7 as Ae } from "./getUris.es.js";
9
9
  import "primereact/confirmdialog";
10
10
  import { upperFirst as Q } from "lodash";
11
11
  import { u as we } from "./useActionTriggers.es.js";
@@ -109,7 +109,7 @@ const Se = x.div`
109
109
  `, U = ({ icon: o, isExecuting: s }) => {
110
110
  let a;
111
111
  return s ? a = /* @__PURE__ */ r(Ee, { icon: "sync" }) : o?.type === "material-symbols" && o?.name ? a = /* @__PURE__ */ r(E, { icon: o.name, style: { color: o.color } }) : o?.type === "url" ? a = /* @__PURE__ */ r("img", { src: o.url, title: "Action" }) : a = /* @__PURE__ */ r(E, { icon: "category" }), a;
112
- }, Oe = x.div`
112
+ }, Be = x.div`
113
113
  display: flex;
114
114
  flex-direction: row;
115
115
  width: 100%;
@@ -127,7 +127,7 @@ const Se = x.div`
127
127
  visibility: visible;
128
128
  }
129
129
  }
130
- `, Be = ({
130
+ `, Fe = ({
131
131
  value: o,
132
132
  label: s,
133
133
  icon: a,
@@ -135,7 +135,7 @@ const Se = x.div`
135
135
  hasConfig: p,
136
136
  description: b,
137
137
  onConfig: c
138
- }) => u ? /* @__PURE__ */ r(ke, { children: Q(s) }) : /* @__PURE__ */ r(De, { children: /* @__PURE__ */ q(Oe, { "data-tooltip": b || "", "data-tooltip-delay": 0, children: [
138
+ }) => u ? /* @__PURE__ */ r(ke, { children: Q(s) }) : /* @__PURE__ */ r(De, { children: /* @__PURE__ */ q(Be, { "data-tooltip": b || "", "data-tooltip-delay": 0, children: [
139
139
  /* @__PURE__ */ r(U, { icon: a }),
140
140
  /* @__PURE__ */ r("span", { children: s }),
141
141
  /* @__PURE__ */ r(pe, {}),
@@ -150,7 +150,7 @@ const Se = x.div`
150
150
  style: { background: "none", padding: 0 }
151
151
  }
152
152
  )
153
- ] }) }), Fe = ({
153
+ ] }) }), Oe = ({
154
154
  options: o,
155
155
  isLoading: s,
156
156
  bundleMode: a,
@@ -167,12 +167,12 @@ const Se = x.div`
167
167
  {
168
168
  ref: d,
169
169
  disabled: s,
170
- className: O("more", a),
170
+ className: B("more", a),
171
171
  options: o,
172
172
  maxOptionsShown: 100,
173
173
  value: [],
174
174
  placeholder: "",
175
- itemTemplate: (g) => /* @__PURE__ */ r(Be, { ...g, onConfig: m }),
175
+ itemTemplate: (g) => /* @__PURE__ */ r(Fe, { ...g, onConfig: m }),
176
176
  valueTemplate: () => /* @__PURE__ */ r(ue, { placeholder: "", value: [], dropIcon: "category" }),
177
177
  onChange: (g) => p(g[0]),
178
178
  buttonProps: {
@@ -260,7 +260,7 @@ const Se = x.div`
260
260
  align: z,
261
261
  pt: H
262
262
  }) => {
263
- const { user: B } = Ce(), { handleActionPayload: J } = we({ onNavigate: m, onSetSearchParams: g, searchParams: b }), [K, F] = _(null), [W, S] = _(null), C = f(() => {
263
+ const { user: F } = Ce(), { handleActionPayload: J } = we({ onNavigate: m, onSetSearchParams: g, searchParams: b }), [K, O] = $(null), [W, S] = $(null), C = f(() => {
264
264
  if (p)
265
265
  return {
266
266
  entityType: "project",
@@ -284,8 +284,8 @@ const Se = x.div`
284
284
  ), I = X?.bundles || [], V = f(() => {
285
285
  if (!I?.length || d !== "developer") return null;
286
286
  const e = I.filter((t) => t.isDev);
287
- return e.length ? e.find((t) => t.activeUser === B?.name)?.name || e[0].name : null;
288
- }, [I, d, B?.name]), j = f(() => d === "developer" ? V || "developer" : d, [d, V]), { data: Z, isFetching: M } = xe(
287
+ return e.length ? e.find((t) => t.activeUser === F?.name)?.name || e[0].name : null;
288
+ }, [I, d, F?.name]), j = f(() => d === "developer" ? V || "developer" : d, [d, V]), { data: Z, isFetching: M } = xe(
289
289
  {
290
290
  mode: "simple",
291
291
  variant: j,
@@ -302,9 +302,9 @@ const Se = x.div`
302
302
  )
303
303
  ],
304
304
  [h]
305
- ), $ = [...L, ...P], ee = f(() => {
305
+ ), T = [...L, ...P], ee = f(() => {
306
306
  const e = [];
307
- return $.forEach((n) => {
307
+ return T.forEach((n) => {
308
308
  if (!h[n] || !h[n].length) return;
309
309
  e.push({
310
310
  label: n,
@@ -328,7 +328,7 @@ const Se = x.div`
328
328
  }), e;
329
329
  }, [h, P, L]), oe = f(() => {
330
330
  let e = A.filter((n) => n.featured).sort((n, t) => (n.order || 0) - (t.order || 0)).slice(0, c);
331
- return e.length < c && $.forEach((n) => {
331
+ return e.length < c && T.forEach((n) => {
332
332
  if (e.length >= c) return;
333
333
  const t = h[n];
334
334
  if (!(!t || !t.length))
@@ -350,11 +350,11 @@ const Se = x.div`
350
350
  addonVersion: i.addonVersion,
351
351
  variant: i.variant,
352
352
  identifier: i.identifier
353
- }, T = { ...C };
354
- t && (T.formData = t);
353
+ }, _ = { ...C };
354
+ t && (_.formData = t);
355
355
  let l = null;
356
356
  try {
357
- l = await ne({ actionContext: T, ...v }).unwrap();
357
+ l = await ne({ actionContext: _, ...v }).unwrap();
358
358
  } catch (y) {
359
359
  w.error(he(y) || "Error executing action");
360
360
  return;
@@ -385,18 +385,18 @@ const Se = x.div`
385
385
  }
386
386
  }, ae = (e) => {
387
387
  const n = A.find((t) => t.identifier === e);
388
- n && F(n);
388
+ n && O(n);
389
389
  }, se = async (e, n) => {
390
390
  D(e, null, n);
391
391
  }, le = f(
392
392
  () => Array(c).fill(N),
393
393
  [c, N]
394
394
  ), k = M || u, ce = k ? le : oe;
395
- return /* @__PURE__ */ q(Se, { className: O("actions", { loading: k }), children: [
395
+ return /* @__PURE__ */ q(Se, { className: B("actions", { loading: k }), children: [
396
396
  ce.map((e, n) => /* @__PURE__ */ r(
397
397
  Ie,
398
398
  {
399
- className: O("action", {
399
+ className: B("action", {
400
400
  isPlaceholder: e.isPlaceholder
401
401
  }),
402
402
  "data-tooltip": e.groupLabel ? e.groupLabel + " " + e.label : e.label,
@@ -407,7 +407,7 @@ const Se = x.div`
407
407
  e.identifier + "-" + n
408
408
  )),
409
409
  /* @__PURE__ */ r(
410
- Fe,
410
+ Oe,
411
411
  {
412
412
  options: ee,
413
413
  isLoading: k && c > 0 || Y,
@@ -424,7 +424,7 @@ const Se = x.div`
424
424
  {
425
425
  action: K,
426
426
  context: C,
427
- onClose: () => F(null)
427
+ onClose: () => O(null)
428
428
  }
429
429
  ),
430
430
  /* @__PURE__ */ r(