From f3b31f50b1b28c339ca1c24e204ebbcf315515c1 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Fri, 3 May 2024 13:20:50 +0100 Subject: [PATCH] Issue #3444932 by bnjmnm, lauriii, nod_: Make libraries with JS internal, at least for beta (cherry picked from commit e971d7feb18fd049b8b8276a13f2216699b1a8e6) --- .../navigation/navigation.libraries.yml | 30 ++++++++++++------- .../navigation/src/NavigationRenderer.php | 2 +- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/core/modules/navigation/navigation.libraries.yml b/core/modules/navigation/navigation.libraries.yml index 232f4856a8ac..c20ab9e71bfd 100644 --- a/core/modules/navigation/navigation.libraries.yml +++ b/core/modules/navigation/navigation.libraries.yml @@ -1,4 +1,6 @@ -navigation: +internal.navigation: + # Internal library. Do not depend on it outside core nor add core usage + # beyond the Navigation module. version: VERSION js: js/toolbar-menu.js: {} @@ -22,16 +24,18 @@ navigation: - core/tabbable - navigation/admin-reset-styles - navigation/body-scroll-lock - - navigation/dropdown - - navigation/tooltip - - navigation/popover + - navigation/internal.dropdown + - navigation/internal.tooltip + - navigation/internal.popover admin-reset-styles: css: base: css/base/admin-reset-styles.css: {} -navigation.escapeAdmin: +internal.navigation.escapeAdmin: + # Internal library. Do not depend on it outside core nor add core usage + # beyond the Navigation module. version: VERSION js: js/escapeAdmin.js: {} @@ -43,8 +47,8 @@ navigation.escapeAdmin: navigation.layout: dependencies: - - navigation/navigation - - navigation/navigation.escapeAdmin + - navigation/internal.navigation + - navigation/internal.navigation.escapeAdmin body-scroll-lock: version: VERSION @@ -52,7 +56,9 @@ body-scroll-lock: base: css/components/body-scroll-lock.css: {} -popover: +internal.popover: + # Internal library. Do not depend on it outside core nor add core usage + # beyond the Navigation module. js: js/toolbar-popover.js: {} css: @@ -61,7 +67,9 @@ popover: dependencies: - core/once -tooltip: +internal.tooltip: + # Internal library. Do not depend on it outside core nor add core usage + # beyond the Navigation module. js: js/tooltip.js: {} css: @@ -71,7 +79,9 @@ tooltip: - core/once - core/internal.floating-ui -dropdown: +internal.dropdown: + # Internal library. Do not depend on it outside core nor add core usage + # beyond the Navigation module. js: js/toolbar-dropdown.js: {} css: diff --git a/core/modules/navigation/src/NavigationRenderer.php b/core/modules/navigation/src/NavigationRenderer.php index 5f37f689a15b..6d4db6a6b4e0 100644 --- a/core/modules/navigation/src/NavigationRenderer.php +++ b/core/modules/navigation/src/NavigationRenderer.php @@ -178,7 +178,7 @@ public function buildTopBar(array &$page_top): void { '#theme' => 'top_bar', '#attached' => [ 'library' => [ - 'navigation/navigation', + 'navigation/internal.navigation', ], ], '#cache' => [ -- GitLab