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