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