@epam/ai-dial-projects 1.3.0-dev.246 → 1.3.0-dev.248
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/ProjectCapacityMeter/ProjectCapacityMeter.d.ts +1 -1
- package/components/ProjectCapacityMeter/ProjectCapacityMeter.d.ts.map +1 -1
- package/components/ProjectCreateForm/ProjectCreateForm.d.ts.map +1 -1
- package/components/ProjectView/ProjectView.d.ts.map +1 -1
- package/components/Projects/Projects.d.ts.map +1 -1
- package/index.css +2 -2
- package/index.js +375 -372
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as t, MarkdownRenderer as n, PROHIBITED_CONVERSATION_NAME_CHARS_RE as r, PanelEmptyState as i, RequestStatus as a, TextRefinementField as o, buildCssVars as ee, getAttachmentTypeFromMime as s, inferMimeTypeFromPath as c, mergeClasses as l, useAvailableHeightCap as u, useTextRefinement as d } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { Button as te, ButtonAppearance as f, ButtonDropdown as p, ButtonVariant as m, CardShell as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, Dropdown as v, ElementSize as ne, EllipsisTooltip as y, ErrorText as b, FileDropzone as re, FolderPath as x, GhostButton as S, GhostIconButton as C, Highlight as w, Input 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
|
|
2
|
+
import { Button as te, ButtonAppearance as f, ButtonDropdown as p, ButtonVariant as m, CardShell as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, Dropdown as v, ElementSize as ne, EllipsisTooltip as y, ErrorText as b, FileDropzone as re, FolderPath as x, GhostButton as S, GhostIconButton as C, Highlight as w, Input as T, Label as E, LiveRegion as ie, LiveRegionElement as ae, LiveRegionPoliteness as oe, MenuItemMark as D, NeutralButton as se, ProgressBar as O, ProgressBarRole as ce, Search as le, Spinner as ue, Textarea as de } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconArrowNarrowLeft as fe, IconArrowsSort as k, IconDotsVertical as pe, IconPin as A, IconPinFilled as j } from "@tabler/icons-react";
|
|
4
|
+
import { Suspense as M, lazy as N, memo as P, useCallback as F, useEffect as I, useId as L, useMemo as R, useRef as z, useState as B } from "react";
|
|
5
|
+
import { Fragment as me, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
6
|
+
import { AttachmentCard as he, FileDndOverlay as ge } from "@epam/ai-dial-attachment-input";
|
|
7
|
+
import { BuilderFormContainer as _e } from "@epam/ai-dial-builder-form";
|
|
8
|
+
import { LazyMarkdownEditor as ve } from "@epam/ai-dial-ui-kit/editors";
|
|
9
9
|
//#region src/types/projects-sort-key.ts
|
|
10
|
-
var
|
|
10
|
+
var U = /* @__PURE__ */ function(e) {
|
|
11
11
|
return e.Newest = "newest", e.Oldest = "oldest", e.NameAsc = "name-asc", e;
|
|
12
|
-
}({}),
|
|
12
|
+
}({}), ye = (e, t) => {
|
|
13
13
|
let n = t.trim().toLocaleLowerCase();
|
|
14
14
|
return n ? e.filter((e) => e.name.toLocaleLowerCase().includes(n)) : e;
|
|
15
|
-
},
|
|
15
|
+
}, be = (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 === U.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
|
|
21
|
+
let o = t === U.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
|
-
},
|
|
26
|
+
}, xe = 60, Se = 3600, W = 24 * Se, G = [
|
|
27
27
|
["year", 365 * W],
|
|
28
28
|
["month", 30 * W],
|
|
29
29
|
["week", 7 * W],
|
|
30
30
|
["day", W],
|
|
31
|
-
["hour",
|
|
32
|
-
["minute",
|
|
33
|
-
],
|
|
31
|
+
["hour", Se],
|
|
32
|
+
["minute", xe]
|
|
33
|
+
], Ce = (e, t, n) => {
|
|
34
34
|
let r = (t - e) / 1e3;
|
|
35
|
-
for (let [e, t] of
|
|
35
|
+
for (let [e, t] of G) {
|
|
36
36
|
let i = Math.floor(r / t);
|
|
37
37
|
if (i >= 1) return new Intl.RelativeTimeFormat(n).format(-i, e);
|
|
38
38
|
}
|
|
@@ -46,49 +46,49 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
46
46
|
link: "_link_1o77o_23",
|
|
47
47
|
aboveLink: "_aboveLink_1o77o_39",
|
|
48
48
|
interactive: "_interactive_1o77o_44"
|
|
49
|
-
},
|
|
50
|
-
let f = /* @__PURE__ */
|
|
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: ee, locale: s, updatedAtClassName: c, titleClassName: u, pathLabelClassName: d, pathLeafClassName: te }) => {
|
|
50
|
+
let f = /* @__PURE__ */ V(w, {
|
|
51
51
|
text: e.name,
|
|
52
52
|
query: t,
|
|
53
53
|
maxLines: 1,
|
|
54
54
|
className: l("min-w-0", u, K.title, a != null && K.aboveLink)
|
|
55
55
|
});
|
|
56
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ V("li", {
|
|
57
57
|
className: "flex min-w-0",
|
|
58
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ H(h, {
|
|
59
59
|
"aria-label": e.name,
|
|
60
60
|
className: l("relative flex w-full min-w-0 flex-col gap-2", K.card, a != null && "has-focus-visible:-translate-y-[3px] has-focus-visible:shadow-lg motion-reduce:has-focus-visible:translate-y-0", a != null && K.interactive),
|
|
61
61
|
children: [
|
|
62
|
-
e.updatedAt != null && /* @__PURE__ */
|
|
62
|
+
e.updatedAt != null && /* @__PURE__ */ V("time", {
|
|
63
63
|
dateTime: new Date(e.updatedAt).toISOString(),
|
|
64
64
|
className: l(c, K.updatedAt),
|
|
65
|
-
children:
|
|
65
|
+
children: Ce(e.updatedAt, ee, s)
|
|
66
66
|
}),
|
|
67
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ H("div", {
|
|
68
68
|
className: "flex min-w-0 items-center gap-2",
|
|
69
|
-
children: [a == null ? /* @__PURE__ */
|
|
69
|
+
children: [a == null ? /* @__PURE__ */ V("div", {
|
|
70
70
|
className: "min-w-0 flex-1",
|
|
71
71
|
children: f
|
|
72
|
-
}) : /* @__PURE__ */
|
|
72
|
+
}) : /* @__PURE__ */ V("a", {
|
|
73
73
|
href: a,
|
|
74
74
|
onClick: (t) => {
|
|
75
|
-
o != null &&
|
|
75
|
+
o != null && Te(t) && (t.preventDefault(), o(e.id));
|
|
76
76
|
},
|
|
77
77
|
className: l("min-w-0 flex-1", K.link),
|
|
78
78
|
children: f
|
|
79
|
-
}), e.isPinned && /* @__PURE__ */
|
|
79
|
+
}), e.isPinned && /* @__PURE__ */ H("span", {
|
|
80
80
|
className: l("shrink-0", K.pin),
|
|
81
|
-
children: [/* @__PURE__ */
|
|
81
|
+
children: [/* @__PURE__ */ V(j, {
|
|
82
82
|
size: g.SM,
|
|
83
83
|
"aria-hidden": !0
|
|
84
|
-
}), /* @__PURE__ */
|
|
84
|
+
}), /* @__PURE__ */ V("span", {
|
|
85
85
|
className: "sr-only",
|
|
86
86
|
children: i
|
|
87
87
|
})]
|
|
88
88
|
})]
|
|
89
89
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
segments:
|
|
90
|
+
/* @__PURE__ */ V(x, {
|
|
91
|
+
segments: we(n, e.parentPath),
|
|
92
92
|
ariaLabel: r,
|
|
93
93
|
labelClassName: l(d, K.path),
|
|
94
94
|
leafClassName: l(te, K.path),
|
|
@@ -101,8 +101,8 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
101
101
|
container: "_container_qfuxj_1",
|
|
102
102
|
subtitle: "_subtitle_qfuxj_5",
|
|
103
103
|
sortButton: "_sortButton_qfuxj_9"
|
|
104
|
-
},
|
|
105
|
-
let { colors: x, typography: C } = re ?? {}, w = C?.titleClassName ?? "dial-h2-text",
|
|
104
|
+
}, J = ({ projects: e, isLoading: t = !1, hasError: n = !1, incompleteSources: r = [], onRetry: a, onCreateProject: o, onOpenProject: s, getProjectHref: c, searchQuery: u, onSearchQueryChange: d, sortKey: h, onSortKeyChange: v, labels: y, locale: b, styles: re }) => {
|
|
105
|
+
let { colors: x, typography: C } = re ?? {}, w = C?.titleClassName ?? "dial-h2-text", T = C?.subtitleClassName ?? "dial-body-text", E = C?.cardTitleClassName ?? "dial-body-semi-text", oe = C?.pathLabelClassName ?? "dial-tiny-text", se = C?.pathLeafClassName ?? "dial-tiny-semi-text", O = C?.updatedAtClassName ?? "dial-tiny-text", ce = C?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", de = ee({
|
|
106
106
|
"--pr-bg": x?.background,
|
|
107
107
|
"--pr-subtitle-text": x?.subtitleText,
|
|
108
108
|
"--pr-sort-text": x?.sortButtonText,
|
|
@@ -110,15 +110,15 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
110
110
|
"--pr-card-title-text": x?.cardTitleText,
|
|
111
111
|
"--pr-updated-at-text": x?.updatedAtText,
|
|
112
112
|
"--pr-path-text": x?.pathText
|
|
113
|
-
}), [
|
|
113
|
+
}), [fe] = B(() => Date.now()), pe = u.trim(), A = r.length > 0, j = A && e.length === 0, M = R(() => be(ye(e, u), h, b), [
|
|
114
114
|
e,
|
|
115
115
|
u,
|
|
116
116
|
h,
|
|
117
117
|
b
|
|
118
|
-
]),
|
|
118
|
+
]), N = y.sortOptions.find((e) => e.value === h)?.label ?? y.sortLabel, P = R(() => y.sortOptions.map((e) => ({
|
|
119
119
|
key: e.value,
|
|
120
120
|
label: e.label,
|
|
121
|
-
mark:
|
|
121
|
+
mark: D.Check,
|
|
122
122
|
checked: e.value === h,
|
|
123
123
|
onClick: () => v(e.value)
|
|
124
124
|
})), [
|
|
@@ -127,74 +127,74 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
127
127
|
v
|
|
128
128
|
]), F = (e) => {
|
|
129
129
|
d(e ?? "");
|
|
130
|
-
},
|
|
130
|
+
}, I = () => {
|
|
131
131
|
if (!t) return n ? y.errorLabel : A ? y.incompleteLabel : e.length === 0 ? y.emptyStateLabel : M.length === 0 ? y.noResultsLabel : y.resultCountLabel(M.length);
|
|
132
|
-
},
|
|
132
|
+
}, L = (e, t) => o ? /* @__PURE__ */ V(te, {
|
|
133
133
|
label: y.createProjectLabel,
|
|
134
134
|
variant: e,
|
|
135
135
|
onClick: o,
|
|
136
136
|
className: l("shrink-0", t)
|
|
137
|
-
}) : void 0, z = () => t ? /* @__PURE__ */
|
|
137
|
+
}) : void 0, z = () => t ? /* @__PURE__ */ V(ue, {}) : n || j ? /* @__PURE__ */ H("div", {
|
|
138
138
|
className: "flex flex-col items-center gap-3",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
140
|
-
className: l(
|
|
139
|
+
children: [/* @__PURE__ */ V("p", {
|
|
140
|
+
className: l(T, q.subtitle),
|
|
141
141
|
children: n ? y.errorLabel : y.incompleteLabel
|
|
142
|
-
}), /* @__PURE__ */
|
|
142
|
+
}), /* @__PURE__ */ V(S, {
|
|
143
143
|
label: y.retryLabel,
|
|
144
144
|
onClick: a
|
|
145
145
|
})]
|
|
146
|
-
}) : e.length === 0 ? /* @__PURE__ */
|
|
146
|
+
}) : e.length === 0 ? /* @__PURE__ */ V(i, {
|
|
147
147
|
label: y.emptyStateLabel,
|
|
148
148
|
description: y.emptyStateDescription,
|
|
149
|
-
action:
|
|
149
|
+
action: L(m.Secondary, "mt-2"),
|
|
150
150
|
containerClassName: "p-3",
|
|
151
151
|
labelClassName: "mt-3",
|
|
152
|
-
descriptionClassName:
|
|
153
|
-
}) : M.length === 0 ? /* @__PURE__ */
|
|
152
|
+
descriptionClassName: ce
|
|
153
|
+
}) : M.length === 0 ? /* @__PURE__ */ V(i, {
|
|
154
154
|
label: y.noResultsLabel,
|
|
155
155
|
containerClassName: "p-3",
|
|
156
156
|
labelClassName: "mt-3"
|
|
157
|
-
}) : /* @__PURE__ */
|
|
157
|
+
}) : /* @__PURE__ */ V("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: M.map((e) => /* @__PURE__ */
|
|
159
|
+
children: M.map((e) => /* @__PURE__ */ V(Ee, {
|
|
160
160
|
project: e,
|
|
161
|
-
searchQuery:
|
|
161
|
+
searchQuery: pe,
|
|
162
162
|
sourceLabel: y.sourceLabels[e.source],
|
|
163
163
|
folderPathLabel: y.folderPathLabel,
|
|
164
164
|
pinnedLabel: y.pinnedLabel ?? "Pinned",
|
|
165
165
|
href: c?.(e.id),
|
|
166
166
|
onOpen: s,
|
|
167
|
-
now:
|
|
167
|
+
now: fe,
|
|
168
168
|
locale: b,
|
|
169
|
-
updatedAtClassName:
|
|
170
|
-
titleClassName:
|
|
171
|
-
pathLabelClassName:
|
|
172
|
-
pathLeafClassName:
|
|
169
|
+
updatedAtClassName: O,
|
|
170
|
+
titleClassName: E,
|
|
171
|
+
pathLabelClassName: oe,
|
|
172
|
+
pathLeafClassName: se
|
|
173
173
|
}, e.id))
|
|
174
|
-
}),
|
|
175
|
-
return /* @__PURE__ */
|
|
176
|
-
style:
|
|
174
|
+
}), me = t || n || j;
|
|
175
|
+
return /* @__PURE__ */ H("div", {
|
|
176
|
+
style: de,
|
|
177
177
|
className: l("flex h-full w-full min-w-0 flex-col overflow-y-auto", q.container),
|
|
178
178
|
children: [
|
|
179
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ H("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__ */ H("div", {
|
|
182
182
|
className: "min-w-0 flex-1",
|
|
183
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ V("h1", {
|
|
184
184
|
className: l("break-words", w),
|
|
185
185
|
children: y.title
|
|
186
|
-
}), y.subtitle && /* @__PURE__ */
|
|
187
|
-
className: l("mt-0.5",
|
|
186
|
+
}), y.subtitle && /* @__PURE__ */ V("p", {
|
|
187
|
+
className: l("mt-0.5", T, q.subtitle),
|
|
188
188
|
children: y.subtitle
|
|
189
189
|
})]
|
|
190
|
-
}),
|
|
190
|
+
}), L(m.Primary)]
|
|
191
191
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ H("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__ */ V("div", {
|
|
195
195
|
role: "search",
|
|
196
196
|
className: "min-w-0 flex-1",
|
|
197
|
-
children: /* @__PURE__ */
|
|
197
|
+
children: /* @__PURE__ */ V(le, {
|
|
198
198
|
value: u,
|
|
199
199
|
onChange: F,
|
|
200
200
|
placeholder: y.searchPlaceholder,
|
|
@@ -202,16 +202,16 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
202
202
|
"aria-label": y.searchAriaLabel,
|
|
203
203
|
size: ne.Large
|
|
204
204
|
})
|
|
205
|
-
}), y.sortOptions.length > 0 && /* @__PURE__ */
|
|
205
|
+
}), y.sortOptions.length > 0 && /* @__PURE__ */ V("div", {
|
|
206
206
|
role: "group",
|
|
207
207
|
"aria-label": y.sortLabel,
|
|
208
208
|
className: "shrink-0",
|
|
209
|
-
children: /* @__PURE__ */
|
|
210
|
-
items:
|
|
211
|
-
label:
|
|
209
|
+
children: /* @__PURE__ */ V(p, {
|
|
210
|
+
items: P,
|
|
211
|
+
label: N,
|
|
212
212
|
variant: m.Primary,
|
|
213
213
|
appearance: f.Ghost,
|
|
214
|
-
iconBefore: /* @__PURE__ */
|
|
214
|
+
iconBefore: /* @__PURE__ */ V(k, {
|
|
215
215
|
size: g.SM,
|
|
216
216
|
"aria-hidden": !0,
|
|
217
217
|
stroke: _
|
|
@@ -220,48 +220,47 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
220
220
|
})
|
|
221
221
|
})]
|
|
222
222
|
}),
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
children: pe()
|
|
223
|
+
/* @__PURE__ */ V(ie, {
|
|
224
|
+
visuallyHidden: !0,
|
|
225
|
+
as: ae.Span,
|
|
226
|
+
children: I()
|
|
228
227
|
}),
|
|
229
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ H("div", {
|
|
230
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",
|
|
231
|
-
children: [A && !t && !n && !j && /* @__PURE__ */
|
|
230
|
+
children: [A && !t && !n && !j && /* @__PURE__ */ H("div", {
|
|
232
231
|
className: "flex w-full max-w-[1116px] flex-wrap items-center gap-3",
|
|
233
|
-
children: [/* @__PURE__ */
|
|
234
|
-
className: l(
|
|
232
|
+
children: [/* @__PURE__ */ V("p", {
|
|
233
|
+
className: l(T, q.subtitle),
|
|
235
234
|
children: y.incompleteLabel
|
|
236
|
-
}), /* @__PURE__ */
|
|
235
|
+
}), /* @__PURE__ */ V(S, {
|
|
237
236
|
label: y.retryLabel,
|
|
238
237
|
onClick: a
|
|
239
238
|
})]
|
|
240
|
-
}), /* @__PURE__ */
|
|
241
|
-
className: l("flex w-full max-w-[1116px] min-w-0 flex-col items-center",
|
|
239
|
+
}), /* @__PURE__ */ V("div", {
|
|
240
|
+
className: l("flex w-full max-w-[1116px] min-w-0 flex-col items-center", me && "flex-1 justify-center"),
|
|
242
241
|
children: z()
|
|
243
242
|
})]
|
|
244
243
|
})
|
|
245
244
|
]
|
|
246
245
|
});
|
|
247
|
-
},
|
|
246
|
+
}, De = /* @__PURE__ */ function(e) {
|
|
248
247
|
return e.Personal = "personal", e.Shared = "shared", e.Organization = "organization", e;
|
|
249
|
-
}({}),
|
|
250
|
-
let [t, n] =
|
|
248
|
+
}({}), Oe = (e) => !!e.dataTransfer?.types.includes("Files"), ke = (e) => {
|
|
249
|
+
let [t, n] = B(!1), r = z(0);
|
|
251
250
|
return {
|
|
252
251
|
isDragActive: t,
|
|
253
252
|
handlers: {
|
|
254
|
-
onDragEnter:
|
|
255
|
-
|
|
253
|
+
onDragEnter: F((e) => {
|
|
254
|
+
Oe(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
256
255
|
}, []),
|
|
257
|
-
onDragLeave:
|
|
258
|
-
|
|
256
|
+
onDragLeave: F((e) => {
|
|
257
|
+
Oe(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
259
258
|
}, []),
|
|
260
|
-
onDragOver:
|
|
261
|
-
|
|
259
|
+
onDragOver: F((e) => {
|
|
260
|
+
Oe(e) && e.preventDefault();
|
|
262
261
|
}, []),
|
|
263
|
-
onDrop:
|
|
264
|
-
if (!
|
|
262
|
+
onDrop: F((t) => {
|
|
263
|
+
if (!Oe(t)) return;
|
|
265
264
|
t.preventDefault(), r.current = 0, n(!1);
|
|
266
265
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
267
266
|
i.length > 0 && e(i);
|
|
@@ -272,34 +271,34 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
272
271
|
return e.UnsupportedType = "unsupported-type", e.TooLarge = "too-large", e.CapacityExceeded = "capacity-exceeded", e.Duplicate = "duplicate", e.InvalidName = "invalid-name", e;
|
|
273
272
|
}({}), X = /* @__PURE__ */ function(e) {
|
|
274
273
|
return e.Required = "required", e.InvalidCharacters = "invalid-characters", e.Reserved = "reserved", e.TooLong = "too-long", e;
|
|
275
|
-
}({}),
|
|
274
|
+
}({}), Ae = 255, je = new RegExp(r.source, "u"), Me = /[\p{Cc}--]/u, Ne = /* @__PURE__ */ new Set([
|
|
276
275
|
".",
|
|
277
276
|
"..",
|
|
278
277
|
"v",
|
|
279
278
|
"files",
|
|
280
279
|
".dial-resource",
|
|
281
280
|
".dial-folder"
|
|
282
|
-
]),
|
|
281
|
+
]), Pe = (e) => new TextEncoder().encode(e).length, Fe = (e) => {
|
|
283
282
|
let t = e.trim();
|
|
284
|
-
return t.length === 0 ? X.Required :
|
|
285
|
-
},
|
|
283
|
+
return t.length === 0 ? X.Required : Pe(t) > 255 ? X.TooLong : je.test(t) || Me.test(t) ? X.InvalidCharacters : Ne.has(t) ? X.Reserved : null;
|
|
284
|
+
}, Ie = (e) => {
|
|
286
285
|
let t = e.lastIndexOf(".");
|
|
287
286
|
return t > 0 ? e.slice(t + 1).toLowerCase() : "";
|
|
288
|
-
},
|
|
287
|
+
}, Le = (e) => "isStored" in e && e.isStored, Z = (e) => Le(e) ? e.size : e.file.size, Re = (e) => e.reduce((e, t) => e + Z(t), 0), ze = 0, Be = () => (ze += 1, `project-context-${Date.now()}-${ze}`), Ve = (e) => {
|
|
289
288
|
let t = e.type || c(e.name) || "application/octet-stream";
|
|
290
289
|
return {
|
|
291
|
-
id:
|
|
290
|
+
id: Be(),
|
|
292
291
|
name: e.name,
|
|
293
292
|
contentType: t,
|
|
294
293
|
type: s(t),
|
|
295
294
|
status: a.Idle,
|
|
296
295
|
file: e
|
|
297
296
|
};
|
|
298
|
-
},
|
|
299
|
-
let r = new Set(t.map((e) => e.name)), i =
|
|
297
|
+
}, Q = (e, t, n, r) => Fe(e.name) != null || e.name.trim() !== e.name ? Y.InvalidName : r.allowedExtensions.includes(Ie(e.name)) ? t.has(e.name) ? Y.Duplicate : e.size > r.maxFileBytes ? Y.TooLarge : n + e.size > r.maxTotalBytes ? Y.CapacityExceeded : null : Y.UnsupportedType, He = (e, t, n) => {
|
|
298
|
+
let r = new Set(t.map((e) => e.name)), i = Re(t), a = [], o = [];
|
|
300
299
|
for (let t of e) {
|
|
301
|
-
let e =
|
|
302
|
-
e == null ? (r.add(t.name), i += t.size, a.push(
|
|
300
|
+
let e = Q(t, r, i, n);
|
|
301
|
+
e == null ? (r.add(t.name), i += t.size, a.push(Ve(t))) : o.push({
|
|
303
302
|
name: t.name,
|
|
304
303
|
reason: e
|
|
305
304
|
});
|
|
@@ -308,276 +307,283 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
308
307
|
accepted: a,
|
|
309
308
|
rejected: o
|
|
310
309
|
};
|
|
311
|
-
},
|
|
310
|
+
}, Ue = (e, t) => e <= 0 ? 0 : t <= 0 ? 100 : Math.min(100, Math.max(1, Math.round(e / t * 100))), We = (e, t) => {
|
|
312
311
|
let n = t.trim().toLowerCase();
|
|
313
312
|
return n === "" ? e : e.filter((e) => e.name.toLowerCase().includes(n));
|
|
314
|
-
},
|
|
315
|
-
track: "
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}, Ve = ({ usedBytes: e, maxBytes: t, ariaLabel: n, formatLabel: r, textClassName: i = "dial-tiny-text" }) => {
|
|
313
|
+
}, Ge = {
|
|
314
|
+
track: "_track_1eyt2_1",
|
|
315
|
+
text: "_text_1eyt2_11"
|
|
316
|
+
}, Ke = ({ usedBytes: e, maxBytes: t, ariaLabel: n, formatLabel: r, textClassName: i = "dial-tiny-text" }) => {
|
|
319
317
|
if (e <= 0) return null;
|
|
320
|
-
let a =
|
|
321
|
-
return /* @__PURE__ */
|
|
318
|
+
let a = r(Ue(e, t));
|
|
319
|
+
return /* @__PURE__ */ H("div", {
|
|
322
320
|
className: "flex min-w-0 items-center gap-2",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
324
|
-
role:
|
|
321
|
+
children: [/* @__PURE__ */ V(O, {
|
|
322
|
+
role: ce.Meter,
|
|
323
|
+
value: e,
|
|
324
|
+
max: t,
|
|
325
|
+
size: ne.Small,
|
|
325
326
|
"aria-label": n,
|
|
326
|
-
"aria-
|
|
327
|
-
"
|
|
328
|
-
|
|
329
|
-
"aria-valuetext": o,
|
|
330
|
-
className: l("h-1 w-[60px] shrink-0 overflow-hidden rounded-full", Be.track),
|
|
331
|
-
children: /* @__PURE__ */ L("div", {
|
|
332
|
-
className: l("h-full rounded-full", Be.fill),
|
|
333
|
-
style: { width: `${a}%` }
|
|
334
|
-
})
|
|
335
|
-
}), /* @__PURE__ */ L("span", {
|
|
327
|
+
"aria-valuetext": a,
|
|
328
|
+
className: l("w-[60px] shrink-0", Ge.track)
|
|
329
|
+
}), /* @__PURE__ */ V("span", {
|
|
336
330
|
"aria-hidden": !0,
|
|
337
|
-
className: l("whitespace-nowrap", i,
|
|
338
|
-
children:
|
|
331
|
+
className: l("whitespace-nowrap", i, Ge.text),
|
|
332
|
+
children: a
|
|
339
333
|
})]
|
|
340
334
|
});
|
|
341
|
-
},
|
|
335
|
+
}, qe = {
|
|
342
336
|
formColumn: "_formColumn_1fxsc_1",
|
|
343
337
|
helper: "_helper_1fxsc_10",
|
|
344
338
|
label: "_label_1fxsc_14"
|
|
345
|
-
},
|
|
346
|
-
let le =
|
|
347
|
-
if (
|
|
348
|
-
|
|
339
|
+
}, Je = N(async () => ({ default: (await ve()).MarkdownEditor })), Ye = "device", Xe = "file-manager", Ze = ({ values: n, errors: r, onFieldChange: i, contextFiles: a, onContextFilesChange: s, allowedExtensions: c, maxFileBytes: te, maxTotalBytes: f, onPickFromFileManager: h, onRefineDescription: v, onRefineInstructions: y, onBack: x, onCancel: S, onSubmit: C, isSubmitting: w = !1, labels: D, markdownEditorTheme: se, className: O, styles: ce }) => {
|
|
340
|
+
let le = L(), k = L(), pe = L(), A = L(), j = L(), N = z(null), P = z(null), me = u(), [ve, U] = B(!1), [ye, be] = B([]), [xe, Se] = B(""), W = z(void 0), G = F((e) => e ? async (t, n) => {
|
|
341
|
+
if (W.current && !W.current.aborted) throw new DOMException("Busy", "AbortError");
|
|
342
|
+
W.current = n;
|
|
349
343
|
try {
|
|
350
344
|
return await e(t, n);
|
|
351
345
|
} finally {
|
|
352
|
-
|
|
346
|
+
W.current === n && (W.current = void 0);
|
|
353
347
|
}
|
|
354
|
-
} : void 0, []),
|
|
348
|
+
} : void 0, []), Ce = R(() => G(v), [G, v]), K = R(() => G(y), [G, y]), we = d({
|
|
355
349
|
value: n.description,
|
|
356
350
|
onChange: (e) => i("description", e),
|
|
357
|
-
onRefine:
|
|
351
|
+
onRefine: Ce,
|
|
358
352
|
disabled: w
|
|
359
|
-
}),
|
|
353
|
+
}), Te = d({
|
|
360
354
|
value: n.instructions,
|
|
361
355
|
onChange: (e) => i("instructions", e),
|
|
362
|
-
onRefine:
|
|
356
|
+
onRefine: K,
|
|
363
357
|
disabled: w
|
|
364
|
-
}),
|
|
365
|
-
|
|
366
|
-
r.name &&
|
|
358
|
+
}), Ee = we.isPending || Te.isPending, q = Fe(n.name), J = r.name ?? (ve && q != null ? D.nameErrors[q] : void 0), De = q != null || w || Ee;
|
|
359
|
+
I(() => {
|
|
360
|
+
r.name && N.current?.focus();
|
|
367
361
|
}, [r.name]);
|
|
368
|
-
let
|
|
362
|
+
let Oe = R(() => Re(a), [a]), Y = R(() => c.map((e) => `.${e}`).join(","), [c]), X = (e) => {
|
|
369
363
|
if (e.length === 0) return;
|
|
370
|
-
let { accepted: t, rejected: n } =
|
|
364
|
+
let { accepted: t, rejected: n } = He(e, a, {
|
|
371
365
|
allowedExtensions: c,
|
|
372
366
|
maxFileBytes: te,
|
|
373
367
|
maxTotalBytes: f
|
|
374
368
|
});
|
|
375
|
-
|
|
376
|
-
}, { isDragActive:
|
|
369
|
+
be(n), t.length > 0 && s([...a, ...t]), Se([t.length > 0 ? D.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => D.fileRejections[t](e))].filter(Boolean).join(" "));
|
|
370
|
+
}, { isDragActive: Ae, handlers: je } = ke(X), Me = (e) => {
|
|
377
371
|
let t = a.find((t) => t.id === e);
|
|
378
|
-
s(a.filter((t) => t.id !== e)),
|
|
379
|
-
},
|
|
380
|
-
|
|
381
|
-
},
|
|
372
|
+
s(a.filter((t) => t.id !== e)), be([]), t && Se(D.fileRemovedStatus(t.name));
|
|
373
|
+
}, Ne = (e) => {
|
|
374
|
+
X(Array.from(e.target.files ?? [])), e.target.value = "";
|
|
375
|
+
}, Pe = async () => {
|
|
382
376
|
if (h) try {
|
|
383
377
|
let e = await h();
|
|
384
|
-
e &&
|
|
378
|
+
e && X(e);
|
|
385
379
|
} catch {}
|
|
386
|
-
},
|
|
387
|
-
key:
|
|
388
|
-
label:
|
|
389
|
-
onClick: () =>
|
|
380
|
+
}, Ie = [{
|
|
381
|
+
key: Ye,
|
|
382
|
+
label: D.addFromDeviceLabel,
|
|
383
|
+
onClick: () => P.current?.click()
|
|
390
384
|
}, ...h ? [{
|
|
391
|
-
key:
|
|
392
|
-
label:
|
|
393
|
-
onClick: () => void
|
|
394
|
-
}] : []],
|
|
395
|
-
!
|
|
396
|
-
}, { colors:
|
|
397
|
-
"--pcf-helper-text":
|
|
398
|
-
"--pcf-label-text":
|
|
399
|
-
"--pcf-meter-track":
|
|
400
|
-
"--pcf-meter-fill":
|
|
401
|
-
}),
|
|
402
|
-
return /* @__PURE__ */
|
|
403
|
-
className: l("relative flex h-full min-h-0 w-full",
|
|
404
|
-
...
|
|
385
|
+
key: Xe,
|
|
386
|
+
label: D.addFromFileManagerLabel,
|
|
387
|
+
onClick: () => void Pe()
|
|
388
|
+
}] : []], Le = () => {
|
|
389
|
+
!De && (!W.current || W.current.aborted) && C();
|
|
390
|
+
}, { colors: Z, typography: ze } = ce ?? {}, Be = ze?.titleClassName ?? "dial-h1-text", Ve = l(ze?.labelClassName ?? "dial-tiny-semi-text", qe.label), Q = ze?.helperClassName ?? "dial-tiny-text", Ue = ee({
|
|
391
|
+
"--pcf-helper-text": Z?.helperText,
|
|
392
|
+
"--pcf-label-text": Z?.labelText,
|
|
393
|
+
"--pcf-meter-track": Z?.meterTrack,
|
|
394
|
+
"--pcf-meter-fill": Z?.meterFill
|
|
395
|
+
}), We = D.refinement, Ge = r.context, Ze = !!Ge;
|
|
396
|
+
return /* @__PURE__ */ H("div", {
|
|
397
|
+
className: l("relative flex h-full min-h-0 w-full", O),
|
|
398
|
+
...je,
|
|
405
399
|
children: [
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
isVisible:
|
|
400
|
+
/* @__PURE__ */ V(ge, {
|
|
401
|
+
isVisible: Ae,
|
|
408
402
|
labels: {
|
|
409
|
-
title:
|
|
410
|
-
subtitle:
|
|
403
|
+
title: D.dropOverlayTitle,
|
|
404
|
+
subtitle: D.dropOverlaySubtitle
|
|
411
405
|
}
|
|
412
406
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ V(_e, {
|
|
414
408
|
labels: {
|
|
415
|
-
title:
|
|
416
|
-
backButtonLabel:
|
|
417
|
-
cancelButtonLabel:
|
|
418
|
-
submitButtonLabel:
|
|
419
|
-
submittingLabel:
|
|
409
|
+
title: D.title,
|
|
410
|
+
backButtonLabel: D.backLabel,
|
|
411
|
+
cancelButtonLabel: D.cancelLabel,
|
|
412
|
+
submitButtonLabel: D.createLabel,
|
|
413
|
+
submittingLabel: D.submittingLabel ?? D.createLabel
|
|
420
414
|
},
|
|
421
415
|
onBack: x,
|
|
422
416
|
onCancel: S,
|
|
423
|
-
onSubmit:
|
|
417
|
+
onSubmit: Le,
|
|
424
418
|
isCancelDisabled: w,
|
|
425
|
-
isSubmitDisabled:
|
|
419
|
+
isSubmitDisabled: De,
|
|
426
420
|
isSubmitting: w,
|
|
427
|
-
backIcon: /* @__PURE__ */
|
|
421
|
+
backIcon: /* @__PURE__ */ V(fe, {
|
|
428
422
|
size: g.LG,
|
|
429
423
|
stroke: _,
|
|
430
424
|
"aria-hidden": !0,
|
|
431
425
|
className: "rtl:scale-x-[-1]"
|
|
432
426
|
}),
|
|
433
427
|
styles: {
|
|
434
|
-
colors: { background:
|
|
428
|
+
colors: { background: Z?.background },
|
|
435
429
|
header: {
|
|
436
|
-
colors: { borderColor:
|
|
437
|
-
typography: { fontClassName:
|
|
430
|
+
colors: { borderColor: Z?.headerBorder },
|
|
431
|
+
typography: { fontClassName: Be }
|
|
438
432
|
},
|
|
439
|
-
cssVars:
|
|
433
|
+
cssVars: Ue
|
|
440
434
|
},
|
|
441
|
-
children: /* @__PURE__ */
|
|
442
|
-
className: l("mx-auto flex w-full max-w-[1040px] min-w-0 flex-col gap-5 py-6",
|
|
435
|
+
children: /* @__PURE__ */ H("div", {
|
|
436
|
+
className: l("mx-auto flex w-full max-w-[1040px] min-w-0 flex-col gap-5 py-6", qe.formColumn),
|
|
443
437
|
children: [
|
|
444
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ H("div", {
|
|
445
439
|
className: "flex flex-col gap-1",
|
|
446
|
-
children: [
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
440
|
+
children: [
|
|
441
|
+
/* @__PURE__ */ V(T, {
|
|
442
|
+
id: le,
|
|
443
|
+
inputRef: N,
|
|
444
|
+
value: n.name,
|
|
445
|
+
onChange: (e) => i("name", e ?? ""),
|
|
446
|
+
onBlur: () => U(!0),
|
|
447
|
+
placeholder: D.namePlaceholder,
|
|
448
|
+
labelProps: {
|
|
449
|
+
label: D.nameLabel,
|
|
450
|
+
required: !0
|
|
451
|
+
},
|
|
452
|
+
required: !0,
|
|
453
|
+
"aria-required": !0,
|
|
454
|
+
invalid: !!J,
|
|
455
|
+
"aria-invalid": !!J,
|
|
456
|
+
"aria-describedby": J ? k : void 0
|
|
457
|
+
}),
|
|
458
|
+
/* @__PURE__ */ V(b, {
|
|
459
|
+
announce: oe.Assertive,
|
|
460
|
+
id: k,
|
|
461
|
+
className: Q,
|
|
462
|
+
text: r.name ?? ""
|
|
463
|
+
}),
|
|
464
|
+
J && !r.name && /* @__PURE__ */ V(b, {
|
|
465
|
+
id: k,
|
|
466
|
+
className: Q,
|
|
467
|
+
text: J
|
|
468
|
+
})
|
|
469
|
+
]
|
|
468
470
|
}),
|
|
469
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ V(o, {
|
|
470
472
|
isEnabled: !!v,
|
|
471
|
-
fieldId:
|
|
472
|
-
label:
|
|
473
|
-
labelClassName:
|
|
474
|
-
labels:
|
|
475
|
-
refinement:
|
|
476
|
-
disabled: w ||
|
|
477
|
-
children: /* @__PURE__ */
|
|
478
|
-
id:
|
|
473
|
+
fieldId: pe,
|
|
474
|
+
label: D.descriptionLabel,
|
|
475
|
+
labelClassName: Ve,
|
|
476
|
+
labels: We,
|
|
477
|
+
refinement: we,
|
|
478
|
+
disabled: w || Ee,
|
|
479
|
+
children: /* @__PURE__ */ V(de, {
|
|
480
|
+
id: pe,
|
|
479
481
|
value: n.description,
|
|
480
482
|
onChange: (e) => {
|
|
481
|
-
|
|
483
|
+
we.reset(), i("description", e);
|
|
482
484
|
},
|
|
483
|
-
placeholder:
|
|
484
|
-
labelProps: v ? void 0 : { label:
|
|
485
|
+
placeholder: D.descriptionPlaceholder,
|
|
486
|
+
labelProps: v ? void 0 : { label: D.descriptionLabel }
|
|
485
487
|
})
|
|
486
488
|
}),
|
|
487
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ V(o, {
|
|
488
490
|
isEnabled: !!y,
|
|
489
491
|
fieldId: A,
|
|
490
|
-
label:
|
|
491
|
-
labelClassName:
|
|
492
|
-
labels:
|
|
493
|
-
refinement:
|
|
494
|
-
disabled: w ||
|
|
495
|
-
children: /* @__PURE__ */
|
|
492
|
+
label: D.instructionsLabel,
|
|
493
|
+
labelClassName: Ve,
|
|
494
|
+
labels: We,
|
|
495
|
+
refinement: Te,
|
|
496
|
+
disabled: w || Ee,
|
|
497
|
+
children: /* @__PURE__ */ H("div", {
|
|
496
498
|
className: "flex flex-1 flex-col gap-2",
|
|
497
|
-
children: [!y && /* @__PURE__ */
|
|
499
|
+
children: [!y && /* @__PURE__ */ V(E, {
|
|
498
500
|
htmlFor: A,
|
|
499
|
-
className:
|
|
500
|
-
label:
|
|
501
|
-
}), /* @__PURE__ */
|
|
502
|
-
ref:
|
|
501
|
+
className: Ve,
|
|
502
|
+
label: D.instructionsLabel
|
|
503
|
+
}), /* @__PURE__ */ V("div", {
|
|
504
|
+
ref: me,
|
|
503
505
|
className: l("w-full", e, t),
|
|
504
|
-
children: /* @__PURE__ */
|
|
505
|
-
fallback: /* @__PURE__ */
|
|
506
|
-
children: /* @__PURE__ */
|
|
506
|
+
children: /* @__PURE__ */ V(M, {
|
|
507
|
+
fallback: /* @__PURE__ */ V(ue, {}),
|
|
508
|
+
children: /* @__PURE__ */ V(Je, {
|
|
507
509
|
id: A,
|
|
508
510
|
value: n.instructions,
|
|
509
511
|
onChange: (e) => {
|
|
510
|
-
|
|
512
|
+
Te.reset(), i("instructions", e);
|
|
511
513
|
},
|
|
512
514
|
height: 176,
|
|
513
|
-
theme:
|
|
514
|
-
placeholder:
|
|
515
|
+
theme: se,
|
|
516
|
+
placeholder: D.instructionsPlaceholder
|
|
515
517
|
})
|
|
516
518
|
})
|
|
517
519
|
})]
|
|
518
520
|
})
|
|
519
521
|
}),
|
|
520
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ H("section", {
|
|
521
523
|
"aria-labelledby": j,
|
|
522
524
|
className: "flex flex-col gap-2",
|
|
523
525
|
children: [
|
|
524
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ H("div", {
|
|
525
527
|
className: "flex min-w-0 flex-wrap items-center justify-between gap-2",
|
|
526
|
-
children: [/* @__PURE__ */
|
|
528
|
+
children: [/* @__PURE__ */ V("h2", {
|
|
527
529
|
id: j,
|
|
528
|
-
className:
|
|
529
|
-
children:
|
|
530
|
-
}), /* @__PURE__ */
|
|
530
|
+
className: Ve,
|
|
531
|
+
children: D.contextLabel
|
|
532
|
+
}), /* @__PURE__ */ H("div", {
|
|
531
533
|
className: "flex min-w-0 items-center gap-4",
|
|
532
|
-
children: [/* @__PURE__ */
|
|
533
|
-
usedBytes:
|
|
534
|
+
children: [/* @__PURE__ */ V(Ke, {
|
|
535
|
+
usedBytes: Oe,
|
|
534
536
|
maxBytes: f,
|
|
535
|
-
ariaLabel:
|
|
536
|
-
formatLabel:
|
|
537
|
-
textClassName:
|
|
538
|
-
}), /* @__PURE__ */
|
|
539
|
-
items:
|
|
540
|
-
label:
|
|
537
|
+
ariaLabel: D.capacityMeterLabel,
|
|
538
|
+
formatLabel: D.capacityLabel,
|
|
539
|
+
textClassName: Q
|
|
540
|
+
}), /* @__PURE__ */ V(p, {
|
|
541
|
+
items: Ie,
|
|
542
|
+
label: D.addLabel,
|
|
541
543
|
variant: m.Neutral,
|
|
542
544
|
size: ne.Small,
|
|
543
545
|
disabled: w
|
|
544
546
|
})]
|
|
545
547
|
})]
|
|
546
548
|
}),
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
ref:
|
|
549
|
+
/* @__PURE__ */ V("input", {
|
|
550
|
+
ref: P,
|
|
549
551
|
type: "file",
|
|
550
552
|
multiple: !0,
|
|
551
|
-
accept:
|
|
553
|
+
accept: Y,
|
|
552
554
|
tabIndex: -1,
|
|
553
555
|
"aria-hidden": !0,
|
|
554
556
|
className: "sr-only",
|
|
555
|
-
onChange:
|
|
557
|
+
onChange: Ne
|
|
556
558
|
}),
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
label:
|
|
559
|
-
description:
|
|
560
|
-
accept:
|
|
559
|
+
/* @__PURE__ */ V(re, {
|
|
560
|
+
label: D.dropZoneLabel,
|
|
561
|
+
description: D.dropZoneHint,
|
|
562
|
+
accept: Y,
|
|
561
563
|
multiple: !0,
|
|
562
564
|
disabled: w,
|
|
563
|
-
onChange:
|
|
564
|
-
onReject:
|
|
565
|
+
onChange: X,
|
|
566
|
+
onReject: X
|
|
565
567
|
}),
|
|
566
|
-
|
|
567
|
-
className: l("flex flex-col gap-1",
|
|
568
|
-
children:
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
568
|
+
ye.length > 0 && /* @__PURE__ */ V("ul", {
|
|
569
|
+
className: l("flex flex-col gap-1", Q, qe.helper),
|
|
570
|
+
children: ye.map(({ name: e, reason: t }) => /* @__PURE__ */ V("li", { children: D.fileRejections[t](e) }, `${t}:${e}`))
|
|
571
|
+
}),
|
|
572
|
+
/* @__PURE__ */ V(ie, {
|
|
573
|
+
politeness: oe.Assertive,
|
|
574
|
+
children: Ze && /* @__PURE__ */ V("p", {
|
|
575
|
+
className: l(Q, qe.helper),
|
|
576
|
+
children: Ge
|
|
577
|
+
})
|
|
572
578
|
}),
|
|
573
|
-
a.length > 0 && /* @__PURE__ */
|
|
579
|
+
a.length > 0 && /* @__PURE__ */ V("ul", {
|
|
574
580
|
className: "flex min-w-0 flex-wrap gap-2 pt-1",
|
|
575
|
-
children: a.map((e) => /* @__PURE__ */
|
|
581
|
+
children: a.map((e) => /* @__PURE__ */ V("li", {
|
|
576
582
|
className: "min-w-0",
|
|
577
|
-
children: /* @__PURE__ */
|
|
583
|
+
children: /* @__PURE__ */ V(he, {
|
|
578
584
|
attachment: e,
|
|
579
|
-
onRemove:
|
|
580
|
-
labels: { removeLabel:
|
|
585
|
+
onRemove: Me,
|
|
586
|
+
labels: { removeLabel: D.removeFileLabel(e.name) }
|
|
581
587
|
})
|
|
582
588
|
}, e.id))
|
|
583
589
|
})
|
|
@@ -586,11 +592,10 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
586
592
|
]
|
|
587
593
|
})
|
|
588
594
|
}),
|
|
589
|
-
/* @__PURE__ */
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
children: w ? E.creatingStatus : W
|
|
595
|
+
/* @__PURE__ */ V(ie, {
|
|
596
|
+
visuallyHidden: !0,
|
|
597
|
+
as: ae.Span,
|
|
598
|
+
children: w ? D.creatingStatus : xe
|
|
594
599
|
})
|
|
595
600
|
]
|
|
596
601
|
});
|
|
@@ -601,21 +606,21 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
601
606
|
body: "_body_16lvl_13",
|
|
602
607
|
secondary: "_secondary_16lvl_17",
|
|
603
608
|
panel: "_panel_16lvl_21"
|
|
604
|
-
},
|
|
609
|
+
}, Qe = (e) => ({
|
|
605
610
|
id: e.name,
|
|
606
611
|
name: e.name,
|
|
607
612
|
contentType: e.contentType,
|
|
608
613
|
type: s(e.contentType),
|
|
609
614
|
status: a.Idle
|
|
610
|
-
}),
|
|
611
|
-
let { colors: D, typography: O } =
|
|
615
|
+
}), $e = P(({ project: e, isLoading: t = !1, hasError: r = !1, isNotFound: a = !1, isPinned: o, isPinPending: s = !1, contextSearchQuery: c, onContextSearchQueryChange: u, onBack: d, onTogglePin: f, onPublish: p, onEdit: h, onShare: ne, onDelete: b, onDownload: re, onOpenFile: x, onRetry: w, onBrowseProjects: T, labels: E, styles: oe }) => {
|
|
616
|
+
let { colors: D, typography: O } = oe ?? {}, ce = O?.titleClassName ?? "dial-h2-text", de = O?.panelTitleClassName ?? "dial-body-semi-text", k = O?.sectionTitleClassName ?? "dial-tiny-text", M = O?.bodyClassName ?? "dial-small-text", N = O?.helperClassName ?? "dial-tiny-text", P = O?.instructionsHeadingClassName ?? "dial-small-semi-text", F = ee({
|
|
612
617
|
"--pv-bg": D?.background,
|
|
613
618
|
"--pv-border": D?.border,
|
|
614
619
|
"--pv-heading-text": D?.headingText,
|
|
615
620
|
"--pv-body-text": D?.bodyText,
|
|
616
621
|
"--pv-secondary-text": D?.secondaryText
|
|
617
|
-
}),
|
|
618
|
-
let e = l("mb-1 mt-3 first:mt-0",
|
|
622
|
+
}), I = R(() => e?.contextFiles ?? [], [e]), z = R(() => We(I, c), [I, c]), B = c.trim(), ge = L(), _e = R(() => {
|
|
623
|
+
let e = l("mb-1 mt-3 first:mt-0", P);
|
|
619
624
|
return {
|
|
620
625
|
h1: e,
|
|
621
626
|
h2: e,
|
|
@@ -627,113 +632,112 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
627
632
|
ul: M,
|
|
628
633
|
ol: M
|
|
629
634
|
};
|
|
630
|
-
}, [M,
|
|
635
|
+
}, [M, P]), ve = (e) => {
|
|
631
636
|
let t = [];
|
|
632
637
|
return e && p && t.push({
|
|
633
638
|
key: "publish",
|
|
634
|
-
label:
|
|
639
|
+
label: E.publishLabel,
|
|
635
640
|
onClick: p
|
|
636
641
|
}), e && h && t.push({
|
|
637
642
|
key: "edit",
|
|
638
|
-
label:
|
|
643
|
+
label: E.editLabel,
|
|
639
644
|
onClick: h
|
|
640
645
|
}), ne && t.push({
|
|
641
646
|
key: "share",
|
|
642
|
-
label:
|
|
647
|
+
label: E.shareLabel,
|
|
643
648
|
onClick: ne
|
|
644
649
|
}), t.push({
|
|
645
650
|
key: "download",
|
|
646
|
-
label:
|
|
651
|
+
label: E.downloadLabel,
|
|
647
652
|
onClick: re
|
|
648
653
|
}), b && t.push({
|
|
649
654
|
key: "delete",
|
|
650
|
-
label:
|
|
655
|
+
label: E.deleteLabel,
|
|
651
656
|
danger: !0,
|
|
652
657
|
onClick: b
|
|
653
658
|
}), t;
|
|
654
|
-
}, U = (e, t) => /* @__PURE__ */
|
|
659
|
+
}, U = (e, t) => /* @__PURE__ */ V("div", {
|
|
655
660
|
className: t,
|
|
656
|
-
children: /* @__PURE__ */
|
|
657
|
-
items:
|
|
661
|
+
children: /* @__PURE__ */ V(v, {
|
|
662
|
+
items: ve(e),
|
|
658
663
|
matchReferenceWidth: !1,
|
|
659
664
|
listClassName: "w-[200px]",
|
|
660
|
-
children: /* @__PURE__ */
|
|
661
|
-
icon: /* @__PURE__ */
|
|
665
|
+
children: /* @__PURE__ */ V(C, {
|
|
666
|
+
icon: /* @__PURE__ */ V(pe, {
|
|
662
667
|
size: g.MD,
|
|
663
668
|
"aria-hidden": !0,
|
|
664
669
|
stroke: _
|
|
665
670
|
}),
|
|
666
|
-
"aria-label":
|
|
671
|
+
"aria-label": E.moreActionsLabel
|
|
667
672
|
})
|
|
668
673
|
})
|
|
669
674
|
});
|
|
670
|
-
return t || r || a || e == null ? /* @__PURE__ */
|
|
671
|
-
style:
|
|
675
|
+
return t || r || a || e == null ? /* @__PURE__ */ V("div", {
|
|
676
|
+
style: F,
|
|
672
677
|
className: l("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
|
|
673
|
-
children: t ? /* @__PURE__ */
|
|
678
|
+
children: t ? /* @__PURE__ */ V(ue, {}) : r ? /* @__PURE__ */ H("div", {
|
|
674
679
|
className: "flex flex-col items-center gap-3",
|
|
675
|
-
children: [/* @__PURE__ */
|
|
676
|
-
role: "
|
|
680
|
+
children: [/* @__PURE__ */ V("p", {
|
|
681
|
+
role: "status",
|
|
677
682
|
className: l(M, $.body),
|
|
678
|
-
children:
|
|
679
|
-
}), /* @__PURE__ */
|
|
680
|
-
label:
|
|
683
|
+
children: E.errorLabel
|
|
684
|
+
}), /* @__PURE__ */ V(S, {
|
|
685
|
+
label: E.retryLabel,
|
|
681
686
|
onClick: w
|
|
682
687
|
})]
|
|
683
|
-
}) : /* @__PURE__ */
|
|
688
|
+
}) : /* @__PURE__ */ H("div", {
|
|
684
689
|
className: "flex flex-col items-center gap-3",
|
|
685
|
-
children: [/* @__PURE__ */
|
|
686
|
-
role: "alert",
|
|
690
|
+
children: [/* @__PURE__ */ V("p", {
|
|
687
691
|
className: l(M, $.body),
|
|
688
|
-
children:
|
|
689
|
-
}), /* @__PURE__ */
|
|
690
|
-
label:
|
|
691
|
-
onClick:
|
|
692
|
+
children: E.notFoundLabel
|
|
693
|
+
}), /* @__PURE__ */ V(S, {
|
|
694
|
+
label: E.browseProjectsLabel,
|
|
695
|
+
onClick: T
|
|
692
696
|
})]
|
|
693
697
|
})
|
|
694
|
-
}) : /* @__PURE__ */
|
|
695
|
-
style:
|
|
698
|
+
}) : /* @__PURE__ */ H("div", {
|
|
699
|
+
style: F,
|
|
696
700
|
className: l("flex h-full w-full min-w-0 flex-col overflow-y-auto", $.container),
|
|
697
|
-
children: [/* @__PURE__ */
|
|
701
|
+
children: [/* @__PURE__ */ H("header", {
|
|
698
702
|
className: l("flex min-w-0 items-center gap-2 px-4 py-3 desktop:px-8", $.header),
|
|
699
703
|
children: [
|
|
700
|
-
/* @__PURE__ */
|
|
701
|
-
icon: /* @__PURE__ */
|
|
704
|
+
/* @__PURE__ */ V(C, {
|
|
705
|
+
icon: /* @__PURE__ */ V(fe, {
|
|
702
706
|
size: g.LG,
|
|
703
707
|
className: "rtl:scale-x-[-1]",
|
|
704
708
|
"aria-hidden": !0,
|
|
705
709
|
stroke: _
|
|
706
710
|
}),
|
|
707
|
-
"aria-label":
|
|
711
|
+
"aria-label": E.backLabel,
|
|
708
712
|
onClick: d
|
|
709
713
|
}),
|
|
710
|
-
/* @__PURE__ */
|
|
711
|
-
className: l("min-w-0 flex-1",
|
|
712
|
-
children: /* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ V("h1", {
|
|
715
|
+
className: l("min-w-0 flex-1", ce, $.title),
|
|
716
|
+
children: /* @__PURE__ */ V(y, { text: e.name })
|
|
713
717
|
}),
|
|
714
|
-
/* @__PURE__ */
|
|
715
|
-
icon: o ? /* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ V(C, {
|
|
719
|
+
icon: o ? /* @__PURE__ */ V(j, {
|
|
716
720
|
size: g.MD,
|
|
717
721
|
"aria-hidden": !0
|
|
718
|
-
}) : /* @__PURE__ */
|
|
722
|
+
}) : /* @__PURE__ */ V(A, {
|
|
719
723
|
size: g.MD,
|
|
720
724
|
"aria-hidden": !0,
|
|
721
725
|
stroke: _
|
|
722
726
|
}),
|
|
723
|
-
"aria-label":
|
|
727
|
+
"aria-label": E.pinLabel,
|
|
724
728
|
"aria-pressed": o,
|
|
725
729
|
"aria-disabled": s || void 0,
|
|
726
730
|
onClick: () => {
|
|
727
731
|
s || f();
|
|
728
732
|
}
|
|
729
733
|
}),
|
|
730
|
-
p && /* @__PURE__ */
|
|
731
|
-
label:
|
|
734
|
+
p && /* @__PURE__ */ V(se, {
|
|
735
|
+
label: E.publishLabel,
|
|
732
736
|
onClick: p,
|
|
733
737
|
className: "hidden shrink-0 desktop:inline-flex"
|
|
734
738
|
}),
|
|
735
|
-
h && /* @__PURE__ */
|
|
736
|
-
label:
|
|
739
|
+
h && /* @__PURE__ */ V(te, {
|
|
740
|
+
label: E.editLabel,
|
|
737
741
|
variant: m.Primary,
|
|
738
742
|
onClick: h,
|
|
739
743
|
className: "hidden shrink-0 desktop:inline-flex"
|
|
@@ -741,76 +745,75 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
741
745
|
U(!1, "hidden desktop:block"),
|
|
742
746
|
U(!0, "desktop:hidden")
|
|
743
747
|
]
|
|
744
|
-
}), /* @__PURE__ */
|
|
748
|
+
}), /* @__PURE__ */ V("div", {
|
|
745
749
|
className: "flex min-w-0 flex-1 flex-col desktop:flex-row desktop:justify-end",
|
|
746
|
-
children: /* @__PURE__ */
|
|
747
|
-
"aria-labelledby":
|
|
750
|
+
children: /* @__PURE__ */ H("aside", {
|
|
751
|
+
"aria-labelledby": ge,
|
|
748
752
|
className: l("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),
|
|
749
753
|
children: [
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
id:
|
|
752
|
-
className: l(
|
|
753
|
-
children:
|
|
754
|
+
/* @__PURE__ */ V("h2", {
|
|
755
|
+
id: ge,
|
|
756
|
+
className: l(de, $.title),
|
|
757
|
+
children: E.detailsLabel
|
|
754
758
|
}),
|
|
755
|
-
e.description !== "" && /* @__PURE__ */
|
|
759
|
+
e.description !== "" && /* @__PURE__ */ H("section", {
|
|
756
760
|
className: "flex min-w-0 flex-col gap-1",
|
|
757
|
-
children: [/* @__PURE__ */
|
|
758
|
-
className: l(
|
|
759
|
-
children:
|
|
760
|
-
}), /* @__PURE__ */
|
|
761
|
+
children: [/* @__PURE__ */ V("h3", {
|
|
762
|
+
className: l(k, $.secondary),
|
|
763
|
+
children: E.descriptionLabel
|
|
764
|
+
}), /* @__PURE__ */ V("p", {
|
|
761
765
|
className: l("break-words whitespace-pre-line", M, $.body),
|
|
762
766
|
children: e.description
|
|
763
767
|
})]
|
|
764
768
|
}),
|
|
765
|
-
e.instructions !== "" && /* @__PURE__ */
|
|
769
|
+
e.instructions !== "" && /* @__PURE__ */ H("section", {
|
|
766
770
|
className: "flex min-w-0 flex-col gap-1",
|
|
767
|
-
children: [/* @__PURE__ */
|
|
768
|
-
className: l(
|
|
769
|
-
children:
|
|
770
|
-
}), /* @__PURE__ */
|
|
771
|
+
children: [/* @__PURE__ */ V("h3", {
|
|
772
|
+
className: l(k, $.secondary),
|
|
773
|
+
children: E.instructionsLabel
|
|
774
|
+
}), /* @__PURE__ */ V("div", {
|
|
771
775
|
className: l("min-w-0 break-words", M, $.body),
|
|
772
|
-
children: /* @__PURE__ */
|
|
776
|
+
children: /* @__PURE__ */ V(n, {
|
|
773
777
|
content: e.instructions,
|
|
774
|
-
classNames:
|
|
778
|
+
classNames: _e
|
|
775
779
|
})
|
|
776
780
|
})]
|
|
777
781
|
}),
|
|
778
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ H("section", {
|
|
779
783
|
className: "flex min-w-0 flex-col gap-2",
|
|
780
|
-
children: [/* @__PURE__ */
|
|
781
|
-
className: l(
|
|
782
|
-
children:
|
|
783
|
-
}),
|
|
784
|
-
/* @__PURE__ */
|
|
784
|
+
children: [/* @__PURE__ */ V("h3", {
|
|
785
|
+
className: l(k, $.secondary),
|
|
786
|
+
children: E.contextLabel
|
|
787
|
+
}), I.length === 0 ? /* @__PURE__ */ V(i, { label: E.emptyContextLabel }) : /* @__PURE__ */ H(me, { children: [
|
|
788
|
+
/* @__PURE__ */ V("div", {
|
|
785
789
|
role: "search",
|
|
786
|
-
children: /* @__PURE__ */
|
|
790
|
+
children: /* @__PURE__ */ V(le, {
|
|
787
791
|
value: c,
|
|
788
792
|
onChange: (e) => u(e ?? ""),
|
|
789
|
-
placeholder:
|
|
790
|
-
clearLabel:
|
|
791
|
-
"aria-label":
|
|
793
|
+
placeholder: E.contextSearchPlaceholder,
|
|
794
|
+
clearLabel: E.clearSearchLabel,
|
|
795
|
+
"aria-label": E.contextSearchAriaLabel
|
|
792
796
|
})
|
|
793
797
|
}),
|
|
794
|
-
|
|
795
|
-
className: l(
|
|
796
|
-
children:
|
|
797
|
-
}) : /* @__PURE__ */
|
|
798
|
+
z.length === 0 ? /* @__PURE__ */ V("p", {
|
|
799
|
+
className: l(N, $.secondary),
|
|
800
|
+
children: E.noContextMatchesLabel
|
|
801
|
+
}) : /* @__PURE__ */ V("ul", {
|
|
798
802
|
className: "m-0 flex min-w-0 list-none flex-wrap gap-2 p-0 pt-2",
|
|
799
|
-
children:
|
|
803
|
+
children: z.map((e) => /* @__PURE__ */ V("li", {
|
|
800
804
|
className: "min-w-0",
|
|
801
|
-
children: /* @__PURE__ */
|
|
802
|
-
attachment:
|
|
803
|
-
searchQuery:
|
|
805
|
+
children: /* @__PURE__ */ V(he, {
|
|
806
|
+
attachment: Qe(e),
|
|
807
|
+
searchQuery: B,
|
|
804
808
|
onClick: x,
|
|
805
|
-
labels: { clickLabel:
|
|
809
|
+
labels: { clickLabel: E.openFileLabel(e.name) }
|
|
806
810
|
})
|
|
807
811
|
}, e.name))
|
|
808
812
|
}),
|
|
809
|
-
/* @__PURE__ */
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
children: V === "" ? "" : T.contextResultCountLabel(B.length)
|
|
813
|
+
/* @__PURE__ */ V(ie, {
|
|
814
|
+
visuallyHidden: !0,
|
|
815
|
+
as: ae.Span,
|
|
816
|
+
children: B === "" ? "" : E.contextResultCountLabel(z.length)
|
|
814
817
|
})
|
|
815
818
|
] })]
|
|
816
819
|
})
|
|
@@ -820,4 +823,4 @@ var H = /* @__PURE__ */ function(e) {
|
|
|
820
823
|
});
|
|
821
824
|
});
|
|
822
825
|
//#endregion
|
|
823
|
-
export { Y as ContextFileRejection,
|
|
826
|
+
export { Y as ContextFileRejection, Ae as PROJECT_NAME_MAX_BYTES, Ze as ProjectCreateForm, X as ProjectNameError, De as ProjectSource, $e as ProjectView, J as Projects, U as ProjectsSortKey, He as checkContextFiles, We as filterContextFileItems, Re as getContextFilesSize, Le as isStoredContextFile, Fe as validateProjectName };
|