@epam/ai-dial-ui-kit 0.15.0-dev.22 → 0.15.0-dev.24
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/dist/CHANGELOG.md +3 -0
- package/dist/JsonEditor-CpSpVa0v.cjs +1 -0
- package/dist/{MarkdownEditor-FVzYMdkC.cjs → MarkdownEditor-CPzMv3lE.cjs} +1 -1
- package/dist/{MarkdownEditor-C7BONfsl.cjs → MarkdownEditor-NYMcKLJy.cjs} +1 -1
- package/dist/MarkdownEditorContainer-DSL5-_hG.cjs +1 -0
- package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +18 -16
- package/dist/components/New/ButtonDropdown/ButtonDropdown.js +27 -18
- package/dist/components/SchemaRenderer/components/SchemaField.js +19 -19
- package/dist/components/SchemaRenderer/components/SchemaFieldContent.js +18 -18
- package/dist/components/SchemaRenderer/utils.js +21 -19
- package/dist/components-manifest.json +8 -2
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/editor-Bc9xzKuR.cjs +1 -0
- package/dist/editors.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/lazy-Cy9WobJf.cjs +1 -0
- package/dist/src/components/New/ButtonDropdown/ButtonDropdown.d.ts +4 -0
- package/dist/src/components/SchemaRenderer/utils.d.ts +5 -0
- package/package.json +1 -1
- package/dist/JsonEditor-BDe6elKO.cjs +0 -1
- package/dist/MarkdownEditorContainer-BA94ffC4.cjs +0 -1
- package/dist/lazy-BEsZqouS.cjs +0 -1
package/dist/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,8 @@ Versions match the git tags on the `development` branch.
|
|
|
19
19
|
|
|
20
20
|
- **`Dropdown` (2.0) — `listStyle`** — the floating panel renders in a portal at the end of `<body>`, so CSS custom properties a caller sets on its own wrapper never reach the panel's rows or `menuHeader`, and `listClassName` can carry a class but not a runtime value. A wrapping component that themes its menu through `var(--…)` — a composer's model picker colouring its selected row and check — had no way to deliver the values. `listStyle` is an inline style on that panel. Positioning stays the dropdown's own: `floatingStyles` is applied on top, so a caller's `position`, `top` or `transform` cannot unanchor it. Additive; nothing renders differently without it. Requested in [ai-dial-chat#8943](https://github.com/epam/ai-dial-chat/issues/8943).
|
|
21
21
|
|
|
22
|
+
- **`ButtonDropdown` (2.0) — `dropdownProps`**: until now `ButtonDropdown` built its menu `Dropdown` with fixed options, so a caller could neither class the menu panel nor stop the panel from taking the button's width. A short label like "Add" produced a menu as narrow as the button. `dropdownProps` forwards `listClassName` and `matchReferenceWidth` to that `Dropdown`. With `matchReferenceWidth: false` and a `min-w-*` class, the menu gets a width of its own. Additive; a `ButtonDropdown` without it renders exactly as before.
|
|
23
|
+
|
|
22
24
|
- **`Notification` (2.0) — `action` slot** — a notification had nowhere to put a control of its own: a "Try again" or "Reload" button had to be packed into `message`, where it sat inside the text column, wrapped with the copy and could not line up against a title. `action` takes any node and renders it at the inline end of the notification, after the text and before the close button, vertically centred and never shrunk by a long message. It sits inside the live region, so the control is reachable right where the error is announced; the caller supplies its visible label and handler. The slot is additive — a notification without `action` renders exactly as before. Requested in [ai-dial-chat#8979](https://github.com/epam/ai-dial-chat/issues/8979), where a failed chat response offers "Try again" inside its error banner.
|
|
23
25
|
|
|
24
26
|
- **`FilterChips` (2.0)** — a row of filter chips that picks one value out of a few, the chip-shaped sibling of `Tabs` and `SegmentedControl`. It draws `TagAppearance.Selectable` tags: no fill until selected, a semibold label once selected. Each chip is a toggle button carrying its state on `aria-pressed` inside a named `role="group"`, so every chip is its own tab stop and arrowing across the row never changes the filter by accident — unlike a `radiogroup`. `stretch` grows the chips to share the row width equally for a filter row spanning a side panel; without it they hug their labels. There is no disabled chip: an option the user must not pick is left out of `items`. Labels carry no English defaults, so the caller translates them. The row carries the public class `dial-kit-filter-chips` (`DIAL_KIT_CLASS.filterChips`); its chips are `Tag` pills, so they carry `dial-kit-tag`.
|
|
@@ -41,6 +43,7 @@ Versions match the git tags on the `development` branch.
|
|
|
41
43
|
|
|
42
44
|
- **`MarkdownEditor` (2.0) — the live preview is part of the card now, instead of a sheet of GitHub's own CSS laid over it** — the 2.0 restyle covered the card and the toolbar and stopped at the split: everything right of it was still `@uiw/react-md-editor`'s default stylesheet. Three things came out of that. The pane divider was the library's `inset` box-shadow in a hardcoded `#d0d7de`, drawn on the preview and then painted over by the markdown body's opaque white — and since that body is only as tall as its content, the divider survived as a hairline starting halfway down the pane, under the last rendered block. The white itself was the second: a `#ffffff` patch over the card's `bg-layer-raised`, which a dark theme would have kept white. And Tailwind's preflight, which the kit ships, had stripped the list markers and the task-list checkbox out of the rendered markdown — a bulleted list came out as indented lines, a `- [ ]` as a 0×0 box. The divider is now a real border on `border-secondary`, the body and its table rows are transparent, code, quotes, tables and headings take kit tokens, and lists and task boxes render again. The preview also inherits the host's font and `text-primary` instead of the library's `-apple-system` stack and `#24292f`; the edit pane keeps its monospace face. Both panes gained a 16px gutter beside the divider, so text no longer butts against it.
|
|
43
45
|
- **`MarkdownEditor` (2.0) — the two panes no longer sit on top of each other in RTL** — live mode pins the preview with a physical `right: 0` while the edit pane is a plain block at the inline start, so under `dir="rtl"` both landed on the right unless the host knew to add the library's own `w-md-editor-rtl` class. The preview is now placed with logical insets and the panes' text aligns to `start`, so the edit pane and the preview swap sides with the document direction — divider, gutters and the quote bar included — with no class for the host to remember.
|
|
46
|
+
- **`DialSchemaRenderer` — required-field errors quote the field label** — the message was `${label} is required`, so with a long schema `title` the reader could not tell where the field name ended and "is required" began. The label is now wrapped in double quotes (`"API key" is required`) wherever the renderer builds the message — the inline field error and the `validateRequired` result alike. The label is still the schema `title` (or the label derived from the property key), never the entered value. Consumers asserting the old text in their tests need to add the quotes. Requested in [ai-dial-admin-frontend#4731](https://github.com/epam/ai-dial-admin-frontend/issues/4731).
|
|
44
47
|
|
|
45
48
|
---
|
|
46
49
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),u=require("./editor-Bc9xzKuR.cjs"),d=require("@monaco-editor/react");function f(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const m=f(d),b=({value:e,onChange:o,onValidateJSON:t,options:a,currentTheme:n,themesConfig:i=u.EDITOR_THEMES_CONFIG})=>{function s(r){r?.editor?.defineTheme(n,i[n]),r.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,enableSchemaRequest:!1,schemas:[{uri:"http://custom-schema/object-required.json",fileMatch:["*"],schema:{type:"object",description:"Top-level value must be an object",additionalProperties:!0}}]})}const{Editor:l}=m;return c.jsx(l,{beforeMount:s,height:"100%",defaultLanguage:"json",value:e,onChange:o,theme:n,onValidate:t,options:{minimap:{enabled:!1},formatOnType:!0,formatOnPaste:!0,selectOnLineNumbers:!1,automaticLayout:!0,scrollBeyondLastLine:!1,wordWrap:"on",smoothScrolling:!0,overviewRulerLanes:0,scrollbar:{horizontal:"hidden",verticalScrollbarSize:4,verticalSliderSize:4},...a??{}}})};exports.DialJsonEditor=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@uiw/react-md-editor"),m=require("./lazy-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@uiw/react-md-editor"),m=require("./lazy-Cy9WobJf.cjs"),u=require("./merge-classes-BEJXjzkx.cjs"),x=({value:t,onChange:s,height:o=300,preview:i="edit",theme:a=m.EditorThemes.dark,className:n,placeholder:r})=>{const d=r!==void 0&&!t;return e.jsxs("div",{"data-color-mode":a,className:u.mergeClasses("relative",n),children:[e.jsx(c,{value:t,onChange:l=>s?.(l||""),height:o,preview:i}),d&&e.jsx("div",{className:"pointer-events-none absolute left-0 top-8 px-2 dial-small-text text-secondary opacity-40",children:r})]})};exports.DialMarkdownEditor=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),O=require("@uiw/react-md-editor"),_=require("./lazy-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),O=require("@uiw/react-md-editor"),_=require("./lazy-Cy9WobJf.cjs"),k=require("./merge-classes-BEJXjzkx.cjs"),o=require("@tabler/icons-react"),p=require("./icon-DhjrDQ8I.cjs"),f=require("./icon-CrGVkVpG.cjs");function E(n){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const c=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(i,r,c.get?c:{enumerable:!0,get:()=>n[r]})}}return i.default=n,Object.freeze(i)}const b=E(O),L=f.DIAL_ICON_SIZE.SM,t={size:L,stroke:p.DIAL_KIT_ICON_STROKE},s=(n,i)=>({...n,icon:i}),M=()=>{const{bold:n,code:i,divider:r,group:c,heading1:a,heading2:d,heading3:u,italic:l,link:m,orderedListCommand:I,quote:x,strikethrough:g,table:h,unorderedListCommand:C}=b;return[s(n,e.jsx(o.IconBold,{...t})),s(l,e.jsx(o.IconItalic,{...t})),s(g,e.jsx(o.IconStrikethrough,{...t})),r,c([a,d,u],{name:"heading",groupName:"heading",icon:e.jsx(o.IconTextSize,{...t}),buttonProps:{"aria-label":"Text style",title:"Text style"}}),r,s(C,e.jsx(o.IconList,{...t})),s(I,e.jsx(o.IconListNumbers,{...t})),r,s(x,e.jsx(o.IconQuote,{...t})),s(m,e.jsx(o.IconLink,{...t})),s(i,e.jsx(o.IconCode,{...t})),r,s(h,e.jsx(o.IconTable,{...t}))]},S=()=>{const{codeEdit:n,codeLive:i,codePreview:r,divider:c,fullscreen:a}=b;return[s(n,e.jsx(o.IconPencil,{...t})),s(i,e.jsx(o.IconLayoutColumns,{...t})),s(r,e.jsx(o.IconEye,{...t})),c,s(a,e.jsx(o.IconMaximize,{...t}))]},T=({value:n,onChange:i,height:r=300,theme:c=_.EditorThemes.light,className:a,placeholder:d,defaultPreview:u="edit",id:l,ariaLabel:m})=>{const I=j.useMemo(()=>M(),[]),x=j.useMemo(()=>S(),[]);return e.jsx("div",{"data-color-mode":c,className:k.mergeClasses("dial-kit-markdown-editor",a),children:e.jsx(O,{value:n,onChange:g=>i?.(g||""),height:r,preview:u,commands:I,extraCommands:x,textareaProps:{placeholder:d,id:l,"aria-label":m}})})};exports.MarkdownEditor=T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react");require("./editor-Bc9xzKuR.cjs");const E=require("./lazy-Cy9WobJf.cjs");require("@monaco-editor/react");const m=require("./Switch-CfxMs3AZ.cjs"),N=require("./MarkdownEditor-CPzMv3lE.cjs"),b=({value:o,onChangeValue:l,label:i,headerContent:a,switcherLabel:d,height:c=300,theme:u=E.EditorThemes.dark,onValidateJSON:x,preview:j="edit"})=>{const w=n.useId(),[t,C]=n.useState(!1),[f,p]=n.useState(null);n.useEffect(()=>{t&&typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-CpSpVa0v.cjs")).then(s=>{p(()=>s.DialJsonEditor)})},[t]);const h=n.useCallback(s=>{l?.(s)},[l]),S=n.useCallback(s=>{x?.(s)},[x]),r=!!d;return e.jsx("div",{className:"size-full flex flex-col",children:e.jsx("div",{className:"flex flex-col gap-8",children:e.jsxs("div",{children:[(i||a||r)&&e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i&&e.jsx(m.DialLabel,{label:i}),e.jsxs("div",{className:"flex items-center gap-2 flex-1 justify-end",children:[a,r&&e.jsx("label",{className:"flex items-center gap-2 cursor-pointer",children:e.jsx(m.DialSwitch,{isOn:t,label:d,switchId:w,onChange:s=>C(s)})})]})]}),r&&t?e.jsx("div",{className:"border border-primary rounded",style:{height:`${c}px`},children:f&&e.jsx(f,{value:o,onChange:h,onValidateJSON:S,currentTheme:u})}):e.jsx(N.DialMarkdownEditor,{value:o,onChange:h,height:c,preview:j,theme:u})]})})})};exports.DialMarkdownEditorContainer=b;
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import { useId as g, useState as x, useEffect as J, useCallback as u } from "react";
|
|
3
|
-
import
|
|
4
|
-
import { EditorThemes as
|
|
3
|
+
import "../../constants/editor.js";
|
|
4
|
+
import { EditorThemes as S } from "../../types/editor.js";
|
|
5
|
+
import "@monaco-editor/react";
|
|
6
|
+
import { DialSwitch as b } from "../Switch/Switch.js";
|
|
5
7
|
import { DialMarkdownEditor as v } from "./MarkdownEditor.js";
|
|
6
8
|
import { DialLabel as y } from "../Label/Label.js";
|
|
7
|
-
const
|
|
9
|
+
const $ = ({
|
|
8
10
|
value: s,
|
|
9
11
|
onChangeValue: l,
|
|
10
|
-
label:
|
|
12
|
+
label: t,
|
|
11
13
|
headerContent: d,
|
|
12
14
|
switcherLabel: a,
|
|
13
15
|
height: c = 300,
|
|
14
|
-
theme: m =
|
|
16
|
+
theme: m = S.dark,
|
|
15
17
|
onValidateJSON: f,
|
|
16
18
|
preview: C = "edit"
|
|
17
19
|
}) => {
|
|
18
|
-
const N = g(), [
|
|
20
|
+
const N = g(), [i, w] = x(!1), [p, D] = x(null);
|
|
19
21
|
J(() => {
|
|
20
|
-
|
|
22
|
+
i && typeof window < "u" && import("../JsonEditor/JsonEditor.js").then((o) => {
|
|
21
23
|
D(() => o.DialJsonEditor);
|
|
22
24
|
});
|
|
23
|
-
}, [
|
|
25
|
+
}, [i]);
|
|
24
26
|
const h = u(
|
|
25
27
|
(o) => {
|
|
26
28
|
l?.(o);
|
|
@@ -31,16 +33,16 @@ const z = ({
|
|
|
31
33
|
f?.(o);
|
|
32
34
|
},
|
|
33
35
|
[f]
|
|
34
|
-
),
|
|
36
|
+
), n = !!a;
|
|
35
37
|
return /* @__PURE__ */ e("div", { className: "size-full flex flex-col", children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-8", children: /* @__PURE__ */ r("div", { children: [
|
|
36
|
-
(
|
|
37
|
-
|
|
38
|
+
(t || d || n) && /* @__PURE__ */ r("div", { className: "flex justify-between items-center mb-2", children: [
|
|
39
|
+
t && /* @__PURE__ */ e(y, { label: t }),
|
|
38
40
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 flex-1 justify-end", children: [
|
|
39
41
|
d,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
n && /* @__PURE__ */ e("label", { className: "flex items-center gap-2 cursor-pointer", children: /* @__PURE__ */ e(
|
|
43
|
+
b,
|
|
42
44
|
{
|
|
43
|
-
isOn:
|
|
45
|
+
isOn: i,
|
|
44
46
|
label: a,
|
|
45
47
|
switchId: N,
|
|
46
48
|
onChange: (o) => w(o)
|
|
@@ -48,7 +50,7 @@ const z = ({
|
|
|
48
50
|
) })
|
|
49
51
|
] })
|
|
50
52
|
] }),
|
|
51
|
-
|
|
53
|
+
n && i ? /* @__PURE__ */ e(
|
|
52
54
|
"div",
|
|
53
55
|
{
|
|
54
56
|
className: "border border-primary rounded",
|
|
@@ -76,5 +78,5 @@ const z = ({
|
|
|
76
78
|
] }) }) });
|
|
77
79
|
};
|
|
78
80
|
export {
|
|
79
|
-
|
|
81
|
+
$ as DialMarkdownEditorContainer
|
|
80
82
|
};
|
|
@@ -1,29 +1,38 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { ButtonAppearance as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Dropdown as
|
|
6
|
-
import { getButtonChevron as
|
|
7
|
-
import { DIAL_KIT_CLASS as
|
|
8
|
-
const
|
|
2
|
+
import { useState as u, useMemo as d } from "react";
|
|
3
|
+
import { ButtonAppearance as c, ButtonVariant as f } from "../../../types/button.js";
|
|
4
|
+
import { Button as D } from "../Button/Button.js";
|
|
5
|
+
import { Dropdown as h } from "../Dropdown/Dropdown.js";
|
|
6
|
+
import { getButtonChevron as l } from "./constants.js";
|
|
7
|
+
import { DIAL_KIT_CLASS as w } from "../../../constants/public-class-names.js";
|
|
8
|
+
const O = ({
|
|
9
9
|
variant: n,
|
|
10
10
|
appearance: t,
|
|
11
11
|
items: e,
|
|
12
|
-
|
|
12
|
+
dropdownProps: p,
|
|
13
|
+
...a
|
|
13
14
|
}) => {
|
|
14
|
-
const [o,
|
|
15
|
-
return /* @__PURE__ */ r("div", { className:
|
|
16
|
-
|
|
15
|
+
const [o, i] = u(!1), m = d(() => l(o), [o]);
|
|
16
|
+
return /* @__PURE__ */ r("div", { className: w.buttonDropdown, children: /* @__PURE__ */ r(
|
|
17
|
+
h,
|
|
17
18
|
{
|
|
18
19
|
...p,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
items: e,
|
|
21
|
+
onOpenChange: (s) => i(s),
|
|
22
|
+
children: /* @__PURE__ */ r(
|
|
23
|
+
D,
|
|
24
|
+
{
|
|
25
|
+
...a,
|
|
26
|
+
iconAfter: m,
|
|
27
|
+
variant: n || f.Primary,
|
|
28
|
+
appearance: t || c.Solid,
|
|
29
|
+
"aria-haspopup": "menu",
|
|
30
|
+
"aria-expanded": o
|
|
31
|
+
}
|
|
32
|
+
)
|
|
24
33
|
}
|
|
25
|
-
) })
|
|
34
|
+
) });
|
|
26
35
|
};
|
|
27
36
|
export {
|
|
28
|
-
|
|
37
|
+
O as ButtonDropdown
|
|
29
38
|
};
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { DialFormItem as g } from "../../FormItem/FormItem.js";
|
|
3
3
|
import { JsonSchemaType as A } from "../types.js";
|
|
4
4
|
import { useSchemaContext as C } from "../context.js";
|
|
5
|
-
import { resolveRef as E, isObjectType as I, buildSummary as
|
|
5
|
+
import { resolveRef as E, isObjectType as I, buildSummary as M, validateRequired as O, isMissingRequiredValue as b, toRequiredMessage as k } from "../utils.js";
|
|
6
6
|
import { SchemaSection as w } from "./SchemaSection.js";
|
|
7
7
|
import { SchemaFieldContent as u } from "./SchemaFieldContent.js";
|
|
8
|
-
const
|
|
9
|
-
schema:
|
|
8
|
+
const B = ({
|
|
9
|
+
schema: a,
|
|
10
10
|
value: t,
|
|
11
11
|
onChange: d,
|
|
12
12
|
path: e,
|
|
13
|
-
level:
|
|
13
|
+
level: i = 0,
|
|
14
14
|
required: r,
|
|
15
15
|
label: n
|
|
16
16
|
}) => {
|
|
17
17
|
const {
|
|
18
18
|
rootSchema: c,
|
|
19
|
-
defaultExpanded:
|
|
19
|
+
defaultExpanded: f = !0,
|
|
20
20
|
touchedPaths: m = /* @__PURE__ */ new Set(),
|
|
21
21
|
skipUntouched: h = !1
|
|
22
|
-
} = C(), o = E(
|
|
23
|
-
if (
|
|
24
|
-
const j =
|
|
22
|
+
} = C(), o = E(a, c), S = I(o), l = o.type === A.Array;
|
|
23
|
+
if (S || l) {
|
|
24
|
+
const j = M(t, o, c), x = O(
|
|
25
25
|
t,
|
|
26
26
|
o,
|
|
27
27
|
c,
|
|
28
28
|
e.join(".")
|
|
29
29
|
), p = e.join("."), T = p + ".", F = !h || m.has(p) || [...m].some((R) => R.startsWith(T));
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ s(
|
|
31
31
|
w,
|
|
32
32
|
{
|
|
33
33
|
title: n ?? o.title ?? e[e.length - 1] ?? "Section",
|
|
34
34
|
description: o.description,
|
|
35
|
-
level:
|
|
35
|
+
level: i,
|
|
36
36
|
summary: j,
|
|
37
37
|
errorCount: F ? x.length : 0,
|
|
38
|
-
defaultExpanded:
|
|
39
|
-
children: /* @__PURE__ */
|
|
38
|
+
defaultExpanded: f,
|
|
39
|
+
children: /* @__PURE__ */ s(
|
|
40
40
|
u,
|
|
41
41
|
{
|
|
42
42
|
schema: o,
|
|
43
43
|
value: t,
|
|
44
44
|
onChange: d,
|
|
45
45
|
path: e,
|
|
46
|
-
level:
|
|
46
|
+
level: i + 1,
|
|
47
47
|
required: r
|
|
48
48
|
}
|
|
49
49
|
)
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
|
-
const y = (!h || m.has(e.join("."))) && r &&
|
|
54
|
-
return /* @__PURE__ */
|
|
53
|
+
const y = (!h || m.has(e.join("."))) && r && b(t) ? k(n ?? "Field") : void 0;
|
|
54
|
+
return /* @__PURE__ */ s(
|
|
55
55
|
g,
|
|
56
56
|
{
|
|
57
57
|
label: n,
|
|
58
58
|
required: r,
|
|
59
59
|
description: o.description,
|
|
60
60
|
error: y,
|
|
61
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ s(
|
|
62
62
|
u,
|
|
63
63
|
{
|
|
64
64
|
schema: o,
|
|
65
65
|
value: t,
|
|
66
66
|
onChange: d,
|
|
67
67
|
path: e,
|
|
68
|
-
level:
|
|
68
|
+
level: i,
|
|
69
69
|
required: r,
|
|
70
70
|
suppressInlineError: !0
|
|
71
71
|
}
|
|
@@ -74,5 +74,5 @@ const q = ({
|
|
|
74
74
|
);
|
|
75
75
|
};
|
|
76
76
|
export {
|
|
77
|
-
|
|
77
|
+
B as SchemaField
|
|
78
78
|
};
|
|
@@ -2,15 +2,15 @@ import { jsx as t, jsxs as O, Fragment as P } from "react/jsx-runtime";
|
|
|
2
2
|
import { DialErrorText as x } from "../../CaptionText/CaptionText.js";
|
|
3
3
|
import { JsonSchemaType as c } from "../types.js";
|
|
4
4
|
import { useSchemaContext as F } from "../context.js";
|
|
5
|
-
import { resolveRef as T, isObjectType as u,
|
|
6
|
-
import { SchemaObjectEditor as
|
|
7
|
-
import { SchemaArrayEditor as
|
|
8
|
-
import { SchemaOneOfEditor as
|
|
9
|
-
import { SchemaAnyOfEditor as
|
|
10
|
-
import { SchemaKeyValueEditor as
|
|
11
|
-
import { SchemaPrimitiveField as
|
|
12
|
-
import { SchemaAdditionalPropertiesEditor as
|
|
13
|
-
const
|
|
5
|
+
import { resolveRef as T, isObjectType as u, toRequiredMessage as A, isMissingRequiredValue as b } from "../utils.js";
|
|
6
|
+
import { SchemaObjectEditor as k } from "./SchemaObjectEditor.js";
|
|
7
|
+
import { SchemaArrayEditor as M } from "./SchemaArrayEditor.js";
|
|
8
|
+
import { SchemaOneOfEditor as R } from "./SchemaOneOfEditor.js";
|
|
9
|
+
import { SchemaAnyOfEditor as q } from "./SchemaAnyOfEditor.js";
|
|
10
|
+
import { SchemaKeyValueEditor as V } from "./SchemaKeyValueEditor.js";
|
|
11
|
+
import { SchemaPrimitiveField as w } from "./SchemaPrimitiveField.js";
|
|
12
|
+
import { SchemaAdditionalPropertiesEditor as D } from "./SchemaAdditionalPropertiesEditor.js";
|
|
13
|
+
const X = ({
|
|
14
14
|
schema: h,
|
|
15
15
|
value: i,
|
|
16
16
|
onChange: f,
|
|
@@ -33,7 +33,7 @@ const Q = ({
|
|
|
33
33
|
let o;
|
|
34
34
|
if (e.oneOf)
|
|
35
35
|
o = /* @__PURE__ */ t(
|
|
36
|
-
|
|
36
|
+
R,
|
|
37
37
|
{
|
|
38
38
|
schema: e,
|
|
39
39
|
value: i,
|
|
@@ -44,7 +44,7 @@ const Q = ({
|
|
|
44
44
|
);
|
|
45
45
|
else if (e.anyOf && e.type !== c.Object)
|
|
46
46
|
o = /* @__PURE__ */ t(
|
|
47
|
-
|
|
47
|
+
q,
|
|
48
48
|
{
|
|
49
49
|
schema: e,
|
|
50
50
|
value: i,
|
|
@@ -56,7 +56,7 @@ const Q = ({
|
|
|
56
56
|
else if (u(e)) {
|
|
57
57
|
const n = e.additionalProperties != null && e.additionalProperties !== !1, a = !e.properties || Object.keys(e.properties).length === 0;
|
|
58
58
|
n && a ? o = /* @__PURE__ */ t(
|
|
59
|
-
|
|
59
|
+
V,
|
|
60
60
|
{
|
|
61
61
|
schema: e,
|
|
62
62
|
value: i,
|
|
@@ -65,14 +65,14 @@ const Q = ({
|
|
|
65
65
|
level: m
|
|
66
66
|
}
|
|
67
67
|
) : a && e.additionalProperties !== !1 ? o = /* @__PURE__ */ t(
|
|
68
|
-
|
|
68
|
+
D,
|
|
69
69
|
{
|
|
70
70
|
value: i,
|
|
71
71
|
onChange: s,
|
|
72
72
|
theme: E
|
|
73
73
|
}
|
|
74
74
|
) : o = /* @__PURE__ */ t(
|
|
75
|
-
|
|
75
|
+
k,
|
|
76
76
|
{
|
|
77
77
|
schema: e,
|
|
78
78
|
value: i,
|
|
@@ -83,7 +83,7 @@ const Q = ({
|
|
|
83
83
|
);
|
|
84
84
|
} else if (e.type === c.Array)
|
|
85
85
|
o = /* @__PURE__ */ t(
|
|
86
|
-
|
|
86
|
+
M,
|
|
87
87
|
{
|
|
88
88
|
schema: e,
|
|
89
89
|
value: i,
|
|
@@ -93,10 +93,10 @@ const Q = ({
|
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
95
|
else {
|
|
96
|
-
const n = j && p &&
|
|
96
|
+
const n = j && p && b(i), a = !l && n ? A(e.title ?? "Field") : void 0;
|
|
97
97
|
o = /* @__PURE__ */ O(P, { children: [
|
|
98
98
|
/* @__PURE__ */ t(
|
|
99
|
-
|
|
99
|
+
w,
|
|
100
100
|
{
|
|
101
101
|
schema: e,
|
|
102
102
|
value: i,
|
|
@@ -110,5 +110,5 @@ const Q = ({
|
|
|
110
110
|
return d ? d(r, e, o) : o;
|
|
111
111
|
};
|
|
112
112
|
export {
|
|
113
|
-
|
|
113
|
+
X as SchemaFieldContent
|
|
114
114
|
};
|
|
@@ -26,7 +26,7 @@ function p(r, n, i = 0) {
|
|
|
26
26
|
}
|
|
27
27
|
return t;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function T(r) {
|
|
30
30
|
return r.map((n, i) => ({ entry: n, index: i })).sort((n, i) => {
|
|
31
31
|
const t = n.entry[1]["dial:meta"]?.["dial:propertyOrder"] ?? 1 / 0, e = i.entry[1]["dial:meta"]?.["dial:propertyOrder"] ?? 1 / 0;
|
|
32
32
|
return t !== e ? t - e : n.index - i.index;
|
|
@@ -41,7 +41,8 @@ function O(r) {
|
|
|
41
41
|
function N(r) {
|
|
42
42
|
return r.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (n) => n.toUpperCase());
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
const I = (r) => `"${r}" is required`;
|
|
45
|
+
function q(r, n) {
|
|
45
46
|
return r.type === f.Null ? "null" : r.$ref ? p(r, n).title ?? r.$ref.split("/").pop() ?? "Option" : r.title ? r.title : r.type ? Array.isArray(r.type) ? r.type.join(" | ") : r.type : r.discriminator ? Object.keys(r.discriminator.mapping).join(" | ") : r.const != null ? String(r.const) : r.oneOf ? "One of options" : "Option";
|
|
46
47
|
}
|
|
47
48
|
function A(r, n, i = 0) {
|
|
@@ -128,7 +129,7 @@ function b(r, n, i, t = "", e = 0) {
|
|
|
128
129
|
const a = t ? `${t}.${l}` : l, c = d?.[l];
|
|
129
130
|
if (j(c)) {
|
|
130
131
|
const g = u?.title ?? N(l);
|
|
131
|
-
o.push({ path: a, message:
|
|
132
|
+
o.push({ path: a, message: I(g) });
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
if (d && s.properties)
|
|
@@ -177,7 +178,7 @@ function E(r, n, i) {
|
|
|
177
178
|
}
|
|
178
179
|
return "";
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
+
function R(r, n, i) {
|
|
181
182
|
if (r == null) {
|
|
182
183
|
const t = n.findIndex((e) => e.type === f.Null);
|
|
183
184
|
return t >= 0 ? t : 0;
|
|
@@ -216,7 +217,7 @@ function q(r, n, i) {
|
|
|
216
217
|
}
|
|
217
218
|
return 0;
|
|
218
219
|
}
|
|
219
|
-
function
|
|
220
|
+
function B(r, n, i) {
|
|
220
221
|
if (n && typeof r == "object" && r !== null) {
|
|
221
222
|
const t = r[n];
|
|
222
223
|
if (t) return `Item ${i + 1}: ${t}`;
|
|
@@ -227,7 +228,7 @@ function R(r, n, i) {
|
|
|
227
228
|
}
|
|
228
229
|
return `Item ${i + 1}`;
|
|
229
230
|
}
|
|
230
|
-
function
|
|
231
|
+
function D(r) {
|
|
231
232
|
switch (Array.isArray(r.type) ? r.type[0] : r.type) {
|
|
232
233
|
case f.String:
|
|
233
234
|
return "";
|
|
@@ -242,7 +243,7 @@ function B(r) {
|
|
|
242
243
|
return {};
|
|
243
244
|
}
|
|
244
245
|
}
|
|
245
|
-
const
|
|
246
|
+
const V = [
|
|
246
247
|
f.String,
|
|
247
248
|
f.Number,
|
|
248
249
|
f.Boolean,
|
|
@@ -250,10 +251,10 @@ const D = [
|
|
|
250
251
|
f.Object,
|
|
251
252
|
f.Array
|
|
252
253
|
];
|
|
253
|
-
function
|
|
254
|
+
function k(r) {
|
|
254
255
|
return Array.isArray(r) ? f.Array : typeof r == "object" && r !== null ? f.Object : typeof r == "boolean" ? f.Boolean : typeof r == "number" ? f.Number : r === null ? f.Null : f.String;
|
|
255
256
|
}
|
|
256
|
-
const
|
|
257
|
+
const P = {
|
|
257
258
|
[f.String]: "",
|
|
258
259
|
[f.Number]: 0,
|
|
259
260
|
[f.Boolean]: !1,
|
|
@@ -261,23 +262,24 @@ const I = {
|
|
|
261
262
|
[f.Object]: {},
|
|
262
263
|
[f.Array]: []
|
|
263
264
|
};
|
|
264
|
-
function
|
|
265
|
-
return
|
|
265
|
+
function _(r) {
|
|
266
|
+
return P[r];
|
|
266
267
|
}
|
|
267
268
|
export {
|
|
268
|
-
|
|
269
|
+
V as ENTRY_TYPE_OPTIONS,
|
|
269
270
|
E as buildSummary,
|
|
270
|
-
|
|
271
|
+
R as detectAnyOfVariant,
|
|
271
272
|
A as extractDefaults,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
273
|
+
_ as getEntryTypeDefault,
|
|
274
|
+
B as getItemTitle,
|
|
275
|
+
q as getOptionLabel,
|
|
276
|
+
D as getSchemaDefault,
|
|
277
|
+
k as inferEntryType,
|
|
277
278
|
j as isMissingRequiredValue,
|
|
278
279
|
O as isObjectType,
|
|
279
280
|
p as resolveRef,
|
|
280
|
-
|
|
281
|
+
T as sortByPropertyOrder,
|
|
281
282
|
N as toFieldLabel,
|
|
283
|
+
I as toRequiredMessage,
|
|
282
284
|
b as validateRequired
|
|
283
285
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.15.0-dev.
|
|
3
|
-
"generatedAt": "2026-09-
|
|
2
|
+
"version": "0.15.0-dev.24",
|
|
3
|
+
"generatedAt": "2026-09-29T08:48:09.588Z",
|
|
4
4
|
"kit": {
|
|
5
5
|
"name": "@epam/ai-dial-ui-kit",
|
|
6
6
|
"description": "A modern UI kit for building AI DIAL interfaces with React",
|
|
@@ -910,6 +910,12 @@
|
|
|
910
910
|
"type": "DropdownItem[]",
|
|
911
911
|
"required": true,
|
|
912
912
|
"description": "DropdownItems with actions"
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
"name": "dropdownProps",
|
|
916
|
+
"type": "Pick<DropdownProps, 'listClassName' | 'matchReferenceWidth'>",
|
|
917
|
+
"required": false,
|
|
918
|
+
"description": "`listClassName` and `matchReferenceWidth` forwarded to the menu `Dropdown`"
|
|
913
919
|
}
|
|
914
920
|
],
|
|
915
921
|
"examples": [
|