@epam/ai-dial-projects 1.3.0-dev.364 → 1.3.0-dev.372
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/index.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { ActionMenu as e, DeleteConfirmationDialog as t, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as n, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as r, MarkdownRenderer as i, PROHIBITED_CONVERSATION_NAME_CHARS_RE as a, PanelEmptyState as o, RequestStatus as s, TextRefinementField as c, buildCssVars as ee, getAttachmentTypeFromMime as l, inferMimeTypeFromPath as u, mergeClasses as d, useAvailableHeightCap as f, useIsMobile as p, useTextRefinement as m } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { Button as h, ButtonAppearance as g, ButtonDropdown as _, ButtonVariant as v, CaptionText as te, CardShell as y, DIAL_ICON_SIZE as b, DIAL_KIT_ICON_STROKE as x, ElementSize as S, EllipsisTooltip as C, ErrorText as w, FileDropzone as T, FolderPath as E, GhostButton as D, GhostIconButton as O, Highlight as k, Input as ne, Label as
|
|
3
|
-
import { IconArrowNarrowLeft as oe, IconArrowsSort as R, IconDotsVertical as z, IconDownload as B, IconPencilMinus as V, IconPin as
|
|
4
|
-
import { Suspense as me, lazy as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { AttachmentCard as
|
|
7
|
-
import { BuilderFormActionsOrder as
|
|
8
|
-
import { LazyMarkdownEditor as
|
|
2
|
+
import { Button as h, ButtonAppearance as g, ButtonDropdown as _, ButtonVariant as v, CaptionText as te, CardShell as y, DIAL_ICON_SIZE as b, DIAL_KIT_ICON_STROKE as x, ElementSize as S, EllipsisTooltip as C, ErrorText as w, FileDropzone as T, FolderPath as E, GhostButton as D, GhostIconButton as O, Highlight as k, Input as ne, Label as re, LinkButton as A, LiveRegion as j, LiveRegionElement as M, LiveRegionPoliteness as N, MenuItemMark as P, NeutralButton as F, Popup as I, PopupSize as L, Search as ie, Spinner as ae } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconArrowNarrowLeft as oe, IconArrowsSort as R, IconDotsVertical as z, IconDownload as B, IconPencilMinus as V, IconPin as H, IconPinFilled as se, IconPlus as ce, IconShare as le, IconSparkles as U, IconTrashX as ue, IconWorldOff as de, IconWorldShare as fe, createReactComponent as pe } from "@tabler/icons-react";
|
|
4
|
+
import { Suspense as me, lazy as he, memo as W, useCallback as G, useEffect as ge, useId as K, useMemo as q, useRef as J, useState as Y } from "react";
|
|
5
|
+
import { Fragment as _e, jsx as X, jsxs as Z } from "react/jsx-runtime";
|
|
6
|
+
import { AttachmentCard as ve, FileDndOverlay as ye } from "@epam/ai-dial-attachment-input";
|
|
7
|
+
import { BuilderFormActionsOrder as be, BuilderFormContainer as xe } from "@epam/ai-dial-builder-form";
|
|
8
|
+
import { LazyMarkdownEditor as Se } from "@epam/ai-dial-ui-kit/editors";
|
|
9
9
|
//#region src/types/projects-sort-key.ts
|
|
10
|
-
var
|
|
10
|
+
var Ce = /* @__PURE__ */ function(e) {
|
|
11
11
|
return e.Newest = "newest", e.Oldest = "oldest", e.NameAsc = "name-asc", e;
|
|
12
|
-
}({}),
|
|
12
|
+
}({}), we = (e, t) => {
|
|
13
13
|
let n = t.trim().toLocaleLowerCase();
|
|
14
14
|
return n ? e.filter((e) => e.name.toLocaleLowerCase().includes(n)) : e;
|
|
15
|
-
},
|
|
15
|
+
}, Te = (e, t, n) => {
|
|
16
16
|
let r = new Intl.Collator(n, {
|
|
17
17
|
sensitivity: "base",
|
|
18
18
|
numeric: !0
|
|
19
19
|
}), i = (e, t) => r.compare(e.name, t.name), a = (e, t) => Number(t.isPinned ?? !1) - Number(e.isPinned ?? !1);
|
|
20
|
-
if (t ===
|
|
21
|
-
let o = t ===
|
|
20
|
+
if (t === Ce.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
|
|
21
|
+
let o = t === Ce.Oldest ? 1 : -1;
|
|
22
22
|
return [...e].sort((e, t) => {
|
|
23
23
|
let n = a(e, t);
|
|
24
24
|
return n === 0 ? e.updatedAt == null && t.updatedAt == null ? i(e, t) : e.updatedAt == null ? 1 : t.updatedAt == null ? -1 : (e.updatedAt - t.updatedAt) * o || i(e, t) : n;
|
|
25
25
|
});
|
|
26
|
-
},
|
|
27
|
-
["year", 365 *
|
|
28
|
-
["month", 30 *
|
|
29
|
-
["week", 7 *
|
|
30
|
-
["day",
|
|
31
|
-
["hour",
|
|
32
|
-
["minute",
|
|
33
|
-
],
|
|
26
|
+
}, Ee = 60, De = 3600, Oe = 24 * De, ke = [
|
|
27
|
+
["year", 365 * Oe],
|
|
28
|
+
["month", 30 * Oe],
|
|
29
|
+
["week", 7 * Oe],
|
|
30
|
+
["day", Oe],
|
|
31
|
+
["hour", De],
|
|
32
|
+
["minute", Ee]
|
|
33
|
+
], Ae = (e, t, n) => {
|
|
34
34
|
let r = (t - e) / 1e3;
|
|
35
|
-
for (let [e, t] of
|
|
35
|
+
for (let [e, t] of ke) {
|
|
36
36
|
let i = Math.floor(r / t);
|
|
37
37
|
if (i >= 1) return new Intl.RelativeTimeFormat(n).format(-i, e);
|
|
38
38
|
}
|
|
@@ -48,14 +48,14 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
48
48
|
link: "_link_13sy6_41",
|
|
49
49
|
aboveLink: "_aboveLink_13sy6_57",
|
|
50
50
|
interactive: "_interactive_13sy6_62"
|
|
51
|
-
},
|
|
51
|
+
}, je = (e, t) => [e, ...(t ?? "").split("/").filter((e) => e.length > 0)], Me = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Ne = ({ project: e, searchQuery: t, sourceLabel: n, folderPathLabel: r, pinnedLabel: i, pinLabel: a, onTogglePin: o, href: s, onOpen: c, now: ee, locale: l, updatedAtClassName: u, titleClassName: f, pathLabelClassName: p, pathLeafClassName: m }) => {
|
|
52
52
|
let h = /* @__PURE__ */ X(k, {
|
|
53
53
|
text: e.name,
|
|
54
54
|
query: t,
|
|
55
55
|
maxLines: 1,
|
|
56
56
|
className: d("min-w-0", f, Q.title, s != null && Q.aboveLink)
|
|
57
57
|
}), g = /* @__PURE__ */ X(E, {
|
|
58
|
-
segments:
|
|
58
|
+
segments: je(n, e.parentPath),
|
|
59
59
|
ariaLabel: r,
|
|
60
60
|
labelClassName: d(p, Q.path),
|
|
61
61
|
leafClassName: d(m, Q.path)
|
|
@@ -69,7 +69,7 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
69
69
|
e.updatedAt != null && /* @__PURE__ */ X("time", {
|
|
70
70
|
dateTime: new Date(e.updatedAt).toISOString(),
|
|
71
71
|
className: d(u, Q.updatedAt, (e.isPinned || o != null) && "pe-6"),
|
|
72
|
-
children:
|
|
72
|
+
children: Ae(e.updatedAt, ee, l)
|
|
73
73
|
}),
|
|
74
74
|
/* @__PURE__ */ Z("div", {
|
|
75
75
|
className: d("flex min-w-0 items-center", (e.isPinned || o != null) && "pe-6"),
|
|
@@ -80,13 +80,13 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
80
80
|
ref: _,
|
|
81
81
|
href: s,
|
|
82
82
|
onClick: (t) => {
|
|
83
|
-
c != null &&
|
|
83
|
+
c != null && Me(t) && (t.preventDefault(), c(e.id));
|
|
84
84
|
},
|
|
85
85
|
className: d("min-w-0 flex-1", Q.link),
|
|
86
86
|
children: h
|
|
87
87
|
}), o == null ? e.isPinned && /* @__PURE__ */ Z("span", {
|
|
88
88
|
className: d("absolute inset-e-5 top-5 flex", Q.pin),
|
|
89
|
-
children: [/* @__PURE__ */ X(
|
|
89
|
+
children: [/* @__PURE__ */ X(se, {
|
|
90
90
|
size: b.SM,
|
|
91
91
|
"aria-hidden": !0
|
|
92
92
|
}), /* @__PURE__ */ X("span", {
|
|
@@ -95,10 +95,10 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
95
95
|
})]
|
|
96
96
|
}) : /* @__PURE__ */ X(O, {
|
|
97
97
|
size: S.Small,
|
|
98
|
-
icon: e.isPinned ? /* @__PURE__ */ X(
|
|
98
|
+
icon: e.isPinned ? /* @__PURE__ */ X(se, {
|
|
99
99
|
size: b.SM,
|
|
100
100
|
"aria-hidden": !0
|
|
101
|
-
}) : /* @__PURE__ */ X(
|
|
101
|
+
}) : /* @__PURE__ */ X(H, {
|
|
102
102
|
size: b.SM,
|
|
103
103
|
"aria-hidden": !0,
|
|
104
104
|
stroke: x
|
|
@@ -127,12 +127,12 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
127
127
|
]
|
|
128
128
|
})
|
|
129
129
|
});
|
|
130
|
-
},
|
|
130
|
+
}, Pe = {
|
|
131
131
|
container: "_container_4rer8_1",
|
|
132
132
|
subtitle: "_subtitle_4rer8_5",
|
|
133
133
|
sortButton: "_sortButton_4rer8_9"
|
|
134
|
-
},
|
|
135
|
-
let { colors: T, typography: E } = w ?? {}, O = E?.titleClassName ?? "dial-h1-text", k = E?.subtitleClassName ?? "dial-body-text", ne = E?.cardTitleClassName ?? "dial-body-semi-text",
|
|
134
|
+
}, Fe = ({ projects: e, isLoading: t = !1, hasError: n = !1, incompleteSources: r = [], onRetry: i, onCreateProject: a, onTogglePin: s, onOpenProject: c, getProjectHref: l, searchQuery: u, onSearchQueryChange: f, sortKey: m, onSortKeyChange: te, labels: y, locale: C, styles: w }) => {
|
|
135
|
+
let { colors: T, typography: E } = w ?? {}, O = E?.titleClassName ?? "dial-h1-text", k = E?.subtitleClassName ?? "dial-body-text", ne = E?.cardTitleClassName ?? "dial-body-semi-text", re = E?.pathLabelClassName ?? "dial-tiny-text", A = E?.pathLeafClassName ?? "dial-tiny-semi-text", N = E?.updatedAtClassName ?? "dial-tiny-text", F = E?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", I = ee({
|
|
136
136
|
"--pr-bg": T?.background,
|
|
137
137
|
"--pr-subtitle-text": T?.subtitleText,
|
|
138
138
|
"--pr-sort-text": T?.sortButtonText,
|
|
@@ -141,34 +141,34 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
141
141
|
"--pr-updated-at-text": T?.updatedAtText,
|
|
142
142
|
"--pr-path-text": T?.pathText,
|
|
143
143
|
"--pr-card-focus-outline": T?.cardFocusOutline
|
|
144
|
-
}), L = p(), oe = q(() => Date.now(), [e]), z = u.trim(), B = r.length > 0, V = B && e.length === 0,
|
|
144
|
+
}), L = p(), oe = q(() => Date.now(), [e]), z = u.trim(), B = r.length > 0, V = B && e.length === 0, H = q(() => Te(we(e, u), m, C), [
|
|
145
145
|
e,
|
|
146
146
|
u,
|
|
147
147
|
m,
|
|
148
148
|
C
|
|
149
|
-
]),
|
|
149
|
+
]), se = y.sortOptions.find((e) => e.value === m)?.label ?? y.sortLabel, le = q(() => y.sortOptions.map((e) => ({
|
|
150
150
|
key: e.value,
|
|
151
151
|
label: e.label,
|
|
152
|
-
mark:
|
|
152
|
+
mark: P.Check,
|
|
153
153
|
checked: e.value === m,
|
|
154
154
|
onClick: () => te(e.value)
|
|
155
155
|
})), [
|
|
156
156
|
y.sortOptions,
|
|
157
157
|
m,
|
|
158
158
|
te
|
|
159
|
-
]),
|
|
159
|
+
]), U = (e) => {
|
|
160
160
|
f(e ?? "");
|
|
161
|
-
},
|
|
162
|
-
if (!t) return n ? y.errorLabel : B ? y.incompleteLabel : e.length === 0 ? y.emptyStateLabel :
|
|
163
|
-
},
|
|
161
|
+
}, ue = () => {
|
|
162
|
+
if (!t) return n ? y.errorLabel : B ? y.incompleteLabel : e.length === 0 ? y.emptyStateLabel : H.length === 0 ? y.noResultsLabel : y.resultCountLabel(H.length);
|
|
163
|
+
}, de = (e, t) => a ? /* @__PURE__ */ X(h, {
|
|
164
164
|
label: y.createProjectLabel,
|
|
165
165
|
variant: e,
|
|
166
166
|
onClick: a,
|
|
167
167
|
className: d("shrink-0", t)
|
|
168
|
-
}) : void 0,
|
|
168
|
+
}) : void 0, fe = () => t ? /* @__PURE__ */ X(ae, { ariaLabel: y.loadingAriaLabel ?? "Loading projects" }) : n || V ? /* @__PURE__ */ Z("div", {
|
|
169
169
|
className: "flex flex-col items-center gap-3",
|
|
170
170
|
children: [/* @__PURE__ */ X("p", {
|
|
171
|
-
className: d(k,
|
|
171
|
+
className: d(k, Pe.subtitle),
|
|
172
172
|
children: n ? y.errorLabel : y.incompleteLabel
|
|
173
173
|
}), /* @__PURE__ */ X(D, {
|
|
174
174
|
label: y.retryLabel,
|
|
@@ -177,17 +177,17 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
177
177
|
}) : e.length === 0 ? /* @__PURE__ */ X(o, {
|
|
178
178
|
label: y.emptyStateLabel,
|
|
179
179
|
description: y.emptyStateDescription,
|
|
180
|
-
action:
|
|
181
|
-
containerClassName:
|
|
180
|
+
action: de(v.Secondary, "mt-2"),
|
|
181
|
+
containerClassName: me,
|
|
182
182
|
labelClassName: "mt-3",
|
|
183
|
-
descriptionClassName:
|
|
184
|
-
}) :
|
|
183
|
+
descriptionClassName: F
|
|
184
|
+
}) : H.length === 0 ? /* @__PURE__ */ X(o, {
|
|
185
185
|
label: y.noResultsLabel,
|
|
186
|
-
containerClassName:
|
|
186
|
+
containerClassName: me,
|
|
187
187
|
labelClassName: "mt-3"
|
|
188
188
|
}) : /* @__PURE__ */ X("ul", {
|
|
189
189
|
className: "m-0 grid w-full min-w-0 list-none grid-cols-1 gap-4 p-0 desktop:grid-cols-3 desktop:gap-5",
|
|
190
|
-
children:
|
|
190
|
+
children: H.map((e) => /* @__PURE__ */ X(Ne, {
|
|
191
191
|
project: e,
|
|
192
192
|
searchQuery: z,
|
|
193
193
|
sourceLabel: y.sourceLabels[e.source],
|
|
@@ -199,15 +199,15 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
199
199
|
onOpen: c,
|
|
200
200
|
now: oe,
|
|
201
201
|
locale: C,
|
|
202
|
-
updatedAtClassName:
|
|
202
|
+
updatedAtClassName: N,
|
|
203
203
|
titleClassName: ne,
|
|
204
|
-
pathLabelClassName:
|
|
205
|
-
pathLeafClassName:
|
|
204
|
+
pathLabelClassName: re,
|
|
205
|
+
pathLeafClassName: A
|
|
206
206
|
}, e.id))
|
|
207
|
-
}),
|
|
207
|
+
}), pe = t || n || V, me = "mt-6 p-3 desktop:mt-0";
|
|
208
208
|
return /* @__PURE__ */ Z("div", {
|
|
209
|
-
style:
|
|
210
|
-
className: d("relative flex size-full min-h-0 min-w-0 flex-1 flex-col",
|
|
209
|
+
style: I,
|
|
210
|
+
className: d("relative flex size-full min-h-0 min-w-0 flex-1 flex-col", Pe.container),
|
|
211
211
|
children: [/* @__PURE__ */ Z("div", {
|
|
212
212
|
className: "flex min-h-0 w-full min-w-0 flex-1 flex-col overflow-y-auto",
|
|
213
213
|
children: [
|
|
@@ -222,10 +222,10 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
222
222
|
className: d("wrap-break-word", O),
|
|
223
223
|
children: y.title
|
|
224
224
|
}), y.subtitle && /* @__PURE__ */ X("p", {
|
|
225
|
-
className: d(k,
|
|
225
|
+
className: d(k, Pe.subtitle),
|
|
226
226
|
children: y.subtitle
|
|
227
227
|
})]
|
|
228
|
-
}),
|
|
228
|
+
}), de(v.Primary)]
|
|
229
229
|
}),
|
|
230
230
|
/* @__PURE__ */ Z("div", {
|
|
231
231
|
className: "flex items-center gap-2 p-4 desktop:gap-3 desktop:px-8 desktop:pt-4 desktop:pb-5",
|
|
@@ -234,7 +234,7 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
234
234
|
className: "min-w-0 flex-1",
|
|
235
235
|
children: /* @__PURE__ */ X(ie, {
|
|
236
236
|
value: u,
|
|
237
|
-
onChange:
|
|
237
|
+
onChange: U,
|
|
238
238
|
placeholder: y.searchPlaceholder,
|
|
239
239
|
clearLabel: y.clearSearchLabel,
|
|
240
240
|
"aria-label": y.searchAriaLabel,
|
|
@@ -246,7 +246,7 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
246
246
|
className: "shrink-0",
|
|
247
247
|
children: /* @__PURE__ */ X(_, {
|
|
248
248
|
items: le,
|
|
249
|
-
label:
|
|
249
|
+
label: se,
|
|
250
250
|
variant: v.Primary,
|
|
251
251
|
appearance: g.Ghost,
|
|
252
252
|
size: L ? S.Small : S.Standard,
|
|
@@ -255,35 +255,35 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
255
255
|
"aria-hidden": !0,
|
|
256
256
|
stroke: x
|
|
257
257
|
}),
|
|
258
|
-
className: d("desktop:px-3",
|
|
258
|
+
className: d("desktop:px-3", Pe.sortButton)
|
|
259
259
|
})
|
|
260
260
|
})]
|
|
261
261
|
}),
|
|
262
|
-
/* @__PURE__ */ X(
|
|
262
|
+
/* @__PURE__ */ X(j, {
|
|
263
263
|
visuallyHidden: !0,
|
|
264
|
-
as:
|
|
265
|
-
children:
|
|
264
|
+
as: M.Span,
|
|
265
|
+
children: ue()
|
|
266
266
|
}),
|
|
267
267
|
/* @__PURE__ */ Z("div", {
|
|
268
268
|
className: "flex w-full min-w-0 flex-1 flex-col items-center gap-4 px-4 pb-20 desktop:gap-5 desktop:px-8 desktop:pt-6 desktop:pb-8",
|
|
269
269
|
children: [B && !t && !n && !V && /* @__PURE__ */ Z("div", {
|
|
270
270
|
className: "flex w-full max-w-[1116px] flex-wrap items-center gap-3",
|
|
271
271
|
children: [/* @__PURE__ */ X("p", {
|
|
272
|
-
className: d(k,
|
|
272
|
+
className: d(k, Pe.subtitle),
|
|
273
273
|
children: y.incompleteLabel
|
|
274
274
|
}), /* @__PURE__ */ X(D, {
|
|
275
275
|
label: y.retryLabel,
|
|
276
276
|
onClick: i
|
|
277
277
|
})]
|
|
278
278
|
}), /* @__PURE__ */ X("div", {
|
|
279
|
-
className: d("flex w-full max-w-[1116px] min-w-0 flex-col items-center",
|
|
280
|
-
children:
|
|
279
|
+
className: d("flex w-full max-w-[1116px] min-w-0 flex-col items-center", pe && "flex-1 justify-center"),
|
|
280
|
+
children: fe()
|
|
281
281
|
})]
|
|
282
282
|
})
|
|
283
283
|
]
|
|
284
284
|
}), L && a && /* @__PURE__ */ X(h, {
|
|
285
285
|
variant: v.Primary,
|
|
286
|
-
iconBefore: /* @__PURE__ */ X(
|
|
286
|
+
iconBefore: /* @__PURE__ */ X(ce, {
|
|
287
287
|
size: b.LG,
|
|
288
288
|
"aria-hidden": !0,
|
|
289
289
|
stroke: x
|
|
@@ -293,62 +293,62 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
293
293
|
className: "absolute inset-e-4 bottom-4 z-10 size-10 rounded-full px-0"
|
|
294
294
|
})]
|
|
295
295
|
});
|
|
296
|
-
},
|
|
296
|
+
}, Ie = /* @__PURE__ */ function(e) {
|
|
297
297
|
return e.Personal = "personal", e.Shared = "shared", e.Organization = "organization", e;
|
|
298
|
-
}({}),
|
|
298
|
+
}({}), Le = (e) => !!e.dataTransfer?.types.includes("Files"), Re = (e) => {
|
|
299
299
|
let [t, n] = Y(!1), r = J(0);
|
|
300
300
|
return {
|
|
301
301
|
isDragActive: t,
|
|
302
302
|
handlers: {
|
|
303
303
|
onDragEnter: G((e) => {
|
|
304
|
-
|
|
304
|
+
Le(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
305
305
|
}, []),
|
|
306
306
|
onDragLeave: G((e) => {
|
|
307
|
-
|
|
307
|
+
Le(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
308
308
|
}, []),
|
|
309
309
|
onDragOver: G((e) => {
|
|
310
|
-
|
|
310
|
+
Le(e) && e.preventDefault();
|
|
311
311
|
}, []),
|
|
312
312
|
onDrop: G((t) => {
|
|
313
|
-
if (!
|
|
313
|
+
if (!Le(t)) return;
|
|
314
314
|
t.preventDefault(), r.current = 0, n(!1);
|
|
315
315
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
316
316
|
i.length > 0 && e(i);
|
|
317
317
|
}, [e])
|
|
318
318
|
}
|
|
319
319
|
};
|
|
320
|
-
},
|
|
320
|
+
}, ze = /* @__PURE__ */ function(e) {
|
|
321
321
|
return e.UnsupportedType = "unsupported-type", e.TooLarge = "too-large", e.CapacityExceeded = "capacity-exceeded", e.Duplicate = "duplicate", e.InvalidName = "invalid-name", e;
|
|
322
|
-
}({}),
|
|
322
|
+
}({}), Be = /* @__PURE__ */ function(e) {
|
|
323
323
|
return e.Required = "required", e.InvalidCharacters = "invalid-characters", e.Reserved = "reserved", e.TooLong = "too-long", e;
|
|
324
|
-
}({}),
|
|
324
|
+
}({}), Ve = 255, He = new RegExp(a.source, "u"), Ue = /[\p{Cc}--]/u, We = /* @__PURE__ */ new Set([
|
|
325
325
|
".",
|
|
326
326
|
"..",
|
|
327
327
|
"v",
|
|
328
328
|
"files",
|
|
329
329
|
".dial-resource",
|
|
330
330
|
".dial-folder"
|
|
331
|
-
]),
|
|
331
|
+
]), Ge = (e) => new TextEncoder().encode(e).length, Ke = (e) => {
|
|
332
332
|
let t = e.trim();
|
|
333
|
-
return t.length === 0 ?
|
|
334
|
-
},
|
|
333
|
+
return t.length === 0 ? Be.Required : Ge(t) > 255 ? Be.TooLong : He.test(t) || Ue.test(t) ? Be.InvalidCharacters : We.has(t) ? Be.Reserved : null;
|
|
334
|
+
}, qe = (e) => {
|
|
335
335
|
let t = e.lastIndexOf(".");
|
|
336
336
|
return t > 0 ? e.slice(t + 1).toLowerCase() : "";
|
|
337
|
-
},
|
|
337
|
+
}, Je = (e) => "isStored" in e && e.isStored, Ye = (e) => Je(e) ? e.size : e.file.size, Xe = (e) => e.reduce((e, t) => e + Ye(t), 0), Ze = 0, Qe = () => (Ze += 1, `project-context-${Date.now()}-${Ze}`), $e = (e) => {
|
|
338
338
|
let t = e.type || u(e.name) || "application/octet-stream";
|
|
339
339
|
return {
|
|
340
|
-
id:
|
|
340
|
+
id: Qe(),
|
|
341
341
|
name: e.name,
|
|
342
342
|
contentType: t,
|
|
343
343
|
type: l(t),
|
|
344
344
|
status: s.Idle,
|
|
345
345
|
file: e
|
|
346
346
|
};
|
|
347
|
-
},
|
|
348
|
-
let r = new Set(t.map((e) => e.name)), i =
|
|
347
|
+
}, et = (e, t, n, r) => Ke(e.name) != null || e.name.trim() !== e.name ? ze.InvalidName : r.allowedExtensions.includes(qe(e.name)) ? t.has(e.name) ? ze.Duplicate : e.size > r.maxFileBytes ? ze.TooLarge : n + e.size > r.maxTotalBytes ? ze.CapacityExceeded : null : ze.UnsupportedType, tt = (e, t, n) => {
|
|
348
|
+
let r = new Set(t.map((e) => e.name)), i = Xe(t), a = [], o = [];
|
|
349
349
|
for (let t of e) {
|
|
350
|
-
let e =
|
|
351
|
-
e == null ? (r.add(t.name), i += t.size, a.push(
|
|
350
|
+
let e = et(t, r, i, n);
|
|
351
|
+
e == null ? (r.add(t.name), i += t.size, a.push($e(t))) : o.push({
|
|
352
352
|
name: t.name,
|
|
353
353
|
reason: e
|
|
354
354
|
});
|
|
@@ -357,69 +357,69 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
357
357
|
accepted: a,
|
|
358
358
|
rejected: o
|
|
359
359
|
};
|
|
360
|
-
},
|
|
360
|
+
}, nt = (e, t) => {
|
|
361
361
|
let n = t.trim().toLowerCase();
|
|
362
362
|
return n === "" ? e : e.filter((e) => e.name.toLowerCase().includes(n));
|
|
363
|
-
},
|
|
363
|
+
}, rt = {
|
|
364
364
|
formColumn: "_formColumn_ru73x_1",
|
|
365
365
|
dropZone: "_dropZone_ru73x_11",
|
|
366
366
|
label: "_label_ru73x_20",
|
|
367
367
|
link: "_link_ru73x_24"
|
|
368
|
-
},
|
|
369
|
-
let
|
|
368
|
+
}, it = he(async () => ({ default: (await Se()).MarkdownEditor })), at = (e) => `Preview ${e}`, ot = (e) => `Download ${e}`, st = "The project name can't be changed after creation", ct = ({ values: e, errors: t, onFieldChange: i, contextFiles: a, onContextFilesChange: o, onContextFileClick: s, onContextFileDownload: l, selectedContextFileId: u, allowedExtensions: p, maxFileBytes: h, maxTotalBytes: g, onPickFromFileManager: _, onRefineInstructions: v, onBack: y, onCancel: S, onSubmit: C, isSubmitting: E = !1, isNameReadOnly: D = !1, labels: O, markdownEditorTheme: k, className: A, styles: P }) => {
|
|
369
|
+
let F = K(), I = K(), L = K(), ie = K(), R = K(), z = K(), B = J(null), V = f(), [H, se] = Y(!1), [ce, le] = Y([]), [U, ue] = Y(""), de = m({
|
|
370
370
|
value: e.instructions,
|
|
371
371
|
onChange: (e) => i("instructions", e),
|
|
372
372
|
onRefine: v,
|
|
373
373
|
disabled: E
|
|
374
|
-
}),
|
|
375
|
-
t.name ? Se =
|
|
374
|
+
}), fe = de.isPending, pe = Ke(e.name), he = O.nameReadOnlyHint ?? st, W = t.name ?? (H && pe != null ? O.nameErrors[pe] : void 0), G = !D && !!t.name, _e = pe != null || G || E || fe, Se;
|
|
375
|
+
t.name ? Se = I : W && (Se = L);
|
|
376
376
|
let Ce = [D && ie, Se].filter(Boolean).join(" ") || void 0;
|
|
377
|
-
|
|
377
|
+
ge(() => {
|
|
378
378
|
t.name && !D && B.current?.focus();
|
|
379
379
|
}, [t.name, D]);
|
|
380
380
|
let we = q(() => p.map((e) => `.${e}`).join(","), [p]), Te = (e) => {
|
|
381
381
|
if (e.length === 0) return;
|
|
382
|
-
let { accepted: t, rejected: n } =
|
|
382
|
+
let { accepted: t, rejected: n } = tt(e, a, {
|
|
383
383
|
allowedExtensions: p,
|
|
384
384
|
maxFileBytes: h,
|
|
385
385
|
maxTotalBytes: g
|
|
386
386
|
});
|
|
387
|
-
le(n), t.length > 0 && o([...a, ...t]),
|
|
388
|
-
}, { isDragActive: Ee, handlers: De } =
|
|
387
|
+
le(n), t.length > 0 && o([...a, ...t]), ue([t.length > 0 ? O.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => O.fileRejections[t](e))].filter(Boolean).join(" "));
|
|
388
|
+
}, { isDragActive: Ee, handlers: De } = Re(Te), Oe = O.openFileLabel ?? at, ke = O.downloadFileLabel ?? ot, Ae = (e) => {
|
|
389
389
|
let t = a.find((t) => t.id === e);
|
|
390
|
-
o(a.filter((t) => t.id !== e)), le([]), t &&
|
|
391
|
-
},
|
|
390
|
+
o(a.filter((t) => t.id !== e)), le([]), t && ue(O.fileRemovedStatus(t.name));
|
|
391
|
+
}, Q = async (e) => {
|
|
392
392
|
if (e.preventDefault(), e.stopPropagation(), _) try {
|
|
393
393
|
let e = await _();
|
|
394
394
|
e && Te(e);
|
|
395
395
|
} catch {}
|
|
396
396
|
}, je = () => {
|
|
397
|
-
|
|
398
|
-
}, { colors: Me, typography: Ne } =
|
|
397
|
+
_e || C();
|
|
398
|
+
}, { colors: Me, typography: Ne } = P ?? {}, Pe = Ne?.titleClassName ?? "dial-h1-text", Fe = d(Ne?.labelClassName ?? "dial-tiny-semi-text", rt.label), Ie = Ne?.helperClassName ?? "dial-tiny-text", Le = ee({
|
|
399
399
|
"--pcf-label-text": Me?.labelText,
|
|
400
400
|
"--pcf-link-text": Me?.linkText,
|
|
401
401
|
"--pcf-dropzone-bg": Me?.dropZoneBackground
|
|
402
|
-
}), ze = O.refinement, Be = t.context, Ve = [...
|
|
403
|
-
fromDevice: /* @__PURE__ */ X("span", { className:
|
|
402
|
+
}), ze = O.refinement, Be = t.context, Ve = [...ce.map(({ name: e, reason: t }) => O.fileRejections[t](e)), Be].filter(Boolean).join("\n"), He = O.dropZoneLabel({
|
|
403
|
+
fromDevice: /* @__PURE__ */ X("span", { className: rt.link }),
|
|
404
404
|
fileManager: _ ? /* @__PURE__ */ X("button", {
|
|
405
405
|
type: "button",
|
|
406
|
-
className:
|
|
406
|
+
className: rt.link,
|
|
407
407
|
disabled: E,
|
|
408
|
-
onClick: (e) => void
|
|
408
|
+
onClick: (e) => void Q(e)
|
|
409
409
|
}) : void 0
|
|
410
410
|
});
|
|
411
411
|
return /* @__PURE__ */ Z("div", {
|
|
412
|
-
className: d("relative flex h-full min-h-0 w-full",
|
|
412
|
+
className: d("relative flex h-full min-h-0 w-full", A),
|
|
413
413
|
...De,
|
|
414
414
|
children: [
|
|
415
|
-
/* @__PURE__ */ X(
|
|
415
|
+
/* @__PURE__ */ X(ye, {
|
|
416
416
|
isVisible: Ee,
|
|
417
417
|
labels: {
|
|
418
418
|
title: O.dropOverlayTitle,
|
|
419
419
|
subtitle: O.dropOverlaySubtitle
|
|
420
420
|
}
|
|
421
421
|
}),
|
|
422
|
-
/* @__PURE__ */ X(
|
|
422
|
+
/* @__PURE__ */ X(xe, {
|
|
423
423
|
labels: {
|
|
424
424
|
title: O.title,
|
|
425
425
|
backButtonLabel: O.backLabel,
|
|
@@ -431,9 +431,9 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
431
431
|
onCancel: S,
|
|
432
432
|
onSubmit: je,
|
|
433
433
|
isCancelDisabled: E,
|
|
434
|
-
isSubmitDisabled:
|
|
434
|
+
isSubmitDisabled: _e,
|
|
435
435
|
isSubmitting: E,
|
|
436
|
-
footerActionsOrder:
|
|
436
|
+
footerActionsOrder: be.SubmitFirst,
|
|
437
437
|
backIcon: /* @__PURE__ */ X(oe, {
|
|
438
438
|
size: b.LG,
|
|
439
439
|
stroke: x,
|
|
@@ -446,22 +446,22 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
446
446
|
colors: { borderColor: Me?.headerBorder },
|
|
447
447
|
typography: { fontClassName: Pe }
|
|
448
448
|
},
|
|
449
|
-
cssVars:
|
|
449
|
+
cssVars: Le
|
|
450
450
|
},
|
|
451
451
|
children: /* @__PURE__ */ Z("div", {
|
|
452
|
-
className: d("mx-auto flex w-full max-w-262 min-w-0 flex-col gap-5 py-6",
|
|
452
|
+
className: d("mx-auto flex w-full max-w-262 min-w-0 flex-col gap-5 py-6", rt.formColumn),
|
|
453
453
|
children: [
|
|
454
454
|
/* @__PURE__ */ Z("div", {
|
|
455
455
|
className: "flex flex-col gap-1",
|
|
456
456
|
children: [
|
|
457
457
|
/* @__PURE__ */ X(ne, {
|
|
458
|
-
id:
|
|
458
|
+
id: F,
|
|
459
459
|
inputRef: B,
|
|
460
460
|
value: e.name,
|
|
461
461
|
onChange: (e) => {
|
|
462
462
|
D || i("name", e ?? "");
|
|
463
463
|
},
|
|
464
|
-
onBlur: () =>
|
|
464
|
+
onBlur: () => se(!0),
|
|
465
465
|
placeholder: O.namePlaceholder,
|
|
466
466
|
labelProps: {
|
|
467
467
|
label: O.nameLabel,
|
|
@@ -471,26 +471,26 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
471
471
|
"aria-required": !0,
|
|
472
472
|
readOnly: D,
|
|
473
473
|
disabled: D,
|
|
474
|
-
tooltipText: D ?
|
|
475
|
-
invalid: !!
|
|
476
|
-
"aria-invalid": !!
|
|
474
|
+
tooltipText: D ? he : void 0,
|
|
475
|
+
invalid: !!W,
|
|
476
|
+
"aria-invalid": !!W,
|
|
477
477
|
"aria-describedby": Ce
|
|
478
478
|
}),
|
|
479
479
|
D && /* @__PURE__ */ X(te, {
|
|
480
480
|
id: ie,
|
|
481
481
|
className: Ie,
|
|
482
|
-
text:
|
|
482
|
+
text: he
|
|
483
483
|
}),
|
|
484
484
|
/* @__PURE__ */ X(w, {
|
|
485
|
-
announce:
|
|
486
|
-
id:
|
|
485
|
+
announce: N.Assertive,
|
|
486
|
+
id: I,
|
|
487
487
|
className: Ie,
|
|
488
488
|
text: t.name ?? ""
|
|
489
489
|
}),
|
|
490
|
-
|
|
490
|
+
W && !t.name && /* @__PURE__ */ X(w, {
|
|
491
491
|
id: L,
|
|
492
492
|
className: Ie,
|
|
493
|
-
text:
|
|
493
|
+
text: W
|
|
494
494
|
})
|
|
495
495
|
]
|
|
496
496
|
}),
|
|
@@ -500,11 +500,11 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
500
500
|
label: O.instructionsLabel,
|
|
501
501
|
labelClassName: Fe,
|
|
502
502
|
labels: ze,
|
|
503
|
-
refinement:
|
|
504
|
-
disabled: E ||
|
|
503
|
+
refinement: de,
|
|
504
|
+
disabled: E || fe,
|
|
505
505
|
children: /* @__PURE__ */ Z("div", {
|
|
506
506
|
className: "flex flex-1 flex-col gap-2",
|
|
507
|
-
children: [!v && /* @__PURE__ */ X(
|
|
507
|
+
children: [!v && /* @__PURE__ */ X(re, {
|
|
508
508
|
htmlFor: R,
|
|
509
509
|
className: Fe,
|
|
510
510
|
label: O.instructionsLabel
|
|
@@ -513,11 +513,11 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
513
513
|
className: d("w-full", n, r),
|
|
514
514
|
children: /* @__PURE__ */ X(me, {
|
|
515
515
|
fallback: /* @__PURE__ */ X(ae, { ariaLabel: O.editorLoadingAriaLabel ?? "Loading editor" }),
|
|
516
|
-
children: /* @__PURE__ */ X(
|
|
516
|
+
children: /* @__PURE__ */ X(it, {
|
|
517
517
|
id: R,
|
|
518
518
|
value: e.instructions,
|
|
519
519
|
onChange: (e) => {
|
|
520
|
-
|
|
520
|
+
de.reset(), i("instructions", e);
|
|
521
521
|
},
|
|
522
522
|
height: 176,
|
|
523
523
|
theme: k,
|
|
@@ -546,22 +546,22 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
546
546
|
onChange: Te,
|
|
547
547
|
onReject: Te,
|
|
548
548
|
errorText: Ve || void 0,
|
|
549
|
-
className:
|
|
549
|
+
className: rt.dropZone
|
|
550
550
|
}),
|
|
551
|
-
/* @__PURE__ */ X(
|
|
551
|
+
/* @__PURE__ */ X(j, {
|
|
552
552
|
visuallyHidden: !0,
|
|
553
|
-
politeness:
|
|
553
|
+
politeness: N.Assertive,
|
|
554
554
|
children: Be
|
|
555
555
|
}),
|
|
556
556
|
a.length > 0 && /* @__PURE__ */ X("ul", {
|
|
557
557
|
className: "flex min-w-0 flex-wrap gap-2 pt-3",
|
|
558
558
|
children: a.map((e) => /* @__PURE__ */ X("li", {
|
|
559
559
|
className: "min-w-0",
|
|
560
|
-
children: /* @__PURE__ */ X(
|
|
560
|
+
children: /* @__PURE__ */ X(ve, {
|
|
561
561
|
attachment: e,
|
|
562
562
|
onClick: s,
|
|
563
563
|
isSelected: s == null ? void 0 : e.id === u,
|
|
564
|
-
onRemove:
|
|
564
|
+
onRemove: Ae,
|
|
565
565
|
onDownload: l,
|
|
566
566
|
labels: {
|
|
567
567
|
removeLabel: O.removeFileLabel(e.name),
|
|
@@ -576,14 +576,14 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
576
576
|
]
|
|
577
577
|
})
|
|
578
578
|
}),
|
|
579
|
-
/* @__PURE__ */ X(
|
|
579
|
+
/* @__PURE__ */ X(j, {
|
|
580
580
|
visuallyHidden: !0,
|
|
581
|
-
as:
|
|
582
|
-
children: E ? O.creatingStatus :
|
|
581
|
+
as: M.Span,
|
|
582
|
+
children: E ? O.creatingStatus : U
|
|
583
583
|
})
|
|
584
584
|
]
|
|
585
585
|
});
|
|
586
|
-
},
|
|
586
|
+
}, lt = pe("outline", "pin-off", "PinOff", [
|
|
587
587
|
["path", {
|
|
588
588
|
d: "M3 3l18 18",
|
|
589
589
|
key: "svg-0"
|
|
@@ -619,21 +619,21 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
619
619
|
body: "_body_1j6j0_16",
|
|
620
620
|
secondary: "_secondary_1j6j0_20",
|
|
621
621
|
panel: "_panel_1j6j0_24"
|
|
622
|
-
},
|
|
622
|
+
}, ut = (e) => ({
|
|
623
623
|
id: e.name,
|
|
624
624
|
name: e.name,
|
|
625
625
|
contentType: e.contentType,
|
|
626
626
|
type: l(e.contentType),
|
|
627
627
|
status: s.Idle
|
|
628
|
-
}),
|
|
629
|
-
let { colors: P, typography:
|
|
628
|
+
}), dt = (e) => `Download ${e}`, ft = W(({ project: t, isLoading: n = !1, hasError: r = !1, isNotFound: a = !1, isPinned: s, isPinPending: c = !1, contextSearchQuery: l, onContextSearchQueryChange: u, onBack: f, onTogglePin: p, onPublish: m, onUnpublish: h, onEdit: g, onShare: _, onDelete: v, onDownload: te, onContextFileClick: y, onContextFileDownload: S, selectedContextFileId: w, isDetailsStacked: T = !1, onRetry: E, onBrowseProjects: k, mainContent: ne, mainContentLabel: re = "Project content", labels: A, styles: N }) => {
|
|
629
|
+
let { colors: P, typography: I } = N ?? {}, L = A.downloadFileLabel ?? dt, R = I?.titleClassName ?? "dial-h1-text", se = I?.panelTitleClassName ?? "dial-body-semi-text", ce = I?.sectionTitleClassName ?? "dial-tiny-text", U = I?.bodyClassName ?? "dial-small-text", pe = I?.helperClassName ?? "dial-tiny-text", me = I?.instructionsHeadingClassName ?? "dial-small-semi-text", he = ee({
|
|
630
630
|
"--pv-bg": P?.background,
|
|
631
631
|
"--pv-border": P?.border,
|
|
632
632
|
"--pv-heading-text": P?.headingText,
|
|
633
633
|
"--pv-body-text": P?.bodyText,
|
|
634
634
|
"--pv-secondary-text": P?.secondaryText
|
|
635
|
-
}),
|
|
636
|
-
let e = d("mb-1 mt-3 first:mt-0",
|
|
635
|
+
}), W = q(() => t?.contextFiles ?? [], [t]), G = q(() => nt(W, l), [W, l]), ge = l.trim(), J = K(), Y = q(() => {
|
|
636
|
+
let e = d("mb-1 mt-3 first:mt-0", me);
|
|
637
637
|
return {
|
|
638
638
|
h1: e,
|
|
639
639
|
h2: e,
|
|
@@ -641,48 +641,60 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
641
641
|
h4: e,
|
|
642
642
|
h5: e,
|
|
643
643
|
h6: e,
|
|
644
|
-
p:
|
|
645
|
-
ul:
|
|
646
|
-
ol:
|
|
644
|
+
p: U,
|
|
645
|
+
ul: U,
|
|
646
|
+
ol: U
|
|
647
647
|
};
|
|
648
|
-
}, [
|
|
648
|
+
}, [U, me]), ye = A.unpublishLabel ?? "Unpublish", be = () => {
|
|
649
|
+
c || p();
|
|
650
|
+
}, xe = (e) => /* @__PURE__ */ X(e, {
|
|
649
651
|
size: b.SM,
|
|
650
652
|
"aria-hidden": !0,
|
|
651
653
|
stroke: x
|
|
652
|
-
}),
|
|
654
|
+
}), Se = (e) => {
|
|
653
655
|
let t = [];
|
|
654
|
-
return e &&
|
|
656
|
+
return e && t.push({
|
|
657
|
+
key: "pin",
|
|
658
|
+
label: s ? A.unpinLabel : A.pinLabel,
|
|
659
|
+
icon: xe(s ? lt : H),
|
|
660
|
+
onClick: be
|
|
661
|
+
}), e && h ? t.push({
|
|
662
|
+
key: "unpublish",
|
|
663
|
+
label: ye,
|
|
664
|
+
icon: xe(de),
|
|
665
|
+
onClick: h
|
|
666
|
+
}) : e && m && t.push({
|
|
655
667
|
key: "publish",
|
|
656
668
|
label: A.publishLabel,
|
|
657
|
-
icon:
|
|
669
|
+
icon: xe(fe),
|
|
658
670
|
onClick: m
|
|
659
|
-
}), e &&
|
|
671
|
+
}), e && g && t.push({
|
|
660
672
|
key: "edit",
|
|
661
673
|
label: A.editLabel,
|
|
662
|
-
icon:
|
|
663
|
-
onClick:
|
|
664
|
-
}),
|
|
674
|
+
icon: xe(V),
|
|
675
|
+
onClick: g
|
|
676
|
+
}), _ && t.push({
|
|
665
677
|
key: "share",
|
|
666
678
|
label: A.shareLabel,
|
|
667
|
-
icon:
|
|
668
|
-
onClick:
|
|
679
|
+
icon: xe(le),
|
|
680
|
+
onClick: _
|
|
669
681
|
}), t.push({
|
|
670
682
|
key: "download",
|
|
671
683
|
label: A.downloadLabel,
|
|
672
|
-
icon:
|
|
673
|
-
onClick:
|
|
674
|
-
}),
|
|
684
|
+
icon: xe(B),
|
|
685
|
+
onClick: te
|
|
686
|
+
}), v && t.push({
|
|
675
687
|
key: "delete",
|
|
676
688
|
label: A.deleteLabel,
|
|
677
|
-
icon:
|
|
689
|
+
icon: xe(ue),
|
|
678
690
|
danger: !0,
|
|
679
|
-
onClick:
|
|
691
|
+
onClick: v
|
|
680
692
|
}), t;
|
|
681
|
-
},
|
|
682
|
-
className:
|
|
693
|
+
}, Ce = (n, r) => /* @__PURE__ */ X("div", {
|
|
694
|
+
className: r,
|
|
683
695
|
children: /* @__PURE__ */ X(e, {
|
|
684
|
-
items:
|
|
685
|
-
title: A.moreActionsLabel,
|
|
696
|
+
items: Se(n),
|
|
697
|
+
title: n ? t?.name ?? A.moreActionsLabel : A.moreActionsLabel,
|
|
686
698
|
closeLabel: A.closeLabel,
|
|
687
699
|
matchReferenceWidth: !1,
|
|
688
700
|
listClassName: "w-[200px]",
|
|
@@ -695,37 +707,35 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
695
707
|
"aria-label": A.moreActionsLabel
|
|
696
708
|
})
|
|
697
709
|
})
|
|
698
|
-
}),
|
|
699
|
-
c || p();
|
|
700
|
-
}, xe = () => n ? /* @__PURE__ */ X(ae, { ariaLabel: A.loadingAriaLabel ?? "Loading project" }) : r ? /* @__PURE__ */ Z("div", {
|
|
710
|
+
}), we = () => n ? /* @__PURE__ */ X(ae, { ariaLabel: A.loadingAriaLabel ?? "Loading project" }) : r ? /* @__PURE__ */ Z("div", {
|
|
701
711
|
className: "flex flex-col items-center gap-3",
|
|
702
712
|
children: [/* @__PURE__ */ X("p", {
|
|
703
713
|
"aria-hidden": !0,
|
|
704
|
-
className: d(
|
|
714
|
+
className: d(U, $.body),
|
|
705
715
|
children: A.errorLabel
|
|
706
716
|
}), /* @__PURE__ */ X(D, {
|
|
707
717
|
label: A.retryLabel,
|
|
708
|
-
onClick:
|
|
718
|
+
onClick: E
|
|
709
719
|
})]
|
|
710
720
|
}) : /* @__PURE__ */ Z("div", {
|
|
711
721
|
className: "flex flex-col items-center gap-3",
|
|
712
722
|
children: [/* @__PURE__ */ X("p", {
|
|
713
|
-
className: d(
|
|
723
|
+
className: d(U, $.body),
|
|
714
724
|
children: A.notFoundLabel
|
|
715
725
|
}), /* @__PURE__ */ X(D, {
|
|
716
726
|
label: A.browseProjectsLabel,
|
|
717
|
-
onClick:
|
|
727
|
+
onClick: k
|
|
718
728
|
})]
|
|
719
729
|
});
|
|
720
730
|
if (n || r || a || t == null) return /* @__PURE__ */ Z("div", {
|
|
721
|
-
style:
|
|
731
|
+
style: he,
|
|
722
732
|
className: d("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
|
|
723
|
-
children: [/* @__PURE__ */ X(
|
|
733
|
+
children: [/* @__PURE__ */ X(j, {
|
|
724
734
|
visuallyHidden: !0,
|
|
725
735
|
children: !n && r && A.errorLabel
|
|
726
|
-
}),
|
|
736
|
+
}), we()]
|
|
727
737
|
});
|
|
728
|
-
let
|
|
738
|
+
let Te = () => W.length === 0 ? /* @__PURE__ */ X(o, { label: A.emptyContextLabel }) : /* @__PURE__ */ Z(_e, { children: [
|
|
729
739
|
/* @__PURE__ */ X("div", {
|
|
730
740
|
role: "search",
|
|
731
741
|
children: /* @__PURE__ */ X(ie, {
|
|
@@ -736,34 +746,34 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
736
746
|
"aria-label": A.contextSearchAriaLabel
|
|
737
747
|
})
|
|
738
748
|
}),
|
|
739
|
-
|
|
740
|
-
className: d(
|
|
749
|
+
G.length === 0 ? /* @__PURE__ */ X("p", {
|
|
750
|
+
className: d(pe, $.secondary),
|
|
741
751
|
children: A.noContextMatchesLabel
|
|
742
752
|
}) : /* @__PURE__ */ X("ul", {
|
|
743
753
|
className: "m-0 flex min-w-0 list-none flex-wrap gap-2 p-0 pt-2",
|
|
744
|
-
children:
|
|
754
|
+
children: G.map((e) => /* @__PURE__ */ X("li", {
|
|
745
755
|
className: "min-w-0",
|
|
746
|
-
children: /* @__PURE__ */ X(
|
|
747
|
-
attachment:
|
|
748
|
-
searchQuery:
|
|
749
|
-
onClick:
|
|
750
|
-
onDownload:
|
|
751
|
-
isSelected: e.name ===
|
|
756
|
+
children: /* @__PURE__ */ X(ve, {
|
|
757
|
+
attachment: ut(e),
|
|
758
|
+
searchQuery: ge,
|
|
759
|
+
onClick: y,
|
|
760
|
+
onDownload: S,
|
|
761
|
+
isSelected: e.name === w,
|
|
752
762
|
labels: {
|
|
753
763
|
clickLabel: A.openFileLabel(e.name),
|
|
754
|
-
downloadLabel:
|
|
764
|
+
downloadLabel: L(e.name)
|
|
755
765
|
}
|
|
756
766
|
})
|
|
757
767
|
}, e.name))
|
|
758
768
|
}),
|
|
759
|
-
/* @__PURE__ */ X(
|
|
769
|
+
/* @__PURE__ */ X(j, {
|
|
760
770
|
visuallyHidden: !0,
|
|
761
|
-
as:
|
|
762
|
-
children:
|
|
771
|
+
as: M.Span,
|
|
772
|
+
children: ge === "" ? "" : A.contextResultCountLabel(G.length)
|
|
763
773
|
})
|
|
764
|
-
] }),
|
|
774
|
+
] }), Ee = !T;
|
|
765
775
|
return /* @__PURE__ */ Z("div", {
|
|
766
|
-
style:
|
|
776
|
+
style: he,
|
|
767
777
|
className: d("flex size-full min-h-0 min-w-0 flex-1 flex-col", $.container),
|
|
768
778
|
children: [/* @__PURE__ */ Z("header", {
|
|
769
779
|
className: d("flex min-w-0 shrink-0 items-center gap-2 px-4 py-3 desktop:px-8 desktop:py-4", $.header),
|
|
@@ -779,21 +789,31 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
779
789
|
onClick: f
|
|
780
790
|
}),
|
|
781
791
|
/* @__PURE__ */ X("h1", {
|
|
782
|
-
className: d("min-w-0 flex-1",
|
|
792
|
+
className: d("min-w-0 flex-1", R, $.title),
|
|
783
793
|
children: /* @__PURE__ */ X(C, { text: t.name })
|
|
784
794
|
}),
|
|
785
795
|
/* @__PURE__ */ X(D, {
|
|
786
796
|
label: s ? A.unpinLabel : A.pinLabel,
|
|
787
|
-
iconBefore: X(s ?
|
|
797
|
+
iconBefore: X(s ? lt : H, {
|
|
788
798
|
size: b.MD,
|
|
789
799
|
"aria-hidden": !0,
|
|
790
800
|
stroke: x
|
|
791
801
|
}),
|
|
792
802
|
"aria-disabled": c || void 0,
|
|
793
803
|
onClick: be,
|
|
794
|
-
className: "shrink-0"
|
|
804
|
+
className: "hidden shrink-0 desktop:inline-flex"
|
|
795
805
|
}),
|
|
796
|
-
|
|
806
|
+
h && /* @__PURE__ */ X(F, {
|
|
807
|
+
label: ye,
|
|
808
|
+
iconBefore: /* @__PURE__ */ X(de, {
|
|
809
|
+
size: b.MD,
|
|
810
|
+
"aria-hidden": !0,
|
|
811
|
+
stroke: x
|
|
812
|
+
}),
|
|
813
|
+
onClick: h,
|
|
814
|
+
className: "hidden shrink-0 desktop:inline-flex"
|
|
815
|
+
}),
|
|
816
|
+
!h && m && /* @__PURE__ */ X(F, {
|
|
797
817
|
label: A.publishLabel,
|
|
798
818
|
iconBefore: /* @__PURE__ */ X(fe, {
|
|
799
819
|
size: b.MD,
|
|
@@ -803,35 +823,35 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
803
823
|
onClick: m,
|
|
804
824
|
className: "hidden shrink-0 desktop:inline-flex"
|
|
805
825
|
}),
|
|
806
|
-
|
|
826
|
+
g && /* @__PURE__ */ X(F, {
|
|
807
827
|
label: A.editLabel,
|
|
808
828
|
iconBefore: /* @__PURE__ */ X(V, {
|
|
809
829
|
size: b.MD,
|
|
810
830
|
"aria-hidden": !0,
|
|
811
831
|
stroke: x
|
|
812
832
|
}),
|
|
813
|
-
onClick:
|
|
833
|
+
onClick: g,
|
|
814
834
|
className: "hidden shrink-0 desktop:inline-flex"
|
|
815
835
|
}),
|
|
816
|
-
|
|
817
|
-
|
|
836
|
+
Ce(!1, "hidden desktop:block"),
|
|
837
|
+
Ce(!0, "desktop:hidden")
|
|
818
838
|
]
|
|
819
839
|
}), /* @__PURE__ */ Z("div", {
|
|
820
|
-
className: d("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",
|
|
821
|
-
children: [
|
|
822
|
-
"aria-label":
|
|
823
|
-
className: d("flex min-w-0 flex-1 flex-col px-4 py-6 desktop:px-8",
|
|
840
|
+
className: d("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto", Ee && "desktop:flex-row desktop:overflow-hidden", ne == null && Ee && "desktop:justify-end"),
|
|
841
|
+
children: [ne != null && /* @__PURE__ */ X("section", {
|
|
842
|
+
"aria-label": re,
|
|
843
|
+
className: d("flex min-w-0 flex-1 flex-col px-4 py-6 desktop:px-8", Ee && "desktop:overflow-y-auto"),
|
|
824
844
|
children: /* @__PURE__ */ X("div", {
|
|
825
845
|
className: "mx-auto flex w-full max-w-[748px] min-w-0 flex-col gap-5",
|
|
826
|
-
children:
|
|
846
|
+
children: ne
|
|
827
847
|
})
|
|
828
848
|
}), /* @__PURE__ */ Z("aside", {
|
|
829
|
-
"aria-labelledby":
|
|
830
|
-
className: d("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:px-8",
|
|
849
|
+
"aria-labelledby": J,
|
|
850
|
+
className: d("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:px-8", Ee && "desktop:w-[488px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s desktop:border-t-0", $.panel),
|
|
831
851
|
children: [
|
|
832
852
|
/* @__PURE__ */ X("h2", {
|
|
833
|
-
id:
|
|
834
|
-
className: d(
|
|
853
|
+
id: J,
|
|
854
|
+
className: d(se, $.title),
|
|
835
855
|
children: A.detailsLabel
|
|
836
856
|
}),
|
|
837
857
|
t.description !== "" && /* @__PURE__ */ Z("section", {
|
|
@@ -840,7 +860,7 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
840
860
|
className: d(ce, $.secondary),
|
|
841
861
|
children: A.descriptionLabel
|
|
842
862
|
}), /* @__PURE__ */ X("p", {
|
|
843
|
-
className: d("wrap-break-word whitespace-pre-line",
|
|
863
|
+
className: d("wrap-break-word whitespace-pre-line", U, $.body),
|
|
844
864
|
children: t.description
|
|
845
865
|
})]
|
|
846
866
|
}),
|
|
@@ -850,10 +870,10 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
850
870
|
className: d(ce, $.secondary),
|
|
851
871
|
children: A.instructionsLabel
|
|
852
872
|
}), /* @__PURE__ */ X("div", {
|
|
853
|
-
className: d("min-w-0 wrap-break-word",
|
|
873
|
+
className: d("min-w-0 wrap-break-word", U, $.body),
|
|
854
874
|
children: /* @__PURE__ */ X(i, {
|
|
855
875
|
content: t.instructions,
|
|
856
|
-
classNames:
|
|
876
|
+
classNames: Y
|
|
857
877
|
})
|
|
858
878
|
})]
|
|
859
879
|
}),
|
|
@@ -862,17 +882,17 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
862
882
|
children: [/* @__PURE__ */ X("h3", {
|
|
863
883
|
className: d(ce, $.secondary),
|
|
864
884
|
children: A.contextLabel
|
|
865
|
-
}),
|
|
885
|
+
}), Te()]
|
|
866
886
|
})
|
|
867
887
|
]
|
|
868
888
|
})]
|
|
869
889
|
})]
|
|
870
890
|
});
|
|
871
|
-
}),
|
|
891
|
+
}), pt = {
|
|
872
892
|
row: "_row_1030u_1",
|
|
873
893
|
readDot: "_readDot_1030u_6",
|
|
874
894
|
unreadDot: "_unreadDot_1030u_10"
|
|
875
|
-
},
|
|
895
|
+
}, mt = ({ item: t, labels: n, rowTitleClassName: r, unreadRowTitleClassName: i, onOpen: a, onRename: o, onDelete: s }) => {
|
|
876
896
|
let c = K(), [ee, l] = Y(!1), u = t.isUnread === !0, f = q(() => [...o ? [{
|
|
877
897
|
key: "rename",
|
|
878
898
|
label: n.renameLabel,
|
|
@@ -890,7 +910,7 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
890
910
|
o
|
|
891
911
|
]);
|
|
892
912
|
return /* @__PURE__ */ Z("li", {
|
|
893
|
-
className: d("group/row flex min-w-0 items-center gap-1 rounded-xl",
|
|
913
|
+
className: d("group/row flex min-w-0 items-center gap-1 rounded-xl", pt.row),
|
|
894
914
|
children: [
|
|
895
915
|
/* @__PURE__ */ Z("button", {
|
|
896
916
|
type: "button",
|
|
@@ -902,7 +922,7 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
902
922
|
t.leading ?? /* @__PURE__ */ X("span", {
|
|
903
923
|
"aria-hidden": !0,
|
|
904
924
|
className: "flex size-4 shrink-0 items-center justify-center",
|
|
905
|
-
children: /* @__PURE__ */ X("span", { className: d("size-[7.11px] rounded-full", u ?
|
|
925
|
+
children: /* @__PURE__ */ X("span", { className: d("size-[7.11px] rounded-full", u ? pt.unreadDot : pt.readDot) })
|
|
906
926
|
}),
|
|
907
927
|
/* @__PURE__ */ X(C, {
|
|
908
928
|
text: t.title,
|
|
@@ -911,7 +931,7 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
911
931
|
t.trailing ?? (u && t.leading != null && /* @__PURE__ */ X("span", {
|
|
912
932
|
"aria-hidden": !0,
|
|
913
933
|
className: "flex size-6 shrink-0 items-center justify-center",
|
|
914
|
-
children: /* @__PURE__ */ X("span", { className: d("size-[7.11px] rounded-full",
|
|
934
|
+
children: /* @__PURE__ */ X("span", { className: d("size-[7.11px] rounded-full", pt.unreadDot) })
|
|
915
935
|
}))
|
|
916
936
|
]
|
|
917
937
|
}),
|
|
@@ -939,7 +959,7 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
939
959
|
})
|
|
940
960
|
]
|
|
941
961
|
});
|
|
942
|
-
},
|
|
962
|
+
}, ht = W(({ items: e, isLoading: t = !1, hasError: n = !1, onRetry: r, hasMore: i = !1, isLoadingMore: a = !1, onLoadMore: s, isEmptyStateShown: c = !0, onOpen: l, onRename: u, onDelete: f, labels: p, typography: m, colors: h }) => {
|
|
943
963
|
let g = K(), _ = m?.titleClassName ?? "dial-body-semi-text", v = m?.rowTitleClassName ?? "dial-body-text", te = m?.unreadRowTitleClassName ?? "dial-body-semi-text", y = q(() => ee({
|
|
944
964
|
"--pcl-read-dot": h?.readDot,
|
|
945
965
|
"--pcl-unread-dot": h?.unreadDot,
|
|
@@ -960,9 +980,9 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
960
980
|
className: d("m-0", _),
|
|
961
981
|
children: p.title
|
|
962
982
|
}),
|
|
963
|
-
/* @__PURE__ */ X(
|
|
983
|
+
/* @__PURE__ */ X(j, {
|
|
964
984
|
visuallyHidden: !0,
|
|
965
|
-
children: t ? p.loadingLabel : n ? p.errorLabel : x ? /* @__PURE__ */ Z(
|
|
985
|
+
children: t ? p.loadingLabel : n ? p.errorLabel : x ? /* @__PURE__ */ Z(_e, { children: [
|
|
966
986
|
/* @__PURE__ */ X("span", { children: p.emptyTitle }),
|
|
967
987
|
" ",
|
|
968
988
|
/* @__PURE__ */ X("span", { children: p.emptyDescription })
|
|
@@ -990,9 +1010,9 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
990
1010
|
label: p.emptyTitle,
|
|
991
1011
|
description: p.emptyDescription
|
|
992
1012
|
})
|
|
993
|
-
}) : /* @__PURE__ */ Z(
|
|
1013
|
+
}) : /* @__PURE__ */ Z(_e, { children: [/* @__PURE__ */ X("ul", {
|
|
994
1014
|
className: "m-0 flex min-w-0 list-none flex-col gap-2 p-0",
|
|
995
|
-
children: e.map((e) => /* @__PURE__ */ X(
|
|
1015
|
+
children: e.map((e) => /* @__PURE__ */ X(mt, {
|
|
996
1016
|
item: e,
|
|
997
1017
|
labels: p,
|
|
998
1018
|
rowTitleClassName: v,
|
|
@@ -1001,7 +1021,7 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
1001
1021
|
onRename: u,
|
|
1002
1022
|
onDelete: f
|
|
1003
1023
|
}, e.id))
|
|
1004
|
-
}), i && s && /* @__PURE__ */ X(
|
|
1024
|
+
}), i && s && /* @__PURE__ */ X(A, {
|
|
1005
1025
|
className: "self-start",
|
|
1006
1026
|
label: p.loadMoreLabel ?? "See more",
|
|
1007
1027
|
disabled: a,
|
|
@@ -1009,8 +1029,8 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
1009
1029
|
})] })
|
|
1010
1030
|
]
|
|
1011
1031
|
});
|
|
1012
|
-
}),
|
|
1013
|
-
let te = K(), y = J(null), [S, C] = Y(null), [w, T] = Y(""), [E, D] = Y(), [k,
|
|
1032
|
+
}), gt = W(({ composer: e, outputs: n, hasOutputs: r = !1, items: i, isLoading: a = !1, hasError: o = !1, onRetry: s, hasMore: c, isLoadingMore: ee, onLoadMore: l, onOpen: u, onRename: d, onGenerateTitle: f, onDelete: p, labels: m, listTypography: h, listColors: _ }) => {
|
|
1033
|
+
let te = K(), y = J(null), [S, C] = Y(null), [w, T] = Y(""), [E, D] = Y(), [k, re] = Y(!1), [A, j] = Y(!1), M = J(0), [N, P] = Y(null), [F, ie] = Y(!1), oe = J(null), R = G(() => {
|
|
1014
1034
|
oe.current = document.activeElement;
|
|
1015
1035
|
}, []), z = G(() => {
|
|
1016
1036
|
let e = oe.current;
|
|
@@ -1023,37 +1043,37 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
1023
1043
|
r && !r.matches("button") && (r.tabIndex = -1), r?.focus();
|
|
1024
1044
|
}, 0);
|
|
1025
1045
|
}, []), V = G((e) => i.find((t) => t.id === e) ?? null, [i]);
|
|
1026
|
-
|
|
1046
|
+
ge(() => {
|
|
1027
1047
|
let e = (e) => e != null && i.some((t) => t.id === e.id);
|
|
1028
|
-
S && !k && !e(S) && (C(null), B(0)),
|
|
1048
|
+
S && !k && !e(S) && (C(null), B(0)), N && !F && !e(N) && (P(null), B(0));
|
|
1029
1049
|
}, [
|
|
1030
|
-
|
|
1050
|
+
N,
|
|
1031
1051
|
B,
|
|
1032
|
-
|
|
1052
|
+
F,
|
|
1033
1053
|
k,
|
|
1034
1054
|
i,
|
|
1035
1055
|
S
|
|
1036
1056
|
]);
|
|
1037
|
-
let
|
|
1057
|
+
let H = G((e) => {
|
|
1038
1058
|
R();
|
|
1039
1059
|
let t = V(e);
|
|
1040
|
-
|
|
1041
|
-
}, [V, R]),
|
|
1042
|
-
R(),
|
|
1043
|
-
}, [V, R]),
|
|
1044
|
-
k || (
|
|
1060
|
+
M.current += 1, j(!1), C(t), T(t?.title ?? ""), D(void 0);
|
|
1061
|
+
}, [V, R]), se = G((e) => {
|
|
1062
|
+
R(), P(V(e));
|
|
1063
|
+
}, [V, R]), ce = G(() => {
|
|
1064
|
+
k || (M.current += 1, j(!1), C(null), z());
|
|
1045
1065
|
}, [k, z]), le = G(() => {
|
|
1046
|
-
|
|
1047
|
-
}, [
|
|
1066
|
+
F || (P(null), z());
|
|
1067
|
+
}, [F, z]), ue = G(async () => {
|
|
1048
1068
|
if (!S || !d || k) return;
|
|
1049
1069
|
let e = w.trim();
|
|
1050
1070
|
if (!e) D(m.renameEmptyError);
|
|
1051
1071
|
else {
|
|
1052
|
-
|
|
1072
|
+
re(!0);
|
|
1053
1073
|
try {
|
|
1054
1074
|
await d(S.id, e), C(null), z();
|
|
1055
1075
|
} catch {} finally {
|
|
1056
|
-
|
|
1076
|
+
re(!1);
|
|
1057
1077
|
}
|
|
1058
1078
|
}
|
|
1059
1079
|
}, [
|
|
@@ -1063,68 +1083,68 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
1063
1083
|
S,
|
|
1064
1084
|
w,
|
|
1065
1085
|
z
|
|
1066
|
-
]),
|
|
1067
|
-
if (!S || !f ||
|
|
1068
|
-
let e = ++
|
|
1069
|
-
|
|
1086
|
+
]), de = G(async () => {
|
|
1087
|
+
if (!S || !f || A) return;
|
|
1088
|
+
let e = ++M.current;
|
|
1089
|
+
j(!0), D(void 0);
|
|
1070
1090
|
try {
|
|
1071
1091
|
let t = await f(S.id);
|
|
1072
|
-
if (e !==
|
|
1092
|
+
if (e !== M.current) return;
|
|
1073
1093
|
T(t);
|
|
1074
1094
|
} catch {
|
|
1075
|
-
if (e !==
|
|
1095
|
+
if (e !== M.current) return;
|
|
1076
1096
|
D(m.renameWithAiError ?? "Could not generate a name. Try again.");
|
|
1077
1097
|
} finally {
|
|
1078
|
-
e ===
|
|
1098
|
+
e === M.current && j(!1);
|
|
1079
1099
|
}
|
|
1080
1100
|
}, [
|
|
1081
|
-
|
|
1101
|
+
A,
|
|
1082
1102
|
m.renameWithAiError,
|
|
1083
1103
|
f,
|
|
1084
1104
|
S
|
|
1085
|
-
]),
|
|
1086
|
-
e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(),
|
|
1087
|
-
}, [
|
|
1088
|
-
if (!
|
|
1089
|
-
let e = i.findIndex((e) => e.id ===
|
|
1105
|
+
]), fe = G((e) => {
|
|
1106
|
+
e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), ue());
|
|
1107
|
+
}, [ue]), pe = G(async () => {
|
|
1108
|
+
if (!N || !p) return;
|
|
1109
|
+
let e = i.findIndex((e) => e.id === N.id);
|
|
1090
1110
|
ie(!0);
|
|
1091
1111
|
try {
|
|
1092
|
-
await p(
|
|
1112
|
+
await p(N.id), P(null), B(Math.max(e, 0));
|
|
1093
1113
|
} catch {} finally {
|
|
1094
1114
|
ie(!1);
|
|
1095
1115
|
}
|
|
1096
1116
|
}, [
|
|
1097
|
-
|
|
1117
|
+
N,
|
|
1098
1118
|
B,
|
|
1099
1119
|
i,
|
|
1100
1120
|
p
|
|
1101
|
-
]),
|
|
1121
|
+
]), me = q(() => [{
|
|
1102
1122
|
label: m.renameCancelLabel ?? "Cancel",
|
|
1103
1123
|
variant: v.Primary,
|
|
1104
1124
|
appearance: g.Ghost,
|
|
1105
1125
|
disabled: k,
|
|
1106
|
-
onClick:
|
|
1126
|
+
onClick: ce
|
|
1107
1127
|
}, {
|
|
1108
1128
|
label: m.renameSaveLabel,
|
|
1109
1129
|
variant: v.Primary,
|
|
1110
1130
|
disabled: k,
|
|
1111
1131
|
onClick: () => {
|
|
1112
|
-
|
|
1132
|
+
ue();
|
|
1113
1133
|
}
|
|
1114
1134
|
}], [
|
|
1115
|
-
|
|
1116
|
-
|
|
1135
|
+
ce,
|
|
1136
|
+
ue,
|
|
1117
1137
|
k,
|
|
1118
1138
|
m.renameCancelLabel,
|
|
1119
1139
|
m.renameSaveLabel
|
|
1120
1140
|
]);
|
|
1121
|
-
return /* @__PURE__ */ Z(
|
|
1141
|
+
return /* @__PURE__ */ Z(_e, { children: [
|
|
1122
1142
|
e,
|
|
1123
1143
|
n,
|
|
1124
1144
|
/* @__PURE__ */ X("div", {
|
|
1125
1145
|
ref: y,
|
|
1126
1146
|
className: "contents",
|
|
1127
|
-
children: /* @__PURE__ */ X(
|
|
1147
|
+
children: /* @__PURE__ */ X(ht, {
|
|
1128
1148
|
items: i,
|
|
1129
1149
|
isLoading: a,
|
|
1130
1150
|
hasError: o,
|
|
@@ -1134,19 +1154,19 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
1134
1154
|
onLoadMore: l,
|
|
1135
1155
|
isEmptyStateShown: !r,
|
|
1136
1156
|
onOpen: u,
|
|
1137
|
-
onRename: d ?
|
|
1138
|
-
onDelete: p ?
|
|
1157
|
+
onRename: d ? H : void 0,
|
|
1158
|
+
onDelete: p ? se : void 0,
|
|
1139
1159
|
labels: m.list,
|
|
1140
1160
|
typography: h,
|
|
1141
1161
|
colors: _
|
|
1142
1162
|
})
|
|
1143
1163
|
}),
|
|
1144
|
-
S && /* @__PURE__ */ X(
|
|
1164
|
+
S && /* @__PURE__ */ X(I, {
|
|
1145
1165
|
open: !0,
|
|
1146
1166
|
header: m.renameTitle,
|
|
1147
1167
|
size: L.Sm,
|
|
1148
|
-
mainButtons:
|
|
1149
|
-
onClose:
|
|
1168
|
+
mainButtons: me,
|
|
1169
|
+
onClose: ce,
|
|
1150
1170
|
children: /* @__PURE__ */ Z("div", {
|
|
1151
1171
|
className: "flex items-end gap-2 px-6 py-4",
|
|
1152
1172
|
children: [/* @__PURE__ */ X("div", {
|
|
@@ -1157,7 +1177,7 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
1157
1177
|
labelProps: { label: m.renameInputLabel },
|
|
1158
1178
|
error: E,
|
|
1159
1179
|
disabled: k,
|
|
1160
|
-
onKeyDown:
|
|
1180
|
+
onKeyDown: fe,
|
|
1161
1181
|
onChange: (e) => {
|
|
1162
1182
|
T(e ?? ""), D(void 0);
|
|
1163
1183
|
}
|
|
@@ -1165,16 +1185,16 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
1165
1185
|
}), f && /* @__PURE__ */ X(O, {
|
|
1166
1186
|
"aria-label": m.renameWithAiLabel ?? "Rename with AI",
|
|
1167
1187
|
tooltipProps: { tooltip: m.renameWithAiLabel ?? "Rename with AI" },
|
|
1168
|
-
disabled:
|
|
1169
|
-
"aria-busy":
|
|
1188
|
+
disabled: A || k,
|
|
1189
|
+
"aria-busy": A,
|
|
1170
1190
|
onClick: () => {
|
|
1171
|
-
|
|
1191
|
+
de();
|
|
1172
1192
|
},
|
|
1173
|
-
icon:
|
|
1193
|
+
icon: A ? /* @__PURE__ */ X("span", {
|
|
1174
1194
|
className: "flex",
|
|
1175
1195
|
"aria-hidden": !0,
|
|
1176
1196
|
children: /* @__PURE__ */ X(ae, { size: b.MD })
|
|
1177
|
-
}) : /* @__PURE__ */ X(
|
|
1197
|
+
}) : /* @__PURE__ */ X(U, {
|
|
1178
1198
|
size: b.MD,
|
|
1179
1199
|
stroke: x,
|
|
1180
1200
|
"aria-hidden": !0
|
|
@@ -1182,36 +1202,36 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
1182
1202
|
})]
|
|
1183
1203
|
})
|
|
1184
1204
|
}),
|
|
1185
|
-
|
|
1205
|
+
N && /* @__PURE__ */ X(t, {
|
|
1186
1206
|
open: !0,
|
|
1187
|
-
title: m.deleteTitle(
|
|
1188
|
-
names: [
|
|
1207
|
+
title: m.deleteTitle(N.title),
|
|
1208
|
+
names: [N.title],
|
|
1189
1209
|
message: m.deleteDescription,
|
|
1190
1210
|
labels: m.deleteDialog,
|
|
1191
|
-
isLoading:
|
|
1211
|
+
isLoading: F,
|
|
1192
1212
|
onConfirm: () => {
|
|
1193
|
-
|
|
1213
|
+
pe();
|
|
1194
1214
|
},
|
|
1195
1215
|
onClose: le
|
|
1196
1216
|
})
|
|
1197
1217
|
] });
|
|
1198
|
-
}),
|
|
1218
|
+
}), _t = {
|
|
1199
1219
|
title: "_title_17sbf_1",
|
|
1200
1220
|
secondary: "_secondary_17sbf_5"
|
|
1201
|
-
},
|
|
1221
|
+
}, vt = 6, yt = (e) => ({
|
|
1202
1222
|
id: e.name,
|
|
1203
1223
|
name: e.name,
|
|
1204
1224
|
contentType: e.contentType,
|
|
1205
1225
|
type: l(e.contentType),
|
|
1206
1226
|
status: s.Idle
|
|
1207
|
-
}),
|
|
1227
|
+
}), bt = W(({ items: e, onOpenOutput: t, selectedOutputName: n, hasError: r = !1, onRetry: i, previewLimit: a = vt, labels: o, styles: s }) => {
|
|
1208
1228
|
let c = K(), l = K(), u = J(null), f = J(!1), [p, m] = Y(!1), { colors: h, typography: g } = s ?? {}, _ = g?.titleClassName ?? "dial-body-semi-text", v = g?.helperClassName ?? "dial-tiny-text", te = o?.title ?? "Outputs", y = o?.errorLabel ?? "Could not load outputs", b = q(() => ee({
|
|
1209
1229
|
"--po-heading-text": h?.headingText,
|
|
1210
1230
|
"--po-secondary-text": h?.secondaryText
|
|
1211
1231
|
}), [h?.headingText, h?.secondaryText]), x = G(() => m((e) => !e), []), S = G(() => {
|
|
1212
1232
|
f.current = !0, i?.();
|
|
1213
1233
|
}, [i]);
|
|
1214
|
-
|
|
1234
|
+
ge(() => {
|
|
1215
1235
|
!r && f.current && (f.current = !1, u.current?.focus());
|
|
1216
1236
|
}, [r]);
|
|
1217
1237
|
let C = r || e.length > 0, w = e.length > a, T = p || !w ? e : e.slice(0, a), E = o?.openOutputLabel ?? ((e) => `Preview ${e}`), O = o?.seeAllLabel?.(e.length) ?? `See all (${e.length})`, k = o?.showLessLabel ?? "Show less";
|
|
@@ -1227,17 +1247,17 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
1227
1247
|
ref: u,
|
|
1228
1248
|
id: c,
|
|
1229
1249
|
tabIndex: -1,
|
|
1230
|
-
className: d("m-0",
|
|
1250
|
+
className: d("m-0", _t.title, _),
|
|
1231
1251
|
children: te
|
|
1232
|
-
}), !r && w && /* @__PURE__ */ X(
|
|
1252
|
+
}), !r && w && /* @__PURE__ */ X(A, {
|
|
1233
1253
|
label: p ? k : O,
|
|
1234
1254
|
"aria-expanded": p,
|
|
1235
1255
|
"aria-controls": l,
|
|
1236
1256
|
onClick: x
|
|
1237
1257
|
})]
|
|
1238
|
-
}), r ? /* @__PURE__ */ Z(
|
|
1258
|
+
}), r ? /* @__PURE__ */ Z(_e, { children: [/* @__PURE__ */ X("p", {
|
|
1239
1259
|
"aria-hidden": !0,
|
|
1240
|
-
className: d("m-0",
|
|
1260
|
+
className: d("m-0", _t.secondary, v),
|
|
1241
1261
|
children: y
|
|
1242
1262
|
}), i && /* @__PURE__ */ X(D, {
|
|
1243
1263
|
className: "self-start",
|
|
@@ -1248,20 +1268,20 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
1248
1268
|
className: d("m-0 flex min-w-0 list-none gap-2 p-0", p ? "flex-wrap" : "flex-nowrap overflow-x-auto"),
|
|
1249
1269
|
children: T.map((e) => /* @__PURE__ */ X("li", {
|
|
1250
1270
|
className: "shrink-0",
|
|
1251
|
-
children: /* @__PURE__ */ X(
|
|
1252
|
-
attachment:
|
|
1271
|
+
children: /* @__PURE__ */ X(ve, {
|
|
1272
|
+
attachment: yt(e),
|
|
1253
1273
|
onClick: t,
|
|
1254
1274
|
isSelected: e.name === n,
|
|
1255
1275
|
labels: { clickLabel: E(e.name) }
|
|
1256
1276
|
})
|
|
1257
1277
|
}, e.name))
|
|
1258
1278
|
})]
|
|
1259
|
-
}), /* @__PURE__ */ X(
|
|
1279
|
+
}), /* @__PURE__ */ X(j, {
|
|
1260
1280
|
visuallyHidden: !0,
|
|
1261
1281
|
children: r ? y : ""
|
|
1262
1282
|
})]
|
|
1263
1283
|
});
|
|
1264
|
-
}),
|
|
1284
|
+
}), xt = W(({ projectName: e, projectHref: t, onBack: n, onProjectLinkClick: r, backLabel: i, className: a, nameClassName: o = "dial-body-text" }) => /* @__PURE__ */ Z("nav", {
|
|
1265
1285
|
"aria-label": i,
|
|
1266
1286
|
className: d("flex min-w-0 shrink-0 items-center gap-2 border-b px-4 py-2", a),
|
|
1267
1287
|
children: [/* @__PURE__ */ X(O, {
|
|
@@ -1284,4 +1304,4 @@ var Se = /* @__PURE__ */ function(e) {
|
|
|
1284
1304
|
})]
|
|
1285
1305
|
}));
|
|
1286
1306
|
//#endregion
|
|
1287
|
-
export {
|
|
1307
|
+
export { ze as ContextFileRejection, Ve as PROJECT_NAME_MAX_BYTES, xt as ProjectChatHeader, ht as ProjectConversationList, gt as ProjectConversationsPanel, ct as ProjectCreateForm, Be as ProjectNameError, bt as ProjectOutputs, Ie as ProjectSource, ft as ProjectView, Fe as Projects, Ce as ProjectsSortKey, tt as checkContextFiles, nt as filterContextFileItems, Xe as getContextFilesSize, Je as isStoredContextFile, Ke as validateProjectName };
|