@ynput/ayon-frontend-shared 0.8.1 → 0.9.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 (42) hide show
  1. package/dist/DetailsPanel.es.js +2 -2
  2. package/dist/ListTable.es.js +1 -1
  3. package/dist/NewEntity.es.js +5 -3
  4. package/dist/ProjectTreeTable.es.js +4153 -4130
  5. package/dist/ProjectsTable.es.js +5 -4
  6. package/dist/Slicer.es.js +326 -293
  7. package/dist/Views.es.js +724 -714
  8. package/dist/chunks/ColumnDropIndicator.es.js +10 -10
  9. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +44 -38
  10. package/dist/chunks/EntityPickerDialog.es.js +1 -1
  11. package/dist/chunks/Feed.es.js +41 -39
  12. package/dist/chunks/FilmstripEntityCard.es.js +1 -1
  13. package/dist/chunks/GroupSettingsFallback.es.js +3 -2
  14. package/dist/chunks/MetaWidget.es.js +425 -411
  15. package/dist/chunks/NewEntityContextInstance.es.js +6 -5
  16. package/dist/chunks/ReviewablesSelector.es.js +76 -76
  17. package/dist/chunks/SimpleTable.es.js +151 -149
  18. package/dist/chunks/Slicer.es.js +637 -617
  19. package/dist/chunks/TableExportContextInstance.es.js +131 -126
  20. package/dist/chunks/ThumbnailSimple.es.js +11 -11
  21. package/dist/chunks/Watchers.es.js +46 -46
  22. package/dist/chunks/getUris.es.js +1 -1
  23. package/dist/chunks/searchTerms.es.js +617 -581
  24. package/dist/chunks/useCreateContextMenu.es.js +15 -13
  25. package/dist/components.es.js +900 -868
  26. package/dist/context.es.js +1 -1
  27. package/dist/hooks.es.js +2 -2
  28. package/dist/index.es.js +11 -10
  29. package/dist/types/ContextMenu.d.ts +1 -1
  30. package/dist/types/Feed.d.ts +1 -1
  31. package/dist/types/ListTable.d.ts +1 -1
  32. package/dist/types/NewEntity.d.ts +2 -0
  33. package/dist/types/ProjectTreeTable.d.ts +44 -3
  34. package/dist/types/ProjectsTable.d.ts +1 -1
  35. package/dist/types/SimpleTable.d.ts +1 -1
  36. package/dist/types/Slicer.d.ts +7 -1
  37. package/dist/types/Views.d.ts +5 -0
  38. package/dist/types/components.d.ts +46 -1
  39. package/dist/types/context.d.ts +2 -1
  40. package/dist/types/util.d.ts +21 -0
  41. package/dist/util.es.js +116 -113
  42. package/package.json +2 -2
@@ -3,7 +3,7 @@ import "react-toastify";
3
3
  import "lodash";
4
4
  import "primereact/confirmdialog";
5
5
  import { g as d } from "./iconUtils.es.js";
6
- import { bB as E } from "./searchTerms.es.js";
6
+ import { bD as E } from "./searchTerms.es.js";
7
7
  import "uuid";
8
8
  import "axios";
9
9
  import { jsx as L } from "react/jsx-runtime";
@@ -29,13 +29,13 @@ import "@module-federation/enhanced/runtime";
29
29
  import "@ynput/ayon-addon/host";
30
30
  import "semver";
31
31
  import "./ContextMenuContextInstance.es.js";
32
- import { createPortal as R } from "react-dom";
32
+ import { createPortal as D } from "react-dom";
33
33
  import "react-router-dom";
34
34
  import "@tanstack/react-table";
35
35
  import "react-redux";
36
- import { useDndContext as B } from "@dnd-kit/core";
37
- import { a as D } from "./addonColumnTags.es.js";
38
- const I = ["string", "integer", "float"], O = (o, s, t, n) => (t || I).includes(o.data.type || "") && (!s || o.scope?.includes(s)) ? n ? E(o.data) : !0 : !1, xt = ({
36
+ import { useDndContext as R } from "@dnd-kit/core";
37
+ import { a as I } from "./addonColumnTags.es.js";
38
+ const O = ["string", "integer", "float"], B = (o, s, t, n) => (t || O).includes(o.data.type || "") && (!s || o.scope?.includes(s)) ? n ? E(o.data) : !0 : !1, xt = ({
39
39
  allowedTypes: o,
40
40
  enumOnly: s,
41
41
  scope: t
@@ -91,7 +91,7 @@ const I = ["string", "integer", "float"], O = (o, s, t, n) => (t || I).includes(
91
91
  icon: d("tags"),
92
92
  scopes: ["task", "version", "folder", "product"]
93
93
  },
94
- ...a.filter((r) => O(r, t, o, s)).map((r) => ({
94
+ ...a.filter((r) => B(r, t, o, s)).map((r) => ({
95
95
  value: "attrib." + r.name,
96
96
  label: r.data.title || r.name,
97
97
  icon: d(r.name)
@@ -159,7 +159,7 @@ const I = ["string", "integer", "float"], O = (o, s, t, n) => (t || I).includes(
159
159
  height: n.height
160
160
  };
161
161
  }, _ = "th[data-column-id]", At = () => {
162
- const { active: o, over: s } = B(), t = o?.data?.current?.type === "column" ? String(o.id) : null, n = s ? String(s.id) : null, [a, r] = v(null);
162
+ const { active: o, over: s } = R(), t = o?.data?.current?.type === "column" ? String(o.id) : null, n = s ? String(s.id) : null, [a, r] = v(null);
163
163
  return T(() => {
164
164
  if (!t || !n || t === n) {
165
165
  r(null);
@@ -179,15 +179,15 @@ const I = ["string", "integer", "float"], O = (o, s, t, n) => (t || I).includes(
179
179
  m = requestAnimationFrame(u);
180
180
  };
181
181
  return u(), () => cancelAnimationFrame(m);
182
- }, [t, n]), a ? R(/* @__PURE__ */ L(D, { style: a }), document.body) : null;
182
+ }, [t, n]), a ? D(/* @__PURE__ */ L(I, { style: a }), document.body) : null;
183
183
  };
184
184
  export {
185
185
  _ as C,
186
186
  At as T,
187
187
  P as a,
188
- I as b,
188
+ O as b,
189
189
  xt as c,
190
190
  F as g,
191
- O as i,
191
+ B as i,
192
192
  yt as u
193
193
  };
@@ -1,7 +1,7 @@
1
- import { jsx as l, jsxs as d, Fragment as E } from "react/jsx-runtime";
2
- import { useState as F, useMemo as A } from "react";
1
+ import { jsx as l, jsxs as d, Fragment as A } from "react/jsx-runtime";
2
+ import { useState as E, useMemo as F } from "react";
3
3
  import { Button as D } from "@ynput/ayon-react-components";
4
- import { S as z, D as N, d as $, F as O, e as T, C as P, f as M, g as R, h as I, i as _ } from "./TableExportContextInstance.es.js";
4
+ import { S as j, D as z, d as $, F as N, e as T, C as O, f as I, g as M, h as R, i as K } from "./TableExportContextInstance.es.js";
5
5
  import "lodash";
6
6
  import "primereact/confirmdialog";
7
7
  import "react-toastify";
@@ -24,7 +24,8 @@ const oe = [
24
24
  "columnSummaries",
25
25
  "listValues",
26
26
  "entityLinks",
27
- "tableExport"
27
+ "tableExport",
28
+ "personalApiKeys"
28
29
  ], se = {
29
30
  annotations: {
30
31
  label: "Annotations",
@@ -100,6 +101,11 @@ const oe = [
100
101
  label: "Table Export",
101
102
  description: "Export a table or the selected rows to Excel or CSV, with every row and inherited attribute, ready to import back.",
102
103
  bullet: "Export tables to Excel and CSV"
104
+ },
105
+ personalApiKeys: {
106
+ label: "Personal API Keys",
107
+ description: "Create your own API keys on your profile, each with a name and an expiry, for scripts and tools that work as you.",
108
+ bullet: "Personal API keys for scripts and tools"
103
109
  }
104
110
  }, C = [
105
111
  "folder",
@@ -108,7 +114,7 @@ const oe = [
108
114
  "version",
109
115
  "representation",
110
116
  "workfile"
111
- ], G = (o) => o.length <= 1 ? o.join("") : `${o.slice(0, -1).join(", ")} and ${o[o.length - 1]}`, ie = (o) => {
117
+ ], _ = (o) => o.length <= 1 ? o.join("") : `${o.slice(0, -1).join(", ")} and ${o[o.length - 1]}`, ne = (o) => {
112
118
  if (o.length === 1) {
113
119
  const e = o[0];
114
120
  return `${e.entityType} "${e.label || e.name || e.id}"`;
@@ -118,8 +124,8 @@ const oe = [
118
124
  const a = C.filter((e) => r[e] > 0).map(
119
125
  (e) => u(r[e], e)
120
126
  );
121
- return G(a);
122
- }, ne = (o, r) => {
127
+ return _(a);
128
+ }, ie = (o, r) => {
123
129
  const a = {}, e = (s, t) => {
124
130
  t > 0 && (a[s] = (a[s] || 0) + t);
125
131
  };
@@ -127,19 +133,19 @@ const oe = [
127
133
  for (const s of r)
128
134
  e("folder", s.totalFolderCount), e("task", s.totalTaskCount), e("product", s.totalProductCount), e("version", s.totalVersionCount);
129
135
  return a;
130
- }, H = (o) => C.reduce((r, a) => r + (o[a] || 0), 0), g = 8, re = (o, r) => {
136
+ }, G = (o) => C.reduce((r, a) => r + (o[a] || 0), 0), g = 8, re = (o, r) => {
131
137
  if (o.length === 0) return [];
132
138
  const a = new Map(r.map((t) => [t.id, t])), e = o.length > 1, s = [];
133
139
  for (const t of o) {
134
- const i = a.get(t.id), p = t.label || t.name || t.id, m = e ? `"${p}" contains ` : "Contains ";
135
- if (i && (i.totalFolderCount > 0 || i.totalTaskCount > 0 || i.totalProductCount > 0 || i.totalVersionCount > 0)) {
140
+ const n = a.get(t.id), p = t.label || t.name || t.id, m = e ? `"${p}" contains ` : "Contains ";
141
+ if (n && (n.totalFolderCount > 0 || n.totalTaskCount > 0 || n.totalProductCount > 0 || n.totalVersionCount > 0)) {
136
142
  const c = [];
137
- i.totalFolderCount > 0 && c.push(u(i.totalFolderCount, "child folder")), i.totalTaskCount > 0 && c.push(u(i.totalTaskCount, "task")), i.totalProductCount > 0 && c.push(u(i.totalProductCount, "product")), i.totalVersionCount > 0 && c.push(u(i.totalVersionCount, "version")), s.push(`${m}${c.join(", ")}`);
143
+ n.totalFolderCount > 0 && c.push(u(n.totalFolderCount, "child folder")), n.totalTaskCount > 0 && c.push(u(n.totalTaskCount, "task")), n.totalProductCount > 0 && c.push(u(n.totalProductCount, "product")), n.totalVersionCount > 0 && c.push(u(n.totalVersionCount, "version")), s.push(`${m}${c.join(", ")}`);
138
144
  } else
139
145
  t.hasChildren && s.push(`${m}child folders`), t.taskNames && t.taskNames.length > 0 && s.push(`${m}${u(t.taskNames.length, "task")}`);
140
146
  }
141
147
  return s.length > g ? [...s.slice(0, g), `…and ${s.length - g} more`] : s;
142
- }, K = (o, r) => {
148
+ }, H = (o, r) => {
143
149
  const a = (o ?? "").trim();
144
150
  return a !== "" && Number(a) === r;
145
151
  }, ae = ({
@@ -151,17 +157,17 @@ const oe = [
151
157
  entityLabel: e,
152
158
  childrenDetails: s,
153
159
  expectedCounts: t,
154
- expectedName: i,
160
+ expectedName: n,
155
161
  deleteLabel: p = "Delete forever",
156
162
  message: m
157
- } = o, [f, c] = F(""), [v, x] = F({}), y = A(
158
- () => C.filter((n) => (t[n] || 0) > 0),
163
+ } = o, [f, c] = E(""), [y, x] = E({}), w = F(
164
+ () => C.filter((i) => (t[i] || 0) > 0),
159
165
  [t]
160
- ), b = A(() => H(t), [t]), h = b > $, w = !!i && !h, k = h ? y.every((n) => K(v[n], t[n])) : w ? f.trim() === i : !0, S = (n) => {
161
- n.key === "Enter" && k && (n.preventDefault(), r());
166
+ ), b = F(() => G(t), [t]), h = b > $, v = !!n && !h, k = h ? w.every((i) => H(y[i], t[i])) : v ? f.trim() === n : !0, S = (i) => {
167
+ i.key === "Enter" && k && (i.preventDefault(), r());
162
168
  };
163
169
  return /* @__PURE__ */ l(
164
- z,
170
+ j,
165
171
  {
166
172
  size: "md",
167
173
  isOpen: !0,
@@ -170,43 +176,43 @@ const oe = [
170
176
  footer: (
171
177
  // keydown lives here, not on the dialog — dialog spreads rest props over its own
172
178
  // handler and would lose escape-to-close
173
- /* @__PURE__ */ d(O, { onKeyDown: S, children: [
174
- w && /* @__PURE__ */ d(E, { children: [
179
+ /* @__PURE__ */ d(N, { onKeyDown: S, children: [
180
+ v && /* @__PURE__ */ d(A, { children: [
175
181
  /* @__PURE__ */ d(T, { htmlFor: "delete-confirm-name-input", children: [
176
182
  "To confirm delete action, type '",
177
- i,
183
+ n,
178
184
  "' in the box below"
179
185
  ] }),
180
186
  /* @__PURE__ */ l(
181
- P,
187
+ O,
182
188
  {
183
189
  id: "delete-confirm-name-input",
184
190
  "data-testid": "delete-confirm-name-input",
185
191
  autoFocus: !0,
186
192
  value: f,
187
- placeholder: i,
188
- onChange: (n) => c(n.target.value)
193
+ placeholder: n,
194
+ onChange: (i) => c(i.target.value)
189
195
  }
190
196
  )
191
197
  ] }),
192
- h && /* @__PURE__ */ d(E, { children: [
198
+ h && /* @__PURE__ */ d(A, { children: [
193
199
  /* @__PURE__ */ l(T, { as: "p", children: "To confirm, type how many of each will be deleted, children included" }),
194
- /* @__PURE__ */ l(M, { children: y.map((n, V) => /* @__PURE__ */ d(R, { children: [
195
- /* @__PURE__ */ l("span", { children: `${n[0].toUpperCase()}${n.slice(1)}s - ${t[n]}` }),
200
+ /* @__PURE__ */ l(I, { children: w.map((i, V) => /* @__PURE__ */ d(M, { children: [
201
+ /* @__PURE__ */ l("span", { children: `${i[0].toUpperCase()}${i.slice(1)}s - ${t[i]}` }),
196
202
  /* @__PURE__ */ l(
197
- I,
203
+ R,
198
204
  {
199
- "data-testid": `delete-confirm-count-${n}`,
205
+ "data-testid": `delete-confirm-count-${i}`,
200
206
  autoFocus: V === 0,
201
207
  inputMode: "numeric",
202
- value: v[n] ?? "",
203
- placeholder: `Number of ${n}s`,
204
- onChange: (L) => x((j) => ({ ...j, [n]: L.target.value }))
208
+ value: y[i] ?? "",
209
+ placeholder: `Number of ${i}s`,
210
+ onChange: (P) => x((L) => ({ ...L, [i]: P.target.value }))
205
211
  }
206
212
  )
207
- ] }, n)) })
213
+ ] }, i)) })
208
214
  ] }),
209
- /* @__PURE__ */ d(_, { children: [
215
+ /* @__PURE__ */ d(K, { children: [
210
216
  /* @__PURE__ */ l(D, { label: "Cancel", onClick: a }),
211
217
  /* @__PURE__ */ l(
212
218
  D,
@@ -222,7 +228,7 @@ const oe = [
222
228
  ] })
223
229
  ),
224
230
  children: /* @__PURE__ */ l(
225
- N,
231
+ z,
226
232
  {
227
233
  entityLabel: e,
228
234
  childrenDetails: s,
@@ -238,11 +244,11 @@ const oe = [
238
244
  };
239
245
  export {
240
246
  ae as D,
241
- ie as a,
247
+ ne as a,
242
248
  re as b,
243
- ne as c,
249
+ ie as c,
244
250
  oe as d,
245
251
  C as e,
246
252
  se as p,
247
- H as s
253
+ G as s
248
254
  };
@@ -15,7 +15,7 @@ import { a as U, E as Pe } from "./EntityTooltip.es.js";
15
15
  import { cj as Te } from "./getUris.es.js";
16
16
  import "@module-federation/enhanced/runtime";
17
17
  import "@ynput/ayon-addon/host";
18
- import { s as Ie, q as Ce, k as Fe, t as Re } from "./TableExportContextInstance.es.js";
18
+ import { q as Ie, s as Ce, k as Fe, t as Re } from "./TableExportContextInstance.es.js";
19
19
  import "semver";
20
20
  import "./ContextMenuContextInstance.es.js";
21
21
  import "clsx";
@@ -1,5 +1,5 @@
1
1
  import { jsx as c, jsxs as x, Fragment as Te } from "react/jsx-runtime";
2
- import nn, { useMemo as I, useState as L, useEffect as W, lazy as xo, Suspense as ko, useCallback as Je, useRef as pe, forwardRef as ft, useId as Ao, Fragment as Fo } from "react";
2
+ import nn, { useMemo as I, useState as L, useEffect as W, lazy as xo, Suspense as ko, useCallback as Ke, useRef as pe, forwardRef as ft, useId as Ao, Fragment as Fo } from "react";
3
3
  import { v4 as xn } from "uuid";
4
4
  import ne, { clsx as kn } from "clsx";
5
5
  import An from "react-markdown";
@@ -30,7 +30,7 @@ import { b as Oa, F as Va, u as $e, a as En, T as ja, C as Ua } from "./Thumbnai
30
30
  import "@module-federation/enhanced/runtime";
31
31
  import "@ynput/ayon-addon/host";
32
32
  import Vt from "axios";
33
- import { m as Be, q as za, a2 as yt, u as Ba } from "./TableExportContextInstance.es.js";
33
+ import { m as Be, s as za, a2 as yt, u as Ba } from "./TableExportContextInstance.es.js";
34
34
  import "semver";
35
35
  import "./ContextMenuContextInstance.es.js";
36
36
  import "react-dom";
@@ -38,7 +38,7 @@ import "react-router-dom";
38
38
  import { p as ve } from "./parseFilename.es.js";
39
39
  import { b as cn } from "./colorUtils.es.js";
40
40
  import "./EntityTooltip.es.js";
41
- import { isValid as Ke, isToday as Ga, isSameYear as Ha, isSameDay as qa, isSameWeek as Wa, isSameMinute as Qa, format as St, formatISO as Ya, differenceInMinutes as Ja, differenceInSeconds as Ka, compareAsc as Xa } from "date-fns";
41
+ import { isValid as Xe, isToday as Ga, isSameYear as Ha, isSameDay as qa, isSameWeek as Wa, isSameMinute as Qa, format as St, formatISO as Ya, differenceInMinutes as Ja, differenceInSeconds as Ka, compareAsc as Xa } from "date-fns";
42
42
  import "@ynput/ayon-addon";
43
43
  import { a as Za, M as er } from "./Menu.es.js";
44
44
  import { InView as tr } from "react-intersection-observer";
@@ -883,7 +883,7 @@ const lr = ({
883
883
  ...p
884
884
  }) => {
885
885
  if (!e.length) return null;
886
- const g = Je(
886
+ const g = Ke(
887
887
  (u) => {
888
888
  const h = e.filter((y) => vt(y.mime, y.ext)), b = h.findIndex((y) => y.id === e[u].id);
889
889
  i?.({ files: h, index: b, activityId: t || "" });
@@ -919,7 +919,7 @@ const lr = ({
919
919
  const r = a.match(/\(([^)]+)\)/)[1], s = r.split("?")[0];
920
920
  n = e.replace(r, s);
921
921
  }), n;
922
- }, Er = new AbortController(), Mr = Vt.CancelToken, Pr = Mr.source(), Xe = (e, t, o) => new Promise((n, a) => {
922
+ }, Er = new AbortController(), Mr = Vt.CancelToken, Pr = Mr.source(), Ze = (e, t, o) => new Promise((n, a) => {
923
923
  new FormData().append("image", e);
924
924
  const s = {
925
925
  signal: Er.signal,
@@ -941,7 +941,7 @@ const lr = ({
941
941
  if (r?.length) {
942
942
  if (r.length === 0) return;
943
943
  for (const s of r)
944
- Xe(s, t, o).then(
944
+ Ze(s, t, o).then(
945
945
  (i) => n(i),
946
946
  (i) => {
947
947
  a && a(s), Ce.error(i.message), console.warn(i);
@@ -985,8 +985,8 @@ const lr = ({
985
985
  }), g = await fetch(l.annotationData).then((M) => M.blob()), u = new File([g], `annotation-${l.name}`, {
986
986
  type: "image/png"
987
987
  }), h = await Promise.all([
988
- Xe(p, e, o),
989
- Xe(u, e, () => {
988
+ Ze(p, e, o),
989
+ Ze(u, e, () => {
990
990
  })
991
991
  ]), [b, y] = h, D = [t(b), t(y, !0)];
992
992
  return { annotation: l, uploads: h, files: D };
@@ -1305,7 +1305,7 @@ const lr = ({
1305
1305
  const [a, r] = L(!0), [s, i] = L(/* @__PURE__ */ new Date());
1306
1306
  if (!e) return null;
1307
1307
  const l = new Date(e);
1308
- if (!Ke(l)) return null;
1308
+ if (!Xe(l)) return null;
1309
1309
  W(() => {
1310
1310
  const w = setInterval(
1311
1311
  () => i(/* @__PURE__ */ new Date()),
@@ -1387,7 +1387,7 @@ const zn = (e) => {
1387
1387
  const { data: r } = await Vt.get(`/api/projects/${e}/files/${t}`, {
1388
1388
  responseType: "blob"
1389
1389
  }), s = new File([r], o, { type: n || r.type });
1390
- return Xe(s, e, a);
1390
+ return Ze(s, e, a);
1391
1391
  }, hn = (e, t) => `/api/projects/${e}/files/${t}`, fn = (e, t) => !!e && $t(t).has(e), ii = [
1392
1392
  { trigger: "@", icon: "person", tooltip: "Mention user" },
1393
1393
  { trigger: "@@", icon: "layers", tooltip: "Mention version" },
@@ -1427,15 +1427,15 @@ const zn = (e) => {
1427
1427
  () => t.map(
1428
1428
  (d) => fn(d.id, e || "") ? { ...d, isInline: !0 } : d
1429
1429
  )
1430
- ), [Oe, De] = L(0), Ve = pe(/* @__PURE__ */ new Map()), [be, ge] = L([]), [Ge, ue] = L(!1), [xe, he] = L(!1), [Ne, Ie] = L([]), [Ze, Re] = L([]), { annotations: fe, removeAnnotation: He, goToAnnotation: qe } = Lr({
1430
+ ), [Oe, De] = L(0), Ve = pe(/* @__PURE__ */ new Map()), [be, ge] = L([]), [Ge, ue] = L(!1), [xe, he] = L(!1), [Ne, Ie] = L([]), [et, Re] = L([]), { annotations: fe, removeAnnotation: He, goToAnnotation: qe } = Lr({
1431
1431
  entityId: w[0]?.id,
1432
1432
  filesUploading: be
1433
- }), re = w.length === 1 && w[0].entityType === "version" ? w[0] : void 0, et = $?.draft && $.draft.entityId === re?.id ? $.draft : null, [je, We] = L(
1433
+ }), re = w.length === 1 && w[0].entityType === "version" ? w[0] : void 0, tt = $?.draft && $.draft.entityId === re?.id ? $.draft : null, [je, We] = L(
1434
1434
  () => u && Number.isSafeInteger(a?.startFrame) && a.startFrame > 0 ? {
1435
1435
  startFrame: a.startFrame,
1436
1436
  endFrame: Number.isSafeInteger(a.endFrame) && a.endFrame >= a.startFrame ? a.endFrame : a.startFrame
1437
1437
  } : null
1438
- ), Ee = (d) => We(d && { ...d, entityId: re?.id }), Ue = u || je?.entityId === re?.id ? je : null, [ke, Me] = L(!1), q = u ? Ue : Ue ?? et, Pe = u ? !!re || !!Ue : !!$ && !!re, T = $?.formatFrame, R = T ?? ((d) => Gn(d, o)), U = (d) => T ? pn(d) : ri(pn(d), o), v = q ? q.endFrame > q.startFrame ? `${R(q.startFrame)}-${R(q.endFrame)}` : R(q.startFrame) : void 0, [K, we] = L(v ?? ""), Ae = pe(!1), Fe = pe(null), Le = (d) => {
1438
+ ), Ee = (d) => We(d && { ...d, entityId: re?.id }), Ue = u || je?.entityId === re?.id ? je : null, [ke, Me] = L(!1), q = u ? Ue : Ue ?? tt, Pe = u ? !!re || !!Ue : !!$ && !!re, T = $?.formatFrame, R = T ?? ((d) => Gn(d, o)), U = (d) => T ? pn(d) : ri(pn(d), o), v = q ? q.endFrame > q.startFrame ? `${R(q.startFrame)}-${R(q.endFrame)}` : R(q.startFrame) : void 0, [K, we] = L(v ?? ""), Ae = pe(!1), Fe = pe(null), Le = (d) => {
1439
1439
  if (!re) return;
1440
1440
  const k = d ? { ...d, entityId: re.id } : null;
1441
1441
  if (!u) {
@@ -1502,12 +1502,12 @@ const zn = (e) => {
1502
1502
  de(d.text), ee(d.files), Ie(d.uploadedAnnotations), mt(d.category), (d.text.trim() || d.files.length || d.uploadedAnnotations.length) && !y && !G && D?.();
1503
1503
  }
1504
1504
  });
1505
- const Ut = _.filter((d) => d.accessLevel >= 20), zt = _.find((d) => d.name === _e), Bt = Rn(zt?.color), tt = pe(null), Gt = pe(null), Ht = pe(null), pt = !!j.trim(), no = !pt && !H.length && !be.length && !Oe && !Ne.length && !fe.length && !xe, qt = !!S?.conditions?.some(
1505
+ const Ut = _.filter((d) => d.accessLevel >= 20), zt = _.find((d) => d.name === _e), Bt = Rn(zt?.color), Je = pe(null), Gt = pe(null), Ht = pe(null), pt = !!j.trim(), no = !pt && !H.length && !be.length && !Oe && !Ne.length && !fe.length && !xe, qt = !!S?.conditions?.some(
1506
1506
  (d) => "key" in d && d.key === "checklists" && d.value === !0
1507
1507
  );
1508
1508
  W(() => {
1509
1509
  if (!y || u || !qt) return;
1510
- const d = tt.current;
1510
+ const d = Je.current;
1511
1511
  !d || !d.isEmpty() || d.getEditor().update(() => {
1512
1512
  const k = Do(!1);
1513
1513
  Io().clear().append(No("check").append(k)), k.select();
@@ -1570,7 +1570,7 @@ const zn = (e) => {
1570
1570
  ge((k) => k.filter((O) => O.name !== ve(d)));
1571
1571
  }, Jt = (d) => {
1572
1572
  for (const k of d) {
1573
- const O = Xe(k, f, ot);
1573
+ const O = Ze(k, f, ot);
1574
1574
  Ve.current.set(k, O), O.then(
1575
1575
  (V) => nt(V),
1576
1576
  (V) => {
@@ -1590,7 +1590,7 @@ const zn = (e) => {
1590
1590
  mime: d.type
1591
1591
  };
1592
1592
  }
1593
- const { data: O } = await Xe(d, f, void 0), V = ve(d.name);
1593
+ const { data: O } = await Ze(d, f, void 0), V = ve(d.name);
1594
1594
  return ee((z) => [
1595
1595
  ...z,
1596
1596
  { id: O.id, name: V, mime: d.type, size: d.size, order: z.length, isInline: !0 }
@@ -1619,7 +1619,7 @@ const zn = (e) => {
1619
1619
  `);
1620
1620
  de((ye) => ye.trim() ? `${ye.trim()}
1621
1621
 
1622
- ${te}` : te), tt.current?.focus();
1622
+ ${te}` : te), Je.current?.focus();
1623
1623
  }, ze = async (B) => {
1624
1624
  const me = z.has(B.id);
1625
1625
  try {
@@ -1701,7 +1701,7 @@ ${te}` : te), tt.current?.focus();
1701
1701
  const { files: me, metadata: ie } = await go(fe);
1702
1702
  d = me, k = [...k, ...ie], O = ie.map((te) => te.id), Re(O);
1703
1703
  }
1704
- const { annotations: V = [] } = a || {}, z = k.length ? [...V, ...k] : void 0, ce = Sr(tt.current?.getMarkdown() ?? j), le = H.filter((me) => !me.isInline || fn(me.id, ce)), ze = [...le, ...d], B = {
1704
+ const { annotations: V = [] } = a || {}, z = k.length ? [...V, ...k] : void 0, ce = Sr(Je.current?.getMarkdown() ?? j), le = H.filter((me) => !me.isInline || fn(me.id, ce)), ze = [...le, ...d], B = {
1705
1705
  ...a,
1706
1706
  annotations: z,
1707
1707
  // could be undefined
@@ -1727,7 +1727,7 @@ ${te}` : te), tt.current?.focus();
1727
1727
  Re([]), he(!1);
1728
1728
  }
1729
1729
  }, Xt = [
1730
- ...fe.filter((d) => !Ze.includes(d.id)),
1730
+ ...fe.filter((d) => !et.includes(d.id)),
1731
1731
  ...(H || []).filter((d) => !d.isAnnotationLayer && !d.isInline),
1732
1732
  ...be
1733
1733
  ].sort((d, k) => d.order - k.order), fo = Xt.length > 3, Zt = (d) => h ? E ? "You do not have permission to comment." : "Commenting is disabled across multiple projects." : E || !d ? "Leave a comment" : "Comment, or type / to add mentions, checklists, code and more...", en = async (d) => {
@@ -1763,7 +1763,9 @@ ${te}` : te), tt.current?.focus();
1763
1763
  {
1764
1764
  value: _e,
1765
1765
  categories: Ut,
1766
- onChange: (d) => mt(d),
1766
+ onChange: (d) => {
1767
+ mt(d), requestAnimationFrame(() => Je.current?.focus());
1768
+ },
1767
1769
  isCompact: u,
1768
1770
  hasPowerpack: X,
1769
1771
  onPowerFeature: Q,
@@ -1855,7 +1857,7 @@ ${te}` : te), tt.current?.focus();
1855
1857
  /* @__PURE__ */ c(
1856
1858
  Bo,
1857
1859
  {
1858
- ref: tt,
1860
+ ref: Je,
1859
1861
  className: "comment-editor",
1860
1862
  value: j,
1861
1863
  onChange: de,
@@ -1891,7 +1893,7 @@ ${te}` : te), tt.current?.focus();
1891
1893
  icon: k,
1892
1894
  variant: "text",
1893
1895
  onMouseDown: (V) => V.preventDefault(),
1894
- onClick: () => tt.current?.insertMentionTrigger(d),
1896
+ onClick: () => Je.current?.insertMentionTrigger(d),
1895
1897
  "data-tooltip": O,
1896
1898
  "data-shortcut": d
1897
1899
  },
@@ -2303,7 +2305,7 @@ ${te}` : te), tt.current?.focus();
2303
2305
  children: xi(a)
2304
2306
  }
2305
2307
  };
2306
- }), o = Je((n) => {
2308
+ }), o = Ke((n) => {
2307
2309
  const a = window.getSelection();
2308
2310
  if (!a || a.rangeCount === 0 || a.isCollapsed) return;
2309
2311
  const r = a.getRangeAt(0), s = n.currentTarget;
@@ -2684,7 +2686,7 @@ const $i = "anonymous.guest", Oi = "Anonymous User", Vi = "unknown.user", Qn = (
2684
2686
  Z || (Z = j?.name || ""), Y = Qn({ name: Z, label: Y });
2685
2687
  const Oe = Ao(), De = `activity-comment-menu-${J}-${Oe}`, Ve = E === De, { onGoToFrame: be, setHighlightedActivities: ge, user: Ge, commentFrameLink: ue } = Be(), xe = !!Ge?.data?.isAdmin, he = de || xe, Ne = de || xe, Ie = () => {
2686
2688
  w(J);
2687
- }, Ze = () => {
2689
+ }, et = () => {
2688
2690
  w(null);
2689
2691
  }, Re = async (v, K, we) => {
2690
2692
  await a?.(v, K, void 0, we), w(null);
@@ -2693,7 +2695,7 @@ const $i = "anonymous.guest", Oi = "Anonymous User", Vi = "unknown.user", Qn = (
2693
2695
  }, qe = oe !== "origin" || u, re = async () => {
2694
2696
  const v = wi(Q);
2695
2697
  qe && ee && v.push({ id: ee.id, type: ee.type }), n && await n(J, ae, v);
2696
- }, et = () => {
2698
+ }, tt = () => {
2697
2699
  cr({
2698
2700
  title: "Delete comment",
2699
2701
  message: "Are you sure you want to delete this comment?",
@@ -2720,7 +2722,7 @@ const $i = "anonymous.guest", Oi = "Anonymous User", Vi = "unknown.user", Qn = (
2720
2722
  activityId: J,
2721
2723
  reaction: v.type
2722
2724
  });
2723
- }, Ue = Je(
2725
+ }, Ue = Ke(
2724
2726
  (v) => {
2725
2727
  v.annotation && (be?.(v.annotation.range[0]), ge([J]));
2726
2728
  },
@@ -2791,7 +2793,7 @@ const $i = "anonymous.guest", Oi = "Anonymous User", Vi = "unknown.user", Qn = (
2791
2793
  activityId: J,
2792
2794
  versionReview: !1,
2793
2795
  isEditing: !0,
2794
- onClose: Ze,
2796
+ onClose: et,
2795
2797
  onSubmit: Re,
2796
2798
  isOpen: !0,
2797
2799
  ...i
@@ -2907,7 +2909,7 @@ const $i = "anonymous.guest", Oi = "Anonymous User", Vi = "unknown.user", Qn = (
2907
2909
  children: /* @__PURE__ */ c(
2908
2910
  Bi,
2909
2911
  {
2910
- onDelete: he && n ? et : void 0,
2912
+ onDelete: he && n ? tt : void 0,
2911
2913
  onEdit: Ne ? Ie : void 0,
2912
2914
  onCopyText: Pe ? () => Mn(Pe) : void 0,
2913
2915
  onDuplicate: r ? () => r(e) : void 0,
@@ -3679,7 +3681,7 @@ const us = F.ul`
3679
3681
  a = { ...s }, r = new Date(s.createdAt);
3680
3682
  continue;
3681
3683
  }
3682
- const i = a.authorName === s.authorName, l = a.origin.id === s.entityId, m = a.activityData?.key === s.activityData?.key, p = new Date(s.createdAt), u = r !== null && Ke(r) && Ke(p) && Math.abs(Ka(r, p)) <= 20;
3684
+ const i = a.authorName === s.authorName, l = a.origin.id === s.entityId, m = a.activityData?.key === s.activityData?.key, p = new Date(s.createdAt), u = r !== null && Xe(r) && Xe(p) && Math.abs(Ka(r, p)) <= 20;
3683
3685
  i && u && l && m ? (s[o] !== void 0 && (a[o] = s[o]), a.activityData = {
3684
3686
  ...a.activityData,
3685
3687
  oldValue: s.activityData.oldValue
@@ -3710,7 +3712,7 @@ const us = F.ul`
3710
3712
  () => ws(i, ["version"], n),
3711
3713
  [i, n]
3712
3714
  ), m = I(() => [...l].sort((D, M) => {
3713
- const C = new Date(D.createdAt), f = new Date(M.createdAt), w = Ke(C), A = Ke(f);
3715
+ const C = new Date(D.createdAt), f = new Date(M.createdAt), w = Xe(C), A = Xe(f);
3714
3716
  if (!w && !A)
3715
3717
  return 0;
3716
3718
  if (w) {
@@ -4181,7 +4183,7 @@ const Ps = (e) => !!e.activityData?.annotations?.length || !!yt(e), _s = ({ proj
4181
4183
  const {
4182
4184
  submitComment: Ne,
4183
4185
  updateComment: Ie,
4184
- deleteComment: Ze,
4186
+ deleteComment: et,
4185
4187
  submitReview: Re,
4186
4188
  isSaving: fe
4187
4189
  } = gs({
@@ -4190,12 +4192,12 @@ const Ps = (e) => !!e.activityData?.annotations?.length || !!yt(e), _s = ({ proj
4190
4192
  entities: l,
4191
4193
  filter: S,
4192
4194
  entityListId: n
4193
- }), He = Je(
4195
+ }), He = Ke(
4194
4196
  async (T, R = [], U = {}) => {
4195
4197
  await Ne(T, R, U), he.current && he.current.scrollTo({ top: 0 });
4196
4198
  },
4197
4199
  [Ne, he]
4198
- ), qe = Je(
4200
+ ), qe = Ke(
4199
4201
  async (T) => {
4200
4202
  await Re(T);
4201
4203
  },
@@ -4218,7 +4220,7 @@ const Ps = (e) => !!e.activityData?.annotations?.length || !!yt(e), _s = ({ proj
4218
4220
  if (Ye === void 0) return;
4219
4221
  const bt = Ye + K.length, ut = Ae.slice(0, Ye) + we + Ae.slice(bt);
4220
4222
  ut && Ie(R, ut, R.files);
4221
- }, et = (T) => {
4223
+ }, tt = (T) => {
4222
4224
  const { entityId: R, entityType: U, activityId: v } = T;
4223
4225
  if (!U || !["version", "task", "folder"].includes(U))
4224
4226
  return console.log("Entity type not supported yet");
@@ -4230,7 +4232,7 @@ const Ps = (e) => !!e.activityData?.annotations?.length || !!yt(e), _s = ({ proj
4230
4232
  files: v.files.filter((K) => vt(K.mime, K.ext))
4231
4233
  })).filter((v) => v.files.length > 0);
4232
4234
  Z?.({ files: U, activityId: R, index: T, projectName: i });
4233
- }, [We, Ee] = L(null), Ue = !be && !t && !e, ke = Je(
4235
+ }, [We, Ee] = L(null), Ue = !be && !t && !e, ke = Ke(
4234
4236
  (T) => {
4235
4237
  Ee({ key: xn(), activity: T }), u(rt);
4236
4238
  },
@@ -4265,13 +4267,13 @@ const Ps = (e) => !!e.activityData?.annotations?.length || !!yt(e), _s = ({ proj
4265
4267
  activity: T,
4266
4268
  annotationFrameStart: Ge[T.origin?.id],
4267
4269
  onCheckChange: re,
4268
- onDelete: Ze,
4270
+ onDelete: et,
4269
4271
  onUpdate: async (R, U, v, K) => await Ie(T, R, U, K),
4270
4272
  onDuplicate: Ue ? ke : void 0,
4271
4273
  projectInfo: g,
4272
4274
  projectName: i,
4273
4275
  entityType: m,
4274
- onReferenceClick: et,
4276
+ onReferenceClick: tt,
4275
4277
  createdAts: l.map((R) => R.createdAt),
4276
4278
  onFileExpand: je,
4277
4279
  showOrigin: l.length > 1,
@@ -4299,7 +4301,7 @@ const Ps = (e) => !!e.activityData?.annotations?.length || !!yt(e), _s = ({ proj
4299
4301
  children: /* @__PURE__ */ c(ms, { style: { height: 0 }, onClick: () => M(), children: D ? "Loading more..." : "Click to load more" })
4300
4302
  }
4301
4303
  ),
4302
- !y && !S.conditions?.length && !E && H?.createdAt && Ke(new Date(H.createdAt)) && /* @__PURE__ */ c(Jn, { children: /* @__PURE__ */ x(Kn, { style: { alignItems: "center" }, children: [
4304
+ !y && !S.conditions?.length && !E && H?.createdAt && Xe(new Date(H.createdAt)) && /* @__PURE__ */ c(Jn, { children: /* @__PURE__ */ x(Kn, { style: { alignItems: "center" }, children: [
4303
4305
  /* @__PURE__ */ x(Rt, { children: [
4304
4306
  "Folder created at ",
4305
4307
  St(new Date(H.createdAt), "PPpp"),
@@ -1,6 +1,6 @@
1
1
  import { format as Yn, isValid as De, isSameMinute as nn, isBefore as qn, formatDistanceToNow as Vn, subYears as Qn, endOfYear as Lt, startOfYear as Mt, subMonths as Xn, endOfMonth as Ge, startOfMonth as We, addMonths as Jn, subWeeks as Zn, endOfWeek as Ye, startOfWeek as qe, addWeeks as eo, setHours as Nt, subDays as to, endOfDay as $t, startOfDay as St, parseISO as K, isSameDay as H } from "date-fns";
2
2
  import { matchSorter as no } from "match-sorter";
3
- import { bc as oo, bF as ro } from "./searchTerms.es.js";
3
+ import { bc as oo, bH as ro } from "./searchTerms.es.js";
4
4
  import { isArray as io } from "lodash";
5
5
  import "primereact/confirmdialog";
6
6
  import "react-toastify";
@@ -53,6 +53,7 @@ import "primereact/splitter";
53
53
  import "./Slicer.es.js";
54
54
  import "./NewEntityContextInstance.es.js";
55
55
  import "./Menu.es.js";
56
+ import "primereact-context/contextmenu";
56
57
  import "./ThumbnailSimple.es.js";
57
58
  import o from "styled-components";
58
59
  const l = o.li`
@@ -63,7 +64,7 @@ const l = o.li`
63
64
  `, s = o(e)`
64
65
  width: 100%;
65
66
  justify-content: start;
66
- `, gt = ({
67
+ `, bt = ({
67
68
  requiredVersion: r,
68
69
  fields: m
69
70
  }) => /* @__PURE__ */ i(a, { feature: "groupAttributes", requiredVersion: r, children: m.map((t) => /* @__PURE__ */ i(l, { children: /* @__PURE__ */ p(s, { variant: "text", icon: t.icon, children: [
@@ -71,5 +72,5 @@ const l = o.li`
71
72
  /* @__PURE__ */ i(n, { icon: "bolt", style: { marginLeft: "auto" } })
72
73
  ] }) }, t.value)) });
73
74
  export {
74
- gt as G
75
+ bt as G
75
76
  };