@brightspot/ui 3.0.1-cms-ui-migration.2 → 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 +1924 -1924
- package/dist/storybook/assets/{ActionBar.stories-hJ_5cm-P.js → ActionBar.stories-CSxtZl7v.js} +1 -1
- package/dist/storybook/assets/{ActionItem.stories-Bjx2803w.js → ActionItem.stories-BWcMRMP3.js} +1 -1
- package/dist/storybook/assets/{Avatar.stories-Cj0YgZ6f.js → Avatar.stories-CYTUGXzH.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-Lh_sQFCU.js → AvatarGroup.stories-CSYBYo_5.js} +1 -1
- package/dist/storybook/assets/{Badge.stories-BL7RUibx.js → Badge.stories-LuF4BuVr.js} +1 -1
- package/dist/storybook/assets/{Button-BPHNcxqK.js → Button-CrXCMxHb.js} +1 -1
- package/dist/storybook/assets/{Button.stories-CAYO4gdU.js → Button.stories-JVwxdrdM.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup.stories-Cd13Us5K.js → ButtonGroup.stories-qtq64a1H.js} +1 -1
- package/dist/storybook/assets/{Celebrate.stories-D_KE3Qze.js → Celebrate.stories-DjTtaSd6.js} +1 -1
- package/dist/storybook/assets/{Checkbox.stories-Aj1xgZVn.js → Checkbox.stories-v1Pr5mL6.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-BecV_v6d.js → CircularProgress.stories-DkV7PJ4D.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-DU-WiZ2f.js → ClipboardMixin.stories-Dh5c7uSM.js} +1 -1
- package/dist/storybook/assets/{Color-6BZIO3FS-BYl4KZZn.js → Color-6BZIO3FS-B1gcREt6.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-BMUVUy2q.js → Colors.stories-DnubtRqn.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-FHcPKFm6.js → CombinedEffects.stories-By6akSve.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-EMUnfT5y.js → ComponentStatesMixin-CPLGv3h-.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-SXq0kzS9.js → ComponentStatesMixin.stories-CiQ_lyhm.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-u43lhvcI.js → CopyToClipboard.stories-cJ7rl3mj.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-BdCn5qgO.js → Debounce.stories-Bw-goobU.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-DxiEJ_jx.js → DocsRenderer-LL677BLK-CNW57dGQ.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-BWSRwjIF.js → Dropdown.stories-CwC3HXXd.js} +1 -1
- package/dist/storybook/assets/{EmptyState.stories-BpobeZL5.js → EmptyState.stories-BUEJwuhP.js} +1 -1
- package/dist/storybook/assets/{Events.stories-CP5kMzpr.js → Events.stories-D1mf9buv.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-CbJD-oTB.js → Heading.stories-DO906G4P.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-BOABJ7zw.js → HueRipple.stories-BOySRSZB.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-CWlUHL4j.js → Icon.stories-BsqgTbdG.js} +1 -1
- package/dist/storybook/assets/{IconButton.stories-BWBs-OLT.js → IconButton.stories-aza1AAKk.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-LZ0GZoxF.js → LinearProgress.stories-CDYmiiex.js} +1 -1
- package/dist/storybook/assets/{Pagination.stories-CbLaR3P9.js → Pagination.stories-LXB-x7YB.js} +1 -1
- package/dist/storybook/assets/{Popover.stories-JHrWqYZw.js → Popover.stories-DY1HesPJ.js} +1 -1
- package/dist/storybook/assets/{ReadyMixin-B1H2a9x8.js → ReadyMixin-DmOC67IJ.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin.stories-UMHpYG73.js → RovingTabindexMixin.stories-BWy0Rq8d.js} +1 -1
- package/dist/storybook/assets/{Rtc.stories-VQtNSlls.js → Rtc.stories-DrmdqqbI.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-CYdi8Tgp.js → ScrollShadow.stories-DiKFPazh.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-D8F2hZCf.js → Switch.stories-BgFnw8_z.js} +1 -1
- package/dist/storybook/assets/{Tab.stories-wgBP0lTj.js → Tab.stories-c2wLMooF.js} +1 -1
- package/dist/storybook/assets/{Tabs.stories-C00rr5sf.js → Tabs.stories-CjH8seNP.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-BhQEfJbS.js → Throttle.stories-CXysc_QE.js} +1 -1
- package/dist/storybook/assets/{Tooltip.stories-CGoZ5qTn.js → Tooltip.stories-6qzyByPm.js} +1 -1
- package/dist/storybook/assets/{Upload.stories-B3K-HAXw.js → Upload.stories-BLxykydQ.js} +1 -1
- package/dist/storybook/assets/{UploadItem.stories-71ArSoUh.js → UploadItem.stories-CcfcqdJW.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-CihlfFXS.js → Welcome.stories-CzYS_3fH.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-1u4KbiJM.js → Widget.stories-Du7T4LAI.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-B3Jitxw9.js → WithTooltip-65CFNBJE-D4LfXdYt.js} +1 -1
- package/dist/storybook/assets/{blocks-C1HaXuQB.js → blocks-DR3fGePu.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-Dy9Lt9fs.js → formatter-EIJCOSYU-Cf01216O.js} +1 -1
- package/dist/storybook/assets/if-defined-DaMmbcIU.js +1 -0
- package/dist/storybook/assets/{iframe-Dx6IxWXF.js → iframe-CQArUhO8.js} +4 -4
- package/dist/storybook/assets/{index-OrjedSVh.js → index-B1uI_67G.js} +1 -1
- package/dist/storybook/assets/{onFind-YTqjw6W0.js → onFind-BpFkN2Rh.js} +1 -1
- package/dist/storybook/assets/{onFind.stories-DEvwTrmx.js → onFind.stories-Cxdeg69X.js} +1 -1
- package/dist/storybook/assets/{onRemove.stories-D5mO-Lin.js → onRemove.stories-BHEWpNrE.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-C3Rcz0Eb.js → onVisible.stories-DFJ3S_ZS.js} +1 -1
- package/dist/storybook/assets/{style-map-CiMHry7H.js → style-map-DJ83UC3V.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-DIZnuhb2.js → syntaxhighlighter-ED5Y7EFY-zYN83mxK.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +16 -2
- package/dist/storybook/assets/if-defined-CA2KmTqA.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,368 +0,0 @@
|
|
|
1
|
-
import { Plugin, PluginKey } from 'prosemirror-state'
|
|
2
|
-
import Cookies from 'js.cookie'
|
|
3
|
-
import { Decoration, DecorationSet } from 'prosemirror-view'
|
|
4
|
-
import { DOMParser, Fragment, Slice } from 'prosemirror-model'
|
|
5
|
-
import { getLegacyHTMLTextForProsemirror } from '../../codemirror-shim'
|
|
6
|
-
import { runSpellCheck } from '../spellcheck/spellcheck-plugin'
|
|
7
|
-
import { v1 as uuidv1 } from 'uuid'
|
|
8
|
-
|
|
9
|
-
if (!window.BRIGHTSPOT?.ui.cms.enableV5UI) {
|
|
10
|
-
await import('./views/PastePopup.less')
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const PASTE_POPUP_TITLE =
|
|
14
|
-
typeof RTE_PASTE_POPUP_TITLE !== 'undefined'
|
|
15
|
-
? RTE_PASTE_POPUP_TITLE
|
|
16
|
-
: 'Replace All'
|
|
17
|
-
const PASTE_POPUP_INSTRUCTIONS =
|
|
18
|
-
typeof RTE_PASTE_POPUP_INSTRUCTIONS !== 'undefined'
|
|
19
|
-
? RTE_PASTE_POPUP_INSTRUCTIONS
|
|
20
|
-
: 'Replace All will replace the selected text and any contained enhancements with the contents of your clipboard. Use Replace Text if you want to retain enhancements and their relevant positioning.'
|
|
21
|
-
const PASTE_POPUP_TEXT_ONLY_BUTTON =
|
|
22
|
-
typeof RTE_PASTE_POPUP_TEXT_ONLY_BUTTON !== 'undefined'
|
|
23
|
-
? RTE_PASTE_POPUP_TEXT_ONLY_BUTTON
|
|
24
|
-
: 'Replace Text'
|
|
25
|
-
const PASTE_POPUP_ALL_BUTTON =
|
|
26
|
-
typeof RTE_PASTE_POPUP_ALL_BUTTON !== 'undefined'
|
|
27
|
-
? RTE_PASTE_POPUP_ALL_BUTTON
|
|
28
|
-
: 'Replace All'
|
|
29
|
-
|
|
30
|
-
const RICH_TEXT_ELEMENTS_PM_MAP = new Map()
|
|
31
|
-
RICH_TEXT_ELEMENTS_PM.forEach((item) => {
|
|
32
|
-
RICH_TEXT_ELEMENTS_PM_MAP.set(item.tag, item)
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Sends to the back-end for transformation of the markup
|
|
37
|
-
* pasted into the HTML. The content returned from the
|
|
38
|
-
* server will be what is pasted into the RTE.
|
|
39
|
-
*
|
|
40
|
-
* @param {string} text Text the user pasted into the RTE.
|
|
41
|
-
* @param {ProseMirror.EditorView} view The view of the RTE.
|
|
42
|
-
* @param {string} typeId The type ID of the content being pasted into.
|
|
43
|
-
* @param {string} fieldName The type ID of the content being pasted into.
|
|
44
|
-
* @return {Promise} The response from the server (could be an error)
|
|
45
|
-
*/
|
|
46
|
-
const getPasted = async (text, view, typeId, fieldName) => {
|
|
47
|
-
try {
|
|
48
|
-
const headers = new Headers()
|
|
49
|
-
headers.append('Brightspot-CSRF', Cookies.get('bsp.csrf'))
|
|
50
|
-
const body = new FormData()
|
|
51
|
-
const form = view.dom.closest('form[data-content-id]')
|
|
52
|
-
|
|
53
|
-
body.append('contentId', form?.dataset.contentId)
|
|
54
|
-
body.append('contentTypeId', form?.dataset.typeId)
|
|
55
|
-
body.append('locale', $('html').attr('lang') || 'en-US')
|
|
56
|
-
body.append('text', text)
|
|
57
|
-
body.append('typeId', typeId)
|
|
58
|
-
body.append('fieldName', fieldName)
|
|
59
|
-
|
|
60
|
-
const response = await fetch(CONTEXT_PATH + 'richTextTransformer', {
|
|
61
|
-
method: 'POST',
|
|
62
|
-
credentials: 'include',
|
|
63
|
-
headers,
|
|
64
|
-
body,
|
|
65
|
-
})
|
|
66
|
-
return response.json()
|
|
67
|
-
} catch (error) {
|
|
68
|
-
console.debug(error)
|
|
69
|
-
return error
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const getPasteOnlyPopupContent = () => {
|
|
74
|
-
return `
|
|
75
|
-
<div class="Widget Paste-popup">
|
|
76
|
-
<h1 class="Widget-title">${PASTE_POPUP_TITLE}</h1>
|
|
77
|
-
<div class="Paste-popup-content Message">${PASTE_POPUP_INSTRUCTIONS}</div>
|
|
78
|
-
<div class="Paste-popup-action-items ActionBar">
|
|
79
|
-
<button class="Paste-popup-text-only-button">${PASTE_POPUP_TEXT_ONLY_BUTTON}</button>
|
|
80
|
-
<button class="Paste-popup-all-button">${PASTE_POPUP_ALL_BUTTON}</button>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
`
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const key = new PluginKey('pasteManager')
|
|
87
|
-
|
|
88
|
-
const pasteManagerPlugin = (ctx, compliantTagNameMap) => {
|
|
89
|
-
return new Plugin({
|
|
90
|
-
key,
|
|
91
|
-
state: {
|
|
92
|
-
init() {
|
|
93
|
-
return DecorationSet.empty
|
|
94
|
-
},
|
|
95
|
-
apply(tr, set, state) {
|
|
96
|
-
// Adjust decoration positions to changes made by the transaction
|
|
97
|
-
set = set.map(tr.mapping, tr.doc)
|
|
98
|
-
let action = tr.getMeta(this)
|
|
99
|
-
let deco
|
|
100
|
-
|
|
101
|
-
if (action && action.add) {
|
|
102
|
-
if (action.add.to) {
|
|
103
|
-
deco = Decoration.inline(
|
|
104
|
-
action.add.from,
|
|
105
|
-
action.add.to,
|
|
106
|
-
{ class: 'Prosemirror-placeholder' },
|
|
107
|
-
{
|
|
108
|
-
id: action.add.id,
|
|
109
|
-
},
|
|
110
|
-
)
|
|
111
|
-
} else {
|
|
112
|
-
const widget = document.createElement('placeholder')
|
|
113
|
-
deco = Decoration.widget(action.add.from, widget, {
|
|
114
|
-
id: action.add.id,
|
|
115
|
-
})
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
set = set.add(tr.doc, [deco])
|
|
119
|
-
} else if (action && action.remove) {
|
|
120
|
-
set = set.remove(
|
|
121
|
-
set.find(null, null, (spec) => spec.id === action.remove.id),
|
|
122
|
-
)
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return set
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
props: {
|
|
129
|
-
decorations(state) {
|
|
130
|
-
return this.getState(state)
|
|
131
|
-
},
|
|
132
|
-
transformPastedHTML: (html) => {
|
|
133
|
-
// Do initial cleanup of pasted HTML prior to parsing.
|
|
134
|
-
const template = document.createElement('template')
|
|
135
|
-
template.innerHTML = html
|
|
136
|
-
const fragment = template.content
|
|
137
|
-
const walker = document.createTreeWalker(fragment)
|
|
138
|
-
let currentNode = walker.currentNode
|
|
139
|
-
|
|
140
|
-
while (currentNode) {
|
|
141
|
-
if (currentNode.nodeType === 1) {
|
|
142
|
-
currentNode.removeAttribute('id')
|
|
143
|
-
currentNode.removeAttribute('label')
|
|
144
|
-
if (
|
|
145
|
-
currentNode.hasAttribute('class') &&
|
|
146
|
-
currentNode.getAttribute('class').indexOf('rte2-style') > -1
|
|
147
|
-
) {
|
|
148
|
-
currentNode.removeAttribute('class')
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
currentNode = walker.nextNode()
|
|
152
|
-
}
|
|
153
|
-
return template.innerHTML
|
|
154
|
-
},
|
|
155
|
-
handlePaste: (view, event, incomingSlice) => {
|
|
156
|
-
const { dispatch, state } = view
|
|
157
|
-
let tr = state.tr
|
|
158
|
-
// User is writing raw html, let the editor handle
|
|
159
|
-
// cutting and pasting without processing from
|
|
160
|
-
// the Java,
|
|
161
|
-
const rawTextManagerState = state.rawTextManager$
|
|
162
|
-
if (
|
|
163
|
-
rawTextManagerState &&
|
|
164
|
-
rawTextManagerState.get('activeStates') &&
|
|
165
|
-
rawTextManagerState.get('activeStates').get('html')
|
|
166
|
-
) {
|
|
167
|
-
return false
|
|
168
|
-
}
|
|
169
|
-
// Content from the clipboard. Note that ProseMirror
|
|
170
|
-
// modifies the content on the clipboard so this is not
|
|
171
|
-
// the true data from the clipboard.
|
|
172
|
-
let content = event.clipboardData.getData('text/html')
|
|
173
|
-
if (!content) {
|
|
174
|
-
content = event.clipboardData.getData('text')
|
|
175
|
-
}
|
|
176
|
-
const isAllSelected = state.selection.toJSON().type === 'all'
|
|
177
|
-
// Because the Java has to process the data, we need to make an async
|
|
178
|
-
// call, which means we have to keep track of the position in the document
|
|
179
|
-
// where the user intended to paste. We keep track of this as a decoration so
|
|
180
|
-
// that the plugin can map through any state changes that occur prior to the content
|
|
181
|
-
// returning from the Java, allowing for the position to be updated correctly.
|
|
182
|
-
let id = uuidv1()
|
|
183
|
-
let { from, to, empty } = state.selection
|
|
184
|
-
if (state.doc.childCount === 1 && state.doc.textContent === '') {
|
|
185
|
-
from = 0
|
|
186
|
-
to = 0
|
|
187
|
-
}
|
|
188
|
-
if (empty) {
|
|
189
|
-
tr = tr.setMeta(key, {
|
|
190
|
-
add: { id, from },
|
|
191
|
-
})
|
|
192
|
-
} else {
|
|
193
|
-
tr = tr.setMeta(key, {
|
|
194
|
-
add: { id, from, to },
|
|
195
|
-
})
|
|
196
|
-
}
|
|
197
|
-
dispatch(tr)
|
|
198
|
-
// Users can replace all the current text content with new content
|
|
199
|
-
// but leave the current block enhancements in place. If the user has
|
|
200
|
-
// selected All and then pastes, we prompt the user to confirm this is what
|
|
201
|
-
// the user intends. The prompt is a popup, so we need
|
|
202
|
-
// to wait for the user to respond. Subsequently, we initialize the popup in
|
|
203
|
-
// a promise. We resolve the promise if there is no need for the popup or when
|
|
204
|
-
// the user exits the popup.
|
|
205
|
-
const promise = new Promise(function (resolve) {
|
|
206
|
-
if (isAllSelected) {
|
|
207
|
-
const popUpDom = document.createElement('div')
|
|
208
|
-
popUpDom.innerHTML = getPasteOnlyPopupContent()
|
|
209
|
-
view.dom.parentElement.appendChild(popUpDom)
|
|
210
|
-
const textOnlybutton = popUpDom.querySelector(
|
|
211
|
-
'.Paste-popup-text-only-button',
|
|
212
|
-
)
|
|
213
|
-
const allButton = popUpDom.querySelector('.Paste-popup-all-button')
|
|
214
|
-
textOnlybutton.addEventListener('click', (e) => {
|
|
215
|
-
e.preventDefault()
|
|
216
|
-
e.stopImmediatePropagation()
|
|
217
|
-
|
|
218
|
-
resolve(true)
|
|
219
|
-
$popUpDom.popup('close')
|
|
220
|
-
view.focus()
|
|
221
|
-
popUpDom.remove()
|
|
222
|
-
})
|
|
223
|
-
allButton.addEventListener('click', (e) => {
|
|
224
|
-
e.preventDefault()
|
|
225
|
-
e.stopImmediatePropagation()
|
|
226
|
-
|
|
227
|
-
resolve(false)
|
|
228
|
-
$popUpDom.popup('close')
|
|
229
|
-
view.focus()
|
|
230
|
-
popUpDom.remove()
|
|
231
|
-
})
|
|
232
|
-
const $popUpDom = $(popUpDom)
|
|
233
|
-
$popUpDom.popup()
|
|
234
|
-
$popUpDom.popup('open')
|
|
235
|
-
$popUpDom.show()
|
|
236
|
-
// The user might close the popup via the standard close
|
|
237
|
-
// button without making a selection, but we still need to
|
|
238
|
-
// resolve the promise.
|
|
239
|
-
$popUpDom.bind('close.popup', () => {
|
|
240
|
-
resolve()
|
|
241
|
-
view.focus()
|
|
242
|
-
})
|
|
243
|
-
} else {
|
|
244
|
-
// The user didn't select All, so no need for popup.
|
|
245
|
-
// Just resolve the promise.
|
|
246
|
-
resolve(false)
|
|
247
|
-
}
|
|
248
|
-
})
|
|
249
|
-
promise.then((shouldPasteTextOnly) => {
|
|
250
|
-
if (typeof shouldPasteTextOnly === 'undefined') {
|
|
251
|
-
return
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
getPasted(
|
|
255
|
-
content,
|
|
256
|
-
view,
|
|
257
|
-
view.dom.closest('.CIG')?.getAttribute('data-type-id'),
|
|
258
|
-
view.dom.closest('.CIG-row')?.getAttribute('data-field'),
|
|
259
|
-
).then(
|
|
260
|
-
(data) => {
|
|
261
|
-
let pos = findPlaceholder(view, id)
|
|
262
|
-
if (pos == null) return
|
|
263
|
-
const pluginMeta = tr.getMeta(key)
|
|
264
|
-
const text = pluginMeta.add.text
|
|
265
|
-
// Request failed, insert the text we collected and stored on the deco
|
|
266
|
-
// when the user pasted and remove the decoration.
|
|
267
|
-
if (!data.status || data.status !== 'ok') {
|
|
268
|
-
view.dispatch(
|
|
269
|
-
tr.insertText(text).setMeta(key, { remove: { id } }),
|
|
270
|
-
)
|
|
271
|
-
return
|
|
272
|
-
}
|
|
273
|
-
let toHTMLString = data.text
|
|
274
|
-
toHTMLString = getLegacyHTMLTextForProsemirror(
|
|
275
|
-
toHTMLString,
|
|
276
|
-
state.schema,
|
|
277
|
-
compliantTagNameMap,
|
|
278
|
-
true,
|
|
279
|
-
)
|
|
280
|
-
// compliantTagNameMap.forEach((value, key) => {
|
|
281
|
-
// const regex = new RegExp(key, 'g')
|
|
282
|
-
// toHTMLString = toHTMLString.replace(regex, value)
|
|
283
|
-
// })
|
|
284
|
-
const tmpElement = document.createElement('div')
|
|
285
|
-
tmpElement.innerHTML = toHTMLString
|
|
286
|
-
let slice = DOMParser.fromSchema(state.config.schema).parseSlice(
|
|
287
|
-
tmpElement,
|
|
288
|
-
)
|
|
289
|
-
|
|
290
|
-
// The user selected all, then pasted, and confirmed
|
|
291
|
-
// intent to paste text-only.
|
|
292
|
-
if (shouldPasteTextOnly && ctx.value) {
|
|
293
|
-
const currentContent = state.doc.content
|
|
294
|
-
// Keep track of all the current block level enhancements and
|
|
295
|
-
// their positions.
|
|
296
|
-
const map = {}
|
|
297
|
-
const newNodes = []
|
|
298
|
-
currentContent.content.forEach((item, index) => {
|
|
299
|
-
if (
|
|
300
|
-
RICH_TEXT_ELEMENTS_PM_MAP.get(item.type.name) &&
|
|
301
|
-
RICH_TEXT_ELEMENTS_PM_MAP.get(item.type.name).line
|
|
302
|
-
) {
|
|
303
|
-
map[index] = item
|
|
304
|
-
}
|
|
305
|
-
})
|
|
306
|
-
let numInserted = 0
|
|
307
|
-
// If there was an enhancement at this position,
|
|
308
|
-
// insert it into the new content at the same position,
|
|
309
|
-
// remembering to map forward the number previously
|
|
310
|
-
// inserted.
|
|
311
|
-
slice.content.content.forEach((item, index) => {
|
|
312
|
-
newNodes.push(item)
|
|
313
|
-
if (map[index]) {
|
|
314
|
-
newNodes.splice(index + numInserted, 0, map[index])
|
|
315
|
-
numInserted++
|
|
316
|
-
}
|
|
317
|
-
})
|
|
318
|
-
|
|
319
|
-
// The lines of pasted text might be shorter than the amount of
|
|
320
|
-
// enhancements that we have, so we just stack whatever is
|
|
321
|
-
// leftover.
|
|
322
|
-
if (numInserted < Object.keys(map).length) {
|
|
323
|
-
Object.keys(map).forEach((key, index) => {
|
|
324
|
-
if (index >= numInserted) {
|
|
325
|
-
newNodes.push(map[key])
|
|
326
|
-
numInserted++
|
|
327
|
-
}
|
|
328
|
-
})
|
|
329
|
-
}
|
|
330
|
-
const fragment = Fragment.fromArray(newNodes)
|
|
331
|
-
slice = new Slice(fragment, 0, 0)
|
|
332
|
-
}
|
|
333
|
-
dispatch(
|
|
334
|
-
view.state.tr
|
|
335
|
-
.replaceRange(pos.from, pos.to || 1, slice)
|
|
336
|
-
.setMeta(key, { remove: { id } }),
|
|
337
|
-
)
|
|
338
|
-
// From the spellcheck API. Runs the spellcheck.
|
|
339
|
-
runSpellCheck(state.doc)
|
|
340
|
-
},
|
|
341
|
-
() => {
|
|
342
|
-
view.dispatch(tr.setMeta(key, { remove: { id } }))
|
|
343
|
-
},
|
|
344
|
-
)
|
|
345
|
-
})
|
|
346
|
-
return true
|
|
347
|
-
},
|
|
348
|
-
},
|
|
349
|
-
})
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* Helper function to find the placeholder decoration that has a spec
|
|
354
|
-
* that provides the current position of the decoration (and thus where
|
|
355
|
-
* to insert the pasted text).
|
|
356
|
-
*
|
|
357
|
-
* @param {ProseMirror.EditorView} view
|
|
358
|
-
* @param {string} id The ID of the plugin that we want to find.
|
|
359
|
-
* @return {number|null} The current position of the decoration or null
|
|
360
|
-
* if the decoration was not found.
|
|
361
|
-
*/
|
|
362
|
-
function findPlaceholder(view, id) {
|
|
363
|
-
let decos = pasteManagerPlugin().getState(view.state)
|
|
364
|
-
let found = decos.find(null, null, (spec) => spec.id === id)
|
|
365
|
-
return found.length ? found[0] : null
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
export { pasteManagerPlugin }
|
package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/placeholder_manager/PlaceHolderManager.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import {
|
|
3
|
-
Plugin,
|
|
4
|
-
PluginKey,
|
|
5
|
-
AllSelection,
|
|
6
|
-
TextSelection,
|
|
7
|
-
} from 'prosemirror-state'
|
|
8
|
-
import { defaultBrightspotDOMSerializer } from '../../settings/BSSerializer'
|
|
9
|
-
import { replaceWholeDocumentWithNewContent } from '../../utilities'
|
|
10
|
-
import { constants } from '../../settings/constants'
|
|
11
|
-
|
|
12
|
-
const key = new PluginKey('placeholderManager')
|
|
13
|
-
const EDITABLE_PLACEHOLDER_ATTR = 'data-editable-placeholder'
|
|
14
|
-
const PLACEHOLDER_ATTR = 'placeholder'
|
|
15
|
-
const POPUP_IS_VISIBLE_SELECTOR = '.Popup.is-visible'
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Mimics native placeholder functionality, using the following rules:
|
|
19
|
-
*
|
|
20
|
-
* 1. At load time, if there is no value for the field, the placeholder
|
|
21
|
-
* value should appear in the RTE styled similarly to a native placeholder. This
|
|
22
|
-
* is handled in ProseMirror.js.
|
|
23
|
-
* 2. If this is not a `data-editable-placeholder` field, then when the RTE
|
|
24
|
-
* is focused, the placeholder should go away.
|
|
25
|
-
* 3. If this is not a `data-editable-placeholder` field, then when the RTE
|
|
26
|
-
* is blurred, the placeholder should come back if the RTE is empty.
|
|
27
|
-
* 4. If this is a `data-editable-placeholder` field, then when the RTE is
|
|
28
|
-
* focused, the placeholder value becomes the value of the RTE if the RTE is empty.
|
|
29
|
-
* 5. If this is a `data-editable-placeholder` field, then when the RTE is
|
|
30
|
-
* blurred, the placeholder should come back if the RTE is empty.
|
|
31
|
-
* 6. Like a native placeholder, the placeholder value is never saved. In the case
|
|
32
|
-
* of a `data-editable-placeholder` field, if the RTE value is the same as the placeholder,
|
|
33
|
-
* it should also not be saved. This check is handled before the RTE value
|
|
34
|
-
* saved back to the textarea in the `dispatchAction` callback in ProseMirror.js.
|
|
35
|
-
*
|
|
36
|
-
* @param {Element} ctx The RTE textarea.
|
|
37
|
-
* @param {Map} compliantTagNameMap Compliant tags, used for serialization.
|
|
38
|
-
*/
|
|
39
|
-
const placeholderManagerPlugin = (ctx, compliantTagNameMap) => {
|
|
40
|
-
return new Plugin({
|
|
41
|
-
key: key,
|
|
42
|
-
props: {
|
|
43
|
-
handleDOMEvents: {
|
|
44
|
-
focus: (view) => {
|
|
45
|
-
if (!ctx.hasAttribute(PLACEHOLDER_ATTR)) {
|
|
46
|
-
return
|
|
47
|
-
}
|
|
48
|
-
const { state, dom, dispatch } = view
|
|
49
|
-
const { tr, doc } = state
|
|
50
|
-
|
|
51
|
-
// If this isn't an editable placeholder and we are showing
|
|
52
|
-
// the 'placeholder' content, the field should be emptied.
|
|
53
|
-
if (
|
|
54
|
-
!ctx.hasAttribute(EDITABLE_PLACEHOLDER_ATTR) &&
|
|
55
|
-
dom.parentElement.classList.contains(
|
|
56
|
-
constants.CLASSES.IS_PLACEHOLDER_CONTENT,
|
|
57
|
-
)
|
|
58
|
-
) {
|
|
59
|
-
const allSelection = new AllSelection(doc)
|
|
60
|
-
const storedMarks = tr.storedMarks
|
|
61
|
-
|
|
62
|
-
dispatch(
|
|
63
|
-
tr
|
|
64
|
-
.setMeta('removeFromTracking', true)
|
|
65
|
-
.setMeta('addToHistory', false)
|
|
66
|
-
.setSelection(allSelection)
|
|
67
|
-
.deleteSelection()
|
|
68
|
-
.setStoredMarks(storedMarks),
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
dom.parentElement.classList.remove(
|
|
72
|
-
constants.CLASSES.IS_PLACEHOLDER_CONTENT,
|
|
73
|
-
)
|
|
74
|
-
},
|
|
75
|
-
blur: (view) => {
|
|
76
|
-
// The user might be interacting with an enhancement popup, which will blur the
|
|
77
|
-
// editor, but in this case we don't want to handle potentially emptying the
|
|
78
|
-
// editor.
|
|
79
|
-
const placeholderContent = ctx.getAttribute(PLACEHOLDER_ATTR)
|
|
80
|
-
let currentContent = ctx.value
|
|
81
|
-
if (!currentContent && ctx.hasAttribute('placeholder')) {
|
|
82
|
-
currentContent = ctx.getAttribute('placeholder')
|
|
83
|
-
}
|
|
84
|
-
if (
|
|
85
|
-
document.querySelector(POPUP_IS_VISIBLE_SELECTOR) ||
|
|
86
|
-
!ctx.hasAttribute(PLACEHOLDER_ATTR) ||
|
|
87
|
-
(currentContent.length > 0 && currentContent !== placeholderContent)
|
|
88
|
-
) {
|
|
89
|
-
return
|
|
90
|
-
}
|
|
91
|
-
const { state, dispatch } = view
|
|
92
|
-
const doc = state.doc
|
|
93
|
-
const content = defaultBrightspotDOMSerializer.serialize(
|
|
94
|
-
doc.content,
|
|
95
|
-
compliantTagNameMap,
|
|
96
|
-
)
|
|
97
|
-
const isEmpty =
|
|
98
|
-
doc.childCount === 1 &&
|
|
99
|
-
doc.firstChild.isTextblock &&
|
|
100
|
-
doc.firstChild.content.size === 0 &&
|
|
101
|
-
!view.docView.contentDOM.textContent
|
|
102
|
-
if (content === placeholderContent || isEmpty) {
|
|
103
|
-
view.dom.parentNode.classList.add(
|
|
104
|
-
constants.CLASSES.IS_PLACEHOLDER_CONTENT,
|
|
105
|
-
)
|
|
106
|
-
}
|
|
107
|
-
// If this isn't an editable placeholder field, the field was
|
|
108
|
-
// emptied when it was focused. If the field is still empty,
|
|
109
|
-
// we need to put the placeholder content back.
|
|
110
|
-
if (isEmpty) {
|
|
111
|
-
replaceWholeDocumentWithNewContent(
|
|
112
|
-
state,
|
|
113
|
-
placeholderContent,
|
|
114
|
-
compliantTagNameMap,
|
|
115
|
-
dispatch,
|
|
116
|
-
false,
|
|
117
|
-
true,
|
|
118
|
-
undefined,
|
|
119
|
-
true,
|
|
120
|
-
)
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
})
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export { placeholderManagerPlugin }
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Brightspot Rich Text Editor Raw Code Manager Plugin
|
|
2
|
-
|
|
3
|
-
Extends Prosemirror to add marks around content the user wants denoted as raw code.
|
|
4
|
-
|
|
5
|
-
## Table of Contents
|
|
6
|
-
|
|
7
|
-
1. [Must Knows](#must-knows)
|
|
8
|
-
|
|
9
|
-
## Must Knows
|
|
10
|
-
|
|
11
|
-
1. The `raw` code marks are added by the shim during RTE content creation. The shim loops through the content elements and compares them to the schema. If the element is not in the schema, it adds a code tag around the content in that element and removes the element. The `raw` mark provides the styling for the raw content.
|
|
12
|
-
2. The `raw` code marks are stripped away by the serializer so that when the content is saved, it will not be saved.
|
|
13
|
-
3. This plugin wraps the `raw` code marks around any content the user enters after engaging the raw content command.
|
package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/raw_text_manager/RawTextManager.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-debugger */
|
|
2
|
-
import { Plugin, PluginKey } from 'prosemirror-state'
|
|
3
|
-
import { ChangeSet } from 'prosemirror-changeset'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Command triggered when user engages the raw html command.
|
|
7
|
-
* Dispatches a meta update to toggle the raw state.
|
|
8
|
-
*/
|
|
9
|
-
const doRaw = () => {
|
|
10
|
-
return function (state, dispatch) {
|
|
11
|
-
dispatch(
|
|
12
|
-
state.tr.setMeta(key, {
|
|
13
|
-
toggleRaw: true,
|
|
14
|
-
}),
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const key = new PluginKey('rawTextManager')
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Manages toggling a `raw` active state for when users
|
|
23
|
-
* engage the raw tag command. The `appendTransaction` adds a `raw` mark
|
|
24
|
-
* around new text the user enters when the raw state is active.
|
|
25
|
-
*/
|
|
26
|
-
const rawTextManagerPlugin = () => {
|
|
27
|
-
return new Plugin({
|
|
28
|
-
key: key,
|
|
29
|
-
|
|
30
|
-
state: {
|
|
31
|
-
init() {
|
|
32
|
-
const pluginState = new Map()
|
|
33
|
-
const activeStates = new Map()
|
|
34
|
-
activeStates.set('html', false)
|
|
35
|
-
pluginState.set('activeStates', activeStates)
|
|
36
|
-
return pluginState
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
apply(transaction, value) {
|
|
40
|
-
const pluginState = value
|
|
41
|
-
const meta = transaction.getMeta(key)
|
|
42
|
-
if (meta && meta.hasOwnProperty('toggleRaw')) {
|
|
43
|
-
const currentState = pluginState
|
|
44
|
-
const newCurrentState = !currentState.get('activeStates').get('html')
|
|
45
|
-
pluginState.get('activeStates').set('html', newCurrentState)
|
|
46
|
-
}
|
|
47
|
-
return pluginState
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
appendTransaction(transactions, oldState, newState) {
|
|
52
|
-
const pluginState = newState[key.key]
|
|
53
|
-
const isRawMode = pluginState.get('activeStates').get('html')
|
|
54
|
-
|
|
55
|
-
if (!isRawMode) {
|
|
56
|
-
return
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
let tr = newState.tr
|
|
60
|
-
const schema = newState.config.schema
|
|
61
|
-
const markType = schema.marks.html
|
|
62
|
-
const mark = markType.create()
|
|
63
|
-
|
|
64
|
-
const changeSets = []
|
|
65
|
-
|
|
66
|
-
transactions.forEach((transaction) => {
|
|
67
|
-
const changeSet = ChangeSet.create(oldState.doc).addSteps(
|
|
68
|
-
newState.doc,
|
|
69
|
-
transaction.mapping.maps,
|
|
70
|
-
)
|
|
71
|
-
if (changeSet.changes.length) {
|
|
72
|
-
changeSets.push(changeSet)
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
// Unless there are actual changes in the returned transaction ProseMirror
|
|
77
|
-
// will go into an infinite loop. This is a known danger when implementing
|
|
78
|
-
// appendTransaction that implementers must guard against.
|
|
79
|
-
if (changeSets.length > 0) {
|
|
80
|
-
changeSets.forEach((cs) => {
|
|
81
|
-
cs.changes.forEach((change) => {
|
|
82
|
-
change.inserted.forEach((inserted) => {
|
|
83
|
-
tr = tr.addMark(change.fromA, change.toB, mark)
|
|
84
|
-
})
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
return tr
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return
|
|
92
|
-
},
|
|
93
|
-
})
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export { rawTextManagerPlugin, doRaw }
|