@123usmanhaider321/ui 0.1.8 → 1.0.2

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 (545) hide show
  1. package/README.md +416 -31
  2. package/dist/images/icon/1LINK.svg +50 -0
  3. package/dist/images/icon/CreditCard.svg +83 -0
  4. package/dist/images/icon/Easypaisa.png +0 -0
  5. package/dist/images/icon/MobileWallet.png +0 -0
  6. package/dist/images/icon/Raast-Logo.png +0 -0
  7. package/dist/images/icon/VISA.png +0 -0
  8. package/dist/images/icon/add-circle-1.svg +5 -0
  9. package/dist/images/icon/check-circle-broken.svg +3 -0
  10. package/dist/images/icon/close-circle.svg +5 -0
  11. package/dist/images/icon/jazzcash.png +0 -0
  12. package/dist/images/icon/loading_icon.json +3347 -0
  13. package/dist/images/icon/mastercard-logo.webp +0 -0
  14. package/dist/images/icon/paymo.jpeg +0 -0
  15. package/dist/images/icon/preview-svgrepo-com.svg +36 -0
  16. package/dist/images/icon/trash.svg +7 -0
  17. package/dist/images/icon/unionpay-logo.svg +9 -0
  18. package/dist/index-BLoegwT6.js +60476 -0
  19. package/dist/index-BLoegwT6.js.map +1 -0
  20. package/dist/index-CPnu5V8f.js +11119 -0
  21. package/dist/index-CPnu5V8f.js.map +1 -0
  22. package/dist/index.d.ts +1 -10
  23. package/dist/index.es-C5pDhGOr.js +16734 -0
  24. package/dist/index.es-C5pDhGOr.js.map +1 -0
  25. package/dist/index.js +40 -12
  26. package/dist/index.js.map +1 -1
  27. package/dist/loading_icon-n5H5dQBl.js +3375 -0
  28. package/dist/loading_icon-n5H5dQBl.js.map +1 -0
  29. package/dist/src/components/Alert/ErrorAlert.d.ts +6 -0
  30. package/dist/src/components/Alert/SuccessAlert.d.ts +6 -0
  31. package/dist/{components → src/components}/FormBuilder/DiscountInput.d.ts +3 -6
  32. package/dist/{components → src/components}/FormBuilder/FormBuilder.d.ts +2 -11
  33. package/dist/{components → src/components}/FormBuilder/QuestionCard.d.ts +0 -5
  34. package/dist/{components → src/components}/FormBuilder/QuestionEditor.d.ts +0 -5
  35. package/dist/{components → src/components}/FormBuilder/SortableQuestionList.d.ts +0 -5
  36. package/dist/src/components/FormBuilder/questionIcons.d.ts +5 -0
  37. package/dist/{components/EventAddForm → src/components/NewAddEvent}/AddEventLayout.d.ts +2 -1
  38. package/dist/{components/EventAddForm → src/components/NewAddEvent}/AddEventStepper.d.ts +2 -2
  39. package/dist/{components/EventAddForm → src/components/NewAddEvent}/common/ConfirmationModal.d.ts +1 -1
  40. package/dist/src/components/NewAddEvent/components/EventSubmissionConfirmationModal.d.ts +14 -0
  41. package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/StepTwo/TicketTierSection.d.ts +1 -1
  42. package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/TicketTierForm.d.ts +1 -1
  43. package/dist/{components/EventAddForm → src/components/NewAddEvent}/hooks/useStepperForm.d.ts +22 -22
  44. package/dist/{components/EventAddForm → src/components/NewAddEvent}/hooks/useTicketTierForm.d.ts +63 -15
  45. package/dist/src/components/NewAddEvent/schemas/step1.d.ts +211 -0
  46. package/dist/src/components/NewAddEvent/schemas/step2.d.ts +411 -0
  47. package/dist/{components/EventAddForm → src/components/NewAddEvent}/schemas/utils.d.ts +8 -2
  48. package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/IndividualFormStep.d.ts +1 -1
  49. package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/SocialProfilesStep.d.ts +1 -1
  50. package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/TeamFormStep.d.ts +1 -1
  51. package/dist/src/components/Spinner/spinner.d.ts +4 -0
  52. package/dist/src/components/TicketlyUIProvider.d.ts +35 -0
  53. package/dist/src/components/common/Loader/index.d.ts +8 -0
  54. package/dist/src/components/common/Modals/ConfirmationModal.d.ts +7 -0
  55. package/dist/{components/FormInput → src/components/ui}/FormInput.d.ts +1 -1
  56. package/dist/src/components/ui/Loader.d.ts +4 -0
  57. package/dist/{components/Button/Button.d.ts → src/components/ui/button.d.ts} +1 -1
  58. package/dist/src/index.d.ts +10 -0
  59. package/dist/{lib → src/lib}/actions.d.ts +0 -126
  60. package/dist/src/lib/dom-utils.d.ts +2 -0
  61. package/dist/src/lib/storage-utils.d.ts +5 -0
  62. package/dist/src/lib/types.d.ts +258 -0
  63. package/dist/src/redux/baseQuery.d.ts +16 -0
  64. package/dist/{services → src/redux/features}/eventApi.d.ts +1053 -1745
  65. package/dist/src/redux/features/globalSlice.d.ts +17 -0
  66. package/dist/{services → src/redux/features/single-event}/single-event-api.d.ts +856 -1190
  67. package/dist/src/redux/types.d.ts +2 -0
  68. package/dist/src/services/library-services.d.ts +15 -0
  69. package/dist/src/services/remote-config.d.ts +27 -0
  70. package/dist/{services → src/services}/utils.d.ts +1 -1
  71. package/dist/src/theme/colors.d.ts +127 -0
  72. package/dist/src/theme/typography.d.ts +13 -0
  73. package/dist/src/types/api.d.ts +18 -0
  74. package/dist/style.css +2984 -0
  75. package/dist/styles.css +3760 -4014
  76. package/package.json +78 -68
  77. package/dist/_virtual/_commonjsHelpers.js +0 -9
  78. package/dist/_virtual/_commonjsHelpers.js.map +0 -1
  79. package/dist/_virtual/customParseFormat.js +0 -5
  80. package/dist/_virtual/customParseFormat.js.map +0 -1
  81. package/dist/_virtual/dayjs.min.js +0 -5
  82. package/dist/_virtual/dayjs.min.js.map +0 -1
  83. package/dist/_virtual/duration.js +0 -5
  84. package/dist/_virtual/duration.js.map +0 -1
  85. package/dist/_virtual/index.js +0 -5
  86. package/dist/_virtual/index.js.map +0 -1
  87. package/dist/_virtual/isBetween.js +0 -5
  88. package/dist/_virtual/isBetween.js.map +0 -1
  89. package/dist/_virtual/relativeTime.js +0 -5
  90. package/dist/_virtual/relativeTime.js.map +0 -1
  91. package/dist/_virtual/use-sync-external-store-shim.development.js +0 -5
  92. package/dist/_virtual/use-sync-external-store-shim.development.js.map +0 -1
  93. package/dist/_virtual/use-sync-external-store-shim.production.js +0 -5
  94. package/dist/_virtual/use-sync-external-store-shim.production.js.map +0 -1
  95. package/dist/_virtual/with-selector.development.js +0 -5
  96. package/dist/_virtual/with-selector.development.js.map +0 -1
  97. package/dist/_virtual/with-selector.js +0 -5
  98. package/dist/_virtual/with-selector.js.map +0 -1
  99. package/dist/_virtual/with-selector.production.js +0 -5
  100. package/dist/_virtual/with-selector.production.js.map +0 -1
  101. package/dist/components/Alert/Alert.js +0 -51
  102. package/dist/components/Alert/Alert.js.map +0 -1
  103. package/dist/components/Button/Button.js +0 -52
  104. package/dist/components/Button/Button.js.map +0 -1
  105. package/dist/components/Button/Button.test.d.ts +0 -1
  106. package/dist/components/Button/index.d.ts +0 -1
  107. package/dist/components/Checkbox/Checkbox.js +0 -50
  108. package/dist/components/Checkbox/Checkbox.js.map +0 -1
  109. package/dist/components/Checkbox/Checkbox.test.d.ts +0 -1
  110. package/dist/components/Checkbox/index.d.ts +0 -1
  111. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +0 -25
  112. package/dist/components/CheckboxGroup/CheckboxGroup.js +0 -99
  113. package/dist/components/CheckboxGroup/CheckboxGroup.js.map +0 -1
  114. package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +0 -15
  115. package/dist/components/ConfirmationModal/ConfirmationModal.js +0 -136
  116. package/dist/components/ConfirmationModal/ConfirmationModal.js.map +0 -1
  117. package/dist/components/ConfirmationModal/index.d.ts +0 -2
  118. package/dist/components/CustomSelect/CustomSelect.js +0 -259
  119. package/dist/components/CustomSelect/CustomSelect.js.map +0 -1
  120. package/dist/components/EventAddForm/AddEventLayout.js +0 -227
  121. package/dist/components/EventAddForm/AddEventLayout.js.map +0 -1
  122. package/dist/components/EventAddForm/AddEventStepper.js +0 -719
  123. package/dist/components/EventAddForm/AddEventStepper.js.map +0 -1
  124. package/dist/components/EventAddForm/common/ConfirmationModal.js +0 -136
  125. package/dist/components/EventAddForm/common/ConfirmationModal.js.map +0 -1
  126. package/dist/components/EventAddForm/common/DescriptionModal.js +0 -70
  127. package/dist/components/EventAddForm/common/DescriptionModal.js.map +0 -1
  128. package/dist/components/EventAddForm/components/AnimatedBackground.d.ts +0 -8
  129. package/dist/components/EventAddForm/components/ApprovalConfirmationModal.d.ts +0 -7
  130. package/dist/components/EventAddForm/components/CheckboxGroup.js +0 -92
  131. package/dist/components/EventAddForm/components/CheckboxGroup.js.map +0 -1
  132. package/dist/components/EventAddForm/components/CustomMeetingForm.js +0 -237
  133. package/dist/components/EventAddForm/components/CustomMeetingForm.js.map +0 -1
  134. package/dist/components/EventAddForm/components/DateTimeField.js +0 -173
  135. package/dist/components/EventAddForm/components/DateTimeField.js.map +0 -1
  136. package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.d.ts +0 -33
  137. package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.js +0 -366
  138. package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.js.map +0 -1
  139. package/dist/components/EventAddForm/components/FileUpload.js +0 -412
  140. package/dist/components/EventAddForm/components/FileUpload.js.map +0 -1
  141. package/dist/components/EventAddForm/components/FormBuilderProceedModal.js +0 -197
  142. package/dist/components/EventAddForm/components/FormBuilderProceedModal.js.map +0 -1
  143. package/dist/components/EventAddForm/components/GoogleMapsAutocompleteInput.js +0 -1179
  144. package/dist/components/EventAddForm/components/GoogleMapsAutocompleteInput.js.map +0 -1
  145. package/dist/components/EventAddForm/components/InputField.d.ts +0 -15
  146. package/dist/components/EventAddForm/components/RadioGroupButton.d.ts +0 -14
  147. package/dist/components/EventAddForm/components/SelectField.d.ts +0 -19
  148. package/dist/components/EventAddForm/components/SingleDateTimeInput.js +0 -102
  149. package/dist/components/EventAddForm/components/SingleDateTimeInput.js.map +0 -1
  150. package/dist/components/EventAddForm/components/StepTwo/CustomFormSection.js +0 -277
  151. package/dist/components/EventAddForm/components/StepTwo/CustomFormSection.js.map +0 -1
  152. package/dist/components/EventAddForm/components/StepTwo/TicketTierSection.js +0 -148
  153. package/dist/components/EventAddForm/components/StepTwo/TicketTierSection.js.map +0 -1
  154. package/dist/components/EventAddForm/components/TicketTierForm.js +0 -418
  155. package/dist/components/EventAddForm/components/TicketTierForm.js.map +0 -1
  156. package/dist/components/EventAddForm/components/TicketTypeSelection.js +0 -93
  157. package/dist/components/EventAddForm/components/TicketTypeSelection.js.map +0 -1
  158. package/dist/components/EventAddForm/hooks/useStepperForm.js +0 -371
  159. package/dist/components/EventAddForm/hooks/useStepperForm.js.map +0 -1
  160. package/dist/components/EventAddForm/hooks/useTicketTierForm.js +0 -237
  161. package/dist/components/EventAddForm/hooks/useTicketTierForm.js.map +0 -1
  162. package/dist/components/EventAddForm/index.d.ts +0 -3
  163. package/dist/components/EventAddForm/index.js +0 -41
  164. package/dist/components/EventAddForm/index.js.map +0 -1
  165. package/dist/components/EventAddForm/schemas/index.d.ts +0 -2
  166. package/dist/components/EventAddForm/schemas/step1.d.ts +0 -47
  167. package/dist/components/EventAddForm/schemas/step1.js +0 -135
  168. package/dist/components/EventAddForm/schemas/step1.js.map +0 -1
  169. package/dist/components/EventAddForm/schemas/step2.d.ts +0 -138
  170. package/dist/components/EventAddForm/schemas/step2.js +0 -94
  171. package/dist/components/EventAddForm/schemas/step2.js.map +0 -1
  172. package/dist/components/EventAddForm/schemas/utils.js +0 -28
  173. package/dist/components/EventAddForm/schemas/utils.js.map +0 -1
  174. package/dist/components/EventAddForm/steps/IndividualFormStep.js +0 -85
  175. package/dist/components/EventAddForm/steps/IndividualFormStep.js.map +0 -1
  176. package/dist/components/EventAddForm/steps/SocialProfilesStep.js +0 -123
  177. package/dist/components/EventAddForm/steps/SocialProfilesStep.js.map +0 -1
  178. package/dist/components/EventAddForm/steps/StepOne.js +0 -462
  179. package/dist/components/EventAddForm/steps/StepOne.js.map +0 -1
  180. package/dist/components/EventAddForm/steps/StepTwo.js +0 -173
  181. package/dist/components/EventAddForm/steps/StepTwo.js.map +0 -1
  182. package/dist/components/EventAddForm/steps/TeamFormStep.js +0 -13
  183. package/dist/components/EventAddForm/steps/TeamFormStep.js.map +0 -1
  184. package/dist/components/FormBuilder/CategoryList.js +0 -242
  185. package/dist/components/FormBuilder/CategoryList.js.map +0 -1
  186. package/dist/components/FormBuilder/DiscountInput.js +0 -366
  187. package/dist/components/FormBuilder/DiscountInput.js.map +0 -1
  188. package/dist/components/FormBuilder/FormBuilder.js +0 -918
  189. package/dist/components/FormBuilder/FormBuilder.js.map +0 -1
  190. package/dist/components/FormBuilder/OptionList.js +0 -120
  191. package/dist/components/FormBuilder/OptionList.js.map +0 -1
  192. package/dist/components/FormBuilder/PaymentPreview.d.ts +0 -12
  193. package/dist/components/FormBuilder/PaymentPreview.js +0 -70
  194. package/dist/components/FormBuilder/PaymentPreview.js.map +0 -1
  195. package/dist/components/FormBuilder/PreviewInput.d.ts +0 -10
  196. package/dist/components/FormBuilder/PreviewInput.js +0 -143
  197. package/dist/components/FormBuilder/PreviewInput.js.map +0 -1
  198. package/dist/components/FormBuilder/QuestionCard.js +0 -252
  199. package/dist/components/FormBuilder/QuestionCard.js.map +0 -1
  200. package/dist/components/FormBuilder/QuestionEditor.js +0 -166
  201. package/dist/components/FormBuilder/QuestionEditor.js.map +0 -1
  202. package/dist/components/FormBuilder/RequiredToggle.js +0 -43
  203. package/dist/components/FormBuilder/RequiredToggle.js.map +0 -1
  204. package/dist/components/FormBuilder/SortableQuestionList.js +0 -137
  205. package/dist/components/FormBuilder/SortableQuestionList.js.map +0 -1
  206. package/dist/components/FormBuilder/index.d.ts +0 -4
  207. package/dist/components/FormBuilder/utils.js +0 -229
  208. package/dist/components/FormBuilder/utils.js.map +0 -1
  209. package/dist/components/FormInput/FormInput.js +0 -126
  210. package/dist/components/FormInput/FormInput.js.map +0 -1
  211. package/dist/components/FormInput/FormInput.test.d.ts +0 -1
  212. package/dist/components/FormInput/index.d.ts +0 -2
  213. package/dist/components/ImageCropModal/index.js +0 -464
  214. package/dist/components/ImageCropModal/index.js.map +0 -1
  215. package/dist/components/InformationPopover/InformationPopover.d.ts +0 -7
  216. package/dist/components/InformationPopover/InformationPopover.js +0 -19
  217. package/dist/components/InformationPopover/InformationPopover.js.map +0 -1
  218. package/dist/components/InformationPopover.js +0 -19
  219. package/dist/components/InformationPopover.js.map +0 -1
  220. package/dist/components/InputErrorMessage/InputErrorMessage.js +0 -21
  221. package/dist/components/InputErrorMessage/InputErrorMessage.js.map +0 -1
  222. package/dist/components/Modal/Modal.d.ts +0 -15
  223. package/dist/components/Modal/Modal.js +0 -73
  224. package/dist/components/Modal/Modal.js.map +0 -1
  225. package/dist/components/Radio/Radio.js +0 -35
  226. package/dist/components/Radio/Radio.js.map +0 -1
  227. package/dist/components/Spinner/spinner.d.ts +0 -2
  228. package/dist/components/Spinner/spinner.js +0 -22
  229. package/dist/components/Spinner/spinner.js.map +0 -1
  230. package/dist/components/Toggle/Toggle.d.ts +0 -16
  231. package/dist/components/Toggle/index.d.ts +0 -2
  232. package/dist/components/Tooltip/Tooltip.d.ts +0 -12
  233. package/dist/components/Tooltip/Tooltip.js +0 -134
  234. package/dist/components/Tooltip/Tooltip.js.map +0 -1
  235. package/dist/components/common/FallbackImage.js +0 -47
  236. package/dist/components/common/FallbackImage.js.map +0 -1
  237. package/dist/components/ui/Calendar/calendar-utils.js +0 -51
  238. package/dist/components/ui/Calendar/calendar-utils.js.map +0 -1
  239. package/dist/components/ui/Calendar/index.js +0 -142
  240. package/dist/components/ui/Calendar/index.js.map +0 -1
  241. package/dist/components/ui/Checkbox.d.ts +0 -9
  242. package/dist/components/ui/Checkbox.js +0 -50
  243. package/dist/components/ui/Checkbox.js.map +0 -1
  244. package/dist/components/ui/DatePicker/index.js +0 -188
  245. package/dist/components/ui/DatePicker/index.js.map +0 -1
  246. package/dist/components/ui/FormInput.js +0 -129
  247. package/dist/components/ui/FormInput.js.map +0 -1
  248. package/dist/components/ui/InputErrorMessage.d.ts +0 -7
  249. package/dist/components/ui/InputErrorMessage.js +0 -21
  250. package/dist/components/ui/InputErrorMessage.js.map +0 -1
  251. package/dist/components/ui/Modal/index.js +0 -73
  252. package/dist/components/ui/Modal/index.js.map +0 -1
  253. package/dist/components/ui/Radio.d.ts +0 -6
  254. package/dist/components/ui/Radio.js +0 -35
  255. package/dist/components/ui/Radio.js.map +0 -1
  256. package/dist/components/ui/RichTextEditor.js +0 -242
  257. package/dist/components/ui/RichTextEditor.js.map +0 -1
  258. package/dist/components/ui/TimePicker/index.js +0 -215
  259. package/dist/components/ui/TimePicker/index.js.map +0 -1
  260. package/dist/components/ui/TimeSelector/index.js +0 -138
  261. package/dist/components/ui/TimeSelector/index.js.map +0 -1
  262. package/dist/components/ui/Tooltip.d.ts +0 -12
  263. package/dist/components/ui/Tooltip.js +0 -136
  264. package/dist/components/ui/Tooltip.js.map +0 -1
  265. package/dist/hooks/useDropdownPosition.d.ts +0 -11
  266. package/dist/hooks/useFirebaseAuthState.d.ts +0 -6
  267. package/dist/hooks/useFirebaseAuthState.js +0 -23
  268. package/dist/hooks/useFirebaseAuthState.js.map +0 -1
  269. package/dist/hooks/useTicketTierForm.d.ts +0 -61
  270. package/dist/lib/actions.js +0 -32
  271. package/dist/lib/actions.js.map +0 -1
  272. package/dist/lib/cropImage.js +0 -113
  273. package/dist/lib/cropImage.js.map +0 -1
  274. package/dist/lib/imageAnalysis.js +0 -58
  275. package/dist/lib/imageAnalysis.js.map +0 -1
  276. package/dist/lib/utils.js +0 -9
  277. package/dist/lib/utils.js.map +0 -1
  278. package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +0 -60
  279. package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js.map +0 -1
  280. package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +0 -3458
  281. package/dist/node_modules/@dnd-kit/core/dist/core.esm.js.map +0 -1
  282. package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +0 -593
  283. package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js.map +0 -1
  284. package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +0 -302
  285. package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js.map +0 -1
  286. package/dist/node_modules/@firebase/app/dist/esm/index.esm.js +0 -768
  287. package/dist/node_modules/@firebase/app/dist/esm/index.esm.js.map +0 -1
  288. package/dist/node_modules/@firebase/component/dist/esm/index.esm.js +0 -340
  289. package/dist/node_modules/@firebase/component/dist/esm/index.esm.js.map +0 -1
  290. package/dist/node_modules/@firebase/logger/dist/esm/index.esm.js +0 -123
  291. package/dist/node_modules/@firebase/logger/dist/esm/index.esm.js.map +0 -1
  292. package/dist/node_modules/@firebase/storage/dist/index.esm.js +0 -2623
  293. package/dist/node_modules/@firebase/storage/dist/index.esm.js.map +0 -1
  294. package/dist/node_modules/@firebase/util/dist/index.esm.js +0 -658
  295. package/dist/node_modules/@firebase/util/dist/index.esm.js.map +0 -1
  296. package/dist/node_modules/@firebase/util/dist/postinstall.js +0 -5
  297. package/dist/node_modules/@firebase/util/dist/postinstall.js.map +0 -1
  298. package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js +0 -3179
  299. package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js.map +0 -1
  300. package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js +0 -60
  301. package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js.map +0 -1
  302. package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js +0 -400
  303. package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js.map +0 -1
  304. package/dist/node_modules/@heroicons/react/20/solid/esm/CheckIcon.js +0 -27
  305. package/dist/node_modules/@heroicons/react/20/solid/esm/CheckIcon.js.map +0 -1
  306. package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js +0 -27
  307. package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js.map +0 -1
  308. package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowRightIcon.js +0 -29
  309. package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowRightIcon.js.map +0 -1
  310. package/dist/node_modules/@heroicons/react/24/outline/esm/ClockIcon.js +0 -29
  311. package/dist/node_modules/@heroicons/react/24/outline/esm/ClockIcon.js.map +0 -1
  312. package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentDuplicateIcon.js +0 -29
  313. package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentDuplicateIcon.js.map +0 -1
  314. package/dist/node_modules/@heroicons/react/24/outline/esm/InformationCircleIcon.js +0 -29
  315. package/dist/node_modules/@heroicons/react/24/outline/esm/InformationCircleIcon.js.map +0 -1
  316. package/dist/node_modules/@heroicons/react/24/outline/esm/LinkIcon.js +0 -29
  317. package/dist/node_modules/@heroicons/react/24/outline/esm/LinkIcon.js.map +0 -1
  318. package/dist/node_modules/@heroicons/react/24/outline/esm/MagnifyingGlassIcon.js +0 -29
  319. package/dist/node_modules/@heroicons/react/24/outline/esm/MagnifyingGlassIcon.js.map +0 -1
  320. package/dist/node_modules/@heroicons/react/24/outline/esm/MapPinIcon.js +0 -33
  321. package/dist/node_modules/@heroicons/react/24/outline/esm/MapPinIcon.js.map +0 -1
  322. package/dist/node_modules/@heroicons/react/24/outline/esm/VideoCameraIcon.js +0 -29
  323. package/dist/node_modules/@heroicons/react/24/outline/esm/VideoCameraIcon.js.map +0 -1
  324. package/dist/node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js +0 -29
  325. package/dist/node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js.map +0 -1
  326. package/dist/node_modules/@tiptap/core/dist/index.js +0 -5446
  327. package/dist/node_modules/@tiptap/core/dist/index.js.map +0 -1
  328. package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +0 -21
  329. package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +0 -1
  330. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +0 -78
  331. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +0 -1
  332. package/dist/node_modules/@tiptap/extension-bold/dist/index.js +0 -100
  333. package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +0 -1
  334. package/dist/node_modules/@tiptap/extension-code/dist/index.js +0 -70
  335. package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +0 -1
  336. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +0 -317
  337. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +0 -1
  338. package/dist/node_modules/@tiptap/extension-document/dist/index.js +0 -16
  339. package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +0 -1
  340. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +0 -66
  341. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +0 -1
  342. package/dist/node_modules/@tiptap/extension-heading/dist/index.js +0 -86
  343. package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +0 -1
  344. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +0 -80
  345. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +0 -1
  346. package/dist/node_modules/@tiptap/extension-italic/dist/index.js +0 -98
  347. package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +0 -1
  348. package/dist/node_modules/@tiptap/extension-link/dist/index.js +0 -423
  349. package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +0 -1
  350. package/dist/node_modules/@tiptap/extension-list/dist/index.js +0 -1039
  351. package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +0 -1
  352. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +0 -61
  353. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +0 -1
  354. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +0 -7
  355. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +0 -1
  356. package/dist/node_modules/@tiptap/extension-strike/dist/index.js +0 -79
  357. package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +0 -1
  358. package/dist/node_modules/@tiptap/extension-text/dist/index.js +0 -16
  359. package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +0 -1
  360. package/dist/node_modules/@tiptap/extension-underline/dist/index.js +0 -76
  361. package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +0 -1
  362. package/dist/node_modules/@tiptap/extensions/dist/index.js +0 -376
  363. package/dist/node_modules/@tiptap/extensions/dist/index.js.map +0 -1
  364. package/dist/node_modules/@tiptap/react/dist/index.js +0 -650
  365. package/dist/node_modules/@tiptap/react/dist/index.js.map +0 -1
  366. package/dist/node_modules/@tiptap/starter-kit/dist/index.js +0 -97
  367. package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +0 -1
  368. package/dist/node_modules/dayjs/dayjs.min.js +0 -283
  369. package/dist/node_modules/dayjs/dayjs.min.js.map +0 -1
  370. package/dist/node_modules/dayjs/plugin/customParseFormat.js +0 -130
  371. package/dist/node_modules/dayjs/plugin/customParseFormat.js.map +0 -1
  372. package/dist/node_modules/dayjs/plugin/duration.js +0 -137
  373. package/dist/node_modules/dayjs/plugin/duration.js.map +0 -1
  374. package/dist/node_modules/dayjs/plugin/isBetween.js +0 -20
  375. package/dist/node_modules/dayjs/plugin/isBetween.js.map +0 -1
  376. package/dist/node_modules/dayjs/plugin/relativeTime.js +0 -49
  377. package/dist/node_modules/dayjs/plugin/relativeTime.js.map +0 -1
  378. package/dist/node_modules/fast-equals/dist/es/index.js +0 -442
  379. package/dist/node_modules/fast-equals/dist/es/index.js.map +0 -1
  380. package/dist/node_modules/idb/build/index.js +0 -70
  381. package/dist/node_modules/idb/build/index.js.map +0 -1
  382. package/dist/node_modules/idb/build/wrap-idb-value.js +0 -149
  383. package/dist/node_modules/idb/build/wrap-idb-value.js.map +0 -1
  384. package/dist/node_modules/linkifyjs/dist/linkify.js +0 -1159
  385. package/dist/node_modules/linkifyjs/dist/linkify.js.map +0 -1
  386. package/dist/node_modules/orderedmap/dist/index.js +0 -120
  387. package/dist/node_modules/orderedmap/dist/index.js.map +0 -1
  388. package/dist/node_modules/prosemirror-commands/dist/index.js +0 -527
  389. package/dist/node_modules/prosemirror-commands/dist/index.js.map +0 -1
  390. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +0 -137
  391. package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +0 -1
  392. package/dist/node_modules/prosemirror-gapcursor/dist/index.js +0 -221
  393. package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +0 -1
  394. package/dist/node_modules/prosemirror-history/dist/index.js +0 -357
  395. package/dist/node_modules/prosemirror-history/dist/index.js.map +0 -1
  396. package/dist/node_modules/prosemirror-keymap/dist/index.js +0 -84
  397. package/dist/node_modules/prosemirror-keymap/dist/index.js.map +0 -1
  398. package/dist/node_modules/prosemirror-model/dist/index.js +0 -3209
  399. package/dist/node_modules/prosemirror-model/dist/index.js.map +0 -1
  400. package/dist/node_modules/prosemirror-schema-list/dist/index.js +0 -131
  401. package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +0 -1
  402. package/dist/node_modules/prosemirror-state/dist/index.js +0 -936
  403. package/dist/node_modules/prosemirror-state/dist/index.js.map +0 -1
  404. package/dist/node_modules/prosemirror-transform/dist/index.js +0 -1881
  405. package/dist/node_modules/prosemirror-transform/dist/index.js.map +0 -1
  406. package/dist/node_modules/prosemirror-view/dist/index.js +0 -5232
  407. package/dist/node_modules/prosemirror-view/dist/index.js.map +0 -1
  408. package/dist/node_modules/rope-sequence/dist/index.js +0 -184
  409. package/dist/node_modules/rope-sequence/dist/index.js.map +0 -1
  410. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +0 -82
  411. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +0 -1
  412. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +0 -78
  413. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +0 -1
  414. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -78
  415. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
  416. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -63
  417. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
  418. package/dist/node_modules/use-sync-external-store/shim/index.js +0 -13
  419. package/dist/node_modules/use-sync-external-store/shim/index.js.map +0 -1
  420. package/dist/node_modules/use-sync-external-store/shim/with-selector.js +0 -13
  421. package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +0 -1
  422. package/dist/node_modules/w3c-keyname/index.js +0 -106
  423. package/dist/node_modules/w3c-keyname/index.js.map +0 -1
  424. package/dist/node_modules/zod/v4/classic/coerce.js +0 -10
  425. package/dist/node_modules/zod/v4/classic/coerce.js.map +0 -1
  426. package/dist/node_modules/zod/v4/classic/compat.js +0 -8
  427. package/dist/node_modules/zod/v4/classic/compat.js.map +0 -1
  428. package/dist/node_modules/zod/v4/classic/errors.js +0 -45
  429. package/dist/node_modules/zod/v4/classic/errors.js.map +0 -1
  430. package/dist/node_modules/zod/v4/classic/iso.js +0 -44
  431. package/dist/node_modules/zod/v4/classic/iso.js.map +0 -1
  432. package/dist/node_modules/zod/v4/classic/parse.js +0 -30
  433. package/dist/node_modules/zod/v4/classic/parse.js.map +0 -1
  434. package/dist/node_modules/zod/v4/classic/schemas.js +0 -711
  435. package/dist/node_modules/zod/v4/classic/schemas.js.map +0 -1
  436. package/dist/node_modules/zod/v4/core/api.js +0 -588
  437. package/dist/node_modules/zod/v4/core/api.js.map +0 -1
  438. package/dist/node_modules/zod/v4/core/checks.js +0 -411
  439. package/dist/node_modules/zod/v4/core/checks.js.map +0 -1
  440. package/dist/node_modules/zod/v4/core/core.js +0 -75
  441. package/dist/node_modules/zod/v4/core/core.js.map +0 -1
  442. package/dist/node_modules/zod/v4/core/doc.js +0 -38
  443. package/dist/node_modules/zod/v4/core/doc.js.map +0 -1
  444. package/dist/node_modules/zod/v4/core/errors.js +0 -73
  445. package/dist/node_modules/zod/v4/core/errors.js.map +0 -1
  446. package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -359
  447. package/dist/node_modules/zod/v4/core/json-schema-processors.js.map +0 -1
  448. package/dist/node_modules/zod/v4/core/parse.js +0 -96
  449. package/dist/node_modules/zod/v4/core/parse.js.map +0 -1
  450. package/dist/node_modules/zod/v4/core/regexes.js +0 -84
  451. package/dist/node_modules/zod/v4/core/regexes.js.map +0 -1
  452. package/dist/node_modules/zod/v4/core/registries.js +0 -52
  453. package/dist/node_modules/zod/v4/core/registries.js.map +0 -1
  454. package/dist/node_modules/zod/v4/core/schemas.js +0 -1391
  455. package/dist/node_modules/zod/v4/core/schemas.js.map +0 -1
  456. package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -363
  457. package/dist/node_modules/zod/v4/core/to-json-schema.js.map +0 -1
  458. package/dist/node_modules/zod/v4/core/util.js +0 -431
  459. package/dist/node_modules/zod/v4/core/util.js.map +0 -1
  460. package/dist/node_modules/zod/v4/core/versions.js +0 -9
  461. package/dist/node_modules/zod/v4/core/versions.js.map +0 -1
  462. package/dist/redux/baseQuery.d.ts +0 -1
  463. package/dist/redux/baseQuery.js +0 -24
  464. package/dist/redux/baseQuery.js.map +0 -1
  465. package/dist/services/eventApi.js +0 -411
  466. package/dist/services/eventApi.js.map +0 -1
  467. package/dist/services/helpers.js +0 -115
  468. package/dist/services/helpers.js.map +0 -1
  469. package/dist/services/initialize-firebase.d.ts +0 -2
  470. package/dist/services/initialize-firebase.js +0 -20
  471. package/dist/services/initialize-firebase.js.map +0 -1
  472. package/dist/services/process-image-on-server.js +0 -30
  473. package/dist/services/process-image-on-server.js.map +0 -1
  474. package/dist/services/remote-config.d.ts +0 -5
  475. package/dist/services/remote-config.js +0 -9
  476. package/dist/services/remote-config.js.map +0 -1
  477. package/dist/services/single-event-api.js +0 -301
  478. package/dist/services/single-event-api.js.map +0 -1
  479. package/dist/services/utils.js +0 -107
  480. package/dist/services/utils.js.map +0 -1
  481. package/dist/setupTests.d.ts +0 -1
  482. package/dist/stories/Alert.stories.d.ts +0 -10
  483. package/dist/stories/Button.stories.d.ts +0 -13
  484. package/dist/types/redux-types.d.ts +0 -15
  485. package/dist/types/types.d.ts +0 -60
  486. package/dist/types/types.js +0 -10
  487. package/dist/types/types.js.map +0 -1
  488. package/dist/utils/cn.d.ts +0 -6
  489. package/dist/utils/cn.js +0 -9
  490. package/dist/utils/cn.js.map +0 -1
  491. package/dist/utils/date-range.d.ts +0 -4
  492. package/dist/utils/date-range.js +0 -13
  493. package/dist/utils/date-range.js.map +0 -1
  494. package/dist/utils/single-event-helpers.d.ts +0 -50
  495. package/dist/utils/single-event-helpers.js +0 -18
  496. package/dist/utils/single-event-helpers.js.map +0 -1
  497. package/dist/utils/social-validation.js +0 -42
  498. package/dist/utils/social-validation.js.map +0 -1
  499. package/dist/utils/utils.js +0 -20
  500. package/dist/utils/utils.js.map +0 -1
  501. /package/dist/{components/Alert/Alert.d.ts → src/components/Alert/index.d.ts} +0 -0
  502. /package/dist/{components → src/components}/FormBuilder/CategoryList.d.ts +0 -0
  503. /package/dist/{components → src/components}/FormBuilder/OptionList.d.ts +0 -0
  504. /package/dist/{components → src/components}/FormBuilder/RequiredToggle.d.ts +0 -0
  505. /package/dist/{components → src/components}/FormBuilder/types.d.ts +0 -0
  506. /package/dist/{components → src/components}/FormBuilder/utils.d.ts +0 -0
  507. /package/dist/{components → src/components}/ImageCropModal/index.d.ts +0 -0
  508. /package/dist/{components → src/components}/InformationPopover.d.ts +0 -0
  509. /package/dist/{components/EventAddForm → src/components/NewAddEvent}/common/DescriptionModal.d.ts +0 -0
  510. /package/dist/{components/ui/FormInput.d.ts → src/components/NewAddEvent/components/AddEventFormInput.d.ts} +0 -0
  511. /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/CheckboxGroup.d.ts +0 -0
  512. /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/CustomMeetingForm.d.ts +0 -0
  513. /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/DateTimeField.d.ts +0 -0
  514. /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/FileUpload.d.ts +0 -0
  515. /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/FormBuilderProceedModal.d.ts +0 -0
  516. /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/GoogleMapsAutocompleteInput.d.ts +0 -0
  517. /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/SingleDateTimeInput.d.ts +0 -0
  518. /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/StepTwo/CustomFormSection.d.ts +0 -0
  519. /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/TicketTypeSelection.d.ts +0 -0
  520. /package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/StepOne.d.ts +0 -0
  521. /package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/StepTwo.d.ts +0 -0
  522. /package/dist/{components/EventAddForm → src/components/NewAddEvent}/types.d.ts +0 -0
  523. /package/dist/{components → src/components}/common/FallbackImage.d.ts +0 -0
  524. /package/dist/{components → src/components}/ui/Calendar/calendar-utils.d.ts +0 -0
  525. /package/dist/{components → src/components}/ui/Calendar/index.d.ts +0 -0
  526. /package/dist/{components/Checkbox → src/components/ui}/Checkbox.d.ts +0 -0
  527. /package/dist/{components/CustomSelect → src/components/ui}/CustomSelect.d.ts +0 -0
  528. /package/dist/{components → src/components}/ui/DatePicker/index.d.ts +0 -0
  529. /package/dist/{components/InputErrorMessage → src/components/ui}/InputErrorMessage.d.ts +0 -0
  530. /package/dist/{components → src/components}/ui/Modal/index.d.ts +0 -0
  531. /package/dist/{components/Radio → src/components/ui}/Radio.d.ts +0 -0
  532. /package/dist/{components → src/components}/ui/RichTextEditor.d.ts +0 -0
  533. /package/dist/{components → src/components}/ui/TimePicker/index.d.ts +0 -0
  534. /package/dist/{components → src/components}/ui/TimeSelector/index.d.ts +0 -0
  535. /package/dist/{components → src/components}/ui/Tooltip/index.d.ts +0 -0
  536. /package/dist/{lib → src/lib}/constants.d.ts +0 -0
  537. /package/dist/{lib → src/lib}/cropImage.d.ts +0 -0
  538. /package/dist/{lib → src/lib}/imageAnalysis.d.ts +0 -0
  539. /package/dist/{utils → src/lib}/social-validation.d.ts +0 -0
  540. /package/dist/{lib/utils.d.ts → src/lib/tailwind-merge.d.ts} +0 -0
  541. /package/dist/{utils → src/lib}/utils.d.ts +0 -0
  542. /package/dist/{services → src/redux/features/single-event}/helpers.d.ts +0 -0
  543. /package/dist/{services → src/services}/process-image-on-server.d.ts +0 -0
  544. /package/dist/{types → src/types}/events.d.ts +0 -0
  545. /package/dist/{types → src/types}/question.d.ts +0 -0
@@ -1,1039 +0,0 @@
1
- import { Node as Node3, wrappingInputRule, mergeAttributes, renderNestedMarkdownContent, Extension, isNodeActive, isAtStartOfNode, isAtEndOfNode, getNodeType, getNodeAtPosition, getRenderedAttributes, parseIndentedBlocks } from "../../core/dist/index.js";
2
- var __defProp = Object.defineProperty;
3
- var __export = (target, all) => {
4
- for (var name in all)
5
- __defProp(target, name, { get: all[name], enumerable: true });
6
- };
7
- var ListItemName = "listItem";
8
- var TextStyleName = "textStyle";
9
- var bulletListInputRegex = /^\s*([-+*])\s$/;
10
- var BulletList = Node3.create({
11
- name: "bulletList",
12
- addOptions() {
13
- return {
14
- itemTypeName: "listItem",
15
- HTMLAttributes: {},
16
- keepMarks: false,
17
- keepAttributes: false
18
- };
19
- },
20
- group: "block list",
21
- content() {
22
- return `${this.options.itemTypeName}+`;
23
- },
24
- parseHTML() {
25
- return [{ tag: "ul" }];
26
- },
27
- renderHTML({ HTMLAttributes }) {
28
- return ["ul", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
29
- },
30
- markdownTokenName: "list",
31
- parseMarkdown: (token, helpers) => {
32
- if (token.type !== "list" || token.ordered) {
33
- return [];
34
- }
35
- return {
36
- type: "bulletList",
37
- content: token.items ? helpers.parseChildren(token.items) : []
38
- };
39
- },
40
- renderMarkdown: (node, h) => {
41
- if (!node.content) {
42
- return "";
43
- }
44
- return h.renderChildren(node.content, "\n");
45
- },
46
- markdownOptions: {
47
- indentsContent: true
48
- },
49
- addCommands() {
50
- return {
51
- toggleBulletList: () => ({ commands, chain }) => {
52
- if (this.options.keepAttributes) {
53
- return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName, this.editor.getAttributes(TextStyleName)).run();
54
- }
55
- return commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks);
56
- }
57
- };
58
- },
59
- addKeyboardShortcuts() {
60
- return {
61
- "Mod-Shift-8": () => this.editor.commands.toggleBulletList()
62
- };
63
- },
64
- addInputRules() {
65
- let inputRule = wrappingInputRule({
66
- find: bulletListInputRegex,
67
- type: this.type
68
- });
69
- if (this.options.keepMarks || this.options.keepAttributes) {
70
- inputRule = wrappingInputRule({
71
- find: bulletListInputRegex,
72
- type: this.type,
73
- keepMarks: this.options.keepMarks,
74
- keepAttributes: this.options.keepAttributes,
75
- getAttributes: () => {
76
- return this.editor.getAttributes(TextStyleName);
77
- },
78
- editor: this.editor
79
- });
80
- }
81
- return [inputRule];
82
- }
83
- });
84
- var ListItem = Node3.create({
85
- name: "listItem",
86
- addOptions() {
87
- return {
88
- HTMLAttributes: {},
89
- bulletListTypeName: "bulletList",
90
- orderedListTypeName: "orderedList"
91
- };
92
- },
93
- content: "paragraph block*",
94
- defining: true,
95
- parseHTML() {
96
- return [
97
- {
98
- tag: "li"
99
- }
100
- ];
101
- },
102
- renderHTML({ HTMLAttributes }) {
103
- return ["li", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
104
- },
105
- markdownTokenName: "list_item",
106
- parseMarkdown: (token, helpers) => {
107
- var _a;
108
- if (token.type !== "list_item") {
109
- return [];
110
- }
111
- const parseBlockChildren = (_a = helpers.parseBlockChildren) != null ? _a : helpers.parseChildren;
112
- let content = [];
113
- if (token.tokens && token.tokens.length > 0) {
114
- const hasParagraphTokens = token.tokens.some((t) => t.type === "paragraph");
115
- if (hasParagraphTokens) {
116
- content = parseBlockChildren(token.tokens);
117
- } else {
118
- const firstToken = token.tokens[0];
119
- if (firstToken && firstToken.type === "text" && firstToken.tokens && firstToken.tokens.length > 0) {
120
- const inlineContent = helpers.parseInline(firstToken.tokens);
121
- content = [
122
- {
123
- type: "paragraph",
124
- content: inlineContent
125
- }
126
- ];
127
- if (token.tokens.length > 1) {
128
- const remainingTokens = token.tokens.slice(1);
129
- const additionalContent = parseBlockChildren(remainingTokens);
130
- content.push(...additionalContent);
131
- }
132
- } else {
133
- content = parseBlockChildren(token.tokens);
134
- }
135
- }
136
- }
137
- if (content.length === 0) {
138
- content = [
139
- {
140
- type: "paragraph",
141
- content: []
142
- }
143
- ];
144
- }
145
- return {
146
- type: "listItem",
147
- content
148
- };
149
- },
150
- renderMarkdown: (node, h, ctx) => {
151
- return renderNestedMarkdownContent(
152
- node,
153
- h,
154
- (context) => {
155
- var _a, _b;
156
- if (context.parentType === "bulletList") {
157
- return "- ";
158
- }
159
- if (context.parentType === "orderedList") {
160
- const start = ((_b = (_a = context.meta) == null ? void 0 : _a.parentAttrs) == null ? void 0 : _b.start) || 1;
161
- return `${start + context.index}. `;
162
- }
163
- return "- ";
164
- },
165
- ctx
166
- );
167
- },
168
- addKeyboardShortcuts() {
169
- return {
170
- Enter: () => this.editor.commands.splitListItem(this.name),
171
- Tab: () => this.editor.commands.sinkListItem(this.name),
172
- "Shift-Tab": () => this.editor.commands.liftListItem(this.name)
173
- };
174
- }
175
- });
176
- var listHelpers_exports = {};
177
- __export(listHelpers_exports, {
178
- findListItemPos: () => findListItemPos,
179
- getNextListDepth: () => getNextListDepth,
180
- handleBackspace: () => handleBackspace,
181
- handleDelete: () => handleDelete,
182
- hasListBefore: () => hasListBefore,
183
- hasListItemAfter: () => hasListItemAfter,
184
- hasListItemBefore: () => hasListItemBefore,
185
- listItemHasSubList: () => listItemHasSubList,
186
- nextListIsDeeper: () => nextListIsDeeper,
187
- nextListIsHigher: () => nextListIsHigher
188
- });
189
- var findListItemPos = (typeOrName, state) => {
190
- const { $from } = state.selection;
191
- const nodeType = getNodeType(typeOrName, state.schema);
192
- let currentNode = null;
193
- let currentDepth = $from.depth;
194
- let currentPos = $from.pos;
195
- let targetDepth = null;
196
- while (currentDepth > 0 && targetDepth === null) {
197
- currentNode = $from.node(currentDepth);
198
- if (currentNode.type === nodeType) {
199
- targetDepth = currentDepth;
200
- } else {
201
- currentDepth -= 1;
202
- currentPos -= 1;
203
- }
204
- }
205
- if (targetDepth === null) {
206
- return null;
207
- }
208
- return { $pos: state.doc.resolve(currentPos), depth: targetDepth };
209
- };
210
- var getNextListDepth = (typeOrName, state) => {
211
- const listItemPos = findListItemPos(typeOrName, state);
212
- if (!listItemPos) {
213
- return false;
214
- }
215
- const [, depth] = getNodeAtPosition(state, typeOrName, listItemPos.$pos.pos + 4);
216
- return depth;
217
- };
218
- var hasListBefore = (editorState, name, parentListTypes) => {
219
- const { $anchor } = editorState.selection;
220
- const previousNodePos = Math.max(0, $anchor.pos - 2);
221
- const previousNode = editorState.doc.resolve(previousNodePos).node();
222
- if (!previousNode || !parentListTypes.includes(previousNode.type.name)) {
223
- return false;
224
- }
225
- return true;
226
- };
227
- var hasListItemBefore = (typeOrName, state) => {
228
- var _a;
229
- const { $anchor } = state.selection;
230
- const $targetPos = state.doc.resolve($anchor.pos - 2);
231
- if ($targetPos.index() === 0) {
232
- return false;
233
- }
234
- if (((_a = $targetPos.nodeBefore) == null ? void 0 : _a.type.name) !== typeOrName) {
235
- return false;
236
- }
237
- return true;
238
- };
239
- var listItemHasSubList = (typeOrName, state, node) => {
240
- if (!node) {
241
- return false;
242
- }
243
- const nodeType = getNodeType(typeOrName, state.schema);
244
- let hasSubList = false;
245
- node.descendants((child) => {
246
- if (child.type === nodeType) {
247
- hasSubList = true;
248
- }
249
- });
250
- return hasSubList;
251
- };
252
- var handleBackspace = (editor, name, parentListTypes) => {
253
- if (editor.commands.undoInputRule()) {
254
- return true;
255
- }
256
- if (editor.state.selection.from !== editor.state.selection.to) {
257
- return false;
258
- }
259
- if (!isNodeActive(editor.state, name) && hasListBefore(editor.state, name, parentListTypes)) {
260
- const { $anchor } = editor.state.selection;
261
- const $listPos = editor.state.doc.resolve($anchor.before() - 1);
262
- const listDescendants = [];
263
- $listPos.node().descendants((node, pos) => {
264
- if (node.type.name === name) {
265
- listDescendants.push({ node, pos });
266
- }
267
- });
268
- const lastItem = listDescendants.at(-1);
269
- if (!lastItem) {
270
- return false;
271
- }
272
- const $lastItemPos = editor.state.doc.resolve($listPos.start() + lastItem.pos + 1);
273
- return editor.chain().cut({ from: $anchor.start() - 1, to: $anchor.end() + 1 }, $lastItemPos.end()).joinForward().run();
274
- }
275
- if (!isNodeActive(editor.state, name)) {
276
- return false;
277
- }
278
- if (!isAtStartOfNode(editor.state)) {
279
- return false;
280
- }
281
- const listItemPos = findListItemPos(name, editor.state);
282
- if (!listItemPos) {
283
- return false;
284
- }
285
- const $prev = editor.state.doc.resolve(listItemPos.$pos.pos - 2);
286
- const prevNode = $prev.node(listItemPos.depth);
287
- const previousListItemHasSubList = listItemHasSubList(name, editor.state, prevNode);
288
- if (hasListItemBefore(name, editor.state) && !previousListItemHasSubList) {
289
- return editor.commands.joinItemBackward();
290
- }
291
- return editor.chain().liftListItem(name).run();
292
- };
293
- var nextListIsDeeper = (typeOrName, state) => {
294
- const listDepth = getNextListDepth(typeOrName, state);
295
- const listItemPos = findListItemPos(typeOrName, state);
296
- if (!listItemPos || !listDepth) {
297
- return false;
298
- }
299
- if (listDepth > listItemPos.depth) {
300
- return true;
301
- }
302
- return false;
303
- };
304
- var nextListIsHigher = (typeOrName, state) => {
305
- const listDepth = getNextListDepth(typeOrName, state);
306
- const listItemPos = findListItemPos(typeOrName, state);
307
- if (!listItemPos || !listDepth) {
308
- return false;
309
- }
310
- if (listDepth < listItemPos.depth) {
311
- return true;
312
- }
313
- return false;
314
- };
315
- var handleDelete = (editor, name) => {
316
- if (!isNodeActive(editor.state, name)) {
317
- return false;
318
- }
319
- if (!isAtEndOfNode(editor.state, name)) {
320
- return false;
321
- }
322
- const { selection } = editor.state;
323
- const { $from, $to } = selection;
324
- if (!selection.empty && $from.sameParent($to)) {
325
- return false;
326
- }
327
- if (nextListIsDeeper(name, editor.state)) {
328
- return editor.chain().focus(editor.state.selection.from + 4).lift(name).joinBackward().run();
329
- }
330
- if (nextListIsHigher(name, editor.state)) {
331
- return editor.chain().joinForward().joinBackward().run();
332
- }
333
- return editor.commands.joinItemForward();
334
- };
335
- var hasListItemAfter = (typeOrName, state) => {
336
- var _a;
337
- const { $anchor } = state.selection;
338
- const $targetPos = state.doc.resolve($anchor.pos - $anchor.parentOffset - 2);
339
- if ($targetPos.index() === $targetPos.parent.childCount - 1) {
340
- return false;
341
- }
342
- if (((_a = $targetPos.nodeAfter) == null ? void 0 : _a.type.name) !== typeOrName) {
343
- return false;
344
- }
345
- return true;
346
- };
347
- var ListKeymap = Extension.create({
348
- name: "listKeymap",
349
- addOptions() {
350
- return {
351
- listTypes: [
352
- {
353
- itemName: "listItem",
354
- wrapperNames: ["bulletList", "orderedList"]
355
- },
356
- {
357
- itemName: "taskItem",
358
- wrapperNames: ["taskList"]
359
- }
360
- ]
361
- };
362
- },
363
- addKeyboardShortcuts() {
364
- return {
365
- Delete: ({ editor }) => {
366
- let handled = false;
367
- this.options.listTypes.forEach(({ itemName }) => {
368
- if (editor.state.schema.nodes[itemName] === void 0) {
369
- return;
370
- }
371
- if (handleDelete(editor, itemName)) {
372
- handled = true;
373
- }
374
- });
375
- return handled;
376
- },
377
- "Mod-Delete": ({ editor }) => {
378
- let handled = false;
379
- this.options.listTypes.forEach(({ itemName }) => {
380
- if (editor.state.schema.nodes[itemName] === void 0) {
381
- return;
382
- }
383
- if (handleDelete(editor, itemName)) {
384
- handled = true;
385
- }
386
- });
387
- return handled;
388
- },
389
- Backspace: ({ editor }) => {
390
- let handled = false;
391
- this.options.listTypes.forEach(({ itemName, wrapperNames }) => {
392
- if (editor.state.schema.nodes[itemName] === void 0) {
393
- return;
394
- }
395
- if (handleBackspace(editor, itemName, wrapperNames)) {
396
- handled = true;
397
- }
398
- });
399
- return handled;
400
- },
401
- "Mod-Backspace": ({ editor }) => {
402
- let handled = false;
403
- this.options.listTypes.forEach(({ itemName, wrapperNames }) => {
404
- if (editor.state.schema.nodes[itemName] === void 0) {
405
- return;
406
- }
407
- if (handleBackspace(editor, itemName, wrapperNames)) {
408
- handled = true;
409
- }
410
- });
411
- return handled;
412
- }
413
- };
414
- }
415
- });
416
- var ORDERED_LIST_ITEM_REGEX = /^(\s*)(\d+)\.\s+(.*)$/;
417
- var INDENTED_LINE_REGEX = /^\s/;
418
- function collectOrderedListItems(lines) {
419
- const listItems = [];
420
- let currentLineIndex = 0;
421
- let consumed = 0;
422
- while (currentLineIndex < lines.length) {
423
- const line = lines[currentLineIndex];
424
- const match = line.match(ORDERED_LIST_ITEM_REGEX);
425
- if (!match) {
426
- break;
427
- }
428
- const [, indent, number, content] = match;
429
- const indentLevel = indent.length;
430
- let itemContent = content;
431
- let nextLineIndex = currentLineIndex + 1;
432
- const itemLines = [line];
433
- while (nextLineIndex < lines.length) {
434
- const nextLine = lines[nextLineIndex];
435
- const nextMatch = nextLine.match(ORDERED_LIST_ITEM_REGEX);
436
- if (nextMatch) {
437
- break;
438
- }
439
- if (nextLine.trim() === "") {
440
- itemLines.push(nextLine);
441
- itemContent += "\n";
442
- nextLineIndex += 1;
443
- } else if (nextLine.match(INDENTED_LINE_REGEX)) {
444
- itemLines.push(nextLine);
445
- itemContent += `
446
- ${nextLine.slice(indentLevel + 2)}`;
447
- nextLineIndex += 1;
448
- } else {
449
- break;
450
- }
451
- }
452
- listItems.push({
453
- indent: indentLevel,
454
- number: parseInt(number, 10),
455
- content: itemContent.trim(),
456
- raw: itemLines.join("\n")
457
- });
458
- consumed = nextLineIndex;
459
- currentLineIndex = nextLineIndex;
460
- }
461
- return [listItems, consumed];
462
- }
463
- function buildNestedStructure(items, baseIndent, lexer) {
464
- var _a;
465
- const result = [];
466
- let currentIndex = 0;
467
- while (currentIndex < items.length) {
468
- const item = items[currentIndex];
469
- if (item.indent === baseIndent) {
470
- const contentLines = item.content.split("\n");
471
- const mainText = ((_a = contentLines[0]) == null ? void 0 : _a.trim()) || "";
472
- const tokens = [];
473
- if (mainText) {
474
- tokens.push({
475
- type: "paragraph",
476
- raw: mainText,
477
- tokens: lexer.inlineTokens(mainText)
478
- });
479
- }
480
- const additionalContent = contentLines.slice(1).join("\n").trim();
481
- if (additionalContent) {
482
- const blockTokens = lexer.blockTokens(additionalContent);
483
- tokens.push(...blockTokens);
484
- }
485
- let lookAheadIndex = currentIndex + 1;
486
- const nestedItems = [];
487
- while (lookAheadIndex < items.length && items[lookAheadIndex].indent > baseIndent) {
488
- nestedItems.push(items[lookAheadIndex]);
489
- lookAheadIndex += 1;
490
- }
491
- if (nestedItems.length > 0) {
492
- const nextIndent = Math.min(...nestedItems.map((nestedItem) => nestedItem.indent));
493
- const nestedListItems = buildNestedStructure(nestedItems, nextIndent, lexer);
494
- tokens.push({
495
- type: "list",
496
- ordered: true,
497
- start: nestedItems[0].number,
498
- items: nestedListItems,
499
- raw: nestedItems.map((nestedItem) => nestedItem.raw).join("\n")
500
- });
501
- }
502
- result.push({
503
- type: "list_item",
504
- raw: item.raw,
505
- tokens
506
- });
507
- currentIndex = lookAheadIndex;
508
- } else {
509
- currentIndex += 1;
510
- }
511
- }
512
- return result;
513
- }
514
- function parseListItems(items, helpers) {
515
- return items.map((item) => {
516
- if (item.type !== "list_item") {
517
- return helpers.parseChildren([item])[0];
518
- }
519
- const content = [];
520
- if (item.tokens && item.tokens.length > 0) {
521
- item.tokens.forEach((itemToken) => {
522
- if (itemToken.type === "paragraph" || itemToken.type === "list" || itemToken.type === "blockquote" || itemToken.type === "code") {
523
- content.push(...helpers.parseChildren([itemToken]));
524
- } else if (itemToken.type === "text" && itemToken.tokens) {
525
- const inlineContent = helpers.parseChildren([itemToken]);
526
- content.push({
527
- type: "paragraph",
528
- content: inlineContent
529
- });
530
- } else {
531
- const parsed = helpers.parseChildren([itemToken]);
532
- if (parsed.length > 0) {
533
- content.push(...parsed);
534
- }
535
- }
536
- });
537
- }
538
- return {
539
- type: "listItem",
540
- content
541
- };
542
- });
543
- }
544
- var ListItemName2 = "listItem";
545
- var TextStyleName2 = "textStyle";
546
- var orderedListInputRegex = /^(\d+)\.\s$/;
547
- var OrderedList = Node3.create({
548
- name: "orderedList",
549
- addOptions() {
550
- return {
551
- itemTypeName: "listItem",
552
- HTMLAttributes: {},
553
- keepMarks: false,
554
- keepAttributes: false
555
- };
556
- },
557
- group: "block list",
558
- content() {
559
- return `${this.options.itemTypeName}+`;
560
- },
561
- addAttributes() {
562
- return {
563
- start: {
564
- default: 1,
565
- parseHTML: (element) => {
566
- return element.hasAttribute("start") ? parseInt(element.getAttribute("start") || "", 10) : 1;
567
- }
568
- },
569
- type: {
570
- default: null,
571
- parseHTML: (element) => element.getAttribute("type")
572
- }
573
- };
574
- },
575
- parseHTML() {
576
- return [
577
- {
578
- tag: "ol"
579
- }
580
- ];
581
- },
582
- renderHTML({ HTMLAttributes }) {
583
- const { start, ...attributesWithoutStart } = HTMLAttributes;
584
- return start === 1 ? ["ol", mergeAttributes(this.options.HTMLAttributes, attributesWithoutStart), 0] : ["ol", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
585
- },
586
- markdownTokenName: "list",
587
- parseMarkdown: (token, helpers) => {
588
- if (token.type !== "list" || !token.ordered) {
589
- return [];
590
- }
591
- const startValue = token.start || 1;
592
- const content = token.items ? parseListItems(token.items, helpers) : [];
593
- if (startValue !== 1) {
594
- return {
595
- type: "orderedList",
596
- attrs: { start: startValue },
597
- content
598
- };
599
- }
600
- return {
601
- type: "orderedList",
602
- content
603
- };
604
- },
605
- renderMarkdown: (node, h) => {
606
- if (!node.content) {
607
- return "";
608
- }
609
- return h.renderChildren(node.content, "\n");
610
- },
611
- markdownTokenizer: {
612
- name: "orderedList",
613
- level: "block",
614
- start: (src) => {
615
- const match = src.match(/^(\s*)(\d+)\.\s+/);
616
- const index = match == null ? void 0 : match.index;
617
- return index !== void 0 ? index : -1;
618
- },
619
- tokenize: (src, _tokens, lexer) => {
620
- var _a;
621
- const lines = src.split("\n");
622
- const [listItems, consumed] = collectOrderedListItems(lines);
623
- if (listItems.length === 0) {
624
- return void 0;
625
- }
626
- const items = buildNestedStructure(listItems, 0, lexer);
627
- if (items.length === 0) {
628
- return void 0;
629
- }
630
- const startValue = ((_a = listItems[0]) == null ? void 0 : _a.number) || 1;
631
- return {
632
- type: "list",
633
- ordered: true,
634
- start: startValue,
635
- items,
636
- raw: lines.slice(0, consumed).join("\n")
637
- };
638
- }
639
- },
640
- markdownOptions: {
641
- indentsContent: true
642
- },
643
- addCommands() {
644
- return {
645
- toggleOrderedList: () => ({ commands, chain }) => {
646
- if (this.options.keepAttributes) {
647
- return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName2, this.editor.getAttributes(TextStyleName2)).run();
648
- }
649
- return commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks);
650
- }
651
- };
652
- },
653
- addKeyboardShortcuts() {
654
- return {
655
- "Mod-Shift-7": () => this.editor.commands.toggleOrderedList()
656
- };
657
- },
658
- addInputRules() {
659
- let inputRule = wrappingInputRule({
660
- find: orderedListInputRegex,
661
- type: this.type,
662
- getAttributes: (match) => ({ start: +match[1] }),
663
- joinPredicate: (match, node) => node.childCount + node.attrs.start === +match[1]
664
- });
665
- if (this.options.keepMarks || this.options.keepAttributes) {
666
- inputRule = wrappingInputRule({
667
- find: orderedListInputRegex,
668
- type: this.type,
669
- keepMarks: this.options.keepMarks,
670
- keepAttributes: this.options.keepAttributes,
671
- getAttributes: (match) => ({ start: +match[1], ...this.editor.getAttributes(TextStyleName2) }),
672
- joinPredicate: (match, node) => node.childCount + node.attrs.start === +match[1],
673
- editor: this.editor
674
- });
675
- }
676
- return [inputRule];
677
- }
678
- });
679
- var inputRegex = /^\s*(\[([( |x])?\])\s$/;
680
- var TaskItem = Node3.create({
681
- name: "taskItem",
682
- addOptions() {
683
- return {
684
- nested: false,
685
- HTMLAttributes: {},
686
- taskListTypeName: "taskList",
687
- a11y: void 0
688
- };
689
- },
690
- content() {
691
- return this.options.nested ? "paragraph block*" : "paragraph+";
692
- },
693
- defining: true,
694
- addAttributes() {
695
- return {
696
- checked: {
697
- default: false,
698
- keepOnSplit: false,
699
- parseHTML: (element) => {
700
- const dataChecked = element.getAttribute("data-checked");
701
- return dataChecked === "" || dataChecked === "true";
702
- },
703
- renderHTML: (attributes) => ({
704
- "data-checked": attributes.checked
705
- })
706
- }
707
- };
708
- },
709
- parseHTML() {
710
- return [
711
- {
712
- tag: `li[data-type="${this.name}"]`,
713
- priority: 51
714
- }
715
- ];
716
- },
717
- renderHTML({ node, HTMLAttributes }) {
718
- return [
719
- "li",
720
- mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
721
- "data-type": this.name
722
- }),
723
- [
724
- "label",
725
- [
726
- "input",
727
- {
728
- type: "checkbox",
729
- checked: node.attrs.checked ? "checked" : null
730
- }
731
- ],
732
- ["span"]
733
- ],
734
- ["div", 0]
735
- ];
736
- },
737
- parseMarkdown: (token, h) => {
738
- const content = [];
739
- if (token.tokens && token.tokens.length > 0) {
740
- content.push(h.createNode("paragraph", {}, h.parseInline(token.tokens)));
741
- } else if (token.text) {
742
- content.push(h.createNode("paragraph", {}, [h.createNode("text", { text: token.text })]));
743
- } else {
744
- content.push(h.createNode("paragraph", {}, []));
745
- }
746
- if (token.nestedTokens && token.nestedTokens.length > 0) {
747
- const nestedContent = h.parseChildren(token.nestedTokens);
748
- content.push(...nestedContent);
749
- }
750
- return h.createNode("taskItem", { checked: token.checked || false }, content);
751
- },
752
- renderMarkdown: (node, h) => {
753
- var _a;
754
- const checkedChar = ((_a = node.attrs) == null ? void 0 : _a.checked) ? "x" : " ";
755
- const prefix = `- [${checkedChar}] `;
756
- return renderNestedMarkdownContent(node, h, prefix);
757
- },
758
- addKeyboardShortcuts() {
759
- const shortcuts = {
760
- Enter: () => this.editor.commands.splitListItem(this.name),
761
- "Shift-Tab": () => this.editor.commands.liftListItem(this.name)
762
- };
763
- if (!this.options.nested) {
764
- return shortcuts;
765
- }
766
- return {
767
- ...shortcuts,
768
- Tab: () => this.editor.commands.sinkListItem(this.name)
769
- };
770
- },
771
- addNodeView() {
772
- return ({ node, HTMLAttributes, getPos, editor }) => {
773
- const listItem = document.createElement("li");
774
- const checkboxWrapper = document.createElement("label");
775
- const checkboxStyler = document.createElement("span");
776
- const checkbox = document.createElement("input");
777
- const content = document.createElement("div");
778
- const updateA11Y = (currentNode) => {
779
- var _a, _b;
780
- checkbox.ariaLabel = ((_b = (_a = this.options.a11y) == null ? void 0 : _a.checkboxLabel) == null ? void 0 : _b.call(_a, currentNode, checkbox.checked)) || `Task item checkbox for ${currentNode.textContent || "empty task item"}`;
781
- };
782
- updateA11Y(node);
783
- checkboxWrapper.contentEditable = "false";
784
- checkbox.type = "checkbox";
785
- checkbox.addEventListener("mousedown", (event) => event.preventDefault());
786
- checkbox.addEventListener("change", (event) => {
787
- if (!editor.isEditable && !this.options.onReadOnlyChecked) {
788
- checkbox.checked = !checkbox.checked;
789
- return;
790
- }
791
- const { checked } = event.target;
792
- if (editor.isEditable && typeof getPos === "function") {
793
- editor.chain().focus(void 0, { scrollIntoView: false }).command(({ tr }) => {
794
- const position = getPos();
795
- if (typeof position !== "number") {
796
- return false;
797
- }
798
- const currentNode = tr.doc.nodeAt(position);
799
- tr.setNodeMarkup(position, void 0, {
800
- ...currentNode == null ? void 0 : currentNode.attrs,
801
- checked
802
- });
803
- return true;
804
- }).run();
805
- }
806
- if (!editor.isEditable && this.options.onReadOnlyChecked) {
807
- if (!this.options.onReadOnlyChecked(node, checked)) {
808
- checkbox.checked = !checkbox.checked;
809
- }
810
- }
811
- });
812
- Object.entries(this.options.HTMLAttributes).forEach(([key, value]) => {
813
- listItem.setAttribute(key, value);
814
- });
815
- listItem.dataset.checked = node.attrs.checked;
816
- checkbox.checked = node.attrs.checked;
817
- checkboxWrapper.append(checkbox, checkboxStyler);
818
- listItem.append(checkboxWrapper, content);
819
- Object.entries(HTMLAttributes).forEach(([key, value]) => {
820
- listItem.setAttribute(key, value);
821
- });
822
- let prevRenderedAttributeKeys = new Set(Object.keys(HTMLAttributes));
823
- return {
824
- dom: listItem,
825
- contentDOM: content,
826
- update: (updatedNode) => {
827
- if (updatedNode.type !== this.type) {
828
- return false;
829
- }
830
- listItem.dataset.checked = updatedNode.attrs.checked;
831
- checkbox.checked = updatedNode.attrs.checked;
832
- updateA11Y(updatedNode);
833
- const extensionAttributes = editor.extensionManager.attributes;
834
- const newHTMLAttributes = getRenderedAttributes(updatedNode, extensionAttributes);
835
- const newKeys = new Set(Object.keys(newHTMLAttributes));
836
- const staticAttrs = this.options.HTMLAttributes;
837
- prevRenderedAttributeKeys.forEach((key) => {
838
- if (!newKeys.has(key)) {
839
- if (key in staticAttrs) {
840
- listItem.setAttribute(key, staticAttrs[key]);
841
- } else {
842
- listItem.removeAttribute(key);
843
- }
844
- }
845
- });
846
- Object.entries(newHTMLAttributes).forEach(([key, value]) => {
847
- if (value === null || value === void 0) {
848
- if (key in staticAttrs) {
849
- listItem.setAttribute(key, staticAttrs[key]);
850
- } else {
851
- listItem.removeAttribute(key);
852
- }
853
- } else {
854
- listItem.setAttribute(key, value);
855
- }
856
- });
857
- prevRenderedAttributeKeys = newKeys;
858
- return true;
859
- }
860
- };
861
- };
862
- },
863
- addInputRules() {
864
- return [
865
- wrappingInputRule({
866
- find: inputRegex,
867
- type: this.type,
868
- getAttributes: (match) => ({
869
- checked: match[match.length - 1] === "x"
870
- })
871
- })
872
- ];
873
- }
874
- });
875
- var TaskList = Node3.create({
876
- name: "taskList",
877
- addOptions() {
878
- return {
879
- itemTypeName: "taskItem",
880
- HTMLAttributes: {}
881
- };
882
- },
883
- group: "block list",
884
- content() {
885
- return `${this.options.itemTypeName}+`;
886
- },
887
- parseHTML() {
888
- return [
889
- {
890
- tag: `ul[data-type="${this.name}"]`,
891
- priority: 51
892
- }
893
- ];
894
- },
895
- renderHTML({ HTMLAttributes }) {
896
- return ["ul", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { "data-type": this.name }), 0];
897
- },
898
- parseMarkdown: (token, h) => {
899
- return h.createNode("taskList", {}, h.parseChildren(token.items || []));
900
- },
901
- renderMarkdown: (node, h) => {
902
- if (!node.content) {
903
- return "";
904
- }
905
- return h.renderChildren(node.content, "\n");
906
- },
907
- markdownTokenizer: {
908
- name: "taskList",
909
- level: "block",
910
- start(src) {
911
- var _a;
912
- const index = (_a = src.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)) == null ? void 0 : _a.index;
913
- return index !== void 0 ? index : -1;
914
- },
915
- tokenize(src, tokens, lexer) {
916
- const parseTaskListContent = (content) => {
917
- const nestedResult = parseIndentedBlocks(
918
- content,
919
- {
920
- itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
921
- extractItemData: (match) => ({
922
- indentLevel: match[1].length,
923
- mainContent: match[4],
924
- checked: match[3].toLowerCase() === "x"
925
- }),
926
- createToken: (data, nestedTokens) => ({
927
- type: "taskItem",
928
- raw: "",
929
- mainContent: data.mainContent,
930
- indentLevel: data.indentLevel,
931
- checked: data.checked,
932
- text: data.mainContent,
933
- tokens: lexer.inlineTokens(data.mainContent),
934
- nestedTokens
935
- }),
936
- // Allow recursive nesting
937
- customNestedParser: parseTaskListContent
938
- },
939
- lexer
940
- );
941
- if (nestedResult) {
942
- return [
943
- {
944
- type: "taskList",
945
- raw: nestedResult.raw,
946
- items: nestedResult.items
947
- }
948
- ];
949
- }
950
- return lexer.blockTokens(content);
951
- };
952
- const result = parseIndentedBlocks(
953
- src,
954
- {
955
- itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
956
- extractItemData: (match) => ({
957
- indentLevel: match[1].length,
958
- mainContent: match[4],
959
- checked: match[3].toLowerCase() === "x"
960
- }),
961
- createToken: (data, nestedTokens) => ({
962
- type: "taskItem",
963
- raw: "",
964
- mainContent: data.mainContent,
965
- indentLevel: data.indentLevel,
966
- checked: data.checked,
967
- text: data.mainContent,
968
- tokens: lexer.inlineTokens(data.mainContent),
969
- nestedTokens
970
- }),
971
- // Use the recursive parser for nested content
972
- customNestedParser: parseTaskListContent
973
- },
974
- lexer
975
- );
976
- if (!result) {
977
- return void 0;
978
- }
979
- return {
980
- type: "taskList",
981
- raw: result.raw,
982
- items: result.items
983
- };
984
- }
985
- },
986
- markdownOptions: {
987
- indentsContent: true
988
- },
989
- addCommands() {
990
- return {
991
- toggleTaskList: () => ({ commands }) => {
992
- return commands.toggleList(this.name, this.options.itemTypeName);
993
- }
994
- };
995
- },
996
- addKeyboardShortcuts() {
997
- return {
998
- "Mod-Shift-9": () => this.editor.commands.toggleTaskList()
999
- };
1000
- }
1001
- });
1002
- Extension.create({
1003
- name: "listKit",
1004
- addExtensions() {
1005
- const extensions = [];
1006
- if (this.options.bulletList !== false) {
1007
- extensions.push(BulletList.configure(this.options.bulletList));
1008
- }
1009
- if (this.options.listItem !== false) {
1010
- extensions.push(ListItem.configure(this.options.listItem));
1011
- }
1012
- if (this.options.listKeymap !== false) {
1013
- extensions.push(ListKeymap.configure(this.options.listKeymap));
1014
- }
1015
- if (this.options.orderedList !== false) {
1016
- extensions.push(OrderedList.configure(this.options.orderedList));
1017
- }
1018
- if (this.options.taskItem !== false) {
1019
- extensions.push(TaskItem.configure(this.options.taskItem));
1020
- }
1021
- if (this.options.taskList !== false) {
1022
- extensions.push(TaskList.configure(this.options.taskList));
1023
- }
1024
- return extensions;
1025
- }
1026
- });
1027
- export {
1028
- BulletList,
1029
- ListItem,
1030
- ListKeymap,
1031
- OrderedList,
1032
- TaskItem,
1033
- TaskList,
1034
- bulletListInputRegex,
1035
- inputRegex,
1036
- listHelpers_exports as listHelpers,
1037
- orderedListInputRegex
1038
- };
1039
- //# sourceMappingURL=index.js.map