@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,280 +0,0 @@
|
|
|
1
|
-
import { Plugin, PluginKey, TextSelection } from 'prosemirror-state'
|
|
2
|
-
import { Decoration, DecorationSet } from 'prosemirror-view'
|
|
3
|
-
import SpellCheckService from './spellcheck-service'
|
|
4
|
-
import Tether from '../../../dom/Tether'
|
|
5
|
-
import { v1 as uuidv1 } from 'uuid'
|
|
6
|
-
|
|
7
|
-
if (!window.BRIGHTSPOT?.ui.cms.enableV5UI) {
|
|
8
|
-
await import('./spellcheck.less')
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const SUGGESTIONS_MENU_CLASSNAME = 'ProseMirror-spellcheck-suggestions'
|
|
12
|
-
const PROBLEM_CLASSNAME = 'problem'
|
|
13
|
-
const spellCheckId = uuidv1()
|
|
14
|
-
const spellCheckService = new SpellCheckService(spellCheckId)
|
|
15
|
-
const key = new PluginKey('spellcheck')
|
|
16
|
-
const words = new Map()
|
|
17
|
-
// Which chararacters make up a word?
|
|
18
|
-
// This must account for unicode characters to support multiple locales!
|
|
19
|
-
// Taken from here: http://stackoverflow.com/a/22075070/101157
|
|
20
|
-
// U+0027 = apostrophe
|
|
21
|
-
// U+2019 = right single quote
|
|
22
|
-
const wordRegEx =
|
|
23
|
-
/[\u0027\u2019\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]+/g
|
|
24
|
-
|
|
25
|
-
let currentCallbackId = uuidv1()
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* This listens for publishes from the spellcheck service
|
|
29
|
-
* and adds the words to our words set.
|
|
30
|
-
*/
|
|
31
|
-
PubSub.subscribe(`spellcheck-${spellCheckId}`, (data) => {
|
|
32
|
-
const response = data.response
|
|
33
|
-
const wordsToFetch = data.words
|
|
34
|
-
response.results.forEach((result, index) => {
|
|
35
|
-
if (result) {
|
|
36
|
-
words.set(wordsToFetch[index], result)
|
|
37
|
-
} else {
|
|
38
|
-
words.set(wordsToFetch[index], wordsToFetch[index])
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
const handleReplace = (suggestion, view, from, to) => {
|
|
44
|
-
const state = view.state
|
|
45
|
-
let tr = state.tr
|
|
46
|
-
const dispatch = view.dispatch
|
|
47
|
-
const newSelection = new TextSelection(
|
|
48
|
-
state.doc.resolve(from),
|
|
49
|
-
state.doc.resolve(to),
|
|
50
|
-
)
|
|
51
|
-
tr.setSelection(newSelection)
|
|
52
|
-
const textNode = state.schema.text(suggestion)
|
|
53
|
-
tr.replaceSelectionWith(textNode, true)
|
|
54
|
-
dispatch(tr)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const removeResizeObserverCallback = (view) => {
|
|
58
|
-
if (view.props && view.props.props && view.props.props.resizeCallbacks) {
|
|
59
|
-
const filteredResizeCallbacks = view.props.props.resizeCallbacks.filter(
|
|
60
|
-
(callback) => {
|
|
61
|
-
return callback.id !== currentCallbackId
|
|
62
|
-
},
|
|
63
|
-
)
|
|
64
|
-
view.props.props.resizeCallbacks = filteredResizeCallbacks
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export const closeSuggestionsList = (view) => {
|
|
69
|
-
const container = document.body.querySelector(
|
|
70
|
-
`:scope > .${SUGGESTIONS_MENU_CLASSNAME}`,
|
|
71
|
-
)
|
|
72
|
-
if (container && !container.classList.contains('is-removing')) {
|
|
73
|
-
container.classList.add('is-removing')
|
|
74
|
-
container.addEventListener(
|
|
75
|
-
'transitionend',
|
|
76
|
-
(e) => {
|
|
77
|
-
document.body.removeChild(container)
|
|
78
|
-
removeResizeObserverCallback(view)
|
|
79
|
-
container.observer?.disconnect()
|
|
80
|
-
},
|
|
81
|
-
{ once: true },
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* This runs on state changes. It checks for a word to be in the
|
|
88
|
-
* cached dictionary and if not, makes the call to the spellcheck
|
|
89
|
-
* service. If the word is in the dictionary and it's misspelled, a
|
|
90
|
-
* decoration is created. All the decorations are then returned as
|
|
91
|
-
* a decoration set. We unfortunately can not debounce or throttle
|
|
92
|
-
* requests here because this is triggered by the plugin's state's
|
|
93
|
-
* apply method and any async activity will cause the UI to become
|
|
94
|
-
* out of sync with the decorations and the underlines will look like
|
|
95
|
-
* they are moving as the user types.
|
|
96
|
-
*
|
|
97
|
-
* This has to be invoked on state changes rather than on keyup, otherwise
|
|
98
|
-
* the UI becomes out of sync with the decorations and the underlines will look like
|
|
99
|
-
* they are moving as the user types. See
|
|
100
|
-
* [this example]{@link https://prosemirror.net/examples/lint/} for more information.
|
|
101
|
-
*
|
|
102
|
-
* @param {Prosemirror.Model.Node} doc
|
|
103
|
-
* @return {Prosemirror.EditorView.DecorationSet}
|
|
104
|
-
*/
|
|
105
|
-
const runSpellCheck = (doc) => {
|
|
106
|
-
const decos = []
|
|
107
|
-
const wordsToFetch = []
|
|
108
|
-
|
|
109
|
-
doc.descendants((node, pos) => {
|
|
110
|
-
if (node.isTextblock) {
|
|
111
|
-
let textContent = ''
|
|
112
|
-
node.forEach((child) => {
|
|
113
|
-
// If child has an 'html' mark replace the text with an equivalent number of
|
|
114
|
-
// spaces to preserve position and append, else just append the text as is.
|
|
115
|
-
textContent += child.marks?.some((mark) => mark.type.name === 'html')
|
|
116
|
-
? ' '.repeat(child.textContent.length)
|
|
117
|
-
: child.textContent
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
let match
|
|
121
|
-
while ((match = wordRegEx.exec(textContent))) {
|
|
122
|
-
const word = words.get(match[0])
|
|
123
|
-
if (!word) {
|
|
124
|
-
wordsToFetch.push(match[0])
|
|
125
|
-
} else if (word === match[0]) {
|
|
126
|
-
continue
|
|
127
|
-
} else {
|
|
128
|
-
let options = { class: PROBLEM_CLASSNAME }
|
|
129
|
-
const offset = match.index + 1
|
|
130
|
-
|
|
131
|
-
if (word.length) {
|
|
132
|
-
options = {
|
|
133
|
-
class: PROBLEM_CLASSNAME,
|
|
134
|
-
'data-suggestions': JSON.stringify(word),
|
|
135
|
-
'data-from': pos + offset,
|
|
136
|
-
'data-to': pos + offset + match[0].length,
|
|
137
|
-
title: 'Double click for suggestions',
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
decos.push(
|
|
142
|
-
Decoration.inline(
|
|
143
|
-
pos + offset,
|
|
144
|
-
pos + offset + match[0].length,
|
|
145
|
-
options,
|
|
146
|
-
),
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
})
|
|
152
|
-
|
|
153
|
-
if (wordsToFetch.length) {
|
|
154
|
-
spellCheckService.spellcheck(wordsToFetch)
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
return DecorationSet.create(doc, decos)
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Hits our spellcheck service as the user types and validates
|
|
162
|
-
* user input spelling. Uses Prosemirror Decorations to add a class to
|
|
163
|
-
* misspelled words so as not to mutate the DOM directly, which is against
|
|
164
|
-
* Prosemirror paradigms. Spelling is checked when a user pastes content
|
|
165
|
-
* and on state changes.
|
|
166
|
-
*
|
|
167
|
-
* Suggestions are received from the backend and stored on the inline decoration
|
|
168
|
-
* span in a data attribute. On double click, we create a submenu container with
|
|
169
|
-
* the suggestions for that misspelling and position it underneath the misspelling.
|
|
170
|
-
* The inline decoration also has attributes that note its to and from positions,
|
|
171
|
-
* so that we can replace the misspelled word if the user clicks on one of the
|
|
172
|
-
* suggestions. On click anywhere in the editor, we remove the submenu from the DOM.
|
|
173
|
-
*/
|
|
174
|
-
const spellcheckPlugin = () => {
|
|
175
|
-
return new Plugin({
|
|
176
|
-
key,
|
|
177
|
-
|
|
178
|
-
state: {
|
|
179
|
-
init(_, state) {
|
|
180
|
-
const { doc } = state
|
|
181
|
-
return runSpellCheck(doc)
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
apply(transaction, value, oldState, newState) {
|
|
185
|
-
return runSpellCheck(newState.doc)
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
props: {
|
|
189
|
-
decorations(state) {
|
|
190
|
-
return this.getState(state)
|
|
191
|
-
},
|
|
192
|
-
handleDOMEvents: {
|
|
193
|
-
blur: (view, evt) => {
|
|
194
|
-
!evt.relatedTarget?.closest('.ProseMirror-spellcheck-suggestions') &&
|
|
195
|
-
closeSuggestionsList(view)
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
handleClick: (view, pos, evt) => {
|
|
199
|
-
closeSuggestionsList(view)
|
|
200
|
-
},
|
|
201
|
-
handleDoubleClick: (view, pos, evt) => {
|
|
202
|
-
closeSuggestionsList(view)
|
|
203
|
-
|
|
204
|
-
if (!evt.target.classList.contains(PROBLEM_CLASSNAME)) {
|
|
205
|
-
return
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
const container = document.createElement('ul')
|
|
209
|
-
container.className = SUGGESTIONS_MENU_CLASSNAME
|
|
210
|
-
|
|
211
|
-
const suggestions = evt.target.getAttribute('data-suggestions')
|
|
212
|
-
if (!suggestions) {
|
|
213
|
-
return
|
|
214
|
-
}
|
|
215
|
-
let suggestionsArr = []
|
|
216
|
-
let from = evt.target.getAttribute('data-from')
|
|
217
|
-
let to = evt.target.getAttribute('data-to')
|
|
218
|
-
try {
|
|
219
|
-
suggestionsArr = JSON.parse(suggestions)
|
|
220
|
-
from = parseInt(from)
|
|
221
|
-
to = parseInt(to)
|
|
222
|
-
} catch (e) {}
|
|
223
|
-
|
|
224
|
-
if (
|
|
225
|
-
!suggestionsArr.length ||
|
|
226
|
-
typeof from !== 'number' ||
|
|
227
|
-
typeof to !== 'number'
|
|
228
|
-
) {
|
|
229
|
-
return
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
suggestionsArr.forEach((suggestion) => {
|
|
233
|
-
const li = document.createElement('li')
|
|
234
|
-
li.setAttribute('tabindex', 0)
|
|
235
|
-
li.innerText = suggestion
|
|
236
|
-
li.addEventListener('click', (evt) => {
|
|
237
|
-
handleReplace(suggestion, view, from, to)
|
|
238
|
-
closeSuggestionsList(view)
|
|
239
|
-
})
|
|
240
|
-
container.appendChild(li)
|
|
241
|
-
})
|
|
242
|
-
document.body.appendChild(container)
|
|
243
|
-
setTimeout(() => {
|
|
244
|
-
container.classList.add('is-opening')
|
|
245
|
-
}, 0)
|
|
246
|
-
|
|
247
|
-
new Tether(evt.target, container)
|
|
248
|
-
const callback = () => {
|
|
249
|
-
new Tether(evt.target, container)
|
|
250
|
-
}
|
|
251
|
-
currentCallbackId = uuidv1()
|
|
252
|
-
|
|
253
|
-
container.observer = new IntersectionObserver((changes) => {
|
|
254
|
-
if (container.classList.contains('is-removing')) return
|
|
255
|
-
changes.forEach((change) => {
|
|
256
|
-
if (change.isIntersecting) {
|
|
257
|
-
container.style.display = 'block'
|
|
258
|
-
} else {
|
|
259
|
-
container.style.display = 'none'
|
|
260
|
-
}
|
|
261
|
-
})
|
|
262
|
-
})
|
|
263
|
-
container.observer.observe(evt.target)
|
|
264
|
-
|
|
265
|
-
if (
|
|
266
|
-
view.props &&
|
|
267
|
-
view.props.props &&
|
|
268
|
-
view.props.props.resizeCallbacks
|
|
269
|
-
) {
|
|
270
|
-
view.props.props.resizeCallbacks.push({
|
|
271
|
-
id: currentCallbackId,
|
|
272
|
-
callback,
|
|
273
|
-
})
|
|
274
|
-
}
|
|
275
|
-
},
|
|
276
|
-
},
|
|
277
|
-
})
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
export { spellcheckPlugin, runSpellCheck }
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import Cookies from 'js.cookie'
|
|
2
|
-
/**
|
|
3
|
-
* This manages requests to our back-end spellcheck. It keeps track if a
|
|
4
|
-
* fetch is in progress, and if so, queues up any incoming requests to
|
|
5
|
-
* be fetched once the fetch that is in progress completes so that we don't
|
|
6
|
-
* have more than 1 fetch pending at any time. Upon successful
|
|
7
|
-
* completion of a fetch to the back-end service, this publishes the data
|
|
8
|
-
* retrieved from back-end spellcheck for any subscribers listening.
|
|
9
|
-
*/
|
|
10
|
-
class SpellCheckService {
|
|
11
|
-
/**
|
|
12
|
-
* @constructor
|
|
13
|
-
* @param {string} id The id to be used for the spellcheck topic to ensure
|
|
14
|
-
* publishes are dispatched to the specific RTE instance that invokes this
|
|
15
|
-
* class.
|
|
16
|
-
*/
|
|
17
|
-
constructor(id) {
|
|
18
|
-
this.id = id
|
|
19
|
-
this.isSpellCheckInProgress = false
|
|
20
|
-
this.queue = []
|
|
21
|
-
this.locale = document.querySelector('html').getAttribute('lang') || 'en'
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @private
|
|
26
|
-
* Makes the actual fetch to the back-end.
|
|
27
|
-
* @param {Array.<string>} words The words to be sent to the back-end.
|
|
28
|
-
* @return {Promise.<Object|null>} The response or null if there was an error
|
|
29
|
-
* during the fetch.
|
|
30
|
-
*/
|
|
31
|
-
_fetchResults = async (words) => {
|
|
32
|
-
this.isSpellCheckInProgress = true
|
|
33
|
-
const body = new URLSearchParams()
|
|
34
|
-
body.append('locale', this.locale)
|
|
35
|
-
for (const word of words) {
|
|
36
|
-
body.append('word', word)
|
|
37
|
-
}
|
|
38
|
-
try {
|
|
39
|
-
const response = await fetch('/cms/spellCheck', {
|
|
40
|
-
method: 'POST',
|
|
41
|
-
headers: {
|
|
42
|
-
'Brightspot-CSRF': Cookies.get('bsp.csrf'),
|
|
43
|
-
},
|
|
44
|
-
body,
|
|
45
|
-
})
|
|
46
|
-
this.isSpellCheckInProgress = false
|
|
47
|
-
return response
|
|
48
|
-
} catch (e) {
|
|
49
|
-
this.isSpellCheckInProgress = false
|
|
50
|
-
return null
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @private
|
|
56
|
-
* Publishes the results if the fetch returns with a response. Then
|
|
57
|
-
* checks the queue for any outstanding words to be fetched, and if there
|
|
58
|
-
* are, repeats the fetch process, then clears the queue.
|
|
59
|
-
* @param {Array.<string>} words
|
|
60
|
-
*/
|
|
61
|
-
_handleCheck = async (words) => {
|
|
62
|
-
words = [...new Set(words)]
|
|
63
|
-
const response = await this._fetchResults(words)
|
|
64
|
-
if (response) {
|
|
65
|
-
const json = await response.json()
|
|
66
|
-
if (json.results) {
|
|
67
|
-
PubSub.publish(`spellcheck-${this.id}`, {
|
|
68
|
-
response: json,
|
|
69
|
-
words,
|
|
70
|
-
})
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (this.queue.length) {
|
|
75
|
-
this._handleCheck(this.queue)
|
|
76
|
-
this.queue = []
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* The API. Checks to see if a request is in progress,
|
|
82
|
-
* and if so, queues up the incoming request, otherwise
|
|
83
|
-
* passes the request on to the next step.
|
|
84
|
-
*/
|
|
85
|
-
spellcheck = (words) => {
|
|
86
|
-
if (this.isSpellCheckInProgress) {
|
|
87
|
-
this.queue = this.queue.concat(words)
|
|
88
|
-
} else {
|
|
89
|
-
this._handleCheck(words)
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export default SpellCheckService
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-debugger */
|
|
2
|
-
import { Plugin, PluginKey } from 'prosemirror-state'
|
|
3
|
-
import { findParentNodeOfType } from 'prosemirror-utils'
|
|
4
|
-
import { Decoration, DecorationSet } from 'prosemirror-view'
|
|
5
|
-
|
|
6
|
-
const key = new PluginKey('tableManager')
|
|
7
|
-
|
|
8
|
-
const tableManagerPlugin = (schema) => {
|
|
9
|
-
return new Plugin({
|
|
10
|
-
key: key,
|
|
11
|
-
|
|
12
|
-
props: {
|
|
13
|
-
decorations(state) {
|
|
14
|
-
const decorations = []
|
|
15
|
-
const parent = findParentNodeOfType(state.schema.nodes.tableCell)(
|
|
16
|
-
state.selection,
|
|
17
|
-
)
|
|
18
|
-
if (parent && parent.node) {
|
|
19
|
-
decorations.push(
|
|
20
|
-
Decoration.node(parent.pos, parent.pos + parent.node.nodeSize, {
|
|
21
|
-
class: 'is-selected-cell',
|
|
22
|
-
}),
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return DecorationSet.create(state.doc, decorations)
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
state: {
|
|
30
|
-
init(config, editorState) {
|
|
31
|
-
const pluginState = new Map()
|
|
32
|
-
const disabledStates = new Map()
|
|
33
|
-
pluginState.set('disabledStates', disabledStates)
|
|
34
|
-
|
|
35
|
-
return pluginState
|
|
36
|
-
},
|
|
37
|
-
apply(tr, value, oldState, newState) {
|
|
38
|
-
const pluginState = value
|
|
39
|
-
const disabledStates = pluginState.get('disabledStates')
|
|
40
|
-
|
|
41
|
-
if (
|
|
42
|
-
tr.curSelection.$anchor.path.filter(
|
|
43
|
-
(item) => item.type && item.type.name === 'table',
|
|
44
|
-
).length > 0
|
|
45
|
-
) {
|
|
46
|
-
disabledStates.set('html', true)
|
|
47
|
-
} else {
|
|
48
|
-
disabledStates.set('html', false)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return value
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export { tableManagerPlugin }
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { Node } from 'prosemirror-model'
|
|
2
|
-
import TableSizerView from './views/TableSizerView'
|
|
3
|
-
import { v1 as uuidv1 } from 'uuid'
|
|
4
|
-
import { closeLayeredPopups } from '../../utilities'
|
|
5
|
-
|
|
6
|
-
if (!window.BRIGHTSPOT?.ui.cms.enableV5UI) {
|
|
7
|
-
await import('./views/TableSizerPopup.less')
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const getWidgetMarkup = () => {
|
|
11
|
-
return `
|
|
12
|
-
<div class="Widget TableSizer">
|
|
13
|
-
<div class="TableSizer-content">
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
`
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const getTableSize = async (evt) => {
|
|
20
|
-
const evtKey = uuidv1()
|
|
21
|
-
const tableSizerEle = new TableSizerView(evtKey)
|
|
22
|
-
const $popup = $(document.createElement('div'))
|
|
23
|
-
$popup.html(getWidgetMarkup())
|
|
24
|
-
$popup.find('.TableSizer-content').append(tableSizerEle)
|
|
25
|
-
$popup.popup()
|
|
26
|
-
$popup.popup('source', $(evt.target), evt)
|
|
27
|
-
$popup.popup('open')
|
|
28
|
-
$popup.popup('container').addClass('is-local')
|
|
29
|
-
$popup.show()
|
|
30
|
-
|
|
31
|
-
return new Promise(function (resolve, reject) {
|
|
32
|
-
PubSub.subscribe(`${evtKey}-cellSelected`, (data) => {
|
|
33
|
-
$popup.popup('close')
|
|
34
|
-
resolve({
|
|
35
|
-
rows: data.rows,
|
|
36
|
-
cols: data.cols,
|
|
37
|
-
})
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
const popupParent = $popup.closest('.Popup')
|
|
41
|
-
const closeButton = popupParent.find('.Popup-close')
|
|
42
|
-
if (closeButton && closeButton.length) {
|
|
43
|
-
closeButton[0].addEventListener('click', () => {
|
|
44
|
-
reject(new Error('No selection made.'))
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const insertTable = () => {
|
|
51
|
-
return async function (state, dispatch, view, evt) {
|
|
52
|
-
try {
|
|
53
|
-
closeLayeredPopups(evt)
|
|
54
|
-
|
|
55
|
-
const tableSize = await getTableSize(evt)
|
|
56
|
-
let transaction = state.tr
|
|
57
|
-
const schema = state.config.schema
|
|
58
|
-
const { from } = state.selection
|
|
59
|
-
const rows = tableSize.rows
|
|
60
|
-
const columns = tableSize.cols
|
|
61
|
-
const content = []
|
|
62
|
-
for (let i = 0; i < rows; i++) {
|
|
63
|
-
const rowContent = []
|
|
64
|
-
for (let j = 0; j < columns; j++) {
|
|
65
|
-
rowContent.push({
|
|
66
|
-
type: 'tableCell',
|
|
67
|
-
attrs: {
|
|
68
|
-
colspan: 1,
|
|
69
|
-
rowspan: 1,
|
|
70
|
-
colwidth: null,
|
|
71
|
-
background: null,
|
|
72
|
-
},
|
|
73
|
-
content: [{ type: 'line' }],
|
|
74
|
-
})
|
|
75
|
-
}
|
|
76
|
-
content.push({
|
|
77
|
-
type: 'tableRow',
|
|
78
|
-
content: rowContent,
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const nodeJSON = {
|
|
83
|
-
type: 'table',
|
|
84
|
-
content,
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const tableNode = Node.fromJSON(schema, nodeJSON)
|
|
88
|
-
transaction.insert(from, tableNode)
|
|
89
|
-
|
|
90
|
-
dispatch(transaction)
|
|
91
|
-
} catch (e) {}
|
|
92
|
-
|
|
93
|
-
return true
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export { insertTable }
|
package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/views/TableSizerView.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
export default class TableSizer {
|
|
2
|
-
constructor(evtKey) {
|
|
3
|
-
this.evtKey = evtKey
|
|
4
|
-
const dom = document.createElement('div')
|
|
5
|
-
this.table = this.getTable()
|
|
6
|
-
this.addEventListeners()
|
|
7
|
-
|
|
8
|
-
if (window.BRIGHTSPOT?.ui.cms.enableV5UI) {
|
|
9
|
-
const v5Title = document.createElement('h2')
|
|
10
|
-
v5Title.className = 'v5-only'
|
|
11
|
-
v5Title.innerText = window.BRIGHTSPOT.ui.tooltips.tableAdd
|
|
12
|
-
dom.appendChild(v5Title)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
dom.appendChild(this.table)
|
|
16
|
-
return dom
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
getTable = () => {
|
|
20
|
-
const table = document.createElement('table')
|
|
21
|
-
for (let row = 0; row < this.rows; row++) {
|
|
22
|
-
const tr = document.createElement('tr')
|
|
23
|
-
table.appendChild(tr)
|
|
24
|
-
for (let col = 0; col < this.cols; col++) {
|
|
25
|
-
const td = document.createElement('td')
|
|
26
|
-
td.innerHTML = ' '
|
|
27
|
-
td.setAttribute('data-row', row)
|
|
28
|
-
td.setAttribute('data-col', col)
|
|
29
|
-
tr.appendChild(td)
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return table
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
getCells = () => {
|
|
36
|
-
if (!this.cells) {
|
|
37
|
-
this.cells = this.table.querySelectorAll('td')
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return this.cells
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
addEventListeners = () => {
|
|
44
|
-
const cells = this.getCells()
|
|
45
|
-
for (let cell of cells) {
|
|
46
|
-
cell.addEventListener('mouseover', this.handleMouseOver)
|
|
47
|
-
cell.addEventListener('click', this.handleClick)
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
handleClick = (evt) => {
|
|
52
|
-
const targetCell = evt.target
|
|
53
|
-
const targetCellRowPos = parseInt(targetCell.getAttribute('data-row'), 10)
|
|
54
|
-
const targetCellColPos = parseInt(targetCell.getAttribute('data-col'), 10)
|
|
55
|
-
PubSub.publish(`${this.evtKey}-cellSelected`, {
|
|
56
|
-
rows: targetCellRowPos + 1,
|
|
57
|
-
cols: targetCellColPos + 1,
|
|
58
|
-
})
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
handleMouseOver = (evt) => {
|
|
62
|
-
const targetCell = evt.target
|
|
63
|
-
const targetCellRowPos = parseInt(targetCell.getAttribute('data-row'), 10)
|
|
64
|
-
const targetCellColPos = parseInt(targetCell.getAttribute('data-col'), 10)
|
|
65
|
-
const cells = this.getCells()
|
|
66
|
-
for (let cell of cells) {
|
|
67
|
-
const cellRowPos = parseInt(cell.getAttribute('data-row'), 10)
|
|
68
|
-
const cellColPos = parseInt(cell.getAttribute('data-col'), 10)
|
|
69
|
-
if (cellRowPos <= targetCellRowPos && cellColPos <= targetCellColPos) {
|
|
70
|
-
cell.classList.add('active')
|
|
71
|
-
} else {
|
|
72
|
-
cell.classList.remove('active')
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
PubSub.publish(`${this.evtKey}-cellHovered`, {
|
|
76
|
-
rows: targetCellRowPos + 1,
|
|
77
|
-
cols: targetCellColPos + 1,
|
|
78
|
-
})
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
get cols() {
|
|
82
|
-
return 20
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
get rows() {
|
|
86
|
-
return 10
|
|
87
|
-
}
|
|
88
|
-
}
|