@epam/ai-dial-builder-form 1.4.0-dev.8 → 1.4.0-dev.81
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/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export type { AvatarPickerFileManagerModalProps, AvatarPickerModalColors, Avatar
|
|
|
24
24
|
export type { DeploymentCreationFormFieldErrors, DeploymentCreationFormFieldLabels, DeploymentCreationFormIconLabels, DeploymentCreationFormLabels, DeploymentCreationFormLocaleEntry, DeploymentCreationFormLocaleLabels, DeploymentCreationFormLocaleOption, DeploymentCreationFormProps, DeploymentCreationFormStyles, DeploymentCreationFormValues, DeploymentLocalesFieldColors, } from './models/deployment-creation-form';
|
|
25
25
|
export type { DeploymentCreationFormErrorCodes, DeploymentCreationFormValidationOptions, } from './models/validation';
|
|
26
26
|
export { DeploymentCreationFieldErrorCode } from './models/validation';
|
|
27
|
-
export { DEFAULT_DEPLOYMENT_VERSION, NAME_PATTERN,
|
|
27
|
+
export { DEFAULT_DEPLOYMENT_VERSION, NAME_PATTERN, STORED_VERSION_PATTERN, VERSION_PATTERN, validateDeploymentCreationFields, withStoredVersionRule, } from './utils/validate-deployment-creation-fields';
|
|
28
28
|
export { BUILDER_FORM_CLASS } from './constants/public-class-names';
|
|
29
29
|
export { DEFAULT_METADATA_FORM_LABELS } from './constants/metadata-form';
|
|
30
30
|
export { AVATAR_ALLOWED_MIME_TYPES, AVATAR_MAX_FILE_SIZE_BYTES, } from './constants/avatar-picker';
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,YAAY,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,YAAY,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AACpF,YAAY,EACV,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,oCAAoC,CAAC;AAC5C,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,2BAA2B,EAAE,MAAM,4DAA4D,CAAC;AAC9G,YAAY,EACV,iCAAiC,EACjC,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,iCAAiC,EACjC,iCAAiC,EACjC,gCAAgC,EAChC,4BAA4B,EAC5B,iCAAiC,EACjC,kCAAkC,EAClC,kCAAkC,EAClC,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACV,gCAAgC,EAChC,uCAAuC,GACxC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EACL,0BAA0B,EAC1B,YAAY,EACZ,sBAAsB,EACtB,eAAe,EACf,gCAAgC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,YAAY,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,YAAY,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AACpF,YAAY,EACV,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,oCAAoC,CAAC;AAC5C,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,2BAA2B,EAAE,MAAM,4DAA4D,CAAC;AAC9G,YAAY,EACV,iCAAiC,EACjC,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,iCAAiC,EACjC,iCAAiC,EACjC,gCAAgC,EAChC,4BAA4B,EAC5B,iCAAiC,EACjC,kCAAkC,EAClC,kCAAkC,EAClC,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACV,gCAAgC,EAChC,uCAAuC,GACxC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EACL,0BAA0B,EAC1B,YAAY,EACZ,sBAAsB,EACtB,eAAe,EACf,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EACL,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,578 +1,578 @@
|
|
|
1
|
-
import { ENTITY_DESCRIPTION_MAX_LENGTH as e, ENTITY_NAME_MAX_LENGTH as t, RESIZABLE_TEXTAREA_CLASS_NAME as n,
|
|
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, RESOURCE_VERSION_PATTERN as r, STORED_RESOURCE_VERSION_PATTERN as i, TAG_INPUT_TAG_CLASS_NAME as a, buildCssVars as o, exceedsMaxLength as s, hasControlCharacters as c, mergeClasses as l } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { ButtonAppearance as u, ButtonVariant as d, DIAL_ICON_SIZE as f, DIAL_KIT_ICON_STROKE as p, DangerIconButton as m, ElementSize as h, GhostButton as g, GhostIconButton as _, Input as v, Label as y, LinkButton as b, LiveRegion as x, LiveRegionElement as S, LiveRegionPoliteness as C, NeutralButton as w, Popup as T, PrimaryButton as E, ResizeHandle as D, Select as O, Spinner as k, TagInput as A, Textarea as j, TextareaResize as ee } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
4
|
+
import { IconArrowLeft as F, IconArrowNarrowLeft as I, IconPhoto as L, IconPlus as R, IconTrashX as te } from "@tabler/icons-react";
|
|
5
|
+
import { Suspense as ne, memo as re, useCallback as z, useEffect as ie, useId as B, useLayoutEffect as V, useMemo as H, useRef as U, useState as W } from "react";
|
|
6
6
|
//#region src/models/builder-form-actions-order.ts
|
|
7
|
-
var
|
|
7
|
+
var G = /* @__PURE__ */ function(e) {
|
|
8
8
|
return e.CancelFirst = "cancelFirst", e.SubmitFirst = "submitFirst", e;
|
|
9
|
-
}({}),
|
|
10
|
-
let c = /* @__PURE__ */
|
|
9
|
+
}({}), ae = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubmitDisabled: i = !1, isSubmitting: a = !1, buttonClassName: o, order: s = G.CancelFirst }) => {
|
|
10
|
+
let c = /* @__PURE__ */ N(w, {
|
|
11
11
|
label: e.cancelButtonLabel,
|
|
12
12
|
onClick: t,
|
|
13
13
|
disabled: r,
|
|
14
14
|
className: o
|
|
15
15
|
});
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
s ===
|
|
18
|
-
/* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ P(M, { children: [
|
|
17
|
+
s === G.CancelFirst && c,
|
|
18
|
+
/* @__PURE__ */ N(E, {
|
|
19
19
|
label: e.submitButtonLabel,
|
|
20
20
|
onClick: n,
|
|
21
21
|
disabled: i,
|
|
22
22
|
"aria-busy": a,
|
|
23
23
|
className: o,
|
|
24
|
-
iconBefore: a ? /* @__PURE__ */
|
|
24
|
+
iconBefore: a ? /* @__PURE__ */ N("span", {
|
|
25
25
|
"aria-hidden": !0,
|
|
26
|
-
children: /* @__PURE__ */
|
|
26
|
+
children: /* @__PURE__ */ N(k, { size: f.SM })
|
|
27
27
|
}) : void 0
|
|
28
28
|
}),
|
|
29
|
-
s ===
|
|
29
|
+
s === G.SubmitFirst && c
|
|
30
30
|
] });
|
|
31
|
-
},
|
|
31
|
+
}, K = {
|
|
32
32
|
body: "_body_1xd7h_2",
|
|
33
33
|
sideColumn: "_sideColumn_1xd7h_6",
|
|
34
34
|
reservedColumn: "_reservedColumn_1xd7h_10"
|
|
35
|
-
},
|
|
35
|
+
}, oe = l("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", K.sideColumn), se = ({ left: e, children: t, metadata: n, layout: r }) => {
|
|
36
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;
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
className:
|
|
37
|
+
return /* @__PURE__ */ P("div", {
|
|
38
|
+
className: l("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden", K.body),
|
|
39
39
|
style: o,
|
|
40
40
|
children: [
|
|
41
|
-
e != null && /* @__PURE__ */
|
|
42
|
-
className:
|
|
41
|
+
e != null && /* @__PURE__ */ N("div", {
|
|
42
|
+
className: oe,
|
|
43
43
|
style: a,
|
|
44
44
|
children: e
|
|
45
45
|
}),
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ N("div", {
|
|
47
47
|
className: "flex w-full min-w-0 flex-1 flex-col desktop:min-h-0 desktop:overflow-y-auto",
|
|
48
48
|
children: t
|
|
49
49
|
}),
|
|
50
|
-
n != null && /* @__PURE__ */
|
|
51
|
-
className:
|
|
50
|
+
n != null && /* @__PURE__ */ N("div", {
|
|
51
|
+
className: oe,
|
|
52
52
|
style: a,
|
|
53
53
|
children: n
|
|
54
54
|
}),
|
|
55
|
-
i && /* @__PURE__ */
|
|
55
|
+
i && /* @__PURE__ */ N("div", {
|
|
56
56
|
"aria-hidden": !0,
|
|
57
57
|
style: a,
|
|
58
|
-
className:
|
|
58
|
+
className: l(K.reservedColumn, K.sideColumn)
|
|
59
59
|
})
|
|
60
60
|
]
|
|
61
61
|
});
|
|
62
|
-
},
|
|
62
|
+
}, q = {
|
|
63
63
|
header: "_header_lon83_4",
|
|
64
64
|
actions: "_actions_lon83_18",
|
|
65
65
|
title: "_title_lon83_27"
|
|
66
|
-
},
|
|
67
|
-
let { colors:
|
|
68
|
-
"--bfh-border":
|
|
69
|
-
"--bfh-font-family":
|
|
66
|
+
}, ce = ({ labels: e, onBack: t, onCancel: n, onSubmit: r, isCancelDisabled: i = !1, isSubmitDisabled: a = !1, isSubmitting: s = !1, backIcon: c, styles: u }) => {
|
|
67
|
+
let { colors: d, typography: m } = u ?? {}, h = m?.fontClassName ?? "dial-h1-text", g = !!m?.fontClassName, v = o({
|
|
68
|
+
"--bfh-border": d?.borderColor,
|
|
69
|
+
"--bfh-font-family": g ? void 0 : m?.fontFamily
|
|
70
70
|
});
|
|
71
|
-
return /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ P("div", {
|
|
72
72
|
style: v,
|
|
73
|
-
className:
|
|
73
|
+
className: l("flex min-h-16 shrink-0 items-center justify-between gap-2 px-4 py-2 desktop:h-16 desktop:flex-nowrap desktop:px-8 desktop:py-0", q.header),
|
|
74
74
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ P("div", {
|
|
76
76
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
77
|
-
children: [/* @__PURE__ */
|
|
78
|
-
icon:
|
|
79
|
-
size:
|
|
77
|
+
children: [/* @__PURE__ */ N(_, {
|
|
78
|
+
icon: c === void 0 ? /* @__PURE__ */ N(F, {
|
|
79
|
+
size: f.LG,
|
|
80
80
|
className: "rtl:scale-x-[-1]",
|
|
81
81
|
"aria-hidden": !0,
|
|
82
|
-
stroke:
|
|
83
|
-
}) :
|
|
82
|
+
stroke: p
|
|
83
|
+
}) : c,
|
|
84
84
|
"aria-label": e.backButtonLabel,
|
|
85
85
|
onClick: t
|
|
86
|
-
}), /* @__PURE__ */
|
|
87
|
-
className:
|
|
86
|
+
}), /* @__PURE__ */ N("h1", {
|
|
87
|
+
className: l("truncate", q.title, h),
|
|
88
88
|
children: e.title
|
|
89
89
|
})]
|
|
90
90
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
className:
|
|
93
|
-
children: /* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ N("div", {
|
|
92
|
+
className: l("items-center gap-2", q.actions),
|
|
93
|
+
children: /* @__PURE__ */ N(ae, {
|
|
94
94
|
labels: e,
|
|
95
95
|
onCancel: n,
|
|
96
96
|
onSubmit: r,
|
|
97
|
-
isCancelDisabled:
|
|
98
|
-
isSubmitDisabled:
|
|
99
|
-
isSubmitting:
|
|
97
|
+
isCancelDisabled: i,
|
|
98
|
+
isSubmitDisabled: a,
|
|
99
|
+
isSubmitting: s
|
|
100
100
|
})
|
|
101
101
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ N(x, {
|
|
103
103
|
visuallyHidden: !0,
|
|
104
|
-
as:
|
|
105
|
-
children:
|
|
104
|
+
as: S.Span,
|
|
105
|
+
children: s ? e.submittingLabel ?? "Submitting" : ""
|
|
106
106
|
})
|
|
107
107
|
]
|
|
108
108
|
});
|
|
109
|
-
},
|
|
109
|
+
}, J = {
|
|
110
110
|
container: "_container_14mfe_1",
|
|
111
111
|
footer: "_footer_14mfe_10"
|
|
112
|
-
},
|
|
112
|
+
}, le = ({ labels: e, onBack: t, onCancel: n, onSubmit: r, isCancelDisabled: i = !1, isSubmitDisabled: a = !1, isSubmitting: s = !1, footerActionsOrder: c, backIcon: u, className: d, left: f, children: p, metadata: m, layout: h, styles: g }) => {
|
|
113
113
|
let { colors: _, header: v, cssVars: y } = g ?? {};
|
|
114
|
-
return /* @__PURE__ */
|
|
114
|
+
return /* @__PURE__ */ P("div", {
|
|
115
115
|
style: {
|
|
116
|
-
...
|
|
116
|
+
...o({ "--bfc-bg": _?.background }),
|
|
117
117
|
...y
|
|
118
118
|
},
|
|
119
|
-
className:
|
|
119
|
+
className: l("flex h-full min-h-0 w-full flex-col overflow-hidden", d, J.container),
|
|
120
120
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ N(ce, {
|
|
122
122
|
labels: e,
|
|
123
123
|
onBack: t,
|
|
124
124
|
onCancel: n,
|
|
125
125
|
onSubmit: r,
|
|
126
|
-
isCancelDisabled:
|
|
127
|
-
isSubmitDisabled:
|
|
128
|
-
isSubmitting:
|
|
126
|
+
isCancelDisabled: i,
|
|
127
|
+
isSubmitDisabled: a,
|
|
128
|
+
isSubmitting: s,
|
|
129
129
|
backIcon: u,
|
|
130
130
|
styles: v
|
|
131
131
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ N(se, {
|
|
133
133
|
left: f,
|
|
134
134
|
metadata: m,
|
|
135
135
|
layout: h,
|
|
136
136
|
children: p
|
|
137
137
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
className:
|
|
140
|
-
children: /* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ N("div", {
|
|
139
|
+
className: l("sticky bottom-0 z-10 items-center gap-2 p-3 shadow-sm", J.footer),
|
|
140
|
+
children: /* @__PURE__ */ N(ae, {
|
|
141
141
|
labels: e,
|
|
142
142
|
onCancel: n,
|
|
143
143
|
onSubmit: r,
|
|
144
|
-
isCancelDisabled:
|
|
145
|
-
isSubmitDisabled:
|
|
146
|
-
isSubmitting:
|
|
144
|
+
isCancelDisabled: i,
|
|
145
|
+
isSubmitDisabled: a,
|
|
146
|
+
isSubmitting: s,
|
|
147
147
|
buttonClassName: "flex-1",
|
|
148
|
-
order:
|
|
148
|
+
order: c
|
|
149
149
|
})
|
|
150
150
|
})
|
|
151
151
|
]
|
|
152
152
|
});
|
|
153
|
-
},
|
|
153
|
+
}, Y = {
|
|
154
154
|
layout: "dial-builder-form-layout",
|
|
155
155
|
section: "dial-builder-form-section",
|
|
156
156
|
metadataSection: "dial-builder-form-metadata-section",
|
|
157
157
|
setupSection: "dial-builder-form-setup-section",
|
|
158
158
|
asideSection: "dial-builder-form-aside-section"
|
|
159
|
-
},
|
|
159
|
+
}, ue = {
|
|
160
160
|
section: "_section_l1mnx_1",
|
|
161
161
|
title: "_title_l1mnx_5"
|
|
162
162
|
}, X = ({ title: e, children: t, styles: n, className: r }) => {
|
|
163
|
-
let
|
|
163
|
+
let i = o({
|
|
164
164
|
"--es-border-color": n?.colors?.borderColor,
|
|
165
165
|
"--es-title-color": n?.colors?.titleColor
|
|
166
166
|
});
|
|
167
|
-
return /* @__PURE__ */
|
|
168
|
-
className:
|
|
169
|
-
style:
|
|
170
|
-
children: [e != null && /* @__PURE__ */
|
|
171
|
-
className:
|
|
167
|
+
return /* @__PURE__ */ P("section", {
|
|
168
|
+
className: l("flex h-full flex-col gap-4 rounded border", ue.section, r, Y.section),
|
|
169
|
+
style: i,
|
|
170
|
+
children: [e != null && /* @__PURE__ */ N("h2", {
|
|
171
|
+
className: l(n?.typography?.titleClassName ?? "dial-h3-text", ue.title),
|
|
172
172
|
children: e
|
|
173
173
|
}), t]
|
|
174
174
|
});
|
|
175
|
-
},
|
|
175
|
+
}, de = (e, { min: t = 280, max: n = 640, containerWidth: r } = {}) => {
|
|
176
176
|
let i = r != null && r > 0 ? r - 360 : n;
|
|
177
177
|
return Math.round(Math.min(Math.max(t, Math.min(n, i)), Math.max(t, Number.isFinite(e) ? e : t)));
|
|
178
178
|
}, Z = {
|
|
179
179
|
headerBorder: "_headerBorder_1adw2_1",
|
|
180
180
|
footerBorder: "_footerBorder_1adw2_5",
|
|
181
181
|
columnBorder: "_columnBorder_1adw2_10"
|
|
182
|
-
},
|
|
183
|
-
let
|
|
184
|
-
min:
|
|
185
|
-
max:
|
|
186
|
-
containerWidth:
|
|
187
|
-
}, k = w ?
|
|
188
|
-
|
|
189
|
-
let e =
|
|
182
|
+
}, fe = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: r, leftContent: i, centerContent: a, rightContent: s, resizableLeftColumn: c, isSaving: u = !1, labels: d, styles: m, dir: h }) => {
|
|
183
|
+
let g = B(), v = u ? d?.savingStatusLabel ?? "Saving" : "", y = U(null), [b, C] = W(), w = c != null && a != null, T = c?.minWidth, E = c?.maxWidth, O = {
|
|
184
|
+
min: T,
|
|
185
|
+
max: E,
|
|
186
|
+
containerWidth: b
|
|
187
|
+
}, k = w ? de(c.width, O) : void 0, A = de(E ?? 640, O);
|
|
188
|
+
ie(() => {
|
|
189
|
+
let e = y.current;
|
|
190
190
|
if (!w || e == null || typeof ResizeObserver > "u") return;
|
|
191
191
|
let t = new ResizeObserver(() => C(e.clientWidth));
|
|
192
192
|
return t.observe(e), () => t.disconnect();
|
|
193
193
|
}, [w]);
|
|
194
|
-
let j =
|
|
194
|
+
let j = o({
|
|
195
195
|
"--el-header-border-color": m?.colors?.headerBorderColor,
|
|
196
196
|
"--el-sidebar-border-color": m?.colors?.sidebarBorderColor
|
|
197
197
|
});
|
|
198
|
-
return /* @__PURE__ */
|
|
199
|
-
dir:
|
|
200
|
-
className:
|
|
198
|
+
return /* @__PURE__ */ P("div", {
|
|
199
|
+
dir: h,
|
|
200
|
+
className: l("flex min-h-0 flex-1 flex-col", Y.layout),
|
|
201
201
|
style: j,
|
|
202
202
|
children: [
|
|
203
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ N(x, {
|
|
204
204
|
visuallyHidden: !0,
|
|
205
|
-
as:
|
|
206
|
-
id:
|
|
205
|
+
as: S.Span,
|
|
206
|
+
id: g,
|
|
207
207
|
children: v
|
|
208
208
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
-
className:
|
|
211
|
-
children: [/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ P("div", {
|
|
210
|
+
className: l("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__ */ P("div", {
|
|
212
212
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
214
|
-
icon: /* @__PURE__ */
|
|
215
|
-
size:
|
|
216
|
-
stroke:
|
|
213
|
+
children: [/* @__PURE__ */ N(_, {
|
|
214
|
+
icon: /* @__PURE__ */ N(I, {
|
|
215
|
+
size: f.LG,
|
|
216
|
+
stroke: p,
|
|
217
217
|
"aria-hidden": !0,
|
|
218
218
|
className: "rtl:scale-x-[-1]"
|
|
219
219
|
}),
|
|
220
220
|
"aria-label": n,
|
|
221
221
|
onClick: t
|
|
222
|
-
}), /* @__PURE__ */
|
|
223
|
-
className:
|
|
222
|
+
}), /* @__PURE__ */ N("h1", {
|
|
223
|
+
className: l(m?.typography?.titleClassName ?? "dial-h2-text", "min-w-0 truncate"),
|
|
224
224
|
children: e
|
|
225
225
|
})]
|
|
226
|
-
}), r != null && /* @__PURE__ */
|
|
226
|
+
}), r != null && /* @__PURE__ */ N("div", {
|
|
227
227
|
className: "hidden shrink-0 items-center gap-2 desktop:flex",
|
|
228
228
|
children: r
|
|
229
229
|
})]
|
|
230
230
|
}),
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
-
ref:
|
|
231
|
+
/* @__PURE__ */ P("div", {
|
|
232
|
+
ref: y,
|
|
233
233
|
className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
|
|
234
234
|
children: [
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
className:
|
|
235
|
+
/* @__PURE__ */ N("div", {
|
|
236
|
+
className: l(a == null ? "desktop:flex-1" : "desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", a != null && !w && "desktop:w-[400px]", w && "desktop:relative desktop:w-(--el-left-width)", "desktop:overflow-y-auto", a == null ? void 0 : Z.columnBorder),
|
|
237
237
|
style: k == null ? void 0 : { "--el-left-width": `${k}px` },
|
|
238
|
-
children:
|
|
238
|
+
children: i
|
|
239
239
|
}),
|
|
240
|
-
w && k != null && /* @__PURE__ */
|
|
240
|
+
w && k != null && /* @__PURE__ */ N("div", {
|
|
241
241
|
className: "relative hidden w-0 shrink-0 desktop:block",
|
|
242
|
-
children: /* @__PURE__ */
|
|
242
|
+
children: /* @__PURE__ */ N(D, {
|
|
243
243
|
width: k,
|
|
244
|
-
minWidth:
|
|
244
|
+
minWidth: T ?? 280,
|
|
245
245
|
maxWidth: A,
|
|
246
|
-
defaultWidth:
|
|
247
|
-
onWidthChange:
|
|
248
|
-
label:
|
|
249
|
-
tooltip:
|
|
246
|
+
defaultWidth: c.defaultWidth ?? 400,
|
|
247
|
+
onWidthChange: c.onWidthChange,
|
|
248
|
+
label: d?.resizeHandleLabel ?? "Resize columns",
|
|
249
|
+
tooltip: d?.resizeHandleTooltip ?? "Drag to resize"
|
|
250
250
|
})
|
|
251
251
|
}),
|
|
252
|
-
|
|
252
|
+
a != null && /* @__PURE__ */ N("div", {
|
|
253
253
|
className: "desktop:flex desktop:min-h-0 desktop:flex-1 desktop:flex-col desktop:overflow-y-auto",
|
|
254
|
-
children:
|
|
254
|
+
children: a
|
|
255
255
|
}),
|
|
256
|
-
|
|
257
|
-
className:
|
|
258
|
-
children:
|
|
256
|
+
s != null && /* @__PURE__ */ N("div", {
|
|
257
|
+
className: l("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s", Z.columnBorder),
|
|
258
|
+
children: s
|
|
259
259
|
})
|
|
260
260
|
]
|
|
261
261
|
}),
|
|
262
|
-
r != null && /* @__PURE__ */
|
|
263
|
-
className:
|
|
262
|
+
r != null && /* @__PURE__ */ N("div", {
|
|
263
|
+
className: l("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 *:flex-1 desktop:hidden", Z.footerBorder),
|
|
264
264
|
children: r
|
|
265
265
|
})
|
|
266
266
|
]
|
|
267
267
|
});
|
|
268
|
-
},
|
|
268
|
+
}, pe = {
|
|
269
269
|
box: "_box_c9as8_1",
|
|
270
270
|
icon: "_icon_c9as8_6",
|
|
271
271
|
caption: "_caption_c9as8_10"
|
|
272
|
-
},
|
|
273
|
-
let
|
|
274
|
-
"--aa-box-bg":
|
|
275
|
-
"--aa-box-border":
|
|
276
|
-
"--aa-icon":
|
|
277
|
-
"--aa-caption":
|
|
272
|
+
}, me = ({ label: e, avatarUrl: t, avatarAlt: n = "", addAvatarLabel: r = "Add avatar", captionText: i = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: a, captionClassName: s = "dial-tiny-text", styles: c, className: u }) => {
|
|
273
|
+
let d = o({
|
|
274
|
+
"--aa-box-bg": c?.colors?.boxBackgroundColor,
|
|
275
|
+
"--aa-box-border": c?.colors?.boxBorderColor,
|
|
276
|
+
"--aa-icon": c?.colors?.placeholderIconColor,
|
|
277
|
+
"--aa-caption": c?.colors?.captionColor
|
|
278
278
|
});
|
|
279
|
-
return /* @__PURE__ */
|
|
280
|
-
className:
|
|
281
|
-
style:
|
|
282
|
-
children: [/* @__PURE__ */
|
|
279
|
+
return /* @__PURE__ */ P("div", {
|
|
280
|
+
className: l("flex flex-col gap-2", u),
|
|
281
|
+
style: d,
|
|
282
|
+
children: [/* @__PURE__ */ N(y, { label: e }), /* @__PURE__ */ P("div", {
|
|
283
283
|
className: "flex items-start gap-3",
|
|
284
|
-
children: [/* @__PURE__ */
|
|
285
|
-
className:
|
|
286
|
-
children: t ? /* @__PURE__ */
|
|
284
|
+
children: [/* @__PURE__ */ N("div", {
|
|
285
|
+
className: l("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", pe.box),
|
|
286
|
+
children: t ? /* @__PURE__ */ N("img", {
|
|
287
287
|
src: t,
|
|
288
288
|
alt: n,
|
|
289
289
|
className: "h-16 w-16 object-cover"
|
|
290
|
-
}) : /* @__PURE__ */
|
|
291
|
-
size:
|
|
292
|
-
stroke:
|
|
290
|
+
}) : /* @__PURE__ */ N(L, {
|
|
291
|
+
size: f.LG,
|
|
292
|
+
stroke: p,
|
|
293
293
|
"aria-hidden": !0,
|
|
294
|
-
className:
|
|
294
|
+
className: pe.icon
|
|
295
295
|
})
|
|
296
|
-
}), /* @__PURE__ */
|
|
296
|
+
}), /* @__PURE__ */ P("div", {
|
|
297
297
|
className: "flex flex-col gap-3",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
299
|
-
size:
|
|
300
|
-
iconBefore: /* @__PURE__ */
|
|
301
|
-
size:
|
|
302
|
-
stroke:
|
|
298
|
+
children: [/* @__PURE__ */ N(g, {
|
|
299
|
+
size: h.Small,
|
|
300
|
+
iconBefore: /* @__PURE__ */ N(R, {
|
|
301
|
+
size: f.SM,
|
|
302
|
+
stroke: p,
|
|
303
303
|
"aria-hidden": !0
|
|
304
304
|
}),
|
|
305
305
|
className: "w-fit",
|
|
306
306
|
label: r,
|
|
307
|
-
onClick:
|
|
308
|
-
}), /* @__PURE__ */
|
|
309
|
-
className: s
|
|
310
|
-
children:
|
|
307
|
+
onClick: a
|
|
308
|
+
}), /* @__PURE__ */ N("span", {
|
|
309
|
+
className: l(s, pe.caption),
|
|
310
|
+
children: i
|
|
311
311
|
})]
|
|
312
312
|
})]
|
|
313
313
|
})]
|
|
314
314
|
});
|
|
315
|
-
},
|
|
315
|
+
}, he = {
|
|
316
316
|
confirmText: "_confirmText_19ec1_1",
|
|
317
317
|
confirmItem: "_confirmItem_19ec1_5"
|
|
318
|
-
},
|
|
319
|
-
let f = d?.colors?.confirmText, p = d?.colors?.confirmItemText, m = z((e) => e.length === 1 ?
|
|
320
|
-
className:
|
|
321
|
-
style:
|
|
318
|
+
}, ge = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: s, labels: c, confirmBodyClassName: u = "dial-small-text", styles: d }) => {
|
|
319
|
+
let f = d?.colors?.confirmText, p = d?.colors?.confirmItemText, m = z((e) => e.length === 1 ? c.deleteConfirmTitleSingle : c.deleteConfirmTitleMultiple, [c.deleteConfirmTitleSingle, c.deleteConfirmTitleMultiple]), h = z((e) => /* @__PURE__ */ N("div", {
|
|
320
|
+
className: l(u, "px-6 py-3"),
|
|
321
|
+
style: o({
|
|
322
322
|
"--apm-confirm-text": f,
|
|
323
323
|
"--apm-confirm-item-text": p
|
|
324
324
|
}),
|
|
325
|
-
children: /* @__PURE__ */
|
|
326
|
-
className:
|
|
327
|
-
children: e.length === 1 ? /* @__PURE__ */
|
|
328
|
-
|
|
325
|
+
children: /* @__PURE__ */ N("p", {
|
|
326
|
+
className: l("mb-3", he.confirmText),
|
|
327
|
+
children: e.length === 1 ? /* @__PURE__ */ P(M, { children: [
|
|
328
|
+
c.deleteConfirmSingleText,
|
|
329
329
|
" ",
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
className:
|
|
330
|
+
/* @__PURE__ */ P("span", {
|
|
331
|
+
className: l("wrap-break-word", he.confirmItem),
|
|
332
332
|
children: [
|
|
333
333
|
"\"",
|
|
334
334
|
e[0].split("/").pop(),
|
|
335
335
|
"\"?"
|
|
336
336
|
]
|
|
337
337
|
})
|
|
338
|
-
] }) : /* @__PURE__ */
|
|
339
|
-
|
|
338
|
+
] }) : /* @__PURE__ */ P(M, { children: [
|
|
339
|
+
c.deleteConfirmMultipleText,
|
|
340
340
|
" ",
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
className:
|
|
341
|
+
/* @__PURE__ */ P("span", {
|
|
342
|
+
className: he.confirmItem,
|
|
343
343
|
children: [
|
|
344
344
|
e.length,
|
|
345
345
|
" ",
|
|
346
|
-
|
|
346
|
+
c.deleteConfirmItemsLabel
|
|
347
347
|
]
|
|
348
348
|
})
|
|
349
349
|
] })
|
|
350
350
|
})
|
|
351
351
|
}), [
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
352
|
+
c.deleteConfirmSingleText,
|
|
353
|
+
c.deleteConfirmMultipleText,
|
|
354
|
+
c.deleteConfirmItemsLabel,
|
|
355
355
|
f,
|
|
356
356
|
p,
|
|
357
357
|
u
|
|
358
358
|
]);
|
|
359
|
-
return /* @__PURE__ */
|
|
359
|
+
return /* @__PURE__ */ N(ne, {
|
|
360
360
|
fallback: null,
|
|
361
|
-
children: e && /* @__PURE__ */
|
|
361
|
+
children: e && /* @__PURE__ */ N(i, {
|
|
362
362
|
isOpen: e,
|
|
363
363
|
onClose: t,
|
|
364
364
|
onAttach: n,
|
|
365
365
|
bucket: r,
|
|
366
|
-
allowedTypes:
|
|
367
|
-
maxSelectableFileSize:
|
|
366
|
+
allowedTypes: a,
|
|
367
|
+
maxSelectableFileSize: s,
|
|
368
368
|
maximumAttachmentsAmount: 1,
|
|
369
369
|
canAttachFolders: !1,
|
|
370
|
-
title:
|
|
371
|
-
attachLabel:
|
|
372
|
-
emptyTitle:
|
|
373
|
-
emptyDescription:
|
|
374
|
-
errorMessage:
|
|
375
|
-
retryLabel:
|
|
376
|
-
hiddenFilesLabel:
|
|
377
|
-
showHiddenFilesLabel:
|
|
378
|
-
hideHiddenFilesLabel:
|
|
379
|
-
getSelectionLabel:
|
|
380
|
-
uploadFilesLabel:
|
|
381
|
-
newFolderLabel:
|
|
382
|
-
downloadLabel:
|
|
383
|
-
downloadingLabel:
|
|
384
|
-
deleteLabel:
|
|
385
|
-
deletingLabel:
|
|
370
|
+
title: c.title,
|
|
371
|
+
attachLabel: c.attachLabel,
|
|
372
|
+
emptyTitle: c.emptyTitle,
|
|
373
|
+
emptyDescription: c.emptyDescription,
|
|
374
|
+
errorMessage: c.errorMessage,
|
|
375
|
+
retryLabel: c.retryLabel,
|
|
376
|
+
hiddenFilesLabel: c.hiddenFilesLabel,
|
|
377
|
+
showHiddenFilesLabel: c.showHiddenFilesLabel,
|
|
378
|
+
hideHiddenFilesLabel: c.hideHiddenFilesLabel,
|
|
379
|
+
getSelectionLabel: c.getSelectionLabel,
|
|
380
|
+
uploadFilesLabel: c.uploadFilesLabel,
|
|
381
|
+
newFolderLabel: c.newFolderLabel,
|
|
382
|
+
downloadLabel: c.downloadLabel,
|
|
383
|
+
downloadingLabel: c.downloadingLabel,
|
|
384
|
+
deleteLabel: c.deleteLabel,
|
|
385
|
+
deletingLabel: c.deletingLabel,
|
|
386
386
|
deleteConfirmTitle: m,
|
|
387
387
|
deleteConfirmBody: h,
|
|
388
|
-
deleteConfirmLabel:
|
|
389
|
-
deleteCancelLabel:
|
|
388
|
+
deleteConfirmLabel: c.deleteConfirmLabel,
|
|
389
|
+
deleteCancelLabel: c.deleteCancelLabel
|
|
390
390
|
})
|
|
391
391
|
});
|
|
392
392
|
}, Q = /* @__PURE__ */ function(e) {
|
|
393
393
|
return e.Avatar = "avatar", e.Name = "name", e.Version = "version", e.Description = "description", e.Locales = "locales", e.Tags = "tags", e;
|
|
394
|
-
}({}),
|
|
394
|
+
}({}), _e = [
|
|
395
395
|
"avatar",
|
|
396
396
|
"name",
|
|
397
397
|
"version",
|
|
398
398
|
"description",
|
|
399
399
|
"locales",
|
|
400
400
|
"tags"
|
|
401
|
-
],
|
|
401
|
+
], ve = {
|
|
402
402
|
summary: "_summary_1hlc9_1",
|
|
403
403
|
rowLabel: "_rowLabel_1hlc9_5"
|
|
404
|
-
},
|
|
404
|
+
}, ye = (e, t, n) => ({
|
|
405
405
|
id: e,
|
|
406
406
|
language: n.find((e) => !t.has(e.code))?.code ?? "",
|
|
407
407
|
name: "",
|
|
408
408
|
description: ""
|
|
409
|
-
}),
|
|
410
|
-
let
|
|
411
|
-
"--dlf-summary-text":
|
|
412
|
-
"--dlf-row-label-text":
|
|
413
|
-
}), { summaryLabel: x, addLabel: S, editLabel:
|
|
414
|
-
|
|
415
|
-
|
|
409
|
+
}), be = (e) => e.toUpperCase(), xe = ({ value: e, onChange: t, availableLocaleOptions: r = [], formatLocaleLabel: i = be, labels: a, className: s, summaryClassName: c = "dial-body-text", rowLabelClassName: g = "dial-tiny-lead-text", colors: _ }) => {
|
|
410
|
+
let y = o({
|
|
411
|
+
"--dlf-summary-text": _?.summaryText,
|
|
412
|
+
"--dlf-row-label-text": _?.rowLabelText
|
|
413
|
+
}), { summaryLabel: x, addLabel: S, editLabel: C, popupTitle: w, addLocaleLabel: E, localeRowLabel: D = "Locale", languageLabel: k, nameLabel: A, namePlaceholder: M, descriptionLabel: F, descriptionPlaceholder: I, deleteAriaLabel: L, cancelLabel: ne = "Cancel", saveLabel: re = "Save" } = a, [z, B] = W(!1), [V, H] = W([]), G = U(0);
|
|
414
|
+
ie(() => {
|
|
415
|
+
z && H(e.length > 0 ? e : [ye(`locale-row-${++G.current}`, /* @__PURE__ */ new Set(), r)]);
|
|
416
416
|
}, [
|
|
417
|
-
|
|
417
|
+
z,
|
|
418
418
|
e,
|
|
419
419
|
r
|
|
420
420
|
]);
|
|
421
|
-
let ae = () => B(!0),
|
|
422
|
-
t(
|
|
421
|
+
let ae = () => B(!0), K = () => B(!1), oe = () => {
|
|
422
|
+
t(V.filter((e) => e.language && e.name)), B(!1);
|
|
423
423
|
}, se = () => {
|
|
424
|
-
let e = new Set(
|
|
425
|
-
|
|
424
|
+
let e = new Set(V.map((e) => e.language).filter(Boolean));
|
|
425
|
+
H((t) => [...t, ye(`locale-row-${++G.current}`, e, r)]);
|
|
426
426
|
}, q = (e, t) => {
|
|
427
|
-
|
|
427
|
+
H((n) => n.map((n) => n.id === e ? {
|
|
428
428
|
...n,
|
|
429
429
|
...t
|
|
430
430
|
} : n));
|
|
431
431
|
}, ce = (e) => {
|
|
432
|
-
|
|
433
|
-
}, J = new Set(r.map((e) => e.code)),
|
|
434
|
-
let
|
|
432
|
+
H((t) => t.filter((t) => t.id !== e));
|
|
433
|
+
}, J = new Set(r.map((e) => e.code)), le = (e) => e !== "" && !J.has(e), Y = e.some((e) => le(e.language)), ue = new Set(V.map((e) => e.language).filter((e) => J.has(e))).size, X = (t, n) => {
|
|
434
|
+
let a = e.find((e) => e.id === t.id)?.language, o = [...new Set([a ?? "", t.language].filter(le))];
|
|
435
435
|
return [...r.map((e) => ({
|
|
436
436
|
value: e.code,
|
|
437
437
|
label: e.label,
|
|
438
438
|
disabled: n.has(e.code)
|
|
439
439
|
})), ...o.map((e) => ({
|
|
440
440
|
value: e,
|
|
441
|
-
label:
|
|
441
|
+
label: i(e),
|
|
442
442
|
disabled: n.has(e)
|
|
443
443
|
}))];
|
|
444
|
-
},
|
|
445
|
-
return r.length === 0 && !
|
|
446
|
-
className:
|
|
447
|
-
style:
|
|
444
|
+
}, de = V.some((e) => !e.language || !e.name);
|
|
445
|
+
return r.length === 0 && !Y ? null : /* @__PURE__ */ P("div", {
|
|
446
|
+
className: l("flex items-center gap-2", s),
|
|
447
|
+
style: y,
|
|
448
448
|
children: [
|
|
449
|
-
e.length > 0 && /* @__PURE__ */
|
|
450
|
-
className:
|
|
449
|
+
e.length > 0 && /* @__PURE__ */ N("span", {
|
|
450
|
+
className: l(ve.summary, c),
|
|
451
451
|
children: `${x}: ${e.map((e) => `[${e.language.toUpperCase()}]`).join(", ")}`
|
|
452
452
|
}),
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
-
label: e.length > 0 ?
|
|
455
|
-
iconBefore: /* @__PURE__ */
|
|
456
|
-
size:
|
|
453
|
+
/* @__PURE__ */ N(b, {
|
|
454
|
+
label: e.length > 0 ? C : S,
|
|
455
|
+
iconBefore: /* @__PURE__ */ N(R, {
|
|
456
|
+
size: f.SM,
|
|
457
457
|
"aria-hidden": !0,
|
|
458
|
-
stroke:
|
|
458
|
+
stroke: p
|
|
459
459
|
}),
|
|
460
460
|
className: "px-0!",
|
|
461
461
|
onClick: ae
|
|
462
462
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
open:
|
|
465
|
-
header:
|
|
466
|
-
onClose:
|
|
463
|
+
/* @__PURE__ */ N(T, {
|
|
464
|
+
open: z,
|
|
465
|
+
header: w,
|
|
466
|
+
onClose: K,
|
|
467
467
|
mainButtons: [{
|
|
468
|
-
label:
|
|
469
|
-
onClick:
|
|
468
|
+
label: ne,
|
|
469
|
+
onClick: K
|
|
470
470
|
}, {
|
|
471
471
|
label: re,
|
|
472
|
-
variant:
|
|
473
|
-
disabled:
|
|
474
|
-
onClick:
|
|
472
|
+
variant: d.Primary,
|
|
473
|
+
disabled: de,
|
|
474
|
+
onClick: oe
|
|
475
475
|
}],
|
|
476
|
-
children: /* @__PURE__ */
|
|
476
|
+
children: /* @__PURE__ */ P("div", {
|
|
477
477
|
className: "flex flex-col gap-8 px-6 py-3",
|
|
478
|
-
style:
|
|
479
|
-
children: [
|
|
480
|
-
let r = new Set(
|
|
481
|
-
return /* @__PURE__ */
|
|
478
|
+
style: y,
|
|
479
|
+
children: [V.map((e, t) => {
|
|
480
|
+
let r = new Set(V.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
|
|
481
|
+
return /* @__PURE__ */ P("div", {
|
|
482
482
|
className: "flex flex-col gap-2",
|
|
483
|
-
children: [/* @__PURE__ */
|
|
483
|
+
children: [/* @__PURE__ */ P("div", {
|
|
484
484
|
className: "flex items-center justify-between",
|
|
485
|
-
children: [/* @__PURE__ */
|
|
486
|
-
className:
|
|
485
|
+
children: [/* @__PURE__ */ P("span", {
|
|
486
|
+
className: l(ve.rowLabel, g),
|
|
487
487
|
children: [
|
|
488
|
-
|
|
488
|
+
D,
|
|
489
489
|
" ",
|
|
490
490
|
t + 1
|
|
491
491
|
]
|
|
492
|
-
}), /* @__PURE__ */
|
|
493
|
-
appearance:
|
|
494
|
-
size:
|
|
495
|
-
icon: /* @__PURE__ */
|
|
496
|
-
size:
|
|
492
|
+
}), /* @__PURE__ */ N(m, {
|
|
493
|
+
appearance: u.Ghost,
|
|
494
|
+
size: h.Small,
|
|
495
|
+
icon: /* @__PURE__ */ N(te, {
|
|
496
|
+
size: f.SM,
|
|
497
497
|
"aria-hidden": !0,
|
|
498
|
-
stroke:
|
|
498
|
+
stroke: p
|
|
499
499
|
}),
|
|
500
|
-
"aria-label": `${
|
|
500
|
+
"aria-label": `${L} ${t + 1}`,
|
|
501
501
|
onClick: () => ce(e.id)
|
|
502
502
|
})]
|
|
503
|
-
}), /* @__PURE__ */
|
|
503
|
+
}), /* @__PURE__ */ P("div", {
|
|
504
504
|
role: "group",
|
|
505
|
-
"aria-label": `${
|
|
505
|
+
"aria-label": `${D} ${t + 1}`,
|
|
506
506
|
className: "flex flex-col gap-5",
|
|
507
|
-
children: [/* @__PURE__ */
|
|
507
|
+
children: [/* @__PURE__ */ P("div", {
|
|
508
508
|
className: "flex flex-col gap-5 desktop:flex-row desktop:items-start",
|
|
509
|
-
children: [/* @__PURE__ */
|
|
509
|
+
children: [/* @__PURE__ */ N(O, {
|
|
510
510
|
id: `${e.id}-language`,
|
|
511
511
|
labelProps: {
|
|
512
|
-
label:
|
|
512
|
+
label: k,
|
|
513
513
|
required: !0
|
|
514
514
|
},
|
|
515
515
|
className: "desktop:shrink-0 desktop:basis-40",
|
|
516
|
-
options:
|
|
516
|
+
options: X(e, r),
|
|
517
517
|
value: e.language,
|
|
518
518
|
onChange: (t) => q(e.id, { language: t })
|
|
519
|
-
}), /* @__PURE__ */
|
|
519
|
+
}), /* @__PURE__ */ N(v, {
|
|
520
520
|
id: `${e.id}-name`,
|
|
521
521
|
containerClassName: "min-w-0 flex-1",
|
|
522
522
|
required: !0,
|
|
523
523
|
value: e.name,
|
|
524
524
|
onChange: (t) => q(e.id, { name: t ?? "" }),
|
|
525
525
|
labelProps: {
|
|
526
|
-
label:
|
|
526
|
+
label: A,
|
|
527
527
|
required: !0
|
|
528
528
|
},
|
|
529
|
-
placeholder:
|
|
529
|
+
placeholder: M
|
|
530
530
|
})]
|
|
531
|
-
}), /* @__PURE__ */
|
|
531
|
+
}), /* @__PURE__ */ N(j, {
|
|
532
532
|
id: `${e.id}-description`,
|
|
533
533
|
className: n,
|
|
534
|
-
resize:
|
|
534
|
+
resize: ee.Vertical,
|
|
535
535
|
value: e.description,
|
|
536
536
|
onChange: (t) => q(e.id, { description: t }),
|
|
537
|
-
labelProps: { label:
|
|
538
|
-
placeholder:
|
|
537
|
+
labelProps: { label: F },
|
|
538
|
+
placeholder: I
|
|
539
539
|
})]
|
|
540
540
|
})]
|
|
541
541
|
}, e.id);
|
|
542
|
-
}), /* @__PURE__ */
|
|
543
|
-
label:
|
|
544
|
-
iconBefore: /* @__PURE__ */
|
|
545
|
-
size:
|
|
542
|
+
}), /* @__PURE__ */ N(b, {
|
|
543
|
+
label: E,
|
|
544
|
+
iconBefore: /* @__PURE__ */ N(R, {
|
|
545
|
+
size: f.SM,
|
|
546
546
|
"aria-hidden": !0,
|
|
547
|
-
stroke:
|
|
547
|
+
stroke: p
|
|
548
548
|
}),
|
|
549
549
|
className: "self-start",
|
|
550
550
|
onClick: se,
|
|
551
|
-
disabled:
|
|
551
|
+
disabled: ue >= r.length
|
|
552
552
|
})]
|
|
553
553
|
})
|
|
554
554
|
})
|
|
555
555
|
]
|
|
556
556
|
});
|
|
557
|
-
},
|
|
558
|
-
let T =
|
|
559
|
-
|
|
557
|
+
}, Se = "Add tags, comma separated", Ce = "The version is changed with \"Save as new version\"", we = "deployment-creation-form-description", Te = ({ values: e, errors: t, onChange: r, onNameBlur: i, onVersionBlur: o, iconPreviewUrl: s, onAddAvatarClick: c, labels: u, styles: d, availableLocaleOptions: f = [], formatLocaleLabel: p, fields: m = _e, isNameReadOnly: h = !1, nameReadOnlyTooltip: g, isVersionReadOnly: _ = !1, versionReadOnlyTooltip: y = Ce, nameCaption: b, isDescriptionRequired: x = !1, descriptionCaption: S, renderDescription: C, focusRequestKey: w }) => {
|
|
558
|
+
let T = U(null), E = U(null), D = U(null), O = U(!1), k = (e) => m.includes(e), M = k(Q.Name), F = k(Q.Version), I = !!(t.name || t.version || t.description), L = U(w);
|
|
559
|
+
ie(() => {
|
|
560
560
|
let e = () => {
|
|
561
561
|
t.name ? T.current?.focus() : t.version ? E.current?.focus() : t.description && D.current?.focus();
|
|
562
562
|
};
|
|
563
|
-
w === void 0 ? (
|
|
563
|
+
w === void 0 ? (I && !O.current && e(), O.current = I) : w !== L.current && (L.current = w, e());
|
|
564
564
|
}, [
|
|
565
565
|
w,
|
|
566
|
-
|
|
566
|
+
I,
|
|
567
567
|
t.name,
|
|
568
568
|
t.version,
|
|
569
569
|
t.description
|
|
570
570
|
]);
|
|
571
|
-
let R = /* @__PURE__ */
|
|
572
|
-
id:
|
|
571
|
+
let R = /* @__PURE__ */ N(j, {
|
|
572
|
+
id: we,
|
|
573
573
|
ref: D,
|
|
574
574
|
value: e.description,
|
|
575
|
-
onChange: (e) =>
|
|
575
|
+
onChange: (e) => r({ description: e }),
|
|
576
576
|
"aria-required": x || void 0,
|
|
577
577
|
labelProps: C ? void 0 : {
|
|
578
578
|
label: u.description.label,
|
|
@@ -584,31 +584,31 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
584
584
|
invalid: !!t.description,
|
|
585
585
|
containerClassName: C ? void 0 : d?.field,
|
|
586
586
|
className: n,
|
|
587
|
-
resize:
|
|
587
|
+
resize: ee.Vertical
|
|
588
588
|
});
|
|
589
|
-
return /* @__PURE__ */
|
|
589
|
+
return /* @__PURE__ */ P("div", {
|
|
590
590
|
role: u.ariaLabel ? "group" : void 0,
|
|
591
591
|
"aria-label": u.ariaLabel,
|
|
592
|
-
className:
|
|
592
|
+
className: l("flex flex-col gap-4", d?.root),
|
|
593
593
|
children: [
|
|
594
|
-
|
|
594
|
+
k(Q.Avatar) && /* @__PURE__ */ N(me, {
|
|
595
595
|
label: u.iconUrl.label,
|
|
596
|
-
avatarUrl:
|
|
596
|
+
avatarUrl: s,
|
|
597
597
|
addAvatarLabel: u.iconUrl.addAvatarLabel,
|
|
598
598
|
captionText: u.iconUrl.captionText,
|
|
599
|
-
onAddAvatarClick:
|
|
599
|
+
onAddAvatarClick: c,
|
|
600
600
|
className: d?.field
|
|
601
601
|
}),
|
|
602
|
-
(
|
|
603
|
-
className:
|
|
604
|
-
children: [
|
|
602
|
+
(M || F) && /* @__PURE__ */ P("div", {
|
|
603
|
+
className: l("flex items-start gap-4", d?.field),
|
|
604
|
+
children: [M && /* @__PURE__ */ N(v, {
|
|
605
605
|
id: "deployment-creation-form-name",
|
|
606
606
|
inputRef: T,
|
|
607
607
|
value: e.name,
|
|
608
|
-
onChange: (e) =>
|
|
609
|
-
onBlur:
|
|
608
|
+
onChange: (e) => r({ name: e ?? "" }),
|
|
609
|
+
onBlur: i,
|
|
610
610
|
disabled: h,
|
|
611
|
-
tooltipText: h ?
|
|
611
|
+
tooltipText: h ? g : void 0,
|
|
612
612
|
labelProps: {
|
|
613
613
|
label: u.name.label,
|
|
614
614
|
required: !0
|
|
@@ -617,102 +617,102 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
617
617
|
caption: b,
|
|
618
618
|
error: t.name || void 0,
|
|
619
619
|
invalid: !!t.name,
|
|
620
|
-
containerClassName:
|
|
621
|
-
}),
|
|
620
|
+
containerClassName: F ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
|
|
621
|
+
}), F && /* @__PURE__ */ N(v, {
|
|
622
622
|
id: "deployment-creation-form-version",
|
|
623
623
|
inputRef: E,
|
|
624
624
|
value: e.version,
|
|
625
625
|
onChange: (e) => {
|
|
626
|
-
|
|
626
|
+
_ || r({ version: e ?? "" });
|
|
627
627
|
},
|
|
628
|
-
onBlur:
|
|
629
|
-
readOnly:
|
|
630
|
-
tooltipText:
|
|
628
|
+
onBlur: _ ? void 0 : o,
|
|
629
|
+
readOnly: _,
|
|
630
|
+
tooltipText: _ ? y : void 0,
|
|
631
631
|
labelProps: { label: u.version.label },
|
|
632
632
|
placeholder: u.version.placeholder,
|
|
633
633
|
error: t.version || void 0,
|
|
634
634
|
invalid: !!t.version,
|
|
635
|
-
containerClassName:
|
|
635
|
+
containerClassName: M ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
|
|
636
636
|
})]
|
|
637
637
|
}),
|
|
638
|
-
|
|
638
|
+
k(Q.Description) && (C ? /* @__PURE__ */ N("div", {
|
|
639
639
|
className: d?.field,
|
|
640
|
-
children: C(R,
|
|
640
|
+
children: C(R, we)
|
|
641
641
|
}) : R),
|
|
642
|
-
|
|
642
|
+
k(Q.Locales) && /* @__PURE__ */ N(xe, {
|
|
643
643
|
value: e.otherLocales,
|
|
644
|
-
onChange: (e) =>
|
|
644
|
+
onChange: (e) => r({ otherLocales: e }),
|
|
645
645
|
availableLocaleOptions: f,
|
|
646
646
|
formatLocaleLabel: p,
|
|
647
647
|
labels: u.otherLocales,
|
|
648
648
|
className: d?.field,
|
|
649
649
|
colors: d?.localesColors
|
|
650
650
|
}),
|
|
651
|
-
|
|
651
|
+
k(Q.Tags) && /* @__PURE__ */ N("div", {
|
|
652
652
|
className: d?.field,
|
|
653
|
-
children: /* @__PURE__ */
|
|
653
|
+
children: /* @__PURE__ */ N(A, {
|
|
654
654
|
id: "deployment-creation-form-topics",
|
|
655
655
|
labelProps: { label: u.topics.label },
|
|
656
|
-
placeholder: u.topics.placeholder ??
|
|
656
|
+
placeholder: u.topics.placeholder ?? Se,
|
|
657
657
|
value: e.topics,
|
|
658
|
-
onChange: (e) =>
|
|
659
|
-
tagClassName:
|
|
658
|
+
onChange: (e) => r({ topics: e }),
|
|
659
|
+
tagClassName: a
|
|
660
660
|
})
|
|
661
661
|
})
|
|
662
662
|
]
|
|
663
663
|
});
|
|
664
|
-
},
|
|
665
|
-
let A = /* @__PURE__ */
|
|
666
|
-
politeness:
|
|
667
|
-
className: v == null ? void 0 :
|
|
664
|
+
}, Ee = "border-0 p-4 desktop:p-8", De = "border-0", Oe = "desktop:flex-1", ke = "px-4 pt-4 desktop:px-6 desktop:pt-6", Ae = re(({ title: e, onBack: t, onCancel: n, onSubmit: r, submitLabel: i, isSubmitting: a = !1, isSubmitDisabled: o = !1, extraActions: s, hideStandardActions: c = !1, metadata: u, metadataTitle: d, metadataFooter: f, setup: p, setupTitle: m, asideData: h, asideTitle: g, asideSectionClassName: _, alert: v, resizableLeftColumn: y, metadataSectionClassName: b, setupSectionClassName: S, hasSetupSectionPadding: T = !0, labels: D, styles: O, dir: k }) => {
|
|
665
|
+
let A = /* @__PURE__ */ N(x, {
|
|
666
|
+
politeness: C.Assertive,
|
|
667
|
+
className: v == null ? void 0 : ke,
|
|
668
668
|
children: v
|
|
669
|
-
}),
|
|
670
|
-
return /* @__PURE__ */
|
|
669
|
+
}), j = p != null;
|
|
670
|
+
return /* @__PURE__ */ N(fe, {
|
|
671
671
|
title: e,
|
|
672
672
|
onBack: t,
|
|
673
673
|
backAriaLabel: D?.backAriaLabel ?? "Back",
|
|
674
674
|
isSaving: a,
|
|
675
|
-
resizableLeftColumn:
|
|
675
|
+
resizableLeftColumn: y,
|
|
676
676
|
labels: {
|
|
677
677
|
savingStatusLabel: D?.savingStatusLabel ?? "Saving",
|
|
678
678
|
resizeHandleLabel: D?.resizeHandleLabel,
|
|
679
679
|
resizeHandleTooltip: D?.resizeHandleTooltip
|
|
680
680
|
},
|
|
681
|
-
rightContent: h == null ? void 0 : /* @__PURE__ */
|
|
681
|
+
rightContent: h == null ? void 0 : /* @__PURE__ */ N(X, {
|
|
682
682
|
title: g,
|
|
683
683
|
styles: O?.section,
|
|
684
|
-
className:
|
|
684
|
+
className: l(Ee, _, Y.asideSection),
|
|
685
685
|
children: h
|
|
686
686
|
}),
|
|
687
687
|
styles: O?.layout,
|
|
688
688
|
dir: k,
|
|
689
|
-
actions: /* @__PURE__ */
|
|
689
|
+
actions: /* @__PURE__ */ P(M, { children: [s, !c && /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(w, {
|
|
690
690
|
label: D?.cancelLabel ?? "Cancel",
|
|
691
691
|
disabled: a,
|
|
692
692
|
onClick: n
|
|
693
|
-
}), /* @__PURE__ */
|
|
693
|
+
}), /* @__PURE__ */ N(E, {
|
|
694
694
|
label: i,
|
|
695
695
|
disabled: a || o,
|
|
696
696
|
onClick: r
|
|
697
697
|
})] })] }),
|
|
698
|
-
leftContent: /* @__PURE__ */
|
|
699
|
-
!
|
|
700
|
-
/* @__PURE__ */
|
|
698
|
+
leftContent: /* @__PURE__ */ P(M, { children: [
|
|
699
|
+
!j && A,
|
|
700
|
+
/* @__PURE__ */ N(X, {
|
|
701
701
|
title: d === null ? void 0 : d ?? D?.metadataTitle ?? "Metadata",
|
|
702
702
|
styles: O?.section,
|
|
703
|
-
className:
|
|
703
|
+
className: l(Ee, b, Y.metadataSection),
|
|
704
704
|
children: u
|
|
705
705
|
}),
|
|
706
706
|
f
|
|
707
707
|
] }),
|
|
708
|
-
centerContent:
|
|
708
|
+
centerContent: j ? /* @__PURE__ */ P(M, { children: [A, /* @__PURE__ */ N(X, {
|
|
709
709
|
title: m === null ? void 0 : m ?? D?.setupTitle ?? "Setup",
|
|
710
710
|
styles: O?.section,
|
|
711
|
-
className:
|
|
711
|
+
className: l(T ? Ee : De, Oe, S, Y.setupSection),
|
|
712
712
|
children: p
|
|
713
713
|
})] }) : void 0
|
|
714
714
|
});
|
|
715
|
-
}),
|
|
715
|
+
}), je = {
|
|
716
716
|
name: {
|
|
717
717
|
label: "Name",
|
|
718
718
|
placeholder: "Enter name"
|
|
@@ -751,7 +751,7 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
751
751
|
saveLabel: "Save"
|
|
752
752
|
},
|
|
753
753
|
ariaLabel: "Metadata"
|
|
754
|
-
},
|
|
754
|
+
}, Me = {
|
|
755
755
|
title: "Add avatar",
|
|
756
756
|
attachLabel: "Attach",
|
|
757
757
|
emptyTitle: "This folder is empty",
|
|
@@ -775,12 +775,12 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
775
775
|
deleteConfirmItemsLabel: "items?",
|
|
776
776
|
deleteConfirmLabel: "Delete",
|
|
777
777
|
deleteCancelLabel: "Cancel"
|
|
778
|
-
},
|
|
779
|
-
let [y, b] =
|
|
778
|
+
}, Ne = re(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, formatLocaleLabel: s, fields: c = _e, isNameReadOnly: l, nameReadOnlyTooltip: u, isVersionReadOnly: d, versionReadOnlyTooltip: f, nameCaption: p, isDescriptionRequired: m, descriptionCaption: h, renderDescription: g, focusRequestKey: _, labels: v }) => {
|
|
779
|
+
let [y, b] = W(!1), x = H(() => a ? c : c.filter((e) => e !== Q.Avatar), [a, c]), S = e.iconUrl, C = a?.resolveIconUrl, w = H(() => C ? C(S) : void 0, [S, C]), T = z(() => b(!0), []), E = z(() => b(!1), []), D = a?.resolveAttachedIconUrl, O = z((e) => {
|
|
780
780
|
let t = D?.(e);
|
|
781
781
|
t && n({ iconUrl: t }), b(!1);
|
|
782
782
|
}, [n, D]);
|
|
783
|
-
return /* @__PURE__ */
|
|
783
|
+
return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(Te, {
|
|
784
784
|
values: e,
|
|
785
785
|
errors: t,
|
|
786
786
|
onChange: n,
|
|
@@ -788,7 +788,7 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
788
788
|
onVersionBlur: i,
|
|
789
789
|
iconPreviewUrl: w,
|
|
790
790
|
onAddAvatarClick: T,
|
|
791
|
-
labels: v?.form ??
|
|
791
|
+
labels: v?.form ?? je,
|
|
792
792
|
availableLocaleOptions: o,
|
|
793
793
|
formatLocaleLabel: s,
|
|
794
794
|
fields: x,
|
|
@@ -801,7 +801,7 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
801
801
|
descriptionCaption: h,
|
|
802
802
|
renderDescription: g,
|
|
803
803
|
focusRequestKey: _
|
|
804
|
-
}), a && /* @__PURE__ */
|
|
804
|
+
}), a && /* @__PURE__ */ N(ge, {
|
|
805
805
|
isOpen: y,
|
|
806
806
|
onClose: E,
|
|
807
807
|
onAttach: O,
|
|
@@ -809,35 +809,38 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
809
809
|
FileManagerModal: a.FileManagerModal,
|
|
810
810
|
allowedMimeTypes: a.allowedMimeTypes,
|
|
811
811
|
maxFileSizeBytes: a.maxFileSizeBytes,
|
|
812
|
-
labels: v?.avatarPicker ??
|
|
812
|
+
labels: v?.avatarPicker ?? Me
|
|
813
813
|
})] });
|
|
814
814
|
}), $ = /* @__PURE__ */ function(e) {
|
|
815
815
|
return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
|
|
816
|
-
}({}),
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
816
|
+
}({}), Pe = (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), Fe = (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]) && Pe(e.otherLocales, t.otherLocales), Ie = (e) => Object.values(e).every((e) => e == null), Le = /^[a-zA-Z0-9 _.-]+$/, Re = r, ze = i, Be = (e, t) => t && e.validateVersionPattern === !0 ? {
|
|
817
|
+
...e,
|
|
818
|
+
validateVersionPattern: ze
|
|
819
|
+
} : e, Ve = "1.0.0", He = (n, r = {}) => {
|
|
820
|
+
let i = {}, a = n.name.trim();
|
|
821
|
+
a ? s(a, t) ? i.name = $.TooLong : r.validateNamePattern && !Le.test(a) ? i.name = $.InvalidFormat : c(a) && (i.name = $.ControlCharacters) : i.name = $.Required, s(n.description, e) && (i.description = $.TooLong);
|
|
822
|
+
let o = n.version.trim();
|
|
823
|
+
return r.validateVersionPattern && o && ((r.validateVersionPattern instanceof RegExp ? r.validateVersionPattern : Re).test(o) || (i.version = $.InvalidFormat)), i;
|
|
824
|
+
}, Ue = /* @__PURE__ */ new Set([$.TooLong, $.ControlCharacters]), We = (e, t) => ({
|
|
822
825
|
reseedKey: t,
|
|
823
826
|
values: e,
|
|
824
827
|
baseline: e,
|
|
825
828
|
touched: {},
|
|
826
829
|
hasAttemptedSubmit: !1,
|
|
827
830
|
submitAttemptCount: 0
|
|
828
|
-
}),
|
|
829
|
-
let [r, i] =
|
|
830
|
-
r.reseedKey !== n && i(
|
|
831
|
-
let a = t?.validateNamePattern, o = t?.validateVersionPattern, s =
|
|
831
|
+
}), Ge = ({ initialValues: e, validationOptions: t, reseedKey: n }) => {
|
|
832
|
+
let [r, i] = W(() => We(e, n));
|
|
833
|
+
r.reseedKey !== n && i(We(e, n));
|
|
834
|
+
let a = t?.validateNamePattern, o = t?.validateVersionPattern, s = H(() => He(r.values, {
|
|
832
835
|
validateNamePattern: a,
|
|
833
836
|
validateVersionPattern: o
|
|
834
837
|
}), [
|
|
835
838
|
r.values,
|
|
836
839
|
a,
|
|
837
840
|
o
|
|
838
|
-
]), c =
|
|
841
|
+
]), c = H(() => {
|
|
839
842
|
if (r.hasAttemptedSubmit) return s;
|
|
840
|
-
let e = (e, t) => e && (t ||
|
|
843
|
+
let e = (e, t) => e && (t || Ue.has(e)) ? e : void 0;
|
|
841
844
|
return {
|
|
842
845
|
name: e(s.name, r.touched[Q.Name]),
|
|
843
846
|
version: e(s.version, r.touched[Q.Version]),
|
|
@@ -847,8 +850,8 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
847
850
|
s,
|
|
848
851
|
r.hasAttemptedSubmit,
|
|
849
852
|
r.touched
|
|
850
|
-
]), l =
|
|
851
|
-
|
|
853
|
+
]), l = U(s), u = U(e);
|
|
854
|
+
V(() => {
|
|
852
855
|
l.current = s, u.current = e;
|
|
853
856
|
});
|
|
854
857
|
let d = z((e) => i((t) => ({
|
|
@@ -867,8 +870,8 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
867
870
|
...e,
|
|
868
871
|
hasAttemptedSubmit: !0,
|
|
869
872
|
submitAttemptCount: e.submitAttemptCount + 1
|
|
870
|
-
})),
|
|
871
|
-
return
|
|
873
|
+
})), Ie(l.current)), []), m = z((e) => i((t) => We(e ?? u.current, t.reseedKey)), []), h = H(() => !Fe(r.values, r.baseline), [r.values, r.baseline]);
|
|
874
|
+
return H(() => ({
|
|
872
875
|
values: r.values,
|
|
873
876
|
setValues: d,
|
|
874
877
|
touched: r.touched,
|
|
@@ -891,10 +894,10 @@ var U = /* @__PURE__ */ function(e) {
|
|
|
891
894
|
h,
|
|
892
895
|
m
|
|
893
896
|
]);
|
|
894
|
-
},
|
|
897
|
+
}, Ke = 1048576, qe = [
|
|
895
898
|
"image/png",
|
|
896
899
|
"image/jpeg",
|
|
897
900
|
"image/svg+xml"
|
|
898
901
|
];
|
|
899
902
|
//#endregion
|
|
900
|
-
export {
|
|
903
|
+
export { qe as AVATAR_ALLOWED_MIME_TYPES, Ke as AVATAR_MAX_FILE_SIZE_BYTES, me as AddAvatar, ge as AvatarPickerModal, Y as BUILDER_FORM_CLASS, G as BuilderFormActionsOrder, le as BuilderFormContainer, Ve as DEFAULT_DEPLOYMENT_VERSION, je as DEFAULT_METADATA_FORM_LABELS, $ as DeploymentCreationFieldErrorCode, Te as DeploymentCreationForm, xe as DeploymentLocalesField, fe as EditorLayout, X as EditorSection, Ae as EntityEditor, Q as MetadataField, Ne as MetadataForm, Le as NAME_PATTERN, ze as STORED_VERSION_PATTERN, Re as VERSION_PATTERN, Ge as useMetadataForm, He as validateDeploymentCreationFields, Be as withStoredVersionRule };
|
package/models/validation.d.ts
CHANGED
|
@@ -25,8 +25,8 @@ export interface DeploymentCreationFormValidationOptions {
|
|
|
25
25
|
/**
|
|
26
26
|
* Whether to reject a non-empty version that doesn't match a pattern.
|
|
27
27
|
* `true` checks against the default `VERSION_PATTERN`; passing a `RegExp`
|
|
28
|
-
* checks against that pattern instead (e.g.
|
|
29
|
-
* host that requires a
|
|
28
|
+
* checks against that pattern instead (e.g. a stricter pattern for a
|
|
29
|
+
* host that requires a dot-separated numeric version).
|
|
30
30
|
*/
|
|
31
31
|
validateVersionPattern?: boolean | RegExp;
|
|
32
32
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-builder-form",
|
|
3
3
|
"description": "Presentational builder form shells, editor layouts, and shared deployment field sets for composing and editing DIAL entities",
|
|
4
|
-
"version": "1.4.0-dev.
|
|
4
|
+
"version": "1.4.0-dev.81",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.css",
|
|
8
|
+
"**/*.scss"
|
|
9
|
+
],
|
|
6
10
|
"type": "module",
|
|
7
11
|
"main": "./index.js",
|
|
8
12
|
"module": "./index.js",
|
|
@@ -20,7 +24,7 @@
|
|
|
20
24
|
"@tabler/icons-react": "^3.50.0"
|
|
21
25
|
},
|
|
22
26
|
"peerDependencies": {
|
|
23
|
-
"@epam/ai-dial-chat-shared": "1.4.0-dev.
|
|
27
|
+
"@epam/ai-dial-chat-shared": "1.4.0-dev.81",
|
|
24
28
|
"@epam/ai-dial-ui-kit": "^0.16.0",
|
|
25
29
|
"react": "^19.2.8"
|
|
26
30
|
},
|
|
@@ -2,10 +2,16 @@ import { DeploymentCreationFormValues } from '../models/deployment-creation-form
|
|
|
2
2
|
import { DeploymentCreationFormErrorCodes, DeploymentCreationFormValidationOptions } from '../models/validation';
|
|
3
3
|
/** Allowed characters for the name field: letters, digits, spaces, underscores, dots, dashes. */
|
|
4
4
|
export declare const NAME_PATTERN: RegExp;
|
|
5
|
-
/**
|
|
5
|
+
/** Default version rule: `RESOURCE_VERSION_PATTERN` from `@epam/ai-dial-chat-shared` (1-64 of letters, digits, `_`, `.`, `+`, `-`; no trailing dot, no `__`, no leading `_`). */
|
|
6
6
|
export declare const VERSION_PATTERN: RegExp;
|
|
7
|
-
/**
|
|
8
|
-
export declare const
|
|
7
|
+
/** Version rule for a deployment that already exists: `STORED_RESOURCE_VERSION_PATTERN` from `@epam/ai-dial-chat-shared`. */
|
|
8
|
+
export declare const STORED_VERSION_PATTERN: RegExp;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the validation options with the version check switched to `STORED_VERSION_PATTERN` in edit mode, so a version stored under the earlier, looser rules still saves unchanged.
|
|
11
|
+
* @param options - validation options of the create form
|
|
12
|
+
* @param isEditMode - whether an existing deployment is being edited
|
|
13
|
+
*/
|
|
14
|
+
export declare const withStoredVersionRule: (options: DeploymentCreationFormValidationOptions, isEditMode: boolean) => DeploymentCreationFormValidationOptions;
|
|
9
15
|
/** Version a new deployment's create form opens with; a SemVer 2.0.0 value the host seeds into its create-mode metadata. */
|
|
10
16
|
export declare const DEFAULT_DEPLOYMENT_VERSION = "1.0.0";
|
|
11
17
|
/** Validates the General-step fields and returns untranslated error codes; has no side effects. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-deployment-creation-fields.d.ts","sourceRoot":"","sources":["../../src/utils/validate-deployment-creation-fields.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate-deployment-creation-fields.d.ts","sourceRoot":"","sources":["../../src/utils/validate-deployment-creation-fields.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,KAAK,EACV,gCAAgC,EAChC,uCAAuC,EACxC,MAAM,sBAAsB,CAAC;AAG9B,iGAAiG;AACjG,eAAO,MAAM,YAAY,QAAuB,CAAC;AAEjD,iLAAiL;AACjL,eAAO,MAAM,eAAe,QAA2B,CAAC;AAExD,6HAA6H;AAC7H,eAAO,MAAM,sBAAsB,QAAkC,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAChC,SAAS,uCAAuC,EAChD,YAAY,OAAO,KAClB,uCAGU,CAAC;AAEd,4HAA4H;AAC5H,eAAO,MAAM,0BAA0B,UAAU,CAAC;AAElD,mGAAmG;AACnG,eAAO,MAAM,gCAAgC,GAC3C,QAAQ,4BAA4B,EACpC,UAAS,uCAA4C,KACpD,gCA8BF,CAAC"}
|