@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,1281 +0,0 @@
|
|
|
1
|
-
import { Schema } from 'prosemirror-model'
|
|
2
|
-
import { constants } from './constants'
|
|
3
|
-
import { v1 as uuidv1 } from 'uuid'
|
|
4
|
-
|
|
5
|
-
const PENDING = RTE_PENDING || 'Pending' /* global RTE_PENDING */
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Taken from ProseMirror table's plugin.
|
|
9
|
-
*
|
|
10
|
-
* @param {Element} dom The table cell from which to get the
|
|
11
|
-
* attributes.
|
|
12
|
-
*/
|
|
13
|
-
const getCellAttrs = (dom) => {
|
|
14
|
-
let widthAttr = dom.getAttribute('data-colwidth')
|
|
15
|
-
let widths =
|
|
16
|
-
widthAttr && /^\d+(,\d+)*$/.test(widthAttr)
|
|
17
|
-
? widthAttr.split(',').map((s) => Number(s))
|
|
18
|
-
: null
|
|
19
|
-
let colspan = Number(dom.getAttribute('colspan') || 1)
|
|
20
|
-
const result = {
|
|
21
|
-
colspan,
|
|
22
|
-
rowspan: Number(dom.getAttribute('rowspan') || 1),
|
|
23
|
-
colwidth: widths && widths.length === colspan ? widths : null,
|
|
24
|
-
}
|
|
25
|
-
const attributes = Object.fromEntries(
|
|
26
|
-
Array.from(dom.attributes)
|
|
27
|
-
.filter((attr) => !(attr.name in result))
|
|
28
|
-
.map((attr) => [attr.name, attr.value]),
|
|
29
|
-
)
|
|
30
|
-
result.attributes = attributes
|
|
31
|
-
|
|
32
|
-
return result
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Taken from ProseMirror table's plugin.
|
|
37
|
-
*
|
|
38
|
-
* @param {ProseMirror.Model.Node} node The table cell node representation.
|
|
39
|
-
*/
|
|
40
|
-
const setCellAttrs = (node) => {
|
|
41
|
-
let attrs = {}
|
|
42
|
-
if (node.attrs.colspan !== 1) attrs.colspan = node.attrs.colspan
|
|
43
|
-
if (node.attrs.rowspan !== 1) attrs.rowspan = node.attrs.rowspan
|
|
44
|
-
if (node.attrs.colwidth) {
|
|
45
|
-
attrs['data-colwidth'] = node.attrs.colwidth.join(',')
|
|
46
|
-
}
|
|
47
|
-
for (let key in node.attrs) {
|
|
48
|
-
attrs[key] = node.attrs[key]
|
|
49
|
-
}
|
|
50
|
-
return attrs
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const DOC_CONTENT = `(line
|
|
54
|
-
| ${constants.NODES.GROUPS.aligned}
|
|
55
|
-
| ${constants.NODES.GROUPS.list}
|
|
56
|
-
| ${constants.NODES.GROUPS.block})+`
|
|
57
|
-
|
|
58
|
-
const LIST_ITEM_CONTENT = `(line
|
|
59
|
-
| ${constants.NODES.GROUPS.list}
|
|
60
|
-
| ${constants.NODES.GROUPS.block})+`
|
|
61
|
-
|
|
62
|
-
const baseNodes = {
|
|
63
|
-
doc: {
|
|
64
|
-
content: DOC_CONTENT,
|
|
65
|
-
marks: 'del ins',
|
|
66
|
-
},
|
|
67
|
-
line: {
|
|
68
|
-
content: `${constants.NODES.GROUPS.inline}*`,
|
|
69
|
-
group: `${constants.NODES.GROUPS.block}`,
|
|
70
|
-
marks: '_',
|
|
71
|
-
parseDOM: [
|
|
72
|
-
{
|
|
73
|
-
tag: 'bsp-line',
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
tag: 'br',
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
toDOM(node) {
|
|
80
|
-
return ['bsp-line', node.attrs, 0]
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
p: {
|
|
84
|
-
content: 'inline*',
|
|
85
|
-
group: `block`,
|
|
86
|
-
parseDOM: [{ tag: 'p' }],
|
|
87
|
-
toDOM(node) {
|
|
88
|
-
return ['p', node.attrs, 0]
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
table: {
|
|
92
|
-
attrs: {
|
|
93
|
-
id: { default: 'rte-' + uuidv1() },
|
|
94
|
-
attributes: { default: {} },
|
|
95
|
-
_state: { default: {} },
|
|
96
|
-
},
|
|
97
|
-
content: 'tableRow+',
|
|
98
|
-
tableRole: 'table',
|
|
99
|
-
isolating: true,
|
|
100
|
-
group: `block`,
|
|
101
|
-
parseDOM: [
|
|
102
|
-
{
|
|
103
|
-
tag: 'table',
|
|
104
|
-
getAttrs(dom) {
|
|
105
|
-
const attributes = [...dom.attributes].reduce((prev, next) => {
|
|
106
|
-
prev[next.name] = next.nodeValue
|
|
107
|
-
return prev
|
|
108
|
-
}, {})
|
|
109
|
-
return {
|
|
110
|
-
id: dom.id || 'rte-' + uuidv1(),
|
|
111
|
-
attributes,
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
],
|
|
116
|
-
toDOM(node) {
|
|
117
|
-
return [
|
|
118
|
-
'table',
|
|
119
|
-
{
|
|
120
|
-
...node.attrs.attributes,
|
|
121
|
-
id: node.attrs.id || 'rte-' + uuidv1(),
|
|
122
|
-
},
|
|
123
|
-
['tbody', 0],
|
|
124
|
-
]
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
tableBody: {
|
|
128
|
-
attrs: {
|
|
129
|
-
attributes: { default: {} },
|
|
130
|
-
},
|
|
131
|
-
content: 'tableRow+',
|
|
132
|
-
parseDOM: [{ tag: 'tbody' }],
|
|
133
|
-
toDOM(node) {
|
|
134
|
-
return ['tbody', node.attrs.attributes, 0]
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
tableRow: {
|
|
138
|
-
attrs: {
|
|
139
|
-
attributes: { default: {} },
|
|
140
|
-
},
|
|
141
|
-
content: '(tableCell | tableHeader)*',
|
|
142
|
-
tableRole: 'row',
|
|
143
|
-
parseDOM: [
|
|
144
|
-
{
|
|
145
|
-
tag: 'tr',
|
|
146
|
-
getAttrs(dom) {
|
|
147
|
-
const attributes = [...dom.attributes].reduce((prev, next) => {
|
|
148
|
-
prev[next.name] = next.nodeValue
|
|
149
|
-
return prev
|
|
150
|
-
}, {})
|
|
151
|
-
return {
|
|
152
|
-
attributes,
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
],
|
|
157
|
-
toDOM(node) {
|
|
158
|
-
return ['tr', node.attrs.attributes, 0]
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
tableCell: {
|
|
162
|
-
content: `(block | ${constants.NODES.GROUPS.list} | ${constants.NODES.GROUPS.aligned})+`,
|
|
163
|
-
attrs: {
|
|
164
|
-
colspan: { default: 1 },
|
|
165
|
-
rowspan: { default: 1 },
|
|
166
|
-
colwidth: { default: null },
|
|
167
|
-
attributes: { default: {} },
|
|
168
|
-
},
|
|
169
|
-
tableRole: 'cell',
|
|
170
|
-
isolating: true,
|
|
171
|
-
parseDOM: [{ tag: 'td', getAttrs: (dom) => getCellAttrs(dom) }],
|
|
172
|
-
toDOM(node) {
|
|
173
|
-
return ['td', setCellAttrs(node), 0]
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
tableHeader: {
|
|
177
|
-
content: 'block+',
|
|
178
|
-
attrs: {
|
|
179
|
-
colspan: { default: 1 },
|
|
180
|
-
rowspan: { default: 1 },
|
|
181
|
-
colwidth: { default: null },
|
|
182
|
-
attributes: { default: {} },
|
|
183
|
-
},
|
|
184
|
-
tableRole: 'header_cell',
|
|
185
|
-
isolating: true,
|
|
186
|
-
parseDOM: [{ tag: 'th', getAttrs: (dom) => getCellAttrs(dom) }],
|
|
187
|
-
toDOM(node) {
|
|
188
|
-
return ['th', setCellAttrs(node), 0]
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
[constants.NODES.TEXT.text]: {
|
|
192
|
-
group: constants.NODES.GROUPS.inline,
|
|
193
|
-
},
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const richTextNodes = []
|
|
197
|
-
const richTextElementsStyleNameToTagMap = new Map()
|
|
198
|
-
|
|
199
|
-
const editableInlineWithFieldsEnhancements = [] // marks with attrs
|
|
200
|
-
const editableLineWithFieldsEnhancements = [] // nodes text content with attrs
|
|
201
|
-
const editableInlineWithNoFieldsEnhancements = [] // marks
|
|
202
|
-
const editableLineWithNoFieldsEnhancements = [] // nodes text content
|
|
203
|
-
const nonEditableInlineEnhancements = [] // nodes no content with attrs
|
|
204
|
-
const nonEditableLineEnhancements = [] // nodes no content with attrs
|
|
205
|
-
const nonEditableLineWithNoFieldsEnhancements = [] // nodes
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* The alignment nodes (left, center, right) need special
|
|
209
|
-
* handling and as such are configured here accordingly. We
|
|
210
|
-
* still use the menu config later to determine whether they should
|
|
211
|
-
* be included in the schema or not.
|
|
212
|
-
*
|
|
213
|
-
* @type {Object.<Object|string>}
|
|
214
|
-
*/
|
|
215
|
-
const alignmentNodes = {
|
|
216
|
-
[constants.NODES.ALIGNED.alignedLeft]: {
|
|
217
|
-
attrs: {
|
|
218
|
-
class: { default: constants.CLASSES.CMS_ALIGN_LEFT },
|
|
219
|
-
},
|
|
220
|
-
content: `${constants.NODES.GROUPS.inline}*`,
|
|
221
|
-
group: `${constants.NODES.GROUPS.aligned}`,
|
|
222
|
-
parseDOM: [
|
|
223
|
-
{
|
|
224
|
-
tag: `.${constants.CLASSES.CMS_ALIGN_LEFT}`,
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
tag: `.${constants.CLASSES.RTE_ALIGN_LEFT}`,
|
|
228
|
-
},
|
|
229
|
-
],
|
|
230
|
-
toDOM(node) {
|
|
231
|
-
return [constants.ELEMENTS.DIV, node.attrs, 0]
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
[constants.NODES.ALIGNED.alignedRight]: {
|
|
235
|
-
attrs: {
|
|
236
|
-
class: { default: constants.CLASSES.CMS_ALIGN_RIGHT },
|
|
237
|
-
},
|
|
238
|
-
content: `${constants.NODES.GROUPS.inline}*`,
|
|
239
|
-
group: `${constants.NODES.GROUPS.aligned}`,
|
|
240
|
-
parseDOM: [
|
|
241
|
-
{
|
|
242
|
-
tag: `.${constants.CLASSES.CMS_ALIGN_RIGHT}`,
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
tag: `.${constants.CLASSES.RTE_ALIGN_RIGHT}`,
|
|
246
|
-
},
|
|
247
|
-
],
|
|
248
|
-
toDOM(node) {
|
|
249
|
-
return [constants.ELEMENTS.DIV, node.attrs, 0]
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
|
-
[constants.NODES.ALIGNED.alignedCenter]: {
|
|
253
|
-
attrs: {
|
|
254
|
-
class: { default: constants.CLASSES.CMS_ALIGN_CENTER },
|
|
255
|
-
},
|
|
256
|
-
content: `${constants.NODES.GROUPS.inline}*`,
|
|
257
|
-
group: `${constants.NODES.GROUPS.aligned}`,
|
|
258
|
-
parseDOM: [
|
|
259
|
-
{
|
|
260
|
-
tag: `.${constants.CLASSES.CMS_ALIGN_CENTER}`,
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
tag: `.${constants.CLASSES.RTE_ALIGN_CENTER}`,
|
|
264
|
-
},
|
|
265
|
-
],
|
|
266
|
-
toDOM(node) {
|
|
267
|
-
return [constants.ELEMENTS.DIV, node.attrs, 0]
|
|
268
|
-
},
|
|
269
|
-
},
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* The list nodes (ul, ol) need special
|
|
274
|
-
* handling and as such are configured here accordingly. We
|
|
275
|
-
* still use the menu config later to determine whether they should
|
|
276
|
-
* be included in the schema or not.
|
|
277
|
-
*
|
|
278
|
-
* @type {Object.<Object|string>}
|
|
279
|
-
*/
|
|
280
|
-
const listNodes = {
|
|
281
|
-
[constants.NODES.LISTS.ol]: {
|
|
282
|
-
content: `${constants.NODES.GROUPS.listItem}*`,
|
|
283
|
-
group: `${constants.NODES.GROUPS.list}`,
|
|
284
|
-
attrs: {
|
|
285
|
-
class: { default: constants.CLASSES.RTE_LIST_ORDERED },
|
|
286
|
-
id: { default: 'rte-' + uuidv1() },
|
|
287
|
-
order: { default: 1 },
|
|
288
|
-
attributes: { default: {} },
|
|
289
|
-
},
|
|
290
|
-
marks: '_',
|
|
291
|
-
parseDOM: [
|
|
292
|
-
{
|
|
293
|
-
tag: 'ol',
|
|
294
|
-
getAttrs(dom) {
|
|
295
|
-
const attributes = {}
|
|
296
|
-
attributes['class'] = constants.CLASSES.RTE_LIST_ORDERED
|
|
297
|
-
Array.from(dom.attributes).forEach(
|
|
298
|
-
(attr) => (attributes[attr.name] = attr.value),
|
|
299
|
-
)
|
|
300
|
-
return {
|
|
301
|
-
id: dom.id || 'rte-' + uuidv1(),
|
|
302
|
-
order: dom.hasAttribute('start') ? +dom.getAttribute('start') : 1,
|
|
303
|
-
attributes,
|
|
304
|
-
}
|
|
305
|
-
},
|
|
306
|
-
},
|
|
307
|
-
],
|
|
308
|
-
toDOM(node) {
|
|
309
|
-
return [
|
|
310
|
-
'ol',
|
|
311
|
-
{
|
|
312
|
-
...node.attrs.attributes,
|
|
313
|
-
id: node.attrs.id || 'rte-' + uuidv1(),
|
|
314
|
-
start: node.attrs.order || 1,
|
|
315
|
-
class: constants.CLASSES.RTE_LIST_ORDERED,
|
|
316
|
-
},
|
|
317
|
-
0,
|
|
318
|
-
]
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
[constants.NODES.LISTS.ul]: {
|
|
322
|
-
content: `${constants.NODES.GROUPS.listItem}*`,
|
|
323
|
-
group: `${constants.NODES.GROUPS.list}`,
|
|
324
|
-
attrs: {
|
|
325
|
-
class: { default: constants.CLASSES.RTE_LIST_UNORDERED },
|
|
326
|
-
id: { default: 'rte-' + uuidv1() },
|
|
327
|
-
attributes: { default: {} },
|
|
328
|
-
},
|
|
329
|
-
marks: '_',
|
|
330
|
-
parseDOM: [
|
|
331
|
-
{
|
|
332
|
-
tag: 'ul',
|
|
333
|
-
getAttrs(dom) {
|
|
334
|
-
const attributes = {}
|
|
335
|
-
attributes['class'] = constants.CLASSES.RTE_LIST_UNORDERED
|
|
336
|
-
Array.from(dom.attributes).forEach(
|
|
337
|
-
(attr) => (attributes[attr.name] = attr.value),
|
|
338
|
-
)
|
|
339
|
-
return {
|
|
340
|
-
id: dom.id || 'rte-' + uuidv1(),
|
|
341
|
-
attributes,
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
},
|
|
345
|
-
],
|
|
346
|
-
toDOM(node) {
|
|
347
|
-
return [
|
|
348
|
-
'ul',
|
|
349
|
-
{
|
|
350
|
-
...node.attrs.attributes,
|
|
351
|
-
id: node.attrs.id || 'rte-' + uuidv1(),
|
|
352
|
-
},
|
|
353
|
-
0,
|
|
354
|
-
]
|
|
355
|
-
},
|
|
356
|
-
},
|
|
357
|
-
[constants.NODES.LISTS.listItem]: {
|
|
358
|
-
content: LIST_ITEM_CONTENT,
|
|
359
|
-
attrs: {
|
|
360
|
-
class: { default: constants.CLASSES.CMS_LI_LIST_ITEM_DIV },
|
|
361
|
-
},
|
|
362
|
-
marks: '_',
|
|
363
|
-
parseDOM: [
|
|
364
|
-
{
|
|
365
|
-
tag: constants.ELEMENTS.LI,
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
tag: `.${constants.CLASSES.CMS_LI_LIST_ITEM_DIV}`,
|
|
369
|
-
},
|
|
370
|
-
],
|
|
371
|
-
toDOM(node) {
|
|
372
|
-
return [constants.ELEMENTS.LI, node.attrs, 0]
|
|
373
|
-
},
|
|
374
|
-
defining: true,
|
|
375
|
-
},
|
|
376
|
-
[constants.NODES.LISTS.listItemDiv]: {
|
|
377
|
-
content: `${constants.NODES.GROUPS.inline}*`,
|
|
378
|
-
isTextBlock: true,
|
|
379
|
-
group: constants.NODES.GROUPS.block,
|
|
380
|
-
attrs: {
|
|
381
|
-
class: { default: constants.CLASSES.CMS_LIST_ITEM_DIV },
|
|
382
|
-
},
|
|
383
|
-
marks: '_',
|
|
384
|
-
parseDOM: [
|
|
385
|
-
{
|
|
386
|
-
tag: `.${constants.CLASSES.CMS_LIST_ITEM_DIV}`,
|
|
387
|
-
},
|
|
388
|
-
],
|
|
389
|
-
toDOM(node) {
|
|
390
|
-
return [constants.ELEMENTS.DIV, node.attrs, 0]
|
|
391
|
-
},
|
|
392
|
-
},
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* This builds the enhancements node objects. Only used
|
|
397
|
-
* when a toolbar configuration calls for enhancements
|
|
398
|
-
* inclusion.
|
|
399
|
-
*/
|
|
400
|
-
const getEnhancements = () => {
|
|
401
|
-
const enhancements = {}
|
|
402
|
-
|
|
403
|
-
RICH_TEXT_ELEMENTS_PM.forEach((obj) => {
|
|
404
|
-
if (
|
|
405
|
-
obj.tag === 'table' ||
|
|
406
|
-
obj.tag === 'tr' ||
|
|
407
|
-
obj.tag === 'td' ||
|
|
408
|
-
obj.tag === 'ul' ||
|
|
409
|
-
obj.tag === 'ol'
|
|
410
|
-
) {
|
|
411
|
-
return
|
|
412
|
-
}
|
|
413
|
-
richTextElementsStyleNameToTagMap.set(obj.styleName, obj.tag)
|
|
414
|
-
if (obj.popup) {
|
|
415
|
-
if (obj.readOnly) {
|
|
416
|
-
if (obj.line) {
|
|
417
|
-
nonEditableLineEnhancements.push(obj)
|
|
418
|
-
} else {
|
|
419
|
-
nonEditableInlineEnhancements.push(obj)
|
|
420
|
-
}
|
|
421
|
-
} else {
|
|
422
|
-
if (obj.line) {
|
|
423
|
-
editableLineWithFieldsEnhancements.push(obj)
|
|
424
|
-
} else {
|
|
425
|
-
editableInlineWithFieldsEnhancements.push(obj)
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
} else {
|
|
429
|
-
if (obj.readOnly) {
|
|
430
|
-
if (obj.line) {
|
|
431
|
-
nonEditableLineWithNoFieldsEnhancements.push(obj)
|
|
432
|
-
} else {
|
|
433
|
-
nonEditableInlineEnhancements.push(obj)
|
|
434
|
-
}
|
|
435
|
-
} else {
|
|
436
|
-
if (obj.line) {
|
|
437
|
-
editableLineWithNoFieldsEnhancements.push(obj)
|
|
438
|
-
} else {
|
|
439
|
-
editableInlineWithNoFieldsEnhancements.push(obj)
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
})
|
|
444
|
-
|
|
445
|
-
nonEditableLineWithNoFieldsEnhancements.forEach((obj) => {
|
|
446
|
-
enhancements[obj.tag] = {
|
|
447
|
-
attrs: {
|
|
448
|
-
class: {
|
|
449
|
-
default: '',
|
|
450
|
-
},
|
|
451
|
-
contenteditable: {
|
|
452
|
-
default: false,
|
|
453
|
-
},
|
|
454
|
-
meta: { default: {} },
|
|
455
|
-
label: { default: '' },
|
|
456
|
-
},
|
|
457
|
-
content: 'inline*',
|
|
458
|
-
group: 'block',
|
|
459
|
-
toDOM(node) {
|
|
460
|
-
node.attrs.class = `rte2-style-${obj.styleName}`
|
|
461
|
-
if (obj.extraCssClasses) {
|
|
462
|
-
node.attrs.class = `${node.attrs.class} ${obj.extraCssClasses}`
|
|
463
|
-
}
|
|
464
|
-
node.attrs.meta = obj
|
|
465
|
-
return [obj.tag, node.attrs, 0]
|
|
466
|
-
},
|
|
467
|
-
parseDOM: [
|
|
468
|
-
{
|
|
469
|
-
tag: obj.tag,
|
|
470
|
-
getAttrs(dom) {
|
|
471
|
-
return {
|
|
472
|
-
label: dom.innerHTML,
|
|
473
|
-
meta: obj,
|
|
474
|
-
}
|
|
475
|
-
},
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
tag: `.${obj.styleName}`,
|
|
479
|
-
getAttrs(dom) {
|
|
480
|
-
return {
|
|
481
|
-
label: dom.innerHTML,
|
|
482
|
-
meta: obj,
|
|
483
|
-
}
|
|
484
|
-
},
|
|
485
|
-
},
|
|
486
|
-
],
|
|
487
|
-
}
|
|
488
|
-
})
|
|
489
|
-
|
|
490
|
-
editableLineWithNoFieldsEnhancements.forEach((obj) => {
|
|
491
|
-
enhancements[obj.tag] = {
|
|
492
|
-
attrs: {
|
|
493
|
-
class: {
|
|
494
|
-
default: '',
|
|
495
|
-
},
|
|
496
|
-
meta: { default: {} },
|
|
497
|
-
label: { default: '' },
|
|
498
|
-
},
|
|
499
|
-
content: 'inline*',
|
|
500
|
-
group: 'block',
|
|
501
|
-
toDOM(node) {
|
|
502
|
-
node.attrs.class = `rte2-style-${obj.styleName}`
|
|
503
|
-
if (obj.extraCssClasses) {
|
|
504
|
-
node.attrs.class = `${node.attrs.class} ${obj.extraCssClasses}`
|
|
505
|
-
}
|
|
506
|
-
node.attrs.meta = obj
|
|
507
|
-
return [obj.tag, node.attrs, 0]
|
|
508
|
-
},
|
|
509
|
-
parseDOM: [
|
|
510
|
-
{
|
|
511
|
-
tag: obj.tag,
|
|
512
|
-
getAttrs(dom) {
|
|
513
|
-
return {
|
|
514
|
-
label: obj.readOnly ? dom.innerHTML : obj.displayName,
|
|
515
|
-
meta: obj,
|
|
516
|
-
}
|
|
517
|
-
},
|
|
518
|
-
},
|
|
519
|
-
{
|
|
520
|
-
tag: `.${obj.styleName}`,
|
|
521
|
-
getAttrs(dom) {
|
|
522
|
-
return {
|
|
523
|
-
label: obj.readOnly ? dom.innerHTML : obj.displayName,
|
|
524
|
-
meta: obj,
|
|
525
|
-
}
|
|
526
|
-
},
|
|
527
|
-
},
|
|
528
|
-
],
|
|
529
|
-
}
|
|
530
|
-
})
|
|
531
|
-
|
|
532
|
-
editableLineWithFieldsEnhancements.forEach((obj) => {
|
|
533
|
-
enhancements[obj.tag] = {
|
|
534
|
-
attrs: {
|
|
535
|
-
attributes: { default: {} },
|
|
536
|
-
label: { default: '' },
|
|
537
|
-
meta: { default: {} },
|
|
538
|
-
typeId: { default: '' },
|
|
539
|
-
id: { default: '' },
|
|
540
|
-
},
|
|
541
|
-
content: 'inline*',
|
|
542
|
-
group: 'block',
|
|
543
|
-
toDOM(node) {
|
|
544
|
-
const domAttrs = {
|
|
545
|
-
label: node.attrs.label,
|
|
546
|
-
...node.attrs.attributes,
|
|
547
|
-
}
|
|
548
|
-
if (obj.extraCssClasses) {
|
|
549
|
-
domAttrs.class = `${domAttrs.class || ''} ${obj.extraCssClasses}`
|
|
550
|
-
}
|
|
551
|
-
return [obj.tag, domAttrs, 0]
|
|
552
|
-
},
|
|
553
|
-
parseDOM: [
|
|
554
|
-
{
|
|
555
|
-
tag: obj.tag,
|
|
556
|
-
getAttrs(dom) {
|
|
557
|
-
const attributes = [...dom.attributes].reduce((prev, next) => {
|
|
558
|
-
prev[next.name] = next.nodeValue
|
|
559
|
-
return prev
|
|
560
|
-
}, {})
|
|
561
|
-
return {
|
|
562
|
-
attributes: attributes,
|
|
563
|
-
label: dom.innerHTML,
|
|
564
|
-
meta: obj,
|
|
565
|
-
id: dom.id || `enhancement-${uuidv1()}`,
|
|
566
|
-
}
|
|
567
|
-
},
|
|
568
|
-
},
|
|
569
|
-
],
|
|
570
|
-
}
|
|
571
|
-
})
|
|
572
|
-
|
|
573
|
-
nonEditableLineEnhancements.forEach((obj) => {
|
|
574
|
-
enhancements[obj.tag] = {
|
|
575
|
-
attrs: {
|
|
576
|
-
attributes: { default: {} },
|
|
577
|
-
label: { default: '' },
|
|
578
|
-
meta: { default: {} },
|
|
579
|
-
id: { default: '' },
|
|
580
|
-
},
|
|
581
|
-
inline: false,
|
|
582
|
-
marks: 'del ins',
|
|
583
|
-
group: 'block',
|
|
584
|
-
toDOM(node) {
|
|
585
|
-
const element = document.createElement(obj.tag)
|
|
586
|
-
element.innerHTML = node.attrs.label
|
|
587
|
-
element.setAttribute('label', node.attrs.label)
|
|
588
|
-
element.setAttribute('id', node.attrs.id)
|
|
589
|
-
|
|
590
|
-
if (node.attrs.attributes) {
|
|
591
|
-
for (const [name, value] of Object.entries(node.attrs.attributes)) {
|
|
592
|
-
element.setAttribute(name, value)
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
if (obj.extraCssClasses) {
|
|
597
|
-
element.classList.add(...obj.extraCssClasses.split(' '))
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
return element
|
|
601
|
-
},
|
|
602
|
-
parseDOM: [
|
|
603
|
-
{
|
|
604
|
-
tag: obj.tag,
|
|
605
|
-
getAttrs(dom) {
|
|
606
|
-
const attributes = [...dom.attributes].reduce((prev, next) => {
|
|
607
|
-
prev[next.name] = next.nodeValue
|
|
608
|
-
return prev
|
|
609
|
-
}, {})
|
|
610
|
-
|
|
611
|
-
// Clean up any pre-existing bsp-line tags within the enhancement preview
|
|
612
|
-
const children = dom.querySelectorAll('bsp-line')
|
|
613
|
-
const isMultiLine = children.length > 1
|
|
614
|
-
for (const item of children) {
|
|
615
|
-
const br = isMultiLine ? [document.createElement('br')] : []
|
|
616
|
-
item.replaceWith(...item.childNodes, ...br)
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
return {
|
|
620
|
-
attributes: attributes,
|
|
621
|
-
label: dom.innerHTML,
|
|
622
|
-
meta: obj,
|
|
623
|
-
id: `enhancement-${uuidv1()}`,
|
|
624
|
-
}
|
|
625
|
-
},
|
|
626
|
-
},
|
|
627
|
-
],
|
|
628
|
-
}
|
|
629
|
-
})
|
|
630
|
-
|
|
631
|
-
nonEditableInlineEnhancements.forEach((obj) => {
|
|
632
|
-
enhancements[obj.tag] = {
|
|
633
|
-
attrs: {
|
|
634
|
-
attributes: { default: {} },
|
|
635
|
-
label: { default: '' },
|
|
636
|
-
meta: { default: {} },
|
|
637
|
-
id: { default: '' },
|
|
638
|
-
},
|
|
639
|
-
inline: true,
|
|
640
|
-
group: constants.NODES.GROUPS.inline,
|
|
641
|
-
toDOM(node) {
|
|
642
|
-
const text =
|
|
643
|
-
node?.content?.textBetween(0, node.content.size) || node.attrs.label
|
|
644
|
-
const element = document.createElement(obj.tag)
|
|
645
|
-
element.innerHTML = text
|
|
646
|
-
element.setAttribute('label', text)
|
|
647
|
-
element.setAttribute('id', node.attrs.id)
|
|
648
|
-
|
|
649
|
-
for (const [name, value] of Object.entries(node.attrs.attributes)) {
|
|
650
|
-
element.setAttribute(name, value)
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
if (obj.extraCssClasses) {
|
|
654
|
-
element.classList.add(...obj.extraCssClasses.split(' '))
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
return element
|
|
658
|
-
},
|
|
659
|
-
parseDOM: [
|
|
660
|
-
{
|
|
661
|
-
tag: obj.tag,
|
|
662
|
-
getAttrs(dom) {
|
|
663
|
-
const attributes = [...dom.attributes].reduce((prev, next) => {
|
|
664
|
-
prev[next.name] = next.nodeValue
|
|
665
|
-
return prev
|
|
666
|
-
}, {})
|
|
667
|
-
return {
|
|
668
|
-
attributes: attributes,
|
|
669
|
-
label: dom.text || dom.textContent,
|
|
670
|
-
meta: obj,
|
|
671
|
-
id: `enhancement-${uuidv1()}`,
|
|
672
|
-
}
|
|
673
|
-
},
|
|
674
|
-
},
|
|
675
|
-
],
|
|
676
|
-
}
|
|
677
|
-
})
|
|
678
|
-
|
|
679
|
-
return {
|
|
680
|
-
...enhancements,
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
/**
|
|
685
|
-
* This builds the nodes object for the schema nodes property.
|
|
686
|
-
* The custom menubar indicates inclusion of the enhancements
|
|
687
|
-
* by the `richTextElements` property. Otherwise they are not
|
|
688
|
-
* includedin the nodes list.
|
|
689
|
-
*
|
|
690
|
-
* @param {Object.<Object|string>} customMenuBar
|
|
691
|
-
* @param {Object.<string>} richTextElementTags Rich Text Elements that are allowed in
|
|
692
|
-
* this instance of the RTE
|
|
693
|
-
* @return {Object.<Object|string} The schema marks object.
|
|
694
|
-
*/
|
|
695
|
-
const getNodesConfig = (customMenuBar, richTextElementTags) => {
|
|
696
|
-
let nodes = {
|
|
697
|
-
...baseNodes,
|
|
698
|
-
...alignmentNodes,
|
|
699
|
-
...listNodes,
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
const hasRichTextEnhancements = customMenuBar.some((obj) => {
|
|
703
|
-
return !!obj['richTextElements']
|
|
704
|
-
})
|
|
705
|
-
|
|
706
|
-
const hasCustomEnhancements = !!(
|
|
707
|
-
hasRichTextEnhancements ||
|
|
708
|
-
richTextElementTags ||
|
|
709
|
-
RICH_TEXT_ELEMENTS_PM
|
|
710
|
-
)
|
|
711
|
-
|
|
712
|
-
if (hasCustomEnhancements) {
|
|
713
|
-
const enhancements = getEnhancements()
|
|
714
|
-
const richTextNodesConfig = {}
|
|
715
|
-
richTextNodes.forEach((obj) => {
|
|
716
|
-
richTextNodesConfig[obj.tag] = {
|
|
717
|
-
content: `${constants.NODES.GROUPS.inline}*`,
|
|
718
|
-
group: 'block',
|
|
719
|
-
attrs: {
|
|
720
|
-
class: { default: `rte2-style-${obj.styleName}` },
|
|
721
|
-
},
|
|
722
|
-
parseDOM: [
|
|
723
|
-
{
|
|
724
|
-
tag: obj.tag,
|
|
725
|
-
},
|
|
726
|
-
{
|
|
727
|
-
tag: `.${obj.styleName}`,
|
|
728
|
-
},
|
|
729
|
-
],
|
|
730
|
-
toDOM(node) {
|
|
731
|
-
return [obj.tag, node.attrs, 0]
|
|
732
|
-
},
|
|
733
|
-
}
|
|
734
|
-
})
|
|
735
|
-
nodes = {
|
|
736
|
-
...nodes,
|
|
737
|
-
...enhancements,
|
|
738
|
-
...richTextNodesConfig,
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
return nodes
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
/**
|
|
746
|
-
* Configuration for mutually exclusive marks. Will
|
|
747
|
-
* be used when building the schema's mark property.
|
|
748
|
-
*
|
|
749
|
-
* @param {Object.<string>} customMenuBar
|
|
750
|
-
*/
|
|
751
|
-
const markExcludes = {
|
|
752
|
-
subscript: 'superscript',
|
|
753
|
-
superscript: 'subscript',
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
/**
|
|
757
|
-
* This builds the marks object for the schema marks property.
|
|
758
|
-
* The marks are represented in the configuration from the
|
|
759
|
-
* server as `inline: true` and must have the following
|
|
760
|
-
* properties set: `className`, `style`. We have hard-coded that
|
|
761
|
-
* `style` can not be of value `link` because these are handled
|
|
762
|
-
* as enhancements. They also must not have the property `separator`.
|
|
763
|
-
*
|
|
764
|
-
* @param {Object.<Object|string>} customMenuBar
|
|
765
|
-
* @return {Object.<Object|string>} The schema marks object.
|
|
766
|
-
*/
|
|
767
|
-
const getMarksConfig = (customMenuBar, compliantTagNameMap) => {
|
|
768
|
-
const marks = {}
|
|
769
|
-
const marksArr = customMenuBar.filter((mark) => {
|
|
770
|
-
return (
|
|
771
|
-
mark.inline &&
|
|
772
|
-
mark.className &&
|
|
773
|
-
mark.style &&
|
|
774
|
-
mark.style !== 'link' &&
|
|
775
|
-
!mark.separator
|
|
776
|
-
)
|
|
777
|
-
})
|
|
778
|
-
|
|
779
|
-
/**
|
|
780
|
-
* Hard-coded Default config for google cut and paste
|
|
781
|
-
* marks. This presumes the keys in this object literal
|
|
782
|
-
* are what is given from the backend.
|
|
783
|
-
*
|
|
784
|
-
* @type {Object.<Array.<Object.<string>>>}
|
|
785
|
-
*/
|
|
786
|
-
let googCopyAndPasteConfig = {
|
|
787
|
-
italic: [
|
|
788
|
-
{
|
|
789
|
-
style: 'font-style=italic',
|
|
790
|
-
},
|
|
791
|
-
],
|
|
792
|
-
bold: [
|
|
793
|
-
{
|
|
794
|
-
style: 'font-weight=bold',
|
|
795
|
-
},
|
|
796
|
-
{
|
|
797
|
-
style: 'font-weight=700',
|
|
798
|
-
},
|
|
799
|
-
],
|
|
800
|
-
underline: [
|
|
801
|
-
{
|
|
802
|
-
style: 'text-decoration=underline',
|
|
803
|
-
},
|
|
804
|
-
],
|
|
805
|
-
superscript: [
|
|
806
|
-
{
|
|
807
|
-
style: 'vertical-align=super',
|
|
808
|
-
},
|
|
809
|
-
],
|
|
810
|
-
subscript: [
|
|
811
|
-
{
|
|
812
|
-
style: 'vertical-align=sub',
|
|
813
|
-
},
|
|
814
|
-
],
|
|
815
|
-
strikethrough: [
|
|
816
|
-
{
|
|
817
|
-
style: 'text-decoration=line-through',
|
|
818
|
-
},
|
|
819
|
-
{
|
|
820
|
-
style: 'text-decoration=underline line-through',
|
|
821
|
-
},
|
|
822
|
-
],
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
// The order in which you define your marks — those with lower precedence
|
|
826
|
-
// (defined earlier) always wrap around those with higher precedence - and
|
|
827
|
-
// mark DOM elements for adjacent inline nodes are combined when possible,
|
|
828
|
-
// so with links for example, which are typically low-precedence, you tend
|
|
829
|
-
// to get uninterrupted nodes.
|
|
830
|
-
editableInlineWithFieldsEnhancements.forEach((mark) => {
|
|
831
|
-
marks[mark.tag] = {
|
|
832
|
-
attrs: {
|
|
833
|
-
class: { default: '' },
|
|
834
|
-
attributes: { default: {} },
|
|
835
|
-
label: { default: '' },
|
|
836
|
-
meta: { default: {} },
|
|
837
|
-
id: { default: '' },
|
|
838
|
-
},
|
|
839
|
-
inclusive: mark.inclusive,
|
|
840
|
-
toDOM(node) {
|
|
841
|
-
const domAttrs = {
|
|
842
|
-
label: node.attrs.label,
|
|
843
|
-
class: `rte2-style-${mark.styleName}`,
|
|
844
|
-
id: node.attrs.id,
|
|
845
|
-
...node.attrs.attributes,
|
|
846
|
-
}
|
|
847
|
-
if (mark.extraCssClasses) {
|
|
848
|
-
domAttrs.class = `${domAttrs.class} ${mark.extraCssClasses}`
|
|
849
|
-
}
|
|
850
|
-
return [mark.tag, domAttrs, 0]
|
|
851
|
-
},
|
|
852
|
-
parseDOM: [
|
|
853
|
-
{
|
|
854
|
-
tag: `.rte2-style-${mark.styleName}`,
|
|
855
|
-
getAttrs(dom) {
|
|
856
|
-
const attributes = [...dom.attributes].reduce((prev, next) => {
|
|
857
|
-
prev[next.name] = next.nodeValue
|
|
858
|
-
return prev
|
|
859
|
-
}, {})
|
|
860
|
-
return {
|
|
861
|
-
attributes: attributes,
|
|
862
|
-
label: dom.text || dom.textContent || attributes.label,
|
|
863
|
-
meta: mark,
|
|
864
|
-
class: `rte2-style-${mark.styleName}`,
|
|
865
|
-
id: attributes.id || `enhancement-${uuidv1()}`,
|
|
866
|
-
}
|
|
867
|
-
},
|
|
868
|
-
},
|
|
869
|
-
{
|
|
870
|
-
tag: mark.tag,
|
|
871
|
-
getAttrs(dom) {
|
|
872
|
-
const attributes = [...dom.attributes].reduce((prev, next) => {
|
|
873
|
-
prev[next.name] = next.nodeValue
|
|
874
|
-
return prev
|
|
875
|
-
}, {})
|
|
876
|
-
return {
|
|
877
|
-
attributes: attributes,
|
|
878
|
-
label: dom.text || dom.textContent || attributes.label,
|
|
879
|
-
meta: mark,
|
|
880
|
-
class: `rte2-style-${mark.styleName}`,
|
|
881
|
-
id: attributes.id || `enhancement-${uuidv1()}`,
|
|
882
|
-
}
|
|
883
|
-
},
|
|
884
|
-
},
|
|
885
|
-
],
|
|
886
|
-
}
|
|
887
|
-
if (mark.clear && mark.clear.length) {
|
|
888
|
-
const excludes = mark.clear.map((item) => {
|
|
889
|
-
return richTextElementsStyleNameToTagMap.get(item)
|
|
890
|
-
})
|
|
891
|
-
marks[mark.tag].excludes = excludes.join(' ')
|
|
892
|
-
}
|
|
893
|
-
})
|
|
894
|
-
editableInlineWithNoFieldsEnhancements.forEach((mark) => {
|
|
895
|
-
marks[mark.tag] = {
|
|
896
|
-
attrs: {
|
|
897
|
-
attributes: { default: {} },
|
|
898
|
-
class: { default: '' },
|
|
899
|
-
},
|
|
900
|
-
toDOM(node) {
|
|
901
|
-
const domAttrs = {
|
|
902
|
-
class: `rte2-style-${mark.styleName} rte2-style-${mark.styleName}-start rte2-style-${mark.styleName}-end`,
|
|
903
|
-
...node.attrs.attributes,
|
|
904
|
-
}
|
|
905
|
-
if (mark.extraCssClasses) {
|
|
906
|
-
domAttrs.class = `${domAttrs.class} ${mark.extraCssClasses}`
|
|
907
|
-
}
|
|
908
|
-
return [mark.tag, domAttrs, 0]
|
|
909
|
-
},
|
|
910
|
-
parseDOM: [
|
|
911
|
-
{
|
|
912
|
-
tag: `.rte2-style-${mark.styleName}`,
|
|
913
|
-
getAttrs(dom) {
|
|
914
|
-
const attributes = [...dom.attributes].reduce((prev, next) => {
|
|
915
|
-
prev[next.name] = next.nodeValue
|
|
916
|
-
return prev
|
|
917
|
-
}, {})
|
|
918
|
-
return {
|
|
919
|
-
class: `rte2-style-${mark.styleName}`,
|
|
920
|
-
attributes: attributes,
|
|
921
|
-
}
|
|
922
|
-
},
|
|
923
|
-
},
|
|
924
|
-
{
|
|
925
|
-
tag: mark.tag,
|
|
926
|
-
getAttrs(dom) {
|
|
927
|
-
const attributes = [...dom.attributes].reduce((prev, next) => {
|
|
928
|
-
prev[next.name] = next.nodeValue
|
|
929
|
-
return prev
|
|
930
|
-
}, {})
|
|
931
|
-
return {
|
|
932
|
-
attributes: attributes,
|
|
933
|
-
class: `rte2-style-${mark.styleName}`,
|
|
934
|
-
}
|
|
935
|
-
},
|
|
936
|
-
},
|
|
937
|
-
],
|
|
938
|
-
}
|
|
939
|
-
if (mark.clear && mark.clear.length) {
|
|
940
|
-
const excludes = mark.clear.map((item) => {
|
|
941
|
-
return richTextElementsStyleNameToTagMap.get(item)
|
|
942
|
-
})
|
|
943
|
-
marks[mark.tag].excludes = excludes.join(' ')
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
if (googCopyAndPasteConfig.hasOwnProperty(mark.tag)) {
|
|
947
|
-
googCopyAndPasteConfig[mark.tag].forEach((rule) => {
|
|
948
|
-
marks[mark.tag].parseDOM.push(rule)
|
|
949
|
-
})
|
|
950
|
-
}
|
|
951
|
-
})
|
|
952
|
-
|
|
953
|
-
// Projects can decorate the default config for cut and paste marks by
|
|
954
|
-
// providing a global `PM_CLIPBOARD_SANITIZATION_OBJ` object. It should
|
|
955
|
-
// follow the same format as the `googCopyAndPasteConfig` object above.
|
|
956
|
-
// Only rich text elements are supported currently.
|
|
957
|
-
if (window.PM_CLIPBOARD_SANITIZATION_OBJ) {
|
|
958
|
-
const customClipboardSanitizationObject = {}
|
|
959
|
-
Object.keys(window.PM_CLIPBOARD_SANITIZATION_OBJ).forEach((key) => {
|
|
960
|
-
const sanitizedKey = compliantTagNameMap.get(key)
|
|
961
|
-
if (sanitizedKey) {
|
|
962
|
-
customClipboardSanitizationObject[sanitizedKey] =
|
|
963
|
-
window.PM_CLIPBOARD_SANITIZATION_OBJ[key]
|
|
964
|
-
} else {
|
|
965
|
-
console.warn(`${key} is not a valid rich text element.`)
|
|
966
|
-
}
|
|
967
|
-
})
|
|
968
|
-
|
|
969
|
-
googCopyAndPasteConfig = Object.assign(
|
|
970
|
-
{},
|
|
971
|
-
googCopyAndPasteConfig,
|
|
972
|
-
customClipboardSanitizationObject,
|
|
973
|
-
)
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
marksArr.forEach((mark) => {
|
|
977
|
-
const className = mark.className.replace('toolbar', 'style')
|
|
978
|
-
const excludes = markExcludes[mark.style]
|
|
979
|
-
marks[mark.style] = {
|
|
980
|
-
attrs: {
|
|
981
|
-
class: { default: '' },
|
|
982
|
-
},
|
|
983
|
-
toDOM(node) {
|
|
984
|
-
node.attrs.class = className
|
|
985
|
-
return [mark.text.toLowerCase(), node.attrs, 0]
|
|
986
|
-
},
|
|
987
|
-
parseDOM: [
|
|
988
|
-
{
|
|
989
|
-
tag: `.${className}`,
|
|
990
|
-
getAttrs() {
|
|
991
|
-
return { class: className }
|
|
992
|
-
},
|
|
993
|
-
},
|
|
994
|
-
{
|
|
995
|
-
tag: mark.style.toLowerCase(),
|
|
996
|
-
getAttrs() {
|
|
997
|
-
return { class: className }
|
|
998
|
-
},
|
|
999
|
-
},
|
|
1000
|
-
{
|
|
1001
|
-
tag: mark.text.toLowerCase(),
|
|
1002
|
-
getAttrs() {
|
|
1003
|
-
return { class: className }
|
|
1004
|
-
},
|
|
1005
|
-
},
|
|
1006
|
-
],
|
|
1007
|
-
excludes,
|
|
1008
|
-
}
|
|
1009
|
-
if (googCopyAndPasteConfig.hasOwnProperty(mark.style)) {
|
|
1010
|
-
googCopyAndPasteConfig[mark.style].getAttrs = () => {
|
|
1011
|
-
return { class: className }
|
|
1012
|
-
}
|
|
1013
|
-
googCopyAndPasteConfig[mark.style].forEach((rule) => {
|
|
1014
|
-
marks[mark.style].parseDOM.push(rule)
|
|
1015
|
-
})
|
|
1016
|
-
}
|
|
1017
|
-
})
|
|
1018
|
-
|
|
1019
|
-
marks.ai = {
|
|
1020
|
-
attrs: {
|
|
1021
|
-
class: { default: 'rte2-style-ins-ai' },
|
|
1022
|
-
'data-user-label': { default: '' },
|
|
1023
|
-
'data-time': { default: PENDING },
|
|
1024
|
-
'data-user-id': { default: '' },
|
|
1025
|
-
'data-chat-id': { default: '' },
|
|
1026
|
-
'data-response-id': { default: '' },
|
|
1027
|
-
},
|
|
1028
|
-
inclusive: false,
|
|
1029
|
-
toDOM(node) {
|
|
1030
|
-
return ['ai', node.attrs, 0]
|
|
1031
|
-
},
|
|
1032
|
-
parseDOM: [
|
|
1033
|
-
{
|
|
1034
|
-
tag: 'ai',
|
|
1035
|
-
getAttrs(dom) {
|
|
1036
|
-
const dataUserLabel = dom.getAttribute('data-user-label')
|
|
1037
|
-
const dataTime = dom.getAttribute('data-time')
|
|
1038
|
-
const dataUserId = dom.getAttribute('data-user-id')
|
|
1039
|
-
const dataChatId = dom.getAttribute('data-chat-id')
|
|
1040
|
-
const dataResponseId = dom.getAttribute('data-response-id')
|
|
1041
|
-
return {
|
|
1042
|
-
'data-user-label': dataUserLabel,
|
|
1043
|
-
'data-time': dataTime,
|
|
1044
|
-
'data-user-id': dataUserId,
|
|
1045
|
-
'data-chat-id': dataChatId,
|
|
1046
|
-
'data-response-id': dataResponseId,
|
|
1047
|
-
title: dataTime ? `${dataUserLabel}: ${dataTime}` : dataUserLabel,
|
|
1048
|
-
}
|
|
1049
|
-
},
|
|
1050
|
-
},
|
|
1051
|
-
],
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
marks.aiInlineIns = {
|
|
1055
|
-
attrs: {
|
|
1056
|
-
class: { default: 'rte2-style-ai-inline-ins' },
|
|
1057
|
-
},
|
|
1058
|
-
inclusive: false,
|
|
1059
|
-
toDOM(node) {
|
|
1060
|
-
return ['ai-inline-ins', node.attrs, 0]
|
|
1061
|
-
},
|
|
1062
|
-
parseDOM: [
|
|
1063
|
-
{
|
|
1064
|
-
tag: 'ai-inline-ins',
|
|
1065
|
-
},
|
|
1066
|
-
],
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
marks.aiInlineDel = {
|
|
1070
|
-
attrs: {
|
|
1071
|
-
class: { default: 'rte2-style-ai-inline-del' },
|
|
1072
|
-
},
|
|
1073
|
-
inclusive: false,
|
|
1074
|
-
toDOM(node) {
|
|
1075
|
-
return ['ai-inline-del', node.attrs, 0]
|
|
1076
|
-
},
|
|
1077
|
-
parseDOM: [
|
|
1078
|
-
{
|
|
1079
|
-
tag: 'ai-inline-del',
|
|
1080
|
-
},
|
|
1081
|
-
],
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
marks.ins = {
|
|
1085
|
-
attrs: {
|
|
1086
|
-
class: { default: 'rte2-style-ins-insert' },
|
|
1087
|
-
'data-user-label': { default: '' },
|
|
1088
|
-
'data-time': { default: PENDING },
|
|
1089
|
-
'data-user-id': { default: '' },
|
|
1090
|
-
'data-target-id': { default: '' },
|
|
1091
|
-
title: { default: '' },
|
|
1092
|
-
},
|
|
1093
|
-
excludes: 'del ins',
|
|
1094
|
-
inclusive: false,
|
|
1095
|
-
toDOM(node) {
|
|
1096
|
-
return ['ins', node.attrs, 0]
|
|
1097
|
-
},
|
|
1098
|
-
parseDOM: [
|
|
1099
|
-
{
|
|
1100
|
-
tag: 'ins',
|
|
1101
|
-
getAttrs(dom) {
|
|
1102
|
-
const dataUserLabel = dom.getAttribute('data-user-label')
|
|
1103
|
-
const dataTime = dom.getAttribute('data-time')
|
|
1104
|
-
const dataUserId = dom.getAttribute('data-user-id')
|
|
1105
|
-
const dataTargetId = dom.getAttribute('data-target-id')
|
|
1106
|
-
return {
|
|
1107
|
-
'data-user-label': dataUserLabel,
|
|
1108
|
-
'data-time': dataTime,
|
|
1109
|
-
'data-user-id': dataUserId,
|
|
1110
|
-
'data-target-id': dataTargetId,
|
|
1111
|
-
title: dataTime ? `${dataUserLabel}: ${dataTime}` : dataUserLabel,
|
|
1112
|
-
}
|
|
1113
|
-
},
|
|
1114
|
-
},
|
|
1115
|
-
],
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
marks.del = {
|
|
1119
|
-
attrs: {
|
|
1120
|
-
class: { default: 'rte2-style-ins-delete' },
|
|
1121
|
-
'data-user-label': { default: '' },
|
|
1122
|
-
'data-time': { default: PENDING },
|
|
1123
|
-
'data-user-id': { default: '' },
|
|
1124
|
-
'data-target-id': { default: '' },
|
|
1125
|
-
title: { default: '' },
|
|
1126
|
-
},
|
|
1127
|
-
inclusive: false,
|
|
1128
|
-
toDOM(node) {
|
|
1129
|
-
return ['del', node.attrs, 0]
|
|
1130
|
-
},
|
|
1131
|
-
parseDOM: [
|
|
1132
|
-
{
|
|
1133
|
-
tag: 'del',
|
|
1134
|
-
getAttrs(dom) {
|
|
1135
|
-
const dataUserLabel = dom.getAttribute('data-user-label')
|
|
1136
|
-
const dataTime = dom.getAttribute('data-time')
|
|
1137
|
-
const dataUserId = dom.getAttribute('data-user-id')
|
|
1138
|
-
const dataTargetId = dom.getAttribute('data-target-id')
|
|
1139
|
-
return {
|
|
1140
|
-
'data-user-label': dataUserLabel,
|
|
1141
|
-
'data-time': dataTime,
|
|
1142
|
-
'data-user-id': dataUserId,
|
|
1143
|
-
'data-target-id': dataTargetId,
|
|
1144
|
-
title: dataTime ? `${dataUserLabel}: ${dataTime}` : dataUserLabel,
|
|
1145
|
-
}
|
|
1146
|
-
},
|
|
1147
|
-
},
|
|
1148
|
-
],
|
|
1149
|
-
}
|
|
1150
|
-
marks.html = {
|
|
1151
|
-
attrs: {
|
|
1152
|
-
class: { default: 'rte2-style-html' },
|
|
1153
|
-
},
|
|
1154
|
-
inclusive: marks.inclusive,
|
|
1155
|
-
toDOM(node) {
|
|
1156
|
-
return ['code', node.attrs, 0]
|
|
1157
|
-
},
|
|
1158
|
-
parseDOM: [
|
|
1159
|
-
{
|
|
1160
|
-
tag: 'code',
|
|
1161
|
-
},
|
|
1162
|
-
],
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
marks.comment = {
|
|
1166
|
-
excludes: '_',
|
|
1167
|
-
attrs: {
|
|
1168
|
-
class: {
|
|
1169
|
-
default:
|
|
1170
|
-
'rte2-style-comment rte2-style-comment-start rte2-style-comment-end',
|
|
1171
|
-
},
|
|
1172
|
-
'data-user-id': {
|
|
1173
|
-
default: '',
|
|
1174
|
-
},
|
|
1175
|
-
'data-user-label': {
|
|
1176
|
-
default: '',
|
|
1177
|
-
},
|
|
1178
|
-
'data-time': {
|
|
1179
|
-
default: '',
|
|
1180
|
-
},
|
|
1181
|
-
'data-replies': {
|
|
1182
|
-
default: '',
|
|
1183
|
-
},
|
|
1184
|
-
'data-collapse': {
|
|
1185
|
-
default: false,
|
|
1186
|
-
},
|
|
1187
|
-
content: {
|
|
1188
|
-
default: '',
|
|
1189
|
-
},
|
|
1190
|
-
title: {
|
|
1191
|
-
default: '',
|
|
1192
|
-
},
|
|
1193
|
-
},
|
|
1194
|
-
toDOM(node) {
|
|
1195
|
-
return ['comment', node.attrs, 0]
|
|
1196
|
-
},
|
|
1197
|
-
parseDOM: [
|
|
1198
|
-
{
|
|
1199
|
-
tag: 'comment',
|
|
1200
|
-
getAttrs(dom) {
|
|
1201
|
-
const dataUserLabel = dom.getAttribute('data-user-label')
|
|
1202
|
-
const dataUserId = dom.getAttribute('data-user-id')
|
|
1203
|
-
const dataTime = dom.getAttribute('data-time')
|
|
1204
|
-
const replies = dom.getAttribute('data-replies')
|
|
1205
|
-
const collapse = dom.getAttribute('data-collapse')
|
|
1206
|
-
return {
|
|
1207
|
-
'data-user-label': dataUserLabel,
|
|
1208
|
-
'data-user-id': dataUserId,
|
|
1209
|
-
'data-time': dataTime,
|
|
1210
|
-
'data-replies': replies,
|
|
1211
|
-
'data-collapse': collapse,
|
|
1212
|
-
title: `${dataUserLabel}: ${dataTime}`,
|
|
1213
|
-
content: dom.innerText,
|
|
1214
|
-
}
|
|
1215
|
-
},
|
|
1216
|
-
},
|
|
1217
|
-
{
|
|
1218
|
-
tag: '.rte2-style-comment',
|
|
1219
|
-
getAttrs(dom) {
|
|
1220
|
-
const dataUserLabel = dom.getAttribute('data-user-label')
|
|
1221
|
-
const dataUserId = dom.getAttribute('data-user-id')
|
|
1222
|
-
const dataTime = dom.getAttribute('data-time')
|
|
1223
|
-
const replies = dom.getAttribute('data-replies')
|
|
1224
|
-
const collapse = dom.getAttribute('data-collapse')
|
|
1225
|
-
return {
|
|
1226
|
-
'data-user-label': dataUserLabel,
|
|
1227
|
-
'data-user-id': dataUserId,
|
|
1228
|
-
'data-time': dataTime,
|
|
1229
|
-
'data-replies': replies,
|
|
1230
|
-
'data-collapse': collapse,
|
|
1231
|
-
title: `${dataUserLabel}: ${dataTime}`,
|
|
1232
|
-
content: dom.innerText,
|
|
1233
|
-
}
|
|
1234
|
-
},
|
|
1235
|
-
},
|
|
1236
|
-
{
|
|
1237
|
-
tag: '.rte-comment',
|
|
1238
|
-
getAttrs(dom) {
|
|
1239
|
-
const dataUserLabel = dom.getAttribute('data-user-label')
|
|
1240
|
-
const dataUserId = dom.getAttribute('data-user-id')
|
|
1241
|
-
const dataTime = dom.getAttribute('data-time')
|
|
1242
|
-
const replies = dom.getAttribute('data-replies')
|
|
1243
|
-
const collapse = dom.getAttribute('data-collapse')
|
|
1244
|
-
return {
|
|
1245
|
-
'data-user-label': dataUserLabel,
|
|
1246
|
-
'data-user-id': dataUserId,
|
|
1247
|
-
'data-time': dataTime,
|
|
1248
|
-
'data-replies': replies,
|
|
1249
|
-
'data-collapse': collapse,
|
|
1250
|
-
title: `${dataUserLabel}: ${dataTime}`,
|
|
1251
|
-
content: dom.innerContent,
|
|
1252
|
-
}
|
|
1253
|
-
},
|
|
1254
|
-
},
|
|
1255
|
-
],
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
return marks
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
/**
|
|
1262
|
-
* Stitches together the schema from the nodes
|
|
1263
|
-
* and marks that are returned from their
|
|
1264
|
-
* 'getter' functions above.
|
|
1265
|
-
*
|
|
1266
|
-
* @param {Object.<Object|string>} customMenuBar
|
|
1267
|
-
* @param {Object.<string>} richTextElementTags Rich Text Elements that are allowed in
|
|
1268
|
-
* this instance of the RTE
|
|
1269
|
-
* @return {Prosemirror.Model.Schema}
|
|
1270
|
-
*/
|
|
1271
|
-
const buildSchemaFromConfig = (
|
|
1272
|
-
customMenuBar,
|
|
1273
|
-
richTextElementTags,
|
|
1274
|
-
compliantTagNameMap,
|
|
1275
|
-
) => {
|
|
1276
|
-
const nodes = getNodesConfig(customMenuBar, richTextElementTags)
|
|
1277
|
-
const marks = getMarksConfig(customMenuBar, compliantTagNameMap)
|
|
1278
|
-
return new Schema({ nodes, marks })
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
export { buildSchemaFromConfig }
|