@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.
- package/README.md +54 -35
- package/dist/custom-elements.json +2536 -2536
- package/dist/storybook/assets/{ActionBar.stories-BhdqLyzJ.js → ActionBar.stories-CSxtZl7v.js} +1 -1
- package/dist/storybook/assets/{ActionItem.stories-17zjMCkO.js → ActionItem.stories-BWcMRMP3.js} +1 -1
- package/dist/storybook/assets/{Avatar.stories-C5m3-zOH.js → Avatar.stories-CYTUGXzH.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-DE88PJ6w.js → AvatarGroup.stories-CSYBYo_5.js} +1 -1
- package/dist/storybook/assets/{Badge.stories-D905HmvO.js → Badge.stories-LuF4BuVr.js} +1 -1
- package/dist/storybook/assets/{Button-ANyLESGb.js → Button-CrXCMxHb.js} +1 -1
- package/dist/storybook/assets/{Button.stories-DbH6q5L3.js → Button.stories-JVwxdrdM.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup.stories-loqgAB7p.js → ButtonGroup.stories-qtq64a1H.js} +1 -1
- package/dist/storybook/assets/{Celebrate.stories-CRO3rSgp.js → Celebrate.stories-DjTtaSd6.js} +1 -1
- package/dist/storybook/assets/{Checkbox.stories-SZtgfbFe.js → Checkbox.stories-v1Pr5mL6.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-VayPxO4M.js → CircularProgress.stories-DkV7PJ4D.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-0EB2O2zT.js → ClipboardMixin.stories-Dh5c7uSM.js} +1 -1
- package/dist/storybook/assets/{Color-6BZIO3FS-CFpcD80i.js → Color-6BZIO3FS-B1gcREt6.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-BJGM6xnp.js → Colors.stories-DnubtRqn.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-DUwocYcn.js → CombinedEffects.stories-By6akSve.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-MUqdPCf7.js → ComponentStatesMixin-CPLGv3h-.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-DjrxNwE7.js → ComponentStatesMixin.stories-CiQ_lyhm.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-DptOcPq6.js → CopyToClipboard.stories-cJ7rl3mj.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-BbcIWmhD.js → Debounce.stories-Bw-goobU.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-Yy8fjeNG.js → DocsRenderer-LL677BLK-CNW57dGQ.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-Du3LrBR6.js → Dropdown.stories-CwC3HXXd.js} +1 -1
- package/dist/storybook/assets/{EmptyState.stories-Dy9P8aOY.js → EmptyState.stories-BUEJwuhP.js} +1 -1
- package/dist/storybook/assets/{Events.stories-DvdVQxDf.js → Events.stories-D1mf9buv.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-BQ1jFOKn.js → Heading.stories-DO906G4P.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-CrZFjnRl.js → HueRipple.stories-BOySRSZB.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-C2Tj8Lx1.js → Icon.stories-BsqgTbdG.js} +1 -1
- package/dist/storybook/assets/{IconButton.stories-DFqouOJb.js → IconButton.stories-aza1AAKk.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-DtNw3QX3.js → LinearProgress.stories-CDYmiiex.js} +1 -1
- package/dist/storybook/assets/{Pagination.stories-CFiZ9APs.js → Pagination.stories-LXB-x7YB.js} +1 -1
- package/dist/storybook/assets/{Popover.stories-DkkTuYag.js → Popover.stories-DY1HesPJ.js} +1 -1
- package/dist/storybook/assets/{ReadyMixin-BA01Vm_B.js → ReadyMixin-DmOC67IJ.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin.stories-BesAqt48.js → RovingTabindexMixin.stories-BWy0Rq8d.js} +1 -1
- package/dist/storybook/assets/{Rtc.stories-iTw43rjp.js → Rtc.stories-DrmdqqbI.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-QYqQCcAo.js → ScrollShadow.stories-DiKFPazh.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-BKArq9Mk.js → Switch.stories-BgFnw8_z.js} +1 -1
- package/dist/storybook/assets/{Tab.stories-8UdDPvE5.js → Tab.stories-c2wLMooF.js} +1 -1
- package/dist/storybook/assets/{Tabs.stories-BPGMZ552.js → Tabs.stories-CjH8seNP.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-CYl5d0r6.js → Throttle.stories-CXysc_QE.js} +1 -1
- package/dist/storybook/assets/{Tooltip.stories-cZ0zSlwX.js → Tooltip.stories-6qzyByPm.js} +1 -1
- package/dist/storybook/assets/{Upload.stories-CPC7N0Ed.js → Upload.stories-BLxykydQ.js} +1 -1
- package/dist/storybook/assets/{UploadItem.stories-D0LClT0a.js → UploadItem.stories-CcfcqdJW.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-C8JUaRas.js → Welcome.stories-CzYS_3fH.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-C1FxF24-.js → Widget.stories-Du7T4LAI.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-BMBo-fie.js → WithTooltip-65CFNBJE-D4LfXdYt.js} +1 -1
- package/dist/storybook/assets/{blocks-BTsuXRXZ.js → blocks-DR3fGePu.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-BJ1Cwrpx.js → formatter-EIJCOSYU-Cf01216O.js} +1 -1
- package/dist/storybook/assets/if-defined-DaMmbcIU.js +1 -0
- package/dist/storybook/assets/{iframe-B3YWTqkR.js → iframe-CQArUhO8.js} +4 -4
- package/dist/storybook/assets/{iframe-BgFj0b5u.css → iframe-D0roG0J-.css} +1 -1
- package/dist/storybook/assets/{index-BBUTVEdP.js → index-B1uI_67G.js} +1 -1
- package/dist/storybook/assets/{onFind-NC0lGo-r.js → onFind-BpFkN2Rh.js} +1 -1
- package/dist/storybook/assets/{onFind.stories-CqbwQgQF.js → onFind.stories-Cxdeg69X.js} +1 -1
- package/dist/storybook/assets/{onRemove.stories-Y8Ycs77o.js → onRemove.stories-BHEWpNrE.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-CcLUE35q.js → onVisible.stories-DFJ3S_ZS.js} +1 -1
- package/dist/storybook/assets/{style-map-MSB_ngx3.js → style-map-DJ83UC3V.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-BjkjEDMG.js → syntaxhighlighter-ED5Y7EFY-zYN83mxK.js} +1 -1
- package/dist/storybook/iframe.html +2 -2
- package/dist/storybook/project.json +1 -1
- package/dist/tailwind.config.d.ts +4 -1
- package/dist/tailwind.config.d.ts.map +1 -1
- package/dist/tailwind.config.js +0 -2
- package/dist/tailwind.config.js.map +1 -1
- package/dist/tailwind.config.ts +0 -2
- package/package.json +16 -2
- package/dist/storybook/assets/if-defined-BPCd2NXs.js +0 -1
- package/src/legacy/tool-ui/src/main/resources/settings.properties +0 -1
- package/src/legacy/tool-ui/src/main/webapp/WEB-INF/web.xml +0 -81
- package/src/legacy/tool-ui/src/main/webapp/script/bsp-uploader.js +0 -170
- package/src/legacy/tool-ui/src/main/webapp/script/bsp-utils.js +0 -393
- package/src/legacy/tool-ui/src/main/webapp/script/content/layout-element.js +0 -141
- package/src/legacy/tool-ui/src/main/webapp/script/input/query.js +0 -78
- package/src/legacy/tool-ui/src/main/webapp/script/input/workflow.js +0 -718
- package/src/legacy/tool-ui/src/main/webapp/script/jquery.extra.js +0 -633
- package/src/legacy/tool-ui/src/main/webapp/script/v3/Dropbox.js +0 -18
- package/src/legacy/tool-ui/src/main/webapp/script/v3/EditFieldUpdate.js +0 -406
- package/src/legacy/tool-ui/src/main/webapp/script/v3/EditFieldUpdateCache.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/script/v3/Notification.js +0 -151
- package/src/legacy/tool-ui/src/main/webapp/script/v3/content/edit.js +0 -194
- package/src/legacy/tool-ui/src/main/webapp/script/v3/content/state.js +0 -785
- package/src/legacy/tool-ui/src/main/webapp/script/v3/csrf.js +0 -35
- package/src/legacy/tool-ui/src/main/webapp/script/v3/dashboard.js +0 -65
- package/src/legacy/tool-ui/src/main/webapp/script/v3/input/dataTransfer.js +0 -129
- package/src/legacy/tool-ui/src/main/webapp/script/v3/input/file.js +0 -433
- package/src/legacy/tool-ui/src/main/webapp/script/v3/input/object.js +0 -743
- package/src/legacy/tool-ui/src/main/webapp/script/v3/input/read-only.js +0 -17
- package/src/legacy/tool-ui/src/main/webapp/script/v3/jquery.frame.js +0 -478
- package/src/legacy/tool-ui/src/main/webapp/script/v3/jquery.repeatable.js +0 -2406
- package/src/legacy/tool-ui/src/main/webapp/script/v3/plugin/popup.d.ts +0 -2
- package/src/legacy/tool-ui/src/main/webapp/script/v3/plugin/popup.js +0 -446
- package/src/legacy/tool-ui/src/main/webapp/script/v3/search-filters.js +0 -62
- package/src/legacy/tool-ui/src/main/webapp/script/v3/search.js +0 -53
- package/src/legacy/tool-ui/src/main/webapp/script/v3.js +0 -1049
- package/src/legacy/tool-ui/src/main/webapp/v4/Admin.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/AutoExpand.js +0 -84
- package/src/legacy/tool-ui/src/main/webapp/v4/AutoSubmit.js +0 -68
- package/src/legacy/tool-ui/src/main/webapp/v4/Bridge.js +0 -536
- package/src/legacy/tool-ui/src/main/webapp/v4/CheckboxInput.js +0 -22
- package/src/legacy/tool-ui/src/main/webapp/v4/ColorInput.js +0 -5
- package/src/legacy/tool-ui/src/main/webapp/v4/ColorInputSpectrum.js +0 -107
- package/src/legacy/tool-ui/src/main/webapp/v4/ComboInput.js +0 -1491
- package/src/legacy/tool-ui/src/main/webapp/v4/CommunityWidget.js +0 -29
- package/src/legacy/tool-ui/src/main/webapp/v4/ContentEdit.js +0 -2427
- package/src/legacy/tool-ui/src/main/webapp/v4/ContentLock.js +0 -470
- package/src/legacy/tool-ui/src/main/webapp/v4/ContentReporting.js +0 -32
- package/src/legacy/tool-ui/src/main/webapp/v4/DataTable.js +0 -31
- package/src/legacy/tool-ui/src/main/webapp/v4/DateStringField.js +0 -485
- package/src/legacy/tool-ui/src/main/webapp/v4/Entry.js +0 -264
- package/src/legacy/tool-ui/src/main/webapp/v4/ExternalItemAuth.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/Form.js +0 -31
- package/src/legacy/tool-ui/src/main/webapp/v4/Hierarchy.js +0 -100
- package/src/legacy/tool-ui/src/main/webapp/v4/Icon.ts +0 -49
- package/src/legacy/tool-ui/src/main/webapp/v4/ImageEditor.js +0 -2403
- package/src/legacy/tool-ui/src/main/webapp/v4/ImageEditorBundle.js +0 -5
- package/src/legacy/tool-ui/src/main/webapp/v4/LinkCarousel.js +0 -40
- package/src/legacy/tool-ui/src/main/webapp/v4/LinkList.js +0 -14
- package/src/legacy/tool-ui/src/main/webapp/v4/LinkTable.js +0 -123
- package/src/legacy/tool-ui/src/main/webapp/v4/Location.js +0 -19
- package/src/legacy/tool-ui/src/main/webapp/v4/LocationMap.js +0 -148
- package/src/legacy/tool-ui/src/main/webapp/v4/LookingGlass.js +0 -24
- package/src/legacy/tool-ui/src/main/webapp/v4/Message.js +0 -14
- package/src/legacy/tool-ui/src/main/webapp/v4/NumberBar.js +0 -32
- package/src/legacy/tool-ui/src/main/webapp/v4/Page.js +0 -890
- package/src/legacy/tool-ui/src/main/webapp/v4/Preview.js +0 -758
- package/src/legacy/tool-ui/src/main/webapp/v4/PreviewEditor.js +0 -86
- package/src/legacy/tool-ui/src/main/webapp/v4/PreviewOverlay.js +0 -1005
- package/src/legacy/tool-ui/src/main/webapp/v4/PubSub.js +0 -47
- package/src/legacy/tool-ui/src/main/webapp/v4/QueryField.js +0 -211
- package/src/legacy/tool-ui/src/main/webapp/v4/RegionMap.js +0 -215
- package/src/legacy/tool-ui/src/main/webapp/v4/RepeatableContentInputGroup.js +0 -160
- package/src/legacy/tool-ui/src/main/webapp/v4/RichTextEditor.js +0 -154
- package/src/legacy/tool-ui/src/main/webapp/v4/SearchFields.js +0 -281
- package/src/legacy/tool-ui/src/main/webapp/v4/SearchResult.js +0 -255
- package/src/legacy/tool-ui/src/main/webapp/v4/SharePreview.js +0 -56
- package/src/legacy/tool-ui/src/main/webapp/v4/Sortable.js +0 -874
- package/src/legacy/tool-ui/src/main/webapp/v4/StyleEmbeddedContent.js +0 -100
- package/src/legacy/tool-ui/src/main/webapp/v4/StyleguidePresets.js +0 -357
- package/src/legacy/tool-ui/src/main/webapp/v4/TabContainer.js +0 -360
- package/src/legacy/tool-ui/src/main/webapp/v4/Taxonomy.js +0 -27
- package/src/legacy/tool-ui/src/main/webapp/v4/ThemeBundleEditor.js +0 -224
- package/src/legacy/tool-ui/src/main/webapp/v4/TimedContent.js +0 -147
- package/src/legacy/tool-ui/src/main/webapp/v4/TimedContentBundle.js +0 -8
- package/src/legacy/tool-ui/src/main/webapp/v4/VideoEditor.js +0 -2417
- package/src/legacy/tool-ui/src/main/webapp/v4/VideoEditorBundle.js +0 -8
- package/src/legacy/tool-ui/src/main/webapp/v4/ViewMirror.js +0 -52
- package/src/legacy/tool-ui/src/main/webapp/v4/ViewPreview.d.ts +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/ViewPreview.js +0 -177
- package/src/legacy/tool-ui/src/main/webapp/v4/Widget.js +0 -90
- package/src/legacy/tool-ui/src/main/webapp/v4/__mocks__/fileMock.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/__mocks__/styleMock.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/__mocks__/textArea.mock.js +0 -20
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/globals.js +0 -770
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/ProseMirror.test.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/index.html +0 -54
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/comment_manager/CommentManager.test.js +0 -29
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/comment_manager/index.html +0 -35
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/custom_keyboard/CustomKeyboard.js +0 -42
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/custom_keyboard/index.html +0 -37
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/EnhancementManager.test.js +0 -288
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/block.html +0 -38
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/inline.html +0 -38
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/no-popups.html +0 -38
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/list_manager/ListManager.js +0 -257
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/list_manager/index.html +0 -38
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/hierarchal.html +0 -33
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/index.html +0 -33
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/menubar.test.js +0 -195
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/small.html +0 -34
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/tags.html +0 -34
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/PlaceholderManager.test.js +0 -134
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/has-editable-placeholder.html +0 -32
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/has-text.html +0 -34
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/index.html +0 -31
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/table_manager/TableManager.test.js +0 -63
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/table_manager/existing.html +0 -48
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/track_manager/TrackManager.test.js +0 -291
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/track_manager/existing.html +0 -39
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/track_manager/insert.html +0 -37
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/Sortable.test.js +0 -105
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/ProseMirror.test.js +0 -41
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/codemirror-shim.test.js +0 -72
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/collab_manager/CollabManager.test.js +0 -46
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/enhancement_manager/EnhancementManager.test.js +0 -84
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/list_manager/ListManager.test.js +0 -54
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/menubar/menubar.test.js +0 -183
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/spellcheck/SpellCheck.test.js +0 -45
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/settings/BSSerializer.test.js +0 -346
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/settings/menuItemsBuilder.test.js +0 -226
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/utilities.test.js +0 -118
- package/src/legacy/tool-ui/src/main/webapp/v4/appetizeio/Appetizeio.js +0 -5
- package/src/legacy/tool-ui/src/main/webapp/v4/appetizeio/AppetizeioEmbedded.js +0 -113
- package/src/legacy/tool-ui/src/main/webapp/v4/compat/Fetch.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/compat/jquery.js +0 -32
- package/src/legacy/tool-ui/src/main/webapp/v4/compat/requirejs.js +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/Tether.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/TetherLayout.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/closest.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/create.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/find.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/findAll.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/ifClick.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/ifMatches.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/ifUnmodified.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/index.js +0 -5
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/insertBefore.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/insertFirst.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/insertLast.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onFind.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onFindOnce.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onRTEReady.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onRemove.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onVisible.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/previousUntil.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/resolveIconCompat.js +0 -40
- package/src/legacy/tool-ui/src/main/webapp/v4/rtc/Socket.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/rtc/index.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/ProseMirror.js +0 -909
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/README.md +0 -68
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/codemirror-shim.d.ts +0 -8
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/codemirror-shim.js +0 -274
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/collab-workflow.jpeg +0 -0
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/interchangeable.ts +0 -250
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/mention.js +0 -90
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/PluginProvider.js +0 -124
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/README.md +0 -46
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/ai_inline_manager/AIInlineManager.ts +0 -124
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/ai_inline_manager/views/AIInlineView.ts +0 -1019
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/ai_manager/AiManager.ts +0 -199
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/collab_manager/CollabManager.js +0 -339
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/collab_manager/views/AvatarView.js +0 -96
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/comment_manager/CommentManager.js +0 -348
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/custom_keyboard/CustomKeyboard.js +0 -110
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/custom_keyboard/README.md +0 -29
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/EnhancementManager.js +0 -428
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/README.md +0 -63
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/commands.js +0 -690
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/constants.js +0 -12
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/enhancement-creation.jpeg +0 -0
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/index.js +0 -15
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/rte-flow.jpeg +0 -0
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/ActionButtonView.js +0 -86
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/BlockSubmenuView.js +0 -60
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/EnhancementView.js +0 -208
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/PreviewView.js +0 -102
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/SubmenuView.js +0 -365
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/find_replace_manager/FindReplaceManager.js +0 -239
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/find_replace_manager/views/FindView.js +0 -604
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/FullscreenManager.js +0 -57
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/README.md +0 -26
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/commands.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/index.js +0 -4
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/views/FullscreenView.js +0 -474
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/html_editor_manager/htmlEditorManager.js +0 -66
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/html_editor_manager/views/HtmlEditorView.js +0 -97
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/ListManager.js +0 -342
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/README.md +0 -50
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/commands.js +0 -207
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/constants.js +0 -26
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/index.js +0 -4
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/menubar/Menubar.js +0 -485
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/menubar/README.md +0 -40
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/menubar/views/MenuView.js +0 -842
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/paste_manager/PasteManager.js +0 -368
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/placeholder_manager/PlaceHolderManager.js +0 -128
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/raw_text_manager/README.md +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/raw_text_manager/RawTextManager.js +0 -96
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/spellcheck/index.js +0 -3
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/spellcheck/spellcheck-plugin.js +0 -280
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/spellcheck/spellcheck-service.js +0 -94
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/TableManager.js +0 -57
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/commands.js +0 -97
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/views/TableSizerView.js +0 -88
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/views/TableView.js +0 -613
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/track_manager/README.md +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/track_manager/TrackManager.js +0 -905
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/BSSerializer.js +0 -819
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/README.md +0 -80
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/commands.js +0 -98
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/constants.d.ts +0 -84
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/constants.js +0 -87
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/index.js +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/keymapBuilder.js +0 -223
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/menuItemsBuilder.js +0 -559
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/schemaBuilder.js +0 -1281
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/utilities.d.ts +0 -4
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/utilities.js +0 -359
- package/src/legacy/tool-ui/src/main/webapp/v4/theme/ColorRotator.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/debounce.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/getComponentKey.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/noise.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/repaint.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/storage.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/throttle.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/AssignmentContent.js +0 -33
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/AssignmentDeskDashboard.js +0 -217
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/AssociatedContentWidget.js +0 -7
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/BulkUpload.js +0 -19
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/Calendar.js +0 -7
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/ClosableWindow.js +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/PitchAssignments.js +0 -25
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/PitchContent.js +0 -33
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/Revisions.js +0 -61
|
@@ -1,485 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-debugger */
|
|
2
|
-
import { Plugin, PluginKey } from 'prosemirror-state'
|
|
3
|
-
import { MenuView } from './views/MenuView'
|
|
4
|
-
import { getActiveMarks, getActiveNodes } from '../../utilities'
|
|
5
|
-
import debounce from '../../../util/debounce'
|
|
6
|
-
import create from '../../../dom/create'
|
|
7
|
-
|
|
8
|
-
const key = new PluginKey('menubar')
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* @param {*} state
|
|
13
|
-
*/
|
|
14
|
-
const getCompatibleActions = (state) => {
|
|
15
|
-
const actions = state.plugins
|
|
16
|
-
.filter((plugin) => {
|
|
17
|
-
return (
|
|
18
|
-
plugin.getState(state) &&
|
|
19
|
-
plugin.getState(state).has !== void 0 &&
|
|
20
|
-
plugin.getState(state).has('compatibleActions')
|
|
21
|
-
)
|
|
22
|
-
})
|
|
23
|
-
.map((plugin) => {
|
|
24
|
-
return plugin.getState(state).get('compatibleActions')
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
return new Map(...actions)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const getMetaData = (state) => {
|
|
31
|
-
let map = new Map()
|
|
32
|
-
const metaData = state.plugins
|
|
33
|
-
.filter((plugin) => {
|
|
34
|
-
return (
|
|
35
|
-
plugin.getState(state) &&
|
|
36
|
-
plugin.getState(state).has !== void 0 &&
|
|
37
|
-
plugin.getState(state).has('metaData')
|
|
38
|
-
)
|
|
39
|
-
})
|
|
40
|
-
.map((plugin) => {
|
|
41
|
-
return plugin.getState(state).get('metaData')
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
metaData.forEach((data) => {
|
|
45
|
-
map = new Map([...map, ...data])
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
return map
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @param {*} state
|
|
54
|
-
*/
|
|
55
|
-
const getActiveStates = (state) => {
|
|
56
|
-
let map = new Map()
|
|
57
|
-
const actions = state.plugins
|
|
58
|
-
.filter((plugin) => {
|
|
59
|
-
return (
|
|
60
|
-
plugin.getState(state) &&
|
|
61
|
-
plugin.getState(state).has !== void 0 &&
|
|
62
|
-
plugin.getState(state).has('activeStates')
|
|
63
|
-
)
|
|
64
|
-
})
|
|
65
|
-
.map((plugin) => {
|
|
66
|
-
return plugin.getState(state).get('activeStates')
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
actions.forEach((action) => {
|
|
70
|
-
map = new Map([...map, ...action])
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
return map
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
78
|
-
* @param {*} state
|
|
79
|
-
*/
|
|
80
|
-
const getDisabledStates = (state) => {
|
|
81
|
-
let map = new Map()
|
|
82
|
-
const actions = state.plugins
|
|
83
|
-
.filter((plugin) => {
|
|
84
|
-
return (
|
|
85
|
-
plugin.getState(state) &&
|
|
86
|
-
plugin.getState(state).has !== void 0 &&
|
|
87
|
-
plugin.getState(state).has('disabledStates')
|
|
88
|
-
)
|
|
89
|
-
})
|
|
90
|
-
.map((plugin) => {
|
|
91
|
-
return plugin.getState(state).get('disabledStates')
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
actions.forEach((action) => {
|
|
95
|
-
map = new Map([...map, ...action])
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
return map
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
*
|
|
103
|
-
* @param {*} state
|
|
104
|
-
*/
|
|
105
|
-
const getCompatibleNodes = (state) => {
|
|
106
|
-
let map = new Map()
|
|
107
|
-
const nodes = state.plugins
|
|
108
|
-
.filter((plugin) => {
|
|
109
|
-
return (
|
|
110
|
-
plugin.getState(state) &&
|
|
111
|
-
plugin.getState(state).has !== void 0 &&
|
|
112
|
-
plugin.getState(state).has('compatibleNodes')
|
|
113
|
-
)
|
|
114
|
-
})
|
|
115
|
-
.map((plugin) => {
|
|
116
|
-
return plugin.getState(state).get('compatibleNodes')
|
|
117
|
-
})
|
|
118
|
-
|
|
119
|
-
nodes.forEach((node) => {
|
|
120
|
-
map = new Map([...map, ...node])
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
return map
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Plugin state represented as a Map. Currently only keeping track
|
|
128
|
-
* of the active states of menu items.
|
|
129
|
-
*
|
|
130
|
-
* @param {Object} menuItems Configuration object mapping menu items
|
|
131
|
-
* to commands and the text that should appear in the menubar
|
|
132
|
-
* @param {Map} activeMarks Map of active marks
|
|
133
|
-
* @return {Map} Plugin state represented as a Map
|
|
134
|
-
*/
|
|
135
|
-
const getNewStateMap = (
|
|
136
|
-
menuItems,
|
|
137
|
-
activeMarks,
|
|
138
|
-
activeNodes,
|
|
139
|
-
compatibleNodes,
|
|
140
|
-
compatibleActions,
|
|
141
|
-
activeStates,
|
|
142
|
-
disabledStates,
|
|
143
|
-
metaData,
|
|
144
|
-
parent,
|
|
145
|
-
hasChange,
|
|
146
|
-
) => {
|
|
147
|
-
const state = new Map()
|
|
148
|
-
state.set('menuItems', new Map(Object.entries(menuItems)))
|
|
149
|
-
state.set('activeMarks', activeMarks)
|
|
150
|
-
state.set('activeNodes', activeNodes)
|
|
151
|
-
state.set('compatibleNodes', compatibleNodes)
|
|
152
|
-
state.set('compatibleActions', compatibleActions)
|
|
153
|
-
state.set('activeStates', activeStates)
|
|
154
|
-
state.set('disabledStates', disabledStates)
|
|
155
|
-
state.set('metaData', metaData)
|
|
156
|
-
state.set('parent', parent)
|
|
157
|
-
state.set('hasChange', hasChange)
|
|
158
|
-
return state
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Tests if 2 maps are equal.
|
|
163
|
-
*
|
|
164
|
-
* @param {Map} map1
|
|
165
|
-
* @param {Map} map2
|
|
166
|
-
*/
|
|
167
|
-
const isEqual = (map1, map2) => {
|
|
168
|
-
let testVal
|
|
169
|
-
if (map1.size !== map2.size) {
|
|
170
|
-
return false
|
|
171
|
-
}
|
|
172
|
-
for (var [key, val] of map1) {
|
|
173
|
-
testVal = map2.get(key)
|
|
174
|
-
if (testVal !== val || (testVal === undefined && !map2.has(key))) {
|
|
175
|
-
return false
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
return true
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Extends Prosemirror to include a menubar with menu items for decorating
|
|
183
|
-
* content in the RTE (e.g. making text bold). It keeps track of active marks
|
|
184
|
-
* and active nodes.
|
|
185
|
-
*
|
|
186
|
-
* This can be used as is, or the menu bar view and/or the menu items
|
|
187
|
-
* configuation could be customized to fit a project's needs and the plugin
|
|
188
|
-
* behavior will remain the same.
|
|
189
|
-
*
|
|
190
|
-
* Plugin itself manages its own state and updates itself when a transaction is
|
|
191
|
-
* dispatched based on the new state produced by the transaction. Every transaction creates
|
|
192
|
-
* a new state, per Prosemirror best practices to keep the transaction history immutable.
|
|
193
|
-
* Plugin state is maintained in the EditorState as a field and can be accessed
|
|
194
|
-
* from anywhere within the app that can access the EditorState using its key `menubar`.
|
|
195
|
-
*
|
|
196
|
-
* When a dispatch triggers the plugin state's update method to run, the state
|
|
197
|
-
* will be updated the active marks, which will trigger the view's update method
|
|
198
|
-
* and the view will re-render with the new state. Active state of the menu items
|
|
199
|
-
* is not determined by what event that just happened but rather by what state the
|
|
200
|
-
* editor is in: If the current selection has a mark, then its corresponding menu
|
|
201
|
-
* icon with be active and vice versa.
|
|
202
|
-
*
|
|
203
|
-
* @param {Object} menuItems Configuration object mapping menu items
|
|
204
|
-
* to commands and the text that should appear in the menubar. Used
|
|
205
|
-
* to create the initial state of the menubar.
|
|
206
|
-
*/
|
|
207
|
-
const menuPlugin = (menuItems) => {
|
|
208
|
-
return new Plugin({
|
|
209
|
-
key,
|
|
210
|
-
|
|
211
|
-
view(editorView) {
|
|
212
|
-
let toolbarView = new MenuView(editorView, this.key.key)
|
|
213
|
-
let menuBar = editorView.dom.parentNode.querySelector(
|
|
214
|
-
'.ProseMirrorToolbar',
|
|
215
|
-
)
|
|
216
|
-
menuBar.appendChild(toolbarView.dom)
|
|
217
|
-
|
|
218
|
-
const toolbarWrapper = toolbarView.dom.parentElement
|
|
219
|
-
|
|
220
|
-
toolbarView.dom.addEventListener('btu-toolbar-overflow-found', (e) => {
|
|
221
|
-
const overflowItems = e.detail
|
|
222
|
-
overflowItems.items.filter((item) => {
|
|
223
|
-
if (item.classList.contains('is-open')) {
|
|
224
|
-
item.click()
|
|
225
|
-
}
|
|
226
|
-
})
|
|
227
|
-
toolbarView.onOverflowUpdate(overflowItems)
|
|
228
|
-
})
|
|
229
|
-
|
|
230
|
-
const doOverflow = () => {
|
|
231
|
-
toolbarView.dom.querySelectorAll('.rte-overflow-btn').forEach((el) => {
|
|
232
|
-
el.remove()
|
|
233
|
-
})
|
|
234
|
-
getOverflow()
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
toolbarView.dom.addEventListener('btu-toolbar-update', (e) => {
|
|
238
|
-
handleOverflowDebounced()
|
|
239
|
-
})
|
|
240
|
-
|
|
241
|
-
const ignoredByOverflow = (el) => {
|
|
242
|
-
return (
|
|
243
|
-
el.dataset.rteStyle === 'rte2-toolbar-ai-inline' ||
|
|
244
|
-
el.classList.contains('rte-overflow-btn') ||
|
|
245
|
-
el.dataset.rteStyle === 'rte2-toolbar-find' ||
|
|
246
|
-
el.dataset.rteStyle === 'rte2-toolbar-fullscreen' ||
|
|
247
|
-
el.dataset.rteStyle?.startsWith('com-psddev-indesign') ||
|
|
248
|
-
el.querySelector(':scope > a.outOfContext') ||
|
|
249
|
-
!el.checkVisibility({ visibilityProperty: true }) ||
|
|
250
|
-
(el.querySelector(':scope > a.rte2-toolbar-noicon') &&
|
|
251
|
-
el.querySelector(':scope > a')?.innerText === '')
|
|
252
|
-
)
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/*
|
|
256
|
-
Returns the items that overflow the toolbar and the target item to insert the overflow button before.
|
|
257
|
-
*/
|
|
258
|
-
const getOverflow = () => {
|
|
259
|
-
const toolbar = toolbarView.dom
|
|
260
|
-
const toolbarRow = toolbar.closest('.ProseMirrorToolbar')
|
|
261
|
-
const actions = toolbar.querySelectorAll(
|
|
262
|
-
':scope > li:not(.rte2-toolbar-submenu-horizontal, [data-rte-style="rte2-toolbar-fullscreen"], [data-rte-style="rte2-toolbar-find"])',
|
|
263
|
-
)
|
|
264
|
-
|
|
265
|
-
// Batch DOM reads and writes to avoid layout thrashing
|
|
266
|
-
// READ: Check if cover offset exists
|
|
267
|
-
const hasCoverOffset =
|
|
268
|
-
toolbarWrapper.style.getPropertyValue('--cover-offset-x')
|
|
269
|
-
|
|
270
|
-
// WRITE: Update classes based on read
|
|
271
|
-
toolbar.classList.remove('coverIntro', 'coverOutro')
|
|
272
|
-
if (!hasCoverOffset) {
|
|
273
|
-
toolbar.classList.add('coverIntro')
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
// Opportunities to overflow are after separators.
|
|
277
|
-
let overflowBreaks = toolbar.querySelectorAll(
|
|
278
|
-
':scope li.rte2-toolbar-separator + :has(~ li)',
|
|
279
|
-
)
|
|
280
|
-
|
|
281
|
-
// When no separators are found, overflow can happen at each item.
|
|
282
|
-
if (!overflowBreaks.length) {
|
|
283
|
-
overflowBreaks = actions
|
|
284
|
-
} else {
|
|
285
|
-
// If separators are present, overflow can also occur at actions that precede the first separator.
|
|
286
|
-
// This ensures overflow button still appears in a narrow RTE container.
|
|
287
|
-
const firstActions = []
|
|
288
|
-
for (const action of actions) {
|
|
289
|
-
if (action.matches('.rte2-toolbar-separator')) {
|
|
290
|
-
break
|
|
291
|
-
} else {
|
|
292
|
-
firstActions.push(action)
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
overflowBreaks = [...firstActions, ...overflowBreaks]
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// Use IntersectionObserver to determine which actions fit into first row of toolbar
|
|
299
|
-
// so that overflow menu button's position (if applicable) is correct.
|
|
300
|
-
const observer = new IntersectionObserver(
|
|
301
|
-
(changes) => {
|
|
302
|
-
let latestBreak = null
|
|
303
|
-
let offsetInline
|
|
304
|
-
|
|
305
|
-
let firstRowActionsCt = 0
|
|
306
|
-
let latestBreakIndex = 0
|
|
307
|
-
let totalActionsCt = 0
|
|
308
|
-
|
|
309
|
-
for (const change of changes) {
|
|
310
|
-
// Find last non-wrapping action where overflow button can be inserted.
|
|
311
|
-
if (change.isIntersecting) {
|
|
312
|
-
const currentIndex = Array.from(actions).indexOf(change.target)
|
|
313
|
-
if (currentIndex >= latestBreakIndex) {
|
|
314
|
-
latestBreak = change.target
|
|
315
|
-
latestBreakIndex = currentIndex
|
|
316
|
-
}
|
|
317
|
-
firstRowActionsCt++
|
|
318
|
-
}
|
|
319
|
-
totalActionsCt++
|
|
320
|
-
|
|
321
|
-
// After all toolbar actions are observed, dispatch event indicating overflow position.
|
|
322
|
-
if (totalActionsCt === overflowBreaks.length) {
|
|
323
|
-
observer.disconnect()
|
|
324
|
-
overflowBreaks.forEach((item) => delete item.dataset.isObserved)
|
|
325
|
-
|
|
326
|
-
const noOverflow = firstRowActionsCt === totalActionsCt
|
|
327
|
-
|
|
328
|
-
// Batch layout reads and writes using RAF to avoid layout thrashing
|
|
329
|
-
requestAnimationFrame(() => {
|
|
330
|
-
// READ PHASE: Batch all layout reads together
|
|
331
|
-
if (noOverflow || !latestBreak) {
|
|
332
|
-
offsetInline = -1
|
|
333
|
-
} else if (
|
|
334
|
-
document.documentElement.getAttribute('dir') === 'rtl'
|
|
335
|
-
) {
|
|
336
|
-
offsetInline =
|
|
337
|
-
latestBreak.offsetParent.offsetWidth -
|
|
338
|
-
latestBreak.offsetLeft -
|
|
339
|
-
latestBreak.offsetWidth
|
|
340
|
-
} else {
|
|
341
|
-
offsetInline = latestBreak.offsetLeft
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
// Calculate overflowed items
|
|
345
|
-
let overflowedItems = []
|
|
346
|
-
let insertionTarget = null
|
|
347
|
-
|
|
348
|
-
if (!noOverflow && latestBreak) {
|
|
349
|
-
overflowedItems = [...actions]
|
|
350
|
-
.splice(latestBreakIndex)
|
|
351
|
-
.filter((item) => !ignoredByOverflow(item))
|
|
352
|
-
insertionTarget = latestBreak
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
// WRITE PHASE: Batch all DOM updates in next frame
|
|
356
|
-
requestAnimationFrame(() => {
|
|
357
|
-
// Cover up overflowed items
|
|
358
|
-
toolbarWrapper.style.setProperty(
|
|
359
|
-
'--cover-offset-x',
|
|
360
|
-
offsetInline > 0 ? offsetInline + 'px' : null,
|
|
361
|
-
)
|
|
362
|
-
|
|
363
|
-
// Dispatch event with overflow data
|
|
364
|
-
toolbar.dispatchEvent(
|
|
365
|
-
new CustomEvent('btu-toolbar-overflow-found', {
|
|
366
|
-
detail: {
|
|
367
|
-
items: overflowedItems,
|
|
368
|
-
target: insertionTarget,
|
|
369
|
-
},
|
|
370
|
-
}),
|
|
371
|
-
)
|
|
372
|
-
})
|
|
373
|
-
})
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
{ root: toolbarRow },
|
|
378
|
-
)
|
|
379
|
-
|
|
380
|
-
for (const item of overflowBreaks) {
|
|
381
|
-
if (item.dataset.isObserved) return
|
|
382
|
-
item.dataset.isObserved = 'true'
|
|
383
|
-
observer.observe(item)
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
const handleOverflowDebounced = debounce(200, () => {
|
|
388
|
-
doOverflow()
|
|
389
|
-
})
|
|
390
|
-
|
|
391
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
392
|
-
for (const entry of entries) {
|
|
393
|
-
handleOverflowDebounced()
|
|
394
|
-
}
|
|
395
|
-
})
|
|
396
|
-
|
|
397
|
-
const submenu = document.createElement('div')
|
|
398
|
-
submenu.className = 'ProseMirrorToolbar-horizontalSubmenu'
|
|
399
|
-
menuBar.appendChild(submenu)
|
|
400
|
-
resizeObserver.observe(toolbarWrapper)
|
|
401
|
-
return toolbarView
|
|
402
|
-
},
|
|
403
|
-
|
|
404
|
-
state: {
|
|
405
|
-
init(config) {
|
|
406
|
-
const activeMarks = new Map()
|
|
407
|
-
const activeNodes = new Map()
|
|
408
|
-
const compatibleNodes = new Map()
|
|
409
|
-
const compatibleActions = new Map()
|
|
410
|
-
const activeStates = new Map()
|
|
411
|
-
const disabledStates = new Map()
|
|
412
|
-
const metaData = new Map()
|
|
413
|
-
const parent = null
|
|
414
|
-
const hasChange = true
|
|
415
|
-
return getNewStateMap(
|
|
416
|
-
menuItems,
|
|
417
|
-
activeMarks,
|
|
418
|
-
activeNodes,
|
|
419
|
-
compatibleNodes,
|
|
420
|
-
compatibleActions,
|
|
421
|
-
activeStates,
|
|
422
|
-
disabledStates,
|
|
423
|
-
metaData,
|
|
424
|
-
parent,
|
|
425
|
-
hasChange,
|
|
426
|
-
)
|
|
427
|
-
},
|
|
428
|
-
|
|
429
|
-
apply(transaction, value, oldState, newState) {
|
|
430
|
-
const activeMarks = getActiveMarks(newState)
|
|
431
|
-
const activeNodes = getActiveNodes(newState)
|
|
432
|
-
const compatibleNodes = getCompatibleNodes(newState)
|
|
433
|
-
const compatibleActions = getCompatibleActions(newState)
|
|
434
|
-
const activeStates = getActiveStates(newState)
|
|
435
|
-
const disabledStates = getDisabledStates(newState)
|
|
436
|
-
const metaData = getMetaData(newState)
|
|
437
|
-
const parent = newState.selection.$anchor.parent
|
|
438
|
-
let hasChange
|
|
439
|
-
|
|
440
|
-
hasChange = value.get('parent') === parent
|
|
441
|
-
|
|
442
|
-
if (!hasChange) {
|
|
443
|
-
const maps = [
|
|
444
|
-
activeMarks,
|
|
445
|
-
activeNodes,
|
|
446
|
-
compatibleNodes,
|
|
447
|
-
compatibleActions,
|
|
448
|
-
activeStates,
|
|
449
|
-
disabledStates,
|
|
450
|
-
metaData,
|
|
451
|
-
]
|
|
452
|
-
const mapsOld = [
|
|
453
|
-
value.get('activeMarks'),
|
|
454
|
-
value.get('activeNodes'),
|
|
455
|
-
value.get('compatibleNodes'),
|
|
456
|
-
value.get('compatibleActions'),
|
|
457
|
-
value.get('activeStates'),
|
|
458
|
-
value.get('disabledStates'),
|
|
459
|
-
value.get('metaData'),
|
|
460
|
-
]
|
|
461
|
-
hasChange = maps.some((map, index) => {
|
|
462
|
-
return !isEqual(map, mapsOld[index])
|
|
463
|
-
})
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
const newStateMap = getNewStateMap(
|
|
467
|
-
menuItems,
|
|
468
|
-
activeMarks,
|
|
469
|
-
activeNodes,
|
|
470
|
-
compatibleNodes,
|
|
471
|
-
compatibleActions,
|
|
472
|
-
activeStates,
|
|
473
|
-
disabledStates,
|
|
474
|
-
metaData,
|
|
475
|
-
parent,
|
|
476
|
-
hasChange,
|
|
477
|
-
)
|
|
478
|
-
|
|
479
|
-
return newStateMap
|
|
480
|
-
},
|
|
481
|
-
},
|
|
482
|
-
})
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
export { menuPlugin }
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# Brightspot Rich Text Editor Menubar Plugin
|
|
2
|
-
|
|
3
|
-
Extends Prosemirror to include a menubar with menu items for decorating content in the RTE (e.g. making text bold). This can be used as is, or the menu bar view and/or the menu items configuation could be customized to fit a project's needs, and the plugin behavior will remain the same.
|
|
4
|
-
|
|
5
|
-
## Table of Contents
|
|
6
|
-
|
|
7
|
-
1. [Must Knows](#must-knows)
|
|
8
|
-
2. [Usage](#usage)
|
|
9
|
-
3. [Component and Directory Structure](#component-and-directory-structure)
|
|
10
|
-
1. [menubar views](#menubar-views)
|
|
11
|
-
|
|
12
|
-
## Must Knows
|
|
13
|
-
|
|
14
|
-
1. You can swap out the menu items and the menubar views and while you will get a new look, the plugin will still function the same in that it will react to state changes, calculate the new state, and pass on the new plugin state.
|
|
15
|
-
2. You can just swap out the menu items configuration to have an entirely different sent of menu items (you might need to also update your commands then as well).
|
|
16
|
-
3. The menu icons can be styled via setting a class name in the menu items configuration. The class name rule should contain the name
|
|
17
|
-
of the icon to be used (see the Settings ReadMe for more information). Or, the menu icon can be markup that you provide via the configuration. This is useful for when there is not a corresponding icon for an action.
|
|
18
|
-
4. You can create "clusters" of menu icons so that you can group them together via css. A cluster class is applied to the first item marked cluster in the menu configuration.
|
|
19
|
-
5. Nested (1-level) lists are supported. They will convert to a drop-down menu. An example is the custom css styling.
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
1. Because they are a part of configuration for the RTE, the menu items configuration file lives in the `settings` directory. See the ReadMe there for more information on extending the default configuration.
|
|
24
|
-
|
|
25
|
-
## Component and Directory Structure
|
|
26
|
-
|
|
27
|
-
### Menubar Views
|
|
28
|
-
|
|
29
|
-
1. This is where the DOM is built. The views should remain as "dumb" as possible: Any events they capture should be handed off to either a built-in/custom command (which will trigger a transaction dispatch) or dispatch a transaction. It should have an update method that will be fired by Prosemirror when the EditorView state changes and it should re-render its DOM accordingly.
|
|
30
|
-
|
|
31
|
-
**Example**:
|
|
32
|
-
|
|
33
|
-
1. User clicks the Bold menu icon
|
|
34
|
-
2. The icon DOM captures the event and calls the menubar's event handler
|
|
35
|
-
3. The event handler calls the command mapped to that menu item
|
|
36
|
-
4. The command handles updating the EditorView state. In this example, it will update the marks for the selected text in the state object. It will then dispatch the transaction and all listeners (which includes are plugin) will be notifed with the new editorState (along with the transaction).
|
|
37
|
-
5. This triggers the `apply` method we set up in the plugin, which creates a new state based on the new EditorView state. In our case, this updates the `activeMarks` Map that is a member of the plugins `state` Map.
|
|
38
|
-
6. This triggers the `update` method of the view, which can determine if the view should re-render, and if so, triggers the view's render method. The view re-renders using the new `state`. In our case, the `activeMarks` map will indicate that the `bold` mark is active. This property is passed into the menu items builder function and the class of the menu item is derived based on the mark's active state.
|
|
39
|
-
|
|
40
|
-
_Note_: Updating state always means creating a new state derived from the old state + changes. State should always remain immutable.
|