@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
package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/EnhancementManager.js
DELETED
|
@@ -1,428 +0,0 @@
|
|
|
1
|
-
import { PM_CONTEXT_PATH } from './constants'
|
|
2
|
-
import { Plugin, PluginKey, TextSelection } from 'prosemirror-state'
|
|
3
|
-
import { DOMParser } from 'prosemirror-model'
|
|
4
|
-
import { keydownHandler } from 'prosemirror-keymap'
|
|
5
|
-
import { constants } from '../../settings'
|
|
6
|
-
import { Decoration, DecorationSet } from 'prosemirror-view'
|
|
7
|
-
import { setBlockType } from 'prosemirror-commands'
|
|
8
|
-
import { keyMappingHandler } from '../../settings/keymapBuilder'
|
|
9
|
-
import onVisible from '../../../dom/onVisible'
|
|
10
|
-
import { v1 as uuidv1 } from 'uuid'
|
|
11
|
-
|
|
12
|
-
const RICH_TEXT_ELEMENTS_PM_MAP = new Map()
|
|
13
|
-
RICH_TEXT_ELEMENTS_PM.forEach((item) => {
|
|
14
|
-
RICH_TEXT_ELEMENTS_PM_MAP.set(item.tag, item)
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Generates the partial URL for the enhancement form that opens in the popup.
|
|
19
|
-
*
|
|
20
|
-
* @param {string} enhancementID type id of the enhancement, which determines
|
|
21
|
-
* what form is called and opened.
|
|
22
|
-
*/
|
|
23
|
-
const getEnhancementEditFormURL = (
|
|
24
|
-
enhancementID,
|
|
25
|
-
element,
|
|
26
|
-
isCustom,
|
|
27
|
-
customUrl,
|
|
28
|
-
) => {
|
|
29
|
-
const closestElementWithTypeId = element.closest('form[data-type-id]')
|
|
30
|
-
const closestElementWithContainerId = element.closest('form[data-object-id]')
|
|
31
|
-
let containerTypeId = ''
|
|
32
|
-
let containerId = ''
|
|
33
|
-
|
|
34
|
-
if (closestElementWithTypeId) {
|
|
35
|
-
containerTypeId = closestElementWithTypeId.getAttribute('data-type-id')
|
|
36
|
-
}
|
|
37
|
-
if (closestElementWithContainerId) {
|
|
38
|
-
containerId = closestElementWithContainerId.getAttribute('data-object-id')
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (isCustom && customUrl) {
|
|
42
|
-
return `${PM_CONTEXT_PATH}${customUrl}`
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return `${PM_CONTEXT_PATH}content/enhancement.jsp?typeId=${enhancementID}&containerTypeId=${containerTypeId}&containerId=${containerId}`
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Sets up the topic subscription to listen to the topic that triggers the publish
|
|
50
|
-
* function below. See the top of the enhancement.jsp file to find the publish trigger.
|
|
51
|
-
* It is embedded in the java code that produces the JS, which also closes the popup.
|
|
52
|
-
*
|
|
53
|
-
* @param {string} tempId A temp id from the originating command to be used as the topic
|
|
54
|
-
* for the pub/sub triggerded from the enhancement.jsp. We store this on the event trigger
|
|
55
|
-
* because the java-generated JS has access to that DOM element.
|
|
56
|
-
* @param {Object.<string>} meta
|
|
57
|
-
* @param {Prosemirror.EditorState} state
|
|
58
|
-
* @param {Prosemirror.EditorView.dispatch} dispatch
|
|
59
|
-
* @param {Event} evt DOM event that triggered the originating command.
|
|
60
|
-
* @param {string} text The text the user entered, in case we don't get back a label.
|
|
61
|
-
* @param {ProseMirror.Node|null} node Node or mark that is being modified during an enhancement
|
|
62
|
-
* edit.
|
|
63
|
-
* @param {boolean} isEdit Flag to indicate if this is an edit to an existing enhancement
|
|
64
|
-
* @param {string} id UUID of the enhancement decoration
|
|
65
|
-
* @param {ProseMirror.EditorView} editorView
|
|
66
|
-
*/
|
|
67
|
-
const setUpSubscription = (
|
|
68
|
-
editorView,
|
|
69
|
-
tempId,
|
|
70
|
-
meta,
|
|
71
|
-
state,
|
|
72
|
-
dispatch,
|
|
73
|
-
evt,
|
|
74
|
-
text,
|
|
75
|
-
node,
|
|
76
|
-
isEdit,
|
|
77
|
-
id,
|
|
78
|
-
) => {
|
|
79
|
-
PubSub.subscribe(tempId, (incomingData) => {
|
|
80
|
-
incomingData.meta = meta
|
|
81
|
-
publish(incomingData, dispatch, text, node, isEdit, id, editorView)
|
|
82
|
-
return false
|
|
83
|
-
})
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Sets up and then triggers the frame and its popup
|
|
88
|
-
* popup that will contain the enhancement form.
|
|
89
|
-
*
|
|
90
|
-
* @param {Event} evt DOM event that triggered the originating
|
|
91
|
-
* command. We need this to properly trigger the frame as it's
|
|
92
|
-
* part of the frame API.
|
|
93
|
-
* @param {string} id UUID of the enhancement decoration
|
|
94
|
-
* @param {ProseMirror.EditorView} editorView
|
|
95
|
-
*/
|
|
96
|
-
const setUpAndTriggerFrame = (evt, id, editorView) => {
|
|
97
|
-
if (!evt.target.getAttribute('target')) {
|
|
98
|
-
evt.target.setAttribute('target', `contentEnhancement-${Date.now()}`)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const $eventParent = $(evt.target.parent)
|
|
102
|
-
const $framedParent = $eventParent.frame()
|
|
103
|
-
$framedParent.trigger('create')
|
|
104
|
-
$framedParent.trigger('click.frame')
|
|
105
|
-
onVisible(
|
|
106
|
-
`.Popup[name="${evt.target.getAttribute('target')}"]`,
|
|
107
|
-
(element) => {
|
|
108
|
-
const closeButton = element.querySelector('.Popup-close')
|
|
109
|
-
if (closeButton) {
|
|
110
|
-
closeButton.addEventListener('click', () => {
|
|
111
|
-
PubSub.publish('collabUnlock', { id })
|
|
112
|
-
editorView.focus()
|
|
113
|
-
})
|
|
114
|
-
}
|
|
115
|
-
const saveButton = element.querySelector('.action-save')
|
|
116
|
-
if (saveButton) {
|
|
117
|
-
saveButton.addEventListener('click', () => {
|
|
118
|
-
PubSub.publish('collabUnlock', { id })
|
|
119
|
-
editorView.focus()
|
|
120
|
-
})
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
)
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* This builds the label. It will fall back to the text the user
|
|
128
|
-
* entered (if any) if there is no label. If no label and no text,
|
|
129
|
-
* we will look for an `href` attribute in case this is a link that
|
|
130
|
-
* was created without a label and without any starter text. Otherwise,
|
|
131
|
-
* we get back an empty string.
|
|
132
|
-
*
|
|
133
|
-
* @param {Object.<Object.<string>>} enhancementData The data about the enhancement
|
|
134
|
-
* from the server.
|
|
135
|
-
* @param {string} text The text the user entered.
|
|
136
|
-
* @return {string} The label, derived by what fields are available.
|
|
137
|
-
*/
|
|
138
|
-
const getLabel = (enhancementData, text) => {
|
|
139
|
-
return (
|
|
140
|
-
enhancementData.label ||
|
|
141
|
-
text ||
|
|
142
|
-
(enhancementData.data && enhancementData.data.href) ||
|
|
143
|
-
''
|
|
144
|
-
)
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* This is triggered when a subscription is published from the enhancement.jsp.
|
|
149
|
-
* See the top of the enhancement.jsp file to find the publish trigger. It is embedded in
|
|
150
|
-
* the java code that produces the JS, which also closes the popup. The enhancement
|
|
151
|
-
* data includes the `label`, which is the contract between the back and front-ends for
|
|
152
|
-
* the text that is displayed for an enhancement. All data needed to save and display
|
|
153
|
-
* the enhancement is in the enhancement data. In addition, the meta data for the enhancement
|
|
154
|
-
* is included in the enhancementData object so that the enhancement has it readily
|
|
155
|
-
* available for when the user edits the enhancement.
|
|
156
|
-
*
|
|
157
|
-
* @param {Object.<string|number|Array|Object>} enhancementData The data returned from
|
|
158
|
-
* the server upon sucessful save.
|
|
159
|
-
* @param {Prosemirror.EditorState} state
|
|
160
|
-
* @param {Prosemirror.EditorView.dispatch} dispatch Announces a transaction
|
|
161
|
-
* This method is bound to the view instance, so that it can be easily passed around.
|
|
162
|
-
* @param {string} text The text the user entered, in case we don't get back a label.
|
|
163
|
-
* @param {ProseMirror.Node|null} node Node or mark that is being modified during an enhancement
|
|
164
|
-
* edit.
|
|
165
|
-
* @param {boolean} isEdit Flag to indicate if this is an edit to an existing enhancement
|
|
166
|
-
* @param {string} id UUID of the enhancement decoration
|
|
167
|
-
* @param {ProseMirror.EditorView} editorView
|
|
168
|
-
*/
|
|
169
|
-
const publish = (
|
|
170
|
-
enhancementData,
|
|
171
|
-
dispatch,
|
|
172
|
-
text,
|
|
173
|
-
node,
|
|
174
|
-
isEdit,
|
|
175
|
-
id,
|
|
176
|
-
editorView,
|
|
177
|
-
) => {
|
|
178
|
-
let state = editorView.state
|
|
179
|
-
let transaction = state.tr
|
|
180
|
-
let from
|
|
181
|
-
|
|
182
|
-
if (node?.attrs?.id) {
|
|
183
|
-
const doc = state.doc
|
|
184
|
-
let to
|
|
185
|
-
|
|
186
|
-
doc.descendants((n, p) => {
|
|
187
|
-
if (
|
|
188
|
-
n.attrs.id === node.attrs.id ||
|
|
189
|
-
n.marks.some((mark) => mark.attrs.id === node.attrs.id)
|
|
190
|
-
) {
|
|
191
|
-
if (!from) {
|
|
192
|
-
from = p
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
to = p + n.nodeSize
|
|
196
|
-
}
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
transaction.setSelection(TextSelection.create(doc, from, to))
|
|
200
|
-
} else {
|
|
201
|
-
from = state.selection.from
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
const { empty, ranges, $anchor } = state.selection
|
|
205
|
-
|
|
206
|
-
let label = getLabel(enhancementData, text)
|
|
207
|
-
if (enhancementData.meta.line && !enhancementData.meta.readOnly) {
|
|
208
|
-
const node = state.doc.nodeAt($anchor.before($anchor.depth))
|
|
209
|
-
if (node) {
|
|
210
|
-
label = node.textContent ? node.textContent : label
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
const schema = state.config.schema
|
|
214
|
-
|
|
215
|
-
let enhancement
|
|
216
|
-
let pos = findPlaceholder(editorView, id)
|
|
217
|
-
if (pos == null) return
|
|
218
|
-
const nodeId = isEdit ? node.attrs.id : `enhancement-${uuidv1()}`
|
|
219
|
-
|
|
220
|
-
if (Array.isArray(enhancementData)) {
|
|
221
|
-
enhancementData.forEach((enhancement, index) => {
|
|
222
|
-
let tag = enhancementData.meta.tag
|
|
223
|
-
if (enhancement.tag) {
|
|
224
|
-
enhancement.meta = RICH_TEXT_ELEMENTS_PM_MAP.get(enhancement.tag)
|
|
225
|
-
tag = enhancement.tag
|
|
226
|
-
}
|
|
227
|
-
const enhancementType = schema.nodes[tag]
|
|
228
|
-
enhancement = enhancementType.create({
|
|
229
|
-
label,
|
|
230
|
-
attributes: enhancement.data,
|
|
231
|
-
typeId: enhancement.enhancementID,
|
|
232
|
-
meta: enhancement.meta,
|
|
233
|
-
id: nodeId,
|
|
234
|
-
})
|
|
235
|
-
|
|
236
|
-
transaction.insert(pos.from + index, enhancement)
|
|
237
|
-
})
|
|
238
|
-
} else {
|
|
239
|
-
let tag = enhancementData.meta.tag
|
|
240
|
-
if (enhancementData.tag) {
|
|
241
|
-
enhancementData.meta = RICH_TEXT_ELEMENTS_PM_MAP.get(enhancementData.tag)
|
|
242
|
-
tag = enhancementData.tag
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
if (enhancementData.meta.readOnly || enhancementData.meta.line) {
|
|
246
|
-
const enhancementType = schema.nodes[tag]
|
|
247
|
-
if (enhancementData.meta.readOnly) {
|
|
248
|
-
const enhancementType = schema.nodes[tag]
|
|
249
|
-
|
|
250
|
-
enhancement = enhancementType.create({
|
|
251
|
-
label,
|
|
252
|
-
attributes: enhancementData.data,
|
|
253
|
-
typeId: enhancementData.enhancementID,
|
|
254
|
-
meta: enhancementData.meta,
|
|
255
|
-
id: nodeId,
|
|
256
|
-
})
|
|
257
|
-
|
|
258
|
-
transaction.replaceRangeWith(pos.from, pos.to, enhancement)
|
|
259
|
-
} else {
|
|
260
|
-
setBlockType(enhancementType, {
|
|
261
|
-
label,
|
|
262
|
-
attributes: enhancementData.data,
|
|
263
|
-
typeId: enhancementData.enhancementID,
|
|
264
|
-
meta: enhancementData.meta,
|
|
265
|
-
id: nodeId,
|
|
266
|
-
})(state, dispatch)
|
|
267
|
-
state = editorView.state
|
|
268
|
-
transaction = state.tr
|
|
269
|
-
|
|
270
|
-
if (
|
|
271
|
-
!isEdit &&
|
|
272
|
-
state.selection.empty &&
|
|
273
|
-
enhancementData?.meta?.initialBody
|
|
274
|
-
) {
|
|
275
|
-
transaction.insert(
|
|
276
|
-
from,
|
|
277
|
-
state.schema.text(enhancementData.meta.initialBody),
|
|
278
|
-
)
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
} else {
|
|
282
|
-
const mark = schema.marks[enhancementData.meta.tag].create({
|
|
283
|
-
label,
|
|
284
|
-
attributes: enhancementData.data,
|
|
285
|
-
typeId: enhancementData.enhancementID,
|
|
286
|
-
meta: enhancementData.meta,
|
|
287
|
-
id: nodeId,
|
|
288
|
-
})
|
|
289
|
-
const domFragment = document.createElement('div')
|
|
290
|
-
domFragment.innerHTML = label || ''
|
|
291
|
-
const slice = DOMParser.fromSchema(state.schema).parseSlice(domFragment, {
|
|
292
|
-
preserveWhitespace: 'full',
|
|
293
|
-
})
|
|
294
|
-
|
|
295
|
-
// ProseMirror select all will start at 0 while text selection will start at 1.
|
|
296
|
-
const to = from + slice.size + (from === 0 ? 1 : 0)
|
|
297
|
-
|
|
298
|
-
transaction.replaceSelection(slice).addMark(from, to, mark)
|
|
299
|
-
transaction.setSelection(TextSelection.create(transaction.doc, from, to))
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
transaction.setMeta('enhancementManager$', {
|
|
303
|
-
remove: { id },
|
|
304
|
-
})
|
|
305
|
-
|
|
306
|
-
if (
|
|
307
|
-
editorView.dom.parentElement.classList.contains(
|
|
308
|
-
constants.CLASSES.IS_PLACEHOLDER_CONTENT,
|
|
309
|
-
)
|
|
310
|
-
) {
|
|
311
|
-
editorView.dom.parentElement.classList.remove(
|
|
312
|
-
constants.CLASSES.IS_PLACEHOLDER_CONTENT,
|
|
313
|
-
)
|
|
314
|
-
}
|
|
315
|
-
dispatch(transaction.scrollIntoView())
|
|
316
|
-
return true
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* @type {Object.<function>} Mapping of command keys to the function
|
|
321
|
-
* to trigger the insert enhancement command.
|
|
322
|
-
*/
|
|
323
|
-
const keyHandlers = RICH_TEXT_ELEMENTS_PM.reduce((prev, next) => {
|
|
324
|
-
if (next.keymap) {
|
|
325
|
-
const className = next.styleName
|
|
326
|
-
next.keymap.forEach((str) => {
|
|
327
|
-
// PM will expect the shift key to be engaged if the item is capitalized,
|
|
328
|
-
// and many of our key commands are capitalized but do not intend to
|
|
329
|
-
// require the shift key
|
|
330
|
-
prev[str.toLowerCase()] = keyMappingHandler(className)
|
|
331
|
-
})
|
|
332
|
-
}
|
|
333
|
-
return prev
|
|
334
|
-
}, {})
|
|
335
|
-
|
|
336
|
-
const handleKeyDown = keydownHandler(keyHandlers)
|
|
337
|
-
|
|
338
|
-
const key = new PluginKey('enhancementManager')
|
|
339
|
-
|
|
340
|
-
const enhancementManagerPlugin = (ctx, compliantTagNameMap) => {
|
|
341
|
-
return new Plugin({
|
|
342
|
-
key,
|
|
343
|
-
state: {
|
|
344
|
-
init() {
|
|
345
|
-
return DecorationSet.empty
|
|
346
|
-
},
|
|
347
|
-
apply(tr, set, state) {
|
|
348
|
-
// Adjust decoration positions to changes made by the transaction
|
|
349
|
-
set = set.map(tr.mapping, tr.doc)
|
|
350
|
-
let action = tr.getMeta(this)
|
|
351
|
-
let deco
|
|
352
|
-
|
|
353
|
-
if (action && action.add) {
|
|
354
|
-
if (action.add.to) {
|
|
355
|
-
deco = Decoration.inline(
|
|
356
|
-
action.add.from,
|
|
357
|
-
action.add.to,
|
|
358
|
-
{ class: 'Prosemirror-placeholder' },
|
|
359
|
-
{
|
|
360
|
-
id: action.add.id,
|
|
361
|
-
},
|
|
362
|
-
)
|
|
363
|
-
} else {
|
|
364
|
-
const widget = document.createElement('placeholder')
|
|
365
|
-
deco = Decoration.widget(action.add.from, widget, {
|
|
366
|
-
side: -1,
|
|
367
|
-
id: action.add.id,
|
|
368
|
-
})
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
set = set.add(tr.doc, [deco])
|
|
372
|
-
} else if (action && action.remove) {
|
|
373
|
-
set = set.remove(
|
|
374
|
-
set.find(null, null, (spec) => spec.id === action.remove.id),
|
|
375
|
-
)
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
return set
|
|
379
|
-
},
|
|
380
|
-
},
|
|
381
|
-
view: (view) => {
|
|
382
|
-
return {
|
|
383
|
-
update: (editorView, prevState) => {
|
|
384
|
-
const currNode = editorView.state.tr?.curSelection?.node
|
|
385
|
-
|
|
386
|
-
editorView.dom
|
|
387
|
-
.querySelectorAll('.is-active')
|
|
388
|
-
.forEach((n) => n.classList.remove('is-active'))
|
|
389
|
-
|
|
390
|
-
if (currNode && currNode?.type?.isAtom) {
|
|
391
|
-
editorView
|
|
392
|
-
.nodeDOM(editorView.state.tr?.curSelection.from)
|
|
393
|
-
?.classList.add('is-active')
|
|
394
|
-
}
|
|
395
|
-
},
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
props: {
|
|
399
|
-
decorations(state) {
|
|
400
|
-
return this.getState(state)
|
|
401
|
-
},
|
|
402
|
-
handleKeyDown,
|
|
403
|
-
},
|
|
404
|
-
})
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* Helper function to find the placeholder decoration that has a spec
|
|
409
|
-
* that provides the current position of the decoration (and thus where
|
|
410
|
-
* to insert the pasted text).
|
|
411
|
-
*
|
|
412
|
-
* @param {ProseMirror.EditorView} view
|
|
413
|
-
* @param {string} id The ID of the plugin that we want to find.
|
|
414
|
-
* @return {number|null} The current position of the decoration or null
|
|
415
|
-
* if the decoration was not found.
|
|
416
|
-
*/
|
|
417
|
-
function findPlaceholder(view, id) {
|
|
418
|
-
let decos = enhancementManagerPlugin().getState(view.state)
|
|
419
|
-
let found = decos.find(null, null, (spec) => spec.id === id)
|
|
420
|
-
return found.length ? found[0] : null
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
export {
|
|
424
|
-
enhancementManagerPlugin,
|
|
425
|
-
getEnhancementEditFormURL,
|
|
426
|
-
setUpSubscription,
|
|
427
|
-
setUpAndTriggerFrame,
|
|
428
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# Brightspot Rich Text Editor Enhancement Manager Plugin
|
|
2
|
-
|
|
3
|
-
Extends Prosemirror to allow users to create custom enhancements.
|
|
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. [Commands](#commands)
|
|
11
|
-
2. [Constants](#constants)
|
|
12
|
-
|
|
13
|
-
## Must Knows
|
|
14
|
-
|
|
15
|
-
1. Enhancements are defined in the schema and the serializer as either nodes or marks, depending on the properties of the enhancement. They are further distinguished by their read-only (not editable), popup (has fields), and line (is block) properties. Enhancements fall into these categories and much of the code forking follows this pattern:
|
|
16
|
-
|
|
17
|
-
- **Editable (!readOnly)**
|
|
18
|
-
- Inline with popup: mark with attrs (e.g link)
|
|
19
|
-
- Line with popup: node with attrs
|
|
20
|
-
- Inline with no popup - mark
|
|
21
|
-
- line with no popup - node (e.g. headings, subheads)
|
|
22
|
-
- **Non-Editable**
|
|
23
|
-
- Inline with pop-up: node with attrs and no content
|
|
24
|
-
- Line with pop-up: node with attrs and no content (e.g. bsp-image)
|
|
25
|
-
|
|
26
|
-
The following process flow diagram depicts how the code determines whether enhancements are represented as nodes or marks and whether they have attrs or not. In general, if content is editable and is inline, it is a mark. If it is editable and a block (line), then it is a node. They will both have attrs if they have fields (have popups) that can be edited from a popup but also content that can be edited directly in the RTE. Noneditable inline and block enhancements are nodes with fields (have popups) and can only be modified via the popup.
|
|
27
|
-
|
|
28
|
-

|
|
29
|
-
|
|
30
|
-
2. Enhancements **with** popups
|
|
31
|
-
|
|
32
|
-
1. There is an enhancement node/mark view that provides the DOM for an enhancement within the RTE. This allows us to assign event handlers to the enhancement to open the enhancement's submenu, which is 1 div that is created at RTE instantiation time (code can be found in ProseMirror.js). The node views are assigned at run-time as properties of the RTE view, and this code can be found in the main ProseMirror.js file.
|
|
33
|
-
2. The submenu content is replaced whenever the user engages a submenu and its left and top positions are set to display the submenu slightly below the enhancement text.
|
|
34
|
-
3. At the top of the enhancement.jsp file is a pub/sub publish action. It is embedded in the java code that produces the popup form JS, which also closes the popup. The "topic" data returned is the data generated by the backend for the enhancement. It is all the needed data to be added to the DOM element as attributes so that the enhancement is saved properly. The enhancement's event trigger is subscribed to this "topic", and when it is published, the enhancement DOM and node attrs will be populated with the "topic" data. The `label` is the contract between the back and front-ends for the text that is displayed for an enhancement, and it will be in the topic data. It is possible that a project might remove the `label` field, in which case the RTE uses the text in the RTE as the label. See the flow chart below for complete workflow:
|
|
35
|
-
|
|
36
|
-

|
|
37
|
-
|
|
38
|
-
3. Enhancements **without** popups
|
|
39
|
-
|
|
40
|
-
- Line enhancements are treated as nodes.
|
|
41
|
-
- Inline enhancements are treated as marks.
|
|
42
|
-
|
|
43
|
-
4. Pasted Embeds
|
|
44
|
-
1. Cut and paste of embeds is supported via decorations because we are unable to insert DOM elements directly into the RTE DOM. Decorations are used because their positions can be mapped through state changes, thus if the user inserts any content before the paste insertion point, the position of where the embed should be inserted is also updated. The flow is:
|
|
45
|
-
- When a paste is detected, a placeholder decoration is created and an id and the current position - 1 is set on the decoration spec. Its position is mapped through state changes (managed by this plugin) in the plugin's state.apply property. We subtract one from the current position to account for the original pasted text being removed from the document.
|
|
46
|
-
- An async call is made to our backend to build the embed. It returns a string version of the embed element or just the entered text if the pasted text was not an embed link.
|
|
47
|
-
- If there are any errors returned by the promise or if plain text is returned, then the plain text is reinserted into the document.
|
|
48
|
-
- Else a block enhancement is then created. Using a helper function, we retrieve the decoration and get its current position from its spec. We use this as the transaction replacement point for the block enhancement. We then set the decoration spec to indicate that the decoration should be removed upon next state update.
|
|
49
|
-
|
|
50
|
-
## Usage
|
|
51
|
-
|
|
52
|
-
1. Implementation is similar to Codemirror legacy RTE. Enhancements are defined on the page inside a global object, which is output from the backend. The schema iterates over that object and builds the enhancement node or mark type spec, differentiating based on the information above.
|
|
53
|
-
2. Display in the RTE can be controlled with CSS.
|
|
54
|
-
|
|
55
|
-
## Component and Directory Structure
|
|
56
|
-
|
|
57
|
-
### Commands
|
|
58
|
-
|
|
59
|
-
This is where the insert, edit, and remove commands are defined.
|
|
60
|
-
|
|
61
|
-
### Constants
|
|
62
|
-
|
|
63
|
-
Constants localized to this plugin.
|