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