@brightspot/ui 3.0.1-cms-ui-migration.2 → 3.0.1-cms-ui-migration.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -35
- package/dist/custom-elements.json +1924 -1924
- package/dist/storybook/assets/{ActionBar.stories-hJ_5cm-P.js → ActionBar.stories-CSxtZl7v.js} +1 -1
- package/dist/storybook/assets/{ActionItem.stories-Bjx2803w.js → ActionItem.stories-BWcMRMP3.js} +1 -1
- package/dist/storybook/assets/{Avatar.stories-Cj0YgZ6f.js → Avatar.stories-CYTUGXzH.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-Lh_sQFCU.js → AvatarGroup.stories-CSYBYo_5.js} +1 -1
- package/dist/storybook/assets/{Badge.stories-BL7RUibx.js → Badge.stories-LuF4BuVr.js} +1 -1
- package/dist/storybook/assets/{Button-BPHNcxqK.js → Button-CrXCMxHb.js} +1 -1
- package/dist/storybook/assets/{Button.stories-CAYO4gdU.js → Button.stories-JVwxdrdM.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup.stories-Cd13Us5K.js → ButtonGroup.stories-qtq64a1H.js} +1 -1
- package/dist/storybook/assets/{Celebrate.stories-D_KE3Qze.js → Celebrate.stories-DjTtaSd6.js} +1 -1
- package/dist/storybook/assets/{Checkbox.stories-Aj1xgZVn.js → Checkbox.stories-v1Pr5mL6.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-BecV_v6d.js → CircularProgress.stories-DkV7PJ4D.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-DU-WiZ2f.js → ClipboardMixin.stories-Dh5c7uSM.js} +1 -1
- package/dist/storybook/assets/{Color-6BZIO3FS-BYl4KZZn.js → Color-6BZIO3FS-B1gcREt6.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-BMUVUy2q.js → Colors.stories-DnubtRqn.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-FHcPKFm6.js → CombinedEffects.stories-By6akSve.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-EMUnfT5y.js → ComponentStatesMixin-CPLGv3h-.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-SXq0kzS9.js → ComponentStatesMixin.stories-CiQ_lyhm.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-u43lhvcI.js → CopyToClipboard.stories-cJ7rl3mj.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-BdCn5qgO.js → Debounce.stories-Bw-goobU.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-DxiEJ_jx.js → DocsRenderer-LL677BLK-CNW57dGQ.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-BWSRwjIF.js → Dropdown.stories-CwC3HXXd.js} +1 -1
- package/dist/storybook/assets/{EmptyState.stories-BpobeZL5.js → EmptyState.stories-BUEJwuhP.js} +1 -1
- package/dist/storybook/assets/{Events.stories-CP5kMzpr.js → Events.stories-D1mf9buv.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-CbJD-oTB.js → Heading.stories-DO906G4P.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-BOABJ7zw.js → HueRipple.stories-BOySRSZB.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-CWlUHL4j.js → Icon.stories-BsqgTbdG.js} +1 -1
- package/dist/storybook/assets/{IconButton.stories-BWBs-OLT.js → IconButton.stories-aza1AAKk.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-LZ0GZoxF.js → LinearProgress.stories-CDYmiiex.js} +1 -1
- package/dist/storybook/assets/{Pagination.stories-CbLaR3P9.js → Pagination.stories-LXB-x7YB.js} +1 -1
- package/dist/storybook/assets/{Popover.stories-JHrWqYZw.js → Popover.stories-DY1HesPJ.js} +1 -1
- package/dist/storybook/assets/{ReadyMixin-B1H2a9x8.js → ReadyMixin-DmOC67IJ.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin.stories-UMHpYG73.js → RovingTabindexMixin.stories-BWy0Rq8d.js} +1 -1
- package/dist/storybook/assets/{Rtc.stories-VQtNSlls.js → Rtc.stories-DrmdqqbI.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-CYdi8Tgp.js → ScrollShadow.stories-DiKFPazh.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-D8F2hZCf.js → Switch.stories-BgFnw8_z.js} +1 -1
- package/dist/storybook/assets/{Tab.stories-wgBP0lTj.js → Tab.stories-c2wLMooF.js} +1 -1
- package/dist/storybook/assets/{Tabs.stories-C00rr5sf.js → Tabs.stories-CjH8seNP.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-BhQEfJbS.js → Throttle.stories-CXysc_QE.js} +1 -1
- package/dist/storybook/assets/{Tooltip.stories-CGoZ5qTn.js → Tooltip.stories-6qzyByPm.js} +1 -1
- package/dist/storybook/assets/{Upload.stories-B3K-HAXw.js → Upload.stories-BLxykydQ.js} +1 -1
- package/dist/storybook/assets/{UploadItem.stories-71ArSoUh.js → UploadItem.stories-CcfcqdJW.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-CihlfFXS.js → Welcome.stories-CzYS_3fH.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-1u4KbiJM.js → Widget.stories-Du7T4LAI.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-B3Jitxw9.js → WithTooltip-65CFNBJE-D4LfXdYt.js} +1 -1
- package/dist/storybook/assets/{blocks-C1HaXuQB.js → blocks-DR3fGePu.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-Dy9Lt9fs.js → formatter-EIJCOSYU-Cf01216O.js} +1 -1
- package/dist/storybook/assets/if-defined-DaMmbcIU.js +1 -0
- package/dist/storybook/assets/{iframe-Dx6IxWXF.js → iframe-CQArUhO8.js} +4 -4
- package/dist/storybook/assets/{index-OrjedSVh.js → index-B1uI_67G.js} +1 -1
- package/dist/storybook/assets/{onFind-YTqjw6W0.js → onFind-BpFkN2Rh.js} +1 -1
- package/dist/storybook/assets/{onFind.stories-DEvwTrmx.js → onFind.stories-Cxdeg69X.js} +1 -1
- package/dist/storybook/assets/{onRemove.stories-D5mO-Lin.js → onRemove.stories-BHEWpNrE.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-C3Rcz0Eb.js → onVisible.stories-DFJ3S_ZS.js} +1 -1
- package/dist/storybook/assets/{style-map-CiMHry7H.js → style-map-DJ83UC3V.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-DIZnuhb2.js → syntaxhighlighter-ED5Y7EFY-zYN83mxK.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +16 -2
- package/dist/storybook/assets/if-defined-CA2KmTqA.js +0 -1
- package/src/legacy/tool-ui/src/main/resources/settings.properties +0 -1
- package/src/legacy/tool-ui/src/main/webapp/WEB-INF/web.xml +0 -81
- package/src/legacy/tool-ui/src/main/webapp/script/bsp-uploader.js +0 -170
- package/src/legacy/tool-ui/src/main/webapp/script/bsp-utils.js +0 -393
- package/src/legacy/tool-ui/src/main/webapp/script/content/layout-element.js +0 -141
- package/src/legacy/tool-ui/src/main/webapp/script/input/query.js +0 -78
- package/src/legacy/tool-ui/src/main/webapp/script/input/workflow.js +0 -718
- package/src/legacy/tool-ui/src/main/webapp/script/jquery.extra.js +0 -633
- package/src/legacy/tool-ui/src/main/webapp/script/v3/Dropbox.js +0 -18
- package/src/legacy/tool-ui/src/main/webapp/script/v3/EditFieldUpdate.js +0 -406
- package/src/legacy/tool-ui/src/main/webapp/script/v3/EditFieldUpdateCache.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/script/v3/Notification.js +0 -151
- package/src/legacy/tool-ui/src/main/webapp/script/v3/content/edit.js +0 -194
- package/src/legacy/tool-ui/src/main/webapp/script/v3/content/state.js +0 -785
- package/src/legacy/tool-ui/src/main/webapp/script/v3/csrf.js +0 -35
- package/src/legacy/tool-ui/src/main/webapp/script/v3/dashboard.js +0 -65
- package/src/legacy/tool-ui/src/main/webapp/script/v3/input/dataTransfer.js +0 -129
- package/src/legacy/tool-ui/src/main/webapp/script/v3/input/file.js +0 -433
- package/src/legacy/tool-ui/src/main/webapp/script/v3/input/object.js +0 -743
- package/src/legacy/tool-ui/src/main/webapp/script/v3/input/read-only.js +0 -17
- package/src/legacy/tool-ui/src/main/webapp/script/v3/jquery.frame.js +0 -478
- package/src/legacy/tool-ui/src/main/webapp/script/v3/jquery.repeatable.js +0 -2406
- package/src/legacy/tool-ui/src/main/webapp/script/v3/plugin/popup.d.ts +0 -2
- package/src/legacy/tool-ui/src/main/webapp/script/v3/plugin/popup.js +0 -446
- package/src/legacy/tool-ui/src/main/webapp/script/v3/search-filters.js +0 -62
- package/src/legacy/tool-ui/src/main/webapp/script/v3/search.js +0 -53
- package/src/legacy/tool-ui/src/main/webapp/script/v3.js +0 -1049
- package/src/legacy/tool-ui/src/main/webapp/v4/Admin.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/AutoExpand.js +0 -84
- package/src/legacy/tool-ui/src/main/webapp/v4/AutoSubmit.js +0 -68
- package/src/legacy/tool-ui/src/main/webapp/v4/Bridge.js +0 -536
- package/src/legacy/tool-ui/src/main/webapp/v4/CheckboxInput.js +0 -22
- package/src/legacy/tool-ui/src/main/webapp/v4/ColorInput.js +0 -5
- package/src/legacy/tool-ui/src/main/webapp/v4/ColorInputSpectrum.js +0 -107
- package/src/legacy/tool-ui/src/main/webapp/v4/ComboInput.js +0 -1491
- package/src/legacy/tool-ui/src/main/webapp/v4/CommunityWidget.js +0 -29
- package/src/legacy/tool-ui/src/main/webapp/v4/ContentEdit.js +0 -2427
- package/src/legacy/tool-ui/src/main/webapp/v4/ContentLock.js +0 -470
- package/src/legacy/tool-ui/src/main/webapp/v4/ContentReporting.js +0 -32
- package/src/legacy/tool-ui/src/main/webapp/v4/DataTable.js +0 -31
- package/src/legacy/tool-ui/src/main/webapp/v4/DateStringField.js +0 -485
- package/src/legacy/tool-ui/src/main/webapp/v4/Entry.js +0 -264
- package/src/legacy/tool-ui/src/main/webapp/v4/ExternalItemAuth.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/Form.js +0 -31
- package/src/legacy/tool-ui/src/main/webapp/v4/Hierarchy.js +0 -100
- package/src/legacy/tool-ui/src/main/webapp/v4/Icon.ts +0 -49
- package/src/legacy/tool-ui/src/main/webapp/v4/ImageEditor.js +0 -2403
- package/src/legacy/tool-ui/src/main/webapp/v4/ImageEditorBundle.js +0 -5
- package/src/legacy/tool-ui/src/main/webapp/v4/LinkCarousel.js +0 -40
- package/src/legacy/tool-ui/src/main/webapp/v4/LinkList.js +0 -14
- package/src/legacy/tool-ui/src/main/webapp/v4/LinkTable.js +0 -123
- package/src/legacy/tool-ui/src/main/webapp/v4/Location.js +0 -19
- package/src/legacy/tool-ui/src/main/webapp/v4/LocationMap.js +0 -148
- package/src/legacy/tool-ui/src/main/webapp/v4/LookingGlass.js +0 -24
- package/src/legacy/tool-ui/src/main/webapp/v4/Message.js +0 -14
- package/src/legacy/tool-ui/src/main/webapp/v4/NumberBar.js +0 -32
- package/src/legacy/tool-ui/src/main/webapp/v4/Page.js +0 -890
- package/src/legacy/tool-ui/src/main/webapp/v4/Preview.js +0 -758
- package/src/legacy/tool-ui/src/main/webapp/v4/PreviewEditor.js +0 -86
- package/src/legacy/tool-ui/src/main/webapp/v4/PreviewOverlay.js +0 -1005
- package/src/legacy/tool-ui/src/main/webapp/v4/PubSub.js +0 -47
- package/src/legacy/tool-ui/src/main/webapp/v4/QueryField.js +0 -211
- package/src/legacy/tool-ui/src/main/webapp/v4/RegionMap.js +0 -215
- package/src/legacy/tool-ui/src/main/webapp/v4/RepeatableContentInputGroup.js +0 -160
- package/src/legacy/tool-ui/src/main/webapp/v4/RichTextEditor.js +0 -154
- package/src/legacy/tool-ui/src/main/webapp/v4/SearchFields.js +0 -281
- package/src/legacy/tool-ui/src/main/webapp/v4/SearchResult.js +0 -255
- package/src/legacy/tool-ui/src/main/webapp/v4/SharePreview.js +0 -56
- package/src/legacy/tool-ui/src/main/webapp/v4/Sortable.js +0 -874
- package/src/legacy/tool-ui/src/main/webapp/v4/StyleEmbeddedContent.js +0 -100
- package/src/legacy/tool-ui/src/main/webapp/v4/StyleguidePresets.js +0 -357
- package/src/legacy/tool-ui/src/main/webapp/v4/TabContainer.js +0 -360
- package/src/legacy/tool-ui/src/main/webapp/v4/Taxonomy.js +0 -27
- package/src/legacy/tool-ui/src/main/webapp/v4/ThemeBundleEditor.js +0 -224
- package/src/legacy/tool-ui/src/main/webapp/v4/TimedContent.js +0 -147
- package/src/legacy/tool-ui/src/main/webapp/v4/TimedContentBundle.js +0 -8
- package/src/legacy/tool-ui/src/main/webapp/v4/VideoEditor.js +0 -2417
- package/src/legacy/tool-ui/src/main/webapp/v4/VideoEditorBundle.js +0 -8
- package/src/legacy/tool-ui/src/main/webapp/v4/ViewMirror.js +0 -52
- package/src/legacy/tool-ui/src/main/webapp/v4/ViewPreview.d.ts +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/ViewPreview.js +0 -177
- package/src/legacy/tool-ui/src/main/webapp/v4/Widget.js +0 -90
- package/src/legacy/tool-ui/src/main/webapp/v4/__mocks__/fileMock.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/__mocks__/styleMock.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/__mocks__/textArea.mock.js +0 -20
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/globals.js +0 -770
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/ProseMirror.test.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/index.html +0 -54
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/comment_manager/CommentManager.test.js +0 -29
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/comment_manager/index.html +0 -35
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/custom_keyboard/CustomKeyboard.js +0 -42
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/custom_keyboard/index.html +0 -37
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/EnhancementManager.test.js +0 -288
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/block.html +0 -38
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/inline.html +0 -38
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/no-popups.html +0 -38
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/list_manager/ListManager.js +0 -257
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/list_manager/index.html +0 -38
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/hierarchal.html +0 -33
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/index.html +0 -33
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/menubar.test.js +0 -195
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/small.html +0 -34
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/tags.html +0 -34
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/PlaceholderManager.test.js +0 -134
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/has-editable-placeholder.html +0 -32
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/has-text.html +0 -34
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/index.html +0 -31
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/table_manager/TableManager.test.js +0 -63
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/table_manager/existing.html +0 -48
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/track_manager/TrackManager.test.js +0 -291
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/track_manager/existing.html +0 -39
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/track_manager/insert.html +0 -37
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/Sortable.test.js +0 -105
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/ProseMirror.test.js +0 -41
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/codemirror-shim.test.js +0 -72
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/collab_manager/CollabManager.test.js +0 -46
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/enhancement_manager/EnhancementManager.test.js +0 -84
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/list_manager/ListManager.test.js +0 -54
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/menubar/menubar.test.js +0 -183
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/spellcheck/SpellCheck.test.js +0 -45
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/settings/BSSerializer.test.js +0 -346
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/settings/menuItemsBuilder.test.js +0 -226
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/utilities.test.js +0 -118
- package/src/legacy/tool-ui/src/main/webapp/v4/appetizeio/Appetizeio.js +0 -5
- package/src/legacy/tool-ui/src/main/webapp/v4/appetizeio/AppetizeioEmbedded.js +0 -113
- package/src/legacy/tool-ui/src/main/webapp/v4/compat/Fetch.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/compat/jquery.js +0 -32
- package/src/legacy/tool-ui/src/main/webapp/v4/compat/requirejs.js +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/Tether.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/TetherLayout.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/closest.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/create.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/find.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/findAll.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/ifClick.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/ifMatches.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/ifUnmodified.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/index.js +0 -5
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/insertBefore.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/insertFirst.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/insertLast.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onFind.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onFindOnce.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onRTEReady.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onRemove.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onVisible.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/previousUntil.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/resolveIconCompat.js +0 -40
- package/src/legacy/tool-ui/src/main/webapp/v4/rtc/Socket.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/rtc/index.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/ProseMirror.js +0 -909
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/README.md +0 -68
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/codemirror-shim.d.ts +0 -8
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/codemirror-shim.js +0 -274
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/collab-workflow.jpeg +0 -0
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/interchangeable.ts +0 -250
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/mention.js +0 -90
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/PluginProvider.js +0 -124
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/README.md +0 -46
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/ai_inline_manager/AIInlineManager.ts +0 -124
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/ai_inline_manager/views/AIInlineView.ts +0 -1019
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/ai_manager/AiManager.ts +0 -199
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/collab_manager/CollabManager.js +0 -339
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/collab_manager/views/AvatarView.js +0 -96
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/comment_manager/CommentManager.js +0 -348
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/custom_keyboard/CustomKeyboard.js +0 -110
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/custom_keyboard/README.md +0 -29
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/EnhancementManager.js +0 -428
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/README.md +0 -63
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/commands.js +0 -690
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/constants.js +0 -12
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/enhancement-creation.jpeg +0 -0
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/index.js +0 -15
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/rte-flow.jpeg +0 -0
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/ActionButtonView.js +0 -86
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/BlockSubmenuView.js +0 -60
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/EnhancementView.js +0 -208
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/PreviewView.js +0 -102
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/SubmenuView.js +0 -365
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/find_replace_manager/FindReplaceManager.js +0 -239
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/find_replace_manager/views/FindView.js +0 -604
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/FullscreenManager.js +0 -57
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/README.md +0 -26
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/commands.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/index.js +0 -4
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/views/FullscreenView.js +0 -474
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/html_editor_manager/htmlEditorManager.js +0 -66
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/html_editor_manager/views/HtmlEditorView.js +0 -97
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/ListManager.js +0 -342
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/README.md +0 -50
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/commands.js +0 -207
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/constants.js +0 -26
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/index.js +0 -4
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/menubar/Menubar.js +0 -485
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/menubar/README.md +0 -40
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/menubar/views/MenuView.js +0 -842
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/paste_manager/PasteManager.js +0 -368
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/placeholder_manager/PlaceHolderManager.js +0 -128
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/raw_text_manager/README.md +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/raw_text_manager/RawTextManager.js +0 -96
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/spellcheck/index.js +0 -3
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/spellcheck/spellcheck-plugin.js +0 -280
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/spellcheck/spellcheck-service.js +0 -94
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/TableManager.js +0 -57
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/commands.js +0 -97
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/views/TableSizerView.js +0 -88
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/views/TableView.js +0 -613
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/track_manager/README.md +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/track_manager/TrackManager.js +0 -905
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/BSSerializer.js +0 -819
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/README.md +0 -80
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/commands.js +0 -98
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/constants.d.ts +0 -84
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/constants.js +0 -87
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/index.js +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/keymapBuilder.js +0 -223
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/menuItemsBuilder.js +0 -559
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/schemaBuilder.js +0 -1281
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/utilities.d.ts +0 -4
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/utilities.js +0 -359
- package/src/legacy/tool-ui/src/main/webapp/v4/theme/ColorRotator.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/debounce.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/getComponentKey.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/noise.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/repaint.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/storage.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/throttle.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/AssignmentContent.js +0 -33
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/AssignmentDeskDashboard.js +0 -217
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/AssociatedContentWidget.js +0 -7
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/BulkUpload.js +0 -19
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/Calendar.js +0 -7
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/ClosableWindow.js +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/PitchAssignments.js +0 -25
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/PitchContent.js +0 -33
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/Revisions.js +0 -61
|
@@ -1,758 +0,0 @@
|
|
|
1
|
-
import debounce from './util/debounce'
|
|
2
|
-
|
|
3
|
-
const parseMarkerNodeData = (data) => {
|
|
4
|
-
const spaceAt = data.indexOf(' ')
|
|
5
|
-
const content = JSON.parse(spaceAt > -1 ? data.substring(spaceAt + 1) : data)
|
|
6
|
-
return content
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
window._deferInit
|
|
10
|
-
|
|
11
|
-
window.addEventListener('load', (event) => {
|
|
12
|
-
// These are the conditions for rendering the preview overlay frame:
|
|
13
|
-
// - The preview is loaded in an iframe; which indicates that the User has not loaded the preview in a new tab.
|
|
14
|
-
// - The preview page contains the server-side preview data needed for rendering the overlay UI.
|
|
15
|
-
const previewToEditParticipating =
|
|
16
|
-
window.location !== window.parent.location && window.PREVIEW_DATA
|
|
17
|
-
|
|
18
|
-
const top = window.parent ? window.parent.parent : null
|
|
19
|
-
|
|
20
|
-
if (window.PREVIEW_TO_EDIT_ENABLED && !previewToEditParticipating) {
|
|
21
|
-
console.debug(
|
|
22
|
-
'Although preview to edit is enabled, this preview is not participating in preview to edit.',
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// The preview data is stored as a string to speed up finding matching module id's.
|
|
27
|
-
const previewData = window.PREVIEW_DATA
|
|
28
|
-
const contents = []
|
|
29
|
-
const previewContainerId = window.PREVIEW_CONTAINER_ID
|
|
30
|
-
const contentIdMeta = document.head.querySelector(
|
|
31
|
-
'[name="brightspot.contentId"]',
|
|
32
|
-
)
|
|
33
|
-
const contentId = contentIdMeta ? contentIdMeta.getAttribute('content') : null
|
|
34
|
-
|
|
35
|
-
// trigger dom parsing if it was paused/deferred previously
|
|
36
|
-
const parseDom = () => {
|
|
37
|
-
if (window._deferInit === undefined || window._deferInit === true) {
|
|
38
|
-
window._deferInit = false
|
|
39
|
-
init()
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (previewToEditParticipating) {
|
|
44
|
-
top?.postMessage(
|
|
45
|
-
{
|
|
46
|
-
type: 'BSP.Preview.ContentLoad',
|
|
47
|
-
previewContainerId,
|
|
48
|
-
},
|
|
49
|
-
'*',
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
window.addEventListener('mouseover', parseDom)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
window.addEventListener('message', async ({ data }) => {
|
|
56
|
-
if (typeof data !== 'object') return
|
|
57
|
-
|
|
58
|
-
const type = data.type
|
|
59
|
-
|
|
60
|
-
if (type === 'BSP.Preview.PointerEvents') {
|
|
61
|
-
window.document.body.style.pointerEvents = data.value
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (type === 'BSP.ContentEdit.ViewportDeviceChanged') {
|
|
65
|
-
consecutiveResizes = 0
|
|
66
|
-
init()
|
|
67
|
-
} else if (type === 'BSP.Preview.Init') {
|
|
68
|
-
window._deferInit = false
|
|
69
|
-
init()
|
|
70
|
-
} else if (type === 'BSP.Preview.UpdateInitToggle') {
|
|
71
|
-
window._deferInit = data.deferPreviewInit
|
|
72
|
-
}
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
let consecutiveResizes = 0
|
|
76
|
-
let maxConsecutiveResizes = 3
|
|
77
|
-
let intervalId
|
|
78
|
-
|
|
79
|
-
const getPreviewHeight = (previewFrame) => {
|
|
80
|
-
const { height, y } = previewFrame.getBoundingClientRect()
|
|
81
|
-
// document body height including margin
|
|
82
|
-
const frameHeight = Math.ceil(height + y)
|
|
83
|
-
// total content height of document including content not visible on the screen
|
|
84
|
-
const totalContentHeight = Math.ceil(previewFrame.scrollHeight)
|
|
85
|
-
/**
|
|
86
|
-
* 1. When viewing preview in p2e mode, set the overlay frame height to the maximum scrollable content height
|
|
87
|
-
* 2. When p2e is disabled/not initialized, set the overlay frame height to include the
|
|
88
|
-
* height of visible content + margin & borders
|
|
89
|
-
*/
|
|
90
|
-
return previewToEditParticipating
|
|
91
|
-
? Math.max(totalContentHeight, frameHeight)
|
|
92
|
-
: frameHeight
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const handleResize = debounce(500, (entries) => {
|
|
96
|
-
if (consecutiveResizes >= maxConsecutiveResizes) return
|
|
97
|
-
|
|
98
|
-
const entry = entries[0]
|
|
99
|
-
const previewFrame = entry.target
|
|
100
|
-
const previewHeight = getPreviewHeight(previewFrame)
|
|
101
|
-
let prevHeight = previewHeight
|
|
102
|
-
|
|
103
|
-
top?.postMessage(
|
|
104
|
-
{
|
|
105
|
-
type: 'BSP.Preview.onChangedHeight',
|
|
106
|
-
height: previewHeight,
|
|
107
|
-
previewContainerId,
|
|
108
|
-
},
|
|
109
|
-
'*',
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
document.body.style.height = 'initial'
|
|
113
|
-
|
|
114
|
-
if (intervalId) clearInterval(intervalId)
|
|
115
|
-
|
|
116
|
-
intervalId = setInterval(() => {
|
|
117
|
-
const adjustedHeight = getPreviewHeight(previewFrame)
|
|
118
|
-
if (adjustedHeight === prevHeight) {
|
|
119
|
-
// if the data-defer-init flag is not explicitly set to 'false', defer parsing
|
|
120
|
-
if (window._deferInit === false) init()
|
|
121
|
-
clearInterval(intervalId)
|
|
122
|
-
intervalId = null
|
|
123
|
-
}
|
|
124
|
-
prevHeight = adjustedHeight
|
|
125
|
-
}, 500)
|
|
126
|
-
|
|
127
|
-
consecutiveResizes++
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
const observer = new ResizeObserver(handleResize)
|
|
131
|
-
observer.observe(document.body)
|
|
132
|
-
|
|
133
|
-
const init = () => {
|
|
134
|
-
if (!previewToEditParticipating) return
|
|
135
|
-
|
|
136
|
-
let listOverlays = new Map()
|
|
137
|
-
let payload = new Map()
|
|
138
|
-
let imageData = new Map()
|
|
139
|
-
let allOverlays = new Map()
|
|
140
|
-
let objectBeginMap = new Map()
|
|
141
|
-
let decodedTexts = new Map()
|
|
142
|
-
const root = document.body
|
|
143
|
-
|
|
144
|
-
const walker = document.createTreeWalker(root, NodeFilter.SHOW_COMMENT, {
|
|
145
|
-
acceptNode: function (node) {
|
|
146
|
-
let nextSibling = node.nextSibling
|
|
147
|
-
const data = node.data
|
|
148
|
-
let filterResponse = NodeFilter.FILTER_ACCEPT
|
|
149
|
-
|
|
150
|
-
// If the next node is a comment reject, we want to use the last field
|
|
151
|
-
// comment prior to the Element node.
|
|
152
|
-
if (nextSibling) {
|
|
153
|
-
const nextNextSibling = nextSibling.nextSibling
|
|
154
|
-
|
|
155
|
-
// TODO: This isn't working correctly.
|
|
156
|
-
if (
|
|
157
|
-
nextSibling.nodeType === Node.COMMENT_NODE ||
|
|
158
|
-
(nextNextSibling &&
|
|
159
|
-
nextSibling === Node.TEXT_NODE &&
|
|
160
|
-
nextNextSibling.nodeType === Node.COMMENT_NODE)
|
|
161
|
-
) {
|
|
162
|
-
return filterResponse
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (nextSibling && nextSibling.nodeType === Node.TEXT_NODE) {
|
|
167
|
-
nextSibling = nextSibling.nextElementSibling
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
if (data.startsWith('BrightspotCmsObjectBegin') && nextSibling) {
|
|
171
|
-
const content = parseMarkerNodeData(data)
|
|
172
|
-
|
|
173
|
-
// PreviewData is the string representation of the Content edit object data.
|
|
174
|
-
// If this marker id is found in that data and it isn't the "main"
|
|
175
|
-
// content object (like a "Gallery" or "Article") then accept this marker.
|
|
176
|
-
if (
|
|
177
|
-
previewData.indexOf(content.id) !== -1 &&
|
|
178
|
-
content.id !== contentId
|
|
179
|
-
) {
|
|
180
|
-
nextSibling.dataset.brightspotField = true
|
|
181
|
-
filterResponse = NodeFilter.FILTER_ACCEPT
|
|
182
|
-
}
|
|
183
|
-
} else if (
|
|
184
|
-
data.startsWith('BrightspotCmsFieldAccess') &&
|
|
185
|
-
nextSibling &&
|
|
186
|
-
nextSibling.nodeType === Node.ELEMENT_NODE &&
|
|
187
|
-
!nextSibling.closest('[data-brightspot-field]')
|
|
188
|
-
) {
|
|
189
|
-
const content = parseMarkerNodeData(data)
|
|
190
|
-
|
|
191
|
-
if (previewData.indexOf(content.id) !== -1) {
|
|
192
|
-
nextSibling.dataset.brightspotField = true
|
|
193
|
-
filterResponse = NodeFilter.FILTER_ACCEPT
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
return filterResponse
|
|
198
|
-
},
|
|
199
|
-
})
|
|
200
|
-
|
|
201
|
-
const textMatched = (element, text, contentKey, rteFlagged) => {
|
|
202
|
-
const processText = (str) => {
|
|
203
|
-
// replaces smart quotes if any with plain quotes
|
|
204
|
-
// replaces multiple spaces with a single space within the string
|
|
205
|
-
str = str.replace(/[“”]/g, '"')
|
|
206
|
-
str = str.replace(/[‘’]/g, "'")
|
|
207
|
-
str = str
|
|
208
|
-
.replace(/[\r\n\t]| /g, '')
|
|
209
|
-
.split(' ')
|
|
210
|
-
.filter((s) => s !== '')
|
|
211
|
-
.join(' ')
|
|
212
|
-
return str
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
const normalize = (text, override = false) => {
|
|
216
|
-
const decodedText = decodedTexts.get(contentKey)
|
|
217
|
-
if (decodedText && !override) return decodedText
|
|
218
|
-
// Removes surrounding whitespace.
|
|
219
|
-
text = text.trim()
|
|
220
|
-
// Create a temporary div element to decode any html entities
|
|
221
|
-
// and remove any html tags
|
|
222
|
-
const tmpl = document.createElement('div')
|
|
223
|
-
tmpl.innerHTML = text
|
|
224
|
-
const normalizedText = processText(tmpl.textContent)
|
|
225
|
-
decodedTexts.set(contentKey, normalizedText)
|
|
226
|
-
return normalizedText
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const hasEnhancements = (element) => {
|
|
230
|
-
return (
|
|
231
|
-
element.querySelector('[data-state], [class*="Enhancement"]') !== null
|
|
232
|
-
)
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
const removeEnhancements = (element) => {
|
|
236
|
-
// Enhancements shown in the theme may not be formatted the same way
|
|
237
|
-
// as the enhancement state data suggests.
|
|
238
|
-
// So we remove them from the element before string matching.
|
|
239
|
-
const enhancements = element.querySelectorAll(
|
|
240
|
-
'[data-state], [class*="Enhancement"]',
|
|
241
|
-
)
|
|
242
|
-
enhancements.forEach((enhancement) => {
|
|
243
|
-
const space = document.createTextNode(' ')
|
|
244
|
-
enhancement.parentElement?.insertBefore(space, enhancement)
|
|
245
|
-
enhancement.parentElement?.removeChild(enhancement)
|
|
246
|
-
})
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
let elementText
|
|
250
|
-
|
|
251
|
-
// If marker suggests the element is rich text, we need to
|
|
252
|
-
// remove enhancements before comparing text.
|
|
253
|
-
if (rteFlagged && hasEnhancements(element)) {
|
|
254
|
-
const textWrapper = document.createElement('div')
|
|
255
|
-
textWrapper.innerHTML = text
|
|
256
|
-
removeEnhancements(textWrapper)
|
|
257
|
-
text = normalize(textWrapper.textContent, true)
|
|
258
|
-
|
|
259
|
-
const tmp = element.cloneNode(true)
|
|
260
|
-
removeEnhancements(tmp)
|
|
261
|
-
elementText = processText(tmp.textContent)
|
|
262
|
-
} else {
|
|
263
|
-
elementText = processText(element.textContent)
|
|
264
|
-
text = normalize(text)
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
if (elementText === text) {
|
|
268
|
-
return true
|
|
269
|
-
}
|
|
270
|
-
return false
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
let nextCascadingElement = null
|
|
274
|
-
|
|
275
|
-
while (walker.nextNode()) {
|
|
276
|
-
const node = walker.currentNode
|
|
277
|
-
const data = node.data
|
|
278
|
-
|
|
279
|
-
if (
|
|
280
|
-
data.startsWith('BrightspotCmsObjectBegin') ||
|
|
281
|
-
data.startsWith('BrightspotCmsFieldAccess')
|
|
282
|
-
) {
|
|
283
|
-
let content = parseMarkerNodeData(data)
|
|
284
|
-
|
|
285
|
-
/* ignore cascading page layout preview markers and the preview elements for now */
|
|
286
|
-
const layoutKeys = [
|
|
287
|
-
'cascadingPage.above',
|
|
288
|
-
'cascadingPage.below',
|
|
289
|
-
'cascadingPage.aside',
|
|
290
|
-
'cascadingPage.footer',
|
|
291
|
-
]
|
|
292
|
-
|
|
293
|
-
if (content.isEmpty === 'false' && layoutKeys.includes(content.name)) {
|
|
294
|
-
nextCascadingElement = node.nextElementSibling
|
|
295
|
-
continue
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
if (data.startsWith('BrightspotCmsObjectBegin')) {
|
|
299
|
-
content.type = 'bspModule'
|
|
300
|
-
} else if (data.startsWith('BrightspotCmsFieldAccess')) {
|
|
301
|
-
content.type = 'bspField'
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
// Try to associate the node with rich text.
|
|
305
|
-
if (
|
|
306
|
-
(node.element && node.element.classList.contains('.RichTextBody')) ||
|
|
307
|
-
node.parentElement?.closest('.RichTextBody') ||
|
|
308
|
-
(node.element &&
|
|
309
|
-
node.element.classList.contains('[class*="Enhancement"]')) ||
|
|
310
|
-
node.parentElement?.closest('.RichTextBody, [class*="Enhancement"]')
|
|
311
|
-
) {
|
|
312
|
-
content.referencesRichText = true
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
let element =
|
|
316
|
-
content.isEmpty !== 'true' ? node.nextElementSibling : null
|
|
317
|
-
|
|
318
|
-
// Skip if element is the nextCascadingElement or its descendant
|
|
319
|
-
if (
|
|
320
|
-
nextCascadingElement &&
|
|
321
|
-
(element === nextCascadingElement ||
|
|
322
|
-
nextCascadingElement.contains(element))
|
|
323
|
-
) {
|
|
324
|
-
continue
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
let prevElement = node.previousElementSibling || node.parentNode
|
|
328
|
-
let textMatchFound = false
|
|
329
|
-
const maxAttempts = 10
|
|
330
|
-
if (element && content.text) {
|
|
331
|
-
const contentKey = content.id + '/' + content.name
|
|
332
|
-
const isRTE = content.isRTE === 'true'
|
|
333
|
-
const exists = allOverlays.get(contentKey)
|
|
334
|
-
if (exists && exists.textMatched) continue
|
|
335
|
-
if (textMatched(element, content.text, contentKey, isRTE)) {
|
|
336
|
-
textMatchFound = true
|
|
337
|
-
} else {
|
|
338
|
-
let attempts = 1
|
|
339
|
-
for (const child of element.querySelectorAll(
|
|
340
|
-
':scope *:not(script):not(style):not(iframe)',
|
|
341
|
-
)) {
|
|
342
|
-
if (textMatched(child, content.text, contentKey, isRTE)) {
|
|
343
|
-
textMatchFound = true
|
|
344
|
-
element = child
|
|
345
|
-
break
|
|
346
|
-
} else if (attempts === maxAttempts) {
|
|
347
|
-
attempts = 1
|
|
348
|
-
console.debug(
|
|
349
|
-
`Preview: looking for text match... Giving up after ${maxAttempts} attempts.`,
|
|
350
|
-
)
|
|
351
|
-
break
|
|
352
|
-
}
|
|
353
|
-
attempts++
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
// A non-empty comment marker which is associated to a text field
|
|
359
|
-
// could be the only child. In that case use its parent element
|
|
360
|
-
// for the preview element reference.
|
|
361
|
-
/* eg:
|
|
362
|
-
<div class="parent">
|
|
363
|
-
<!--BrightspotCmsFieldAccess {"internalType":"text","displayName":"foo","isEmpty":"false","text":"Some text or nothing at all." ... }-->
|
|
364
|
-
"Some text or nothing at all."
|
|
365
|
-
</div>
|
|
366
|
-
*/
|
|
367
|
-
if (
|
|
368
|
-
!textMatchFound &&
|
|
369
|
-
content.type === 'bspField' &&
|
|
370
|
-
content.internalType === 'text' &&
|
|
371
|
-
content.isEmpty !== 'true'
|
|
372
|
-
) {
|
|
373
|
-
const elmToIgnore = element
|
|
374
|
-
element = node.parentElement
|
|
375
|
-
const isRTE = content.isRTE === 'true'
|
|
376
|
-
if (element) {
|
|
377
|
-
element.dataset.brightspotParentAssociated = true
|
|
378
|
-
if (
|
|
379
|
-
textMatched(
|
|
380
|
-
element,
|
|
381
|
-
content.text,
|
|
382
|
-
content.id + '/' + content.name,
|
|
383
|
-
isRTE,
|
|
384
|
-
)
|
|
385
|
-
) {
|
|
386
|
-
textMatchFound = true
|
|
387
|
-
} else {
|
|
388
|
-
let attempts = 1
|
|
389
|
-
// Compare text of parent's immediate children.
|
|
390
|
-
// When the correct preview element is not the first immediate child.
|
|
391
|
-
for (const child of element.querySelectorAll(
|
|
392
|
-
':scope > *:not(script):not(style):not(iframe)',
|
|
393
|
-
)) {
|
|
394
|
-
if (
|
|
395
|
-
!child.isEqualNode(elmToIgnore) &&
|
|
396
|
-
textMatched(
|
|
397
|
-
child,
|
|
398
|
-
content.text,
|
|
399
|
-
content.id + '/' + content.name,
|
|
400
|
-
isRTE,
|
|
401
|
-
)
|
|
402
|
-
) {
|
|
403
|
-
textMatchFound = true
|
|
404
|
-
element = child
|
|
405
|
-
break
|
|
406
|
-
} else if (attempts === maxAttempts) {
|
|
407
|
-
attempts = 1
|
|
408
|
-
console.debug(
|
|
409
|
-
`Preview: looking for text match... Giving up after ${maxAttempts} attempts.`,
|
|
410
|
-
)
|
|
411
|
-
break
|
|
412
|
-
}
|
|
413
|
-
attempts++
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
// Finally, no matches were found so we fallback to the
|
|
420
|
-
// closest sibling to the marker.
|
|
421
|
-
if (
|
|
422
|
-
!textMatchFound &&
|
|
423
|
-
node.nextElementSibling &&
|
|
424
|
-
node.nextElementSibling.tagName !== 'BR'
|
|
425
|
-
) {
|
|
426
|
-
element = node.nextElementSibling
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
let prevSibling
|
|
430
|
-
|
|
431
|
-
if (content.isEmpty === 'true') {
|
|
432
|
-
while (!prevSibling || prevElement !== document.documentElement) {
|
|
433
|
-
prevSibling = prevElement.previousElementSibling
|
|
434
|
-
if (prevSibling) break
|
|
435
|
-
prevElement = prevElement.parentNode
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
content.textMatched = textMatchFound
|
|
440
|
-
|
|
441
|
-
let exists = allOverlays.get(
|
|
442
|
-
content.id + '/' + content.name || content.typeLabel,
|
|
443
|
-
)
|
|
444
|
-
|
|
445
|
-
const name = content.name || content.typeLabel
|
|
446
|
-
|
|
447
|
-
if (exists && exists.textMatched) {
|
|
448
|
-
content = Object.assign({}, content, {
|
|
449
|
-
parentNode: exists.parentNode,
|
|
450
|
-
previewElement: exists.previewElement,
|
|
451
|
-
textMatched: exists.textMatched,
|
|
452
|
-
})
|
|
453
|
-
} else if (exists && !exists.textMatched && textMatchFound) {
|
|
454
|
-
content = Object.assign({}, exists, content, {
|
|
455
|
-
parentNode: prevElement,
|
|
456
|
-
previewElement: element,
|
|
457
|
-
})
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
if (!exists) {
|
|
461
|
-
contents.push(content)
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
// build overlays map
|
|
465
|
-
let overlayId = content.id + '/' + name
|
|
466
|
-
let overlay = null
|
|
467
|
-
let numOfElements = 0
|
|
468
|
-
|
|
469
|
-
// Markers which are unsupported:
|
|
470
|
-
if (
|
|
471
|
-
content.internalType === 'number' ||
|
|
472
|
-
content.internalType === 'boolean' ||
|
|
473
|
-
(content.type === 'bspField' && content.internalType === undefined)
|
|
474
|
-
) {
|
|
475
|
-
continue
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
// Skip to the next node if no preview element exists.
|
|
479
|
-
// or if the field is not in default 'Main' tab or is hidden
|
|
480
|
-
// or it has dimensions but is inside a hidden ancestor element
|
|
481
|
-
let parentNode = element?.parentNode
|
|
482
|
-
parentNode = parentNode && parentNode !== root ? parentNode : element
|
|
483
|
-
if (
|
|
484
|
-
!element ||
|
|
485
|
-
!parentNode.offsetParent ||
|
|
486
|
-
content.isFieldHidden === 'true'
|
|
487
|
-
) {
|
|
488
|
-
continue
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
if (content.type === 'bspModule') {
|
|
492
|
-
if (allOverlays.has(overlayId)) {
|
|
493
|
-
overlay = allOverlays.get(overlayId)
|
|
494
|
-
if (overlay.previewElements.indexOf(element) === -1) {
|
|
495
|
-
overlay.previewElements.push(element)
|
|
496
|
-
overlay.dimensions.push(element?.getBoundingClientRect())
|
|
497
|
-
}
|
|
498
|
-
numOfElements = overlay.previewElements.length
|
|
499
|
-
} else {
|
|
500
|
-
const previewElements = []
|
|
501
|
-
previewElements.push(element)
|
|
502
|
-
const dimensions = []
|
|
503
|
-
dimensions.push(element?.getBoundingClientRect())
|
|
504
|
-
allOverlays.set(overlayId, {
|
|
505
|
-
id: content.id,
|
|
506
|
-
name: name,
|
|
507
|
-
previewElements: previewElements,
|
|
508
|
-
fieldValue: content.fieldValue ? content.fieldValue : null,
|
|
509
|
-
type: content.type,
|
|
510
|
-
internalType: content.internalType,
|
|
511
|
-
isEmpty: content.isEmpty,
|
|
512
|
-
label: content.displayName,
|
|
513
|
-
parentNode: prevElement?.getBoundingClientRect(),
|
|
514
|
-
textMatched: content.textMatched,
|
|
515
|
-
dimensions: dimensions,
|
|
516
|
-
referencesRichText: content.referencesRichText,
|
|
517
|
-
})
|
|
518
|
-
numOfElements = 1
|
|
519
|
-
}
|
|
520
|
-
const objectBegin = allOverlays.get(overlayId)
|
|
521
|
-
objectBeginMap.set(overlayId, objectBegin)
|
|
522
|
-
} else {
|
|
523
|
-
// Is not a bspModule.
|
|
524
|
-
if (
|
|
525
|
-
!exists ||
|
|
526
|
-
(exists && !exists.textMatched && textMatchFound) ||
|
|
527
|
-
(exists && !content.text)
|
|
528
|
-
) {
|
|
529
|
-
// Skip <source> elements so that <img> elements can be processed correctly.
|
|
530
|
-
if (exists && element.tagName === 'SOURCE') {
|
|
531
|
-
continue
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
allOverlays.set(overlayId, {
|
|
535
|
-
id: content.id,
|
|
536
|
-
name: name,
|
|
537
|
-
previewElement: element,
|
|
538
|
-
children: content.children
|
|
539
|
-
? content.children.split(',').map((item) => item.trim())
|
|
540
|
-
: null,
|
|
541
|
-
fieldValue: content.fieldValue ? content.fieldValue : null,
|
|
542
|
-
listType: content.children ? true : false,
|
|
543
|
-
type: content.type,
|
|
544
|
-
internalType: content.internalType,
|
|
545
|
-
isEmpty: content.isEmpty,
|
|
546
|
-
label: content.displayName,
|
|
547
|
-
textMatched: content.textMatched,
|
|
548
|
-
parentNode: prevElement?.getBoundingClientRect(),
|
|
549
|
-
dimensions: element?.getBoundingClientRect(),
|
|
550
|
-
referencesRichText: content.referencesRichText,
|
|
551
|
-
})
|
|
552
|
-
} else if (
|
|
553
|
-
content.internalType === 'text' &&
|
|
554
|
-
content.referencesRichText
|
|
555
|
-
) {
|
|
556
|
-
// Handles richtext fields which, for whatever reason,
|
|
557
|
-
// don't result in a text match.
|
|
558
|
-
allOverlays.set(overlayId, {
|
|
559
|
-
id: content.id,
|
|
560
|
-
name: name,
|
|
561
|
-
previewElement: element,
|
|
562
|
-
children: content.children
|
|
563
|
-
? content.children.split(',').map((item) => item.trim())
|
|
564
|
-
: null,
|
|
565
|
-
fieldValue: content.fieldValue ? content.fieldValue : null,
|
|
566
|
-
listType: content.children ? true : false,
|
|
567
|
-
type: content.type,
|
|
568
|
-
internalType: content.internalType,
|
|
569
|
-
isEmpty: content.isEmpty,
|
|
570
|
-
label: content.displayName,
|
|
571
|
-
textMatched: content.textMatched,
|
|
572
|
-
parentNode: prevElement?.getBoundingClientRect(),
|
|
573
|
-
dimensions: element?.getBoundingClientRect(),
|
|
574
|
-
referencesRichText: content.referencesRichText,
|
|
575
|
-
})
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
// Try to find the image element nearby.
|
|
580
|
-
let img =
|
|
581
|
-
element.nodeName !== 'IMG'
|
|
582
|
-
? element.querySelector(':scope > img, :scope > picture > img')
|
|
583
|
-
: element
|
|
584
|
-
|
|
585
|
-
if (img) {
|
|
586
|
-
const prevSib = img.previousSibling
|
|
587
|
-
if (
|
|
588
|
-
prevSib?.nodeName === '#comment' &&
|
|
589
|
-
prevSib?.nodeValue.startsWith('BrightspotThemeData')
|
|
590
|
-
) {
|
|
591
|
-
const {
|
|
592
|
-
image: { name, height, width },
|
|
593
|
-
} = parseMarkerNodeData(prevSib.data)
|
|
594
|
-
imageData.set(JSON.stringify(img.getBoundingClientRect()), {
|
|
595
|
-
name,
|
|
596
|
-
height,
|
|
597
|
-
width,
|
|
598
|
-
rect: img.getBoundingClientRect(),
|
|
599
|
-
})
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
if (content.children) {
|
|
604
|
-
listOverlays.set(overlayId, allOverlays.get(overlayId))
|
|
605
|
-
}
|
|
606
|
-
const overlayDimensions = allOverlays.get(overlayId).dimensions
|
|
607
|
-
|
|
608
|
-
payload.set(overlayId, {
|
|
609
|
-
id: content.id,
|
|
610
|
-
children: content.children
|
|
611
|
-
? content.children.split(',').map((item) => item.trim())
|
|
612
|
-
: null,
|
|
613
|
-
type: content.type,
|
|
614
|
-
name: name,
|
|
615
|
-
label: content.displayName,
|
|
616
|
-
internalType: content.internalType,
|
|
617
|
-
hasElement:
|
|
618
|
-
(content.type === 'bspField' || content.type === 'bspModule') &&
|
|
619
|
-
element
|
|
620
|
-
? true
|
|
621
|
-
: false,
|
|
622
|
-
fieldValue: content.fieldValue ? content.fieldValue : null,
|
|
623
|
-
isEmpty: content.isEmpty === 'true',
|
|
624
|
-
dimensions: overlayDimensions,
|
|
625
|
-
parentNode: prevSibling?.getBoundingClientRect(),
|
|
626
|
-
listType: content.children ? true : false,
|
|
627
|
-
textMatched: content.textMatched,
|
|
628
|
-
referencesRichText: content.referencesRichText,
|
|
629
|
-
})
|
|
630
|
-
|
|
631
|
-
if (content.type === 'bspModule') {
|
|
632
|
-
payload.numOfElements = numOfElements
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
listOverlays.forEach((overlay, key) => {
|
|
638
|
-
const children = overlay.children
|
|
639
|
-
let childElms = []
|
|
640
|
-
children.forEach((child) => {
|
|
641
|
-
const childOverlay = allOverlays.get(child)
|
|
642
|
-
if (childOverlay) {
|
|
643
|
-
if (childOverlay.previewElements) {
|
|
644
|
-
childElms.push.apply(childElms, childOverlay.previewElements)
|
|
645
|
-
} else if (childOverlay.previewElement) {
|
|
646
|
-
childElms.push(childOverlay.previewElement)
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
})
|
|
650
|
-
if (children.length === childElms.length) {
|
|
651
|
-
let parent = childElms[0]
|
|
652
|
-
childElms.shift()
|
|
653
|
-
if (childElms.length) {
|
|
654
|
-
let common = false
|
|
655
|
-
while (!common) {
|
|
656
|
-
const node = parent
|
|
657
|
-
let num = 0
|
|
658
|
-
childElms.forEach((childElm) => {
|
|
659
|
-
if (parent.contains(childElm)) {
|
|
660
|
-
num = num + 1
|
|
661
|
-
}
|
|
662
|
-
})
|
|
663
|
-
if (num === childElms.length) {
|
|
664
|
-
common = true
|
|
665
|
-
} else {
|
|
666
|
-
parent = node.parentNode
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
if (parent) {
|
|
671
|
-
const existing = payload.get(key)
|
|
672
|
-
existing.dimensions = parent?.getBoundingClientRect()
|
|
673
|
-
overlay.previewElement = parent
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
})
|
|
677
|
-
|
|
678
|
-
const sortPreviewElements = (elements) => {
|
|
679
|
-
const compareDepth = (a, b) => {
|
|
680
|
-
return a.dataset.depth - b.dataset.depth
|
|
681
|
-
}
|
|
682
|
-
elements.forEach((elm) => {
|
|
683
|
-
let depth = 1
|
|
684
|
-
let parent = elm.parentNode
|
|
685
|
-
while (parent !== root) {
|
|
686
|
-
depth = depth + 1
|
|
687
|
-
parent = parent.parentNode
|
|
688
|
-
// To ensure efficiency, only check up to a max depth of 30 nodes
|
|
689
|
-
if (depth > 30) {
|
|
690
|
-
break
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
elm.dataset.depth = depth
|
|
694
|
-
})
|
|
695
|
-
elements.sort(compareDepth)
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
objectBeginMap.forEach((overlay, key) => {
|
|
699
|
-
let prev = null
|
|
700
|
-
let res = overlay
|
|
701
|
-
let resMatches = []
|
|
702
|
-
let payloadOverlay
|
|
703
|
-
let noMatches = false
|
|
704
|
-
let matches
|
|
705
|
-
resMatches.push(overlay)
|
|
706
|
-
while (!noMatches) {
|
|
707
|
-
prev = res
|
|
708
|
-
matches = []
|
|
709
|
-
const resMatch = resMatches.map((match) => {
|
|
710
|
-
return match.id
|
|
711
|
-
})
|
|
712
|
-
|
|
713
|
-
allOverlays.forEach((ovr) => {
|
|
714
|
-
if (
|
|
715
|
-
resMatch.includes(ovr.fieldValue?.split('/')[0]) &&
|
|
716
|
-
!resMatch.includes(ovr.id) &&
|
|
717
|
-
!ovr.visited
|
|
718
|
-
) {
|
|
719
|
-
matches.push(ovr)
|
|
720
|
-
ovr.visited = true
|
|
721
|
-
}
|
|
722
|
-
})
|
|
723
|
-
if (matches.length) {
|
|
724
|
-
noMatches = false
|
|
725
|
-
resMatches = matches
|
|
726
|
-
} else {
|
|
727
|
-
noMatches = true
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
if (overlay.previewElements.length > 1) {
|
|
732
|
-
sortPreviewElements(overlay.previewElements)
|
|
733
|
-
}
|
|
734
|
-
resMatches.forEach((res, index) => {
|
|
735
|
-
if (res !== overlay) {
|
|
736
|
-
res.linked = key
|
|
737
|
-
res.previewElement = overlay.previewElements[index]
|
|
738
|
-
const ovrKey = res.id + '/' + res.name
|
|
739
|
-
payloadOverlay = payload.get(ovrKey)
|
|
740
|
-
payloadOverlay.linked = key
|
|
741
|
-
payloadOverlay.linkedIdx = index
|
|
742
|
-
payloadOverlay.dimensions =
|
|
743
|
-
res.previewElement?.getBoundingClientRect()
|
|
744
|
-
}
|
|
745
|
-
})
|
|
746
|
-
})
|
|
747
|
-
|
|
748
|
-
top?.postMessage(
|
|
749
|
-
{
|
|
750
|
-
type: 'BSP.Preview.DOMParsed',
|
|
751
|
-
overlays: payload,
|
|
752
|
-
previewContainerId,
|
|
753
|
-
imageData,
|
|
754
|
-
},
|
|
755
|
-
'*',
|
|
756
|
-
)
|
|
757
|
-
}
|
|
758
|
-
})
|