@epam/ai-dial-projects 1.3.0-rc.2 → 1.4.0-dev.12
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectConversationsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/ProjectConversationsPanel/ProjectConversationsPanel.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"ProjectConversationsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/ProjectConversationsPanel/ProjectConversationsPanel.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,gDAAgD,CAAC;AAmTrG,yGAAyG;AACzG,eAAO,MAAM,yBAAyB,sEAErC,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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 re, LinkButton as A, LiveRegion as j, LiveRegionElement as
|
|
3
|
-
import { IconArrowNarrowLeft 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
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
5
|
import { Fragment as _e, jsx as X, jsxs as Z } from "react/jsx-runtime";
|
|
6
6
|
import { AttachmentCard as ve, FileDndOverlay as ye } from "@epam/ai-dial-attachment-input";
|
|
@@ -86,7 +86,7 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
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 Ce = /* @__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
|
|
@@ -132,7 +132,7 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
132
132
|
subtitle: "_subtitle_4rer8_5",
|
|
133
133
|
sortButton: "_sortButton_4rer8_9"
|
|
134
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",
|
|
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,31 +141,31 @@ var Ce = /* @__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
|
-
}),
|
|
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 :
|
|
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, fe = () => t ? /* @__PURE__ */ X(
|
|
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
171
|
className: d(k, Pe.subtitle),
|
|
@@ -177,19 +177,19 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
177
177
|
}) : e.length === 0 ? /* @__PURE__ */ X(o, {
|
|
178
178
|
label: y.emptyStateLabel,
|
|
179
179
|
description: y.emptyStateDescription,
|
|
180
|
-
action:
|
|
180
|
+
action: de(v.Secondary, "mt-2"),
|
|
181
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
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
|
-
searchQuery:
|
|
192
|
+
searchQuery: z,
|
|
193
193
|
sourceLabel: y.sourceLabels[e.source],
|
|
194
194
|
folderPathLabel: y.folderPathLabel,
|
|
195
195
|
pinnedLabel: y.pinnedLabel ?? "Pinned",
|
|
@@ -197,21 +197,21 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
197
197
|
onTogglePin: s,
|
|
198
198
|
href: l?.(e.id),
|
|
199
199
|
onOpen: c,
|
|
200
|
-
now:
|
|
200
|
+
now: oe,
|
|
201
201
|
locale: C,
|
|
202
|
-
updatedAtClassName:
|
|
202
|
+
updatedAtClassName: N,
|
|
203
203
|
titleClassName: ne,
|
|
204
204
|
pathLabelClassName: re,
|
|
205
205
|
pathLeafClassName: A
|
|
206
206
|
}, e.id))
|
|
207
|
-
}), pe = t || n ||
|
|
207
|
+
}), pe = t || n || V, me = "mt-6 p-3 desktop:mt-0";
|
|
208
208
|
return /* @__PURE__ */ Z("div", {
|
|
209
|
-
style:
|
|
209
|
+
style: I,
|
|
210
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: [
|
|
214
|
-
|
|
214
|
+
L ? /* @__PURE__ */ X("h1", {
|
|
215
215
|
className: "sr-only",
|
|
216
216
|
children: y.title
|
|
217
217
|
}) : /* @__PURE__ */ Z("div", {
|
|
@@ -225,33 +225,33 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
225
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",
|
|
232
232
|
children: [/* @__PURE__ */ X("div", {
|
|
233
233
|
role: "search",
|
|
234
234
|
className: "min-w-0 flex-1",
|
|
235
|
-
children: /* @__PURE__ */ X(
|
|
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,
|
|
241
|
-
size:
|
|
241
|
+
size: L ? S.Standard : S.Large
|
|
242
242
|
})
|
|
243
243
|
}), y.sortOptions.length > 0 && /* @__PURE__ */ X("div", {
|
|
244
244
|
role: "group",
|
|
245
245
|
"aria-label": y.sortLabel,
|
|
246
246
|
className: "shrink-0",
|
|
247
247
|
children: /* @__PURE__ */ X(_, {
|
|
248
|
-
items:
|
|
249
|
-
label:
|
|
248
|
+
items: le,
|
|
249
|
+
label: se,
|
|
250
250
|
variant: v.Primary,
|
|
251
251
|
appearance: g.Ghost,
|
|
252
|
-
size:
|
|
253
|
-
iconBefore: /* @__PURE__ */ X(
|
|
254
|
-
size:
|
|
252
|
+
size: L ? S.Small : S.Standard,
|
|
253
|
+
iconBefore: /* @__PURE__ */ X(R, {
|
|
254
|
+
size: L ? b.SM : b.MD,
|
|
255
255
|
"aria-hidden": !0,
|
|
256
256
|
stroke: x
|
|
257
257
|
}),
|
|
@@ -261,12 +261,12 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
261
261
|
}),
|
|
262
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
|
-
children: [
|
|
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
272
|
className: d(k, Pe.subtitle),
|
|
@@ -281,9 +281,9 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
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
|
|
@@ -365,17 +365,17 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
365
365
|
dropZone: "_dropZone_ru73x_11",
|
|
366
366
|
label: "_label_ru73x_20",
|
|
367
367
|
link: "_link_ru73x_24"
|
|
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:
|
|
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
|
-
}), fe =
|
|
375
|
-
t.name ? Se =
|
|
376
|
-
let Ce = [D &&
|
|
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
|
+
let Ce = [D && ie, Se].filter(Boolean).join(" ") || void 0;
|
|
377
377
|
ge(() => {
|
|
378
|
-
t.name && !D &&
|
|
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;
|
|
@@ -384,10 +384,10 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
384
384
|
maxFileBytes: h,
|
|
385
385
|
maxTotalBytes: g
|
|
386
386
|
});
|
|
387
|
-
|
|
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
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)),
|
|
390
|
+
o(a.filter((t) => t.id !== e)), le([]), t && ue(O.fileRemovedStatus(t.name));
|
|
391
391
|
}, Q = async (e) => {
|
|
392
392
|
if (e.preventDefault(), e.stopPropagation(), _) try {
|
|
393
393
|
let e = await _();
|
|
@@ -395,11 +395,11 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
395
395
|
} catch {}
|
|
396
396
|
}, je = () => {
|
|
397
397
|
_e || C();
|
|
398
|
-
}, { colors: Me, typography: Ne } =
|
|
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 = [...
|
|
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
403
|
fromDevice: /* @__PURE__ */ X("span", { className: rt.link }),
|
|
404
404
|
fileManager: _ ? /* @__PURE__ */ X("button", {
|
|
405
405
|
type: "button",
|
|
@@ -434,7 +434,7 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
434
434
|
isSubmitDisabled: _e,
|
|
435
435
|
isSubmitting: E,
|
|
436
436
|
footerActionsOrder: be.SubmitFirst,
|
|
437
|
-
backIcon: /* @__PURE__ */ X(
|
|
437
|
+
backIcon: /* @__PURE__ */ X(oe, {
|
|
438
438
|
size: b.LG,
|
|
439
439
|
stroke: x,
|
|
440
440
|
"aria-hidden": !0,
|
|
@@ -455,13 +455,13 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
455
455
|
className: "flex flex-col gap-1",
|
|
456
456
|
children: [
|
|
457
457
|
/* @__PURE__ */ X(ne, {
|
|
458
|
-
id:
|
|
459
|
-
inputRef:
|
|
458
|
+
id: F,
|
|
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,
|
|
@@ -477,18 +477,18 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
477
477
|
"aria-describedby": Ce
|
|
478
478
|
}),
|
|
479
479
|
D && /* @__PURE__ */ X(te, {
|
|
480
|
-
id:
|
|
480
|
+
id: ie,
|
|
481
481
|
className: Ie,
|
|
482
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
|
-
id:
|
|
491
|
+
id: L,
|
|
492
492
|
className: Ie,
|
|
493
493
|
text: W
|
|
494
494
|
})
|
|
@@ -496,28 +496,28 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
496
496
|
}),
|
|
497
497
|
/* @__PURE__ */ X(c, {
|
|
498
498
|
isEnabled: !!v,
|
|
499
|
-
fieldId:
|
|
499
|
+
fieldId: R,
|
|
500
500
|
label: O.instructionsLabel,
|
|
501
501
|
labelClassName: Fe,
|
|
502
502
|
labels: ze,
|
|
503
|
-
refinement:
|
|
503
|
+
refinement: de,
|
|
504
504
|
disabled: E || fe,
|
|
505
505
|
children: /* @__PURE__ */ Z("div", {
|
|
506
506
|
className: "flex flex-1 flex-col gap-2",
|
|
507
507
|
children: [!v && /* @__PURE__ */ X(re, {
|
|
508
|
-
htmlFor:
|
|
508
|
+
htmlFor: R,
|
|
509
509
|
className: Fe,
|
|
510
510
|
label: O.instructionsLabel
|
|
511
511
|
}), /* @__PURE__ */ X("div", {
|
|
512
|
-
ref:
|
|
512
|
+
ref: V,
|
|
513
513
|
className: d("w-full", n, r),
|
|
514
514
|
children: /* @__PURE__ */ X(me, {
|
|
515
|
-
fallback: /* @__PURE__ */ X(
|
|
515
|
+
fallback: /* @__PURE__ */ X(ae, { ariaLabel: O.editorLoadingAriaLabel ?? "Loading editor" }),
|
|
516
516
|
children: /* @__PURE__ */ X(it, {
|
|
517
|
-
id:
|
|
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,
|
|
@@ -528,11 +528,11 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
528
528
|
})
|
|
529
529
|
}),
|
|
530
530
|
/* @__PURE__ */ Z("section", {
|
|
531
|
-
"aria-labelledby":
|
|
531
|
+
"aria-labelledby": z,
|
|
532
532
|
className: "flex flex-col gap-2",
|
|
533
533
|
children: [
|
|
534
534
|
/* @__PURE__ */ X("h2", {
|
|
535
|
-
id:
|
|
535
|
+
id: z,
|
|
536
536
|
className: Fe,
|
|
537
537
|
children: O.contextLabel
|
|
538
538
|
}),
|
|
@@ -550,7 +550,7 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
550
550
|
}),
|
|
551
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", {
|
|
@@ -578,8 +578,8 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
578
578
|
}),
|
|
579
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
|
});
|
|
@@ -625,13 +625,13 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
625
625
|
contentType: e.contentType,
|
|
626
626
|
type: l(e.contentType),
|
|
627
627
|
status: s.Idle
|
|
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:
|
|
629
|
-
let { colors:
|
|
630
|
-
"--pv-bg":
|
|
631
|
-
"--pv-border":
|
|
632
|
-
"--pv-heading-text":
|
|
633
|
-
"--pv-body-text":
|
|
634
|
-
"--pv-secondary-text":
|
|
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
|
+
"--pv-bg": P?.background,
|
|
631
|
+
"--pv-border": P?.border,
|
|
632
|
+
"--pv-heading-text": P?.headingText,
|
|
633
|
+
"--pv-body-text": P?.bodyText,
|
|
634
|
+
"--pv-secondary-text": P?.secondaryText
|
|
635
635
|
}), W = q(() => t?.contextFiles ?? [], [t]), G = q(() => nt(W, l), [W, l]), ge = l.trim(), J = K(), Y = q(() => {
|
|
636
636
|
let e = d("mb-1 mt-3 first:mt-0", me);
|
|
637
637
|
return {
|
|
@@ -641,11 +641,11 @@ var Ce = /* @__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
649
|
c || p();
|
|
650
650
|
}, xe = (e) => /* @__PURE__ */ X(e, {
|
|
651
651
|
size: b.SM,
|
|
@@ -656,12 +656,12 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
656
656
|
return e && t.push({
|
|
657
657
|
key: "pin",
|
|
658
658
|
label: s ? A.unpinLabel : A.pinLabel,
|
|
659
|
-
icon: xe(s ? lt :
|
|
659
|
+
icon: xe(s ? lt : H),
|
|
660
660
|
onClick: be
|
|
661
661
|
}), e && h ? t.push({
|
|
662
662
|
key: "unpublish",
|
|
663
663
|
label: ye,
|
|
664
|
-
icon: xe(
|
|
664
|
+
icon: xe(de),
|
|
665
665
|
onClick: h
|
|
666
666
|
}) : e && m && t.push({
|
|
667
667
|
key: "publish",
|
|
@@ -671,22 +671,22 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
671
671
|
}), e && g && t.push({
|
|
672
672
|
key: "edit",
|
|
673
673
|
label: A.editLabel,
|
|
674
|
-
icon: xe(
|
|
674
|
+
icon: xe(V),
|
|
675
675
|
onClick: g
|
|
676
676
|
}), _ && t.push({
|
|
677
677
|
key: "share",
|
|
678
678
|
label: A.shareLabel,
|
|
679
|
-
icon: xe(
|
|
679
|
+
icon: xe(le),
|
|
680
680
|
onClick: _
|
|
681
681
|
}), t.push({
|
|
682
682
|
key: "download",
|
|
683
683
|
label: A.downloadLabel,
|
|
684
|
-
icon: xe(
|
|
684
|
+
icon: xe(B),
|
|
685
685
|
onClick: te
|
|
686
686
|
}), v && t.push({
|
|
687
687
|
key: "delete",
|
|
688
688
|
label: A.deleteLabel,
|
|
689
|
-
icon: xe(
|
|
689
|
+
icon: xe(ue),
|
|
690
690
|
danger: !0,
|
|
691
691
|
onClick: v
|
|
692
692
|
}), t;
|
|
@@ -699,7 +699,7 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
699
699
|
matchReferenceWidth: !1,
|
|
700
700
|
listClassName: "w-[200px]",
|
|
701
701
|
children: /* @__PURE__ */ X(O, {
|
|
702
|
-
icon: /* @__PURE__ */ X(
|
|
702
|
+
icon: /* @__PURE__ */ X(z, {
|
|
703
703
|
size: b.MD,
|
|
704
704
|
"aria-hidden": !0,
|
|
705
705
|
stroke: x
|
|
@@ -707,11 +707,11 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
707
707
|
"aria-label": A.moreActionsLabel
|
|
708
708
|
})
|
|
709
709
|
})
|
|
710
|
-
}), we = () => n ? /* @__PURE__ */ X(
|
|
710
|
+
}), we = () => n ? /* @__PURE__ */ X(ae, { ariaLabel: A.loadingAriaLabel ?? "Loading project" }) : r ? /* @__PURE__ */ Z("div", {
|
|
711
711
|
className: "flex flex-col items-center gap-3",
|
|
712
712
|
children: [/* @__PURE__ */ X("p", {
|
|
713
713
|
"aria-hidden": !0,
|
|
714
|
-
className: d(
|
|
714
|
+
className: d(U, $.body),
|
|
715
715
|
children: A.errorLabel
|
|
716
716
|
}), /* @__PURE__ */ X(D, {
|
|
717
717
|
label: A.retryLabel,
|
|
@@ -720,7 +720,7 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
720
720
|
}) : /* @__PURE__ */ Z("div", {
|
|
721
721
|
className: "flex flex-col items-center gap-3",
|
|
722
722
|
children: [/* @__PURE__ */ X("p", {
|
|
723
|
-
className: d(
|
|
723
|
+
className: d(U, $.body),
|
|
724
724
|
children: A.notFoundLabel
|
|
725
725
|
}), /* @__PURE__ */ X(D, {
|
|
726
726
|
label: A.browseProjectsLabel,
|
|
@@ -738,7 +738,7 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
738
738
|
let Te = () => W.length === 0 ? /* @__PURE__ */ X(o, { label: A.emptyContextLabel }) : /* @__PURE__ */ Z(_e, { children: [
|
|
739
739
|
/* @__PURE__ */ X("div", {
|
|
740
740
|
role: "search",
|
|
741
|
-
children: /* @__PURE__ */ X(
|
|
741
|
+
children: /* @__PURE__ */ X(ie, {
|
|
742
742
|
value: l,
|
|
743
743
|
onChange: (e) => u(e ?? ""),
|
|
744
744
|
placeholder: A.contextSearchPlaceholder,
|
|
@@ -761,14 +761,14 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
761
761
|
isSelected: e.name === w,
|
|
762
762
|
labels: {
|
|
763
763
|
clickLabel: A.openFileLabel(e.name),
|
|
764
|
-
downloadLabel:
|
|
764
|
+
downloadLabel: L(e.name)
|
|
765
765
|
}
|
|
766
766
|
})
|
|
767
767
|
}, e.name))
|
|
768
768
|
}),
|
|
769
769
|
/* @__PURE__ */ X(j, {
|
|
770
770
|
visuallyHidden: !0,
|
|
771
|
-
as:
|
|
771
|
+
as: M.Span,
|
|
772
772
|
children: ge === "" ? "" : A.contextResultCountLabel(G.length)
|
|
773
773
|
})
|
|
774
774
|
] }), Ee = !T;
|
|
@@ -779,7 +779,7 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
779
779
|
className: d("flex min-w-0 shrink-0 items-center gap-2 px-4 py-3 desktop:px-8 desktop:py-4", $.header),
|
|
780
780
|
children: [
|
|
781
781
|
/* @__PURE__ */ X(O, {
|
|
782
|
-
icon: /* @__PURE__ */ X(
|
|
782
|
+
icon: /* @__PURE__ */ X(oe, {
|
|
783
783
|
size: b.LG,
|
|
784
784
|
className: "rtl:scale-x-[-1]",
|
|
785
785
|
"aria-hidden": !0,
|
|
@@ -789,12 +789,12 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
789
789
|
onClick: f
|
|
790
790
|
}),
|
|
791
791
|
/* @__PURE__ */ X("h1", {
|
|
792
|
-
className: d("min-w-0 flex-1",
|
|
792
|
+
className: d("min-w-0 flex-1", R, $.title),
|
|
793
793
|
children: /* @__PURE__ */ X(C, { text: t.name })
|
|
794
794
|
}),
|
|
795
795
|
/* @__PURE__ */ X(D, {
|
|
796
796
|
label: s ? A.unpinLabel : A.pinLabel,
|
|
797
|
-
iconBefore: X(s ? lt :
|
|
797
|
+
iconBefore: X(s ? lt : H, {
|
|
798
798
|
size: b.MD,
|
|
799
799
|
"aria-hidden": !0,
|
|
800
800
|
stroke: x
|
|
@@ -803,9 +803,9 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
803
803
|
onClick: be,
|
|
804
804
|
className: "hidden shrink-0 desktop:inline-flex"
|
|
805
805
|
}),
|
|
806
|
-
h && /* @__PURE__ */ X(
|
|
806
|
+
h && /* @__PURE__ */ X(F, {
|
|
807
807
|
label: ye,
|
|
808
|
-
iconBefore: /* @__PURE__ */ X(
|
|
808
|
+
iconBefore: /* @__PURE__ */ X(de, {
|
|
809
809
|
size: b.MD,
|
|
810
810
|
"aria-hidden": !0,
|
|
811
811
|
stroke: x
|
|
@@ -813,7 +813,7 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
813
813
|
onClick: h,
|
|
814
814
|
className: "hidden shrink-0 desktop:inline-flex"
|
|
815
815
|
}),
|
|
816
|
-
!h && m && /* @__PURE__ */ X(
|
|
816
|
+
!h && m && /* @__PURE__ */ X(F, {
|
|
817
817
|
label: A.publishLabel,
|
|
818
818
|
iconBefore: /* @__PURE__ */ X(fe, {
|
|
819
819
|
size: b.MD,
|
|
@@ -823,9 +823,9 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
823
823
|
onClick: m,
|
|
824
824
|
className: "hidden shrink-0 desktop:inline-flex"
|
|
825
825
|
}),
|
|
826
|
-
g && /* @__PURE__ */ X(
|
|
826
|
+
g && /* @__PURE__ */ X(F, {
|
|
827
827
|
label: A.editLabel,
|
|
828
|
-
iconBefore: /* @__PURE__ */ X(
|
|
828
|
+
iconBefore: /* @__PURE__ */ X(V, {
|
|
829
829
|
size: b.MD,
|
|
830
830
|
"aria-hidden": !0,
|
|
831
831
|
stroke: x
|
|
@@ -851,26 +851,26 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
851
851
|
children: [
|
|
852
852
|
/* @__PURE__ */ X("h2", {
|
|
853
853
|
id: J,
|
|
854
|
-
className: d(
|
|
854
|
+
className: d(se, $.title),
|
|
855
855
|
children: A.detailsLabel
|
|
856
856
|
}),
|
|
857
857
|
t.description !== "" && /* @__PURE__ */ Z("section", {
|
|
858
858
|
className: "flex min-w-0 flex-col gap-1",
|
|
859
859
|
children: [/* @__PURE__ */ X("h3", {
|
|
860
|
-
className: d(
|
|
860
|
+
className: d(ce, $.secondary),
|
|
861
861
|
children: A.descriptionLabel
|
|
862
862
|
}), /* @__PURE__ */ X("p", {
|
|
863
|
-
className: d("wrap-break-word whitespace-pre-line",
|
|
863
|
+
className: d("wrap-break-word whitespace-pre-line", U, $.body),
|
|
864
864
|
children: t.description
|
|
865
865
|
})]
|
|
866
866
|
}),
|
|
867
867
|
t.instructions !== "" && /* @__PURE__ */ Z("section", {
|
|
868
868
|
className: "flex min-w-0 flex-col gap-1",
|
|
869
869
|
children: [/* @__PURE__ */ X("h3", {
|
|
870
|
-
className: d(
|
|
870
|
+
className: d(ce, $.secondary),
|
|
871
871
|
children: A.instructionsLabel
|
|
872
872
|
}), /* @__PURE__ */ X("div", {
|
|
873
|
-
className: d("min-w-0 wrap-break-word",
|
|
873
|
+
className: d("min-w-0 wrap-break-word", U, $.body),
|
|
874
874
|
children: /* @__PURE__ */ X(i, {
|
|
875
875
|
content: t.instructions,
|
|
876
876
|
classNames: Y
|
|
@@ -880,7 +880,7 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
880
880
|
/* @__PURE__ */ Z("section", {
|
|
881
881
|
className: "flex min-w-0 flex-col gap-2",
|
|
882
882
|
children: [/* @__PURE__ */ X("h3", {
|
|
883
|
-
className: d(
|
|
883
|
+
className: d(ce, $.secondary),
|
|
884
884
|
children: A.contextLabel
|
|
885
885
|
}), Te()]
|
|
886
886
|
})
|
|
@@ -950,7 +950,7 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
950
950
|
"aria-label": n.moreActionsLabel(t.title),
|
|
951
951
|
size: S.Small,
|
|
952
952
|
className: d("me-2 shrink-0", !ee && "desktop:opacity-0 desktop:group-focus-within/row:opacity-100 desktop:group-hover/row:opacity-100"),
|
|
953
|
-
icon: /* @__PURE__ */ X(
|
|
953
|
+
icon: /* @__PURE__ */ X(z, {
|
|
954
954
|
"aria-hidden": !0,
|
|
955
955
|
size: b.SM,
|
|
956
956
|
stroke: x
|
|
@@ -992,7 +992,7 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
992
992
|
className: "flex justify-center py-6",
|
|
993
993
|
children: /* @__PURE__ */ X("span", {
|
|
994
994
|
"aria-hidden": !0,
|
|
995
|
-
children: /* @__PURE__ */ X(
|
|
995
|
+
children: /* @__PURE__ */ X(ae, {})
|
|
996
996
|
})
|
|
997
997
|
}) : n ? /* @__PURE__ */ Z("div", {
|
|
998
998
|
className: "flex flex-col items-center gap-3 py-6 text-center",
|
|
@@ -1030,114 +1030,111 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
1030
1030
|
]
|
|
1031
1031
|
});
|
|
1032
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),
|
|
1034
|
-
|
|
1035
|
-
}, []),
|
|
1036
|
-
let e =
|
|
1037
|
-
|
|
1038
|
-
}, []),
|
|
1039
|
-
|
|
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(() => {
|
|
1034
|
+
oe.current = document.activeElement;
|
|
1035
|
+
}, []), z = G(() => {
|
|
1036
|
+
let e = oe.current;
|
|
1037
|
+
oe.current = null, e?.isConnected && window.setTimeout(() => e.focus(), 0);
|
|
1038
|
+
}, []), B = G((e) => {
|
|
1039
|
+
oe.current = null, window.setTimeout(() => {
|
|
1040
1040
|
let t = y.current;
|
|
1041
1041
|
if (!t) return;
|
|
1042
1042
|
let n = t.querySelectorAll("li > button"), r = n[Math.min(e, n.length - 1)] ?? t.querySelector("h2, section");
|
|
1043
1043
|
r && !r.matches("button") && (r.tabIndex = -1), r?.focus();
|
|
1044
1044
|
}, 0);
|
|
1045
|
-
}, []),
|
|
1045
|
+
}, []), V = G((e) => i.find((t) => t.id === e) ?? null, [i]);
|
|
1046
1046
|
ge(() => {
|
|
1047
1047
|
let e = (e) => e != null && i.some((t) => t.id === e.id);
|
|
1048
|
-
S && !k && !e(S) && (C(null),
|
|
1048
|
+
S && !k && !e(S) && (C(null), B(0)), N && !F && !e(N) && (P(null), B(0));
|
|
1049
1049
|
}, [
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1050
|
+
N,
|
|
1051
|
+
B,
|
|
1052
|
+
F,
|
|
1053
1053
|
k,
|
|
1054
1054
|
i,
|
|
1055
1055
|
S
|
|
1056
1056
|
]);
|
|
1057
|
-
let
|
|
1058
|
-
|
|
1059
|
-
let t =
|
|
1060
|
-
|
|
1061
|
-
}, [
|
|
1062
|
-
|
|
1063
|
-
}, [
|
|
1064
|
-
k || (
|
|
1065
|
-
}, [k,
|
|
1066
|
-
|
|
1067
|
-
}, [
|
|
1068
|
-
if (!S || !d || k
|
|
1057
|
+
let H = G((e) => {
|
|
1058
|
+
R();
|
|
1059
|
+
let t = V(e);
|
|
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());
|
|
1065
|
+
}, [k, z]), le = G(() => {
|
|
1066
|
+
F || (P(null), z());
|
|
1067
|
+
}, [F, z]), ue = G(async () => {
|
|
1068
|
+
if (!S || !d || k) return;
|
|
1069
1069
|
let e = w.trim();
|
|
1070
1070
|
if (!e) D(m.renameEmptyError);
|
|
1071
1071
|
else {
|
|
1072
1072
|
re(!0);
|
|
1073
1073
|
try {
|
|
1074
|
-
await d(S.id, e), C(null),
|
|
1074
|
+
await d(S.id, e), C(null), z();
|
|
1075
1075
|
} catch {} finally {
|
|
1076
1076
|
re(!1);
|
|
1077
1077
|
}
|
|
1078
1078
|
}
|
|
1079
1079
|
}, [
|
|
1080
1080
|
k,
|
|
1081
|
-
de,
|
|
1082
1081
|
m.renameEmptyError,
|
|
1083
1082
|
d,
|
|
1084
1083
|
S,
|
|
1085
1084
|
w,
|
|
1086
|
-
|
|
1087
|
-
]),
|
|
1085
|
+
z
|
|
1086
|
+
]), de = G(async () => {
|
|
1088
1087
|
if (!S || !f || A) return;
|
|
1089
|
-
let e = ++
|
|
1088
|
+
let e = ++M.current;
|
|
1090
1089
|
j(!0), D(void 0);
|
|
1091
1090
|
try {
|
|
1092
1091
|
let t = await f(S.id);
|
|
1093
|
-
if (e !==
|
|
1092
|
+
if (e !== M.current) return;
|
|
1094
1093
|
T(t);
|
|
1095
1094
|
} catch {
|
|
1096
|
-
if (e !==
|
|
1095
|
+
if (e !== M.current) return;
|
|
1097
1096
|
D(m.renameWithAiError ?? "Could not generate a name. Try again.");
|
|
1098
1097
|
} finally {
|
|
1099
|
-
e ===
|
|
1098
|
+
e === M.current && j(!1);
|
|
1100
1099
|
}
|
|
1101
1100
|
}, [
|
|
1102
1101
|
A,
|
|
1103
1102
|
m.renameWithAiError,
|
|
1104
1103
|
f,
|
|
1105
1104
|
S
|
|
1106
|
-
]),
|
|
1107
|
-
e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(),
|
|
1108
|
-
}, [
|
|
1109
|
-
if (!
|
|
1110
|
-
let e = i.findIndex((e) => e.id ===
|
|
1111
|
-
|
|
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);
|
|
1110
|
+
ie(!0);
|
|
1112
1111
|
try {
|
|
1113
|
-
await p(
|
|
1112
|
+
await p(N.id), P(null), B(Math.max(e, 0));
|
|
1114
1113
|
} catch {} finally {
|
|
1115
|
-
|
|
1114
|
+
ie(!1);
|
|
1116
1115
|
}
|
|
1117
1116
|
}, [
|
|
1118
|
-
|
|
1119
|
-
|
|
1117
|
+
N,
|
|
1118
|
+
B,
|
|
1120
1119
|
i,
|
|
1121
1120
|
p
|
|
1122
|
-
]),
|
|
1121
|
+
]), me = q(() => [{
|
|
1123
1122
|
label: m.renameCancelLabel ?? "Cancel",
|
|
1124
1123
|
variant: v.Primary,
|
|
1125
1124
|
appearance: g.Ghost,
|
|
1126
1125
|
disabled: k,
|
|
1127
|
-
onClick:
|
|
1126
|
+
onClick: ce
|
|
1128
1127
|
}, {
|
|
1129
1128
|
label: m.renameSaveLabel,
|
|
1130
1129
|
variant: v.Primary,
|
|
1131
|
-
disabled: k
|
|
1130
|
+
disabled: k,
|
|
1132
1131
|
onClick: () => {
|
|
1133
|
-
|
|
1132
|
+
ue();
|
|
1134
1133
|
}
|
|
1135
1134
|
}], [
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
de,
|
|
1135
|
+
ce,
|
|
1136
|
+
ue,
|
|
1139
1137
|
k,
|
|
1140
|
-
w,
|
|
1141
1138
|
m.renameCancelLabel,
|
|
1142
1139
|
m.renameSaveLabel
|
|
1143
1140
|
]);
|
|
@@ -1157,19 +1154,19 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
1157
1154
|
onLoadMore: l,
|
|
1158
1155
|
isEmptyStateShown: !r,
|
|
1159
1156
|
onOpen: u,
|
|
1160
|
-
onRename: d ?
|
|
1161
|
-
onDelete: p ?
|
|
1157
|
+
onRename: d ? H : void 0,
|
|
1158
|
+
onDelete: p ? se : void 0,
|
|
1162
1159
|
labels: m.list,
|
|
1163
1160
|
typography: h,
|
|
1164
1161
|
colors: _
|
|
1165
1162
|
})
|
|
1166
1163
|
}),
|
|
1167
|
-
S && /* @__PURE__ */ X(
|
|
1164
|
+
S && /* @__PURE__ */ X(I, {
|
|
1168
1165
|
open: !0,
|
|
1169
1166
|
header: m.renameTitle,
|
|
1170
|
-
size:
|
|
1171
|
-
mainButtons:
|
|
1172
|
-
onClose:
|
|
1167
|
+
size: L.Sm,
|
|
1168
|
+
mainButtons: me,
|
|
1169
|
+
onClose: ce,
|
|
1173
1170
|
children: /* @__PURE__ */ Z("div", {
|
|
1174
1171
|
className: "flex items-end gap-2 px-6 py-4",
|
|
1175
1172
|
children: [/* @__PURE__ */ X("div", {
|
|
@@ -1180,7 +1177,7 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
1180
1177
|
labelProps: { label: m.renameInputLabel },
|
|
1181
1178
|
error: E,
|
|
1182
1179
|
disabled: k,
|
|
1183
|
-
onKeyDown:
|
|
1180
|
+
onKeyDown: fe,
|
|
1184
1181
|
onChange: (e) => {
|
|
1185
1182
|
T(e ?? ""), D(void 0);
|
|
1186
1183
|
}
|
|
@@ -1191,13 +1188,13 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
1191
1188
|
disabled: A || k,
|
|
1192
1189
|
"aria-busy": A,
|
|
1193
1190
|
onClick: () => {
|
|
1194
|
-
|
|
1191
|
+
de();
|
|
1195
1192
|
},
|
|
1196
1193
|
icon: A ? /* @__PURE__ */ X("span", {
|
|
1197
1194
|
className: "flex",
|
|
1198
1195
|
"aria-hidden": !0,
|
|
1199
|
-
children: /* @__PURE__ */ X(
|
|
1200
|
-
}) : /* @__PURE__ */ X(
|
|
1196
|
+
children: /* @__PURE__ */ X(ae, { size: b.MD })
|
|
1197
|
+
}) : /* @__PURE__ */ X(U, {
|
|
1201
1198
|
size: b.MD,
|
|
1202
1199
|
stroke: x,
|
|
1203
1200
|
"aria-hidden": !0
|
|
@@ -1205,17 +1202,17 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
1205
1202
|
})]
|
|
1206
1203
|
})
|
|
1207
1204
|
}),
|
|
1208
|
-
|
|
1205
|
+
N && /* @__PURE__ */ X(t, {
|
|
1209
1206
|
open: !0,
|
|
1210
|
-
title: m.deleteTitle(
|
|
1211
|
-
names: [
|
|
1207
|
+
title: m.deleteTitle(N.title),
|
|
1208
|
+
names: [N.title],
|
|
1212
1209
|
message: m.deleteDescription,
|
|
1213
1210
|
labels: m.deleteDialog,
|
|
1214
|
-
isLoading:
|
|
1211
|
+
isLoading: F,
|
|
1215
1212
|
onConfirm: () => {
|
|
1216
|
-
|
|
1213
|
+
pe();
|
|
1217
1214
|
},
|
|
1218
|
-
onClose:
|
|
1215
|
+
onClose: le
|
|
1219
1216
|
})
|
|
1220
1217
|
] });
|
|
1221
1218
|
}), _t = {
|
|
@@ -1289,7 +1286,7 @@ var Ce = /* @__PURE__ */ function(e) {
|
|
|
1289
1286
|
className: d("flex min-w-0 shrink-0 items-center gap-2 border-b px-4 py-2", a),
|
|
1290
1287
|
children: [/* @__PURE__ */ X(O, {
|
|
1291
1288
|
"aria-label": i,
|
|
1292
|
-
icon: /* @__PURE__ */ X(
|
|
1289
|
+
icon: /* @__PURE__ */ X(oe, {
|
|
1293
1290
|
"aria-hidden": !0,
|
|
1294
1291
|
size: b.MD,
|
|
1295
1292
|
stroke: x,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-projects",
|
|
3
3
|
"description": "Presentational Projects page shell, New and Edit project form, and project view — searchable, sortable grid of the projects available to a user",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0-dev.12",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@epam/ai-dial-attachment-input": "1.
|
|
21
|
-
"@epam/ai-dial-builder-form": "1.
|
|
20
|
+
"@epam/ai-dial-attachment-input": "1.4.0-dev.12",
|
|
21
|
+
"@epam/ai-dial-builder-form": "1.4.0-dev.12",
|
|
22
22
|
"@tabler/icons-react": "^3.50.0",
|
|
23
23
|
"@uiw/react-markdown-preview": "^5.2.1",
|
|
24
24
|
"@uiw/react-md-editor": "^4.2.2"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@epam/ai-dial-chat-shared": "1.
|
|
27
|
+
"@epam/ai-dial-chat-shared": "1.4.0-dev.12",
|
|
28
28
|
"@epam/ai-dial-ui-kit": "^0.16.0",
|
|
29
29
|
"react": "^19.2.8"
|
|
30
30
|
},
|