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