@epam/ai-dial-chat-shared 1.2.0-dev.98 → 1.2.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 (51) hide show
  1. package/components/ConfirmationDialog/ConfirmationDialog.js +34 -0
  2. package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.js +21 -0
  3. package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.module.scss.js +6 -0
  4. package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.js +24 -0
  5. package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.module.scss.js +3 -0
  6. package/components/ConfirmationView/ConfirmationFooter.js +42 -0
  7. package/components/ConfirmationView/ConfirmationView.js +39 -0
  8. package/components/ConfirmationView/ConfirmationView.module.scss.js +7 -0
  9. package/components/CopyButton/CopyButton.js +5 -5
  10. package/components/EntityHeader/EntityHeader.js +14 -13
  11. package/components/EntityTypeLabel/EntityTypeLabel.js +2 -2
  12. package/components/FeaturedChip/FeaturedChip.js +9 -14
  13. package/components/InitialsAvatar/InitialsAvatar.js +10 -27
  14. package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +65 -64
  15. package/components/MarkdownRenderer/MDMessageViewer.js +25 -17
  16. package/components/MarkdownRenderer/MarkdownRenderer.js +119 -118
  17. package/components/MarkdownRenderer/MarkdownRenderer.module.scss.js +7 -7
  18. package/components/MarkdownRenderer/Math/MarkdownMathBlock.module.scss.js +2 -2
  19. package/components/MarkdownRenderer/PlainTextRenderer.js +21 -0
  20. package/components/MarkdownRenderer/Table/MarkdownTable.js +62 -65
  21. package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +11 -11
  22. package/components/MarkdownRenderer/Table/TableHeader.js +18 -21
  23. package/components/MarkdownRenderer/ThinkingShimmer.js +14 -0
  24. package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js +3 -2
  25. package/components/PanelEmptyState/PanelEmptyState.js +2 -1
  26. package/components/TextRefinementField/TextRefinementField.js +86 -0
  27. package/constants/dial.js +2 -2
  28. package/constants/resizable-fields.js +2 -2
  29. package/file-manager/DialFileManagerShell/DialFileManagerShell.js +248 -236
  30. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +17 -14
  31. package/file-manager/OperationLoaderModal/OperationLoaderModal.js +17 -20
  32. package/file-manager/upload-batch.js +2 -2
  33. package/file-manager/upload-queue.js +17 -0
  34. package/file-manager.d.ts +25 -14
  35. package/file-manager.js +4 -3
  36. package/hooks/useTextRefinement.js +66 -0
  37. package/hooks/useUnsavedChangesGuard.js +30 -0
  38. package/index.css +2 -2
  39. package/index.d.ts +510 -46
  40. package/index.js +73 -62
  41. package/markdown.d.ts +64 -8
  42. package/markdown.js +5 -4
  43. package/models/chat.js +4 -2
  44. package/package.json +5 -5
  45. package/utils/entity-field-limits.js +4 -0
  46. package/utils/entity-type.js +15 -0
  47. package/utils/format-price.js +13 -9
  48. package/utils/is-skill-selection-unsupported.js +4 -0
  49. package/utils/syntax-highlighting.js +13 -0
  50. package/components/InitialsAvatar/InitialsAvatar.module.scss.js +0 -6
  51. package/file-manager/UploadProgressModal/UploadProgressModal.js +0 -50
@@ -1,30 +1,27 @@
1
1
  import { mergeClasses as e } from "../../../utils/merge-class.js";
2
2
  import t from "./TableHeader.module.scss.js";
3
- import { ElementSize as n, GhostIconButton as r, Tooltip as i } from "@epam/ai-dial-ui-kit";
4
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
3
+ import { ElementSize as n, GhostIconButton as r } from "@epam/ai-dial-ui-kit";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  //#region src/components/MarkdownRenderer/Table/TableHeader.tsx
6
- var s = ({ children: s, actions: c, className: l }) => /* @__PURE__ */ o("div", {
7
- className: e("flex min-h-10 items-center gap-2 border-b px-2 py-2", t.tableHeader, l),
8
- children: [s != null && /* @__PURE__ */ a("div", {
6
+ var o = ({ children: o, actions: s, className: c }) => /* @__PURE__ */ a("div", {
7
+ className: e("flex min-h-10 items-center gap-2 border-b px-2 py-2", t.tableHeader, c),
8
+ children: [o != null && /* @__PURE__ */ i("div", {
9
9
  className: "min-w-0 flex-1",
10
- children: s
11
- }), c != null && /* @__PURE__ */ a("div", {
10
+ children: o
11
+ }), s != null && /* @__PURE__ */ i("div", {
12
12
  className: "ms-auto flex items-center gap-1",
13
- children: c.map((e) => /* @__PURE__ */ a(i, {
14
- tooltip: e.label,
15
- asChild: !0,
16
- children: /* @__PURE__ */ a(r, {
17
- "aria-label": e.label,
18
- icon: /* @__PURE__ */ a("span", {
19
- "aria-hidden": !0,
20
- className: "flex items-center",
21
- children: e.icon
22
- }),
23
- size: n.Small,
24
- onClick: e.onClick
25
- })
13
+ children: s.map((e) => /* @__PURE__ */ i(r, {
14
+ tooltipProps: { tooltip: e.label },
15
+ "aria-label": e.label,
16
+ icon: /* @__PURE__ */ i("span", {
17
+ "aria-hidden": !0,
18
+ className: "flex items-center",
19
+ children: e.icon
20
+ }),
21
+ size: n.Small,
22
+ onClick: e.onClick
26
23
  }, e.label))
27
24
  })]
28
25
  });
29
26
  //#endregion
30
- export { s as TableHeader };
27
+ export { o as TableHeader };
@@ -0,0 +1,14 @@
1
+ import { buildCssVars as e } from "../../utils/build-css-vars.js";
2
+ import t from "./MarkdownRenderer.module.scss.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region src/components/MarkdownRenderer/ThinkingShimmer.tsx
5
+ var r = ({ label: r, colors: i }) => /* @__PURE__ */ n("span", {
6
+ className: t.thinking,
7
+ style: e({
8
+ "--cm-thinking-inverted": i?.thinkingPrimary,
9
+ "--cm-thinking-secondary": i?.thinkingSecondary
10
+ }),
11
+ children: r
12
+ });
13
+ //#endregion
14
+ export { r as ThinkingShimmer };
@@ -2,7 +2,7 @@ import { rehypePromptVariables as e } from "../../utils/prompt-variables.js";
2
2
  import { MarkdownRenderer as t } from "../MarkdownRenderer/MarkdownRenderer.js";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  //#region src/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.tsx
5
- var r = [e], i = ({ content: e, headingClassName: i }) => /* @__PURE__ */ n(t, {
5
+ var r = [e], i = ({ content: e, headingClassName: i, ...a }) => /* @__PURE__ */ n(t, {
6
6
  content: e,
7
7
  rehypePlugins: r,
8
8
  classNames: {
@@ -12,7 +12,8 @@ var r = [e], i = ({ content: e, headingClassName: i }) => /* @__PURE__ */ n(t, {
12
12
  h4: i,
13
13
  h5: i,
14
14
  h6: i
15
- }
15
+ },
16
+ ...a
16
17
  });
17
18
  //#endregion
18
19
  export { i as MarkdownWithPlaceholders };
@@ -5,10 +5,11 @@ import { NoDataContent as r } from "@epam/ai-dial-ui-kit";
5
5
  import { memo as i } from "react";
6
6
  import { jsx as a } from "react/jsx-runtime";
7
7
  //#region src/components/PanelEmptyState/PanelEmptyState.tsx
8
- var o = i(({ label: i, colors: o, labelClassName: s = "dial-tiny-text", containerClassName: c }) => /* @__PURE__ */ a("div", {
8
+ var o = i(({ label: i, colors: o, labelClassName: s = "dial-tiny-text", containerClassName: c, icon: l }) => /* @__PURE__ */ a("div", {
9
9
  style: t({ "--pes-label-color": o?.label }),
10
10
  children: /* @__PURE__ */ a(r, {
11
11
  title: i,
12
+ icon: l,
12
13
  titleClassName: e(n.label, s),
13
14
  className: c
14
15
  })
@@ -0,0 +1,86 @@
1
+ import { mergeClasses as e } from "../../utils/merge-class.js";
2
+ import { TextRefinementState as t } from "../../hooks/useTextRefinement.js";
3
+ import { CaptionText as n, DIAL_ICON_SIZE as r, DIAL_KIT_ICON_STROKE as i, ElementSize as a, ErrorText as o, GhostButton as s, Label as c, Spinner as l } from "@epam/ai-dial-ui-kit";
4
+ import { useRef as u } from "react";
5
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
6
+ import { IconSparkles as m } from "@tabler/icons-react";
7
+ //#region src/components/TextRefinementField/TextRefinementField.tsx
8
+ var h = ({ isEnabled: h, fieldId: g, label: _, labelClassName: v, required: y, labels: b, refinement: x, disabled: S, feedbackClassName: C, errorClassName: w, children: T }) => {
9
+ let E = u(null);
10
+ if (!h) return /* @__PURE__ */ f(d, { children: T });
11
+ let D = x.state === t.Error, O = {
12
+ [t.Idle]: "",
13
+ [t.Pending]: b?.refinePendingAriaLabel ?? "Refining text",
14
+ [t.Success]: b?.refineSuccessAriaLabel ?? "Text refined. Undo is available.",
15
+ [t.Restored]: b?.refineUndoAriaLabel ?? "Original text restored.",
16
+ [t.Unchanged]: b?.refineUnchangedAriaLabel ?? "No changes were needed.",
17
+ [t.Error]: ""
18
+ }[x.state];
19
+ return /* @__PURE__ */ p("div", {
20
+ className: "flex min-w-0 flex-col gap-1",
21
+ role: "group",
22
+ "aria-labelledby": g + "-label",
23
+ "aria-describedby": D ? g + "-refinement-error" : void 0,
24
+ children: [
25
+ /* @__PURE__ */ p("div", {
26
+ className: "flex min-w-0 flex-wrap items-center gap-x-3",
27
+ children: [/* @__PURE__ */ f(c, {
28
+ id: g + "-label",
29
+ htmlFor: g,
30
+ className: v,
31
+ label: _,
32
+ required: y
33
+ }), /* @__PURE__ */ p("div", {
34
+ ref: E,
35
+ className: "ms-auto flex min-w-0 flex-wrap items-center",
36
+ children: [/* @__PURE__ */ f(s, {
37
+ size: a.Small,
38
+ label: b?.refineWithAiLabel ?? "Refine with AI",
39
+ disabled: S || !x.canRefine,
40
+ onClick: () => {
41
+ x.refine();
42
+ },
43
+ iconBefore: x.isPending ? /* @__PURE__ */ f("span", {
44
+ "aria-hidden": !0,
45
+ children: /* @__PURE__ */ f(l, {
46
+ size: r.SM,
47
+ ariaLabel: ""
48
+ })
49
+ }) : /* @__PURE__ */ f(m, {
50
+ size: r.SM,
51
+ stroke: i,
52
+ "aria-hidden": !0
53
+ })
54
+ }), x.canUndo && /* @__PURE__ */ f(s, {
55
+ size: a.Small,
56
+ label: b?.refineUndoLabel ?? "Undo",
57
+ disabled: S,
58
+ onClick: () => {
59
+ x.undo(), E.current?.querySelector("button")?.focus();
60
+ }
61
+ })]
62
+ })]
63
+ }),
64
+ /* @__PURE__ */ f("div", {
65
+ "aria-busy": x.isPending,
66
+ children: T
67
+ }),
68
+ /* @__PURE__ */ f("div", {
69
+ role: "status",
70
+ "aria-live": "polite",
71
+ children: /* @__PURE__ */ f(n, {
72
+ text: O,
73
+ className: C
74
+ })
75
+ }),
76
+ D && /* @__PURE__ */ f(o, {
77
+ role: "alert",
78
+ id: g + "-refinement-error",
79
+ className: e(C, w),
80
+ text: b?.refineErrorLabel ?? "Could not refine this text. Please try again."
81
+ })
82
+ ]
83
+ });
84
+ };
85
+ //#endregion
86
+ export { h as TextRefinementField };
package/constants/dial.js CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region src/constants/dial.ts
2
- var e = ".dial_folder";
2
+ var e = ".dial_folder", t = "public";
3
3
  //#endregion
4
- export { e as HIDDEN_FILE };
4
+ export { e as HIDDEN_FILE, t as PUBLIC_BUCKET };
@@ -1,4 +1,4 @@
1
1
  //#region src/constants/resizable-fields.ts
2
- var e = "max-h-[50vh]", t = "--resizable-field-max-height", n = "[&_.w-md-editor:not(.w-md-editor-fullscreen)]:max-h-[var(--resizable-field-max-height,70vh)]";
2
+ var e = "max-h-[50vh]", t = "--resizable-field-max-height", n = "[&_.w-md-editor:not(.w-md-editor-fullscreen)]:max-h-[var(--resizable-field-max-height,70vh)]", r = "[&_.w-md-editor:not(.w-md-editor-fullscreen)]:!h-[var(--resizable-field-max-height,70vh)]";
3
3
  //#endregion
4
- export { n as MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME, t as RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE, e as RESIZABLE_TEXTAREA_CLASS_NAME };
4
+ export { r as MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME, n as MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME, t as RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE, e as RESIZABLE_TEXTAREA_CLASS_NAME };