@epam/ai-dial-projects 1.3.0-dev.249 → 1.3.0-dev.253
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/ProjectChatHeader/ProjectChatHeader.d.ts +4 -0
- package/components/ProjectChatHeader/ProjectChatHeader.d.ts.map +1 -0
- package/components/ProjectConversationList/ProjectConversationList.d.ts +4 -0
- package/components/ProjectConversationList/ProjectConversationList.d.ts.map +1 -0
- package/components/ProjectConversationsPanel/ProjectConversationsPanel.d.ts +4 -0
- package/components/ProjectConversationsPanel/ProjectConversationsPanel.d.ts.map +1 -0
- package/components/ProjectView/ProjectView.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -1
- package/index.js +754 -494
- package/models/project-chat-header-props.d.ts +19 -0
- package/models/project-chat-header-props.d.ts.map +1 -0
- package/models/project-conversation-list-props.d.ts +71 -0
- package/models/project-conversation-list-props.d.ts.map +1 -0
- package/models/project-conversations-panel-props.d.ts +54 -0
- package/models/project-conversations-panel-props.d.ts.map +1 -0
- package/models/project-view-props.d.ts +5 -0
- package/models/project-view-props.d.ts.map +1 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Button as
|
|
3
|
-
import { IconArrowNarrowLeft as
|
|
4
|
-
import { Suspense as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { AttachmentCard as
|
|
7
|
-
import { BuilderFormContainer as
|
|
8
|
-
import { LazyMarkdownEditor as
|
|
1
|
+
import { DeleteConfirmationDialog as e, InitialsAvatar 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, useTextRefinement as p } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { Button as m, ButtonAppearance as h, ButtonDropdown as g, ButtonVariant as _, CardShell as v, DIAL_ICON_SIZE as y, DIAL_KIT_ICON_STROKE as b, Dropdown 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 te, Label as A, LiveRegion as j, LiveRegionElement as ne, LiveRegionPoliteness as M, MenuItemMark as N, NeutralButton as re, Popup as P, PopupSize as ie, ProgressBar as F, ProgressBarRole as I, Search as L, Spinner as ae, Textarea as R } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconArrowNarrowLeft as z, IconArrowsSort as oe, IconDotsVertical as se, IconPin as ce, IconPinFilled as le } from "@tabler/icons-react";
|
|
4
|
+
import { Suspense as ue, lazy as de, memo as B, useCallback as V, useEffect as fe, useId as H, useMemo as U, useRef as W, useState as G } from "react";
|
|
5
|
+
import { Fragment as pe, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
6
|
+
import { AttachmentCard as me, FileDndOverlay as he } from "@epam/ai-dial-attachment-input";
|
|
7
|
+
import { BuilderFormContainer as ge } from "@epam/ai-dial-builder-form";
|
|
8
|
+
import { LazyMarkdownEditor as _e } from "@epam/ai-dial-ui-kit/editors";
|
|
9
9
|
//#region src/types/projects-sort-key.ts
|
|
10
|
-
var
|
|
10
|
+
var ve = /* @__PURE__ */ function(e) {
|
|
11
11
|
return e.Newest = "newest", e.Oldest = "oldest", e.NameAsc = "name-asc", e;
|
|
12
|
-
}({}),
|
|
12
|
+
}({}), J = (e, t) => {
|
|
13
13
|
let n = t.trim().toLocaleLowerCase();
|
|
14
14
|
return n ? e.filter((e) => e.name.toLocaleLowerCase().includes(n)) : e;
|
|
15
|
-
},
|
|
15
|
+
}, ye = (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 === ve.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
|
|
21
|
+
let o = t === ve.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",
|
|
26
|
+
}, be = 60, xe = 3600, Y = 24 * xe, Se = [
|
|
27
|
+
["year", 365 * Y],
|
|
28
|
+
["month", 30 * Y],
|
|
29
|
+
["week", 7 * Y],
|
|
30
|
+
["day", Y],
|
|
31
|
+
["hour", xe],
|
|
32
|
+
["minute", be]
|
|
33
33
|
], Ce = (e, t, n) => {
|
|
34
34
|
let r = (t - e) / 1e3;
|
|
35
|
-
for (let [e, t] of
|
|
35
|
+
for (let [e, t] of Se) {
|
|
36
36
|
let i = Math.floor(r / t);
|
|
37
37
|
if (i >= 1) return new Intl.RelativeTimeFormat(n).format(-i, e);
|
|
38
38
|
}
|
|
39
39
|
return new Intl.RelativeTimeFormat(n, { numeric: "auto" }).format(0, "second");
|
|
40
|
-
},
|
|
40
|
+
}, X = {
|
|
41
41
|
card: "_card_1o77o_1",
|
|
42
42
|
title: "_title_1o77o_5",
|
|
43
43
|
updatedAt: "_updatedAt_1o77o_9",
|
|
@@ -46,259 +46,259 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
46
46
|
link: "_link_1o77o_23",
|
|
47
47
|
aboveLink: "_aboveLink_1o77o_39",
|
|
48
48
|
interactive: "_interactive_1o77o_44"
|
|
49
|
-
}, we = (e, t) => [e, ...(t ?? "").split("/").filter((e) => e.length > 0)], Te = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Ee = ({ project: e, searchQuery: t, sourceLabel: n, folderPathLabel: r, pinnedLabel: i, href: a, onOpen: o, now:
|
|
50
|
-
let
|
|
49
|
+
}, we = (e, t) => [e, ...(t ?? "").split("/").filter((e) => e.length > 0)], Te = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Ee = ({ project: e, searchQuery: t, sourceLabel: n, folderPathLabel: r, pinnedLabel: i, href: a, onOpen: o, now: s, locale: c, updatedAtClassName: ee, titleClassName: l, pathLabelClassName: u, pathLeafClassName: f }) => {
|
|
50
|
+
let p = /* @__PURE__ */ K(k, {
|
|
51
51
|
text: e.name,
|
|
52
52
|
query: t,
|
|
53
53
|
maxLines: 1,
|
|
54
|
-
className:
|
|
54
|
+
className: d("min-w-0", l, X.title, a != null && X.aboveLink)
|
|
55
55
|
});
|
|
56
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ K("li", {
|
|
57
57
|
className: "flex min-w-0",
|
|
58
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ q(v, {
|
|
59
59
|
"aria-label": e.name,
|
|
60
|
-
className:
|
|
60
|
+
className: d("relative flex w-full min-w-0 flex-col gap-2", X.card, a != null && "has-focus-visible:-translate-y-[3px] has-focus-visible:shadow-lg motion-reduce:has-focus-visible:translate-y-0", a != null && X.interactive),
|
|
61
61
|
children: [
|
|
62
|
-
e.updatedAt != null && /* @__PURE__ */
|
|
62
|
+
e.updatedAt != null && /* @__PURE__ */ K("time", {
|
|
63
63
|
dateTime: new Date(e.updatedAt).toISOString(),
|
|
64
|
-
className:
|
|
65
|
-
children: Ce(e.updatedAt,
|
|
64
|
+
className: d(ee, X.updatedAt),
|
|
65
|
+
children: Ce(e.updatedAt, s, c)
|
|
66
66
|
}),
|
|
67
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ q("div", {
|
|
68
68
|
className: "flex min-w-0 items-center gap-2",
|
|
69
|
-
children: [a == null ? /* @__PURE__ */
|
|
69
|
+
children: [a == null ? /* @__PURE__ */ K("div", {
|
|
70
70
|
className: "min-w-0 flex-1",
|
|
71
|
-
children:
|
|
72
|
-
}) : /* @__PURE__ */
|
|
71
|
+
children: p
|
|
72
|
+
}) : /* @__PURE__ */ K("a", {
|
|
73
73
|
href: a,
|
|
74
74
|
onClick: (t) => {
|
|
75
75
|
o != null && Te(t) && (t.preventDefault(), o(e.id));
|
|
76
76
|
},
|
|
77
|
-
className:
|
|
78
|
-
children:
|
|
79
|
-
}), e.isPinned && /* @__PURE__ */
|
|
80
|
-
className:
|
|
81
|
-
children: [/* @__PURE__ */
|
|
82
|
-
size:
|
|
77
|
+
className: d("min-w-0 flex-1", X.link),
|
|
78
|
+
children: p
|
|
79
|
+
}), e.isPinned && /* @__PURE__ */ q("span", {
|
|
80
|
+
className: d("shrink-0", X.pin),
|
|
81
|
+
children: [/* @__PURE__ */ K(le, {
|
|
82
|
+
size: y.SM,
|
|
83
83
|
"aria-hidden": !0
|
|
84
|
-
}), /* @__PURE__ */
|
|
84
|
+
}), /* @__PURE__ */ K("span", {
|
|
85
85
|
className: "sr-only",
|
|
86
86
|
children: i
|
|
87
87
|
})]
|
|
88
88
|
})]
|
|
89
89
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ K(E, {
|
|
91
91
|
segments: we(n, e.parentPath),
|
|
92
92
|
ariaLabel: r,
|
|
93
|
-
labelClassName:
|
|
94
|
-
leafClassName:
|
|
95
|
-
className:
|
|
93
|
+
labelClassName: d(u, X.path),
|
|
94
|
+
leafClassName: d(f, X.path),
|
|
95
|
+
className: d(a != null && X.aboveLink)
|
|
96
96
|
})
|
|
97
97
|
]
|
|
98
98
|
})
|
|
99
99
|
});
|
|
100
|
-
},
|
|
100
|
+
}, Z = {
|
|
101
101
|
container: "_container_qfuxj_1",
|
|
102
102
|
subtitle: "_subtitle_qfuxj_5",
|
|
103
103
|
sortButton: "_sortButton_qfuxj_9"
|
|
104
|
-
},
|
|
105
|
-
let { colors:
|
|
106
|
-
"--pr-bg":
|
|
107
|
-
"--pr-subtitle-text":
|
|
108
|
-
"--pr-sort-text":
|
|
109
|
-
"--pr-card-bg":
|
|
110
|
-
"--pr-card-title-text":
|
|
111
|
-
"--pr-updated-at-text":
|
|
112
|
-
"--pr-path-text":
|
|
113
|
-
}), [
|
|
104
|
+
}, De = ({ projects: e, isLoading: t = !1, hasError: n = !1, incompleteSources: r = [], onRetry: i, onCreateProject: a, onOpenProject: s, getProjectHref: c, searchQuery: l, onSearchQueryChange: u, sortKey: f, onSortKeyChange: p, labels: v, locale: x, styles: C }) => {
|
|
105
|
+
let { colors: w, typography: T } = C ?? {}, E = T?.titleClassName ?? "dial-h2-text", O = T?.subtitleClassName ?? "dial-body-text", k = T?.cardTitleClassName ?? "dial-body-semi-text", te = T?.pathLabelClassName ?? "dial-tiny-text", A = T?.pathLeafClassName ?? "dial-tiny-semi-text", M = T?.updatedAtClassName ?? "dial-tiny-text", re = T?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", P = ee({
|
|
106
|
+
"--pr-bg": w?.background,
|
|
107
|
+
"--pr-subtitle-text": w?.subtitleText,
|
|
108
|
+
"--pr-sort-text": w?.sortButtonText,
|
|
109
|
+
"--pr-card-bg": w?.cardBackground,
|
|
110
|
+
"--pr-card-title-text": w?.cardTitleText,
|
|
111
|
+
"--pr-updated-at-text": w?.updatedAtText,
|
|
112
|
+
"--pr-path-text": w?.pathText
|
|
113
|
+
}), [ie] = G(() => Date.now()), F = l.trim(), I = r.length > 0, R = I && e.length === 0, z = U(() => ye(J(e, l), f, x), [
|
|
114
114
|
e,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
]),
|
|
115
|
+
l,
|
|
116
|
+
f,
|
|
117
|
+
x
|
|
118
|
+
]), se = v.sortOptions.find((e) => e.value === f)?.label ?? v.sortLabel, ce = U(() => v.sortOptions.map((e) => ({
|
|
119
119
|
key: e.value,
|
|
120
120
|
label: e.label,
|
|
121
|
-
mark:
|
|
122
|
-
checked: e.value ===
|
|
123
|
-
onClick: () =>
|
|
121
|
+
mark: N.Check,
|
|
122
|
+
checked: e.value === f,
|
|
123
|
+
onClick: () => p(e.value)
|
|
124
124
|
})), [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
]),
|
|
129
|
-
|
|
130
|
-
},
|
|
131
|
-
if (!t) return n ?
|
|
132
|
-
},
|
|
133
|
-
label:
|
|
125
|
+
v.sortOptions,
|
|
126
|
+
f,
|
|
127
|
+
p
|
|
128
|
+
]), le = (e) => {
|
|
129
|
+
u(e ?? "");
|
|
130
|
+
}, ue = () => {
|
|
131
|
+
if (!t) return n ? v.errorLabel : I ? v.incompleteLabel : e.length === 0 ? v.emptyStateLabel : z.length === 0 ? v.noResultsLabel : v.resultCountLabel(z.length);
|
|
132
|
+
}, de = (e, t) => a ? /* @__PURE__ */ K(m, {
|
|
133
|
+
label: v.createProjectLabel,
|
|
134
134
|
variant: e,
|
|
135
|
-
onClick:
|
|
136
|
-
className:
|
|
137
|
-
}) : void 0,
|
|
135
|
+
onClick: a,
|
|
136
|
+
className: d("shrink-0", t)
|
|
137
|
+
}) : void 0, B = () => t ? /* @__PURE__ */ K(ae, {}) : n || R ? /* @__PURE__ */ q("div", {
|
|
138
138
|
className: "flex flex-col items-center gap-3",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
140
|
-
className:
|
|
141
|
-
children: n ?
|
|
142
|
-
}), /* @__PURE__ */
|
|
143
|
-
label:
|
|
144
|
-
onClick:
|
|
139
|
+
children: [/* @__PURE__ */ K("p", {
|
|
140
|
+
className: d(O, Z.subtitle),
|
|
141
|
+
children: n ? v.errorLabel : v.incompleteLabel
|
|
142
|
+
}), /* @__PURE__ */ K(D, {
|
|
143
|
+
label: v.retryLabel,
|
|
144
|
+
onClick: i
|
|
145
145
|
})]
|
|
146
|
-
}) : e.length === 0 ? /* @__PURE__ */
|
|
147
|
-
label:
|
|
148
|
-
description:
|
|
149
|
-
action:
|
|
146
|
+
}) : e.length === 0 ? /* @__PURE__ */ K(o, {
|
|
147
|
+
label: v.emptyStateLabel,
|
|
148
|
+
description: v.emptyStateDescription,
|
|
149
|
+
action: de(_.Secondary, "mt-2"),
|
|
150
150
|
containerClassName: "p-3",
|
|
151
151
|
labelClassName: "mt-3",
|
|
152
|
-
descriptionClassName:
|
|
153
|
-
}) :
|
|
154
|
-
label:
|
|
152
|
+
descriptionClassName: re
|
|
153
|
+
}) : z.length === 0 ? /* @__PURE__ */ K(o, {
|
|
154
|
+
label: v.noResultsLabel,
|
|
155
155
|
containerClassName: "p-3",
|
|
156
156
|
labelClassName: "mt-3"
|
|
157
|
-
}) : /* @__PURE__ */
|
|
157
|
+
}) : /* @__PURE__ */ K("ul", {
|
|
158
158
|
className: "m-0 grid w-full min-w-0 list-none grid-cols-1 gap-5 p-0 desktop:grid-cols-3",
|
|
159
|
-
children:
|
|
159
|
+
children: z.map((e) => /* @__PURE__ */ K(Ee, {
|
|
160
160
|
project: e,
|
|
161
|
-
searchQuery:
|
|
162
|
-
sourceLabel:
|
|
163
|
-
folderPathLabel:
|
|
164
|
-
pinnedLabel:
|
|
161
|
+
searchQuery: F,
|
|
162
|
+
sourceLabel: v.sourceLabels[e.source],
|
|
163
|
+
folderPathLabel: v.folderPathLabel,
|
|
164
|
+
pinnedLabel: v.pinnedLabel ?? "Pinned",
|
|
165
165
|
href: c?.(e.id),
|
|
166
166
|
onOpen: s,
|
|
167
|
-
now:
|
|
168
|
-
locale:
|
|
169
|
-
updatedAtClassName:
|
|
170
|
-
titleClassName:
|
|
171
|
-
pathLabelClassName:
|
|
172
|
-
pathLeafClassName:
|
|
167
|
+
now: ie,
|
|
168
|
+
locale: x,
|
|
169
|
+
updatedAtClassName: M,
|
|
170
|
+
titleClassName: k,
|
|
171
|
+
pathLabelClassName: te,
|
|
172
|
+
pathLeafClassName: A
|
|
173
173
|
}, e.id))
|
|
174
|
-
}),
|
|
175
|
-
return /* @__PURE__ */
|
|
176
|
-
style:
|
|
177
|
-
className:
|
|
174
|
+
}), V = t || n || R;
|
|
175
|
+
return /* @__PURE__ */ q("div", {
|
|
176
|
+
style: P,
|
|
177
|
+
className: d("flex h-full w-full min-w-0 flex-col overflow-y-auto", Z.container),
|
|
178
178
|
children: [
|
|
179
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ q("div", {
|
|
180
180
|
className: "flex min-w-0 items-center gap-2 px-4 py-4 desktop:px-8",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ q("div", {
|
|
182
182
|
className: "min-w-0 flex-1",
|
|
183
|
-
children: [/* @__PURE__ */
|
|
184
|
-
className:
|
|
185
|
-
children:
|
|
186
|
-
}),
|
|
187
|
-
className:
|
|
188
|
-
children:
|
|
183
|
+
children: [/* @__PURE__ */ K("h1", {
|
|
184
|
+
className: d("break-words", E),
|
|
185
|
+
children: v.title
|
|
186
|
+
}), v.subtitle && /* @__PURE__ */ K("p", {
|
|
187
|
+
className: d("mt-0.5", O, Z.subtitle),
|
|
188
|
+
children: v.subtitle
|
|
189
189
|
})]
|
|
190
|
-
}),
|
|
190
|
+
}), de(_.Primary)]
|
|
191
191
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ q("div", {
|
|
193
193
|
className: "flex flex-col gap-3 px-4 pt-4 pb-5 desktop:flex-row desktop:items-center desktop:px-8",
|
|
194
|
-
children: [/* @__PURE__ */
|
|
194
|
+
children: [/* @__PURE__ */ K("div", {
|
|
195
195
|
role: "search",
|
|
196
196
|
className: "min-w-0 flex-1",
|
|
197
|
-
children: /* @__PURE__ */
|
|
198
|
-
value:
|
|
199
|
-
onChange:
|
|
200
|
-
placeholder:
|
|
201
|
-
clearLabel:
|
|
202
|
-
"aria-label":
|
|
203
|
-
size:
|
|
197
|
+
children: /* @__PURE__ */ K(L, {
|
|
198
|
+
value: l,
|
|
199
|
+
onChange: le,
|
|
200
|
+
placeholder: v.searchPlaceholder,
|
|
201
|
+
clearLabel: v.clearSearchLabel,
|
|
202
|
+
"aria-label": v.searchAriaLabel,
|
|
203
|
+
size: S.Large
|
|
204
204
|
})
|
|
205
|
-
}),
|
|
205
|
+
}), v.sortOptions.length > 0 && /* @__PURE__ */ K("div", {
|
|
206
206
|
role: "group",
|
|
207
|
-
"aria-label":
|
|
207
|
+
"aria-label": v.sortLabel,
|
|
208
208
|
className: "shrink-0",
|
|
209
|
-
children: /* @__PURE__ */
|
|
210
|
-
items:
|
|
211
|
-
label:
|
|
212
|
-
variant:
|
|
213
|
-
appearance:
|
|
214
|
-
iconBefore: /* @__PURE__ */
|
|
215
|
-
size:
|
|
209
|
+
children: /* @__PURE__ */ K(g, {
|
|
210
|
+
items: ce,
|
|
211
|
+
label: se,
|
|
212
|
+
variant: _.Primary,
|
|
213
|
+
appearance: h.Ghost,
|
|
214
|
+
iconBefore: /* @__PURE__ */ K(oe, {
|
|
215
|
+
size: y.SM,
|
|
216
216
|
"aria-hidden": !0,
|
|
217
|
-
stroke:
|
|
217
|
+
stroke: b
|
|
218
218
|
}),
|
|
219
|
-
className:
|
|
219
|
+
className: Z.sortButton
|
|
220
220
|
})
|
|
221
221
|
})]
|
|
222
222
|
}),
|
|
223
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ K(j, {
|
|
224
224
|
visuallyHidden: !0,
|
|
225
|
-
as:
|
|
226
|
-
children:
|
|
225
|
+
as: ne.Span,
|
|
226
|
+
children: ue()
|
|
227
227
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ q("div", {
|
|
229
229
|
className: "flex w-full min-w-0 flex-1 flex-col items-center gap-5 px-4 pt-6 pb-8 desktop:px-8",
|
|
230
|
-
children: [
|
|
230
|
+
children: [I && !t && !n && !R && /* @__PURE__ */ q("div", {
|
|
231
231
|
className: "flex w-full max-w-[1116px] flex-wrap items-center gap-3",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
233
|
-
className:
|
|
234
|
-
children:
|
|
235
|
-
}), /* @__PURE__ */
|
|
236
|
-
label:
|
|
237
|
-
onClick:
|
|
232
|
+
children: [/* @__PURE__ */ K("p", {
|
|
233
|
+
className: d(O, Z.subtitle),
|
|
234
|
+
children: v.incompleteLabel
|
|
235
|
+
}), /* @__PURE__ */ K(D, {
|
|
236
|
+
label: v.retryLabel,
|
|
237
|
+
onClick: i
|
|
238
238
|
})]
|
|
239
|
-
}), /* @__PURE__ */
|
|
240
|
-
className:
|
|
241
|
-
children:
|
|
239
|
+
}), /* @__PURE__ */ K("div", {
|
|
240
|
+
className: d("flex w-full max-w-[1116px] min-w-0 flex-col items-center", V && "flex-1 justify-center"),
|
|
241
|
+
children: B()
|
|
242
242
|
})]
|
|
243
243
|
})
|
|
244
244
|
]
|
|
245
245
|
});
|
|
246
|
-
},
|
|
246
|
+
}, Oe = /* @__PURE__ */ function(e) {
|
|
247
247
|
return e.Personal = "personal", e.Shared = "shared", e.Organization = "organization", e;
|
|
248
|
-
}({}),
|
|
249
|
-
let [t, n] =
|
|
248
|
+
}({}), ke = (e) => !!e.dataTransfer?.types.includes("Files"), Ae = (e) => {
|
|
249
|
+
let [t, n] = G(!1), r = W(0);
|
|
250
250
|
return {
|
|
251
251
|
isDragActive: t,
|
|
252
252
|
handlers: {
|
|
253
|
-
onDragEnter:
|
|
254
|
-
|
|
253
|
+
onDragEnter: V((e) => {
|
|
254
|
+
ke(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
255
255
|
}, []),
|
|
256
|
-
onDragLeave:
|
|
257
|
-
|
|
256
|
+
onDragLeave: V((e) => {
|
|
257
|
+
ke(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
258
258
|
}, []),
|
|
259
|
-
onDragOver:
|
|
260
|
-
|
|
259
|
+
onDragOver: V((e) => {
|
|
260
|
+
ke(e) && e.preventDefault();
|
|
261
261
|
}, []),
|
|
262
|
-
onDrop:
|
|
263
|
-
if (!
|
|
262
|
+
onDrop: V((t) => {
|
|
263
|
+
if (!ke(t)) return;
|
|
264
264
|
t.preventDefault(), r.current = 0, n(!1);
|
|
265
265
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
266
266
|
i.length > 0 && e(i);
|
|
267
267
|
}, [e])
|
|
268
268
|
}
|
|
269
269
|
};
|
|
270
|
-
},
|
|
270
|
+
}, Q = /* @__PURE__ */ function(e) {
|
|
271
271
|
return e.UnsupportedType = "unsupported-type", e.TooLarge = "too-large", e.CapacityExceeded = "capacity-exceeded", e.Duplicate = "duplicate", e.InvalidName = "invalid-name", e;
|
|
272
|
-
}({}),
|
|
272
|
+
}({}), je = /* @__PURE__ */ function(e) {
|
|
273
273
|
return e.Required = "required", e.InvalidCharacters = "invalid-characters", e.Reserved = "reserved", e.TooLong = "too-long", e;
|
|
274
|
-
}({}),
|
|
274
|
+
}({}), Me = 255, Ne = new RegExp(a.source, "u"), Pe = /[\p{Cc}--]/u, Fe = /* @__PURE__ */ new Set([
|
|
275
275
|
".",
|
|
276
276
|
"..",
|
|
277
277
|
"v",
|
|
278
278
|
"files",
|
|
279
279
|
".dial-resource",
|
|
280
280
|
".dial-folder"
|
|
281
|
-
]),
|
|
281
|
+
]), Ie = (e) => new TextEncoder().encode(e).length, Le = (e) => {
|
|
282
282
|
let t = e.trim();
|
|
283
|
-
return t.length === 0 ?
|
|
284
|
-
},
|
|
283
|
+
return t.length === 0 ? je.Required : Ie(t) > 255 ? je.TooLong : Ne.test(t) || Pe.test(t) ? je.InvalidCharacters : Fe.has(t) ? je.Reserved : null;
|
|
284
|
+
}, Re = (e) => {
|
|
285
285
|
let t = e.lastIndexOf(".");
|
|
286
286
|
return t > 0 ? e.slice(t + 1).toLowerCase() : "";
|
|
287
|
-
},
|
|
288
|
-
let t = e.type ||
|
|
287
|
+
}, ze = (e) => "isStored" in e && e.isStored, Be = (e) => ze(e) ? e.size : e.file.size, Ve = (e) => e.reduce((e, t) => e + Be(t), 0), He = 0, Ue = () => (He += 1, `project-context-${Date.now()}-${He}`), We = (e) => {
|
|
288
|
+
let t = e.type || u(e.name) || "application/octet-stream";
|
|
289
289
|
return {
|
|
290
|
-
id:
|
|
290
|
+
id: Ue(),
|
|
291
291
|
name: e.name,
|
|
292
292
|
contentType: t,
|
|
293
|
-
type:
|
|
294
|
-
status:
|
|
293
|
+
type: l(t),
|
|
294
|
+
status: s.Idle,
|
|
295
295
|
file: e
|
|
296
296
|
};
|
|
297
|
-
},
|
|
298
|
-
let r = new Set(t.map((e) => e.name)), i =
|
|
297
|
+
}, Ge = (e, t, n, r) => Le(e.name) != null || e.name.trim() !== e.name ? Q.InvalidName : r.allowedExtensions.includes(Re(e.name)) ? t.has(e.name) ? Q.Duplicate : e.size > r.maxFileBytes ? Q.TooLarge : n + e.size > r.maxTotalBytes ? Q.CapacityExceeded : null : Q.UnsupportedType, Ke = (e, t, n) => {
|
|
298
|
+
let r = new Set(t.map((e) => e.name)), i = Ve(t), a = [], o = [];
|
|
299
299
|
for (let t of e) {
|
|
300
|
-
let e =
|
|
301
|
-
e == null ? (r.add(t.name), i += t.size, a.push(
|
|
300
|
+
let e = Ge(t, r, i, n);
|
|
301
|
+
e == null ? (r.add(t.name), i += t.size, a.push(We(t))) : o.push({
|
|
302
302
|
name: t.name,
|
|
303
303
|
reason: e
|
|
304
304
|
});
|
|
@@ -307,283 +307,283 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
307
307
|
accepted: a,
|
|
308
308
|
rejected: o
|
|
309
309
|
};
|
|
310
|
-
},
|
|
310
|
+
}, qe = (e, t) => e <= 0 ? 0 : t <= 0 ? 100 : Math.min(100, Math.max(1, Math.round(e / t * 100))), Je = (e, t) => {
|
|
311
311
|
let n = t.trim().toLowerCase();
|
|
312
312
|
return n === "" ? e : e.filter((e) => e.name.toLowerCase().includes(n));
|
|
313
|
-
},
|
|
313
|
+
}, Ye = {
|
|
314
314
|
track: "_track_1eyt2_1",
|
|
315
315
|
text: "_text_1eyt2_11"
|
|
316
|
-
},
|
|
316
|
+
}, Xe = ({ usedBytes: e, maxBytes: t, ariaLabel: n, formatLabel: r, textClassName: i = "dial-tiny-text" }) => {
|
|
317
317
|
if (e <= 0) return null;
|
|
318
|
-
let a = r(
|
|
319
|
-
return /* @__PURE__ */
|
|
318
|
+
let a = r(qe(e, t));
|
|
319
|
+
return /* @__PURE__ */ q("div", {
|
|
320
320
|
className: "flex min-w-0 items-center gap-2",
|
|
321
|
-
children: [/* @__PURE__ */
|
|
322
|
-
role:
|
|
321
|
+
children: [/* @__PURE__ */ K(F, {
|
|
322
|
+
role: I.Meter,
|
|
323
323
|
value: e,
|
|
324
324
|
max: t,
|
|
325
|
-
size:
|
|
325
|
+
size: S.Small,
|
|
326
326
|
"aria-label": n,
|
|
327
327
|
"aria-valuetext": a,
|
|
328
|
-
className:
|
|
329
|
-
}), /* @__PURE__ */
|
|
328
|
+
className: d("w-[60px] shrink-0", Ye.track)
|
|
329
|
+
}), /* @__PURE__ */ K("span", {
|
|
330
330
|
"aria-hidden": !0,
|
|
331
|
-
className:
|
|
331
|
+
className: d("whitespace-nowrap", i, Ye.text),
|
|
332
332
|
children: a
|
|
333
333
|
})]
|
|
334
334
|
});
|
|
335
|
-
},
|
|
335
|
+
}, Ze = {
|
|
336
336
|
formColumn: "_formColumn_1fxsc_1",
|
|
337
337
|
helper: "_helper_1fxsc_10",
|
|
338
338
|
label: "_label_1fxsc_14"
|
|
339
|
-
},
|
|
340
|
-
let
|
|
341
|
-
if (
|
|
342
|
-
|
|
339
|
+
}, Qe = de(async () => ({ default: (await _e()).MarkdownEditor })), $e = "device", et = "file-manager", tt = ({ values: e, errors: t, onFieldChange: i, contextFiles: a, onContextFilesChange: o, allowedExtensions: s, maxFileBytes: l, maxTotalBytes: u, onPickFromFileManager: m, onRefineDescription: h, onRefineInstructions: v, onBack: x, onCancel: C, onSubmit: E, isSubmitting: D = !1, labels: O, markdownEditorTheme: k, className: N, styles: re }) => {
|
|
340
|
+
let P = H(), ie = H(), F = H(), I = H(), L = H(), oe = W(null), se = W(null), ce = f(), [le, de] = G(!1), [B, pe] = G([]), [_e, ve] = G(""), J = W(void 0), ye = V((e) => e ? async (t, n) => {
|
|
341
|
+
if (J.current && !J.current.aborted) throw new DOMException("Busy", "AbortError");
|
|
342
|
+
J.current = n;
|
|
343
343
|
try {
|
|
344
344
|
return await e(t, n);
|
|
345
345
|
} finally {
|
|
346
|
-
|
|
346
|
+
J.current === n && (J.current = void 0);
|
|
347
347
|
}
|
|
348
|
-
} : void 0, []),
|
|
349
|
-
value:
|
|
348
|
+
} : void 0, []), be = U(() => ye(h), [ye, h]), xe = U(() => ye(v), [ye, v]), Y = p({
|
|
349
|
+
value: e.description,
|
|
350
350
|
onChange: (e) => i("description", e),
|
|
351
|
-
onRefine:
|
|
352
|
-
disabled:
|
|
353
|
-
}),
|
|
354
|
-
value:
|
|
351
|
+
onRefine: be,
|
|
352
|
+
disabled: D
|
|
353
|
+
}), Se = p({
|
|
354
|
+
value: e.instructions,
|
|
355
355
|
onChange: (e) => i("instructions", e),
|
|
356
|
-
onRefine:
|
|
357
|
-
disabled:
|
|
358
|
-
}),
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}, [
|
|
362
|
-
let
|
|
356
|
+
onRefine: xe,
|
|
357
|
+
disabled: D
|
|
358
|
+
}), Ce = Y.isPending || Se.isPending, X = Le(e.name), we = t.name ?? (le && X != null ? O.nameErrors[X] : void 0), Te = X != null || D || Ce;
|
|
359
|
+
fe(() => {
|
|
360
|
+
t.name && oe.current?.focus();
|
|
361
|
+
}, [t.name]);
|
|
362
|
+
let Ee = U(() => Ve(a), [a]), Z = U(() => s.map((e) => `.${e}`).join(","), [s]), De = (e) => {
|
|
363
363
|
if (e.length === 0) return;
|
|
364
|
-
let { accepted: t, rejected: n } =
|
|
365
|
-
allowedExtensions:
|
|
366
|
-
maxFileBytes:
|
|
367
|
-
maxTotalBytes:
|
|
364
|
+
let { accepted: t, rejected: n } = Ke(e, a, {
|
|
365
|
+
allowedExtensions: s,
|
|
366
|
+
maxFileBytes: l,
|
|
367
|
+
maxTotalBytes: u
|
|
368
368
|
});
|
|
369
|
-
|
|
370
|
-
}, { isDragActive:
|
|
369
|
+
pe(n), t.length > 0 && o([...a, ...t]), ve([t.length > 0 ? O.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => O.fileRejections[t](e))].filter(Boolean).join(" "));
|
|
370
|
+
}, { isDragActive: Oe, handlers: ke } = Ae(De), Q = (e) => {
|
|
371
371
|
let t = a.find((t) => t.id === e);
|
|
372
|
-
|
|
373
|
-
},
|
|
374
|
-
|
|
375
|
-
},
|
|
376
|
-
if (
|
|
377
|
-
let e = await
|
|
378
|
-
e &&
|
|
372
|
+
o(a.filter((t) => t.id !== e)), pe([]), t && ve(O.fileRemovedStatus(t.name));
|
|
373
|
+
}, je = (e) => {
|
|
374
|
+
De(Array.from(e.target.files ?? [])), e.target.value = "";
|
|
375
|
+
}, Me = async () => {
|
|
376
|
+
if (m) try {
|
|
377
|
+
let e = await m();
|
|
378
|
+
e && De(e);
|
|
379
379
|
} catch {}
|
|
380
|
-
},
|
|
381
|
-
key:
|
|
382
|
-
label:
|
|
383
|
-
onClick: () =>
|
|
384
|
-
}, ...
|
|
385
|
-
key:
|
|
386
|
-
label:
|
|
387
|
-
onClick: () => void
|
|
388
|
-
}] : []],
|
|
389
|
-
!
|
|
390
|
-
}, { colors:
|
|
391
|
-
"--pcf-helper-text":
|
|
392
|
-
"--pcf-label-text":
|
|
393
|
-
"--pcf-meter-track":
|
|
394
|
-
"--pcf-meter-fill":
|
|
395
|
-
}),
|
|
396
|
-
return /* @__PURE__ */
|
|
397
|
-
className:
|
|
398
|
-
...
|
|
380
|
+
}, Ne = [{
|
|
381
|
+
key: $e,
|
|
382
|
+
label: O.addFromDeviceLabel,
|
|
383
|
+
onClick: () => se.current?.click()
|
|
384
|
+
}, ...m ? [{
|
|
385
|
+
key: et,
|
|
386
|
+
label: O.addFromFileManagerLabel,
|
|
387
|
+
onClick: () => void Me()
|
|
388
|
+
}] : []], Pe = () => {
|
|
389
|
+
!Te && (!J.current || J.current.aborted) && E();
|
|
390
|
+
}, { colors: Fe, typography: Ie } = re ?? {}, Re = Ie?.titleClassName ?? "dial-h1-text", ze = d(Ie?.labelClassName ?? "dial-tiny-semi-text", Ze.label), Be = Ie?.helperClassName ?? "dial-tiny-text", He = ee({
|
|
391
|
+
"--pcf-helper-text": Fe?.helperText,
|
|
392
|
+
"--pcf-label-text": Fe?.labelText,
|
|
393
|
+
"--pcf-meter-track": Fe?.meterTrack,
|
|
394
|
+
"--pcf-meter-fill": Fe?.meterFill
|
|
395
|
+
}), Ue = O.refinement, We = t.context, Ge = !!We;
|
|
396
|
+
return /* @__PURE__ */ q("div", {
|
|
397
|
+
className: d("relative flex h-full min-h-0 w-full", N),
|
|
398
|
+
...ke,
|
|
399
399
|
children: [
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
-
isVisible:
|
|
400
|
+
/* @__PURE__ */ K(he, {
|
|
401
|
+
isVisible: Oe,
|
|
402
402
|
labels: {
|
|
403
|
-
title:
|
|
404
|
-
subtitle:
|
|
403
|
+
title: O.dropOverlayTitle,
|
|
404
|
+
subtitle: O.dropOverlaySubtitle
|
|
405
405
|
}
|
|
406
406
|
}),
|
|
407
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ K(ge, {
|
|
408
408
|
labels: {
|
|
409
|
-
title:
|
|
410
|
-
backButtonLabel:
|
|
411
|
-
cancelButtonLabel:
|
|
412
|
-
submitButtonLabel:
|
|
413
|
-
submittingLabel:
|
|
409
|
+
title: O.title,
|
|
410
|
+
backButtonLabel: O.backLabel,
|
|
411
|
+
cancelButtonLabel: O.cancelLabel,
|
|
412
|
+
submitButtonLabel: O.createLabel,
|
|
413
|
+
submittingLabel: O.submittingLabel ?? O.createLabel
|
|
414
414
|
},
|
|
415
415
|
onBack: x,
|
|
416
|
-
onCancel:
|
|
417
|
-
onSubmit:
|
|
418
|
-
isCancelDisabled:
|
|
419
|
-
isSubmitDisabled:
|
|
420
|
-
isSubmitting:
|
|
421
|
-
backIcon: /* @__PURE__ */
|
|
422
|
-
size:
|
|
423
|
-
stroke:
|
|
416
|
+
onCancel: C,
|
|
417
|
+
onSubmit: Pe,
|
|
418
|
+
isCancelDisabled: D,
|
|
419
|
+
isSubmitDisabled: Te,
|
|
420
|
+
isSubmitting: D,
|
|
421
|
+
backIcon: /* @__PURE__ */ K(z, {
|
|
422
|
+
size: y.LG,
|
|
423
|
+
stroke: b,
|
|
424
424
|
"aria-hidden": !0,
|
|
425
425
|
className: "rtl:scale-x-[-1]"
|
|
426
426
|
}),
|
|
427
427
|
styles: {
|
|
428
|
-
colors: { background:
|
|
428
|
+
colors: { background: Fe?.background },
|
|
429
429
|
header: {
|
|
430
|
-
colors: { borderColor:
|
|
431
|
-
typography: { fontClassName:
|
|
430
|
+
colors: { borderColor: Fe?.headerBorder },
|
|
431
|
+
typography: { fontClassName: Re }
|
|
432
432
|
},
|
|
433
|
-
cssVars:
|
|
433
|
+
cssVars: He
|
|
434
434
|
},
|
|
435
|
-
children: /* @__PURE__ */
|
|
436
|
-
className:
|
|
435
|
+
children: /* @__PURE__ */ q("div", {
|
|
436
|
+
className: d("mx-auto flex w-full max-w-[1040px] min-w-0 flex-col gap-5 py-6", Ze.formColumn),
|
|
437
437
|
children: [
|
|
438
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ q("div", {
|
|
439
439
|
className: "flex flex-col gap-1",
|
|
440
440
|
children: [
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
-
id:
|
|
443
|
-
inputRef:
|
|
444
|
-
value:
|
|
441
|
+
/* @__PURE__ */ K(te, {
|
|
442
|
+
id: P,
|
|
443
|
+
inputRef: oe,
|
|
444
|
+
value: e.name,
|
|
445
445
|
onChange: (e) => i("name", e ?? ""),
|
|
446
|
-
onBlur: () =>
|
|
447
|
-
placeholder:
|
|
446
|
+
onBlur: () => de(!0),
|
|
447
|
+
placeholder: O.namePlaceholder,
|
|
448
448
|
labelProps: {
|
|
449
|
-
label:
|
|
449
|
+
label: O.nameLabel,
|
|
450
450
|
required: !0
|
|
451
451
|
},
|
|
452
452
|
required: !0,
|
|
453
453
|
"aria-required": !0,
|
|
454
|
-
invalid: !!
|
|
455
|
-
"aria-invalid": !!
|
|
456
|
-
"aria-describedby":
|
|
454
|
+
invalid: !!we,
|
|
455
|
+
"aria-invalid": !!we,
|
|
456
|
+
"aria-describedby": we ? ie : void 0
|
|
457
457
|
}),
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
announce:
|
|
460
|
-
id:
|
|
461
|
-
className:
|
|
462
|
-
text:
|
|
458
|
+
/* @__PURE__ */ K(w, {
|
|
459
|
+
announce: M.Assertive,
|
|
460
|
+
id: ie,
|
|
461
|
+
className: Be,
|
|
462
|
+
text: t.name ?? ""
|
|
463
463
|
}),
|
|
464
|
-
|
|
465
|
-
id:
|
|
466
|
-
className:
|
|
467
|
-
text:
|
|
464
|
+
we && !t.name && /* @__PURE__ */ K(w, {
|
|
465
|
+
id: ie,
|
|
466
|
+
className: Be,
|
|
467
|
+
text: we
|
|
468
468
|
})
|
|
469
469
|
]
|
|
470
470
|
}),
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
-
isEnabled: !!
|
|
473
|
-
fieldId:
|
|
474
|
-
label:
|
|
475
|
-
labelClassName:
|
|
476
|
-
labels:
|
|
477
|
-
refinement:
|
|
478
|
-
disabled:
|
|
479
|
-
children: /* @__PURE__ */
|
|
480
|
-
id:
|
|
481
|
-
value:
|
|
471
|
+
/* @__PURE__ */ K(c, {
|
|
472
|
+
isEnabled: !!h,
|
|
473
|
+
fieldId: F,
|
|
474
|
+
label: O.descriptionLabel,
|
|
475
|
+
labelClassName: ze,
|
|
476
|
+
labels: Ue,
|
|
477
|
+
refinement: Y,
|
|
478
|
+
disabled: D || Ce,
|
|
479
|
+
children: /* @__PURE__ */ K(R, {
|
|
480
|
+
id: F,
|
|
481
|
+
value: e.description,
|
|
482
482
|
onChange: (e) => {
|
|
483
|
-
|
|
483
|
+
Y.reset(), i("description", e);
|
|
484
484
|
},
|
|
485
|
-
placeholder:
|
|
486
|
-
labelProps:
|
|
485
|
+
placeholder: O.descriptionPlaceholder,
|
|
486
|
+
labelProps: h ? void 0 : { label: O.descriptionLabel }
|
|
487
487
|
})
|
|
488
488
|
}),
|
|
489
|
-
/* @__PURE__ */
|
|
490
|
-
isEnabled: !!
|
|
491
|
-
fieldId:
|
|
492
|
-
label:
|
|
493
|
-
labelClassName:
|
|
494
|
-
labels:
|
|
495
|
-
refinement:
|
|
496
|
-
disabled:
|
|
497
|
-
children: /* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ K(c, {
|
|
490
|
+
isEnabled: !!v,
|
|
491
|
+
fieldId: I,
|
|
492
|
+
label: O.instructionsLabel,
|
|
493
|
+
labelClassName: ze,
|
|
494
|
+
labels: Ue,
|
|
495
|
+
refinement: Se,
|
|
496
|
+
disabled: D || Ce,
|
|
497
|
+
children: /* @__PURE__ */ q("div", {
|
|
498
498
|
className: "flex flex-1 flex-col gap-2",
|
|
499
|
-
children: [!
|
|
500
|
-
htmlFor:
|
|
501
|
-
className:
|
|
502
|
-
label:
|
|
503
|
-
}), /* @__PURE__ */
|
|
504
|
-
ref:
|
|
505
|
-
className:
|
|
506
|
-
children: /* @__PURE__ */
|
|
507
|
-
fallback: /* @__PURE__ */
|
|
508
|
-
children: /* @__PURE__ */
|
|
509
|
-
id:
|
|
510
|
-
value:
|
|
499
|
+
children: [!v && /* @__PURE__ */ K(A, {
|
|
500
|
+
htmlFor: I,
|
|
501
|
+
className: ze,
|
|
502
|
+
label: O.instructionsLabel
|
|
503
|
+
}), /* @__PURE__ */ K("div", {
|
|
504
|
+
ref: ce,
|
|
505
|
+
className: d("w-full", n, r),
|
|
506
|
+
children: /* @__PURE__ */ K(ue, {
|
|
507
|
+
fallback: /* @__PURE__ */ K(ae, {}),
|
|
508
|
+
children: /* @__PURE__ */ K(Qe, {
|
|
509
|
+
id: I,
|
|
510
|
+
value: e.instructions,
|
|
511
511
|
onChange: (e) => {
|
|
512
|
-
|
|
512
|
+
Se.reset(), i("instructions", e);
|
|
513
513
|
},
|
|
514
514
|
height: 176,
|
|
515
|
-
theme:
|
|
516
|
-
placeholder:
|
|
515
|
+
theme: k,
|
|
516
|
+
placeholder: O.instructionsPlaceholder
|
|
517
517
|
})
|
|
518
518
|
})
|
|
519
519
|
})]
|
|
520
520
|
})
|
|
521
521
|
}),
|
|
522
|
-
/* @__PURE__ */
|
|
523
|
-
"aria-labelledby":
|
|
522
|
+
/* @__PURE__ */ q("section", {
|
|
523
|
+
"aria-labelledby": L,
|
|
524
524
|
className: "flex flex-col gap-2",
|
|
525
525
|
children: [
|
|
526
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ q("div", {
|
|
527
527
|
className: "flex min-w-0 flex-wrap items-center justify-between gap-2",
|
|
528
|
-
children: [/* @__PURE__ */
|
|
529
|
-
id:
|
|
530
|
-
className:
|
|
531
|
-
children:
|
|
532
|
-
}), /* @__PURE__ */
|
|
528
|
+
children: [/* @__PURE__ */ K("h2", {
|
|
529
|
+
id: L,
|
|
530
|
+
className: ze,
|
|
531
|
+
children: O.contextLabel
|
|
532
|
+
}), /* @__PURE__ */ q("div", {
|
|
533
533
|
className: "flex min-w-0 items-center gap-4",
|
|
534
|
-
children: [/* @__PURE__ */
|
|
535
|
-
usedBytes:
|
|
536
|
-
maxBytes:
|
|
537
|
-
ariaLabel:
|
|
538
|
-
formatLabel:
|
|
539
|
-
textClassName:
|
|
540
|
-
}), /* @__PURE__ */
|
|
541
|
-
items:
|
|
542
|
-
label:
|
|
543
|
-
variant:
|
|
544
|
-
size:
|
|
545
|
-
disabled:
|
|
534
|
+
children: [/* @__PURE__ */ K(Xe, {
|
|
535
|
+
usedBytes: Ee,
|
|
536
|
+
maxBytes: u,
|
|
537
|
+
ariaLabel: O.capacityMeterLabel,
|
|
538
|
+
formatLabel: O.capacityLabel,
|
|
539
|
+
textClassName: Be
|
|
540
|
+
}), /* @__PURE__ */ K(g, {
|
|
541
|
+
items: Ne,
|
|
542
|
+
label: O.addLabel,
|
|
543
|
+
variant: _.Neutral,
|
|
544
|
+
size: S.Small,
|
|
545
|
+
disabled: D
|
|
546
546
|
})]
|
|
547
547
|
})]
|
|
548
548
|
}),
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
-
ref:
|
|
549
|
+
/* @__PURE__ */ K("input", {
|
|
550
|
+
ref: se,
|
|
551
551
|
type: "file",
|
|
552
552
|
multiple: !0,
|
|
553
|
-
accept:
|
|
553
|
+
accept: Z,
|
|
554
554
|
tabIndex: -1,
|
|
555
555
|
"aria-hidden": !0,
|
|
556
556
|
className: "sr-only",
|
|
557
|
-
onChange:
|
|
557
|
+
onChange: je
|
|
558
558
|
}),
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
-
label:
|
|
561
|
-
description:
|
|
562
|
-
accept:
|
|
559
|
+
/* @__PURE__ */ K(T, {
|
|
560
|
+
label: O.dropZoneLabel,
|
|
561
|
+
description: O.dropZoneHint,
|
|
562
|
+
accept: Z,
|
|
563
563
|
multiple: !0,
|
|
564
|
-
disabled:
|
|
565
|
-
onChange:
|
|
566
|
-
onReject:
|
|
564
|
+
disabled: D,
|
|
565
|
+
onChange: De,
|
|
566
|
+
onReject: De
|
|
567
567
|
}),
|
|
568
|
-
|
|
569
|
-
className:
|
|
570
|
-
children:
|
|
568
|
+
B.length > 0 && /* @__PURE__ */ K("ul", {
|
|
569
|
+
className: d("flex flex-col gap-1", Be, Ze.helper),
|
|
570
|
+
children: B.map(({ name: e, reason: t }) => /* @__PURE__ */ K("li", { children: O.fileRejections[t](e) }, `${t}:${e}`))
|
|
571
571
|
}),
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
politeness:
|
|
574
|
-
children:
|
|
575
|
-
className:
|
|
576
|
-
children:
|
|
572
|
+
/* @__PURE__ */ K(j, {
|
|
573
|
+
politeness: M.Assertive,
|
|
574
|
+
children: Ge && /* @__PURE__ */ K("p", {
|
|
575
|
+
className: d(Be, Ze.helper),
|
|
576
|
+
children: We
|
|
577
577
|
})
|
|
578
578
|
}),
|
|
579
|
-
a.length > 0 && /* @__PURE__ */
|
|
579
|
+
a.length > 0 && /* @__PURE__ */ K("ul", {
|
|
580
580
|
className: "flex min-w-0 flex-wrap gap-2 pt-1",
|
|
581
|
-
children: a.map((e) => /* @__PURE__ */
|
|
581
|
+
children: a.map((e) => /* @__PURE__ */ K("li", {
|
|
582
582
|
className: "min-w-0",
|
|
583
|
-
children: /* @__PURE__ */
|
|
583
|
+
children: /* @__PURE__ */ K(me, {
|
|
584
584
|
attachment: e,
|
|
585
|
-
onRemove:
|
|
586
|
-
labels: { removeLabel:
|
|
585
|
+
onRemove: Q,
|
|
586
|
+
labels: { removeLabel: O.removeFileLabel(e.name) }
|
|
587
587
|
})
|
|
588
588
|
}, e.id))
|
|
589
589
|
})
|
|
@@ -592,10 +592,10 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
592
592
|
]
|
|
593
593
|
})
|
|
594
594
|
}),
|
|
595
|
-
/* @__PURE__ */
|
|
595
|
+
/* @__PURE__ */ K(j, {
|
|
596
596
|
visuallyHidden: !0,
|
|
597
|
-
as:
|
|
598
|
-
children:
|
|
597
|
+
as: ne.Span,
|
|
598
|
+
children: D ? O.creatingStatus : _e
|
|
599
599
|
})
|
|
600
600
|
]
|
|
601
601
|
});
|
|
@@ -606,21 +606,21 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
606
606
|
body: "_body_16lvl_13",
|
|
607
607
|
secondary: "_secondary_16lvl_17",
|
|
608
608
|
panel: "_panel_16lvl_21"
|
|
609
|
-
},
|
|
609
|
+
}, nt = (e) => ({
|
|
610
610
|
id: e.name,
|
|
611
611
|
name: e.name,
|
|
612
612
|
contentType: e.contentType,
|
|
613
|
-
type:
|
|
614
|
-
status:
|
|
615
|
-
}),
|
|
616
|
-
let { colors:
|
|
617
|
-
"--pv-bg":
|
|
618
|
-
"--pv-border":
|
|
619
|
-
"--pv-heading-text":
|
|
620
|
-
"--pv-body-text":
|
|
621
|
-
"--pv-secondary-text":
|
|
622
|
-
}),
|
|
623
|
-
let e =
|
|
613
|
+
type: l(e.contentType),
|
|
614
|
+
status: s.Idle
|
|
615
|
+
}), rt = B(({ project: e, isLoading: t = !1, hasError: n = !1, isNotFound: r = !1, isPinned: a, isPinPending: s = !1, contextSearchQuery: c, onContextSearchQueryChange: l, onBack: u, onTogglePin: f, onPublish: p, onEdit: h, onShare: g, onDelete: v, onDownload: S, onOpenFile: w, onRetry: T, onBrowseProjects: E, mainContent: k, mainContentLabel: te = "Project content", labels: A, styles: M }) => {
|
|
616
|
+
let { colors: N, typography: P } = M ?? {}, ie = P?.titleClassName ?? "dial-h2-text", F = P?.panelTitleClassName ?? "dial-body-semi-text", I = P?.sectionTitleClassName ?? "dial-tiny-text", R = P?.bodyClassName ?? "dial-small-text", oe = P?.helperClassName ?? "dial-tiny-text", ue = P?.instructionsHeadingClassName ?? "dial-small-semi-text", de = ee({
|
|
617
|
+
"--pv-bg": N?.background,
|
|
618
|
+
"--pv-border": N?.border,
|
|
619
|
+
"--pv-heading-text": N?.headingText,
|
|
620
|
+
"--pv-body-text": N?.bodyText,
|
|
621
|
+
"--pv-secondary-text": N?.secondaryText
|
|
622
|
+
}), B = U(() => e?.contextFiles ?? [], [e]), V = U(() => Je(B, c), [B, c]), fe = c.trim(), W = H(), G = U(() => {
|
|
623
|
+
let e = d("mb-1 mt-3 first:mt-0", ue);
|
|
624
624
|
return {
|
|
625
625
|
h1: e,
|
|
626
626
|
h2: e,
|
|
@@ -628,199 +628,459 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
628
628
|
h4: e,
|
|
629
629
|
h5: e,
|
|
630
630
|
h6: e,
|
|
631
|
-
p:
|
|
632
|
-
ul:
|
|
633
|
-
ol:
|
|
631
|
+
p: R,
|
|
632
|
+
ul: R,
|
|
633
|
+
ol: R
|
|
634
634
|
};
|
|
635
|
-
}, [
|
|
635
|
+
}, [R, ue]), he = (e) => {
|
|
636
636
|
let t = [];
|
|
637
637
|
return e && p && t.push({
|
|
638
638
|
key: "publish",
|
|
639
|
-
label:
|
|
639
|
+
label: A.publishLabel,
|
|
640
640
|
onClick: p
|
|
641
641
|
}), e && h && t.push({
|
|
642
642
|
key: "edit",
|
|
643
|
-
label:
|
|
643
|
+
label: A.editLabel,
|
|
644
644
|
onClick: h
|
|
645
|
-
}),
|
|
645
|
+
}), g && t.push({
|
|
646
646
|
key: "share",
|
|
647
|
-
label:
|
|
648
|
-
onClick:
|
|
647
|
+
label: A.shareLabel,
|
|
648
|
+
onClick: g
|
|
649
649
|
}), t.push({
|
|
650
650
|
key: "download",
|
|
651
|
-
label:
|
|
652
|
-
onClick:
|
|
653
|
-
}),
|
|
651
|
+
label: A.downloadLabel,
|
|
652
|
+
onClick: S
|
|
653
|
+
}), v && t.push({
|
|
654
654
|
key: "delete",
|
|
655
|
-
label:
|
|
655
|
+
label: A.deleteLabel,
|
|
656
656
|
danger: !0,
|
|
657
|
-
onClick:
|
|
657
|
+
onClick: v
|
|
658
658
|
}), t;
|
|
659
|
-
},
|
|
659
|
+
}, ge = (e, t) => /* @__PURE__ */ K("div", {
|
|
660
660
|
className: t,
|
|
661
|
-
children: /* @__PURE__ */
|
|
662
|
-
items:
|
|
661
|
+
children: /* @__PURE__ */ K(x, {
|
|
662
|
+
items: he(e),
|
|
663
663
|
matchReferenceWidth: !1,
|
|
664
664
|
listClassName: "w-[200px]",
|
|
665
|
-
children: /* @__PURE__ */
|
|
666
|
-
icon: /* @__PURE__ */
|
|
667
|
-
size:
|
|
665
|
+
children: /* @__PURE__ */ K(O, {
|
|
666
|
+
icon: /* @__PURE__ */ K(se, {
|
|
667
|
+
size: y.MD,
|
|
668
668
|
"aria-hidden": !0,
|
|
669
|
-
stroke:
|
|
669
|
+
stroke: b
|
|
670
670
|
}),
|
|
671
|
-
"aria-label":
|
|
671
|
+
"aria-label": A.moreActionsLabel
|
|
672
672
|
})
|
|
673
673
|
})
|
|
674
674
|
});
|
|
675
|
-
return t ||
|
|
676
|
-
style:
|
|
677
|
-
className:
|
|
678
|
-
children: t ? /* @__PURE__ */
|
|
675
|
+
return t || n || r || e == null ? /* @__PURE__ */ K("div", {
|
|
676
|
+
style: de,
|
|
677
|
+
className: d("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
|
|
678
|
+
children: t ? /* @__PURE__ */ K(ae, {}) : n ? /* @__PURE__ */ q("div", {
|
|
679
679
|
className: "flex flex-col items-center gap-3",
|
|
680
|
-
children: [/* @__PURE__ */
|
|
680
|
+
children: [/* @__PURE__ */ K("p", {
|
|
681
681
|
role: "status",
|
|
682
|
-
className:
|
|
683
|
-
children:
|
|
684
|
-
}), /* @__PURE__ */
|
|
685
|
-
label:
|
|
686
|
-
onClick:
|
|
682
|
+
className: d(R, $.body),
|
|
683
|
+
children: A.errorLabel
|
|
684
|
+
}), /* @__PURE__ */ K(D, {
|
|
685
|
+
label: A.retryLabel,
|
|
686
|
+
onClick: T
|
|
687
687
|
})]
|
|
688
|
-
}) : /* @__PURE__ */
|
|
688
|
+
}) : /* @__PURE__ */ q("div", {
|
|
689
689
|
className: "flex flex-col items-center gap-3",
|
|
690
|
-
children: [/* @__PURE__ */
|
|
691
|
-
className:
|
|
692
|
-
children:
|
|
693
|
-
}), /* @__PURE__ */
|
|
694
|
-
label:
|
|
695
|
-
onClick:
|
|
690
|
+
children: [/* @__PURE__ */ K("p", {
|
|
691
|
+
className: d(R, $.body),
|
|
692
|
+
children: A.notFoundLabel
|
|
693
|
+
}), /* @__PURE__ */ K(D, {
|
|
694
|
+
label: A.browseProjectsLabel,
|
|
695
|
+
onClick: E
|
|
696
696
|
})]
|
|
697
697
|
})
|
|
698
|
-
}) : /* @__PURE__ */
|
|
699
|
-
style:
|
|
700
|
-
className:
|
|
701
|
-
children: [/* @__PURE__ */
|
|
702
|
-
className:
|
|
698
|
+
}) : /* @__PURE__ */ q("div", {
|
|
699
|
+
style: de,
|
|
700
|
+
className: d("flex h-full w-full min-w-0 flex-col overflow-y-auto", $.container),
|
|
701
|
+
children: [/* @__PURE__ */ q("header", {
|
|
702
|
+
className: d("flex min-w-0 items-center gap-2 px-4 py-3 desktop:px-8", $.header),
|
|
703
703
|
children: [
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
icon: /* @__PURE__ */
|
|
706
|
-
size:
|
|
704
|
+
/* @__PURE__ */ K(O, {
|
|
705
|
+
icon: /* @__PURE__ */ K(z, {
|
|
706
|
+
size: y.LG,
|
|
707
707
|
className: "rtl:scale-x-[-1]",
|
|
708
708
|
"aria-hidden": !0,
|
|
709
|
-
stroke:
|
|
709
|
+
stroke: b
|
|
710
710
|
}),
|
|
711
|
-
"aria-label":
|
|
712
|
-
onClick:
|
|
711
|
+
"aria-label": A.backLabel,
|
|
712
|
+
onClick: u
|
|
713
713
|
}),
|
|
714
|
-
/* @__PURE__ */
|
|
715
|
-
className:
|
|
716
|
-
children: /* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ K("h1", {
|
|
715
|
+
className: d("min-w-0 flex-1", ie, $.title),
|
|
716
|
+
children: /* @__PURE__ */ K(C, { text: e.name })
|
|
717
717
|
}),
|
|
718
|
-
/* @__PURE__ */
|
|
719
|
-
icon:
|
|
720
|
-
size:
|
|
718
|
+
/* @__PURE__ */ K(O, {
|
|
719
|
+
icon: a ? /* @__PURE__ */ K(le, {
|
|
720
|
+
size: y.MD,
|
|
721
721
|
"aria-hidden": !0
|
|
722
|
-
}) : /* @__PURE__ */
|
|
723
|
-
size:
|
|
722
|
+
}) : /* @__PURE__ */ K(ce, {
|
|
723
|
+
size: y.MD,
|
|
724
724
|
"aria-hidden": !0,
|
|
725
|
-
stroke:
|
|
725
|
+
stroke: b
|
|
726
726
|
}),
|
|
727
|
-
"aria-label":
|
|
728
|
-
"aria-pressed":
|
|
727
|
+
"aria-label": A.pinLabel,
|
|
728
|
+
"aria-pressed": a,
|
|
729
729
|
"aria-disabled": s || void 0,
|
|
730
730
|
onClick: () => {
|
|
731
731
|
s || f();
|
|
732
732
|
}
|
|
733
733
|
}),
|
|
734
|
-
p && /* @__PURE__ */
|
|
735
|
-
label:
|
|
734
|
+
p && /* @__PURE__ */ K(re, {
|
|
735
|
+
label: A.publishLabel,
|
|
736
736
|
onClick: p,
|
|
737
737
|
className: "hidden shrink-0 desktop:inline-flex"
|
|
738
738
|
}),
|
|
739
|
-
h && /* @__PURE__ */
|
|
740
|
-
label:
|
|
741
|
-
variant:
|
|
739
|
+
h && /* @__PURE__ */ K(m, {
|
|
740
|
+
label: A.editLabel,
|
|
741
|
+
variant: _.Primary,
|
|
742
742
|
onClick: h,
|
|
743
743
|
className: "hidden shrink-0 desktop:inline-flex"
|
|
744
744
|
}),
|
|
745
|
-
|
|
746
|
-
|
|
745
|
+
ge(!1, "hidden desktop:block"),
|
|
746
|
+
ge(!0, "desktop:hidden")
|
|
747
747
|
]
|
|
748
|
-
}), /* @__PURE__ */
|
|
749
|
-
className: "flex min-w-0 flex-1 flex-col desktop:flex-row desktop:justify-end",
|
|
750
|
-
children: /* @__PURE__ */
|
|
751
|
-
"aria-
|
|
752
|
-
className:
|
|
748
|
+
}), /* @__PURE__ */ q("div", {
|
|
749
|
+
className: d("flex min-w-0 flex-1 flex-col desktop:flex-row", k == null && "desktop:justify-end"),
|
|
750
|
+
children: [k != null && /* @__PURE__ */ K("section", {
|
|
751
|
+
"aria-label": te,
|
|
752
|
+
className: "flex min-w-0 flex-1 flex-col gap-6 px-4 py-6 desktop:px-8",
|
|
753
|
+
children: k
|
|
754
|
+
}), /* @__PURE__ */ q("aside", {
|
|
755
|
+
"aria-labelledby": W,
|
|
756
|
+
className: d("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:w-[488px] desktop:shrink-0 desktop:border-s desktop:border-t-0 desktop:px-8", $.panel),
|
|
753
757
|
children: [
|
|
754
|
-
/* @__PURE__ */
|
|
755
|
-
id:
|
|
756
|
-
className:
|
|
757
|
-
children:
|
|
758
|
+
/* @__PURE__ */ K("h2", {
|
|
759
|
+
id: W,
|
|
760
|
+
className: d(F, $.title),
|
|
761
|
+
children: A.detailsLabel
|
|
758
762
|
}),
|
|
759
|
-
e.description !== "" && /* @__PURE__ */
|
|
763
|
+
e.description !== "" && /* @__PURE__ */ q("section", {
|
|
760
764
|
className: "flex min-w-0 flex-col gap-1",
|
|
761
|
-
children: [/* @__PURE__ */
|
|
762
|
-
className:
|
|
763
|
-
children:
|
|
764
|
-
}), /* @__PURE__ */
|
|
765
|
-
className:
|
|
765
|
+
children: [/* @__PURE__ */ K("h3", {
|
|
766
|
+
className: d(I, $.secondary),
|
|
767
|
+
children: A.descriptionLabel
|
|
768
|
+
}), /* @__PURE__ */ K("p", {
|
|
769
|
+
className: d("break-words whitespace-pre-line", R, $.body),
|
|
766
770
|
children: e.description
|
|
767
771
|
})]
|
|
768
772
|
}),
|
|
769
|
-
e.instructions !== "" && /* @__PURE__ */
|
|
773
|
+
e.instructions !== "" && /* @__PURE__ */ q("section", {
|
|
770
774
|
className: "flex min-w-0 flex-col gap-1",
|
|
771
|
-
children: [/* @__PURE__ */
|
|
772
|
-
className:
|
|
773
|
-
children:
|
|
774
|
-
}), /* @__PURE__ */
|
|
775
|
-
className:
|
|
776
|
-
children: /* @__PURE__ */
|
|
775
|
+
children: [/* @__PURE__ */ K("h3", {
|
|
776
|
+
className: d(I, $.secondary),
|
|
777
|
+
children: A.instructionsLabel
|
|
778
|
+
}), /* @__PURE__ */ K("div", {
|
|
779
|
+
className: d("min-w-0 break-words", R, $.body),
|
|
780
|
+
children: /* @__PURE__ */ K(i, {
|
|
777
781
|
content: e.instructions,
|
|
778
|
-
classNames:
|
|
782
|
+
classNames: G
|
|
779
783
|
})
|
|
780
784
|
})]
|
|
781
785
|
}),
|
|
782
|
-
/* @__PURE__ */
|
|
786
|
+
/* @__PURE__ */ q("section", {
|
|
783
787
|
className: "flex min-w-0 flex-col gap-2",
|
|
784
|
-
children: [/* @__PURE__ */
|
|
785
|
-
className:
|
|
786
|
-
children:
|
|
787
|
-
}),
|
|
788
|
-
/* @__PURE__ */
|
|
788
|
+
children: [/* @__PURE__ */ K("h3", {
|
|
789
|
+
className: d(I, $.secondary),
|
|
790
|
+
children: A.contextLabel
|
|
791
|
+
}), B.length === 0 ? /* @__PURE__ */ K(o, { label: A.emptyContextLabel }) : /* @__PURE__ */ q(pe, { children: [
|
|
792
|
+
/* @__PURE__ */ K("div", {
|
|
789
793
|
role: "search",
|
|
790
|
-
children: /* @__PURE__ */
|
|
794
|
+
children: /* @__PURE__ */ K(L, {
|
|
791
795
|
value: c,
|
|
792
|
-
onChange: (e) =>
|
|
793
|
-
placeholder:
|
|
794
|
-
clearLabel:
|
|
795
|
-
"aria-label":
|
|
796
|
+
onChange: (e) => l(e ?? ""),
|
|
797
|
+
placeholder: A.contextSearchPlaceholder,
|
|
798
|
+
clearLabel: A.clearSearchLabel,
|
|
799
|
+
"aria-label": A.contextSearchAriaLabel
|
|
796
800
|
})
|
|
797
801
|
}),
|
|
798
|
-
|
|
799
|
-
className:
|
|
800
|
-
children:
|
|
801
|
-
}) : /* @__PURE__ */
|
|
802
|
+
V.length === 0 ? /* @__PURE__ */ K("p", {
|
|
803
|
+
className: d(oe, $.secondary),
|
|
804
|
+
children: A.noContextMatchesLabel
|
|
805
|
+
}) : /* @__PURE__ */ K("ul", {
|
|
802
806
|
className: "m-0 flex min-w-0 list-none flex-wrap gap-2 p-0 pt-2",
|
|
803
|
-
children:
|
|
807
|
+
children: V.map((e) => /* @__PURE__ */ K("li", {
|
|
804
808
|
className: "min-w-0",
|
|
805
|
-
children: /* @__PURE__ */
|
|
806
|
-
attachment:
|
|
807
|
-
searchQuery:
|
|
808
|
-
onClick:
|
|
809
|
-
labels: { clickLabel:
|
|
809
|
+
children: /* @__PURE__ */ K(me, {
|
|
810
|
+
attachment: nt(e),
|
|
811
|
+
searchQuery: fe,
|
|
812
|
+
onClick: w,
|
|
813
|
+
labels: { clickLabel: A.openFileLabel(e.name) }
|
|
810
814
|
})
|
|
811
815
|
}, e.name))
|
|
812
816
|
}),
|
|
813
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ K(j, {
|
|
814
818
|
visuallyHidden: !0,
|
|
815
|
-
as:
|
|
816
|
-
children:
|
|
819
|
+
as: ne.Span,
|
|
820
|
+
children: fe === "" ? "" : A.contextResultCountLabel(V.length)
|
|
817
821
|
})
|
|
818
822
|
] })]
|
|
819
823
|
})
|
|
820
824
|
]
|
|
825
|
+
})]
|
|
826
|
+
})]
|
|
827
|
+
});
|
|
828
|
+
}), it = 24, at = ({ item: e, labels: n, rowTitleClassName: r, onOpen: i, onRename: a, onDelete: o }) => {
|
|
829
|
+
let s = U(() => [...a ? [{
|
|
830
|
+
key: "rename",
|
|
831
|
+
label: n.renameLabel,
|
|
832
|
+
onClick: () => a(e.id)
|
|
833
|
+
}] : [], ...o ? [{
|
|
834
|
+
key: "delete",
|
|
835
|
+
label: n.deleteLabel,
|
|
836
|
+
danger: !0,
|
|
837
|
+
onClick: () => o(e.id)
|
|
838
|
+
}] : []], [
|
|
839
|
+
e.id,
|
|
840
|
+
n.deleteLabel,
|
|
841
|
+
n.renameLabel,
|
|
842
|
+
o,
|
|
843
|
+
a
|
|
844
|
+
]);
|
|
845
|
+
return /* @__PURE__ */ q("li", {
|
|
846
|
+
className: "flex min-w-0 items-center gap-1 rounded focus-within:bg-(--bg-accent-primary-alpha,rgba(92,141,234,0.15)) hover:bg-(--bg-accent-primary-alpha,rgba(92,141,234,0.15))",
|
|
847
|
+
children: [/* @__PURE__ */ q("button", {
|
|
848
|
+
type: "button",
|
|
849
|
+
"aria-label": n.openLabel(e.title, e.authorName),
|
|
850
|
+
className: "flex min-w-0 flex-1 items-center gap-3 rounded px-3 py-2 text-start focus-visible:outline-2 focus-visible:-outline-offset-2",
|
|
851
|
+
onClick: () => i(e.id),
|
|
852
|
+
children: [/* @__PURE__ */ K("span", {
|
|
853
|
+
"aria-hidden": !0,
|
|
854
|
+
className: "shrink-0",
|
|
855
|
+
children: /* @__PURE__ */ K(t, {
|
|
856
|
+
name: e.authorName ?? "",
|
|
857
|
+
size: it
|
|
858
|
+
})
|
|
859
|
+
}), /* @__PURE__ */ K(C, {
|
|
860
|
+
text: e.title,
|
|
861
|
+
className: d("min-w-0 flex-1", r)
|
|
862
|
+
})]
|
|
863
|
+
}), s.length > 0 && /* @__PURE__ */ K(x, {
|
|
864
|
+
items: s,
|
|
865
|
+
placement: "bottom-end",
|
|
866
|
+
children: /* @__PURE__ */ K(O, {
|
|
867
|
+
"aria-label": n.moreActionsLabel(e.title),
|
|
868
|
+
size: S.Small,
|
|
869
|
+
className: "me-2 shrink-0",
|
|
870
|
+
icon: /* @__PURE__ */ K(se, {
|
|
871
|
+
"aria-hidden": !0,
|
|
872
|
+
size: y.SM,
|
|
873
|
+
stroke: b
|
|
874
|
+
})
|
|
821
875
|
})
|
|
822
876
|
})]
|
|
823
877
|
});
|
|
824
|
-
})
|
|
878
|
+
}, ot = B(({ items: e, isLoading: t = !1, hasError: n = !1, onRetry: r, hasMore: i = !1, isLoadingMore: a = !1, onLoadMore: s, onOpen: c, onRename: ee, onDelete: l, labels: u, typography: f }) => {
|
|
879
|
+
let p = H(), m = f?.titleClassName ?? "dial-body-semi-text", h = f?.rowTitleClassName ?? "dial-body-text", g = f?.messageClassName ?? "dial-small-text", _ = !t && !n && e.length === 0;
|
|
880
|
+
return /* @__PURE__ */ q("section", {
|
|
881
|
+
"aria-labelledby": _ ? void 0 : p,
|
|
882
|
+
"aria-label": _ ? u.title : void 0,
|
|
883
|
+
className: "flex min-w-0 flex-col gap-2",
|
|
884
|
+
children: [!_ && /* @__PURE__ */ K("h2", {
|
|
885
|
+
id: p,
|
|
886
|
+
className: d("m-0", m),
|
|
887
|
+
children: u.title
|
|
888
|
+
}), t ? /* @__PURE__ */ q("div", {
|
|
889
|
+
role: "status",
|
|
890
|
+
className: "flex justify-center py-6",
|
|
891
|
+
children: [/* @__PURE__ */ K("span", {
|
|
892
|
+
"aria-hidden": !0,
|
|
893
|
+
children: /* @__PURE__ */ K(ae, {})
|
|
894
|
+
}), /* @__PURE__ */ K("span", {
|
|
895
|
+
className: "sr-only",
|
|
896
|
+
children: u.loadingLabel
|
|
897
|
+
})]
|
|
898
|
+
}) : n ? /* @__PURE__ */ q("div", {
|
|
899
|
+
role: "status",
|
|
900
|
+
className: "flex flex-col items-center gap-3 py-6 text-center",
|
|
901
|
+
children: [/* @__PURE__ */ K("p", {
|
|
902
|
+
className: d("m-0", g),
|
|
903
|
+
children: u.errorLabel
|
|
904
|
+
}), /* @__PURE__ */ K(D, {
|
|
905
|
+
label: u.retryLabel,
|
|
906
|
+
onClick: r
|
|
907
|
+
})]
|
|
908
|
+
}) : _ ? /* @__PURE__ */ K("div", {
|
|
909
|
+
role: "status",
|
|
910
|
+
children: /* @__PURE__ */ K(o, {
|
|
911
|
+
label: u.emptyTitle,
|
|
912
|
+
description: u.emptyDescription
|
|
913
|
+
})
|
|
914
|
+
}) : /* @__PURE__ */ q(pe, { children: [/* @__PURE__ */ K("ul", {
|
|
915
|
+
className: "m-0 flex min-w-0 list-none flex-col gap-1 p-0",
|
|
916
|
+
children: e.map((e) => /* @__PURE__ */ K(at, {
|
|
917
|
+
item: e,
|
|
918
|
+
labels: u,
|
|
919
|
+
rowTitleClassName: h,
|
|
920
|
+
onOpen: c,
|
|
921
|
+
onRename: ee,
|
|
922
|
+
onDelete: l
|
|
923
|
+
}, e.id))
|
|
924
|
+
}), i && s && /* @__PURE__ */ K(D, {
|
|
925
|
+
className: "self-center",
|
|
926
|
+
label: u.loadMoreLabel ?? "Show more",
|
|
927
|
+
disabled: a,
|
|
928
|
+
onClick: s
|
|
929
|
+
})] })]
|
|
930
|
+
});
|
|
931
|
+
}), st = B(({ composer: t, items: n, isLoading: r = !1, hasError: i = !1, onRetry: a, hasMore: o, isLoadingMore: s, onLoadMore: c, onOpen: ee, onRename: l, onDelete: u, labels: d, listTypography: f }) => {
|
|
932
|
+
let p = H(), m = W(null), [g, v] = G(null), [y, b] = G(""), [x, S] = G(), [C, w] = G(!1), [T, E] = G(null), [D, O] = G(!1), k = W(null), A = V(() => {
|
|
933
|
+
k.current = document.activeElement;
|
|
934
|
+
}, []), j = V(() => {
|
|
935
|
+
let e = k.current;
|
|
936
|
+
k.current = null, e?.isConnected && window.setTimeout(() => e.focus(), 0);
|
|
937
|
+
}, []), ne = V((e) => {
|
|
938
|
+
k.current = null, window.setTimeout(() => {
|
|
939
|
+
let t = m.current;
|
|
940
|
+
if (!t) return;
|
|
941
|
+
let n = t.querySelectorAll("li > button"), r = n[Math.min(e, n.length - 1)] ?? t.querySelector("h2, section");
|
|
942
|
+
r && !r.matches("button") && (r.tabIndex = -1), r?.focus();
|
|
943
|
+
}, 0);
|
|
944
|
+
}, []), M = V((e) => n.find((t) => t.id === e) ?? null, [n]), N = V((e) => {
|
|
945
|
+
A();
|
|
946
|
+
let t = M(e);
|
|
947
|
+
v(t), b(t?.title ?? ""), S(void 0);
|
|
948
|
+
}, [M, A]), re = V((e) => {
|
|
949
|
+
A(), E(M(e));
|
|
950
|
+
}, [M, A]), F = V(() => {
|
|
951
|
+
C || (v(null), j());
|
|
952
|
+
}, [C, j]), I = V(() => {
|
|
953
|
+
D || (E(null), j());
|
|
954
|
+
}, [D, j]), L = V(async () => {
|
|
955
|
+
if (!g || !l || C) return;
|
|
956
|
+
let e = y.trim();
|
|
957
|
+
if (!e) S(d.renameEmptyError);
|
|
958
|
+
else {
|
|
959
|
+
w(!0);
|
|
960
|
+
try {
|
|
961
|
+
await l(g.id, e), v(null), j();
|
|
962
|
+
} catch {} finally {
|
|
963
|
+
w(!1);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
}, [
|
|
967
|
+
C,
|
|
968
|
+
d.renameEmptyError,
|
|
969
|
+
l,
|
|
970
|
+
g,
|
|
971
|
+
y,
|
|
972
|
+
j
|
|
973
|
+
]), ae = V((e) => {
|
|
974
|
+
e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), L());
|
|
975
|
+
}, [L]), R = V(async () => {
|
|
976
|
+
if (!T || !u) return;
|
|
977
|
+
let e = n.findIndex((e) => e.id === T.id);
|
|
978
|
+
O(!0);
|
|
979
|
+
try {
|
|
980
|
+
await u(T.id), E(null), ne(Math.max(e, 0));
|
|
981
|
+
} catch {} finally {
|
|
982
|
+
O(!1);
|
|
983
|
+
}
|
|
984
|
+
}, [
|
|
985
|
+
T,
|
|
986
|
+
ne,
|
|
987
|
+
n,
|
|
988
|
+
u
|
|
989
|
+
]), z = U(() => [{
|
|
990
|
+
label: d.renameCancelLabel ?? "Cancel",
|
|
991
|
+
variant: _.Primary,
|
|
992
|
+
appearance: h.Ghost,
|
|
993
|
+
disabled: C,
|
|
994
|
+
onClick: F
|
|
995
|
+
}, {
|
|
996
|
+
label: d.renameSaveLabel,
|
|
997
|
+
variant: _.Primary,
|
|
998
|
+
disabled: C,
|
|
999
|
+
onClick: () => {
|
|
1000
|
+
L();
|
|
1001
|
+
}
|
|
1002
|
+
}], [
|
|
1003
|
+
F,
|
|
1004
|
+
L,
|
|
1005
|
+
C,
|
|
1006
|
+
d.renameCancelLabel,
|
|
1007
|
+
d.renameSaveLabel
|
|
1008
|
+
]);
|
|
1009
|
+
return /* @__PURE__ */ q(pe, { children: [
|
|
1010
|
+
t,
|
|
1011
|
+
/* @__PURE__ */ K("div", {
|
|
1012
|
+
ref: m,
|
|
1013
|
+
className: "contents",
|
|
1014
|
+
children: /* @__PURE__ */ K(ot, {
|
|
1015
|
+
items: n,
|
|
1016
|
+
isLoading: r,
|
|
1017
|
+
hasError: i,
|
|
1018
|
+
onRetry: a,
|
|
1019
|
+
hasMore: o,
|
|
1020
|
+
isLoadingMore: s,
|
|
1021
|
+
onLoadMore: c,
|
|
1022
|
+
onOpen: ee,
|
|
1023
|
+
onRename: l ? N : void 0,
|
|
1024
|
+
onDelete: u ? re : void 0,
|
|
1025
|
+
labels: d.list,
|
|
1026
|
+
typography: f
|
|
1027
|
+
})
|
|
1028
|
+
}),
|
|
1029
|
+
g && /* @__PURE__ */ K(P, {
|
|
1030
|
+
open: !0,
|
|
1031
|
+
header: d.renameTitle,
|
|
1032
|
+
size: ie.Sm,
|
|
1033
|
+
mainButtons: z,
|
|
1034
|
+
onClose: F,
|
|
1035
|
+
children: /* @__PURE__ */ K("div", {
|
|
1036
|
+
className: "px-6 py-4",
|
|
1037
|
+
children: /* @__PURE__ */ K(te, {
|
|
1038
|
+
id: p,
|
|
1039
|
+
value: y,
|
|
1040
|
+
labelProps: { label: d.renameInputLabel },
|
|
1041
|
+
error: x,
|
|
1042
|
+
disabled: C,
|
|
1043
|
+
onKeyDown: ae,
|
|
1044
|
+
onChange: (e) => {
|
|
1045
|
+
b(e ?? ""), S(void 0);
|
|
1046
|
+
}
|
|
1047
|
+
})
|
|
1048
|
+
})
|
|
1049
|
+
}),
|
|
1050
|
+
T && /* @__PURE__ */ K(e, {
|
|
1051
|
+
open: !0,
|
|
1052
|
+
title: d.deleteTitle(T.title),
|
|
1053
|
+
names: [T.title],
|
|
1054
|
+
message: d.deleteDescription,
|
|
1055
|
+
labels: d.deleteDialog,
|
|
1056
|
+
isLoading: D,
|
|
1057
|
+
onConfirm: () => {
|
|
1058
|
+
R();
|
|
1059
|
+
},
|
|
1060
|
+
onClose: I
|
|
1061
|
+
})
|
|
1062
|
+
] });
|
|
1063
|
+
}), ct = B(({ projectName: e, projectHref: t, onBack: n, onProjectLinkClick: r, backLabel: i, className: a, nameClassName: o = "dial-body-text" }) => /* @__PURE__ */ q("nav", {
|
|
1064
|
+
"aria-label": i,
|
|
1065
|
+
className: d("flex min-w-0 shrink-0 items-center gap-2 border-b px-4 py-2", a),
|
|
1066
|
+
children: [/* @__PURE__ */ K(O, {
|
|
1067
|
+
"aria-label": i,
|
|
1068
|
+
icon: /* @__PURE__ */ K(z, {
|
|
1069
|
+
"aria-hidden": !0,
|
|
1070
|
+
size: y.MD,
|
|
1071
|
+
stroke: b,
|
|
1072
|
+
className: "rtl:scale-x-[-1]"
|
|
1073
|
+
}),
|
|
1074
|
+
onClick: n
|
|
1075
|
+
}), /* @__PURE__ */ K("a", {
|
|
1076
|
+
href: t,
|
|
1077
|
+
onClick: r,
|
|
1078
|
+
className: "min-w-0 hover:underline focus-visible:underline",
|
|
1079
|
+
children: /* @__PURE__ */ K(C, {
|
|
1080
|
+
text: e,
|
|
1081
|
+
className: d("min-w-0", o)
|
|
1082
|
+
})
|
|
1083
|
+
})]
|
|
1084
|
+
}));
|
|
825
1085
|
//#endregion
|
|
826
|
-
export {
|
|
1086
|
+
export { Q as ContextFileRejection, Me as PROJECT_NAME_MAX_BYTES, ct as ProjectChatHeader, ot as ProjectConversationList, st as ProjectConversationsPanel, tt as ProjectCreateForm, je as ProjectNameError, Oe as ProjectSource, rt as ProjectView, De as Projects, ve as ProjectsSortKey, Ke as checkContextFiles, Je as filterContextFileItems, Ve as getContextFilesSize, ze as isStoredContextFile, Le as validateProjectName };
|