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