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