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