@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,819 +0,0 @@
|
|
|
1
|
-
import htmlEncode from 'js-htmlencode'
|
|
2
|
-
import { getElementMarkupAsString } from '../utilities'
|
|
3
|
-
import moment from 'moment'
|
|
4
|
-
import { v1 as uuidv1 } from 'uuid'
|
|
5
|
-
|
|
6
|
-
const PENDING = RTE_PENDING || 'Pending' /* global RTE_PENDING */
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* A specification for serializing a ProseMirror document into
|
|
10
|
-
* the markup needed by the legacy CodeMirror RTE and our Java
|
|
11
|
-
* backend. Inspired by the ProseMirror markdown serializer, borrowing
|
|
12
|
-
* some functionality.
|
|
13
|
-
*/
|
|
14
|
-
export class BrightspotDOMSerializer {
|
|
15
|
-
/**
|
|
16
|
-
* Construct a serializer with the given configuration. The `nodes`
|
|
17
|
-
* object should map node names in a given schema to function that
|
|
18
|
-
* take a serializer state and such a node, and serialize the node.
|
|
19
|
-
*
|
|
20
|
-
* The `marks` object should hold objects with `open` and `close`
|
|
21
|
-
* properties, which hold the strings that should appear before and
|
|
22
|
-
* after a piece of text marked that way, either directly or as a
|
|
23
|
-
* function that takes a serializer state and a mark, and returns a
|
|
24
|
-
* string.
|
|
25
|
-
*
|
|
26
|
-
* The `expelEnclosingWhitespace` mark property causes the
|
|
27
|
-
* serializer to move enclosing whitespace from inside the marks to
|
|
28
|
-
* outside the marks.
|
|
29
|
-
*
|
|
30
|
-
* @param {Object} nodes
|
|
31
|
-
* @param {Object} marks
|
|
32
|
-
*/
|
|
33
|
-
constructor(nodes, marks) {
|
|
34
|
-
this.nodes = nodes
|
|
35
|
-
this.marks = marks
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Kicks off the serialization of the document.
|
|
40
|
-
*
|
|
41
|
-
* @param {ProseMirror.EditorState} editorState
|
|
42
|
-
* @param {Object} options
|
|
43
|
-
*/
|
|
44
|
-
serialize(content, compliantTagNameMap, options) {
|
|
45
|
-
let state = new BrightspotDOMSerializerState(
|
|
46
|
-
this.nodes,
|
|
47
|
-
this.marks,
|
|
48
|
-
compliantTagNameMap,
|
|
49
|
-
options,
|
|
50
|
-
)
|
|
51
|
-
state.renderContent(content)
|
|
52
|
-
return state.out
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const getRichTextNodes = () => {
|
|
57
|
-
const richTextNodes = {}
|
|
58
|
-
RICH_TEXT_ELEMENTS_PM.forEach((obj) => {
|
|
59
|
-
if (obj.popup || !obj.line) {
|
|
60
|
-
return
|
|
61
|
-
}
|
|
62
|
-
let tag = obj.tag
|
|
63
|
-
richTextNodes[obj.tag] = (state, node) => {
|
|
64
|
-
state.compliantTagNameMap.forEach((value, key) => {
|
|
65
|
-
if (tag === value) {
|
|
66
|
-
tag = key
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
state.writeTag(`<${tag}>`)
|
|
70
|
-
state.renderContent(node)
|
|
71
|
-
state.writeTag(`</${tag}>`)
|
|
72
|
-
}
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
return richTextNodes
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const nonEditableEnhancements = [] // nodes
|
|
79
|
-
const editableInlineWithFieldsEnhancements = [] // marks with attrs
|
|
80
|
-
const editableLineWithFieldsEnhancements = [] // nodes text content with attrs
|
|
81
|
-
const editableInlineWithNoFieldsEnhancements = [] // marks
|
|
82
|
-
const editableLineWithNoFieldsEnhancements = [] // nodes text content
|
|
83
|
-
|
|
84
|
-
RICH_TEXT_ELEMENTS_PM.forEach((obj) => {
|
|
85
|
-
if (obj.readOnly) {
|
|
86
|
-
nonEditableEnhancements.push(obj)
|
|
87
|
-
} else if (obj.popup) {
|
|
88
|
-
if (obj.line) {
|
|
89
|
-
editableLineWithFieldsEnhancements.push(obj)
|
|
90
|
-
} else {
|
|
91
|
-
editableInlineWithFieldsEnhancements.push(obj)
|
|
92
|
-
}
|
|
93
|
-
} else {
|
|
94
|
-
if (obj.line) {
|
|
95
|
-
editableLineWithNoFieldsEnhancements.push(obj)
|
|
96
|
-
} else {
|
|
97
|
-
editableInlineWithNoFieldsEnhancements.push(obj)
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
const getNonEditableEnhancements = () => {
|
|
103
|
-
const richTextNodes = {}
|
|
104
|
-
nonEditableEnhancements.forEach((obj) => {
|
|
105
|
-
richTextNodes[obj.tag] = (state, node) => {
|
|
106
|
-
const attributes = node.attrs.attributes
|
|
107
|
-
const metaObj = node.attrs.meta
|
|
108
|
-
const marks = node.marks.filter((mark) => !state.active.includes(mark))
|
|
109
|
-
let tag = metaObj.tag
|
|
110
|
-
state.compliantTagNameMap.forEach((value, key) => {
|
|
111
|
-
if (tag === value) {
|
|
112
|
-
tag = key
|
|
113
|
-
}
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
const label = node.attrs.label
|
|
117
|
-
let tagString = getElementMarkupAsString(tag, label, attributes)
|
|
118
|
-
|
|
119
|
-
marks.forEach((mark) => {
|
|
120
|
-
const markName = mark.type.name
|
|
121
|
-
const markAttrs = mark.attrs
|
|
122
|
-
tagString = getElementMarkupAsString(markName, tagString, markAttrs)
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
state.writeTag(tagString, false)
|
|
126
|
-
}
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
return richTextNodes
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
const getEditableNoFieldsLineEnhancements = () => {
|
|
133
|
-
const richTextNodes = {}
|
|
134
|
-
editableLineWithNoFieldsEnhancements.forEach((obj) => {
|
|
135
|
-
richTextNodes[obj.tag] = (state, node) => {
|
|
136
|
-
let tag = obj.tag
|
|
137
|
-
state.compliantTagNameMap.forEach((value, key) => {
|
|
138
|
-
if (tag === value) {
|
|
139
|
-
tag = key
|
|
140
|
-
}
|
|
141
|
-
})
|
|
142
|
-
state.writeTag(`<${tag}>`)
|
|
143
|
-
node.inlineContent ? state.renderInline(node) : state.renderContent(node)
|
|
144
|
-
state.writeTag(`</${tag}>`)
|
|
145
|
-
}
|
|
146
|
-
})
|
|
147
|
-
return richTextNodes
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const getEditableLineWithFieldsEnhancements = () => {
|
|
151
|
-
const richTextNodes = {}
|
|
152
|
-
editableLineWithFieldsEnhancements.forEach((obj) => {
|
|
153
|
-
richTextNodes[obj.tag] = (state, node) => {
|
|
154
|
-
const attributes = node.attrs.attributes
|
|
155
|
-
const metaObj = node.attrs.meta
|
|
156
|
-
let tag = metaObj.tag
|
|
157
|
-
state.compliantTagNameMap.forEach((value, key) => {
|
|
158
|
-
if (tag === value) {
|
|
159
|
-
tag = key
|
|
160
|
-
}
|
|
161
|
-
})
|
|
162
|
-
|
|
163
|
-
if (attributes) {
|
|
164
|
-
let nodeAttributes = ''
|
|
165
|
-
Object.keys(attributes).forEach((key) => {
|
|
166
|
-
nodeAttributes = `${nodeAttributes} ${key}="${htmlEncode(
|
|
167
|
-
attributes[key],
|
|
168
|
-
)}"`
|
|
169
|
-
})
|
|
170
|
-
state.writeTag(`<${tag}${nodeAttributes}>`)
|
|
171
|
-
} else {
|
|
172
|
-
state.writeTag(`<${tag}>`)
|
|
173
|
-
}
|
|
174
|
-
node.inlineContent ? state.renderInline(node) : state.renderContent(node)
|
|
175
|
-
state.writeTag(`</${tag}>`)
|
|
176
|
-
}
|
|
177
|
-
})
|
|
178
|
-
return richTextNodes
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
const geteditableInlineWithFieldsEnhancements = () => {
|
|
182
|
-
const richTextMarks = {}
|
|
183
|
-
editableInlineWithFieldsEnhancements.forEach((obj) => {
|
|
184
|
-
let tag = obj.tag
|
|
185
|
-
richTextMarks[obj.tag] = {
|
|
186
|
-
open(state, mark) {
|
|
187
|
-
state.compliantTagNameMap.forEach((value, key) => {
|
|
188
|
-
if (tag === value) {
|
|
189
|
-
tag = key
|
|
190
|
-
}
|
|
191
|
-
})
|
|
192
|
-
const attributesJSON = mark.attrs.attributes
|
|
193
|
-
if (attributesJSON) {
|
|
194
|
-
let nodeAttributes = ''
|
|
195
|
-
Object.keys(attributesJSON).forEach((key) => {
|
|
196
|
-
if (key === 'id') {
|
|
197
|
-
return
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
const value = attributesJSON[key]
|
|
201
|
-
|
|
202
|
-
if (value == null) {
|
|
203
|
-
return
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
if (nodeAttributes) {
|
|
207
|
-
nodeAttributes += ` ${key}="${htmlEncode(value)}"`
|
|
208
|
-
} else {
|
|
209
|
-
nodeAttributes = `${key}="${htmlEncode(value)}"`
|
|
210
|
-
}
|
|
211
|
-
})
|
|
212
|
-
return `<${tag}${nodeAttributes ? ' ' + nodeAttributes : ''}>`
|
|
213
|
-
} else {
|
|
214
|
-
return `<${tag}>`
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
close(state) {
|
|
218
|
-
state.compliantTagNameMap.forEach((value, key) => {
|
|
219
|
-
if (tag === value) {
|
|
220
|
-
tag = key
|
|
221
|
-
}
|
|
222
|
-
})
|
|
223
|
-
return `</${tag}>`
|
|
224
|
-
},
|
|
225
|
-
}
|
|
226
|
-
})
|
|
227
|
-
|
|
228
|
-
return richTextMarks
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
const geteditableInlineWithNoFieldsEnhancements = () => {
|
|
232
|
-
const richTextMarks = {}
|
|
233
|
-
editableInlineWithNoFieldsEnhancements.forEach((obj) => {
|
|
234
|
-
let tag = obj.tag
|
|
235
|
-
richTextMarks[obj.tag] = {
|
|
236
|
-
open(state, mark) {
|
|
237
|
-
state.compliantTagNameMap.forEach((value, key) => {
|
|
238
|
-
if (tag === value) {
|
|
239
|
-
tag = key
|
|
240
|
-
}
|
|
241
|
-
})
|
|
242
|
-
const attributesJSON = mark.attrs.attributes
|
|
243
|
-
|
|
244
|
-
if (attributesJSON) {
|
|
245
|
-
let nodeAttributes = ''
|
|
246
|
-
Object.keys(attributesJSON).forEach((key) => {
|
|
247
|
-
if (key === 'id') {
|
|
248
|
-
return
|
|
249
|
-
}
|
|
250
|
-
nodeAttributes = `${nodeAttributes} ${key}="${htmlEncode(
|
|
251
|
-
attributesJSON[key],
|
|
252
|
-
)}"`
|
|
253
|
-
})
|
|
254
|
-
return `<${tag}${nodeAttributes}>`
|
|
255
|
-
} else {
|
|
256
|
-
return `<${tag}>`
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
close(state) {
|
|
260
|
-
state.compliantTagNameMap.forEach((value, key) => {
|
|
261
|
-
if (tag === value) {
|
|
262
|
-
tag = key
|
|
263
|
-
}
|
|
264
|
-
})
|
|
265
|
-
return `</${tag}>`
|
|
266
|
-
},
|
|
267
|
-
}
|
|
268
|
-
})
|
|
269
|
-
|
|
270
|
-
return richTextMarks
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* Default implementation of the BrightspotDOMSerializer.
|
|
275
|
-
*/
|
|
276
|
-
export const defaultBrightspotDOMSerializer = new BrightspotDOMSerializer(
|
|
277
|
-
{
|
|
278
|
-
line(state, node, parent, index) {
|
|
279
|
-
node.marks.forEach((mark) => {
|
|
280
|
-
state.text(state.marks[mark.type.name].open(state, mark), false)
|
|
281
|
-
})
|
|
282
|
-
state.renderInline(node)
|
|
283
|
-
if (node !== parent.lastChild) {
|
|
284
|
-
state.writeTag('<br/>')
|
|
285
|
-
}
|
|
286
|
-
node.marks.forEach((mark) => {
|
|
287
|
-
state.text(state.marks[mark.type.name].close, false)
|
|
288
|
-
})
|
|
289
|
-
state.closeBlock(node)
|
|
290
|
-
},
|
|
291
|
-
p(state, node, parent) {
|
|
292
|
-
state.renderInline(node)
|
|
293
|
-
if (node !== parent.lastChild) {
|
|
294
|
-
state.writeTag('<br/>')
|
|
295
|
-
if (!node.isSingleGraf) {
|
|
296
|
-
state.writeTag('<br/>')
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
text(state, node) {
|
|
301
|
-
state.write(node.text, node.marks)
|
|
302
|
-
},
|
|
303
|
-
alignLeft(state, node, parent) {
|
|
304
|
-
state.writeTag(`<div class="cms-textAlign-left">`)
|
|
305
|
-
state.renderInline(node)
|
|
306
|
-
state.closeBlock(node)
|
|
307
|
-
state.writeTag(`</div>`)
|
|
308
|
-
},
|
|
309
|
-
alignCenter(state, node, parent) {
|
|
310
|
-
state.writeTag(`<div class="cms-textAlign-center">`)
|
|
311
|
-
state.renderInline(node)
|
|
312
|
-
state.closeBlock(node)
|
|
313
|
-
state.writeTag(`</div>`)
|
|
314
|
-
},
|
|
315
|
-
alignRight(state, node, parent) {
|
|
316
|
-
state.writeTag(`<div class="cms-textAlign-right">`)
|
|
317
|
-
state.renderInline(node)
|
|
318
|
-
state.closeBlock(node)
|
|
319
|
-
state.writeTag(`</div>`)
|
|
320
|
-
},
|
|
321
|
-
ol(state, node) {
|
|
322
|
-
const attributes = node.attrs.attributes
|
|
323
|
-
// if the id already exists in the document, generate a new id
|
|
324
|
-
if (document.querySelectorAll(`[id="${node.attrs.id}"]`).length > 1) {
|
|
325
|
-
attributes.id = 'rte-' + uuidv1()
|
|
326
|
-
} else {
|
|
327
|
-
attributes.id = node.attrs.id
|
|
328
|
-
}
|
|
329
|
-
attributes['start'] = `${node.attrs.order}`
|
|
330
|
-
let nodeAttributes = ''
|
|
331
|
-
Object.keys(attributes).forEach((key) => {
|
|
332
|
-
nodeAttributes = `${nodeAttributes} ${key}="${htmlEncode(
|
|
333
|
-
attributes[key] || '',
|
|
334
|
-
)}"`
|
|
335
|
-
})
|
|
336
|
-
state.writeTag(`<ol${nodeAttributes}>`)
|
|
337
|
-
state.renderContent(node)
|
|
338
|
-
state.writeTag(`</ol>`)
|
|
339
|
-
},
|
|
340
|
-
ul(state, node) {
|
|
341
|
-
const attributes = node.attrs.attributes
|
|
342
|
-
if (document.querySelectorAll(`[id="${node.attrs.id}"]`).length > 1) {
|
|
343
|
-
attributes.id = 'rte-' + uuidv1()
|
|
344
|
-
} else {
|
|
345
|
-
attributes.id = node.attrs.id
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
let nodeAttributes = ''
|
|
349
|
-
Object.keys(attributes).forEach((key) => {
|
|
350
|
-
nodeAttributes = `${nodeAttributes} ${key}="${htmlEncode(
|
|
351
|
-
attributes[key] || '',
|
|
352
|
-
)}"`
|
|
353
|
-
})
|
|
354
|
-
state.writeTag(`<ul${nodeAttributes}>`)
|
|
355
|
-
state.renderContent(node)
|
|
356
|
-
state.writeTag(`</ul>`)
|
|
357
|
-
},
|
|
358
|
-
listItem(state, node) {
|
|
359
|
-
state.writeTag(`<li>`)
|
|
360
|
-
state.renderContent(node)
|
|
361
|
-
state.writeTag(`</li>`)
|
|
362
|
-
},
|
|
363
|
-
listItemDiv(state, node) {
|
|
364
|
-
state.renderInline(node)
|
|
365
|
-
state.closeBlock(node)
|
|
366
|
-
},
|
|
367
|
-
table(state, node) {
|
|
368
|
-
const attributes = node.attrs.attributes
|
|
369
|
-
attributes.id = node.attrs.id
|
|
370
|
-
if (document.querySelectorAll(`[id="${node.attrs.id}"]`).length > 1) {
|
|
371
|
-
attributes.id = 'rte-' + uuidv1()
|
|
372
|
-
} else {
|
|
373
|
-
attributes.id = node.attrs.id
|
|
374
|
-
}
|
|
375
|
-
let nodeAttributes = ''
|
|
376
|
-
Object.keys(attributes).forEach((key) => {
|
|
377
|
-
nodeAttributes = `${nodeAttributes} ${key}="${htmlEncode(
|
|
378
|
-
attributes[key] || '',
|
|
379
|
-
)}"`
|
|
380
|
-
})
|
|
381
|
-
state.writeTag(`<table ${nodeAttributes}>`)
|
|
382
|
-
state.renderContent(node)
|
|
383
|
-
state.writeTag(`</table>`)
|
|
384
|
-
},
|
|
385
|
-
tbody(state, node) {
|
|
386
|
-
state.writeTag(`<tbody>`)
|
|
387
|
-
state.renderContent(node)
|
|
388
|
-
state.writeTag(`</tbody>`)
|
|
389
|
-
},
|
|
390
|
-
tableRow(state, node) {
|
|
391
|
-
const attributes = node.attrs.attributes
|
|
392
|
-
let nodeAttributes = ''
|
|
393
|
-
Object.keys(attributes).forEach((key) => {
|
|
394
|
-
nodeAttributes = `${nodeAttributes} ${key}="${htmlEncode(
|
|
395
|
-
attributes[key] || '',
|
|
396
|
-
)}"`
|
|
397
|
-
})
|
|
398
|
-
state.writeTag(`<tr ${nodeAttributes}>`)
|
|
399
|
-
state.renderContent(node)
|
|
400
|
-
state.writeTag(`</tr>`)
|
|
401
|
-
},
|
|
402
|
-
tableCell(state, node) {
|
|
403
|
-
const attributes = node.attrs.attributes
|
|
404
|
-
let nodeAttributes = ''
|
|
405
|
-
Object.keys(attributes).forEach((key) => {
|
|
406
|
-
nodeAttributes = `${nodeAttributes} ${key}="${htmlEncode(
|
|
407
|
-
attributes[key] || '',
|
|
408
|
-
)}"`
|
|
409
|
-
})
|
|
410
|
-
const colspan = node.attrs.colspan
|
|
411
|
-
const rowspan = node.attrs.rowspan
|
|
412
|
-
state.writeTag(
|
|
413
|
-
`<td colspan="${colspan}" rowspan="${rowspan}" ${nodeAttributes}>`,
|
|
414
|
-
)
|
|
415
|
-
state.renderContent(node)
|
|
416
|
-
state.writeTag(`</td>`)
|
|
417
|
-
},
|
|
418
|
-
tableHeader(state, node) {
|
|
419
|
-
state.writeTag(`<th>`)
|
|
420
|
-
state.renderContent(node)
|
|
421
|
-
state.writeTag(`</th>`)
|
|
422
|
-
},
|
|
423
|
-
...getRichTextNodes(),
|
|
424
|
-
...getEditableNoFieldsLineEnhancements(),
|
|
425
|
-
...getEditableLineWithFieldsEnhancements(),
|
|
426
|
-
...getNonEditableEnhancements(),
|
|
427
|
-
},
|
|
428
|
-
{
|
|
429
|
-
bold: {
|
|
430
|
-
open: '<b>',
|
|
431
|
-
close: '</b>',
|
|
432
|
-
},
|
|
433
|
-
italic: {
|
|
434
|
-
open: '<i>',
|
|
435
|
-
close: '</i>',
|
|
436
|
-
},
|
|
437
|
-
underline: {
|
|
438
|
-
open: '<u>',
|
|
439
|
-
close: '</u>',
|
|
440
|
-
},
|
|
441
|
-
strikethrough: {
|
|
442
|
-
open: '<s>',
|
|
443
|
-
close: '</s>',
|
|
444
|
-
},
|
|
445
|
-
superscript: {
|
|
446
|
-
open: '<sup>',
|
|
447
|
-
close: '</sup>',
|
|
448
|
-
},
|
|
449
|
-
subscript: {
|
|
450
|
-
open: '<sub>',
|
|
451
|
-
close: '</sub>',
|
|
452
|
-
},
|
|
453
|
-
ai: {
|
|
454
|
-
open(state, mark) {
|
|
455
|
-
const time =
|
|
456
|
-
mark.attrs['data-time'] === PENDING
|
|
457
|
-
? moment().format('MM/D/YYYY h:mm:ss A')
|
|
458
|
-
: mark.attrs['data-time']
|
|
459
|
-
|
|
460
|
-
return `<ai
|
|
461
|
-
data-user-label="${mark.attrs['data-user-label']}"
|
|
462
|
-
data-time="${time}"
|
|
463
|
-
data-user-id="${mark.attrs['data-user-id']}"
|
|
464
|
-
data-chat-id="${mark.attrs['data-chat-id']}"
|
|
465
|
-
data-response-id="${mark.attrs['data-response-id']}">`
|
|
466
|
-
},
|
|
467
|
-
close: '</ai>',
|
|
468
|
-
},
|
|
469
|
-
aiInlineIns: {
|
|
470
|
-
open(state, mark) {
|
|
471
|
-
const time =
|
|
472
|
-
mark.attrs['data-time'] === PENDING
|
|
473
|
-
? moment().format('MM/D/YYYY h:mm:ss A')
|
|
474
|
-
: mark.attrs['data-time']
|
|
475
|
-
|
|
476
|
-
return `<ai-inline-ins
|
|
477
|
-
data-user-label="${mark.attrs['data-user-label']}"
|
|
478
|
-
data-time="${time}"
|
|
479
|
-
data-user-id="${mark.attrs['data-user-id']}"
|
|
480
|
-
data-chat-id="${mark.attrs['data-chat-id']}"
|
|
481
|
-
data-response-id="${mark.attrs['data-response-id']}">`
|
|
482
|
-
},
|
|
483
|
-
close: '</ai-inline-ins>',
|
|
484
|
-
},
|
|
485
|
-
aiInlineDel: {
|
|
486
|
-
open(state, mark) {
|
|
487
|
-
const time =
|
|
488
|
-
mark.attrs['data-time'] === PENDING
|
|
489
|
-
? moment().format('MM/D/YYYY h:mm:ss A')
|
|
490
|
-
: mark.attrs['data-time']
|
|
491
|
-
|
|
492
|
-
return `<ai-inline-del
|
|
493
|
-
data-user-label="${mark.attrs['data-user-label']}"
|
|
494
|
-
data-time="${time}"
|
|
495
|
-
data-user-id="${mark.attrs['data-user-id']}"
|
|
496
|
-
data-chat-id="${mark.attrs['data-chat-id']}"
|
|
497
|
-
data-response-id="${mark.attrs['data-response-id']}">`
|
|
498
|
-
},
|
|
499
|
-
close: '</ai-inline-del>',
|
|
500
|
-
},
|
|
501
|
-
ins: {
|
|
502
|
-
open(state, mark) {
|
|
503
|
-
const time =
|
|
504
|
-
mark.attrs['data-time'] === PENDING
|
|
505
|
-
? moment().format('MM/D/YYYY h:mm:ss A')
|
|
506
|
-
: mark.attrs['data-time']
|
|
507
|
-
|
|
508
|
-
return `<ins
|
|
509
|
-
data-user-label="${mark.attrs['data-user-label']}"
|
|
510
|
-
data-time="${time}"
|
|
511
|
-
data-user-id="${mark.attrs['data-user-id']}"
|
|
512
|
-
data-target-id="${mark.attrs['data-target-id']}">`
|
|
513
|
-
},
|
|
514
|
-
close: '</ins>',
|
|
515
|
-
},
|
|
516
|
-
del: {
|
|
517
|
-
open(state, mark) {
|
|
518
|
-
const time =
|
|
519
|
-
mark.attrs['data-time'] === PENDING
|
|
520
|
-
? moment().format('MM/D/YYYY h:mm:ss A')
|
|
521
|
-
: mark.attrs['data-time']
|
|
522
|
-
|
|
523
|
-
return `<del
|
|
524
|
-
data-user-label="${mark.attrs['data-user-label']}"
|
|
525
|
-
data-time="${time}"
|
|
526
|
-
data-user-id="${mark.attrs['data-user-id']}"
|
|
527
|
-
data-target-id="${mark.attrs['data-target-id']}">`
|
|
528
|
-
},
|
|
529
|
-
close: '</del>',
|
|
530
|
-
},
|
|
531
|
-
...geteditableInlineWithFieldsEnhancements(),
|
|
532
|
-
...geteditableInlineWithNoFieldsEnhancements(),
|
|
533
|
-
html: {
|
|
534
|
-
open: '',
|
|
535
|
-
close: '',
|
|
536
|
-
shouldNotEncode: true,
|
|
537
|
-
},
|
|
538
|
-
comment: {
|
|
539
|
-
open(state, mark) {
|
|
540
|
-
const replies = mark.attrs['data-replies']
|
|
541
|
-
return `<span class="rte rte-comment"
|
|
542
|
-
data-user-id="${mark.attrs['data-user-id']}"
|
|
543
|
-
data-user-label="${mark.attrs['data-user-label']}"
|
|
544
|
-
data-time="${mark.attrs['data-time']}"
|
|
545
|
-
data-replies="${replies ? htmlEncode(replies) : ''}"
|
|
546
|
-
data-collapse="${mark.attrs['data-collapse']}">`
|
|
547
|
-
},
|
|
548
|
-
close: '</span>',
|
|
549
|
-
},
|
|
550
|
-
},
|
|
551
|
-
)
|
|
552
|
-
|
|
553
|
-
/**
|
|
554
|
-
* This is an object used to track state and expose
|
|
555
|
-
* methods related to serialization. Instances are passed to
|
|
556
|
-
* node and mark serialization methods. This functionality
|
|
557
|
-
* is mostly lifted from the ProseMirror Markdown serializer.
|
|
558
|
-
*/
|
|
559
|
-
export class BrightspotDOMSerializerState {
|
|
560
|
-
constructor(nodes, marks, compliantTagNameMap, options) {
|
|
561
|
-
this.nodes = nodes
|
|
562
|
-
this.marks = marks
|
|
563
|
-
this.delim = this.out = ''
|
|
564
|
-
this.closed = false
|
|
565
|
-
this.inTightList = false
|
|
566
|
-
this.active = []
|
|
567
|
-
this.options = options || {}
|
|
568
|
-
this.compliantTagNameMap = compliantTagNameMap
|
|
569
|
-
if (typeof this.options.tightLists === 'undefined') {
|
|
570
|
-
this.options.tightLists = false
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
flushClose(size) {
|
|
575
|
-
if (this.closed) {
|
|
576
|
-
if (!this.atBlank()) this.out += '\n'
|
|
577
|
-
if (size == null) size = 2
|
|
578
|
-
if (size > 1) {
|
|
579
|
-
let delimMin = this.delim
|
|
580
|
-
let trim = /\s+$/.exec(delimMin)
|
|
581
|
-
if (trim) delimMin = delimMin.slice(0, delimMin.length - trim[0].length)
|
|
582
|
-
for (let i = 1; i < size; i++) this.out += delimMin + '\n'
|
|
583
|
-
}
|
|
584
|
-
this.closed = false
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
/**
|
|
589
|
-
* Render a block, prefixing each line with `delim`, and the first
|
|
590
|
-
* line in `firstDelim`. `node` should be the node that is closed at
|
|
591
|
-
* the end of the block, and `f` is a function that renders the
|
|
592
|
-
* content of the block.
|
|
593
|
-
*/
|
|
594
|
-
wrapBlock(delim, firstDelim, node, f) {
|
|
595
|
-
let old = this.delim
|
|
596
|
-
this.write(firstDelim || delim)
|
|
597
|
-
this.delim += delim
|
|
598
|
-
f()
|
|
599
|
-
this.delim = old
|
|
600
|
-
this.closeBlock(node)
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
atBlank() {
|
|
604
|
-
return this.out.length === 0 || this.out === '\n'
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* Prepare the state for writing output (closing closed paragraphs,
|
|
609
|
-
* adding delimiters, and so on), and then optionally add content
|
|
610
|
-
* (unescaped) to the output.
|
|
611
|
-
*/
|
|
612
|
-
write(content, marks = []) {
|
|
613
|
-
if (!content) {
|
|
614
|
-
return
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
let shouldNotEncode = false
|
|
618
|
-
|
|
619
|
-
if (marks && marks.some) {
|
|
620
|
-
shouldNotEncode = marks.some((mark) => {
|
|
621
|
-
return (
|
|
622
|
-
this.marks[mark.type.name] &&
|
|
623
|
-
this.marks[mark.type.name].shouldNotEncode
|
|
624
|
-
)
|
|
625
|
-
})
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
if (shouldNotEncode) {
|
|
629
|
-
this.out += content
|
|
630
|
-
} else {
|
|
631
|
-
// Always let Javascript DOM APIs handle the proper escaping of possible markup
|
|
632
|
-
// and/or entities in the content.
|
|
633
|
-
let container = document.createElement('div')
|
|
634
|
-
let textNode = document.createTextNode(content)
|
|
635
|
-
container.appendChild(textNode)
|
|
636
|
-
|
|
637
|
-
this.out += container.innerHTML
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
writeTag(content) {
|
|
642
|
-
if (!content) {
|
|
643
|
-
return
|
|
644
|
-
}
|
|
645
|
-
this.out += content
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
/**
|
|
649
|
-
* Close the block for the given node.
|
|
650
|
-
*/
|
|
651
|
-
closeBlock(node) {
|
|
652
|
-
this.closed = node
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
/**
|
|
656
|
-
* Add the given text to the document. When escape is not `false`,
|
|
657
|
-
* it will be escaped.
|
|
658
|
-
*/
|
|
659
|
-
text(text, escape) {
|
|
660
|
-
let lines = text.split('\n')
|
|
661
|
-
for (let i = 0; i < lines.length; i++) {
|
|
662
|
-
var startOfLine = this.atBlank() || this.closed
|
|
663
|
-
this.write()
|
|
664
|
-
this.out += escape !== false ? this.esc(lines[i], startOfLine) : lines[i]
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
/**
|
|
669
|
-
* Render the given node as a block.
|
|
670
|
-
* @param {ProseMirror.Model.Node} node
|
|
671
|
-
* @param {ProseMirror.Model.Node} parent
|
|
672
|
-
* @param {number} index
|
|
673
|
-
*/
|
|
674
|
-
render(node, parent, index) {
|
|
675
|
-
if (typeof parent === 'number') throw new Error('!')
|
|
676
|
-
this.nodes[node.type.name](this, node, parent, index)
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
/**
|
|
680
|
-
* Render the contents of `parent` as block nodes.
|
|
681
|
-
* @param {ProseMirror.Model.Node} parent
|
|
682
|
-
*/
|
|
683
|
-
renderContent(parent) {
|
|
684
|
-
parent.forEach((node, _, i) => this.render(node, parent, i))
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
/**
|
|
688
|
-
* Render the contents of `parent` as inline content.
|
|
689
|
-
* @param {ProseMirror.Model.Node} parent
|
|
690
|
-
*/
|
|
691
|
-
renderInline(parent) {
|
|
692
|
-
let trailing = ''
|
|
693
|
-
let progress = (node, _, index) => {
|
|
694
|
-
let marks = node ? node.marks : []
|
|
695
|
-
if (node && node.type.name === 'hard_break') {
|
|
696
|
-
marks = marks.filter((m) => {
|
|
697
|
-
if (index + 1 === parent.childCount) return false
|
|
698
|
-
let next = parent.child(index + 1)
|
|
699
|
-
return m.isInSet(next.marks) && (!next.isText || /\S/.test(next.text))
|
|
700
|
-
})
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
let leading = trailing
|
|
704
|
-
trailing = ''
|
|
705
|
-
// If whitespace has to be expelled from the node, adjust
|
|
706
|
-
// leading and trailing accordingly.
|
|
707
|
-
if (
|
|
708
|
-
node &&
|
|
709
|
-
node.isText &&
|
|
710
|
-
marks.some((mark) => {
|
|
711
|
-
let info = this.marks[mark.type.name]
|
|
712
|
-
return info && info.expelEnclosingWhitespace
|
|
713
|
-
})
|
|
714
|
-
) {
|
|
715
|
-
let [, lead, inner, trail] = /^(\s*)(.*?)(\s*)$/m.exec(node.text)
|
|
716
|
-
leading += lead
|
|
717
|
-
trailing = trail
|
|
718
|
-
if (lead || trail) {
|
|
719
|
-
node = inner ? node.withText(inner) : null
|
|
720
|
-
if (!node) marks = this.active
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
let inner = marks.length && marks[marks.length - 1]
|
|
725
|
-
let noEsc = inner && this.marks[inner.type.name].escape === false
|
|
726
|
-
let len = marks.length - (noEsc ? 1 : 0)
|
|
727
|
-
|
|
728
|
-
// Find the prefix of the mark set that didn't change
|
|
729
|
-
let keep = 0
|
|
730
|
-
while (
|
|
731
|
-
keep < Math.min(this.active.length, len) &&
|
|
732
|
-
marks[keep].eq(this.active[keep])
|
|
733
|
-
) {
|
|
734
|
-
++keep
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
// Close the marks that need to be closed
|
|
738
|
-
while (keep < this.active.length) {
|
|
739
|
-
this.text(this.markString(this.active.pop(), false), false)
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
// Output any previously expelled trailing whitespace outside the marks
|
|
743
|
-
if (leading) this.text(leading)
|
|
744
|
-
|
|
745
|
-
// Open the marks that need to be opened
|
|
746
|
-
if (node) {
|
|
747
|
-
while (this.active.length < len) {
|
|
748
|
-
let add = marks[this.active.length]
|
|
749
|
-
this.active.push(add)
|
|
750
|
-
this.text(this.markString(add, true), false)
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
// Render the node. Special case code marks, since their content
|
|
754
|
-
// may not be escaped.
|
|
755
|
-
if (noEsc && node.isText) {
|
|
756
|
-
this.text(
|
|
757
|
-
this.markString(inner, true) +
|
|
758
|
-
node.text +
|
|
759
|
-
this.markString(inner, false),
|
|
760
|
-
false,
|
|
761
|
-
)
|
|
762
|
-
} else this.render(node, parent, index)
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
parent.forEach(progress)
|
|
766
|
-
progress(null)
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
/**
|
|
770
|
-
* Render a node's content as a list. `delim` should be the extra
|
|
771
|
-
* indentation added to all lines except the first in an item,
|
|
772
|
-
* `firstDelim` is a function going from an item index to a
|
|
773
|
-
* delimiter for the first line of the item.
|
|
774
|
-
*
|
|
775
|
-
* @param {ProseMirror.Model.Node} node
|
|
776
|
-
* @param {string} delim
|
|
777
|
-
* @param {string} firstDelim
|
|
778
|
-
*/
|
|
779
|
-
renderList(node, delim, firstDelim) {
|
|
780
|
-
if (this.closed && this.closed.type === node.type) this.flushClose(3)
|
|
781
|
-
else if (this.inTightList) this.flushClose(1)
|
|
782
|
-
|
|
783
|
-
let isTight =
|
|
784
|
-
typeof node.attrs.tight !== 'undefined'
|
|
785
|
-
? node.attrs.tight
|
|
786
|
-
: this.options.tightLists
|
|
787
|
-
let prevTight = this.inTightList
|
|
788
|
-
this.inTightList = isTight
|
|
789
|
-
node.forEach((child, _, i) => {
|
|
790
|
-
if (i && isTight) this.flushClose(1)
|
|
791
|
-
this.wrapBlock(delim, firstDelim(i), node, () =>
|
|
792
|
-
this.render(child, node, i),
|
|
793
|
-
)
|
|
794
|
-
})
|
|
795
|
-
this.inTightList = prevTight
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
/**
|
|
799
|
-
* Escape the given string so that it can safely appear in Markdown
|
|
800
|
-
* content. If `startOfLine` is true, also escape characters that
|
|
801
|
-
* has special meaning only at the start of the line.
|
|
802
|
-
*
|
|
803
|
-
* @param {string} str
|
|
804
|
-
* @param {boolean} startOfLine
|
|
805
|
-
*/
|
|
806
|
-
esc(str, startOfLine) {
|
|
807
|
-
str = str.replace(/[`*\\~[\]]/g, '\\$&')
|
|
808
|
-
if (startOfLine) {
|
|
809
|
-
str = str.replace(/^[:#\-*+]/, '\\$&').replace(/^(\d+)\./, '$1\\.')
|
|
810
|
-
}
|
|
811
|
-
return str
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
markString(mark, open) {
|
|
815
|
-
let info = this.marks[mark.type.name]
|
|
816
|
-
let value = open ? info.open : info.close
|
|
817
|
-
return typeof value === 'string' ? value : value(this, mark)
|
|
818
|
-
}
|
|
819
|
-
}
|