@brightspot/ui 3.0.1-cms-ui-migration.2 → 3.0.1-cms-ui-migration.4
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 +56 -37
- package/dist/custom-elements.json +1807 -1807
- package/dist/storybook/assets/{ActionBar.stories-hJ_5cm-P.js → ActionBar.stories-BZAVK1QG.js} +1 -1
- package/dist/storybook/assets/{ActionItem.stories-Bjx2803w.js → ActionItem.stories-BqiWvlWi.js} +1 -1
- package/dist/storybook/assets/{Avatar.stories-Cj0YgZ6f.js → Avatar.stories-DkdB6hd_.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-Lh_sQFCU.js → AvatarGroup.stories-DODqaIix.js} +1 -1
- package/dist/storybook/assets/{Badge.stories-BL7RUibx.js → Badge.stories-DZoum08S.js} +1 -1
- package/dist/storybook/assets/{Button-BPHNcxqK.js → Button-BkmBgNO-.js} +1 -1
- package/dist/storybook/assets/{Button.stories-CAYO4gdU.js → Button.stories-BFhCL2dp.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup.stories-Cd13Us5K.js → ButtonGroup.stories-DlTGTvkq.js} +1 -1
- package/dist/storybook/assets/{Celebrate.stories-D_KE3Qze.js → Celebrate.stories-m4d4zTEz.js} +1 -1
- package/dist/storybook/assets/{Checkbox.stories-Aj1xgZVn.js → Checkbox.stories-Y253YeU7.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-BecV_v6d.js → CircularProgress.stories-6BD8uV5G.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-DU-WiZ2f.js → ClipboardMixin.stories-BkH66rIU.js} +1 -1
- package/dist/storybook/assets/{Color-6BZIO3FS-BYl4KZZn.js → Color-6BZIO3FS-iG0OjPBU.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-BMUVUy2q.js → Colors.stories-BxiyQnEg.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-FHcPKFm6.js → CombinedEffects.stories-Bs3U7qRl.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-EMUnfT5y.js → ComponentStatesMixin-DampYb5c.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-SXq0kzS9.js → ComponentStatesMixin.stories-CZ2OW7as.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-u43lhvcI.js → CopyToClipboard.stories-CdlghjaE.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-BdCn5qgO.js → Debounce.stories-CymT8PnT.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-DxiEJ_jx.js → DocsRenderer-LL677BLK-dqHCo-GE.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-BWSRwjIF.js → Dropdown.stories-B6JwKg-I.js} +1 -1
- package/dist/storybook/assets/{EmptyState.stories-BpobeZL5.js → EmptyState.stories-Bk229lPH.js} +1 -1
- package/dist/storybook/assets/{Events.stories-CP5kMzpr.js → Events.stories-C8-k9cx8.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-CbJD-oTB.js → Heading.stories-DIdnAQRG.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-BOABJ7zw.js → HueRipple.stories-B1gXAEaH.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-CWlUHL4j.js → Icon.stories--1VJ0_yt.js} +1 -1
- package/dist/storybook/assets/{IconButton.stories-BWBs-OLT.js → IconButton.stories-CS2rEIir.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-LZ0GZoxF.js → LinearProgress.stories-Bx0CQQls.js} +1 -1
- package/dist/storybook/assets/{Pagination.stories-CbLaR3P9.js → Pagination.stories-B4AogTXB.js} +1 -1
- package/dist/storybook/assets/{Popover.stories-JHrWqYZw.js → Popover.stories-BR88DPgU.js} +1 -1
- package/dist/storybook/assets/{ReadyMixin-B1H2a9x8.js → ReadyMixin-n6qZO39Y.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin.stories-UMHpYG73.js → RovingTabindexMixin.stories-1xTJSMSv.js} +1 -1
- package/dist/storybook/assets/{Rtc.stories-VQtNSlls.js → Rtc.stories-Rt0A_rUZ.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-CYdi8Tgp.js → ScrollShadow.stories-CjLdJyYu.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-D8F2hZCf.js → Switch.stories-CF8wO4v2.js} +1 -1
- package/dist/storybook/assets/{Tab.stories-wgBP0lTj.js → Tab.stories-C8XNshog.js} +1 -1
- package/dist/storybook/assets/{Tabs.stories-C00rr5sf.js → Tabs.stories-B01l4rQx.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-BhQEfJbS.js → Throttle.stories-Bpi0K5j9.js} +1 -1
- package/dist/storybook/assets/{Tooltip.stories-CGoZ5qTn.js → Tooltip.stories-BC4zMiZ1.js} +1 -1
- package/dist/storybook/assets/{Upload.stories-B3K-HAXw.js → Upload.stories-2pWv_fZ1.js} +1 -1
- package/dist/storybook/assets/{UploadItem.stories-71ArSoUh.js → UploadItem.stories-aLeAUM7y.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-CihlfFXS.js → Welcome.stories-DJV83eb7.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-1u4KbiJM.js → Widget.stories-Cz0i2o6L.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-B3Jitxw9.js → WithTooltip-65CFNBJE-D8QwVYG8.js} +1 -1
- package/dist/storybook/assets/{blocks-C1HaXuQB.js → blocks-BFmpEZRy.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-Dy9Lt9fs.js → formatter-EIJCOSYU-CdwdJOPy.js} +1 -1
- package/dist/storybook/assets/if-defined-gbJXriW-.js +1 -0
- package/dist/storybook/assets/{iframe-Dx6IxWXF.js → iframe-CyssRDCd.js} +4 -4
- package/dist/storybook/assets/{index-OrjedSVh.js → index-B82i8dhg.js} +1 -1
- package/dist/storybook/assets/{onFind-YTqjw6W0.js → onFind-BFI1uIxr.js} +1 -1
- package/dist/storybook/assets/{onFind.stories-DEvwTrmx.js → onFind.stories-zZjQs_Gn.js} +1 -1
- package/dist/storybook/assets/{onRemove.stories-D5mO-Lin.js → onRemove.stories-pFBwAIex.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-C3Rcz0Eb.js → onVisible.stories-5dErOVRq.js} +1 -1
- package/dist/storybook/assets/{style-map-CiMHry7H.js → style-map-D0EcLEWO.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-DIZnuhb2.js → syntaxhighlighter-ED5Y7EFY--2h_dVga.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +16 -2
- package/src/legacy/tool-ui/src/AnalyticsWidget.css +1 -1
- package/src/legacy/tool-ui/src/Board.css +1 -1
- package/src/legacy/tool-ui/src/BulkUpload.css +1 -1
- package/src/legacy/tool-ui/src/ComboInput.css +1 -1
- package/src/legacy/tool-ui/src/Compat.css +5 -5
- package/src/legacy/tool-ui/src/ContentEditDrawer.css +1 -1
- package/src/legacy/tool-ui/src/Dialog.css +1 -1
- package/src/legacy/tool-ui/src/FormFilter.css +1 -1
- package/src/legacy/tool-ui/src/Icon/index.css +1 -1
- package/src/legacy/tool-ui/src/ImageEditor.css +1 -1
- package/src/legacy/tool-ui/src/Incompatible.css +2 -2
- package/src/legacy/tool-ui/src/LinkCarousel.css +1 -1
- package/src/legacy/tool-ui/src/Page.css +1 -1
- package/src/legacy/tool-ui/src/RepeatableContentInputGroup.css +1 -1
- package/src/legacy/tool-ui/src/RichText.css +1 -1
- package/src/legacy/tool-ui/src/SearchWidget.css +2 -2
- package/src/legacy/tool-ui/src/SearchWidgetAdvanced.css +1 -1
- package/src/legacy/tool-ui/src/Widget.css +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/v5.5e5d7f655e174ddd85f5.css +5 -0
- package/dist/storybook/assets/if-defined-CA2KmTqA.js +0 -1
- package/docs/adr/0001-retire-cms-ui-package-fold-under-src-legacy.md +0 -78
- package/docs/adr/0002-yarn-workspaces-preserve-cms-ui-deps.md +0 -130
- package/docs/adr/0003-bundle-equivalence-as-fold-acceptance-criterion.md +0 -286
- 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/dist/v5.5e3fdf0f0b20b4e3c170.css +0 -5
- 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,68 +0,0 @@
|
|
|
1
|
-
# Brightspot Rich Text Editor
|
|
2
|
-
|
|
3
|
-
This is the new Brightspot RTE, which is built on top of [ProseMirror](https://prosemirror.net/). Custom functionality is added to the RTE via Prosemirror's Plugin architecture. Our plugins live in the `plugin` diretory. Settings for the RTE app are in the `settings` directory. This directory holds the default configuration settings for this RTE. Your customizations will likely entail extending any or all of these settings (as well as adding a plugin).
|
|
4
|
-
|
|
5
|
-
## Table of Contents
|
|
6
|
-
|
|
7
|
-
1. [Must Knows](#must-knows)
|
|
8
|
-
2. [Usage](#usage)
|
|
9
|
-
3. [Collaborative Editing](#collaborative-editing)
|
|
10
|
-
4. [Component and Directory Structure](#component-and-directory-structure)
|
|
11
|
-
5. [Root](#root)
|
|
12
|
-
6. [Plugins](#plugins)
|
|
13
|
-
7. [menubar](#menubar)
|
|
14
|
-
1. [menubar views](#menubar-views)
|
|
15
|
-
2. [menubar plugin](#menubar-plugin)
|
|
16
|
-
8. [plugin-setup](#plugin-setup)
|
|
17
|
-
9. [Settings](#settings)
|
|
18
|
-
10. [schema](#schema)
|
|
19
|
-
11. [commands](#commands)
|
|
20
|
-
12. [constants](#constants)
|
|
21
|
-
13. [keymap](#keymap)
|
|
22
|
-
14. [menuitems](#menuitems)
|
|
23
|
-
|
|
24
|
-
## Must Knows
|
|
25
|
-
|
|
26
|
-
1. Content produced by the legacy RTE built on CodeMirror is not compatible with Prosemirror-generated content because of the way in which both handle new lines: our codemirror only supports inline breaks while prosemirror must have block-level elements that wrap either text or other block-level elements. To handle this, there is a shim that does minimal translating of the markup whenever the editor state changes. This markup is saved to the original textarea, whose value is submitted when the user saves the content item. You can always see this translated markup by checking the value of the original text editor DOM element at any time, as both the Prosemirror editor and the textarea are kept in sync.
|
|
27
|
-
2. **Warning**: Any block-level elements not defined in the schema will be ignored by the prosemirror parser. You can tell what has been defined by looking at the `schema` file.
|
|
28
|
-
3. **Warning**: This currently comes with a limited menu bar that allows the user to bold, italicize, strikethru, sub, sup, left align, center align, and right align text. The menubar configuration of menu items and commands is in the **settings** directory.
|
|
29
|
-
|
|
30
|
-
## Usage
|
|
31
|
-
|
|
32
|
-
1. Import the RTE class file. Example:
|
|
33
|
-
|
|
34
|
-
```js
|
|
35
|
-
import { RTE } from './rte/index'
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
2. Instantiate an RTE object by passing in a DOM element. It does not have to be a textarea but it needs to be an element that can have its values set and get.
|
|
39
|
-
|
|
40
|
-
```js
|
|
41
|
-
const rte = new RTE(element)
|
|
42
|
-
rte.init()
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Collaborative Editing
|
|
46
|
-
|
|
47
|
-
Collaborative editing functionality is assisted by the ProseMirror [collab plugin](https://prosemirror.net/docs/ref/#collab). The following diagram encompasses the collab flow. Major takeaways are:
|
|
48
|
-
|
|
49
|
-
1. Our backend is the authority in the form of a record per each RTE field. It holds the last document structure in JSON form, all of the steps taken by users on this field and the clientIds who made those changes, as well as current users' anchors and/or selection ranges.
|
|
50
|
-
|
|
51
|
-
2. We use our RTC for constant communication between the server and the users. Upon initialization, the RTE will be drawn from the information stored in the record if there is one or the textarea if there is not one. This guarantees the collab plugin will be instantiated with the correct version number, which matches the number of steps held in the record.
|
|
52
|
-
|
|
53
|
-
3. If a user attemps to post a content change to the authority (i.e. update the record for this field) and the change version number is behind the current version number stored on the server, the change will be rejected by the server.
|
|
54
|
-
|
|
55
|
-

|
|
56
|
-
|
|
57
|
-
## Component and Directory Structure
|
|
58
|
-
|
|
59
|
-
### Root
|
|
60
|
-
|
|
61
|
-
1. RTE Class - sets up an RTE object per object instantiated, which occurs in `v3.js`. Much of the code that involves setting up the instance lives in the `utilites` file.
|
|
62
|
-
2. styles - all styles impacting the RTE are in the `rte.css` file.
|
|
63
|
-
3. codemirror-shim - bridges the gap between codemirror and prosemirror (in particular, handling of lines) for those users who are able to toggle back and forth between the two RTE implementations.
|
|
64
|
-
|
|
65
|
-
### Plugins
|
|
66
|
-
|
|
67
|
-
To make it easy to package and enable extra editor functionality, ProseMirror has a [plugin system](http://prosemirror.net/docs/ref/#state.Plugin_System). Additional functionality should be added here as a plugin. Plugins can have views, their own states, styling as well as influece the EditorState during transactions.
|
|
68
|
-
See the ReadMe in the plugins directory for more information on our plugins.
|
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import DOMPurify from 'dompurify'
|
|
2
|
-
import create from '../dom/create'
|
|
3
|
-
|
|
4
|
-
/* eslint-disable no-debugger */
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Prosemirror generated content is not quite compatible with our legacy RTE generated
|
|
8
|
-
* content because of the way in which both handle new lines. The serializer
|
|
9
|
-
* handles translation for translating back to CodeMirror (backend-needed) code. This
|
|
10
|
-
* does mimimal parsing to make a few adjustments to display the content correctly
|
|
11
|
-
* in ProseMirror.
|
|
12
|
-
*
|
|
13
|
-
* @param {string} text HTML markup as a string, possibly with line breaks
|
|
14
|
-
* @param {ProseMirror.Schema} schema
|
|
15
|
-
* @param {Map} compliantTagNameMap
|
|
16
|
-
* @param {boolean} skipRawTagsCheck Optional flag to indicate if the raw tags
|
|
17
|
-
* check should be skipped.
|
|
18
|
-
* @return {string} HTML markup as a string with any line breaks `replaced`
|
|
19
|
-
* with paragraphs
|
|
20
|
-
*/
|
|
21
|
-
const getLegacyHTMLTextForProsemirror = (
|
|
22
|
-
string,
|
|
23
|
-
schema,
|
|
24
|
-
compliantTagNameMap,
|
|
25
|
-
skipRawTagsCheck,
|
|
26
|
-
sanitize,
|
|
27
|
-
) => {
|
|
28
|
-
const blockSet = new Set()
|
|
29
|
-
const allowedTagsSet = new Set()
|
|
30
|
-
compliantTagNameMap.forEach((value, key) => {
|
|
31
|
-
const regex = new RegExp(key, 'g')
|
|
32
|
-
string = string.replace(regex, value)
|
|
33
|
-
})
|
|
34
|
-
Object.keys(schema.nodes).forEach((key) => {
|
|
35
|
-
const isBlock = schema.nodes[key].isBlock
|
|
36
|
-
if (!schema.nodes[key].spec.hasOwnProperty('parseDOM')) {
|
|
37
|
-
return
|
|
38
|
-
}
|
|
39
|
-
schema.nodes[key].spec.parseDOM.forEach((dom) => {
|
|
40
|
-
// this.allowedTags[dom.tag] = true
|
|
41
|
-
allowedTagsSet.add(dom.tag)
|
|
42
|
-
if (isBlock && dom.tag !== 'br') {
|
|
43
|
-
blockSet.add(dom.tag)
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
Object.keys(schema.marks).forEach((key) => {
|
|
48
|
-
if (!schema.marks[key].spec.hasOwnProperty('parseDOM')) {
|
|
49
|
-
return
|
|
50
|
-
}
|
|
51
|
-
schema.marks[key].spec.parseDOM.forEach((dom) => {
|
|
52
|
-
allowedTagsSet.add(dom.tag)
|
|
53
|
-
})
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
const element = document.createElement('div')
|
|
57
|
-
|
|
58
|
-
if (sanitize) {
|
|
59
|
-
element.innerHTML = DOMPurify.sanitize(string, {
|
|
60
|
-
CUSTOM_ELEMENT_HANDLING: {
|
|
61
|
-
tagNameCheck: () => true,
|
|
62
|
-
attributeNameCheck: null,
|
|
63
|
-
allowCustomizedBuiltInElements: true,
|
|
64
|
-
},
|
|
65
|
-
})
|
|
66
|
-
} else {
|
|
67
|
-
element.innerHTML = string
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
wrapUnsupportedTags(element, allowedTagsSet, skipRawTagsCheck)
|
|
71
|
-
|
|
72
|
-
const buckets = getBucketsFromElement([...element.childNodes], blockSet)
|
|
73
|
-
const newElement = processBuckets(buckets, blockSet)
|
|
74
|
-
return newElement.innerHTML
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const getBucketsFromElement = (nodes, blockSet) => {
|
|
78
|
-
let prevChild = null
|
|
79
|
-
const buckets = []
|
|
80
|
-
let bucketNumber = -1
|
|
81
|
-
|
|
82
|
-
nodes.forEach((child) => {
|
|
83
|
-
const childNodeName = child.nodeName.toLowerCase()
|
|
84
|
-
|
|
85
|
-
// If node is essentially empty skip since we will wrap them in a line. This
|
|
86
|
-
// becomes problematic with whitespace etc before/after elements added in HTML
|
|
87
|
-
// mode.
|
|
88
|
-
if (
|
|
89
|
-
blockSet.has(prevChild) &&
|
|
90
|
-
childNodeName === '#text' &&
|
|
91
|
-
child.wholeText.trim().length === 0
|
|
92
|
-
) {
|
|
93
|
-
return
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const classList = child.className ? child.className.split(' ') : []
|
|
97
|
-
let hasBlockClass = classList.some((className) => {
|
|
98
|
-
return blockSet.has(`.${className}`)
|
|
99
|
-
})
|
|
100
|
-
// ins and del are special marks that can be block-level or inline. If
|
|
101
|
-
// this is a block level mark, we don't want to surround it with a bsp-line.
|
|
102
|
-
// We know if this is a block level mark by checking if any of its children
|
|
103
|
-
// are block-level nodes.
|
|
104
|
-
if (
|
|
105
|
-
classList.indexOf('rte2-style-ins-delete') !== -1 ||
|
|
106
|
-
classList.indexOf('rte2-style-ins-insert') !== -1 ||
|
|
107
|
-
classList.indexOf('rte2-style-ins-ai') !== -1 ||
|
|
108
|
-
childNodeName === 'ai' ||
|
|
109
|
-
childNodeName === 'del' ||
|
|
110
|
-
childNodeName === 'ins'
|
|
111
|
-
) {
|
|
112
|
-
const childChildren = child.children
|
|
113
|
-
const hasBlockChild = [...childChildren].some((ele) => {
|
|
114
|
-
const nodeName = ele.nodeName.toLowerCase()
|
|
115
|
-
return blockSet.has(nodeName) || nodeName === 'br'
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
if (hasBlockChild) {
|
|
119
|
-
hasBlockClass = true
|
|
120
|
-
|
|
121
|
-
// when ins/del span across lines we will no longer detect the br+br
|
|
122
|
-
// sibling combination so strip out since this child will be treated
|
|
123
|
-
// as block already.
|
|
124
|
-
if (child.childNodes.length > 1) {
|
|
125
|
-
for (let grandChild of childChildren) {
|
|
126
|
-
if (grandChild.nodeName.toLowerCase() === 'br') {
|
|
127
|
-
grandChild.remove()
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
if (blockSet.has(childNodeName) || hasBlockClass) {
|
|
134
|
-
bucketNumber++
|
|
135
|
-
buckets[bucketNumber] = []
|
|
136
|
-
buckets[bucketNumber].push(child)
|
|
137
|
-
buckets[bucketNumber].isBlock = true
|
|
138
|
-
} else if (
|
|
139
|
-
childNodeName !== 'br' &&
|
|
140
|
-
(prevChild === null || prevChild === 'br' || blockSet.has(prevChild))
|
|
141
|
-
) {
|
|
142
|
-
bucketNumber++
|
|
143
|
-
buckets[bucketNumber] = []
|
|
144
|
-
buckets[bucketNumber].push(child)
|
|
145
|
-
} else if (childNodeName !== 'br' && prevChild !== 'br') {
|
|
146
|
-
if (buckets[bucketNumber].isBlock) {
|
|
147
|
-
bucketNumber++
|
|
148
|
-
buckets[bucketNumber] = []
|
|
149
|
-
}
|
|
150
|
-
buckets[bucketNumber].push(child)
|
|
151
|
-
} else if (childNodeName === 'br' && prevChild === null) {
|
|
152
|
-
bucketNumber++
|
|
153
|
-
buckets[bucketNumber] = []
|
|
154
|
-
buckets[bucketNumber].push(child)
|
|
155
|
-
buckets[bucketNumber].isBreaks = true
|
|
156
|
-
buckets[bucketNumber].isFirst = true
|
|
157
|
-
} else if (childNodeName === 'br' && prevChild !== 'br') {
|
|
158
|
-
bucketNumber++
|
|
159
|
-
buckets[bucketNumber] = []
|
|
160
|
-
buckets[bucketNumber].push(child)
|
|
161
|
-
buckets[bucketNumber].isBreaks = true
|
|
162
|
-
} else if (childNodeName === 'br' && prevChild === 'br') {
|
|
163
|
-
buckets[bucketNumber].push(child)
|
|
164
|
-
}
|
|
165
|
-
prevChild = childNodeName
|
|
166
|
-
})
|
|
167
|
-
|
|
168
|
-
return buckets
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const processBuckets = (buckets, blockSet) => {
|
|
172
|
-
const newElement = document.createElement('div')
|
|
173
|
-
let prevBucketBlock = false
|
|
174
|
-
buckets.forEach((bucket, index) => {
|
|
175
|
-
if (bucket.isBreaks && bucket.isFirst) {
|
|
176
|
-
bucket.forEach((child, index) => {
|
|
177
|
-
if (index === 0 && child.length > 1) {
|
|
178
|
-
return
|
|
179
|
-
}
|
|
180
|
-
const line = document.createElement('bsp-line')
|
|
181
|
-
newElement.appendChild(line)
|
|
182
|
-
})
|
|
183
|
-
prevBucketBlock = false
|
|
184
|
-
} else if (bucket.isBreaks && index === buckets.length - 1) {
|
|
185
|
-
const line = document.createElement('bsp-line')
|
|
186
|
-
newElement.appendChild(line)
|
|
187
|
-
} else if (bucket.isBreaks) {
|
|
188
|
-
bucket.forEach((child, index) => {
|
|
189
|
-
if (index === 0 && !prevBucketBlock) {
|
|
190
|
-
return
|
|
191
|
-
}
|
|
192
|
-
const line = document.createElement('bsp-line')
|
|
193
|
-
newElement.appendChild(line)
|
|
194
|
-
})
|
|
195
|
-
prevBucketBlock = false
|
|
196
|
-
} else if (bucket.isBlock) {
|
|
197
|
-
bucket.forEach((child) => {
|
|
198
|
-
const childBuckets = getBucketsFromElement(
|
|
199
|
-
[...child.childNodes],
|
|
200
|
-
blockSet,
|
|
201
|
-
)
|
|
202
|
-
let processedChildren = processBuckets(childBuckets, blockSet)
|
|
203
|
-
child.innerHTML = ''
|
|
204
|
-
;[...processedChildren.childNodes].forEach((processedChild) => {
|
|
205
|
-
child.appendChild(processedChild)
|
|
206
|
-
})
|
|
207
|
-
newElement.appendChild(child)
|
|
208
|
-
})
|
|
209
|
-
prevBucketBlock = true
|
|
210
|
-
} else {
|
|
211
|
-
const line = document.createElement('bsp-line')
|
|
212
|
-
bucket.forEach((child) => {
|
|
213
|
-
line.appendChild(child)
|
|
214
|
-
})
|
|
215
|
-
newElement.appendChild(line)
|
|
216
|
-
prevBucketBlock = false
|
|
217
|
-
}
|
|
218
|
-
})
|
|
219
|
-
return newElement
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* If a node is of a type not known to the schema the opening and closing tags
|
|
224
|
-
* should be wrapped in a 'code' element.
|
|
225
|
-
*
|
|
226
|
-
* @param {Node} root The root node.
|
|
227
|
-
* @param {Set} allowedTagsSet A set of tag names known to the schema.
|
|
228
|
-
* @param {boolean} skipRawTagsCheck Skip this check altogether.
|
|
229
|
-
*/
|
|
230
|
-
function wrapUnsupportedTags(root, allowedTagsSet, skipRawTagsCheck) {
|
|
231
|
-
const nodes = []
|
|
232
|
-
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
|
|
233
|
-
acceptNode: function (node) {
|
|
234
|
-
const classList = node.className
|
|
235
|
-
? node.className.toString().split(' ')
|
|
236
|
-
: []
|
|
237
|
-
const hasAllowedClass = classList.some((className) => {
|
|
238
|
-
return allowedTagsSet.has(`.${className}`)
|
|
239
|
-
})
|
|
240
|
-
|
|
241
|
-
if (
|
|
242
|
-
!allowedTagsSet.has(node.nodeName.toLowerCase()) &&
|
|
243
|
-
!hasAllowedClass &&
|
|
244
|
-
!skipRawTagsCheck
|
|
245
|
-
) {
|
|
246
|
-
return NodeFilter.FILTER_ACCEPT
|
|
247
|
-
}
|
|
248
|
-
return NodeFilter.FILTER_REJECT
|
|
249
|
-
},
|
|
250
|
-
})
|
|
251
|
-
|
|
252
|
-
// Just collect nodes, manipulation will need to be done outside of TreeWalker.
|
|
253
|
-
while (walker.nextNode()) {
|
|
254
|
-
nodes.push(walker.currentNode)
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
nodes.forEach((unsupported) => {
|
|
258
|
-
const parent = unsupported.parentNode
|
|
259
|
-
const codeStart = create(
|
|
260
|
-
'code',
|
|
261
|
-
unsupported.outerHTML.slice(0, unsupported.outerHTML.indexOf('>') + 1),
|
|
262
|
-
)
|
|
263
|
-
const codeEnd = create('code', `</${unsupported.nodeName.toLowerCase()}>`)
|
|
264
|
-
|
|
265
|
-
parent.insertBefore(codeStart, unsupported)
|
|
266
|
-
while (unsupported.firstChild) {
|
|
267
|
-
parent.insertBefore(unsupported.firstChild, unsupported)
|
|
268
|
-
}
|
|
269
|
-
parent.insertBefore(codeEnd, unsupported)
|
|
270
|
-
parent.removeChild(unsupported)
|
|
271
|
-
})
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
export { getLegacyHTMLTextForProsemirror }
|
|
Binary file
|
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import { DOMParser, Schema } from 'prosemirror-model'
|
|
2
|
-
import Cookies from 'js-cookie'
|
|
3
|
-
import { Plugin, PluginKey, TextSelection } from 'prosemirror-state'
|
|
4
|
-
import { constants } from './settings/constants'
|
|
5
|
-
import { EditorView } from 'prosemirror-view'
|
|
6
|
-
|
|
7
|
-
export const interchangeable = (schema: Schema) => {
|
|
8
|
-
return new Plugin({
|
|
9
|
-
key: new PluginKey('interchangeable'),
|
|
10
|
-
props: {
|
|
11
|
-
handleDOMEvents: {
|
|
12
|
-
interchange: (view, evt) => {
|
|
13
|
-
const drawerUrl = '/cms/drawer/item-interchange'
|
|
14
|
-
const detail = evt.detail
|
|
15
|
-
|
|
16
|
-
// Conversion inside RTE Body
|
|
17
|
-
if (detail.loadableTypes) {
|
|
18
|
-
const enhancement = detail.node
|
|
19
|
-
const meta = enhancement.attrs.meta
|
|
20
|
-
const attributes = enhancement.attrs.attributes
|
|
21
|
-
const tr = view.state.tr
|
|
22
|
-
|
|
23
|
-
const query = new URLSearchParams()
|
|
24
|
-
query.set('typeId', meta.typeId)
|
|
25
|
-
query.set('targetTypeId', attributes['data-convert-target'])
|
|
26
|
-
query.set('itemState', attributes['data-state'])
|
|
27
|
-
query.set('isRte', 'true')
|
|
28
|
-
query.set('isConvert', 'true')
|
|
29
|
-
|
|
30
|
-
const headers = new Headers()
|
|
31
|
-
const cookie = Cookies.get('bsp.csrf')
|
|
32
|
-
|
|
33
|
-
if (cookie) {
|
|
34
|
-
headers.append('Brightspot-CSRF', cookie)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
fetch(`${drawerUrl}`, {
|
|
38
|
-
method: 'POST',
|
|
39
|
-
credentials: 'include',
|
|
40
|
-
body: query,
|
|
41
|
-
headers,
|
|
42
|
-
}).then((response) => {
|
|
43
|
-
response.text().then((text) => {
|
|
44
|
-
const data = { ...JSON.parse(text) }
|
|
45
|
-
|
|
46
|
-
// Update state and loadable types after conversion
|
|
47
|
-
attributes['data-state'] = data['data-state']
|
|
48
|
-
attributes['data-loadable-types'] = data['data-loadable-types']
|
|
49
|
-
|
|
50
|
-
const newEnhancement = enhancement.type.create({
|
|
51
|
-
attributes: data,
|
|
52
|
-
typeId: attributes['data-convert-target'],
|
|
53
|
-
meta: meta,
|
|
54
|
-
id: enhancement.attrs.id,
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
tr.replaceSelectionWith(newEnhancement)
|
|
58
|
-
|
|
59
|
-
view.dispatch(tr)
|
|
60
|
-
})
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
return
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const sortableTypes =
|
|
67
|
-
evt.detail.to.dataset.sortableValidItemTypes.split(' ')
|
|
68
|
-
const items =
|
|
69
|
-
evt.detail.items.length > 0 ? evt.detail.items : [evt.detail.item]
|
|
70
|
-
|
|
71
|
-
processItems(view, schema, items, drawerUrl, sortableTypes)
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
})
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/** Process each item to be inserted into the editor
|
|
79
|
-
* @param view - The ProseMirror editor view
|
|
80
|
-
* @param schema - The ProseMirror schema
|
|
81
|
-
* @param items - The list of HTML elements representing the items to be processed
|
|
82
|
-
* @param drawerUrl - The URL endpoint for fetching item data
|
|
83
|
-
* @param sortableTypes - The list of valid sortable item types
|
|
84
|
-
*/
|
|
85
|
-
async function processItems(
|
|
86
|
-
view: EditorView,
|
|
87
|
-
schema: Schema,
|
|
88
|
-
items: HTMLElement[],
|
|
89
|
-
drawerUrl: string,
|
|
90
|
-
sortableTypes: string[],
|
|
91
|
-
): Promise<void> {
|
|
92
|
-
for (const selected in items) {
|
|
93
|
-
const item = items[selected]
|
|
94
|
-
let meta: any
|
|
95
|
-
|
|
96
|
-
const loadTypes = item.dataset.sortableLoadTypes?.split(' ') || []
|
|
97
|
-
const id = item.dataset.id
|
|
98
|
-
const targetTypeId = loadTypes.find((type: string) =>
|
|
99
|
-
sortableTypes.includes(type),
|
|
100
|
-
)
|
|
101
|
-
const query = new URLSearchParams()
|
|
102
|
-
query.set('id', id || '')
|
|
103
|
-
query.set('targetTypeId', targetTypeId || '')
|
|
104
|
-
query.set('isRte', 'true')
|
|
105
|
-
|
|
106
|
-
const headers = new Headers()
|
|
107
|
-
const cookie = Cookies.get('bsp.csrf')
|
|
108
|
-
|
|
109
|
-
if (cookie) {
|
|
110
|
-
headers.append('Brightspot-CSRF', cookie)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
await fetch(`${drawerUrl}`, {
|
|
114
|
-
method: 'POST',
|
|
115
|
-
credentials: 'include',
|
|
116
|
-
body: query,
|
|
117
|
-
headers,
|
|
118
|
-
})
|
|
119
|
-
.then(async (response) => {
|
|
120
|
-
const text = await response.text()
|
|
121
|
-
const data = { ...JSON.parse(text) }
|
|
122
|
-
const label = data.label
|
|
123
|
-
|
|
124
|
-
const elements = window.RICH_TEXT_ELEMENTS
|
|
125
|
-
|
|
126
|
-
if (elements instanceof Array) {
|
|
127
|
-
meta = elements.find(
|
|
128
|
-
(item: { tag: string }) => item.tag === data.tagName,
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (meta) {
|
|
133
|
-
let enhancementType
|
|
134
|
-
let enhancement
|
|
135
|
-
|
|
136
|
-
// Ensure we have a collapsed cursor, not a selection range
|
|
137
|
-
const selection = view.state.selection
|
|
138
|
-
const from = selection.ranges[0].$to.pos
|
|
139
|
-
let to = from
|
|
140
|
-
const tr = view.state.tr
|
|
141
|
-
|
|
142
|
-
// If there's a selection range, collapse it to a cursor at the end
|
|
143
|
-
if (!selection.empty) {
|
|
144
|
-
const $pos = tr.doc.resolve(from)
|
|
145
|
-
tr.setSelection(TextSelection.near($pos))
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (meta.tag === 'a') {
|
|
149
|
-
enhancementType = schema.marks[meta.tag]
|
|
150
|
-
enhancement = enhancementType.create({
|
|
151
|
-
label,
|
|
152
|
-
attributes: data,
|
|
153
|
-
typeId: targetTypeId,
|
|
154
|
-
meta: meta,
|
|
155
|
-
id: id,
|
|
156
|
-
})
|
|
157
|
-
const domFragment = document.createElement('div')
|
|
158
|
-
domFragment.innerHTML = label || ''
|
|
159
|
-
|
|
160
|
-
// Add line breaks if multiple link items are dropped
|
|
161
|
-
if (items.length > 1) {
|
|
162
|
-
domFragment.append(document.createElement('br'))
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
const slice = DOMParser.fromSchema(schema).parseSlice(domFragment, {
|
|
166
|
-
preserveWhitespace: 'full',
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
to = from + slice.size
|
|
170
|
-
|
|
171
|
-
tr.replaceSelection(slice).addMark(from, to, enhancement)
|
|
172
|
-
// Use TextSelection.near to find valid selection position
|
|
173
|
-
const $pos = tr.doc.resolve(to)
|
|
174
|
-
tr.setSelection(TextSelection.near($pos))
|
|
175
|
-
} else {
|
|
176
|
-
enhancementType = schema.nodes[meta.tag]
|
|
177
|
-
enhancement = enhancementType.create({
|
|
178
|
-
label: meta.tag !== 'bsp-module' ? label : null,
|
|
179
|
-
attributes: data,
|
|
180
|
-
typeId: targetTypeId,
|
|
181
|
-
meta: meta,
|
|
182
|
-
id: id,
|
|
183
|
-
})
|
|
184
|
-
|
|
185
|
-
const $from = tr.doc.resolve(from)
|
|
186
|
-
const parent = $from.parent
|
|
187
|
-
const isAtEndOfBlock =
|
|
188
|
-
parent.isTextblock && $from.parentOffset === parent.content.size
|
|
189
|
-
|
|
190
|
-
let selectionPos: number
|
|
191
|
-
|
|
192
|
-
if (parent.isTextblock && isAtEndOfBlock) {
|
|
193
|
-
// At end of textblock - insert after the block
|
|
194
|
-
const insertDepth =
|
|
195
|
-
$from.depth > 1 ? $from.depth - 1 : $from.depth
|
|
196
|
-
const insertPos = $from.after(insertDepth)
|
|
197
|
-
tr.insert(insertPos, enhancement)
|
|
198
|
-
|
|
199
|
-
const afterEnhancement = insertPos + enhancement.nodeSize
|
|
200
|
-
|
|
201
|
-
// If at document end, add a new line for subsequent content
|
|
202
|
-
if (afterEnhancement >= tr.doc.content.size) {
|
|
203
|
-
const lineType = schema.nodes['line']
|
|
204
|
-
if (lineType) {
|
|
205
|
-
tr.insert(afterEnhancement, lineType.create())
|
|
206
|
-
selectionPos = afterEnhancement + 1
|
|
207
|
-
} else {
|
|
208
|
-
selectionPos = afterEnhancement
|
|
209
|
-
}
|
|
210
|
-
} else {
|
|
211
|
-
selectionPos = afterEnhancement
|
|
212
|
-
}
|
|
213
|
-
} else {
|
|
214
|
-
// In middle of content - replaceSelectionWith handles splitting
|
|
215
|
-
tr.replaceSelectionWith(enhancement)
|
|
216
|
-
selectionPos = from + enhancement.nodeSize
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
const $selPos = tr.doc.resolve(selectionPos)
|
|
220
|
-
tr.setSelection(TextSelection.near($selPos, 1))
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
tr.setMeta('enhancementManager$', {
|
|
224
|
-
remove: { id },
|
|
225
|
-
})
|
|
226
|
-
|
|
227
|
-
if (
|
|
228
|
-
view.dom.parentElement?.classList.contains(
|
|
229
|
-
constants.CLASSES.IS_PLACEHOLDER_CONTENT,
|
|
230
|
-
)
|
|
231
|
-
) {
|
|
232
|
-
view.dom.parentElement?.classList.remove(
|
|
233
|
-
constants.CLASSES.IS_PLACEHOLDER_CONTENT,
|
|
234
|
-
)
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
try {
|
|
238
|
-
view.dispatch(tr)
|
|
239
|
-
} catch (error) {
|
|
240
|
-
// Do nothing
|
|
241
|
-
}
|
|
242
|
-
} else {
|
|
243
|
-
return
|
|
244
|
-
}
|
|
245
|
-
})
|
|
246
|
-
.catch(() => {
|
|
247
|
-
// Do nothing
|
|
248
|
-
})
|
|
249
|
-
}
|
|
250
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import insertBefore from '../dom/insertBefore'
|
|
2
|
-
import $ from 'jquery'
|
|
3
|
-
import { DOMParser } from 'prosemirror-model'
|
|
4
|
-
import { Plugin } from 'prosemirror-state'
|
|
5
|
-
import { tabbable } from 'tabbable'
|
|
6
|
-
|
|
7
|
-
export const mention = (element) => {
|
|
8
|
-
const inputTemplate = document.querySelector('template#rte-mention-input')
|
|
9
|
-
let form
|
|
10
|
-
|
|
11
|
-
if (inputTemplate) {
|
|
12
|
-
form = document.createElement('form')
|
|
13
|
-
form.className = 'Mention'
|
|
14
|
-
form.appendChild(inputTemplate.content.cloneNode(true))
|
|
15
|
-
insertBefore(form, element)
|
|
16
|
-
$(form).trigger('create')
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return new Plugin({
|
|
20
|
-
props: {
|
|
21
|
-
handleTextInput: (view, from, to, text) => {
|
|
22
|
-
if (!form) return false
|
|
23
|
-
if (text !== '@') return false
|
|
24
|
-
if (from !== 1) {
|
|
25
|
-
let lastChar = view.state.doc.textBetween(from - 1, to)
|
|
26
|
-
if (!/\s/.test(lastChar) && lastChar !== '') {
|
|
27
|
-
return false
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const select = form.querySelector('.ContentSelector-select')
|
|
32
|
-
if (!select) return false
|
|
33
|
-
|
|
34
|
-
select.value = ''
|
|
35
|
-
select.dispatchEvent(new CustomEvent('change', { bubbles: true }))
|
|
36
|
-
|
|
37
|
-
const parentCoords = form.offsetParent.getBoundingClientRect()
|
|
38
|
-
form.style.left = `${view.coordsAtPos(from).left - parentCoords.left}px`
|
|
39
|
-
form.style.top = `${
|
|
40
|
-
view.domAtPos(from).node.getBoundingClientRect().top -
|
|
41
|
-
parentCoords.top
|
|
42
|
-
}px`
|
|
43
|
-
form.style.visibility = 'visible'
|
|
44
|
-
|
|
45
|
-
const firstInput = tabbable(form)[0]
|
|
46
|
-
firstInput.focus()
|
|
47
|
-
firstInput.click()
|
|
48
|
-
|
|
49
|
-
const changeListener = () => {
|
|
50
|
-
select.removeEventListener('change', changeListener)
|
|
51
|
-
|
|
52
|
-
const value = select.value
|
|
53
|
-
if (!value) return
|
|
54
|
-
|
|
55
|
-
const mention = document.createElement('bsp-mention')
|
|
56
|
-
mention.setAttribute('user-id', value)
|
|
57
|
-
mention.innerText =
|
|
58
|
-
'@' +
|
|
59
|
-
Array.prototype.filter.call(select, (o) => o.value === value)[0]
|
|
60
|
-
.label
|
|
61
|
-
|
|
62
|
-
const wrapper = document.createElement('div')
|
|
63
|
-
wrapper.appendChild(mention)
|
|
64
|
-
wrapper.appendChild(document.createTextNode(' '))
|
|
65
|
-
|
|
66
|
-
const state = view.state
|
|
67
|
-
view.dispatch(
|
|
68
|
-
state.tr.replaceRange(
|
|
69
|
-
from,
|
|
70
|
-
to + 1,
|
|
71
|
-
DOMParser.fromSchema(state.config.schema).parseSlice(wrapper, {
|
|
72
|
-
preserveWhitespace: true,
|
|
73
|
-
}),
|
|
74
|
-
),
|
|
75
|
-
)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const hideListener = () => {
|
|
79
|
-
select.removeEventListener('combo-input:hide', hideListener)
|
|
80
|
-
view.focus()
|
|
81
|
-
form.style.visibility = 'hidden'
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
select.addEventListener('change', changeListener)
|
|
85
|
-
select.addEventListener('combo-input:hide', hideListener)
|
|
86
|
-
return false
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
})
|
|
90
|
-
}
|