@ynput/ayon-frontend-shared 0.6.0 → 0.6.1

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 (89) hide show
  1. package/dist/ContextMenu.es.js +34 -16
  2. package/dist/DetailsPanel.es.js +292 -298
  3. package/dist/Feed.es.js +179 -50
  4. package/dist/ListTable.es.js +32 -35
  5. package/dist/NewEntity.es.js +1256 -11
  6. package/dist/ProjectTreeTable.es.js +4451 -2965
  7. package/dist/SimpleTable.es.js +8 -7
  8. package/dist/Slicer.es.js +451 -147
  9. package/dist/Views.es.js +918 -310
  10. package/dist/chunks/Actions.es.js +9 -4
  11. package/dist/chunks/ColumnDropIndicator.es.js +174 -328
  12. package/dist/chunks/ColumnDropIndicator.styled.es.js +281 -0
  13. package/dist/chunks/ColumnHeaderMenuUI.es.js +52 -0
  14. package/dist/chunks/ContextMenuContextInstance.es.js +12 -0
  15. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +229 -0
  16. package/dist/chunks/DeleteEntitiesContextInstance.es.js +827 -0
  17. package/dist/chunks/EmptyPlaceholder.es.js +4 -4
  18. package/dist/chunks/EntityPath.es.js +58 -53
  19. package/dist/chunks/EntityPickerDialog.es.js +24 -20
  20. package/dist/chunks/EntityTooltip.es.js +20 -13
  21. package/dist/chunks/EntityUpdatesContext.es.js +38 -96
  22. package/dist/chunks/Feed.es.js +1495 -1439
  23. package/dist/chunks/FilterErrorActions.es.js +25 -229
  24. package/dist/chunks/Menu.es.js +21 -17
  25. package/dist/chunks/MenuContext.es.js +14 -65
  26. package/dist/chunks/MenuItem.es.js +34 -24
  27. package/dist/chunks/MetaWidget.es.js +2835 -4301
  28. package/dist/chunks/NewEntityContextInstance.es.js +11 -0
  29. package/dist/chunks/PlayableIcon.es.js +1532 -1594
  30. package/dist/chunks/ProjectContext.es.js +102 -66
  31. package/dist/chunks/RepresentationsList.es.js +1 -1
  32. package/dist/chunks/ReviewablesSelector.es.js +457 -458
  33. package/dist/chunks/SimpleForm.es.js +9 -9
  34. package/dist/chunks/SimpleTable.es.js +15 -13
  35. package/dist/chunks/Slicer.es.js +163 -154
  36. package/dist/chunks/TableSettingsFallback.es.js +25 -13
  37. package/dist/chunks/ThumbnailSimple.es.js +150 -261
  38. package/dist/chunks/VersionUploadContextInstance.es.js +12 -0
  39. package/dist/chunks/VideoPlayer.es.js +24 -28
  40. package/dist/chunks/Watchers.es.js +384 -389
  41. package/dist/chunks/entityDefinitions.es.js +2 -350
  42. package/dist/chunks/extractVersionFromFilename.es.js +28 -0
  43. package/dist/chunks/getBundleMode.es.js +61 -16
  44. package/dist/chunks/getUris.es.js +737 -712
  45. package/dist/chunks/searchTerms.es.js +57 -56
  46. package/dist/chunks/useAttributeEnums.es.js +4 -4
  47. package/dist/chunks/useCreateContextMenu.es.js +66 -90
  48. package/dist/chunks/useHierarchySelection.es.js +24 -0
  49. package/dist/chunks/useLoadModule.es.js +74 -0
  50. package/dist/chunks/useQueryArgumentChangeLoading.es.js +11 -0
  51. package/dist/chunks/versionUploadHelpers.es.js +16 -42
  52. package/dist/chunks/viewUpdateHelper.es.js +67 -50
  53. package/dist/components.es.js +1425 -999
  54. package/dist/context.es.js +791 -80
  55. package/dist/hooks.es.js +115 -120
  56. package/dist/index.es.js +19 -23
  57. package/dist/types/Actions.d.ts +7 -7
  58. package/dist/types/ContextMenu.d.ts +11 -8
  59. package/dist/types/DetailsPanel.d.ts +102 -9
  60. package/dist/types/EntityPickerDialog.d.ts +7 -7
  61. package/dist/types/Feed.d.ts +11 -8
  62. package/dist/types/ListTable.d.ts +7 -7
  63. package/dist/types/NewEntity.d.ts +16 -10
  64. package/dist/types/ProjectTreeTable.d.ts +22 -115
  65. package/dist/types/RepresentationsList.d.ts +7 -7
  66. package/dist/types/SimpleTable.d.ts +11 -8
  67. package/dist/types/Slicer.d.ts +10 -7
  68. package/dist/types/Views.d.ts +10 -7
  69. package/dist/types/api.d.ts +132 -120
  70. package/dist/types/components.d.ts +13 -8
  71. package/dist/types/context.d.ts +56 -16
  72. package/dist/types/hooks.d.ts +7 -7
  73. package/dist/types/index.d.ts +7 -7
  74. package/dist/types/util.d.ts +12 -7
  75. package/dist/util.es.js +72 -71
  76. package/package.json +1 -1
  77. package/dist/chunks/DeleteEntitiesContext.es.js +0 -748
  78. package/dist/chunks/DetailsPanelContext.es.js +0 -155
  79. package/dist/chunks/GlobalContext.es.js +0 -52
  80. package/dist/chunks/NewEntityContext.es.js +0 -1242
  81. package/dist/chunks/ProjectFoldersContext.es.js +0 -134
  82. package/dist/chunks/ProjectFoldersContextInstance.es.js +0 -7
  83. package/dist/chunks/VersionUploadContext.es.js +0 -232
  84. package/dist/chunks/ViewsContext.es.js +0 -878
  85. package/dist/chunks/uriUtils.es.js +0 -48
  86. package/dist/chunks/useColumnDragRestriction.es.js +0 -158
  87. package/dist/chunks/useLocalStorage.es.js +0 -355
  88. package/dist/chunks/useSessionStorage.es.js +0 -61
  89. /package/dist/{useCreateContextMenu.css → ContextMenuContextInstance.css} +0 -0
@@ -0,0 +1,281 @@
1
+ import { createContext as _, useContext as u, forwardRef as I } from "react";
2
+ import { jsxs as l, jsx as i, Fragment as S } from "react/jsx-runtime";
3
+ import { Button as p, Icon as z } from "@ynput/ayon-react-components";
4
+ import a from "clsx";
5
+ import n from "styled-components";
6
+ import { R as d, D as f } from "./realtimeUpdatesUtils.es.js";
7
+ import "lodash";
8
+ import "primereact/confirmdialog";
9
+ import "react-toastify";
10
+ import { c as N } from "./copyToClipboard.es.js";
11
+ import "uuid";
12
+ import "./searchTerms.es.js";
13
+ const D = (t) => {
14
+ const o = t.getIsPinned(), s = t.id !== d && t.id !== f ? -30 : 0;
15
+ return {
16
+ left: o === "left" ? `${t.getStart("left") + s}px` : void 0,
17
+ right: o === "right" ? `${t.getAfter("right")}px` : void 0,
18
+ position: o ? "sticky" : "relative",
19
+ width: t.getSize(),
20
+ zIndex: o ? 100 : 0
21
+ };
22
+ }, E = (t) => `calc(var(--col-${t}-size) * 1px)`, g = _(void 0), Q = () => {
23
+ const t = u(g);
24
+ if (!t)
25
+ throw new Error("useFeedback must be used within a FeedbackProvider");
26
+ return t;
27
+ }, X = () => u(g), Y = I(({ ...t }, o) => /* @__PURE__ */ l(
28
+ "svg",
29
+ {
30
+ width: "25",
31
+ height: "22",
32
+ viewBox: "0 0 25 22",
33
+ fill: "none",
34
+ xmlns: "http://www.w3.org/2000/svg",
35
+ ...t,
36
+ ref: o,
37
+ children: [
38
+ /* @__PURE__ */ i(
39
+ "path",
40
+ {
41
+ d: "M0.938178 10.6543C0.816721 5.48877 5.1207 1.23771 10.4975 1.11128C15.8743 0.98486 20.3734 5.02894 20.4948 10.1945C20.6163 15.36 16.3122 19.6111 10.9354 19.7376C9.75118 19.7654 8.61022 19.5914 7.5495 19.2479C7.33438 19.1783 7.0983 19.1794 6.88174 19.2638L5.242 19.9017C4.31715 20.2614 3.35776 19.4629 3.54364 18.4881L3.72118 17.557C3.78241 17.2359 3.67515 16.9129 3.45681 16.6832C1.94083 15.0885 0.992941 12.9834 0.938178 10.6543Z",
42
+ stroke: "white",
43
+ strokeWidth: "1.5"
44
+ }
45
+ ),
46
+ /* @__PURE__ */ i(
47
+ "path",
48
+ {
49
+ d: "M15.3853 4.70168C19.9873 4.59348 23.892 8.06066 23.9977 12.5556C24.0445 14.5475 23.3301 16.3832 22.121 17.8111C22.0428 17.9034 22.0185 18.0146 22.041 18.108L22.2908 19.1496C22.5495 20.2281 21.5204 21.1699 20.469 20.8169L18.8159 20.2617C18.7509 20.2398 18.6726 20.2401 18.5934 20.2693C17.7115 20.5946 16.7586 20.7823 15.764 20.8057C11.1621 20.9139 7.2573 17.4467 7.1516 12.9517C7.04592 8.45675 10.7834 4.80988 15.3853 4.70168Z",
50
+ fill: "white",
51
+ stroke: "#1C2026",
52
+ strokeWidth: "1.5"
53
+ }
54
+ ),
55
+ /* @__PURE__ */ i(
56
+ "path",
57
+ {
58
+ d: "M20.1373 12.6133C19.942 15.1992 17.8037 17.2074 15.2107 17.2402L14.7621 17.2459",
59
+ stroke: "#232323",
60
+ strokeWidth: "1.5",
61
+ strokeLinecap: "round"
62
+ }
63
+ )
64
+ ]
65
+ }
66
+ )), M = n(p)`
67
+ width: 24px;
68
+ height: 24px;
69
+ padding: 2px;
70
+
71
+ &.action {
72
+ padding: 0px;
73
+ display: flex;
74
+ background-color: unset;
75
+ }
76
+
77
+ &:hover {
78
+ background-color: var(--md-sys-color-surface-container-hover) !important;
79
+ }
80
+
81
+ &.pin-button .material-symbols-outlined.icon {
82
+ font-variation-settings: 'FILL' 1, 'wght' 200, 'GRAD' 200, 'opsz' 10;
83
+ }
84
+
85
+ &.selected {
86
+ display: flex !important;
87
+ }
88
+ `, tt = ({ selected: t, style: o, ...s }) => /* @__PURE__ */ i(
89
+ M,
90
+ {
91
+ ...s,
92
+ selected: t,
93
+ className: a(s.className, "action", { selected: t }),
94
+ variant: "text",
95
+ style: { ...o }
96
+ }
97
+ ), ot = n(p)`
98
+ background-color: unset !important;
99
+ z-index: 110;
100
+ position: relative;
101
+ padding: 2px;
102
+ width: 24px;
103
+ height: 24px;
104
+
105
+ &.hasIcon {
106
+ padding: 2px;
107
+ }
108
+
109
+ &:hover,
110
+ &.active {
111
+ background-color: var(--md-sys-color-surface-container-hover) !important;
112
+ }
113
+
114
+ ${({ $isOpen: t }) => t && `
115
+ background-color: var(--md-sys-color-surface-container-hover) !important;
116
+ `}
117
+ `, R = n.tfoot`
118
+ display: grid !important;
119
+ position: sticky;
120
+ bottom: 0;
121
+ z-index: 10;
122
+ background-color: var(--md-sys-color-surface-container-lowest);
123
+ `, A = n.tr`
124
+ display: flex;
125
+ background-color: var(--md-sys-color-surface-container-low);
126
+
127
+ &.clickable {
128
+ cursor: pointer;
129
+ }
130
+ `, B = n.td`
131
+ position: relative;
132
+ box-shadow: inset 1px 1px 0 0 var(--md-sys-color-surface-container);
133
+ background-color: var(--md-sys-color-surface-container-lowest);
134
+ display: flex;
135
+ align-items: center;
136
+ height: 34px !important;
137
+ padding: 0 !important;
138
+ overflow: visible;
139
+
140
+ &.last-pinned-left {
141
+ box-shadow: inset 1px 1px 0 0 var(--md-sys-color-surface-container),
142
+ inset -2px 0 0 0 var(--md-sys-color-surface-container);
143
+ }
144
+
145
+ /* match the special fixed widths used by header/body cells */
146
+ &.__row_selection__ {
147
+ width: 20px !important;
148
+ min-width: unset;
149
+ }
150
+ &.drag-handle {
151
+ width: 24px !important;
152
+ min-width: unset;
153
+ }
154
+ `, P = n.div`
155
+ display: flex;
156
+ align-items: center;
157
+ gap: var(--base-gap-small);
158
+ width: 100%;
159
+ height: 100%;
160
+ padding: 0 8px;
161
+ overflow: hidden;
162
+ white-space: nowrap;
163
+ font-size: 14px;
164
+ color: var(--md-sys-color-on-surface-variant);
165
+
166
+ .label {
167
+ color: var(--md-sys-color-outline);
168
+ }
169
+ .value {
170
+ font-weight: 600;
171
+ color: var(--md-sys-color-on-surface);
172
+ }
173
+ `, x = n.div`
174
+ width: calc(100% - 1px);
175
+ height: calc(100% - 3px);
176
+ margin-left: 1px;
177
+
178
+ &.selection {
179
+ width: calc(100% - 3px);
180
+ margin-left: 1px;
181
+ }
182
+ `, O = n(x)`
183
+ position: absolute;
184
+ inset: 1px 0 2px 1px;
185
+ width: auto;
186
+ height: auto;
187
+ margin: 0;
188
+ pointer-events: none;
189
+ `, et = ({
190
+ columnVirtualizer: t,
191
+ table: o,
192
+ virtualPaddingLeft: s,
193
+ virtualPaddingRight: m,
194
+ renderCellContent: v,
195
+ onClick: c,
196
+ isLoading: w,
197
+ statsLoading: y,
198
+ error: r
199
+ }) => {
200
+ const C = [
201
+ ...o.getLeftVisibleLeafColumns(),
202
+ ...o.getCenterVisibleLeafColumns(),
203
+ ...o.getRightVisibleLeafColumns()
204
+ ], b = t.getVirtualItems(), h = r instanceof Error ? r.message : typeof r == "string" ? r : "";
205
+ return /* @__PURE__ */ i(R, { children: /* @__PURE__ */ l(
206
+ A,
207
+ {
208
+ className: a({ clickable: !!c }),
209
+ onClick: c,
210
+ "data-tooltip": c ? "Power feature" : void 0,
211
+ children: [
212
+ s ? /* @__PURE__ */ i("td", { style: { display: "flex", width: s } }) : null,
213
+ b.map((k) => {
214
+ const e = C[k.index];
215
+ if (!e) return null;
216
+ const L = e.id === f || e.id === d, F = e.getIsPinned() === "left" && e.getIsLastColumn("left");
217
+ return /* @__PURE__ */ i(
218
+ B,
219
+ {
220
+ className: a(e.id, { "last-pinned-left": F }),
221
+ style: { ...D(e), width: E(e.id) },
222
+ children: w ? /* @__PURE__ */ i(
223
+ x,
224
+ {
225
+ className: a("loading", "shimmer-dark", {
226
+ selection: e.id === d
227
+ })
228
+ }
229
+ ) : r ? e.id === "name" ? /* @__PURE__ */ l(P, { style: { color: "var(--md-sys-color-error)" }, children: [
230
+ "Error loading stats",
231
+ /* @__PURE__ */ i(
232
+ z,
233
+ {
234
+ icon: "info",
235
+ style: { fontSize: 16, cursor: "help" },
236
+ "data-tooltip": h,
237
+ "data-tooltip-as": "markdown"
238
+ }
239
+ ),
240
+ /* @__PURE__ */ i(
241
+ p,
242
+ {
243
+ icon: "content_copy",
244
+ "data-tooltip": "Copy error message",
245
+ onClick: () => N(h),
246
+ iconProps: { style: { fontSize: 16 } },
247
+ style: { padding: 2 },
248
+ variant: "text"
249
+ }
250
+ )
251
+ ] }) : null : !L && /* @__PURE__ */ l(S, { children: [
252
+ v?.(e.id),
253
+ y && /* @__PURE__ */ i(O, { className: a("loading", "shimmer-dark") })
254
+ ] })
255
+ },
256
+ e.id
257
+ );
258
+ }),
259
+ m ? /* @__PURE__ */ i("td", { style: { display: "flex", width: m } }) : null
260
+ ]
261
+ }
262
+ ) });
263
+ }, it = n.div`
264
+ position: fixed;
265
+ z-index: 2000;
266
+ pointer-events: none;
267
+ width: 2px;
268
+ background-color: var(--md-sys-color-primary);
269
+ `;
270
+ export {
271
+ ot as C,
272
+ g as F,
273
+ tt as H,
274
+ Y as S,
275
+ et as T,
276
+ it as a,
277
+ Q as b,
278
+ D as c,
279
+ E as g,
280
+ X as u
281
+ };
@@ -0,0 +1,52 @@
1
+ import { jsxs as a, Fragment as l, jsx as n } from "react/jsx-runtime";
2
+ import { useRef as u } from "react";
3
+ import "@module-federation/enhanced/runtime";
4
+ import "./searchTerms.es.js";
5
+ import "./getUris.es.js";
6
+ import "primereact/confirmdialog";
7
+ import { u as f } from "./DeleteEntitiesContextInstance.es.js";
8
+ import "lodash";
9
+ import "react-toastify";
10
+ import "uuid";
11
+ import "semver";
12
+ import "@ynput/ayon-react-components";
13
+ import "./ContextMenuContextInstance.es.js";
14
+ import "clsx";
15
+ import "react-dom";
16
+ import "react-redux";
17
+ import { M as c, a as g } from "./Menu.es.js";
18
+ import "./MenuItem.es.js";
19
+ import { C } from "./ColumnDropIndicator.styled.es.js";
20
+ const q = ({ menuItems: e, menuId: t, className: p }) => {
21
+ const { toggleMenuOpen: r, menuOpen: m } = f(), i = u(null), s = m === t;
22
+ return e.length === 0 ? null : /* @__PURE__ */ a(l, { children: [
23
+ /* @__PURE__ */ n(
24
+ C,
25
+ {
26
+ ref: i,
27
+ className: p,
28
+ onClick: (o) => {
29
+ o.stopPropagation(), r(t);
30
+ },
31
+ onPointerDown: (o) => o.stopPropagation(),
32
+ icon: "more_horiz",
33
+ $isOpen: s
34
+ }
35
+ ),
36
+ /* @__PURE__ */ n(
37
+ c,
38
+ {
39
+ target: i.current,
40
+ id: t,
41
+ align: "left",
42
+ onClose: (o) => {
43
+ o.stopPropagation(), r(!1);
44
+ },
45
+ children: /* @__PURE__ */ n(g, { menu: e, onClose: () => r(!1) })
46
+ }
47
+ )
48
+ ] });
49
+ };
50
+ export {
51
+ q as C
52
+ };
@@ -0,0 +1,12 @@
1
+ import { createContext as e, useContext as n } from "react";
2
+ const o = e(void 0);
3
+ function u() {
4
+ const t = n(o);
5
+ if (t === void 0)
6
+ throw new Error("useContextMenu must be used within a ContextMenuProvider");
7
+ return t;
8
+ }
9
+ export {
10
+ o as C,
11
+ u
12
+ };
@@ -0,0 +1,229 @@
1
+ import { jsx as l, jsxs as d, Fragment as k } from "react/jsx-runtime";
2
+ import { useState as A, useMemo as D } from "react";
3
+ import { Button as $ } from "@ynput/ayon-react-components";
4
+ import { S as x, D as O, f as T, F as L, h as E, C as P, i as M, j as R, k as I, l as _ } from "./DeleteEntitiesContextInstance.es.js";
5
+ import "lodash";
6
+ import "primereact/confirmdialog";
7
+ import "react-toastify";
8
+ import "uuid";
9
+ import { p as u } from "./pluralize.es.js";
10
+ import "./searchTerms.es.js";
11
+ const te = [
12
+ "annotations",
13
+ "sharedViews",
14
+ "listFolders",
15
+ "groupAttributes",
16
+ "listAccess",
17
+ "slicer",
18
+ "projectFolders",
19
+ "releases",
20
+ "advancedFilters",
21
+ "listAttributes",
22
+ "commentCategories",
23
+ "columnSummaries"
24
+ ], oe = {
25
+ annotations: {
26
+ label: "Annotations",
27
+ description: "Create detailed visual feedback directly on media files.",
28
+ bullet: "Advanced media review tools"
29
+ },
30
+ projectFolders: {
31
+ label: "Project Folders",
32
+ description: "Organize your projects into folders for a cleaner and more structured view.",
33
+ bullet: "Organize projects into folders"
34
+ },
35
+ sharedViews: {
36
+ label: "Shared Views",
37
+ description: "Save custom views and share them with team members for better collaboration.",
38
+ bullet: "Save and share custom views"
39
+ },
40
+ listFolders: {
41
+ label: "List Folders",
42
+ description: "Organize your lists into folders for a cleaner and more structured view.",
43
+ bullet: "Organize lists into folders"
44
+ },
45
+ groupAttributes: {
46
+ label: "Group Attributes",
47
+ description: "Group tasks by assignees, status, or other attributes for better organization.",
48
+ bullet: "Group tasks by attributes"
49
+ },
50
+ commentCategories: {
51
+ label: "Comment Categories",
52
+ description: "Organize comments with categories, assign permissions, and use colors for better distinction. Set visibility rules to control who can view specific comments.",
53
+ bullet: "Enhanced comment organization, permissions, and visibility"
54
+ },
55
+ slicer: {
56
+ label: "Slicer",
57
+ description: "Advanced filtering system for project organization.",
58
+ bullet: "Powerful project filtering tools"
59
+ },
60
+ releases: {
61
+ label: "Release History",
62
+ description: "Access and download the complete archive of releases",
63
+ bullet: "Full release archive access"
64
+ },
65
+ advancedFilters: {
66
+ label: "Advanced Filters",
67
+ description: "Customize your view and find your data with powerful filtering options",
68
+ bullet: "Advanced filtering options"
69
+ },
70
+ listAttributes: {
71
+ label: "List Attributes",
72
+ description: "Add custom attributes to your lists for better collaboration and organization.",
73
+ bullet: "Custom attributes for lists"
74
+ },
75
+ listAccess: {
76
+ label: "List Access",
77
+ description: "Manage and control access to your lists with advanced sharing options.",
78
+ bullet: "Advanced list sharing options"
79
+ },
80
+ columnSummaries: {
81
+ label: "Column Summaries",
82
+ description: "Aggregate each column totals, averages, distributions in a summary footer.",
83
+ bullet: "Per-column summary footer"
84
+ }
85
+ }, g = [
86
+ "folder",
87
+ "task",
88
+ "product",
89
+ "version",
90
+ "representation",
91
+ "workfile"
92
+ ], G = (o) => o.length <= 1 ? o.join("") : `${o.slice(0, -1).join(", ")} and ${o[o.length - 1]}`, se = (o) => {
93
+ if (o.length === 1) {
94
+ const e = o[0];
95
+ return `${e.entityType} "${e.label || e.name || e.id}"`;
96
+ }
97
+ const r = {};
98
+ for (const e of o) r[e.entityType] = (r[e.entityType] || 0) + 1;
99
+ const a = g.filter((e) => r[e] > 0).map(
100
+ (e) => u(r[e], e)
101
+ );
102
+ return G(a);
103
+ }, ne = (o, r) => {
104
+ const a = {}, e = (s, t) => {
105
+ t > 0 && (a[s] = (a[s] || 0) + t);
106
+ };
107
+ for (const s of o) e(s.entityType, 1);
108
+ for (const s of r)
109
+ e("folder", s.totalFolderCount), e("task", s.totalTaskCount), e("product", s.totalProductCount), e("version", s.totalVersionCount);
110
+ return a;
111
+ }, H = (o) => g.reduce((r, a) => r + (o[a] || 0), 0), C = 8, ie = (o, r) => {
112
+ if (o.length === 0) return [];
113
+ const a = new Map(r.map((t) => [t.id, t])), e = o.length > 1, s = [];
114
+ for (const t of o) {
115
+ const n = a.get(t.id), f = t.label || t.name || t.id, m = e ? `"${f}" contains ` : "Contains ";
116
+ if (n && (n.totalFolderCount > 0 || n.totalTaskCount > 0 || n.totalProductCount > 0 || n.totalVersionCount > 0)) {
117
+ const c = [];
118
+ 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(", ")}`);
119
+ } else
120
+ t.hasChildren && s.push(`${m}child folders`), t.taskNames && t.taskNames.length > 0 && s.push(`${m}${u(t.taskNames.length, "task")}`);
121
+ }
122
+ return s.length > C ? [...s.slice(0, C), `…and ${s.length - C} more`] : s;
123
+ }, q = (o, r) => {
124
+ const a = (o ?? "").trim();
125
+ return a !== "" && Number(a) === r;
126
+ }, re = ({
127
+ payload: o,
128
+ onConfirm: r,
129
+ onCancel: a
130
+ }) => {
131
+ const {
132
+ entityLabel: e,
133
+ childrenDetails: s,
134
+ expectedCounts: t,
135
+ expectedName: n,
136
+ deleteLabel: f = "Delete forever",
137
+ message: m
138
+ } = o, [p, c] = A(""), [v, j] = A({}), w = D(
139
+ () => g.filter((i) => (t[i] || 0) > 0),
140
+ [t]
141
+ ), h = D(() => H(t), [t]), b = h > T, y = !!n && !b, F = b ? w.every((i) => q(v[i], t[i])) : y ? p.trim() === n : !0, S = (i) => {
142
+ i.key === "Enter" && F && (i.preventDefault(), r());
143
+ };
144
+ return /* @__PURE__ */ l(
145
+ x,
146
+ {
147
+ size: "md",
148
+ isOpen: !0,
149
+ header: `${f} ${e}`,
150
+ onClose: a,
151
+ footer: (
152
+ // keydown lives here, not on the dialog — dialog spreads rest props over its own
153
+ // handler and would lose escape-to-close
154
+ /* @__PURE__ */ d(L, { onKeyDown: S, children: [
155
+ y && /* @__PURE__ */ d(k, { children: [
156
+ /* @__PURE__ */ d(E, { htmlFor: "delete-confirm-name-input", children: [
157
+ "To confirm delete action, type '",
158
+ n,
159
+ "' in the box below"
160
+ ] }),
161
+ /* @__PURE__ */ l(
162
+ P,
163
+ {
164
+ id: "delete-confirm-name-input",
165
+ "data-testid": "delete-confirm-name-input",
166
+ autoFocus: !0,
167
+ value: p,
168
+ placeholder: n,
169
+ onChange: (i) => c(i.target.value)
170
+ }
171
+ )
172
+ ] }),
173
+ b && /* @__PURE__ */ d(k, { children: [
174
+ /* @__PURE__ */ l(E, { as: "p", children: "To confirm, type how many of each will be deleted, children included" }),
175
+ /* @__PURE__ */ l(M, { children: w.map((i, z) => /* @__PURE__ */ d(R, { children: [
176
+ /* @__PURE__ */ l("span", { children: `${i[0].toUpperCase()}${i.slice(1)}s - ${t[i]}` }),
177
+ /* @__PURE__ */ l(
178
+ I,
179
+ {
180
+ "data-testid": `delete-confirm-count-${i}`,
181
+ autoFocus: z === 0,
182
+ inputMode: "numeric",
183
+ value: v[i] ?? "",
184
+ placeholder: `Number of ${i}s`,
185
+ onChange: (N) => j((V) => ({ ...V, [i]: N.target.value }))
186
+ }
187
+ )
188
+ ] }, i)) })
189
+ ] }),
190
+ /* @__PURE__ */ d(_, { children: [
191
+ /* @__PURE__ */ l($, { label: "Cancel", onClick: a }),
192
+ /* @__PURE__ */ l(
193
+ $,
194
+ {
195
+ "data-testid": "delete-confirm-submit",
196
+ variant: "danger",
197
+ label: f,
198
+ onClick: r,
199
+ disabled: !F
200
+ }
201
+ )
202
+ ] })
203
+ ] })
204
+ ),
205
+ children: /* @__PURE__ */ l(
206
+ O,
207
+ {
208
+ entityLabel: e,
209
+ childrenDetails: s,
210
+ message: m,
211
+ totalLine: h > T ? (
212
+ // versions cascaded from products are not countable, so the total is a floor
213
+ `This deletes ${(t.product || 0) > 0 ? "at least " : ""}${h} entities in total.`
214
+ ) : void 0
215
+ }
216
+ )
217
+ }
218
+ );
219
+ };
220
+ export {
221
+ g as D,
222
+ te as a,
223
+ re as b,
224
+ ie as c,
225
+ se as d,
226
+ ne as e,
227
+ oe as p,
228
+ H as s
229
+ };