@micromerce/formbuilder-react 1.0.651 → 1.0.656

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 (532) hide show
  1. package/dist/components/Checkbox/Checkbox.module.scss +10 -0
  2. package/dist/components/FormBuilder/FormBuilder.module.scss +94 -0
  3. package/dist/components/FormFooter/FormFooter.module.scss +65 -0
  4. package/dist/components/FormGroup/FormGroup.module.scss +69 -0
  5. package/dist/components/FormList/FormList.module.scss +173 -0
  6. package/dist/components/Group/Group.module.scss +28 -0
  7. package/dist/components/Input/Input.module.scss +3 -0
  8. package/dist/components/InputFreeSolo/InputFreeSolo.module.scss +29 -0
  9. package/dist/components/MrnInput/MrnInput.module.scss +31 -0
  10. package/dist/components/MultiSelect/MultiSelect.module.scss +13 -0
  11. package/dist/components/PasswordInput/PasswordInput.module.scss +26 -0
  12. package/dist/components/Select/Select.module.scss +15 -0
  13. package/dist/components/Textarea/Textarea.module.scss +14 -0
  14. package/dist/components/addressGroup/AddressGroup.module.scss +72 -0
  15. package/dist/src/assets/icons/error/Error.d.ts +2 -0
  16. package/dist/src/assets/icons/error/Error.js +6 -0
  17. package/dist/src/assets/icons/error/Error.js.map +1 -0
  18. package/dist/src/components/Checkbox/Checkbox.d.ts +10 -0
  19. package/dist/src/components/Checkbox/Checkbox.js +37 -0
  20. package/dist/src/components/Checkbox/Checkbox.js.map +1 -0
  21. package/dist/src/components/Checkbox/index.d.ts +1 -0
  22. package/dist/src/components/Checkbox/index.js +2 -0
  23. package/dist/src/components/Checkbox/index.js.map +1 -0
  24. package/dist/src/components/ControlWrapper/ControlWrapper.d.ts +11 -0
  25. package/dist/src/components/ControlWrapper/ControlWrapper.js +37 -0
  26. package/dist/src/components/ControlWrapper/ControlWrapper.js.map +1 -0
  27. package/dist/src/components/ControlWrapper/index.d.ts +1 -0
  28. package/dist/src/components/ControlWrapper/index.js +2 -0
  29. package/dist/src/components/ControlWrapper/index.js.map +1 -0
  30. package/dist/src/components/DateRangeGroup/DateRangeGroup.d.ts +10 -0
  31. package/dist/src/components/DateRangeGroup/DateRangeGroup.js +69 -0
  32. package/dist/src/components/DateRangeGroup/DateRangeGroup.js.map +1 -0
  33. package/dist/src/components/DateRangeGroup/DateRangeGroup.styles.d.ts +3 -0
  34. package/dist/src/components/DateRangeGroup/DateRangeGroup.styles.js +59 -0
  35. package/dist/src/components/DateRangeGroup/DateRangeGroup.styles.js.map +1 -0
  36. package/dist/src/components/DateRangeGroup/components/CalendarModal.d.ts +14 -0
  37. package/dist/src/components/DateRangeGroup/components/CalendarModal.js +90 -0
  38. package/dist/src/components/DateRangeGroup/components/CalendarModal.js.map +1 -0
  39. package/dist/src/components/DateRangeGroup/index.d.ts +1 -0
  40. package/dist/src/components/DateRangeGroup/index.js +2 -0
  41. package/dist/src/components/DateRangeGroup/index.js.map +1 -0
  42. package/dist/src/components/ErrorBoundary/ErrorBoundary.d.ts +14 -0
  43. package/dist/src/components/ErrorBoundary/ErrorBoundary.js +22 -0
  44. package/dist/src/components/ErrorBoundary/ErrorBoundary.js.map +1 -0
  45. package/dist/src/components/FileUploader/FileUploader.d.ts +9 -0
  46. package/dist/src/components/FileUploader/FileUploader.js +30 -0
  47. package/dist/src/components/FileUploader/FileUploader.js.map +1 -0
  48. package/dist/src/components/FileUploader/index.d.ts +1 -0
  49. package/dist/src/components/FileUploader/index.js +2 -0
  50. package/dist/src/components/FileUploader/index.js.map +1 -0
  51. package/dist/src/components/FormBuilder/FormBuilder.d.ts +25 -0
  52. package/dist/src/components/FormBuilder/FormBuilder.js +74 -0
  53. package/dist/src/components/FormBuilder/FormBuilder.js.map +1 -0
  54. package/dist/src/components/FormBuilder/index.d.ts +1 -0
  55. package/dist/src/components/FormBuilder/index.js +2 -0
  56. package/dist/src/components/FormBuilder/index.js.map +1 -0
  57. package/dist/src/components/FormBuilder/utils/extractFormControlValues/extractFormControlValues.d.ts +6 -0
  58. package/dist/src/components/FormBuilder/utils/extractFormControlValues/extractFormControlValues.js +50 -0
  59. package/dist/src/components/FormBuilder/utils/extractFormControlValues/extractFormControlValues.js.map +1 -0
  60. package/dist/src/components/FormBuilder/utils/extractFormControlValues/index.d.ts +1 -0
  61. package/dist/src/components/FormBuilder/utils/extractFormControlValues/index.js +2 -0
  62. package/dist/src/components/FormBuilder/utils/extractFormControlValues/index.js.map +1 -0
  63. package/dist/src/components/FormBuilder/utils/jsonToUrlEncoded/index.d.ts +1 -0
  64. package/dist/src/components/FormBuilder/utils/jsonToUrlEncoded/index.js +2 -0
  65. package/dist/src/components/FormBuilder/utils/jsonToUrlEncoded/index.js.map +1 -0
  66. package/dist/src/components/FormBuilder/utils/jsonToUrlEncoded/jsonToUrlEncoded.d.ts +5 -0
  67. package/dist/src/components/FormBuilder/utils/jsonToUrlEncoded/jsonToUrlEncoded.js +15 -0
  68. package/dist/src/components/FormBuilder/utils/jsonToUrlEncoded/jsonToUrlEncoded.js.map +1 -0
  69. package/dist/src/components/FormFooter/FormFooter.d.ts +15 -0
  70. package/dist/src/components/FormFooter/FormFooter.js +46 -0
  71. package/dist/src/components/FormFooter/FormFooter.js.map +1 -0
  72. package/dist/src/components/FormFooter/components/Switch.d.ts +1 -0
  73. package/dist/src/components/FormFooter/components/Switch.js +15 -0
  74. package/dist/src/components/FormFooter/components/Switch.js.map +1 -0
  75. package/dist/src/components/FormFooter/index.d.ts +1 -0
  76. package/dist/src/components/FormFooter/index.js +2 -0
  77. package/dist/src/components/FormFooter/index.js.map +1 -0
  78. package/dist/src/components/FormGroup/FormGroup.d.ts +15 -0
  79. package/dist/src/components/FormGroup/FormGroup.js +18 -0
  80. package/dist/src/components/FormGroup/FormGroup.js.map +1 -0
  81. package/dist/src/components/FormGroup/index.d.ts +1 -0
  82. package/dist/src/components/FormGroup/index.js +2 -0
  83. package/dist/src/components/FormGroup/index.js.map +1 -0
  84. package/dist/src/components/FormList/FormList.d.ts +11 -0
  85. package/dist/src/components/FormList/FormList.js +66 -0
  86. package/dist/src/components/FormList/FormList.js.map +1 -0
  87. package/dist/src/components/FormList/index.d.ts +1 -0
  88. package/dist/src/components/FormList/index.js +2 -0
  89. package/dist/src/components/FormList/index.js.map +1 -0
  90. package/dist/src/components/GeneralFormGroup/GeneralFormGroup.d.ts +5 -0
  91. package/dist/src/components/GeneralFormGroup/GeneralFormGroup.js +4 -0
  92. package/dist/src/components/GeneralFormGroup/GeneralFormGroup.js.map +1 -0
  93. package/dist/src/components/GeneralFormGroup/index.d.ts +1 -0
  94. package/dist/src/components/GeneralFormGroup/index.js +2 -0
  95. package/dist/src/components/GeneralFormGroup/index.js.map +1 -0
  96. package/dist/src/components/Group/Group.d.ts +12 -0
  97. package/dist/src/components/Group/Group.js +32 -0
  98. package/dist/src/components/Group/Group.js.map +1 -0
  99. package/dist/src/components/Group/index.d.ts +1 -0
  100. package/dist/src/components/Group/index.js +2 -0
  101. package/dist/src/components/Group/index.js.map +1 -0
  102. package/dist/src/components/Input/Input.d.ts +14 -0
  103. package/dist/src/components/Input/Input.js +57 -0
  104. package/dist/src/components/Input/Input.js.map +1 -0
  105. package/dist/src/components/Input/index.d.ts +1 -0
  106. package/dist/src/components/Input/index.js +2 -0
  107. package/dist/src/components/Input/index.js.map +1 -0
  108. package/dist/src/components/Input/input.styles.d.ts +9 -0
  109. package/dist/src/components/Input/input.styles.js +24 -0
  110. package/dist/src/components/Input/input.styles.js.map +1 -0
  111. package/dist/src/components/InputFreeSolo/InputFreeSolo.d.ts +10 -0
  112. package/dist/src/components/InputFreeSolo/InputFreeSolo.js +67 -0
  113. package/dist/src/components/InputFreeSolo/InputFreeSolo.js.map +1 -0
  114. package/dist/src/components/InputFreeSolo/index.d.ts +1 -0
  115. package/dist/src/components/InputFreeSolo/index.js +2 -0
  116. package/dist/src/components/InputFreeSolo/index.js.map +1 -0
  117. package/dist/src/components/MrnInput/MrnInput.d.ts +11 -0
  118. package/dist/src/components/MrnInput/MrnInput.js +64 -0
  119. package/dist/src/components/MrnInput/MrnInput.js.map +1 -0
  120. package/dist/src/components/MrnInput/hooks/useMrn.d.ts +21 -0
  121. package/dist/src/components/MrnInput/hooks/useMrn.js +92 -0
  122. package/dist/src/components/MrnInput/hooks/useMrn.js.map +1 -0
  123. package/dist/src/components/MrnInput/index.d.ts +1 -0
  124. package/dist/src/components/MrnInput/index.js +2 -0
  125. package/dist/src/components/MrnInput/index.js.map +1 -0
  126. package/dist/src/components/MrnInput/services/fetchMrn.d.ts +3 -0
  127. package/dist/src/components/MrnInput/services/fetchMrn.js +30 -0
  128. package/dist/src/components/MrnInput/services/fetchMrn.js.map +1 -0
  129. package/dist/src/components/MrnInput/ui-helper/Link/Link.d.ts +3 -0
  130. package/dist/src/components/MrnInput/ui-helper/Link/Link.js +15 -0
  131. package/dist/src/components/MrnInput/ui-helper/Link/Link.js.map +1 -0
  132. package/dist/src/components/MrnInput/utils/mrnUtils/mrnUtils.d.ts +8 -0
  133. package/dist/src/components/MrnInput/utils/mrnUtils/mrnUtils.js +35 -0
  134. package/dist/src/components/MrnInput/utils/mrnUtils/mrnUtils.js.map +1 -0
  135. package/dist/src/components/MrnInput/utils/resolveMrnLinks/resolveMrnLink.d.ts +2 -0
  136. package/dist/src/components/MrnInput/utils/resolveMrnLinks/resolveMrnLink.js +11 -0
  137. package/dist/src/components/MrnInput/utils/resolveMrnLinks/resolveMrnLink.js.map +1 -0
  138. package/dist/src/components/MrnInput/utils/resolveNestedQueryLink/resolveNestedQueryLink.d.ts +2 -0
  139. package/dist/src/components/MrnInput/utils/resolveNestedQueryLink/resolveNestedQueryLink.js +19 -0
  140. package/dist/src/components/MrnInput/utils/resolveNestedQueryLink/resolveNestedQueryLink.js.map +1 -0
  141. package/dist/src/components/MrnInput/utils/urlSearchParam/urlSearchParam.d.ts +1 -0
  142. package/dist/src/components/MrnInput/utils/urlSearchParam/urlSearchParam.js +8 -0
  143. package/dist/src/components/MrnInput/utils/urlSearchParam/urlSearchParam.js.map +1 -0
  144. package/dist/src/components/MultiSelect/MultiSelect.d.ts +17 -0
  145. package/dist/src/components/MultiSelect/MultiSelect.js +61 -0
  146. package/dist/src/components/MultiSelect/MultiSelect.js.map +1 -0
  147. package/dist/src/components/MultiSelect/index.d.ts +1 -0
  148. package/dist/src/components/MultiSelect/index.js +2 -0
  149. package/dist/src/components/MultiSelect/index.js.map +1 -0
  150. package/dist/src/components/MultiSelect/utils/extractSelectedOptionValues/extractSelectedOptionValues.d.ts +24 -0
  151. package/dist/src/components/MultiSelect/utils/extractSelectedOptionValues/extractSelectedOptionValues.js +21 -0
  152. package/dist/src/components/MultiSelect/utils/extractSelectedOptionValues/extractSelectedOptionValues.js.map +1 -0
  153. package/dist/src/components/MultiSelect/utils/extractSelectedOptionValues/index.d.ts +1 -0
  154. package/dist/src/components/MultiSelect/utils/extractSelectedOptionValues/index.js +2 -0
  155. package/dist/src/components/MultiSelect/utils/extractSelectedOptionValues/index.js.map +1 -0
  156. package/dist/src/components/PasswordInput/PasswordInput.d.ts +12 -0
  157. package/dist/src/components/PasswordInput/PasswordInput.js +21 -0
  158. package/dist/src/components/PasswordInput/PasswordInput.js.map +1 -0
  159. package/dist/src/components/PasswordInput/index.d.ts +1 -0
  160. package/dist/src/components/PasswordInput/index.js +2 -0
  161. package/dist/src/components/PasswordInput/index.js.map +1 -0
  162. package/dist/src/components/QueryControl/QueryControl.d.ts +13 -0
  163. package/dist/src/components/QueryControl/QueryControl.js +95 -0
  164. package/dist/src/components/QueryControl/QueryControl.js.map +1 -0
  165. package/dist/src/components/QueryControl/data/defaultControls.d.ts +9 -0
  166. package/dist/src/components/QueryControl/data/defaultControls.js +95 -0
  167. package/dist/src/components/QueryControl/data/defaultControls.js.map +1 -0
  168. package/dist/src/components/QueryControl/index.d.ts +1 -0
  169. package/dist/src/components/QueryControl/index.js +2 -0
  170. package/dist/src/components/QueryControl/index.js.map +1 -0
  171. package/dist/src/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.d.ts +8 -0
  172. package/dist/src/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.js +8 -0
  173. package/dist/src/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.js.map +1 -0
  174. package/dist/src/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.styles.d.ts +6 -0
  175. package/dist/src/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.styles.js +14 -0
  176. package/dist/src/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.styles.js.map +1 -0
  177. package/dist/src/components/QueryControl/ui-helper/Wrapper/index.d.ts +1 -0
  178. package/dist/src/components/QueryControl/ui-helper/Wrapper/index.js +2 -0
  179. package/dist/src/components/QueryControl/ui-helper/Wrapper/index.js.map +1 -0
  180. package/dist/src/components/QueryControl/utils/allControlsHidden/allControlsHidden.d.ts +3 -0
  181. package/dist/src/components/QueryControl/utils/allControlsHidden/allControlsHidden.js +39 -0
  182. package/dist/src/components/QueryControl/utils/allControlsHidden/allControlsHidden.js.map +1 -0
  183. package/dist/src/components/QueryControl/utils/allControlsHidden/index.d.ts +1 -0
  184. package/dist/src/components/QueryControl/utils/allControlsHidden/index.js +2 -0
  185. package/dist/src/components/QueryControl/utils/allControlsHidden/index.js.map +1 -0
  186. package/dist/src/components/QueryControl/utils/getMatchingControls.d.ts +9 -0
  187. package/dist/src/components/QueryControl/utils/getMatchingControls.js +19 -0
  188. package/dist/src/components/QueryControl/utils/getMatchingControls.js.map +1 -0
  189. package/dist/src/components/QueryControl/utils/hasExpertControl/hasExpertControl.d.ts +3 -0
  190. package/dist/src/components/QueryControl/utils/hasExpertControl/hasExpertControl.js +38 -0
  191. package/dist/src/components/QueryControl/utils/hasExpertControl/hasExpertControl.js.map +1 -0
  192. package/dist/src/components/QueryControl/utils/hasExpertControl/index.d.ts +1 -0
  193. package/dist/src/components/QueryControl/utils/hasExpertControl/index.js +2 -0
  194. package/dist/src/components/QueryControl/utils/hasExpertControl/index.js.map +1 -0
  195. package/dist/src/components/QueryControl/utils/hideGroup/hideGroup.d.ts +3 -0
  196. package/dist/src/components/QueryControl/utils/hideGroup/hideGroup.js +9 -0
  197. package/dist/src/components/QueryControl/utils/hideGroup/hideGroup.js.map +1 -0
  198. package/dist/src/components/QueryControl/utils/hideGroup/index.d.ts +1 -0
  199. package/dist/src/components/QueryControl/utils/hideGroup/index.js +2 -0
  200. package/dist/src/components/QueryControl/utils/hideGroup/index.js.map +1 -0
  201. package/dist/src/components/Select/Select.d.ts +12 -0
  202. package/dist/src/components/Select/Select.js +67 -0
  203. package/dist/src/components/Select/Select.js.map +1 -0
  204. package/dist/src/components/Select/index.d.ts +1 -0
  205. package/dist/src/components/Select/index.js +2 -0
  206. package/dist/src/components/Select/index.js.map +1 -0
  207. package/dist/src/components/Select/utils/getSelectedOption.d.ts +3 -0
  208. package/dist/src/components/Select/utils/getSelectedOption.js +8 -0
  209. package/dist/src/components/Select/utils/getSelectedOption.js.map +1 -0
  210. package/dist/src/components/Textarea/Textarea.d.ts +10 -0
  211. package/dist/src/components/Textarea/Textarea.js +55 -0
  212. package/dist/src/components/Textarea/Textarea.js.map +1 -0
  213. package/dist/src/components/Textarea/Textarea.types.d.ts +12 -0
  214. package/dist/src/components/Textarea/Textarea.types.js +2 -0
  215. package/dist/src/components/Textarea/Textarea.types.js.map +1 -0
  216. package/dist/src/components/Textarea/aiWrapper/aiAction.d.ts +12 -0
  217. package/dist/src/components/Textarea/aiWrapper/aiAction.js +21 -0
  218. package/dist/src/components/Textarea/aiWrapper/aiAction.js.map +1 -0
  219. package/dist/src/components/Textarea/aiWrapper/aiLayout.d.ts +10 -0
  220. package/dist/src/components/Textarea/aiWrapper/aiLayout.js +21 -0
  221. package/dist/src/components/Textarea/aiWrapper/aiLayout.js.map +1 -0
  222. package/dist/src/components/Textarea/aiWrapper/index.d.ts +11 -0
  223. package/dist/src/components/Textarea/aiWrapper/index.js +29 -0
  224. package/dist/src/components/Textarea/aiWrapper/index.js.map +1 -0
  225. package/dist/src/components/Textarea/aiWrapper/useAi.d.ts +21 -0
  226. package/dist/src/components/Textarea/aiWrapper/useAi.js +74 -0
  227. package/dist/src/components/Textarea/aiWrapper/useAi.js.map +1 -0
  228. package/dist/src/components/Textarea/editors/Default.d.ts +13 -0
  229. package/dist/src/components/Textarea/editors/Default.js +26 -0
  230. package/dist/src/components/Textarea/editors/Default.js.map +1 -0
  231. package/dist/src/components/Textarea/editors/Html.d.ts +10 -0
  232. package/dist/src/components/Textarea/editors/Html.js +9 -0
  233. package/dist/src/components/Textarea/editors/Html.js.map +1 -0
  234. package/dist/src/components/Textarea/editors/Json.d.ts +10 -0
  235. package/dist/src/components/Textarea/editors/Json.js +9 -0
  236. package/dist/src/components/Textarea/editors/Json.js.map +1 -0
  237. package/dist/src/components/Textarea/editors/Markdown.d.ts +10 -0
  238. package/dist/src/components/Textarea/editors/Markdown.js +20 -0
  239. package/dist/src/components/Textarea/editors/Markdown.js.map +1 -0
  240. package/dist/src/components/Textarea/editors/Richtext.d.ts +12 -0
  241. package/dist/src/components/Textarea/editors/Richtext.js +13 -0
  242. package/dist/src/components/Textarea/editors/Richtext.js.map +1 -0
  243. package/dist/src/components/Textarea/index.d.ts +1 -0
  244. package/dist/src/components/Textarea/index.js +2 -0
  245. package/dist/src/components/Textarea/index.js.map +1 -0
  246. package/dist/src/components/addressGroup/AddressGroup.d.ts +12 -0
  247. package/dist/src/components/addressGroup/AddressGroup.js +39 -0
  248. package/dist/src/components/addressGroup/AddressGroup.js.map +1 -0
  249. package/dist/src/components/addressGroup/index.d.ts +1 -0
  250. package/dist/src/components/addressGroup/index.js +2 -0
  251. package/dist/src/components/addressGroup/index.js.map +1 -0
  252. package/dist/src/components/addressGroup/utils/Countries.d.ts +3 -0
  253. package/dist/src/components/addressGroup/utils/Countries.js +1249 -0
  254. package/dist/src/components/addressGroup/utils/Countries.js.map +1 -0
  255. package/dist/src/components/plate/PlateEditor.d.ts +10 -0
  256. package/dist/src/components/plate/PlateEditor.js +38 -0
  257. package/dist/src/components/plate/PlateEditor.js.map +1 -0
  258. package/dist/src/components/plate/PlateEditorContent.d.ts +24 -0
  259. package/dist/src/components/plate/PlateEditorContent.js +45 -0
  260. package/dist/src/components/plate/PlateEditorContent.js.map +1 -0
  261. package/dist/src/components/plate/components/align-dropdown-menu.d.ts +2 -0
  262. package/dist/src/components/plate/components/align-dropdown-menu.js +33 -0
  263. package/dist/src/components/plate/components/align-dropdown-menu.js.map +1 -0
  264. package/dist/src/components/plate/components/blockquote-element.d.ts +21 -0
  265. package/dist/src/components/plate/components/blockquote-element.js +8 -0
  266. package/dist/src/components/plate/components/blockquote-element.js.map +1 -0
  267. package/dist/src/components/plate/components/button.d.ts +14 -0
  268. package/dist/src/components/plate/components/button.js +38 -0
  269. package/dist/src/components/plate/components/button.js.map +1 -0
  270. package/dist/src/components/plate/components/caption.d.ts +43 -0
  271. package/dist/src/components/plate/components/caption.js +25 -0
  272. package/dist/src/components/plate/components/caption.js.map +1 -0
  273. package/dist/src/components/plate/components/checkbox.d.ts +3 -0
  274. package/dist/src/components/plate/components/checkbox.js +7 -0
  275. package/dist/src/components/plate/components/checkbox.js.map +1 -0
  276. package/dist/src/components/plate/components/code-block-combobox.d.ts +48 -0
  277. package/dist/src/components/plate/components/code-block-combobox.js +131 -0
  278. package/dist/src/components/plate/components/code-block-combobox.js.map +1 -0
  279. package/dist/src/components/plate/components/code-block-element.d.ts +22 -0
  280. package/dist/src/components/plate/components/code-block-element.js +13 -0
  281. package/dist/src/components/plate/components/code-block-element.js.map +1 -0
  282. package/dist/src/components/plate/components/code-leaf.d.ts +19 -0
  283. package/dist/src/components/plate/components/code-leaf.js +8 -0
  284. package/dist/src/components/plate/components/code-leaf.js.map +1 -0
  285. package/dist/src/components/plate/components/code-line-element.d.ts +21 -0
  286. package/dist/src/components/plate/components/code-line-element.js +6 -0
  287. package/dist/src/components/plate/components/code-line-element.js.map +1 -0
  288. package/dist/src/components/plate/components/code-syntax-leaf.d.ts +19 -0
  289. package/dist/src/components/plate/components/code-syntax-leaf.js +11 -0
  290. package/dist/src/components/plate/components/code-syntax-leaf.js.map +1 -0
  291. package/dist/src/components/plate/components/color-constants.d.ts +10 -0
  292. package/dist/src/components/plate/components/color-constants.js +430 -0
  293. package/dist/src/components/plate/components/color-constants.js.map +1 -0
  294. package/dist/src/components/plate/components/color-dropdown-menu-items.d.ts +18 -0
  295. package/dist/src/components/plate/components/color-dropdown-menu-items.js +21 -0
  296. package/dist/src/components/plate/components/color-dropdown-menu-items.js.map +1 -0
  297. package/dist/src/components/plate/components/color-dropdown-menu.d.ts +12 -0
  298. package/dist/src/components/plate/components/color-dropdown-menu.js +18 -0
  299. package/dist/src/components/plate/components/color-dropdown-menu.js.map +1 -0
  300. package/dist/src/components/plate/components/color-input.d.ts +2 -0
  301. package/dist/src/components/plate/components/color-input.js +15 -0
  302. package/dist/src/components/plate/components/color-input.js.map +1 -0
  303. package/dist/src/components/plate/components/color-picker.d.ts +18 -0
  304. package/dist/src/components/plate/components/color-picker.js +19 -0
  305. package/dist/src/components/plate/components/color-picker.js.map +1 -0
  306. package/dist/src/components/plate/components/colors-custom.d.ts +10 -0
  307. package/dist/src/components/plate/components/colors-custom.js +21 -0
  308. package/dist/src/components/plate/components/colors-custom.js.map +1 -0
  309. package/dist/src/components/plate/components/command.d.ts +76 -0
  310. package/dist/src/components/plate/components/command.js +18 -0
  311. package/dist/src/components/plate/components/command.js.map +1 -0
  312. package/dist/src/components/plate/components/comment-leaf.d.ts +3 -0
  313. package/dist/src/components/plate/components/comment-leaf.js +23 -0
  314. package/dist/src/components/plate/components/comment-leaf.js.map +1 -0
  315. package/dist/src/components/plate/components/dialog.d.ts +12 -0
  316. package/dist/src/components/plate/components/dialog.js +16 -0
  317. package/dist/src/components/plate/components/dialog.js.map +1 -0
  318. package/dist/src/components/plate/components/dropdown-menu.d.ts +29 -0
  319. package/dist/src/components/plate/components/dropdown-menu.js +51 -0
  320. package/dist/src/components/plate/components/dropdown-menu.js.map +1 -0
  321. package/dist/src/components/plate/components/excalidraw-element.d.ts +21 -0
  322. package/dist/src/components/plate/components/excalidraw-element.js +12 -0
  323. package/dist/src/components/plate/components/excalidraw-element.js.map +1 -0
  324. package/dist/src/components/plate/components/fixed-toolbar-buttons.d.ts +1 -0
  325. package/dist/src/components/plate/components/fixed-toolbar-buttons.js +25 -0
  326. package/dist/src/components/plate/components/fixed-toolbar-buttons.js.map +1 -0
  327. package/dist/src/components/plate/components/fixed-toolbar.d.ts +1 -0
  328. package/dist/src/components/plate/components/fixed-toolbar.js +4 -0
  329. package/dist/src/components/plate/components/fixed-toolbar.js.map +1 -0
  330. package/dist/src/components/plate/components/heading-element.d.ts +24 -0
  331. package/dist/src/components/plate/components/heading-element.js +30 -0
  332. package/dist/src/components/plate/components/heading-element.js.map +1 -0
  333. package/dist/src/components/plate/components/highlight-leaf.d.ts +19 -0
  334. package/dist/src/components/plate/components/highlight-leaf.js +5 -0
  335. package/dist/src/components/plate/components/highlight-leaf.js.map +1 -0
  336. package/dist/src/components/plate/components/hr-element.d.ts +21 -0
  337. package/dist/src/components/plate/components/hr-element.js +11 -0
  338. package/dist/src/components/plate/components/hr-element.js.map +1 -0
  339. package/dist/src/components/plate/components/image-element.d.ts +21 -0
  340. package/dist/src/components/plate/components/image-element.js +19 -0
  341. package/dist/src/components/plate/components/image-element.js.map +1 -0
  342. package/dist/src/components/plate/components/indent-list-toolbar-button.d.ts +18 -0
  343. package/dist/src/components/plate/components/indent-list-toolbar-button.js +12 -0
  344. package/dist/src/components/plate/components/indent-list-toolbar-button.js.map +1 -0
  345. package/dist/src/components/plate/components/indent-todo-marker-component.d.ts +3 -0
  346. package/dist/src/components/plate/components/indent-todo-marker-component.js +14 -0
  347. package/dist/src/components/plate/components/indent-todo-marker-component.js.map +1 -0
  348. package/dist/src/components/plate/components/indent-todo-toolbar-button.d.ts +15 -0
  349. package/dist/src/components/plate/components/indent-todo-toolbar-button.js +11 -0
  350. package/dist/src/components/plate/components/indent-todo-toolbar-button.js.map +1 -0
  351. package/dist/src/components/plate/components/indent-toolbar-button.d.ts +15 -0
  352. package/dist/src/components/plate/components/indent-toolbar-button.js +10 -0
  353. package/dist/src/components/plate/components/indent-toolbar-button.js.map +1 -0
  354. package/dist/src/components/plate/components/inline-combobox.d.ts +29 -0
  355. package/dist/src/components/plate/components/inline-combobox.js +156 -0
  356. package/dist/src/components/plate/components/inline-combobox.js.map +1 -0
  357. package/dist/src/components/plate/components/input.d.ts +8 -0
  358. package/dist/src/components/plate/components/input.js +20 -0
  359. package/dist/src/components/plate/components/input.js.map +1 -0
  360. package/dist/src/components/plate/components/insert-dropdown-menu.d.ts +12 -0
  361. package/dist/src/components/plate/components/insert-dropdown-menu.js +179 -0
  362. package/dist/src/components/plate/components/insert-dropdown-menu.js.map +1 -0
  363. package/dist/src/components/plate/components/kbd-leaf.d.ts +19 -0
  364. package/dist/src/components/plate/components/kbd-leaf.js +5 -0
  365. package/dist/src/components/plate/components/kbd-leaf.js.map +1 -0
  366. package/dist/src/components/plate/components/line-height-dropdown-menu.d.ts +2 -0
  367. package/dist/src/components/plate/components/line-height-dropdown-menu.js +12 -0
  368. package/dist/src/components/plate/components/line-height-dropdown-menu.js.map +1 -0
  369. package/dist/src/components/plate/components/link-element.d.ts +21 -0
  370. package/dist/src/components/plate/components/link-element.js +10 -0
  371. package/dist/src/components/plate/components/link-element.js.map +1 -0
  372. package/dist/src/components/plate/components/link-floating-toolbar.d.ts +5 -0
  373. package/dist/src/components/plate/components/link-floating-toolbar.js +54 -0
  374. package/dist/src/components/plate/components/link-floating-toolbar.js.map +1 -0
  375. package/dist/src/components/plate/components/link-toolbar-button.d.ts +15 -0
  376. package/dist/src/components/plate/components/link-toolbar-button.js +11 -0
  377. package/dist/src/components/plate/components/link-toolbar-button.js.map +1 -0
  378. package/dist/src/components/plate/components/mark-toolbar-button.d.ts +18 -0
  379. package/dist/src/components/plate/components/mark-toolbar-button.js +11 -0
  380. package/dist/src/components/plate/components/mark-toolbar-button.js.map +1 -0
  381. package/dist/src/components/plate/components/media-embed-element.d.ts +21 -0
  382. package/dist/src/components/plate/components/media-embed-element.js +23 -0
  383. package/dist/src/components/plate/components/media-embed-element.js.map +1 -0
  384. package/dist/src/components/plate/components/media-popover.d.ts +7 -0
  385. package/dist/src/components/plate/components/media-popover.js +30 -0
  386. package/dist/src/components/plate/components/media-popover.js.map +1 -0
  387. package/dist/src/components/plate/components/mention-element.d.ts +26 -0
  388. package/dist/src/components/plate/components/mention-element.js +12 -0
  389. package/dist/src/components/plate/components/mention-element.js.map +1 -0
  390. package/dist/src/components/plate/components/mention-input-element.d.ts +25 -0
  391. package/dist/src/components/plate/components/mention-input-element.js +89 -0
  392. package/dist/src/components/plate/components/mention-input-element.js.map +1 -0
  393. package/dist/src/components/plate/components/outdent-toolbar-button.d.ts +15 -0
  394. package/dist/src/components/plate/components/outdent-toolbar-button.js +10 -0
  395. package/dist/src/components/plate/components/outdent-toolbar-button.js.map +1 -0
  396. package/dist/src/components/plate/components/paragraph-element.d.ts +20 -0
  397. package/dist/src/components/plate/components/paragraph-element.js +4 -0
  398. package/dist/src/components/plate/components/paragraph-element.js.map +1 -0
  399. package/dist/src/components/plate/components/placeholder.d.ts +6 -0
  400. package/dist/src/components/plate/components/placeholder.js +37 -0
  401. package/dist/src/components/plate/components/placeholder.js.map +1 -0
  402. package/dist/src/components/plate/components/popover.d.ts +7 -0
  403. package/dist/src/components/plate/components/popover.js +11 -0
  404. package/dist/src/components/plate/components/popover.js.map +1 -0
  405. package/dist/src/components/plate/components/resizable.d.ts +40 -0
  406. package/dist/src/components/plate/components/resizable.js +38 -0
  407. package/dist/src/components/plate/components/resizable.js.map +1 -0
  408. package/dist/src/components/plate/components/separator.d.ts +4 -0
  409. package/dist/src/components/plate/components/separator.js +20 -0
  410. package/dist/src/components/plate/components/separator.js.map +1 -0
  411. package/dist/src/components/plate/components/slash-input-element.d.ts +22 -0
  412. package/dist/src/components/plate/components/slash-input-element.js +64 -0
  413. package/dist/src/components/plate/components/slash-input-element.js.map +1 -0
  414. package/dist/src/components/plate/components/table-cell-element.d.ts +47 -0
  415. package/dist/src/components/plate/components/table-cell-element.js +35 -0
  416. package/dist/src/components/plate/components/table-cell-element.js.map +1 -0
  417. package/dist/src/components/plate/components/table-element.d.ts +24 -0
  418. package/dist/src/components/plate/components/table-element.js +46 -0
  419. package/dist/src/components/plate/components/table-element.js.map +1 -0
  420. package/dist/src/components/plate/components/table-row-element.d.ts +23 -0
  421. package/dist/src/components/plate/components/table-row-element.js +7 -0
  422. package/dist/src/components/plate/components/table-row-element.js.map +1 -0
  423. package/dist/src/components/plate/components/todo-list-element.d.ts +21 -0
  424. package/dist/src/components/plate/components/todo-list-element.js +12 -0
  425. package/dist/src/components/plate/components/todo-list-element.js.map +1 -0
  426. package/dist/src/components/plate/components/toolbar.d.ts +29 -0
  427. package/dist/src/components/plate/components/toolbar.js +51 -0
  428. package/dist/src/components/plate/components/toolbar.js.map +1 -0
  429. package/dist/src/components/plate/components/tooltip.d.ts +12 -0
  430. package/dist/src/components/plate/components/tooltip.js +26 -0
  431. package/dist/src/components/plate/components/tooltip.js.map +1 -0
  432. package/dist/src/components/plate/components/turn-into-dropdown-menu.d.ts +2 -0
  433. package/dist/src/components/plate/components/turn-into-dropdown-menu.js +93 -0
  434. package/dist/src/components/plate/components/turn-into-dropdown-menu.js.map +1 -0
  435. package/dist/src/components/plate/icons.d.ts +85 -0
  436. package/dist/src/components/plate/icons.js +101 -0
  437. package/dist/src/components/plate/icons.js.map +1 -0
  438. package/dist/src/components/plate/lib/autoformat-rules.d.ts +10 -0
  439. package/dist/src/components/plate/lib/autoformat-rules.js +271 -0
  440. package/dist/src/components/plate/lib/autoformat-rules.js.map +1 -0
  441. package/dist/src/components/plate/usePlateEditor.d.ts +4 -0
  442. package/dist/src/components/plate/usePlateEditor.js +384 -0
  443. package/dist/src/components/plate/usePlateEditor.js.map +1 -0
  444. package/dist/src/components/states/error/index.d.ts +5 -0
  445. package/dist/src/components/states/error/index.js +15 -0
  446. package/dist/src/components/states/error/index.js.map +1 -0
  447. package/dist/src/context/FormData.d.ts +33 -0
  448. package/dist/src/context/FormData.js +109 -0
  449. package/dist/src/context/FormData.js.map +1 -0
  450. package/dist/src/hooks/useDependent/enhanced/useInputDependent/useInputDependent.d.ts +12 -0
  451. package/dist/src/hooks/useDependent/enhanced/useInputDependent/useInputDependent.js +36 -0
  452. package/dist/src/hooks/useDependent/enhanced/useInputDependent/useInputDependent.js.map +1 -0
  453. package/dist/src/hooks/useDependent/enhanced/useOptionsGenerator/useOptionsGenerator.d.ts +15 -0
  454. package/dist/src/hooks/useDependent/enhanced/useOptionsGenerator/useOptionsGenerator.js +16 -0
  455. package/dist/src/hooks/useDependent/enhanced/useOptionsGenerator/useOptionsGenerator.js.map +1 -0
  456. package/dist/src/hooks/useDependent/useDependent.d.ts +11 -0
  457. package/dist/src/hooks/useDependent/useDependent.js +86 -0
  458. package/dist/src/hooks/useDependent/useDependent.js.map +1 -0
  459. package/dist/src/hooks/useValueGenerator/useValueGenerator.d.ts +18 -0
  460. package/dist/src/hooks/useValueGenerator/useValueGenerator.js +99 -0
  461. package/dist/src/hooks/useValueGenerator/useValueGenerator.js.map +1 -0
  462. package/dist/src/index.d.ts +18 -0
  463. package/dist/src/index.js +19 -0
  464. package/dist/src/index.js.map +1 -0
  465. package/dist/src/styles/Hidden.styles.d.ts +7 -0
  466. package/dist/src/styles/Hidden.styles.js +16 -0
  467. package/dist/src/styles/Hidden.styles.js.map +1 -0
  468. package/dist/src/styles/Skeleton.d.ts +7 -0
  469. package/dist/src/styles/Skeleton.js +40 -0
  470. package/dist/src/styles/Skeleton.js.map +1 -0
  471. package/dist/src/styles/Textfield.styles.d.ts +5 -0
  472. package/dist/src/styles/Textfield.styles.js +34 -0
  473. package/dist/src/styles/Textfield.styles.js.map +1 -0
  474. package/dist/src/testutils.d.ts +14 -0
  475. package/dist/src/testutils.js +22 -0
  476. package/dist/src/testutils.js.map +1 -0
  477. package/dist/src/types/controlProps.d.ts +70 -0
  478. package/dist/src/types/controlProps.js +2 -0
  479. package/dist/src/types/controlProps.js.map +1 -0
  480. package/dist/src/types/index.d.ts +166 -0
  481. package/dist/src/types/index.js +2 -0
  482. package/dist/src/types/index.js.map +1 -0
  483. package/dist/src/ui/menu/hooks/useMenu.d.ts +13 -0
  484. package/dist/src/ui/menu/hooks/useMenu.js +41 -0
  485. package/dist/src/ui/menu/hooks/useMenu.js.map +1 -0
  486. package/dist/src/ui/menu/index.d.ts +13 -0
  487. package/dist/src/ui/menu/index.js +13 -0
  488. package/dist/src/ui/menu/index.js.map +1 -0
  489. package/dist/src/ui/menu/test/createControl.d.ts +15 -0
  490. package/dist/src/ui/menu/test/createControl.js +30 -0
  491. package/dist/src/ui/menu/test/createControl.js.map +1 -0
  492. package/dist/src/ui/menu/utils/detemineSubmenuTabs/index.d.ts +14 -0
  493. package/dist/src/ui/menu/utils/detemineSubmenuTabs/index.js +82 -0
  494. package/dist/src/ui/menu/utils/detemineSubmenuTabs/index.js.map +1 -0
  495. package/dist/src/ui-helper/HeaderCollapseButton/index.d.ts +7 -0
  496. package/dist/src/ui-helper/HeaderCollapseButton/index.js +9 -0
  497. package/dist/src/ui-helper/HeaderCollapseButton/index.js.map +1 -0
  498. package/dist/src/ui-helper/notifications/Error.d.ts +6 -0
  499. package/dist/src/ui-helper/notifications/Error.js +77 -0
  500. package/dist/src/ui-helper/notifications/Error.js.map +1 -0
  501. package/dist/src/ui-helper/notifications/images/background.d.ts +2 -0
  502. package/dist/src/ui-helper/notifications/images/background.js +7 -0
  503. package/dist/src/ui-helper/notifications/images/background.js.map +1 -0
  504. package/dist/src/ui-helper/notifications/images/spinner.d.ts +2 -0
  505. package/dist/src/ui-helper/notifications/images/spinner.js +6 -0
  506. package/dist/src/ui-helper/notifications/images/spinner.js.map +1 -0
  507. package/dist/src/ui-helper/notifications/images/under-improvement.d.ts +2 -0
  508. package/dist/src/ui-helper/notifications/images/under-improvement.js +6 -0
  509. package/dist/src/ui-helper/notifications/images/under-improvement.js.map +1 -0
  510. package/dist/src/utils/findFormControlError/index.d.ts +4 -0
  511. package/dist/src/utils/findFormControlError/index.js +24 -0
  512. package/dist/src/utils/findFormControlError/index.js.map +1 -0
  513. package/dist/src/utils/hasGroupRequiredFieldsWithValues/index.d.ts +6 -0
  514. package/dist/src/utils/hasGroupRequiredFieldsWithValues/index.js +22 -0
  515. package/dist/src/utils/hasGroupRequiredFieldsWithValues/index.js.map +1 -0
  516. package/dist/styles/formControl.module.scss +59 -0
  517. package/dist/tailwind.config.d.ts +1 -0
  518. package/dist/tailwind.config.js +17 -0
  519. package/dist/tailwind.config.js.map +1 -0
  520. package/dist/webpack.common.d.ts +63 -0
  521. package/dist/webpack.common.js +76 -0
  522. package/dist/webpack.common.js.map +1 -0
  523. package/dist/webpack.dev.d.ts +65 -0
  524. package/dist/webpack.dev.js +11 -0
  525. package/dist/webpack.dev.js.map +1 -0
  526. package/dist/webpack.prod.d.ts +65 -0
  527. package/dist/webpack.prod.js +10 -0
  528. package/dist/webpack.prod.js.map +1 -0
  529. package/package.json +39 -2
  530. package/dist/formbuilder.js +0 -521
  531. package/dist/formbuilder.js.LICENSE.txt +0 -60
  532. package/dist/formbuilder.js.map +0 -1
@@ -0,0 +1,10 @@
1
+ import type { AutoformatBlockRule, AutoformatRule } from "@udecode/plate-autoformat";
2
+ import type { SlateEditor } from "@udecode/plate-common";
3
+ export declare const preFormat: AutoformatBlockRule["preFormat"];
4
+ export declare const format: (editor: SlateEditor, customFormatting: any) => void;
5
+ export declare const formatList: (editor: SlateEditor, elementType: string) => void;
6
+ export declare const autoformatMarks: AutoformatRule[];
7
+ export declare const autoformatBlocks: AutoformatRule[];
8
+ export declare const autoformatLists: AutoformatRule[];
9
+ export declare const autoformatIndentLists: AutoformatRule[];
10
+ export declare const autoformatRules: AutoformatRule[];
@@ -0,0 +1,271 @@
1
+ import { autoformatArrow, autoformatLegal, autoformatLegalHtml, autoformatMath, autoformatPunctuation, autoformatSmartQuotes, } from "@udecode/plate-autoformat";
2
+ import { BoldPlugin, CodePlugin, ItalicPlugin, StrikethroughPlugin, SubscriptPlugin, SuperscriptPlugin, UnderlinePlugin, } from "@udecode/plate-basic-marks/react";
3
+ import { BlockquotePlugin } from "@udecode/plate-block-quote/react";
4
+ import { insertEmptyCodeBlock } from "@udecode/plate-code-block";
5
+ import { CodeBlockPlugin, CodeLinePlugin, } from "@udecode/plate-code-block/react";
6
+ import { getParentNode, insertNodes, isBlock, isElement, isType, setNodes, } from "@udecode/plate-common";
7
+ import { ParagraphPlugin } from "@udecode/plate-common/react";
8
+ import { HEADING_KEYS } from "@udecode/plate-heading";
9
+ import { HighlightPlugin } from "@udecode/plate-highlight/react";
10
+ import { HorizontalRulePlugin } from "@udecode/plate-horizontal-rule/react";
11
+ import { INDENT_LIST_KEYS, ListStyleType, toggleIndentList, } from "@udecode/plate-indent-list";
12
+ import { toggleList, unwrapList } from "@udecode/plate-list";
13
+ import { BulletedListPlugin, ListItemPlugin, NumberedListPlugin, TodoListPlugin, } from "@udecode/plate-list/react";
14
+ import { openNextToggles, TogglePlugin } from "@udecode/plate-toggle/react";
15
+ export const preFormat = (editor) => unwrapList(editor);
16
+ export const format = (editor, customFormatting) => {
17
+ if (editor.selection) {
18
+ const parentEntry = getParentNode(editor, editor.selection);
19
+ if (!parentEntry)
20
+ return;
21
+ const [node] = parentEntry;
22
+ if (isElement(node) &&
23
+ !isType(editor, node, CodeBlockPlugin.key) &&
24
+ !isType(editor, node, CodeLinePlugin.key)) {
25
+ customFormatting();
26
+ }
27
+ }
28
+ };
29
+ export const formatList = (editor, elementType) => {
30
+ format(editor, () => toggleList(editor, {
31
+ type: elementType,
32
+ }));
33
+ };
34
+ export const autoformatMarks = [
35
+ {
36
+ match: "***",
37
+ mode: "mark",
38
+ type: [BoldPlugin.key, ItalicPlugin.key],
39
+ },
40
+ {
41
+ match: "__*",
42
+ mode: "mark",
43
+ type: [UnderlinePlugin.key, ItalicPlugin.key],
44
+ },
45
+ {
46
+ match: "__**",
47
+ mode: "mark",
48
+ type: [UnderlinePlugin.key, BoldPlugin.key],
49
+ },
50
+ {
51
+ match: "___***",
52
+ mode: "mark",
53
+ type: [UnderlinePlugin.key, BoldPlugin.key, ItalicPlugin.key],
54
+ },
55
+ {
56
+ match: "**",
57
+ mode: "mark",
58
+ type: BoldPlugin.key,
59
+ },
60
+ {
61
+ match: "__",
62
+ mode: "mark",
63
+ type: UnderlinePlugin.key,
64
+ },
65
+ {
66
+ match: "*",
67
+ mode: "mark",
68
+ type: ItalicPlugin.key,
69
+ },
70
+ {
71
+ match: "_",
72
+ mode: "mark",
73
+ type: ItalicPlugin.key,
74
+ },
75
+ {
76
+ match: "~~",
77
+ mode: "mark",
78
+ type: StrikethroughPlugin.key,
79
+ },
80
+ {
81
+ match: "^",
82
+ mode: "mark",
83
+ type: SuperscriptPlugin.key,
84
+ },
85
+ {
86
+ match: "~",
87
+ mode: "mark",
88
+ type: SubscriptPlugin.key,
89
+ },
90
+ {
91
+ match: "==",
92
+ mode: "mark",
93
+ type: HighlightPlugin.key,
94
+ },
95
+ {
96
+ match: "≡",
97
+ mode: "mark",
98
+ type: HighlightPlugin.key,
99
+ },
100
+ {
101
+ match: "`",
102
+ mode: "mark",
103
+ type: CodePlugin.key,
104
+ },
105
+ ];
106
+ export const autoformatBlocks = [
107
+ {
108
+ match: "# ",
109
+ mode: "block",
110
+ preFormat,
111
+ type: HEADING_KEYS.h1,
112
+ },
113
+ {
114
+ match: "## ",
115
+ mode: "block",
116
+ preFormat,
117
+ type: HEADING_KEYS.h2,
118
+ },
119
+ {
120
+ match: "### ",
121
+ mode: "block",
122
+ preFormat,
123
+ type: HEADING_KEYS.h3,
124
+ },
125
+ {
126
+ match: "#### ",
127
+ mode: "block",
128
+ preFormat,
129
+ type: HEADING_KEYS.h4,
130
+ },
131
+ {
132
+ match: "##### ",
133
+ mode: "block",
134
+ preFormat,
135
+ type: HEADING_KEYS.h5,
136
+ },
137
+ {
138
+ match: "###### ",
139
+ mode: "block",
140
+ preFormat,
141
+ type: HEADING_KEYS.h6,
142
+ },
143
+ {
144
+ match: "> ",
145
+ mode: "block",
146
+ preFormat,
147
+ type: BlockquotePlugin.key,
148
+ },
149
+ {
150
+ format: (editor) => {
151
+ insertEmptyCodeBlock(editor, {
152
+ defaultType: ParagraphPlugin.key,
153
+ insertNodesOptions: { select: true },
154
+ });
155
+ },
156
+ match: "```",
157
+ mode: "block",
158
+ preFormat,
159
+ triggerAtBlockStart: false,
160
+ type: CodeBlockPlugin.key,
161
+ },
162
+ {
163
+ match: "+ ",
164
+ mode: "block",
165
+ preFormat: openNextToggles,
166
+ type: TogglePlugin.key,
167
+ },
168
+ {
169
+ format: (editor) => {
170
+ setNodes(editor, { type: HorizontalRulePlugin.key });
171
+ insertNodes(editor, {
172
+ children: [{ text: "" }],
173
+ type: ParagraphPlugin.key,
174
+ });
175
+ },
176
+ match: ["---", "—-", "___ "],
177
+ mode: "block",
178
+ type: HorizontalRulePlugin.key,
179
+ },
180
+ ];
181
+ export const autoformatLists = [
182
+ {
183
+ format: (editor) => formatList(editor, BulletedListPlugin.key),
184
+ match: ["* ", "- "],
185
+ mode: "block",
186
+ preFormat,
187
+ type: ListItemPlugin.key,
188
+ },
189
+ {
190
+ format: (editor) => formatList(editor, NumberedListPlugin.key),
191
+ match: ["^\\d+\\.$ ", "^\\d+\\)$ "],
192
+ matchByRegex: true,
193
+ mode: "block",
194
+ preFormat,
195
+ type: ListItemPlugin.key,
196
+ },
197
+ {
198
+ match: "[] ",
199
+ mode: "block",
200
+ type: TodoListPlugin.key,
201
+ },
202
+ {
203
+ format: (editor) => setNodes(editor, { checked: true, type: TodoListPlugin.key }, {
204
+ match: (n) => isBlock(editor, n),
205
+ }),
206
+ match: "[x] ",
207
+ mode: "block",
208
+ type: TodoListPlugin.key,
209
+ },
210
+ ];
211
+ export const autoformatIndentLists = [
212
+ {
213
+ format: (editor) => {
214
+ toggleIndentList(editor, {
215
+ listStyleType: ListStyleType.Disc,
216
+ });
217
+ },
218
+ match: ["* ", "- "],
219
+ mode: "block",
220
+ type: "list",
221
+ },
222
+ {
223
+ format: (editor) => toggleIndentList(editor, {
224
+ listStyleType: ListStyleType.Decimal,
225
+ }),
226
+ match: ["^\\d+\\.$ ", "^\\d+\\)$ "],
227
+ matchByRegex: true,
228
+ mode: "block",
229
+ type: "list",
230
+ },
231
+ {
232
+ format: (editor) => {
233
+ toggleIndentList(editor, {
234
+ listStyleType: INDENT_LIST_KEYS.todo,
235
+ });
236
+ setNodes(editor, {
237
+ checked: false,
238
+ listStyleType: INDENT_LIST_KEYS.todo,
239
+ });
240
+ },
241
+ match: ["[] "],
242
+ mode: "block",
243
+ type: "list",
244
+ },
245
+ {
246
+ format: (editor) => {
247
+ toggleIndentList(editor, {
248
+ listStyleType: INDENT_LIST_KEYS.todo,
249
+ });
250
+ setNodes(editor, {
251
+ checked: true,
252
+ listStyleType: INDENT_LIST_KEYS.todo,
253
+ });
254
+ },
255
+ match: ["[x] "],
256
+ mode: "block",
257
+ type: "list",
258
+ },
259
+ ];
260
+ export const autoformatRules = [
261
+ ...autoformatBlocks,
262
+ ...autoformatMarks,
263
+ ...autoformatSmartQuotes,
264
+ ...autoformatPunctuation,
265
+ ...autoformatLegal,
266
+ ...autoformatLegalHtml,
267
+ ...autoformatArrow,
268
+ ...autoformatMath,
269
+ ...autoformatIndentLists,
270
+ ];
271
+ //# sourceMappingURL=autoformat-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autoformat-rules.js","sourceRoot":"","sources":["../../../../../src/components/plate/lib/autoformat-rules.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACp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,IAAI;QAClB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,MAAM;KACb;IACD;QACE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;YACjB,gBAAgB,CAAC,MAAM,EAAE;gBACvB,aAAa,EAAE,gBAAgB,CAAC,IAAI;aACrC,CAAC,CAAC;YACH,QAAQ,CAAC,MAAa,EAAE;gBACtB,OAAO,EAAE,KAAK;gBACd,aAAa,EAAE,gBAAgB,CAAC,IAAI;aACrC,CAAC,CAAC;QACL,CAAC;QACD,KAAK,EAAE,CAAC,KAAK,CAAC;QACd,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,MAAM;KACb;IACD;QACE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;YACjB,gBAAgB,CAAC,MAAM,EAAE;gBACvB,aAAa,EAAE,gBAAgB,CAAC,IAAI;aACrC,CAAC,CAAC;YACH,QAAQ,CAAC,MAAa,EAAE;gBACtB,OAAO,EAAE,IAAI;gBACb,aAAa,EAAE,gBAAgB,CAAC,IAAI;aACrC,CAAC,CAAC;QACL,CAAC;QACD,KAAK,EAAE,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,MAAM;KACb;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C,GAAG,gBAAgB;IACnB,GAAG,eAAe;IAClB,GAAG,qBAAqB;IACxB,GAAG,qBAAqB;IACxB,GAAG,eAAe;IAClB,GAAG,mBAAmB;IACtB,GAAG,eAAe;IAClB,GAAG,cAAc;IACjB,GAAG,qBAAqB;CACzB,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare const usePlateEditor: ({ value }: {
2
+ value: any;
3
+ }) => any;
4
+ export default usePlateEditor;
@@ -0,0 +1,384 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ // PLUGINS
4
+ import { AlignPlugin } from "@udecode/plate-alignment/react";
5
+ import { AutoformatPlugin } from "@udecode/plate-autoformat/react";
6
+ import { BasicMarksPlugin, BoldPlugin, CodePlugin, ItalicPlugin, StrikethroughPlugin, SubscriptPlugin, SuperscriptPlugin, UnderlinePlugin, } from "@udecode/plate-basic-marks/react";
7
+ import { BlockquotePlugin } from "@udecode/plate-block-quote/react";
8
+ import { ExitBreakPlugin, SoftBreakPlugin } from "@udecode/plate-break/react";
9
+ import { CaptionPlugin } from "@udecode/plate-caption/react";
10
+ import { isCodeBlockEmpty, isSelectionAtCodeBlockStart, unwrapCodeBlock, } from "@udecode/plate-code-block";
11
+ import { CodeBlockPlugin, CodeLinePlugin, CodeSyntaxPlugin, } from "@udecode/plate-code-block/react";
12
+ import { CommentsPlugin } from "@udecode/plate-comments/react";
13
+ import { isBlockAboveEmpty, isSelectionAtBlockStart, someNode, } from "@udecode/plate-common";
14
+ import { createPlateEditor, ParagraphPlugin, PlateLeaf, } from "@udecode/plate-common/react";
15
+ import { EmojiPlugin } from "@udecode/plate-emoji/react";
16
+ import { ExcalidrawPlugin } from "@udecode/plate-excalidraw/react";
17
+ import { FontBackgroundColorPlugin, FontColorPlugin, FontSizePlugin, } from "@udecode/plate-font/react";
18
+ import { HEADING_KEYS, HEADING_LEVELS } from "@udecode/plate-heading";
19
+ import { HeadingPlugin } from "@udecode/plate-heading/react";
20
+ import { HighlightPlugin } from "@udecode/plate-highlight/react";
21
+ import { HorizontalRulePlugin } from "@udecode/plate-horizontal-rule/react";
22
+ import { IndentListPlugin } from "@udecode/plate-indent-list/react";
23
+ import { IndentPlugin } from "@udecode/plate-indent/react";
24
+ import { KbdPlugin } from "@udecode/plate-kbd/react";
25
+ import { LineHeightPlugin } from "@udecode/plate-line-height/react";
26
+ import { LinkPlugin } from "@udecode/plate-link/react";
27
+ import { BulletedListPlugin, ListPlugin, NumberedListPlugin, TodoListPlugin, } from "@udecode/plate-list/react";
28
+ import { ImagePlugin, MediaEmbedPlugin } from "@udecode/plate-media/react";
29
+ import { MentionInputPlugin, MentionPlugin, } from "@udecode/plate-mention/react";
30
+ import { NodeIdPlugin } from "@udecode/plate-node-id";
31
+ import { ResetNodePlugin } from "@udecode/plate-reset-node/react";
32
+ import { SelectOnBackspacePlugin } from "@udecode/plate-select";
33
+ import { BlockSelectionPlugin } from "@udecode/plate-selection/react";
34
+ import { SlashInputPlugin, SlashPlugin, } from "@udecode/plate-slash-command/react";
35
+ import { TabbablePlugin } from "@udecode/plate-tabbable/react";
36
+ import { TableCellHeaderPlugin, TableCellPlugin, TablePlugin, TableRowPlugin, } from "@udecode/plate-table/react";
37
+ import { TogglePlugin } from "@udecode/plate-toggle/react";
38
+ import { TrailingBlockPlugin } from "@udecode/plate-trailing-block";
39
+ // import { DragOverCursorPlugin } from "./components/cursor-overlay";
40
+ // COMPONENTS
41
+ import { BlockquoteElement } from "./components/blockquote-element";
42
+ import { CodeBlockElement } from "./components/code-block-element";
43
+ import { CodeLeaf } from "./components/code-leaf";
44
+ import { CodeLineElement } from "./components/code-line-element";
45
+ import { CodeSyntaxLeaf } from "./components/code-syntax-leaf";
46
+ import { CommentLeaf } from "./components/comment-leaf";
47
+ import { ExcalidrawElement } from "./components/excalidraw-element";
48
+ import { HeadingElement } from "./components/heading-element";
49
+ import { HighlightLeaf } from "./components/highlight-leaf";
50
+ import { HrElement } from "./components/hr-element";
51
+ import { ImageElement } from "./components/image-element";
52
+ import { TodoLi, TodoMarker } from "./components/indent-todo-marker-component";
53
+ import { KbdLeaf } from "./components/kbd-leaf";
54
+ import { LinkElement } from "./components/link-element";
55
+ import { LinkFloatingToolbar } from "./components/link-floating-toolbar";
56
+ import { MediaEmbedElement } from "./components/media-embed-element";
57
+ import { MentionElement } from "./components/mention-element";
58
+ import { MentionInputElement } from "./components/mention-input-element";
59
+ import { ParagraphElement } from "./components/paragraph-element";
60
+ import { withPlaceholders } from "./components/placeholder";
61
+ import { SlashInputElement } from "./components/slash-input-element";
62
+ import { TableCellElement, TableCellHeaderElement, } from "./components/table-cell-element";
63
+ import { TableElement } from "./components/table-element";
64
+ import { TableRowElement } from "./components/table-row-element";
65
+ import { TodoListElement } from "./components/todo-list-element";
66
+ // UTILS
67
+ import { withProps } from "@udecode/cn";
68
+ import { autoformatRules } from "./lib/autoformat-rules";
69
+ const usePlateEditor = ({ value = [] }) => {
70
+ const editor = createPlateEditor({
71
+ plugins: [
72
+ HeadingPlugin,
73
+ BlockquotePlugin,
74
+ CodeBlockPlugin,
75
+ CodeLinePlugin,
76
+ CodeSyntaxPlugin,
77
+ HorizontalRulePlugin,
78
+ BasicMarksPlugin,
79
+ TodoListPlugin,
80
+ // Nodes
81
+ HeadingPlugin,
82
+ BlockquotePlugin,
83
+ CodeBlockPlugin,
84
+ CodeLinePlugin,
85
+ CodeSyntaxPlugin,
86
+ HorizontalRulePlugin,
87
+ TogglePlugin,
88
+ LinkPlugin.configure({
89
+ render: { afterEditable: () => _jsx(LinkFloatingToolbar, {}) },
90
+ }),
91
+ ImagePlugin,
92
+ MediaEmbedPlugin,
93
+ CaptionPlugin.configure({
94
+ options: { plugins: [ImagePlugin, MediaEmbedPlugin] },
95
+ }),
96
+ MentionPlugin,
97
+ MentionInputPlugin,
98
+ TablePlugin,
99
+ TableRowPlugin,
100
+ TableCellPlugin,
101
+ TableCellHeaderPlugin,
102
+ TodoListPlugin,
103
+ ExcalidrawPlugin,
104
+ // Marks
105
+ BoldPlugin,
106
+ ItalicPlugin,
107
+ UnderlinePlugin,
108
+ StrikethroughPlugin,
109
+ CodePlugin,
110
+ SubscriptPlugin,
111
+ SuperscriptPlugin,
112
+ FontColorPlugin,
113
+ FontBackgroundColorPlugin,
114
+ FontSizePlugin,
115
+ HighlightPlugin,
116
+ KbdPlugin,
117
+ // Block Style
118
+ AlignPlugin.configure({
119
+ inject: {
120
+ targetPlugins: [ParagraphPlugin.key, ...HEADING_LEVELS],
121
+ },
122
+ }),
123
+ IndentPlugin.configure({
124
+ inject: {
125
+ targetPlugins: [
126
+ ParagraphPlugin.key,
127
+ BlockquotePlugin.key,
128
+ CodeBlockPlugin.key,
129
+ TogglePlugin.key,
130
+ ...HEADING_LEVELS,
131
+ ],
132
+ },
133
+ }),
134
+ IndentListPlugin.configure({
135
+ inject: {
136
+ targetPlugins: [
137
+ ParagraphPlugin.key,
138
+ BlockquotePlugin.key,
139
+ CodeBlockPlugin.key,
140
+ TogglePlugin.key,
141
+ ...HEADING_LEVELS,
142
+ ],
143
+ },
144
+ options: {
145
+ listStyleTypes: {
146
+ todo: {
147
+ liComponent: TodoLi,
148
+ markerComponent: TodoMarker,
149
+ type: "todo",
150
+ },
151
+ },
152
+ },
153
+ }),
154
+ LineHeightPlugin.configure({
155
+ inject: {
156
+ nodeProps: {
157
+ defaultNodeValue: 1.5,
158
+ validNodeValues: [1, 1.2, 1.5, 2, 3],
159
+ },
160
+ targetPlugins: [ParagraphPlugin.key, ...HEADING_LEVELS],
161
+ },
162
+ }),
163
+ ListPlugin,
164
+ BulletedListPlugin,
165
+ NumberedListPlugin,
166
+ // TABLE
167
+ TablePlugin,
168
+ TableRowPlugin,
169
+ TableCellPlugin,
170
+ TableCellHeaderPlugin,
171
+ TabbablePlugin.configure(({ editor }) => ({
172
+ options: {
173
+ query: () => {
174
+ if (isSelectionAtBlockStart(editor))
175
+ return false;
176
+ return !someNode(editor, {
177
+ match: (n) => {
178
+ return !!(n.type &&
179
+ ([
180
+ TablePlugin.key,
181
+ TodoListPlugin.key,
182
+ CodeBlockPlugin.key,
183
+ ].includes(n.type) ||
184
+ n.listStyleType));
185
+ },
186
+ });
187
+ },
188
+ },
189
+ })),
190
+ ResetNodePlugin.configure({
191
+ options: {
192
+ rules: [
193
+ {
194
+ types: [BlockquotePlugin.key, TodoListPlugin.key],
195
+ defaultType: ParagraphPlugin.key,
196
+ hotkey: "Enter",
197
+ predicate: isBlockAboveEmpty,
198
+ },
199
+ {
200
+ types: [BlockquotePlugin.key, TodoListPlugin.key],
201
+ defaultType: ParagraphPlugin.key,
202
+ hotkey: "Backspace",
203
+ predicate: isSelectionAtBlockStart,
204
+ },
205
+ {
206
+ types: [CodeBlockPlugin.key],
207
+ defaultType: ParagraphPlugin.key,
208
+ onReset: unwrapCodeBlock,
209
+ hotkey: "Enter",
210
+ predicate: isCodeBlockEmpty,
211
+ },
212
+ {
213
+ types: [CodeBlockPlugin.key],
214
+ defaultType: ParagraphPlugin.key,
215
+ onReset: unwrapCodeBlock,
216
+ hotkey: "Backspace",
217
+ predicate: isSelectionAtCodeBlockStart,
218
+ },
219
+ ],
220
+ },
221
+ }),
222
+ // Functionality
223
+ SlashPlugin,
224
+ SlashInputPlugin,
225
+ AutoformatPlugin.configure({
226
+ options: {
227
+ rules: autoformatRules,
228
+ enableUndoOnDelete: true,
229
+ },
230
+ }),
231
+ BlockSelectionPlugin,
232
+ EmojiPlugin,
233
+ ExitBreakPlugin.configure({
234
+ options: {
235
+ rules: [
236
+ {
237
+ hotkey: "mod+enter",
238
+ },
239
+ {
240
+ hotkey: "mod+shift+enter",
241
+ before: true,
242
+ },
243
+ {
244
+ hotkey: "enter",
245
+ query: {
246
+ start: true,
247
+ end: true,
248
+ allow: HEADING_LEVELS,
249
+ },
250
+ relative: true,
251
+ level: 1,
252
+ },
253
+ ],
254
+ },
255
+ }),
256
+ NodeIdPlugin,
257
+ ResetNodePlugin.configure({
258
+ options: {
259
+ rules: [
260
+ {
261
+ types: [BlockquotePlugin.key, TodoListPlugin.key],
262
+ defaultType: ParagraphPlugin.key,
263
+ hotkey: "Enter",
264
+ predicate: isBlockAboveEmpty,
265
+ },
266
+ {
267
+ types: [BlockquotePlugin.key, TodoListPlugin.key],
268
+ defaultType: ParagraphPlugin.key,
269
+ hotkey: "Backspace",
270
+ predicate: isSelectionAtBlockStart,
271
+ },
272
+ {
273
+ types: [CodeBlockPlugin.key],
274
+ defaultType: ParagraphPlugin.key,
275
+ onReset: unwrapCodeBlock,
276
+ hotkey: "Enter",
277
+ predicate: isCodeBlockEmpty,
278
+ },
279
+ {
280
+ types: [CodeBlockPlugin.key],
281
+ defaultType: ParagraphPlugin.key,
282
+ onReset: unwrapCodeBlock,
283
+ hotkey: "Backspace",
284
+ predicate: isSelectionAtCodeBlockStart,
285
+ },
286
+ ],
287
+ },
288
+ }),
289
+ SelectOnBackspacePlugin.configure({
290
+ options: {
291
+ query: {
292
+ allow: [ImagePlugin.key, HorizontalRulePlugin.key],
293
+ },
294
+ },
295
+ }),
296
+ SoftBreakPlugin.configure({
297
+ options: {
298
+ rules: [
299
+ { hotkey: "shift+enter" },
300
+ {
301
+ hotkey: "enter",
302
+ query: {
303
+ allow: [
304
+ CodeBlockPlugin.key,
305
+ BlockquotePlugin.key,
306
+ TableCellPlugin.key,
307
+ TableCellHeaderPlugin.key,
308
+ ],
309
+ },
310
+ },
311
+ ],
312
+ },
313
+ }),
314
+ TabbablePlugin.configure(({ editor }) => ({
315
+ options: {
316
+ query: () => {
317
+ if (isSelectionAtBlockStart(editor))
318
+ return false;
319
+ return !someNode(editor, {
320
+ match: (n) => {
321
+ return !!(n.type &&
322
+ ([
323
+ TablePlugin.key,
324
+ TodoListPlugin.key,
325
+ CodeBlockPlugin.key,
326
+ ].includes(n.type) ||
327
+ n.listStyleType));
328
+ },
329
+ });
330
+ },
331
+ },
332
+ })),
333
+ TrailingBlockPlugin.configure({
334
+ options: { type: ParagraphPlugin.key },
335
+ }),
336
+ // DragOverCursorPlugin,
337
+ ],
338
+ override: {
339
+ components: withPlaceholders({
340
+ [BlockquotePlugin.key]: BlockquoteElement,
341
+ [CodeBlockPlugin.key]: CodeBlockElement,
342
+ [CodeLinePlugin.key]: CodeLineElement,
343
+ [CodeSyntaxPlugin.key]: CodeSyntaxLeaf,
344
+ [HorizontalRulePlugin.key]: HrElement,
345
+ [HEADING_KEYS.h1]: withProps(HeadingElement, { variant: "h1" }),
346
+ [HEADING_KEYS.h2]: withProps(HeadingElement, { variant: "h2" }),
347
+ [HEADING_KEYS.h3]: withProps(HeadingElement, { variant: "h3" }),
348
+ [HEADING_KEYS.h4]: withProps(HeadingElement, { variant: "h4" }),
349
+ [HEADING_KEYS.h5]: withProps(HeadingElement, { variant: "h5" }),
350
+ [HEADING_KEYS.h6]: withProps(HeadingElement, { variant: "h6" }),
351
+ [ImagePlugin.key]: ImageElement,
352
+ [LinkPlugin.key]: LinkElement,
353
+ [MediaEmbedPlugin.key]: MediaEmbedElement,
354
+ [MentionPlugin.key]: MentionElement,
355
+ [MentionInputPlugin.key]: MentionInputElement,
356
+ [ParagraphPlugin.key]: ParagraphElement,
357
+ [TablePlugin.key]: TableElement,
358
+ [TableRowPlugin.key]: TableRowElement,
359
+ [TableCellPlugin.key]: TableCellElement,
360
+ [TableCellHeaderPlugin.key]: TableCellHeaderElement,
361
+ [TodoListPlugin.key]: TodoListElement,
362
+ [ExcalidrawPlugin.key]: ExcalidrawElement,
363
+ [HighlightPlugin.key]: HighlightLeaf,
364
+ [BoldPlugin.key]: withProps(PlateLeaf, { as: "strong" }),
365
+ [CodePlugin.key]: CodeLeaf,
366
+ [ItalicPlugin.key]: withProps(PlateLeaf, { as: "em" }),
367
+ [StrikethroughPlugin.key]: withProps(PlateLeaf, { as: "s" }),
368
+ [SubscriptPlugin.key]: withProps(PlateLeaf, { as: "sub" }),
369
+ [SuperscriptPlugin.key]: withProps(PlateLeaf, { as: "sup" }),
370
+ [UnderlinePlugin.key]: withProps(PlateLeaf, { as: "u" }),
371
+ [KbdPlugin.key]: KbdLeaf,
372
+ [CommentsPlugin.key]: CommentLeaf,
373
+ [SlashInputPlugin.key]: SlashInputElement,
374
+ [ListPlugin.key]: withProps(PlateLeaf, { as: "ul" }),
375
+ [BulletedListPlugin.key]: withProps(PlateLeaf, { as: "ul" }),
376
+ [NumberedListPlugin.key]: withProps(PlateLeaf, { as: "ol" }),
377
+ }),
378
+ },
379
+ value: value,
380
+ });
381
+ return editor;
382
+ };
383
+ export default usePlateEditor;
384
+ //# sourceMappingURL=usePlateEditor.js.map