@epam/ai-dial-ui-kit 0.16.0-dev.45 → 0.16.0-dev.46

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 (213) hide show
  1. package/README.md +7 -10
  2. package/dist/CHANGELOG.md +4 -1
  3. package/dist/DateCellRenderer-Bx79kGGv.cjs +63 -0
  4. package/dist/MarkdownEditor-BtLY7OVq.cjs +1 -0
  5. package/dist/components-manifest.json +518 -3034
  6. package/dist/constants/public-class-names.js +0 -7
  7. package/dist/dial-ui-kit.cjs +3 -3
  8. package/dist/dial-ui-kit.js +373 -456
  9. package/dist/editors.cjs +1 -1
  10. package/dist/editors.js +4 -10
  11. package/dist/grid.cjs +1 -1
  12. package/dist/grid.js +23 -31
  13. package/dist/{merge-classes-B0SnCG4i.cjs → icon-D93YIwGJ.cjs} +1 -1
  14. package/dist/index.css +1 -1
  15. package/dist/migration-guides/0.16.0/legacy-file-manager-removal.md +5 -3
  16. package/dist/migration-guides/0.16.0/unused-legacy-components-removal.md +128 -0
  17. package/dist/migration-guides/README.md +1 -0
  18. package/dist/node_modules/react-dnd/dist/internals/registration.js +5 -13
  19. package/dist/src/components/New/MarkdownEditor/lazy.d.ts +8 -2
  20. package/dist/src/components/New/SegmentedControl/SegmentedControl.d.ts +2 -2
  21. package/dist/src/constants/public-class-names.d.ts +0 -7
  22. package/dist/src/index.d.ts +2 -53
  23. package/dist/src/subpaths/editors.d.ts +9 -15
  24. package/dist/src/subpaths/grid.d.ts +2 -8
  25. package/dist/src/types/editor.d.ts +0 -6
  26. package/dist/src/utils/grid-registration.d.ts +6 -8
  27. package/package.json +1 -12
  28. package/dist/DateCellRenderer-DrDOIpWg.cjs +0 -63
  29. package/dist/IconButton-CsePS6PY.cjs +0 -1
  30. package/dist/JsonEditor-DQhHSm93.cjs +0 -1
  31. package/dist/MarkdownEditor-CvIPIbPq.cjs +0 -1
  32. package/dist/MarkdownEditor-TR6X_gdl.cjs +0 -1
  33. package/dist/MarkdownEditorContainer-JIn_VNUX.cjs +0 -1
  34. package/dist/Switch-HEL_aq23.cjs +0 -1
  35. package/dist/assets/icons/file/c.svg.js +0 -5
  36. package/dist/assets/icons/file/cpp.svg.js +0 -5
  37. package/dist/assets/icons/file/cs.svg.js +0 -5
  38. package/dist/assets/icons/file/ini.svg.js +0 -5
  39. package/dist/assets/icons/file/json.svg.js +0 -5
  40. package/dist/assets/icons/file/md.svg.js +0 -5
  41. package/dist/assets/icons/file/py.svg.js +0 -5
  42. package/dist/assets/icons/open-popup.svg.js +0 -5
  43. package/dist/components/AutocompleteInput/AutocompleteInputValue.js +0 -21
  44. package/dist/components/ButtonDropdown/ButtonDropdown.js +0 -33
  45. package/dist/components/ButtonDropdown/constants.js +0 -8
  46. package/dist/components/Checkbox/Checkbox.js +0 -64
  47. package/dist/components/Checkbox/constants.js +0 -4
  48. package/dist/components/CollapsibleSidebar/CollapsibleSidebar.js +0 -84
  49. package/dist/components/ConfirmationPopup/ConfirmationPopup.js +0 -75
  50. package/dist/components/ConfirmationPopup/constants.js +0 -32
  51. package/dist/components/DraggableItem/DraggableItem.js +0 -61
  52. package/dist/components/DraggableItem/constants.js +0 -6
  53. package/dist/components/DropdownIcon/DropdownIcon.js +0 -103
  54. package/dist/components/FileIcon/FileIcon.js +0 -37
  55. package/dist/components/FileIcon/constants.js +0 -60
  56. package/dist/components/FileName/FileName.js +0 -68
  57. package/dist/components/FolderName/FolderName.js +0 -57
  58. package/dist/components/FormItem/FormItem.js +0 -90
  59. package/dist/components/FormItem/constants.js +0 -9
  60. package/dist/components/FormPopup/FormPopup.js +0 -59
  61. package/dist/components/FormPopup/constants.js +0 -6
  62. package/dist/components/Grid/Grid.js +0 -333
  63. package/dist/components/Grid/constants.js +0 -33
  64. package/dist/components/Grid/renderers/DateCellRenderer.js +0 -27
  65. package/dist/components/Grid/renderers/constants.js +0 -25
  66. package/dist/components/InputPopup/InputPopup.js +0 -174
  67. package/dist/components/JsonEditor/JsonEditor.js +0 -65
  68. package/dist/components/JsonEditor/lazy.js +0 -4
  69. package/dist/components/MarkdownEditor/MarkdownEditor.js +0 -39
  70. package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +0 -82
  71. package/dist/components/MarkdownEditor/lazy.js +0 -4
  72. package/dist/components/Notification/Notification.js +0 -67
  73. package/dist/components/Notification/constants.js +0 -24
  74. package/dist/components/NumberInput/NumberInput.js +0 -41
  75. package/dist/components/Pagination/Pagination.js +0 -80
  76. package/dist/components/Pagination/utils.js +0 -10
  77. package/dist/components/PasswordInput/Icons/HideIcon.js +0 -16
  78. package/dist/components/PasswordInput/Icons/ShowIcon.js +0 -16
  79. package/dist/components/PasswordInput/PasswordInput.js +0 -21
  80. package/dist/components/Popup/Popup.js +0 -110
  81. package/dist/components/Popup/constants.js +0 -12
  82. package/dist/components/RadioButton/RadioButton.js +0 -103
  83. package/dist/components/RadioGroup/RadioGroup.js +0 -92
  84. package/dist/components/RadioGroup/constants.js +0 -10
  85. package/dist/components/RadioGroupPopupField/RadioGroupPopupField.js +0 -101
  86. package/dist/components/ResizableContainer/ConditionalResizableContainer.js +0 -6
  87. package/dist/components/ResizableContainer/ResizableContainer.js +0 -79
  88. package/dist/components/ResizableContainer/components/ResizeHandle.js +0 -20
  89. package/dist/components/ResizableContainer/components/ResizeIcon.js +0 -11
  90. package/dist/components/SchemaRenderer/SchemaRenderer.js +0 -151
  91. package/dist/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.js +0 -56
  92. package/dist/components/SchemaRenderer/components/SchemaAnyOfEditor.js +0 -74
  93. package/dist/components/SchemaRenderer/components/SchemaArrayEditor.js +0 -118
  94. package/dist/components/SchemaRenderer/components/SchemaField.js +0 -78
  95. package/dist/components/SchemaRenderer/components/SchemaFieldContent.js +0 -114
  96. package/dist/components/SchemaRenderer/components/SchemaKeyValueEditor.js +0 -272
  97. package/dist/components/SchemaRenderer/components/SchemaObjectEditor.js +0 -36
  98. package/dist/components/SchemaRenderer/components/SchemaOneOfEditor.js +0 -192
  99. package/dist/components/SchemaRenderer/components/SchemaPrimitiveField.js +0 -161
  100. package/dist/components/SchemaRenderer/components/SchemaSection.js +0 -81
  101. package/dist/components/SchemaRenderer/context.js +0 -12
  102. package/dist/components/Search/Search.js +0 -63
  103. package/dist/components/Search/constants.js +0 -27
  104. package/dist/components/SegmentedControl/SegmentedControl.js +0 -87
  105. package/dist/components/SegmentedControl/constants.js +0 -8
  106. package/dist/components/Select/MultiSelectTags.js +0 -23
  107. package/dist/components/Select/Select.js +0 -435
  108. package/dist/components/Select/SelectSubMenuItem.js +0 -90
  109. package/dist/components/Select/constants.js +0 -15
  110. package/dist/components/SelectField/SelectField.js +0 -66
  111. package/dist/components/SharedEntityIndicator/SharedEntityIndicator.js +0 -34
  112. package/dist/components/Slider/Slider.js +0 -158
  113. package/dist/components/Switch/Switch.js +0 -70
  114. package/dist/components/TagInput/TagInput.js +0 -179
  115. package/dist/components/Textarea/Textarea.js +0 -43
  116. package/dist/constants/editor.js +0 -52
  117. package/dist/icon-CrGVkVpG.cjs +0 -1
  118. package/dist/icon-DhjrDQ8I.cjs +0 -1
  119. package/dist/lazy-kq-xfXXv.cjs +0 -1
  120. package/dist/node_modules/react-dnd/dist/hooks/useDrag/DragSourceImpl.js +0 -25
  121. package/dist/node_modules/react-dnd/dist/hooks/useDrag/connectors.js +0 -21
  122. package/dist/node_modules/react-dnd/dist/hooks/useDrag/useDrag.js +0 -20
  123. package/dist/node_modules/react-dnd/dist/hooks/useDrag/useDragSource.js +0 -19
  124. package/dist/node_modules/react-dnd/dist/hooks/useDrag/useDragSourceConnector.js +0 -22
  125. package/dist/node_modules/react-dnd/dist/hooks/useDrag/useDragSourceMonitor.js +0 -15
  126. package/dist/node_modules/react-dnd/dist/hooks/useDrag/useDragType.js +0 -13
  127. package/dist/node_modules/react-dnd/dist/hooks/useDrag/useRegisteredDragSource.js +0 -23
  128. package/dist/node_modules/react-dnd/dist/internals/DragSourceMonitorImpl.js +0 -88
  129. package/dist/node_modules/react-dnd/dist/internals/SourceConnector.js +0 -87
  130. package/dist/src/components/AutocompleteInput/AutocompleteInputValue.d.ts +0 -34
  131. package/dist/src/components/ButtonDropdown/ButtonDropdown.d.ts +0 -24
  132. package/dist/src/components/ButtonDropdown/constants.d.ts +0 -2
  133. package/dist/src/components/Checkbox/Checkbox.d.ts +0 -36
  134. package/dist/src/components/Checkbox/constants.d.ts +0 -1
  135. package/dist/src/components/CollapsibleSidebar/CollapsibleSidebar.d.ts +0 -46
  136. package/dist/src/components/ConfirmationPopup/ConfirmationPopup.d.ts +0 -55
  137. package/dist/src/components/ConfirmationPopup/constants.d.ts +0 -18
  138. package/dist/src/components/DraggableItem/DraggableItem.d.ts +0 -33
  139. package/dist/src/components/DraggableItem/constants.d.ts +0 -3
  140. package/dist/src/components/DropdownIcon/DropdownIcon.d.ts +0 -38
  141. package/dist/src/components/FileIcon/FileIcon.d.ts +0 -33
  142. package/dist/src/components/FileIcon/constants.d.ts +0 -9
  143. package/dist/src/components/FileName/FileName.d.ts +0 -49
  144. package/dist/src/components/FolderName/FolderName.d.ts +0 -37
  145. package/dist/src/components/FormItem/FormItem.d.ts +0 -66
  146. package/dist/src/components/FormItem/constants.d.ts +0 -3
  147. package/dist/src/components/FormPopup/FormPopup.d.ts +0 -46
  148. package/dist/src/components/FormPopup/constants.d.ts +0 -3
  149. package/dist/src/components/Grid/Grid.d.ts +0 -120
  150. package/dist/src/components/Grid/comparators/base-column-comparator.d.ts +0 -1
  151. package/dist/src/components/Grid/constants.d.ts +0 -28
  152. package/dist/src/components/Grid/renderers/DateCellRenderer.d.ts +0 -34
  153. package/dist/src/components/Grid/renderers/constants.d.ts +0 -7
  154. package/dist/src/components/Grid/renderers/utils.d.ts +0 -1
  155. package/dist/src/components/InputPopup/InputPopup.d.ts +0 -61
  156. package/dist/src/components/JsonEditor/JsonEditor.d.ts +0 -25
  157. package/dist/src/components/JsonEditor/lazy.d.ts +0 -14
  158. package/dist/src/components/MarkdownEditor/MarkdownEditor.d.ts +0 -38
  159. package/dist/src/components/MarkdownEditor/MarkdownEditorContainer.d.ts +0 -51
  160. package/dist/src/components/MarkdownEditor/lazy.d.ts +0 -7
  161. package/dist/src/components/Notification/Notification.d.ts +0 -58
  162. package/dist/src/components/Notification/constants.d.ts +0 -8
  163. package/dist/src/components/NumberInput/NumberInput.d.ts +0 -34
  164. package/dist/src/components/Pagination/Pagination.d.ts +0 -11
  165. package/dist/src/components/Pagination/utils.d.ts +0 -9
  166. package/dist/src/components/PasswordInput/Icons/HideIcon.d.ts +0 -16
  167. package/dist/src/components/PasswordInput/Icons/ShowIcon.d.ts +0 -16
  168. package/dist/src/components/PasswordInput/PasswordInput.d.ts +0 -26
  169. package/dist/src/components/Popup/Popup.d.ts +0 -64
  170. package/dist/src/components/Popup/constants.d.ts +0 -5
  171. package/dist/src/components/RadioButton/RadioButton.d.ts +0 -54
  172. package/dist/src/components/RadioGroup/RadioGroup.d.ts +0 -66
  173. package/dist/src/components/RadioGroup/constants.d.ts +0 -5
  174. package/dist/src/components/RadioGroupPopupField/RadioGroupPopupField.d.ts +0 -74
  175. package/dist/src/components/ResizableContainer/ConditionalResizableContainer.d.ts +0 -35
  176. package/dist/src/components/ResizableContainer/ResizableContainer.d.ts +0 -72
  177. package/dist/src/components/ResizableContainer/components/ResizeHandle.d.ts +0 -10
  178. package/dist/src/components/ResizableContainer/components/ResizeIcon.d.ts +0 -8
  179. package/dist/src/components/SchemaRenderer/SchemaRenderer.d.ts +0 -30
  180. package/dist/src/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.d.ts +0 -20
  181. package/dist/src/components/SchemaRenderer/components/SchemaAnyOfEditor.d.ts +0 -31
  182. package/dist/src/components/SchemaRenderer/components/SchemaArrayEditor.d.ts +0 -31
  183. package/dist/src/components/SchemaRenderer/components/SchemaField.d.ts +0 -29
  184. package/dist/src/components/SchemaRenderer/components/SchemaFieldContent.d.ts +0 -25
  185. package/dist/src/components/SchemaRenderer/components/SchemaKeyValueEditor.d.ts +0 -33
  186. package/dist/src/components/SchemaRenderer/components/SchemaObjectEditor.d.ts +0 -31
  187. package/dist/src/components/SchemaRenderer/components/SchemaOneOfEditor.d.ts +0 -31
  188. package/dist/src/components/SchemaRenderer/components/SchemaPrimitiveField.d.ts +0 -31
  189. package/dist/src/components/SchemaRenderer/components/SchemaSection.d.ts +0 -33
  190. package/dist/src/components/SchemaRenderer/context.d.ts +0 -19
  191. package/dist/src/components/SchemaRenderer/types.d.ts +0 -62
  192. package/dist/src/components/SchemaRenderer/utils.d.ts +0 -1
  193. package/dist/src/components/Search/Search.d.ts +0 -35
  194. package/dist/src/components/Search/constants.d.ts +0 -8
  195. package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +0 -40
  196. package/dist/src/components/SegmentedControl/constants.d.ts +0 -5
  197. package/dist/src/components/Select/MultiSelectTags.d.ts +0 -8
  198. package/dist/src/components/Select/Select.d.ts +0 -100
  199. package/dist/src/components/Select/SelectSubMenuItem.d.ts +0 -8
  200. package/dist/src/components/Select/constants.d.ts +0 -9
  201. package/dist/src/components/SelectField/SelectField.d.ts +0 -42
  202. package/dist/src/components/SharedEntityIndicator/SharedEntityIndicator.d.ts +0 -31
  203. package/dist/src/components/Slider/Slider.d.ts +0 -57
  204. package/dist/src/components/Switch/Switch.d.ts +0 -34
  205. package/dist/src/components/TagInput/TagInput.d.ts +0 -52
  206. package/dist/src/components/Textarea/Textarea.d.ts +0 -39
  207. package/dist/src/constants/editor.d.ts +0 -2
  208. package/dist/src/constants/storybook/form-item.d.ts +0 -3
  209. package/dist/src/models/segmented-control.d.ts +0 -7
  210. package/dist/src/types/form-item.d.ts +0 -31
  211. package/dist/src/types/select.d.ts +0 -8
  212. package/dist/types/form-item.js +0 -4
  213. package/dist/types/select.js +0 -5
@@ -1,92 +0,0 @@
1
- import { jsx as s, jsxs as g } from "react/jsx-runtime";
2
- import { DialFormItem as j } from "../FormItem/FormItem.js";
3
- import { DialRadioButton as v } from "../RadioButton/RadioButton.js";
4
- import { mergeClasses as a } from "../../utils/merge-classes.js";
5
- import { selectedContentClassName as $, orientationClassMap as k, optionsWrapperBaseClassName as F } from "./constants.js";
6
- const y = ({
7
- fieldTitle: n,
8
- radioClassName: p,
9
- containerClassName: o,
10
- selectedItemClassName: t,
11
- selectedLabelClassName: d,
12
- radioGroupClassName: N,
13
- inputContainerClassName: h,
14
- selectedInputContainerClassName: C,
15
- groupLabelClassName: i,
16
- formItemChildrenClassName: f,
17
- labelClassName: r,
18
- disabled: c,
19
- elementId: m,
20
- radioButtons: x,
21
- activeRadioButton: l,
22
- orientation: b,
23
- labelDescription: u,
24
- onChange: D
25
- }) => /* @__PURE__ */ s(
26
- j,
27
- {
28
- id: m,
29
- label: n,
30
- labelClassName: i || r,
31
- description: u,
32
- className: o,
33
- childrenClassName: f,
34
- children: /* @__PURE__ */ s(
35
- "div",
36
- {
37
- role: "radiogroup",
38
- "aria-label": n,
39
- "aria-disabled": c || void 0,
40
- className: a(
41
- F,
42
- k[b],
43
- N
44
- ),
45
- children: x.map((e) => /* @__PURE__ */ g(
46
- "div",
47
- {
48
- className: a(
49
- "flex flex-col",
50
- h,
51
- e.id === l && C
52
- ),
53
- children: [
54
- /* @__PURE__ */ s(
55
- v,
56
- {
57
- name: m,
58
- value: e.id,
59
- inputId: `${m}-${e.id}`,
60
- disabled: c,
61
- className: p,
62
- labelClassName: a(
63
- r,
64
- e.id === l && d
65
- ),
66
- label: e.name,
67
- caption: e.caption,
68
- checked: e.id === l,
69
- onChange: () => D(e.id)
70
- }
71
- ),
72
- e.id === l && e.content ? /* @__PURE__ */ s(
73
- "div",
74
- {
75
- className: a(
76
- $,
77
- t
78
- ),
79
- children: e.content
80
- }
81
- ) : null
82
- ]
83
- },
84
- e.id
85
- ))
86
- }
87
- )
88
- }
89
- );
90
- export {
91
- y as DialRadioGroup
92
- };
@@ -1,10 +0,0 @@
1
- import { RadioGroupOrientation as o } from "../../types/radio-group.js";
2
- const t = "flex", a = "pb-1 mt-2", s = {
3
- [o.Column]: "flex-col gap-y-2",
4
- [o.Row]: "flex-row gap-x-4"
5
- };
6
- export {
7
- t as optionsWrapperBaseClassName,
8
- s as orientationClassMap,
9
- a as selectedContentClassName
10
- };
@@ -1,101 +0,0 @@
1
- import { jsxs as u, jsx as e } from "react/jsx-runtime";
2
- import B from "classnames";
3
- import { useState as S, useCallback as l } from "react";
4
- import { DialNeutralButton as w, DialPrimaryButton as z } from "../Button/ButtonWrappers.js";
5
- import { DialLabel as A } from "../Label/Label.js";
6
- import { DialInputPopup as F } from "../InputPopup/InputPopup.js";
7
- import { DialPopup as L } from "../Popup/Popup.js";
8
- import { DialRadioGroup as M } from "../RadioGroup/RadioGroup.js";
9
- import { PopupSize as q } from "../../types/popup.js";
10
- import { RadioGroupOrientation as E } from "../../types/radio-group.js";
11
- const _ = ({
12
- label: c,
13
- htmlFor: f,
14
- disabled: a,
15
- selectedValue: d,
16
- radioButtons: i,
17
- customInputValue: x,
18
- valueClassName: C,
19
- inputClassName: D,
20
- emptyValueText: N,
21
- placeholder: P,
22
- onClose: p,
23
- header: h,
24
- portalId: y,
25
- onApply: t,
26
- onCancel: n,
27
- cancelButtonTitle: O = "Cancel",
28
- applyButtonTitle: b = "Apply",
29
- isValid: v,
30
- selectedRadioValue: R,
31
- onChangeRadioField: g,
32
- id: j,
33
- size: k = q.Md
34
- }) => {
35
- const [r, m] = S(!1), G = l(() => {
36
- a || m(!0);
37
- }, [a]), o = l(() => {
38
- m(!1), p?.();
39
- }, [p]), s = l(() => {
40
- n?.(), o();
41
- }, [n, o]), I = l(() => {
42
- t(), o();
43
- }, [t, o]);
44
- return /* @__PURE__ */ u("div", { className: "flex flex-col gap-1", children: [
45
- /* @__PURE__ */ e(A, { label: c, htmlFor: f }),
46
- /* @__PURE__ */ e(
47
- F,
48
- {
49
- disabled: a,
50
- open: r,
51
- selectedValue: x ?? i.find((V) => V.id === d)?.name,
52
- valueClassName: C,
53
- inputClassName: B(D, "py-2", "px-3"),
54
- emptyValueText: N,
55
- placeholder: P,
56
- onOpen: G,
57
- children: /* @__PURE__ */ e(
58
- L,
59
- {
60
- open: r,
61
- onClose: s,
62
- header: h,
63
- portalId: y,
64
- size: k,
65
- footer: /* @__PURE__ */ u("div", { className: "flex flex-row items-center justify-end gap-2 px-6 py-4", children: [
66
- /* @__PURE__ */ e(
67
- w,
68
- {
69
- label: O,
70
- onClick: s
71
- }
72
- ),
73
- /* @__PURE__ */ e(
74
- z,
75
- {
76
- label: b,
77
- onClick: I,
78
- disabled: !v
79
- }
80
- )
81
- ] }),
82
- children: /* @__PURE__ */ e("div", { className: "px-6 py-4", children: /* @__PURE__ */ e(
83
- M,
84
- {
85
- radioButtons: i,
86
- labelClassName: "dial-small-text",
87
- activeRadioButton: R,
88
- onChange: g,
89
- elementId: j,
90
- orientation: E.Column
91
- }
92
- ) })
93
- }
94
- )
95
- }
96
- )
97
- ] });
98
- };
99
- export {
100
- _ as DialRadioGroupPopupField
101
- };
@@ -1,6 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { DialResizableContainer as e } from "./ResizableContainer.js";
3
- const l = ({ enabled: i = !0, children: r, ...o }) => i ? /* @__PURE__ */ t(e, { ...o, children: r }) : r;
4
- export {
5
- l as DialConditionalResizableContainer
6
- };
@@ -1,79 +0,0 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { ResizableContainerSide as R } from "../../types/resizable-container.js";
3
- import { Resizable as H } from "../../node_modules/re-resizable/lib/index.js";
4
- import { useState as v, useRef as L, useCallback as b, useMemo as _ } from "react";
5
- import { ResizeHandle as j } from "./components/ResizeHandle.js";
6
- const E = ({
7
- children: C,
8
- minWidth: n,
9
- maxWidth: l,
10
- width: a,
11
- defaultWidth: S,
12
- onResizeStop: d,
13
- onResize: f,
14
- side: o = R.Right,
15
- resizeHandlerClassName: c,
16
- resizeHandler: h
17
- }) => {
18
- const [u, g] = v(!1), [x, y] = v(S), t = a !== void 0, r = t ? a : x, z = L(null), p = b(() => {
19
- g(!0);
20
- }, []), m = b(() => {
21
- g(!1);
22
- const e = z.current?.resizable?.getBoundingClientRect(), i = e ? Math.round(e.width) : n;
23
- t || y(i), d?.(i);
24
- }, [d, t, n]), I = _(() => {
25
- const e = o === R.Left, i = /* @__PURE__ */ s(
26
- j,
27
- {
28
- side: o,
29
- isResizing: u,
30
- customHandler: h,
31
- handlerClassName: c
32
- }
33
- );
34
- return {
35
- size: t ? { width: r, height: "100%" } : void 0,
36
- defaultSize: t ? void 0 : { width: r, height: "100%" },
37
- minWidth: n,
38
- maxWidth: l,
39
- enable: {
40
- left: e,
41
- right: !e
42
- },
43
- handleClasses: {
44
- right: "group",
45
- left: "group"
46
- },
47
- handleStyles: {
48
- right: { right: "-8px", zIndex: 10 },
49
- left: { left: 0, zIndex: 10 }
50
- },
51
- handleComponent: {
52
- left: e ? i : void 0,
53
- right: e ? void 0 : i
54
- },
55
- onResizeStart: p,
56
- onResize: (k, B, w) => {
57
- const M = Math.round(w.offsetWidth);
58
- f?.(M);
59
- },
60
- onResizeStop: m
61
- };
62
- }, [
63
- o,
64
- t,
65
- r,
66
- n,
67
- l,
68
- h,
69
- c,
70
- u,
71
- p,
72
- m,
73
- f
74
- ]);
75
- return /* @__PURE__ */ s(H, { ref: z, ...I, children: /* @__PURE__ */ s("div", { className: "group flex size-full flex-col bg-layer-3 divide-y divide-tertiary transition-all", children: C }) });
76
- };
77
- export {
78
- E as DialResizableContainer
79
- };
@@ -1,20 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { mergeClasses as a } from "../../../utils/merge-classes.js";
3
- import "react";
4
- import { ResizeIcon as n } from "./ResizeIcon.js";
5
- const u = ({
6
- side: s,
7
- isResizing: o,
8
- customHandler: e,
9
- handlerClassName: t
10
- }) => {
11
- const i = a(
12
- "invisible h-full w-0.5 group-hover:visible bg-accent-primary text-accent-primary cursor-col-resize transition-opacity",
13
- o && "visible",
14
- t
15
- ), c = /* @__PURE__ */ r(n, { side: s, className: i });
16
- return e ? /* @__PURE__ */ r("div", { className: i, children: e }) : c;
17
- };
18
- export {
19
- u as ResizeHandle
20
- };
@@ -1,11 +0,0 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { ResizableContainerSide as t } from "../../../types/resizable-container.js";
3
- import { IconChevronLeft as i, IconChevronRight as s } from "@tabler/icons-react";
4
- import c from "classnames";
5
- const p = ({ side: r, className: n }) => {
6
- const o = r === t.Left;
7
- return /* @__PURE__ */ e("div", { className: n, children: /* @__PURE__ */ e(o ? i : s, { className: c("h-full", o && "-ml-6") }) });
8
- };
9
- export {
10
- p as ResizeIcon
11
- };
@@ -1,151 +0,0 @@
1
- import { jsx as i, jsxs as f } from "react/jsx-runtime";
2
- import { useMemo as b, useState as q, useCallback as J, useEffect as Q } from "react";
3
- import { mergeClasses as U } from "../../utils/merge-classes.js";
4
- import { SchemaRendererContext as Y } from "./context.js";
5
- import { extractDefaults as Z, sortByPropertyOrder as $, resolveRef as R, toFieldLabel as F, validateRequired as y, isMissingRequiredValue as k } from "../../utils/json-schema.js";
6
- import { SchemaSection as L } from "./components/SchemaSection.js";
7
- import { SchemaFieldContent as T } from "./components/SchemaFieldContent.js";
8
- import { SchemaField as ee } from "./components/SchemaField.js";
9
- import { SchemaAdditionalPropertiesEditor as te } from "./components/SchemaAdditionalPropertiesEditor.js";
10
- import { DEFAULT_SCHEMA_TEXTS as re } from "../../constants/schema-renderer.js";
11
- import { SchemaRendererVariant as m } from "../../types/json-schema.js";
12
- const pe = ({
13
- schema: r,
14
- defaultValue: v,
15
- texts: x,
16
- className: N,
17
- readonly: j = !1,
18
- defaultExpanded: u = !0,
19
- inputClassName: M,
20
- variant: h = m.Sections,
21
- onChange: O,
22
- onPropertyChange: A,
23
- onDefaultValues: D,
24
- renderField: V,
25
- skipUntouched: S = !1,
26
- jsonEditorTheme: g,
27
- acceptableResourceTypes: w
28
- }) => {
29
- const E = b(
30
- () => ({ ...re, ...x }),
31
- [x]
32
- ), C = b(() => v || (Z(r, r) ?? {}), []), [a, H] = q(C), [p, K] = q(
33
- /* @__PURE__ */ new Set()
34
- ), _ = J((e) => {
35
- K((t) => t.has(e) ? t : /* @__PURE__ */ new Set([...t, e]));
36
- }, []);
37
- Q(() => {
38
- D?.(C);
39
- }, []);
40
- const c = (e, t) => {
41
- const o = { ...a, [e]: t };
42
- H(o), O?.(o), A?.(e, t);
43
- }, B = new Set(Object.keys(r.properties ?? {})), W = Object.keys(a).filter(
44
- (e) => !B.has(e)
45
- ), X = $(
46
- Object.entries(r.properties ?? {}).filter(
47
- ([, e]) => !R(e, r).isHidden
48
- )
49
- ), z = r.required ?? [];
50
- return /* @__PURE__ */ i(
51
- Y.Provider,
52
- {
53
- value: {
54
- rootSchema: r,
55
- texts: E,
56
- readonly: j,
57
- defaultExpanded: u,
58
- inputClassName: M,
59
- jsonEditorTheme: g,
60
- acceptableResourceTypes: w,
61
- renderField: V,
62
- touchedPaths: p,
63
- markTouched: _,
64
- skipUntouched: S
65
- },
66
- children: /* @__PURE__ */ f("div", { className: U("flex flex-col gap-4", N), children: [
67
- X.map(([e, t]) => {
68
- const o = R(t, r), s = o.title ?? t.title ?? F(e), d = z.includes(e), n = a[e];
69
- if (h === m.Flat)
70
- return /* @__PURE__ */ i(
71
- ee,
72
- {
73
- schema: t,
74
- value: n,
75
- onChange: (l) => c(e, l),
76
- path: [e],
77
- level: 0,
78
- required: d,
79
- label: s
80
- },
81
- e
82
- );
83
- if (h === m.FlatSections)
84
- return /* @__PURE__ */ f("div", { className: "flex flex-col gap-3", children: [
85
- /* @__PURE__ */ i("h2", { className: "dial-small-semi-text text-primary", children: s }),
86
- /* @__PURE__ */ i(
87
- T,
88
- {
89
- schema: t,
90
- value: n,
91
- onChange: (l) => c(e, l),
92
- path: [e],
93
- level: 0,
94
- required: d
95
- }
96
- )
97
- ] }, e);
98
- const P = y(n, o, r, e), G = e + ".", I = !S || p.has(e) || [...p].some((l) => l.startsWith(G));
99
- return /* @__PURE__ */ i(
100
- L,
101
- {
102
- title: s,
103
- description: o.description,
104
- level: 0,
105
- defaultExpanded: u,
106
- errorCount: I ? d && k(n) ? Math.max(P.length, 1) : P.length : 0,
107
- children: /* @__PURE__ */ i(
108
- T,
109
- {
110
- schema: t,
111
- value: n,
112
- onChange: (l) => c(e, l),
113
- path: [e],
114
- level: 1,
115
- required: d
116
- }
117
- )
118
- },
119
- e
120
- );
121
- }),
122
- W.map((e) => {
123
- const t = F(e), o = /* @__PURE__ */ i(
124
- te,
125
- {
126
- value: a[e],
127
- onChange: (s) => c(e, s),
128
- theme: g
129
- }
130
- );
131
- return h === m.Sections ? /* @__PURE__ */ i(
132
- L,
133
- {
134
- title: t,
135
- level: 0,
136
- defaultExpanded: u,
137
- children: o
138
- },
139
- e
140
- ) : /* @__PURE__ */ f("div", { className: "flex flex-col gap-3", children: [
141
- /* @__PURE__ */ i("h2", { className: "dial-small-semi-text text-primary", children: t }),
142
- o
143
- ] }, e);
144
- })
145
- ] })
146
- }
147
- );
148
- };
149
- export {
150
- pe as DialSchemaRenderer
151
- };
@@ -1,56 +0,0 @@
1
- import { jsxs as u, jsx as e } from "react/jsx-runtime";
2
- import { useState as s, useEffect as E } from "react";
3
- import { DialErrorText as y } from "../../CaptionText/CaptionText.js";
4
- import { useSchemaContext as S } from "../context.js";
5
- import { EditorThemes as v } from "../../../types/editor.js";
6
- const O = ({ value: a, onChange: d, theme: m = v.dark, height: l = 240 }) => {
7
- const { readonly: c, texts: p } = S(), [r, h] = s(null), [o, f] = s(
8
- () => JSON.stringify(a, null, 2)
9
- );
10
- E(() => {
11
- typeof window < "u" && import("../../JsonEditor/JsonEditor.js").then((t) => {
12
- h(() => t.DialJsonEditor);
13
- });
14
- }, []);
15
- let n = !1;
16
- try {
17
- JSON.parse(o);
18
- } catch {
19
- n = !0;
20
- }
21
- const x = (t) => {
22
- const i = t ?? "";
23
- f(i);
24
- try {
25
- d(JSON.parse(i));
26
- } catch {
27
- }
28
- };
29
- return /* @__PURE__ */ u("div", { children: [
30
- /* @__PURE__ */ e(
31
- "div",
32
- {
33
- className: "border border-primary rounded",
34
- style: { height: `${l}px` },
35
- children: r && /* @__PURE__ */ e(
36
- r,
37
- {
38
- value: o,
39
- currentTheme: m,
40
- onChange: x,
41
- options: { readOnly: c }
42
- }
43
- )
44
- }
45
- ),
46
- /* @__PURE__ */ e(
47
- y,
48
- {
49
- text: n ? p.invalidJsonError : void 0
50
- }
51
- )
52
- ] });
53
- };
54
- export {
55
- O as SchemaAdditionalPropertiesEditor
56
- };
@@ -1,74 +0,0 @@
1
- import { jsxs as v, jsx as c } from "react/jsx-runtime";
2
- import { DialSelect as x } from "../../Select/Select.js";
3
- import { useSchemaContext as N } from "../context.js";
4
- import { getOptionLabel as k, detectAnyOfVariant as O, resolveRef as d, extractDefaults as w } from "../../../utils/json-schema.js";
5
- import { SchemaFieldContent as A } from "./SchemaFieldContent.js";
6
- import { JsonSchemaType as a } from "../../../types/json-schema.js";
7
- const J = ({
8
- schema: f,
9
- value: n,
10
- onChange: e,
11
- path: p,
12
- level: u
13
- }) => {
14
- const { rootSchema: s, readonly: S = !1 } = N(), l = f.anyOf ?? [], b = l.map((t, r) => ({
15
- value: String(r),
16
- label: k(t, s)
17
- })), i = O(n, l, s), o = l[i], y = d(o, s).type === a.Null, h = (t) => {
18
- const r = d(l[t], s);
19
- if (r.type === a.Null) {
20
- e(null);
21
- return;
22
- }
23
- const m = w(r, s);
24
- if (m !== void 0) {
25
- e(m);
26
- return;
27
- }
28
- switch (r.type) {
29
- case a.Array:
30
- e([]);
31
- break;
32
- case a.String:
33
- e("");
34
- break;
35
- case a.Boolean:
36
- e(!1);
37
- break;
38
- case a.Integer:
39
- case a.Number:
40
- e(0);
41
- break;
42
- default:
43
- e({});
44
- break;
45
- }
46
- };
47
- return /* @__PURE__ */ v("div", { className: "flex flex-col gap-3", children: [
48
- /* @__PURE__ */ c("div", { className: "flex-1 max-w-[280px]", children: /* @__PURE__ */ c(
49
- x,
50
- {
51
- options: b,
52
- value: String(i),
53
- disabled: S,
54
- onChange: (t) => {
55
- const r = typeof t == "string" ? t : t[0];
56
- h(Number(r));
57
- }
58
- }
59
- ) }),
60
- !y && o && /* @__PURE__ */ c("div", { className: "pl-3 border-l-2 border-secondary", children: /* @__PURE__ */ c(
61
- A,
62
- {
63
- schema: o,
64
- value: n,
65
- onChange: e,
66
- path: p,
67
- level: u
68
- }
69
- ) })
70
- ] });
71
- };
72
- export {
73
- J as SchemaAnyOfEditor
74
- };