@salesforcedevs/dx-components 0.16.3 → 0.17.1-review-diff1
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/lwc.config.json +85 -26
- package/package.json +34 -19
- package/src/assets/icons/brand-sprite/svg/symbols.svg +23 -5
- package/src/assets/icons/salesforcebrand-sprite/svg/symbols.svg +909 -107
- package/src/assets/icons/utility-sprite/svg/symbols.svg +2 -1
- package/src/modules/dx/agenda/agenda.css +97 -0
- package/src/modules/dx/agenda/agenda.html +32 -0
- package/src/modules/dx/agenda/agenda.ts +26 -0
- package/src/modules/dx/alert/alert.css +103 -0
- package/src/modules/dx/alert/alert.html +37 -0
- package/src/modules/dx/alert/alert.ts +137 -0
- package/src/modules/dx/audio/audio.css +276 -0
- package/src/modules/dx/audio/audio.html +158 -0
- package/src/modules/dx/audio/audio.ts +484 -0
- package/src/modules/dx/banner/banner.css +3 -3
- package/src/modules/dx/banner/banner.ts +3 -5
- package/src/modules/dx/brandThemeProvider/brandThemeProvider.ts +1 -1
- package/src/modules/dx/breadcrumbs/breadcrumbs.css +4 -4
- package/src/modules/dx/breadcrumbs/breadcrumbs.html +1 -1
- package/src/modules/dx/breadcrumbs/breadcrumbs.ts +28 -27
- package/src/modules/dx/button/button.css +79 -25
- package/src/modules/dx/button/button.html +4 -2
- package/src/modules/dx/button/button.ts +41 -14
- package/src/modules/dx/buttonToggle/buttonToggle.css +50 -0
- package/src/modules/dx/buttonToggle/buttonToggle.html +17 -0
- package/src/modules/dx/buttonToggle/buttonToggle.ts +75 -0
- package/src/modules/dx/cardBlogPost/cardBlogPost.css +2 -2
- package/src/modules/dx/cardBlogPost/cardBlogPost.html +5 -4
- package/src/modules/dx/cardBlogPost/cardBlogPost.ts +27 -4
- package/src/modules/dx/cardCallout/cardCallout.css +5 -5
- package/src/modules/dx/cardCallout/cardCallout.html +1 -1
- package/src/modules/dx/cardCallout/cardCallout.ts +14 -10
- package/src/modules/dx/cardClickthrough/cardClickthrough.css +105 -0
- package/src/modules/dx/cardClickthrough/cardClickthrough.html +42 -0
- package/src/modules/dx/cardClickthrough/cardClickthrough.ts +139 -0
- package/src/modules/dx/cardContent/cardContent.css +21 -9
- package/src/modules/dx/cardContent/cardContent.html +33 -14
- package/src/modules/dx/cardContent/cardContent.ts +80 -15
- package/src/modules/dx/cardDemo/cardDemo.css +1 -1
- package/src/modules/dx/cardDemo/cardDemo.html +1 -1
- package/src/modules/dx/cardDemo/cardDemo.ts +1 -1
- package/src/modules/dx/cardDocs/cardDocs.css +8 -8
- package/src/modules/dx/cardDocs/cardDocs.html +25 -5
- package/src/modules/dx/cardDocs/cardDocs.ts +51 -2
- package/src/modules/dx/cardEvent/cardEvent.css +31 -17
- package/src/modules/dx/cardEvent/cardEvent.html +17 -18
- package/src/modules/dx/cardEvent/cardEvent.ts +11 -3
- package/src/modules/dx/cardExpanded/cardExpanded.css +60 -0
- package/src/modules/dx/cardExpanded/cardExpanded.html +35 -0
- package/src/modules/dx/cardExpanded/cardExpanded.ts +63 -0
- package/src/modules/dx/cardGrid/cardGrid.css +1 -85
- package/src/modules/dx/cardGrid/cardGrid.html +16 -44
- package/src/modules/dx/cardGrid/cardGrid.ts +32 -139
- package/src/modules/dx/cardGridDocs/cardGridDocs.css +73 -0
- package/src/modules/dx/cardGridDocs/cardGridDocs.html +67 -0
- package/src/modules/dx/cardGridDocs/cardGridDocs.ts +86 -0
- package/src/modules/dx/cardMinimal/cardMinimal.css +31 -0
- package/src/modules/dx/cardMinimal/cardMinimal.html +8 -0
- package/src/modules/dx/cardMinimal/cardMinimal.ts +3 -0
- package/src/modules/dx/cardNews/cardNews.css +34 -15
- package/src/modules/dx/cardNews/cardNews.html +8 -1
- package/src/modules/dx/cardNews/cardNews.ts +23 -5
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.css +3 -3
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.html +2 -1
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.ts +1 -1
- package/src/modules/dx/cardSmall/cardSmall.css +3 -7
- package/src/modules/dx/cardSmall/cardSmall.html +2 -2
- package/src/modules/dx/cardSmall/cardSmall.ts +2 -2
- package/src/modules/dx/cardStep/cardStep.css +128 -0
- package/src/modules/dx/cardStep/cardStep.html +31 -0
- package/src/modules/dx/cardStep/cardStep.ts +55 -0
- package/src/modules/dx/cardStep/mockProps.ts +59 -0
- package/src/modules/dx/cardTestimonial/cardTestimonial.css +24 -0
- package/src/modules/dx/cardTestimonial/cardTestimonial.html +15 -0
- package/src/modules/dx/cardTestimonial/cardTestimonial.ts +18 -0
- package/src/modules/dx/cardTitle/cardTitle.css +6 -4
- package/src/modules/dx/cardTitle/cardTitle.html +1 -1
- package/src/modules/dx/cardTitle/cardTitle.ts +4 -4
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.css +2 -2
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.html +2 -2
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.ts +2 -1
- package/src/modules/dx/cardTrial/cardTrial.css +134 -0
- package/src/modules/dx/cardTrial/cardTrial.html +207 -0
- package/src/modules/dx/cardTrial/cardTrial.ts +147 -0
- package/src/modules/dx/cardTrialExpanded/cardTrialExpanded.css +159 -0
- package/src/modules/dx/cardTrialExpanded/cardTrialExpanded.html +91 -0
- package/src/modules/dx/cardTrialExpanded/cardTrialExpanded.ts +84 -0
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.css +2 -2
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.html +3 -2
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.ts +2 -2
- package/src/modules/dx/checkbox/checkbox.css +9 -4
- package/src/modules/dx/checkbox/checkbox.ts +27 -2
- package/src/modules/dx/checkboxGroup/checkboxGroup.css +1 -1
- package/src/modules/dx/checkboxGroup/checkboxGroup.ts +1 -1
- package/src/modules/dx/checkboxNative/checkboxNative.css +18 -0
- package/src/modules/dx/checkboxNative/checkboxNative.html +14 -0
- package/src/modules/dx/checkboxNative/checkboxNative.ts +39 -0
- package/src/modules/dx/codeBlock/codeBlock.css +22 -15
- package/src/modules/dx/codeBlock/codeBlock.html +3 -3
- package/src/modules/dx/codeBlock/codeBlock.ts +149 -61
- package/src/modules/dx/codeBlock/customLanguages.js +48 -0
- package/src/modules/dx/codeBlock/darkAndLightThemes.css +177 -0
- package/src/modules/dx/coveoRecommendations/coveoRecommendations.css +8 -0
- package/src/modules/dx/coveoRecommendations/coveoRecommendations.html +27 -0
- package/src/modules/dx/coveoRecommendations/coveoRecommendations.ts +171 -0
- package/src/modules/dx/darkModeManager/darkModeManager.ts +86 -0
- package/src/modules/dx/dropdown/dropdown.css +3 -5
- package/src/modules/dx/dropdown/dropdown.html +7 -1
- package/src/modules/dx/dropdown/dropdown.ts +18 -9
- package/src/modules/dx/dropdownOption/dropdownOption.css +125 -5
- package/src/modules/dx/dropdownOption/dropdownOption.html +7 -2
- package/src/modules/dx/dropdownOption/dropdownOption.ts +27 -9
- package/src/modules/dx/embeddedVideo/embeddedVideo.css +35 -0
- package/src/modules/dx/embeddedVideo/embeddedVideo.html +56 -0
- package/src/modules/dx/embeddedVideo/embeddedVideo.ts +40 -0
- package/src/modules/dx/emptyState/emptyState.css +76 -4
- package/src/modules/dx/emptyState/emptyState.html +16 -4
- package/src/modules/dx/emptyState/emptyState.ts +57 -7
- package/src/modules/dx/errorFallback/errorFallback.css +27 -0
- package/src/modules/dx/errorFallback/errorFallback.html +11 -0
- package/src/modules/dx/errorFallback/errorFallback.ts +7 -0
- package/src/modules/dx/eyebrow/eyebrow.css +44 -0
- package/src/modules/dx/eyebrow/eyebrow.html +16 -0
- package/src/modules/dx/eyebrow/eyebrow.ts +32 -0
- package/src/modules/dx/faq/faq.css +58 -0
- package/src/modules/dx/faq/faq.html +36 -0
- package/src/modules/dx/faq/faq.ts +16 -0
- package/src/modules/dx/feature/feature.css +16 -6
- package/src/modules/dx/feature/feature.html +9 -7
- package/src/modules/dx/feature/feature.ts +17 -4
- package/src/modules/dx/featureFlag/featureFlag.css +3 -0
- package/src/modules/dx/featureFlag/featureFlag.html +3 -0
- package/src/modules/dx/featureFlag/featureFlag.ts +41 -0
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.css +182 -146
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.html +123 -87
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +179 -30
- package/src/modules/dx/featuredContentHeader/svgs.ts +5 -4
- package/src/modules/dx/featuresList/featuresList.css +5 -5
- package/src/modules/dx/featuresList/featuresList.html +2 -2
- package/src/modules/dx/featuresList/featuresList.ts +2 -3
- package/src/modules/dx/featuresListHeader/featuresListHeader.css +144 -0
- package/src/modules/dx/featuresListHeader/featuresListHeader.html +58 -0
- package/src/modules/dx/featuresListHeader/featuresListHeader.ts +103 -0
- package/src/modules/dx/filterMenu/filterMenu.css +134 -0
- package/src/modules/dx/filterMenu/filterMenu.html +111 -0
- package/src/modules/dx/filterMenu/filterMenu.ts +119 -0
- package/src/modules/dx/footer/footer.css +72 -41
- package/src/modules/dx/footer/footer.html +65 -65
- package/src/modules/dx/footer/footer.ts +66 -31
- package/src/modules/dx/footer/links.ts +142 -54
- package/src/modules/dx/footerOption/footerOption.css +10 -3
- package/src/modules/dx/footerOption/footerOption.html +1 -10
- package/src/modules/dx/footerOption/footerOption.ts +21 -7
- package/src/modules/dx/formattedDateTime/formattedDateTime.ts +22 -14
- package/src/modules/dx/formattedRichText/formattedRichText.css +32 -0
- package/src/modules/dx/formattedRichText/formattedRichText.html +3 -0
- package/src/modules/dx/formattedRichText/formattedRichText.ts +17 -0
- package/src/modules/dx/grid/grid.css +7 -2
- package/src/modules/dx/grid/grid.html +15 -0
- package/src/modules/dx/grid/grid.ts +78 -2
- package/src/modules/dx/groupText/groupText.css +5 -9
- package/src/modules/dx/groupText/groupText.html +8 -3
- package/src/modules/dx/groupText/groupText.ts +21 -14
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.css +3 -2
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.ts +5 -5
- package/src/modules/dx/headerMobileNavMenuOption/headerMobileNavMenuOption.ts +10 -2
- package/src/modules/dx/headerNav/headerNav.css +9 -1
- package/src/modules/dx/headerNav/headerNav.html +2 -0
- package/src/modules/dx/headerNav/headerNav.ts +10 -6
- package/src/modules/dx/helmet/helmet.css +3 -3
- package/src/modules/dx/helmet/helmet.html +2 -2
- package/src/modules/dx/helmet/helmet.ts +2 -2
- package/src/modules/dx/hr/hr.css +10 -10
- package/src/modules/dx/hr/hr.ts +7 -1
- package/src/modules/dx/icon/icon.css +2 -2
- package/src/modules/dx/icon/icon.html +20 -9
- package/src/modules/dx/icon/icon.ts +6 -1
- package/src/modules/dx/iconBadge/iconBadge.css +13 -1
- package/src/modules/dx/iconBadge/iconBadge.html +3 -3
- package/src/modules/dx/iconBadge/iconBadge.ts +23 -7
- package/src/modules/dx/imageAndLabel/imageAndLabel.css +4 -8
- package/src/modules/dx/imageAndLabel/imageAndLabel.html +18 -2
- package/src/modules/dx/input/input.css +24 -6
- package/src/modules/dx/input/input.html +6 -1
- package/src/modules/dx/input/input.ts +76 -10
- package/src/modules/dx/interactiveImage/interactiveImage.css +2 -2
- package/src/modules/dx/interactiveImage/interactiveImage.html +2 -2
- package/src/modules/dx/interactiveImage/interactiveImage.ts +2 -2
- package/src/modules/dx/logo/logo.css +2 -3
- package/src/modules/dx/logo/logo.html +1 -1
- package/src/modules/dx/logo/logo.ts +3 -2
- package/src/modules/dx/mainContentHeader/mainContentHeader.css +197 -0
- package/src/modules/dx/mainContentHeader/mainContentHeader.html +75 -0
- package/src/modules/dx/mainContentHeader/mainContentHeader.ts +98 -0
- package/src/modules/dx/metadataBadge/metadataBadge.css +41 -0
- package/src/modules/dx/metadataBadge/metadataBadge.html +5 -0
- package/src/modules/dx/metadataBadge/metadataBadge.ts +24 -0
- package/src/modules/dx/modal/modal.css +7 -0
- package/src/modules/dx/modal/modal.html +13 -0
- package/src/modules/dx/modal/modal.ts +98 -0
- package/src/modules/dx/modalDrawer/modalDrawer.css +41 -0
- package/src/modules/dx/modalDrawer/modalDrawer.html +11 -0
- package/src/modules/dx/modalDrawer/modalDrawer.ts +33 -0
- package/src/modules/dx/pagination/pagination.css +2 -3
- package/src/modules/dx/pagination/pagination.ts +45 -8
- package/src/modules/dx/podcastHost/podcastHost.css +11 -4
- package/src/modules/dx/podcastHost/podcastHost.html +8 -9
- package/src/modules/dx/popover/popover.css +31 -6
- package/src/modules/dx/popover/popover.html +1 -1
- package/src/modules/dx/popover/popover.ts +112 -47
- package/src/modules/dx/radioGroup/radioGroup.css +1 -1
- package/src/modules/dx/radioGroup/radioGroup.ts +1 -1
- package/src/modules/dx/redirectChecker/redirectChecker.html +1 -0
- package/src/modules/dx/redirectChecker/redirectChecker.ts +10 -0
- package/src/modules/dx/relativeDateTime/relativeDateTime.ts +23 -94
- package/src/modules/dx/scrollManager/scrollManager.html +1 -0
- package/src/modules/dx/scrollManager/scrollManager.ts +212 -0
- package/src/modules/dx/searchResults/coveo.css +2138 -3126
- package/src/modules/dx/searchResults/resultsTemplate.js +141 -0
- package/src/modules/dx/searchResults/searchResults.css +136 -19
- package/src/modules/dx/searchResults/searchResults.html +7 -4
- package/src/modules/dx/searchResults/searchResults.ts +378 -37
- package/src/modules/dx/section/section.css +40 -7
- package/src/modules/dx/section/section.html +37 -7
- package/src/modules/dx/section/section.ts +45 -13
- package/src/modules/dx/sectionBanner/sectionBanner.css +145 -0
- package/src/modules/dx/sectionBanner/sectionBanner.html +41 -0
- package/src/modules/dx/sectionBanner/sectionBanner.ts +128 -0
- package/src/modules/dx/sectionSignup/sectionSignup.ts +2 -2
- package/src/modules/dx/select/select.css +173 -10
- package/src/modules/dx/select/select.html +54 -53
- package/src/modules/dx/select/select.ts +153 -10
- package/src/modules/dx/sidebar/sidebar.css +44 -130
- package/src/modules/dx/sidebar/sidebar.html +114 -50
- package/src/modules/dx/sidebar/sidebar.ts +159 -116
- package/src/modules/dx/sidebarFooterNav/sidebarFooterNav.css +49 -0
- package/src/modules/dx/sidebarFooterNav/sidebarFooterNav.html +55 -0
- package/src/modules/dx/sidebarFooterNav/sidebarFooterNav.ts +106 -0
- package/src/modules/dx/sidebarOld/sidebarOld.css +33 -0
- package/src/modules/dx/sidebarOld/sidebarOld.html +111 -0
- package/src/modules/dx/sidebarOld/sidebarOld.ts +170 -0
- package/src/modules/dx/sidebarSearch/sidebarSearch.css +3 -0
- package/src/modules/dx/sidebarSearch/sidebarSearch.html +25 -0
- package/src/modules/dx/sidebarSearch/sidebarSearch.ts +493 -0
- package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.css +67 -0
- package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.html +20 -0
- package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.ts +78 -0
- package/src/modules/dx/skipNavLink/skipNavLink.css +21 -0
- package/src/modules/dx/skipNavLink/skipNavLink.html +3 -0
- package/src/modules/dx/skipNavLink/skipNavLink.ts +3 -0
- package/src/modules/dx/socials/socials.css +4 -3
- package/src/modules/dx/socials/socials.ts +1 -6
- package/src/modules/dx/spinner/spinner.css +28 -232
- package/src/modules/dx/stepSequence/stepSequence.css +42 -0
- package/src/modules/dx/stepSequence/stepSequence.html +10 -0
- package/src/modules/dx/stepSequence/stepSequence.ts +334 -0
- package/src/modules/dx/stepSequenceStep/stepSequenceStep.html +3 -0
- package/src/modules/dx/stepSequenceStep/stepSequenceStep.ts +60 -0
- package/src/modules/dx/tab/tab.css +49 -24
- package/src/modules/dx/tab/tab.ts +16 -5
- package/src/modules/dx/tabPanel/tabPanel.css +20 -0
- package/src/modules/dx/tabPanel/tabPanel.html +13 -0
- package/src/modules/dx/tabPanel/tabPanel.ts +27 -0
- package/src/modules/dx/tabPanelItem/tabPanelItem.css +54 -0
- package/src/modules/dx/tabPanelItem/tabPanelItem.html +26 -0
- package/src/modules/dx/tabPanelItem/tabPanelItem.ts +45 -0
- package/src/modules/dx/tabPanelList/tabPanelList.css +37 -0
- package/src/modules/dx/tabPanelList/tabPanelList.html +56 -0
- package/src/modules/dx/tabPanelList/tabPanelList.ts +178 -0
- package/src/modules/dx/tabPanelList/uniqueId.ts +6 -0
- package/src/modules/dx/tabbedCodeBlock/tabbedCodeBlock.css +8 -0
- package/src/modules/dx/tabbedCodeBlock/tabbedCodeBlock.html +16 -0
- package/src/modules/dx/tabbedCodeBlock/tabbedCodeBlock.ts +44 -0
- package/src/modules/dx/tbidAvatarButton/tbidAvatarButton.css +33 -0
- package/src/modules/dx/tbidAvatarButton/tbidAvatarButton.html +53 -0
- package/src/modules/dx/tbidAvatarButton/tbidAvatarButton.ts +450 -0
- package/src/modules/dx/toast/toast.css +78 -0
- package/src/modules/dx/toast/toast.html +20 -0
- package/src/modules/dx/toast/toast.ts +41 -0
- package/src/modules/dx/toc/toc.css +18 -46
- package/src/modules/dx/toc/toc.html +5 -11
- package/src/modules/dx/toc/toc.ts +20 -31
- package/src/modules/dx/tooltip/tooltip.css +1 -0
- package/src/modules/dx/topics/topics.css +26 -0
- package/src/modules/dx/topics/topics.html +12 -0
- package/src/modules/dx/topics/topics.ts +25 -0
- package/src/modules/dx/trafficLabeler/trafficLabeler.html +1 -0
- package/src/modules/dx/trafficLabeler/trafficLabeler.ts +58 -0
- package/src/modules/dx/tree/tree.css +1 -1
- package/src/modules/dx/tree/tree.ts +9 -1
- package/src/modules/dx/tree/treeHandler.ts +5 -1
- package/src/modules/dx/treeItem/treeItem.css +12 -1
- package/src/modules/dx/treeItem/treeItem.html +10 -2
- package/src/modules/dx/treeItem/treeItem.ts +103 -15
- package/src/modules/dx/treeTile/treeTile.css +77 -64
- package/src/modules/dx/treeTile/treeTile.html +24 -10
- package/src/modules/dx/treeTile/treeTile.ts +31 -6
- package/src/modules/dx/typeBadge/typeBadge.css +2 -59
- package/src/modules/dx/typeBadge/typeBadge.html +7 -1
- package/src/modules/dx/typeBadge/typeBadge.ts +97 -8
- package/src/modules/dx/vimeoPlayer/vimeoPlayer.css +1 -0
- package/src/modules/dx/vimeoPlayer/vimeoPlayer.html +3 -0
- package/src/modules/dx/vimeoPlayer/vimeoPlayer.ts +31 -0
- package/src/modules/dxBaseElements/archiveCard/archiveCard.ts +31 -0
- package/src/modules/{utils → dxBaseElements}/headerBase/headerBase.ts +37 -13
- package/src/modules/dxBaseElements/lightningElementWithState/lightningElementWithState.ts +93 -0
- package/src/modules/dxBaseElements/matchMediaElement/matchMediaElement.ts +63 -0
- package/src/modules/dxBaseElements/sidebarBase/sidebarBase.ts +176 -0
- package/src/modules/dxConstants/brands/brands.ts +18 -0
- package/src/modules/dxConstants/colors/colors.ts +14 -0
- package/src/modules/dxConstants/contentTypes/contentTypes.ts +72 -0
- package/src/modules/{helpers → dxHelpers}/animations/animations.css +1 -1
- package/src/modules/dxHelpers/button/button.css +4 -0
- package/src/modules/{helpers → dxHelpers}/card/card.css +33 -32
- package/src/modules/{helpers → dxHelpers}/code/code.css +5 -13
- package/src/modules/{helpers → dxHelpers}/commonHeader/commonHeader.css +13 -11
- package/src/modules/dxHelpers/commonSidebar/commonSidebar.css +179 -0
- package/src/modules/dxHelpers/commonTreeItem/commonTreeItem.css +44 -0
- package/src/modules/{helpers → dxHelpers}/reset/reset.css +6 -13
- package/src/modules/dxHelpers/scrollbar/scrollbar.css +31 -0
- package/src/modules/{helpers → dxHelpers}/table/table.css +2 -6
- package/src/modules/{helpers → dxHelpers}/text/text.css +71 -32
- package/src/modules/dxHelpers/typeBadge/typeBadge.css +32 -0
- package/src/modules/dxUtils/analytics/analytics.ts +24 -0
- package/src/modules/dxUtils/async/async.ts +45 -0
- package/src/modules/dxUtils/browser/browser.ts +17 -0
- package/src/modules/dxUtils/constants/breakpoints.ts +9 -0
- package/src/modules/dxUtils/constants/constants.ts +1 -0
- package/src/modules/dxUtils/contentTypes/contentTypes.ts +30 -0
- package/src/modules/dxUtils/coveo/coveo.ts +70 -0
- package/src/modules/dxUtils/css/css.ts +58 -0
- package/src/modules/dxUtils/dates/dates.ts +72 -0
- package/src/modules/{utils → dxUtils}/highlight/highlight.ts +3 -2
- package/src/modules/dxUtils/language/language.ts +21 -0
- package/src/modules/dxUtils/list/list.ts +11 -0
- package/src/modules/dxUtils/lwc/lwc.ts +24 -0
- package/src/modules/dxUtils/normalizers/normalizers.ts +112 -0
- package/src/modules/{utils → dxUtils}/options/options.ts +13 -9
- package/src/modules/dxUtils/prismjs/prismjs.ts +4183 -0
- package/src/modules/dxUtils/queryCoordinator/queryCoordinator.ts +43 -0
- package/src/modules/dxUtils/recentSearches/recentSearches.ts +57 -0
- package/src/modules/dxUtils/sanitizeHtml/sanitizeHtml.ts +8 -0
- package/src/modules/dxUtils/urlWatcher/urlWatcher.ts +79 -0
- package/src/modules/dxUtils/withTypedRefs/withTypedRefs.ts +26 -0
- package/src/modules/{utils → dxUtils}/wordpress/wordpress.ts +14 -0
- package/LICENSE +0 -12
- package/src/assets/svg/card-news-learn-moar.svg +0 -415
- package/src/assets/svg/cloud-1.svg +0 -24
- package/src/assets/svg/cloud-2.svg +0 -18
- package/src/assets/svg/codey.svg +0 -93
- package/src/assets/svg/command.svg +0 -9
- package/src/assets/svg/control.svg +0 -10
- package/src/assets/svg/docs-empty-state-small.svg +0 -72
- package/src/assets/svg/docs-empty-state.svg +0 -86
- package/src/assets/svg/dsc-home-news-bear.svg +0 -3
- package/src/assets/svg/dsc-home-news-community.png +0 -0
- package/src/assets/svg/dsc-home-news-goatbear.svg +0 -257
- package/src/assets/svg/dsc-home-news-samplegallery.svg +0 -76
- package/src/assets/svg/empty-state-assistant.svg +0 -1
- package/src/assets/svg/fch-blog-cloud-1.png +0 -0
- package/src/assets/svg/fch-blog-cloud-2.png +0 -0
- package/src/assets/svg/fch-blog-planet.png +0 -0
- package/src/assets/svg/feature-backdrop1.svg +0 -10
- package/src/assets/svg/feature-backdrop2.svg +0 -10
- package/src/assets/svg/featured-demo-art-blank.svg +0 -76
- package/src/assets/svg/featured-demo-art-eBikes.svg +0 -77
- package/src/assets/svg/footer-graphic-large.svg +0 -207
- package/src/assets/svg/footer-graphic-mountains-small.svg +0 -17
- package/src/assets/svg/footer-graphic-mountains.svg +0 -21
- package/src/assets/svg/footer-graphic-trees-small.svg +0 -33
- package/src/assets/svg/footer-graphic-trees.svg +0 -62
- package/src/assets/svg/lake-mountain.svg +0 -79
- package/src/assets/svg/podcast-subscription-clouds-small.svg +0 -49
- package/src/assets/svg/podcast-subscription-clouds.svg +0 -57
- package/src/assets/svg/podcasts-subscription-apple.svg +0 -164
- package/src/assets/svg/podcasts-subscription-google.svg +0 -29
- package/src/assets/svg/podcasts-subscription-spotify.svg +0 -11
- package/src/assets/svg/salesforce-cloud.svg +0 -7
- package/src/assets/svg/salesforce-logo-corporate.svg +0 -21
- package/src/assets/svg/salesforce-logo.svg +0 -14
- package/src/assets/svg/trees.svg +0 -42
- package/src/modules/dx/banner/__tests__/banner.test.ts +0 -31
- package/src/modules/dx/brandThemeProvider/__tests__/brandThemeProvider.test.ts +0 -49
- package/src/modules/dx/brandThemeProvider/brandThemeProvider.stories.ts +0 -321
- package/src/modules/dx/breadcrumbs/__tests__/breadcrumbs.test.ts +0 -143
- package/src/modules/dx/breadcrumbs/__tests__/mockProps.ts +0 -28
- package/src/modules/dx/breadcrumbs/breadcrumbs.stories.ts +0 -39
- package/src/modules/dx/button/__tests__/button.test.ts +0 -107
- package/src/modules/dx/button/button.stories.ts +0 -150
- package/src/modules/dx/cardBlogPost/__tests__/cardBlogPost.test.ts +0 -27
- package/src/modules/dx/cardBlogPost/__tests__/mockProps.ts +0 -12
- package/src/modules/dx/cardBlogPost/cardBlogPost.stories.ts +0 -164
- package/src/modules/dx/cardBlogPostProvider/__tests__/cardBlogPostProvider.test.ts +0 -34
- package/src/modules/dx/cardBlogPostProvider/__tests__/mockWordpressPosts.ts +0 -44
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.css +0 -3
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.html +0 -16
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.ts +0 -29
- package/src/modules/dx/cardCallout/__tests__/cardCallout.test.ts +0 -23
- package/src/modules/dx/cardCallout/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/cardCallout/cardCallout.stories.ts +0 -33
- package/src/modules/dx/cardContent/__tests__/cardContent.test.ts +0 -112
- package/src/modules/dx/cardContent/__tests__/mockProps.ts +0 -13
- package/src/modules/dx/cardContent/cardContent.stories.ts +0 -127
- package/src/modules/dx/cardDemo/cardDemo.stories.ts +0 -115
- package/src/modules/dx/cardDocs/__tests__/cardDocs.test.ts +0 -48
- package/src/modules/dx/cardDocs/__tests__/mockProps.ts +0 -9
- package/src/modules/dx/cardDocs/cardDocs.stories.ts +0 -299
- package/src/modules/dx/cardEvent/__tests__/cardEvent.test.ts +0 -99
- package/src/modules/dx/cardEvent/__tests__/mockProps.ts +0 -10
- package/src/modules/dx/cardEvent/cardEvent.stories.ts +0 -152
- package/src/modules/dx/cardGrid/__tests__/cardMockProps.ts +0 -431
- package/src/modules/dx/cardGrid/__tests__/mockProps.ts +0 -15
- package/src/modules/dx/cardGrid/cardGrid.stories.ts +0 -111
- package/src/modules/dx/cardNews/__tests__/cardNews.test.ts +0 -59
- package/src/modules/dx/cardNews/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/cardNews/cardNews.stories.ts +0 -115
- package/src/modules/dx/cardPodcastEpisode/__tests__/cardPodcastEpisode.test.ts +0 -70
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.stories.ts +0 -31
- package/src/modules/dx/cardPodcastEpisodeProvider/__tests__/cardPodcastEpisodeProvider.test.ts +0 -36
- package/src/modules/dx/cardPodcastEpisodeProvider/__tests__/mockWordpressEpisodes.ts +0 -50
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.css +0 -3
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.html +0 -12
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.ts +0 -29
- package/src/modules/dx/cardSmall/__tests__/cardSmall.test.ts +0 -70
- package/src/modules/dx/cardSmall/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/cardSmall/cardSmall.stories.ts +0 -166
- package/src/modules/dx/cardTitle/__tests__/cardTitle.test.ts +0 -46
- package/src/modules/dx/cardTrailheadModule/__tests__/cardTrailheadModule.test.ts +0 -18
- package/src/modules/dx/cardTrailheadModule/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.stories.ts +0 -122
- package/src/modules/dx/cardVideoPreview/__tests__/cardVideoPreview.test.ts +0 -22
- package/src/modules/dx/cardVideoPreview/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.stories.ts +0 -147
- package/src/modules/dx/checkbox/__tests__/checkbox.test.ts +0 -86
- package/src/modules/dx/checkbox/__tests__/mockProps.ts +0 -5
- package/src/modules/dx/checkbox/checkbox.stories.ts +0 -38
- package/src/modules/dx/checkboxGroup/__tests__/checkboxGroup.test.ts +0 -80
- package/src/modules/dx/checkboxGroup/__tests__/mockProps.ts +0 -14
- package/src/modules/dx/checkboxGroup/checkboxGroup.stories.ts +0 -33
- package/src/modules/dx/codeBlock/__tests__/codeBlock.test.ts +0 -242
- package/src/modules/dx/codeBlock/__tests__/mockProps.ts +0 -160
- package/src/modules/dx/codeBlock/codeBlock.stories.ts +0 -143
- package/src/modules/dx/codeBlock/darkTheme.css +0 -88
- package/src/modules/dx/codeBlock/lightTheme.css +0 -72
- package/src/modules/dx/dropdown/__tests__/dropdown.test.ts +0 -172
- package/src/modules/dx/dropdown/__tests__/mockNestedOptions.ts +0 -96
- package/src/modules/dx/dropdown/__tests__/mockOptions.ts +0 -10
- package/src/modules/dx/dropdown/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/dropdown/dropdown.stories.ts +0 -89
- package/src/modules/dx/dropdownOption/__tests__/dropdownOption.test.ts +0 -112
- package/src/modules/dx/dropdownOption/__tests__/mockProps.ts +0 -20
- package/src/modules/dx/emptyState/__tests__/emptyState.test.ts +0 -52
- package/src/modules/dx/emptyState/__tests__/mockProps.ts +0 -4
- package/src/modules/dx/emptyState/emptyState.stories.ts +0 -45
- package/src/modules/dx/feature/__tests__/feature.test.ts +0 -50
- package/src/modules/dx/feature/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/featureGrid/__tests__/featureGrid.test.ts +0 -21
- package/src/modules/dx/featureGrid/featureGrid.stories.ts +0 -120
- package/src/modules/dx/featuredContentHeader/__tests__/featuredContentHeader.test.ts +0 -191
- package/src/modules/dx/featuredContentHeader/__tests__/mockProps.ts +0 -73
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.stories.ts +0 -153
- package/src/modules/dx/featuresList/__tests__/featuresList.test.ts +0 -47
- package/src/modules/dx/featuresList/__tests__/mockProps.ts +0 -17
- package/src/modules/dx/featuresList/featuresList.stories.ts +0 -30
- package/src/modules/dx/footer/__tests__/footer.test.ts +0 -147
- package/src/modules/dx/footer/__tests__/mockLocales.ts +0 -7
- package/src/modules/dx/footer/footer.stories.ts +0 -88
- package/src/modules/dx/footerOption/__tests__/footerOption.test.ts +0 -34
- package/src/modules/dx/footerOption/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/formattedDateTime/__tests__/formattedDateTime.test.ts +0 -25
- package/src/modules/dx/formattedDateTime/__tests__/mockProps.ts +0 -13
- package/src/modules/dx/formattedDateTime/formattedDateTime.stories.ts +0 -103
- package/src/modules/dx/grid/__tests__/grid.test.ts +0 -37
- package/src/modules/dx/grid/grid.stories.ts +0 -134
- package/src/modules/dx/groupBio/__tests__/groupBio.test.ts +0 -82
- package/src/modules/dx/groupBio/__tests__/mockProps.ts +0 -15
- package/src/modules/dx/groupBio/groupBio.css +0 -49
- package/src/modules/dx/groupBio/groupBio.html +0 -29
- package/src/modules/dx/groupBio/groupBio.stories.ts +0 -66
- package/src/modules/dx/groupBio/groupBio.ts +0 -41
- package/src/modules/dx/groupText/__tests__/groupText.test.ts +0 -73
- package/src/modules/dx/groupText/__tests__/mockProps.ts +0 -35
- package/src/modules/dx/groupText/groupText.stories.ts +0 -81
- package/src/modules/dx/headTags/headTags.html +0 -3
- package/src/modules/dx/headTags/headTags.ts +0 -39
- package/src/modules/dx/header/__benchmarks__/header.benchmark.js +0 -45
- package/src/modules/dx/header/__tests__/header.test.ts +0 -242
- package/src/modules/dx/header/__tests__/mockNavArchitects.ts +0 -169
- package/src/modules/dx/header/__tests__/mockNavDevelopers.ts +0 -419
- package/src/modules/dx/header/__tests__/mockNavs.ts +0 -115
- package/src/modules/dx/header/__tests__/mockProps.ts +0 -164
- package/src/modules/dx/header/header.css +0 -109
- package/src/modules/dx/header/header.html +0 -128
- package/src/modules/dx/header/header.stories.ts +0 -172
- package/src/modules/dx/header/header.ts +0 -27
- package/src/modules/dx/headerMobileNavMenu/__tests__/headerMobileNavMenu.test.ts +0 -123
- package/src/modules/dx/headerMobileNavMenuOption/__tests__/headerMobileNavMenuOption.test.ts +0 -38
- package/src/modules/dx/headerNav/__tests__/headerNav.test.ts +0 -49
- package/src/modules/dx/headerSearch/__tests__/headerSearch.test.ts +0 -198
- package/src/modules/dx/headerSearch/__tests__/mockData.ts +0 -11
- package/src/modules/dx/headerSearch/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/headerSearch/headerSearch.css +0 -62
- package/src/modules/dx/headerSearch/headerSearch.html +0 -65
- package/src/modules/dx/headerSearch/headerSearch.ts +0 -161
- package/src/modules/dx/helmet/__tests__/helmet.test.ts +0 -53
- package/src/modules/dx/helmet/helmet.stories.ts +0 -53
- package/src/modules/dx/hr/__tests__/hr.test.ts +0 -53
- package/src/modules/dx/hr/__tests__/mockProps.ts +0 -16
- package/src/modules/dx/hr/hr.stories.ts +0 -50
- package/src/modules/dx/icon/__tests__/icon.test.ts +0 -54
- package/src/modules/dx/icon/icon.stories.ts +0 -100
- package/src/modules/dx/iconBadge/__tests__/iconBadge.test.ts +0 -17
- package/src/modules/dx/iconBadge/iconBadge.stories.ts +0 -32
- package/src/modules/dx/imageAndLabel/__tests__/imageAndLabel.test.ts +0 -39
- package/src/modules/dx/imageAndLabel/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/imageAndLabel/imageAndLabel.stories.ts +0 -48
- package/src/modules/dx/input/__tests__/input.test.ts +0 -368
- package/src/modules/dx/input/input.stories.ts +0 -102
- package/src/modules/dx/instrumentation/__tests__/instrumentation.test.ts +0 -86
- package/src/modules/dx/instrumentation/instrumentation.ts +0 -116
- package/src/modules/dx/interactiveImage/__tests__/interactiveImage.test.ts +0 -86
- package/src/modules/dx/interactiveImage/__tests__/mockProps.ts +0 -39
- package/src/modules/dx/interactiveImage/interactiveImage.stories.ts +0 -31
- package/src/modules/dx/lazy/__tests__/lazy.test.ts +0 -43
- package/src/modules/dx/lazy/lazy.html +0 -5
- package/src/modules/dx/lazy/lazy.stories.ts +0 -132
- package/src/modules/dx/lazy/lazy.ts +0 -170
- package/src/modules/dx/newsletterForm/newsletterForm.css +0 -73
- package/src/modules/dx/newsletterForm/newsletterForm.html +0 -73
- package/src/modules/dx/newsletterForm/newsletterForm.ts +0 -229
- package/src/modules/dx/pagination/__tests__/pagination.test.ts +0 -121
- package/src/modules/dx/pagination/pagination.stories.ts +0 -88
- package/src/modules/dx/podcastHost/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/podcastHost/__tests__/podcastHost.test.ts +0 -21
- package/src/modules/dx/podcastHost/podcastHost.stories.ts +0 -17
- package/src/modules/dx/podcastPlayer/__tests__/podcastPlayer.test.ts +0 -20
- package/src/modules/dx/podcastPlayer/podcastPlayer.stories.ts +0 -13
- package/src/modules/dx/podcastSubscription/__tests__/podcastSubscription.test.ts +0 -16
- package/src/modules/dx/podcastSubscription/podcastSubscription.css +0 -92
- package/src/modules/dx/podcastSubscription/podcastSubscription.html +0 -24
- package/src/modules/dx/podcastSubscription/podcastSubscription.stories.ts +0 -23
- package/src/modules/dx/podcastSubscription/podcastSubscription.ts +0 -58
- package/src/modules/dx/popover/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/popover/__tests__/popover.test.ts +0 -321
- package/src/modules/dx/popover/popover.stories.ts +0 -82
- package/src/modules/dx/radioGroup/__tests__/mockProps.ts +0 -12
- package/src/modules/dx/radioGroup/__tests__/radioGroup.test.ts +0 -42
- package/src/modules/dx/radioGroup/radioGroup.stories.ts +0 -25
- package/src/modules/dx/relativeDateTime/__tests__/mockProps.ts +0 -55
- package/src/modules/dx/relativeDateTime/__tests__/relativeDateTime.test.ts +0 -52
- package/src/modules/dx/relativeDateTime/relativeDateTime.stories.ts +0 -83
- package/src/modules/dx/searchResults/searchResults.stories.ts +0 -36
- package/src/modules/dx/section/__tests__/section.test.ts +0 -17
- package/src/modules/dx/section/section.stories.ts +0 -381
- package/src/modules/dx/sectionSignup/__tests__/sectionSignup.test.ts +0 -66
- package/src/modules/dx/sectionSignup/sectionSignup.stories.ts +0 -49
- package/src/modules/dx/select/select.stories.ts +0 -59
- package/src/modules/dx/sidebar/__tests__/mockProps.ts +0 -181
- package/src/modules/dx/sidebar/__tests__/sidebar.test.ts +0 -609
- package/src/modules/dx/sidebar/sidebar.stories.ts +0 -139
- package/src/modules/dx/socials/__tests__/socials.test.ts +0 -124
- package/src/modules/dx/socials/socials.stories.ts +0 -24
- package/src/modules/dx/spinner/__tests__/spinner.test.ts +0 -37
- package/src/modules/dx/spinner/spinner.stories.ts +0 -69
- package/src/modules/dx/tab/__tests__/tab.test.ts +0 -129
- package/src/modules/dx/tab/tab.stories.ts +0 -57
- package/src/modules/dx/toc/__tests__/mockProps.ts +0 -22
- package/src/modules/dx/toc/__tests__/toc.test.ts +0 -115
- package/src/modules/dx/toc/toc.stories.ts +0 -26
- package/src/modules/dx/tooltip/__tests__/tooltip.test.ts +0 -23
- package/src/modules/dx/tooltip/tooltip.stories.ts +0 -46
- package/src/modules/dx/tree/__tests__/mockProps.ts +0 -215
- package/src/modules/dx/tree/__tests__/tree.test.ts +0 -357
- package/src/modules/dx/tree/__tests__/treeHandler.test.ts +0 -194
- package/src/modules/dx/tree/tree.stories.ts +0 -65
- package/src/modules/dx/treeItem/__tests__/mockProps.ts +0 -46
- package/src/modules/dx/treeItem/__tests__/treeItem.test.ts +0 -400
- package/src/modules/dx/treeTile/__tests__/mockProps.ts +0 -16
- package/src/modules/dx/treeTile/__tests__/treeTile.test.ts +0 -179
- package/src/modules/dx/typeBadge/__tests__/typeBadge.test.ts +0 -63
- package/src/modules/dx/typeBadge/typeBadge.stories.ts +0 -79
- package/src/modules/dx/typeBadgeGroup/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/typeBadgeGroup/__tests__/typeBadgeGroup.test.ts +0 -76
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.css +0 -12
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.html +0 -11
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.stories.ts +0 -19
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.ts +0 -18
- package/src/modules/helpers/button/button.css +0 -4
- package/src/modules/helpers/slds/slds.css +0 -191
- package/src/modules/tests/buttonTest/buttonTest.html +0 -3
- package/src/modules/tests/buttonTest/buttonTest.ts +0 -3
- package/src/modules/tests/codeBlockTest/codeBlockTest.js +0 -4
- package/src/modules/tests/featureGridTest/featureGridTest.html +0 -7
- package/src/modules/tests/featureGridTest/featureGridTest.ts +0 -5
- package/src/modules/tests/instrumentationTest/instrumentationTest.html +0 -4
- package/src/modules/tests/instrumentationTest/instrumentationTest.ts +0 -8
- package/src/modules/tests/popoverTest/popoverTest.html +0 -6
- package/src/modules/tests/popoverTest/popoverTest.ts +0 -5
- package/src/modules/utils/css/css.ts +0 -2
- package/src/modules/utils/jest/jest.ts +0 -23
- package/src/modules/utils/normalizers/normalizers.ts +0 -91
- package/src/modules/utils/prismjs/prismjs.ts +0 -3225
- package/src/modules/utils/storybook/storybook.ts +0 -33
- package/src/modules/utils/tests/tests.ts +0 -31
- package/src/modules/utils/wordpress/__tests__/wordpress.test.ts +0 -15
- /package/src/modules/dx/{instrumentation/instrumentation.html → darkModeManager/darkModeManager.html} +0 -0
- /package/src/modules/{utils → dxUtils}/devices/devices.ts +0 -0
- /package/src/modules/{utils → dxUtils}/prismjs/prismjs.html +0 -0
- /package/src/modules/{utils → dxUtils}/regexps/regexps.ts +0 -0
- /package/src/modules/{utils → dxUtils}/seo/seo.ts +0 -0
- /package/src/modules/{utils → dxUtils}/slot/slot.ts +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export const ampscript = {
|
|
2
|
+
pattern: /%%=\s*([\s\S]*?)\s*=%%|%%\[([\s\S]*?)\]%%/,
|
|
3
|
+
greedy: true,
|
|
4
|
+
inside: {
|
|
5
|
+
delimiter: {
|
|
6
|
+
pattern: /%%=|=%%|%%\[|\]%%/,
|
|
7
|
+
alias: "operator"
|
|
8
|
+
},
|
|
9
|
+
comment: {
|
|
10
|
+
pattern: /(\/\/.*|\/\*[\s\S]*?\*\/)/,
|
|
11
|
+
greedy: true
|
|
12
|
+
},
|
|
13
|
+
string: {
|
|
14
|
+
pattern: /(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,
|
|
15
|
+
greedy: true,
|
|
16
|
+
inside: {
|
|
17
|
+
escape: /\\./
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
function: {
|
|
21
|
+
pattern: /\b\w+\b(?=\()/i,
|
|
22
|
+
greedy: true
|
|
23
|
+
},
|
|
24
|
+
boolean: /\b(true|false|null)\b/i,
|
|
25
|
+
number: /\b(0(x|X)[0-9a-fA-F]+|([0-9]+(\.[0-9]+)?))\b/,
|
|
26
|
+
keyword:
|
|
27
|
+
/\b(do|else|elseif|for|if(?:\s+not)?|endif|next|then|to|downto|var|set)\b/i,
|
|
28
|
+
operator: /==|!=|>|<|>=|<=|=/,
|
|
29
|
+
variable: {
|
|
30
|
+
pattern: /@\w+|\[\w+\]/,
|
|
31
|
+
greedy: true
|
|
32
|
+
},
|
|
33
|
+
constant:
|
|
34
|
+
/\b(xtmonth|xtmonthnumeric|xtday|xtdayofweek|xtyear|xtshortdate|xtlongdate)\b/i,
|
|
35
|
+
logical: /\b(and|or|not)\b/i
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const sqlDocsTemplate = {
|
|
40
|
+
comment: /--.*/,
|
|
41
|
+
variable: [
|
|
42
|
+
/<[^>\s]+>/,
|
|
43
|
+
{ pattern: /(\s|\[|\[, ])\.\.\.(?=\]|\))/, lookbehind: true }
|
|
44
|
+
],
|
|
45
|
+
keyword: /\b[A-Z_]+\b/,
|
|
46
|
+
string: /'[^']*'/,
|
|
47
|
+
punctuation: /[;[\]{}]/
|
|
48
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/*
|
|
2
|
+
A11y syntax highlighting comes from this npm package (release 1.2.0):
|
|
3
|
+
https://github.com/ericwbailey/a11y-syntax-highlighting/releases
|
|
4
|
+
The colors used are from the files prism/a11y-light.css and prism/a11y-dark.css with
|
|
5
|
+
some minor modifications to work with our existing classes.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
.dx-theme-dark {
|
|
9
|
+
--prism-a11y-border-radius: 0.3em;
|
|
10
|
+
--prism-a11y-font-family: "consolas", "monaco", "Andale Mono", "Ubuntu Mono",
|
|
11
|
+
monospace;
|
|
12
|
+
--prism-a11y-line-height: 1.5;
|
|
13
|
+
--prism-a11y-code-block-margin: 0.5em 0;
|
|
14
|
+
--prism-a11y-code-block-padding: 1em;
|
|
15
|
+
--prism-a11y-code-inline-padding: 0.1em;
|
|
16
|
+
--prism-a11y-width-border: 1px;
|
|
17
|
+
--prism-a11y-width-tab: 2;
|
|
18
|
+
--prism-a11y-color-background: hsl(0deg 0% 17% / 100%);
|
|
19
|
+
--prism-a11y-color-text-no-token: hsl(60deg 30% 96% / 100%);
|
|
20
|
+
--prism-a11y-color-text-comment: hsl(54deg 32% 75% / 100%);
|
|
21
|
+
--prism-a11y-color-text-blue: hsl(180deg 100% 44% / 100%);
|
|
22
|
+
--prism-a11y-color-text-green: hsl(80deg 75% 55% / 100%);
|
|
23
|
+
--prism-a11y-color-text-gray: hsl(60deg 30% 96% / 100%);
|
|
24
|
+
--prism-a11y-color-text-purple: hsl(291deg 30% 83% / 100%);
|
|
25
|
+
--prism-a11y-color-text-red: hsl(17deg 100% 74% / 100%);
|
|
26
|
+
--prism-a11y-color-text-yellow: hsl(51deg 100% 50% / 100%);
|
|
27
|
+
--prism-a11y-plugin-color-border: hsl(51deg 100% 50% / 55%);
|
|
28
|
+
--prism-a11y-plugin-color-background: hsl(51deg 100% 50% / 10%);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.dx-theme-light {
|
|
32
|
+
--prism-a11y-border-radius: 0.3em;
|
|
33
|
+
--prism-a11y-font-family: "consolas", "monaco", "Andale Mono", "Ubuntu Mono",
|
|
34
|
+
monospace;
|
|
35
|
+
--prism-a11y-line-height: 1.5;
|
|
36
|
+
--prism-a11y-code-block-margin: 0.5em 0;
|
|
37
|
+
--prism-a11y-code-block-padding: 1em;
|
|
38
|
+
--prism-a11y-code-inline-padding: 0.1em;
|
|
39
|
+
--prism-a11y-width-border: 1px;
|
|
40
|
+
--prism-a11y-width-tab: 2;
|
|
41
|
+
--prism-a11y-color-background: hsl(0deg 0% 100% / 100%);
|
|
42
|
+
--prism-a11y-color-text-no-token: hsl(0deg 0% 33% / 100%);
|
|
43
|
+
--prism-a11y-color-text-comment: hsl(16deg 100% 25% / 100%);
|
|
44
|
+
--prism-a11y-color-text-blue: hsl(195deg 100% 30% / 100%);
|
|
45
|
+
--prism-a11y-color-text-green: hsl(120deg 100% 25% / 100%);
|
|
46
|
+
--prism-a11y-color-text-gray: hsl(0deg 0% 41% / 100%);
|
|
47
|
+
--prism-a11y-color-text-purple: hsl(282deg 100% 41% / 100%);
|
|
48
|
+
--prism-a11y-color-text-red: hsl(2deg 80% 47% / 100%);
|
|
49
|
+
--prism-a11y-color-text-yellow: hsl(43deg 74% 30% / 100%);
|
|
50
|
+
--prism-a11y-plugin-color-border: hsl(43deg 74% 30% / 55%);
|
|
51
|
+
--prism-a11y-plugin-color-background: hsl(43deg 74% 30% / 10%);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.dx-theme-dark pre[class*="language-"] {
|
|
55
|
+
background: var(--prism-a11y-color-background);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.dx-theme-light pre[class*="language-"] {
|
|
59
|
+
background: var(--prism-a11y-color-background);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:where(code[class*="language-"], pre[class*="language-"]) {
|
|
63
|
+
color: var(--prism-a11y-color-text-no-token);
|
|
64
|
+
background: var(--prism-a11y-color-background);
|
|
65
|
+
font-family: var(--prism-a11y-font-family);
|
|
66
|
+
text-align: start;
|
|
67
|
+
white-space: pre;
|
|
68
|
+
word-spacing: normal;
|
|
69
|
+
word-break: normal;
|
|
70
|
+
word-wrap: normal;
|
|
71
|
+
line-height: var(--prism-a11y-line-height);
|
|
72
|
+
tab-size: var(--prism-a11y-width-tab);
|
|
73
|
+
hyphens: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Code blocks */
|
|
77
|
+
pre[class*="language-"] {
|
|
78
|
+
padding: var(--prism-a11y-code-block-padding);
|
|
79
|
+
margin: var(--prism-a11y-code-block-margin);
|
|
80
|
+
overflow: auto;
|
|
81
|
+
border-radius: var(--prism-a11y-border-radius);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:where(:not(pre) > code[class*="language-"], pre[class*="language-"]) {
|
|
85
|
+
background: var(--prism-a11y-color-background);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* Inline code */
|
|
89
|
+
:not(pre) > code[class*="language-"] {
|
|
90
|
+
padding: var(--prism-a11y-code-inline-padding);
|
|
91
|
+
border-radius: var(--prism-a11y-border-radius);
|
|
92
|
+
white-space: normal;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:where(.token.comment, .token.prolog, .token.doctype, .token.cdata) {
|
|
96
|
+
color: var(--prism-a11y-color-text-comment);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.token.punctuation {
|
|
100
|
+
color: var(--prism-a11y-color-text-gray);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:where(
|
|
104
|
+
.token.property,
|
|
105
|
+
.token.tag,
|
|
106
|
+
.token.constant,
|
|
107
|
+
.token.symbol,
|
|
108
|
+
.token.deleted
|
|
109
|
+
) {
|
|
110
|
+
color: var(--prism-a11y-color-text-red);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:where(
|
|
114
|
+
.token.operator,
|
|
115
|
+
.token.entity,
|
|
116
|
+
.token.url,
|
|
117
|
+
.language-css .token.string,
|
|
118
|
+
.style .token.string,
|
|
119
|
+
.token.variable,
|
|
120
|
+
.token.keyword
|
|
121
|
+
) {
|
|
122
|
+
color: var(--prism-a11y-color-text-blue);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:where(
|
|
126
|
+
.token.selector,
|
|
127
|
+
.token.attr-name,
|
|
128
|
+
.token.string,
|
|
129
|
+
.token.char,
|
|
130
|
+
.token.builtin,
|
|
131
|
+
.token.inserted
|
|
132
|
+
) {
|
|
133
|
+
color: var(--prism-a11y-color-text-green);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:where(
|
|
137
|
+
.token.atrule,
|
|
138
|
+
.token.attr-value,
|
|
139
|
+
.token.function,
|
|
140
|
+
.token.regex,
|
|
141
|
+
.token.important
|
|
142
|
+
) {
|
|
143
|
+
color: var(--prism-a11y-color-text-yellow);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
:where(.token.boolean, .token.number, .token.keyword) {
|
|
147
|
+
color: var(--prism-a11y-color-text-purple);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
:where(.token.important, .token.bold) {
|
|
151
|
+
font-weight: bold;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.token.italic {
|
|
155
|
+
font-style: italic;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.token.entity {
|
|
159
|
+
cursor: help;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.line-highlight {
|
|
163
|
+
background: var(--prism-a11y-plugin-color-background);
|
|
164
|
+
border-top: var(--prism-a11y-width-border) solid
|
|
165
|
+
var(--prism-a11y-plugin-color-border);
|
|
166
|
+
border-bottom: var(--prism-a11y-width-border) solid
|
|
167
|
+
var(--prism-a11y-plugin-color-border);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.line-numbers .line-numbers-rows {
|
|
171
|
+
border-right: var(--prism-a11y-width-border) solid
|
|
172
|
+
var(--prism-a11y-color-text-no-token);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.line-numbers-rows > span::before {
|
|
176
|
+
color: var(--prism-a11y-color-text-comment);
|
|
177
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<dx-hr lwc:if={showRecommendations} spacing="2xl" text={label}></dx-hr>
|
|
3
|
+
|
|
4
|
+
<dx-section lwc:if={showRecommendations} class="section-reduced-padding">
|
|
5
|
+
<dx-spinner lwc:if={recommendationsLoading}>
|
|
6
|
+
<div class="spinner-container">
|
|
7
|
+
<dx-spinner size="large" variant="brand"></dx-spinner>
|
|
8
|
+
</div>
|
|
9
|
+
</dx-spinner>
|
|
10
|
+
<dx-grid columns="three" class="recent-posts">
|
|
11
|
+
<template for:each={recommendations} for:item="recommendation">
|
|
12
|
+
<dx-card-blog-post
|
|
13
|
+
authors={recommendation.authors}
|
|
14
|
+
body={recommendation.yoast_head_json.description}
|
|
15
|
+
datetime={recommendation.yoast_head_json.article_published_time}
|
|
16
|
+
href={recommendation.yoast_head_json.canonical}
|
|
17
|
+
img-alt={recommendation.yoast_head_json.title}
|
|
18
|
+
img-src={recommendation.featured_image}
|
|
19
|
+
key={recommendation.id}
|
|
20
|
+
header={recommendation.yoast_head_json.title}
|
|
21
|
+
origin="coveo"
|
|
22
|
+
click-event={recommendation.clickEvent}
|
|
23
|
+
></dx-card-blog-post>
|
|
24
|
+
</template>
|
|
25
|
+
</dx-grid>
|
|
26
|
+
</dx-section>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { LightningElement, api, track } from "lwc";
|
|
2
|
+
|
|
3
|
+
const SEARCH_HUB = "developerWebsiteBlogs";
|
|
4
|
+
|
|
5
|
+
interface Recommendation {
|
|
6
|
+
originalCoveoData: {
|
|
7
|
+
uri: string;
|
|
8
|
+
title: string;
|
|
9
|
+
searchUid: string;
|
|
10
|
+
raw: {
|
|
11
|
+
permanentId: string;
|
|
12
|
+
};
|
|
13
|
+
"@source": string;
|
|
14
|
+
};
|
|
15
|
+
clickEvent: () => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const language_to_locale_map = {
|
|
19
|
+
english: "en",
|
|
20
|
+
japanese: "ja"
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default class CoveoRecommendations extends LightningElement {
|
|
24
|
+
@api coveoAuthToken!: string;
|
|
25
|
+
@api coveoOrganizationId!: string;
|
|
26
|
+
@api label? = "Readers Also Viewed";
|
|
27
|
+
@api postAcf: string = "{}";
|
|
28
|
+
|
|
29
|
+
_recommendations = [] as Recommendation[];
|
|
30
|
+
|
|
31
|
+
private get recommendations(): any[] {
|
|
32
|
+
return this._recommendations || [];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@track showRecommendations = true;
|
|
36
|
+
@track recommendationsLoading = true;
|
|
37
|
+
|
|
38
|
+
getLocale() {
|
|
39
|
+
const acf = JSON.parse(this.postAcf);
|
|
40
|
+
return language_to_locale_map[
|
|
41
|
+
(acf?.language as keyof typeof language_to_locale_map) || "english"
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
connectedCallback() {
|
|
46
|
+
const actionsHistory = localStorage.getItem(
|
|
47
|
+
"__coveo.analytics.history"
|
|
48
|
+
);
|
|
49
|
+
const url = `https://${this.coveoOrganizationId}.org.coveo.com/rest/search`;
|
|
50
|
+
const searchStart = performance.now();
|
|
51
|
+
fetch(url, {
|
|
52
|
+
headers: {
|
|
53
|
+
Authorization: `Bearer ${this.coveoAuthToken}`,
|
|
54
|
+
"Content-Type": "application/json"
|
|
55
|
+
},
|
|
56
|
+
method: "POST",
|
|
57
|
+
body: JSON.stringify({
|
|
58
|
+
pipeline: "Recommendations_Developer_Blogs",
|
|
59
|
+
locale: this.getLocale(),
|
|
60
|
+
searchHub: SEARCH_HUB,
|
|
61
|
+
numberOfResults: 3,
|
|
62
|
+
actionsHistory: JSON.parse(actionsHistory!),
|
|
63
|
+
isGuestUser: true
|
|
64
|
+
})
|
|
65
|
+
}).then(
|
|
66
|
+
async (response) => {
|
|
67
|
+
try {
|
|
68
|
+
const json = await response.json();
|
|
69
|
+
const results = json.results;
|
|
70
|
+
|
|
71
|
+
this.logSearchAnalytics(
|
|
72
|
+
json.searchUid,
|
|
73
|
+
performance.now() - searchStart
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const blogDataLoadTasks = results
|
|
77
|
+
.slice(0, 3)
|
|
78
|
+
.map(async (rec: any, index: number) => {
|
|
79
|
+
const slug = rec.uri.split("/").pop();
|
|
80
|
+
const blogDataUrl = `https://developer.salesforce.com/blogs/wp-json/wp/v2/posts?slug=${slug}&state=publish&_embed=wp:featuredmedia`;
|
|
81
|
+
const wordPressData = (
|
|
82
|
+
await (await fetch(blogDataUrl)).json()
|
|
83
|
+
)[0];
|
|
84
|
+
wordPressData.originalCoveoData = rec;
|
|
85
|
+
wordPressData.originalCoveoData.searchUid =
|
|
86
|
+
json.searchUid;
|
|
87
|
+
wordPressData.clickEvent =
|
|
88
|
+
this.buildClickAnalyticsLogger(index);
|
|
89
|
+
return wordPressData;
|
|
90
|
+
});
|
|
91
|
+
this._recommendations = await Promise.all(
|
|
92
|
+
blogDataLoadTasks
|
|
93
|
+
);
|
|
94
|
+
if (this._recommendations.length !== 3) {
|
|
95
|
+
this.showRecommendations = false;
|
|
96
|
+
}
|
|
97
|
+
} catch (ex) {
|
|
98
|
+
this.showRecommendations = false;
|
|
99
|
+
} finally {
|
|
100
|
+
if (this.recommendations.length === 3) {
|
|
101
|
+
this.recommendationsLoading = false;
|
|
102
|
+
} else {
|
|
103
|
+
this.recommendationsLoading = false;
|
|
104
|
+
this.showRecommendations = false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
() => {
|
|
109
|
+
this.showRecommendations = false;
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
logSearchAnalytics = (uid: string, time: number) => {
|
|
115
|
+
const payload = {
|
|
116
|
+
anonymous: true,
|
|
117
|
+
language: this.getLocale(),
|
|
118
|
+
originLevel1: SEARCH_HUB,
|
|
119
|
+
originLevel2: SEARCH_HUB,
|
|
120
|
+
actionCause: "recommendationInterfaceLoad",
|
|
121
|
+
queryText: "", // This has to be included, but is empty, because recommendations use the 'search' endpoint with an empty query string
|
|
122
|
+
responseTime: time,
|
|
123
|
+
searchQueryUid: uid
|
|
124
|
+
};
|
|
125
|
+
fetch(
|
|
126
|
+
`https://${this.coveoOrganizationId}.analytics.org.coveo.com/rest/ua/v15/analytics/search`,
|
|
127
|
+
{
|
|
128
|
+
headers: {
|
|
129
|
+
Authorization: `Bearer ${this.coveoAuthToken}`,
|
|
130
|
+
"Content-Type": "application/json"
|
|
131
|
+
},
|
|
132
|
+
method: "POST",
|
|
133
|
+
body: JSON.stringify(payload)
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
buildClickAnalyticsLogger = (index: number) => () => {
|
|
139
|
+
const payload = {
|
|
140
|
+
anonymous: true,
|
|
141
|
+
documentPosition: index,
|
|
142
|
+
documentTitle: this._recommendations[index].originalCoveoData.title,
|
|
143
|
+
documentUrl: this._recommendations[index].originalCoveoData.uri,
|
|
144
|
+
language: this.getLocale(),
|
|
145
|
+
originLevel1: SEARCH_HUB,
|
|
146
|
+
originLevel2: SEARCH_HUB,
|
|
147
|
+
actionCause: "recommendationOpen",
|
|
148
|
+
queryText: "", // This has to be included, but is empty, because recommendations use the 'search' endpoint with an empty query string
|
|
149
|
+
searchQueryUid: this._recommendations[index].originalCoveoData.uri,
|
|
150
|
+
sourceName:
|
|
151
|
+
this._recommendations[index].originalCoveoData["@source"],
|
|
152
|
+
customData: {
|
|
153
|
+
contentIDKey: "permanentId",
|
|
154
|
+
contentIDValue:
|
|
155
|
+
this._recommendations[index].originalCoveoData.raw
|
|
156
|
+
.permanentId
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
fetch(
|
|
160
|
+
`https://${this.coveoOrganizationId}.analytics.org.coveo.com/rest/ua/v15/analytics/click`,
|
|
161
|
+
{
|
|
162
|
+
headers: {
|
|
163
|
+
Authorization: `Bearer ${this.coveoAuthToken}`,
|
|
164
|
+
"Content-Type": "application/json"
|
|
165
|
+
},
|
|
166
|
+
method: "POST",
|
|
167
|
+
body: JSON.stringify(payload)
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
};
|
|
171
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* eslint-disable @lwc/lwc/no-document-query */
|
|
2
|
+
import { LightningElement } from "lwc";
|
|
3
|
+
|
|
4
|
+
export const LOCAL_STORAGE_KEY = "dx-dark-mode-theme";
|
|
5
|
+
|
|
6
|
+
function setTheme(theme: string) {
|
|
7
|
+
const DWONavSelector = document.querySelector("hgf-c360contextnav");
|
|
8
|
+
|
|
9
|
+
document.body.setAttribute("class", theme);
|
|
10
|
+
DWONavSelector?.setAttribute("dark-mode", String(theme === "dark"));
|
|
11
|
+
localStorage.setItem(LOCAL_STORAGE_KEY, theme);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function isDarkMode() {
|
|
15
|
+
return document.body.getAttribute("class") === "dark";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function onDarkModeToggle() {
|
|
19
|
+
if (isDarkMode()) {
|
|
20
|
+
setTheme("light");
|
|
21
|
+
} else {
|
|
22
|
+
setTheme("dark");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare module globalThis {
|
|
27
|
+
let singletonDarkModeManagerRendered: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const DARK_MODE_THEMES = ["dark", "light"];
|
|
31
|
+
export const DARKMODE_TOGGLE_EVENT_NAME = "UPDATE_DARK_MODE";
|
|
32
|
+
|
|
33
|
+
export const isDarkModeEnabled = () => {
|
|
34
|
+
return process.env.DARK_MODE;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const dispatchDarkModeToggleEvent = () => {
|
|
38
|
+
window.dispatchEvent(new Event(DARKMODE_TOGGLE_EVENT_NAME));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const getLocalStorageDarkModeSetting = () => {
|
|
42
|
+
return localStorage.getItem(LOCAL_STORAGE_KEY);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const isBrowserDarkModeEnabled = () => {
|
|
46
|
+
return (
|
|
47
|
+
window.matchMedia &&
|
|
48
|
+
window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const setLocalStorageDarkModeSetting = (theme: string) => {
|
|
53
|
+
localStorage.setItem(LOCAL_STORAGE_KEY, theme);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default class DarkModeManager extends LightningElement {
|
|
57
|
+
renderedCallback(): void {
|
|
58
|
+
if (
|
|
59
|
+
isDarkModeEnabled() &&
|
|
60
|
+
!globalThis.singletonDarkModeManagerRendered
|
|
61
|
+
) {
|
|
62
|
+
const theme = getLocalStorageDarkModeSetting();
|
|
63
|
+
if (theme) {
|
|
64
|
+
if (DARK_MODE_THEMES.includes(theme)) {
|
|
65
|
+
setTheme(theme);
|
|
66
|
+
}
|
|
67
|
+
} else if (isBrowserDarkModeEnabled()) {
|
|
68
|
+
setTheme("dark");
|
|
69
|
+
}
|
|
70
|
+
window.addEventListener(
|
|
71
|
+
DARKMODE_TOGGLE_EVENT_NAME,
|
|
72
|
+
onDarkModeToggle
|
|
73
|
+
);
|
|
74
|
+
globalThis.singletonDarkModeManagerRendered = true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
disconnectedCallback(): void {
|
|
79
|
+
if (isDarkModeEnabled()) {
|
|
80
|
+
window.removeEventListener(
|
|
81
|
+
DARKMODE_TOGGLE_EVENT_NAME,
|
|
82
|
+
onDarkModeToggle
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import "
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
2
|
|
|
3
3
|
.menu-nested::part(content) {
|
|
4
4
|
padding-top: var(--dx-g-spacing-sm);
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
.menu_list {
|
|
9
9
|
display: flex;
|
|
10
|
-
flex-
|
|
11
|
-
flex-wrap: nowrap;
|
|
10
|
+
flex-flow: column nowrap;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
.menu-hidden::part(content) {
|
|
@@ -29,8 +28,7 @@
|
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
.menu-nested-2-col .menu_list {
|
|
32
|
-
flex-
|
|
33
|
-
flex-wrap: wrap;
|
|
31
|
+
flex-flow: row wrap;
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
.menu-nested-2-col .menu_option {
|
|
@@ -19,16 +19,20 @@
|
|
|
19
19
|
role={role}
|
|
20
20
|
slot="content"
|
|
21
21
|
>
|
|
22
|
-
<template for:each={options} for:item="option">
|
|
22
|
+
<template for:each={options} for:item="option" for:index="index">
|
|
23
23
|
<dx-dropdown-option
|
|
24
|
+
analytics-event={analyticsEvent}
|
|
25
|
+
analytics-payload={analyticsPayload}
|
|
24
26
|
active={option.active}
|
|
25
27
|
key-value={option.keyValue}
|
|
26
28
|
if:false={option.options}
|
|
27
29
|
key={option.id}
|
|
30
|
+
index-position={index}
|
|
28
31
|
onfocus={onOptionFocus}
|
|
29
32
|
onselect={onOptionClick}
|
|
30
33
|
option={option}
|
|
31
34
|
nav-item-label={navItemLabel}
|
|
35
|
+
variant={variant}
|
|
32
36
|
></dx-dropdown-option>
|
|
33
37
|
<div
|
|
34
38
|
key={option.id}
|
|
@@ -39,6 +43,8 @@
|
|
|
39
43
|
<span class="menu_heading">{option.label}</span>
|
|
40
44
|
<template for:each={option.options} for:item="suboption">
|
|
41
45
|
<dx-dropdown-option
|
|
46
|
+
analytics-event={analyticsEvent}
|
|
47
|
+
analytics-payload={analyticsPayload}
|
|
42
48
|
active={suboption.active}
|
|
43
49
|
key={suboption.id}
|
|
44
50
|
key-value={suboption.keyValue}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AnalyticsPayload,
|
|
3
|
+
OptionWithNested,
|
|
4
|
+
PopperPlacement,
|
|
5
|
+
DropdownVariant
|
|
6
|
+
} from "typings/custom";
|
|
2
7
|
import { LightningElement, api, track } from "lwc";
|
|
3
8
|
import cx from "classnames";
|
|
4
|
-
import { deepmapOptions } from "utils/options";
|
|
5
9
|
import get from "lodash.get";
|
|
6
|
-
import { toJson } from "
|
|
10
|
+
import { toJson } from "dxUtils/normalizers";
|
|
11
|
+
import { deepmapOptions } from "dxUtils/options";
|
|
7
12
|
|
|
8
|
-
interface DropdownOption extends
|
|
13
|
+
interface DropdownOption extends OptionWithNested {
|
|
9
14
|
// link that gets shown as a highlighted link at end of option group
|
|
10
15
|
calloutLink?: {
|
|
11
16
|
href: string;
|
|
@@ -14,11 +19,11 @@ interface DropdownOption extends Option {
|
|
|
14
19
|
};
|
|
15
20
|
}
|
|
16
21
|
|
|
22
|
+
// @ts-ignore Dark Magic (TM) we are adding a custom getter to the 'role' property and tsc doesn't like that
|
|
17
23
|
export default class Dropdown extends LightningElement {
|
|
18
24
|
@api value: string | null = null; // "active option" id
|
|
19
25
|
@api valuePath: string = "id"; // path to match for the active value (useful for url matching)
|
|
20
26
|
@api stayOpenAfterChange?: boolean = false;
|
|
21
|
-
|
|
22
27
|
// props forwarded to popover:
|
|
23
28
|
@api ariaLabel: string | null = null;
|
|
24
29
|
@api tempId: string | null = null;
|
|
@@ -31,6 +36,11 @@ export default class Dropdown extends LightningElement {
|
|
|
31
36
|
@api width?: string | null = null;
|
|
32
37
|
@api fullWidth?: boolean | null;
|
|
33
38
|
@api navItemLabel: string | null = null;
|
|
39
|
+
@api variant: DropdownVariant = "base";
|
|
40
|
+
|
|
41
|
+
// props forwarded to dropdown option
|
|
42
|
+
@api analyticsEvent?: string;
|
|
43
|
+
@api analyticsPayload?: AnalyticsPayload;
|
|
34
44
|
|
|
35
45
|
@api
|
|
36
46
|
get options() {
|
|
@@ -112,7 +122,7 @@ export default class Dropdown extends LightningElement {
|
|
|
112
122
|
this.dispatchEvent(new CustomEvent("change", { detail: e.detail }));
|
|
113
123
|
}
|
|
114
124
|
if (!this.stayOpenAfterChange && this.popoverEl) {
|
|
115
|
-
this.popoverEl.closePopover();
|
|
125
|
+
(this.popoverEl as any).closePopover();
|
|
116
126
|
}
|
|
117
127
|
}
|
|
118
128
|
|
|
@@ -163,9 +173,8 @@ export default class Dropdown extends LightningElement {
|
|
|
163
173
|
? this.findOptionElementIndex(this.value)
|
|
164
174
|
: 0;
|
|
165
175
|
|
|
166
|
-
const optionToFocus: any =
|
|
167
|
-
defaultIndex < 0 ? 0 : defaultIndex
|
|
168
|
-
];
|
|
176
|
+
const optionToFocus: any =
|
|
177
|
+
this.optionsElements[defaultIndex < 0 ? 0 : defaultIndex];
|
|
169
178
|
if (optionToFocus) {
|
|
170
179
|
optionToFocus.focus();
|
|
171
180
|
this._focusedValue = optionToFocus.option.id;
|