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