@epam/ai-dial-builder-form 1.3.0-dev.29 → 1.3.0-dev.290
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/AddAvatar/AddAvatar.d.ts.map +1 -1
- package/components/AvatarPickerModal/AvatarPickerModal.d.ts.map +1 -1
- package/components/BuilderFormHeader/BuilderFormHeader.d.ts.map +1 -1
- package/components/DeploymentCreationForm/DeploymentCreationForm.d.ts.map +1 -1
- package/components/DeploymentLocalesField/DeploymentLocalesField.d.ts +5 -3
- package/components/DeploymentLocalesField/DeploymentLocalesField.d.ts.map +1 -1
- package/components/EditorLayout/EditorLayout.d.ts.map +1 -1
- package/components/EditorSection/EditorSection.d.ts.map +1 -1
- package/components/EntityEditor/EntityEditor.d.ts.map +1 -1
- package/components/MetadataForm/MetadataForm.d.ts.map +1 -1
- package/index.css +3 -2
- package/index.d.ts +4 -4
- package/index.d.ts.map +1 -1
- package/index.js +367 -317
- package/models/add-avatar-props.d.ts +2 -0
- package/models/add-avatar-props.d.ts.map +1 -1
- package/models/avatar-picker-modal.d.ts +16 -0
- package/models/avatar-picker-modal.d.ts.map +1 -1
- package/models/deployment-creation-form.d.ts +14 -1
- package/models/deployment-creation-form.d.ts.map +1 -1
- package/models/editor-layout-props.d.ts +26 -0
- package/models/editor-layout-props.d.ts.map +1 -1
- package/models/editor-section-props.d.ts +7 -0
- package/models/editor-section-props.d.ts.map +1 -1
- package/models/entity-editor-props.d.ts +4 -2
- package/models/entity-editor-props.d.ts.map +1 -1
- package/models/metadata-form-props.d.ts +5 -1
- package/models/metadata-form-props.d.ts.map +1 -1
- package/models/validation.d.ts +1 -1
- package/package.json +4 -4
- package/utils/clamp-left-column-width.d.ts +19 -0
- package/utils/clamp-left-column-width.d.ts.map +1 -0
- package/utils/validate-deployment-creation-fields.d.ts +1 -6
- package/utils/validate-deployment-creation-fields.d.ts.map +1 -1
package/index.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
import { ENTITY_DESCRIPTION_MAX_LENGTH as e, ENTITY_NAME_MAX_LENGTH as t, RESIZABLE_TEXTAREA_CLASS_NAME as n, TAG_INPUT_TAG_CLASS_NAME as r, buildCssVars as i, exceedsMaxLength as a, hasControlCharacters as o, mergeClasses as s } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { ButtonAppearance as c, ButtonVariant as l, DIAL_ICON_SIZE as u, DIAL_KIT_ICON_STROKE as d, DangerIconButton as f, ElementSize as p, GhostButton as m, GhostIconButton as h, Input as g, Label as _, LinkButton as v,
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { IconArrowLeft as
|
|
5
|
-
import { Suspense as
|
|
2
|
+
import { ButtonAppearance as c, ButtonVariant as l, DIAL_ICON_SIZE as u, DIAL_KIT_ICON_STROKE as d, DangerIconButton as f, ElementSize as p, GhostButton as m, GhostIconButton as h, Input as g, Label as _, LinkButton as v, LiveRegion as y, LiveRegionElement as b, LiveRegionPoliteness as x, NeutralButton as S, Popup as C, PrimaryButton as w, ResizeHandle as T, Select as E, Spinner as D, TagInput as O, Textarea as k, TextareaResize as A } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
4
|
+
import { IconArrowLeft as P, IconArrowNarrowLeft as F, IconPhoto as I, IconPlus as L, IconTrashX as ee } from "@tabler/icons-react";
|
|
5
|
+
import { Suspense as te, memo as ne, useCallback as R, useEffect as z, useId as B, useLayoutEffect as V, useMemo as H, useRef as U, useState as W } from "react";
|
|
6
6
|
//#region src/components/BuilderFormActions/BuilderFormActions.tsx
|
|
7
|
-
var
|
|
7
|
+
var G = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubmitDisabled: i = !1, isSubmitting: a = !1, buttonClassName: o }) => /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(S, {
|
|
8
8
|
label: e.cancelButtonLabel,
|
|
9
9
|
onClick: t,
|
|
10
10
|
disabled: r,
|
|
11
11
|
className: o
|
|
12
|
-
}), /* @__PURE__ */
|
|
12
|
+
}), /* @__PURE__ */ M(w, {
|
|
13
13
|
label: e.submitButtonLabel,
|
|
14
14
|
onClick: n,
|
|
15
15
|
disabled: i,
|
|
16
16
|
"aria-busy": a,
|
|
17
17
|
className: o,
|
|
18
|
-
iconBefore: a ? /* @__PURE__ */
|
|
18
|
+
iconBefore: a ? /* @__PURE__ */ M("span", {
|
|
19
19
|
"aria-hidden": !0,
|
|
20
|
-
children: /* @__PURE__ */
|
|
20
|
+
children: /* @__PURE__ */ M(D, { size: u.SM })
|
|
21
21
|
}) : void 0
|
|
22
|
-
})] }),
|
|
22
|
+
})] }), K = {
|
|
23
23
|
body: "_body_1xd7h_2",
|
|
24
24
|
sideColumn: "_sideColumn_1xd7h_6",
|
|
25
25
|
reservedColumn: "_reservedColumn_1xd7h_10"
|
|
26
|
-
},
|
|
26
|
+
}, re = s("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", K.sideColumn), ie = ({ left: e, children: t, metadata: n, layout: r }) => {
|
|
27
27
|
let i = e != null && n == null && r?.reserveEndColumn !== !1, a = r ? { "--bfb-side-column-width": r.sideColumnWidth ?? "400px" } : void 0, o = r ? { columnGap: r.columnGap ?? "0px" } : void 0;
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
className: s("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
|
|
28
|
+
return /* @__PURE__ */ N("div", {
|
|
29
|
+
className: s("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden", K.body),
|
|
30
30
|
style: o,
|
|
31
31
|
children: [
|
|
32
|
-
e != null && /* @__PURE__ */
|
|
33
|
-
className:
|
|
32
|
+
e != null && /* @__PURE__ */ M("div", {
|
|
33
|
+
className: re,
|
|
34
34
|
style: a,
|
|
35
35
|
children: e
|
|
36
36
|
}),
|
|
37
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ M("div", {
|
|
38
38
|
className: "flex w-full min-w-0 flex-1 flex-col desktop:min-h-0 desktop:overflow-y-auto",
|
|
39
39
|
children: t
|
|
40
40
|
}),
|
|
41
|
-
n != null && /* @__PURE__ */
|
|
42
|
-
className:
|
|
41
|
+
n != null && /* @__PURE__ */ M("div", {
|
|
42
|
+
className: re,
|
|
43
43
|
style: a,
|
|
44
44
|
children: n
|
|
45
45
|
}),
|
|
46
|
-
i && /* @__PURE__ */
|
|
46
|
+
i && /* @__PURE__ */ M("div", {
|
|
47
47
|
"aria-hidden": !0,
|
|
48
48
|
style: a,
|
|
49
|
-
className: s(
|
|
49
|
+
className: s(K.reservedColumn, K.sideColumn)
|
|
50
50
|
})
|
|
51
51
|
]
|
|
52
52
|
});
|
|
53
|
-
},
|
|
53
|
+
}, q = {
|
|
54
54
|
header: "_header_lon83_4",
|
|
55
55
|
actions: "_actions_lon83_18",
|
|
56
56
|
title: "_title_lon83_27"
|
|
57
|
-
},
|
|
58
|
-
let { colors: p, typography: m } = f ?? {}, g = m?.fontClassName ?? "dial-h1-text", _ = !!m?.fontClassName
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
className: s("flex min-h-16 shrink-0 items-center justify-between gap-2 px-4 py-2 desktop:h-16 desktop:flex-nowrap desktop:px-8 desktop:py-0",
|
|
57
|
+
}, ae = ({ labels: e, onBack: t, onCancel: n, onSubmit: r, isCancelDisabled: a = !1, isSubmitDisabled: o = !1, isSubmitting: c = !1, backIcon: l, styles: f }) => {
|
|
58
|
+
let { colors: p, typography: m } = f ?? {}, g = m?.fontClassName ?? "dial-h1-text", _ = !!m?.fontClassName, v = i({
|
|
59
|
+
"--bfh-border": p?.borderColor,
|
|
60
|
+
"--bfh-font-family": _ ? void 0 : m?.fontFamily
|
|
61
|
+
});
|
|
62
|
+
return /* @__PURE__ */ N("div", {
|
|
63
|
+
style: v,
|
|
64
|
+
className: s("flex min-h-16 shrink-0 items-center justify-between gap-2 px-4 py-2 desktop:h-16 desktop:flex-nowrap desktop:px-8 desktop:py-0", q.header),
|
|
65
65
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ N("div", {
|
|
67
67
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
68
|
-
children: [/* @__PURE__ */
|
|
69
|
-
icon: l === void 0 ? /* @__PURE__ */
|
|
68
|
+
children: [/* @__PURE__ */ M(h, {
|
|
69
|
+
icon: l === void 0 ? /* @__PURE__ */ M(P, {
|
|
70
70
|
size: u.LG,
|
|
71
71
|
className: "rtl:scale-x-[-1]",
|
|
72
72
|
"aria-hidden": !0,
|
|
@@ -74,14 +74,14 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
74
74
|
}) : l,
|
|
75
75
|
"aria-label": e.backButtonLabel,
|
|
76
76
|
onClick: t
|
|
77
|
-
}), /* @__PURE__ */
|
|
78
|
-
className: s("truncate",
|
|
77
|
+
}), /* @__PURE__ */ M("h1", {
|
|
78
|
+
className: s("truncate", q.title, g),
|
|
79
79
|
children: e.title
|
|
80
80
|
})]
|
|
81
81
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
className: s("items-center gap-2",
|
|
84
|
-
children: /* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ M("div", {
|
|
83
|
+
className: s("items-center gap-2", q.actions),
|
|
84
|
+
children: /* @__PURE__ */ M(G, {
|
|
85
85
|
labels: e,
|
|
86
86
|
onCancel: n,
|
|
87
87
|
onSubmit: r,
|
|
@@ -90,27 +90,26 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
90
90
|
isSubmitting: c
|
|
91
91
|
})
|
|
92
92
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
className: "sr-only",
|
|
93
|
+
/* @__PURE__ */ M(y, {
|
|
94
|
+
visuallyHidden: !0,
|
|
95
|
+
as: b.Span,
|
|
97
96
|
children: c ? e.submittingLabel ?? "Submitting" : ""
|
|
98
97
|
})
|
|
99
98
|
]
|
|
100
99
|
});
|
|
101
|
-
},
|
|
100
|
+
}, J = {
|
|
102
101
|
container: "_container_14mfe_1",
|
|
103
102
|
footer: "_footer_14mfe_10"
|
|
104
|
-
},
|
|
103
|
+
}, oe = ({ labels: e, onBack: t, onCancel: n, onSubmit: r, isCancelDisabled: a = !1, isSubmitDisabled: o = !1, isSubmitting: c = !1, backIcon: l, className: u, left: d, children: f, metadata: p, layout: m, styles: h }) => {
|
|
105
104
|
let { colors: g, header: _, cssVars: v } = h ?? {};
|
|
106
|
-
return /* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ N("div", {
|
|
107
106
|
style: {
|
|
108
107
|
...i({ "--bfc-bg": g?.background }),
|
|
109
108
|
...v
|
|
110
109
|
},
|
|
111
|
-
className: s("flex h-full min-h-0 w-full flex-col overflow-hidden", u,
|
|
110
|
+
className: s("flex h-full min-h-0 w-full flex-col overflow-hidden", u, J.container),
|
|
112
111
|
children: [
|
|
113
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ M(ae, {
|
|
114
113
|
labels: e,
|
|
115
114
|
onBack: t,
|
|
116
115
|
onCancel: n,
|
|
@@ -121,15 +120,15 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
121
120
|
backIcon: l,
|
|
122
121
|
styles: _
|
|
123
122
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ M(ie, {
|
|
125
124
|
left: d,
|
|
126
125
|
metadata: p,
|
|
127
126
|
layout: m,
|
|
128
127
|
children: f
|
|
129
128
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
className: s("sticky bottom-0 z-10 items-center gap-2 p-3 shadow-sm",
|
|
132
|
-
children: /* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ M("div", {
|
|
130
|
+
className: s("sticky bottom-0 z-10 items-center gap-2 p-3 shadow-sm", J.footer),
|
|
131
|
+
children: /* @__PURE__ */ M(G, {
|
|
133
132
|
labels: e,
|
|
134
133
|
onCancel: n,
|
|
135
134
|
onSubmit: r,
|
|
@@ -141,55 +140,68 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
141
140
|
})
|
|
142
141
|
]
|
|
143
142
|
});
|
|
144
|
-
},
|
|
143
|
+
}, Y = {
|
|
145
144
|
layout: "dial-builder-form-layout",
|
|
146
145
|
section: "dial-builder-form-section",
|
|
147
146
|
metadataSection: "dial-builder-form-metadata-section",
|
|
148
147
|
setupSection: "dial-builder-form-setup-section",
|
|
149
148
|
asideSection: "dial-builder-form-aside-section"
|
|
150
|
-
},
|
|
149
|
+
}, se = {
|
|
151
150
|
section: "_section_l1mnx_1",
|
|
152
151
|
title: "_title_l1mnx_5"
|
|
153
|
-
},
|
|
152
|
+
}, X = ({ title: e, children: t, styles: n, className: r }) => {
|
|
154
153
|
let a = i({
|
|
155
154
|
"--es-border-color": n?.colors?.borderColor,
|
|
156
155
|
"--es-title-color": n?.colors?.titleColor
|
|
157
156
|
});
|
|
158
|
-
return /* @__PURE__ */
|
|
159
|
-
className: s("flex h-full flex-col gap-4 rounded border
|
|
157
|
+
return /* @__PURE__ */ N("section", {
|
|
158
|
+
className: s("flex h-full flex-col gap-4 rounded border", se.section, r, Y.section),
|
|
160
159
|
style: a,
|
|
161
|
-
children: [e != null && /* @__PURE__ */
|
|
162
|
-
className: s("dial-h3-text",
|
|
160
|
+
children: [e != null && /* @__PURE__ */ M("h2", {
|
|
161
|
+
className: s(n?.typography?.titleClassName ?? "dial-h3-text", se.title),
|
|
163
162
|
children: e
|
|
164
163
|
}), t]
|
|
165
164
|
});
|
|
166
|
-
},
|
|
165
|
+
}, ce = (e, { min: t = 280, max: n = 640, containerWidth: r } = {}) => {
|
|
166
|
+
let i = r != null && r > 0 ? r - 360 : n;
|
|
167
|
+
return Math.round(Math.min(Math.max(t, Math.min(n, i)), Math.max(t, Number.isFinite(e) ? e : t)));
|
|
168
|
+
}, Z = {
|
|
167
169
|
headerBorder: "_headerBorder_1adw2_1",
|
|
168
170
|
footerBorder: "_footerBorder_1adw2_5",
|
|
169
171
|
columnBorder: "_columnBorder_1adw2_10"
|
|
170
|
-
},
|
|
171
|
-
let
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
}, le = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: r, leftContent: a, centerContent: o, rightContent: c, resizableLeftColumn: l, isSaving: f = !1, labels: p, styles: m, dir: g }) => {
|
|
173
|
+
let _ = B(), v = f ? p?.savingStatusLabel ?? "Saving" : "", x = U(null), [S, C] = W(), w = l != null && o != null, E = l?.minWidth, D = l?.maxWidth, O = {
|
|
174
|
+
min: E,
|
|
175
|
+
max: D,
|
|
176
|
+
containerWidth: S
|
|
177
|
+
}, k = w ? ce(l.width, O) : void 0, A = ce(D ?? 640, O);
|
|
178
|
+
z(() => {
|
|
179
|
+
let e = x.current;
|
|
180
|
+
if (!w || e == null || typeof ResizeObserver > "u") return;
|
|
181
|
+
let t = new ResizeObserver(() => C(e.clientWidth));
|
|
182
|
+
return t.observe(e), () => t.disconnect();
|
|
183
|
+
}, [w]);
|
|
184
|
+
let j = i({
|
|
185
|
+
"--el-header-border-color": m?.colors?.headerBorderColor,
|
|
186
|
+
"--el-sidebar-border-color": m?.colors?.sidebarBorderColor
|
|
174
187
|
});
|
|
175
|
-
return /* @__PURE__ */
|
|
176
|
-
dir:
|
|
177
|
-
className: s("flex min-h-0 flex-1 flex-col",
|
|
178
|
-
style:
|
|
188
|
+
return /* @__PURE__ */ N("div", {
|
|
189
|
+
dir: g,
|
|
190
|
+
className: s("flex min-h-0 flex-1 flex-col", Y.layout),
|
|
191
|
+
style: j,
|
|
179
192
|
children: [
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
children: _
|
|
193
|
+
/* @__PURE__ */ M(y, {
|
|
194
|
+
visuallyHidden: !0,
|
|
195
|
+
as: b.Span,
|
|
196
|
+
id: _,
|
|
197
|
+
children: v
|
|
186
198
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
className: s("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:
|
|
189
|
-
children: [/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ N("div", {
|
|
200
|
+
className: s("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pt-3 desktop:pb-3", Z.headerBorder),
|
|
201
|
+
children: [/* @__PURE__ */ N("div", {
|
|
190
202
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
191
|
-
children: [/* @__PURE__ */
|
|
192
|
-
icon: /* @__PURE__ */
|
|
203
|
+
children: [/* @__PURE__ */ M(h, {
|
|
204
|
+
icon: /* @__PURE__ */ M(F, {
|
|
193
205
|
size: u.LG,
|
|
194
206
|
stroke: d,
|
|
195
207
|
"aria-hidden": !0,
|
|
@@ -197,71 +209,85 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
197
209
|
}),
|
|
198
210
|
"aria-label": n,
|
|
199
211
|
onClick: t
|
|
200
|
-
}), /* @__PURE__ */
|
|
201
|
-
className: "dial-h2-text min-w-0 truncate",
|
|
212
|
+
}), /* @__PURE__ */ M("h1", {
|
|
213
|
+
className: s(m?.typography?.titleClassName ?? "dial-h2-text", "min-w-0 truncate"),
|
|
202
214
|
children: e
|
|
203
215
|
})]
|
|
204
|
-
}), r != null && /* @__PURE__ */
|
|
216
|
+
}), r != null && /* @__PURE__ */ M("div", {
|
|
205
217
|
className: "hidden shrink-0 items-center gap-2 desktop:flex",
|
|
206
218
|
children: r
|
|
207
219
|
})]
|
|
208
220
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ N("div", {
|
|
222
|
+
ref: x,
|
|
210
223
|
className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
|
|
211
224
|
children: [
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
-
className: s(o == null ? "desktop:flex-1" : "desktop:
|
|
225
|
+
/* @__PURE__ */ M("div", {
|
|
226
|
+
className: s(o == null ? "desktop:flex-1" : "desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", o != null && !w && "desktop:w-[400px]", w && "desktop:relative desktop:w-(--el-left-width)", "desktop:overflow-y-auto", o == null ? void 0 : Z.columnBorder),
|
|
227
|
+
style: k == null ? void 0 : { "--el-left-width": `${k}px` },
|
|
214
228
|
children: a
|
|
215
229
|
}),
|
|
216
|
-
|
|
230
|
+
w && k != null && /* @__PURE__ */ M("div", {
|
|
231
|
+
className: "relative hidden w-0 shrink-0 desktop:block",
|
|
232
|
+
children: /* @__PURE__ */ M(T, {
|
|
233
|
+
width: k,
|
|
234
|
+
minWidth: E ?? 280,
|
|
235
|
+
maxWidth: A,
|
|
236
|
+
defaultWidth: l.defaultWidth ?? 400,
|
|
237
|
+
onWidthChange: l.onWidthChange,
|
|
238
|
+
label: p?.resizeHandleLabel ?? "Resize columns",
|
|
239
|
+
tooltip: p?.resizeHandleTooltip ?? "Drag to resize"
|
|
240
|
+
})
|
|
241
|
+
}),
|
|
242
|
+
o != null && /* @__PURE__ */ M("div", {
|
|
217
243
|
className: "desktop:flex desktop:min-h-0 desktop:flex-1 desktop:flex-col desktop:overflow-y-auto",
|
|
218
244
|
children: o
|
|
219
245
|
}),
|
|
220
|
-
c != null && /* @__PURE__ */
|
|
221
|
-
className: s("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s",
|
|
246
|
+
c != null && /* @__PURE__ */ M("div", {
|
|
247
|
+
className: s("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s", Z.columnBorder),
|
|
222
248
|
children: c
|
|
223
249
|
})
|
|
224
250
|
]
|
|
225
251
|
}),
|
|
226
|
-
r != null && /* @__PURE__ */
|
|
227
|
-
className: s("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden
|
|
252
|
+
r != null && /* @__PURE__ */ M("div", {
|
|
253
|
+
className: s("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 *:flex-1 desktop:hidden", Z.footerBorder),
|
|
228
254
|
children: r
|
|
229
255
|
})
|
|
230
256
|
]
|
|
231
257
|
});
|
|
232
|
-
},
|
|
258
|
+
}, ue = {
|
|
233
259
|
box: "_box_c9as8_1",
|
|
234
260
|
icon: "_icon_c9as8_6",
|
|
235
261
|
caption: "_caption_c9as8_10"
|
|
236
|
-
},
|
|
237
|
-
let
|
|
238
|
-
"--aa-box-bg":
|
|
239
|
-
"--aa-box-border":
|
|
240
|
-
"--aa-icon":
|
|
241
|
-
"--aa-caption":
|
|
262
|
+
}, de = ({ label: e, avatarUrl: t, avatarAlt: n = "", addAvatarLabel: r = "Add avatar", captionText: a = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: o, captionClassName: c = "dial-tiny-text", styles: l, className: f }) => {
|
|
263
|
+
let h = i({
|
|
264
|
+
"--aa-box-bg": l?.colors?.boxBackgroundColor,
|
|
265
|
+
"--aa-box-border": l?.colors?.boxBorderColor,
|
|
266
|
+
"--aa-icon": l?.colors?.placeholderIconColor,
|
|
267
|
+
"--aa-caption": l?.colors?.captionColor
|
|
242
268
|
});
|
|
243
|
-
return /* @__PURE__ */
|
|
244
|
-
className: s("flex flex-col gap-2",
|
|
245
|
-
style:
|
|
246
|
-
children: [/* @__PURE__ */
|
|
269
|
+
return /* @__PURE__ */ N("div", {
|
|
270
|
+
className: s("flex flex-col gap-2", f),
|
|
271
|
+
style: h,
|
|
272
|
+
children: [/* @__PURE__ */ M(_, { label: e }), /* @__PURE__ */ N("div", {
|
|
247
273
|
className: "flex items-start gap-3",
|
|
248
|
-
children: [/* @__PURE__ */
|
|
249
|
-
className: s("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border",
|
|
250
|
-
children: t ? /* @__PURE__ */
|
|
274
|
+
children: [/* @__PURE__ */ M("div", {
|
|
275
|
+
className: s("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", ue.box),
|
|
276
|
+
children: t ? /* @__PURE__ */ M("img", {
|
|
251
277
|
src: t,
|
|
252
278
|
alt: n,
|
|
253
279
|
className: "h-16 w-16 object-cover"
|
|
254
|
-
}) : /* @__PURE__ */
|
|
280
|
+
}) : /* @__PURE__ */ M(I, {
|
|
255
281
|
size: u.LG,
|
|
256
282
|
stroke: d,
|
|
257
283
|
"aria-hidden": !0,
|
|
258
|
-
className:
|
|
284
|
+
className: ue.icon
|
|
259
285
|
})
|
|
260
|
-
}), /* @__PURE__ */
|
|
286
|
+
}), /* @__PURE__ */ N("div", {
|
|
261
287
|
className: "flex flex-col gap-3",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
288
|
+
children: [/* @__PURE__ */ M(m, {
|
|
263
289
|
size: p.Small,
|
|
264
|
-
iconBefore: /* @__PURE__ */
|
|
290
|
+
iconBefore: /* @__PURE__ */ M(L, {
|
|
265
291
|
size: u.SM,
|
|
266
292
|
stroke: d,
|
|
267
293
|
"aria-hidden": !0
|
|
@@ -269,182 +295,200 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
269
295
|
className: "w-fit",
|
|
270
296
|
label: r,
|
|
271
297
|
onClick: o
|
|
272
|
-
}), /* @__PURE__ */
|
|
273
|
-
className: s(
|
|
298
|
+
}), /* @__PURE__ */ M("span", {
|
|
299
|
+
className: s(c, ue.caption),
|
|
274
300
|
children: a
|
|
275
301
|
})]
|
|
276
302
|
})]
|
|
277
303
|
})]
|
|
278
304
|
});
|
|
279
|
-
},
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
305
|
+
}, fe = {
|
|
306
|
+
confirmText: "_confirmText_19ec1_1",
|
|
307
|
+
confirmItem: "_confirmItem_19ec1_5"
|
|
308
|
+
}, pe = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: a, allowedMimeTypes: o, maxFileSizeBytes: c, labels: l, confirmBodyClassName: u = "dial-small-text", styles: d }) => {
|
|
309
|
+
let f = d?.colors?.confirmText, p = d?.colors?.confirmItemText, m = R((e) => e.length === 1 ? l.deleteConfirmTitleSingle : l.deleteConfirmTitleMultiple, [l.deleteConfirmTitleSingle, l.deleteConfirmTitleMultiple]), h = R((e) => /* @__PURE__ */ M("div", {
|
|
310
|
+
className: s(u, "px-6 py-3"),
|
|
311
|
+
style: i({
|
|
312
|
+
"--apm-confirm-text": f,
|
|
313
|
+
"--apm-confirm-item-text": p
|
|
314
|
+
}),
|
|
315
|
+
children: /* @__PURE__ */ M("p", {
|
|
316
|
+
className: s("mb-3", fe.confirmText),
|
|
317
|
+
children: e.length === 1 ? /* @__PURE__ */ N(j, { children: [
|
|
318
|
+
l.deleteConfirmSingleText,
|
|
286
319
|
" ",
|
|
287
|
-
/* @__PURE__ */
|
|
288
|
-
className: "break-
|
|
320
|
+
/* @__PURE__ */ N("span", {
|
|
321
|
+
className: s("wrap-break-word", fe.confirmItem),
|
|
289
322
|
children: [
|
|
290
323
|
"\"",
|
|
291
324
|
e[0].split("/").pop(),
|
|
292
325
|
"\"?"
|
|
293
326
|
]
|
|
294
327
|
})
|
|
295
|
-
] }) : /* @__PURE__ */
|
|
296
|
-
|
|
328
|
+
] }) : /* @__PURE__ */ N(j, { children: [
|
|
329
|
+
l.deleteConfirmMultipleText,
|
|
297
330
|
" ",
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
className:
|
|
331
|
+
/* @__PURE__ */ N("span", {
|
|
332
|
+
className: fe.confirmItem,
|
|
300
333
|
children: [
|
|
301
334
|
e.length,
|
|
302
335
|
" ",
|
|
303
|
-
|
|
336
|
+
l.deleteConfirmItemsLabel
|
|
304
337
|
]
|
|
305
338
|
})
|
|
306
339
|
] })
|
|
307
340
|
})
|
|
308
341
|
}), [
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
342
|
+
l.deleteConfirmSingleText,
|
|
343
|
+
l.deleteConfirmMultipleText,
|
|
344
|
+
l.deleteConfirmItemsLabel,
|
|
345
|
+
f,
|
|
346
|
+
p,
|
|
347
|
+
u
|
|
312
348
|
]);
|
|
313
|
-
return /* @__PURE__ */
|
|
349
|
+
return /* @__PURE__ */ M(te, {
|
|
314
350
|
fallback: null,
|
|
315
|
-
children: e && /* @__PURE__ */
|
|
351
|
+
children: e && /* @__PURE__ */ M(a, {
|
|
316
352
|
isOpen: e,
|
|
317
353
|
onClose: t,
|
|
318
354
|
onAttach: n,
|
|
319
355
|
bucket: r,
|
|
320
|
-
allowedTypes:
|
|
321
|
-
maxSelectableFileSize:
|
|
356
|
+
allowedTypes: o,
|
|
357
|
+
maxSelectableFileSize: c,
|
|
322
358
|
maximumAttachmentsAmount: 1,
|
|
323
359
|
canAttachFolders: !1,
|
|
324
|
-
title:
|
|
325
|
-
attachLabel:
|
|
326
|
-
emptyTitle:
|
|
327
|
-
emptyDescription:
|
|
328
|
-
errorMessage:
|
|
329
|
-
retryLabel:
|
|
330
|
-
hiddenFilesLabel:
|
|
331
|
-
showHiddenFilesLabel:
|
|
332
|
-
hideHiddenFilesLabel:
|
|
333
|
-
getSelectionLabel:
|
|
334
|
-
uploadFilesLabel:
|
|
335
|
-
newFolderLabel:
|
|
336
|
-
downloadLabel:
|
|
337
|
-
downloadingLabel:
|
|
338
|
-
deleteLabel:
|
|
339
|
-
deletingLabel:
|
|
340
|
-
deleteConfirmTitle:
|
|
341
|
-
deleteConfirmBody:
|
|
342
|
-
deleteConfirmLabel:
|
|
343
|
-
deleteCancelLabel:
|
|
360
|
+
title: l.title,
|
|
361
|
+
attachLabel: l.attachLabel,
|
|
362
|
+
emptyTitle: l.emptyTitle,
|
|
363
|
+
emptyDescription: l.emptyDescription,
|
|
364
|
+
errorMessage: l.errorMessage,
|
|
365
|
+
retryLabel: l.retryLabel,
|
|
366
|
+
hiddenFilesLabel: l.hiddenFilesLabel,
|
|
367
|
+
showHiddenFilesLabel: l.showHiddenFilesLabel,
|
|
368
|
+
hideHiddenFilesLabel: l.hideHiddenFilesLabel,
|
|
369
|
+
getSelectionLabel: l.getSelectionLabel,
|
|
370
|
+
uploadFilesLabel: l.uploadFilesLabel,
|
|
371
|
+
newFolderLabel: l.newFolderLabel,
|
|
372
|
+
downloadLabel: l.downloadLabel,
|
|
373
|
+
downloadingLabel: l.downloadingLabel,
|
|
374
|
+
deleteLabel: l.deleteLabel,
|
|
375
|
+
deletingLabel: l.deletingLabel,
|
|
376
|
+
deleteConfirmTitle: m,
|
|
377
|
+
deleteConfirmBody: h,
|
|
378
|
+
deleteConfirmLabel: l.deleteConfirmLabel,
|
|
379
|
+
deleteCancelLabel: l.deleteCancelLabel
|
|
344
380
|
})
|
|
345
381
|
});
|
|
346
382
|
}, Q = /* @__PURE__ */ function(e) {
|
|
347
383
|
return e.Avatar = "avatar", e.Name = "name", e.Version = "version", e.Description = "description", e.Locales = "locales", e.Tags = "tags", e;
|
|
348
|
-
}({}),
|
|
384
|
+
}({}), me = [
|
|
349
385
|
"avatar",
|
|
350
386
|
"name",
|
|
351
387
|
"version",
|
|
352
388
|
"description",
|
|
353
389
|
"locales",
|
|
354
390
|
"tags"
|
|
355
|
-
],
|
|
391
|
+
], he = {
|
|
392
|
+
summary: "_summary_1hlc9_1",
|
|
393
|
+
rowLabel: "_rowLabel_1hlc9_5"
|
|
394
|
+
}, ge = (e, t, n) => ({
|
|
356
395
|
id: e,
|
|
357
396
|
language: n.find((e) => !t.has(e.code))?.code ?? "",
|
|
358
397
|
name: "",
|
|
359
398
|
description: ""
|
|
360
|
-
}),
|
|
361
|
-
let
|
|
362
|
-
|
|
363
|
-
|
|
399
|
+
}), _e = ({ value: e, onChange: t, availableLocaleOptions: r = [], labels: a, className: o, summaryClassName: m = "dial-body-text", rowLabelClassName: h = "dial-tiny-lead-text", colors: _ }) => {
|
|
400
|
+
let y = i({
|
|
401
|
+
"--dlf-summary-text": _?.summaryText,
|
|
402
|
+
"--dlf-row-label-text": _?.rowLabelText
|
|
403
|
+
}), { summaryLabel: b, addLabel: x, editLabel: S, popupTitle: w, addLocaleLabel: T, localeRowLabel: D = "Locale", languageLabel: O, nameLabel: j, namePlaceholder: P, descriptionLabel: F, descriptionPlaceholder: I, deleteAriaLabel: te, cancelLabel: ne = "Cancel", saveLabel: R = "Save" } = a, [B, V] = W(!1), [H, G] = W([]), K = U(0);
|
|
404
|
+
z(() => {
|
|
405
|
+
B && G(e.length > 0 ? e : [ge(`locale-row-${++K.current}`, /* @__PURE__ */ new Set(), r)]);
|
|
364
406
|
}, [
|
|
365
|
-
|
|
407
|
+
B,
|
|
366
408
|
e,
|
|
367
409
|
r
|
|
368
410
|
]);
|
|
369
|
-
let re = () =>
|
|
370
|
-
t(
|
|
371
|
-
},
|
|
372
|
-
let e = new Set(
|
|
373
|
-
|
|
374
|
-
},
|
|
375
|
-
|
|
411
|
+
let re = () => V(!0), ie = () => V(!1), q = () => {
|
|
412
|
+
t(H.filter((e) => e.language && e.name)), V(!1);
|
|
413
|
+
}, ae = () => {
|
|
414
|
+
let e = new Set(H.map((e) => e.language).filter(Boolean));
|
|
415
|
+
G((t) => [...t, ge(`locale-row-${++K.current}`, e, r)]);
|
|
416
|
+
}, J = (e, t) => {
|
|
417
|
+
G((n) => n.map((n) => n.id === e ? {
|
|
376
418
|
...n,
|
|
377
419
|
...t
|
|
378
420
|
} : n));
|
|
379
|
-
},
|
|
380
|
-
|
|
381
|
-
},
|
|
382
|
-
return r.length === 0 ? null : /* @__PURE__ */
|
|
383
|
-
className: s("flex items-center gap-2",
|
|
421
|
+
}, oe = (e) => {
|
|
422
|
+
G((t) => t.filter((t) => t.id !== e));
|
|
423
|
+
}, Y = (e) => r.find((t) => t.code === e)?.label ?? e.toUpperCase(), se = H.some((e) => !e.language || !e.name);
|
|
424
|
+
return r.length === 0 ? null : /* @__PURE__ */ N("div", {
|
|
425
|
+
className: s("flex items-center gap-2", o),
|
|
426
|
+
style: y,
|
|
384
427
|
children: [
|
|
385
|
-
e.length > 0 && /* @__PURE__ */
|
|
386
|
-
className:
|
|
387
|
-
children: `${
|
|
428
|
+
e.length > 0 && /* @__PURE__ */ M("span", {
|
|
429
|
+
className: s(he.summary, m),
|
|
430
|
+
children: `${b}: ${e.map((e) => `[${Y(e.language)}]`).join(", ")}`
|
|
388
431
|
}),
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
label: e.length > 0 ?
|
|
391
|
-
iconBefore: /* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ M(v, {
|
|
433
|
+
label: e.length > 0 ? S : x,
|
|
434
|
+
iconBefore: /* @__PURE__ */ M(L, {
|
|
392
435
|
size: u.SM,
|
|
393
436
|
"aria-hidden": !0,
|
|
394
437
|
stroke: d
|
|
395
438
|
}),
|
|
396
|
-
className: "
|
|
439
|
+
className: "px-0!",
|
|
397
440
|
onClick: re
|
|
398
441
|
}),
|
|
399
|
-
/* @__PURE__ */
|
|
400
|
-
open:
|
|
401
|
-
header:
|
|
402
|
-
onClose:
|
|
442
|
+
/* @__PURE__ */ M(C, {
|
|
443
|
+
open: B,
|
|
444
|
+
header: w,
|
|
445
|
+
onClose: ie,
|
|
403
446
|
mainButtons: [{
|
|
404
|
-
label: I,
|
|
405
|
-
onClick: W
|
|
406
|
-
}, {
|
|
407
447
|
label: ne,
|
|
408
|
-
variant: l.Primary,
|
|
409
|
-
disabled: Y,
|
|
410
448
|
onClick: ie
|
|
449
|
+
}, {
|
|
450
|
+
label: R,
|
|
451
|
+
variant: l.Primary,
|
|
452
|
+
disabled: se,
|
|
453
|
+
onClick: q
|
|
411
454
|
}],
|
|
412
|
-
children: /* @__PURE__ */
|
|
455
|
+
children: /* @__PURE__ */ N("div", {
|
|
413
456
|
className: "flex flex-col gap-8 px-6 py-3",
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
457
|
+
style: y,
|
|
458
|
+
children: [H.map((e, t) => {
|
|
459
|
+
let i = new Set(H.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
|
|
460
|
+
return /* @__PURE__ */ N("div", {
|
|
417
461
|
className: "flex flex-col gap-2",
|
|
418
|
-
children: [/* @__PURE__ */
|
|
462
|
+
children: [/* @__PURE__ */ N("div", {
|
|
419
463
|
className: "flex items-center justify-between",
|
|
420
|
-
children: [/* @__PURE__ */
|
|
421
|
-
className:
|
|
464
|
+
children: [/* @__PURE__ */ N("span", {
|
|
465
|
+
className: s(he.rowLabel, h),
|
|
422
466
|
children: [
|
|
423
|
-
|
|
467
|
+
D,
|
|
424
468
|
" ",
|
|
425
469
|
t + 1
|
|
426
470
|
]
|
|
427
|
-
}), /* @__PURE__ */
|
|
471
|
+
}), /* @__PURE__ */ M(f, {
|
|
428
472
|
appearance: c.Ghost,
|
|
429
473
|
size: p.Small,
|
|
430
|
-
icon: /* @__PURE__ */
|
|
474
|
+
icon: /* @__PURE__ */ M(ee, {
|
|
431
475
|
size: u.SM,
|
|
432
476
|
"aria-hidden": !0,
|
|
433
477
|
stroke: d
|
|
434
478
|
}),
|
|
435
|
-
"aria-label": `${
|
|
436
|
-
onClick: () =>
|
|
479
|
+
"aria-label": `${te} ${t + 1}`,
|
|
480
|
+
onClick: () => oe(e.id)
|
|
437
481
|
})]
|
|
438
|
-
}), /* @__PURE__ */
|
|
482
|
+
}), /* @__PURE__ */ N("div", {
|
|
439
483
|
role: "group",
|
|
440
|
-
"aria-label": `${
|
|
484
|
+
"aria-label": `${D} ${t + 1}`,
|
|
441
485
|
className: "flex flex-col gap-5",
|
|
442
|
-
children: [/* @__PURE__ */
|
|
486
|
+
children: [/* @__PURE__ */ N("div", {
|
|
443
487
|
className: "flex flex-col gap-5 desktop:flex-row desktop:items-start",
|
|
444
|
-
children: [/* @__PURE__ */
|
|
488
|
+
children: [/* @__PURE__ */ M(E, {
|
|
445
489
|
id: `${e.id}-language`,
|
|
446
490
|
labelProps: {
|
|
447
|
-
label:
|
|
491
|
+
label: O,
|
|
448
492
|
required: !0
|
|
449
493
|
},
|
|
450
494
|
className: "desktop:shrink-0 desktop:basis-40",
|
|
@@ -454,86 +498,83 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
454
498
|
disabled: i.has(e.code)
|
|
455
499
|
})),
|
|
456
500
|
value: e.language,
|
|
457
|
-
onChange: (t) =>
|
|
458
|
-
}), /* @__PURE__ */
|
|
501
|
+
onChange: (t) => J(e.id, { language: t })
|
|
502
|
+
}), /* @__PURE__ */ M(g, {
|
|
459
503
|
id: `${e.id}-name`,
|
|
460
504
|
containerClassName: "min-w-0 flex-1",
|
|
461
505
|
required: !0,
|
|
462
506
|
value: e.name,
|
|
463
|
-
onChange: (t) =>
|
|
507
|
+
onChange: (t) => J(e.id, { name: t ?? "" }),
|
|
464
508
|
labelProps: {
|
|
465
|
-
label:
|
|
509
|
+
label: j,
|
|
466
510
|
required: !0
|
|
467
511
|
},
|
|
468
|
-
placeholder:
|
|
512
|
+
placeholder: P
|
|
469
513
|
})]
|
|
470
|
-
}), /* @__PURE__ */
|
|
514
|
+
}), /* @__PURE__ */ M(k, {
|
|
471
515
|
id: `${e.id}-description`,
|
|
472
516
|
className: n,
|
|
473
|
-
resize:
|
|
517
|
+
resize: A.Vertical,
|
|
474
518
|
value: e.description,
|
|
475
|
-
onChange: (t) =>
|
|
476
|
-
labelProps: { label:
|
|
477
|
-
placeholder:
|
|
519
|
+
onChange: (t) => J(e.id, { description: t }),
|
|
520
|
+
labelProps: { label: F },
|
|
521
|
+
placeholder: I
|
|
478
522
|
})]
|
|
479
523
|
})]
|
|
480
524
|
}, e.id);
|
|
481
|
-
}), /* @__PURE__ */
|
|
482
|
-
label:
|
|
483
|
-
iconBefore: /* @__PURE__ */
|
|
525
|
+
}), /* @__PURE__ */ M(v, {
|
|
526
|
+
label: T,
|
|
527
|
+
iconBefore: /* @__PURE__ */ M(L, {
|
|
484
528
|
size: u.SM,
|
|
485
529
|
"aria-hidden": !0,
|
|
486
530
|
stroke: d
|
|
487
531
|
}),
|
|
488
532
|
className: "self-start",
|
|
489
|
-
onClick:
|
|
490
|
-
disabled:
|
|
533
|
+
onClick: ae,
|
|
534
|
+
disabled: H.length >= r.length
|
|
491
535
|
})]
|
|
492
536
|
})
|
|
493
537
|
})
|
|
494
538
|
]
|
|
495
539
|
});
|
|
496
|
-
},
|
|
497
|
-
let
|
|
498
|
-
|
|
540
|
+
}, ve = "Add tags, comma separated", ye = "deployment-creation-form-description", be = ({ values: e, errors: t, onChange: i, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: c, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], fields: p = me, isNameReadOnly: m = !1, nameReadOnlyTooltip: h, nameCaption: _, isDescriptionRequired: v = !1, descriptionCaption: y, renderDescription: b, focusRequestKey: x }) => {
|
|
541
|
+
let S = U(null), C = U(null), w = U(null), T = U(!1), E = (e) => p.includes(e), D = E(Q.Name), j = E(Q.Version), P = !!(t.name || t.version || t.description), F = U(x);
|
|
542
|
+
z(() => {
|
|
499
543
|
let e = () => {
|
|
500
|
-
t.name ?
|
|
544
|
+
t.name ? S.current?.focus() : t.version ? C.current?.focus() : t.description && w.current?.focus();
|
|
501
545
|
};
|
|
502
|
-
|
|
503
|
-
y !== N.current && (N.current = y, e());
|
|
504
|
-
return;
|
|
505
|
-
}
|
|
506
|
-
M && !C.current && e(), C.current = M;
|
|
546
|
+
x === void 0 ? (P && !T.current && e(), T.current = P) : x !== F.current && (F.current = x, e());
|
|
507
547
|
}, [
|
|
508
|
-
|
|
509
|
-
|
|
548
|
+
x,
|
|
549
|
+
P,
|
|
510
550
|
t.name,
|
|
511
551
|
t.version,
|
|
512
552
|
t.description
|
|
513
553
|
]);
|
|
514
|
-
let
|
|
515
|
-
id:
|
|
516
|
-
ref:
|
|
554
|
+
let I = /* @__PURE__ */ M(k, {
|
|
555
|
+
id: ye,
|
|
556
|
+
ref: w,
|
|
517
557
|
value: e.description,
|
|
518
558
|
onChange: (e) => i({ description: e }),
|
|
519
|
-
"aria-required":
|
|
520
|
-
labelProps:
|
|
559
|
+
"aria-required": v || void 0,
|
|
560
|
+
labelProps: b ? void 0 : {
|
|
521
561
|
label: u.description.label,
|
|
522
|
-
required:
|
|
562
|
+
required: v
|
|
523
563
|
},
|
|
524
564
|
placeholder: u.description.placeholder,
|
|
565
|
+
caption: y,
|
|
525
566
|
error: t.description || void 0,
|
|
526
567
|
invalid: !!t.description,
|
|
527
|
-
containerClassName:
|
|
568
|
+
containerClassName: b ? void 0 : d?.field,
|
|
528
569
|
className: n,
|
|
529
|
-
resize:
|
|
570
|
+
resize: A.Vertical
|
|
530
571
|
});
|
|
531
|
-
return /* @__PURE__ */
|
|
572
|
+
return /* @__PURE__ */ N("div", {
|
|
532
573
|
role: u.ariaLabel ? "group" : void 0,
|
|
533
574
|
"aria-label": u.ariaLabel,
|
|
534
575
|
className: s("flex flex-col gap-4", d?.root),
|
|
535
576
|
children: [
|
|
536
|
-
|
|
577
|
+
E(Q.Avatar) && /* @__PURE__ */ M(de, {
|
|
537
578
|
label: u.iconUrl.label,
|
|
538
579
|
avatarUrl: c,
|
|
539
580
|
addAvatarLabel: u.iconUrl.addAvatarLabel,
|
|
@@ -541,27 +582,28 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
541
582
|
onAddAvatarClick: l,
|
|
542
583
|
className: d?.field
|
|
543
584
|
}),
|
|
544
|
-
(
|
|
585
|
+
(D || j) && /* @__PURE__ */ N("div", {
|
|
545
586
|
className: s("flex items-start gap-4", d?.field),
|
|
546
|
-
children: [
|
|
587
|
+
children: [D && /* @__PURE__ */ M(g, {
|
|
547
588
|
id: "deployment-creation-form-name",
|
|
548
|
-
inputRef:
|
|
589
|
+
inputRef: S,
|
|
549
590
|
value: e.name,
|
|
550
591
|
onChange: (e) => i({ name: e ?? "" }),
|
|
551
592
|
onBlur: a,
|
|
552
|
-
|
|
593
|
+
disabled: m,
|
|
594
|
+
tooltipText: m ? h : void 0,
|
|
553
595
|
labelProps: {
|
|
554
596
|
label: u.name.label,
|
|
555
597
|
required: !0
|
|
556
598
|
},
|
|
557
599
|
placeholder: u.name.placeholder,
|
|
558
|
-
caption:
|
|
600
|
+
caption: _,
|
|
559
601
|
error: t.name || void 0,
|
|
560
602
|
invalid: !!t.name,
|
|
561
603
|
containerClassName: j ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
|
|
562
|
-
}), j && /* @__PURE__ */
|
|
604
|
+
}), j && /* @__PURE__ */ M(g, {
|
|
563
605
|
id: "deployment-creation-form-version",
|
|
564
|
-
inputRef:
|
|
606
|
+
inputRef: C,
|
|
565
607
|
value: e.version,
|
|
566
608
|
onChange: (e) => i({ version: e ?? "" }),
|
|
567
609
|
onBlur: o,
|
|
@@ -569,26 +611,27 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
569
611
|
placeholder: u.version.placeholder,
|
|
570
612
|
error: t.version || void 0,
|
|
571
613
|
invalid: !!t.version,
|
|
572
|
-
containerClassName:
|
|
614
|
+
containerClassName: D ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
|
|
573
615
|
})]
|
|
574
616
|
}),
|
|
575
|
-
|
|
617
|
+
E(Q.Description) && (b ? /* @__PURE__ */ M("div", {
|
|
576
618
|
className: d?.field,
|
|
577
|
-
children:
|
|
578
|
-
}) :
|
|
579
|
-
|
|
619
|
+
children: b(I, ye)
|
|
620
|
+
}) : I),
|
|
621
|
+
E(Q.Locales) && /* @__PURE__ */ M(_e, {
|
|
580
622
|
value: e.otherLocales,
|
|
581
623
|
onChange: (e) => i({ otherLocales: e }),
|
|
582
624
|
availableLocaleOptions: f,
|
|
583
625
|
labels: u.otherLocales,
|
|
584
|
-
className: d?.field
|
|
626
|
+
className: d?.field,
|
|
627
|
+
colors: d?.localesColors
|
|
585
628
|
}),
|
|
586
|
-
|
|
629
|
+
E(Q.Tags) && /* @__PURE__ */ M("div", {
|
|
587
630
|
className: d?.field,
|
|
588
|
-
children: /* @__PURE__ */ O
|
|
631
|
+
children: /* @__PURE__ */ M(O, {
|
|
589
632
|
id: "deployment-creation-form-topics",
|
|
590
633
|
labelProps: { label: u.topics.label },
|
|
591
|
-
placeholder: u.topics.placeholder ??
|
|
634
|
+
placeholder: u.topics.placeholder ?? ve,
|
|
592
635
|
value: e.topics,
|
|
593
636
|
onChange: (e) => i({ topics: e }),
|
|
594
637
|
tagClassName: r
|
|
@@ -596,53 +639,58 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
596
639
|
})
|
|
597
640
|
]
|
|
598
641
|
});
|
|
599
|
-
},
|
|
600
|
-
let
|
|
601
|
-
|
|
602
|
-
className:
|
|
642
|
+
}, xe = "border-0 p-4 desktop:p-8", Se = "desktop:flex-1", Ce = "px-4 pt-4 desktop:px-6 desktop:pt-6", we = ne(({ title: e, onBack: t, onCancel: n, onSubmit: r, submitLabel: i, isSubmitting: a = !1, isSubmitDisabled: o = !1, extraActions: c, hideStandardActions: l = !1, metadata: u, metadataTitle: d, metadataFooter: f, setup: p, setupTitle: m, asideData: h, asideTitle: g, asideSectionClassName: _, alert: v, resizableLeftColumn: b, metadataSectionClassName: C, setupSectionClassName: T, labels: E, styles: D, dir: O }) => {
|
|
643
|
+
let k = /* @__PURE__ */ M(y, {
|
|
644
|
+
politeness: x.Assertive,
|
|
645
|
+
className: v == null ? void 0 : Ce,
|
|
603
646
|
children: v
|
|
604
647
|
}), A = p != null;
|
|
605
|
-
return /* @__PURE__ */
|
|
648
|
+
return /* @__PURE__ */ M(le, {
|
|
606
649
|
title: e,
|
|
607
650
|
onBack: t,
|
|
608
|
-
backAriaLabel:
|
|
651
|
+
backAriaLabel: E?.backAriaLabel ?? "Back",
|
|
609
652
|
isSaving: a,
|
|
610
|
-
|
|
611
|
-
|
|
653
|
+
resizableLeftColumn: b,
|
|
654
|
+
labels: {
|
|
655
|
+
savingStatusLabel: E?.savingStatusLabel ?? "Saving",
|
|
656
|
+
resizeHandleLabel: E?.resizeHandleLabel,
|
|
657
|
+
resizeHandleTooltip: E?.resizeHandleTooltip
|
|
658
|
+
},
|
|
659
|
+
rightContent: h == null ? void 0 : /* @__PURE__ */ M(X, {
|
|
612
660
|
title: g,
|
|
613
|
-
styles:
|
|
614
|
-
className: s(
|
|
661
|
+
styles: D?.section,
|
|
662
|
+
className: s(xe, _, Y.asideSection),
|
|
615
663
|
children: h
|
|
616
664
|
}),
|
|
617
|
-
styles:
|
|
618
|
-
dir:
|
|
619
|
-
actions: /* @__PURE__ */
|
|
620
|
-
label:
|
|
665
|
+
styles: D?.layout,
|
|
666
|
+
dir: O,
|
|
667
|
+
actions: /* @__PURE__ */ N(j, { children: [c, !l && /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(S, {
|
|
668
|
+
label: E?.cancelLabel ?? "Cancel",
|
|
621
669
|
disabled: a,
|
|
622
670
|
onClick: n
|
|
623
|
-
}), /* @__PURE__ */
|
|
671
|
+
}), /* @__PURE__ */ M(w, {
|
|
624
672
|
label: i,
|
|
625
673
|
disabled: a || o,
|
|
626
674
|
onClick: r
|
|
627
675
|
})] })] }),
|
|
628
|
-
leftContent: /* @__PURE__ */
|
|
629
|
-
!A &&
|
|
630
|
-
/* @__PURE__ */
|
|
631
|
-
title: d === null ? void 0 : d ??
|
|
632
|
-
styles:
|
|
633
|
-
className: s(
|
|
676
|
+
leftContent: /* @__PURE__ */ N(j, { children: [
|
|
677
|
+
!A && k,
|
|
678
|
+
/* @__PURE__ */ M(X, {
|
|
679
|
+
title: d === null ? void 0 : d ?? E?.metadataTitle ?? "Metadata",
|
|
680
|
+
styles: D?.section,
|
|
681
|
+
className: s(xe, C, Y.metadataSection),
|
|
634
682
|
children: u
|
|
635
683
|
}),
|
|
636
684
|
f
|
|
637
685
|
] }),
|
|
638
|
-
centerContent: A ? /* @__PURE__ */
|
|
639
|
-
title: m === null ? void 0 : m ??
|
|
640
|
-
styles:
|
|
641
|
-
className: s(
|
|
686
|
+
centerContent: A ? /* @__PURE__ */ N(j, { children: [k, /* @__PURE__ */ M(X, {
|
|
687
|
+
title: m === null ? void 0 : m ?? E?.setupTitle ?? "Setup",
|
|
688
|
+
styles: D?.section,
|
|
689
|
+
className: s(xe, Se, T, Y.setupSection),
|
|
642
690
|
children: p
|
|
643
691
|
})] }) : void 0
|
|
644
692
|
});
|
|
645
|
-
}),
|
|
693
|
+
}), Te = {
|
|
646
694
|
name: {
|
|
647
695
|
label: "Name",
|
|
648
696
|
placeholder: "Enter name"
|
|
@@ -681,7 +729,7 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
681
729
|
saveLabel: "Save"
|
|
682
730
|
},
|
|
683
731
|
ariaLabel: "Metadata"
|
|
684
|
-
},
|
|
732
|
+
}, Ee = {
|
|
685
733
|
title: "Add avatar",
|
|
686
734
|
attachLabel: "Attach",
|
|
687
735
|
emptyTitle: "This folder is empty",
|
|
@@ -705,64 +753,66 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
705
753
|
deleteConfirmItemsLabel: "items?",
|
|
706
754
|
deleteConfirmLabel: "Delete",
|
|
707
755
|
deleteCancelLabel: "Cancel"
|
|
708
|
-
},
|
|
709
|
-
let [
|
|
710
|
-
let t =
|
|
711
|
-
t && n({ iconUrl: t }),
|
|
712
|
-
}, [n,
|
|
713
|
-
return /* @__PURE__ */
|
|
756
|
+
}, De = ne(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, fields: s = me, isNameReadOnly: c, nameReadOnlyTooltip: l, nameCaption: u, isDescriptionRequired: d, descriptionCaption: f, renderDescription: p, focusRequestKey: m, labels: h }) => {
|
|
757
|
+
let [g, _] = W(!1), v = H(() => a ? s : s.filter((e) => e !== Q.Avatar), [a, s]), y = e.iconUrl, b = a?.resolveIconUrl, x = H(() => b ? b(y) : void 0, [y, b]), S = R(() => _(!0), []), C = R(() => _(!1), []), w = a?.resolveAttachedIconUrl, T = R((e) => {
|
|
758
|
+
let t = w?.(e);
|
|
759
|
+
t && n({ iconUrl: t }), _(!1);
|
|
760
|
+
}, [n, w]);
|
|
761
|
+
return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(be, {
|
|
714
762
|
values: e,
|
|
715
763
|
errors: t,
|
|
716
764
|
onChange: n,
|
|
717
765
|
onNameBlur: r,
|
|
718
766
|
onVersionBlur: i,
|
|
719
|
-
iconPreviewUrl:
|
|
720
|
-
onAddAvatarClick:
|
|
721
|
-
labels:
|
|
767
|
+
iconPreviewUrl: x,
|
|
768
|
+
onAddAvatarClick: S,
|
|
769
|
+
labels: h?.form ?? Te,
|
|
722
770
|
availableLocaleOptions: o,
|
|
723
|
-
fields:
|
|
771
|
+
fields: v,
|
|
724
772
|
isNameReadOnly: c,
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
773
|
+
nameReadOnlyTooltip: l,
|
|
774
|
+
nameCaption: u,
|
|
775
|
+
isDescriptionRequired: d,
|
|
776
|
+
descriptionCaption: f,
|
|
777
|
+
renderDescription: p,
|
|
778
|
+
focusRequestKey: m
|
|
779
|
+
}), a && /* @__PURE__ */ M(pe, {
|
|
780
|
+
isOpen: g,
|
|
781
|
+
onClose: C,
|
|
782
|
+
onAttach: T,
|
|
733
783
|
bucket: a.bucket,
|
|
734
784
|
FileManagerModal: a.FileManagerModal,
|
|
735
785
|
allowedMimeTypes: a.allowedMimeTypes,
|
|
736
786
|
maxFileSizeBytes: a.maxFileSizeBytes,
|
|
737
|
-
labels:
|
|
787
|
+
labels: h?.avatarPicker ?? Ee
|
|
738
788
|
})] });
|
|
739
789
|
}), $ = /* @__PURE__ */ function(e) {
|
|
740
790
|
return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
|
|
741
|
-
}({}),
|
|
791
|
+
}({}), Oe = (e, t) => e.length === t.length && e.every((e, n) => e.id === t[n].id && e.language === t[n].language && e.name === t[n].name && e.description === t[n].description), ke = (e, t) => e.name === t.name && e.description === t.description && e.iconUrl === t.iconUrl && e.version === t.version && e.topics.length === t.topics.length && e.topics.every((e, n) => e === t.topics[n]) && Oe(e.otherLocales, t.otherLocales), Ae = (e) => Object.values(e).every((e) => e == null), je = /^[a-zA-Z0-9 _.-]+$/, Me = /^[a-zA-Z0-9._-]+$/, Ne = /^\d+(\.\d+)*$/, Pe = "1.0.0", Fe = (n, r = {}) => {
|
|
742
792
|
let i = {}, s = n.name.trim();
|
|
743
|
-
s ? a(s, t) ? i.name = $.TooLong : r.validateNamePattern && !
|
|
793
|
+
s ? a(s, t) ? i.name = $.TooLong : r.validateNamePattern && !je.test(s) ? i.name = $.InvalidFormat : o(s) && (i.name = $.ControlCharacters) : i.name = $.Required, a(n.description, e) && (i.description = $.TooLong);
|
|
744
794
|
let c = n.version.trim();
|
|
745
|
-
return r.validateVersionPattern && c && ((r.validateVersionPattern instanceof RegExp ? r.validateVersionPattern :
|
|
746
|
-
},
|
|
795
|
+
return r.validateVersionPattern && c && ((r.validateVersionPattern instanceof RegExp ? r.validateVersionPattern : Me).test(c) || (i.version = $.InvalidFormat)), i;
|
|
796
|
+
}, Ie = /* @__PURE__ */ new Set([$.TooLong, $.ControlCharacters]), Le = (e, t) => ({
|
|
747
797
|
reseedKey: t,
|
|
748
798
|
values: e,
|
|
749
799
|
baseline: e,
|
|
750
800
|
touched: {},
|
|
751
801
|
hasAttemptedSubmit: !1,
|
|
752
802
|
submitAttemptCount: 0
|
|
753
|
-
}),
|
|
754
|
-
let [r, i] =
|
|
755
|
-
r.reseedKey !== n && i(
|
|
756
|
-
let a = t?.validateNamePattern, o = t?.validateVersionPattern, s =
|
|
803
|
+
}), Re = ({ initialValues: e, validationOptions: t, reseedKey: n }) => {
|
|
804
|
+
let [r, i] = W(() => Le(e, n));
|
|
805
|
+
r.reseedKey !== n && i(Le(e, n));
|
|
806
|
+
let a = t?.validateNamePattern, o = t?.validateVersionPattern, s = H(() => Fe(r.values, {
|
|
757
807
|
validateNamePattern: a,
|
|
758
808
|
validateVersionPattern: o
|
|
759
809
|
}), [
|
|
760
810
|
r.values,
|
|
761
811
|
a,
|
|
762
812
|
o
|
|
763
|
-
]), c =
|
|
813
|
+
]), c = H(() => {
|
|
764
814
|
if (r.hasAttemptedSubmit) return s;
|
|
765
|
-
let e = (e, t) => e && (t ||
|
|
815
|
+
let e = (e, t) => e && (t || Ie.has(e)) ? e : void 0;
|
|
766
816
|
return {
|
|
767
817
|
name: e(s.name, r.touched[Q.Name]),
|
|
768
818
|
version: e(s.version, r.touched[Q.Version]),
|
|
@@ -772,28 +822,28 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
772
822
|
s,
|
|
773
823
|
r.hasAttemptedSubmit,
|
|
774
824
|
r.touched
|
|
775
|
-
]), l =
|
|
776
|
-
|
|
825
|
+
]), l = U(s), u = U(e);
|
|
826
|
+
V(() => {
|
|
777
827
|
l.current = s, u.current = e;
|
|
778
828
|
});
|
|
779
|
-
let d =
|
|
829
|
+
let d = R((e) => i((t) => ({
|
|
780
830
|
...t,
|
|
781
831
|
values: {
|
|
782
832
|
...t.values,
|
|
783
833
|
...e
|
|
784
834
|
}
|
|
785
|
-
})), []), f =
|
|
835
|
+
})), []), f = R((e) => i((t) => t.touched[e] ? t : {
|
|
786
836
|
...t,
|
|
787
837
|
touched: {
|
|
788
838
|
...t.touched,
|
|
789
839
|
[e]: !0
|
|
790
840
|
}
|
|
791
|
-
}), []), p =
|
|
841
|
+
}), []), p = R(() => (i((e) => ({
|
|
792
842
|
...e,
|
|
793
843
|
hasAttemptedSubmit: !0,
|
|
794
844
|
submitAttemptCount: e.submitAttemptCount + 1
|
|
795
|
-
})),
|
|
796
|
-
return
|
|
845
|
+
})), Ae(l.current)), []), m = R((e) => i((t) => Le(e ?? u.current, t.reseedKey)), []), h = H(() => !ke(r.values, r.baseline), [r.values, r.baseline]);
|
|
846
|
+
return H(() => ({
|
|
797
847
|
values: r.values,
|
|
798
848
|
setValues: d,
|
|
799
849
|
touched: r.touched,
|
|
@@ -818,4 +868,4 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
|
|
|
818
868
|
]);
|
|
819
869
|
};
|
|
820
870
|
//#endregion
|
|
821
|
-
export {
|
|
871
|
+
export { de as AddAvatar, pe as AvatarPickerModal, Y as BUILDER_FORM_CLASS, oe as BuilderFormContainer, Pe as DEFAULT_DEPLOYMENT_VERSION, Te as DEFAULT_METADATA_FORM_LABELS, $ as DeploymentCreationFieldErrorCode, be as DeploymentCreationForm, _e as DeploymentLocalesField, le as EditorLayout, X as EditorSection, we as EntityEditor, Q as MetadataField, De as MetadataForm, je as NAME_PATTERN, Ne as SEMVER_VERSION_PATTERN, Me as VERSION_PATTERN, Re as useMetadataForm, Fe as validateDeploymentCreationFields };
|