@brightspot/ui 3.0.1-cms-ui-migration.1 → 3.0.1-cms-ui-migration.3

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 (303) hide show
  1. package/README.md +54 -35
  2. package/dist/custom-elements.json +2536 -2536
  3. package/dist/storybook/assets/{ActionBar.stories-BhdqLyzJ.js → ActionBar.stories-CSxtZl7v.js} +1 -1
  4. package/dist/storybook/assets/{ActionItem.stories-17zjMCkO.js → ActionItem.stories-BWcMRMP3.js} +1 -1
  5. package/dist/storybook/assets/{Avatar.stories-C5m3-zOH.js → Avatar.stories-CYTUGXzH.js} +1 -1
  6. package/dist/storybook/assets/{AvatarGroup.stories-DE88PJ6w.js → AvatarGroup.stories-CSYBYo_5.js} +1 -1
  7. package/dist/storybook/assets/{Badge.stories-D905HmvO.js → Badge.stories-LuF4BuVr.js} +1 -1
  8. package/dist/storybook/assets/{Button-ANyLESGb.js → Button-CrXCMxHb.js} +1 -1
  9. package/dist/storybook/assets/{Button.stories-DbH6q5L3.js → Button.stories-JVwxdrdM.js} +1 -1
  10. package/dist/storybook/assets/{ButtonGroup.stories-loqgAB7p.js → ButtonGroup.stories-qtq64a1H.js} +1 -1
  11. package/dist/storybook/assets/{Celebrate.stories-CRO3rSgp.js → Celebrate.stories-DjTtaSd6.js} +1 -1
  12. package/dist/storybook/assets/{Checkbox.stories-SZtgfbFe.js → Checkbox.stories-v1Pr5mL6.js} +1 -1
  13. package/dist/storybook/assets/{CircularProgress.stories-VayPxO4M.js → CircularProgress.stories-DkV7PJ4D.js} +1 -1
  14. package/dist/storybook/assets/{ClipboardMixin.stories-0EB2O2zT.js → ClipboardMixin.stories-Dh5c7uSM.js} +1 -1
  15. package/dist/storybook/assets/{Color-6BZIO3FS-CFpcD80i.js → Color-6BZIO3FS-B1gcREt6.js} +1 -1
  16. package/dist/storybook/assets/{Colors.stories-BJGM6xnp.js → Colors.stories-DnubtRqn.js} +1 -1
  17. package/dist/storybook/assets/{CombinedEffects.stories-DUwocYcn.js → CombinedEffects.stories-By6akSve.js} +1 -1
  18. package/dist/storybook/assets/{ComponentStatesMixin-MUqdPCf7.js → ComponentStatesMixin-CPLGv3h-.js} +1 -1
  19. package/dist/storybook/assets/{ComponentStatesMixin.stories-DjrxNwE7.js → ComponentStatesMixin.stories-CiQ_lyhm.js} +1 -1
  20. package/dist/storybook/assets/{CopyToClipboard.stories-DptOcPq6.js → CopyToClipboard.stories-cJ7rl3mj.js} +1 -1
  21. package/dist/storybook/assets/{Debounce.stories-BbcIWmhD.js → Debounce.stories-Bw-goobU.js} +1 -1
  22. package/dist/storybook/assets/{DocsRenderer-LL677BLK-Yy8fjeNG.js → DocsRenderer-LL677BLK-CNW57dGQ.js} +3 -3
  23. package/dist/storybook/assets/{Dropdown.stories-Du3LrBR6.js → Dropdown.stories-CwC3HXXd.js} +1 -1
  24. package/dist/storybook/assets/{EmptyState.stories-Dy9P8aOY.js → EmptyState.stories-BUEJwuhP.js} +1 -1
  25. package/dist/storybook/assets/{Events.stories-DvdVQxDf.js → Events.stories-D1mf9buv.js} +1 -1
  26. package/dist/storybook/assets/{Heading.stories-BQ1jFOKn.js → Heading.stories-DO906G4P.js} +1 -1
  27. package/dist/storybook/assets/{HueRipple.stories-CrZFjnRl.js → HueRipple.stories-BOySRSZB.js} +1 -1
  28. package/dist/storybook/assets/{Icon.stories-C2Tj8Lx1.js → Icon.stories-BsqgTbdG.js} +1 -1
  29. package/dist/storybook/assets/{IconButton.stories-DFqouOJb.js → IconButton.stories-aza1AAKk.js} +1 -1
  30. package/dist/storybook/assets/{LinearProgress.stories-DtNw3QX3.js → LinearProgress.stories-CDYmiiex.js} +1 -1
  31. package/dist/storybook/assets/{Pagination.stories-CFiZ9APs.js → Pagination.stories-LXB-x7YB.js} +1 -1
  32. package/dist/storybook/assets/{Popover.stories-DkkTuYag.js → Popover.stories-DY1HesPJ.js} +1 -1
  33. package/dist/storybook/assets/{ReadyMixin-BA01Vm_B.js → ReadyMixin-DmOC67IJ.js} +1 -1
  34. package/dist/storybook/assets/{RovingTabindexMixin.stories-BesAqt48.js → RovingTabindexMixin.stories-BWy0Rq8d.js} +1 -1
  35. package/dist/storybook/assets/{Rtc.stories-iTw43rjp.js → Rtc.stories-DrmdqqbI.js} +1 -1
  36. package/dist/storybook/assets/{ScrollShadow.stories-QYqQCcAo.js → ScrollShadow.stories-DiKFPazh.js} +1 -1
  37. package/dist/storybook/assets/{Switch.stories-BKArq9Mk.js → Switch.stories-BgFnw8_z.js} +1 -1
  38. package/dist/storybook/assets/{Tab.stories-8UdDPvE5.js → Tab.stories-c2wLMooF.js} +1 -1
  39. package/dist/storybook/assets/{Tabs.stories-BPGMZ552.js → Tabs.stories-CjH8seNP.js} +1 -1
  40. package/dist/storybook/assets/{Throttle.stories-CYl5d0r6.js → Throttle.stories-CXysc_QE.js} +1 -1
  41. package/dist/storybook/assets/{Tooltip.stories-cZ0zSlwX.js → Tooltip.stories-6qzyByPm.js} +1 -1
  42. package/dist/storybook/assets/{Upload.stories-CPC7N0Ed.js → Upload.stories-BLxykydQ.js} +1 -1
  43. package/dist/storybook/assets/{UploadItem.stories-D0LClT0a.js → UploadItem.stories-CcfcqdJW.js} +1 -1
  44. package/dist/storybook/assets/{Welcome.stories-C8JUaRas.js → Welcome.stories-CzYS_3fH.js} +1 -1
  45. package/dist/storybook/assets/{Widget.stories-C1FxF24-.js → Widget.stories-Du7T4LAI.js} +1 -1
  46. package/dist/storybook/assets/{WithTooltip-65CFNBJE-BMBo-fie.js → WithTooltip-65CFNBJE-D4LfXdYt.js} +1 -1
  47. package/dist/storybook/assets/{blocks-BTsuXRXZ.js → blocks-DR3fGePu.js} +5 -5
  48. package/dist/storybook/assets/{formatter-EIJCOSYU-BJ1Cwrpx.js → formatter-EIJCOSYU-Cf01216O.js} +1 -1
  49. package/dist/storybook/assets/if-defined-DaMmbcIU.js +1 -0
  50. package/dist/storybook/assets/{iframe-B3YWTqkR.js → iframe-CQArUhO8.js} +4 -4
  51. package/dist/storybook/assets/{iframe-BgFj0b5u.css → iframe-D0roG0J-.css} +1 -1
  52. package/dist/storybook/assets/{index-BBUTVEdP.js → index-B1uI_67G.js} +1 -1
  53. package/dist/storybook/assets/{onFind-NC0lGo-r.js → onFind-BpFkN2Rh.js} +1 -1
  54. package/dist/storybook/assets/{onFind.stories-CqbwQgQF.js → onFind.stories-Cxdeg69X.js} +1 -1
  55. package/dist/storybook/assets/{onRemove.stories-Y8Ycs77o.js → onRemove.stories-BHEWpNrE.js} +1 -1
  56. package/dist/storybook/assets/{onVisible.stories-CcLUE35q.js → onVisible.stories-DFJ3S_ZS.js} +1 -1
  57. package/dist/storybook/assets/{style-map-MSB_ngx3.js → style-map-DJ83UC3V.js} +1 -1
  58. package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-BjkjEDMG.js → syntaxhighlighter-ED5Y7EFY-zYN83mxK.js} +1 -1
  59. package/dist/storybook/iframe.html +2 -2
  60. package/dist/storybook/project.json +1 -1
  61. package/dist/tailwind.config.d.ts +4 -1
  62. package/dist/tailwind.config.d.ts.map +1 -1
  63. package/dist/tailwind.config.js +0 -2
  64. package/dist/tailwind.config.js.map +1 -1
  65. package/dist/tailwind.config.ts +0 -2
  66. package/package.json +16 -2
  67. package/dist/storybook/assets/if-defined-BPCd2NXs.js +0 -1
  68. package/src/legacy/tool-ui/src/main/resources/settings.properties +0 -1
  69. package/src/legacy/tool-ui/src/main/webapp/WEB-INF/web.xml +0 -81
  70. package/src/legacy/tool-ui/src/main/webapp/script/bsp-uploader.js +0 -170
  71. package/src/legacy/tool-ui/src/main/webapp/script/bsp-utils.js +0 -393
  72. package/src/legacy/tool-ui/src/main/webapp/script/content/layout-element.js +0 -141
  73. package/src/legacy/tool-ui/src/main/webapp/script/input/query.js +0 -78
  74. package/src/legacy/tool-ui/src/main/webapp/script/input/workflow.js +0 -718
  75. package/src/legacy/tool-ui/src/main/webapp/script/jquery.extra.js +0 -633
  76. package/src/legacy/tool-ui/src/main/webapp/script/v3/Dropbox.js +0 -18
  77. package/src/legacy/tool-ui/src/main/webapp/script/v3/EditFieldUpdate.js +0 -406
  78. package/src/legacy/tool-ui/src/main/webapp/script/v3/EditFieldUpdateCache.js +0 -1
  79. package/src/legacy/tool-ui/src/main/webapp/script/v3/Notification.js +0 -151
  80. package/src/legacy/tool-ui/src/main/webapp/script/v3/content/edit.js +0 -194
  81. package/src/legacy/tool-ui/src/main/webapp/script/v3/content/state.js +0 -785
  82. package/src/legacy/tool-ui/src/main/webapp/script/v3/csrf.js +0 -35
  83. package/src/legacy/tool-ui/src/main/webapp/script/v3/dashboard.js +0 -65
  84. package/src/legacy/tool-ui/src/main/webapp/script/v3/input/dataTransfer.js +0 -129
  85. package/src/legacy/tool-ui/src/main/webapp/script/v3/input/file.js +0 -433
  86. package/src/legacy/tool-ui/src/main/webapp/script/v3/input/object.js +0 -743
  87. package/src/legacy/tool-ui/src/main/webapp/script/v3/input/read-only.js +0 -17
  88. package/src/legacy/tool-ui/src/main/webapp/script/v3/jquery.frame.js +0 -478
  89. package/src/legacy/tool-ui/src/main/webapp/script/v3/jquery.repeatable.js +0 -2406
  90. package/src/legacy/tool-ui/src/main/webapp/script/v3/plugin/popup.d.ts +0 -2
  91. package/src/legacy/tool-ui/src/main/webapp/script/v3/plugin/popup.js +0 -446
  92. package/src/legacy/tool-ui/src/main/webapp/script/v3/search-filters.js +0 -62
  93. package/src/legacy/tool-ui/src/main/webapp/script/v3/search.js +0 -53
  94. package/src/legacy/tool-ui/src/main/webapp/script/v3.js +0 -1049
  95. package/src/legacy/tool-ui/src/main/webapp/v4/Admin.js +0 -16
  96. package/src/legacy/tool-ui/src/main/webapp/v4/AutoExpand.js +0 -84
  97. package/src/legacy/tool-ui/src/main/webapp/v4/AutoSubmit.js +0 -68
  98. package/src/legacy/tool-ui/src/main/webapp/v4/Bridge.js +0 -536
  99. package/src/legacy/tool-ui/src/main/webapp/v4/CheckboxInput.js +0 -22
  100. package/src/legacy/tool-ui/src/main/webapp/v4/ColorInput.js +0 -5
  101. package/src/legacy/tool-ui/src/main/webapp/v4/ColorInputSpectrum.js +0 -107
  102. package/src/legacy/tool-ui/src/main/webapp/v4/ComboInput.js +0 -1491
  103. package/src/legacy/tool-ui/src/main/webapp/v4/CommunityWidget.js +0 -29
  104. package/src/legacy/tool-ui/src/main/webapp/v4/ContentEdit.js +0 -2427
  105. package/src/legacy/tool-ui/src/main/webapp/v4/ContentLock.js +0 -470
  106. package/src/legacy/tool-ui/src/main/webapp/v4/ContentReporting.js +0 -32
  107. package/src/legacy/tool-ui/src/main/webapp/v4/DataTable.js +0 -31
  108. package/src/legacy/tool-ui/src/main/webapp/v4/DateStringField.js +0 -485
  109. package/src/legacy/tool-ui/src/main/webapp/v4/Entry.js +0 -264
  110. package/src/legacy/tool-ui/src/main/webapp/v4/ExternalItemAuth.js +0 -16
  111. package/src/legacy/tool-ui/src/main/webapp/v4/Form.js +0 -31
  112. package/src/legacy/tool-ui/src/main/webapp/v4/Hierarchy.js +0 -100
  113. package/src/legacy/tool-ui/src/main/webapp/v4/Icon.ts +0 -49
  114. package/src/legacy/tool-ui/src/main/webapp/v4/ImageEditor.js +0 -2403
  115. package/src/legacy/tool-ui/src/main/webapp/v4/ImageEditorBundle.js +0 -5
  116. package/src/legacy/tool-ui/src/main/webapp/v4/LinkCarousel.js +0 -40
  117. package/src/legacy/tool-ui/src/main/webapp/v4/LinkList.js +0 -14
  118. package/src/legacy/tool-ui/src/main/webapp/v4/LinkTable.js +0 -123
  119. package/src/legacy/tool-ui/src/main/webapp/v4/Location.js +0 -19
  120. package/src/legacy/tool-ui/src/main/webapp/v4/LocationMap.js +0 -148
  121. package/src/legacy/tool-ui/src/main/webapp/v4/LookingGlass.js +0 -24
  122. package/src/legacy/tool-ui/src/main/webapp/v4/Message.js +0 -14
  123. package/src/legacy/tool-ui/src/main/webapp/v4/NumberBar.js +0 -32
  124. package/src/legacy/tool-ui/src/main/webapp/v4/Page.js +0 -890
  125. package/src/legacy/tool-ui/src/main/webapp/v4/Preview.js +0 -758
  126. package/src/legacy/tool-ui/src/main/webapp/v4/PreviewEditor.js +0 -86
  127. package/src/legacy/tool-ui/src/main/webapp/v4/PreviewOverlay.js +0 -1005
  128. package/src/legacy/tool-ui/src/main/webapp/v4/PubSub.js +0 -47
  129. package/src/legacy/tool-ui/src/main/webapp/v4/QueryField.js +0 -211
  130. package/src/legacy/tool-ui/src/main/webapp/v4/RegionMap.js +0 -215
  131. package/src/legacy/tool-ui/src/main/webapp/v4/RepeatableContentInputGroup.js +0 -160
  132. package/src/legacy/tool-ui/src/main/webapp/v4/RichTextEditor.js +0 -154
  133. package/src/legacy/tool-ui/src/main/webapp/v4/SearchFields.js +0 -281
  134. package/src/legacy/tool-ui/src/main/webapp/v4/SearchResult.js +0 -255
  135. package/src/legacy/tool-ui/src/main/webapp/v4/SharePreview.js +0 -56
  136. package/src/legacy/tool-ui/src/main/webapp/v4/Sortable.js +0 -874
  137. package/src/legacy/tool-ui/src/main/webapp/v4/StyleEmbeddedContent.js +0 -100
  138. package/src/legacy/tool-ui/src/main/webapp/v4/StyleguidePresets.js +0 -357
  139. package/src/legacy/tool-ui/src/main/webapp/v4/TabContainer.js +0 -360
  140. package/src/legacy/tool-ui/src/main/webapp/v4/Taxonomy.js +0 -27
  141. package/src/legacy/tool-ui/src/main/webapp/v4/ThemeBundleEditor.js +0 -224
  142. package/src/legacy/tool-ui/src/main/webapp/v4/TimedContent.js +0 -147
  143. package/src/legacy/tool-ui/src/main/webapp/v4/TimedContentBundle.js +0 -8
  144. package/src/legacy/tool-ui/src/main/webapp/v4/VideoEditor.js +0 -2417
  145. package/src/legacy/tool-ui/src/main/webapp/v4/VideoEditorBundle.js +0 -8
  146. package/src/legacy/tool-ui/src/main/webapp/v4/ViewMirror.js +0 -52
  147. package/src/legacy/tool-ui/src/main/webapp/v4/ViewPreview.d.ts +0 -13
  148. package/src/legacy/tool-ui/src/main/webapp/v4/ViewPreview.js +0 -177
  149. package/src/legacy/tool-ui/src/main/webapp/v4/Widget.js +0 -90
  150. package/src/legacy/tool-ui/src/main/webapp/v4/__mocks__/fileMock.js +0 -1
  151. package/src/legacy/tool-ui/src/main/webapp/v4/__mocks__/styleMock.js +0 -1
  152. package/src/legacy/tool-ui/src/main/webapp/v4/__mocks__/textArea.mock.js +0 -20
  153. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/globals.js +0 -770
  154. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/ProseMirror.test.js +0 -16
  155. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/index.html +0 -54
  156. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/comment_manager/CommentManager.test.js +0 -29
  157. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/comment_manager/index.html +0 -35
  158. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/custom_keyboard/CustomKeyboard.js +0 -42
  159. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/custom_keyboard/index.html +0 -37
  160. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/EnhancementManager.test.js +0 -288
  161. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/block.html +0 -38
  162. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/inline.html +0 -38
  163. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/no-popups.html +0 -38
  164. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/list_manager/ListManager.js +0 -257
  165. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/list_manager/index.html +0 -38
  166. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/hierarchal.html +0 -33
  167. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/index.html +0 -33
  168. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/menubar.test.js +0 -195
  169. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/small.html +0 -34
  170. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/tags.html +0 -34
  171. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/PlaceholderManager.test.js +0 -134
  172. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/has-editable-placeholder.html +0 -32
  173. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/has-text.html +0 -34
  174. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/index.html +0 -31
  175. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/table_manager/TableManager.test.js +0 -63
  176. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/table_manager/existing.html +0 -48
  177. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/track_manager/TrackManager.test.js +0 -291
  178. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/track_manager/existing.html +0 -39
  179. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/track_manager/insert.html +0 -37
  180. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/Sortable.test.js +0 -105
  181. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/ProseMirror.test.js +0 -41
  182. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/codemirror-shim.test.js +0 -72
  183. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/collab_manager/CollabManager.test.js +0 -46
  184. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/enhancement_manager/EnhancementManager.test.js +0 -84
  185. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/list_manager/ListManager.test.js +0 -54
  186. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/menubar/menubar.test.js +0 -183
  187. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/spellcheck/SpellCheck.test.js +0 -45
  188. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/settings/BSSerializer.test.js +0 -346
  189. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/settings/menuItemsBuilder.test.js +0 -226
  190. package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/utilities.test.js +0 -118
  191. package/src/legacy/tool-ui/src/main/webapp/v4/appetizeio/Appetizeio.js +0 -5
  192. package/src/legacy/tool-ui/src/main/webapp/v4/appetizeio/AppetizeioEmbedded.js +0 -113
  193. package/src/legacy/tool-ui/src/main/webapp/v4/compat/Fetch.js +0 -16
  194. package/src/legacy/tool-ui/src/main/webapp/v4/compat/jquery.js +0 -32
  195. package/src/legacy/tool-ui/src/main/webapp/v4/compat/requirejs.js +0 -13
  196. package/src/legacy/tool-ui/src/main/webapp/v4/dom/Tether.js +0 -1
  197. package/src/legacy/tool-ui/src/main/webapp/v4/dom/TetherLayout.js +0 -1
  198. package/src/legacy/tool-ui/src/main/webapp/v4/dom/closest.js +0 -1
  199. package/src/legacy/tool-ui/src/main/webapp/v4/dom/create.js +0 -1
  200. package/src/legacy/tool-ui/src/main/webapp/v4/dom/find.js +0 -1
  201. package/src/legacy/tool-ui/src/main/webapp/v4/dom/findAll.js +0 -1
  202. package/src/legacy/tool-ui/src/main/webapp/v4/dom/ifClick.js +0 -1
  203. package/src/legacy/tool-ui/src/main/webapp/v4/dom/ifMatches.js +0 -1
  204. package/src/legacy/tool-ui/src/main/webapp/v4/dom/ifUnmodified.js +0 -1
  205. package/src/legacy/tool-ui/src/main/webapp/v4/dom/index.js +0 -5
  206. package/src/legacy/tool-ui/src/main/webapp/v4/dom/insertBefore.js +0 -1
  207. package/src/legacy/tool-ui/src/main/webapp/v4/dom/insertFirst.js +0 -1
  208. package/src/legacy/tool-ui/src/main/webapp/v4/dom/insertLast.js +0 -1
  209. package/src/legacy/tool-ui/src/main/webapp/v4/dom/onFind.js +0 -1
  210. package/src/legacy/tool-ui/src/main/webapp/v4/dom/onFindOnce.js +0 -1
  211. package/src/legacy/tool-ui/src/main/webapp/v4/dom/onRTEReady.js +0 -1
  212. package/src/legacy/tool-ui/src/main/webapp/v4/dom/onRemove.js +0 -1
  213. package/src/legacy/tool-ui/src/main/webapp/v4/dom/onVisible.js +0 -1
  214. package/src/legacy/tool-ui/src/main/webapp/v4/dom/previousUntil.js +0 -1
  215. package/src/legacy/tool-ui/src/main/webapp/v4/dom/resolveIconCompat.js +0 -40
  216. package/src/legacy/tool-ui/src/main/webapp/v4/rtc/Socket.js +0 -1
  217. package/src/legacy/tool-ui/src/main/webapp/v4/rtc/index.js +0 -1
  218. package/src/legacy/tool-ui/src/main/webapp/v4/rte/ProseMirror.js +0 -909
  219. package/src/legacy/tool-ui/src/main/webapp/v4/rte/README.md +0 -68
  220. package/src/legacy/tool-ui/src/main/webapp/v4/rte/codemirror-shim.d.ts +0 -8
  221. package/src/legacy/tool-ui/src/main/webapp/v4/rte/codemirror-shim.js +0 -274
  222. package/src/legacy/tool-ui/src/main/webapp/v4/rte/collab-workflow.jpeg +0 -0
  223. package/src/legacy/tool-ui/src/main/webapp/v4/rte/interchangeable.ts +0 -250
  224. package/src/legacy/tool-ui/src/main/webapp/v4/rte/mention.js +0 -90
  225. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/PluginProvider.js +0 -124
  226. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/README.md +0 -46
  227. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/ai_inline_manager/AIInlineManager.ts +0 -124
  228. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/ai_inline_manager/views/AIInlineView.ts +0 -1019
  229. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/ai_manager/AiManager.ts +0 -199
  230. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/collab_manager/CollabManager.js +0 -339
  231. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/collab_manager/views/AvatarView.js +0 -96
  232. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/comment_manager/CommentManager.js +0 -348
  233. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/custom_keyboard/CustomKeyboard.js +0 -110
  234. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/custom_keyboard/README.md +0 -29
  235. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/EnhancementManager.js +0 -428
  236. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/README.md +0 -63
  237. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/commands.js +0 -690
  238. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/constants.js +0 -12
  239. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/enhancement-creation.jpeg +0 -0
  240. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/index.js +0 -15
  241. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/rte-flow.jpeg +0 -0
  242. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/ActionButtonView.js +0 -86
  243. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/BlockSubmenuView.js +0 -60
  244. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/EnhancementView.js +0 -208
  245. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/PreviewView.js +0 -102
  246. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/SubmenuView.js +0 -365
  247. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/find_replace_manager/FindReplaceManager.js +0 -239
  248. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/find_replace_manager/views/FindView.js +0 -604
  249. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/FullscreenManager.js +0 -57
  250. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/README.md +0 -26
  251. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/commands.js +0 -16
  252. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/index.js +0 -4
  253. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/views/FullscreenView.js +0 -474
  254. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/html_editor_manager/htmlEditorManager.js +0 -66
  255. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/html_editor_manager/views/HtmlEditorView.js +0 -97
  256. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/ListManager.js +0 -342
  257. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/README.md +0 -50
  258. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/commands.js +0 -207
  259. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/constants.js +0 -26
  260. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/index.js +0 -4
  261. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/menubar/Menubar.js +0 -485
  262. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/menubar/README.md +0 -40
  263. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/menubar/views/MenuView.js +0 -842
  264. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/paste_manager/PasteManager.js +0 -368
  265. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/placeholder_manager/PlaceHolderManager.js +0 -128
  266. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/raw_text_manager/README.md +0 -13
  267. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/raw_text_manager/RawTextManager.js +0 -96
  268. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/spellcheck/index.js +0 -3
  269. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/spellcheck/spellcheck-plugin.js +0 -280
  270. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/spellcheck/spellcheck-service.js +0 -94
  271. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/TableManager.js +0 -57
  272. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/commands.js +0 -97
  273. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/views/TableSizerView.js +0 -88
  274. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/views/TableView.js +0 -613
  275. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/track_manager/README.md +0 -13
  276. package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/track_manager/TrackManager.js +0 -905
  277. package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/BSSerializer.js +0 -819
  278. package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/README.md +0 -80
  279. package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/commands.js +0 -98
  280. package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/constants.d.ts +0 -84
  281. package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/constants.js +0 -87
  282. package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/index.js +0 -13
  283. package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/keymapBuilder.js +0 -223
  284. package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/menuItemsBuilder.js +0 -559
  285. package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/schemaBuilder.js +0 -1281
  286. package/src/legacy/tool-ui/src/main/webapp/v4/rte/utilities.d.ts +0 -4
  287. package/src/legacy/tool-ui/src/main/webapp/v4/rte/utilities.js +0 -359
  288. package/src/legacy/tool-ui/src/main/webapp/v4/theme/ColorRotator.js +0 -1
  289. package/src/legacy/tool-ui/src/main/webapp/v4/util/debounce.js +0 -1
  290. package/src/legacy/tool-ui/src/main/webapp/v4/util/getComponentKey.js +0 -1
  291. package/src/legacy/tool-ui/src/main/webapp/v4/util/noise.js +0 -1
  292. package/src/legacy/tool-ui/src/main/webapp/v4/util/repaint.js +0 -1
  293. package/src/legacy/tool-ui/src/main/webapp/v4/util/storage.js +0 -1
  294. package/src/legacy/tool-ui/src/main/webapp/v4/util/throttle.js +0 -1
  295. package/src/legacy/tool-ui/src/main/webapp/v4/widget/AssignmentContent.js +0 -33
  296. package/src/legacy/tool-ui/src/main/webapp/v4/widget/AssignmentDeskDashboard.js +0 -217
  297. package/src/legacy/tool-ui/src/main/webapp/v4/widget/AssociatedContentWidget.js +0 -7
  298. package/src/legacy/tool-ui/src/main/webapp/v4/widget/BulkUpload.js +0 -19
  299. package/src/legacy/tool-ui/src/main/webapp/v4/widget/Calendar.js +0 -7
  300. package/src/legacy/tool-ui/src/main/webapp/v4/widget/ClosableWindow.js +0 -13
  301. package/src/legacy/tool-ui/src/main/webapp/v4/widget/PitchAssignments.js +0 -25
  302. package/src/legacy/tool-ui/src/main/webapp/v4/widget/PitchContent.js +0 -33
  303. package/src/legacy/tool-ui/src/main/webapp/v4/widget/Revisions.js +0 -61
@@ -1,842 +0,0 @@
1
- import { closeSuggestionsList } from '../../spellcheck/spellcheck-plugin'
2
- import { getPluginState } from '../../../utilities'
3
- import { resolveIconCompat } from '../../../../dom/resolveIconCompat'
4
- import Tether from '../../../../dom/Tether'
5
- import { v1 as uuidv1 } from 'uuid'
6
- import create from '../../../../dom/create'
7
- import {
8
- toggleMenu,
9
- setupMenuForAria,
10
- } from '../../../../../../../dom/popupMenu'
11
-
12
- if (!window.BRIGHTSPOT?.ui.cms.enableV5UI) {
13
- await import('./MenuView.less')
14
- }
15
-
16
- /**
17
- * Functional representation of an individual menu item.
18
- *
19
- * @param {Object.<string|boolean|Function>} props
20
- * @param {string} props.name example 'bold'
21
- * @param {string} props.className example 'B'
22
- * @param {boolean} props.isActive active state to assist in determining
23
- * class names
24
- * @param {Function} onClick Function the parent menu expected to be called
25
- * when the item is clicked on
26
- * @return {Element} The menu item
27
- */
28
- /**
29
- * Functional representation of an individual menu item.
30
- *
31
- * @param {Object.<string|boolean|Function>} props
32
- * @param {string} props.className Example 'B'.
33
- * @param {string} props.tooltip Becomes the title attribute.
34
- * @param {string} props.displayName The default text of the link.
35
- * @param {boolean} props.isActive active state to assist in determining
36
- * class names.
37
- * @param {Function} props.onClick Function the parent menu expected to be called
38
- * when the item is clicked on.
39
- * @param {boolean} props.clusterStart Indicates if this menu item starts a cluster.
40
- * A cluster is a group of menu items separated from other menu items via
41
- * a vertical rule.
42
- * @param {boolean} props.isCompatible Indicates if this menu item is compatible with the
43
- * current RTE selection.
44
- * @param {string} props.target Becomes the target attribute of the link.
45
- * @param {string} props.customUrl Custom URL, e.g. the upload action item url.
46
- * @param {string} props.icon The off state icon, if any, to be shown.
47
- * @param {string} props.onIcon The on state icon, if any, to be shown.
48
- * @param {Function} props.command The command to be called when the item is engaged.
49
- * @param {boolean} props.isOutOfContext True if this item is out of the context of the
50
- * current selection.
51
- * @param {string} props.metaData Extra text to be displayed next to the default text of the
52
- * item (e.g. Track Changes Accept All and Reject All display the number of changes in the
53
- * document).
54
- * @return {Element} The menu item
55
- */
56
- const createMenuItem = (props) => {
57
- const {
58
- className,
59
- tooltip,
60
- displayName,
61
- isActive,
62
- onClick,
63
- clusterStart,
64
- isCompatible,
65
- target,
66
- customUrl,
67
- icon,
68
- onIcon,
69
- command,
70
- isOutOfContext,
71
- popup,
72
- metaData,
73
- } = props
74
- let linkClass = isActive ? `${className} active` : `${className}`
75
- linkClass = isCompatible ? linkClass : `${linkClass} disabled`
76
- linkClass = icon ? linkClass : `${linkClass} rte2-toolbar-noicon`
77
- linkClass = isOutOfContext ? `${linkClass} outOfContext disabled` : linkClass
78
- let listItemClass = clusterStart
79
- ? 'ProseMirrorToolbar-action clusterStart'
80
- : 'ProseMirrorToolbar-action'
81
- listItemClass =
82
- isCompatible && !isOutOfContext
83
- ? `${listItemClass}`
84
- : `${listItemClass} disabled`
85
- listItemClass = isActive ? `${listItemClass} active` : `${listItemClass}`
86
-
87
- const listItem = document.createElement('li')
88
- listItem.className = listItemClass
89
- listItem.title = tooltip
90
- listItem.setAttribute('data-rte-style', className)
91
- const targetAttr = target ? `target="${target}"` : ''
92
- let iconAttr = icon ? `data-icon=${icon}` : ''
93
- iconAttr = isActive && onIcon ? `data-icon=${onIcon}` : iconAttr
94
- const ariaHasPopupAttr = customUrl || popup ? 'aria-haspopup="true"' : ''
95
- const ariaDisabledAttr =
96
- isCompatible && !isOutOfContext ? '' : 'aria-disabled="true"'
97
- const metaDataStr = metaData ? `(${metaData})` : ''
98
- const link = `
99
- <a
100
- href="${customUrl || '#'}"
101
- class="${linkClass}"
102
- tabindex="-1"
103
- role="button"
104
- title="${tooltip}"
105
- aria-label="${tooltip}"
106
- ${ariaDisabledAttr}
107
- ${ariaHasPopupAttr}
108
- ${targetAttr}
109
- ${iconAttr}
110
- >
111
- ${displayName || tooltip} ${metaDataStr}
112
- </a>
113
- `
114
- listItem.innerHTML = link
115
-
116
- const linkEl = listItem.querySelector('a')
117
- const iconName = linkEl?.dataset.icon
118
- if (iconName) {
119
- resolveIconCompat(iconName, linkEl)
120
- }
121
-
122
- if (isCompatible) {
123
- listItem.addEventListener('click', (evt) => {
124
- if (listItem.classList.contains('disabled')) {
125
- return
126
- }
127
- evt.preventDefault()
128
- onClick(command, evt)
129
- })
130
- }
131
-
132
- return listItem
133
- }
134
-
135
- const removeOpenedMenu = (button) => {
136
- const toolbar = document.querySelector('.ProseMirrorToolbar.is-visible')
137
- if (toolbar) toolbar.classList.remove('is-visible')
138
- const menuId = button
139
- .querySelector('button[aria-controls]')
140
- .getAttribute('aria-controls')
141
- const list = document.getElementById(menuId)
142
- if (!list) return
143
- if (list.classList.contains('is-removing')) return
144
- list.classList.add('is-removing')
145
- list.addEventListener(
146
- 'transitionend',
147
- (e) => {
148
- button?.observer?.disconnect()
149
- list.classList.remove('is-removing', 'is-opening')
150
- list.setAttribute('aria-hidden', true)
151
- if (window.BRIGHTSPOT?.ui.cms.enableV5UI) {
152
- list.hidePopover()
153
- } else {
154
- button ? button.appendChild(list) : list.remove()
155
- }
156
- button?.classList.remove('is-open')
157
- },
158
- { once: true },
159
- )
160
- }
161
-
162
- window.addEventListener('click', (e) => {
163
- handleSubmenuClick(e)
164
- })
165
-
166
- /**
167
- * The UI component of the menubar. It controls the behavior
168
- * of when its child menu items are clicked to decouple the menu
169
- * items from this view. This allows for mixing and matching of menu items
170
- * and menus for customization per RTE instance.
171
- *
172
- * Instantiation and updating of the menubar state is managed by the plugin
173
- * itself, which also allows for modularity as well as follows
174
- * Prosemirror's best practices. State can be retrieved from the
175
- * view's state, as seen in the `getPluginState` utility method.
176
- *
177
- * @param {Prosemirror.EditorView} editorView
178
- * @param {string} myKey The key of this plugin, used for easy retrieval
179
- * of the plugin from the EditorView.
180
- */
181
- class MenuView {
182
- constructor(editorView, myKey) {
183
- const textarea = editorView.dom
184
- .closest('.ProseMirrorContainer')
185
- .parentElement.querySelector('.richtext')
186
- this.editorView = editorView
187
- this.myKey = myKey
188
- this.dom = document.createElement('ul')
189
- this.dom.role = 'toolbar'
190
- this.dom.tabIndex = -1
191
- this.dom.setAttribute('aria-controls', textarea.id)
192
- this.dom.setAttribute('aria-label', textarea.ariaLabel)
193
-
194
- this.dom.addEventListener('mousedown', (e) => {
195
- e.preventDefault()
196
- closeSuggestionsList(this.editorView)
197
- })
198
-
199
- PubSub.subscribe('engageTrackManager', () => {
200
- this.openSubmenu = 'Track'
201
- })
202
-
203
- PubSub.subscribe('disengageTrackManager', () => {
204
- this.openSubmenu = null
205
- })
206
-
207
- this.render()
208
- }
209
-
210
- handleMenuSelection(command, evt) {
211
- const menu = this.dom.querySelector('.rte2-toolbar-submenu-2.is-open')
212
- if (menu) {
213
- this.dom.style.zIndex = 9
214
-
215
- const menuId = menu
216
- .querySelector('button[aria-controls]')
217
- .getAttribute('aria-controls')
218
- const menuMoved = document.getElementById(menuId)
219
-
220
- Tether.toggle(menu, menuMoved, () => {
221
- removeOpenedMenu(menu)
222
- })
223
- }
224
-
225
- const editorView = this.editorView
226
- editorView.focus()
227
- command(editorView.state, editorView.dispatch, editorView, evt)
228
- }
229
-
230
- /**
231
- * Builds out the menu action list item.
232
- *
233
- * @param {Object.<Object>} item Object literal representation
234
- * of the list item.
235
- * @param {string} key The list item property key.
236
- * @param {ProseMirror.State} state
237
- * @return {Element} The menu action list item.
238
- */
239
- getListItem = (item, key, state) => {
240
- const itemsDOM = item.dom
241
- let isActive =
242
- state.get('activeStates').get(key) ||
243
- state.get('activeMarks').get(key) ||
244
- state.get('activeNodes').get(key)
245
- const activeIfUnset = item.activeIfUnset
246
- if (activeIfUnset && activeIfUnset.length) {
247
- activeIfUnset.forEach((item) => {
248
- if (!state.get('activeMarks').get(item)) {
249
- isActive = true
250
- }
251
- })
252
- }
253
- let isCompatible =
254
- state.get('compatibleNodes').get(key) == null &&
255
- state.get('compatibleActions').get(key) == null
256
- ? true
257
- : state.get('compatibleNodes').get(key) ||
258
- state.get('compatibleActions').get(key)
259
-
260
- const inactiveIfSet = item.inactiveIfSet
261
- if (inactiveIfSet && inactiveIfSet.length) {
262
- inactiveIfSet.forEach((item) => {
263
- if (state.get('activeMarks').get(item)) {
264
- isCompatible = false
265
- }
266
- if (state.get('activeNodes').get(item)) {
267
- isCompatible = false
268
- }
269
- if (state.get('activeStates').get(item)) {
270
- isCompatible = false
271
- }
272
- })
273
- }
274
-
275
- if (
276
- (state.get('disabledStates') && state.get('disabledStates').get(key)) ||
277
- (isActive && item.dom.disableIfActive)
278
- ) {
279
- isCompatible = false
280
- }
281
-
282
- const parentName = state.get('parent')
283
- ? state.get('parent').type.name
284
- : null
285
-
286
- let isInContext = true
287
-
288
- if (item.context && item.context.length) {
289
- isInContext = item.context.some((tag) => {
290
- if (tag === parentName) {
291
- return true
292
- }
293
-
294
- if (tag === null && (parentName === 'line' || parentName === 'p')) {
295
- return true
296
- }
297
-
298
- if (state.get('activeMarks').get(tag)) {
299
- return true
300
- }
301
-
302
- return false
303
- })
304
- }
305
-
306
- const metaData = state.get('metaData').get(key)
307
-
308
- return createMenuItem({
309
- className: itemsDOM.className,
310
- displayName: itemsDOM.displayName,
311
- tooltip: itemsDOM.tooltip,
312
- isActive,
313
- isCompatible,
314
- onClick: this.handleMenuSelection.bind(this),
315
- clusterStart: item.cluster,
316
- target: itemsDOM.target,
317
- customUrl: item.customUrl,
318
- icon: itemsDOM.icon,
319
- onIcon: itemsDOM.onIcon,
320
- command: item.command,
321
- isOutOfContext: !isInContext,
322
- popup: itemsDOM.popup === true,
323
- metaData,
324
- })
325
- }
326
-
327
- /**
328
- * Builds out a nested list (e.g custom css properties
329
- * drop-down menus).
330
- *
331
- * @param {string} title The title of the nested list.
332
- * @param {Array.<Object>} children The nested list's child
333
- * objects.
334
- * @param {ProseMirror.State} state
335
- * @param {number} index Indicates what number in a series of
336
- * nested lists the list is - used to determine if it should
337
- * receive the clusterStart class name.
338
- * @return {Element} A nested list item.
339
- */
340
- getList = (title, icon, children, state) => {
341
- const isActive =
342
- state.get('activeStates').get(title) ||
343
- state.get('activeMarks').get(title) ||
344
- state.get('activeNodes').get(title)
345
- const isDisabled = state.get('disabledStates').get(title)
346
- const parentList = document.createElement('li')
347
- if (title === 'Track') {
348
- parentList.className = 'rte2-toolbar-submenu-horizontal '
349
- } else {
350
- parentList.className = 'rte2-toolbar-submenu-2 '
351
- }
352
-
353
- if (title) {
354
- parentList.setAttribute('data-rte-toolbar-submenu', title)
355
- }
356
- if (isActive) {
357
- parentList.classList.add('active')
358
- }
359
- if (isDisabled) {
360
- parentList.classList.add('disabled')
361
- }
362
- if (icon) {
363
- parentList.classList.add('rte2-toolbar-submenu-2-with-icon')
364
- }
365
- if (!title && !icon) {
366
- parentList.classList.add('rte2-toolbar-submenu-2-no-icon-no-text')
367
- }
368
-
369
- const baseMenuId = uuidv1()
370
- const heading = document.createElement('button')
371
- heading.type = 'button'
372
- heading.id = `b${baseMenuId}`
373
- heading.setAttribute('aria-haspopup', true)
374
- heading.setAttribute('aria-label', title)
375
- heading.setAttribute('aria-controls', `m${baseMenuId}`)
376
- if (isDisabled) {
377
- heading.setAttribute('aria-disabled', true)
378
- }
379
- heading.tabIndex = -1
380
- heading.classList.add('rte2-toolbar-submenu-2-heading-icon', 'Link')
381
- heading.setAttribute('title', title)
382
- const headingText = document.createElement('span')
383
- headingText.textContent = title
384
- headingText.className = 'rte2-toolbar-submenu-2-heading'
385
- heading.appendChild(headingText)
386
-
387
- parentList.appendChild(heading)
388
-
389
- const list = document.createElement('ul')
390
- list.id = `m${baseMenuId}`
391
- list.role = 'menu'
392
- list.classList.add('rte2-toolbar-submenu-2-items')
393
- list.setAttribute('aria-label', title)
394
- list.setAttribute('aria-hidden', true)
395
-
396
- if (window.BRIGHTSPOT?.ui.cms.enableV5UI)
397
- if (!parentList.classList.contains('rte2-toolbar-submenu-horizontal'))
398
- list.setAttribute('popover', 'manual')
399
-
400
- let numDisabledChild = 0
401
- children.forEach((child) => {
402
- const listItem = this.getListItem(child, child.dom.name, state)
403
- listItem.role = 'menuitem'
404
-
405
- if (listItem.classList.contains('disabled')) {
406
- numDisabledChild++
407
- }
408
-
409
- if (listItem.classList.contains('active')) {
410
- parentList.classList.add('active')
411
- }
412
-
413
- list.appendChild(listItem)
414
- })
415
- list.addEventListener('keydown', (evt) => {
416
- evt.target.parentElement.classList.remove('focus')
417
- switch (evt.key) {
418
- case 'ArrowUp':
419
- if (
420
- evt.currentTarget.firstElementChild === evt.target.parentElement
421
- ) {
422
- evt.currentTarget.lastElementChild.firstElementChild.focus()
423
- evt.currentTarget.lastElementChild.classList.add('focus')
424
- } else {
425
- evt.target.parentElement.previousElementSibling.firstElementChild.focus()
426
- evt.target.parentElement.previousElementSibling.classList.add(
427
- 'focus',
428
- )
429
- }
430
- break
431
- case 'ArrowDown':
432
- if (evt.currentTarget.lastElementChild === evt.target.parentElement) {
433
- evt.currentTarget.firstElementChild.firstElementChild.focus()
434
- evt.currentTarget.firstElementChild.classList.add('focus')
435
- } else {
436
- evt.target.parentElement.nextElementSibling.firstElementChild.focus()
437
- evt.target.parentElement.nextElementSibling.classList.add('focus')
438
- }
439
- break
440
- case 'Escape':
441
- case 'Tab':
442
- heading.click()
443
- heading.focus()
444
- break
445
- }
446
- })
447
- parentList.appendChild(list)
448
- if (numDisabledChild === children.length) {
449
- parentList.classList.add('disabled')
450
- parentList.classList.add('outOfContext')
451
- heading.setAttribute('aria-disabled', true)
452
- }
453
- return parentList
454
- }
455
-
456
- createSeparator = () => {
457
- return create('li', { className: 'separator' }, '')
458
- }
459
-
460
- createToggle = (el) => {
461
- const elAnchor = el.querySelector('a')
462
- const clone = create('li', {
463
- className:
464
- `${
465
- el.classList.contains('ProseMirrorToolbar-action')
466
- ? 'ProseMirrorToolbar-action '
467
- : ''
468
- }` +
469
- `${el.classList.contains('active') ? 'active ' : ''}` +
470
- `${el.classList.contains('disabled') ? 'disabled ' : ''}`,
471
- })
472
- const anchor = create(
473
- 'a',
474
- {
475
- className: elAnchor?.className || '',
476
- href: '#',
477
- tabIndex: -1,
478
- role: 'menuitem',
479
- dataset: { icon: elAnchor?.dataset.icon || '' },
480
- },
481
- '',
482
- )
483
-
484
- // Splits text like: "Outdent (Ctrl + [" into two parts: "Outdent" and "(Ctrl + [)".
485
- const splitStringWithParentheses = (str) => {
486
- let regex = /(.+?)\s*(\([^)]*\))/
487
- const match = str.match(regex)
488
-
489
- // If there's a match, return an array with two parts
490
- if (match) {
491
- return [match[1].trim(), match[2].trim()]
492
- } else {
493
- // If there's no match, return an array with the original string as the first element and an empty string as the second element
494
- return [str, '']
495
- }
496
- }
497
-
498
- // Render a shortcut tooltip if one exists.
499
- let tooltip = el.firstElementChild?.getAttribute('aria-label')
500
- if (!tooltip) tooltip = el.firstElementChild?.innerText
501
- const result = splitStringWithParentheses(tooltip)
502
-
503
- // If the tooltip is too long, use the first child's text content if possible.
504
- result[0] =
505
- result[0].length >= 28
506
- ? el.firstElementChild?.innerText || result[0]
507
- : result[0]
508
-
509
- anchor.innerText = result[0]
510
- if (result[1]) {
511
- anchor.append(create('span', { class: 'shortcut' }, result[1]))
512
- }
513
-
514
- if (!clone.classList.contains('disabled')) {
515
- clone.onclick = (evt) => {
516
- el.querySelector('a')?.click()
517
- evt.stopImmediatePropagation()
518
- }
519
- }
520
- clone.append(anchor)
521
-
522
- const iconName = anchor.dataset?.icon
523
- if (iconName) {
524
- resolveIconCompat(iconName, anchor)
525
- }
526
-
527
- return clone
528
- }
529
-
530
- createSubmenu = (el) => {
531
- const btn = el.querySelector('button[aria-haspopup="true"]')
532
- const parentItem = document.createElement('li')
533
- const submenu = create(
534
- 'ul',
535
- { className: 'overflow-submenu', role: 'group' },
536
- btn
537
- ? btn.querySelector('.rte2-toolbar-submenu-2-heading')?.innerText
538
- : '',
539
- )
540
- parentItem.appendChild(submenu)
541
-
542
- // Render all the children of the submenu
543
- const list = el.querySelector('.rte2-toolbar-submenu-2-items')
544
- if (list) {
545
- list.childNodes.forEach((subitem, index, array) => {
546
- if (subitem.classList.contains('separator')) return
547
- submenu.append(this.createToggle(subitem))
548
- })
549
- }
550
- return parentItem
551
- }
552
-
553
- getOverflowItem = (children) => {
554
- const overflowBtnWrap = document.createElement('li')
555
- overflowBtnWrap.className = 'rte2-toolbar-submenu-2 rte-overflow-btn'
556
- const title = window.BRIGHTSPOT?.ui?.rte?.buttonMoreMenu
557
- overflowBtnWrap.setAttribute(
558
- 'data-rte-toolbar-submenu',
559
- window.BRIGHTSPOT?.ui?.rte?.buttonMoreMenu,
560
- )
561
-
562
- const baseMenuId = uuidv1()
563
- const overflowBtn = document.createElement('button')
564
- overflowBtn.type = 'button'
565
- overflowBtn.id = `b${baseMenuId}`
566
- overflowBtn.setAttribute('aria-haspopup', 'menu')
567
- overflowBtn.setAttribute('aria-expanded', false)
568
- overflowBtn.setAttribute('aria-label', title)
569
- overflowBtn.setAttribute('aria-controls', `m${baseMenuId}`)
570
- overflowBtn.tabIndex = -1
571
- overflowBtn.classList.add('rte2-toolbar-submenu-2-heading-icon', 'Link')
572
- overflowBtn.setAttribute('title', title)
573
-
574
- overflowBtnWrap.appendChild(overflowBtn)
575
-
576
- const list = document.createElement('ul')
577
- list.id = `m${baseMenuId}`
578
- list.role = 'menu'
579
- list.classList.add('rte2-toolbar-submenu-2-items', 'overflow-items')
580
- list.setAttribute('aria-label', title)
581
-
582
- if (window.BRIGHTSPOT?.ui.cms.enableV5UI)
583
- list.setAttribute('popover', 'manual')
584
-
585
- children.forEach((child) => {
586
- let itemType = 'toggle'
587
- if (child.classList.contains('rte2-toolbar-submenu-2')) {
588
- itemType = 'submenu'
589
- }
590
- if (child.classList.contains('rte2-toolbar-separator')) {
591
- itemType = 'separator'
592
- }
593
-
594
- // Different render methods for each item type:
595
- let listItem
596
- if (itemType === 'toggle') {
597
- listItem = this.createToggle(child)
598
- } else if (itemType === 'submenu') {
599
- listItem = this.createSubmenu(child)
600
- } else if (itemType === 'separator') {
601
- listItem = this.createSeparator(child)
602
- }
603
-
604
- if (listItem.classList.contains('active')) {
605
- overflowBtnWrap.classList.add('active')
606
- }
607
-
608
- list.appendChild(listItem)
609
- })
610
-
611
- setupMenuForAria(list, overflowBtn)
612
- overflowBtnWrap.appendChild(list)
613
- return overflowBtnWrap
614
- }
615
-
616
- /**
617
- * Renders the menu view.
618
- */
619
- render() {
620
- const state = getPluginState(this.editorView, this.myKey)
621
- if (!state.get('hasChange')) {
622
- return
623
- }
624
-
625
- this.dom.innerHTML = ''
626
-
627
- state.get('menuItems').forEach((value, key) => {
628
- const items = value.items
629
- const rollAt = value.rollAt
630
-
631
- items.forEach((item, index) => {
632
- const name = item.dom.name
633
- if (name === 'separator') {
634
- const li = document.createElement('li')
635
- li.className = 'rte2-toolbar-separator'
636
- this.dom.appendChild(li)
637
- } else if (rollAt == null || (rollAt > 0 && index < rollAt)) {
638
- const li = this.getListItem(item, item.dom.name, state)
639
- this.dom.appendChild(li)
640
- }
641
- })
642
-
643
- if (rollAt != null && items.slice(rollAt).length > 0) {
644
- const topListItem = this.getList(
645
- value.topLevelText,
646
- value.topLevelIcon,
647
- items.slice(rollAt),
648
- state,
649
- )
650
-
651
- let submenu
652
- if (this.dom.parentNode) {
653
- submenu = this.dom.parentNode.querySelector(
654
- '.ProseMirrorToolbar-horizontalSubmenu',
655
- )
656
- }
657
-
658
- if (this.openSubmenu === value.topLevelText) {
659
- submenu.innerHTML = ''
660
- submenu.appendChild(topListItem.querySelector('ul'))
661
- } else {
662
- // When submenu is in opened state do not clear out on repaints of menu.
663
- if (submenu && !this.openSubmenu) {
664
- submenu.innerHTML = ''
665
- }
666
- this.dom.appendChild(topListItem)
667
- }
668
- }
669
- })
670
-
671
- const first = this.dom.querySelector('[tabindex]')
672
-
673
- if (first) {
674
- first.tabIndex = 0
675
- }
676
-
677
- this.dom.addEventListener('keydown', (event) => {
678
- const { key, target } = event
679
- for (
680
- let move = target.closest('li');
681
- (move =
682
- key === 'ArrowLeft'
683
- ? move.previousElementSibling
684
- : key === 'ArrowRight'
685
- ? move.nextElementSibling
686
- : null);
687
-
688
- ) {
689
- const { width, height } = move.getBoundingClientRect()
690
-
691
- if (
692
- width > 0 &&
693
- height > 0 &&
694
- getComputedStyle(move).pointerEvents !== 'none' &&
695
- move.dataset.rteStyle !== 'RichTextEditor-upload'
696
- ) {
697
- const tab = move.querySelector(':scope > [tabindex]')
698
-
699
- if (tab) {
700
- tab.focus()
701
- return
702
- }
703
- }
704
- }
705
-
706
- if (key === 'ArrowDown' || key === 'ArrowUp') {
707
- event.preventDefault()
708
- handleSubmenuClick({ target })
709
- }
710
- })
711
-
712
- return true
713
- }
714
-
715
- update() {
716
- if (this.render()) {
717
- this.dom.dispatchEvent(new Event('btu-toolbar-update'))
718
- }
719
- }
720
-
721
- onOverflowUpdate({ items, target }) {
722
- // Remove the overflow menu if it exists.
723
- if (this.overflowMenuBtn) {
724
- this.overflowMenuBtn.innerHTML = ''
725
- }
726
-
727
- // Exit early if there are no items to overflow.
728
- if (!items || items.length === 0) {
729
- return
730
- }
731
-
732
- // Create an overflow menu item and append it to the menu.
733
- const container = target.insertAdjacentElement(
734
- 'beforebegin',
735
- this.getOverflowItem(items),
736
- )
737
- const btn = container?.querySelector('button')
738
- if (!btn) return
739
-
740
- this.overflowMenuBtn = btn
741
-
742
- // Find the overflow menu list.
743
- const menuId = this.overflowMenuBtn.getAttribute('aria-controls')
744
- const list = document.getElementById(menuId)
745
-
746
- this.overflowMenuBtn.addEventListener('click', () => {
747
- toggleMenu(list, this.overflowMenuBtn)
748
- })
749
- }
750
-
751
- destroy() {
752
- this.dom.remove()
753
- }
754
- }
755
-
756
- const handleSubmenuClick = (e) => {
757
- let menu = e.target.closest('.rte2-toolbar-submenu-2')
758
- if (!menu) return
759
- const menuId = menu
760
- .querySelector('button[aria-controls]')
761
- .getAttribute('aria-controls')
762
- const menuItems = document.getElementById(menuId)
763
- if (!menuItems) return
764
- let toolbar = menu?.parentElement
765
- if (!toolbar) return
766
- if (
767
- menu?.classList.contains('is-blocked') ||
768
- menu?.classList.contains('disabled')
769
- ) {
770
- return
771
- }
772
- menuItems
773
- ?.querySelectorAll('li.focus')
774
- .forEach((li) => li.classList.remove('focus'))
775
-
776
- const toggleCallback = () => {
777
- if (menu && !menu.classList.contains('is-open')) {
778
- if (!menuItems) return
779
- menu.classList.add('is-blocked')
780
- const isV5 = window.BRIGHTSPOT?.ui.cms.enableV5UI
781
- if (!isV5) document.body.appendChild(menuItems)
782
- toolbar.style.zIndex = 10
783
- toolbar.closest('.ProseMirrorToolbar').classList.add('is-visible')
784
- setTimeout(() => {
785
- if (isV5) menuItems.showPopover()
786
- menuItems.classList.add('is-opening')
787
- }, 0)
788
-
789
- menuItems.addEventListener(
790
- 'transitionend',
791
- (e) => {
792
- menu.classList.remove('is-blocked')
793
- },
794
- { once: true },
795
- )
796
- menu.observer = new IntersectionObserver((changes) => {
797
- changes.forEach((change) => {
798
- if (menuItems.classList.contains('is-removing')) return
799
- if (change.isIntersecting) {
800
- menuItems.style.visibility = 'visible'
801
- menuItems.setAttribute('aria-hidden', false)
802
- if (menuItems.firstElementChild?.firstElementChild) {
803
- menuItems.firstElementChild?.firstElementChild?.focus()
804
- } else {
805
- menuItems.firstElementChild?.focus()
806
- }
807
- menuItems.firstElementChild.classList.add('focus')
808
- e.target.setAttribute('aria-expanded', true)
809
- menuItems.scrollTo(0, 0)
810
- } else {
811
- menuItems.style.visibility = 'hidden'
812
- menuItems.setAttribute('aria-hidden', true)
813
- }
814
- })
815
- })
816
- menu.observer.observe(menu)
817
- } else {
818
- if (e.target.classList.contains('rte2-toolbar-submenu-2-items')) return
819
- if (!menu) {
820
- const menuId = e.target
821
- .closest('button[aria-controls]')
822
- .getAttribute('aria-controls')
823
- if (menuId) {
824
- menu = document.getElementById(menuId)
825
- }
826
- if (menu && !toolbar) {
827
- toolbar = menu.closest('ul')
828
- }
829
- }
830
-
831
- removeOpenedMenu(menu)
832
- e.target.removeAttribute('aria-expanded')
833
- if (toolbar) toolbar.style.zIndex = 9
834
- }
835
-
836
- return menu?.classList.toggle('is-open')
837
- }
838
-
839
- Tether.toggle(menu, menuItems, toggleCallback)
840
- }
841
-
842
- export { MenuView }