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