@epam/ai-dial-projects 1.3.0-dev.225 → 1.3.0-dev.234
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/ProjectCapacityMeter/ProjectCapacityMeter.d.ts.map +1 -1
- package/components/ProjectCard/ProjectCard.d.ts +7 -1
- package/components/ProjectCard/ProjectCard.d.ts.map +1 -1
- package/components/ProjectCreateForm/ProjectCreateForm.d.ts +1 -1
- package/components/ProjectCreateForm/ProjectCreateForm.d.ts.map +1 -1
- package/components/ProjectView/ProjectView.d.ts +4 -0
- package/components/ProjectView/ProjectView.d.ts.map +1 -0
- package/components/Projects/Projects.d.ts.map +1 -1
- package/index.css +2 -2
- package/index.d.ts +4 -1
- package/index.d.ts.map +1 -1
- package/index.js +571 -309
- package/models/project-context-file.d.ts +11 -0
- package/models/project-context-file.d.ts.map +1 -0
- package/models/project-create-form-props.d.ts +8 -5
- package/models/project-create-form-props.d.ts.map +1 -1
- package/models/project-item.d.ts +2 -0
- package/models/project-item.d.ts.map +1 -1
- package/models/project-view-props.d.ts +149 -0
- package/models/project-view-props.d.ts.map +1 -0
- package/models/projects-props.d.ts +8 -0
- package/models/projects-props.d.ts.map +1 -1
- package/package.json +5 -5
- package/utils/context-files.d.ts +11 -4
- package/utils/context-files.d.ts.map +1 -1
- package/utils/projects.d.ts +1 -1
- package/utils/projects.d.ts.map +1 -1
package/index.js
CHANGED
|
@@ -1,241 +1,277 @@
|
|
|
1
|
-
import { MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as t,
|
|
2
|
-
import { Button as
|
|
3
|
-
import { IconArrowNarrowLeft as
|
|
4
|
-
import { Suspense as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { AttachmentCard as
|
|
7
|
-
import { BuilderFormContainer as
|
|
8
|
-
import { LazyMarkdownEditor as
|
|
1
|
+
import { MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as t, MarkdownRenderer as n, PROHIBITED_CONVERSATION_NAME_CHARS_RE as r, PanelEmptyState as i, RequestStatus as a, TextRefinementField as o, buildCssVars as ee, getAttachmentTypeFromMime as s, inferMimeTypeFromPath as c, mergeClasses as l, useAvailableHeightCap as u, useTextRefinement as d } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { Button as te, ButtonAppearance as ne, ButtonDropdown as f, ButtonVariant as re, CardShell as p, DIAL_ICON_SIZE as m, DIAL_KIT_ICON_STROKE as h, Dropdown as g, ElementSize as ie, EllipsisTooltip as _, ErrorText as v, FileDropzone as ae, FolderPath as y, GhostButton as b, GhostIconButton as x, Highlight as S, Input as C, Label as w, MenuItemMark as T, NeutralButton as oe, Search as se, Spinner as ce, Textarea as E } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconArrowNarrowLeft as le, IconArrowsSort as D, IconDotsVertical as ue, IconPin as O, IconPinFilled as k, IconPlus as A } from "@tabler/icons-react";
|
|
4
|
+
import { Suspense as j, lazy as M, memo as N, useCallback as P, useEffect as de, useId as F, useMemo as I, useRef as L, useState as R } from "react";
|
|
5
|
+
import { Fragment as fe, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
6
|
+
import { AttachmentCard as pe, FileDndOverlay as me } from "@epam/ai-dial-attachment-input";
|
|
7
|
+
import { BuilderFormContainer as he } from "@epam/ai-dial-builder-form";
|
|
8
|
+
import { LazyMarkdownEditor as ge } from "@epam/ai-dial-ui-kit/editors";
|
|
9
9
|
//#region src/types/projects-sort-key.ts
|
|
10
|
-
var
|
|
10
|
+
var V = /* @__PURE__ */ function(e) {
|
|
11
11
|
return e.Newest = "newest", e.Oldest = "oldest", e.NameAsc = "name-asc", e;
|
|
12
|
-
}({}),
|
|
12
|
+
}({}), _e = (e, t) => {
|
|
13
13
|
let n = t.trim().toLocaleLowerCase();
|
|
14
14
|
return n ? e.filter((e) => e.name.toLocaleLowerCase().includes(n)) : e;
|
|
15
|
-
},
|
|
15
|
+
}, H = (e, t, n) => {
|
|
16
16
|
let r = new Intl.Collator(n, {
|
|
17
17
|
sensitivity: "base",
|
|
18
18
|
numeric: !0
|
|
19
|
-
}), i = (e, t) => r.compare(e.name, t.name);
|
|
20
|
-
if (t ===
|
|
21
|
-
let
|
|
22
|
-
return [...e].sort((e, t) =>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
19
|
+
}), i = (e, t) => r.compare(e.name, t.name), a = (e, t) => Number(t.isPinned ?? !1) - Number(e.isPinned ?? !1);
|
|
20
|
+
if (t === V.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
|
|
21
|
+
let o = t === V.Oldest ? 1 : -1;
|
|
22
|
+
return [...e].sort((e, t) => {
|
|
23
|
+
let n = a(e, t);
|
|
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
|
+
});
|
|
26
|
+
}, U = {
|
|
27
|
+
card: "_card_175or_1",
|
|
28
|
+
title: "_title_175or_5",
|
|
29
|
+
footer: "_footer_175or_9",
|
|
30
|
+
path: "_path_175or_13",
|
|
31
|
+
pin: "_pin_175or_17",
|
|
32
|
+
link: "_link_175or_23",
|
|
33
|
+
aboveLink: "_aboveLink_175or_39",
|
|
34
|
+
interactive: "_interactive_175or_44"
|
|
35
|
+
}, ve = (e, t) => [e, ...(t ?? "").split("/").filter((e) => e.length > 0)], ye = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, W = ({ project: e, searchQuery: t, sourceLabel: n, folderPathLabel: r, pinnedLabel: i, href: a, onOpen: o, titleClassName: ee, pathLabelClassName: s, pathLeafClassName: c }) => {
|
|
36
|
+
let u = /* @__PURE__ */ z(S, {
|
|
37
|
+
text: e.name,
|
|
38
|
+
query: t,
|
|
39
|
+
maxLines: 1,
|
|
40
|
+
className: l("min-w-0", ee, U.title, a != null && U.aboveLink)
|
|
41
|
+
});
|
|
42
|
+
return /* @__PURE__ */ z("li", {
|
|
43
|
+
className: "flex min-w-0",
|
|
44
|
+
children: /* @__PURE__ */ B(p, {
|
|
45
|
+
"aria-label": e.name,
|
|
46
|
+
className: l("relative flex w-full min-w-0 flex-col gap-3", U.card, a != null && U.interactive),
|
|
47
|
+
children: [/* @__PURE__ */ B("div", {
|
|
48
|
+
className: "flex min-w-0 items-center gap-2",
|
|
49
|
+
children: [a == null ? /* @__PURE__ */ z("div", {
|
|
50
|
+
className: "min-w-0 flex-1",
|
|
51
|
+
children: u
|
|
52
|
+
}) : /* @__PURE__ */ z("a", {
|
|
53
|
+
href: a,
|
|
54
|
+
onClick: (t) => {
|
|
55
|
+
o != null && ye(t) && (t.preventDefault(), o(e.id));
|
|
56
|
+
},
|
|
57
|
+
className: l("min-w-0 flex-1", U.link),
|
|
58
|
+
children: u
|
|
59
|
+
}), e.isPinned && /* @__PURE__ */ B("span", {
|
|
60
|
+
className: l("shrink-0", U.pin),
|
|
61
|
+
children: [/* @__PURE__ */ z(k, {
|
|
62
|
+
size: m.SM,
|
|
63
|
+
"aria-hidden": !0
|
|
64
|
+
}), /* @__PURE__ */ z("span", {
|
|
65
|
+
className: "sr-only",
|
|
66
|
+
children: i
|
|
67
|
+
})]
|
|
68
|
+
})]
|
|
69
|
+
}), /* @__PURE__ */ z(y, {
|
|
70
|
+
segments: ve(n, e.parentPath),
|
|
71
|
+
ariaLabel: r,
|
|
72
|
+
labelClassName: l(s, U.path),
|
|
73
|
+
leafClassName: l(c, U.path),
|
|
74
|
+
className: l("mt-auto pt-3", U.footer, a != null && U.aboveLink)
|
|
75
|
+
})]
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
}, G = {
|
|
47
79
|
container: "_container_4rer8_1",
|
|
48
80
|
subtitle: "_subtitle_4rer8_5",
|
|
49
81
|
sortButton: "_sortButton_4rer8_9"
|
|
50
|
-
},
|
|
51
|
-
let { colors:
|
|
52
|
-
"--pr-bg":
|
|
53
|
-
"--pr-subtitle-text":
|
|
54
|
-
"--pr-sort-text":
|
|
55
|
-
"--pr-card-bg":
|
|
56
|
-
"--pr-card-
|
|
57
|
-
"--pr-card-
|
|
58
|
-
"--pr-
|
|
59
|
-
|
|
82
|
+
}, be = ({ projects: e, isLoading: t = !1, hasError: n = !1, incompleteSources: r = [], onRetry: a, onCreateProject: o, onOpenProject: s, getProjectHref: c, searchQuery: u, onSearchQueryChange: d, sortKey: p, onSortKeyChange: g, labels: _, locale: v, styles: ae }) => {
|
|
83
|
+
let { colors: y, typography: x } = ae ?? {}, S = x?.titleClassName ?? "dial-h1-text", C = x?.subtitleClassName ?? "dial-body-text", w = x?.cardTitleClassName ?? "dial-body-semi-text", oe = x?.pathLabelClassName ?? "dial-tiny-text", E = x?.pathLeafClassName ?? "dial-tiny-semi-text", le = ee({
|
|
84
|
+
"--pr-bg": y?.background,
|
|
85
|
+
"--pr-subtitle-text": y?.subtitleText,
|
|
86
|
+
"--pr-sort-text": y?.sortButtonText,
|
|
87
|
+
"--pr-card-bg": y?.cardBackground,
|
|
88
|
+
"--pr-card-hover-bg": y?.cardHoverBackground,
|
|
89
|
+
"--pr-card-title-text": y?.cardTitleText,
|
|
90
|
+
"--pr-card-divider": y?.cardDivider,
|
|
91
|
+
"--pr-path-text": y?.pathText
|
|
92
|
+
}), ue = u.trim(), O = r.length > 0, k = O && e.length === 0, j = I(() => H(_e(e, u), p, v), [
|
|
60
93
|
e,
|
|
61
|
-
c,
|
|
62
94
|
u,
|
|
95
|
+
p,
|
|
63
96
|
v
|
|
64
|
-
]),
|
|
97
|
+
]), M = _.sortOptions.find((e) => e.value === p)?.label ?? _.sortLabel, N = I(() => _.sortOptions.map((e) => ({
|
|
65
98
|
key: e.value,
|
|
66
99
|
label: e.label,
|
|
67
|
-
mark:
|
|
68
|
-
checked: e.value ===
|
|
69
|
-
onClick: () =>
|
|
100
|
+
mark: T.Check,
|
|
101
|
+
checked: e.value === p,
|
|
102
|
+
onClick: () => g(e.value)
|
|
70
103
|
})), [
|
|
71
104
|
_.sortOptions,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
]),
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
if (!t) return n ? _.errorLabel :
|
|
78
|
-
},
|
|
105
|
+
p,
|
|
106
|
+
g
|
|
107
|
+
]), P = (e) => {
|
|
108
|
+
d(e ?? "");
|
|
109
|
+
}, de = () => {
|
|
110
|
+
if (!t) return n ? _.errorLabel : O ? _.incompleteLabel : e.length === 0 ? _.emptyStateLabel : j.length === 0 ? _.noResultsLabel : _.resultCountLabel(j.length);
|
|
111
|
+
}, F = () => o ? /* @__PURE__ */ z(te, {
|
|
79
112
|
label: _.createProjectLabel,
|
|
80
|
-
variant:
|
|
81
|
-
iconBefore: /* @__PURE__ */ A
|
|
113
|
+
variant: re.Primary,
|
|
114
|
+
iconBefore: /* @__PURE__ */ z(A, {
|
|
82
115
|
size: m.SM,
|
|
83
116
|
stroke: h,
|
|
84
117
|
"aria-hidden": !0
|
|
85
118
|
}),
|
|
86
|
-
onClick:
|
|
119
|
+
onClick: o,
|
|
87
120
|
className: "shrink-0"
|
|
88
|
-
}) : void 0,
|
|
121
|
+
}) : void 0, L = () => t ? /* @__PURE__ */ z(ce, {}) : n || k ? /* @__PURE__ */ B("div", {
|
|
89
122
|
className: "flex flex-col items-center gap-3",
|
|
90
|
-
children: [/* @__PURE__ */
|
|
91
|
-
className: l(C,
|
|
123
|
+
children: [/* @__PURE__ */ z("p", {
|
|
124
|
+
className: l(C, G.subtitle),
|
|
92
125
|
children: n ? _.errorLabel : _.incompleteLabel
|
|
93
|
-
}), /* @__PURE__ */
|
|
126
|
+
}), /* @__PURE__ */ z(b, {
|
|
94
127
|
label: _.retryLabel,
|
|
95
128
|
onClick: a
|
|
96
129
|
})]
|
|
97
|
-
}) : e.length === 0 ? /* @__PURE__ */
|
|
130
|
+
}) : e.length === 0 ? /* @__PURE__ */ z(i, {
|
|
98
131
|
label: _.emptyStateLabel,
|
|
99
132
|
description: _.emptyStateDescription,
|
|
100
|
-
action:
|
|
101
|
-
}) :
|
|
133
|
+
action: F()
|
|
134
|
+
}) : j.length === 0 ? /* @__PURE__ */ z(i, { label: _.noResultsLabel }) : /* @__PURE__ */ z("ul", {
|
|
102
135
|
className: "m-0 grid w-full max-w-[1116px] min-w-0 list-none grid-cols-1 gap-5 p-0 desktop:grid-cols-3",
|
|
103
|
-
children:
|
|
136
|
+
children: j.map((e) => /* @__PURE__ */ z(W, {
|
|
104
137
|
project: e,
|
|
105
|
-
searchQuery:
|
|
138
|
+
searchQuery: ue,
|
|
106
139
|
sourceLabel: _.sourceLabels[e.source],
|
|
107
140
|
folderPathLabel: _.folderPathLabel,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
141
|
+
pinnedLabel: _.pinnedLabel ?? "Pinned",
|
|
142
|
+
href: c?.(e.id),
|
|
143
|
+
onOpen: s,
|
|
144
|
+
titleClassName: w,
|
|
145
|
+
pathLabelClassName: oe,
|
|
146
|
+
pathLeafClassName: E
|
|
111
147
|
}, e.id))
|
|
112
|
-
}),
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
style:
|
|
115
|
-
className: l("flex h-full w-full min-w-0 flex-col gap-4 overflow-y-auto px-4 py-4 desktop:gap-6 desktop:px-8",
|
|
148
|
+
}), R = t || n || j.length === 0;
|
|
149
|
+
return /* @__PURE__ */ B("div", {
|
|
150
|
+
style: le,
|
|
151
|
+
className: l("flex h-full w-full min-w-0 flex-col gap-4 overflow-y-auto px-4 py-4 desktop:gap-6 desktop:px-8", G.container),
|
|
116
152
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ B("div", {
|
|
118
154
|
className: "flex min-w-0 items-start justify-between gap-3",
|
|
119
|
-
children: [/* @__PURE__ */
|
|
155
|
+
children: [/* @__PURE__ */ B("div", {
|
|
120
156
|
className: "min-w-0",
|
|
121
|
-
children: [/* @__PURE__ */
|
|
122
|
-
className: l("break-words",
|
|
157
|
+
children: [/* @__PURE__ */ z("h1", {
|
|
158
|
+
className: l("break-words", S),
|
|
123
159
|
children: _.title
|
|
124
|
-
}), /* @__PURE__ */
|
|
125
|
-
className: l("mt-1", C,
|
|
160
|
+
}), /* @__PURE__ */ z("p", {
|
|
161
|
+
className: l("mt-1", C, G.subtitle),
|
|
126
162
|
children: _.subtitle
|
|
127
163
|
})]
|
|
128
|
-
}),
|
|
164
|
+
}), F()]
|
|
129
165
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ B("div", {
|
|
131
167
|
className: "flex flex-col gap-3 desktop:flex-row desktop:items-center",
|
|
132
|
-
children: [/* @__PURE__ */
|
|
168
|
+
children: [/* @__PURE__ */ z("div", {
|
|
133
169
|
role: "search",
|
|
134
170
|
className: "min-w-0 flex-1",
|
|
135
|
-
children: /* @__PURE__ */
|
|
136
|
-
value:
|
|
137
|
-
onChange:
|
|
171
|
+
children: /* @__PURE__ */ z(se, {
|
|
172
|
+
value: u,
|
|
173
|
+
onChange: P,
|
|
138
174
|
placeholder: _.searchPlaceholder,
|
|
139
175
|
clearLabel: _.clearSearchLabel,
|
|
140
176
|
"aria-label": _.searchAriaLabel,
|
|
141
|
-
size:
|
|
177
|
+
size: ie.Large
|
|
142
178
|
})
|
|
143
|
-
}), _.sortOptions.length > 0 && /* @__PURE__ */
|
|
179
|
+
}), _.sortOptions.length > 0 && /* @__PURE__ */ z("div", {
|
|
144
180
|
role: "group",
|
|
145
181
|
"aria-label": _.sortLabel,
|
|
146
182
|
className: "shrink-0",
|
|
147
|
-
children: /* @__PURE__ */
|
|
148
|
-
items:
|
|
149
|
-
label:
|
|
150
|
-
variant:
|
|
151
|
-
appearance:
|
|
152
|
-
iconBefore: /* @__PURE__ */
|
|
183
|
+
children: /* @__PURE__ */ z(f, {
|
|
184
|
+
items: N,
|
|
185
|
+
label: M,
|
|
186
|
+
variant: re.Primary,
|
|
187
|
+
appearance: ne.Ghost,
|
|
188
|
+
iconBefore: /* @__PURE__ */ z(D, {
|
|
153
189
|
size: m.SM,
|
|
154
190
|
"aria-hidden": !0,
|
|
155
191
|
stroke: h
|
|
156
192
|
}),
|
|
157
|
-
className:
|
|
193
|
+
className: G.sortButton
|
|
158
194
|
})
|
|
159
195
|
})]
|
|
160
196
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ z("span", {
|
|
162
198
|
role: "status",
|
|
163
199
|
"aria-live": "polite",
|
|
164
200
|
className: "sr-only",
|
|
165
|
-
children:
|
|
201
|
+
children: de()
|
|
166
202
|
}),
|
|
167
|
-
|
|
203
|
+
O && !t && !n && !k && /* @__PURE__ */ B("div", {
|
|
168
204
|
className: "flex flex-wrap items-center gap-3",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
170
|
-
className: l(C,
|
|
205
|
+
children: [/* @__PURE__ */ z("p", {
|
|
206
|
+
className: l(C, G.subtitle),
|
|
171
207
|
children: _.incompleteLabel
|
|
172
|
-
}), /* @__PURE__ */
|
|
208
|
+
}), /* @__PURE__ */ z(b, {
|
|
173
209
|
label: _.retryLabel,
|
|
174
210
|
onClick: a
|
|
175
211
|
})]
|
|
176
212
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
className: l("flex w-full min-w-0 flex-1 flex-col",
|
|
179
|
-
children:
|
|
213
|
+
/* @__PURE__ */ z("div", {
|
|
214
|
+
className: l("flex w-full min-w-0 flex-1 flex-col", R && "items-center justify-center"),
|
|
215
|
+
children: L()
|
|
180
216
|
})
|
|
181
217
|
]
|
|
182
218
|
});
|
|
183
|
-
},
|
|
219
|
+
}, xe = /* @__PURE__ */ function(e) {
|
|
184
220
|
return e.Personal = "personal", e.Shared = "shared", e.Organization = "organization", e;
|
|
185
|
-
}({}),
|
|
186
|
-
let [t, n] =
|
|
221
|
+
}({}), K = (e) => !!e.dataTransfer?.types.includes("Files"), Se = (e) => {
|
|
222
|
+
let [t, n] = R(!1), r = L(0);
|
|
187
223
|
return {
|
|
188
224
|
isDragActive: t,
|
|
189
225
|
handlers: {
|
|
190
|
-
onDragEnter:
|
|
191
|
-
|
|
226
|
+
onDragEnter: P((e) => {
|
|
227
|
+
K(e) && (e.preventDefault(), r.current += 1, n(!0));
|
|
192
228
|
}, []),
|
|
193
|
-
onDragLeave:
|
|
194
|
-
|
|
229
|
+
onDragLeave: P((e) => {
|
|
230
|
+
K(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
|
|
195
231
|
}, []),
|
|
196
|
-
onDragOver:
|
|
197
|
-
|
|
232
|
+
onDragOver: P((e) => {
|
|
233
|
+
K(e) && e.preventDefault();
|
|
198
234
|
}, []),
|
|
199
|
-
onDrop:
|
|
200
|
-
if (!
|
|
235
|
+
onDrop: P((t) => {
|
|
236
|
+
if (!K(t)) return;
|
|
201
237
|
t.preventDefault(), r.current = 0, n(!1);
|
|
202
238
|
let i = Array.from(t.dataTransfer?.files ?? []);
|
|
203
239
|
i.length > 0 && e(i);
|
|
204
240
|
}, [e])
|
|
205
241
|
}
|
|
206
242
|
};
|
|
207
|
-
},
|
|
243
|
+
}, q = /* @__PURE__ */ function(e) {
|
|
208
244
|
return e.UnsupportedType = "unsupported-type", e.TooLarge = "too-large", e.CapacityExceeded = "capacity-exceeded", e.Duplicate = "duplicate", e.InvalidName = "invalid-name", e;
|
|
209
|
-
}({}),
|
|
245
|
+
}({}), J = /* @__PURE__ */ function(e) {
|
|
210
246
|
return e.Required = "required", e.InvalidCharacters = "invalid-characters", e.Reserved = "reserved", e.TooLong = "too-long", e;
|
|
211
|
-
}({}),
|
|
247
|
+
}({}), Ce = 255, Y = new RegExp(r.source, "u"), we = /[\p{Cc}--]/u, Te = /* @__PURE__ */ new Set([
|
|
212
248
|
".",
|
|
213
249
|
"..",
|
|
214
250
|
"v",
|
|
215
251
|
"files",
|
|
216
252
|
".dial-resource",
|
|
217
253
|
".dial-folder"
|
|
218
|
-
]),
|
|
254
|
+
]), Ee = (e) => new TextEncoder().encode(e).length, De = (e) => {
|
|
219
255
|
let t = e.trim();
|
|
220
|
-
return t.length === 0 ?
|
|
221
|
-
},
|
|
256
|
+
return t.length === 0 ? J.Required : Ee(t) > 255 ? J.TooLong : Y.test(t) || we.test(t) ? J.InvalidCharacters : Te.has(t) ? J.Reserved : null;
|
|
257
|
+
}, X = (e) => {
|
|
222
258
|
let t = e.lastIndexOf(".");
|
|
223
259
|
return t > 0 ? e.slice(t + 1).toLowerCase() : "";
|
|
224
|
-
},
|
|
260
|
+
}, Oe = (e) => "isStored" in e && e.isStored, ke = (e) => Oe(e) ? e.size : e.file.size, Ae = (e) => e.reduce((e, t) => e + ke(t), 0), je = 0, Me = () => (je += 1, `project-context-${Date.now()}-${je}`), Ne = (e) => {
|
|
225
261
|
let t = e.type || c(e.name) || "application/octet-stream";
|
|
226
262
|
return {
|
|
227
|
-
id:
|
|
263
|
+
id: Me(),
|
|
228
264
|
name: e.name,
|
|
229
265
|
contentType: t,
|
|
230
266
|
type: s(t),
|
|
231
|
-
status:
|
|
267
|
+
status: a.Idle,
|
|
232
268
|
file: e
|
|
233
269
|
};
|
|
234
|
-
},
|
|
235
|
-
let r = new Set(t.map((e) => e.name)), i =
|
|
270
|
+
}, Pe = (e, t, n, r) => De(e.name) != null || e.name.trim() !== e.name ? q.InvalidName : r.allowedExtensions.includes(X(e.name)) ? t.has(e.name) ? q.Duplicate : e.size > r.maxFileBytes ? q.TooLarge : n + e.size > r.maxTotalBytes ? q.CapacityExceeded : null : q.UnsupportedType, Fe = (e, t, n) => {
|
|
271
|
+
let r = new Set(t.map((e) => e.name)), i = Ae(t), a = [], o = [];
|
|
236
272
|
for (let t of e) {
|
|
237
|
-
let e =
|
|
238
|
-
e == null ? (r.add(t.name), i += t.size, a.push(
|
|
273
|
+
let e = Pe(t, r, i, n);
|
|
274
|
+
e == null ? (r.add(t.name), i += t.size, a.push(Ne(t))) : o.push({
|
|
239
275
|
name: t.name,
|
|
240
276
|
reason: e
|
|
241
277
|
});
|
|
@@ -244,38 +280,42 @@ var N = /* @__PURE__ */ function(e) {
|
|
|
244
280
|
accepted: a,
|
|
245
281
|
rejected: o
|
|
246
282
|
};
|
|
247
|
-
},
|
|
283
|
+
}, Ie = (e, t) => e <= 0 ? 0 : t <= 0 ? 100 : Math.min(100, Math.max(1, Math.round(e / t * 100))), Z = (e, t) => {
|
|
284
|
+
let n = t.trim().toLowerCase();
|
|
285
|
+
return n === "" ? e : e.filter((e) => e.name.toLowerCase().includes(n));
|
|
286
|
+
}, Q = {
|
|
248
287
|
track: "_track_15unh_1",
|
|
249
288
|
fill: "_fill_15unh_5",
|
|
250
289
|
text: "_text_15unh_9"
|
|
251
|
-
},
|
|
290
|
+
}, Le = ({ usedBytes: e, maxBytes: t, ariaLabel: n, formatLabel: r, textClassName: i = "dial-tiny-text" }) => {
|
|
252
291
|
if (e <= 0) return null;
|
|
253
|
-
let a =
|
|
254
|
-
return /* @__PURE__ */
|
|
255
|
-
className: "flex
|
|
256
|
-
children: [/* @__PURE__ */
|
|
292
|
+
let a = Ie(e, t), o = r(a);
|
|
293
|
+
return /* @__PURE__ */ B("div", {
|
|
294
|
+
className: "flex min-w-0 items-center gap-2",
|
|
295
|
+
children: [/* @__PURE__ */ z("div", {
|
|
257
296
|
role: "meter",
|
|
258
297
|
"aria-label": n,
|
|
259
298
|
"aria-valuemin": 0,
|
|
260
299
|
"aria-valuemax": t,
|
|
261
300
|
"aria-valuenow": Math.min(e, t),
|
|
262
301
|
"aria-valuetext": o,
|
|
263
|
-
className: l("h-1 w-
|
|
264
|
-
children: /* @__PURE__ */
|
|
265
|
-
className: l("h-full rounded-full",
|
|
302
|
+
className: l("h-1 w-[60px] shrink-0 overflow-hidden rounded-full", Q.track),
|
|
303
|
+
children: /* @__PURE__ */ z("div", {
|
|
304
|
+
className: l("h-full rounded-full", Q.fill),
|
|
266
305
|
style: { width: `${a}%` }
|
|
267
306
|
})
|
|
268
|
-
}), /* @__PURE__ */
|
|
307
|
+
}), /* @__PURE__ */ z("span", {
|
|
269
308
|
"aria-hidden": !0,
|
|
270
|
-
className: l(i,
|
|
309
|
+
className: l("whitespace-nowrap", i, Q.text),
|
|
271
310
|
children: o
|
|
272
311
|
})]
|
|
273
312
|
});
|
|
274
|
-
},
|
|
275
|
-
formColumn: "
|
|
276
|
-
helper: "
|
|
277
|
-
|
|
278
|
-
|
|
313
|
+
}, Re = {
|
|
314
|
+
formColumn: "_formColumn_1fxsc_1",
|
|
315
|
+
helper: "_helper_1fxsc_10",
|
|
316
|
+
label: "_label_1fxsc_14"
|
|
317
|
+
}, ze = M(async () => ({ default: (await ge()).MarkdownEditor })), Be = "device", Ve = "file-manager", He = ({ values: n, errors: r, onFieldChange: i, contextFiles: a, onContextFilesChange: s, allowedExtensions: c, maxFileBytes: te, maxTotalBytes: ne, onPickFromFileManager: p, onRefineDescription: g, onRefineInstructions: _, onBack: y, onCancel: b, onSubmit: x, isSubmitting: S = !1, labels: T, markdownEditorTheme: oe, className: se, styles: D }) => {
|
|
318
|
+
let ue = F(), O = F(), k = F(), A = F(), M = F(), N = L(null), fe = L(null), ge = u(), [V, _e] = R(!1), [H, U] = R([]), [ve, ye] = R(""), W = L(void 0), G = P((e) => e ? async (t, n) => {
|
|
279
319
|
if (W.current && !W.current.aborted) throw new DOMException("Busy", "AbortError");
|
|
280
320
|
W.current = n;
|
|
281
321
|
try {
|
|
@@ -283,251 +323,473 @@ var N = /* @__PURE__ */ function(e) {
|
|
|
283
323
|
} finally {
|
|
284
324
|
W.current === n && (W.current = void 0);
|
|
285
325
|
}
|
|
286
|
-
} : void 0, []),
|
|
326
|
+
} : void 0, []), be = I(() => G(g), [G, g]), xe = I(() => G(_), [G, _]), K = d({
|
|
287
327
|
value: n.description,
|
|
288
328
|
onChange: (e) => i("description", e),
|
|
289
|
-
onRefine:
|
|
290
|
-
disabled:
|
|
291
|
-
}), q =
|
|
329
|
+
onRefine: be,
|
|
330
|
+
disabled: S
|
|
331
|
+
}), q = d({
|
|
292
332
|
value: n.instructions,
|
|
293
333
|
onChange: (e) => i("instructions", e),
|
|
294
|
-
onRefine:
|
|
295
|
-
disabled:
|
|
296
|
-
}), J = K.isPending || q.isPending,
|
|
334
|
+
onRefine: xe,
|
|
335
|
+
disabled: S
|
|
336
|
+
}), J = K.isPending || q.isPending, Ce = De(n.name), Y = r.name ?? (V && Ce != null ? T.nameErrors[Ce] : void 0), we = Ce != null || S || J;
|
|
297
337
|
de(() => {
|
|
298
|
-
r.name &&
|
|
338
|
+
r.name && N.current?.focus();
|
|
299
339
|
}, [r.name]);
|
|
300
|
-
let
|
|
340
|
+
let Te = I(() => Ae(a), [a]), Ee = I(() => c.map((e) => `.${e}`).join(","), [c]), X = (e) => {
|
|
301
341
|
if (e.length === 0) return;
|
|
302
|
-
let { accepted: t, rejected: n } =
|
|
303
|
-
allowedExtensions:
|
|
304
|
-
maxFileBytes:
|
|
305
|
-
maxTotalBytes:
|
|
342
|
+
let { accepted: t, rejected: n } = Fe(e, a, {
|
|
343
|
+
allowedExtensions: c,
|
|
344
|
+
maxFileBytes: te,
|
|
345
|
+
maxTotalBytes: ne
|
|
306
346
|
});
|
|
307
|
-
|
|
308
|
-
}, { isDragActive:
|
|
309
|
-
let t =
|
|
310
|
-
|
|
311
|
-
},
|
|
312
|
-
|
|
313
|
-
},
|
|
314
|
-
if (
|
|
315
|
-
let e = await
|
|
316
|
-
e &&
|
|
347
|
+
U(n), t.length > 0 && s([...a, ...t]), ye([t.length > 0 ? T.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => T.fileRejections[t](e))].filter(Boolean).join(" "));
|
|
348
|
+
}, { isDragActive: Oe, handlers: ke } = Se(X), je = (e) => {
|
|
349
|
+
let t = a.find((t) => t.id === e);
|
|
350
|
+
s(a.filter((t) => t.id !== e)), U([]), t && ye(T.fileRemovedStatus(t.name));
|
|
351
|
+
}, Me = (e) => {
|
|
352
|
+
X(Array.from(e.target.files ?? [])), e.target.value = "";
|
|
353
|
+
}, Ne = async () => {
|
|
354
|
+
if (p) try {
|
|
355
|
+
let e = await p();
|
|
356
|
+
e && X(e);
|
|
317
357
|
} catch {}
|
|
318
|
-
},
|
|
319
|
-
key:
|
|
320
|
-
label:
|
|
321
|
-
onClick: () =>
|
|
322
|
-
}, ...
|
|
323
|
-
key:
|
|
324
|
-
label:
|
|
325
|
-
onClick: () => void
|
|
326
|
-
}] : []],
|
|
327
|
-
!
|
|
328
|
-
}, { colors:
|
|
329
|
-
"--pcf-helper-text":
|
|
330
|
-
"--pcf-
|
|
331
|
-
"--pcf-meter-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
358
|
+
}, Pe = [{
|
|
359
|
+
key: Be,
|
|
360
|
+
label: T.addFromDeviceLabel,
|
|
361
|
+
onClick: () => fe.current?.click()
|
|
362
|
+
}, ...p ? [{
|
|
363
|
+
key: Ve,
|
|
364
|
+
label: T.addFromFileManagerLabel,
|
|
365
|
+
onClick: () => void Ne()
|
|
366
|
+
}] : []], Ie = () => {
|
|
367
|
+
!we && (!W.current || W.current.aborted) && x();
|
|
368
|
+
}, { colors: Z, typography: Q } = D ?? {}, He = Q?.titleClassName ?? "dial-h1-text", $ = l(Q?.labelClassName ?? "dial-tiny-semi-text", Re.label), Ue = Q?.helperClassName ?? "dial-tiny-text", We = ee({
|
|
369
|
+
"--pcf-helper-text": Z?.helperText,
|
|
370
|
+
"--pcf-label-text": Z?.labelText,
|
|
371
|
+
"--pcf-meter-track": Z?.meterTrack,
|
|
372
|
+
"--pcf-meter-fill": Z?.meterFill
|
|
373
|
+
}), Ge = T.refinement, Ke = r.context, qe = !!Ke;
|
|
374
|
+
return /* @__PURE__ */ B("div", {
|
|
375
|
+
className: l("relative flex h-full min-h-0 w-full", se),
|
|
376
|
+
...ke,
|
|
336
377
|
children: [
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
isVisible:
|
|
378
|
+
/* @__PURE__ */ z(me, {
|
|
379
|
+
isVisible: Oe,
|
|
339
380
|
labels: {
|
|
340
|
-
title:
|
|
341
|
-
subtitle:
|
|
381
|
+
title: T.dropOverlayTitle,
|
|
382
|
+
subtitle: T.dropOverlaySubtitle
|
|
342
383
|
}
|
|
343
384
|
}),
|
|
344
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ z(he, {
|
|
345
386
|
labels: {
|
|
346
|
-
title:
|
|
347
|
-
backButtonLabel:
|
|
348
|
-
cancelButtonLabel:
|
|
349
|
-
submitButtonLabel:
|
|
350
|
-
submittingLabel:
|
|
387
|
+
title: T.title,
|
|
388
|
+
backButtonLabel: T.backLabel,
|
|
389
|
+
cancelButtonLabel: T.cancelLabel,
|
|
390
|
+
submitButtonLabel: T.createLabel,
|
|
391
|
+
submittingLabel: T.submittingLabel ?? T.createLabel
|
|
351
392
|
},
|
|
352
|
-
onBack:
|
|
353
|
-
onCancel:
|
|
354
|
-
onSubmit:
|
|
355
|
-
isCancelDisabled:
|
|
356
|
-
isSubmitDisabled:
|
|
357
|
-
isSubmitting:
|
|
358
|
-
backIcon: /* @__PURE__ */
|
|
393
|
+
onBack: y,
|
|
394
|
+
onCancel: b,
|
|
395
|
+
onSubmit: Ie,
|
|
396
|
+
isCancelDisabled: S,
|
|
397
|
+
isSubmitDisabled: we,
|
|
398
|
+
isSubmitting: S,
|
|
399
|
+
backIcon: /* @__PURE__ */ z(le, {
|
|
359
400
|
size: m.LG,
|
|
360
401
|
stroke: h,
|
|
361
402
|
"aria-hidden": !0,
|
|
362
403
|
className: "rtl:scale-x-[-1]"
|
|
363
404
|
}),
|
|
364
405
|
styles: {
|
|
365
|
-
colors: { background:
|
|
406
|
+
colors: { background: Z?.background },
|
|
366
407
|
header: {
|
|
367
|
-
colors: { borderColor:
|
|
368
|
-
typography: { fontClassName:
|
|
408
|
+
colors: { borderColor: Z?.headerBorder },
|
|
409
|
+
typography: { fontClassName: He }
|
|
369
410
|
},
|
|
370
|
-
cssVars:
|
|
411
|
+
cssVars: We
|
|
371
412
|
},
|
|
372
|
-
children: /* @__PURE__ */
|
|
373
|
-
className: l("mx-auto flex w-full max-w-[
|
|
413
|
+
children: /* @__PURE__ */ B("div", {
|
|
414
|
+
className: l("mx-auto flex w-full max-w-[1040px] min-w-0 flex-col gap-5 py-6", Re.formColumn),
|
|
374
415
|
children: [
|
|
375
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ B("div", {
|
|
376
417
|
className: "flex flex-col gap-1",
|
|
377
|
-
children: [/* @__PURE__ */
|
|
378
|
-
id:
|
|
379
|
-
inputRef:
|
|
418
|
+
children: [/* @__PURE__ */ z(C, {
|
|
419
|
+
id: ue,
|
|
420
|
+
inputRef: N,
|
|
380
421
|
value: n.name,
|
|
381
422
|
onChange: (e) => i("name", e ?? ""),
|
|
382
|
-
onBlur: () =>
|
|
383
|
-
placeholder:
|
|
423
|
+
onBlur: () => _e(!0),
|
|
424
|
+
placeholder: T.namePlaceholder,
|
|
384
425
|
labelProps: {
|
|
385
|
-
label:
|
|
426
|
+
label: T.nameLabel,
|
|
386
427
|
required: !0
|
|
387
428
|
},
|
|
388
429
|
required: !0,
|
|
389
430
|
"aria-required": !0,
|
|
390
|
-
invalid: !!
|
|
391
|
-
"aria-invalid": !!
|
|
392
|
-
"aria-describedby":
|
|
393
|
-
}),
|
|
394
|
-
id:
|
|
431
|
+
invalid: !!Y,
|
|
432
|
+
"aria-invalid": !!Y,
|
|
433
|
+
"aria-describedby": Y ? O : void 0
|
|
434
|
+
}), Y && /* @__PURE__ */ z(v, {
|
|
435
|
+
id: O,
|
|
395
436
|
role: r.name ? "alert" : void 0,
|
|
396
|
-
className:
|
|
397
|
-
text:
|
|
437
|
+
className: Ue,
|
|
438
|
+
text: Y
|
|
398
439
|
})]
|
|
399
440
|
}),
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
-
isEnabled: !!
|
|
402
|
-
fieldId:
|
|
403
|
-
label:
|
|
441
|
+
/* @__PURE__ */ z(o, {
|
|
442
|
+
isEnabled: !!g,
|
|
443
|
+
fieldId: k,
|
|
444
|
+
label: T.descriptionLabel,
|
|
404
445
|
labelClassName: $,
|
|
405
|
-
labels:
|
|
446
|
+
labels: Ge,
|
|
406
447
|
refinement: K,
|
|
407
|
-
disabled:
|
|
408
|
-
children: /* @__PURE__ */
|
|
409
|
-
id:
|
|
448
|
+
disabled: S || J,
|
|
449
|
+
children: /* @__PURE__ */ z(E, {
|
|
450
|
+
id: k,
|
|
410
451
|
value: n.description,
|
|
411
452
|
onChange: (e) => {
|
|
412
453
|
K.reset(), i("description", e);
|
|
413
454
|
},
|
|
414
|
-
placeholder:
|
|
415
|
-
labelProps:
|
|
455
|
+
placeholder: T.descriptionPlaceholder,
|
|
456
|
+
labelProps: g ? void 0 : { label: T.descriptionLabel }
|
|
416
457
|
})
|
|
417
458
|
}),
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
isEnabled: !!
|
|
420
|
-
fieldId:
|
|
421
|
-
label:
|
|
459
|
+
/* @__PURE__ */ z(o, {
|
|
460
|
+
isEnabled: !!_,
|
|
461
|
+
fieldId: A,
|
|
462
|
+
label: T.instructionsLabel,
|
|
422
463
|
labelClassName: $,
|
|
423
|
-
labels:
|
|
464
|
+
labels: Ge,
|
|
424
465
|
refinement: q,
|
|
425
|
-
disabled:
|
|
426
|
-
children: /* @__PURE__ */
|
|
427
|
-
className: "flex flex-1 flex-col gap-
|
|
428
|
-
children: [!
|
|
429
|
-
htmlFor:
|
|
466
|
+
disabled: S || J,
|
|
467
|
+
children: /* @__PURE__ */ B("div", {
|
|
468
|
+
className: "flex flex-1 flex-col gap-2",
|
|
469
|
+
children: [!_ && /* @__PURE__ */ z(w, {
|
|
470
|
+
htmlFor: A,
|
|
430
471
|
className: $,
|
|
431
|
-
label:
|
|
432
|
-
}), /* @__PURE__ */
|
|
433
|
-
ref:
|
|
472
|
+
label: T.instructionsLabel
|
|
473
|
+
}), /* @__PURE__ */ z("div", {
|
|
474
|
+
ref: ge,
|
|
434
475
|
className: l("w-full", e, t),
|
|
435
|
-
children: /* @__PURE__ */
|
|
436
|
-
fallback: /* @__PURE__ */
|
|
437
|
-
children: /* @__PURE__ */
|
|
438
|
-
id:
|
|
476
|
+
children: /* @__PURE__ */ z(j, {
|
|
477
|
+
fallback: /* @__PURE__ */ z(ce, {}),
|
|
478
|
+
children: /* @__PURE__ */ z(ze, {
|
|
479
|
+
id: A,
|
|
439
480
|
value: n.instructions,
|
|
440
481
|
onChange: (e) => {
|
|
441
482
|
q.reset(), i("instructions", e);
|
|
442
483
|
},
|
|
443
|
-
height:
|
|
444
|
-
theme:
|
|
445
|
-
placeholder:
|
|
484
|
+
height: 176,
|
|
485
|
+
theme: oe,
|
|
486
|
+
placeholder: T.instructionsPlaceholder
|
|
446
487
|
})
|
|
447
488
|
})
|
|
448
489
|
})]
|
|
449
490
|
})
|
|
450
491
|
}),
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
-
"aria-labelledby":
|
|
453
|
-
className: "flex flex-col gap-
|
|
492
|
+
/* @__PURE__ */ B("section", {
|
|
493
|
+
"aria-labelledby": M,
|
|
494
|
+
className: "flex flex-col gap-2",
|
|
454
495
|
children: [
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
className: "flex min-w-0 items-center justify-between gap-2",
|
|
457
|
-
children: [/* @__PURE__ */
|
|
458
|
-
id:
|
|
496
|
+
/* @__PURE__ */ B("div", {
|
|
497
|
+
className: "flex min-w-0 flex-wrap items-center justify-between gap-2",
|
|
498
|
+
children: [/* @__PURE__ */ z("h2", {
|
|
499
|
+
id: M,
|
|
459
500
|
className: $,
|
|
460
|
-
children:
|
|
461
|
-
}), /* @__PURE__ */
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
501
|
+
children: T.contextLabel
|
|
502
|
+
}), /* @__PURE__ */ B("div", {
|
|
503
|
+
className: "flex min-w-0 items-center gap-4",
|
|
504
|
+
children: [/* @__PURE__ */ z(Le, {
|
|
505
|
+
usedBytes: Te,
|
|
506
|
+
maxBytes: ne,
|
|
507
|
+
ariaLabel: T.capacityMeterLabel,
|
|
508
|
+
formatLabel: T.capacityLabel,
|
|
509
|
+
textClassName: Ue
|
|
510
|
+
}), /* @__PURE__ */ z(f, {
|
|
511
|
+
items: Pe,
|
|
512
|
+
label: T.addLabel,
|
|
513
|
+
variant: re.Neutral,
|
|
514
|
+
size: ie.Small,
|
|
515
|
+
disabled: S
|
|
516
|
+
})]
|
|
472
517
|
})]
|
|
473
518
|
}),
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
ref:
|
|
519
|
+
/* @__PURE__ */ z("input", {
|
|
520
|
+
ref: fe,
|
|
476
521
|
type: "file",
|
|
477
522
|
multiple: !0,
|
|
478
|
-
accept:
|
|
523
|
+
accept: Ee,
|
|
479
524
|
tabIndex: -1,
|
|
480
525
|
"aria-hidden": !0,
|
|
481
526
|
className: "sr-only",
|
|
482
|
-
onChange:
|
|
527
|
+
onChange: Me
|
|
483
528
|
}),
|
|
484
|
-
/* @__PURE__ */
|
|
485
|
-
label:
|
|
486
|
-
description:
|
|
487
|
-
accept:
|
|
529
|
+
/* @__PURE__ */ z(ae, {
|
|
530
|
+
label: T.dropZoneLabel,
|
|
531
|
+
description: T.dropZoneHint,
|
|
532
|
+
accept: Ee,
|
|
488
533
|
multiple: !0,
|
|
489
|
-
disabled:
|
|
490
|
-
onChange:
|
|
491
|
-
onReject:
|
|
534
|
+
disabled: S,
|
|
535
|
+
onChange: X,
|
|
536
|
+
onReject: X
|
|
492
537
|
}),
|
|
493
|
-
(
|
|
494
|
-
className: l("flex flex-col gap-1",
|
|
495
|
-
children: [
|
|
538
|
+
(H.length > 0 || qe) && /* @__PURE__ */ B("ul", {
|
|
539
|
+
className: l("flex flex-col gap-1", Ue, Re.helper),
|
|
540
|
+
children: [H.map(({ name: e, reason: t }) => /* @__PURE__ */ z("li", { children: T.fileRejections[t](e) }, `${t}:${e}`)), qe && /* @__PURE__ */ z("li", {
|
|
496
541
|
role: "alert",
|
|
497
|
-
children:
|
|
542
|
+
children: Ke
|
|
498
543
|
})]
|
|
499
544
|
}),
|
|
500
|
-
|
|
501
|
-
className: "flex min-w-0 flex-wrap gap-2",
|
|
502
|
-
children:
|
|
545
|
+
a.length > 0 && /* @__PURE__ */ z("ul", {
|
|
546
|
+
className: "flex min-w-0 flex-wrap gap-2 pt-1",
|
|
547
|
+
children: a.map((e) => /* @__PURE__ */ z("li", {
|
|
503
548
|
className: "min-w-0",
|
|
504
|
-
children: /* @__PURE__ */
|
|
549
|
+
children: /* @__PURE__ */ z(pe, {
|
|
505
550
|
attachment: e,
|
|
506
|
-
onRemove:
|
|
507
|
-
labels: { removeLabel:
|
|
551
|
+
onRemove: je,
|
|
552
|
+
labels: { removeLabel: T.removeFileLabel(e.name) }
|
|
508
553
|
})
|
|
509
554
|
}, e.id))
|
|
510
|
-
}),
|
|
511
|
-
/* @__PURE__ */ A(De, {
|
|
512
|
-
usedBytes: Ne,
|
|
513
|
-
maxBytes: g,
|
|
514
|
-
ariaLabel: M.capacityMeterLabel,
|
|
515
|
-
formatLabel: M.capacityLabel,
|
|
516
|
-
textClassName: We
|
|
517
555
|
})
|
|
518
556
|
]
|
|
519
557
|
})
|
|
520
558
|
]
|
|
521
559
|
})
|
|
522
560
|
}),
|
|
523
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ z("span", {
|
|
524
562
|
role: "status",
|
|
525
563
|
"aria-live": "polite",
|
|
526
564
|
className: "sr-only",
|
|
527
|
-
children:
|
|
565
|
+
children: S ? T.creatingStatus : ve
|
|
528
566
|
})
|
|
529
567
|
]
|
|
530
568
|
});
|
|
531
|
-
}
|
|
569
|
+
}, $ = {
|
|
570
|
+
container: "_container_16lvl_1",
|
|
571
|
+
header: "_header_16lvl_5",
|
|
572
|
+
title: "_title_16lvl_9",
|
|
573
|
+
body: "_body_16lvl_13",
|
|
574
|
+
secondary: "_secondary_16lvl_17",
|
|
575
|
+
panel: "_panel_16lvl_21"
|
|
576
|
+
}, Ue = (e) => ({
|
|
577
|
+
id: e.name,
|
|
578
|
+
name: e.name,
|
|
579
|
+
contentType: e.contentType,
|
|
580
|
+
type: s(e.contentType),
|
|
581
|
+
status: a.Idle
|
|
582
|
+
}), We = N(({ project: e, isLoading: t = !1, hasError: r = !1, isNotFound: a = !1, isPinned: o, isPinPending: s = !1, contextSearchQuery: c, onContextSearchQueryChange: u, onBack: d, onTogglePin: ne, onPublish: f, onEdit: p, onShare: ie, onDelete: v, onDownload: ae, onOpenFile: y, onRetry: S, onBrowseProjects: C, labels: w, styles: T }) => {
|
|
583
|
+
let { colors: E, typography: D } = T ?? {}, A = D?.titleClassName ?? "dial-h2-text", j = D?.panelTitleClassName ?? "dial-body-semi-text", M = D?.sectionTitleClassName ?? "dial-tiny-text", N = D?.bodyClassName ?? "dial-small-text", P = D?.helperClassName ?? "dial-tiny-text", de = D?.instructionsHeadingClassName ?? "dial-small-semi-text", L = ee({
|
|
584
|
+
"--pv-bg": E?.background,
|
|
585
|
+
"--pv-border": E?.border,
|
|
586
|
+
"--pv-heading-text": E?.headingText,
|
|
587
|
+
"--pv-body-text": E?.bodyText,
|
|
588
|
+
"--pv-secondary-text": E?.secondaryText
|
|
589
|
+
}), R = I(() => e?.contextFiles ?? [], [e]), me = I(() => Z(R, c), [R, c]), he = c.trim(), ge = F(), V = I(() => {
|
|
590
|
+
let e = l("mb-1 mt-3 first:mt-0", de);
|
|
591
|
+
return {
|
|
592
|
+
h1: e,
|
|
593
|
+
h2: e,
|
|
594
|
+
h3: e,
|
|
595
|
+
h4: e,
|
|
596
|
+
h5: e,
|
|
597
|
+
h6: e,
|
|
598
|
+
p: N,
|
|
599
|
+
ul: N,
|
|
600
|
+
ol: N
|
|
601
|
+
};
|
|
602
|
+
}, [N, de]), _e = (e) => {
|
|
603
|
+
let t = [];
|
|
604
|
+
return e && f && t.push({
|
|
605
|
+
key: "publish",
|
|
606
|
+
label: w.publishLabel,
|
|
607
|
+
onClick: f
|
|
608
|
+
}), e && p && t.push({
|
|
609
|
+
key: "edit",
|
|
610
|
+
label: w.editLabel,
|
|
611
|
+
onClick: p
|
|
612
|
+
}), ie && t.push({
|
|
613
|
+
key: "share",
|
|
614
|
+
label: w.shareLabel,
|
|
615
|
+
onClick: ie
|
|
616
|
+
}), t.push({
|
|
617
|
+
key: "download",
|
|
618
|
+
label: w.downloadLabel,
|
|
619
|
+
onClick: ae
|
|
620
|
+
}), v && t.push({
|
|
621
|
+
key: "delete",
|
|
622
|
+
label: w.deleteLabel,
|
|
623
|
+
danger: !0,
|
|
624
|
+
onClick: v
|
|
625
|
+
}), t;
|
|
626
|
+
}, H = (e, t) => /* @__PURE__ */ z("div", {
|
|
627
|
+
className: t,
|
|
628
|
+
children: /* @__PURE__ */ z(g, {
|
|
629
|
+
items: _e(e),
|
|
630
|
+
matchReferenceWidth: !1,
|
|
631
|
+
listClassName: "w-[200px]",
|
|
632
|
+
children: /* @__PURE__ */ z(x, {
|
|
633
|
+
icon: /* @__PURE__ */ z(ue, {
|
|
634
|
+
size: m.MD,
|
|
635
|
+
"aria-hidden": !0,
|
|
636
|
+
stroke: h
|
|
637
|
+
}),
|
|
638
|
+
"aria-label": w.moreActionsLabel
|
|
639
|
+
})
|
|
640
|
+
})
|
|
641
|
+
});
|
|
642
|
+
return t || r || a || e == null ? /* @__PURE__ */ z("div", {
|
|
643
|
+
style: L,
|
|
644
|
+
className: l("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
|
|
645
|
+
children: t ? /* @__PURE__ */ z(ce, {}) : r ? /* @__PURE__ */ B("div", {
|
|
646
|
+
className: "flex flex-col items-center gap-3",
|
|
647
|
+
children: [/* @__PURE__ */ z("p", {
|
|
648
|
+
role: "alert",
|
|
649
|
+
className: l(N, $.body),
|
|
650
|
+
children: w.errorLabel
|
|
651
|
+
}), /* @__PURE__ */ z(b, {
|
|
652
|
+
label: w.retryLabel,
|
|
653
|
+
onClick: S
|
|
654
|
+
})]
|
|
655
|
+
}) : /* @__PURE__ */ B("div", {
|
|
656
|
+
className: "flex flex-col items-center gap-3",
|
|
657
|
+
children: [/* @__PURE__ */ z("p", {
|
|
658
|
+
role: "alert",
|
|
659
|
+
className: l(N, $.body),
|
|
660
|
+
children: w.notFoundLabel
|
|
661
|
+
}), /* @__PURE__ */ z(b, {
|
|
662
|
+
label: w.browseProjectsLabel,
|
|
663
|
+
onClick: C
|
|
664
|
+
})]
|
|
665
|
+
})
|
|
666
|
+
}) : /* @__PURE__ */ B("div", {
|
|
667
|
+
style: L,
|
|
668
|
+
className: l("flex h-full w-full min-w-0 flex-col overflow-y-auto", $.container),
|
|
669
|
+
children: [/* @__PURE__ */ B("header", {
|
|
670
|
+
className: l("flex min-w-0 items-center gap-2 px-4 py-3 desktop:px-8", $.header),
|
|
671
|
+
children: [
|
|
672
|
+
/* @__PURE__ */ z(x, {
|
|
673
|
+
icon: /* @__PURE__ */ z(le, {
|
|
674
|
+
size: m.LG,
|
|
675
|
+
className: "rtl:scale-x-[-1]",
|
|
676
|
+
"aria-hidden": !0,
|
|
677
|
+
stroke: h
|
|
678
|
+
}),
|
|
679
|
+
"aria-label": w.backLabel,
|
|
680
|
+
onClick: d
|
|
681
|
+
}),
|
|
682
|
+
/* @__PURE__ */ z("h1", {
|
|
683
|
+
className: l("min-w-0 flex-1", A, $.title),
|
|
684
|
+
children: /* @__PURE__ */ z(_, { text: e.name })
|
|
685
|
+
}),
|
|
686
|
+
/* @__PURE__ */ z(x, {
|
|
687
|
+
icon: o ? /* @__PURE__ */ z(k, {
|
|
688
|
+
size: m.MD,
|
|
689
|
+
"aria-hidden": !0
|
|
690
|
+
}) : /* @__PURE__ */ z(O, {
|
|
691
|
+
size: m.MD,
|
|
692
|
+
"aria-hidden": !0,
|
|
693
|
+
stroke: h
|
|
694
|
+
}),
|
|
695
|
+
"aria-label": w.pinLabel,
|
|
696
|
+
"aria-pressed": o,
|
|
697
|
+
"aria-disabled": s || void 0,
|
|
698
|
+
onClick: () => {
|
|
699
|
+
s || ne();
|
|
700
|
+
}
|
|
701
|
+
}),
|
|
702
|
+
f && /* @__PURE__ */ z(oe, {
|
|
703
|
+
label: w.publishLabel,
|
|
704
|
+
onClick: f,
|
|
705
|
+
className: "hidden shrink-0 desktop:inline-flex"
|
|
706
|
+
}),
|
|
707
|
+
p && /* @__PURE__ */ z(te, {
|
|
708
|
+
label: w.editLabel,
|
|
709
|
+
variant: re.Primary,
|
|
710
|
+
onClick: p,
|
|
711
|
+
className: "hidden shrink-0 desktop:inline-flex"
|
|
712
|
+
}),
|
|
713
|
+
H(!1, "hidden desktop:block"),
|
|
714
|
+
H(!0, "desktop:hidden")
|
|
715
|
+
]
|
|
716
|
+
}), /* @__PURE__ */ z("div", {
|
|
717
|
+
className: "flex min-w-0 flex-1 flex-col desktop:flex-row desktop:justify-end",
|
|
718
|
+
children: /* @__PURE__ */ B("aside", {
|
|
719
|
+
"aria-labelledby": ge,
|
|
720
|
+
className: l("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:w-[488px] desktop:shrink-0 desktop:border-s desktop:border-t-0 desktop:px-8", $.panel),
|
|
721
|
+
children: [
|
|
722
|
+
/* @__PURE__ */ z("h2", {
|
|
723
|
+
id: ge,
|
|
724
|
+
className: l(j, $.title),
|
|
725
|
+
children: w.detailsLabel
|
|
726
|
+
}),
|
|
727
|
+
e.description !== "" && /* @__PURE__ */ B("section", {
|
|
728
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
729
|
+
children: [/* @__PURE__ */ z("h3", {
|
|
730
|
+
className: l(M, $.secondary),
|
|
731
|
+
children: w.descriptionLabel
|
|
732
|
+
}), /* @__PURE__ */ z("p", {
|
|
733
|
+
className: l("break-words whitespace-pre-line", N, $.body),
|
|
734
|
+
children: e.description
|
|
735
|
+
})]
|
|
736
|
+
}),
|
|
737
|
+
e.instructions !== "" && /* @__PURE__ */ B("section", {
|
|
738
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
739
|
+
children: [/* @__PURE__ */ z("h3", {
|
|
740
|
+
className: l(M, $.secondary),
|
|
741
|
+
children: w.instructionsLabel
|
|
742
|
+
}), /* @__PURE__ */ z("div", {
|
|
743
|
+
className: l("min-w-0 break-words", N, $.body),
|
|
744
|
+
children: /* @__PURE__ */ z(n, {
|
|
745
|
+
content: e.instructions,
|
|
746
|
+
classNames: V
|
|
747
|
+
})
|
|
748
|
+
})]
|
|
749
|
+
}),
|
|
750
|
+
/* @__PURE__ */ B("section", {
|
|
751
|
+
className: "flex min-w-0 flex-col gap-2",
|
|
752
|
+
children: [/* @__PURE__ */ z("h3", {
|
|
753
|
+
className: l(M, $.secondary),
|
|
754
|
+
children: w.contextLabel
|
|
755
|
+
}), R.length === 0 ? /* @__PURE__ */ z(i, { label: w.emptyContextLabel }) : /* @__PURE__ */ B(fe, { children: [
|
|
756
|
+
/* @__PURE__ */ z("div", {
|
|
757
|
+
role: "search",
|
|
758
|
+
children: /* @__PURE__ */ z(se, {
|
|
759
|
+
value: c,
|
|
760
|
+
onChange: (e) => u(e ?? ""),
|
|
761
|
+
placeholder: w.contextSearchPlaceholder,
|
|
762
|
+
clearLabel: w.clearSearchLabel,
|
|
763
|
+
"aria-label": w.contextSearchAriaLabel
|
|
764
|
+
})
|
|
765
|
+
}),
|
|
766
|
+
me.length === 0 ? /* @__PURE__ */ z("p", {
|
|
767
|
+
className: l(P, $.secondary),
|
|
768
|
+
children: w.noContextMatchesLabel
|
|
769
|
+
}) : /* @__PURE__ */ z("ul", {
|
|
770
|
+
className: "m-0 flex min-w-0 list-none flex-wrap gap-2 p-0 pt-2",
|
|
771
|
+
children: me.map((e) => /* @__PURE__ */ z("li", {
|
|
772
|
+
className: "min-w-0",
|
|
773
|
+
children: /* @__PURE__ */ z(pe, {
|
|
774
|
+
attachment: Ue(e),
|
|
775
|
+
searchQuery: he,
|
|
776
|
+
onClick: y,
|
|
777
|
+
labels: { clickLabel: w.openFileLabel(e.name) }
|
|
778
|
+
})
|
|
779
|
+
}, e.name))
|
|
780
|
+
}),
|
|
781
|
+
/* @__PURE__ */ z("span", {
|
|
782
|
+
role: "status",
|
|
783
|
+
"aria-live": "polite",
|
|
784
|
+
className: "sr-only",
|
|
785
|
+
children: he === "" ? "" : w.contextResultCountLabel(me.length)
|
|
786
|
+
})
|
|
787
|
+
] })]
|
|
788
|
+
})
|
|
789
|
+
]
|
|
790
|
+
})
|
|
791
|
+
})]
|
|
792
|
+
});
|
|
793
|
+
});
|
|
532
794
|
//#endregion
|
|
533
|
-
export {
|
|
795
|
+
export { q as ContextFileRejection, Ce as PROJECT_NAME_MAX_BYTES, He as ProjectCreateForm, J as ProjectNameError, xe as ProjectSource, We as ProjectView, be as Projects, V as ProjectsSortKey, Fe as checkContextFiles, Z as filterContextFileItems, Ae as getContextFilesSize, Oe as isStoredContextFile, De as validateProjectName };
|