@epam/ai-dial-projects 1.3.0-dev.256 → 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 -445
- package/models/projects-props.d.ts +6 -2
- package/models/projects-props.d.ts.map +1 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,267 +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
|
-
"--pr-card-focus-outline":
|
|
114
|
-
}),
|
|
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), [
|
|
115
131
|
e,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
]),
|
|
132
|
+
u,
|
|
133
|
+
m,
|
|
134
|
+
w
|
|
135
|
+
]), de = S.sortOptions.find((e) => e.value === m)?.label ?? S.sortLabel, pe = U(() => S.sortOptions.map((e) => ({
|
|
120
136
|
key: e.value,
|
|
121
137
|
label: e.label,
|
|
122
|
-
mark:
|
|
123
|
-
checked: e.value ===
|
|
124
|
-
onClick: () =>
|
|
138
|
+
mark: F.Check,
|
|
139
|
+
checked: e.value === m,
|
|
140
|
+
onClick: () => y(e.value)
|
|
125
141
|
})), [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
]),
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
if (!t) return n ?
|
|
133
|
-
},
|
|
134
|
-
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,
|
|
135
151
|
variant: e,
|
|
136
152
|
onClick: a,
|
|
137
153
|
className: d("shrink-0", t)
|
|
138
|
-
}) : void 0,
|
|
154
|
+
}) : void 0, me = () => t ? /* @__PURE__ */ K(oe, {}) : n || ue ? /* @__PURE__ */ q("div", {
|
|
139
155
|
className: "flex flex-col items-center gap-3",
|
|
140
156
|
children: [/* @__PURE__ */ K("p", {
|
|
141
|
-
className: d(
|
|
142
|
-
children: n ?
|
|
143
|
-
}), /* @__PURE__ */ K(
|
|
144
|
-
label:
|
|
157
|
+
className: d(A, Oe.subtitle),
|
|
158
|
+
children: n ? S.errorLabel : S.incompleteLabel
|
|
159
|
+
}), /* @__PURE__ */ K(O, {
|
|
160
|
+
label: S.retryLabel,
|
|
145
161
|
onClick: i
|
|
146
162
|
})]
|
|
147
163
|
}) : e.length === 0 ? /* @__PURE__ */ K(o, {
|
|
148
|
-
label:
|
|
149
|
-
description:
|
|
150
|
-
action:
|
|
151
|
-
containerClassName:
|
|
164
|
+
label: S.emptyStateLabel,
|
|
165
|
+
description: S.emptyStateDescription,
|
|
166
|
+
action: V(v.Secondary, "mt-2"),
|
|
167
|
+
containerClassName: W,
|
|
152
168
|
labelClassName: "mt-3",
|
|
153
169
|
descriptionClassName: re
|
|
154
|
-
}) :
|
|
155
|
-
label:
|
|
156
|
-
containerClassName:
|
|
170
|
+
}) : R.length === 0 ? /* @__PURE__ */ K(o, {
|
|
171
|
+
label: S.noResultsLabel,
|
|
172
|
+
containerClassName: W,
|
|
157
173
|
labelClassName: "mt-3"
|
|
158
174
|
}) : /* @__PURE__ */ K("ul", {
|
|
159
|
-
className: "m-0 grid w-full min-w-0 list-none grid-cols-1 gap-
|
|
160
|
-
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, {
|
|
161
177
|
project: e,
|
|
162
|
-
searchQuery:
|
|
163
|
-
sourceLabel:
|
|
164
|
-
folderPathLabel:
|
|
165
|
-
pinnedLabel:
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
|
174
192
|
}, e.id))
|
|
175
|
-
}),
|
|
193
|
+
}), H = t || n || ue, W = "mt-6 p-3 desktop:mt-0";
|
|
176
194
|
return /* @__PURE__ */ q("div", {
|
|
177
|
-
style:
|
|
178
|
-
className: d("flex h-full w-full min-w-0 flex-col
|
|
179
|
-
children: [
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
className: "
|
|
184
|
-
children:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
className:
|
|
189
|
-
children:
|
|
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
|
-
}),
|
|
229
|
-
/* @__PURE__ */ q("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: [I && !t && !n && !R && /* @__PURE__ */ q("div", {
|
|
232
|
-
className: "flex w-full max-w-[1116px] flex-wrap items-center gap-3",
|
|
233
|
-
children: [/* @__PURE__ */ K("p", {
|
|
234
|
-
className: d(O, Z.subtitle),
|
|
235
|
-
children: v.incompleteLabel
|
|
236
|
-
}), /* @__PURE__ */ K(D, {
|
|
237
|
-
label: v.retryLabel,
|
|
238
|
-
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
|
+
})
|
|
239
246
|
})]
|
|
240
|
-
}),
|
|
241
|
-
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ K(te, {
|
|
249
|
+
visuallyHidden: !0,
|
|
250
|
+
as: N.Span,
|
|
242
251
|
children: B()
|
|
243
|
-
})
|
|
244
|
-
|
|
245
|
-
|
|
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
|
+
})]
|
|
246
281
|
});
|
|
247
|
-
},
|
|
282
|
+
}, Ae = /* @__PURE__ */ function(e) {
|
|
248
283
|
return e.Personal = "personal", e.Shared = "shared", e.Organization = "organization", e;
|
|
249
|
-
}({}),
|
|
284
|
+
}({}), je = (e) => !!e.dataTransfer?.types.includes("Files"), Me = (e) => {
|
|
250
285
|
let [t, n] = G(!1), r = W(0);
|
|
251
286
|
return {
|
|
252
287
|
isDragActive: t,
|
|
253
288
|
handlers: {
|
|
254
289
|
onDragEnter: V((e) => {
|
|
255
|
-
|
|
290
|
+
je(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
256
291
|
}, []),
|
|
257
292
|
onDragLeave: V((e) => {
|
|
258
|
-
|
|
293
|
+
je(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
259
294
|
}, []),
|
|
260
295
|
onDragOver: V((e) => {
|
|
261
|
-
|
|
296
|
+
je(e) && e.preventDefault();
|
|
262
297
|
}, []),
|
|
263
298
|
onDrop: V((t) => {
|
|
264
|
-
if (!
|
|
299
|
+
if (!je(t)) return;
|
|
265
300
|
t.preventDefault(), r.current = 0, n(!1);
|
|
266
301
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
267
302
|
i.length > 0 && e(i);
|
|
@@ -270,36 +305,36 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
270
305
|
};
|
|
271
306
|
}, Q = /* @__PURE__ */ function(e) {
|
|
272
307
|
return e.UnsupportedType = "unsupported-type", e.TooLarge = "too-large", e.CapacityExceeded = "capacity-exceeded", e.Duplicate = "duplicate", e.InvalidName = "invalid-name", e;
|
|
273
|
-
}({}),
|
|
308
|
+
}({}), Ne = /* @__PURE__ */ function(e) {
|
|
274
309
|
return e.Required = "required", e.InvalidCharacters = "invalid-characters", e.Reserved = "reserved", e.TooLong = "too-long", e;
|
|
275
|
-
}({}),
|
|
310
|
+
}({}), Pe = 255, Fe = new RegExp(a.source, "u"), Ie = /[\p{Cc}--]/u, Le = /* @__PURE__ */ new Set([
|
|
276
311
|
".",
|
|
277
312
|
"..",
|
|
278
313
|
"v",
|
|
279
314
|
"files",
|
|
280
315
|
".dial-resource",
|
|
281
316
|
".dial-folder"
|
|
282
|
-
]),
|
|
317
|
+
]), Re = (e) => new TextEncoder().encode(e).length, ze = (e) => {
|
|
283
318
|
let t = e.trim();
|
|
284
|
-
return t.length === 0 ?
|
|
285
|
-
},
|
|
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) => {
|
|
286
321
|
let t = e.lastIndexOf(".");
|
|
287
322
|
return t > 0 ? e.slice(t + 1).toLowerCase() : "";
|
|
288
|
-
},
|
|
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) => {
|
|
289
324
|
let t = e.type || u(e.name) || "application/octet-stream";
|
|
290
325
|
return {
|
|
291
|
-
id:
|
|
326
|
+
id: Ge(),
|
|
292
327
|
name: e.name,
|
|
293
328
|
contentType: t,
|
|
294
329
|
type: l(t),
|
|
295
330
|
status: s.Idle,
|
|
296
331
|
file: e
|
|
297
332
|
};
|
|
298
|
-
},
|
|
299
|
-
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 = [];
|
|
300
335
|
for (let t of e) {
|
|
301
|
-
let e =
|
|
302
|
-
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({
|
|
303
338
|
name: t.name,
|
|
304
339
|
reason: e
|
|
305
340
|
});
|
|
@@ -308,37 +343,37 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
308
343
|
accepted: a,
|
|
309
344
|
rejected: o
|
|
310
345
|
};
|
|
311
|
-
},
|
|
346
|
+
}, Ye = (e, t) => e <= 0 ? 0 : t <= 0 ? 100 : Math.min(100, Math.max(1, Math.round(e / t * 100))), Xe = (e, t) => {
|
|
312
347
|
let n = t.trim().toLowerCase();
|
|
313
348
|
return n === "" ? e : e.filter((e) => e.name.toLowerCase().includes(n));
|
|
314
|
-
},
|
|
349
|
+
}, Ze = {
|
|
315
350
|
track: "_track_1eyt2_1",
|
|
316
351
|
text: "_text_1eyt2_11"
|
|
317
|
-
},
|
|
352
|
+
}, Qe = ({ usedBytes: e, maxBytes: t, ariaLabel: n, formatLabel: r, textClassName: i = "dial-tiny-text" }) => {
|
|
318
353
|
if (e <= 0) return null;
|
|
319
|
-
let a = r(
|
|
354
|
+
let a = r(Ye(e, t));
|
|
320
355
|
return /* @__PURE__ */ q("div", {
|
|
321
356
|
className: "flex min-w-0 items-center gap-2",
|
|
322
|
-
children: [/* @__PURE__ */ K(
|
|
323
|
-
role:
|
|
357
|
+
children: [/* @__PURE__ */ K(I, {
|
|
358
|
+
role: L.Meter,
|
|
324
359
|
value: e,
|
|
325
360
|
max: t,
|
|
326
|
-
size:
|
|
361
|
+
size: C.Small,
|
|
327
362
|
"aria-label": n,
|
|
328
363
|
"aria-valuetext": a,
|
|
329
|
-
className: d("w-[60px] shrink-0",
|
|
364
|
+
className: d("w-[60px] shrink-0", Ze.track)
|
|
330
365
|
}), /* @__PURE__ */ K("span", {
|
|
331
366
|
"aria-hidden": !0,
|
|
332
|
-
className: d("whitespace-nowrap", i,
|
|
367
|
+
className: d("whitespace-nowrap", i, Ze.text),
|
|
333
368
|
children: a
|
|
334
369
|
})]
|
|
335
370
|
});
|
|
336
|
-
},
|
|
371
|
+
}, $e = {
|
|
337
372
|
formColumn: "_formColumn_1fxsc_1",
|
|
338
373
|
helper: "_helper_1fxsc_10",
|
|
339
374
|
label: "_label_1fxsc_14"
|
|
340
|
-
},
|
|
341
|
-
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) => {
|
|
342
377
|
if (J.current && !J.current.aborted) throw new DOMException("Busy", "AbortError");
|
|
343
378
|
J.current = n;
|
|
344
379
|
try {
|
|
@@ -346,66 +381,66 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
346
381
|
} finally {
|
|
347
382
|
J.current === n && (J.current = void 0);
|
|
348
383
|
}
|
|
349
|
-
} : void 0, []),
|
|
384
|
+
} : void 0, []), ye = U(() => Y(h), [Y, h]), be = U(() => Y(g), [Y, g]), xe = m({
|
|
350
385
|
value: e.description,
|
|
351
386
|
onChange: (e) => i("description", e),
|
|
352
|
-
onRefine:
|
|
387
|
+
onRefine: ye,
|
|
353
388
|
disabled: D
|
|
354
|
-
}), Se =
|
|
389
|
+
}), Se = m({
|
|
355
390
|
value: e.instructions,
|
|
356
391
|
onChange: (e) => i("instructions", e),
|
|
357
|
-
onRefine:
|
|
392
|
+
onRefine: be,
|
|
358
393
|
disabled: D
|
|
359
|
-
}),
|
|
360
|
-
|
|
361
|
-
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();
|
|
362
397
|
}, [t.name]);
|
|
363
|
-
let
|
|
398
|
+
let Te = U(() => Ue(a), [a]), Ee = U(() => s.map((e) => `.${e}`).join(","), [s]), De = (e) => {
|
|
364
399
|
if (e.length === 0) return;
|
|
365
|
-
let { accepted: t, rejected: n } =
|
|
400
|
+
let { accepted: t, rejected: n } = Je(e, a, {
|
|
366
401
|
allowedExtensions: s,
|
|
367
402
|
maxFileBytes: l,
|
|
368
403
|
maxTotalBytes: u
|
|
369
404
|
});
|
|
370
|
-
|
|
371
|
-
}, { 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) => {
|
|
372
407
|
let t = a.find((t) => t.id === e);
|
|
373
|
-
o(a.filter((t) => t.id !== e)),
|
|
408
|
+
o(a.filter((t) => t.id !== e)), z([]), t && he(O.fileRemovedStatus(t.name));
|
|
374
409
|
}, je = (e) => {
|
|
375
410
|
De(Array.from(e.target.files ?? [])), e.target.value = "";
|
|
376
|
-
},
|
|
377
|
-
if (
|
|
378
|
-
let e = await
|
|
411
|
+
}, Q = async () => {
|
|
412
|
+
if (p) try {
|
|
413
|
+
let e = await p();
|
|
379
414
|
e && De(e);
|
|
380
415
|
} catch {}
|
|
381
416
|
}, Ne = [{
|
|
382
|
-
key:
|
|
417
|
+
key: tt,
|
|
383
418
|
label: O.addFromDeviceLabel,
|
|
384
|
-
onClick: () =>
|
|
385
|
-
}, ...
|
|
386
|
-
key:
|
|
419
|
+
onClick: () => le.current?.click()
|
|
420
|
+
}, ...p ? [{
|
|
421
|
+
key: nt,
|
|
387
422
|
label: O.addFromFileManagerLabel,
|
|
388
|
-
onClick: () => void
|
|
423
|
+
onClick: () => void Q()
|
|
389
424
|
}] : []], Pe = () => {
|
|
390
|
-
!
|
|
391
|
-
}, { 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({
|
|
392
427
|
"--pcf-helper-text": Fe?.helperText,
|
|
393
428
|
"--pcf-label-text": Fe?.labelText,
|
|
394
429
|
"--pcf-meter-track": Fe?.meterTrack,
|
|
395
430
|
"--pcf-meter-fill": Fe?.meterFill
|
|
396
|
-
}),
|
|
431
|
+
}), He = O.refinement, We = t.context, Ge = !!We;
|
|
397
432
|
return /* @__PURE__ */ q("div", {
|
|
398
|
-
className: d("relative flex h-full min-h-0 w-full",
|
|
433
|
+
className: d("relative flex h-full min-h-0 w-full", A),
|
|
399
434
|
...ke,
|
|
400
435
|
children: [
|
|
401
|
-
/* @__PURE__ */ K(
|
|
436
|
+
/* @__PURE__ */ K(_e, {
|
|
402
437
|
isVisible: Oe,
|
|
403
438
|
labels: {
|
|
404
439
|
title: O.dropOverlayTitle,
|
|
405
440
|
subtitle: O.dropOverlaySubtitle
|
|
406
441
|
}
|
|
407
442
|
}),
|
|
408
|
-
/* @__PURE__ */ K(
|
|
443
|
+
/* @__PURE__ */ K(ve, {
|
|
409
444
|
labels: {
|
|
410
445
|
title: O.title,
|
|
411
446
|
backButtonLabel: O.backLabel,
|
|
@@ -413,15 +448,15 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
413
448
|
submitButtonLabel: O.createLabel,
|
|
414
449
|
submittingLabel: O.submittingLabel ?? O.createLabel
|
|
415
450
|
},
|
|
416
|
-
onBack:
|
|
417
|
-
onCancel:
|
|
451
|
+
onBack: y,
|
|
452
|
+
onCancel: S,
|
|
418
453
|
onSubmit: Pe,
|
|
419
454
|
isCancelDisabled: D,
|
|
420
|
-
isSubmitDisabled:
|
|
455
|
+
isSubmitDisabled: Z,
|
|
421
456
|
isSubmitting: D,
|
|
422
|
-
backIcon: /* @__PURE__ */ K(
|
|
423
|
-
size:
|
|
424
|
-
stroke:
|
|
457
|
+
backIcon: /* @__PURE__ */ K(ce, {
|
|
458
|
+
size: b.LG,
|
|
459
|
+
stroke: x,
|
|
425
460
|
"aria-hidden": !0,
|
|
426
461
|
className: "rtl:scale-x-[-1]"
|
|
427
462
|
}),
|
|
@@ -429,19 +464,19 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
429
464
|
colors: { background: Fe?.background },
|
|
430
465
|
header: {
|
|
431
466
|
colors: { borderColor: Fe?.headerBorder },
|
|
432
|
-
typography: { fontClassName:
|
|
467
|
+
typography: { fontClassName: Le }
|
|
433
468
|
},
|
|
434
|
-
cssVars:
|
|
469
|
+
cssVars: Ve
|
|
435
470
|
},
|
|
436
471
|
children: /* @__PURE__ */ q("div", {
|
|
437
|
-
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),
|
|
438
473
|
children: [
|
|
439
474
|
/* @__PURE__ */ q("div", {
|
|
440
475
|
className: "flex flex-col gap-1",
|
|
441
476
|
children: [
|
|
442
|
-
/* @__PURE__ */ K(
|
|
443
|
-
id:
|
|
444
|
-
inputRef:
|
|
477
|
+
/* @__PURE__ */ K(j, {
|
|
478
|
+
id: ne,
|
|
479
|
+
inputRef: ae,
|
|
445
480
|
value: e.name,
|
|
446
481
|
onChange: (e) => i("name", e ?? ""),
|
|
447
482
|
onBlur: () => de(!0),
|
|
@@ -454,16 +489,16 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
454
489
|
"aria-required": !0,
|
|
455
490
|
invalid: !!we,
|
|
456
491
|
"aria-invalid": !!we,
|
|
457
|
-
"aria-describedby": we ?
|
|
492
|
+
"aria-describedby": we ? re : void 0
|
|
458
493
|
}),
|
|
459
|
-
/* @__PURE__ */ K(
|
|
460
|
-
announce:
|
|
461
|
-
id:
|
|
494
|
+
/* @__PURE__ */ K(T, {
|
|
495
|
+
announce: P.Assertive,
|
|
496
|
+
id: re,
|
|
462
497
|
className: Be,
|
|
463
498
|
text: t.name ?? ""
|
|
464
499
|
}),
|
|
465
|
-
we && !t.name && /* @__PURE__ */ K(
|
|
466
|
-
id:
|
|
500
|
+
we && !t.name && /* @__PURE__ */ K(T, {
|
|
501
|
+
id: re,
|
|
467
502
|
className: Be,
|
|
468
503
|
text: we
|
|
469
504
|
})
|
|
@@ -471,42 +506,42 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
471
506
|
}),
|
|
472
507
|
/* @__PURE__ */ K(c, {
|
|
473
508
|
isEnabled: !!h,
|
|
474
|
-
fieldId:
|
|
509
|
+
fieldId: ie,
|
|
475
510
|
label: O.descriptionLabel,
|
|
476
|
-
labelClassName:
|
|
477
|
-
labels:
|
|
478
|
-
refinement:
|
|
479
|
-
disabled: D ||
|
|
480
|
-
children: /* @__PURE__ */ K(
|
|
481
|
-
id:
|
|
511
|
+
labelClassName: Re,
|
|
512
|
+
labels: He,
|
|
513
|
+
refinement: xe,
|
|
514
|
+
disabled: D || X,
|
|
515
|
+
children: /* @__PURE__ */ K(se, {
|
|
516
|
+
id: ie,
|
|
482
517
|
value: e.description,
|
|
483
518
|
onChange: (e) => {
|
|
484
|
-
|
|
519
|
+
xe.reset(), i("description", e);
|
|
485
520
|
},
|
|
486
521
|
placeholder: O.descriptionPlaceholder,
|
|
487
522
|
labelProps: h ? void 0 : { label: O.descriptionLabel }
|
|
488
523
|
})
|
|
489
524
|
}),
|
|
490
525
|
/* @__PURE__ */ K(c, {
|
|
491
|
-
isEnabled: !!
|
|
526
|
+
isEnabled: !!g,
|
|
492
527
|
fieldId: I,
|
|
493
528
|
label: O.instructionsLabel,
|
|
494
|
-
labelClassName:
|
|
495
|
-
labels:
|
|
529
|
+
labelClassName: Re,
|
|
530
|
+
labels: He,
|
|
496
531
|
refinement: Se,
|
|
497
|
-
disabled: D ||
|
|
532
|
+
disabled: D || X,
|
|
498
533
|
children: /* @__PURE__ */ q("div", {
|
|
499
534
|
className: "flex flex-1 flex-col gap-2",
|
|
500
|
-
children: [!
|
|
535
|
+
children: [!g && /* @__PURE__ */ K(M, {
|
|
501
536
|
htmlFor: I,
|
|
502
|
-
className:
|
|
537
|
+
className: Re,
|
|
503
538
|
label: O.instructionsLabel
|
|
504
539
|
}), /* @__PURE__ */ K("div", {
|
|
505
|
-
ref:
|
|
540
|
+
ref: ue,
|
|
506
541
|
className: d("w-full", n, r),
|
|
507
|
-
children: /* @__PURE__ */ K(
|
|
508
|
-
fallback: /* @__PURE__ */ K(
|
|
509
|
-
children: /* @__PURE__ */ K(
|
|
542
|
+
children: /* @__PURE__ */ K(pe, {
|
|
543
|
+
fallback: /* @__PURE__ */ K(oe, {}),
|
|
544
|
+
children: /* @__PURE__ */ K(et, {
|
|
510
545
|
id: I,
|
|
511
546
|
value: e.instructions,
|
|
512
547
|
onChange: (e) => {
|
|
@@ -528,52 +563,52 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
528
563
|
className: "flex min-w-0 flex-wrap items-center justify-between gap-2",
|
|
529
564
|
children: [/* @__PURE__ */ K("h2", {
|
|
530
565
|
id: L,
|
|
531
|
-
className:
|
|
566
|
+
className: Re,
|
|
532
567
|
children: O.contextLabel
|
|
533
568
|
}), /* @__PURE__ */ q("div", {
|
|
534
569
|
className: "flex min-w-0 items-center gap-4",
|
|
535
|
-
children: [/* @__PURE__ */ K(
|
|
536
|
-
usedBytes:
|
|
570
|
+
children: [/* @__PURE__ */ K(Qe, {
|
|
571
|
+
usedBytes: Te,
|
|
537
572
|
maxBytes: u,
|
|
538
573
|
ariaLabel: O.capacityMeterLabel,
|
|
539
574
|
formatLabel: O.capacityLabel,
|
|
540
575
|
textClassName: Be
|
|
541
|
-
}), /* @__PURE__ */ K(
|
|
576
|
+
}), /* @__PURE__ */ K(_, {
|
|
542
577
|
items: Ne,
|
|
543
578
|
label: O.addLabel,
|
|
544
|
-
variant:
|
|
545
|
-
size:
|
|
579
|
+
variant: v.Neutral,
|
|
580
|
+
size: C.Small,
|
|
546
581
|
disabled: D
|
|
547
582
|
})]
|
|
548
583
|
})]
|
|
549
584
|
}),
|
|
550
585
|
/* @__PURE__ */ K("input", {
|
|
551
|
-
ref:
|
|
586
|
+
ref: le,
|
|
552
587
|
type: "file",
|
|
553
588
|
multiple: !0,
|
|
554
|
-
accept:
|
|
589
|
+
accept: Ee,
|
|
555
590
|
tabIndex: -1,
|
|
556
591
|
"aria-hidden": !0,
|
|
557
592
|
className: "sr-only",
|
|
558
593
|
onChange: je
|
|
559
594
|
}),
|
|
560
|
-
/* @__PURE__ */ K(
|
|
595
|
+
/* @__PURE__ */ K(E, {
|
|
561
596
|
label: O.dropZoneLabel,
|
|
562
597
|
description: O.dropZoneHint,
|
|
563
|
-
accept:
|
|
598
|
+
accept: Ee,
|
|
564
599
|
multiple: !0,
|
|
565
600
|
disabled: D,
|
|
566
601
|
onChange: De,
|
|
567
602
|
onReject: De
|
|
568
603
|
}),
|
|
569
|
-
|
|
570
|
-
className: d("flex flex-col gap-1", Be,
|
|
571
|
-
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}`))
|
|
572
607
|
}),
|
|
573
|
-
/* @__PURE__ */ K(
|
|
574
|
-
politeness:
|
|
608
|
+
/* @__PURE__ */ K(te, {
|
|
609
|
+
politeness: P.Assertive,
|
|
575
610
|
children: Ge && /* @__PURE__ */ K("p", {
|
|
576
|
-
className: d(Be,
|
|
611
|
+
className: d(Be, $e.helper),
|
|
577
612
|
children: We
|
|
578
613
|
})
|
|
579
614
|
}),
|
|
@@ -581,9 +616,9 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
581
616
|
className: "flex min-w-0 flex-wrap gap-2 pt-1",
|
|
582
617
|
children: a.map((e) => /* @__PURE__ */ K("li", {
|
|
583
618
|
className: "min-w-0",
|
|
584
|
-
children: /* @__PURE__ */ K(
|
|
619
|
+
children: /* @__PURE__ */ K(ge, {
|
|
585
620
|
attachment: e,
|
|
586
|
-
onRemove:
|
|
621
|
+
onRemove: Ae,
|
|
587
622
|
labels: { removeLabel: O.removeFileLabel(e.name) }
|
|
588
623
|
})
|
|
589
624
|
}, e.id))
|
|
@@ -593,10 +628,10 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
593
628
|
]
|
|
594
629
|
})
|
|
595
630
|
}),
|
|
596
|
-
/* @__PURE__ */ K(
|
|
631
|
+
/* @__PURE__ */ K(te, {
|
|
597
632
|
visuallyHidden: !0,
|
|
598
|
-
as:
|
|
599
|
-
children: D ? O.creatingStatus :
|
|
633
|
+
as: N.Span,
|
|
634
|
+
children: D ? O.creatingStatus : B
|
|
600
635
|
})
|
|
601
636
|
]
|
|
602
637
|
});
|
|
@@ -607,21 +642,21 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
607
642
|
body: "_body_16lvl_13",
|
|
608
643
|
secondary: "_secondary_16lvl_17",
|
|
609
644
|
panel: "_panel_16lvl_21"
|
|
610
|
-
},
|
|
645
|
+
}, it = (e) => ({
|
|
611
646
|
id: e.name,
|
|
612
647
|
name: e.name,
|
|
613
648
|
contentType: e.contentType,
|
|
614
649
|
type: l(e.contentType),
|
|
615
650
|
status: s.Idle
|
|
616
|
-
}),
|
|
617
|
-
let { colors:
|
|
618
|
-
"--pv-bg":
|
|
619
|
-
"--pv-border":
|
|
620
|
-
"--pv-heading-text":
|
|
621
|
-
"--pv-body-text":
|
|
622
|
-
"--pv-secondary-text":
|
|
623
|
-
}),
|
|
624
|
-
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);
|
|
625
660
|
return {
|
|
626
661
|
h1: e,
|
|
627
662
|
h2: e,
|
|
@@ -629,145 +664,145 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
629
664
|
h4: e,
|
|
630
665
|
h5: e,
|
|
631
666
|
h6: e,
|
|
632
|
-
p:
|
|
633
|
-
ul:
|
|
634
|
-
ol:
|
|
667
|
+
p: L,
|
|
668
|
+
ul: L,
|
|
669
|
+
ol: L
|
|
635
670
|
};
|
|
636
|
-
}, [
|
|
671
|
+
}, [L, le]), W = (e) => {
|
|
637
672
|
let t = [];
|
|
638
673
|
return e && p && t.push({
|
|
639
674
|
key: "publish",
|
|
640
|
-
label:
|
|
675
|
+
label: j.publishLabel,
|
|
641
676
|
onClick: p
|
|
642
|
-
}), e &&
|
|
677
|
+
}), e && m && t.push({
|
|
643
678
|
key: "edit",
|
|
644
|
-
label:
|
|
645
|
-
onClick:
|
|
679
|
+
label: j.editLabel,
|
|
680
|
+
onClick: m
|
|
646
681
|
}), g && t.push({
|
|
647
682
|
key: "share",
|
|
648
|
-
label:
|
|
683
|
+
label: j.shareLabel,
|
|
649
684
|
onClick: g
|
|
650
685
|
}), t.push({
|
|
651
686
|
key: "download",
|
|
652
|
-
label:
|
|
653
|
-
onClick:
|
|
654
|
-
}),
|
|
687
|
+
label: j.downloadLabel,
|
|
688
|
+
onClick: y
|
|
689
|
+
}), _ && t.push({
|
|
655
690
|
key: "delete",
|
|
656
|
-
label:
|
|
691
|
+
label: j.deleteLabel,
|
|
657
692
|
danger: !0,
|
|
658
|
-
onClick:
|
|
693
|
+
onClick: _
|
|
659
694
|
}), t;
|
|
660
|
-
},
|
|
695
|
+
}, G = (e, t) => /* @__PURE__ */ K("div", {
|
|
661
696
|
className: t,
|
|
662
|
-
children: /* @__PURE__ */ K(
|
|
663
|
-
items:
|
|
697
|
+
children: /* @__PURE__ */ K(S, {
|
|
698
|
+
items: W(e),
|
|
664
699
|
matchReferenceWidth: !1,
|
|
665
700
|
listClassName: "w-[200px]",
|
|
666
|
-
children: /* @__PURE__ */ K(
|
|
667
|
-
icon: /* @__PURE__ */ K(
|
|
668
|
-
size:
|
|
701
|
+
children: /* @__PURE__ */ K(k, {
|
|
702
|
+
icon: /* @__PURE__ */ K(ue, {
|
|
703
|
+
size: b.MD,
|
|
669
704
|
"aria-hidden": !0,
|
|
670
|
-
stroke:
|
|
705
|
+
stroke: x
|
|
671
706
|
}),
|
|
672
|
-
"aria-label":
|
|
707
|
+
"aria-label": j.moreActionsLabel
|
|
673
708
|
})
|
|
674
709
|
})
|
|
675
710
|
});
|
|
676
711
|
return t || n || r || e == null ? /* @__PURE__ */ K("div", {
|
|
677
|
-
style:
|
|
712
|
+
style: fe,
|
|
678
713
|
className: d("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
|
|
679
|
-
children: t ? /* @__PURE__ */ K(
|
|
714
|
+
children: t ? /* @__PURE__ */ K(oe, {}) : n ? /* @__PURE__ */ q("div", {
|
|
680
715
|
className: "flex flex-col items-center gap-3",
|
|
681
716
|
children: [/* @__PURE__ */ K("p", {
|
|
682
717
|
role: "status",
|
|
683
|
-
className: d(
|
|
684
|
-
children:
|
|
685
|
-
}), /* @__PURE__ */ K(
|
|
686
|
-
label:
|
|
718
|
+
className: d(L, $.body),
|
|
719
|
+
children: j.errorLabel
|
|
720
|
+
}), /* @__PURE__ */ K(O, {
|
|
721
|
+
label: j.retryLabel,
|
|
687
722
|
onClick: T
|
|
688
723
|
})]
|
|
689
724
|
}) : /* @__PURE__ */ q("div", {
|
|
690
725
|
className: "flex flex-col items-center gap-3",
|
|
691
726
|
children: [/* @__PURE__ */ K("p", {
|
|
692
|
-
className: d(
|
|
693
|
-
children:
|
|
694
|
-
}), /* @__PURE__ */ K(
|
|
695
|
-
label:
|
|
727
|
+
className: d(L, $.body),
|
|
728
|
+
children: j.notFoundLabel
|
|
729
|
+
}), /* @__PURE__ */ K(O, {
|
|
730
|
+
label: j.browseProjectsLabel,
|
|
696
731
|
onClick: E
|
|
697
732
|
})]
|
|
698
733
|
})
|
|
699
734
|
}) : /* @__PURE__ */ q("div", {
|
|
700
|
-
style:
|
|
735
|
+
style: fe,
|
|
701
736
|
className: d("flex h-full w-full min-w-0 flex-col overflow-y-auto", $.container),
|
|
702
737
|
children: [/* @__PURE__ */ q("header", {
|
|
703
738
|
className: d("flex min-w-0 items-center gap-2 px-4 py-3 desktop:px-8", $.header),
|
|
704
739
|
children: [
|
|
705
|
-
/* @__PURE__ */ K(
|
|
706
|
-
icon: /* @__PURE__ */ K(
|
|
707
|
-
size:
|
|
740
|
+
/* @__PURE__ */ K(k, {
|
|
741
|
+
icon: /* @__PURE__ */ K(ce, {
|
|
742
|
+
size: b.LG,
|
|
708
743
|
className: "rtl:scale-x-[-1]",
|
|
709
744
|
"aria-hidden": !0,
|
|
710
|
-
stroke:
|
|
745
|
+
stroke: x
|
|
711
746
|
}),
|
|
712
|
-
"aria-label":
|
|
747
|
+
"aria-label": j.backLabel,
|
|
713
748
|
onClick: u
|
|
714
749
|
}),
|
|
715
750
|
/* @__PURE__ */ K("h1", {
|
|
716
|
-
className: d("min-w-0 flex-1",
|
|
717
|
-
children: /* @__PURE__ */ K(
|
|
751
|
+
className: d("min-w-0 flex-1", re, $.title),
|
|
752
|
+
children: /* @__PURE__ */ K(w, { text: e.name })
|
|
718
753
|
}),
|
|
719
|
-
/* @__PURE__ */ K(
|
|
720
|
-
icon: a ? /* @__PURE__ */ K(
|
|
721
|
-
size:
|
|
754
|
+
/* @__PURE__ */ K(k, {
|
|
755
|
+
icon: a ? /* @__PURE__ */ K(de, {
|
|
756
|
+
size: b.MD,
|
|
722
757
|
"aria-hidden": !0
|
|
723
|
-
}) : /* @__PURE__ */ K(
|
|
724
|
-
size:
|
|
758
|
+
}) : /* @__PURE__ */ K(R, {
|
|
759
|
+
size: b.MD,
|
|
725
760
|
"aria-hidden": !0,
|
|
726
|
-
stroke:
|
|
761
|
+
stroke: x
|
|
727
762
|
}),
|
|
728
|
-
"aria-label":
|
|
763
|
+
"aria-label": j.pinLabel,
|
|
729
764
|
"aria-pressed": a,
|
|
730
765
|
"aria-disabled": s || void 0,
|
|
731
766
|
onClick: () => {
|
|
732
767
|
s || f();
|
|
733
768
|
}
|
|
734
769
|
}),
|
|
735
|
-
p && /* @__PURE__ */ K(
|
|
736
|
-
label:
|
|
770
|
+
p && /* @__PURE__ */ K(ne, {
|
|
771
|
+
label: j.publishLabel,
|
|
737
772
|
onClick: p,
|
|
738
773
|
className: "hidden shrink-0 desktop:inline-flex"
|
|
739
774
|
}),
|
|
740
|
-
|
|
741
|
-
label:
|
|
742
|
-
variant:
|
|
743
|
-
onClick:
|
|
775
|
+
m && /* @__PURE__ */ K(h, {
|
|
776
|
+
label: j.editLabel,
|
|
777
|
+
variant: v.Primary,
|
|
778
|
+
onClick: m,
|
|
744
779
|
className: "hidden shrink-0 desktop:inline-flex"
|
|
745
780
|
}),
|
|
746
|
-
|
|
747
|
-
|
|
781
|
+
G(!1, "hidden desktop:block"),
|
|
782
|
+
G(!0, "desktop:hidden")
|
|
748
783
|
]
|
|
749
784
|
}), /* @__PURE__ */ q("div", {
|
|
750
|
-
className: d("flex min-w-0 flex-1 flex-col desktop:flex-row",
|
|
751
|
-
children: [
|
|
752
|
-
"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,
|
|
753
788
|
className: "flex min-w-0 flex-1 flex-col gap-6 px-4 py-6 desktop:px-8",
|
|
754
|
-
children:
|
|
789
|
+
children: D
|
|
755
790
|
}), /* @__PURE__ */ q("aside", {
|
|
756
|
-
"aria-labelledby":
|
|
791
|
+
"aria-labelledby": V,
|
|
757
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),
|
|
758
793
|
children: [
|
|
759
794
|
/* @__PURE__ */ K("h2", {
|
|
760
|
-
id:
|
|
761
|
-
className: d(
|
|
762
|
-
children:
|
|
795
|
+
id: V,
|
|
796
|
+
className: d(ie, $.title),
|
|
797
|
+
children: j.detailsLabel
|
|
763
798
|
}),
|
|
764
799
|
e.description !== "" && /* @__PURE__ */ q("section", {
|
|
765
800
|
className: "flex min-w-0 flex-col gap-1",
|
|
766
801
|
children: [/* @__PURE__ */ K("h3", {
|
|
767
802
|
className: d(I, $.secondary),
|
|
768
|
-
children:
|
|
803
|
+
children: j.descriptionLabel
|
|
769
804
|
}), /* @__PURE__ */ K("p", {
|
|
770
|
-
className: d("wrap-break-word whitespace-pre-line",
|
|
805
|
+
className: d("wrap-break-word whitespace-pre-line", L, $.body),
|
|
771
806
|
children: e.description
|
|
772
807
|
})]
|
|
773
808
|
}),
|
|
@@ -775,12 +810,12 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
775
810
|
className: "flex min-w-0 flex-col gap-1",
|
|
776
811
|
children: [/* @__PURE__ */ K("h3", {
|
|
777
812
|
className: d(I, $.secondary),
|
|
778
|
-
children:
|
|
813
|
+
children: j.instructionsLabel
|
|
779
814
|
}), /* @__PURE__ */ K("div", {
|
|
780
|
-
className: d("min-w-0 wrap-break-word",
|
|
815
|
+
className: d("min-w-0 wrap-break-word", L, $.body),
|
|
781
816
|
children: /* @__PURE__ */ K(i, {
|
|
782
817
|
content: e.instructions,
|
|
783
|
-
classNames:
|
|
818
|
+
classNames: me
|
|
784
819
|
})
|
|
785
820
|
})]
|
|
786
821
|
}),
|
|
@@ -788,37 +823,37 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
788
823
|
className: "flex min-w-0 flex-col gap-2",
|
|
789
824
|
children: [/* @__PURE__ */ K("h3", {
|
|
790
825
|
className: d(I, $.secondary),
|
|
791
|
-
children:
|
|
792
|
-
}),
|
|
826
|
+
children: j.contextLabel
|
|
827
|
+
}), pe.length === 0 ? /* @__PURE__ */ K(o, { label: j.emptyContextLabel }) : /* @__PURE__ */ q(he, { children: [
|
|
793
828
|
/* @__PURE__ */ K("div", {
|
|
794
829
|
role: "search",
|
|
795
|
-
children: /* @__PURE__ */ K(
|
|
830
|
+
children: /* @__PURE__ */ K(ae, {
|
|
796
831
|
value: c,
|
|
797
832
|
onChange: (e) => l(e ?? ""),
|
|
798
|
-
placeholder:
|
|
799
|
-
clearLabel:
|
|
800
|
-
"aria-label":
|
|
833
|
+
placeholder: j.contextSearchPlaceholder,
|
|
834
|
+
clearLabel: j.clearSearchLabel,
|
|
835
|
+
"aria-label": j.contextSearchAriaLabel
|
|
801
836
|
})
|
|
802
837
|
}),
|
|
803
|
-
|
|
804
|
-
className: d(
|
|
805
|
-
children:
|
|
838
|
+
z.length === 0 ? /* @__PURE__ */ K("p", {
|
|
839
|
+
className: d(se, $.secondary),
|
|
840
|
+
children: j.noContextMatchesLabel
|
|
806
841
|
}) : /* @__PURE__ */ K("ul", {
|
|
807
842
|
className: "m-0 flex min-w-0 list-none flex-wrap gap-2 p-0 pt-2",
|
|
808
|
-
children:
|
|
843
|
+
children: z.map((e) => /* @__PURE__ */ K("li", {
|
|
809
844
|
className: "min-w-0",
|
|
810
|
-
children: /* @__PURE__ */ K(
|
|
811
|
-
attachment:
|
|
812
|
-
searchQuery:
|
|
813
|
-
onClick:
|
|
814
|
-
labels: { clickLabel:
|
|
845
|
+
children: /* @__PURE__ */ K(ge, {
|
|
846
|
+
attachment: it(e),
|
|
847
|
+
searchQuery: B,
|
|
848
|
+
onClick: C,
|
|
849
|
+
labels: { clickLabel: j.openFileLabel(e.name) }
|
|
815
850
|
})
|
|
816
851
|
}, e.name))
|
|
817
852
|
}),
|
|
818
|
-
/* @__PURE__ */ K(
|
|
853
|
+
/* @__PURE__ */ K(te, {
|
|
819
854
|
visuallyHidden: !0,
|
|
820
|
-
as:
|
|
821
|
-
children:
|
|
855
|
+
as: N.Span,
|
|
856
|
+
children: B === "" ? "" : j.contextResultCountLabel(z.length)
|
|
822
857
|
})
|
|
823
858
|
] })]
|
|
824
859
|
})
|
|
@@ -826,7 +861,7 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
826
861
|
})]
|
|
827
862
|
})]
|
|
828
863
|
});
|
|
829
|
-
}),
|
|
864
|
+
}), ot = 24, st = ({ item: e, labels: n, rowTitleClassName: r, onOpen: i, onRename: a, onDelete: o }) => {
|
|
830
865
|
let s = U(() => [...a ? [{
|
|
831
866
|
key: "rename",
|
|
832
867
|
label: n.renameLabel,
|
|
@@ -855,28 +890,28 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
855
890
|
className: "shrink-0",
|
|
856
891
|
children: /* @__PURE__ */ K(t, {
|
|
857
892
|
name: e.authorName ?? "",
|
|
858
|
-
size:
|
|
893
|
+
size: ot
|
|
859
894
|
})
|
|
860
|
-
}), /* @__PURE__ */ K(
|
|
895
|
+
}), /* @__PURE__ */ K(w, {
|
|
861
896
|
text: e.title,
|
|
862
897
|
className: d("min-w-0 flex-1", r)
|
|
863
898
|
})]
|
|
864
|
-
}), s.length > 0 && /* @__PURE__ */ K(
|
|
899
|
+
}), s.length > 0 && /* @__PURE__ */ K(S, {
|
|
865
900
|
items: s,
|
|
866
901
|
placement: "bottom-end",
|
|
867
|
-
children: /* @__PURE__ */ K(
|
|
902
|
+
children: /* @__PURE__ */ K(k, {
|
|
868
903
|
"aria-label": n.moreActionsLabel(e.title),
|
|
869
|
-
size:
|
|
904
|
+
size: C.Small,
|
|
870
905
|
className: "me-2 shrink-0",
|
|
871
|
-
icon: /* @__PURE__ */ K(
|
|
906
|
+
icon: /* @__PURE__ */ K(ue, {
|
|
872
907
|
"aria-hidden": !0,
|
|
873
|
-
size:
|
|
874
|
-
stroke:
|
|
908
|
+
size: b.SM,
|
|
909
|
+
stroke: x
|
|
875
910
|
})
|
|
876
911
|
})
|
|
877
912
|
})]
|
|
878
913
|
});
|
|
879
|
-
},
|
|
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 }) => {
|
|
880
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;
|
|
881
916
|
return /* @__PURE__ */ q("section", {
|
|
882
917
|
"aria-labelledby": _ ? void 0 : p,
|
|
@@ -891,7 +926,7 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
891
926
|
className: "flex justify-center py-6",
|
|
892
927
|
children: [/* @__PURE__ */ K("span", {
|
|
893
928
|
"aria-hidden": !0,
|
|
894
|
-
children: /* @__PURE__ */ K(
|
|
929
|
+
children: /* @__PURE__ */ K(oe, {})
|
|
895
930
|
}), /* @__PURE__ */ K("span", {
|
|
896
931
|
className: "sr-only",
|
|
897
932
|
children: u.loadingLabel
|
|
@@ -902,7 +937,7 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
902
937
|
children: [/* @__PURE__ */ K("p", {
|
|
903
938
|
className: d("m-0", g),
|
|
904
939
|
children: u.errorLabel
|
|
905
|
-
}), /* @__PURE__ */ K(
|
|
940
|
+
}), /* @__PURE__ */ K(O, {
|
|
906
941
|
label: u.retryLabel,
|
|
907
942
|
onClick: r
|
|
908
943
|
})]
|
|
@@ -912,9 +947,9 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
912
947
|
label: u.emptyTitle,
|
|
913
948
|
description: u.emptyDescription
|
|
914
949
|
})
|
|
915
|
-
}) : /* @__PURE__ */ q(
|
|
950
|
+
}) : /* @__PURE__ */ q(he, { children: [/* @__PURE__ */ K("ul", {
|
|
916
951
|
className: "m-0 flex min-w-0 list-none flex-col gap-1 p-0",
|
|
917
|
-
children: e.map((e) => /* @__PURE__ */ K(
|
|
952
|
+
children: e.map((e) => /* @__PURE__ */ K(st, {
|
|
918
953
|
item: e,
|
|
919
954
|
labels: u,
|
|
920
955
|
rowTitleClassName: h,
|
|
@@ -922,44 +957,44 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
922
957
|
onRename: ee,
|
|
923
958
|
onDelete: l
|
|
924
959
|
}, e.id))
|
|
925
|
-
}), i && s && /* @__PURE__ */ K(
|
|
960
|
+
}), i && s && /* @__PURE__ */ K(O, {
|
|
926
961
|
className: "self-center",
|
|
927
962
|
label: u.loadMoreLabel ?? "Show more",
|
|
928
963
|
disabled: a,
|
|
929
964
|
onClick: s
|
|
930
965
|
})] })]
|
|
931
966
|
});
|
|
932
|
-
}),
|
|
933
|
-
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(() => {
|
|
934
969
|
k.current = document.activeElement;
|
|
935
|
-
}, []),
|
|
970
|
+
}, []), M = V(() => {
|
|
936
971
|
let e = k.current;
|
|
937
972
|
k.current = null, e?.isConnected && window.setTimeout(() => e.focus(), 0);
|
|
938
|
-
}, []),
|
|
973
|
+
}, []), te = V((e) => {
|
|
939
974
|
k.current = null, window.setTimeout(() => {
|
|
940
975
|
let t = m.current;
|
|
941
976
|
if (!t) return;
|
|
942
977
|
let n = t.querySelectorAll("li > button"), r = n[Math.min(e, n.length - 1)] ?? t.querySelector("h2, section");
|
|
943
978
|
r && !r.matches("button") && (r.tabIndex = -1), r?.focus();
|
|
944
979
|
}, 0);
|
|
945
|
-
}, []),
|
|
980
|
+
}, []), N = V((e) => n.find((t) => t.id === e) ?? null, [n]), P = V((e) => {
|
|
946
981
|
A();
|
|
947
|
-
let t =
|
|
948
|
-
|
|
949
|
-
}, [
|
|
950
|
-
A(), E(
|
|
951
|
-
}, [
|
|
952
|
-
C || (
|
|
953
|
-
}, [C,
|
|
954
|
-
D || (E(null),
|
|
955
|
-
}, [D,
|
|
956
|
-
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;
|
|
957
992
|
let e = y.trim();
|
|
958
993
|
if (!e) S(d.renameEmptyError);
|
|
959
994
|
else {
|
|
960
995
|
w(!0);
|
|
961
996
|
try {
|
|
962
|
-
await l(
|
|
997
|
+
await l(h.id, e), _(null), M();
|
|
963
998
|
} catch {} finally {
|
|
964
999
|
w(!1);
|
|
965
1000
|
}
|
|
@@ -968,51 +1003,51 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
968
1003
|
C,
|
|
969
1004
|
d.renameEmptyError,
|
|
970
1005
|
l,
|
|
971
|
-
|
|
1006
|
+
h,
|
|
972
1007
|
y,
|
|
973
|
-
|
|
1008
|
+
M
|
|
974
1009
|
]), ae = V((e) => {
|
|
975
1010
|
e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), L());
|
|
976
|
-
}, [L]),
|
|
1011
|
+
}, [L]), oe = V(async () => {
|
|
977
1012
|
if (!T || !u) return;
|
|
978
1013
|
let e = n.findIndex((e) => e.id === T.id);
|
|
979
1014
|
O(!0);
|
|
980
1015
|
try {
|
|
981
|
-
await u(T.id), E(null),
|
|
1016
|
+
await u(T.id), E(null), te(Math.max(e, 0));
|
|
982
1017
|
} catch {} finally {
|
|
983
1018
|
O(!1);
|
|
984
1019
|
}
|
|
985
1020
|
}, [
|
|
986
1021
|
T,
|
|
987
|
-
|
|
1022
|
+
te,
|
|
988
1023
|
n,
|
|
989
1024
|
u
|
|
990
|
-
]),
|
|
1025
|
+
]), se = U(() => [{
|
|
991
1026
|
label: d.renameCancelLabel ?? "Cancel",
|
|
992
|
-
variant:
|
|
993
|
-
appearance:
|
|
1027
|
+
variant: v.Primary,
|
|
1028
|
+
appearance: g.Ghost,
|
|
994
1029
|
disabled: C,
|
|
995
|
-
onClick:
|
|
1030
|
+
onClick: ne
|
|
996
1031
|
}, {
|
|
997
1032
|
label: d.renameSaveLabel,
|
|
998
|
-
variant:
|
|
1033
|
+
variant: v.Primary,
|
|
999
1034
|
disabled: C,
|
|
1000
1035
|
onClick: () => {
|
|
1001
1036
|
L();
|
|
1002
1037
|
}
|
|
1003
1038
|
}], [
|
|
1004
|
-
|
|
1039
|
+
ne,
|
|
1005
1040
|
L,
|
|
1006
1041
|
C,
|
|
1007
1042
|
d.renameCancelLabel,
|
|
1008
1043
|
d.renameSaveLabel
|
|
1009
1044
|
]);
|
|
1010
|
-
return /* @__PURE__ */ q(
|
|
1045
|
+
return /* @__PURE__ */ q(he, { children: [
|
|
1011
1046
|
t,
|
|
1012
1047
|
/* @__PURE__ */ K("div", {
|
|
1013
1048
|
ref: m,
|
|
1014
1049
|
className: "contents",
|
|
1015
|
-
children: /* @__PURE__ */ K(
|
|
1050
|
+
children: /* @__PURE__ */ K(ct, {
|
|
1016
1051
|
items: n,
|
|
1017
1052
|
isLoading: r,
|
|
1018
1053
|
hasError: i,
|
|
@@ -1021,21 +1056,21 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
1021
1056
|
isLoadingMore: s,
|
|
1022
1057
|
onLoadMore: c,
|
|
1023
1058
|
onOpen: ee,
|
|
1024
|
-
onRename: l ?
|
|
1025
|
-
onDelete: u ?
|
|
1059
|
+
onRename: l ? P : void 0,
|
|
1060
|
+
onDelete: u ? F : void 0,
|
|
1026
1061
|
labels: d.list,
|
|
1027
1062
|
typography: f
|
|
1028
1063
|
})
|
|
1029
1064
|
}),
|
|
1030
|
-
|
|
1065
|
+
h && /* @__PURE__ */ K(re, {
|
|
1031
1066
|
open: !0,
|
|
1032
1067
|
header: d.renameTitle,
|
|
1033
1068
|
size: ie.Sm,
|
|
1034
|
-
mainButtons:
|
|
1035
|
-
onClose:
|
|
1069
|
+
mainButtons: se,
|
|
1070
|
+
onClose: ne,
|
|
1036
1071
|
children: /* @__PURE__ */ K("div", {
|
|
1037
1072
|
className: "px-6 py-4",
|
|
1038
|
-
children: /* @__PURE__ */ K(
|
|
1073
|
+
children: /* @__PURE__ */ K(j, {
|
|
1039
1074
|
id: p,
|
|
1040
1075
|
value: y,
|
|
1041
1076
|
labelProps: { label: d.renameInputLabel },
|
|
@@ -1056,20 +1091,20 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
1056
1091
|
labels: d.deleteDialog,
|
|
1057
1092
|
isLoading: D,
|
|
1058
1093
|
onConfirm: () => {
|
|
1059
|
-
|
|
1094
|
+
oe();
|
|
1060
1095
|
},
|
|
1061
1096
|
onClose: I
|
|
1062
1097
|
})
|
|
1063
1098
|
] });
|
|
1064
|
-
}),
|
|
1099
|
+
}), ut = B(({ projectName: e, projectHref: t, onBack: n, onProjectLinkClick: r, backLabel: i, className: a, nameClassName: o = "dial-body-text" }) => /* @__PURE__ */ q("nav", {
|
|
1065
1100
|
"aria-label": i,
|
|
1066
1101
|
className: d("flex min-w-0 shrink-0 items-center gap-2 border-b px-4 py-2", a),
|
|
1067
|
-
children: [/* @__PURE__ */ K(
|
|
1102
|
+
children: [/* @__PURE__ */ K(k, {
|
|
1068
1103
|
"aria-label": i,
|
|
1069
|
-
icon: /* @__PURE__ */ K(
|
|
1104
|
+
icon: /* @__PURE__ */ K(ce, {
|
|
1070
1105
|
"aria-hidden": !0,
|
|
1071
|
-
size:
|
|
1072
|
-
stroke:
|
|
1106
|
+
size: b.MD,
|
|
1107
|
+
stroke: x,
|
|
1073
1108
|
className: "rtl:scale-x-[-1]"
|
|
1074
1109
|
}),
|
|
1075
1110
|
onClick: n
|
|
@@ -1077,11 +1112,11 @@ var ve = /* @__PURE__ */ function(e) {
|
|
|
1077
1112
|
href: t,
|
|
1078
1113
|
onClick: r,
|
|
1079
1114
|
className: "min-w-0 hover:underline focus-visible:underline",
|
|
1080
|
-
children: /* @__PURE__ */ K(
|
|
1115
|
+
children: /* @__PURE__ */ K(w, {
|
|
1081
1116
|
text: e,
|
|
1082
1117
|
className: d("min-w-0", o)
|
|
1083
1118
|
})
|
|
1084
1119
|
})]
|
|
1085
1120
|
}));
|
|
1086
1121
|
//#endregion
|
|
1087
|
-
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 };
|