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