@epam/ai-dial-projects 1.3.0-dev.294 → 1.3.0-dev.304
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/components/ProjectCard/ProjectCard.d.ts.map +1 -1
- package/components/ProjectConversationList/ProjectConversationList.d.ts.map +1 -1
- package/components/ProjectConversationsPanel/ProjectConversationsPanel.d.ts.map +1 -1
- package/components/ProjectView/ProjectView.d.ts.map +1 -1
- package/index.css +2 -2
- package/index.js +359 -333
- package/models/project-conversation-list-props.d.ts +4 -0
- package/models/project-conversation-list-props.d.ts.map +1 -1
- package/models/project-conversations-panel-props.d.ts +2 -0
- package/models/project-conversations-panel-props.d.ts.map +1 -1
- package/models/project-view-props.d.ts +1 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DeleteConfirmationDialog as e, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as t, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as n, MarkdownRenderer as r, PROHIBITED_CONVERSATION_NAME_CHARS_RE as i, PanelEmptyState as a, RequestStatus as o, TextRefinementField as s, buildCssVars as c, 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, CardShell as y, DIAL_ICON_SIZE as b, DIAL_KIT_ICON_STROKE as x, Dropdown as S, ElementSize as C, EllipsisTooltip as w, ErrorText as T, FileDropzone as E, FolderPath as D, GhostButton as O, GhostIconButton as k, Highlight as A, Input as j, Label as M, LinkButton as N, LiveRegion as P, LiveRegionElement as
|
|
3
|
-
import { IconArrowNarrowLeft as
|
|
4
|
-
import { Suspense as
|
|
2
|
+
import { Button as h, ButtonAppearance as g, ButtonDropdown as _, ButtonVariant as v, CardShell as y, DIAL_ICON_SIZE as b, DIAL_KIT_ICON_STROKE as x, Dropdown as S, ElementSize as C, EllipsisTooltip as w, ErrorText as T, FileDropzone as E, FolderPath as D, GhostButton as O, GhostIconButton as k, Highlight as A, Input as j, Label as M, LinkButton as N, LiveRegion as P, LiveRegionElement as ee, LiveRegionPoliteness as F, MenuItemMark as I, NeutralButton as L, Popup as te, PopupSize as ne, Search as re, Spinner as ie } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconArrowNarrowLeft as R, IconArrowsSort as ae, IconDotsVertical as z, IconDownload as oe, IconPencilMinus as B, IconPin as V, IconPinFilled as H, IconPlus as se, IconShare as ce, IconTrashX as le, IconWorldShare as U, createReactComponent as ue } from "@tabler/icons-react";
|
|
4
|
+
import { Suspense as de, lazy as fe, memo as W, useCallback as G, useEffect as pe, useId as K, useMemo as q, useRef as J, useState as Y } from "react";
|
|
5
5
|
import { Fragment as me, jsx as X, jsxs as Z } from "react/jsx-runtime";
|
|
6
6
|
import { AttachmentCard as he, FileDndOverlay as ge } from "@epam/ai-dial-attachment-input";
|
|
7
7
|
import { BuilderFormContainer as _e } from "@epam/ai-dial-builder-form";
|
|
@@ -54,7 +54,12 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
54
54
|
query: t,
|
|
55
55
|
maxLines: 1,
|
|
56
56
|
className: d("min-w-0", p, Q.title, s != null && Q.aboveLink)
|
|
57
|
-
})
|
|
57
|
+
}), _ = /* @__PURE__ */ X(D, {
|
|
58
|
+
segments: De(n, e.parentPath),
|
|
59
|
+
ariaLabel: r,
|
|
60
|
+
labelClassName: d(m, Q.path),
|
|
61
|
+
leafClassName: d(h, Q.path)
|
|
62
|
+
}), v = J(null);
|
|
58
63
|
return /* @__PURE__ */ X("li", {
|
|
59
64
|
className: "flex min-w-0",
|
|
60
65
|
children: /* @__PURE__ */ Z(y, {
|
|
@@ -72,6 +77,7 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
72
77
|
className: "min-w-0 flex-1",
|
|
73
78
|
children: g
|
|
74
79
|
}) : /* @__PURE__ */ X("a", {
|
|
80
|
+
ref: v,
|
|
75
81
|
href: s,
|
|
76
82
|
onClick: (t) => {
|
|
77
83
|
c != null && Oe(t) && (t.preventDefault(), c(e.id));
|
|
@@ -80,7 +86,7 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
80
86
|
children: g
|
|
81
87
|
}), o == null ? e.isPinned && /* @__PURE__ */ Z("span", {
|
|
82
88
|
className: d("absolute inset-e-5 top-5 flex", Q.pin),
|
|
83
|
-
children: [/* @__PURE__ */ X(
|
|
89
|
+
children: [/* @__PURE__ */ X(H, {
|
|
84
90
|
size: b.SM,
|
|
85
91
|
"aria-hidden": !0
|
|
86
92
|
}), /* @__PURE__ */ X("span", {
|
|
@@ -89,10 +95,10 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
89
95
|
})]
|
|
90
96
|
}) : /* @__PURE__ */ X(k, {
|
|
91
97
|
size: C.Small,
|
|
92
|
-
icon: e.isPinned ? /* @__PURE__ */ X(
|
|
98
|
+
icon: e.isPinned ? /* @__PURE__ */ X(H, {
|
|
93
99
|
size: b.SM,
|
|
94
100
|
"aria-hidden": !0
|
|
95
|
-
}) : /* @__PURE__ */ X(
|
|
101
|
+
}) : /* @__PURE__ */ X(V, {
|
|
96
102
|
size: b.SM,
|
|
97
103
|
"aria-hidden": !0,
|
|
98
104
|
stroke: x
|
|
@@ -103,12 +109,20 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
103
109
|
className: d("absolute inset-e-4 top-4", Q.pinToggle, !e.isPinned && Q.pinToggleIdle)
|
|
104
110
|
})]
|
|
105
111
|
}),
|
|
106
|
-
/* @__PURE__ */ X(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
s == null ? _ : /* @__PURE__ */ X("div", {
|
|
113
|
+
className: Q.aboveLink,
|
|
114
|
+
onClick: (e) => {
|
|
115
|
+
v.current?.dispatchEvent(new window.MouseEvent("click", {
|
|
116
|
+
bubbles: !0,
|
|
117
|
+
cancelable: !0,
|
|
118
|
+
button: e.button,
|
|
119
|
+
ctrlKey: e.ctrlKey,
|
|
120
|
+
metaKey: e.metaKey,
|
|
121
|
+
shiftKey: e.shiftKey,
|
|
122
|
+
altKey: e.altKey
|
|
123
|
+
}));
|
|
124
|
+
},
|
|
125
|
+
children: _
|
|
112
126
|
})
|
|
113
127
|
]
|
|
114
128
|
})
|
|
@@ -118,7 +132,7 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
118
132
|
subtitle: "_subtitle_4rer8_5",
|
|
119
133
|
sortButton: "_sortButton_4rer8_9"
|
|
120
134
|
}, je = ({ projects: e, isLoading: t = !1, hasError: n = !1, incompleteSources: r = [], onRetry: i, onCreateProject: o, onTogglePin: s, onOpenProject: l, getProjectHref: u, searchQuery: f, onSearchQueryChange: m, sortKey: y, onSortKeyChange: S, labels: w, locale: T, styles: E }) => {
|
|
121
|
-
let { colors: D, typography: k } = E ?? {}, A = k?.titleClassName ?? "dial-h1-text", j = k?.subtitleClassName ?? "dial-body-text", M = k?.cardTitleClassName ?? "dial-body-semi-text", N = k?.pathLabelClassName ?? "dial-tiny-text",
|
|
135
|
+
let { colors: D, typography: k } = E ?? {}, A = k?.titleClassName ?? "dial-h1-text", j = k?.subtitleClassName ?? "dial-body-text", M = k?.cardTitleClassName ?? "dial-body-semi-text", N = k?.pathLabelClassName ?? "dial-tiny-text", F = k?.pathLeafClassName ?? "dial-tiny-semi-text", L = k?.updatedAtClassName ?? "dial-tiny-text", te = k?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", ne = c({
|
|
122
136
|
"--pr-bg": D?.background,
|
|
123
137
|
"--pr-subtitle-text": D?.subtitleText,
|
|
124
138
|
"--pr-sort-text": D?.sortButtonText,
|
|
@@ -127,31 +141,31 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
127
141
|
"--pr-updated-at-text": D?.updatedAtText,
|
|
128
142
|
"--pr-path-text": D?.pathText,
|
|
129
143
|
"--pr-card-focus-outline": D?.cardFocusOutline
|
|
130
|
-
}),
|
|
144
|
+
}), R = p(), z = q(() => Date.now(), [e]), oe = f.trim(), B = r.length > 0, V = B && e.length === 0, H = q(() => xe(be(e, f), y, T), [
|
|
131
145
|
e,
|
|
132
146
|
f,
|
|
133
147
|
y,
|
|
134
148
|
T
|
|
135
|
-
]),
|
|
149
|
+
]), ce = w.sortOptions.find((e) => e.value === y)?.label ?? w.sortLabel, le = q(() => w.sortOptions.map((e) => ({
|
|
136
150
|
key: e.value,
|
|
137
151
|
label: e.label,
|
|
138
|
-
mark:
|
|
152
|
+
mark: I.Check,
|
|
139
153
|
checked: e.value === y,
|
|
140
154
|
onClick: () => S(e.value)
|
|
141
155
|
})), [
|
|
142
156
|
w.sortOptions,
|
|
143
157
|
y,
|
|
144
158
|
S
|
|
145
|
-
]),
|
|
159
|
+
]), U = (e) => {
|
|
146
160
|
m(e ?? "");
|
|
147
|
-
},
|
|
148
|
-
if (!t) return n ? w.errorLabel :
|
|
149
|
-
},
|
|
161
|
+
}, ue = () => {
|
|
162
|
+
if (!t) return n ? w.errorLabel : B ? w.incompleteLabel : e.length === 0 ? w.emptyStateLabel : H.length === 0 ? w.noResultsLabel : w.resultCountLabel(H.length);
|
|
163
|
+
}, de = (e, t) => o ? /* @__PURE__ */ X(h, {
|
|
150
164
|
label: w.createProjectLabel,
|
|
151
165
|
variant: e,
|
|
152
166
|
onClick: o,
|
|
153
167
|
className: d("shrink-0", t)
|
|
154
|
-
}) : void 0,
|
|
168
|
+
}) : void 0, fe = () => t ? /* @__PURE__ */ X(ie, {}) : n || V ? /* @__PURE__ */ Z("div", {
|
|
155
169
|
className: "flex flex-col items-center gap-3",
|
|
156
170
|
children: [/* @__PURE__ */ X("p", {
|
|
157
171
|
className: d(j, Ae.subtitle),
|
|
@@ -163,19 +177,19 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
163
177
|
}) : e.length === 0 ? /* @__PURE__ */ X(a, {
|
|
164
178
|
label: w.emptyStateLabel,
|
|
165
179
|
description: w.emptyStateDescription,
|
|
166
|
-
action:
|
|
167
|
-
containerClassName:
|
|
180
|
+
action: de(v.Secondary, "mt-2"),
|
|
181
|
+
containerClassName: G,
|
|
168
182
|
labelClassName: "mt-3",
|
|
169
|
-
descriptionClassName:
|
|
170
|
-
}) :
|
|
183
|
+
descriptionClassName: te
|
|
184
|
+
}) : H.length === 0 ? /* @__PURE__ */ X(a, {
|
|
171
185
|
label: w.noResultsLabel,
|
|
172
|
-
containerClassName:
|
|
186
|
+
containerClassName: G,
|
|
173
187
|
labelClassName: "mt-3"
|
|
174
188
|
}) : /* @__PURE__ */ X("ul", {
|
|
175
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",
|
|
176
|
-
children:
|
|
190
|
+
children: H.map((e) => /* @__PURE__ */ X(ke, {
|
|
177
191
|
project: e,
|
|
178
|
-
searchQuery:
|
|
192
|
+
searchQuery: oe,
|
|
179
193
|
sourceLabel: w.sourceLabels[e.source],
|
|
180
194
|
folderPathLabel: w.folderPathLabel,
|
|
181
195
|
pinnedLabel: w.pinnedLabel ?? "Pinned",
|
|
@@ -183,21 +197,21 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
183
197
|
onTogglePin: s,
|
|
184
198
|
href: u?.(e.id),
|
|
185
199
|
onOpen: l,
|
|
186
|
-
now:
|
|
200
|
+
now: z,
|
|
187
201
|
locale: T,
|
|
188
|
-
updatedAtClassName:
|
|
202
|
+
updatedAtClassName: L,
|
|
189
203
|
titleClassName: M,
|
|
190
204
|
pathLabelClassName: N,
|
|
191
|
-
pathLeafClassName:
|
|
205
|
+
pathLeafClassName: F
|
|
192
206
|
}, e.id))
|
|
193
|
-
}),
|
|
207
|
+
}), W = t || n || V, G = "mt-6 p-3 desktop:mt-0";
|
|
194
208
|
return /* @__PURE__ */ Z("div", {
|
|
195
|
-
style:
|
|
209
|
+
style: ne,
|
|
196
210
|
className: d("relative flex h-full w-full min-w-0 flex-col", Ae.container),
|
|
197
211
|
children: [/* @__PURE__ */ Z("div", {
|
|
198
212
|
className: "flex min-h-0 w-full min-w-0 flex-1 flex-col overflow-y-auto",
|
|
199
213
|
children: [
|
|
200
|
-
|
|
214
|
+
R ? /* @__PURE__ */ X("h1", {
|
|
201
215
|
className: "sr-only",
|
|
202
216
|
children: w.title
|
|
203
217
|
}) : /* @__PURE__ */ Z("div", {
|
|
@@ -211,33 +225,33 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
211
225
|
className: d(j, Ae.subtitle),
|
|
212
226
|
children: w.subtitle
|
|
213
227
|
})]
|
|
214
|
-
}),
|
|
228
|
+
}), de(v.Primary)]
|
|
215
229
|
}),
|
|
216
230
|
/* @__PURE__ */ Z("div", {
|
|
217
231
|
className: "flex items-center gap-2 p-4 desktop:gap-3 desktop:px-8 desktop:pt-4 desktop:pb-5",
|
|
218
232
|
children: [/* @__PURE__ */ X("div", {
|
|
219
233
|
role: "search",
|
|
220
234
|
className: "min-w-0 flex-1",
|
|
221
|
-
children: /* @__PURE__ */ X(
|
|
235
|
+
children: /* @__PURE__ */ X(re, {
|
|
222
236
|
value: f,
|
|
223
|
-
onChange:
|
|
237
|
+
onChange: U,
|
|
224
238
|
placeholder: w.searchPlaceholder,
|
|
225
239
|
clearLabel: w.clearSearchLabel,
|
|
226
240
|
"aria-label": w.searchAriaLabel,
|
|
227
|
-
size:
|
|
241
|
+
size: R ? C.Standard : C.Large
|
|
228
242
|
})
|
|
229
243
|
}), w.sortOptions.length > 0 && /* @__PURE__ */ X("div", {
|
|
230
244
|
role: "group",
|
|
231
245
|
"aria-label": w.sortLabel,
|
|
232
246
|
className: "shrink-0",
|
|
233
247
|
children: /* @__PURE__ */ X(_, {
|
|
234
|
-
items:
|
|
235
|
-
label:
|
|
248
|
+
items: le,
|
|
249
|
+
label: ce,
|
|
236
250
|
variant: v.Primary,
|
|
237
251
|
appearance: g.Ghost,
|
|
238
|
-
size:
|
|
239
|
-
iconBefore: /* @__PURE__ */ X(
|
|
240
|
-
size:
|
|
252
|
+
size: R ? C.Small : C.Standard,
|
|
253
|
+
iconBefore: /* @__PURE__ */ X(ae, {
|
|
254
|
+
size: R ? b.SM : b.MD,
|
|
241
255
|
"aria-hidden": !0,
|
|
242
256
|
stroke: x
|
|
243
257
|
}),
|
|
@@ -247,12 +261,12 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
247
261
|
}),
|
|
248
262
|
/* @__PURE__ */ X(P, {
|
|
249
263
|
visuallyHidden: !0,
|
|
250
|
-
as:
|
|
251
|
-
children:
|
|
264
|
+
as: ee.Span,
|
|
265
|
+
children: ue()
|
|
252
266
|
}),
|
|
253
267
|
/* @__PURE__ */ Z("div", {
|
|
254
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",
|
|
255
|
-
children: [
|
|
269
|
+
children: [B && !t && !n && !V && /* @__PURE__ */ Z("div", {
|
|
256
270
|
className: "flex w-full max-w-[1116px] flex-wrap items-center gap-3",
|
|
257
271
|
children: [/* @__PURE__ */ X("p", {
|
|
258
272
|
className: d(j, Ae.subtitle),
|
|
@@ -262,14 +276,14 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
262
276
|
onClick: i
|
|
263
277
|
})]
|
|
264
278
|
}), /* @__PURE__ */ X("div", {
|
|
265
|
-
className: d("flex w-full max-w-[1116px] min-w-0 flex-col items-center",
|
|
266
|
-
children:
|
|
279
|
+
className: d("flex w-full max-w-[1116px] min-w-0 flex-col items-center", W && "flex-1 justify-center"),
|
|
280
|
+
children: fe()
|
|
267
281
|
})]
|
|
268
282
|
})
|
|
269
283
|
]
|
|
270
|
-
}),
|
|
284
|
+
}), R && o && /* @__PURE__ */ X(h, {
|
|
271
285
|
variant: v.Primary,
|
|
272
|
-
iconBefore: /* @__PURE__ */ X(
|
|
286
|
+
iconBefore: /* @__PURE__ */ X(se, {
|
|
273
287
|
size: b.LG,
|
|
274
288
|
"aria-hidden": !0,
|
|
275
289
|
stroke: x
|
|
@@ -282,20 +296,20 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
282
296
|
}, Me = /* @__PURE__ */ function(e) {
|
|
283
297
|
return e.Personal = "personal", e.Shared = "shared", e.Organization = "organization", e;
|
|
284
298
|
}({}), Ne = (e) => !!e.dataTransfer?.types.includes("Files"), Pe = (e) => {
|
|
285
|
-
let [t, n] = Y(!1), r =
|
|
299
|
+
let [t, n] = Y(!1), r = J(0);
|
|
286
300
|
return {
|
|
287
301
|
isDragActive: t,
|
|
288
302
|
handlers: {
|
|
289
|
-
onDragEnter:
|
|
303
|
+
onDragEnter: G((e) => {
|
|
290
304
|
Ne(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
291
305
|
}, []),
|
|
292
|
-
onDragLeave:
|
|
306
|
+
onDragLeave: G((e) => {
|
|
293
307
|
Ne(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
294
308
|
}, []),
|
|
295
|
-
onDragOver:
|
|
309
|
+
onDragOver: G((e) => {
|
|
296
310
|
Ne(e) && e.preventDefault();
|
|
297
311
|
}, []),
|
|
298
|
-
onDrop:
|
|
312
|
+
onDrop: G((t) => {
|
|
299
313
|
if (!Ne(t)) return;
|
|
300
314
|
t.preventDefault(), r.current = 0, n(!1);
|
|
301
315
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
@@ -351,38 +365,38 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
351
365
|
dropZone: "_dropZone_ub3na_11",
|
|
352
366
|
label: "_label_ub3na_15",
|
|
353
367
|
link: "_link_ub3na_19"
|
|
354
|
-
}, et =
|
|
355
|
-
let N =
|
|
368
|
+
}, et = fe(async () => ({ default: (await ve()).MarkdownEditor })), tt = (e) => `Preview ${e}`, nt = ({ values: e, errors: r, onFieldChange: i, contextFiles: a, onContextFilesChange: o, onContextFileClick: l, selectedContextFileId: u, allowedExtensions: p, maxFileBytes: h, maxTotalBytes: g, onPickFromFileManager: _, onRefineInstructions: v, onBack: y, onCancel: S, onSubmit: C, isSubmitting: w = !1, labels: D, markdownEditorTheme: O, className: k, styles: A }) => {
|
|
369
|
+
let N = K(), I = K(), L = K(), te = K(), ne = J(null), re = f(), [ae, z] = Y(!1), [oe, B] = Y([]), [V, H] = Y(""), se = m({
|
|
356
370
|
value: e.instructions,
|
|
357
371
|
onChange: (e) => i("instructions", e),
|
|
358
372
|
onRefine: v,
|
|
359
373
|
disabled: w
|
|
360
|
-
}),
|
|
361
|
-
|
|
362
|
-
r.name &&
|
|
374
|
+
}), ce = se.isPending, le = He(e.name), U = r.name ?? (ae && le != null ? D.nameErrors[le] : void 0), ue = le != null || w || ce;
|
|
375
|
+
pe(() => {
|
|
376
|
+
r.name && ne.current?.focus();
|
|
363
377
|
}, [r.name]);
|
|
364
|
-
let
|
|
378
|
+
let fe = q(() => p.map((e) => `.${e}`).join(","), [p]), W = (e) => {
|
|
365
379
|
if (e.length === 0) return;
|
|
366
380
|
let { accepted: t, rejected: n } = Ze(e, a, {
|
|
367
381
|
allowedExtensions: p,
|
|
368
382
|
maxFileBytes: h,
|
|
369
383
|
maxTotalBytes: g
|
|
370
384
|
});
|
|
371
|
-
|
|
372
|
-
}, { isDragActive:
|
|
385
|
+
B(n), t.length > 0 && o([...a, ...t]), H([t.length > 0 ? D.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => D.fileRejections[t](e))].filter(Boolean).join(" "));
|
|
386
|
+
}, { isDragActive: G, handlers: me } = Pe(W), ve = D.openFileLabel ?? tt, ye = (e) => {
|
|
373
387
|
let t = a.find((t) => t.id === e);
|
|
374
|
-
o(a.filter((t) => t.id !== e)),
|
|
388
|
+
o(a.filter((t) => t.id !== e)), B([]), t && H(D.fileRemovedStatus(t.name));
|
|
375
389
|
}, be = async (e) => {
|
|
376
390
|
if (e.preventDefault(), e.stopPropagation(), _) try {
|
|
377
391
|
let e = await _();
|
|
378
|
-
e &&
|
|
392
|
+
e && W(e);
|
|
379
393
|
} catch {}
|
|
380
394
|
}, xe = () => {
|
|
381
|
-
|
|
395
|
+
ue || C();
|
|
382
396
|
}, { colors: Se, typography: Ce } = A ?? {}, we = Ce?.titleClassName ?? "dial-h1-text", Te = d(Ce?.labelClassName ?? "dial-tiny-semi-text", $e.label), Ee = Ce?.helperClassName ?? "dial-tiny-text", Q = c({
|
|
383
397
|
"--pcf-label-text": Se?.labelText,
|
|
384
398
|
"--pcf-link-text": Se?.linkText
|
|
385
|
-
}), De = D.refinement, Oe = r.context, ke = [...
|
|
399
|
+
}), De = D.refinement, Oe = r.context, ke = [...oe.map(({ name: e, reason: t }) => D.fileRejections[t](e)), Oe].filter(Boolean).join("\n"), Ae = D.dropZoneLabel({
|
|
386
400
|
fromDevice: /* @__PURE__ */ X("span", { className: $e.link }),
|
|
387
401
|
fileManager: _ ? /* @__PURE__ */ X("button", {
|
|
388
402
|
type: "button",
|
|
@@ -396,7 +410,7 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
396
410
|
...me,
|
|
397
411
|
children: [
|
|
398
412
|
/* @__PURE__ */ X(ge, {
|
|
399
|
-
isVisible:
|
|
413
|
+
isVisible: G,
|
|
400
414
|
labels: {
|
|
401
415
|
title: D.dropOverlayTitle,
|
|
402
416
|
subtitle: D.dropOverlaySubtitle
|
|
@@ -414,9 +428,9 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
414
428
|
onCancel: S,
|
|
415
429
|
onSubmit: xe,
|
|
416
430
|
isCancelDisabled: w,
|
|
417
|
-
isSubmitDisabled:
|
|
431
|
+
isSubmitDisabled: ue,
|
|
418
432
|
isSubmitting: w,
|
|
419
|
-
backIcon: /* @__PURE__ */ X(
|
|
433
|
+
backIcon: /* @__PURE__ */ X(R, {
|
|
420
434
|
size: b.LG,
|
|
421
435
|
stroke: x,
|
|
422
436
|
"aria-hidden": !0,
|
|
@@ -438,10 +452,10 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
438
452
|
children: [
|
|
439
453
|
/* @__PURE__ */ X(j, {
|
|
440
454
|
id: N,
|
|
441
|
-
inputRef:
|
|
455
|
+
inputRef: ne,
|
|
442
456
|
value: e.name,
|
|
443
457
|
onChange: (e) => i("name", e ?? ""),
|
|
444
|
-
onBlur: () =>
|
|
458
|
+
onBlur: () => z(!0),
|
|
445
459
|
placeholder: D.namePlaceholder,
|
|
446
460
|
labelProps: {
|
|
447
461
|
label: D.nameLabel,
|
|
@@ -449,47 +463,47 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
449
463
|
},
|
|
450
464
|
required: !0,
|
|
451
465
|
"aria-required": !0,
|
|
452
|
-
invalid: !!
|
|
453
|
-
"aria-invalid": !!
|
|
454
|
-
"aria-describedby":
|
|
466
|
+
invalid: !!U,
|
|
467
|
+
"aria-invalid": !!U,
|
|
468
|
+
"aria-describedby": U ? I : void 0
|
|
455
469
|
}),
|
|
456
470
|
/* @__PURE__ */ X(T, {
|
|
457
|
-
announce:
|
|
458
|
-
id:
|
|
471
|
+
announce: F.Assertive,
|
|
472
|
+
id: I,
|
|
459
473
|
className: Ee,
|
|
460
474
|
text: r.name ?? ""
|
|
461
475
|
}),
|
|
462
|
-
|
|
463
|
-
id:
|
|
476
|
+
U && !r.name && /* @__PURE__ */ X(T, {
|
|
477
|
+
id: I,
|
|
464
478
|
className: Ee,
|
|
465
|
-
text:
|
|
479
|
+
text: U
|
|
466
480
|
})
|
|
467
481
|
]
|
|
468
482
|
}),
|
|
469
483
|
/* @__PURE__ */ X(s, {
|
|
470
484
|
isEnabled: !!v,
|
|
471
|
-
fieldId:
|
|
485
|
+
fieldId: L,
|
|
472
486
|
label: D.instructionsLabel,
|
|
473
487
|
labelClassName: Te,
|
|
474
488
|
labels: De,
|
|
475
|
-
refinement:
|
|
476
|
-
disabled: w ||
|
|
489
|
+
refinement: se,
|
|
490
|
+
disabled: w || ce,
|
|
477
491
|
children: /* @__PURE__ */ Z("div", {
|
|
478
492
|
className: "flex flex-1 flex-col gap-2",
|
|
479
493
|
children: [!v && /* @__PURE__ */ X(M, {
|
|
480
|
-
htmlFor:
|
|
494
|
+
htmlFor: L,
|
|
481
495
|
className: Te,
|
|
482
496
|
label: D.instructionsLabel
|
|
483
497
|
}), /* @__PURE__ */ X("div", {
|
|
484
|
-
ref:
|
|
498
|
+
ref: re,
|
|
485
499
|
className: d("w-full", t, n),
|
|
486
|
-
children: /* @__PURE__ */ X(
|
|
487
|
-
fallback: /* @__PURE__ */ X(
|
|
500
|
+
children: /* @__PURE__ */ X(de, {
|
|
501
|
+
fallback: /* @__PURE__ */ X(ie, {}),
|
|
488
502
|
children: /* @__PURE__ */ X(et, {
|
|
489
|
-
id:
|
|
503
|
+
id: L,
|
|
490
504
|
value: e.instructions,
|
|
491
505
|
onChange: (e) => {
|
|
492
|
-
|
|
506
|
+
se.reset(), i("instructions", e);
|
|
493
507
|
},
|
|
494
508
|
height: 176,
|
|
495
509
|
theme: O,
|
|
@@ -500,11 +514,11 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
500
514
|
})
|
|
501
515
|
}),
|
|
502
516
|
/* @__PURE__ */ Z("section", {
|
|
503
|
-
"aria-labelledby":
|
|
517
|
+
"aria-labelledby": te,
|
|
504
518
|
className: "flex flex-col gap-2",
|
|
505
519
|
children: [
|
|
506
520
|
/* @__PURE__ */ X("h2", {
|
|
507
|
-
id:
|
|
521
|
+
id: te,
|
|
508
522
|
className: Te,
|
|
509
523
|
children: D.contextLabel
|
|
510
524
|
}),
|
|
@@ -512,17 +526,17 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
512
526
|
label: Ae,
|
|
513
527
|
ariaLabel: D.dropZoneAriaLabel,
|
|
514
528
|
description: D.dropZoneHint,
|
|
515
|
-
accept:
|
|
529
|
+
accept: fe,
|
|
516
530
|
multiple: !0,
|
|
517
531
|
disabled: w,
|
|
518
|
-
onChange:
|
|
519
|
-
onReject:
|
|
532
|
+
onChange: W,
|
|
533
|
+
onReject: W,
|
|
520
534
|
errorText: ke || void 0,
|
|
521
535
|
className: $e.dropZone
|
|
522
536
|
}),
|
|
523
537
|
/* @__PURE__ */ X(P, {
|
|
524
538
|
visuallyHidden: !0,
|
|
525
|
-
politeness:
|
|
539
|
+
politeness: F.Assertive,
|
|
526
540
|
children: Oe
|
|
527
541
|
}),
|
|
528
542
|
a.length > 0 && /* @__PURE__ */ X("ul", {
|
|
@@ -548,12 +562,12 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
548
562
|
}),
|
|
549
563
|
/* @__PURE__ */ X(P, {
|
|
550
564
|
visuallyHidden: !0,
|
|
551
|
-
as:
|
|
552
|
-
children: w ? D.creatingStatus :
|
|
565
|
+
as: ee.Span,
|
|
566
|
+
children: w ? D.creatingStatus : V
|
|
553
567
|
})
|
|
554
568
|
]
|
|
555
569
|
});
|
|
556
|
-
}, rt =
|
|
570
|
+
}, rt = ue("outline", "pin-off", "PinOff", [
|
|
557
571
|
["path", {
|
|
558
572
|
d: "M3 3l18 18",
|
|
559
573
|
key: "svg-0"
|
|
@@ -595,15 +609,15 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
595
609
|
contentType: e.contentType,
|
|
596
610
|
type: l(e.contentType),
|
|
597
611
|
status: o.Idle
|
|
598
|
-
}), at =
|
|
599
|
-
let { colors:
|
|
600
|
-
"--pv-bg":
|
|
601
|
-
"--pv-border":
|
|
602
|
-
"--pv-heading-text":
|
|
603
|
-
"--pv-body-text":
|
|
604
|
-
"--pv-secondary-text":
|
|
605
|
-
}),
|
|
606
|
-
let e = d("mb-1 mt-3 first:mt-0",
|
|
612
|
+
}), at = W(({ project: e, isLoading: t = !1, hasError: n = !1, isNotFound: i = !1, isPinned: o, isPinPending: s = !1, contextSearchQuery: l, onContextSearchQueryChange: u, onBack: f, onTogglePin: p, onPublish: m, onEdit: h, onShare: g, onDelete: _, onDownload: v, onContextFileClick: y, selectedContextFileId: C, isDetailsStacked: T = !1, onRetry: E, onBrowseProjects: D, mainContent: A, mainContentLabel: j = "Project content", labels: M, styles: N }) => {
|
|
613
|
+
let { colors: F, typography: I } = N ?? {}, te = I?.titleClassName ?? "dial-h1-text", ne = I?.panelTitleClassName ?? "dial-body-semi-text", ae = I?.sectionTitleClassName ?? "dial-tiny-text", H = I?.bodyClassName ?? "dial-small-text", se = I?.helperClassName ?? "dial-tiny-text", ue = I?.instructionsHeadingClassName ?? "dial-small-semi-text", de = c({
|
|
614
|
+
"--pv-bg": F?.background,
|
|
615
|
+
"--pv-border": F?.border,
|
|
616
|
+
"--pv-heading-text": F?.headingText,
|
|
617
|
+
"--pv-body-text": F?.bodyText,
|
|
618
|
+
"--pv-secondary-text": F?.secondaryText
|
|
619
|
+
}), fe = q(() => e?.contextFiles ?? [], [e]), W = q(() => Qe(fe, l), [fe, l]), G = l.trim(), pe = K(), J = q(() => {
|
|
620
|
+
let e = d("mb-1 mt-3 first:mt-0", ue);
|
|
607
621
|
return {
|
|
608
622
|
h1: e,
|
|
609
623
|
h2: e,
|
|
@@ -611,11 +625,11 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
611
625
|
h4: e,
|
|
612
626
|
h5: e,
|
|
613
627
|
h6: e,
|
|
614
|
-
p:
|
|
615
|
-
ul:
|
|
616
|
-
ol:
|
|
628
|
+
p: H,
|
|
629
|
+
ul: H,
|
|
630
|
+
ol: H
|
|
617
631
|
};
|
|
618
|
-
}, [
|
|
632
|
+
}, [H, ue]), Y = (e) => /* @__PURE__ */ X(e, {
|
|
619
633
|
size: b.SM,
|
|
620
634
|
"aria-hidden": !0,
|
|
621
635
|
stroke: x
|
|
@@ -624,27 +638,27 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
624
638
|
return e && m && t.push({
|
|
625
639
|
key: "publish",
|
|
626
640
|
label: M.publishLabel,
|
|
627
|
-
icon: Y(
|
|
641
|
+
icon: Y(U),
|
|
628
642
|
onClick: m
|
|
629
643
|
}), e && h && t.push({
|
|
630
644
|
key: "edit",
|
|
631
645
|
label: M.editLabel,
|
|
632
|
-
icon: Y(
|
|
646
|
+
icon: Y(B),
|
|
633
647
|
onClick: h
|
|
634
648
|
}), g && t.push({
|
|
635
649
|
key: "share",
|
|
636
650
|
label: M.shareLabel,
|
|
637
|
-
icon: Y(
|
|
651
|
+
icon: Y(ce),
|
|
638
652
|
onClick: g
|
|
639
653
|
}), t.push({
|
|
640
654
|
key: "download",
|
|
641
655
|
label: M.downloadLabel,
|
|
642
|
-
icon: Y(
|
|
656
|
+
icon: Y(oe),
|
|
643
657
|
onClick: v
|
|
644
658
|
}), _ && t.push({
|
|
645
659
|
key: "delete",
|
|
646
660
|
label: M.deleteLabel,
|
|
647
|
-
icon: Y(
|
|
661
|
+
icon: Y(le),
|
|
648
662
|
danger: !0,
|
|
649
663
|
onClick: _
|
|
650
664
|
}), t;
|
|
@@ -655,7 +669,7 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
655
669
|
matchReferenceWidth: !1,
|
|
656
670
|
listClassName: "w-[200px]",
|
|
657
671
|
children: /* @__PURE__ */ X(k, {
|
|
658
|
-
icon: /* @__PURE__ */ X(
|
|
672
|
+
icon: /* @__PURE__ */ X(z, {
|
|
659
673
|
size: b.MD,
|
|
660
674
|
"aria-hidden": !0,
|
|
661
675
|
stroke: x
|
|
@@ -663,38 +677,74 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
663
677
|
"aria-label": M.moreActionsLabel
|
|
664
678
|
})
|
|
665
679
|
})
|
|
680
|
+
}), ve = () => {
|
|
681
|
+
s || p();
|
|
682
|
+
}, ye = () => t ? /* @__PURE__ */ X(ie, {}) : n ? /* @__PURE__ */ Z("div", {
|
|
683
|
+
className: "flex flex-col items-center gap-3",
|
|
684
|
+
children: [/* @__PURE__ */ X("p", {
|
|
685
|
+
role: "status",
|
|
686
|
+
className: d(H, $.body),
|
|
687
|
+
children: M.errorLabel
|
|
688
|
+
}), /* @__PURE__ */ X(O, {
|
|
689
|
+
label: M.retryLabel,
|
|
690
|
+
onClick: E
|
|
691
|
+
})]
|
|
692
|
+
}) : /* @__PURE__ */ Z("div", {
|
|
693
|
+
className: "flex flex-col items-center gap-3",
|
|
694
|
+
children: [/* @__PURE__ */ X("p", {
|
|
695
|
+
className: d(H, $.body),
|
|
696
|
+
children: M.notFoundLabel
|
|
697
|
+
}), /* @__PURE__ */ X(O, {
|
|
698
|
+
label: M.browseProjectsLabel,
|
|
699
|
+
onClick: D
|
|
700
|
+
})]
|
|
666
701
|
});
|
|
667
|
-
|
|
668
|
-
style:
|
|
702
|
+
if (t || n || i || e == null) return /* @__PURE__ */ X("div", {
|
|
703
|
+
style: de,
|
|
669
704
|
className: d("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
|
|
670
|
-
children:
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
705
|
+
children: ye()
|
|
706
|
+
});
|
|
707
|
+
let be = () => fe.length === 0 ? /* @__PURE__ */ X(a, { label: M.emptyContextLabel }) : /* @__PURE__ */ Z(me, { children: [
|
|
708
|
+
/* @__PURE__ */ X("div", {
|
|
709
|
+
role: "search",
|
|
710
|
+
children: /* @__PURE__ */ X(re, {
|
|
711
|
+
value: l,
|
|
712
|
+
onChange: (e) => u(e ?? ""),
|
|
713
|
+
placeholder: M.contextSearchPlaceholder,
|
|
714
|
+
clearLabel: M.clearSearchLabel,
|
|
715
|
+
"aria-label": M.contextSearchAriaLabel
|
|
716
|
+
})
|
|
717
|
+
}),
|
|
718
|
+
W.length === 0 ? /* @__PURE__ */ X("p", {
|
|
719
|
+
className: d(se, $.secondary),
|
|
720
|
+
children: M.noContextMatchesLabel
|
|
721
|
+
}) : /* @__PURE__ */ X("ul", {
|
|
722
|
+
className: "m-0 flex min-w-0 list-none flex-wrap gap-2 p-0 pt-2",
|
|
723
|
+
children: W.map((e) => /* @__PURE__ */ X("li", {
|
|
724
|
+
className: "min-w-0",
|
|
725
|
+
children: /* @__PURE__ */ X(he, {
|
|
726
|
+
attachment: it(e),
|
|
727
|
+
searchQuery: G,
|
|
728
|
+
onClick: y,
|
|
729
|
+
isSelected: e.name === C,
|
|
730
|
+
labels: { clickLabel: M.openFileLabel(e.name) }
|
|
731
|
+
})
|
|
732
|
+
}, e.name))
|
|
733
|
+
}),
|
|
734
|
+
/* @__PURE__ */ X(P, {
|
|
735
|
+
visuallyHidden: !0,
|
|
736
|
+
as: ee.Span,
|
|
737
|
+
children: G === "" ? "" : M.contextResultCountLabel(W.length)
|
|
689
738
|
})
|
|
690
|
-
})
|
|
691
|
-
|
|
692
|
-
|
|
739
|
+
] }), xe = !T;
|
|
740
|
+
return /* @__PURE__ */ Z("div", {
|
|
741
|
+
style: de,
|
|
742
|
+
className: d("flex h-full w-full min-w-0 flex-col", $.container),
|
|
693
743
|
children: [/* @__PURE__ */ Z("header", {
|
|
694
|
-
className: d("flex min-w-0 items-center gap-2 px-4 py-3 desktop:px-8", $.header),
|
|
744
|
+
className: d("flex min-w-0 shrink-0 items-center gap-2 px-4 py-3 desktop:px-8 desktop:py-4", $.header),
|
|
695
745
|
children: [
|
|
696
746
|
/* @__PURE__ */ X(k, {
|
|
697
|
-
icon: /* @__PURE__ */ X(
|
|
747
|
+
icon: /* @__PURE__ */ X(R, {
|
|
698
748
|
size: b.LG,
|
|
699
749
|
className: "rtl:scale-x-[-1]",
|
|
700
750
|
"aria-hidden": !0,
|
|
@@ -704,25 +754,23 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
704
754
|
onClick: f
|
|
705
755
|
}),
|
|
706
756
|
/* @__PURE__ */ X("h1", {
|
|
707
|
-
className: d("min-w-0 flex-1",
|
|
757
|
+
className: d("min-w-0 flex-1", te, $.title),
|
|
708
758
|
children: /* @__PURE__ */ X(w, { text: e.name })
|
|
709
759
|
}),
|
|
710
760
|
/* @__PURE__ */ X(O, {
|
|
711
761
|
label: o ? M.unpinLabel : M.pinLabel,
|
|
712
|
-
iconBefore: X(o ? rt :
|
|
762
|
+
iconBefore: X(o ? rt : V, {
|
|
713
763
|
size: b.MD,
|
|
714
764
|
"aria-hidden": !0,
|
|
715
765
|
stroke: x
|
|
716
766
|
}),
|
|
717
767
|
"aria-disabled": s || void 0,
|
|
718
|
-
onClick:
|
|
719
|
-
s || p();
|
|
720
|
-
},
|
|
768
|
+
onClick: ve,
|
|
721
769
|
className: "shrink-0"
|
|
722
770
|
}),
|
|
723
|
-
m && /* @__PURE__ */ X(
|
|
771
|
+
m && /* @__PURE__ */ X(L, {
|
|
724
772
|
label: M.publishLabel,
|
|
725
|
-
iconBefore: /* @__PURE__ */ X(
|
|
773
|
+
iconBefore: /* @__PURE__ */ X(U, {
|
|
726
774
|
size: b.MD,
|
|
727
775
|
"aria-hidden": !0,
|
|
728
776
|
stroke: x
|
|
@@ -730,9 +778,9 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
730
778
|
onClick: m,
|
|
731
779
|
className: "hidden shrink-0 desktop:inline-flex"
|
|
732
780
|
}),
|
|
733
|
-
h && /* @__PURE__ */ X(
|
|
781
|
+
h && /* @__PURE__ */ X(L, {
|
|
734
782
|
label: M.editLabel,
|
|
735
|
-
iconBefore: /* @__PURE__ */ X(
|
|
783
|
+
iconBefore: /* @__PURE__ */ X(B, {
|
|
736
784
|
size: b.MD,
|
|
737
785
|
"aria-hidden": !0,
|
|
738
786
|
stroke: x
|
|
@@ -744,91 +792,63 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
744
792
|
_e(!0, "desktop:hidden")
|
|
745
793
|
]
|
|
746
794
|
}), /* @__PURE__ */ Z("div", {
|
|
747
|
-
className: d("flex min-w-0 flex-1 flex-col",
|
|
795
|
+
className: d("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto", xe && "desktop:flex-row desktop:overflow-hidden", A == null && xe && "desktop:justify-end"),
|
|
748
796
|
children: [A != null && /* @__PURE__ */ X("section", {
|
|
749
797
|
"aria-label": j,
|
|
750
|
-
className: "flex min-w-0 flex-1 flex-col
|
|
751
|
-
children:
|
|
798
|
+
className: d("flex min-w-0 flex-1 flex-col px-4 py-6 desktop:px-8", xe && "desktop:overflow-y-auto"),
|
|
799
|
+
children: /* @__PURE__ */ X("div", {
|
|
800
|
+
className: "mx-auto flex w-full max-w-[748px] min-w-0 flex-col gap-5",
|
|
801
|
+
children: A
|
|
802
|
+
})
|
|
752
803
|
}), /* @__PURE__ */ Z("aside", {
|
|
753
|
-
"aria-labelledby":
|
|
754
|
-
className: d("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:px-8",
|
|
804
|
+
"aria-labelledby": pe,
|
|
805
|
+
className: d("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:px-8", xe && "desktop:w-[488px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s desktop:border-t-0", $.panel),
|
|
755
806
|
children: [
|
|
756
807
|
/* @__PURE__ */ X("h2", {
|
|
757
|
-
id:
|
|
758
|
-
className: d(
|
|
808
|
+
id: pe,
|
|
809
|
+
className: d(ne, $.title),
|
|
759
810
|
children: M.detailsLabel
|
|
760
811
|
}),
|
|
761
812
|
e.description !== "" && /* @__PURE__ */ Z("section", {
|
|
762
813
|
className: "flex min-w-0 flex-col gap-1",
|
|
763
814
|
children: [/* @__PURE__ */ X("h3", {
|
|
764
|
-
className: d(
|
|
815
|
+
className: d(ae, $.secondary),
|
|
765
816
|
children: M.descriptionLabel
|
|
766
817
|
}), /* @__PURE__ */ X("p", {
|
|
767
|
-
className: d("wrap-break-word whitespace-pre-line",
|
|
818
|
+
className: d("wrap-break-word whitespace-pre-line", H, $.body),
|
|
768
819
|
children: e.description
|
|
769
820
|
})]
|
|
770
821
|
}),
|
|
771
822
|
e.instructions !== "" && /* @__PURE__ */ Z("section", {
|
|
772
823
|
className: "flex min-w-0 flex-col gap-1",
|
|
773
824
|
children: [/* @__PURE__ */ X("h3", {
|
|
774
|
-
className: d(
|
|
825
|
+
className: d(ae, $.secondary),
|
|
775
826
|
children: M.instructionsLabel
|
|
776
827
|
}), /* @__PURE__ */ X("div", {
|
|
777
|
-
className: d("min-w-0 wrap-break-word",
|
|
828
|
+
className: d("min-w-0 wrap-break-word", H, $.body),
|
|
778
829
|
children: /* @__PURE__ */ X(r, {
|
|
779
830
|
content: e.instructions,
|
|
780
|
-
classNames:
|
|
831
|
+
classNames: J
|
|
781
832
|
})
|
|
782
833
|
})]
|
|
783
834
|
}),
|
|
784
835
|
/* @__PURE__ */ Z("section", {
|
|
785
836
|
className: "flex min-w-0 flex-col gap-2",
|
|
786
837
|
children: [/* @__PURE__ */ X("h3", {
|
|
787
|
-
className: d(
|
|
838
|
+
className: d(ae, $.secondary),
|
|
788
839
|
children: M.contextLabel
|
|
789
|
-
}),
|
|
790
|
-
/* @__PURE__ */ X("div", {
|
|
791
|
-
role: "search",
|
|
792
|
-
children: /* @__PURE__ */ X(ne, {
|
|
793
|
-
value: l,
|
|
794
|
-
onChange: (e) => u(e ?? ""),
|
|
795
|
-
placeholder: M.contextSearchPlaceholder,
|
|
796
|
-
clearLabel: M.clearSearchLabel,
|
|
797
|
-
"aria-label": M.contextSearchAriaLabel
|
|
798
|
-
})
|
|
799
|
-
}),
|
|
800
|
-
G.length === 0 ? /* @__PURE__ */ X("p", {
|
|
801
|
-
className: d(oe, $.secondary),
|
|
802
|
-
children: M.noContextMatchesLabel
|
|
803
|
-
}) : /* @__PURE__ */ X("ul", {
|
|
804
|
-
className: "m-0 flex min-w-0 list-none flex-wrap gap-2 p-0 pt-2",
|
|
805
|
-
children: G.map((e) => /* @__PURE__ */ X("li", {
|
|
806
|
-
className: "min-w-0",
|
|
807
|
-
children: /* @__PURE__ */ X(he, {
|
|
808
|
-
attachment: it(e),
|
|
809
|
-
searchQuery: K,
|
|
810
|
-
onClick: y,
|
|
811
|
-
isSelected: e.name === C,
|
|
812
|
-
labels: { clickLabel: M.openFileLabel(e.name) }
|
|
813
|
-
})
|
|
814
|
-
}, e.name))
|
|
815
|
-
}),
|
|
816
|
-
/* @__PURE__ */ X(P, {
|
|
817
|
-
visuallyHidden: !0,
|
|
818
|
-
as: F.Span,
|
|
819
|
-
children: K === "" ? "" : M.contextResultCountLabel(G.length)
|
|
820
|
-
})
|
|
821
|
-
] })]
|
|
840
|
+
}), be()]
|
|
822
841
|
})
|
|
823
842
|
]
|
|
824
843
|
})]
|
|
825
844
|
})]
|
|
826
845
|
});
|
|
827
846
|
}), ot = {
|
|
828
|
-
|
|
829
|
-
|
|
847
|
+
row: "_row_1030u_1",
|
|
848
|
+
readDot: "_readDot_1030u_6",
|
|
849
|
+
unreadDot: "_unreadDot_1030u_10"
|
|
830
850
|
}, st = ({ item: e, labels: t, rowTitleClassName: n, unreadRowTitleClassName: r, onOpen: i, onRename: a, onDelete: o }) => {
|
|
831
|
-
let s =
|
|
851
|
+
let s = K(), [c, l] = Y(!1), u = e.isUnread === !0, f = q(() => [...a ? [{
|
|
832
852
|
key: "rename",
|
|
833
853
|
label: t.renameLabel,
|
|
834
854
|
onClick: () => a(e.id)
|
|
@@ -845,7 +865,7 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
845
865
|
a
|
|
846
866
|
]);
|
|
847
867
|
return /* @__PURE__ */ Z("li", {
|
|
848
|
-
className: "group/row flex min-w-0 items-center gap-1 rounded-xl
|
|
868
|
+
className: d("group/row flex min-w-0 items-center gap-1 rounded-xl", ot.row),
|
|
849
869
|
children: [
|
|
850
870
|
/* @__PURE__ */ Z("button", {
|
|
851
871
|
type: "button",
|
|
@@ -875,7 +895,7 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
875
895
|
"aria-label": t.moreActionsLabel(e.title),
|
|
876
896
|
size: C.Small,
|
|
877
897
|
className: d("me-2 shrink-0", !c && "desktop:opacity-0 desktop:group-focus-within/row:opacity-100 desktop:group-hover/row:opacity-100"),
|
|
878
|
-
icon: /* @__PURE__ */ X(
|
|
898
|
+
icon: /* @__PURE__ */ X(z, {
|
|
879
899
|
"aria-hidden": !0,
|
|
880
900
|
size: b.SM,
|
|
881
901
|
stroke: x
|
|
@@ -884,208 +904,214 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
884
904
|
})
|
|
885
905
|
]
|
|
886
906
|
});
|
|
887
|
-
}, ct =
|
|
888
|
-
let
|
|
889
|
-
"--pcl-read-dot":
|
|
890
|
-
"--pcl-unread-dot":
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
907
|
+
}, ct = W(({ items: e, isLoading: t = !1, hasError: n = !1, onRetry: r, hasMore: i = !1, isLoadingMore: o = !1, onLoadMore: s, isEmptyStateShown: l = !0, onOpen: u, onRename: f, onDelete: p, labels: m, typography: h, colors: g }) => {
|
|
908
|
+
let _ = K(), v = h?.titleClassName ?? "dial-body-semi-text", y = h?.rowTitleClassName ?? "dial-body-text", b = h?.unreadRowTitleClassName ?? "dial-body-semi-text", x = q(() => c({
|
|
909
|
+
"--pcl-read-dot": g?.readDot,
|
|
910
|
+
"--pcl-unread-dot": g?.unreadDot,
|
|
911
|
+
"--pcl-row-hover": g?.rowHoverBackground
|
|
912
|
+
}), [
|
|
913
|
+
g?.readDot,
|
|
914
|
+
g?.unreadDot,
|
|
915
|
+
g?.rowHoverBackground
|
|
916
|
+
]), S = h?.messageClassName ?? "dial-small-text", C = !t && !n && e.length === 0;
|
|
917
|
+
return C && !l ? null : /* @__PURE__ */ Z("section", {
|
|
918
|
+
"aria-labelledby": C ? void 0 : _,
|
|
919
|
+
"aria-label": C ? m.title : void 0,
|
|
895
920
|
className: "flex min-w-0 flex-col gap-2 pt-3",
|
|
896
|
-
style:
|
|
897
|
-
children: [!
|
|
898
|
-
id:
|
|
899
|
-
className: d("m-0",
|
|
900
|
-
children:
|
|
921
|
+
style: x,
|
|
922
|
+
children: [!C && /* @__PURE__ */ X("h2", {
|
|
923
|
+
id: _,
|
|
924
|
+
className: d("m-0", v),
|
|
925
|
+
children: m.title
|
|
901
926
|
}), t ? /* @__PURE__ */ Z("div", {
|
|
902
927
|
role: "status",
|
|
903
928
|
className: "flex justify-center py-6",
|
|
904
929
|
children: [/* @__PURE__ */ X("span", {
|
|
905
930
|
"aria-hidden": !0,
|
|
906
|
-
children: /* @__PURE__ */ X(
|
|
931
|
+
children: /* @__PURE__ */ X(ie, {})
|
|
907
932
|
}), /* @__PURE__ */ X("span", {
|
|
908
933
|
className: "sr-only",
|
|
909
|
-
children:
|
|
934
|
+
children: m.loadingLabel
|
|
910
935
|
})]
|
|
911
936
|
}) : n ? /* @__PURE__ */ Z("div", {
|
|
912
937
|
role: "status",
|
|
913
938
|
className: "flex flex-col items-center gap-3 py-6 text-center",
|
|
914
939
|
children: [/* @__PURE__ */ X("p", {
|
|
915
|
-
className: d("m-0",
|
|
916
|
-
children:
|
|
940
|
+
className: d("m-0", S),
|
|
941
|
+
children: m.errorLabel
|
|
917
942
|
}), /* @__PURE__ */ X(O, {
|
|
918
|
-
label:
|
|
943
|
+
label: m.retryLabel,
|
|
919
944
|
onClick: r
|
|
920
945
|
})]
|
|
921
|
-
}) :
|
|
946
|
+
}) : C ? /* @__PURE__ */ X("div", {
|
|
922
947
|
role: "status",
|
|
923
948
|
children: /* @__PURE__ */ X(a, {
|
|
924
|
-
label:
|
|
925
|
-
description:
|
|
949
|
+
label: m.emptyTitle,
|
|
950
|
+
description: m.emptyDescription
|
|
926
951
|
})
|
|
927
952
|
}) : /* @__PURE__ */ Z(me, { children: [/* @__PURE__ */ X("ul", {
|
|
928
953
|
className: "m-0 flex min-w-0 list-none flex-col gap-2 p-0",
|
|
929
954
|
children: e.map((e) => /* @__PURE__ */ X(st, {
|
|
930
955
|
item: e,
|
|
931
|
-
labels:
|
|
932
|
-
rowTitleClassName:
|
|
933
|
-
unreadRowTitleClassName:
|
|
934
|
-
onOpen:
|
|
935
|
-
onRename:
|
|
936
|
-
onDelete:
|
|
956
|
+
labels: m,
|
|
957
|
+
rowTitleClassName: y,
|
|
958
|
+
unreadRowTitleClassName: b,
|
|
959
|
+
onOpen: u,
|
|
960
|
+
onRename: f,
|
|
961
|
+
onDelete: p
|
|
937
962
|
}, e.id))
|
|
938
963
|
}), i && s && /* @__PURE__ */ X(N, {
|
|
939
964
|
className: "self-start",
|
|
940
|
-
label:
|
|
965
|
+
label: m.loadMoreLabel ?? "See more",
|
|
941
966
|
disabled: o,
|
|
942
967
|
onClick: s
|
|
943
968
|
})] })]
|
|
944
969
|
});
|
|
945
|
-
}), lt =
|
|
946
|
-
let
|
|
947
|
-
|
|
948
|
-
}, []), F =
|
|
949
|
-
let e =
|
|
950
|
-
|
|
951
|
-
}, []), I =
|
|
952
|
-
|
|
953
|
-
let t =
|
|
970
|
+
}), lt = W(({ composer: t, outputs: n, hasOutputs: r = !1, items: i, isLoading: a = !1, hasError: o = !1, onRetry: s, hasMore: c, isLoadingMore: l, onLoadMore: u, onOpen: d, onRename: f, onDelete: p, labels: m, listTypography: h, listColors: _ }) => {
|
|
971
|
+
let y = K(), b = J(null), [x, S] = Y(null), [C, w] = Y(""), [T, E] = Y(), [D, O] = Y(!1), [k, A] = Y(null), [M, N] = Y(!1), P = J(null), ee = G(() => {
|
|
972
|
+
P.current = document.activeElement;
|
|
973
|
+
}, []), F = G(() => {
|
|
974
|
+
let e = P.current;
|
|
975
|
+
P.current = null, e?.isConnected && window.setTimeout(() => e.focus(), 0);
|
|
976
|
+
}, []), I = G((e) => {
|
|
977
|
+
P.current = null, window.setTimeout(() => {
|
|
978
|
+
let t = b.current;
|
|
954
979
|
if (!t) return;
|
|
955
980
|
let n = t.querySelectorAll("li > button"), r = n[Math.min(e, n.length - 1)] ?? t.querySelector("h2, section");
|
|
956
981
|
r && !r.matches("button") && (r.tabIndex = -1), r?.focus();
|
|
957
982
|
}, 0);
|
|
958
|
-
}, []), L =
|
|
959
|
-
|
|
960
|
-
let e = (e) => e != null &&
|
|
961
|
-
|
|
983
|
+
}, []), L = G((e) => i.find((t) => t.id === e) ?? null, [i]);
|
|
984
|
+
pe(() => {
|
|
985
|
+
let e = (e) => e != null && i.some((t) => t.id === e.id);
|
|
986
|
+
x && !D && !e(x) && (S(null), I(0)), k && !M && !e(k) && (A(null), I(0));
|
|
962
987
|
}, [
|
|
963
|
-
|
|
988
|
+
k,
|
|
964
989
|
I,
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
990
|
+
M,
|
|
991
|
+
D,
|
|
992
|
+
i,
|
|
993
|
+
x
|
|
969
994
|
]);
|
|
970
|
-
let
|
|
971
|
-
|
|
995
|
+
let re = G((e) => {
|
|
996
|
+
ee();
|
|
972
997
|
let t = L(e);
|
|
973
|
-
|
|
974
|
-
}, [L,
|
|
975
|
-
|
|
976
|
-
}, [L,
|
|
977
|
-
|
|
978
|
-
}, [
|
|
979
|
-
|
|
980
|
-
}, [
|
|
981
|
-
if (!
|
|
982
|
-
let e =
|
|
983
|
-
if (!e)
|
|
998
|
+
S(t), w(t?.title ?? ""), E(void 0);
|
|
999
|
+
}, [L, ee]), ie = G((e) => {
|
|
1000
|
+
ee(), A(L(e));
|
|
1001
|
+
}, [L, ee]), R = G(() => {
|
|
1002
|
+
D || (S(null), F());
|
|
1003
|
+
}, [D, F]), ae = G(() => {
|
|
1004
|
+
M || (A(null), F());
|
|
1005
|
+
}, [M, F]), z = G(async () => {
|
|
1006
|
+
if (!x || !f || D) return;
|
|
1007
|
+
let e = C.trim();
|
|
1008
|
+
if (!e) E(m.renameEmptyError);
|
|
984
1009
|
else {
|
|
985
|
-
|
|
1010
|
+
O(!0);
|
|
986
1011
|
try {
|
|
987
|
-
await
|
|
1012
|
+
await f(x.id, e), S(null), F();
|
|
988
1013
|
} catch {} finally {
|
|
989
|
-
|
|
1014
|
+
O(!1);
|
|
990
1015
|
}
|
|
991
1016
|
}
|
|
992
1017
|
}, [
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1018
|
+
D,
|
|
1019
|
+
m.renameEmptyError,
|
|
1020
|
+
f,
|
|
1021
|
+
x,
|
|
1022
|
+
C,
|
|
998
1023
|
F
|
|
999
|
-
]),
|
|
1000
|
-
e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(),
|
|
1001
|
-
}, [
|
|
1002
|
-
if (!
|
|
1003
|
-
let e =
|
|
1004
|
-
|
|
1024
|
+
]), oe = G((e) => {
|
|
1025
|
+
e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), z());
|
|
1026
|
+
}, [z]), B = G(async () => {
|
|
1027
|
+
if (!k || !p) return;
|
|
1028
|
+
let e = i.findIndex((e) => e.id === k.id);
|
|
1029
|
+
N(!0);
|
|
1005
1030
|
try {
|
|
1006
|
-
await
|
|
1031
|
+
await p(k.id), A(null), I(Math.max(e, 0));
|
|
1007
1032
|
} catch {} finally {
|
|
1008
|
-
|
|
1033
|
+
N(!1);
|
|
1009
1034
|
}
|
|
1010
1035
|
}, [
|
|
1011
|
-
|
|
1036
|
+
k,
|
|
1012
1037
|
I,
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
]),
|
|
1016
|
-
label:
|
|
1038
|
+
i,
|
|
1039
|
+
p
|
|
1040
|
+
]), V = q(() => [{
|
|
1041
|
+
label: m.renameCancelLabel ?? "Cancel",
|
|
1017
1042
|
variant: v.Primary,
|
|
1018
1043
|
appearance: g.Ghost,
|
|
1019
|
-
disabled:
|
|
1020
|
-
onClick:
|
|
1044
|
+
disabled: D,
|
|
1045
|
+
onClick: R
|
|
1021
1046
|
}, {
|
|
1022
|
-
label:
|
|
1047
|
+
label: m.renameSaveLabel,
|
|
1023
1048
|
variant: v.Primary,
|
|
1024
|
-
disabled:
|
|
1049
|
+
disabled: D,
|
|
1025
1050
|
onClick: () => {
|
|
1026
|
-
|
|
1051
|
+
z();
|
|
1027
1052
|
}
|
|
1028
1053
|
}], [
|
|
1054
|
+
R,
|
|
1029
1055
|
z,
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
p.renameSaveLabel
|
|
1056
|
+
D,
|
|
1057
|
+
m.renameCancelLabel,
|
|
1058
|
+
m.renameSaveLabel
|
|
1034
1059
|
]);
|
|
1035
1060
|
return /* @__PURE__ */ Z(me, { children: [
|
|
1036
1061
|
t,
|
|
1037
1062
|
n,
|
|
1038
1063
|
/* @__PURE__ */ X("div", {
|
|
1039
|
-
ref:
|
|
1064
|
+
ref: b,
|
|
1040
1065
|
className: "contents",
|
|
1041
1066
|
children: /* @__PURE__ */ X(ct, {
|
|
1042
|
-
items:
|
|
1043
|
-
isLoading:
|
|
1044
|
-
hasError:
|
|
1045
|
-
onRetry:
|
|
1046
|
-
hasMore:
|
|
1047
|
-
isLoadingMore:
|
|
1048
|
-
onLoadMore:
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1067
|
+
items: i,
|
|
1068
|
+
isLoading: a,
|
|
1069
|
+
hasError: o,
|
|
1070
|
+
onRetry: s,
|
|
1071
|
+
hasMore: c,
|
|
1072
|
+
isLoadingMore: l,
|
|
1073
|
+
onLoadMore: u,
|
|
1074
|
+
isEmptyStateShown: !r,
|
|
1075
|
+
onOpen: d,
|
|
1076
|
+
onRename: f ? re : void 0,
|
|
1077
|
+
onDelete: p ? ie : void 0,
|
|
1078
|
+
labels: m.list,
|
|
1079
|
+
typography: h,
|
|
1080
|
+
colors: _
|
|
1055
1081
|
})
|
|
1056
1082
|
}),
|
|
1057
|
-
|
|
1083
|
+
x && /* @__PURE__ */ X(te, {
|
|
1058
1084
|
open: !0,
|
|
1059
|
-
header:
|
|
1060
|
-
size:
|
|
1061
|
-
mainButtons:
|
|
1062
|
-
onClose:
|
|
1085
|
+
header: m.renameTitle,
|
|
1086
|
+
size: ne.Sm,
|
|
1087
|
+
mainButtons: V,
|
|
1088
|
+
onClose: R,
|
|
1063
1089
|
children: /* @__PURE__ */ X("div", {
|
|
1064
1090
|
className: "px-6 py-4",
|
|
1065
1091
|
children: /* @__PURE__ */ X(j, {
|
|
1066
|
-
id:
|
|
1067
|
-
value:
|
|
1068
|
-
labelProps: { label:
|
|
1069
|
-
error:
|
|
1070
|
-
disabled:
|
|
1071
|
-
onKeyDown:
|
|
1092
|
+
id: y,
|
|
1093
|
+
value: C,
|
|
1094
|
+
labelProps: { label: m.renameInputLabel },
|
|
1095
|
+
error: T,
|
|
1096
|
+
disabled: D,
|
|
1097
|
+
onKeyDown: oe,
|
|
1072
1098
|
onChange: (e) => {
|
|
1073
|
-
|
|
1099
|
+
w(e ?? ""), E(void 0);
|
|
1074
1100
|
}
|
|
1075
1101
|
})
|
|
1076
1102
|
})
|
|
1077
1103
|
}),
|
|
1078
|
-
|
|
1104
|
+
k && /* @__PURE__ */ X(e, {
|
|
1079
1105
|
open: !0,
|
|
1080
|
-
title:
|
|
1081
|
-
names: [
|
|
1082
|
-
message:
|
|
1083
|
-
labels:
|
|
1084
|
-
isLoading:
|
|
1106
|
+
title: m.deleteTitle(k.title),
|
|
1107
|
+
names: [k.title],
|
|
1108
|
+
message: m.deleteDescription,
|
|
1109
|
+
labels: m.deleteDialog,
|
|
1110
|
+
isLoading: M,
|
|
1085
1111
|
onConfirm: () => {
|
|
1086
|
-
|
|
1112
|
+
B();
|
|
1087
1113
|
},
|
|
1088
|
-
onClose:
|
|
1114
|
+
onClose: ae
|
|
1089
1115
|
})
|
|
1090
1116
|
] });
|
|
1091
1117
|
}), ut = {
|
|
@@ -1097,14 +1123,14 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
1097
1123
|
contentType: e.contentType,
|
|
1098
1124
|
type: l(e.contentType),
|
|
1099
1125
|
status: o.Idle
|
|
1100
|
-
}), pt =
|
|
1101
|
-
let l =
|
|
1126
|
+
}), pt = W(({ items: e, onOpenOutput: t, selectedOutputName: n, hasError: r = !1, onRetry: i, previewLimit: a = dt, labels: o, styles: s }) => {
|
|
1127
|
+
let l = K(), u = K(), f = J(null), p = J(!1), [m, h] = Y(!1), { colors: g, typography: _ } = s ?? {}, v = _?.titleClassName ?? "dial-body-semi-text", y = _?.helperClassName ?? "dial-tiny-text", b = o?.title ?? "Outputs", x = o?.errorLabel ?? "Could not load outputs", S = q(() => c({
|
|
1102
1128
|
"--po-heading-text": g?.headingText,
|
|
1103
1129
|
"--po-secondary-text": g?.secondaryText
|
|
1104
|
-
}), [g?.headingText, g?.secondaryText]), C =
|
|
1130
|
+
}), [g?.headingText, g?.secondaryText]), C = G(() => h((e) => !e), []), w = G(() => {
|
|
1105
1131
|
p.current = !0, i?.();
|
|
1106
1132
|
}, [i]);
|
|
1107
|
-
|
|
1133
|
+
pe(() => {
|
|
1108
1134
|
!r && p.current && (p.current = !1, f.current?.focus());
|
|
1109
1135
|
}, [r]);
|
|
1110
1136
|
let T = r || e.length > 0, E = e.length > a, D = m || !E ? e : e.slice(0, a), k = o?.openOutputLabel ?? ((e) => `Preview ${e}`), A = o?.seeAllLabel?.(e.length) ?? `See all (${e.length})`, j = o?.showLessLabel ?? "Show less";
|
|
@@ -1154,12 +1180,12 @@ var ye = /* @__PURE__ */ function(e) {
|
|
|
1154
1180
|
children: r ? x : ""
|
|
1155
1181
|
})]
|
|
1156
1182
|
});
|
|
1157
|
-
}), mt =
|
|
1183
|
+
}), mt = W(({ projectName: e, projectHref: t, onBack: n, onProjectLinkClick: r, backLabel: i, className: a, nameClassName: o = "dial-body-text" }) => /* @__PURE__ */ Z("nav", {
|
|
1158
1184
|
"aria-label": i,
|
|
1159
1185
|
className: d("flex min-w-0 shrink-0 items-center gap-2 border-b px-4 py-2", a),
|
|
1160
1186
|
children: [/* @__PURE__ */ X(k, {
|
|
1161
1187
|
"aria-label": i,
|
|
1162
|
-
icon: /* @__PURE__ */ X(
|
|
1188
|
+
icon: /* @__PURE__ */ X(R, {
|
|
1163
1189
|
"aria-hidden": !0,
|
|
1164
1190
|
size: b.MD,
|
|
1165
1191
|
stroke: x,
|