@pareto-engineering/design-system 5.12.6 → 5.12.7

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 (208) hide show
  1. package/dist/{FormBuilder-CaHio0TV.js → FormBuilder-BeA-ypKe.js} +5451 -5454
  2. package/dist/assets/DragAndDrop.css +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/stories/a/AppContext.stories.js +1 -1
  5. package/dist/stories/a/AreaChart.stories.js +1 -1
  6. package/dist/stories/a/BarChart.stories.js +1 -1
  7. package/dist/stories/a/BlurOverlay.stories.js +1 -1
  8. package/dist/stories/a/ContentTree.stories.js +1 -1
  9. package/dist/stories/a/Conversation.stories.js +1 -1
  10. package/dist/stories/a/DatePicker.stories.js +1 -1
  11. package/dist/stories/a/DotInfo.stories.js +1 -1
  12. package/dist/stories/a/Figure.stories.js +1 -1
  13. package/dist/stories/a/HamburgerButton.stories.js +1 -1
  14. package/dist/stories/a/IconList.stories.js +1 -1
  15. package/dist/stories/a/Label.stories.js +1 -1
  16. package/dist/stories/a/LoadingCircle.stories.js +1 -1
  17. package/dist/stories/a/MetaCard.stories.js +1 -1
  18. package/dist/stories/a/Notification.stories.js +1 -1
  19. package/dist/stories/a/NotificationStack.stories.js +1 -1
  20. package/dist/stories/a/People.stories.js +1 -1
  21. package/dist/stories/a/PieChart.stories.js +1 -1
  22. package/dist/stories/a/Popover.stories.js +1 -1
  23. package/dist/stories/a/ProgressBar.stories.js +1 -1
  24. package/dist/stories/a/Quote.stories.js +1 -1
  25. package/dist/stories/a/Removable.stories.js +1 -1
  26. package/dist/stories/a/SVG.stories.js +1 -1
  27. package/dist/stories/a/SnapScroller.stories.js +1 -1
  28. package/dist/stories/a/Spinner.stories.js +1 -1
  29. package/dist/stories/a/TextSteps.stories.js +1 -1
  30. package/dist/stories/a/Timestamp.stories.js +1 -1
  31. package/dist/stories/a/Tip.stories.js +1 -1
  32. package/dist/stories/a/ToggleSwitch.stories.js +1 -1
  33. package/dist/stories/a/Tooltip.stories.js +1 -1
  34. package/dist/stories/a/XMLEditor.stories.js +1 -1
  35. package/dist/stories/b/Button/Button.stories.js +1 -1
  36. package/dist/stories/b/Button/Group.stories.js +1 -1
  37. package/dist/stories/b/Card/Card.stories.js +1 -1
  38. package/dist/stories/b/Card/Group.stories.js +1 -1
  39. package/dist/stories/b/Logo.stories.js +1 -1
  40. package/dist/stories/b/Page.stories.js +1 -1
  41. package/dist/stories/b/SocialMediaButton.stories.js +1 -1
  42. package/dist/stories/b/ThemeSelector.stories.js +1 -1
  43. package/dist/stories/b/Title.stories.js +1 -1
  44. package/dist/stories/c/Modal.stories.js +1 -1
  45. package/dist/stories/c/Shortener.stories.js +1 -1
  46. package/dist/stories/c/SocialMediaShareButton.stories.js +1 -1
  47. package/dist/stories/f/Checkbox.stories.js +1 -1
  48. package/dist/stories/f/ChoicesInput.stories.js +1 -1
  49. package/dist/stories/f/Combobox.stories.js +1 -1
  50. package/dist/stories/f/Description.stories.js +1 -1
  51. package/dist/stories/f/DragAndDropFileUpload.stories.js +1 -1
  52. package/dist/stories/f/EditorInput.stories.js +1 -1
  53. package/dist/stories/f/FileUpload.stories.js +1 -1
  54. package/dist/stories/f/Label.stories.js +1 -1
  55. package/dist/stories/f/LinkInput.stories.js +1 -1
  56. package/dist/stories/f/RadioInput.stories.js +1 -1
  57. package/dist/stories/f/RatingsInput.stories.js +1 -1
  58. package/dist/stories/f/SelectInput.stories.js +1 -1
  59. package/dist/stories/f/TextInput.stories.js +1 -1
  60. package/dist/stories/f/TextareaInput.stories.js +1 -1
  61. package/dist/stories/g/DragAndDrop.stories.js +131 -40
  62. package/dist/stories/g/ExpandableLexicalPreview.stories.js +1 -1
  63. package/dist/stories/g/FormBuilder.stories.js +1 -1
  64. package/dist/ui/a/AnimatedGradient/AnimatedGradient.js +1 -1
  65. package/dist/ui/a/AnimatedGradient/index.js +1 -1
  66. package/dist/ui/a/ContentTree/ContentTree.js +1 -1
  67. package/dist/ui/a/ContentTree/common/Tree/Tree.js +1 -1
  68. package/dist/ui/a/ContentTree/common/Tree/index.js +1 -1
  69. package/dist/ui/a/ContentTree/common/index.js +1 -1
  70. package/dist/ui/a/ContentTree/index.js +1 -1
  71. package/dist/ui/a/Conversation/Conversation.js +1 -1
  72. package/dist/ui/a/Conversation/index.js +1 -1
  73. package/dist/ui/a/Notification/Notification.js +1 -1
  74. package/dist/ui/a/Notification/index.js +1 -1
  75. package/dist/ui/a/NotificationStack/NotificationStack.js +1 -1
  76. package/dist/ui/a/NotificationStack/index.js +1 -1
  77. package/dist/ui/a/index.js +1 -1
  78. package/dist/ui/b/Button/Button.js +1 -1
  79. package/dist/ui/b/Button/index.js +1 -1
  80. package/dist/ui/b/Card/Card.js +1 -1
  81. package/dist/ui/b/Card/common/Group/Group.js +1 -1
  82. package/dist/ui/b/Card/common/Group/index.js +1 -1
  83. package/dist/ui/b/Card/common/index.js +1 -1
  84. package/dist/ui/b/Card/index.js +1 -1
  85. package/dist/ui/b/Logo/Logo.js +1 -1
  86. package/dist/ui/b/Logo/index.js +1 -1
  87. package/dist/ui/b/Page/Page.js +1 -1
  88. package/dist/ui/b/Page/common/PageHelmet/PageHelmet.js +1 -1
  89. package/dist/ui/b/Page/common/PageHelmet/index.js +1 -1
  90. package/dist/ui/b/Page/common/index.js +1 -1
  91. package/dist/ui/b/Page/index.js +1 -1
  92. package/dist/ui/b/SocialMediaButton/SocialMediaButton.js +1 -1
  93. package/dist/ui/b/SocialMediaButton/index.js +1 -1
  94. package/dist/ui/b/ThemeSelector/ThemeSelector.js +1 -1
  95. package/dist/ui/b/ThemeSelector/index.js +1 -1
  96. package/dist/ui/b/index.js +1 -1
  97. package/dist/ui/c/Modal/Modal.js +1 -1
  98. package/dist/ui/c/Modal/common/ModalHeader/ModalHeader.js +1 -1
  99. package/dist/ui/c/Modal/common/ModalHeader/index.js +1 -1
  100. package/dist/ui/c/Modal/common/index.js +1 -1
  101. package/dist/ui/c/Modal/index.js +1 -1
  102. package/dist/ui/c/Shortener/Shortener.js +1 -1
  103. package/dist/ui/c/Shortener/index.js +1 -1
  104. package/dist/ui/c/index.js +1 -1
  105. package/dist/ui/f/FormInput/FormInput.js +1 -1
  106. package/dist/ui/f/FormInput/index.js +1 -1
  107. package/dist/ui/f/common/Debugger/Debugger.js +1 -1
  108. package/dist/ui/f/common/Debugger/index.js +1 -1
  109. package/dist/ui/f/common/index.js +1 -1
  110. package/dist/ui/f/fields/Checkbox/Checkbox.js +1 -1
  111. package/dist/ui/f/fields/Checkbox/index.js +1 -1
  112. package/dist/ui/f/fields/ChoicesInput/ChoicesInput.js +1 -1
  113. package/dist/ui/f/fields/ChoicesInput/index.js +1 -1
  114. package/dist/ui/f/fields/DragAndDropFileUpload/DragAndDropFileUpload.js +1 -1
  115. package/dist/ui/f/fields/DragAndDropFileUpload/index.js +1 -1
  116. package/dist/ui/f/fields/EditorInput/EditorInput.js +1 -1
  117. package/dist/ui/f/fields/EditorInput/common/BlockFormatDropDown/BlockFormatDropDown.js +1 -1
  118. package/dist/ui/f/fields/EditorInput/common/BlockFormatDropDown/index.js +1 -1
  119. package/dist/ui/f/fields/EditorInput/common/ColorPicker/ColorPicker.js +1 -1
  120. package/dist/ui/f/fields/EditorInput/common/ColorPicker/index.js +1 -1
  121. package/dist/ui/f/fields/EditorInput/common/FontSizeDropDown/FontSizeDropDown.js +1 -1
  122. package/dist/ui/f/fields/EditorInput/common/FontSizeDropDown/index.js +1 -1
  123. package/dist/ui/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.js +1 -1
  124. package/dist/ui/f/fields/EditorInput/common/ToolbarPlugin/index.js +1 -1
  125. package/dist/ui/f/fields/EditorInput/common/index.js +1 -1
  126. package/dist/ui/f/fields/EditorInput/index.js +1 -1
  127. package/dist/ui/f/fields/FileUpload/FileUpload.js +1 -1
  128. package/dist/ui/f/fields/FileUpload/common/Preview/Preview.js +1 -1
  129. package/dist/ui/f/fields/FileUpload/common/Preview/index.js +1 -1
  130. package/dist/ui/f/fields/FileUpload/common/PreviewNewRegistration/PreviewNewRegistration.js +1 -1
  131. package/dist/ui/f/fields/FileUpload/common/PreviewNewRegistration/index.js +1 -1
  132. package/dist/ui/f/fields/FileUpload/common/index.js +1 -1
  133. package/dist/ui/f/fields/FileUpload/index.js +1 -1
  134. package/dist/ui/f/fields/LatexPreviewInput/LatexPreviewInput.js +1 -1
  135. package/dist/ui/f/fields/LatexPreviewInput/index.js +1 -1
  136. package/dist/ui/f/fields/LinkInput/LinkInput.js +1 -1
  137. package/dist/ui/f/fields/LinkInput/index.js +1 -1
  138. package/dist/ui/f/fields/PasswordInput/PasswordInput.js +1 -1
  139. package/dist/ui/f/fields/PasswordInput/index.js +1 -1
  140. package/dist/ui/f/fields/QueryChoices/QueryChoices.js +1 -1
  141. package/dist/ui/f/fields/QueryChoices/index.js +1 -1
  142. package/dist/ui/f/fields/QueryCombobox/QueryCombobox.js +1 -1
  143. package/dist/ui/f/fields/QueryCombobox/common/Combobox/Combobox.js +1 -1
  144. package/dist/ui/f/fields/QueryCombobox/common/Combobox/index.js +1 -1
  145. package/dist/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +1 -1
  146. package/dist/ui/f/fields/QueryCombobox/common/MultipleCombobox/index.js +1 -1
  147. package/dist/ui/f/fields/QueryCombobox/common/index.js +1 -1
  148. package/dist/ui/f/fields/QueryCombobox/index.js +1 -1
  149. package/dist/ui/f/fields/QuerySelect/QuerySelect.js +1 -1
  150. package/dist/ui/f/fields/QuerySelect/index.js +1 -1
  151. package/dist/ui/f/fields/RatingsInput/RatingsInput.js +1 -1
  152. package/dist/ui/f/fields/RatingsInput/index.js +1 -1
  153. package/dist/ui/f/fields/SearchDropdown/SearchDropdown.js +1 -1
  154. package/dist/ui/f/fields/SearchDropdown/index.js +1 -1
  155. package/dist/ui/f/fields/SelectInput/SelectInput.js +1 -1
  156. package/dist/ui/f/fields/SelectInput/common/Menu/Menu.js +1 -1
  157. package/dist/ui/f/fields/SelectInput/common/Menu/index.js +1 -1
  158. package/dist/ui/f/fields/SelectInput/common/Multiple/Multiple.js +1 -1
  159. package/dist/ui/f/fields/SelectInput/common/Multiple/index.js +1 -1
  160. package/dist/ui/f/fields/SelectInput/common/Single/Single.js +1 -1
  161. package/dist/ui/f/fields/SelectInput/common/Single/index.js +1 -1
  162. package/dist/ui/f/fields/SelectInput/common/index.js +1 -1
  163. package/dist/ui/f/fields/SelectInput/index.js +1 -1
  164. package/dist/ui/f/fields/SelectSingle/SelectSingle.js +1 -1
  165. package/dist/ui/f/fields/TextInput/TextInput.js +1 -1
  166. package/dist/ui/f/fields/TextInput/index.js +1 -1
  167. package/dist/ui/f/fields/TextareaInput/TextareaInput.js +1 -1
  168. package/dist/ui/f/fields/TextareaInput/index.js +1 -1
  169. package/dist/ui/f/fields/ToggleInput/ToggleInput.js +1 -1
  170. package/dist/ui/f/fields/ToggleInput/index.js +1 -1
  171. package/dist/ui/f/fields/index.js +1 -1
  172. package/dist/ui/f/index.js +1 -1
  173. package/dist/ui/g/DragAndDrop/DragAndDrop.js +65 -87
  174. package/dist/ui/g/DragAndDrop/common/DraggableItem/DraggableItem.js +29 -53
  175. package/dist/ui/g/DragAndDrop/common/MultiSectionDragAndDrop/MultiSectionDragAndDrop.js +54 -0
  176. package/dist/ui/g/DragAndDrop/common/MultiSectionDragAndDrop/index.js +4 -0
  177. package/dist/ui/g/DragAndDrop/common/SingleListDragAndDrop/SingleListDragAndDrop.js +55 -0
  178. package/dist/ui/g/DragAndDrop/common/SingleListDragAndDrop/index.js +4 -0
  179. package/dist/ui/g/DragAndDrop/common/index.js +6 -2
  180. package/dist/ui/g/DragAndDrop/common/useMultiSectionDragAndDrop.js +36 -0
  181. package/dist/ui/g/DragAndDrop/types.js +1 -0
  182. package/dist/ui/g/ExpandableLexicalPreview/ExpandableLexicalPreview.js +1 -1
  183. package/dist/ui/g/ExpandableLexicalPreview/common/NewWindowPortal/NewWindowPortal.js +1 -1
  184. package/dist/ui/g/ExpandableLexicalPreview/common/NewWindowPortal/index.js +1 -1
  185. package/dist/ui/g/ExpandableLexicalPreview/common/index.js +1 -1
  186. package/dist/ui/g/ExpandableLexicalPreview/index.js +1 -1
  187. package/dist/ui/g/FormBuilder/FormBuilder.js +1 -1
  188. package/dist/ui/g/FormBuilder/common/Builder/Builder.js +1 -1
  189. package/dist/ui/g/FormBuilder/common/Builder/common/ActionsContainer/ActionsContainer.js +1 -1
  190. package/dist/ui/g/FormBuilder/common/Builder/common/ActionsContainer/index.js +1 -1
  191. package/dist/ui/g/FormBuilder/common/Builder/common/AutoQASection/AutoQASection.js +1 -1
  192. package/dist/ui/g/FormBuilder/common/Builder/common/AutoQASection/index.js +1 -1
  193. package/dist/ui/g/FormBuilder/common/Builder/common/InputBuilder/InputBuilder.js +1 -1
  194. package/dist/ui/g/FormBuilder/common/Builder/common/InputBuilder/index.js +1 -1
  195. package/dist/ui/g/FormBuilder/common/Builder/common/Section/Section.js +1 -1
  196. package/dist/ui/g/FormBuilder/common/Builder/common/Section/index.js +1 -1
  197. package/dist/ui/g/FormBuilder/common/Builder/common/index.js +1 -1
  198. package/dist/ui/g/FormBuilder/common/Builder/index.js +1 -1
  199. package/dist/ui/g/FormBuilder/common/Renderer/Renderer.js +1 -1
  200. package/dist/ui/g/FormBuilder/common/Renderer/common/Section/Section.js +1 -1
  201. package/dist/ui/g/FormBuilder/common/Renderer/common/Section/index.js +1 -1
  202. package/dist/ui/g/FormBuilder/common/Renderer/common/index.js +1 -1
  203. package/dist/ui/g/FormBuilder/common/Renderer/index.js +1 -1
  204. package/dist/ui/g/FormBuilder/common/index.js +1 -1
  205. package/dist/ui/g/FormBuilder/index.js +1 -1
  206. package/dist/ui/g/index.js +1 -1
  207. package/dist/ui/index.js +1 -1
  208. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import { j as t, g as o, q as s, E as p, n as r, m as l, l as n, r as u, k as i, Q as d, i as x, R as I, p as f, f as m, e as c, h as g, o as T } from "../../../FormBuilder-CaHio0TV.js";
1
+ import { j as t, g as o, q as s, E as p, n as r, m as l, l as n, r as u, k as i, Q as d, i as x, R as I, p as f, f as m, e as c, h as g, o as T } from "../../../FormBuilder-BeA-ypKe.js";
2
2
  import { default as y } from "./SelectSingle/SelectSingle.js";
3
3
  import { default as S } from "./LatexPreviewInput/convertLatexToHtml.js";
4
4
  import { fileUploadOptions as Q, getFileType as U, getFileTypeFromUrl as b } from "./FileUpload/utils.js";
@@ -1,7 +1,7 @@
1
1
  import { default as a } from "./common/Label/Label.js";
2
2
  import { default as r } from "./common/Description/Description.js";
3
3
  import { default as s } from "./common/CharacterCount/CharacterCount.js";
4
- import { j as l, g as u, q as i, E as m, n as f, D as x, F as d, m as I, l as g, r as F, k as c, Q as h, i as T, R as C, p as D, f as b, e as y, h as S, o as U } from "../../FormBuilder-CaHio0TV.js";
4
+ import { j as l, g as u, q as i, E as m, n as f, D as x, F as d, m as I, l as g, r as F, k as c, Q as h, i as T, R as C, p as D, f as b, e as y, h as S, o as U } from "../../FormBuilder-BeA-ypKe.js";
5
5
  import { lookUpInputValueFromOptions as L } from "./common/utils/lookUpInputValueFromOptions.js";
6
6
  import { integerAndGreaterThanZero as w } from "./common/utils/validators.js";
7
7
  import { default as v } from "./fields/SelectSingle/SelectSingle.js";
@@ -1,92 +1,70 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { useState as g, useEffect as y } from "react";
3
- import { P as e } from "../../../index-CxkFVI6N.js";
4
- import { s as T } from "../../../exports.module-DmUnHWIJ.js";
5
- import f from "./common/DraggableItem/DraggableItem.js";
6
- import '../../../assets/DragAndDrop.css';const j = T.base, q = "drag-and-drop", m = ({
7
- id: u,
8
- className: D,
9
- style: I,
10
- as: b,
11
- onOrderChange: r,
12
- items: o
13
- // ...otherProps
14
- }) => {
15
- const [p, i] = g(o), [N, d] = g(null);
16
- y(() => {
17
- i(o);
18
- }, [o]);
19
- const v = (t, l) => {
20
- t.preventDefault();
21
- const n = t.dataTransfer.getData("text"), s = [...p], [a] = s.splice(n, 1);
22
- s.splice(l, 0, a), i(s), r == null || r(s), d(null);
23
- };
24
- return /* @__PURE__ */ c(
25
- b,
26
- {
27
- id: u,
28
- className: [
29
- j,
30
- q,
31
- D
32
- ].filter((t) => t).join(" "),
33
- style: I,
34
- children: p.map(({
35
- identifier: t,
36
- disabled: l = !1,
37
- ...n
38
- }, s) => /* @__PURE__ */ c(
39
- f,
40
- {
41
- className: N === s && "drag-over",
42
- disabled: l,
43
- onDrop: (a) => v(a, s),
44
- onDragOver: (a) => {
45
- a.preventDefault(), d(s);
46
- },
47
- index: s,
48
- ...n
49
- },
50
- t
51
- ))
52
- }
53
- );
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import "react";
3
+ import { P as r } from "../../../index-CxkFVI6N.js";
4
+ import c from "./common/DraggableItem/DraggableItem.js";
5
+ import f from "./common/SingleListDragAndDrop/SingleListDragAndDrop.js";
6
+ import d from "./common/MultiSectionDragAndDrop/MultiSectionDragAndDrop.js";
7
+ import '../../../assets/DragAndDrop.css';const i = ({
8
+ id: t,
9
+ className: s,
10
+ style: a,
11
+ as: p,
12
+ onOrderChange: o,
13
+ items: l,
14
+ sections: e,
15
+ sectionTitleClassName: g
16
+ }) => Array.isArray(e) && e.length > 0 ? /* @__PURE__ */ n(
17
+ d,
18
+ {
19
+ id: t,
20
+ className: s,
21
+ style: a,
22
+ sections: e,
23
+ sectionTitleClassName: g,
24
+ onOrderChange: o
25
+ }
26
+ ) : /* @__PURE__ */ n(
27
+ f,
28
+ {
29
+ id: t,
30
+ className: s,
31
+ style: a,
32
+ as: p,
33
+ items: l,
34
+ onOrderChange: o
35
+ }
36
+ ), m = r.shape({
37
+ Content: r.elementType.isRequired,
38
+ identifier: r.string.isRequired,
39
+ disabled: r.bool,
40
+ as: r.string
41
+ }), u = r.shape({
42
+ id: r.string.isRequired,
43
+ title: r.string,
44
+ items: r.arrayOf(m).isRequired
45
+ });
46
+ i.propTypes = {
47
+ /** The HTML id for this element */
48
+ id: r.string,
49
+ /** The HTML class names for this element */
50
+ className: r.string,
51
+ /** The React-written, css properties for this element. */
52
+ style: r.objectOf(r.string),
53
+ /** The html element to use to display this component (single-list mode only). */
54
+ as: r.string,
55
+ /** The list of items to be dragged around (single-list mode). Use this OR sections, not both. */
56
+ items: r.arrayOf(m),
57
+ /** Array of sections for multi-section drag and drop mode. Use this OR items, not both. */
58
+ sections: r.arrayOf(u),
59
+ /** Custom class name for section titles (multi-section mode). */
60
+ sectionTitleClassName: r.string,
61
+ /** Callback when items are reordered. Receives items or sections array. */
62
+ onOrderChange: r.func
54
63
  };
55
- m.propTypes = {
56
- /**
57
- * The HTML id for this element
58
- */
59
- id: e.string,
60
- /**
61
- * The HTML class names for this element
62
- */
63
- className: e.string,
64
- /**
65
- * The React-written, css properties for this element.
66
- */
67
- style: e.objectOf(e.string),
68
- /**
69
- * The html element to use to display this component.
70
- */
71
- as: e.string,
72
- /**
73
- * The list of items to be dragged around
74
- */
75
- items: e.arrayOf(e.shape({
76
- Content: e.elementType.isRequired,
77
- identifier: e.string.isRequired,
78
- disabled: e.bool,
79
- as: e.string
80
- })).isRequired,
81
- /*
82
- * A function to be called when the draggable items are re-ordered
83
- */
84
- onOrderChange: e.func
85
- };
86
- m.defaultProps = {
64
+ i.defaultProps = {
87
65
  as: "ul"
88
66
  };
89
- m.DraggableItem = f;
67
+ i.DraggableItem = c;
90
68
  export {
91
- m as default
69
+ i as default
92
70
  };
@@ -1,75 +1,51 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { useState as T, useRef as h } from "react";
3
- import { P as t } from "../../../../../index-CxkFVI6N.js";
4
- import { s as y } from "../../../../../exports.module-DmUnHWIJ.js";
5
- import '../../../../../assets/DraggableItem.css';const C = y.base, P = "draggable-item", o = ({
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { useState as b, useRef as h } from "react";
3
+ import { s as C } from "../../../../../exports.module-DmUnHWIJ.js";
4
+ import '../../../../../assets/DraggableItem.css';const T = C.base, j = "draggable-item", W = ({
6
5
  id: l,
7
6
  className: g,
8
- style: i,
9
- as: c,
10
- Content: f,
11
- index: d,
7
+ style: f,
8
+ as: c = "li",
9
+ Content: i,
10
+ index: e,
11
+ identifier: d,
12
+ sectionId: r,
12
13
  disabled: m = !1,
13
14
  ...p
14
15
  }) => {
15
- const [u, s] = T(!1), a = h(null), D = m ? {} : {
16
+ const [D, n] = b(!1), t = h(null), u = m ? {} : {
16
17
  draggable: !0,
17
- onDragStart: (e) => {
18
- if (s(!0), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", d), a.current) {
19
- const r = a.current.getBoundingClientRect(), b = e.clientX - r.left, N = e.clientY - r.top;
20
- e.dataTransfer.setDragImage(a.current, b, N);
18
+ onDragStart: (a) => {
19
+ if (n(!0), a.dataTransfer.effectAllowed = "move", r ? a.dataTransfer.setData("application/json", JSON.stringify({
20
+ sectionId: r,
21
+ identifier: d,
22
+ index: e
23
+ })) : a.dataTransfer.setData("text/plain", String(e)), t.current) {
24
+ const s = t.current.getBoundingClientRect(), N = a.clientX - s.left, S = a.clientY - s.top;
25
+ a.dataTransfer.setDragImage(t.current, N, S);
21
26
  }
22
27
  },
23
28
  onDragEnd: () => {
24
- s(!1);
29
+ n(!1);
25
30
  }
26
31
  };
27
- return /* @__PURE__ */ n(
32
+ return /* @__PURE__ */ o(
28
33
  c,
29
34
  {
30
- ref: a,
35
+ ref: t,
31
36
  id: l,
32
37
  className: [
33
- C,
34
- P,
38
+ T,
39
+ j,
35
40
  g,
36
- u && "dragging"
37
- ].filter((e) => e).join(" "),
38
- style: i,
41
+ D && "dragging"
42
+ ].filter((a) => a).join(" "),
43
+ style: f,
39
44
  ...p,
40
- children: /* @__PURE__ */ n(f, { ...D })
45
+ children: /* @__PURE__ */ o(i, { ...u })
41
46
  }
42
47
  );
43
48
  };
44
- o.propTypes = {
45
- /**
46
- * The HTML id for this element
47
- */
48
- id: t.string,
49
- /**
50
- * The HTML class names for this element
51
- */
52
- className: t.string,
53
- /**
54
- * The React-written, css properties for this element.
55
- */
56
- style: t.objectOf(t.string),
57
- /**
58
- * Component that receives dragHandleProps
59
- */
60
- Content: t.elementType.isRequired,
61
- /**
62
- * The html element to use to display this component.
63
- */
64
- as: t.string,
65
- /**
66
- * Whether dragging is disabled for this item
67
- */
68
- disabled: t.bool
69
- };
70
- o.defaultProps = {
71
- as: "li"
72
- };
73
49
  export {
74
- o as default
50
+ W as default
75
51
  };
@@ -0,0 +1,54 @@
1
+ import { jsx as r, jsxs as N } from "react/jsx-runtime";
2
+ import { s as h } from "../../../../../exports.module-DmUnHWIJ.js";
3
+ import u from "../DraggableItem/DraggableItem.js";
4
+ import v from "../useMultiSectionDragAndDrop.js";
5
+ const b = h.base, j = "multi-section-drag-and-drop", A = ({
6
+ id: s,
7
+ className: i,
8
+ style: m,
9
+ sections: n,
10
+ sectionTitleClassName: d,
11
+ onOrderChange: p
12
+ }) => {
13
+ const {
14
+ sectionState: c,
15
+ handleDragOver: t,
16
+ handleDrop: o
17
+ } = v({ sections: n, onOrderChange: p });
18
+ return /* @__PURE__ */ r(
19
+ "div",
20
+ {
21
+ id: s,
22
+ className: [b, j, i].filter(Boolean).join(" "),
23
+ style: m,
24
+ children: c.map((a) => /* @__PURE__ */ N(
25
+ "div",
26
+ {
27
+ className: "droppable-section",
28
+ onDragOver: t,
29
+ onDrop: (e) => o(e, a.id),
30
+ children: [
31
+ a.title && (typeof a.title == "string" ? /* @__PURE__ */ r("p", { className: ["section-title", d].filter(Boolean).join(" "), children: a.title }) : a.title),
32
+ /* @__PURE__ */ r("div", { className: "section-items", children: a.items.map(({ identifier: e, disabled: D = !1, ...g }, l) => /* @__PURE__ */ r(
33
+ u,
34
+ {
35
+ disabled: D,
36
+ index: l,
37
+ identifier: e,
38
+ sectionId: a.id,
39
+ onDrop: (f) => o(f, a.id, l),
40
+ onDragOver: t,
41
+ ...g
42
+ },
43
+ `${a.id}-${e}`
44
+ )) })
45
+ ]
46
+ },
47
+ a.id
48
+ ))
49
+ }
50
+ );
51
+ };
52
+ export {
53
+ A as default
54
+ };
@@ -0,0 +1,4 @@
1
+ import { default as t } from "./MultiSectionDragAndDrop.js";
2
+ export {
3
+ t as MultiSectionDragAndDrop
4
+ };
@@ -0,0 +1,55 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { useState as d, useEffect as N } from "react";
3
+ import { s as b } from "../../../../../exports.module-DmUnHWIJ.js";
4
+ import v from "../DraggableItem/DraggableItem.js";
5
+ const x = b.base, j = "single-list-drag-and-drop", L = ({
6
+ id: f,
7
+ className: g,
8
+ style: D,
9
+ as: u = "ul",
10
+ items: a,
11
+ onOrderChange: r
12
+ }) => {
13
+ const [m, n] = d(a), [I, p] = d(null);
14
+ N(() => {
15
+ n(a);
16
+ }, [a]);
17
+ const i = (t, o) => {
18
+ t.preventDefault();
19
+ const l = Number(t.dataTransfer.getData("text")), e = [...m], [s] = e.splice(l, 1);
20
+ e.splice(o, 0, s), n(e), r == null || r(e), p(null);
21
+ };
22
+ return /* @__PURE__ */ c(
23
+ u,
24
+ {
25
+ id: f,
26
+ className: [
27
+ x,
28
+ j,
29
+ g
30
+ ].filter((t) => t).join(" "),
31
+ style: D,
32
+ children: m.map(({
33
+ identifier: t,
34
+ disabled: o = !1,
35
+ ...l
36
+ }, e) => /* @__PURE__ */ c(
37
+ v,
38
+ {
39
+ className: I === e && "drag-over",
40
+ disabled: o,
41
+ onDrop: (s) => i(s, e),
42
+ onDragOver: (s) => {
43
+ s.preventDefault(), p(e);
44
+ },
45
+ index: e,
46
+ ...l
47
+ },
48
+ t
49
+ ))
50
+ }
51
+ );
52
+ };
53
+ export {
54
+ L as default
55
+ };
@@ -0,0 +1,4 @@
1
+ import { default as e } from "./SingleListDragAndDrop.js";
2
+ export {
3
+ e as SingleListDragAndDrop
4
+ };
@@ -1,4 +1,8 @@
1
- import { default as r } from "./DraggableItem/DraggableItem.js";
1
+ import { default as e } from "./DraggableItem/DraggableItem.js";
2
+ import { default as o } from "./SingleListDragAndDrop/SingleListDragAndDrop.js";
3
+ import { default as l } from "./MultiSectionDragAndDrop/MultiSectionDragAndDrop.js";
2
4
  export {
3
- r as DraggableItem
5
+ e as DraggableItem,
6
+ l as MultiSectionDragAndDrop,
7
+ o as SingleListDragAndDrop
4
8
  };
@@ -0,0 +1,36 @@
1
+ import { useState as x, useEffect as I, useCallback as v } from "react";
2
+ const N = ({
3
+ sections: c,
4
+ onOrderChange: i
5
+ }) => {
6
+ const [n, l] = x(c || []);
7
+ I(() => {
8
+ l(c || []);
9
+ }, [c]);
10
+ const S = v((s) => {
11
+ s.preventDefault();
12
+ }, []), b = v((s, o, f) => {
13
+ if (s.preventDefault(), s.stopPropagation(), f === void 0 && s.target.closest(".draggable-item"))
14
+ return;
15
+ const u = s.dataTransfer.getData("application/json");
16
+ if (!u) return;
17
+ const { sectionId: r, index: m } = JSON.parse(u), e = n.find((t) => t.id === o), p = f ?? (e == null ? void 0 : e.items.length) ?? 0;
18
+ if (r === o && m === p || f === void 0 && r === o && e && m === e.items.length - 1)
19
+ return;
20
+ const a = n.map((t) => ({
21
+ ...t,
22
+ items: [...t.items]
23
+ })), d = a.find((t) => t.id === r), D = a.find((t) => t.id === o);
24
+ if (!d || !D) return;
25
+ const [w] = d.items.splice(m, 1);
26
+ D.items.splice(p, 0, w), l(a), i == null || i(a);
27
+ }, [n, i]);
28
+ return {
29
+ sectionState: n,
30
+ handleDragOver: S,
31
+ handleDrop: b
32
+ };
33
+ };
34
+ export {
35
+ N as default
36
+ };
@@ -0,0 +1 @@
1
+
@@ -6,7 +6,7 @@ import "../../../exports.module-DmUnHWIJ.js";
6
6
  import "../../f/common/Label/Label.js";
7
7
  import "../../f/common/Description/Description.js";
8
8
  import "../../f/common/CharacterCount/CharacterCount.js";
9
- import { s as V } from "../../../FormBuilder-CaHio0TV.js";
9
+ import { s as V } from "../../../FormBuilder-BeA-ypKe.js";
10
10
  import "../../f/fields/QueryCombobox/common/Menu/Menu.js";
11
11
  import "../../../debounce-Cm69Z_cF.js";
12
12
  import "../../a/AppContext/Context.js";
@@ -6,7 +6,7 @@ import "../../../../a/AppContext/Context.js";
6
6
  import "../../../../a/AppContext/ContextProvider.js";
7
7
  import "../../../../a/AppContext/useTheme.js";
8
8
  import "../../../../a/BlurOverlay/BlurOverlay.js";
9
- import { H as N } from "../../../../../FormBuilder-CaHio0TV.js";
9
+ import { H as N } from "../../../../../FormBuilder-BeA-ypKe.js";
10
10
  import "../../../../a/Conversation/Context.js";
11
11
  import "../../../../a/DotInfo/DotInfo.js";
12
12
  import "../../../../a/Figure/Figure.js";
@@ -1,4 +1,4 @@
1
- import { H as a } from "../../../../../FormBuilder-CaHio0TV.js";
1
+ import { H as a } from "../../../../../FormBuilder-BeA-ypKe.js";
2
2
  export {
3
3
  a as NewWindowPortal
4
4
  };
@@ -1,4 +1,4 @@
1
- import { H as a } from "../../../../FormBuilder-CaHio0TV.js";
1
+ import { H as a } from "../../../../FormBuilder-BeA-ypKe.js";
2
2
  export {
3
3
  a as NewWindowPortal
4
4
  };
@@ -1,4 +1,4 @@
1
- import { s as r } from "../../../FormBuilder-CaHio0TV.js";
1
+ import { s as r } from "../../../FormBuilder-BeA-ypKe.js";
2
2
  export {
3
3
  r as ExpandableLexicalPreview
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { t as a } from "../../../FormBuilder-CaHio0TV.js";
2
+ import { t as a } from "../../../FormBuilder-BeA-ypKe.js";
3
3
  import "react";
4
4
  import "../../../index-CxkFVI6N.js";
5
5
  import "../../../exports.module-DmUnHWIJ.js";
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { u as V } from "../../../../../FormBuilder-CaHio0TV.js";
2
+ import { u as V } from "../../../../../FormBuilder-BeA-ypKe.js";
3
3
  import "react";
4
4
  import "formik";
5
5
  import "../../../../../index-CxkFVI6N.js";
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../../../../../../index-CxkFVI6N.js";
4
4
  import "../../../../../../../exports.module-DmUnHWIJ.js";
5
- import { z as P } from "../../../../../../../FormBuilder-CaHio0TV.js";
5
+ import { z as P } from "../../../../../../../FormBuilder-BeA-ypKe.js";
6
6
  import "../../../../../../../debounce-Cm69Z_cF.js";
7
7
  import "../../../../../../../throttle-BCrS-Wew.js";
8
8
  import "../../../../../../utils/hooks/useOutsideClick.js";
@@ -1,4 +1,4 @@
1
- import { z as r } from "../../../../../../../FormBuilder-CaHio0TV.js";
1
+ import { z as r } from "../../../../../../../FormBuilder-BeA-ypKe.js";
2
2
  export {
3
3
  r as ActionsContainer
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { G as L } from "../../../../../../../FormBuilder-CaHio0TV.js";
2
+ import { G as L } from "../../../../../../../FormBuilder-BeA-ypKe.js";
3
3
  import "../../../../../../a/AppContext/Context.js";
4
4
  import "../../../../../../a/AppContext/ContextProvider.js";
5
5
  import "react";
@@ -1,4 +1,4 @@
1
- import { G as e } from "../../../../../../../FormBuilder-CaHio0TV.js";
1
+ import { G as e } from "../../../../../../../FormBuilder-BeA-ypKe.js";
2
2
  export {
3
3
  e as AutoQASection
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { I as W } from "../../../../../../../FormBuilder-CaHio0TV.js";
2
+ import { I as W } from "../../../../../../../FormBuilder-BeA-ypKe.js";
3
3
  import "react";
4
4
  import "../../../../../../f/common/Label/Label.js";
5
5
  import "../../../../../../f/common/Description/Description.js";
@@ -1,4 +1,4 @@
1
- import { I as o } from "../../../../../../../FormBuilder-CaHio0TV.js";
1
+ import { I as o } from "../../../../../../../FormBuilder-BeA-ypKe.js";
2
2
  export {
3
3
  o as InputBuilder
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { x as W, y as X } from "../../../../../../../FormBuilder-CaHio0TV.js";
2
+ import { x as W, y as X } from "../../../../../../../FormBuilder-BeA-ypKe.js";
3
3
  import "react";
4
4
  import "../../../../../../f/common/Label/Label.js";
5
5
  import "../../../../../../f/common/Description/Description.js";
@@ -1,4 +1,4 @@
1
- import { x as o, y as t } from "../../../../../../../FormBuilder-CaHio0TV.js";
1
+ import { x as o, y as t } from "../../../../../../../FormBuilder-BeA-ypKe.js";
2
2
  export {
3
3
  o as Section,
4
4
  t as getRandomIntInclusive
@@ -1,4 +1,4 @@
1
- import { z as o, G as a, I as e, x as s, y as i } from "../../../../../../FormBuilder-CaHio0TV.js";
1
+ import { z as o, G as a, I as e, x as s, y as i } from "../../../../../../FormBuilder-BeA-ypKe.js";
2
2
  export {
3
3
  o as ActionsContainer,
4
4
  a as AutoQASection,
@@ -1,4 +1,4 @@
1
- import { u as o } from "../../../../../FormBuilder-CaHio0TV.js";
1
+ import { u as o } from "../../../../../FormBuilder-BeA-ypKe.js";
2
2
  export {
3
3
  o as Builder
4
4
  };
@@ -3,7 +3,7 @@ import "react";
3
3
  import "formik";
4
4
  import "../../../../../index-CxkFVI6N.js";
5
5
  import "../../../../../exports.module-DmUnHWIJ.js";
6
- import { v as d } from "../../../../../FormBuilder-CaHio0TV.js";
6
+ import { v as d } from "../../../../../FormBuilder-BeA-ypKe.js";
7
7
  import "../../../../b/Page/Context.js";
8
8
  import "../../../../b/Title/Title.js";
9
9
  export {
@@ -6,7 +6,7 @@ import "../../../../../../f/common/Description/Description.js";
6
6
  import "formik";
7
7
  import "../../../../../../../exports.module-DmUnHWIJ.js";
8
8
  import "../../../../../../f/common/CharacterCount/CharacterCount.js";
9
- import { w as X } from "../../../../../../../FormBuilder-CaHio0TV.js";
9
+ import { w as X } from "../../../../../../../FormBuilder-BeA-ypKe.js";
10
10
  import "../../../../../../f/fields/QueryCombobox/common/Menu/Menu.js";
11
11
  import "../../../../../../../debounce-Cm69Z_cF.js";
12
12
  import "../../../../../../a/AppContext/Context.js";
@@ -1,4 +1,4 @@
1
- import { w as r } from "../../../../../../../FormBuilder-CaHio0TV.js";
1
+ import { w as r } from "../../../../../../../FormBuilder-BeA-ypKe.js";
2
2
  export {
3
3
  r as Section
4
4
  };
@@ -1,4 +1,4 @@
1
- import { w as r } from "../../../../../../FormBuilder-CaHio0TV.js";
1
+ import { w as r } from "../../../../../../FormBuilder-BeA-ypKe.js";
2
2
  export {
3
3
  r as Section
4
4
  };
@@ -1,4 +1,4 @@
1
- import { v as o } from "../../../../../FormBuilder-CaHio0TV.js";
1
+ import { v as o } from "../../../../../FormBuilder-BeA-ypKe.js";
2
2
  export {
3
3
  o as Renderer
4
4
  };
@@ -1,4 +1,4 @@
1
- import { u as a, v as d } from "../../../../FormBuilder-CaHio0TV.js";
1
+ import { u as a, v as d } from "../../../../FormBuilder-BeA-ypKe.js";
2
2
  export {
3
3
  a as Builder,
4
4
  d as Renderer