diff --git a/core/modules/tour/tour.libraries.yml b/core/modules/tour/tour.libraries.yml index 19c0d3a39ca3f488701421c6fdf1afe288b8d31c..52cbc50573d8f7acfd2ddfa07b0f502ea98834c8 100644 --- a/core/modules/tour/tour.libraries.yml +++ b/core/modules/tour/tour.libraries.yml @@ -16,17 +16,3 @@ tour-styling: css: component: css/tour.module.css: { media: screen } - -tour-claro-styling: - version: VERSION - css: - theme: - css/theme/claro-tour.theme.css: {} - -tour-stable9-styling: - version: VERSION - js: - js/theme/tour.js: {} - css: - theme: - css/theme/stable9-tour.module.css: {} diff --git a/core/modules/tour/tour.module b/core/modules/tour/tour.module index bd05f7311c7358b0b0e0b082552db836b98d5e30..da432ef9ed7f23d19b83e9507e817a3e33e42e66 100644 --- a/core/modules/tour/tour.module +++ b/core/modules/tour/tour.module @@ -115,23 +115,3 @@ function tour_tour_insert($entity) { function tour_tour_update($entity) { \Drupal::service('plugin.manager.tour.tip')->clearCachedDefinitions(); } - -/** - * Implements hook_library_info_alter(). - */ -function tour_library_info_alter(&$libraries, $extension) { - if ($extension === 'tour') { - $theme = \Drupal::service('theme.manager')->getActiveTheme()->getName(); - $base_theme = FALSE; - if ($theme && !\Drupal::service('theme_handler')->listInfo()[$theme]) { - $base_theme = \Drupal::service('theme_handler')->listInfo()[$theme]->base_theme; - } - if (in_array('claro', [$theme, $base_theme])) { - $libraries['tour']['dependencies'][] = 'tour/tour-claro-styling'; - } - elseif (in_array('stable9', [$theme, $base_theme])) { - $libraries['tour']['dependencies'][] = 'tour/tour-stable9-styling'; - } - } - -} diff --git a/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php b/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php index e31900a27efa1109ac2222787d76f330f7caf42a..5ba0c7bb4d8f3899bf1be22b1c1cb052c887f033 100644 --- a/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php +++ b/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php @@ -207,10 +207,7 @@ protected function getAllLibraries() { $extensions = $modules; $module_list = array_keys($modules); sort($module_list); - // Remove deprecated module Tour. - $module_list = array_diff($module_list, ['tour']); - $all_modules = array_diff($this->allModules, ['tour']); - $this->assertEquals($all_modules, $module_list, 'All core modules are installed.'); + $this->assertEquals($this->allModules, $module_list, 'All core modules are installed.'); $themes = $this->themeHandler->listInfo(); $extensions += $themes; @@ -219,8 +216,7 @@ protected function getAllLibraries() { $this->assertEquals($this->allThemes, $theme_list, 'All core themes are installed.'); $libraries['core'] = $this->libraryDiscovery->getLibrariesByExtension('core'); - // Remove deprecated module Tour. - unset($extensions['tour']); + foreach ($extensions as $extension_name => $extension) { $library_file = $extension->getPath() . '/' . $extension_name . '.libraries.yml'; if (is_file($this->root . '/' . $library_file)) { diff --git a/core/tests/Drupal/KernelTests/Core/Theme/Stable9LibraryOverrideTest.php b/core/tests/Drupal/KernelTests/Core/Theme/Stable9LibraryOverrideTest.php index 20bbe21c5bf37133e644fd24af48dca37ea7f8f4..39ccd4038d535dfbb63e5a73e572563e16142197 100644 --- a/core/tests/Drupal/KernelTests/Core/Theme/Stable9LibraryOverrideTest.php +++ b/core/tests/Drupal/KernelTests/Core/Theme/Stable9LibraryOverrideTest.php @@ -26,9 +26,6 @@ class Stable9LibraryOverrideTest extends StableLibraryOverrideTestBase { 'media/drupal.media-icon', 'options/drupal.options-icon', 'telephone/drupal.telephone-icon', - 'tour/tour-styling', - 'tour/tour-claro-styling', - 'tour/tour-stable9-styling', ]; /** diff --git a/core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTestBase.php b/core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTestBase.php index bfe0ecfafd34d13079089e7cd961d5e958e36447..6e80b20fbd52d03ece7219eaccfa1154c88fb50f 100644 --- a/core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTestBase.php +++ b/core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTestBase.php @@ -121,15 +121,10 @@ protected function getAllLibraries() { $modules = \Drupal::moduleHandler()->getModuleList(); $module_list = array_keys($modules); sort($module_list); - // Remove deprecated module Tour. - $module_list = array_diff($module_list, ['tour']); - $all_modules = array_diff($this->allModules, ['tour']); - $this->assertEquals($all_modules, $module_list, 'All core modules are installed.'); + $this->assertEquals($this->allModules, $module_list, 'All core modules are installed.'); $libraries['core'] = $this->libraryDiscovery->getLibrariesByExtension('core'); - // Remove deprecated module Tour. - unset($modules['tour']); foreach ($modules as $module_name => $module) { $library_file = $module->getPath() . '/' . $module_name . '.libraries.yml'; if (is_file($this->root . '/' . $library_file)) { diff --git a/core/themes/claro/claro.info.yml b/core/themes/claro/claro.info.yml index c47d4b86e51c2165c1fe674fc2484c66355dcb85..5b8fd2393527301e88f3799f7d23e99ff196a0a2 100644 --- a/core/themes/claro/claro.info.yml +++ b/core/themes/claro/claro.info.yml @@ -128,6 +128,8 @@ libraries-extend: - claro/system.admin core/drupal.autocomplete: - claro/autocomplete + tour/tour-styling: + - claro/tour-styling shortcut/drupal.shortcut: - claro/drupal.shortcut core/drupal.ajax: diff --git a/core/themes/claro/claro.libraries.yml b/core/themes/claro/claro.libraries.yml index bcc8788ebea28d90b8506cfe310f619806b4502b..3a16437d1ae7fc80c8ce8e12d226e4c46544e9bd 100644 --- a/core/themes/claro/claro.libraries.yml +++ b/core/themes/claro/claro.libraries.yml @@ -139,6 +139,12 @@ drupal.node.preview: theme: css/components/node-preview.css: {} +tour-styling: + version: VERSION + css: + theme: + css/theme/tour.theme.css: {} + media-form: version: VERSION css: diff --git a/core/modules/tour/css/theme/claro-tour.theme.css b/core/themes/claro/css/theme/tour.theme.css similarity index 100% rename from core/modules/tour/css/theme/claro-tour.theme.css rename to core/themes/claro/css/theme/tour.theme.css diff --git a/core/modules/tour/css/theme/claro-tour.theme.pcss.css b/core/themes/claro/css/theme/tour.theme.pcss.css similarity index 100% rename from core/modules/tour/css/theme/claro-tour.theme.pcss.css rename to core/themes/claro/css/theme/tour.theme.pcss.css diff --git a/core/themes/olivero/css/components/site-header.css b/core/themes/olivero/css/components/site-header.css index ecbdc1ea9cc7292cea3595a44eeae3a8e19b5e51..6dc7c5162ac392cb68ede3c6eb62f97b5eb85ded 100644 --- a/core/themes/olivero/css/components/site-header.css +++ b/core/themes/olivero/css/components/site-header.css @@ -14,7 +14,7 @@ position: relative; /** * Ensure mobile site header is always above other elements including - * contextual links. + * contextual links, and Tour. */ z-index: 101; } diff --git a/core/themes/olivero/css/components/site-header.pcss.css b/core/themes/olivero/css/components/site-header.pcss.css index ee68226463573eb62b2cbb0bdcb43fbe59244dde..1ab7251194de5f9bb7df75e029907c03187ea502 100644 --- a/core/themes/olivero/css/components/site-header.pcss.css +++ b/core/themes/olivero/css/components/site-header.pcss.css @@ -9,7 +9,7 @@ position: relative; /** * Ensure mobile site header is always above other elements including - * contextual links. + * contextual links, and Tour. */ z-index: 101; diff --git a/core/modules/tour/css/theme/stable9-tour.module.css b/core/themes/stable9/css/tour/tour.module.css similarity index 100% rename from core/modules/tour/css/theme/stable9-tour.module.css rename to core/themes/stable9/css/tour/tour.module.css diff --git a/core/modules/tour/js/theme/tour.js b/core/themes/stable9/js/tour.js similarity index 100% rename from core/modules/tour/js/theme/tour.js rename to core/themes/stable9/js/tour.js diff --git a/core/themes/stable9/stable9.info.yml b/core/themes/stable9/stable9.info.yml index 4c757b84feed42ce8d816a28bd2edfd5051c6c68..fd2dd2e022fbbdcc673da392b5d9275d7cbbf7d9 100644 --- a/core/themes/stable9/stable9.info.yml +++ b/core/themes/stable9/stable9.info.yml @@ -261,6 +261,11 @@ libraries-override: state: css/toolbar.menu.css: css/toolbar/toolbar.menu.css + tour/tour-styling: + css: + component: + css/tour.module.css: css/tour/tour.module.css + update/drupal.update.admin: css: theme: @@ -295,3 +300,7 @@ libraries-override: css: theme: css/field_ui_display_mode_table.css: css/field_ui/field_ui_display_mode_table.css + +libraries-extend: + tour/tour: + - stable9/tour diff --git a/core/themes/stable9/stable9.libraries.yml b/core/themes/stable9/stable9.libraries.yml index 98535a37153f73758a0f4408bab7616023701f8d..828fdd4aa16d91273f312cc90be2096c72d3dc45 100644 --- a/core/themes/stable9/stable9.libraries.yml +++ b/core/themes/stable9/stable9.libraries.yml @@ -8,3 +8,8 @@ normalize: css: base: css/core/assets/vendor/normalize-css/normalize.css: { weight: -20 } + +tour: + version: VERSION + js: + js/tour.js: {}