@ynput/ayon-frontend-shared 0.7.4 → 0.7.6
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.
- package/dist/DetailsPanel.es.js +376 -380
- package/dist/ListTable.es.js +2 -2
- package/dist/NewEntity.es.js +26 -26
- package/dist/ProjectTreeTable.es.js +2521 -2510
- package/dist/ProjectsTable.es.js +3 -3
- package/dist/Slicer.es.js +32 -32
- package/dist/Views.es.js +1 -1
- package/dist/chunks/ColumnDropIndicator.es.js +2 -2
- package/dist/chunks/ColumnHeaderMenuUI.es.js +1 -1
- package/dist/chunks/EntityPath.es.js +1 -1
- package/dist/chunks/EntityPickerDialog.es.js +481 -460
- package/dist/chunks/EntityTooltip.es.js +1 -1
- package/dist/chunks/Feed.es.js +11 -10
- package/dist/chunks/FilterErrorActions.es.js +1 -1
- package/dist/chunks/GroupSettingsFallback.es.js +2 -2
- package/dist/chunks/Menu.es.js +250 -247
- package/dist/chunks/MetaWidget.es.js +2 -2
- package/dist/chunks/PlayableIcon.es.js +368 -368
- package/dist/chunks/ProjectFoldersContext.es.js +237 -0
- package/dist/chunks/ReviewablesSelector.es.js +1223 -1170
- package/dist/chunks/SimpleTable.es.js +301 -296
- package/dist/chunks/Slicer.es.js +418 -410
- package/dist/chunks/TableExportContextInstance.es.js +428 -382
- package/dist/chunks/ThumbnailUploaderContext.es.js +48 -0
- package/dist/chunks/Watchers.es.js +2 -2
- package/dist/chunks/{ColumnDropIndicator.styled.es.js → addonColumnTags.es.js} +60 -47
- package/dist/components.es.js +1404 -1274
- package/dist/context.es.js +559 -657
- package/dist/hooks.es.js +2 -2
- package/dist/index.es.js +2 -2
- package/dist/types/Actions.d.ts +16 -16
- package/dist/types/ContextMenu.d.ts +16 -16
- package/dist/types/DetailsPanel.d.ts +16 -16
- package/dist/types/EntityPickerDialog.d.ts +61 -18
- package/dist/types/Feed.d.ts +16 -16
- package/dist/types/ListTable.d.ts +16 -16
- package/dist/types/NewEntity.d.ts +16 -16
- package/dist/types/ProjectTreeTable.d.ts +135 -33
- package/dist/types/ProjectsTable.d.ts +16 -16
- package/dist/types/RepresentationsList.d.ts +16 -16
- package/dist/types/SimpleTable.d.ts +16 -16
- package/dist/types/Slicer.d.ts +16 -16
- package/dist/types/Views.d.ts +16 -16
- package/dist/types/api.d.ts +16 -16
- package/dist/types/components.d.ts +226 -39
- package/dist/types/context.d.ts +24 -16
- package/dist/types/hooks.d.ts +16 -16
- package/dist/types/index.d.ts +16 -16
- package/dist/types/util.d.ts +16 -16
- package/package.json +3 -3
- package/dist/chunks/ProjectContext.es.js +0 -158
- package/dist/chunks/useQueryArgumentChangeLoading.es.js +0 -11
package/dist/chunks/Menu.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as Q, jsx as
|
|
2
|
-
import te, { forwardRef as
|
|
3
|
-
import { Button as
|
|
4
|
-
import A, { keyframes as
|
|
5
|
-
import { isArray as
|
|
6
|
-
import { Link as
|
|
1
|
+
import { jsxs as Q, jsx as u, Fragment as Me } from "react/jsx-runtime";
|
|
2
|
+
import te, { forwardRef as ke, useRef as oe, useEffect as Y, useLayoutEffect as le, useState as ce, useCallback as Ee } from "react";
|
|
3
|
+
import { Button as de, Icon as K, ShortcutTag as Le } from "@ynput/ayon-react-components";
|
|
4
|
+
import A, { keyframes as Pe } from "styled-components";
|
|
5
|
+
import { isArray as Re } from "lodash";
|
|
6
|
+
import { Link as Ce } from "react-router-dom";
|
|
7
7
|
import fe from "clsx";
|
|
8
8
|
import "@module-federation/enhanced/runtime";
|
|
9
9
|
import "@ynput/ayon-addon/host";
|
|
@@ -11,15 +11,15 @@ import "react-toastify";
|
|
|
11
11
|
import "./searchTerms.es.js";
|
|
12
12
|
import "./getUris.es.js";
|
|
13
13
|
import "primereact/confirmdialog";
|
|
14
|
-
import { b as ne, u as
|
|
14
|
+
import { b as ne, u as pe } from "./TableExportContextInstance.es.js";
|
|
15
15
|
import "uuid";
|
|
16
16
|
import "axios";
|
|
17
17
|
import "semver";
|
|
18
18
|
import "./ContextMenuContextInstance.es.js";
|
|
19
|
-
import { createPortal as
|
|
19
|
+
import { createPortal as Se } from "react-dom";
|
|
20
20
|
import "react-redux";
|
|
21
|
-
import { c as
|
|
22
|
-
const z = 42,
|
|
21
|
+
import { c as Te } from "./copyToClipboard.es.js";
|
|
22
|
+
const z = 42, Ne = 8, U = z + Ne, Ae = A.dialog`
|
|
23
23
|
position: fixed;
|
|
24
24
|
margin: 0;
|
|
25
25
|
inset: 0;
|
|
@@ -41,7 +41,7 @@ const z = 42, Ae = 8, U = z + Ae, De = A.dialog`
|
|
|
41
41
|
display: none;
|
|
42
42
|
}
|
|
43
43
|
padding-bottom: 60px;
|
|
44
|
-
`,
|
|
44
|
+
`, De = Pe`
|
|
45
45
|
from {
|
|
46
46
|
scale: 0.95;
|
|
47
47
|
opacity: 0.6;
|
|
@@ -64,7 +64,7 @@ const z = 42, Ae = 8, U = z + Ae, De = A.dialog`
|
|
|
64
64
|
z-index: 30;
|
|
65
65
|
|
|
66
66
|
/* animate */
|
|
67
|
-
animation: ${
|
|
67
|
+
animation: ${De} 0.03s ease-in forwards;
|
|
68
68
|
|
|
69
69
|
/* transform origin based on alignment */
|
|
70
70
|
&.right {
|
|
@@ -88,7 +88,7 @@ const z = 42, Ae = 8, U = z + Ae, De = A.dialog`
|
|
|
88
88
|
color: var(--md-sys-color-on-surface, #fff) !important;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
`,
|
|
91
|
+
`, Ie = A.section`
|
|
92
92
|
position: relative;
|
|
93
93
|
display: flex;
|
|
94
94
|
flex-direction: column;
|
|
@@ -101,7 +101,7 @@ const z = 42, Ae = 8, U = z + Ae, De = A.dialog`
|
|
|
101
101
|
color: var(--md-sys-color-on-surface);
|
|
102
102
|
z-index: 10;
|
|
103
103
|
overflow: hidden;
|
|
104
|
-
`,
|
|
104
|
+
`, He = A.div`
|
|
105
105
|
position: relative;
|
|
106
106
|
border-radius: 8px;
|
|
107
107
|
display: flex;
|
|
@@ -125,7 +125,7 @@ const z = 42, Ae = 8, U = z + Ae, De = A.dialog`
|
|
|
125
125
|
overflow-x: hidden;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
`,
|
|
128
|
+
`, _e = A.menu`
|
|
129
129
|
/* reset defaults */
|
|
130
130
|
display: flex;
|
|
131
131
|
list-style-type: none;
|
|
@@ -160,7 +160,7 @@ const z = 42, Ae = 8, U = z + Ae, De = A.dialog`
|
|
|
160
160
|
opacity: 0.5;
|
|
161
161
|
border-color: var(--md-sys-color-surface-container-highest);
|
|
162
162
|
}
|
|
163
|
-
`,
|
|
163
|
+
`, Be = A.li`
|
|
164
164
|
display: flex;
|
|
165
165
|
padding: 6px 16px 6px 12px;
|
|
166
166
|
justify-content: flex-start;
|
|
@@ -269,13 +269,13 @@ const z = 42, Ae = 8, U = z + Ae, De = A.dialog`
|
|
|
269
269
|
}
|
|
270
270
|
background-color: unset;
|
|
271
271
|
}
|
|
272
|
-
`,
|
|
272
|
+
`, Fe = A.div`
|
|
273
273
|
display: flex;
|
|
274
274
|
align-items: center;
|
|
275
275
|
gap: var(--base-gap-small);
|
|
276
276
|
margin-left: auto;
|
|
277
277
|
padding-left: 24px;
|
|
278
|
-
`,
|
|
278
|
+
`, We = A(de)`
|
|
279
279
|
margin-left: auto;
|
|
280
280
|
&.hasIcon {
|
|
281
281
|
padding: 4px;
|
|
@@ -288,11 +288,11 @@ const z = 42, Ae = 8, U = z + Ae, De = A.dialog`
|
|
|
288
288
|
background-color: var(--md-sys-color-on-primary);
|
|
289
289
|
color: var(--md-sys-color-primary);
|
|
290
290
|
}
|
|
291
|
-
`,
|
|
291
|
+
`, $e = A.img`
|
|
292
292
|
width: 18px;
|
|
293
293
|
height: 18px;
|
|
294
294
|
object-fit: contain;
|
|
295
|
-
`,
|
|
295
|
+
`, ze = A.footer`
|
|
296
296
|
position: relative;
|
|
297
297
|
display: flex;
|
|
298
298
|
padding: 8px;
|
|
@@ -321,114 +321,114 @@ const z = 42, Ae = 8, U = z + Ae, De = A.dialog`
|
|
|
321
321
|
display: flex;
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
`,
|
|
324
|
+
`, ue = ke(
|
|
325
325
|
({
|
|
326
|
-
label:
|
|
327
|
-
icon:
|
|
326
|
+
label: a,
|
|
327
|
+
icon: i,
|
|
328
328
|
hoverIcon: r,
|
|
329
|
-
img:
|
|
330
|
-
highlighted:
|
|
331
|
-
notification:
|
|
332
|
-
selected:
|
|
329
|
+
img: n,
|
|
330
|
+
highlighted: f,
|
|
331
|
+
notification: p,
|
|
332
|
+
selected: l,
|
|
333
333
|
danger: t,
|
|
334
|
-
items:
|
|
335
|
-
className:
|
|
334
|
+
items: g = [],
|
|
335
|
+
className: c,
|
|
336
336
|
isLink: h,
|
|
337
|
-
isDev:
|
|
337
|
+
isDev: m,
|
|
338
338
|
shortcut: L,
|
|
339
339
|
disabled: e,
|
|
340
|
-
powerFeature:
|
|
341
|
-
active:
|
|
340
|
+
powerFeature: s,
|
|
341
|
+
active: d,
|
|
342
342
|
reserveActiveSlot: w,
|
|
343
|
-
endActions:
|
|
343
|
+
endActions: y = [],
|
|
344
344
|
...N
|
|
345
345
|
}, q) => {
|
|
346
|
-
const J =
|
|
347
|
-
|
|
346
|
+
const J = Re(a) ? a : [a], { powerLicense: v } = ne(), C = !v && s, S = /* @__PURE__ */ Q(
|
|
347
|
+
Be,
|
|
348
348
|
{
|
|
349
349
|
ref: q,
|
|
350
350
|
className: fe(
|
|
351
351
|
"menu-item",
|
|
352
352
|
{
|
|
353
|
-
highlighted:
|
|
354
|
-
selected:
|
|
355
|
-
notification:
|
|
353
|
+
highlighted: f,
|
|
354
|
+
selected: l,
|
|
355
|
+
notification: p,
|
|
356
356
|
danger: t,
|
|
357
|
-
dev:
|
|
357
|
+
dev: m,
|
|
358
358
|
disabled: e,
|
|
359
359
|
power: C
|
|
360
360
|
},
|
|
361
|
-
|
|
361
|
+
c
|
|
362
362
|
),
|
|
363
363
|
...N,
|
|
364
364
|
"aria-label": J.join(", "),
|
|
365
365
|
children: [
|
|
366
|
-
|
|
367
|
-
r && /* @__PURE__ */
|
|
368
|
-
|
|
369
|
-
J.map((
|
|
370
|
-
L && /* @__PURE__ */
|
|
371
|
-
(
|
|
366
|
+
i && /* @__PURE__ */ u(K, { icon: i, className: r ? "hover-swap-default" : void 0 }),
|
|
367
|
+
r && /* @__PURE__ */ u(K, { icon: r, className: "hover-swap" }),
|
|
368
|
+
n && /* @__PURE__ */ u($e, { src: n, alt: `${a} icon` }),
|
|
369
|
+
J.map((b, x) => /* @__PURE__ */ u("span", { children: b }, x)),
|
|
370
|
+
L && /* @__PURE__ */ u(Le, { style: { minWidth: 22, textAlign: "center" }, align: "right", children: L }),
|
|
371
|
+
(d || w) && /* @__PURE__ */ u(
|
|
372
372
|
K,
|
|
373
373
|
{
|
|
374
374
|
icon: "check",
|
|
375
|
-
style: { marginLeft: "auto", visibility:
|
|
375
|
+
style: { marginLeft: "auto", visibility: d ? "visible" : "hidden" }
|
|
376
376
|
}
|
|
377
377
|
),
|
|
378
|
-
!!
|
|
379
|
-
|
|
378
|
+
!!y.length && /* @__PURE__ */ u(Fe, { children: y.map((b) => /* @__PURE__ */ u(
|
|
379
|
+
We,
|
|
380
380
|
{
|
|
381
381
|
variant: "text",
|
|
382
|
-
icon:
|
|
382
|
+
icon: b.icon,
|
|
383
383
|
className: "menu-item-end-action",
|
|
384
|
-
"data-tooltip":
|
|
385
|
-
"aria-label":
|
|
384
|
+
"data-tooltip": b.tooltip,
|
|
385
|
+
"aria-label": b.tooltip,
|
|
386
386
|
onClick: (x) => {
|
|
387
|
-
x.stopPropagation(),
|
|
387
|
+
x.stopPropagation(), b.onClick(x);
|
|
388
388
|
},
|
|
389
389
|
onKeyDown: (x) => x.stopPropagation()
|
|
390
390
|
},
|
|
391
|
-
|
|
391
|
+
b.icon
|
|
392
392
|
)) }),
|
|
393
|
-
C && /* @__PURE__ */
|
|
394
|
-
!!
|
|
393
|
+
C && /* @__PURE__ */ u(K, { icon: "bolt", className: "power-bolt" }),
|
|
394
|
+
!!g.length && /* @__PURE__ */ u(K, { icon: "arrow_right", className: "more" })
|
|
395
395
|
]
|
|
396
396
|
}
|
|
397
397
|
);
|
|
398
|
-
return h ? /* @__PURE__ */
|
|
398
|
+
return h ? /* @__PURE__ */ u(Ce, { to: h, target: N.target, children: S }) : S;
|
|
399
399
|
}
|
|
400
400
|
);
|
|
401
|
-
|
|
401
|
+
ue.displayName = "MenuItem";
|
|
402
402
|
const ae = ({
|
|
403
|
-
items:
|
|
404
|
-
handleClick:
|
|
403
|
+
items: a,
|
|
404
|
+
handleClick: i,
|
|
405
405
|
onSubMenu: r,
|
|
406
|
-
onSubMenuLayout:
|
|
407
|
-
subMenu:
|
|
408
|
-
level:
|
|
409
|
-
id:
|
|
406
|
+
onSubMenuLayout: n,
|
|
407
|
+
subMenu: f,
|
|
408
|
+
level: p,
|
|
409
|
+
id: l = "root-menu",
|
|
410
410
|
parentRef: t,
|
|
411
|
-
parentEl:
|
|
412
|
-
style:
|
|
411
|
+
parentEl: g,
|
|
412
|
+
style: c,
|
|
413
413
|
placement: h,
|
|
414
|
-
onClose:
|
|
414
|
+
onClose: m,
|
|
415
415
|
onMenuClose: L,
|
|
416
416
|
itemClassName: e,
|
|
417
|
-
itemStyle:
|
|
418
|
-
setPowerpackDialog:
|
|
417
|
+
itemStyle: s,
|
|
418
|
+
setPowerpackDialog: d,
|
|
419
419
|
...w
|
|
420
420
|
}) => {
|
|
421
|
-
const
|
|
422
|
-
const
|
|
423
|
-
if (!
|
|
424
|
-
const _ = (x.offsetParent ?? document.body).getBoundingClientRect(), D =
|
|
421
|
+
const y = oe({}), N = oe(null), q = (v, C, S) => {
|
|
422
|
+
const b = y.current[C], x = N.current;
|
|
423
|
+
if (!b || !x) return;
|
|
424
|
+
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), O = Math.min(
|
|
425
425
|
S.length * 36 + 16,
|
|
426
426
|
B - U - M
|
|
427
|
-
), E = 4, F = () => Math.max(M, k.left - T - E),
|
|
427
|
+
), E = 4, F = () => Math.max(M, k.left - T - E), I = () => k.right + E, j = I() + T <= V - M, $ = F() >= M;
|
|
428
428
|
let R, o;
|
|
429
|
-
h === "left" && $ ? (R = "left", o = F()) : j ? (R = "right", o =
|
|
429
|
+
h === "left" && $ ? (R = "left", o = F()) : j ? (R = "right", o = I()) : $ ? (R = "left", o = F()) : (R = "left", o = Math.max(M, V - T - M));
|
|
430
430
|
let W = D.top - 8;
|
|
431
|
-
W +
|
|
431
|
+
W + O > B - M && (W = B - O - M), W = Math.max(U, W);
|
|
432
432
|
const ee = R === "left" ? o - 16 : o;
|
|
433
433
|
r?.(v, {
|
|
434
434
|
id: C,
|
|
@@ -438,53 +438,53 @@ const ae = ({
|
|
|
438
438
|
maxHeight: B - W - M
|
|
439
439
|
},
|
|
440
440
|
items: S,
|
|
441
|
-
level:
|
|
441
|
+
level: p,
|
|
442
442
|
placement: R,
|
|
443
443
|
// Pass the actual menu-item element so sub-menu measurement uses the <li>
|
|
444
444
|
// instead of whatever inner span the mouse event bubbled from.
|
|
445
|
-
parentEl:
|
|
445
|
+
parentEl: b
|
|
446
446
|
});
|
|
447
447
|
}, J = (v) => {
|
|
448
|
-
|
|
448
|
+
f && r?.(v, { id: "parent", items: [] });
|
|
449
449
|
};
|
|
450
450
|
return Y(() => {
|
|
451
|
-
|
|
452
|
-
}, [
|
|
453
|
-
if (!
|
|
451
|
+
f && N.current && N.current.querySelectorAll("li, button")[0]?.focus();
|
|
452
|
+
}, [f]), le(() => {
|
|
453
|
+
if (!f || !N.current || !t || !n || !l) return;
|
|
454
454
|
const v = N.current, C = t, S = C.closest(".menu-list, .sub-menu");
|
|
455
455
|
if (!S) return;
|
|
456
|
-
const
|
|
456
|
+
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, O = window.innerHeight, E = 8, F = 4, I = () => Math.max(E, k.left - M - F), j = () => k.right + F, $ = j() + M <= T - E, R = I() >= E;
|
|
457
457
|
let o, H;
|
|
458
|
-
h === "left" && R ? (o = "left", H =
|
|
459
|
-
const Z =
|
|
460
|
-
let G = D.top +
|
|
461
|
-
if (G + ie >
|
|
462
|
-
const
|
|
463
|
-
G =
|
|
458
|
+
h === "left" && R ? (o = "left", H = I()) : $ ? (o = "right", H = j()) : R ? (o = "left", H = I()) : (o = "left", H = Math.max(E, T - M - E));
|
|
459
|
+
const Z = b.querySelector(":scope > li")?.getBoundingClientRect(), ee = V.top, he = Z ? Z.top : D.top + 8, ve = ee - he, ie = b.scrollHeight;
|
|
460
|
+
let G = D.top + ve;
|
|
461
|
+
if (G + ie > O - E) {
|
|
462
|
+
const xe = Math.min(ie, O - U - E);
|
|
463
|
+
G = O - xe - E;
|
|
464
464
|
}
|
|
465
465
|
G = Math.max(U, G);
|
|
466
|
-
const ye = o === "left" ? H - B : H, re = G - _.top, se = ye - _.left,
|
|
467
|
-
(Math.abs(re -
|
|
468
|
-
|
|
469
|
-
{ top: re, left: se, maxHeight:
|
|
466
|
+
const ye = o === "left" ? H - B : H, re = G - _.top, se = ye - _.left, be = typeof c?.top == "number" ? c.top : parseFloat(String(c?.top)), we = typeof c?.left == "number" ? c.left : parseFloat(String(c?.left));
|
|
467
|
+
(Math.abs(re - be) > 1 || Math.abs(se - we) > 1) && n(
|
|
468
|
+
l,
|
|
469
|
+
{ top: re, left: se, maxHeight: O - G - E },
|
|
470
470
|
o
|
|
471
471
|
);
|
|
472
|
-
}, [
|
|
473
|
-
|
|
472
|
+
}, [f, a, t, l, h, c?.top, c?.left, n]), /* @__PURE__ */ u(
|
|
473
|
+
He,
|
|
474
474
|
{
|
|
475
|
-
style: { paddingLeft:
|
|
476
|
-
className:
|
|
477
|
-
id:
|
|
475
|
+
style: { paddingLeft: f ? 16 : 0, ...c },
|
|
476
|
+
className: f ? "sub-menu" : "menu-list",
|
|
477
|
+
id: l,
|
|
478
478
|
onMouseLeave: J,
|
|
479
479
|
...w,
|
|
480
480
|
ref: N,
|
|
481
|
-
children: /* @__PURE__ */
|
|
481
|
+
children: /* @__PURE__ */ u(_e, { children: a.filter((v) => !v.hidden).map((v, C) => {
|
|
482
482
|
if (v.node)
|
|
483
483
|
return v.node;
|
|
484
|
-
if (v?.id === "divider" || v?.separator) return /* @__PURE__ */
|
|
484
|
+
if (v?.id === "divider" || v?.separator) return /* @__PURE__ */ u("hr", {}, C);
|
|
485
485
|
const {
|
|
486
486
|
label: S,
|
|
487
|
-
icon:
|
|
487
|
+
icon: b,
|
|
488
488
|
img: x,
|
|
489
489
|
highlighted: X,
|
|
490
490
|
onClick: _,
|
|
@@ -495,42 +495,42 @@ const ae = ({
|
|
|
495
495
|
selected: B,
|
|
496
496
|
disabled: M,
|
|
497
497
|
powerFeature: T,
|
|
498
|
-
active:
|
|
498
|
+
active: O,
|
|
499
499
|
reserveActiveSlot: E,
|
|
500
500
|
endActions: F,
|
|
501
|
-
...
|
|
501
|
+
...I
|
|
502
502
|
} = v, { powerLicense: j } = ne(), $ = !j && T, R = (o) => {
|
|
503
|
-
o.preventDefault(), o.stopPropagation(), T &&
|
|
503
|
+
o.preventDefault(), o.stopPropagation(), T && d?.(T), L?.();
|
|
504
504
|
};
|
|
505
|
-
return /* @__PURE__ */
|
|
506
|
-
|
|
505
|
+
return /* @__PURE__ */ u(
|
|
506
|
+
ue,
|
|
507
507
|
{
|
|
508
508
|
tabIndex: 0,
|
|
509
509
|
label: S,
|
|
510
|
-
icon:
|
|
510
|
+
icon: b,
|
|
511
511
|
img: x,
|
|
512
512
|
highlighted: X,
|
|
513
513
|
items: P,
|
|
514
514
|
selected: B,
|
|
515
515
|
disabled: M,
|
|
516
516
|
powerFeature: T,
|
|
517
|
-
active:
|
|
517
|
+
active: O,
|
|
518
518
|
reserveActiveSlot: E,
|
|
519
519
|
endActions: F,
|
|
520
520
|
isLink: D,
|
|
521
|
-
onClick: (o) => $ ? R(o) : P.length ? q(o, k, P) :
|
|
521
|
+
onClick: (o) => $ ? R(o) : P.length ? q(o, k, P) : i(o, _, D, V),
|
|
522
522
|
onKeyDown: (o) => {
|
|
523
|
-
o.key === "Enter" && ($ ? R(o) : P.length ? q(o, k, P) :
|
|
523
|
+
o.key === "Enter" && ($ ? R(o) : P.length ? q(o, k, P) : i(o, _, D));
|
|
524
524
|
const H = !o.target.nextSibling;
|
|
525
|
-
o.key === "Tab" && H && !o.shiftKey && (o.preventDefault(), o.stopPropagation(), N.current?.querySelectorAll("li, button")[0]?.focus()), o.key === "Escape" &&
|
|
525
|
+
o.key === "Tab" && H && !o.shiftKey && (o.preventDefault(), o.stopPropagation(), N.current?.querySelectorAll("li, button")[0]?.focus()), o.key === "Escape" && f && t && (o.preventDefault(), o.stopPropagation(), t.focus(), m?.(k));
|
|
526
526
|
},
|
|
527
|
-
style: { paddingRight: P.length ? "0" : "16px", ...
|
|
528
|
-
ref: (o) =>
|
|
527
|
+
style: { paddingRight: P.length ? "0" : "16px", ...s },
|
|
528
|
+
ref: (o) => y.current[k] = o,
|
|
529
529
|
onMouseEnter: (o) => q(o, k, P),
|
|
530
530
|
onMouseLeave: (o) => q(o, k, []),
|
|
531
|
-
className: `${e} ${
|
|
532
|
-
...
|
|
533
|
-
children: !!P.length && /* @__PURE__ */
|
|
531
|
+
className: `${e} ${I.className || ""}`,
|
|
532
|
+
...I,
|
|
533
|
+
children: !!P.length && /* @__PURE__ */ u(K, { icon: "arrow_right", style: { marginLeft: "auto" } })
|
|
534
534
|
},
|
|
535
535
|
`${k}-${C}`
|
|
536
536
|
);
|
|
@@ -538,219 +538,222 @@ const ae = ({
|
|
|
538
538
|
}
|
|
539
539
|
);
|
|
540
540
|
};
|
|
541
|
-
function
|
|
542
|
-
if (!
|
|
543
|
-
const
|
|
544
|
-
let h =
|
|
541
|
+
function qe(a, i, r = "right") {
|
|
542
|
+
if (!a) return null;
|
|
543
|
+
const n = a.getBoundingClientRect(), f = i?.getBoundingClientRect(), p = f?.width || 200, l = f?.height || 300, t = 8, g = window.innerWidth, c = window.innerHeight;
|
|
544
|
+
let h = n.bottom + 8 - z, m;
|
|
545
545
|
const L = U - z;
|
|
546
|
-
if (h + z +
|
|
547
|
-
const e =
|
|
546
|
+
if (h + z + l > c - t) {
|
|
547
|
+
const e = n.top - 8 - l - z;
|
|
548
548
|
e >= L && (h = e);
|
|
549
549
|
}
|
|
550
550
|
if (h = Math.max(L, h), r === "right") {
|
|
551
|
-
const e =
|
|
552
|
-
e >= t ?
|
|
551
|
+
const e = n.right - p;
|
|
552
|
+
e >= t ? m = e : m = n.left;
|
|
553
553
|
} else {
|
|
554
|
-
const e =
|
|
555
|
-
e +
|
|
554
|
+
const e = n.left;
|
|
555
|
+
e + p <= g - t ? m = e : m = n.right - p;
|
|
556
556
|
}
|
|
557
|
-
return
|
|
557
|
+
return m !== void 0 && (m = Math.max(t, Math.min(m, g - p - t))), { top: h, left: m, maxHeight: c - (h + z) - t };
|
|
558
558
|
}
|
|
559
|
-
function
|
|
560
|
-
const [
|
|
561
|
-
let t =
|
|
562
|
-
if (!t &&
|
|
563
|
-
|
|
559
|
+
function Ve(a, i, r = "right") {
|
|
560
|
+
const [n, f] = ce(null), p = oe(null), l = Ee(() => {
|
|
561
|
+
let t = a;
|
|
562
|
+
if (!t && i && (t = document.getElementById(i)), !t) {
|
|
563
|
+
i && console.warn(`Target element with id '${i}' not found`);
|
|
564
564
|
return;
|
|
565
565
|
}
|
|
566
|
-
if (!
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
(
|
|
566
|
+
if (!p.current) return;
|
|
567
|
+
const g = qe(t, p.current, r);
|
|
568
|
+
g && f(
|
|
569
|
+
(c) => c && Math.abs(c.top - g.top) < 1 && Math.abs((c.left ?? 0) - (g.left ?? 0)) < 1 && Math.abs((c.maxHeight ?? 0) - (g.maxHeight ?? 0)) < 1 ? c : g
|
|
570
570
|
);
|
|
571
|
-
}, [
|
|
572
|
-
return
|
|
573
|
-
|
|
574
|
-
}, [
|
|
575
|
-
const t = () => requestAnimationFrame(
|
|
571
|
+
}, [a, i, r]);
|
|
572
|
+
return le(() => {
|
|
573
|
+
l();
|
|
574
|
+
}, [l]), Y(() => {
|
|
575
|
+
const t = () => requestAnimationFrame(l);
|
|
576
576
|
return window.addEventListener("resize", t, { passive: !0 }), window.addEventListener("scroll", t, { passive: !0 }), () => {
|
|
577
577
|
window.removeEventListener("resize", t), window.removeEventListener("scroll", t);
|
|
578
578
|
};
|
|
579
|
-
}, [
|
|
580
|
-
if (!
|
|
579
|
+
}, [l]), Y(() => {
|
|
580
|
+
if (!p.current) return;
|
|
581
581
|
const t = new ResizeObserver(() => {
|
|
582
|
-
|
|
582
|
+
l();
|
|
583
583
|
});
|
|
584
|
-
return t.observe(
|
|
584
|
+
return t.observe(p.current), () => {
|
|
585
585
|
t.disconnect();
|
|
586
586
|
};
|
|
587
|
-
}, [
|
|
587
|
+
}, [l]), { position: n, menuRef: p };
|
|
588
588
|
}
|
|
589
|
-
const
|
|
590
|
-
id:
|
|
591
|
-
target:
|
|
589
|
+
const je = "ayon-menu-dialog", me = "ayon-menu-content", ht = ({
|
|
590
|
+
id: a,
|
|
591
|
+
target: i,
|
|
592
592
|
targetId: r = "",
|
|
593
|
-
align:
|
|
594
|
-
theme:
|
|
595
|
-
|
|
596
|
-
|
|
593
|
+
align: n = "right",
|
|
594
|
+
theme: f = "light",
|
|
595
|
+
isOpen: p,
|
|
596
|
+
onDismiss: l,
|
|
597
|
+
children: t,
|
|
598
|
+
...g
|
|
597
599
|
}) => {
|
|
598
|
-
const { menuOpen:
|
|
599
|
-
|
|
600
|
-
},
|
|
601
|
-
console.log("navigate and close"),
|
|
600
|
+
const { menuOpen: c, setMenuOpen: h, navigate: m } = pe(), L = p ?? c === a, e = () => {
|
|
601
|
+
p !== void 0 ? l?.() : h(!1);
|
|
602
|
+
}, s = (d) => {
|
|
603
|
+
console.log("navigate and close"), e(), !m && d ? console.log("navigate not found") : m && d && m(d);
|
|
602
604
|
};
|
|
603
|
-
return
|
|
605
|
+
return L ? /* @__PURE__ */ u(
|
|
604
606
|
Ge,
|
|
605
607
|
{
|
|
606
|
-
handleClose:
|
|
607
|
-
handleNavigate:
|
|
608
|
-
target:
|
|
608
|
+
handleClose: e,
|
|
609
|
+
handleNavigate: s,
|
|
610
|
+
target: i,
|
|
609
611
|
targetId: r,
|
|
610
|
-
align:
|
|
611
|
-
theme:
|
|
612
|
-
children:
|
|
613
|
-
...
|
|
612
|
+
align: n,
|
|
613
|
+
theme: f,
|
|
614
|
+
children: t,
|
|
615
|
+
...g
|
|
614
616
|
}
|
|
615
617
|
) : null;
|
|
616
618
|
}, Ge = ({
|
|
617
|
-
handleClose:
|
|
618
|
-
handleNavigate:
|
|
619
|
+
handleClose: a,
|
|
620
|
+
handleNavigate: i,
|
|
619
621
|
target: r,
|
|
620
|
-
targetId:
|
|
621
|
-
align:
|
|
622
|
-
children:
|
|
623
|
-
...
|
|
622
|
+
targetId: n,
|
|
623
|
+
align: f = "right",
|
|
624
|
+
children: p,
|
|
625
|
+
...l
|
|
624
626
|
}) => {
|
|
625
|
-
const { position: t, menuRef:
|
|
627
|
+
const { position: t, menuRef: g } = Ve(r ?? null, n ?? "", f);
|
|
626
628
|
Y(() => {
|
|
627
|
-
t &&
|
|
629
|
+
t && g.current && g.current.querySelectorAll("li, button")[0]?.focus();
|
|
628
630
|
}, [t]);
|
|
629
|
-
const
|
|
630
|
-
e.key
|
|
631
|
+
const c = (e) => {
|
|
632
|
+
if (e.key !== "Escape") return;
|
|
633
|
+
e.preventDefault(), e.stopPropagation(), a(), (r ?? (n ? document.getElementById(n) : null))?.focus();
|
|
631
634
|
}, h = (e) => {
|
|
632
|
-
e.target
|
|
633
|
-
},
|
|
634
|
-
onClose:
|
|
635
|
-
index:
|
|
636
|
-
navigate:
|
|
635
|
+
e.target === e.currentTarget && a();
|
|
636
|
+
}, m = te.Children.map(p, (e, s) => te.isValidElement(e) ? te.cloneElement(e, {
|
|
637
|
+
onClose: a,
|
|
638
|
+
index: s,
|
|
639
|
+
navigate: i
|
|
637
640
|
}) : e);
|
|
638
|
-
return
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
-
|
|
641
|
+
return Se(
|
|
642
|
+
/* @__PURE__ */ u(
|
|
643
|
+
Ae,
|
|
641
644
|
{
|
|
642
645
|
open: !0,
|
|
643
646
|
onClick: h,
|
|
644
|
-
onKeyDown:
|
|
645
|
-
...
|
|
646
|
-
id:
|
|
647
|
-
children: /* @__PURE__ */
|
|
647
|
+
onKeyDown: c,
|
|
648
|
+
...l,
|
|
649
|
+
id: je,
|
|
650
|
+
children: /* @__PURE__ */ u(
|
|
648
651
|
Oe,
|
|
649
652
|
{
|
|
650
|
-
id:
|
|
653
|
+
id: me,
|
|
651
654
|
style: t || { top: 0, left: 0, opacity: 0, visibility: "hidden" },
|
|
652
|
-
className: fe(
|
|
653
|
-
ref:
|
|
654
|
-
children:
|
|
655
|
+
className: fe(f),
|
|
656
|
+
ref: g,
|
|
657
|
+
children: m
|
|
655
658
|
}
|
|
656
659
|
)
|
|
657
660
|
}
|
|
658
661
|
),
|
|
659
662
|
document.body
|
|
660
663
|
);
|
|
661
|
-
},
|
|
662
|
-
for (const r of
|
|
663
|
-
if (r.id ===
|
|
664
|
-
const
|
|
665
|
-
if (
|
|
664
|
+
}, ge = (a, i) => {
|
|
665
|
+
for (const r of a) {
|
|
666
|
+
if (r.id === i) return r.items?.length ? r.items : void 0;
|
|
667
|
+
const n = r.items?.length ? ge(r.items, i) : void 0;
|
|
668
|
+
if (n) return n;
|
|
666
669
|
}
|
|
667
|
-
}, Ke = (
|
|
668
|
-
(r,
|
|
669
|
-
), vt = ({ menu:
|
|
670
|
-
const { setPowerpackDialog:
|
|
671
|
-
if (
|
|
672
|
-
|
|
673
|
-
},
|
|
674
|
-
if (
|
|
675
|
-
if (!
|
|
676
|
-
const
|
|
670
|
+
}, Ke = (a = [], i = []) => a.length === i.length && a.every((r, n) => r.icon === i[n].icon && r.tooltip === i[n].tooltip), Ue = (a, i) => a.length === i.length && a.every(
|
|
671
|
+
(r, n) => r.id === i[n].id && r.icon === i[n].icon && r.selected === i[n].selected && r.active === i[n].active && Ke(r.endActions, i[n].endActions)
|
|
672
|
+
), vt = ({ menu: a = [], onClose: i, header: r, footer: n = "" }) => {
|
|
673
|
+
const { setPowerpackDialog: f } = ne(), { setMenuOpen: p } = pe(), [l, t] = ce([]), g = (e, s, d, w) => {
|
|
674
|
+
if (d) return i?.();
|
|
675
|
+
s?.(e), !w && i && i();
|
|
676
|
+
}, c = (e, s) => {
|
|
677
|
+
if (s.items.length) {
|
|
678
|
+
if (!l.find((d) => d.id === s.id)) {
|
|
679
|
+
const d = s.parentEl ?? e.currentTarget ?? e.target;
|
|
677
680
|
t([
|
|
678
|
-
...
|
|
681
|
+
...l.filter((w) => w.level < (s.level || 0) + 1),
|
|
679
682
|
{
|
|
680
|
-
...
|
|
681
|
-
id:
|
|
682
|
-
level: (
|
|
683
|
-
parentRef:
|
|
683
|
+
...s,
|
|
684
|
+
id: s.id,
|
|
685
|
+
level: (s.level || 0) + 1,
|
|
686
|
+
parentRef: d
|
|
684
687
|
}
|
|
685
688
|
]);
|
|
686
689
|
}
|
|
687
690
|
} else
|
|
688
|
-
t(
|
|
689
|
-
}, h = (e,
|
|
690
|
-
const
|
|
691
|
-
if (!
|
|
692
|
-
if (
|
|
693
|
-
typeof
|
|
694
|
-
},
|
|
695
|
-
e.type === "mouseenter" || e.type === "keydown" ?
|
|
691
|
+
t(l.filter((d) => d.level <= (s.level || 0)));
|
|
692
|
+
}, h = (e, s = {}) => {
|
|
693
|
+
const d = e.relatedTarget;
|
|
694
|
+
if (!d) return;
|
|
695
|
+
if (d.tagName === "DIALOG") return t([]);
|
|
696
|
+
typeof d.closest == "function" && d.closest(`#${me}`) || l.find((y) => y.id === d.id) || t(l.filter((y) => y.level <= (s.level || 0) + 1));
|
|
697
|
+
}, m = (e, s) => {
|
|
698
|
+
e.type === "mouseenter" || e.type === "keydown" ? c(e, s) : e.type === "mouseleave" && h(e, s);
|
|
696
699
|
};
|
|
697
700
|
Y(() => {
|
|
698
701
|
t((e) => {
|
|
699
702
|
if (!e.length) return e;
|
|
700
|
-
const
|
|
701
|
-
const
|
|
702
|
-
return
|
|
703
|
+
const s = e.flatMap((w) => {
|
|
704
|
+
const y = ge(a, w.id);
|
|
705
|
+
return y ? [{ ...w, items: y }] : [];
|
|
703
706
|
});
|
|
704
|
-
return
|
|
707
|
+
return s.length === e.length && s.every((w, y) => Ue(w.items, e[y].items)) ? e : s;
|
|
705
708
|
});
|
|
706
|
-
}, [
|
|
707
|
-
const L = (e,
|
|
708
|
-
t((w) => w.map((
|
|
709
|
+
}, [a]);
|
|
710
|
+
const L = (e, s, d) => {
|
|
711
|
+
t((w) => w.map((y) => y.id === e ? { ...y, style: s, placement: d } : y));
|
|
709
712
|
};
|
|
710
|
-
return /* @__PURE__ */ Q(
|
|
711
|
-
/* @__PURE__ */ Q(
|
|
713
|
+
return /* @__PURE__ */ Q(Me, { children: [
|
|
714
|
+
/* @__PURE__ */ Q(Ie, { children: [
|
|
712
715
|
r && r,
|
|
713
|
-
/* @__PURE__ */
|
|
716
|
+
/* @__PURE__ */ u(
|
|
714
717
|
ae,
|
|
715
718
|
{
|
|
716
|
-
items:
|
|
717
|
-
handleClick:
|
|
718
|
-
onSubMenu:
|
|
719
|
+
items: a,
|
|
720
|
+
handleClick: g,
|
|
721
|
+
onSubMenu: m,
|
|
719
722
|
level: 0,
|
|
720
|
-
setPowerpackDialog:
|
|
721
|
-
onMenuClose: () =>
|
|
723
|
+
setPowerpackDialog: f,
|
|
724
|
+
onMenuClose: () => p(!1)
|
|
722
725
|
}
|
|
723
726
|
),
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
+
n && /* @__PURE__ */ Q(ze, { children: [
|
|
728
|
+
n,
|
|
729
|
+
/* @__PURE__ */ u(de, { icon: "content_copy", variant: "text", onClick: () => Te(n) })
|
|
727
730
|
] })
|
|
728
731
|
] }),
|
|
729
|
-
|
|
732
|
+
l.map((e, s) => /* @__PURE__ */ u(
|
|
730
733
|
ae,
|
|
731
734
|
{
|
|
732
735
|
...e,
|
|
733
736
|
parentRef: e.parentRef || null,
|
|
734
737
|
style: e.style || {},
|
|
735
|
-
handleClick:
|
|
738
|
+
handleClick: g,
|
|
736
739
|
subMenu: !0,
|
|
737
|
-
onSubMenu:
|
|
740
|
+
onSubMenu: m,
|
|
738
741
|
onSubMenuLayout: L,
|
|
739
|
-
onClose: () => t(
|
|
740
|
-
onMenuClose: () =>
|
|
741
|
-
onChange:
|
|
742
|
-
setPowerpackDialog:
|
|
742
|
+
onClose: () => t(l.filter((d) => d.id !== e.id)),
|
|
743
|
+
onMenuClose: () => p(!1),
|
|
744
|
+
onChange: c,
|
|
745
|
+
setPowerpackDialog: f,
|
|
743
746
|
itemClassName: void 0,
|
|
744
747
|
itemStyle: void 0
|
|
745
748
|
},
|
|
746
|
-
|
|
749
|
+
s
|
|
747
750
|
))
|
|
748
751
|
] });
|
|
749
752
|
};
|
|
750
753
|
export {
|
|
751
754
|
ht as M,
|
|
752
755
|
vt as a,
|
|
753
|
-
|
|
754
|
-
|
|
756
|
+
me as b,
|
|
757
|
+
je as c,
|
|
755
758
|
ae as d
|
|
756
759
|
};
|