@epam/ai-dial-builder-form 1.3.0-dev.98 → 1.3.0-rc.0

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