@uva-glass/component-library 3.55.3 → 3.55.5

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 (253) hide show
  1. package/dist/{Accordion-BpnBHYIx.js → Accordion-DvblEUVu.js} +16 -17
  2. package/dist/{Accordion-BpnBHYIx.js.map → Accordion-DvblEUVu.js.map} +1 -1
  3. package/dist/{AddCatalogueLinkForm-Cy6fPNvN.js → AddCatalogueLinkForm-rph4K9P0.js} +24 -25
  4. package/dist/{AddCatalogueLinkForm-Cy6fPNvN.js.map → AddCatalogueLinkForm-rph4K9P0.js.map} +1 -1
  5. package/dist/{CheckboxButtonBar-CalU0IYK.js → CheckboxButtonBar-5UMIFMKH.js} +2 -2
  6. package/dist/{CheckboxButtonBar-CalU0IYK.js.map → CheckboxButtonBar-5UMIFMKH.js.map} +1 -1
  7. package/dist/{ControlsButton-zemVxTlg.js → ControlsButton-B1XRpMUM.js} +15 -16
  8. package/dist/{ControlsButton-zemVxTlg.js.map → ControlsButton-B1XRpMUM.js.map} +1 -1
  9. package/dist/{Drawer-Ggofac6y.js → Drawer-e7UFHVg9.js} +29 -30
  10. package/dist/{Drawer-Ggofac6y.js.map → Drawer-e7UFHVg9.js.map} +1 -1
  11. package/dist/{FieldHint-D0HtbTnt.js → FieldHint-fxnEOsVZ.js} +2 -2
  12. package/dist/{FieldHint-D0HtbTnt.js.map → FieldHint-fxnEOsVZ.js.map} +1 -1
  13. package/dist/Fieldset-0LFsZ3Mz.js +22 -0
  14. package/dist/{Fieldset-CoNu_Owa.js.map → Fieldset-0LFsZ3Mz.js.map} +1 -1
  15. package/dist/{Lexical.prod-DIglXatJ.js → Lexical.prod-sbwgNRjw.js} +575 -568
  16. package/dist/Lexical.prod-sbwgNRjw.js.map +1 -0
  17. package/dist/{LexicalClipboard.prod-Bnzu0sh_.js → LexicalClipboard.prod-DdImsyd1.js} +82 -82
  18. package/dist/{LexicalClipboard.prod-Bnzu0sh_.js.map → LexicalClipboard.prod-DdImsyd1.js.map} +1 -1
  19. package/dist/{LexicalExtension.prod-COPHoPpX.js → LexicalExtension.prod-jTSDl1mh.js} +208 -198
  20. package/dist/LexicalExtension.prod-jTSDl1mh.js.map +1 -0
  21. package/dist/{LexicalLink.prod-Bf9JUdMv.js → LexicalLink.prod-BKLNLyu8.js} +155 -149
  22. package/dist/LexicalLink.prod-BKLNLyu8.js.map +1 -0
  23. package/dist/{LexicalList.prod-DRz8vsM9.js → LexicalList.prod-DEtc4lSr.js} +222 -222
  24. package/dist/{LexicalList.prod-DRz8vsM9.js.map → LexicalList.prod-DEtc4lSr.js.map} +1 -1
  25. package/dist/{LexicalTable.prod-D16GW-aZ.js → LexicalTable.prod-CpIPDW6z.js} +436 -428
  26. package/dist/LexicalTable.prod-CpIPDW6z.js.map +1 -0
  27. package/dist/LexicalUtils.prod-DjjGkphN.js +360 -0
  28. package/dist/LexicalUtils.prod-DjjGkphN.js.map +1 -0
  29. package/dist/{LinkContextMenu-m_CGQEiX.js → LinkContextMenu-CTkNPiIW.js} +2 -2
  30. package/dist/{LinkContextMenu-m_CGQEiX.js.map → LinkContextMenu-CTkNPiIW.js.map} +1 -1
  31. package/dist/{ModalDialog-HUkDdAJ-.js → ModalDialog-N50NGnd4.js} +2 -2
  32. package/dist/{ModalDialog-HUkDdAJ-.js.map → ModalDialog-N50NGnd4.js.map} +1 -1
  33. package/dist/{PageOverlay-D_wG2oie.js → PageOverlay-S4xsqJha.js} +2 -2
  34. package/dist/{PageOverlay-D_wG2oie.js.map → PageOverlay-S4xsqJha.js.map} +1 -1
  35. package/dist/{PasteHandlerPlugin-DjD1wryY.js → PasteHandlerPlugin-YpQruA-w.js} +4 -4
  36. package/dist/{PasteHandlerPlugin-DjD1wryY.js.map → PasteHandlerPlugin-YpQruA-w.js.map} +1 -1
  37. package/dist/{RteEditor.module-Jk80F1FA.js → RteEditor.module-BJLUYSpf.js} +9 -10
  38. package/dist/{RteEditor.module-Jk80F1FA.js.map → RteEditor.module-BJLUYSpf.js.map} +1 -1
  39. package/dist/{Sortable.module-BTUOSbOU.js → Sortable.module-8SoaHfuE.js} +6 -7
  40. package/dist/{Sortable.module-BTUOSbOU.js.map → Sortable.module-8SoaHfuE.js.map} +1 -1
  41. package/dist/{SortableProvider-Dc7hwkb5.js → SortableProvider-8HYiBXJS.js} +2 -2
  42. package/dist/{SortableProvider-Dc7hwkb5.js.map → SortableProvider-8HYiBXJS.js.map} +1 -1
  43. package/dist/Spinner-BpElTDIu.js +30 -0
  44. package/dist/{Spinner-D8tWqg9j.js.map → Spinner-BpElTDIu.js.map} +1 -1
  45. package/dist/{TableCellResizerPlugin-CgYsYsuY.js → TableCellResizerPlugin-Ceof6StD.js} +17 -17
  46. package/dist/{TableCellResizerPlugin-CgYsYsuY.js.map → TableCellResizerPlugin-Ceof6StD.js.map} +1 -1
  47. package/dist/{TextArea-DqKIpOfT.js → TextArea-CuASC9bX.js} +16 -17
  48. package/dist/{TextArea-DqKIpOfT.js.map → TextArea-CuASC9bX.js.map} +1 -1
  49. package/dist/{Tooltip-BzB3jznk.js → Tooltip-D27p9kh4.js} +13 -14
  50. package/dist/{Tooltip-BzB3jznk.js.map → Tooltip-D27p9kh4.js.map} +1 -1
  51. package/dist/{chunk-SZQXB3JV-D0XG4Tlp.js → chunk-SZQXB3JV-KiB8lSa9.js} +5 -5
  52. package/dist/{chunk-SZQXB3JV-D0XG4Tlp.js.map → chunk-SZQXB3JV-KiB8lSa9.js.map} +1 -1
  53. package/dist/{client-UU-mS47K.js → client-CHQ7u_QI.js} +9 -9
  54. package/dist/{client-UU-mS47K.js.map → client-CHQ7u_QI.js.map} +1 -1
  55. package/dist/components/Accordion/Accordion.js +1 -1
  56. package/dist/components/Accordion/Accordion.stories.js +1 -1
  57. package/dist/components/Accordion/Accordion.test.js +4 -7
  58. package/dist/components/Accordion/Accordion.test.js.map +1 -1
  59. package/dist/components/Accordion/index.js +1 -1
  60. package/dist/components/AccordionCard/AccordionCard.test.js +3 -6
  61. package/dist/components/AccordionCard/AccordionCard.test.js.map +1 -1
  62. package/dist/components/ActionList/ActionList.test.js +3 -6
  63. package/dist/components/ActionList/ActionList.test.js.map +1 -1
  64. package/dist/components/AppStatusBar/AppStatusBar.test.js +2 -5
  65. package/dist/components/AppStatusBar/AppStatusBar.test.js.map +1 -1
  66. package/dist/components/Attention/Attention.test.js +2 -5
  67. package/dist/components/Attention/Attention.test.js.map +1 -1
  68. package/dist/components/Backdrop/Backdrop.test.js +2 -5
  69. package/dist/components/Backdrop/Backdrop.test.js.map +1 -1
  70. package/dist/components/Buttons/Button.stories.js +1 -1
  71. package/dist/components/Buttons/Button.test.js +2 -5
  72. package/dist/components/Buttons/Button.test.js.map +1 -1
  73. package/dist/components/Buttons/LinkButton.stories.js +1 -1
  74. package/dist/components/Buttons/LinkButton.test.js +2 -5
  75. package/dist/components/Buttons/LinkButton.test.js.map +1 -1
  76. package/dist/components/Buttons/MenuButton.stories.js +1 -1
  77. package/dist/components/Buttons/MenuButton.test.js +2 -5
  78. package/dist/components/Buttons/MenuButton.test.js.map +1 -1
  79. package/dist/components/Card/Card.test.js +2 -5
  80. package/dist/components/Card/Card.test.js.map +1 -1
  81. package/dist/components/Checkbox/Checkbox.stories.js +1 -1
  82. package/dist/components/Checkbox/Checkbox.test.js +3 -6
  83. package/dist/components/Checkbox/Checkbox.test.js.map +1 -1
  84. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.js +1 -1
  85. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +2 -2
  86. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +3 -6
  87. package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js.map +1 -1
  88. package/dist/components/CheckboxButtonBar/index.js +1 -1
  89. package/dist/components/CheckboxTree/CheckboxTree.js +1 -2
  90. package/dist/components/CheckboxTree/CheckboxTree.stories.js +3 -4
  91. package/dist/components/CheckboxTree/CheckboxTree.stories.js.map +1 -1
  92. package/dist/components/CheckboxTree/index.js +1 -2
  93. package/dist/components/Chip/Chip.stories.js +1 -1
  94. package/dist/components/ControlsButton/ControlsButton.js +1 -1
  95. package/dist/components/ControlsButton/ControlsButton.stories.js +2 -2
  96. package/dist/components/ControlsButton/index.js +1 -1
  97. package/dist/components/Drawer/Drawer.js +1 -1
  98. package/dist/components/Drawer/Drawer.stories.js +2 -2
  99. package/dist/components/Drawer/index.js +1 -1
  100. package/dist/components/FeedbackBar/FeedbackBar.test.js +2 -5
  101. package/dist/components/FeedbackBar/FeedbackBar.test.js.map +1 -1
  102. package/dist/components/FieldHint/FieldHint.js +1 -1
  103. package/dist/components/FieldHint/FieldHint.stories.js +1 -1
  104. package/dist/components/FieldHint/index.js +1 -1
  105. package/dist/components/Fieldset/Fieldset.js +1 -1
  106. package/dist/components/Fieldset/Fieldset.stories.js +1 -1
  107. package/dist/components/Fieldset/index.js +1 -1
  108. package/dist/components/FormInput/FormInput.js +1 -2
  109. package/dist/components/FormInput/FormInput.stories.js +2 -3
  110. package/dist/components/FormInput/FormInput.stories.js.map +1 -1
  111. package/dist/components/FormInput/index.js +1 -2
  112. package/dist/components/IconButton/IconButton.stories.js +6 -7
  113. package/dist/components/IconButton/IconButton.stories.js.map +1 -1
  114. package/dist/components/InputField/InputField.stories.js +1 -3
  115. package/dist/components/InputField/InputField.stories.js.map +1 -1
  116. package/dist/components/Label/Label.test.js +2 -5
  117. package/dist/components/Label/Label.test.js.map +1 -1
  118. package/dist/components/MetaDataBar/MetaDataBar.test.js +1 -4
  119. package/dist/components/MetaDataBar/MetaDataBar.test.js.map +1 -1
  120. package/dist/components/ModalDialog/ModalDialog.js +1 -1
  121. package/dist/components/ModalDialog/ModalDialog.stories.js +2 -2
  122. package/dist/components/ModalDialog/index.js +1 -1
  123. package/dist/components/MultiSelect/MultiSelect.js +1 -2
  124. package/dist/components/MultiSelect/MultiSelect.stories.js +2 -3
  125. package/dist/components/MultiSelect/MultiSelect.stories.js.map +1 -1
  126. package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -2
  127. package/dist/components/MultiSelect/index.js +1 -2
  128. package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +1 -1
  129. package/dist/components/MultiSelectBox/MultiSelectBox.test.js +2 -5
  130. package/dist/components/MultiSelectBox/MultiSelectBox.test.js.map +1 -1
  131. package/dist/components/Notification/Notification.stories.js +1 -1
  132. package/dist/components/Notification/Notification.test.js +2 -5
  133. package/dist/components/Notification/Notification.test.js.map +1 -1
  134. package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +6 -7
  135. package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js.map +1 -1
  136. package/dist/components/PageOverlay/PageOverlay.js +1 -1
  137. package/dist/components/PageOverlay/PageOverlay.stories.js +1 -1
  138. package/dist/components/PageOverlay/index.js +1 -1
  139. package/dist/components/PeriodSelector/PeriodSelector.js +1 -2
  140. package/dist/components/PeriodSelector/PeriodSelector.stories.js +2 -3
  141. package/dist/components/PeriodSelector/PeriodSelector.stories.js.map +1 -1
  142. package/dist/components/PeriodSelector/index.js +1 -2
  143. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +0 -2
  144. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
  145. package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
  146. package/dist/components/RadioGroup/Radiogroup.test.js +2 -5
  147. package/dist/components/RadioGroup/Radiogroup.test.js.map +1 -1
  148. package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -2
  149. package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +2 -3
  150. package/dist/components/RadioTabSelector/RadioTabSelector.stories.js.map +1 -1
  151. package/dist/components/RadioTabSelector/index.js +1 -2
  152. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -2
  153. package/dist/components/RteEditor/EditorHeader/index.js +1 -2
  154. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +2 -2
  155. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/AddCatalogueLinkForm.js +1 -1
  156. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/index.js +1 -1
  157. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +30 -30
  158. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +1 -2
  159. package/dist/components/RteEditor/Plugins/HistoryPlugin/index.js +1 -2
  160. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -2
  161. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
  162. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +1 -2
  163. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  164. package/dist/components/RteEditor/Plugins/LinkPlugin/index.js +1 -2
  165. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +6 -6
  166. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +1 -1
  167. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/index.js +1 -1
  168. package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +1 -1
  169. package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/index.js +1 -1
  170. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -2
  171. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +1 -2
  172. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +16 -16
  173. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -2
  174. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +1 -2
  175. package/dist/components/RteEditor/Plugins/ToolbarPlugin/index.js +1 -2
  176. package/dist/components/RteEditor/Plugins/index.js +3 -3
  177. package/dist/components/RteEditor/RteEditor.js +1 -2
  178. package/dist/components/RteEditor/RteEditor.stories.js +1 -2
  179. package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
  180. package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
  181. package/dist/components/RteEditor/helpers.js +5 -5
  182. package/dist/components/RteEditor/index.js +1 -2
  183. package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js +14 -14
  184. package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +19 -19
  185. package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
  186. package/dist/components/Sortable/Sortable.js +1 -1
  187. package/dist/components/Sortable/Sortable.stories.js +1 -1
  188. package/dist/components/Sortable/SortableProvider.js +1 -1
  189. package/dist/components/Sortable/components/SortableContainer.js +1 -1
  190. package/dist/components/Sortable/components/SortableHandle.js +1 -1
  191. package/dist/components/Sortable/components/SortableItem.js +2 -2
  192. package/dist/components/Spinner/Spinner.js +1 -1
  193. package/dist/components/Spinner/Spinner.stories.js +1 -1
  194. package/dist/components/Spinner/index.js +1 -1
  195. package/dist/components/StatusBadge/StatusBadge.test.js +2 -5
  196. package/dist/components/StatusBadge/StatusBadge.test.js.map +1 -1
  197. package/dist/components/TextArea/TextArea.js +1 -1
  198. package/dist/components/TextArea/TextArea.stories.js +2 -2
  199. package/dist/components/TextArea/TextArea.test.js +4 -7
  200. package/dist/components/TextArea/TextArea.test.js.map +1 -1
  201. package/dist/components/TextArea/index.js +1 -1
  202. package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
  203. package/dist/components/Tooltip/Tooltip.js +1 -1
  204. package/dist/components/Tooltip/Tooltip.stories.js +1 -1
  205. package/dist/components/Tooltip/index.js +1 -1
  206. package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
  207. package/dist/components/VarIndicator/VarIndicator.test.js +3 -6
  208. package/dist/components/VarIndicator/VarIndicator.test.js.map +1 -1
  209. package/dist/components/index.js +12 -13
  210. package/dist/{components-C4MCdrDH.js → components-DAwjkky5.js} +436 -436
  211. package/dist/components-DAwjkky5.js.map +1 -0
  212. package/dist/{dist-2TKCXdYZ.js → dist-BIkFjHck.js} +181 -181
  213. package/dist/{dist-2TKCXdYZ.js.map → dist-BIkFjHck.js.map} +1 -1
  214. package/dist/{esm-UNe_gmRA.js → esm-ipAmzhQq.js} +4 -4
  215. package/dist/{esm-UNe_gmRA.js.map → esm-ipAmzhQq.js.map} +1 -1
  216. package/dist/{helpers-BBSxTGRl.js → helpers-MNJmfDe_.js} +7 -7
  217. package/dist/{helpers-BBSxTGRl.js.map → helpers-MNJmfDe_.js.map} +1 -1
  218. package/dist/index.js +12 -13
  219. package/dist/{react-18-CRbkdI-3.js → react-18-Dwpebadr.js} +2 -2
  220. package/dist/{react-18-CRbkdI-3.js.map → react-18-Dwpebadr.js.map} +1 -1
  221. package/dist/{react.esm-CzIhAqlo.js → react.esm-R7eBXTUI.js} +587 -587
  222. package/dist/{react.esm-CzIhAqlo.js.map → react.esm-R7eBXTUI.js.map} +1 -1
  223. package/dist/setupTests.js +1 -2
  224. package/dist/setupTests.js.map +1 -1
  225. package/dist/storybook__react.d.js +97 -97
  226. package/dist/storybook__react.d.js.map +1 -1
  227. package/dist/{test-DQruvi8i.js → test-Cr_l59hN.js} +12 -10
  228. package/dist/{test-DQruvi8i.js.map → test-Cr_l59hN.js.map} +1 -1
  229. package/package.json +27 -27
  230. package/dist/Fieldset-CoNu_Owa.js +0 -23
  231. package/dist/Lexical.prod-DIglXatJ.js.map +0 -1
  232. package/dist/LexicalExtension.prod-COPHoPpX.js.map +0 -1
  233. package/dist/LexicalLink.prod-Bf9JUdMv.js.map +0 -1
  234. package/dist/LexicalTable.prod-D16GW-aZ.js.map +0 -1
  235. package/dist/LexicalUtils.prod-BBTLliac.js +0 -360
  236. package/dist/LexicalUtils.prod-BBTLliac.js.map +0 -1
  237. package/dist/Spinner-D8tWqg9j.js +0 -31
  238. package/dist/components-C4MCdrDH.js.map +0 -1
  239. /package/dist/assets/favicon/{android-chrome-192x192.png → src/assets/favicon/android-chrome-192x192.png} +0 -0
  240. /package/dist/assets/favicon/{android-chrome-512x512.png → src/assets/favicon/android-chrome-512x512.png} +0 -0
  241. /package/dist/assets/favicon/{apple-touch-icon.png → src/assets/favicon/apple-touch-icon.png} +0 -0
  242. /package/dist/assets/favicon/{favicon-16x16.png → src/assets/favicon/favicon-16x16.png} +0 -0
  243. /package/dist/assets/favicon/{favicon-32x32.png → src/assets/favicon/favicon-32x32.png} +0 -0
  244. /package/dist/assets/favicon/{favicon.ico → src/assets/favicon/favicon.ico} +0 -0
  245. /package/dist/assets/favicon/{favicon.svg → src/assets/favicon/favicon.svg} +0 -0
  246. /package/dist/assets/favicon/{site.webmanifest → src/assets/favicon/site.webmanifest} +0 -0
  247. /package/dist/assets/fonts/{SourceSans3-Regular.otf.woff → src/assets/fonts/SourceSans3-Regular.otf.woff} +0 -0
  248. /package/dist/assets/fonts/{SourceSans3-Regular.otf.woff2 → src/assets/fonts/SourceSans3-Regular.otf.woff2} +0 -0
  249. /package/dist/assets/fonts/{SourceSans3-Semibold.otf.woff → src/assets/fonts/SourceSans3-Semibold.otf.woff} +0 -0
  250. /package/dist/assets/fonts/{SourceSans3-Semibold.otf.woff2 → src/assets/fonts/SourceSans3-Semibold.otf.woff2} +0 -0
  251. /package/dist/assets/{fonts.css → src/css/fonts.css} +0 -0
  252. /package/dist/assets/{globals.css → src/css/globals.css} +0 -0
  253. /package/dist/assets/{variables.css → src/css/variables.css} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"PageOverlay-D_wG2oie.js","names":[],"sources":["../src/components/PageOverlay/PageOverlay.module.css","../src/components/PageOverlay/PageOverlay.tsx"],"sourcesContent":[".page-overlay__container {\n bottom: 0;\n left: 0;\n position: fixed;\n right: 0;\n top: 0;\n z-index: 50;\n}\n\n.page-overlay {\n background: var(--color-uva-white);\n display: flex;\n flex-direction: column;\n\n /* dynamic view height needed to adapt for possible auto hiding of mobile address bar */\n height: 100dvh;\n}\n\n.page-overlay--full-screen {\n width: 100vw;\n}\n\n.page-overlay--with-gutters {\n max-width: 87.5rem;\n width: 100%;\n}\n\n.page-overlay__content {\n display: flex;\n flex-direction: column;\n height: 100svh;\n justify-content: space-between;\n overflow: hidden;\n overflow-y: auto;\n padding: 0 1.5rem;\n width: 100%;\n}\n\n.page-overlay__content--grey {\n background-color: var(--color-grey-200);\n}\n\n.page-overlay__content--white {\n background-color: var(--color-uva-white);\n}\n\n.page-overlay__children {\n padding-bottom: 1rem;\n}\n\n.page-overlay__title-wrapper {\n position: relative;\n}\n\n.page-overlay__title {\n font-size: var(--font-size-s);\n line-height: var(--line-height-m);\n margin: 0 1.5rem 0 0;\n padding: 1rem 1.5rem;\n}\n\n.page-overlay__buttons-bar {\n background-color: var(--color-uva-white);\n bottom: 0;\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n justify-content: flex-start;\n margin: 0 calc(-1 * 1.5rem);\n padding: 0.5rem 1rem;\n position: sticky;\n right: 0;\n}\n\n.page-overlay__buttons-bar::before {\n background: linear-gradient(to top, rgba(0 0 0 / 30%), rgba(0 0 0 / 0%));\n bottom: 100%;\n content: \"\";\n height: 10px;\n left: 0;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n right: 0;\n transition: opacity 0.4s ease-out;\n}\n\n.page-overlay__buttons-bar--shadow::before {\n opacity: 1;\n\n /* Show the shadow when content is scrollable and not scrolled to the bottom */\n}\n\n.page-overlay__close {\n height: 1.5rem;\n position: absolute;\n right: 1rem;\n top: calc(50% - 0.125rem);\n transform: translateY(-50%);\n}\n\n@media (min-width: 28rem) and (min-height: 28rem) {\n .page-overlay--with-gutters {\n margin: 0 calc(1.5rem / 2);\n }\n}\n","import { useDialog } from '@react-aria/dialog';\nimport { FocusScope } from '@react-aria/focus';\nimport { OverlayContainer, useModal, useOverlay, usePreventScroll } from '@react-aria/overlays';\nimport classNames, { clsx } from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\n\nimport type { FormHTMLAttributes, KeyboardEvent, PropsWithChildren, ReactNode } from 'react';\n\nimport styles from './PageOverlay.module.css';\n\nimport { OverlayCloseButton } from 'components/OverlayCloseButton';\nimport { Spinner } from 'components/Spinner';\nimport { Backdrop } from 'components/Backdrop';\n\nexport interface PageOverlayProps {\n /** The buttons of the dialog. */\n buttons?: ReactNode;\n /** `true` to show a spinner, if the contents of the dialog is lazy loaded; otherwise, `false`. */\n isLoading?: boolean;\n /** The `aria-valuetext` value of the [Spinner](/story/atoms-spinner--spinner-example) component. Used together with `isLoading`. */\n spinnerAriaValueText?: string;\n /** The `aria-label` value of the [OverlayCloseButton](/story/atoms-overlayclosebutton--overlay-close-button-example) component. */\n closeButtonAriaValueText?: string;\n /** `true` to render the dialog opened; otherwise, `false`. */\n isOpen: boolean;\n /** `true` to disable form validation; otherwise, `false`. */\n noValidate?: boolean;\n /** The callback function that is invoked when the dialog is closed. */\n onClose?(): void;\n /** The callback function that is invoked when the form is submitted. */\n onSubmit?: FormHTMLAttributes<HTMLFormElement>['onSubmit'];\n /** The title of the dialog. */\n title?: string;\n /** The contents of the dialog header. */\n headerContent?: ReactNode;\n /** The variant styling of the dialog. */\n variant?: 'full-screen' | 'with-gutters';\n /** The content background color of the dialog. Default grey-300*/\n contentBackgroundColor?: 'grey' | 'white';\n}\n\n/** Represents a component for a modal dialog. */\nexport function PageOverlay({\n buttons,\n children,\n isLoading,\n spinnerAriaValueText = 'Loading',\n closeButtonAriaValueText = 'Close',\n isOpen,\n noValidate = false,\n onClose,\n onSubmit,\n title,\n headerContent,\n variant = 'full-screen',\n contentBackgroundColor = 'grey',\n}: PropsWithChildren<PageOverlayProps>) {\n const ref = useRef<HTMLDivElement>(null);\n const formRef = useRef<HTMLFormElement>(null);\n const [isScrollable, setIsScrollable] = useState(false);\n const [isScrolledToBottom, setIsScrolledToBottom] = useState(false);\n\n const { dialogProps, titleProps } = useDialog({ role: 'dialog' }, ref);\n const { modalProps } = useModal({ isDisabled: !isOpen });\n const { overlayProps, underlayProps } = useOverlay({ isOpen, onClose }, ref);\n\n usePreventScroll({ isDisabled: !isOpen });\n\n useEffect(() => {\n const formElement = formRef.current;\n\n if (!formElement) return;\n\n function checkScrollable() {\n const scrollHeight = formElement!.scrollHeight;\n const clientHeight = formElement!.clientHeight;\n const scrollTop = formElement!.scrollTop;\n\n setIsScrollable(scrollHeight > clientHeight);\n setIsScrolledToBottom(scrollTop + clientHeight >= scrollHeight);\n }\n\n function handleScrollAndResize() {\n checkScrollable();\n }\n\n formElement.addEventListener('scroll', handleScrollAndResize);\n window.addEventListener('resize', handleScrollAndResize);\n\n const timeoutId = setTimeout(() => {\n checkScrollable();\n }, 0);\n\n return () => {\n formElement.removeEventListener('scroll', handleScrollAndResize);\n\n window.removeEventListener('resize', handleScrollAndResize);\n clearTimeout(timeoutId);\n };\n }, [isOpen, headerContent]);\n\n function onKeyUp(event: KeyboardEvent) {\n event.stopPropagation();\n }\n\n if (!isOpen) return null;\n\n return (\n <OverlayContainer className={styles['page-overlay__container']}>\n <Backdrop {...underlayProps}>\n {isLoading ? (\n <Spinner ariaValueText={spinnerAriaValueText} />\n ) : (\n <>\n {/* eslint-disable-next-line jsx-a11y/no-autofocus */}\n <FocusScope autoFocus contain restoreFocus>\n <div\n {...dialogProps}\n {...modalProps}\n {...overlayProps}\n className={clsx(styles['page-overlay'], {\n [styles[`page-overlay--${variant}`]]: variant,\n })}\n onKeyUp={onKeyUp}\n role=\"presentation\"\n ref={ref}\n >\n {(title || headerContent) && (\n <div className={styles['page-overlay__title-wrapper']}>\n {title && (\n <h1 {...titleProps} className={styles['page-overlay__title']}>\n {title}\n </h1>\n )}\n {headerContent}\n {\n <span className={styles['page-overlay__close']}>\n <OverlayCloseButton aria-label={closeButtonAriaValueText} onClick={onClose} />\n </span>\n }\n </div>\n )}\n <form\n className={classNames(\n styles['page-overlay__content'],\n styles[`page-overlay__content--${contentBackgroundColor}`],\n {\n [styles['page-overlay--content-with-buttons']]: buttons,\n }\n )}\n onSubmit={onSubmit}\n noValidate={noValidate}\n ref={formRef}\n >\n <div className={styles['page-overlay__children']}>{children}</div>\n {buttons && (\n <div\n className={classNames(styles['page-overlay__buttons-bar'], {\n [styles['page-overlay__buttons-bar--shadow']]: isScrollable && !isScrolledToBottom,\n })}\n >\n {buttons}\n </div>\n )}\n </form>\n </div>\n </FocusScope>\n </>\n )}\n </Backdrop>\n </OverlayContainer>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AC0CA,SAAgB,EAAY,EAC1B,YACA,aACA,cACA,0BAAuB,WACvB,8BAA2B,SAC3B,WACA,gBAAa,IACb,YACA,aACA,UACA,kBACA,aAAU,eACV,4BAAyB,UACa;CACtC,IAAM,IAAM,EAAuB,KAAK,EAClC,IAAU,EAAwB,KAAK,EACvC,CAAC,GAAc,KAAmB,EAAS,GAAM,EACjD,CAAC,GAAoB,KAAyB,EAAS,GAAM,EAE7D,EAAE,gBAAa,kBAAe,EAAU,EAAE,MAAM,UAAU,EAAE,EAAI,EAChE,EAAE,kBAAe,EAAS,EAAE,YAAY,CAAC,GAAQ,CAAC,EAClD,EAAE,iBAAc,qBAAkB,EAAW;EAAE;EAAQ;EAAS,EAAE,EAAI;AAI5E,CAFA,EAAiB,EAAE,YAAY,CAAC,GAAQ,CAAC,EAEzC,QAAgB;EACd,IAAM,IAAc,EAAQ;AAE5B,MAAI,CAAC,EAAa;EAElB,SAAS,IAAkB;GACzB,IAAM,IAAe,EAAa,cAC5B,IAAe,EAAa,cAC5B,IAAY,EAAa;AAG/B,GADA,EAAgB,IAAe,EAAa,EAC5C,EAAsB,IAAY,KAAgB,EAAa;;EAGjE,SAAS,IAAwB;AAC/B,MAAiB;;AAInB,EADA,EAAY,iBAAiB,UAAU,EAAsB,EAC7D,OAAO,iBAAiB,UAAU,EAAsB;EAExD,IAAM,IAAY,iBAAiB;AACjC,MAAiB;KAChB,EAAE;AAEL,eAAa;AAIX,GAHA,EAAY,oBAAoB,UAAU,EAAsB,EAEhE,OAAO,oBAAoB,UAAU,EAAsB,EAC3D,aAAa,EAAU;;IAExB,CAAC,GAAQ,EAAc,CAAC;CAE3B,SAAS,EAAQ,GAAsB;AACrC,IAAM,iBAAiB;;AAKzB,QAFK,IAGH,kBAAC,GAAD;EAAkB,WAAW,EAAO;YAClC,kBAAC,GAAD;GAAU,GAAI;aACX,IACC,kBAAC,GAAD,EAAS,eAAe,GAAwB,CAAA,GAEhD,kBAAA,GAAA,EAAA,UAEE,kBAAC,GAAD;IAAY,WAAA;IAAU,SAAA;IAAQ,cAAA;cAC5B,kBAAC,OAAD;KACE,GAAI;KACJ,GAAI;KACJ,GAAI;KACJ,WAAW,EAAK,EAAO,iBAAiB,GACrC,EAAO,iBAAiB,OAAa,GACvC,CAAC;KACO;KACT,MAAK;KACA;eATP,EAWI,KAAS,MACT,kBAAC,OAAD;MAAK,WAAW,EAAO;gBAAvB;OACG,KACC,kBAAC,MAAD;QAAI,GAAI;QAAY,WAAW,EAAO;kBACnC;QACE,CAAA;OAEN;OAEC,kBAAC,QAAD;QAAM,WAAW,EAAO;kBACtB,kBAAC,GAAD;SAAoB,cAAY;SAA0B,SAAS;SAAW,CAAA;QACzE,CAAA;OAEL;SAER,kBAAC,QAAD;MACE,WAAW,EACT,EAAO,0BACP,EAAO,0BAA0B,MACjC,GACG,EAAO,wCAAwC,GACjD,CACF;MACS;MACE;MACZ,KAAK;gBAVP,CAYE,kBAAC,OAAD;OAAK,WAAW,EAAO;OAA4B;OAAe,CAAA,EACjE,KACC,kBAAC,OAAD;OACE,WAAW,EAAW,EAAO,8BAA8B,GACxD,EAAO,uCAAuC,KAAgB,CAAC,GACjE,CAAC;iBAED;OACG,CAAA,CAEH;QACH;;IACK,CAAA,EACZ,CAAA;GAEI,CAAA;EACM,CAAA,GAjED"}
1
+ {"version":3,"file":"PageOverlay-S4xsqJha.js","names":[],"sources":["../src/components/PageOverlay/PageOverlay.module.css","../src/components/PageOverlay/PageOverlay.tsx"],"sourcesContent":[".page-overlay__container {\n bottom: 0;\n left: 0;\n position: fixed;\n right: 0;\n top: 0;\n z-index: 50;\n}\n\n.page-overlay {\n background: var(--color-uva-white);\n display: flex;\n flex-direction: column;\n\n /* dynamic view height needed to adapt for possible auto hiding of mobile address bar */\n height: 100dvh;\n}\n\n.page-overlay--full-screen {\n width: 100vw;\n}\n\n.page-overlay--with-gutters {\n max-width: 87.5rem;\n width: 100%;\n}\n\n.page-overlay__content {\n display: flex;\n flex-direction: column;\n height: 100svh;\n justify-content: space-between;\n overflow: hidden;\n overflow-y: auto;\n padding: 0 1.5rem;\n width: 100%;\n}\n\n.page-overlay__content--grey {\n background-color: var(--color-grey-200);\n}\n\n.page-overlay__content--white {\n background-color: var(--color-uva-white);\n}\n\n.page-overlay__children {\n padding-bottom: 1rem;\n}\n\n.page-overlay__title-wrapper {\n position: relative;\n}\n\n.page-overlay__title {\n font-size: var(--font-size-s);\n line-height: var(--line-height-m);\n margin: 0 1.5rem 0 0;\n padding: 1rem 1.5rem;\n}\n\n.page-overlay__buttons-bar {\n background-color: var(--color-uva-white);\n bottom: 0;\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n justify-content: flex-start;\n margin: 0 calc(-1 * 1.5rem);\n padding: 0.5rem 1rem;\n position: sticky;\n right: 0;\n}\n\n.page-overlay__buttons-bar::before {\n background: linear-gradient(to top, rgba(0 0 0 / 30%), rgba(0 0 0 / 0%));\n bottom: 100%;\n content: \"\";\n height: 10px;\n left: 0;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n right: 0;\n transition: opacity 0.4s ease-out;\n}\n\n.page-overlay__buttons-bar--shadow::before {\n opacity: 1;\n\n /* Show the shadow when content is scrollable and not scrolled to the bottom */\n}\n\n.page-overlay__close {\n height: 1.5rem;\n position: absolute;\n right: 1rem;\n top: calc(50% - 0.125rem);\n transform: translateY(-50%);\n}\n\n@media (min-width: 28rem) and (min-height: 28rem) {\n .page-overlay--with-gutters {\n margin: 0 calc(1.5rem / 2);\n }\n}\n","import { useDialog } from '@react-aria/dialog';\nimport { FocusScope } from '@react-aria/focus';\nimport { OverlayContainer, useModal, useOverlay, usePreventScroll } from '@react-aria/overlays';\nimport classNames, { clsx } from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\n\nimport type { FormHTMLAttributes, KeyboardEvent, PropsWithChildren, ReactNode } from 'react';\n\nimport styles from './PageOverlay.module.css';\n\nimport { OverlayCloseButton } from 'components/OverlayCloseButton';\nimport { Spinner } from 'components/Spinner';\nimport { Backdrop } from 'components/Backdrop';\n\nexport interface PageOverlayProps {\n /** The buttons of the dialog. */\n buttons?: ReactNode;\n /** `true` to show a spinner, if the contents of the dialog is lazy loaded; otherwise, `false`. */\n isLoading?: boolean;\n /** The `aria-valuetext` value of the [Spinner](/story/atoms-spinner--spinner-example) component. Used together with `isLoading`. */\n spinnerAriaValueText?: string;\n /** The `aria-label` value of the [OverlayCloseButton](/story/atoms-overlayclosebutton--overlay-close-button-example) component. */\n closeButtonAriaValueText?: string;\n /** `true` to render the dialog opened; otherwise, `false`. */\n isOpen: boolean;\n /** `true` to disable form validation; otherwise, `false`. */\n noValidate?: boolean;\n /** The callback function that is invoked when the dialog is closed. */\n onClose?(): void;\n /** The callback function that is invoked when the form is submitted. */\n onSubmit?: FormHTMLAttributes<HTMLFormElement>['onSubmit'];\n /** The title of the dialog. */\n title?: string;\n /** The contents of the dialog header. */\n headerContent?: ReactNode;\n /** The variant styling of the dialog. */\n variant?: 'full-screen' | 'with-gutters';\n /** The content background color of the dialog. Default grey-300*/\n contentBackgroundColor?: 'grey' | 'white';\n}\n\n/** Represents a component for a modal dialog. */\nexport function PageOverlay({\n buttons,\n children,\n isLoading,\n spinnerAriaValueText = 'Loading',\n closeButtonAriaValueText = 'Close',\n isOpen,\n noValidate = false,\n onClose,\n onSubmit,\n title,\n headerContent,\n variant = 'full-screen',\n contentBackgroundColor = 'grey',\n}: PropsWithChildren<PageOverlayProps>) {\n const ref = useRef<HTMLDivElement>(null);\n const formRef = useRef<HTMLFormElement>(null);\n const [isScrollable, setIsScrollable] = useState(false);\n const [isScrolledToBottom, setIsScrolledToBottom] = useState(false);\n\n const { dialogProps, titleProps } = useDialog({ role: 'dialog' }, ref);\n const { modalProps } = useModal({ isDisabled: !isOpen });\n const { overlayProps, underlayProps } = useOverlay({ isOpen, onClose }, ref);\n\n usePreventScroll({ isDisabled: !isOpen });\n\n useEffect(() => {\n const formElement = formRef.current;\n\n if (!formElement) return;\n\n function checkScrollable() {\n const scrollHeight = formElement!.scrollHeight;\n const clientHeight = formElement!.clientHeight;\n const scrollTop = formElement!.scrollTop;\n\n setIsScrollable(scrollHeight > clientHeight);\n setIsScrolledToBottom(scrollTop + clientHeight >= scrollHeight);\n }\n\n function handleScrollAndResize() {\n checkScrollable();\n }\n\n formElement.addEventListener('scroll', handleScrollAndResize);\n window.addEventListener('resize', handleScrollAndResize);\n\n const timeoutId = setTimeout(() => {\n checkScrollable();\n }, 0);\n\n return () => {\n formElement.removeEventListener('scroll', handleScrollAndResize);\n\n window.removeEventListener('resize', handleScrollAndResize);\n clearTimeout(timeoutId);\n };\n }, [isOpen, headerContent]);\n\n function onKeyUp(event: KeyboardEvent) {\n event.stopPropagation();\n }\n\n if (!isOpen) return null;\n\n return (\n <OverlayContainer className={styles['page-overlay__container']}>\n <Backdrop {...underlayProps}>\n {isLoading ? (\n <Spinner ariaValueText={spinnerAriaValueText} />\n ) : (\n <>\n {/* eslint-disable-next-line jsx-a11y/no-autofocus */}\n <FocusScope autoFocus contain restoreFocus>\n <div\n {...dialogProps}\n {...modalProps}\n {...overlayProps}\n className={clsx(styles['page-overlay'], {\n [styles[`page-overlay--${variant}`]]: variant,\n })}\n onKeyUp={onKeyUp}\n role=\"presentation\"\n ref={ref}\n >\n {(title || headerContent) && (\n <div className={styles['page-overlay__title-wrapper']}>\n {title && (\n <h1 {...titleProps} className={styles['page-overlay__title']}>\n {title}\n </h1>\n )}\n {headerContent}\n {\n <span className={styles['page-overlay__close']}>\n <OverlayCloseButton aria-label={closeButtonAriaValueText} onClick={onClose} />\n </span>\n }\n </div>\n )}\n <form\n className={classNames(\n styles['page-overlay__content'],\n styles[`page-overlay__content--${contentBackgroundColor}`],\n {\n [styles['page-overlay--content-with-buttons']]: buttons,\n }\n )}\n onSubmit={onSubmit}\n noValidate={noValidate}\n ref={formRef}\n >\n <div className={styles['page-overlay__children']}>{children}</div>\n {buttons && (\n <div\n className={classNames(styles['page-overlay__buttons-bar'], {\n [styles['page-overlay__buttons-bar--shadow']]: isScrollable && !isScrolledToBottom,\n })}\n >\n {buttons}\n </div>\n )}\n </form>\n </div>\n </FocusScope>\n </>\n )}\n </Backdrop>\n </OverlayContainer>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AC0CA,SAAgB,EAAY,EAC1B,YACA,aACA,cACA,0BAAuB,WACvB,8BAA2B,SAC3B,WACA,gBAAa,IACb,YACA,aACA,UACA,kBACA,aAAU,eACV,4BAAyB,UACa;CACtC,IAAM,IAAM,EAAuB,KAAK,EAClC,IAAU,EAAwB,KAAK,EACvC,CAAC,GAAc,KAAmB,EAAS,GAAM,EACjD,CAAC,GAAoB,KAAyB,EAAS,GAAM,EAE7D,EAAE,gBAAa,kBAAe,EAAU,EAAE,MAAM,UAAU,EAAE,EAAI,EAChE,EAAE,kBAAe,EAAS,EAAE,YAAY,CAAC,GAAQ,CAAC,EAClD,EAAE,iBAAc,qBAAkB,EAAW;EAAE;EAAQ;EAAS,EAAE,EAAI;AAI5E,CAFA,EAAiB,EAAE,YAAY,CAAC,GAAQ,CAAC,EAEzC,QAAgB;EACd,IAAM,IAAc,EAAQ;AAE5B,MAAI,CAAC,EAAa;EAElB,SAAS,IAAkB;GACzB,IAAM,IAAe,EAAa,cAC5B,IAAe,EAAa,cAC5B,IAAY,EAAa;AAG/B,GADA,EAAgB,IAAe,EAAa,EAC5C,EAAsB,IAAY,KAAgB,EAAa;;EAGjE,SAAS,IAAwB;AAC/B,MAAiB;;AAInB,EADA,EAAY,iBAAiB,UAAU,EAAsB,EAC7D,OAAO,iBAAiB,UAAU,EAAsB;EAEx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@
1
1
  import { t as e } from "./chunk-DeC0fbbY.js";
2
2
  import { t } from "./LexicalComposerContext.prod-Ca-YN_fj.js";
3
- import { Gt as n, r } from "./Lexical.prod-DIglXatJ.js";
4
- import { o as i } from "./LexicalUtils.prod-BBTLliac.js";
5
- import { n as a } from "./LexicalClipboard.prod-Bnzu0sh_.js";
3
+ import { Jt as n, r } from "./Lexical.prod-sbwgNRjw.js";
4
+ import { o as i } from "./LexicalUtils.prod-DjjGkphN.js";
5
+ import { n as a } from "./LexicalClipboard.prod-DdImsyd1.js";
6
6
  import { useEffect as o } from "react";
7
7
  //#region node_modules/@staartwind.nl/lexical-paste-from-word/dist/normalizer.js
8
8
  var s = /* @__PURE__ */ e(((e) => {
@@ -232,4 +232,4 @@ var s = /* @__PURE__ */ e(((e) => {
232
232
  //#endregion
233
233
  export { l as t };
234
234
 
235
- //# sourceMappingURL=PasteHandlerPlugin-DjD1wryY.js.map
235
+ //# sourceMappingURL=PasteHandlerPlugin-YpQruA-w.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PasteHandlerPlugin-DjD1wryY.js","names":[],"sources":["../node_modules/@staartwind.nl/lexical-paste-from-word/dist/normalizer.js","../node_modules/@staartwind.nl/lexical-paste-from-word/dist/index.js","../src/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.tsx"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.normalizeSpacerunSpans = exports.normalizeSpacing = exports.parseHtml = exports.MSWordNormalizer = void 0;\nconst MS_WORD_MATCHES = [\n /<meta\\s*name=\"?generator\"?\\s*content=\"?microsoft\\s*word\\s*\\d+\"?\\/?>/i,\n /xmlns:o=\"urn:schemas-microsoft-com/i\n];\nclass MSWordNormalizer {\n isActive(htmlString) {\n return MS_WORD_MATCHES.some(regex => regex.test(htmlString));\n }\n normalize(htmlString) {\n const { bodyString, stylesString } = parseHtml(htmlString);\n const doc = new DOMParser().parseFromString(bodyString, 'text/html');\n this.transformListItemLikeLElementsIntoLists(doc, stylesString);\n this.removeMSAttributes(doc);\n return doc.body.innerHTML;\n }\n findAllItemLikeElements(doc) {\n const items = doc.querySelectorAll('*');\n const res = [];\n for (const item of items) {\n const tagName = item.tagName.toLowerCase();\n // Find all the possible list items\n if (!['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li', 'div'].includes(tagName) || !(item instanceof HTMLElement)) {\n continue;\n }\n const style = convertStyleToObject(item.getAttribute('style') || '');\n // Keep items that are part of a list.\n if ('mso-list' in style) {\n if (!item.parentElement)\n continue;\n if (isList(item.parentElement))\n continue;\n const itemData = getListItemData(style);\n res.push(Object.assign(Object.assign({}, itemData), { element: item }));\n }\n }\n return res;\n }\n transformListItemLikeLElementsIntoLists(doc, stylesString) {\n var _a, _b, _c, _d, _e, _f, _g;\n const itemLikeElements = this.findAllItemLikeElements(doc);\n if (!itemLikeElements.length) {\n return;\n }\n const encounteredLists = {};\n const stack = [];\n for (const itemLikeElement of itemLikeElements) {\n if (itemLikeElement.indent != null) {\n // Reset the current stack if the previous used list does not continue with itemLikeElement\n if (!isListContinuation(itemLikeElement)) {\n stack.length = 0;\n }\n // Combined list ID for addressing encounter lists counters.\n const originalListId = `${itemLikeElement.id}:${itemLikeElement.indent}`;\n // Normalized list item indentation.\n const indent = Math.min(itemLikeElement.indent - 1, stack.length);\n // Trimming of the list stack on list ID change.\n if (indent < stack.length && ((_a = stack[indent]) === null || _a === void 0 ? void 0 : _a.id) !== itemLikeElement.id) {\n stack.length = indent;\n }\n // Trimming of the list stack on lower indent list encountered.\n if (indent < stack.length - 1) {\n stack.length = indent + 1;\n }\n else {\n const listStyle = detectListStyle(itemLikeElement, stylesString);\n // Create a new OL/UL if required (greater indent or different list type).\n if (indent > stack.length - 1 || ((_b = stack[indent]) === null || _b === void 0 ? void 0 : _b.listElement.tagName.toLowerCase()) != listStyle.type) {\n if (indent == 0 &&\n listStyle.type == 'ol' &&\n itemLikeElement.id !== undefined &&\n encounteredLists[originalListId]) {\n listStyle.startIndex = (_c = encounteredLists[originalListId]) !== null && _c !== void 0 ? _c : null;\n }\n const listElement = createNewEmptyList(listStyle, false);\n // Insert the new OL/UL.\n if (stack.length == 0) {\n const parent = itemLikeElement.element.parentNode;\n const index = Array.from(parent.children).indexOf(itemLikeElement.element) + 1;\n if (index === parent.children.length) {\n parent.appendChild(listElement);\n }\n else {\n parent.insertBefore(listElement, itemLikeElement.element);\n }\n }\n else {\n const parentListItems = (_d = stack[indent - 1]) === null || _d === void 0 ? void 0 : _d.listItemElements;\n if (parentListItems) {\n (_e = parentListItems[parentListItems.length - 1]) === null || _e === void 0 ? void 0 : _e.appendChild(listElement);\n }\n }\n // Update the list stack for other items to reference.\n stack[indent] = Object.assign(Object.assign({}, itemLikeElement), { listElement, listItemElements: [] });\n // Prepare list counter for start index.\n if (indent == 0 && itemLikeElement.id !== undefined) {\n encounteredLists[originalListId] = listStyle.startIndex || 1;\n }\n }\n }\n // Use LI if it is already it or create a new LI element.\n const listItem = itemLikeElement.element.tagName.toLowerCase() == 'li' ? itemLikeElement.element : document.createElement('li');\n // Append the LI to OL/UL.\n (_f = stack[indent]) === null || _f === void 0 ? void 0 : _f.listElement.appendChild(listItem);\n (_g = stack[indent]) === null || _g === void 0 ? void 0 : _g.listItemElements.push(listItem);\n // Increment list counter.\n if (indent == 0 && itemLikeElement.id !== undefined) {\n encounteredLists[originalListId]++;\n }\n // Append list block to LI.\n if (itemLikeElement.element != listItem) {\n listItem.appendChild(itemLikeElement.element);\n }\n // Clean list block.\n removeMsoListIgnoreSpans(itemLikeElement.element);\n }\n }\n }\n removeMSAttributes(doc) {\n const items = doc.querySelectorAll('*');\n const elementsToUnwrap = [];\n for (const item of items) {\n // Eliminate all classes that include mso.\n for (const className of item.classList) {\n if (/\\bmso/gi.exec(className)) {\n item.classList.remove(className);\n }\n }\n // Eliminate all useless mso styling\n if (item instanceof HTMLElement) {\n removeMSOStyles(item);\n }\n // Push word specific elements to an array\n if (item.tagName === 'W:SDT' || item.tagName === 'W:SDTPR' && isElementEmpty(item) || item.tagName === 'O:P' && isElementEmpty(item)) {\n elementsToUnwrap.push(item);\n }\n }\n // Eliminate word specific elements\n for (const item of elementsToUnwrap) {\n const itemParent = item.parentNode;\n itemParent.removeChild(item);\n }\n }\n}\nexports.MSWordNormalizer = MSWordNormalizer;\nfunction parseHtml(htmlString) {\n const domParser = new DOMParser();\n // Remove Word specific \"if comments\" so content inside is not omitted by the parser.\n htmlString = htmlString.replace(/<!--\\[if gte vml 1]>/g, '');\n // Clean the <head> section of MS Windows specific tags. See https://github.com/ckeditor/ckeditor5/issues/15333.\n // The regular expression matches the <o:SmartTagType> tag with optional attributes (with or without values).\n htmlString = htmlString.replace(/<o:SmartTagType(?:\\s+[^\\s>=]+(?:=\"[^\"]*\")?)*\\s*\\/?>/gi, '');\n const normalizedHtml = normalizeSpacing(cleanContentAfterBody(htmlString));\n // Parse htmlString as native Document object.\n const htmlDocument = domParser.parseFromString(normalizedHtml, 'text/html');\n normalizeSpacerunSpans(htmlDocument);\n // Get `innerHTML` first as transforming to View modifies the source document.\n const bodyString = htmlDocument.body.innerHTML;\n const stylesString = extractStyles(htmlDocument);\n return {\n bodyString,\n stylesString\n };\n}\nexports.parseHtml = parseHtml;\nfunction extractStyles(htmlDocument) {\n const styles = [];\n const stylesString = [];\n const styleTags = Array.from(htmlDocument.getElementsByTagName('style'));\n for (const style of styleTags) {\n if (style.sheet && style.sheet.cssRules && style.sheet.cssRules.length) {\n styles.push(style.sheet);\n stylesString.push(style.innerHTML);\n }\n }\n return stylesString.join(' ');\n}\nfunction normalizeSpacing(htmlString) {\n // Run normalizeSafariSpaceSpans() two times to cover nested spans.\n return normalizeSafariSpaceSpans(normalizeSafariSpaceSpans(htmlString))\n // Remove all \\r\\n from \"spacerun spans\" so the last replace line doesn't strip all whitespaces.\n .replace(/(<span\\s+style=['\"]mso-spacerun:yes['\"]>[^\\S\\r\\n]*?)[\\r\\n]+([^\\S\\r\\n]*<\\/span>)/g, '$1$2')\n .replace(/<span\\s+style=['\"]mso-spacerun:yes['\"]><\\/span>/g, '')\n .replace(/(<span\\s+style=['\"]letter-spacing:[^'\"]+?['\"]>)[\\r\\n]+(<\\/span>)/g, '$1 $2')\n .replace(/ <\\//g, '\\u00A0</')\n .replace(/ <o:p><\\/o:p>/g, '\\u00A0<o:p></o:p>')\n // Remove <o:p> block filler from empty paragraph. Safari uses \\u00A0 instead of &nbsp;.\n .replace(/<o:p>(&nbsp;|\\u00A0)<\\/o:p>/g, '')\n // Remove all whitespaces when they contain any \\r or \\n.\n .replace(/>([^\\S\\r\\n]*[\\r\\n]\\s*)</g, '><');\n}\nexports.normalizeSpacing = normalizeSpacing;\nfunction normalizeSafariSpaceSpans(htmlString) {\n return htmlString.replace(/<span(?: class=\"Apple-converted-space\"|)>(\\s+)<\\/span>/g, (fullMatch, spaces) => {\n return spaces.length === 1 ? ' ' : Array(spaces.length + 1).join('\\u00A0 ').substring(0, spaces.length);\n });\n}\nfunction normalizeSpacerunSpans(htmlDocument) {\n htmlDocument.querySelectorAll('span[style*=spacerun]').forEach(el => {\n const htmlElement = el;\n const innerTextLength = htmlElement.innerText.length || 0;\n htmlElement.innerText = Array(innerTextLength + 1).join('\\u00A0 ').substring(0, innerTextLength);\n });\n}\nexports.normalizeSpacerunSpans = normalizeSpacerunSpans;\nfunction cleanContentAfterBody(htmlString) {\n const bodyCloseTag = '</body>';\n const htmlCloseTag = '</html>';\n const bodyCloseIndex = htmlString.indexOf(bodyCloseTag);\n if (bodyCloseIndex < 0) {\n return htmlString;\n }\n const htmlCloseIndex = htmlString.indexOf(htmlCloseTag, bodyCloseIndex + bodyCloseTag.length);\n return htmlString.substring(0, bodyCloseIndex + bodyCloseTag.length) +\n (htmlCloseIndex >= 0 ? htmlString.substring(htmlCloseIndex) : '');\n}\nfunction convertStyleToObject(styleString) {\n const styleObject = {};\n if (!styleString) {\n return styleObject;\n }\n // Split the style string into individual declarations\n const declarations = styleString.split(';').map(declaration => declaration.trim());\n // Iterate over each declaration and split it into property and value\n declarations.forEach(declaration => {\n const [property, value] = declaration.split(':').map(part => part.trim());\n if (property && value) {\n // Add the property and value to the style object\n styleObject[property] = value;\n }\n });\n return styleObject;\n}\nfunction isElementEmpty(element) {\n return !element.textContent && !element.innerHTML.trim();\n}\nfunction removeMSOStyles(element) {\n // Get the current style string of the paragraph node\n const currentStyle = element.getAttribute('style') || '';\n // Parse the style string to extract individual style properties\n const styleProperties = currentStyle.split(';').map(property => property.trim());\n // Remove the 'mso-bidi-font-family' property from the list of style properties\n const filteredProperties = styleProperties.filter(property => {\n var _a;\n const [key] = property.split(':');\n return !(/\\bmso/gi.exec((_a = key === null || key === void 0 ? void 0 : key.toLowerCase()) !== null && _a !== void 0 ? _a : ''));\n });\n // Reconstruct the style string without the removed property\n const updatedStyle = filteredProperties.join(';');\n // Set the updated style string back to the paragraph node\n element.setAttribute('style', updatedStyle);\n}\nfunction getListItemData(styles) {\n var _a;\n const listStyle = styles['mso-list'];\n if (listStyle === undefined) {\n return {};\n }\n const idMatch = listStyle.match(/(^|\\s{1,100})l(\\d+)/i);\n const orderMatch = listStyle.match(/\\s{0,100}lfo(\\d+)/i);\n const indentMatch = listStyle.match(/\\s{0,100}level(\\d+)/i);\n if (idMatch && orderMatch && indentMatch) {\n return {\n id: idMatch[2],\n order: orderMatch[1],\n indent: parseInt((_a = indentMatch[1]) !== null && _a !== void 0 ? _a : '')\n };\n }\n return {\n indent: 1\n };\n}\nfunction detectListStyle(listLikeItem, stylesString) {\n const listStyleRegexp = new RegExp(`@list l${listLikeItem.id}:level${listLikeItem.indent}\\\\s*({[^}]*)`, 'gi');\n const listStyleTypeRegex = /mso-level-number-format:([^;]{0,100});/gi;\n const listStartIndexRegex = /mso-level-start-at:\\s{0,100}([0-9]{0,10})\\s{0,100};/gi;\n const legalStyleListRegex = new RegExp(`@list\\\\s+l${listLikeItem.id}:level\\\\d\\\\s*{[^{]*mso-level-text:\"%\\\\d\\\\\\\\.`, 'gi');\n const multiLevelNumberFormatTypeRegex = new RegExp(`@list l${listLikeItem.id}:level\\\\d\\\\s*{[^{]*mso-level-number-format:`, 'gi');\n const legalStyleListMatch = legalStyleListRegex.exec(stylesString);\n const multiLevelNumberFormatMatch = multiLevelNumberFormatTypeRegex.exec(stylesString);\n // Multi level lists in Word have mso-level-number-format attribute except legal lists,\n // so we used that. If list has legal list match and doesn't has mso-level-number-format\n // then this is legal-list.\n const islegalStyleList = legalStyleListMatch && !multiLevelNumberFormatMatch;\n const listStyleMatch = listStyleRegexp.exec(stylesString);\n let listStyleType = 'decimal'; // Decimal is default one.\n let type = 'ol'; // <ol> is default list.\n let startIndex = null;\n if (listStyleMatch && listStyleMatch[1]) {\n const listStyleTypeMatch = listStyleTypeRegex.exec(listStyleMatch[1]);\n if (listStyleTypeMatch && listStyleTypeMatch[1]) {\n listStyleType = listStyleTypeMatch[1].trim();\n type = listStyleType !== 'bullet' && listStyleType !== 'image' ? 'ol' : 'ul';\n }\n // Styles for the numbered lists are always defined in the Word CSS stylesheet.\n // Unordered lists MAY contain a value for the Word CSS definition `mso-level-text` but sometimes\n // this tag is missing. And because of that, we cannot depend on that. We need to predict the list style value\n // based on the list style marker element.\n if (listStyleType === 'bullet') {\n const bulletedStyle = findBulletedListStyle(listLikeItem.element);\n if (bulletedStyle) {\n listStyleType = bulletedStyle;\n }\n }\n else {\n const listStartIndexMatch = listStartIndexRegex.exec(listStyleMatch[1]);\n if (listStartIndexMatch && listStartIndexMatch[1]) {\n startIndex = parseInt(listStartIndexMatch[1]);\n }\n }\n if (islegalStyleList) {\n type = 'ol';\n }\n }\n return {\n type,\n startIndex,\n style: mapListStyleDefinition(listStyleType),\n isLegalStyleList: islegalStyleList\n };\n}\nfunction findBulletedListStyle(element) {\n // https://github.com/ckeditor/ckeditor5/issues/15964\n if (element.tagName.toLowerCase() == 'li' && element.parentElement.tagName.toLowerCase() == 'ul' && element.parentElement.hasAttribute('type')) {\n return element.parentElement.getAttribute('type');\n }\n const listMarkerElement = findListMarkerNode(element);\n if (!listMarkerElement) {\n return null;\n }\n const listMarker = listMarkerElement.textContent;\n if (listMarker === 'o') {\n return 'circle';\n }\n else if ((listMarker !== null && listMarker !== void 0 ? listMarker : '').charCodeAt(0) === 183) {\n return 'disc';\n }\n // Word returns '§' instead of '■' for the square list style.\n else if (listMarker === '§') {\n return 'square';\n }\n return null;\n}\nfunction findListMarkerNode(element) {\n var _a;\n // If the first child is a text node, it is the data for the element.\n // The list-style marker is not present here.\n if (((_a = Array.from(element.children)[0]) === null || _a === void 0 ? void 0 : _a.tagName.toLowerCase()) === '#text') {\n return null;\n }\n for (const childNode of Array.from(element.children)) {\n // The list-style marker will be inside the `<span>` element. Let's ignore all non-span elements.\n // It may happen that the `<a>` element is added as the first child. Most probably, it's an anchor element.\n if (!['element', 'span'].includes(childNode.tagName.toLowerCase())) {\n continue;\n }\n return childNode;\n }\n return null;\n}\nfunction mapListStyleDefinition(value) {\n if (value.startsWith('arabic-leading-zero')) {\n return 'decimal-leading-zero';\n }\n switch (value) {\n case 'alpha-upper':\n return 'upper-alpha';\n case 'alpha-lower':\n return 'lower-alpha';\n case 'roman-upper':\n return 'upper-roman';\n case 'roman-lower':\n return 'lower-roman';\n case 'circle':\n case 'disc':\n case 'square':\n return value;\n default:\n return null;\n }\n}\nfunction createNewEmptyList(listStyle, hasMultiLevelListPlugin) {\n const list = document.createElement(listStyle.type);\n // We do not support modifying the marker for a particular list item.\n // Set the value for the `list-style-type` property directly to the list container.\n if (listStyle.style) {\n list.style.setProperty('list-style-type', listStyle.style);\n }\n if (listStyle.startIndex && listStyle.startIndex > 1) {\n list.setAttribute('start', listStyle.startIndex.toString());\n }\n if (listStyle.isLegalStyleList && hasMultiLevelListPlugin) {\n list.classList.add('legal-list');\n }\n return list;\n}\nfunction removeMsoListIgnoreSpans(parentElement) {\n // Get all <span> elements inside the parentElement\n const spans = parentElement.querySelectorAll('span');\n // Iterate over each <span> element\n spans.forEach(span => {\n var _a;\n // Get the value of the 'style' attribute\n const style = span.getAttribute('style');\n // Check if the 'style' attribute contains 'mso-list: Ignore'\n if (style && style.includes('mso-list:Ignore')) {\n // Remove the <span> element\n (_a = span.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(span);\n }\n });\n}\nfunction isListContinuation(currentItem) {\n const previousSibling = currentItem.element.previousSibling;\n if (!previousSibling) {\n // If it's a li inside ul or ol like in here: https://github.com/ckeditor/ckeditor5/issues/15964.\n return isList(currentItem.element.parentElement);\n }\n // Even with the same id the list does not have to be continuous (#43).\n // @ts-expect-error\n return isList(previousSibling);\n}\nconst isList = (element) => ['ul', 'ol'].includes(element.tagName.toLowerCase());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MSWordNormalizer = void 0;\nconst normalizer_1 = require(\"./normalizer\");\nObject.defineProperty(exports, \"MSWordNormalizer\", { enumerable: true, get: function () { return normalizer_1.MSWordNormalizer; } });\n","import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { useEffect } from 'react';\nimport { $getSelection, COMMAND_PRIORITY_CRITICAL, type CommandPayloadType, PASTE_COMMAND } from 'lexical';\nimport { objectKlassEquals } from '@lexical/utils';\nimport { $insertDataTransferForRichText } from '@lexical/clipboard';\nimport { MSWordNormalizer } from '@staartwind.nl/lexical-paste-from-word';\n\nexport const PasteHandlerPlugin = () => {\n const [editor] = useLexicalComposerContext();\n\n const handlePaste = (event: CommandPayloadType<typeof PASTE_COMMAND>) => {\n event.preventDefault();\n editor.update(() => {\n const selection = $getSelection();\n const clipboardData =\n objectKlassEquals(event, InputEvent) || objectKlassEquals(event, KeyboardEvent) ? null : event.clipboardData;\n if (clipboardData != null && selection !== null) {\n const content = clipboardData.getData('text/html') || clipboardData.getData('text/plain');\n const newData = new DataTransfer();\n const wordNormalizer = new MSWordNormalizer();\n newData.setData('text/html', content);\n if (wordNormalizer.isActive(content)) {\n newData.setData('text/html', wordNormalizer.normalize(content));\n }\n $insertDataTransferForRichText(newData, selection, editor);\n }\n });\n };\n\n useEffect(() => {\n const removePasteListener = editor.registerCommand(\n PASTE_COMMAND,\n (event) => {\n if (event instanceof ClipboardEvent) {\n handlePaste(event);\n return true;\n }\n return false;\n },\n COMMAND_PRIORITY_CRITICAL\n );\n\n return () => {\n removePasteListener();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [editor]);\n\n return null;\n};\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;AAEA,CADA,OAAO,eAAe,GAAS,cAAc,EAAE,OAAO,IAAM,CAAC,EAC7D,EAAQ,yBAAyB,EAAQ,mBAAmB,EAAQ,YAAY,EAAQ,mBAAmB,KAAK;CAChH,IAAM,IAAkB,CACpB,wEACA,sCACH;AA4ID,GAAQ,mBA3IR,MAAuB;EACnB,SAAS,GAAY;AACjB,UAAO,EAAgB,MAAK,MAAS,EAAM,KAAK,EAAW,CAAC;;EAEhE,UAAU,GAAY;GAClB,IAAM,EAAE,eAAY,oBAAiB,EAAU,EAAW,EACpD,IAAM,IAAI,WAAW,CAAC,gBAAgB,GAAY,YAAY;AAGpE,UAFA,KAAK,wCAAwC,GAAK,EAAa,EAC/D,KAAK,mBAAmB,EAAI,EACrB,EAAI,KAAK;;EAEpB,wBAAwB,GAAK;GACzB,IAAM,IAAQ,EAAI,iBAAiB,IAAI,EACjC,IAAM,EAAE;AACd,QAAK,IAAM,KAAQ,GAAO;IACtB,IAAM,IAAU,EAAK,QAAQ,aAAa;AAE1C,QAAI,CAAC;KAAC;KAAK;KAAM;KAAM;KAAM;KAAM;KAAM;KAAM;KAAM;KAAM,CAAC,SAAS,EAAQ,IAAI,EAAE,aAAgB,aAC/F;IAEJ,IAAM,IAAQ,EAAqB,EAAK,aAAa,QAAQ,IAAI,GAAG;AAEpE,QAAI,cAAc,GAAO;AAGrB,SAFI,CAAC,EAAK,iBAEN,EAAO,EAAK,cAAc,CAC1B;KACJ,IAAM,IAAW,EAAgB,EAAM;AACvC,OAAI,KAAK,OAAO,OAAO,OAA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EAEtC,KAAe,MAAoD;AAEvE,EADA,EAAM,gBAAgB,EACtB,EAAO,aAAa;GAClB,IAAM,IAAY,GAAe,EAC3B,IACJ,EAAkB,GAAO,WAAW,IAAI,EAAkB,GAAO,cAAc,GAAG,OAAO,EAAM;AACjG,OAAI,KAAiB,QAAQ,MAAc,MAAM;IAC/C,IAAM,IAAU,EAAc,QAAQ,YAAY,IAAI,EAAc,QAAQ,aAAa,EACnF,IAAU,IAAI,cAAc,EAC5B,IAAiB,IAAI,EAAA,kBAAkB;AAK7C,IAJA,EAAQ,QAAQ,aAAa,EAAQ,EACjC,EAAe,SAAS,EAAQ,IAClC,EAAQ,QAAQ,aAAa,EAAe,UAAU,EAAQ,CAAC,EAEjE,EAA+B,GAAS,GAAW,EAAO;;IAE5D;;AAsBJ,QAnBA,QAAgB;EACd,IAAM,IAAsB,EAAO,gBACjC,IACC,MACK,aAAiB,kBACnB,EAAY,EAAM,EACX,MAEF,MAGV;AAED,eAAa;AACX,MAAqB;;IAGtB,CAAC,EAAO,CAAC,EAEL"}
1
+ {"version":3,"file":"PasteHandlerPlugin-YpQruA-w.js","names":[],"sources":["../node_modules/@staartwind.nl/lexical-paste-from-word/dist/normalizer.js","../node_modules/@staartwind.nl/lexical-paste-from-word/dist/index.js","../src/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.tsx"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.normalizeSpacerunSpans = exports.normalizeSpacing = exports.parseHtml = exports.MSWordNormalizer = void 0;\nconst MS_WORD_MATCHES = [\n /<meta\\s*name=\"?generator\"?\\s*content=\"?microsoft\\s*word\\s*\\d+\"?\\/?>/i,\n /xmlns:o=\"urn:schemas-microsoft-com/i\n];\nclass MSWordNormalizer {\n isActive(htmlString) {\n return MS_WORD_MATCHES.some(regex => regex.test(htmlString));\n }\n normalize(htmlString) {\n const { bodyString, stylesString } = parseHtml(htmlString);\n const doc = new DOMParser().parseFromString(bodyString, 'text/html');\n this.transformListItemLikeLElementsIntoLists(doc, stylesString);\n this.removeMSAttributes(doc);\n return doc.body.innerHTML;\n }\n findAllItemLikeElements(doc) {\n const items = doc.querySelectorAll('*');\n const res = [];\n for (const item of items) {\n const tagName = item.tagName.toLowerCase();\n // Find all the possible list items\n if (!['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li', 'div'].includes(tagName) || !(item instanceof HTMLElement)) {\n continue;\n }\n const style = convertStyleToObject(item.getAttribute('style') || '');\n // Keep items that are part of a list.\n if ('mso-list' in style) {\n if (!item.parentElement)\n continue;\n if (isList(item.parentElement))\n continue;\n const itemData = getListItemData(style);\n res.push(Object.assign(Object.assign({}, itemData), { element: item }));\n }\n }\n return res;\n }\n transformListItemLikeLElementsIntoLists(doc, stylesString) {\n var _a, _b, _c, _d, _e, _f, _g;\n const itemLikeElements = this.findAllItemLikeElements(doc);\n if (!itemLikeElements.length) {\n return;\n }\n const encounteredLists = {};\n const stack = [];\n for (const itemLikeElement of itemLikeElements) {\n if (itemLikeElement.indent != null) {\n // Reset the current stack if the previous used list does not continue with itemLikeElement\n if (!isListContinuation(itemLikeElement)) {\n stack.length = 0;\n }\n // Combined list ID for addressing encounter lists counters.\n const originalListId = `${itemLikeElement.id}:${itemLikeElement.indent}`;\n // Normalized list item indentation.\n const indent = Math.min(itemLikeElement.indent - 1, stack.length);\n // Trimming of the list stack on list ID change.\n if (indent < stack.length && ((_a = stack[indent]) === null || _a === void 0 ? void 0 : _a.id) !== itemLikeElement.id) {\n stack.length = indent;\n }\n // Trimming of the list stack on lower indent list encountered.\n if (indent < stack.length - 1) {\n stack.length = indent + 1;\n }\n else {\n const listStyle = detectListStyle(itemLikeElement, stylesString);\n // Create a new OL/UL if required (greater indent or different list type).\n if (indent > stack.length - 1 || ((_b = stack[indent]) === null || _b === void 0 ? void 0 : _b.listElement.tagName.toLowerCase()) != listStyle.type) {\n if (indent == 0 &&\n listStyle.type == 'ol' &&\n itemLikeElement.id !== undefined &&\n encounteredLists[originalListId]) {\n listStyle.startIndex = (_c = encounteredLists[originalListId]) !== null && _c !== void 0 ? _c : null;\n }\n const listElement = createNewEmptyList(listStyle, false);\n // Insert the new OL/UL.\n if (stack.length == 0) {\n const parent = itemLikeElement.element.parentNode;\n const index = Array.from(parent.children).indexOf(itemLikeElement.element) + 1;\n if (index === parent.children.length) {\n parent.appendChild(listElement);\n }\n else {\n parent.insertBefore(listElement, itemLikeElement.element);\n }\n }\n else {\n const parentListItems = (_d = stack[indent - 1]) === null || _d === void 0 ? void 0 : _d.listItemElements;\n if (parentListItems) {\n (_e = parentListItems[parentListItems.length - 1]) === null || _e === void 0 ? void 0 : _e.appendChild(listElement);\n }\n }\n // Update the list stack for other items to reference.\n stack[indent] = Object.assign(Object.assign({}, itemLikeElement), { listElement, listItemElements: [] });\n // Prepare list counter for start index.\n if (indent == 0 && itemLikeElement.id !== undefined) {\n encounteredLists[originalListId] = listStyle.startIndex || 1;\n }\n }\n }\n // Use LI if it is already it or create a new LI element.\n const listItem = itemLikeElement.element.tagName.toLowerCase() == 'li' ? itemLikeElement.element : document.createElement('li');\n // Append the LI to OL/UL.\n (_f = stack[indent]) === null || _f === void 0 ? void 0 : _f.listElement.appendChild(listItem);\n (_g = stack[indent]) === null || _g === void 0 ? void 0 : _g.listItemElements.push(listItem);\n // Increment list counter.\n if (indent == 0 && itemLikeElement.id !== undefined) {\n encounteredLists[originalListId]++;\n }\n // Append list block to LI.\n if (itemLikeElement.element != listItem) {\n listItem.appendChild(itemLikeElement.element);\n }\n // Clean list block.\n removeMsoListIgnoreSpans(itemLikeElement.element);\n }\n }\n }\n removeMSAttributes(doc) {\n const items = doc.querySelectorAll('*');\n const elementsToUnwrap = [];\n for (const item of items) {\n // Eliminate all classes that include mso.\n for (const className of item.classList) {\n if (/\\bmso/gi.exec(className)) {\n item.classList.remove(className);\n }\n }\n // Eliminate all useless mso styling\n if (item instanceof HTMLElement) {\n removeMSOStyles(item);\n }\n // Push word specific elements to an array\n if (item.tagName === 'W:SDT' || item.tagName === 'W:SDTPR' && isElementEmpty(item) || item.tagName === 'O:P' && isElementEmpty(item)) {\n elementsToUnwrap.push(item);\n }\n }\n // Eliminate word specific elements\n for (const item of elementsToUnwrap) {\n const itemParent = item.parentNode;\n itemParent.removeChild(item);\n }\n }\n}\nexports.MSWordNormalizer = MSWordNormalizer;\nfunction parseHtml(htmlString) {\n const domParser = new DOMParser();\n // Remove Word specific \"if comments\" so content inside is not omitted by the parser.\n htmlString = htmlString.replace(/<!--\\[if gte vml 1]>/g, '');\n // Clean the <head> section of MS Windows specific tags. See https://github.com/ckeditor/ckeditor5/issues/15333.\n // The regular expression matches the <o:SmartTagType> tag with optional attributes (with or without values).\n htmlString = htmlString.replace(/<o:SmartTagType(?:\\s+[^\\s>=]+(?:=\"[^\"]*\")?)*\\s*\\/?>/gi, '');\n const normalizedHtml = normalizeSpacing(cleanContentAfterBody(htmlString));\n // Parse htmlString as native Document object.\n const htmlDocument = domParser.parseFromString(normalizedHtml, 'text/html');\n normalizeSpacerunSpans(htmlDocument);\n // Get `innerHTML` first as transforming to View modifies the source document.\n const bodyString = htmlDocument.body.innerHTML;\n const stylesString = extractStyles(htmlDocument);\n return {\n bodyString,\n stylesString\n };\n}\nexports.parseHtml = parseHtml;\nfunction extractStyles(htmlDocument) {\n const styles = [];\n const stylesString = [];\n const styleTags = Array.from(htmlDocument.getElementsByTagName('style'));\n for (const style of styleTags) {\n if (style.sheet && style.sheet.cssRules && style.sheet.cssRules.length) {\n styles.push(style.sheet);\n stylesString.push(style.innerHTML);\n }\n }\n return stylesString.join(' ');\n}\nfunction normalizeSpacing(htmlString) {\n // Run normalizeSafariSpaceSpans() two times to cover nested spans.\n return normalizeSafariSpaceSpans(normalizeSafariSpaceSpans(htmlString))\n // Remove all \\r\\n from \"spacerun spans\" so the last replace line doesn't strip all whitespaces.\n .replace(/(<span\\s+style=['\"]mso-spacerun:yes['\"]>[^\\S\\r\\n]*?)[\\r\\n]+([^\\S\\r\\n]*<\\/span>)/g, '$1$2')\n .replace(/<span\\s+style=['\"]mso-spacerun:yes['\"]><\\/span>/g, '')\n .replace(/(<span\\s+style=['\"]letter-spacing:[^'\"]+?['\"]>)[\\r\\n]+(<\\/span>)/g, '$1 $2')\n .replace(/ <\\//g, '\\u00A0</')\n .replace(/ <o:p><\\/o:p>/g, '\\u00A0<o:p></o:p>')\n // Remove <o:p> block filler from empty paragraph. Safari uses \\u00A0 instead of &nbsp;.\n .replace(/<o:p>(&nbsp;|\\u00A0)<\\/o:p>/g, '')\n // Remove all whitespaces when they contain any \\r or \\n.\n .replace(/>([^\\S\\r\\n]*[\\r\\n]\\s*)</g, '><');\n}\nexports.normalizeSpacing = normalizeSpacing;\nfunction normalizeSafariSpaceSpans(htmlString) {\n return htmlString.replace(/<span(?: class=\"Apple-converted-space\"|)>(\\s+)<\\/span>/g, (fullMatch, spaces) => {\n return spaces.length === 1 ? ' ' : Array(spaces.length + 1).join('\\u00A0 ').substring(0, spaces.length);\n });\n}\nfunction normalizeSpacerunSpans(htmlDocument) {\n htmlDocument.querySelectorAll('span[style*=spacerun]').forEach(el => {\n const htmlElement = el;\n const innerTextLength = htmlElement.innerText.length || 0;\n htmlElement.innerText = Array(innerTextLength + 1).join('\\u00A0 ').substring(0, innerTextLength);\n });\n}\nexports.normalizeSpacerunSpans = normalizeSpacerunSpans;\nfunction cleanContentAfterBody(htmlString) {\n const bodyCloseTag = '</body>';\n const htmlCloseTag = '</html>';\n const bodyCloseIndex = htmlString.indexOf(bodyCloseTag);\n if (bodyCloseIndex < 0) {\n return htmlString;\n }\n const htmlCloseIndex = htmlString.indexOf(htmlCloseTag, bodyCloseIndex + bodyCloseTag.length);\n return htmlString.substring(0, bodyCloseIndex + bodyCloseTag.length) +\n (htmlCloseIndex >= 0 ? htmlString.substring(htmlCloseIndex) : '');\n}\nfunction convertStyleToObject(styleString) {\n const styleObject = {};\n if (!styleString) {\n return styleObject;\n }\n // Split the style string into individual declarations\n const declarations = styleString.split(';').map(declaration => declaration.trim());\n // Iterate over each declaration and split it into property and value\n declarations.forEach(declaration => {\n const [property, value] = declaration.split(':').map(part => part.trim());\n if (property && value) {\n // Add the property and value to the style object\n styleObject[property] = value;\n }\n });\n return styleObject;\n}\nfunction isElementEmpty(element) {\n return !element.textContent && !element.innerHTML.trim();\n}\nfunction removeMSOStyles(element) {\n // Get the current style string of the paragraph node\n const currentStyle = element.getAttribute('style') || '';\n // Parse the style string to extract individual style properties\n const styleProperties = currentStyle.split(';').map(property => property.trim());\n // Remove the 'mso-bidi-font-family' property from the list of style properties\n const filteredProperties = styleProperties.filter(property => {\n var _a;\n const [key] = property.split(':');\n return !(/\\bmso/gi.exec((_a = key === null || key === void 0 ? void 0 : key.toLowerCase()) !== null && _a !== void 0 ? _a : ''));\n });\n // Reconstruct the style string without the removed property\n const updatedStyle = filteredProperties.join(';');\n // Set the updated style string back to the paragraph node\n element.setAttribute('style', updatedStyle);\n}\nfunction getListItemData(styles) {\n var _a;\n const listStyle = styles['mso-list'];\n if (listStyle === undefined) {\n return {};\n }\n const idMatch = listStyle.match(/(^|\\s{1,100})l(\\d+)/i);\n const orderMatch = listStyle.match(/\\s{0,100}lfo(\\d+)/i);\n const indentMatch = listStyle.match(/\\s{0,100}level(\\d+)/i);\n if (idMatch && orderMatch && indentMatch) {\n return {\n id: idMatch[2],\n order: orderMatch[1],\n indent: parseInt((_a = indentMatch[1]) !== null && _a !== void 0 ? _a : '')\n };\n }\n return {\n indent: 1\n };\n}\nfunction detectListStyle(listLikeItem, stylesString) {\n const listStyleRegexp = new RegExp(`@list l${listLikeItem.id}:level${listLikeItem.indent}\\\\s*({[^}]*)`, 'gi');\n const listStyleTypeRegex = /mso-level-number-format:([^;]{0,100});/gi;\n const listStartIndexRegex = /mso-level-start-at:\\s{0,100}([0-9]{0,10})\\s{0,100};/gi;\n const legalStyleListRegex = new RegExp(`@list\\\\s+l${listLikeItem.id}:level\\\\d\\\\s*{[^{]*mso-level-text:\"%\\\\d\\\\\\\\.`, 'gi');\n const multiLevelNumberFormatTypeRegex = new RegExp(`@list l${listLikeItem.id}:level\\\\d\\\\s*{[^{]*mso-level-number-format:`, 'gi');\n const legalStyleListMatch = legalStyleListRegex.exec(stylesString);\n const multiLevelNumberFormatMatch = multiLevelNumberFormatTypeRegex.exec(stylesString);\n // Multi level lists in Word have mso-level-number-format attribute except legal lists,\n // so we used that. If list has legal list match and doesn't has mso-level-number-format\n // then this is legal-list.\n const islegalStyleList = legalStyleListMatch && !multiLevelNumberFormatMatch;\n const listStyleMatch = listStyleRegexp.exec(stylesString);\n let listStyleType = 'decimal'; // Decimal is default one.\n let type = 'ol'; // <ol> is default list.\n let startIndex = null;\n if (listStyleMatch && listStyleMatch[1]) {\n const listStyleTypeMatch = listStyleTypeRegex.exec(listStyleMatch[1]);\n if (listStyleTypeMatch && listStyleTypeMatch[1]) {\n listStyleType = listStyleTypeMatch[1].trim();\n type = listStyleType !== 'bullet' && listStyleType !== 'image' ? 'ol' : 'ul';\n }\n // Styles for the numbered lists are always defined in the Word CSS stylesheet.\n // Unordered lists MAY contain a value for the Word CSS definition `mso-level-text` but sometimes\n // this tag is missing. And because of that, we cannot depend on that. We need to predict the list style value\n // based on the list style marker element.\n if (listStyleType === 'bullet') {\n const bulletedStyle = findBulletedListStyle(listLikeItem.element);\n if (bulletedStyle) {\n listStyleType = bulletedStyle;\n }\n }\n else {\n const listStartIndexMatch = listStartIndexRegex.exec(listStyleMatch[1]);\n if (listStartIndexMatch && listStartIndexMatch[1]) {\n startIndex = parseInt(listStartIndexMatch[1]);\n }\n }\n if (islegalStyleList) {\n type = 'ol';\n }\n }\n return {\n type,\n startIndex,\n style: mapListStyleDefinition(listStyleType),\n isLegalStyleList: islegalStyleList\n };\n}\nfunction findBulletedListStyle(element) {\n // https://github.com/ckeditor/ckeditor5/issues/15964\n if (element.tagName.toLowerCase() == 'li' && element.parentElement.tagName.toLowerCase() == 'ul' && element.parentElement.hasAttribute('type')) {\n return element.parentElement.getAttribute('type');\n }\n const listMarkerElement = findListMarkerNode(element);\n if (!listMarkerElement) {\n return null;\n }\n const listMarker = listMarkerElement.textContent;\n if (listMarker === 'o') {\n return 'circle';\n }\n else if ((listMarker !== null && listMarker !== void 0 ? listMarker : '').charCodeAt(0) === 183) {\n return 'disc';\n }\n // Word returns '§' instead of '■' for the square list style.\n else if (listMarker === '§') {\n return 'square';\n }\n return null;\n}\nfunction findListMarkerNode(element) {\n var _a;\n // If the first child is a text node, it is the data for the element.\n // The list-style marker is not present here.\n if (((_a = Array.from(element.children)[0]) === null || _a === void 0 ? void 0 : _a.tagName.toLowerCase()) === '#text') {\n return null;\n }\n for (const childNode of Array.from(element.children)) {\n // The list-style marker will be inside the `<span>` element. Let's ignore all non-span elements.\n // It may happen that the `<a>` element is added as the first child. Most probably, it's an anchor element.\n if (!['element', 'span'].includes(childNode.tagName.toLowerCase())) {\n continue;\n }\n return childNode;\n }\n return null;\n}\nfunction mapListStyleDefinition(value) {\n if (value.startsWith('arabic-leading-zero')) {\n return 'decimal-leading-zero';\n }\n switch (value) {\n case 'alpha-upper':\n return 'upper-alpha';\n case 'alpha-lower':\n return 'lower-alpha';\n case 'roman-upper':\n return 'upper-roman';\n case 'roman-lower':\n return 'lower-roman';\n case 'circle':\n case 'disc':\n case 'square':\n return value;\n default:\n return null;\n }\n}\nfunction createNewEmptyList(listStyle, hasMultiLevelListPlugin) {\n const list = document.createElement(listStyle.type);\n // We do not support modifying the marker for a particular list item.\n // Set the value for the `list-style-type` property directly to the list container.\n if (listStyle.style) {\n list.style.setProperty('list-style-type', listStyle.style);\n }\n if (listStyle.startIndex && listStyle.startIndex > 1) {\n list.setAttribute('start', listStyle.startIndex.toString());\n }\n if (listStyle.isLegalStyleList && hasMultiLevelListPlugin) {\n list.classList.add('legal-list');\n }\n return list;\n}\nfunction removeMsoListIgnoreSpans(parentElement) {\n // Get all <span> elements inside the parentElement\n const spans = parentElement.querySelectorAll('span');\n // Iterate over each <span> element\n spans.forEach(span => {\n var _a;\n // Get the value of the 'style' attribute\n const style = span.getAttribute('style');\n // Check if the 'style' attribute contains 'mso-list: Ignore'\n if (style && style.includes('mso-list:Ignore')) {\n // Remove the <span> element\n (_a = span.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(span);\n }\n });\n}\nfunction isListContinuation(currentItem) {\n const previousSibling = currentItem.element.previousSibling;\n if (!previousSibling) {\n // If it's a li inside ul or ol like in here: https://github.com/ckeditor/ckeditor5/issues/15964.\n return isList(currentItem.element.parentElement);\n }\n // Even with the same id the list does not have to be continuous (#43).\n // @ts-expect-error\n return isList(previousSibling);\n}\nconst isList = (element) => ['ul', 'ol'].includes(element.tagName.toLowerCase());\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MSWordNormalizer = void 0;\nconst normalizer_1 = require(\"./normalizer\");\nObject.defineProperty(exports, \"MSWordNormalizer\", { enumerable: true, get: function () { return normalizer_1.MSWordNormalizer; } });\n","import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { useEffect } from 'react';\nimport { $getSelection, COMMAND_PRIORITY_CRITICAL, type CommandPayloadType, PASTE_COMMAND } from 'lexical';\nimport { objectKlassEquals } from '@lexical/utils';\nimport { $insertDataTransferForRichText } from '@lexical/clipboard';\nimport { MSWordNormalizer } from '@staartwind.nl/lexical-paste-from-word';\n\nexport const PasteHandlerPlugin = () => {\n const [editor] = useLexicalComposerContext();\n\n const handlePaste = (event: CommandPayloadType<typeof PASTE_COMMAND>) => {\n event.preventDefault();\n editor.update(() => {\n const selection = $getSelection();\n const clipboardData =\n objectKlassEquals(event, InputEvent) || objectKlassEquals(event, KeyboardEvent) ? null : event.clipboardData;\n if (clipboardData != null && selection !== null) {\n const content = clipboardData.getData('text/html') || clipboardData.getData('text/plain');\n const newData = new DataTransfer();\n const wordNormalizer = new MSWordNormalizer();\n newData.setData('text/html', content);\n if (wordNormalizer.isActive(content)) {\n newData.setData('text/html', wordNormalizer.normalize(content));\n }\n $insertDataTransferForRichText(newData, selection, editor);\n }\n });\n };\n\n useEffect(() => {\n const removePasteListener = editor.registerCommand(\n PASTE_COMMAND,\n (event) => {\n if (event instanceof ClipboardEvent) {\n handlePaste(event);\n return true;\n }\n return false;\n },\n COMMAND_PRIORITY_CRITICAL\n );\n\n return () => {\n removePasteListener();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [editor]);\n\n return null;\n};\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;AAEA,CADA,OAAO,eAAe,GAAS,cAAc,EAAE,OAAO,IAAM,CAAC,EAC7D,EAAQ,yBAAyB,EAAQ,mBAAmB,EAAQ,YAAY,EAAQ,mBAAmB,KAAK;CAChH,IAAM,IAAkB,CACpB,wEACA,sCACH;AA4ID,GAAQ,mBA3IR,MAAuB;EACnB,SAAS,GAAY;AACjB,UAAO,EAAgB,MAAK,MAAS,EAAM,KAAK,EAAW,CAAC;;EAEhE,UAAU,GAAY;GAClB,IAAM,EAAE,eAAY,oBAAiB,EAAU,EAAW,EACpD,IAAM,IAAI,WAAW,CAAC,gBAAgB,GAAY,YAAY;AAGpE,UAFA,KAAK,wCAAwC,GAAK,EAAa,EAC/D,KAAK,mBAAmB,EAAI,EACrB,EAAI,KAAK;;EAEpB,wBAAwB,GAAK;GACzB,IAAM,IAAQ,EAAI,iBAAiB,IAAI,EACjC,IAAM,EAAE;AACd,QAAK,IAAM,KAAQ,GAAO;IACtB,IAAM,IAAU,EAAK,QAAQ,aAAa;AAE1C,QAAI,CAAC;KAAC;KAAK;KAAM;KAAM;KAAM;KAAM;KAAM;KAAM;KAAM;KAAM,CAAC,SAAS,EAAQ,IAAI,EAAE,aAAgB,aAC/F;IAEJ,IAAM,IAAQ,EAAqB,EAAK,aAAa,QAAQ,IAAI,GAAG;AAEpE,QAAI,cAAc,GAAO;AAGrB,SAFI,CAAC,EAAK,iBAEN,EAAO,EAAK,cAAc,CAC1B;KACJ,IAAM,IAAW,EAAgB,EAAM;AACvC,OAAI,KAAK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AC,KAAU,GAA2B,EAEtC,KAAe,MAAoD;AAEvE,EADA,EAAM,gBAAgB,EACtB,EAAO,aAAa;GAClB,IAAM,IAAY,GAAe,EAC3B,IACJ,EAAkB,GAAO,WAAW,IAAI,EAAkB,GAAO,cAAc,GAAG,OAAO,EAAM;AACjG,OAAI,KAAiB,QAAQ,MAAc,MAAM;IAC/C,IAAM,IAAU,EAAc,QAAQ,YAAY,IAAI,EAAc,QAAQ,aAAa,EACnF,IAAU,IAAI,cAAc,EAC5B,IAAiB,IAAI,EAAA,kBAAkB;AAK7C,IAJA,EAAQ,QAAQ,aAAa,EAAQ,EACjC,EAAe,SAAS,EAAQ,IAClC,EAAQ,QAAQ,aAAa,EAAe,UAAU,EAAQ,CAAC,EAEjE,EAA+B,GAAS,GAAW,EAAO;;IAE5D;;AAsBJ,QAnBA,QAAgB;EACd,IAAM,IAAsB,EAAO,gBACjC,IACC,MACK,aAAiB,kBACnB,EAAY,EAAM,EACX,MAEF,MAGV;AAED,eAAa;AACX,MAAqB;;IAGtB,CAAC,EAAO,CAAC,EAEL"}
@@ -1,13 +1,12 @@
1
- import './assets/RteEditor.css';//#region src/components/RteEditor/RteEditor.module.css
2
- var e = "_editor__container_17vay_1", t = "_editor__header_17vay_6", n = "_editor_17vay_1", r = "_editor__field_17vay_36", i = "_editor__toolbar_17vay_44", a = "_editor__placeholder_17vay_202", o = {
3
- editor__container: e,
4
- editor__header: t,
1
+ import './assets/RteEditor.css';var e = {
2
+ editor__container: "_editor__container_17vay_1",
3
+ editor__header: "_editor__header_17vay_6",
5
4
  "editor__header-word-count": "_editor__header-word-count_17vay_14",
6
5
  "editor__header-word-count--alert": "_editor__header-word-count--alert_17vay_23",
7
- editor: n,
8
- editor__field: r,
6
+ editor: "_editor_17vay_1",
7
+ editor__field: "_editor__field_17vay_36",
9
8
  "not-valid": "_not-valid_17vay_40",
10
- editor__toolbar: i,
9
+ editor__toolbar: "_editor__toolbar_17vay_44",
11
10
  "editor__toolbar-flyout-wrapper": "_editor__toolbar-flyout-wrapper_17vay_53",
12
11
  "editor__toolbar-button-group": "_editor__toolbar-button-group_17vay_66",
13
12
  "editor__toolbar-button-group--text": "_editor__toolbar-button-group--text_17vay_73",
@@ -18,7 +17,7 @@ var e = "_editor__container_17vay_1", t = "_editor__header_17vay_6", n = "_edito
18
17
  "editor__toolbar-button--italic": "_editor__toolbar-button--italic_17vay_136",
19
18
  "editor__toolbar-button-flyoutwrapper": "_editor__toolbar-button-flyoutwrapper_17vay_155",
20
19
  "editor__field-wrapper": "_editor__field-wrapper_17vay_159",
21
- editor__placeholder: a,
20
+ editor__placeholder: "_editor__placeholder_17vay_202",
22
21
  "guide-text-ltr": "_guide-text-ltr_17vay_212",
23
22
  "guide-text-rtl": "_guide-text-rtl_17vay_216",
24
23
  "guide-text-paragraph": "_guide-text-paragraph_17vay_220",
@@ -37,6 +36,6 @@ var e = "_editor__container_17vay_1", t = "_editor__header_17vay_6", n = "_edito
37
36
  "guide-text__course-catalogue-link": "_guide-text__course-catalogue-link_17vay_358"
38
37
  };
39
38
  //#endregion
40
- export { o as t };
39
+ export { e as t };
41
40
 
42
- //# sourceMappingURL=RteEditor.module-Jk80F1FA.js.map
41
+ //# sourceMappingURL=RteEditor.module-BJLUYSpf.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RteEditor.module-Jk80F1FA.js","names":[],"sources":["../src/components/RteEditor/RteEditor.module.css"],"sourcesContent":[".editor__container {\n display: flex;\n flex-direction: column;\n}\n\n.editor__header {\n align-items: center;\n display: flex;\n justify-content: space-between;\n margin-bottom: 0.5rem;\n min-height: 1.5rem;\n}\n\n.editor__header-word-count {\n align-self: flex-end;\n font-size: 0.875rem;\n margin-left: 0.5rem;\n text-align: right;\n white-space: nowrap;\n width: 4.5rem;\n}\n\n.editor__header-word-count--alert {\n color: var(--color-red-600);\n font-weight: bold;\n}\n\n.editor {\n background-color: var(--color-uva-white);\n border: 1px solid var(--color-grey-600);\n border-radius: 4px;\n margin-bottom: 0.5rem;\n padding: 0.25rem;\n}\n\n.editor:has(.editor__field:focus-visible) {\n outline: 1px solid var(--color-navy-600);\n}\n\n.editor.not-valid {\n border-color: var(--color-red-600);\n}\n\n.editor__toolbar {\n align-items: center;\n display: flex;\n gap: 0.25rem;\n justify-content: flex-start;\n margin-bottom: 0.5rem;\n padding: 0.25rem;\n}\n\n.editor__toolbar-flyout-wrapper {\n background-color: var(--color-uva-white);\n border-radius: 0.25rem;\n box-shadow: 0 3px 6px rgba(0 0 0 / 40%);\n display: flex;\n flex-direction: column;\n left: 0;\n padding: 1rem;\n position: fixed;\n top: calc(100% + 0.25rem);\n z-index: 1500;\n}\n\n.editor__toolbar-button-group {\n align-items: center;\n display: flex;\n gap: 0.125rem;\n justify-content: center;\n}\n\n.editor__toolbar-button-group--text {\n align-items: center;\n display: flex;\n gap: 0.5rem;\n justify-content: center;\n}\n\n.editor__toolbar-button {\n align-items: center;\n background-color: var(--color-uva-white);\n border: none;\n border-radius: 0.25rem;\n cursor: pointer;\n display: flex;\n font-family: inherit;\n font-size: inherit;\n justify-content: center;\n min-height: 2rem;\n width: 2rem;\n}\n\n.editor__toolbar-button:hover {\n background-color: var(--color-grey-400);\n border: 1px solid var(--color-grey-700);\n}\n\n.editor__toolbar-button:focus-visible {\n outline: 0.125rem dotted var(--color-navy-600);\n outline-offset: 0.125rem;\n z-index: 1;\n}\n\n.editor__toolbar-button--active,\n.editor__toolbar-button:active {\n background-color: var(--color-uva-black);\n border-color: var(--color-uva-black);\n color: var(--color-uva-white);\n}\n\n.editor__toolbar-button--text {\n border: 1px solid transparent;\n font-size: 1rem;\n padding: 0.25rem 0.5rem;\n width: auto;\n}\n\n.editor__toolbar-button:disabled {\n border-color: var(--color-grey-300);\n color: var(--color-grey-400);\n cursor: not-allowed;\n}\n\n.editor__toolbar-button:hover:disabled {\n background-color: var(--color-grey-300);\n border-color: var(--color-grey-300);\n color: var(--color-grey-500);\n cursor: not-allowed;\n}\n\n.editor__toolbar-button--bold {\n font-weight: bold;\n}\n\n.editor__toolbar-button--italic {\n font-style: italic;\n}\n\n.editor__toolbar-button:active:hover {\n color: var(--color-uva-white);\n}\n\n.editor__toolbar-button--active:hover {\n color: var(--color-uva-black);\n}\n\n.editor__toolbar-button--active:disabled {\n background-color: var(--color-grey-300);\n border-color: var(--color-grey-300);\n color: var(--color-grey-500);\n cursor: not-allowed;\n}\n\n.editor__toolbar-button-flyoutwrapper {\n position: relative;\n}\n\n.editor__field-wrapper {\n position: relative;\n}\n\n.editor__field-wrapper::before {\n border-top: 1px solid var(--color-grey-600);\n content: \"\";\n display: block;\n height: 0;\n margin-left: -0.25rem;\n margin-top: -0.3rem;\n width: calc(100% + 0.5rem);\n}\n\n.editor__field {\n background-color: var(--color-uva-white);\n margin-top: 0.5rem;\n min-height: 8rem;\n overflow-x: hidden;\n padding: 0 0.5rem 0.5rem;\n position: relative;\n}\n\n.editor__field::-webkit-scrollbar {\n cursor: default;\n width: 12px;\n}\n\n.editor__field::-webkit-scrollbar-track {\n background: var(--color-uva-white);\n}\n\n.editor__field::-webkit-scrollbar-thumb {\n background-color: var(--color-grey-500);\n border: 3px solid var(--color-uva-white);\n border-radius: 20px;\n cursor: default;\n}\n\n.editor__field:focus-visible {\n outline: none;\n}\n\n.editor__placeholder {\n color: var(--color-grey-500);\n left: 0.45rem;\n pointer-events: none;\n position: absolute;\n top: 0.55rem;\n}\n\n/* Editor theme blockstyles */\n\n.guide-text-ltr {\n text-align: left;\n}\n\n.guide-text-rtl {\n text-align: right;\n}\n\n.guide-text-paragraph {\n margin: 0;\n position: relative;\n}\n\n.guide-text__text--bold {\n font-weight: bold;\n}\n\n.guide-text__text--italic {\n font-style: italic;\n}\n\n.guide-text__list--ul,\n.guide-text__list--ol {\n list-style-position: inside;\n margin: 0 0 0 -0.25rem;\n padding: 0.25rem;\n}\n\n.guide-text__list--ol {\n list-style-position: outside;\n list-style-type: decimal;\n margin: 0 0 0 0.25rem;\n}\n\n.guide-text__list--ul .guide-text__list--listitem {\n margin: 0;\n}\n\n.guide-text__list--ol .guide-text__list--listitem {\n margin-left: 0.35rem;\n padding-left: 0.55rem;\n}\n\n.guide-text__list--ol .guide-text__list--nested-listitem,\n.guide-text__list--ul .guide-text__list--nested-listitem {\n list-style-type: none;\n margin-left: 1.5rem;\n}\n\n.guide-text__list--ol .guide-text__list--nested-listitem {\n margin-left: 1rem;\n}\n\n.guide-text__list--ul2 .guide-text__list--listitem {\n list-style-type: circle;\n}\n\n.guide-text__list--ul3 .guide-text__list--listitem {\n list-style-type: square;\n}\n\n.guide-text__list--ul4 .guide-text__list--listitem {\n list-style-type: disc;\n}\n\n.guide-text__list--ul5 .guide-text__list--listitem {\n list-style-type: circle;\n}\n\nul .guide-text__list--nested-listitem ol {\n list-style-position: outside;\n list-style-type: decimal;\n margin-left: 0;\n padding: 0.25rem 0.25rem 0.25rem 0.55rem;\n}\n\nul .guide-text__list--nested-listitem ol .guide-text__list--listitem {\n list-style-type: decimal;\n margin-left: 0.35rem;\n padding-left: 0.55rem;\n}\n\nol .guide-text__list--nested-listitem ul .guide-text__list--listitem {\n list-style-type: disc;\n margin-left: 0.35rem;\n padding-left: 0.55rem;\n}\n\nul .guide-text__list--nested-listitem {\n list-style-type: none !important;\n}\n\nol .guide-text__list--nested-listitem ul {\n margin-left: -1.5rem;\n padding-left: 0.55rem;\n}\n\n.guide-text__table-wrapper {\n margin: 0 1rem 0.5rem 0;\n overflow-x: auto;\n}\n\n.guide-text__table {\n border: 2px solid var(--color-grey-400);\n border-collapse: collapse;\n border-collapse: collapse;\n border-spacing: 0;\n margin: 0.5rem 0;\n overflow-x: scroll;\n overflow-y: scroll;\n table-layout: fixed;\n width: fit-content;\n}\n\n/* CSS counts the <colgroup> tag as the first \"row\" in the table. \nTherefore, to apply zebra striping to the actual odd rows, \nthe CSS must target the even rows instead. */\n\n.guide-text__table > tr:nth-child(even) {\n background-color: var(--color-grey-100);\n}\n\n.guide-text__table > tr td {\n border: 1px dotted var(--color-grey-400);\n padding: 0.25rem 0.5rem;\n position: relative;\n vertical-align: top;\n}\n\ntd .guide-text__table-wrapper {\n margin: 0;\n}\n\ntd:has(.guide-text__table-wrapper) {\n padding: 0 !important;\n}\n\ntd:has(.guide-text__table-wrapper) table {\n border: 0;\n margin: 0;\n}\n\ntd:has(.guide-text__table-wrapper) table tr {\n background-color: transparent !important;\n}\n\n.guide-text__course-catalogue-link {\n color: var(--color-grey-800);\n cursor: default;\n text-decoration: dotted underline;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"RteEditor.module-BJLUYSpf.js","names":[],"sources":["../src/components/RteEditor/RteEditor.module.css"],"sourcesContent":[".editor__container {\n display: flex;\n flex-direction: column;\n}\n\n.editor__header {\n align-items: center;\n display: flex;\n justify-content: space-between;\n margin-bottom: 0.5rem;\n min-height: 1.5rem;\n}\n\n.editor__header-word-count {\n align-self: flex-end;\n font-size: 0.875rem;\n margin-left: 0.5rem;\n text-align: right;\n white-space: nowrap;\n width: 4.5rem;\n}\n\n.editor__header-word-count--alert {\n color: var(--color-red-600);\n font-weight: bold;\n}\n\n.editor {\n background-color: var(--color-uva-white);\n border: 1px solid var(--color-grey-600);\n border-radius: 4px;\n margin-bottom: 0.5rem;\n padding: 0.25rem;\n}\n\n.editor:has(.editor__field:focus-visible) {\n outline: 1px solid var(--color-navy-600);\n}\n\n.editor.not-valid {\n border-color: var(--color-red-600);\n}\n\n.editor__toolbar {\n align-items: center;\n display: flex;\n gap: 0.25rem;\n justify-content: flex-start;\n margin-bottom: 0.5rem;\n padding: 0.25rem;\n}\n\n.editor__toolbar-flyout-wrapper {\n background-color: var(--color-uva-white);\n border-radius: 0.25rem;\n box-shadow: 0 3px 6px rgba(0 0 0 / 40%);\n display: flex;\n flex-direction: column;\n left: 0;\n padding: 1rem;\n position: fixed;\n top: calc(100% + 0.25rem);\n z-index: 1500;\n}\n\n.editor__toolbar-button-group {\n align-items: center;\n display: flex;\n gap: 0.125rem;\n justify-content: center;\n}\n\n.editor__toolbar-button-group--text {\n align-items: center;\n display: flex;\n gap: 0.5rem;\n justify-content: center;\n}\n\n.editor__toolbar-button {\n align-items: center;\n background-color: var(--color-uva-white);\n border: none;\n border-radius: 0.25rem;\n cursor: pointer;\n display: flex;\n font-family: inherit;\n font-size: inherit;\n justify-content: center;\n min-height: 2rem;\n width: 2rem;\n}\n\n.editor__toolbar-button:hover {\n background-color: var(--color-grey-400);\n border: 1px solid var(--color-grey-700);\n}\n\n.editor__toolbar-button:focus-visible {\n outline: 0.125rem dotted var(--color-navy-600);\n outline-offset: 0.125rem;\n z-index: 1;\n}\n\n.editor__toolbar-button--active,\n.editor__toolbar-button:active {\n background-color: var(--color-uva-black);\n border-color: var(--color-uva-black);\n color: var(--color-uva-white);\n}\n\n.editor__toolbar-button--text {\n border: 1px solid transparent;\n font-size: 1rem;\n padding: 0.25rem 0.5rem;\n width: auto;\n}\n\n.editor__toolbar-button:disabled {\n border-color: var(--color-grey-300);\n color: var(--color-grey-400);\n cursor: not-allowed;\n}\n\n.editor__toolbar-button:hover:disabled {\n background-color: var(--color-grey-300);\n border-color: var(--color-grey-300);\n color: var(--color-grey-500);\n cursor: not-allowed;\n}\n\n.editor__toolbar-button--bold {\n font-weight: bold;\n}\n\n.editor__toolbar-button--italic {\n font-style: italic;\n}\n\n.editor__toolbar-button:active:hover {\n color: var(--color-uva-white);\n}\n\n.editor__toolbar-button--active:hover {\n color: var(--color-uva-black);\n}\n\n.editor__toolbar-button--active:disabled {\n background-color: var(--color-grey-300);\n border-color: var(--color-grey-300);\n color: var(--color-grey-500);\n cursor: not-allowed;\n}\n\n.editor__toolbar-button-flyoutwrapper {\n position: relative;\n}\n\n.editor__field-wrapper {\n position: relative;\n}\n\n.editor__field-wrapper::before {\n border-top: 1px solid var(--color-grey-600);\n content: \"\";\n display: block;\n height: 0;\n margin-left: -0.25rem;\n margin-top: -0.3rem;\n width: calc(100% + 0.5rem);\n}\n\n.editor__field {\n background-color: var(--color-uva-white);\n margin-top: 0.5rem;\n min-height: 8rem;\n overflow-x: hidden;\n padding: 0 0.5rem 0.5rem;\n position: relative;\n}\n\n.editor__field::-webkit-scrollbar {\n cursor: default;\n width: 12px;\n}\n\n.editor__field::-webkit-scrollbar-track {\n background: var(--color-uva-white);\n}\n\n.editor__field::-webkit-scrollbar-thumb {\n background-color: var(--color-grey-500);\n border: 3px solid var(--color-uva-white);\n border-radius: 20px;\n cursor: default;\n}\n\n.editor__field:focus-visible {\n outline: none;\n}\n\n.editor__placeholder {\n color: var(--color-grey-500);\n left: 0.45rem;\n pointer-events: none;\n position: absolute;\n top: 0.55rem;\n}\n\n/* Editor theme blockstyles */\n\n.guide-text-ltr {\n text-align: left;\n}\n\n.guide-text-rtl {\n text-align: right;\n}\n\n.guide-text-paragraph {\n margin: 0;\n position: relative;\n}\n\n.guide-text__text--bold {\n font-weight: bold;\n}\n\n.guide-text__text--italic {\n font-style: italic;\n}\n\n.guide-text__list--ul,\n.guide-text__list--ol {\n list-style-position: inside;\n margin: 0 0 0 -0.25rem;\n padding: 0.25rem;\n}\n\n.guide-text__list--ol {\n list-style-position: outside;\n list-style-type: decimal;\n margin: 0 0 0 0.25rem;\n}\n\n.guide-text__list--ul .guide-text__list--listitem {\n margin: 0;\n}\n\n.guide-text__list--ol .guide-text__list--listitem {\n margin-left: 0.35rem;\n padding-left: 0.55rem;\n}\n\n.guide-text__list--ol .guide-text__list--nested-listitem,\n.guide-text__list--ul .guide-text__list--nested-listitem {\n list-style-type: none;\n margin-left: 1.5rem;\n}\n\n.guide-text__list--ol .guide-text__list--nested-listitem {\n margin-left: 1rem;\n}\n\n.guide-text__list--ul2 .guide-text__list--listitem {\n list-style-type: circle;\n}\n\n.guide-text__list--ul3 .guide-text__list--listitem {\n list-style-type: square;\n}\n\n.guide-text__list--ul4 .guide-text__list--listitem {\n list-style-type: disc;\n}\n\n.guide-text__list--ul5 .guide-text__list--listitem {\n list-style-type: circle;\n}\n\nul .guide-text__list--nested-listitem ol {\n list-style-position: outside;\n list-style-type: decimal;\n margin-left: 0;\n padding: 0.25rem 0.25rem 0.25rem 0.55rem;\n}\n\nul .guide-text__list--nested-listitem ol .guide-text__list--listitem {\n list-style-type: decimal;\n margin-left: 0.35rem;\n padding-left: 0.55rem;\n}\n\nol .guide-text__list--nested-listitem ul .guide-text__list--listitem {\n list-style-type: disc;\n margin-left: 0.35rem;\n padding-left: 0.55rem;\n}\n\nul .guide-text__list--nested-listitem {\n list-style-type: none !important;\n}\n\nol .guide-text__list--nested-listitem ul {\n margin-left: -1.5rem;\n padding-left: 0.55rem;\n}\n\n.guide-text__table-wrapper {\n margin: 0 1rem 0.5rem 0;\n overflow-x: auto;\n}\n\n.guide-text__table {\n border: 2px solid var(--color-grey-400);\n border-collapse: collapse;\n border-collapse: collapse;\n border-spacing: 0;\n margin: 0.5rem 0;\n overflow-x: scroll;\n overflow-y: scroll;\n table-layout: fixed;\n width: fit-content;\n}\n\n/* CSS counts the <colgroup> tag as the first \"row\" in the table. \nTherefore, to apply zebra striping to the actual odd rows, \nthe CSS must target the even rows instead. */\n\n.guide-text__table > tr:nth-child(even) {\n background-color: var(--color-grey-100);\n}\n\n.guide-text__table > tr td {\n border: 1px dotted var(--color-grey-400);\n padding: 0.25rem 0.5rem;\n position: relative;\n vertical-align: top;\n}\n\ntd .guide-text__table-wrapper {\n margin: 0;\n}\n\ntd:has(.guide-text__table-wrapper) {\n padding: 0 !important;\n}\n\ntd:has(.guide-text__table-wrapper) table {\n border: 0;\n margin: 0;\n}\n\ntd:has(.guide-text__table-wrapper) table tr {\n background-color: transparent !important;\n}\n\n.guide-text__course-catalogue-link {\n color: var(--color-grey-800);\n cursor: default;\n text-decoration: dotted underline;\n}\n"],"mappings":""}
@@ -1,8 +1,7 @@
1
- import './assets/Sortable.css';//#region src/components/Sortable/Sortable.module.css
2
- var e = "_sortable__wrapper_1jxfw_1", t = "_sortable__container_1jxfw_13", n = "_sortable__handle_1jxfw_159", r = {
3
- sortable__wrapper: e,
1
+ import './assets/Sortable.css';var e = {
2
+ sortable__wrapper: "_sortable__wrapper_1jxfw_1",
4
3
  "sortable__wrapper--scrollable": "_sortable__wrapper--scrollable_1jxfw_5",
5
- sortable__container: t,
4
+ sortable__container: "_sortable__container_1jxfw_13",
6
5
  "sortable__drop-target": "_sortable__drop-target_1jxfw_24",
7
6
  "sortable__drop-target--no-number": "_sortable__drop-target--no-number_1jxfw_41",
8
7
  "sortable__sort-item": "_sortable__sort-item_1jxfw_59",
@@ -17,11 +16,11 @@ var e = "_sortable__wrapper_1jxfw_1", t = "_sortable__container_1jxfw_13", n = "
17
16
  "sortable__sort-item--dragging": "_sortable__sort-item--dragging_1jxfw_141",
18
17
  "sortable__sort-item__contents": "_sortable__sort-item__contents_1jxfw_145",
19
18
  "sortable__sort-item__contents--handle-right": "_sortable__sort-item__contents--handle-right_1jxfw_154",
20
- sortable__handle: n,
19
+ sortable__handle: "_sortable__handle_1jxfw_159",
21
20
  "sortable__handle--right": "_sortable__handle--right_1jxfw_165",
22
21
  "sortable__visually-hidden": "_sortable__visually-hidden_1jxfw_184"
23
22
  };
24
23
  //#endregion
25
- export { r as t };
24
+ export { e as t };
26
25
 
27
- //# sourceMappingURL=Sortable.module-BTUOSbOU.js.map
26
+ //# sourceMappingURL=Sortable.module-8SoaHfuE.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Sortable.module-BTUOSbOU.js","names":[],"sources":["../src/components/Sortable/Sortable.module.css"],"sourcesContent":[".sortable__wrapper {\n position: relative;\n}\n\n.sortable__wrapper--scrollable {\n border-bottom: 1px solid var(--color-grey-300);\n border-top: 1px solid var(--color-grey-300);\n margin-bottom: 1rem;\n max-height: 21rem;\n overflow-y: auto;\n}\n\n.sortable__container {\n --item-min-height: 3.75rem;\n counter-reset: container;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n list-style: none;\n margin: 1rem 1rem 1rem 0;\n padding: 0;\n}\n\n.sortable__drop-target {\n display: flex;\n gap: 1rem;\n min-height: var(--item-min-height);\n position: relative;\n}\n\n.sortable__drop-target::before {\n align-items: center;\n content: counter(container);\n counter-increment: container;\n display: flex;\n opacity: 1;\n position: relative;\n transition: opacity 0.25s;\n}\n\n.sortable__drop-target--no-number::before {\n content: none;\n}\n\n.sortable__drop-target::after {\n content: \"\";\n display: block;\n height: 1px;\n left: 0;\n position: absolute;\n width: 100%;\n z-index: 1;\n}\n\n.sortable__drop-target:last-child::after {\n display: inline;\n}\n\n.sortable__sort-item {\n align-items: center;\n border-radius: 0.5rem;\n display: flex;\n gap: 1rem;\n min-height: var(--item-min-height);\n position: relative;\n width: 100%;\n z-index: 0;\n}\n\n.sortable__sort-item--grey-200 {\n background-color: var(--color-grey-200);\n}\n\n.sortable__sort-item--white {\n background-color: var(--color-uva-white);\n}\n\n.sortable__sort-item:focus {\n z-index: 2;\n}\n\n.sortable__sort-item--ghost {\n -webkit-user-drag: none;\n margin: 0 1rem;\n opacity: 0.5;\n padding: 0.5rem 0;\n pointer-events: none;\n position: fixed;\n visibility: hidden;\n z-index: 2;\n}\n\n.sortable__sort-item__handle {\n appearance: none;\n background: none;\n background-color: var(--color-uva-white);\n border: 0;\n cursor: grab;\n height: 2.625rem;\n width: 2.625rem;\n}\n\n.sortable__sort-item__button-container {\n align-items: center;\n background-color: var(--color-grey-300);\n border-left: 1px solid var(--color-grey-300);\n border-radius: 0 0.5rem 0.5rem 0;\n display: flex;\n flex-direction: column;\n inset: 0 0 0 auto;\n margin-right: 1px;\n overflow: hidden;\n position: absolute;\n width: 2.625rem;\n z-index: 20;\n}\n\n.sortable__sort-item__button-container[data-touch=\"false\"] {\n display: none;\n}\n\n.sortable__sort-item__handle--icon {\n align-items: center;\n display: flex;\n height: 1rem;\n width: 1rem;\n}\n\n.sortable__sort-item__handle--up,\n.sortable__sort-item__handle--down {\n color: black;\n display: none;\n height: 100%;\n right: 0.5rem;\n}\n\n.sortable__sort-item__handle--up {\n transform: rotate(180deg);\n}\n\n.sortable__sort-item--dragging .sortable__sort-item__handle {\n cursor: grabbing;\n}\n\n.sortable__sort-item__contents {\n align-items: center;\n color: var(--color-uva-black);\n display: flex;\n gap: 0.5rem;\n padding: 0.5rem;\n width: 100%;\n}\n\n.sortable__sort-item__contents--handle-right {\n padding-left: 1rem;\n padding-right: 2.5rem;\n}\n\n.sortable__handle {\n color: var(--color-grey-700);\n cursor: grab;\n display: flex;\n}\n\n.sortable__handle--right {\n position: absolute;\n right: 0.5rem;\n}\n\n/** Target touch enabled devices and screen readers */\n\n.sortable__sort-item__button-container[data-touch=\"true\"] {\n gap: 1px;\n justify-content: center;\n}\n\n.sortable__sort-item__button-container[data-touch=\"true\"] .sortable__sort-item__handle--up,\n.sortable__sort-item__button-container[data-touch=\"true\"] .sortable__sort-item__handle--down {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.sortable__visually-hidden {\n border: 0;\n clip: rect(0, 0, 0, 0);\n clip-path: inset(50%);\n height: 1px;\n margin: 0 -1px -1px 0;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"Sortable.module-8SoaHfuE.js","names":[],"sources":["../src/components/Sortable/Sortable.module.css"],"sourcesContent":[".sortable__wrapper {\n position: relative;\n}\n\n.sortable__wrapper--scrollable {\n border-bottom: 1px solid var(--color-grey-300);\n border-top: 1px solid var(--color-grey-300);\n margin-bottom: 1rem;\n max-height: 21rem;\n overflow-y: auto;\n}\n\n.sortable__container {\n --item-min-height: 3.75rem;\n counter-reset: container;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n list-style: none;\n margin: 1rem 1rem 1rem 0;\n padding: 0;\n}\n\n.sortable__drop-target {\n display: flex;\n gap: 1rem;\n min-height: var(--item-min-height);\n position: relative;\n}\n\n.sortable__drop-target::before {\n align-items: center;\n content: counter(container);\n counter-increment: container;\n display: flex;\n opacity: 1;\n position: relative;\n transition: opacity 0.25s;\n}\n\n.sortable__drop-target--no-number::before {\n content: none;\n}\n\n.sortable__drop-target::after {\n content: \"\";\n display: block;\n height: 1px;\n left: 0;\n position: absolute;\n width: 100%;\n z-index: 1;\n}\n\n.sortable__drop-target:last-child::after {\n display: inline;\n}\n\n.sortable__sort-item {\n align-items: center;\n border-radius: 0.5rem;\n display: flex;\n gap: 1rem;\n min-height: var(--item-min-height);\n position: relative;\n width: 100%;\n z-index: 0;\n}\n\n.sortable__sort-item--grey-200 {\n background-color: var(--color-grey-200);\n}\n\n.sortable__sort-item--white {\n background-color: var(--color-uva-white);\n}\n\n.sortable__sort-item:focus {\n z-index: 2;\n}\n\n.sortable__sort-item--ghost {\n -webkit-user-drag: none;\n margin: 0 1rem;\n opacity: 0.5;\n padding: 0.5rem 0;\n pointer-events: none;\n position: fixed;\n visibility: hidden;\n z-index: 2;\n}\n\n.sortable__sort-item__handle {\n appearance: none;\n background: none;\n background-color: var(--color-uva-white);\n border: 0;\n cursor: grab;\n height: 2.625rem;\n width: 2.625rem;\n}\n\n.sortable__sort-item__button-container {\n align-items: center;\n background-color: var(--color-grey-300);\n border-left: 1px solid var(--color-grey-300);\n border-radius: 0 0.5rem 0.5rem 0;\n display: flex;\n flex-direction: column;\n inset: 0 0 0 auto;\n margin-right: 1px;\n overflow: hidden;\n position: absolute;\n width: 2.625rem;\n z-index: 20;\n}\n\n.sortable__sort-item__button-container[data-touch=\"false\"] {\n display: none;\n}\n\n.sortable__sort-item__handle--icon {\n align-items: center;\n display: flex;\n height: 1rem;\n width: 1rem;\n}\n\n.sortable__sort-item__handle--up,\n.sortable__sort-item__handle--down {\n color: black;\n display: none;\n height: 100%;\n right: 0.5rem;\n}\n\n.sortable__sort-item__handle--up {\n transform: rotate(180deg);\n}\n\n.sortable__sort-item--dragging .sortable__sort-item__handle {\n cursor: grabbing;\n}\n\n.sortable__sort-item__contents {\n align-items: center;\n color: var(--color-uva-black);\n display: flex;\n gap: 0.5rem;\n padding: 0.5rem;\n width: 100%;\n}\n\n.sortable__sort-item__contents--handle-right {\n padding-left: 1rem;\n padding-right: 2.5rem;\n}\n\n.sortable__handle {\n color: var(--color-grey-700);\n cursor: grab;\n display: flex;\n}\n\n.sortable__handle--right {\n position: absolute;\n right: 0.5rem;\n}\n\n/** Target touch enabled devices and screen readers */\n\n.sortable__sort-item__button-container[data-touch=\"true\"] {\n gap: 1px;\n justify-content: center;\n}\n\n.sortable__sort-item__button-container[data-touch=\"true\"] .sortable__sort-item__handle--up,\n.sortable__sort-item__button-container[data-touch=\"true\"] .sortable__sort-item__handle--down {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.sortable__visually-hidden {\n border: 0;\n clip: rect(0, 0, 0, 0);\n clip-path: inset(50%);\n height: 1px;\n margin: 0 -1px -1px 0;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n"],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./clsx-BD2qMUU1.js";
2
- import { t } from "./Sortable.module-BTUOSbOU.js";
2
+ import { t } from "./Sortable.module-8SoaHfuE.js";
3
3
  import { initialState as n, sortableReducer as r } from "./components/Sortable/sortableReducer.js";
4
4
  import { clearDraggingSource as i, clearDraggingTarget as a, dragEnd as o, dragStart as s, drop as c, moveToPosition as l, reset as u, setClone as d, setDraggingSource as f, setDraggingTarget as p } from "./components/Sortable/actions.js";
5
5
  import { cloneElement as m, createContext as h, useContext as g, useEffect as _, useReducer as v, useRef as y } from "react";
@@ -144,4 +144,4 @@ function E() {
144
144
  //#endregion
145
145
  export { E as n, x as r, T as t };
146
146
 
147
- //# sourceMappingURL=SortableProvider-Dc7hwkb5.js.map
147
+ //# sourceMappingURL=SortableProvider-8HYiBXJS.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SortableProvider-Dc7hwkb5.js","names":[],"sources":["../src/components/Sortable/components/SortableContainer.tsx","../src/components/Sortable/SortableProvider.tsx"],"sourcesContent":["import { cloneElement, useEffect, useRef } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { DragEvent } from 'react';\n\nimport styles from 'components/Sortable/Sortable.module.css';\nimport { useSortable } from 'components/Sortable/SortableProvider';\n\nexport type OnSort = (indices: number[]) => void;\n\ninterface SortableContainerProps {\n scrollable?: boolean;\n hideNumbers?: boolean;\n onSort?: OnSort;\n}\n\nexport function SortableContainer({ scrollable, hideNumbers, onSort }: SortableContainerProps) {\n const { clone, draggingTarget, drop, sortableItems, setDraggingTarget, reset, indices } = useSortable();\n const containerRef = useRef<HTMLUListElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const indicesRef = useRef<number[]>(indices);\n\n function getTargetIndex(event: DragEvent<HTMLLIElement>) {\n const sortableContainer = containerRef.current;\n\n if (!sortableContainer?.hasChildNodes()) return;\n\n const listItemNode = event.currentTarget;\n const childNodes = Array.from(sortableContainer.childNodes);\n const targetIndex = childNodes.findIndex((node) => node.isEqualNode(listItemNode));\n\n return targetIndex;\n }\n\n function handleDrop(event: DragEvent<HTMLLIElement>) {\n const targetIndex = getTargetIndex(event);\n\n if (targetIndex === undefined) return;\n\n if (clone && wrapperRef.current) wrapperRef.current.removeChild(clone);\n\n drop(targetIndex);\n }\n\n function handleDragOver(event: DragEvent<HTMLLIElement>) {\n // Prevent default to allow drop\n event.preventDefault();\n event.dataTransfer.dropEffect = 'move';\n\n if (clone) {\n const { clientX, clientY } = event;\n const { x, y, width, height } = event.currentTarget.getBoundingClientRect();\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n const grabPosition = height / 2 - (clientY - y);\n\n // lock drag image movement to x-axis and mouse pointer\n clone.setAttribute(\n 'style',\n `\n left: ${clientX - (clientX - x)}px;\n top: ${y - grabPosition}px;\n height: ${height}px;\n width: ${width}px;\n visibility: visible;\n `\n );\n }\n\n const targetIndex = getTargetIndex(event);\n\n if (targetIndex === undefined || targetIndex === draggingTarget) return;\n\n setDraggingTarget(targetIndex);\n }\n\n function handleContainerDragLeave(event: DragEvent<HTMLUListElement>) {\n const { relatedTarget } = event;\n\n const within = relatedTarget !== null && containerRef.current?.contains(relatedTarget as Node);\n\n if (!within) {\n reset();\n\n if (clone) {\n clone.setAttribute('style', 'visibility: hidden;');\n }\n }\n }\n\n useEffect(() => {\n if (!clone || !wrapperRef.current) return;\n\n wrapperRef.current.appendChild(clone);\n\n return function () {\n clone.remove();\n };\n }, [clone]);\n\n useEffect(() => {\n if (!onSort) return;\n\n if (indices.valueOf() !== indicesRef.current.valueOf()) {\n onSort(indices);\n\n indicesRef.current = indices;\n }\n }, [indices, indicesRef, onSort]);\n\n return (\n <div\n className={clsx(styles['sortable__wrapper'], { [styles['sortable__wrapper--scrollable']]: scrollable })}\n ref={wrapperRef}\n >\n <ul\n className={clsx(styles['sortable__container'], {\n [styles['sortable__container--drag-over']]: clone !== undefined,\n })}\n onDragLeave={handleContainerDragLeave}\n ref={containerRef}\n role=\"presentation\"\n >\n {sortableItems.map((child, index) => (\n <li\n className={clsx(styles['sortable__drop-target'], {\n [styles['sortable__drop-target--no-number']]: hideNumbers,\n })}\n draggable={false}\n key={index}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n role=\"presentation\"\n >\n {cloneElement(child, { index })}\n </li>\n ))}\n </ul>\n </div>\n );\n}\n","import { createContext, useContext, useReducer, useRef } from 'react';\n\nimport type { ReactElement, ReactNode } from 'react';\nimport type { SortableStateType } from './sortableReducer';\nimport type { SortableItem, SortableItemProps } from './components/SortableItem';\n\nimport { sortableReducer, initialState } from './sortableReducer';\nimport { SortableContainer } from './components/SortableContainer';\nimport * as actions from './actions';\n\ntype SortableContextType = {\n clearDraggingSource: () => void;\n clearDraggingTarget: () => void;\n dragEnd: () => void;\n dragStart: (index: number) => void;\n drop: (index: number) => void;\n moveToPosition: (index: number) => void;\n reset: () => void;\n setClone: (node: Element) => void;\n setDraggingSource: (index: number) => void;\n setDraggingTarget: (index: number) => void;\n};\n\nconst SortableContext = createContext<(SortableContextType & SortableStateType) | undefined>(undefined);\n\ntype SortableItems = ReactElement<SortableItemProps, typeof SortableItem>[];\n\ninterface Props<T = unknown> {\n renderItems: SortableItems;\n dataItems: T[];\n scrollable?: boolean;\n hideNumbers?: boolean;\n onSort?: (items: T[]) => void;\n children?: ReactNode;\n}\n\nfunction isReactElementWithIndex(value: string | ReactElement): value is ReactElement<{ index: number }> {\n return typeof value !== 'string';\n}\n\nconst init = (renderItems: SortableItems): SortableStateType => {\n const reactChildren = renderItems.filter(isReactElementWithIndex);\n\n return {\n ...initialState,\n indices: reactChildren.map(({ props }) => props.index),\n maxIndex: reactChildren.length - 1,\n sortableItems: reactChildren,\n };\n};\n\nexport function SortableProvider<T>({ renderItems, dataItems, scrollable, hideNumbers, onSort }: Props<T>) {\n const persistentItems = useRef(dataItems);\n\n const [state, dispatch] = useReducer(sortableReducer, renderItems, init);\n\n function setDraggingSource(index: number) {\n dispatch(actions.setDraggingSource(index));\n }\n\n function setDraggingTarget(index: number) {\n dispatch(actions.setDraggingTarget(index));\n }\n\n function moveToPosition(index: number) {\n dispatch(actions.moveToPosition(index));\n }\n\n function clearDraggingTarget() {\n dispatch(actions.clearDraggingTarget());\n }\n\n function clearDraggingSource() {\n dispatch(actions.clearDraggingSource());\n }\n\n function drop(index: number) {\n dispatch(actions.drop(index));\n }\n\n function dragStart(index: number) {\n dispatch(actions.dragStart(index));\n }\n\n function dragEnd() {\n dispatch(actions.dragEnd());\n }\n\n function reset() {\n dispatch(actions.reset());\n }\n\n function setClone(node: Element) {\n dispatch(actions.setClone(node));\n }\n\n function onHandleSort(sortedIndices: number[]) {\n const sortedData = sortedIndices.map((index) => persistentItems.current[index]);\n onSort && onSort(sortedData);\n }\n\n return (\n <SortableContext.Provider\n value={{\n ...state,\n clearDraggingSource,\n clearDraggingTarget,\n dragEnd,\n dragStart,\n drop,\n moveToPosition,\n reset,\n setClone,\n setDraggingSource,\n setDraggingTarget,\n }}\n >\n <SortableContainer scrollable={scrollable} hideNumbers={hideNumbers} onSort={onHandleSort} />\n </SortableContext.Provider>\n );\n}\n\nexport function useSortable() {\n const context = useContext(SortableContext);\n\n if (context === undefined) {\n throw new Error('useSortable must be used within a SortablePro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AM,CAAC;;CAGzC,SAAS,IAAsB;AAC7B,IAAS,GAA6B,CAAC;;CAGzC,SAAS,IAAsB;AAC7B,IAAS,GAA6B,CAAC;;CAGzC,SAAS,EAAK,GAAe;AAC3B,IAAS,EAAa,EAAM,CAAC;;CAG/B,SAAS,EAAU,GAAe;AAChC,IAAS,EAAkB,EAAM,CAAC;;CAGpC,SAAS,IAAU;AACjB,IAAS,GAAiB,CAAC;;CAG7B,SAAS,IAAQ;AACf,IAAS,GAAe,CAAC;;CAG3B,SAAS,EAAS,GAAe;AAC/B,IAAS,EAAiB,EAAK,CAAC;;CAGlC,SAAS,EAAa,GAAyB;EAC7C,IAAM,IAAa,EAAc,KAAK,MAAU,EAAgB,QAAQ,GAAO;AAC/E,OAAU,EAAO,EAAW;;AAG9B,QACE,kBAAC,EAAgB,UAAjB;EACE,OAAO;GACL,GAAG;GACH,qBAAA;GACA,qBAAA;GACA,SAAA;GACA,WAAA;GACA,MAAA;GACA,gBAAA;GACA,OAAA;GACA,UAAA;GACA,mBAAA;GACA,mBAAA;GACD;YAED,kBAAC,GAAD;GAA+B;GAAyB;GAAa,QAAQ;GAAgB,CAAA;EACpE,CAAA;;AAI/B,SAAgB,IAAc;CAC5B,IAAM,IAAU,EAAW,EAAgB;AAE3C,KAAI,MAAY,KAAA,EACd,OAAU,MAAM,qDAAqD;AAGvE,QAAO"}
1
+ {"version":3,"file":"SortableProvider-8HYiBXJS.js","names":[],"sources":["../src/components/Sortable/components/SortableContainer.tsx","../src/components/Sortable/SortableProvider.tsx"],"sourcesContent":["import { cloneElement, useEffect, useRef } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { DragEvent } from 'react';\n\nimport styles from 'components/Sortable/Sortable.module.css';\nimport { useSortable } from 'components/Sortable/SortableProvider';\n\nexport type OnSort = (indices: number[]) => void;\n\ninterface SortableContainerProps {\n scrollable?: boolean;\n hideNumbers?: boolean;\n onSort?: OnSort;\n}\n\nexport function SortableContainer({ scrollable, hideNumbers, onSort }: SortableContainerProps) {\n const { clone, draggingTarget, drop, sortableItems, setDraggingTarget, reset, indices } = useSortable();\n const containerRef = useRef<HTMLUListElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const indicesRef = useRef<number[]>(indices);\n\n function getTargetIndex(event: DragEvent<HTMLLIElement>) {\n const sortableContainer = containerRef.current;\n\n if (!sortableContainer?.hasChildNodes()) return;\n\n const listItemNode = event.currentTarget;\n const childNodes = Array.from(sortableContainer.childNodes);\n const targetIndex = childNodes.findIndex((node) => node.isEqualNode(listItemNode));\n\n return targetIndex;\n }\n\n function handleDrop(event: DragEvent<HTMLLIElement>) {\n const targetIndex = getTargetIndex(event);\n\n if (targetIndex === undefined) return;\n\n if (clone && wrapperRef.current) wrapperRef.current.removeChild(clone);\n\n drop(targetIndex);\n }\n\n function handleDragOver(event: DragEvent<HTMLLIElement>) {\n // Prevent default to allow drop\n event.preventDefault();\n event.dataTransfer.dropEffect = 'move';\n\n if (clone) {\n const { clientX, clientY } = event;\n const { x, y, width, height } = event.currentTarget.getBoundingClientRect();\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n const grabPosition = height / 2 - (clientY - y);\n\n // lock drag image movement to x-axis and mouse pointer\n clone.setAttribute(\n 'style',\n `\n left: ${clientX - (clientX - x)}px;\n top: ${y - grabPosition}px;\n height: ${height}px;\n width: ${width}px;\n visibility: visible;\n `\n );\n }\n\n const targetIndex = getTargetIndex(event);\n\n if (targetIndex === undefined || targetIndex === draggingTarget) return;\n\n setDraggingTarget(targetIndex);\n }\n\n function handleContainerDragLeave(event: DragEvent<HTMLUListElement>) {\n const { relatedTarget } = event;\n\n const within = relatedTarget !== null && containerRef.current?.contains(relatedTarget as Node);\n\n if (!within) {\n reset();\n\n if (clone) {\n clone.setAttribute('style', 'visibility: hidden;');\n }\n }\n }\n\n useEffect(() => {\n if (!clone || !wrapperRef.current) return;\n\n wrapperRef.current.appendChild(clone);\n\n return function () {\n clone.remove();\n };\n }, [clone]);\n\n useEffect(() => {\n if (!onSort) return;\n\n if (indices.valueOf() !== indicesRef.current.valueOf()) {\n onSort(indices);\n\n indicesRef.current = indices;\n }\n }, [indices, indicesRef, onSort]);\n\n return (\n <div\n className={clsx(styles['sortable__wrapper'], { [styles['sortable__wrapper--scrollable']]: scrollable })}\n ref={wrapperRef}\n >\n <ul\n className={clsx(styles['sortable__container'], {\n [styles['sortable__container--drag-over']]: clone !== undefined,\n })}\n onDragLeave={handleContainerDragLeave}\n ref={containerRef}\n role=\"presentation\"\n >\n {sortableItems.map((child, index) => (\n <li\n className={clsx(styles['sortable__drop-target'], {\n [styles['sortable__drop-target--no-number']]: hideNumbers,\n })}\n draggable={false}\n key={index}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n role=\"presentation\"\n >\n {cloneElement(child, { index })}\n </li>\n ))}\n </ul>\n </div>\n );\n}\n","import { createContext, useContext, useReducer, useRef } from 'react';\n\nimport type { ReactElement, ReactNode } from 'react';\nimport type { SortableStateType } from './sortableReducer';\nimport type { SortableItem, SortableItemProps } from './components/SortableItem';\n\nimport { sortableReducer, initialState } from './sortableReducer';\nimport { SortableContainer } from './components/SortableContainer';\nimport * as actions from './actions';\n\ntype SortableContextType = {\n clearDraggingSource: () => void;\n clearDraggingTarget: () => void;\n dragEnd: () => void;\n dragStart: (index: number) => void;\n drop: (index: number) => void;\n moveToPosition: (index: number) => void;\n reset: () => void;\n setClone: (node: Element) => void;\n setDraggingSource: (index: number) => void;\n setDraggingTarget: (index: number) => void;\n};\n\nconst SortableContext = createContext<(SortableContextType & SortableStateType) | undefined>(undefined);\n\ntype SortableItems = ReactElement<SortableItemProps, typeof SortableItem>[];\n\ninterface Props<T = unknown> {\n renderItems: SortableItems;\n dataItems: T[];\n scrollable?: boolean;\n hideNumbers?: boolean;\n onSort?: (items: T[]) => void;\n children?: ReactNode;\n}\n\nfunction isReactElementWithIndex(value: string | ReactElement): value is ReactElement<{ index: number }> {\n return typeof value !== 'string';\n}\n\nconst init = (renderItems: SortableItems): SortableStateType => {\n const reactChildren = renderItems.filter(isReactElementWithIndex);\n\n return {\n ...initialState,\n indices: reactChildren.map(({ props }) => props.index),\n maxIndex: reactChildren.length - 1,\n sortableItems: reactChildren,\n };\n};\n\nexport function SortableProvider<T>({ renderItems, dataItems, scrollable, hideNumbers, onSort }: Props<T>) {\n const persistentItems = useRef(dataItems);\n\n const [state, dispatch] = useReducer(sortableReducer, renderItems, init);\n\n function setDraggingSource(index: number) {\n dispatch(actions.setDraggingSource(index));\n }\n\n function setDraggingTarget(index: number) {\n dispatch(actions.setDraggingTarget(index));\n }\n\n function moveToPosition(index: number) {\n dispatch(actions.moveToPosition(index));\n }\n\n function clearDraggingTarget() {\n dispatch(actions.clearDraggingTarget());\n }\n\n function clearDraggingSource() {\n dispatch(actions.clearDraggingSource());\n }\n\n function drop(index: number) {\n dispatch(actions.drop(index));\n }\n\n function dragStart(index: number) {\n dispatch(actions.dragStart(index));\n }\n\n function dragEnd() {\n dispatch(actions.dragEnd());\n }\n\n function reset() {\n dispatch(actions.reset());\n }\n\n function setClone(node: Element) {\n dispatch(actions.setClone(node));\n }\n\n function onHandleSort(sortedIndices: number[]) {\n const sortedData = sortedIndices.map((index) => persistentItems.current[index]);\n onSort && onSort(sortedData);\n }\n\n return (\n <SortableContext.Provider\n value={{\n ...state,\n clearDraggingSource,\n clearDraggingTarget,\n dragEnd,\n dragStart,\n drop,\n moveToPosition,\n reset,\n setClone,\n setDraggingSource,\n setDraggingTarget,\n }}\n >\n <SortableContainer scrollable={scrollable} hideNumbers={hideNumbers} onSort={onHandleSort} />\n </SortableContext.Provider>\n );\n}\n\nexport function useSortable() {\n const context = useContext(SortableContext);\n\n if (context === undefined) {\n throw new Error('useSortable must be used within a SortableProvider');\n }\n\n return context;\n}\n"],"mappings":";;;;;;;AAgBA,SAAgB,EAAkB,EAAE,eAAY,gBAAa,aAAkC;CAC7F,IAAM,EAAE,UAAO,mBAAgB,SAAM,kBAAe,sBAAmB,UAAO,eAAY,GAAa,EACjG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CAG/B,SAAS,EAAU,GAAe;AAChC,IAAS,EAAkB,EAAM,CAAC;;CAGpC,SAAS,IAAU;AACjB,IAAS,GAAiB,CAAC;;CAG7B,SAAS,IAAQ;AACf,IAAS,GAAe,CAAC;;CAG3B,SAAS,EAAS,GAAe;AAC/B,IAAS,EAAiB,EAAK,CAAC;;CAGlC,SAAS,EAAa,GAAyB;EAC7C,IAAM,IAAa,EAAc,KAAK,MAAU,EAAgB,QAAQ,GAAO;AAC/E,OAAU,EAAO,EAAW;;AAG9B,QACE,kBAAC,EAAgB,UAAjB;EACE,OAAO;GACL,GAAG;GACH,qBAAA;GACA,qBAAA;GACA,SAAA;GACA,WAAA;GACA,MAAA;GACA,gBAAA;GACA,OAAA;GACA,UAAA;GACA,mBAAA;GACA,mBAAA;GACD;YAED,kBAAC,GAAD;GAA+B;GAAyB;GAAa,QAAQ;GAAgB,CAAA;EACpE,CAAA;;AAI/B,SAAgB,IAAc;CAC5B,IAAM,IAAU,EAAW,EAAgB;AAE3C,KAAI,MAAY,KAAA,EACd,OAAU,MAAM,qDAAqD;AAGvE,QAAO"}
@@ -0,0 +1,30 @@
1
+ import { useEffect as e, useState as t } from "react";
2
+ import { jsx as n } from "react/jsx-runtime";
3
+ import './assets/Spinner.css';var r = {
4
+ "spinner-container": "_spinner-container_n7kdw_11",
5
+ spinner: "_spinner_n7kdw_11",
6
+ spin: "_spin_n7kdw_11"
7
+ }, i = 250, a = ({ ariaValueText: a, showAfterMs: o = i }) => {
8
+ let [s, c] = t(() => o === 0);
9
+ return e(() => {
10
+ if (o === 0) return;
11
+ let e = window.setTimeout(() => {
12
+ c(!0);
13
+ }, o);
14
+ return () => {
15
+ window.clearTimeout(e);
16
+ };
17
+ }), s ? /* @__PURE__ */ n("div", {
18
+ className: r["spinner-container"],
19
+ children: /* @__PURE__ */ n("div", {
20
+ className: r.spinner,
21
+ role: "progressbar",
22
+ "aria-label": "Spinner",
23
+ "aria-valuetext": a
24
+ })
25
+ }) : null;
26
+ };
27
+ //#endregion
28
+ export { a as t };
29
+
30
+ //# sourceMappingURL=Spinner-BpElTDIu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner-D8tWqg9j.js","names":[],"sources":["../src/components/Spinner/Spinner.module.css","../src/components/Spinner/Spinner.tsx"],"sourcesContent":["@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.spinner-container {\n align-items: center;\n display: flex;\n justify-content: center;\n padding: 2rem;\n}\n\n.spinner {\n height: 2rem;\n width: 2rem;\n}\n\n.spinner::after {\n border: 0.25rem solid hsl(0deg 0% 0% / 10%);\n border-radius: 50%;\n content: \" \";\n display: block;\n height: 100%;\n transform-origin: 50% 50%;\n width: 100%;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .spinner::after {\n animation: spin 1s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;\n border-left-color: var(--color-uva-black);\n }\n}\n","import { useEffect, useState } from 'react';\n\nimport styles from './Spinner.module.css';\n\nconst DEFAULT_DELAY_IN_MS = 250;\n\nexport interface SpinnerProps {\n /** The `aria-valuetext` of the spinner. */\n ariaValueText: string;\n /** Delay in milliseconds after which the spinner becomes visible. The default is `250`. */\n showAfterMs?: number;\n}\n\n/** Represents a component to display a spinner. */\nexport const Spinner = ({ ariaValueText, showAfterMs = DEFAULT_DELAY_IN_MS }: SpinnerProps) => {\n const [visible, setVisible] = useState(() => (showAfterMs === 0 ? true : false));\n\n useEffect(() => {\n if (showAfterMs === 0) {\n return;\n }\n const t = window.setTimeout(() => {\n setVisible(true);\n }, showAfterMs);\n\n return () => {\n window.clearTimeout(t);\n };\n });\n\n if (!visible) {\n return null;\n }\n\n return (\n <div className={styles['spinner-container']}>\n <div className={styles['spinner']} role=\"progressbar\" aria-label=\"Spinner\" aria-valuetext={ariaValueText}></div>\n </div>\n );\n};\n"],"mappings":";;;;;;;GCIM,IAAsB,KAUf,KAAW,EAAE,kBAAe,iBAAc,QAAwC;CAC7F,IAAM,CAAC,GAAS,KAAc,QAAgB,MAAgB,EAAkB;AAmBhF,QAjBA,QAAgB;AACd,MAAI,MAAgB,EAClB;EAEF,IAAM,IAAI,OAAO,iBAAiB;AAChC,KAAW,GAAK;KACf,EAAY;AAEf,eAAa;AACX,UAAO,aAAa,EAAE;;GAExB,EAEG,IAKH,kBAAC,OAAD;EAAK,WAAW,EAAO;YACrB,kBAAC,OAAD;GAAK,WAAW,EAAO;GAAY,MAAK;GAAc,cAAW;GAAU,kBAAgB;GAAqB,CAAA;EAC5G,CAAA,GANC"}
1
+ {"version":3,"file":"Spinner-BpElTDIu.js","names":[],"sources":["../src/components/Spinner/Spinner.module.css","../src/components/Spinner/Spinner.tsx"],"sourcesContent":["@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.spinner-container {\n align-items: center;\n display: flex;\n justify-content: center;\n padding: 2rem;\n}\n\n.spinner {\n height: 2rem;\n width: 2rem;\n}\n\n.spinner::after {\n border: 0.25rem solid hsl(0deg 0% 0% / 10%);\n border-radius: 50%;\n content: \" \";\n display: block;\n height: 100%;\n transform-origin: 50% 50%;\n width: 100%;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .spinner::after {\n animation: spin 1s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;\n border-left-color: var(--color-uva-black);\n }\n}\n","import { useEffect, useState } from 'react';\n\nimport styles from './Spinner.module.css';\n\nconst DEFAULT_DELAY_IN_MS = 250;\n\nexport interface SpinnerProps {\n /** The `aria-valuetext` of the spinner. */\n ariaValueText: string;\n /** Delay in milliseconds after which the spinner becomes visible. The default is `250`. */\n showAfterMs?: number;\n}\n\n/** Represents a component to display a spinner. */\nexport const Spinner = ({ ariaValueText, showAfterMs = DEFAULT_DELAY_IN_MS }: SpinnerProps) => {\n const [visible, setVisible] = useState(() => (showAfterMs === 0 ? true : false));\n\n useEffect(() => {\n if (showAfterMs === 0) {\n return;\n }\n const t = window.setTimeout(() => {\n setVisible(true);\n }, showAfterMs);\n\n return () => {\n window.clearTimeout(t);\n };\n });\n\n if (!visible) {\n return null;\n }\n\n return (\n <div className={styles['spinner-container']}>\n <div className={styles['spinner']} role=\"progressbar\" aria-label=\"Spinner\" aria-valuetext={ariaValueText}></div>\n </div>\n );\n};\n"],"mappings":";;;;;;GCIM,IAAsB,KAUf,KAAW,EAAE,kBAAe,iBAAc,QAAwC;CAC7F,IAAM,CAAC,GAAS,KAAc,QAAgB,MAAgB,EAAkB;AAmBhF,QAjBA,QAAgB;AACd,MAAI,MAAgB,EAClB;EAEF,IAAM,IAAI,OAAO,iBAAiB;AAChC,KAAW,GAAK;KACf,EAAY;AAEf,eAAa;AACX,UAAO,aAAa,EAAE;;GAExB,EAEG,IAKH,kBAAC,OAAD;EAAK,WAAW,EAAO;YACrB,kBAAC,OAAD;GAAK,WAAW,EAAO;GAAY,MAAK;GAAc,cAAW;GAAU,kBAAgB;GAAqB,CAAA;EAC5G,CAAA,GANC"}
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./LexicalComposerContext.prod-Ca-YN_fj.js";
2
- import { at as t, q as n } from "./Lexical.prod-DIglXatJ.js";
3
- import { f as r, s as i } from "./LexicalUtils.prod-BBTLliac.js";
4
- import { C as a, T as o, b as s, g as c, l, o as u, t as d, u as f, y as p } from "./LexicalTable.prod-D16GW-aZ.js";
2
+ import { _ as t, j as n } from "./Lexical.prod-sbwgNRjw.js";
3
+ import { f as r, s as i } from "./LexicalUtils.prod-DjjGkphN.js";
4
+ import { C as a, T as o, a as s, b as c, g as l, l as u, t as d, u as f, y as p } from "./LexicalTable.prod-CpIPDW6z.js";
5
5
  import { $createTableWrapperNode as m, TableWrapperNode as h } from "./components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js";
6
6
  import { getEditorContentWidth as g, getEditorParrentCellWidth as _, tableHasContent as v } from "./components/RteEditor/Plugins/TablePlugin/helpers.js";
7
7
  import { useCallback as y, useEffect as b, useLayoutEffect as x, useMemo as S, useRef as C, useState as w } from "react";
@@ -33,15 +33,15 @@ function I({ editor: e }) {
33
33
  let x = C(null), S = C(null), O = C(null), k = C(null), [A, j] = w(null), [I, L] = w(null), [R, z] = w(!1), [B, V] = w(null), H = y(() => {
34
34
  L(null), x.current = null, V(null), k.current = null, O.current = null;
35
35
  }, []), U = (e) => (e.buttons & 1) == 1;
36
- b(() => e.registerNodeTransform(l, (t) => {
36
+ b(() => e.registerNodeTransform(u, (t) => {
37
37
  if (!t.getColWidths()) {
38
38
  let n = t.getChildren(), r = t.getColumnCount(), a = Array(r).fill(void 0);
39
39
  n[0].getChildren().forEach((n, o) => {
40
- let s = e.getElementByKey(n.getKey());
41
- if (s && s.style.width) a[o] = parseInt(s.style.width, 10), s.style.width = "";
40
+ let c = e.getElementByKey(n.getKey());
41
+ if (c && c.style.width) a[o] = parseInt(c.style.width, 10), c.style.width = "";
42
42
  else if (v(t)) {
43
- let n = t ? i(t, u) : null, s = (n ? _(n, r, e) : g(e)) / r;
44
- a[o] = Math.max(s, P);
43
+ let n = t ? i(t, s) : null, c = (n ? _(n, r, e) : g(e)) / r;
44
+ a[o] = Math.max(c, P);
45
45
  } else a[o] = P;
46
46
  }), t.setColWidths(a);
47
47
  }
@@ -63,7 +63,7 @@ function I({ editor: e }) {
63
63
  }
64
64
  if (z(U(r)), !(S.current && S.current.contains(i)) && x.current !== i) {
65
65
  x.current = i;
66
- let t = s(i);
66
+ let t = c(i);
67
67
  t && I !== t ? e.getEditorState().read(() => {
68
68
  let r = n(t.elem);
69
69
  if (!r) throw Error("TableCellResizer: Table cell node not found.");
@@ -77,11 +77,11 @@ function I({ editor: e }) {
77
77
  z(!0);
78
78
  }, a = () => {
79
79
  z(!1);
80
- }, c = e.registerRootListener((e, t) => {
80
+ }, s = e.registerRootListener((e, t) => {
81
81
  t?.removeEventListener("mousemove", r), t?.removeEventListener("mousedown", i), t?.removeEventListener("mouseup", a), e?.addEventListener("mousemove", r), e?.addEventListener("mousedown", i), e?.addEventListener("mouseup", a);
82
82
  });
83
83
  return () => {
84
- c();
84
+ s();
85
85
  };
86
86
  }, [
87
87
  I,
@@ -94,16 +94,16 @@ function I({ editor: e }) {
94
94
  e.update(() => {
95
95
  let r = n(I.elem);
96
96
  if (!d(r)) throw Error("TableCellResizer: Table cell node not found.");
97
- let i = p(r), a = c(r) + r.getRowSpan() - 1, o = i.getChildren();
97
+ let i = p(r), a = l(r) + r.getRowSpan() - 1, o = i.getChildren();
98
98
  if (a >= o.length || a < 0) throw Error("Expected table cell to be inside of table row.");
99
99
  let s = o[a];
100
100
  if (!f(s)) throw Error("Expected table row");
101
- let l = s.getHeight();
102
- if (l === void 0) {
101
+ let c = s.getHeight();
102
+ if (c === void 0) {
103
103
  let t = s.getChildren();
104
- l = Math.min(...t.map((t) => K(t, e) ?? Infinity));
104
+ c = Math.min(...t.map((t) => K(t, e) ?? Infinity));
105
105
  }
106
- let u = Math.max(l + t, N);
106
+ let u = Math.max(c + t, N);
107
107
  s.setHeight(u);
108
108
  }, { tag: "skip-scroll-into-view" });
109
109
  }, [I, e]), K = (e, t) => t.getElementByKey(e.getKey())?.clientHeight, q = (e, t) => {
@@ -205,4 +205,4 @@ var L = () => {
205
205
  //#endregion
206
206
  export { j as n, L as t };
207
207
 
208
- //# sourceMappingURL=TableCellResizerPlugin-CgYsYsuY.js.map
208
+ //# sourceMappingURL=TableCellResizerPlugin-Ceof6StD.js.map