import { htmlUserLanguageAttributes } from './utils'; import { placeholder } from './utils'; import { articleToolbarTemplate, ARTICLE_TOOLBAR_TEMPLATE_DATA_LEGACY } from './ArticleToolbar.stories.data'; import { userLinksTemplateLegacy } from './UserLinks.stories.data'; import { menuTemplate, legacyMenuTemplate } from './Menu.stories.data'; import { PERSONAL_MENU_TEMPLATE_DATA } from './UserLinks.stories.data'; import { vectorMenuTemplate, moreData, variantsData } from './MenuDropdown.stories.data'; import { searchBoxData, searchBoxTemplate, SEARCH_TEMPLATE_PARTIALS } from './SearchBox.stories.data'; import { SIDEBAR_DATA, SIDEBAR_TEMPLATE_PARTIALS, OPT_OUT_DATA, sidebarLegacyTemplate, sidebarTemplate } from './Sidebar.stories.data'; import { FOOTER_TEMPLATE_DATA, FOOTER_TEMPLATE_PARTIALS, footerTemplate } from './Footer.stories.data'; import { logoTemplate } from './Logo.stories.data'; export const NAVIGATION_TEMPLATE_DATA = { loggedInWithVariantsAndOptOut: Object.assign( {}, { 'data-portlets': Object.assign( {}, ARTICLE_TOOLBAR_TEMPLATE_DATA_LEGACY[ 'data-portlets' ], { 'data-personal': PERSONAL_MENU_TEMPLATE_DATA.loggedInWithEcho, 'data-variants': variantsData } ), 'data-search-box': searchBoxData, 'data-portlets-sidebar': SIDEBAR_DATA.withPortals, 'msg-navigation-heading': 'Navigation menu', 'html-logo-attributes': `class="mw-wiki-logo" href="/wiki/Main_Page" title="Visit the main page"` }, OPT_OUT_DATA ), loggedOutWithVariants: { 'data-portlets': Object.assign( {}, ARTICLE_TOOLBAR_TEMPLATE_DATA_LEGACY[ 'data-portlets' ], { 'data-personal': PERSONAL_MENU_TEMPLATE_DATA.loggedOut, 'data-variants': variantsData } ), 'data-search-box': searchBoxData, 'data-portlets-sidebar': SIDEBAR_DATA.withPortals, 'msg-navigation-heading': 'Navigation menu', 'html-logo-attributes': `class="mw-wiki-logo" href="/wiki/Main_Page" title="Visit the main page"` }, loggedInWithMoreActions: { 'data-portlets': Object.assign( {}, ARTICLE_TOOLBAR_TEMPLATE_DATA_LEGACY[ 'data-portlets' ], { 'data-personal': PERSONAL_MENU_TEMPLATE_DATA.loggedInWithEcho, 'data-actions': moreData } ), 'data-search-box': searchBoxData, 'data-portlets-sidebar': SIDEBAR_DATA.withPortals, 'msg-navigation-heading': 'Navigation menu', 'html-logo-attributes': `class="mw-wiki-logo" href="/wiki/Main_Page" title="Visit the main page"` } }; export const TEMPLATE_PARTIALS = Object.assign( {}, SIDEBAR_TEMPLATE_PARTIALS, { Logo: logoTemplate, ArticleToolbar: articleToolbarTemplate, SearchBox: searchBoxTemplate, LegacySidebar: sidebarLegacyTemplate, Sidebar: sidebarTemplate, LegacyMenu: legacyMenuTemplate, VectorMenu: vectorMenuTemplate, Menu: menuTemplate, LegacyUserLinks: userLinksTemplateLegacy, Footer: footerTemplate }, FOOTER_TEMPLATE_PARTIALS, SEARCH_TEMPLATE_PARTIALS ); /** * @type {Indicator[]} */ const DATA_INDICATORS = [ { id: 'mw-indicator-good-star', class: 'mw-indicator', html: ` ` }, { id: 'mw-indicator-pp-autoreview', class: 'mw-indicator', html: ` ` } ]; export const LEGACY_TEMPLATE_DATA = { 'html-title': 'Vector 2019', 'html-title-heading': '