@ynput/ayon-frontend-shared 0.7.3 → 0.7.5

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 (66) hide show
  1. package/LICENSE +105 -0
  2. package/dist/DetailsPanel.es.js +1088 -969
  3. package/dist/ListTable.es.js +70 -67
  4. package/dist/NewEntity.es.js +8 -5
  5. package/dist/ProjectTreeTable.es.js +4134 -3825
  6. package/dist/ProjectsTable.es.js +526 -0
  7. package/dist/Slicer.es.js +75 -73
  8. package/dist/Views.es.js +86 -84
  9. package/dist/chunks/Actions.es.js +4 -2
  10. package/dist/chunks/ColumnDropIndicator.es.js +21 -18
  11. package/dist/chunks/ColumnDropIndicator.styled.es.js +14 -13
  12. package/dist/chunks/ColumnHeaderMenuUI.es.js +9 -7
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +12 -11
  14. package/dist/chunks/EmptyPlaceholder.es.js +9 -8
  15. package/dist/chunks/EntityPath.es.js +15 -14
  16. package/dist/chunks/EntityPickerDialog.es.js +5 -3
  17. package/dist/chunks/EntityTooltip.es.js +10 -8
  18. package/dist/chunks/EntityUpdatesContext.es.js +13 -12
  19. package/dist/chunks/Feed.es.js +12 -11
  20. package/dist/chunks/FilterErrorActions.es.js +6 -4
  21. package/dist/chunks/GroupSettingsFallback.es.js +75 -0
  22. package/dist/chunks/JsonViewer.es.js +3 -2
  23. package/dist/chunks/Menu.es.js +105 -103
  24. package/dist/chunks/MetaWidget.es.js +278 -275
  25. package/dist/chunks/PlayableIcon.es.js +868 -862
  26. package/dist/chunks/ProjectContext.es.js +5 -4
  27. package/dist/chunks/RepresentationsList.es.js +3 -2
  28. package/dist/chunks/ReviewablesSelector.es.js +3471 -2067
  29. package/dist/chunks/SimpleTable.es.js +492 -402
  30. package/dist/chunks/Slicer.es.js +936 -896
  31. package/dist/chunks/TableExportContextInstance.es.js +437 -339
  32. package/dist/chunks/TableSettingsFallback.es.js +5 -3
  33. package/dist/chunks/ThumbnailSimple.es.js +15 -13
  34. package/dist/chunks/VideoPlayer.es.js +14 -12
  35. package/dist/chunks/Watchers.es.js +97 -95
  36. package/dist/chunks/getProjectDisplayName.es.js +4 -0
  37. package/dist/chunks/getUris.es.js +375 -374
  38. package/dist/chunks/useHierarchySelection.es.js +5 -3
  39. package/dist/chunks/useLoadModule.es.js +10 -8
  40. package/dist/chunks/viewUpdateHelper.es.js +12 -10
  41. package/dist/components.es.js +1488 -1186
  42. package/dist/context.es.js +589 -539
  43. package/dist/hooks.es.js +169 -212
  44. package/dist/index.es.js +17 -12
  45. package/dist/types/Actions.d.ts +3 -0
  46. package/dist/types/ContextMenu.d.ts +3 -0
  47. package/dist/types/DetailsPanel.d.ts +3 -0
  48. package/dist/types/EntityPickerDialog.d.ts +3 -0
  49. package/dist/types/Feed.d.ts +3 -0
  50. package/dist/types/ListTable.d.ts +3 -0
  51. package/dist/types/NewEntity.d.ts +3 -0
  52. package/dist/types/ProjectTreeTable.d.ts +735 -1
  53. package/dist/types/ProjectsTable.d.ts +228 -0
  54. package/dist/types/RepresentationsList.d.ts +3 -0
  55. package/dist/types/SimpleTable.d.ts +17 -0
  56. package/dist/types/Slicer.d.ts +4 -0
  57. package/dist/types/Views.d.ts +3 -0
  58. package/dist/types/api.d.ts +3 -0
  59. package/dist/types/components.d.ts +808 -11
  60. package/dist/types/context.d.ts +39 -1
  61. package/dist/types/hooks.d.ts +3 -0
  62. package/dist/types/index.d.ts +3 -0
  63. package/dist/types/util.d.ts +7 -0
  64. package/dist/util.es.js +152 -144
  65. package/package.json +16 -8
  66. /package/dist/{ContextMenuContextInstance.css → style.css} +0 -0
@@ -0,0 +1,75 @@
1
+ import { jsx as i, jsxs as p } from "react/jsx-runtime";
2
+ import "./ReviewablesSelector.es.js";
3
+ import "react";
4
+ import "match-sorter";
5
+ import { Button as e, Icon as n } from "@ynput/ayon-react-components";
6
+ import "clsx";
7
+ import "./SimpleForm.es.js";
8
+ import "./MetaWidget.es.js";
9
+ import "react-dom";
10
+ import "date-fns";
11
+ import "./PlayableIcon.es.js";
12
+ import "./TableExportContextInstance.es.js";
13
+ import "lodash";
14
+ import "primereact/confirmdialog";
15
+ import "react-toastify";
16
+ import "uuid";
17
+ import "./searchTerms.es.js";
18
+ import "axios";
19
+ import "./getUris.es.js";
20
+ import "./JsonViewer.es.js";
21
+ import "./Watchers.es.js";
22
+ import "lexical";
23
+ import "@lexical/markdown";
24
+ import "@lexical/code";
25
+ import "@lexical/list";
26
+ import "@lexical/rich-text";
27
+ import "@lexical/selection";
28
+ import "@lexical/utils";
29
+ import "@lexical/react/LexicalBlockWithAlignableContents";
30
+ import "@lexical/react/LexicalDecoratorBlockNode";
31
+ import "@module-federation/enhanced/runtime";
32
+ import "@ynput/ayon-addon/host";
33
+ import "semver";
34
+ import "./ContextMenuContextInstance.es.js";
35
+ import "react-redux";
36
+ import "react-router-dom";
37
+ import "./EmptyPlaceholder.es.js";
38
+ import "./EmptyPlaceholderFlex.styled.es.js";
39
+ import "./InfoMessage.es.js";
40
+ import "@dnd-kit/core";
41
+ import "@dnd-kit/sortable";
42
+ import "@dnd-kit/utilities";
43
+ import "./VersionUploadContextInstance.es.js";
44
+ import "./EntityTooltip.es.js";
45
+ import "./ColumnDropIndicator.styled.es.js";
46
+ import "@tanstack/react-table";
47
+ import "@ynput/ayon-addon";
48
+ import "./EntityPickerDialog.es.js";
49
+ import { T as a } from "./TableSettingsFallback.es.js";
50
+ import "remark-gfm";
51
+ import "react-markdown";
52
+ import "primereact/splitter";
53
+ import "./Slicer.es.js";
54
+ import "./NewEntityContextInstance.es.js";
55
+ import "./Menu.es.js";
56
+ import "./ThumbnailSimple.es.js";
57
+ import o from "styled-components";
58
+ const l = o.li`
59
+ display: flex;
60
+ align-items: center;
61
+ padding: 0;
62
+ margin: 0;
63
+ `, s = o(e)`
64
+ width: 100%;
65
+ justify-content: start;
66
+ `, gt = ({
67
+ requiredVersion: r,
68
+ fields: m
69
+ }) => /* @__PURE__ */ i(a, { feature: "groupAttributes", requiredVersion: r, children: m.map((t) => /* @__PURE__ */ i(l, { children: /* @__PURE__ */ p(s, { variant: "text", icon: t.icon, children: [
70
+ t.label,
71
+ /* @__PURE__ */ i(n, { icon: "bolt", style: { marginLeft: "auto" } })
72
+ ] }) }, t.value)) });
73
+ export {
74
+ gt as G
75
+ };
@@ -9,6 +9,7 @@ import "react-toastify";
9
9
  import { c as d } from "./copyToClipboard.es.js";
10
10
  import "uuid";
11
11
  import "./searchTerms.es.js";
12
+ import "axios";
12
13
  const l = c.div`
13
14
  position: relative;
14
15
  overflow: auto;
@@ -59,7 +60,7 @@ const l = c.div`
59
60
  .w-tc-editor textarea {
60
61
  display: none !important;
61
62
  }
62
- `, _ = ({ value: o, wrap: e, className: i }) => {
63
+ `, h = ({ value: o, wrap: e, className: i }) => {
63
64
  const t = a(() => {
64
65
  try {
65
66
  return JSON.stringify(o, null, 2);
@@ -92,5 +93,5 @@ const l = c.div`
92
93
  ] });
93
94
  };
94
95
  export {
95
- _ as J
96
+ h as J
96
97
  };
@@ -1,17 +1,19 @@
1
- import { jsxs as Q, jsx as p, Fragment as ke } from "react/jsx-runtime";
1
+ import { jsxs as Q, jsx as f, Fragment as ke } from "react/jsx-runtime";
2
2
  import te, { forwardRef as Ee, useRef as oe, useEffect as Y, useLayoutEffect as ce, useState as de, useCallback as Le } from "react";
3
- import { Button as fe, Icon as K, ShortcutTag as Pe } from "@ynput/ayon-react-components";
3
+ import { Button as pe, Icon as K, ShortcutTag as Pe } from "@ynput/ayon-react-components";
4
4
  import A, { keyframes as Re } from "styled-components";
5
5
  import { isArray as Ce } from "lodash";
6
6
  import { Link as Se } from "react-router-dom";
7
- import pe from "clsx";
7
+ import fe from "clsx";
8
8
  import "@module-federation/enhanced/runtime";
9
+ import "@ynput/ayon-addon/host";
9
10
  import "react-toastify";
10
11
  import "./searchTerms.es.js";
11
12
  import "./getUris.es.js";
12
13
  import "primereact/confirmdialog";
13
- import { a as ne, u as ue } from "./TableExportContextInstance.es.js";
14
+ import { b as ne, u as ue } from "./TableExportContextInstance.es.js";
14
15
  import "uuid";
16
+ import "axios";
15
17
  import "semver";
16
18
  import "./ContextMenuContextInstance.es.js";
17
19
  import { createPortal as Te } from "react-dom";
@@ -273,7 +275,7 @@ const z = 42, Ae = 8, U = z + Ae, De = A.dialog`
273
275
  gap: var(--base-gap-small);
274
276
  margin-left: auto;
275
277
  padding-left: 24px;
276
- `, $e = A(fe)`
278
+ `, $e = A(pe)`
277
279
  margin-left: auto;
278
280
  &.hasIcon {
279
281
  padding: 4px;
@@ -319,7 +321,7 @@ const z = 42, Ae = 8, U = z + Ae, De = A.dialog`
319
321
  display: flex;
320
322
  }
321
323
  }
322
- `, ge = Ee(
324
+ `, me = Ee(
323
325
  ({
324
326
  label: s,
325
327
  icon: n,
@@ -329,30 +331,30 @@ const z = 42, Ae = 8, U = z + Ae, De = A.dialog`
329
331
  notification: u,
330
332
  selected: c,
331
333
  danger: t,
332
- items: g = [],
334
+ items: m = [],
333
335
  className: a,
334
336
  isLink: h,
335
- isDev: m,
337
+ isDev: g,
336
338
  shortcut: L,
337
339
  disabled: e,
338
340
  powerFeature: l,
339
- active: f,
341
+ active: p,
340
342
  reserveActiveSlot: w,
341
- endActions: y = [],
343
+ endActions: b = [],
342
344
  ...N
343
345
  }, q) => {
344
346
  const J = Ce(s) ? s : [s], { powerLicense: v } = ne(), C = !v && l, S = /* @__PURE__ */ Q(
345
347
  Fe,
346
348
  {
347
349
  ref: q,
348
- className: pe(
350
+ className: fe(
349
351
  "menu-item",
350
352
  {
351
353
  highlighted: d,
352
354
  selected: c,
353
355
  notification: u,
354
356
  danger: t,
355
- dev: m,
357
+ dev: g,
356
358
  disabled: e,
357
359
  power: C
358
360
  },
@@ -361,42 +363,42 @@ const z = 42, Ae = 8, U = z + Ae, De = A.dialog`
361
363
  ...N,
362
364
  "aria-label": J.join(", "),
363
365
  children: [
364
- n && /* @__PURE__ */ p(K, { icon: n, className: r ? "hover-swap-default" : void 0 }),
365
- r && /* @__PURE__ */ p(K, { icon: r, className: "hover-swap" }),
366
- i && /* @__PURE__ */ p(ze, { src: i, alt: `${s} icon` }),
367
- J.map((b, x) => /* @__PURE__ */ p("span", { children: b }, x)),
368
- L && /* @__PURE__ */ p(Pe, { style: { minWidth: 22, textAlign: "center" }, align: "right", children: L }),
369
- (f || w) && /* @__PURE__ */ p(
366
+ n && /* @__PURE__ */ f(K, { icon: n, className: r ? "hover-swap-default" : void 0 }),
367
+ r && /* @__PURE__ */ f(K, { icon: r, className: "hover-swap" }),
368
+ i && /* @__PURE__ */ f(ze, { src: i, alt: `${s} icon` }),
369
+ J.map((y, x) => /* @__PURE__ */ f("span", { children: y }, x)),
370
+ L && /* @__PURE__ */ f(Pe, { style: { minWidth: 22, textAlign: "center" }, align: "right", children: L }),
371
+ (p || w) && /* @__PURE__ */ f(
370
372
  K,
371
373
  {
372
374
  icon: "check",
373
- style: { marginLeft: "auto", visibility: f ? "visible" : "hidden" }
375
+ style: { marginLeft: "auto", visibility: p ? "visible" : "hidden" }
374
376
  }
375
377
  ),
376
- !!y.length && /* @__PURE__ */ p(We, { children: y.map((b) => /* @__PURE__ */ p(
378
+ !!b.length && /* @__PURE__ */ f(We, { children: b.map((y) => /* @__PURE__ */ f(
377
379
  $e,
378
380
  {
379
381
  variant: "text",
380
- icon: b.icon,
382
+ icon: y.icon,
381
383
  className: "menu-item-end-action",
382
- "data-tooltip": b.tooltip,
383
- "aria-label": b.tooltip,
384
+ "data-tooltip": y.tooltip,
385
+ "aria-label": y.tooltip,
384
386
  onClick: (x) => {
385
- x.stopPropagation(), b.onClick(x);
387
+ x.stopPropagation(), y.onClick(x);
386
388
  },
387
389
  onKeyDown: (x) => x.stopPropagation()
388
390
  },
389
- b.icon
391
+ y.icon
390
392
  )) }),
391
- C && /* @__PURE__ */ p(K, { icon: "bolt", className: "power-bolt" }),
392
- !!g.length && /* @__PURE__ */ p(K, { icon: "arrow_right", className: "more" })
393
+ C && /* @__PURE__ */ f(K, { icon: "bolt", className: "power-bolt" }),
394
+ !!m.length && /* @__PURE__ */ f(K, { icon: "arrow_right", className: "more" })
393
395
  ]
394
396
  }
395
397
  );
396
- return h ? /* @__PURE__ */ p(Se, { to: h, target: N.target, children: S }) : S;
398
+ return h ? /* @__PURE__ */ f(Se, { to: h, target: N.target, children: S }) : S;
397
399
  }
398
400
  );
399
- ge.displayName = "MenuItem";
401
+ me.displayName = "MenuItem";
400
402
  const ae = ({
401
403
  items: s,
402
404
  handleClick: n,
@@ -406,20 +408,20 @@ const ae = ({
406
408
  level: u,
407
409
  id: c = "root-menu",
408
410
  parentRef: t,
409
- parentEl: g,
411
+ parentEl: m,
410
412
  style: a,
411
413
  placement: h,
412
- onClose: m,
414
+ onClose: g,
413
415
  onMenuClose: L,
414
416
  itemClassName: e,
415
417
  itemStyle: l,
416
- setPowerpackDialog: f,
418
+ setPowerpackDialog: p,
417
419
  ...w
418
420
  }) => {
419
- const y = oe({}), N = oe(null), q = (v, C, S) => {
420
- const b = y.current[C], x = N.current;
421
- if (!b || !x) return;
422
- const _ = (x.offsetParent ?? document.body).getBoundingClientRect(), D = b.getBoundingClientRect(), k = (x.querySelector("menu") ?? x).getBoundingClientRect(), V = window.innerWidth, B = window.innerHeight, M = 8, T = Math.max(240, k.width), I = Math.min(
421
+ const b = oe({}), N = oe(null), q = (v, C, S) => {
422
+ const y = b.current[C], x = N.current;
423
+ if (!y || !x) return;
424
+ const _ = (x.offsetParent ?? document.body).getBoundingClientRect(), D = y.getBoundingClientRect(), k = (x.querySelector("menu") ?? x).getBoundingClientRect(), V = window.innerWidth, B = window.innerHeight, M = 8, T = Math.max(240, k.width), I = Math.min(
423
425
  S.length * 36 + 16,
424
426
  B - U - M
425
427
  ), E = 4, F = () => Math.max(M, k.left - T - E), O = () => k.right + E, j = O() + T <= V - M, $ = F() >= M;
@@ -440,7 +442,7 @@ const ae = ({
440
442
  placement: R,
441
443
  // Pass the actual menu-item element so sub-menu measurement uses the <li>
442
444
  // instead of whatever inner span the mouse event bubbled from.
443
- parentEl: b
445
+ parentEl: y
444
446
  });
445
447
  }, J = (v) => {
446
448
  d && r?.(v, { id: "parent", items: [] });
@@ -451,23 +453,23 @@ const ae = ({
451
453
  if (!d || !N.current || !t || !i || !c) return;
452
454
  const v = N.current, C = t, S = C.closest(".menu-list, .sub-menu");
453
455
  if (!S) return;
454
- const b = v.querySelector("menu") ?? v, x = S.querySelector("menu") ?? S, _ = (v.offsetParent ?? document.body).getBoundingClientRect(), D = v.getBoundingClientRect(), P = b.getBoundingClientRect(), k = x.getBoundingClientRect(), V = C.getBoundingClientRect(), B = P.left - D.left, M = P.width, T = window.innerWidth, I = window.innerHeight, E = 8, F = 4, O = () => Math.max(E, k.left - M - F), j = () => k.right + F, $ = j() + M <= T - E, R = O() >= E;
456
+ const y = v.querySelector("menu") ?? v, x = S.querySelector("menu") ?? S, _ = (v.offsetParent ?? document.body).getBoundingClientRect(), D = v.getBoundingClientRect(), P = y.getBoundingClientRect(), k = x.getBoundingClientRect(), V = C.getBoundingClientRect(), B = P.left - D.left, M = P.width, T = window.innerWidth, I = window.innerHeight, E = 8, F = 4, O = () => Math.max(E, k.left - M - F), j = () => k.right + F, $ = j() + M <= T - E, R = O() >= E;
455
457
  let o, H;
456
458
  h === "left" && R ? (o = "left", H = O()) : $ ? (o = "right", H = j()) : R ? (o = "left", H = O()) : (o = "left", H = Math.max(E, T - M - E));
457
- const Z = b.querySelector(":scope > li")?.getBoundingClientRect(), ee = V.top, ve = Z ? Z.top : D.top + 8, ye = ee - ve, ie = b.scrollHeight;
458
- let G = D.top + ye;
459
+ const Z = y.querySelector(":scope > li")?.getBoundingClientRect(), ee = V.top, ve = Z ? Z.top : D.top + 8, be = ee - ve, ie = y.scrollHeight;
460
+ let G = D.top + be;
459
461
  if (G + ie > I - E) {
460
462
  const Me = Math.min(ie, I - U - E);
461
463
  G = I - Me - E;
462
464
  }
463
465
  G = Math.max(U, G);
464
- const be = o === "left" ? H - B : H, re = G - _.top, se = be - _.left, we = typeof a?.top == "number" ? a.top : parseFloat(String(a?.top)), xe = typeof a?.left == "number" ? a.left : parseFloat(String(a?.left));
466
+ const ye = o === "left" ? H - B : H, re = G - _.top, se = ye - _.left, we = typeof a?.top == "number" ? a.top : parseFloat(String(a?.top)), xe = typeof a?.left == "number" ? a.left : parseFloat(String(a?.left));
465
467
  (Math.abs(re - we) > 1 || Math.abs(se - xe) > 1) && i(
466
468
  c,
467
469
  { top: re, left: se, maxHeight: I - G - E },
468
470
  o
469
471
  );
470
- }, [d, s, t, c, h, a?.top, a?.left, i]), /* @__PURE__ */ p(
472
+ }, [d, s, t, c, h, a?.top, a?.left, i]), /* @__PURE__ */ f(
471
473
  _e,
472
474
  {
473
475
  style: { paddingLeft: d ? 16 : 0, ...a },
@@ -476,13 +478,13 @@ const ae = ({
476
478
  onMouseLeave: J,
477
479
  ...w,
478
480
  ref: N,
479
- children: /* @__PURE__ */ p(Be, { children: s.filter((v) => !v.hidden).map((v, C) => {
481
+ children: /* @__PURE__ */ f(Be, { children: s.filter((v) => !v.hidden).map((v, C) => {
480
482
  if (v.node)
481
483
  return v.node;
482
- if (v?.id === "divider" || v?.separator) return /* @__PURE__ */ p("hr", {}, C);
484
+ if (v?.id === "divider" || v?.separator) return /* @__PURE__ */ f("hr", {}, C);
483
485
  const {
484
486
  label: S,
485
- icon: b,
487
+ icon: y,
486
488
  img: x,
487
489
  highlighted: X,
488
490
  onClick: _,
@@ -498,14 +500,14 @@ const ae = ({
498
500
  endActions: F,
499
501
  ...O
500
502
  } = v, { powerLicense: j } = ne(), $ = !j && T, R = (o) => {
501
- o.preventDefault(), o.stopPropagation(), T && f?.(T), L?.();
503
+ o.preventDefault(), o.stopPropagation(), T && p?.(T), L?.();
502
504
  };
503
- return /* @__PURE__ */ p(
504
- ge,
505
+ return /* @__PURE__ */ f(
506
+ me,
505
507
  {
506
508
  tabIndex: 0,
507
509
  label: S,
508
- icon: b,
510
+ icon: y,
509
511
  img: x,
510
512
  highlighted: X,
511
513
  items: P,
@@ -520,15 +522,15 @@ const ae = ({
520
522
  onKeyDown: (o) => {
521
523
  o.key === "Enter" && ($ ? R(o) : P.length ? q(o, k, P) : n(o, _, D));
522
524
  const H = !o.target.nextSibling;
523
- o.key === "Tab" && H && !o.shiftKey && (o.preventDefault(), o.stopPropagation(), N.current?.querySelectorAll("li, button")[0]?.focus()), o.key === "Escape" && d && t && (o.preventDefault(), o.stopPropagation(), t.focus(), m?.(k));
525
+ o.key === "Tab" && H && !o.shiftKey && (o.preventDefault(), o.stopPropagation(), N.current?.querySelectorAll("li, button")[0]?.focus()), o.key === "Escape" && d && t && (o.preventDefault(), o.stopPropagation(), t.focus(), g?.(k));
524
526
  },
525
527
  style: { paddingRight: P.length ? "0" : "16px", ...l },
526
- ref: (o) => y.current[k] = o,
528
+ ref: (o) => b.current[k] = o,
527
529
  onMouseEnter: (o) => q(o, k, P),
528
530
  onMouseLeave: (o) => q(o, k, []),
529
531
  className: `${e} ${O.className || ""}`,
530
532
  ...O,
531
- children: !!P.length && /* @__PURE__ */ p(K, { icon: "arrow_right", style: { marginLeft: "auto" } })
533
+ children: !!P.length && /* @__PURE__ */ f(K, { icon: "arrow_right", style: { marginLeft: "auto" } })
532
534
  },
533
535
  `${k}-${C}`
534
536
  );
@@ -538,8 +540,8 @@ const ae = ({
538
540
  };
539
541
  function Ve(s, n, r = "right") {
540
542
  if (!s) return null;
541
- const i = s.getBoundingClientRect(), d = n?.getBoundingClientRect(), u = d?.width || 200, c = d?.height || 300, t = 8, g = window.innerWidth, a = window.innerHeight;
542
- let h = i.bottom + 8 - z, m;
543
+ const i = s.getBoundingClientRect(), d = n?.getBoundingClientRect(), u = d?.width || 200, c = d?.height || 300, t = 8, m = window.innerWidth, a = window.innerHeight;
544
+ let h = i.bottom + 8 - z, g;
543
545
  const L = U - z;
544
546
  if (h + z + c > a - t) {
545
547
  const e = i.top - 8 - c - z;
@@ -547,12 +549,12 @@ function Ve(s, n, r = "right") {
547
549
  }
548
550
  if (h = Math.max(L, h), r === "right") {
549
551
  const e = i.right - u;
550
- e >= t ? m = e : m = i.left;
552
+ e >= t ? g = e : g = i.left;
551
553
  } else {
552
554
  const e = i.left;
553
- e + u <= g - t ? m = e : m = i.right - u;
555
+ e + u <= m - t ? g = e : g = i.right - u;
554
556
  }
555
- return m !== void 0 && (m = Math.max(t, Math.min(m, g - u - t))), { top: h, left: m, maxHeight: a - (h + z) - t };
557
+ return g !== void 0 && (g = Math.max(t, Math.min(g, m - u - t))), { top: h, left: g, maxHeight: a - (h + z) - t };
556
558
  }
557
559
  function je(s, n, r = "right") {
558
560
  const [i, d] = de(null), u = oe(null), c = Le(() => {
@@ -562,9 +564,9 @@ function je(s, n, r = "right") {
562
564
  return;
563
565
  }
564
566
  if (!u.current) return;
565
- const g = Ve(t, u.current, r);
566
- g && d(
567
- (a) => a && Math.abs(a.top - g.top) < 1 && Math.abs((a.left ?? 0) - (g.left ?? 0)) < 1 && Math.abs((a.maxHeight ?? 0) - (g.maxHeight ?? 0)) < 1 ? a : g
567
+ const m = Ve(t, u.current, r);
568
+ m && d(
569
+ (a) => a && Math.abs(a.top - m.top) < 1 && Math.abs((a.left ?? 0) - (m.left ?? 0)) < 1 && Math.abs((a.maxHeight ?? 0) - (m.maxHeight ?? 0)) < 1 ? a : m
568
570
  );
569
571
  }, [s, n, r]);
570
572
  return ce(() => {
@@ -584,7 +586,7 @@ function je(s, n, r = "right") {
584
586
  };
585
587
  }, [c]), { position: i, menuRef: u };
586
588
  }
587
- const le = "ayon-menu-dialog", me = "ayon-menu-content", gt = ({
589
+ const le = "ayon-menu-dialog", ge = "ayon-menu-content", ht = ({
588
590
  id: s,
589
591
  target: n,
590
592
  targetId: r = "",
@@ -593,15 +595,15 @@ const le = "ayon-menu-dialog", me = "ayon-menu-content", gt = ({
593
595
  children: u,
594
596
  ...c
595
597
  }) => {
596
- const { menuOpen: t, setMenuOpen: g, navigate: a } = ue(), h = t === s, m = () => {
597
- g(!1);
598
+ const { menuOpen: t, setMenuOpen: m, navigate: a } = ue(), h = t === s, g = () => {
599
+ m(!1);
598
600
  }, L = (e) => {
599
- console.log("navigate and close"), m(), !a && e ? console.log("navigate not found") : a && e && a(e);
601
+ console.log("navigate and close"), g(), !a && e ? console.log("navigate not found") : a && e && a(e);
600
602
  };
601
- return h ? /* @__PURE__ */ p(
603
+ return h ? /* @__PURE__ */ f(
602
604
  Ge,
603
605
  {
604
- handleClose: m,
606
+ handleClose: g,
605
607
  handleNavigate: L,
606
608
  target: n,
607
609
  targetId: r,
@@ -620,21 +622,21 @@ const le = "ayon-menu-dialog", me = "ayon-menu-content", gt = ({
620
622
  children: u,
621
623
  ...c
622
624
  }) => {
623
- const { position: t, menuRef: g } = je(r ?? null, i ?? "", d);
625
+ const { position: t, menuRef: m } = je(r ?? null, i ?? "", d);
624
626
  Y(() => {
625
- t && g.current && g.current.querySelectorAll("li, button")[0]?.focus();
627
+ t && m.current && m.current.querySelectorAll("li, button")[0]?.focus();
626
628
  }, [t]);
627
629
  const a = (e) => {
628
630
  e.key === "Escape" && s();
629
631
  }, h = (e) => {
630
632
  e.target.id === le && s();
631
- }, m = te.Children.map(u, (e, l) => te.isValidElement(e) ? te.cloneElement(e, {
633
+ }, g = te.Children.map(u, (e, l) => te.isValidElement(e) ? te.cloneElement(e, {
632
634
  onClose: s,
633
635
  index: l,
634
636
  navigate: n
635
637
  }) : e);
636
638
  return Te(
637
- /* @__PURE__ */ p(
639
+ /* @__PURE__ */ f(
638
640
  De,
639
641
  {
640
642
  open: !0,
@@ -642,14 +644,14 @@ const le = "ayon-menu-dialog", me = "ayon-menu-content", gt = ({
642
644
  onKeyDown: a,
643
645
  ...c,
644
646
  id: le,
645
- children: /* @__PURE__ */ p(
647
+ children: /* @__PURE__ */ f(
646
648
  Oe,
647
649
  {
648
- id: me,
650
+ id: ge,
649
651
  style: t || { top: 0, left: 0, opacity: 0, visibility: "hidden" },
650
- className: pe(d),
651
- ref: g,
652
- children: m
652
+ className: fe(d),
653
+ ref: m,
654
+ children: g
653
655
  }
654
656
  )
655
657
  }
@@ -664,56 +666,56 @@ const le = "ayon-menu-dialog", me = "ayon-menu-content", gt = ({
664
666
  }
665
667
  }, Ke = (s = [], n = []) => s.length === n.length && s.every((r, i) => r.icon === n[i].icon && r.tooltip === n[i].tooltip), Ue = (s, n) => s.length === n.length && s.every(
666
668
  (r, i) => r.id === n[i].id && r.icon === n[i].icon && r.selected === n[i].selected && r.active === n[i].active && Ke(r.endActions, n[i].endActions)
667
- ), mt = ({ menu: s = [], onClose: n, header: r, footer: i = "" }) => {
668
- const { setPowerpackDialog: d } = ne(), { setMenuOpen: u } = ue(), [c, t] = de([]), g = (e, l, f, w) => {
669
- if (f) return n?.();
669
+ ), vt = ({ menu: s = [], onClose: n, header: r, footer: i = "" }) => {
670
+ const { setPowerpackDialog: d } = ne(), { setMenuOpen: u } = ue(), [c, t] = de([]), m = (e, l, p, w) => {
671
+ if (p) return n?.();
670
672
  l?.(e), !w && n && n();
671
673
  }, a = (e, l) => {
672
674
  if (l.items.length) {
673
- if (!c.find((f) => f.id === l.id)) {
674
- const f = l.parentEl ?? e.currentTarget ?? e.target;
675
+ if (!c.find((p) => p.id === l.id)) {
676
+ const p = l.parentEl ?? e.currentTarget ?? e.target;
675
677
  t([
676
678
  ...c.filter((w) => w.level < (l.level || 0) + 1),
677
679
  {
678
680
  ...l,
679
681
  id: l.id,
680
682
  level: (l.level || 0) + 1,
681
- parentRef: f
683
+ parentRef: p
682
684
  }
683
685
  ]);
684
686
  }
685
687
  } else
686
- t(c.filter((f) => f.level <= (l.level || 0)));
688
+ t(c.filter((p) => p.level <= (l.level || 0)));
687
689
  }, h = (e, l = {}) => {
688
- const f = e.relatedTarget;
689
- if (!f) return;
690
- if (f.tagName === "DIALOG") return t([]);
691
- typeof f.closest == "function" && f.closest(`#${me}`) || c.find((y) => y.id === f.id) || t(c.filter((y) => y.level <= (l.level || 0) + 1));
692
- }, m = (e, l) => {
690
+ const p = e.relatedTarget;
691
+ if (!p) return;
692
+ if (p.tagName === "DIALOG") return t([]);
693
+ typeof p.closest == "function" && p.closest(`#${ge}`) || c.find((b) => b.id === p.id) || t(c.filter((b) => b.level <= (l.level || 0) + 1));
694
+ }, g = (e, l) => {
693
695
  e.type === "mouseenter" || e.type === "keydown" ? a(e, l) : e.type === "mouseleave" && h(e, l);
694
696
  };
695
697
  Y(() => {
696
698
  t((e) => {
697
699
  if (!e.length) return e;
698
700
  const l = e.flatMap((w) => {
699
- const y = he(s, w.id);
700
- return y ? [{ ...w, items: y }] : [];
701
+ const b = he(s, w.id);
702
+ return b ? [{ ...w, items: b }] : [];
701
703
  });
702
- return l.length === e.length && l.every((w, y) => Ue(w.items, e[y].items)) ? e : l;
704
+ return l.length === e.length && l.every((w, b) => Ue(w.items, e[b].items)) ? e : l;
703
705
  });
704
706
  }, [s]);
705
- const L = (e, l, f) => {
706
- t((w) => w.map((y) => y.id === e ? { ...y, style: l, placement: f } : y));
707
+ const L = (e, l, p) => {
708
+ t((w) => w.map((b) => b.id === e ? { ...b, style: l, placement: p } : b));
707
709
  };
708
710
  return /* @__PURE__ */ Q(ke, { children: [
709
711
  /* @__PURE__ */ Q(He, { children: [
710
712
  r && r,
711
- /* @__PURE__ */ p(
713
+ /* @__PURE__ */ f(
712
714
  ae,
713
715
  {
714
716
  items: s,
715
- handleClick: g,
716
- onSubMenu: m,
717
+ handleClick: m,
718
+ onSubMenu: g,
717
719
  level: 0,
718
720
  setPowerpackDialog: d,
719
721
  onMenuClose: () => u(!1)
@@ -721,20 +723,20 @@ const le = "ayon-menu-dialog", me = "ayon-menu-content", gt = ({
721
723
  ),
722
724
  i && /* @__PURE__ */ Q(qe, { children: [
723
725
  i,
724
- /* @__PURE__ */ p(fe, { icon: "content_copy", variant: "text", onClick: () => Ne(i) })
726
+ /* @__PURE__ */ f(pe, { icon: "content_copy", variant: "text", onClick: () => Ne(i) })
725
727
  ] })
726
728
  ] }),
727
- c.map((e, l) => /* @__PURE__ */ p(
729
+ c.map((e, l) => /* @__PURE__ */ f(
728
730
  ae,
729
731
  {
730
732
  ...e,
731
733
  parentRef: e.parentRef || null,
732
734
  style: e.style || {},
733
- handleClick: g,
735
+ handleClick: m,
734
736
  subMenu: !0,
735
- onSubMenu: m,
737
+ onSubMenu: g,
736
738
  onSubMenuLayout: L,
737
- onClose: () => t(c.filter((f) => f.id !== e.id)),
739
+ onClose: () => t(c.filter((p) => p.id !== e.id)),
738
740
  onMenuClose: () => u(!1),
739
741
  onChange: a,
740
742
  setPowerpackDialog: d,
@@ -746,9 +748,9 @@ const le = "ayon-menu-dialog", me = "ayon-menu-content", gt = ({
746
748
  ] });
747
749
  };
748
750
  export {
749
- gt as M,
750
- mt as a,
751
- me as b,
751
+ ht as M,
752
+ vt as a,
753
+ ge as b,
752
754
  le as c,
753
755
  ae as d
754
756
  };